Class: CardanoWallet::Shelley::Wallets
- Defined in:
- lib/cardano_wallet/shelley.rb
Overview
API for Wallets
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#create(params) ⇒ Object
Create a wallet based on the params.
-
#delete(wid) ⇒ Object
Delete wallet.
-
#get(wid) ⇒ Object
Get wallet details.
-
#list ⇒ Object
List all wallets.
-
#update_metadata(wid, params) ⇒ Object
Update wallet’s metadata.
-
#update_passphrase(wid, params) ⇒ Object
Update wallet’s passphrase.
-
#utxo(wid) ⇒ Object
See wallet’s utxo distribution.
- #utxo_snapshot(wid) ⇒ Object
Methods inherited from Base
#byron, #initialize, #misc, #shared, #shelley, #utils
Constructor Details
This class inherits a constructor from CardanoWallet::Base
Instance Method Details
#create(params) ⇒ Object
Create a wallet based on the params.
185 186 187 188 189 190 |
# File 'lib/cardano_wallet/shelley.rb', line 185 def create(params) Utils.verify_param_is_hash!(params) self.class.post('/wallets', body: params.to_json, headers: { 'Content-Type' => 'application/json' }) end |
#delete(wid) ⇒ Object
Delete wallet
194 195 196 |
# File 'lib/cardano_wallet/shelley.rb', line 194 def delete(wid) self.class.delete("/wallets/#{wid}") end |
#get(wid) ⇒ Object
Get wallet details
168 169 170 |
# File 'lib/cardano_wallet/shelley.rb', line 168 def get(wid) self.class.get("/wallets/#{wid}") end |
#list ⇒ Object
List all wallets
162 163 164 |
# File 'lib/cardano_wallet/shelley.rb', line 162 def list self.class.get('/wallets') end |
#update_metadata(wid, params) ⇒ Object
Update wallet’s metadata
203 204 205 206 207 208 |
# File 'lib/cardano_wallet/shelley.rb', line 203 def (wid, params) Utils.verify_param_is_hash!(params) self.class.put("/wallets/#{wid}", body: params.to_json, headers: { 'Content-Type' => 'application/json' }) end |
#update_passphrase(wid, params) ⇒ Object
Update wallet’s passphrase
227 228 229 230 231 232 |
# File 'lib/cardano_wallet/shelley.rb', line 227 def update_passphrase(wid, params) Utils.verify_param_is_hash!(params) self.class.put("/wallets/#{wid}/passphrase", body: params.to_json, headers: { 'Content-Type' => 'application/json' }) end |
#utxo(wid) ⇒ Object
See wallet’s utxo distribution
212 213 214 |
# File 'lib/cardano_wallet/shelley.rb', line 212 def utxo(wid) self.class.get("/wallets/#{wid}/statistics/utxos") end |
#utxo_snapshot(wid) ⇒ Object
217 218 219 |
# File 'lib/cardano_wallet/shelley.rb', line 217 def utxo_snapshot(wid) self.class.get("/wallets/#{wid}/utxo") end |