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.
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.
188 189 190 191 192 193 |
# File 'lib/cardano_wallet/shared.rb', line 188 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
197 198 199 |
# File 'lib/cardano_wallet/shared.rb', line 197 def delete(wid) self.class.delete("/shared-wallets/#{wid}") end |
#get(wid) ⇒ Object
Get wallet details
173 174 175 |
# File 'lib/cardano_wallet/shared.rb', line 173 def get(wid) self.class.get("/shared-wallets/#{wid}") end |
#list ⇒ Object
List all wallets
167 168 169 |
# File 'lib/cardano_wallet/shared.rb', line 167 def list self.class.get('/shared-wallets') end |
#update_delegation_script(wid, cosigner, acc_pub_key) ⇒ Object
Update delegation script
211 212 213 214 215 |
# File 'lib/cardano_wallet/shared.rb', line 211 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
203 204 205 206 207 |
# File 'lib/cardano_wallet/shared.rb', line 203 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 |