Class: CardanoWallet::Shared::Keys

Inherits:
Base
  • Object
show all
Defined in:
lib/cardano_wallet/shared.rb

Overview

API for Keys

Examples:

@cw = CardanoWallet.new
@cw.shared.keys # API for Shared Keys

See Also:

Instance Attribute Summary

Attributes inherited from Base

#opt

Instance Method Summary collapse

Methods inherited from Base

#byron, #initialize, #misc, #shared, #shelley, #utils

Constructor Details

This class inherits a constructor from CardanoWallet::Base

Instance Method Details

#create_acc_public_key(wid, index, payload) ⇒ Object



161
162
163
164
165
166
167
# File 'lib/cardano_wallet/shared.rb', line 161

def create_acc_public_key(wid, index, payload)
  # payload = { passphrase: pass, format: format }
  Utils.verify_param_is_hash!(payload)
  self.class.post("/shared-wallets/#{wid}/keys/#{index}",
                  body: payload.to_json,
                  headers: { 'Content-Type' => 'application/json' })
end

#get_acc_public_key(wid, query = {}) ⇒ Object



170
171
172
173
# File 'lib/cardano_wallet/shared.rb', line 170

def get_acc_public_key(wid, query = {})
  query_formatted = query.empty? ? '' : Utils.to_query(query)
  self.class.get("/shared-wallets/#{wid}/keys#{query_formatted}")
end

#get_public_key(wid, role, index, hash = {}) ⇒ Object



155
156
157
158
# File 'lib/cardano_wallet/shared.rb', line 155

def get_public_key(wid, role, index, hash = {})
  hash_query = hash.empty? ? '' : Utils.to_query(hash)
  self.class.get("/shared-wallets/#{wid}/keys/#{role}/#{index}#{hash_query}")
end