class CardanoWallet::Shared::Wallets

API for Wallets @see input-output-hk.github.io/cardano-wallet/api/edge/#tag/Shared-Wallets

Public Instance Methods

create(params) click to toggle source

Create a wallet based on the params. @see input-output-hk.github.io/cardano-wallet/api/edge/#operation/postSharedWallet

@example Create wallet from mnemonic sentence

create({name: "Wallet from mnemonic_sentence",
        passphrase: "Secure Passphrase",
        mnemonic_sentence: %w[story egg fun ... ],
        account_index: "1852H",
        payment_script_template: {...},
        ...
       })
# File lib/cardano_wallet/shared.rb, line 93
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) click to toggle source

Delete wallet @see input-output-hk.github.io/cardano-wallet/api/edge/#operation/deleteSharedWallet

# File lib/cardano_wallet/shared.rb, line 102
def delete(wid)
  self.class.delete("/shared-wallets/#{wid}")
end
get(wid) click to toggle source

Get wallet details @see input-output-hk.github.io/cardano-wallet/api/edge/#operation/getSharedWallet

# File lib/cardano_wallet/shared.rb, line 78
def get(wid)
  self.class.get("/shared-wallets/#{wid}")
end
list() click to toggle source

List all wallets @see input-output-hk.github.io/cardano-wallet/api/edge/#operation/listSharedWallets

# File lib/cardano_wallet/shared.rb, line 72
def list
  self.class.get('/shared-wallets')
end
update_delegation_script(wid, cosigner, acc_pub_key) click to toggle source

Update delegation script @see input-output-hk.github.io/cardano-wallet/api/edge/#operation/patchSharedWalletInDelegation

# File lib/cardano_wallet/shared.rb, line 116
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) click to toggle source

Update payment script @see input-output-hk.github.io/cardano-wallet/api/edge/#operation/patchSharedWalletInPayment

# File lib/cardano_wallet/shared.rb, line 108
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