class CardanoWallet::Byron::Addresses

Byron addresses @see input-output-hk.github.io/cardano-wallet/api/edge/#tag/Byron-Addresses

Public Instance Methods

bulk_import(wid, addresses) click to toggle source

Import addresses to Byron wallet. @see input-output-hk.github.io/cardano-wallet/api/edge/#operation/importAddresses @param wid [String] wallet id @param addresses [Array] array of addresses

# File lib/cardano_wallet/byron.rb, line 179
def bulk_import(wid, addresses)
  self.class.put("/byron-wallets/#{wid}/addresses",
                 body: { addresses: addresses }.to_json,
                 headers: { 'Content-Type' => 'application/json' })
end
create(wid, params) click to toggle source

Create address for Byron random wallet. @see input-output-hk.github.io/cardano-wallet/api/edge/#operation/createAddress @param wid [String] wallet id @param params [Hash] passphrase and (optional) address_index

@example Create address with index.

create(wid, {passphrase: "Secure Passphrase", address_index: 2147483648})

@example Create address with random index.

create(wid, {passphrase: "Secure Passphrase"})
# File lib/cardano_wallet/byron.rb, line 160
def create(wid, params)
  Utils.verify_param_is_hash!(params)
  self.class.post("/byron-wallets/#{wid}/addresses",
                  body: params.to_json,
                  headers: { 'Content-Type' => 'application/json' })
end
import(wid, addr_id) click to toggle source

Import address to Byron wallet. @see input-output-hk.github.io/cardano-wallet/api/edge/#operation/importAddress @param wid [String] wallet id @param addr_id [String] address id

# File lib/cardano_wallet/byron.rb, line 171
def import(wid, addr_id)
  self.class.put("/byron-wallets/#{wid}/addresses/#{addr_id}")
end
list(wid, query = {}) click to toggle source

List Byron addresses. @see input-output-hk.github.io/cardano-wallet/api/edge/#operation/listByronAddresses

@example

list(wid, {state: "used"})
# File lib/cardano_wallet/byron.rb, line 146
def list(wid, query = {})
  query_formatted = query.empty? ? '' : Utils.to_query(query)
  self.class.get("/byron-wallets/#{wid}/addresses#{query_formatted}")
end