Class: CardanoWallet::Shared::Wallets
- Defined in:
- lib/cardano_wallet/shared.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_delegation_script(wid, cosigner, acc_pub_key) ⇒ Object
Update delegation script.
-
#update_payment_script(wid, cosigner, acc_pub_key) ⇒ Object
Update payment script.
- #utxo(wid) ⇒ Object
- #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.
205 206 207 208 209 210 |
# File 'lib/cardano_wallet/shared.rb', line 205 def create(params) Utils.verify_param_is_hash!(params) self.class.post('/shared-wallets', body: params.to_json, headers: { 'Content-Type' => 'application/json' }) end |
#delete(wid) ⇒ Object
Delete wallet
214 215 216 |
# File 'lib/cardano_wallet/shared.rb', line 214 def delete(wid) self.class.delete("/shared-wallets/#{wid}") end |
#get(wid) ⇒ Object
Get wallet details
190 191 192 |
# File 'lib/cardano_wallet/shared.rb', line 190 def get(wid) self.class.get("/shared-wallets/#{wid}") end |
#list ⇒ Object
List all wallets
184 185 186 |
# File 'lib/cardano_wallet/shared.rb', line 184 def list self.class.get('/shared-wallets') end |
#update_delegation_script(wid, cosigner, acc_pub_key) ⇒ Object
Update delegation script
228 229 230 231 232 |
# File 'lib/cardano_wallet/shared.rb', line 228 def update_delegation_script(wid, cosigner, acc_pub_key) self.class.patch("/shared-wallets/#{wid}/delegation-script-template", body: { cosigner => acc_pub_key }.to_json, headers: { 'Content-Type' => 'application/json' }) end |
#update_payment_script(wid, cosigner, acc_pub_key) ⇒ Object
Update payment script
220 221 222 223 224 |
# File 'lib/cardano_wallet/shared.rb', line 220 def update_payment_script(wid, cosigner, acc_pub_key) self.class.patch("/shared-wallets/#{wid}/payment-script-template", body: { cosigner => acc_pub_key }.to_json, headers: { 'Content-Type' => 'application/json' }) end |
#utxo(wid) ⇒ Object
235 236 237 |
# File 'lib/cardano_wallet/shared.rb', line 235 def utxo(wid) self.class.get("/shared-wallets/#{wid}/statistics/utxos") end |
#utxo_snapshot(wid) ⇒ Object
240 241 242 |
# File 'lib/cardano_wallet/shared.rb', line 240 def utxo_snapshot(wid) self.class.get("/shared-wallets/#{wid}/utxo") end |