Class: CardanoWallet::Misc::Utils
- Inherits:
-
Base
- Object
- Base
- CardanoWallet::Misc::Utils
show all
- Defined in:
- lib/cardano_wallet/misc.rb
Overview
Instance Attribute Summary
Attributes inherited from Base
#opt
Instance Method Summary
collapse
Methods inherited from Base
#byron, #initialize, #misc, #shared, #shelley, #utils
Instance Method Details
#addresses(address_id) ⇒ Object
121
122
123
|
# File 'lib/cardano_wallet/misc.rb', line 121
def addresses(address_id)
self.class.get("/addresses/#{address_id}")
end
|
#get_public_key(wid, role, index) ⇒ Object
116
117
118
|
# File 'lib/cardano_wallet/misc.rb', line 116
def get_public_key(wid, role, index)
self.class.get("/wallets/#{wid}/keys/#{role}/#{index}")
end
|
#post_address(payload) ⇒ Object
126
127
128
129
130
131
132
|
# File 'lib/cardano_wallet/misc.rb', line 126
def post_address(payload)
CardanoWallet::Utils.verify_param_is_hash!(payload)
self.class.post('/addresses',
body: payload.to_json,
headers: { 'Content-Type' => 'application/json',
'Accept' => 'application/json' })
end
|
106
107
108
109
110
111
112
113
|
# File 'lib/cardano_wallet/misc.rb', line 106
def sign_metadata(wid, role, index, pass, metadata)
payload = { passphrase: pass }
payload[:metadata] = metadata if metadata
self.class.post("/wallets/#{wid}/signatures/#{role}/#{index}",
body: payload.to_json,
headers: { 'Content-Type' => 'application/json' })
end
|
#smash_health(query = {}) ⇒ Object
139
140
141
142
|
# File 'lib/cardano_wallet/misc.rb', line 139
def smash_health(query = {})
query_formatted = query.empty? ? '' : CardanoWallet::Utils.to_query(query)
self.class.get("/smash/health#{query_formatted}")
end
|