class CryptoApis::UTXOBasedApi

Attributes

api_client[RW]

Public Class Methods

new(api_client = ApiClient.default) click to toggle source
# File lib/crypto_apis/api/utxo_based_api.rb, line 19
def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Public Instance Methods

get_hd_wallet__x_pub_y_pub_z_pub_details(blockchain, extended_public_key, network, opts = {}) click to toggle source

Get HD Wallet (xPub, yPub, zPub) Details HD wallet details is useful endpoint to get the most important data about HD wallet without the need to do a lot of calculations, once the HD Wallet is synced using Sync endpoint we keep it up to date and we calculate these details in advance. @param blockchain [String] Represents the specific blockchain protocol name, e.g. Ethereum, Bitcoin, etc. @param extended_public_key [String] Defines the account extended publicly known key which is used to derive all child public keys. @param network [String] Represents the name of the blockchain network used; blockchain networks are usually identical as technology and software, but they differ in data, e.g. - "mainnet" is the live network with actual data while networks like "testnet", "ropsten", "rinkeby" are test networks. @param [Hash] opts the optional parameters @option opts [String] :context In batch situations the user can use the context to correlate responses with requests. This property is present regardless of whether the response was successful or returned as an error. `context` is specified by the user. @option opts [String] :derivation The way how the HD walled derives, for example when the type is ACCOUNT, it derives change and receive addresses while when the type is BIP32 it derives directly. @return [GetHDWalletXPubYPubZPubDetailsR]

# File lib/crypto_apis/api/utxo_based_api.rb, line 31
def get_hd_wallet__x_pub_y_pub_z_pub_details(blockchain, extended_public_key, network, opts = {})
  data, _status_code, _headers = get_hd_wallet__x_pub_y_pub_z_pub_details_with_http_info(blockchain, extended_public_key, network, opts)
  data
end
get_hd_wallet__x_pub_y_pub_z_pub_details_with_http_info(blockchain, extended_public_key, network, opts = {}) click to toggle source

Get HD Wallet (xPub, yPub, zPub) Details HD wallet details is useful endpoint to get the most important data about HD wallet without the need to do a lot of calculations, once the HD Wallet is synced using Sync endpoint we keep it up to date and we calculate these details in advance. @param blockchain [String] Represents the specific blockchain protocol name, e.g. Ethereum, Bitcoin, etc. @param extended_public_key [String] Defines the account extended publicly known key which is used to derive all child public keys. @param network [String] Represents the name of the blockchain network used; blockchain networks are usually identical as technology and software, but they differ in data, e.g. - "mainnet&quot; is the live network with actual data while networks like "testnet&quot;, "ropsten&quot;, "rinkeby&quot; are test networks. @param [Hash] opts the optional parameters @option opts [String] :context In batch situations the user can use the context to correlate responses with requests. This property is present regardless of whether the response was successful or returned as an error. &#x60;context&#x60; is specified by the user. @option opts [String] :derivation The way how the HD walled derives, for example when the type is ACCOUNT, it derives change and receive addresses while when the type is BIP32 it derives directly. @return [Array<(GetHDWalletXPubYPubZPubDetailsR, Integer, Hash)>] GetHDWalletXPubYPubZPubDetailsR data, response status code and response headers

# File lib/crypto_apis/api/utxo_based_api.rb, line 45
def get_hd_wallet__x_pub_y_pub_z_pub_details_with_http_info(blockchain, extended_public_key, network, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UTXOBasedApi.get_hd_wallet__x_pub_y_pub_z_pub_details ...'
  end
  # verify the required parameter 'blockchain' is set
  if @api_client.config.client_side_validation && blockchain.nil?
    fail ArgumentError, "Missing the required parameter 'blockchain' when calling UTXOBasedApi.get_hd_wallet__x_pub_y_pub_z_pub_details"
  end
  # verify enum value
  allowable_values = ["bitcoin", "bitcoin-cash", "litecoin", "dogecoin", "dash", "ethereum"]
  if @api_client.config.client_side_validation && !allowable_values.include?(blockchain)
    fail ArgumentError, "invalid value for \"blockchain\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'extended_public_key' is set
  if @api_client.config.client_side_validation && extended_public_key.nil?
    fail ArgumentError, "Missing the required parameter 'extended_public_key' when calling UTXOBasedApi.get_hd_wallet__x_pub_y_pub_z_pub_details"
  end
  # verify the required parameter 'network' is set
  if @api_client.config.client_side_validation && network.nil?
    fail ArgumentError, "Missing the required parameter 'network' when calling UTXOBasedApi.get_hd_wallet__x_pub_y_pub_z_pub_details"
  end
  # verify enum value
  allowable_values = ["mainnet", "testnet", "ropsten", "rinkeby"]
  if @api_client.config.client_side_validation && !allowable_values.include?(network)
    fail ArgumentError, "invalid value for \"network\", must be one of #{allowable_values}"
  end
  allowable_values = ["account", "bip32"]
  if @api_client.config.client_side_validation && opts[:'derivation'] && !allowable_values.include?(opts[:'derivation'])
    fail ArgumentError, "invalid value for \"derivation\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/blockchain-data/{blockchain}/{network}/hd/{extendedPublicKey}/details'.sub('{' + 'blockchain' + '}', CGI.escape(blockchain.to_s)).sub('{' + 'extendedPublicKey' + '}', CGI.escape(extended_public_key.to_s)).sub('{' + 'network' + '}', CGI.escape(network.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'context'] = opts[:'context'] if !opts[:'context'].nil?
  query_params[:'derivation'] = opts[:'derivation'] if !opts[:'derivation'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'GetHDWalletXPubYPubZPubDetailsR'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKey']

  new_options = opts.merge(
    :operation => :"UTXOBasedApi.get_hd_wallet__x_pub_y_pub_z_pub_details",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UTXOBasedApi#get_hd_wallet__x_pub_y_pub_z_pub_details\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
list_hd_wallet__x_pub_y_pub_z_pub_transactions(blockchain, extended_public_key, network, opts = {}) click to toggle source

List HD Wallet (xPub, yPub, zPub) Transactions This endpoint will list HD Wallet transactions. @param blockchain [String] Represents the specific blockchain. @param extended_public_key [String] Defines the master public key (xPub) of the account. @param network [String] Represents the specific network. @param [Hash] opts the optional parameters @option opts [String] :context In batch situations the user can use the context to correlate responses with requests. This property is present regardless of whether the response was successful or returned as an error. &#x60;context&#x60; is specified by the user. @option opts [String] :derivation The way how the HD walled derives, for example when the type is ACCOUNT, it derives change and receive addresses while when the type is BIP32 it derives directly. @option opts [Integer] :limit Defines how many items should be returned in the response per page basis. (default to 50) @option opts [Integer] :offset The starting index of the response items, i.e. where the response should start listing the returned items. (default to 0) @return [ListHDWalletXPubYPubZPubTransactionsR]

# File lib/crypto_apis/api/utxo_based_api.rb, line 128
def list_hd_wallet__x_pub_y_pub_z_pub_transactions(blockchain, extended_public_key, network, opts = {})
  data, _status_code, _headers = list_hd_wallet__x_pub_y_pub_z_pub_transactions_with_http_info(blockchain, extended_public_key, network, opts)
  data
end
list_hd_wallet__x_pub_y_pub_z_pub_transactions_with_http_info(blockchain, extended_public_key, network, opts = {}) click to toggle source

List HD Wallet (xPub, yPub, zPub) Transactions This endpoint will list HD Wallet transactions. @param blockchain [String] Represents the specific blockchain. @param extended_public_key [String] Defines the master public key (xPub) of the account. @param network [String] Represents the specific network. @param [Hash] opts the optional parameters @option opts [String] :context In batch situations the user can use the context to correlate responses with requests. This property is present regardless of whether the response was successful or returned as an error. &#x60;context&#x60; is specified by the user. @option opts [String] :derivation The way how the HD walled derives, for example when the type is ACCOUNT, it derives change and receive addresses while when the type is BIP32 it derives directly. @option opts [Integer] :limit Defines how many items should be returned in the response per page basis. @option opts [Integer] :offset The starting index of the response items, i.e. where the response should start listing the returned items. @return [Array<(ListHDWalletXPubYPubZPubTransactionsR, Integer, Hash)>] ListHDWalletXPubYPubZPubTransactionsR data, response status code and response headers

# File lib/crypto_apis/api/utxo_based_api.rb, line 144
def list_hd_wallet__x_pub_y_pub_z_pub_transactions_with_http_info(blockchain, extended_public_key, network, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UTXOBasedApi.list_hd_wallet__x_pub_y_pub_z_pub_transactions ...'
  end
  # verify the required parameter 'blockchain' is set
  if @api_client.config.client_side_validation && blockchain.nil?
    fail ArgumentError, "Missing the required parameter 'blockchain' when calling UTXOBasedApi.list_hd_wallet__x_pub_y_pub_z_pub_transactions"
  end
  # verify enum value
  allowable_values = ["bitcoin", "bitcoin-cash", "litecoin", "dogecoin", "dash", "ethereum"]
  if @api_client.config.client_side_validation && !allowable_values.include?(blockchain)
    fail ArgumentError, "invalid value for \"blockchain\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'extended_public_key' is set
  if @api_client.config.client_side_validation && extended_public_key.nil?
    fail ArgumentError, "Missing the required parameter 'extended_public_key' when calling UTXOBasedApi.list_hd_wallet__x_pub_y_pub_z_pub_transactions"
  end
  # verify the required parameter 'network' is set
  if @api_client.config.client_side_validation && network.nil?
    fail ArgumentError, "Missing the required parameter 'network' when calling UTXOBasedApi.list_hd_wallet__x_pub_y_pub_z_pub_transactions"
  end
  # verify enum value
  allowable_values = ["mainnet", "testnet", "ropsten", "rinkeby"]
  if @api_client.config.client_side_validation && !allowable_values.include?(network)
    fail ArgumentError, "invalid value for \"network\", must be one of #{allowable_values}"
  end
  allowable_values = ["account", "bip32"]
  if @api_client.config.client_side_validation && opts[:'derivation'] && !allowable_values.include?(opts[:'derivation'])
    fail ArgumentError, "invalid value for \"derivation\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/blockchain-data/{blockchain}/{network}/hd/{extendedPublicKey}/transactions'.sub('{' + 'blockchain' + '}', CGI.escape(blockchain.to_s)).sub('{' + 'extendedPublicKey' + '}', CGI.escape(extended_public_key.to_s)).sub('{' + 'network' + '}', CGI.escape(network.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'context'] = opts[:'context'] if !opts[:'context'].nil?
  query_params[:'derivation'] = opts[:'derivation'] if !opts[:'derivation'].nil?
  query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
  query_params[:'offset'] = opts[:'offset'] if !opts[:'offset'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

  # return_type
  return_type = opts[:debug_return_type] || 'ListHDWalletXPubYPubZPubTransactionsR'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKey']

  new_options = opts.merge(
    :operation => :"UTXOBasedApi.list_hd_wallet__x_pub_y_pub_z_pub_transactions",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UTXOBasedApi#list_hd_wallet__x_pub_y_pub_z_pub_transactions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
sync_hd_wallet__x_pub_y_pub_z_pub(blockchain, network, opts = {}) click to toggle source

Sync HD Wallet (xPub, yPub, zPub) HD wallets usually have a lot of addresses and transactions, getting the data on demand is a heavy operation. That's why we have created this feature, to be able to get HD wallet details or transactions this HD wallet must be synced first. In addition to the initial sync we keep updating the synced HD wallets all the time. @param blockchain [String] Represents the specific blockchain protocol name, e.g. Ethereum, Bitcoin, etc. @param network [String] Represents the name of the blockchain network used; blockchain networks are usually identical as technology and software, but they differ in data, e.g. - "mainnet&quot; is the live network with actual data while networks like "testnet&quot;, "ropsten&quot;, "rinkeby&quot; are test networks. @param [Hash] opts the optional parameters @option opts [String] :context In batch situations the user can use the context to correlate responses with requests. This property is present regardless of whether the response was successful or returned as an error. &#x60;context&#x60; is specified by the user. @option opts [SyncHDWalletXPubYPubZPubRB] :sync_hd_wallet_x_pub_y_pub_z_pub_rb @return [SyncHDWalletXPubYPubZPubR]

# File lib/crypto_apis/api/utxo_based_api.rb, line 226
def sync_hd_wallet__x_pub_y_pub_z_pub(blockchain, network, opts = {})
  data, _status_code, _headers = sync_hd_wallet__x_pub_y_pub_z_pub_with_http_info(blockchain, network, opts)
  data
end
sync_hd_wallet__x_pub_y_pub_z_pub_with_http_info(blockchain, network, opts = {}) click to toggle source

Sync HD Wallet (xPub, yPub, zPub) HD wallets usually have a lot of addresses and transactions, getting the data on demand is a heavy operation. That&#39;s why we have created this feature, to be able to get HD wallet details or transactions this HD wallet must be synced first. In addition to the initial sync we keep updating the synced HD wallets all the time. @param blockchain [String] Represents the specific blockchain protocol name, e.g. Ethereum, Bitcoin, etc. @param network [String] Represents the name of the blockchain network used; blockchain networks are usually identical as technology and software, but they differ in data, e.g. - "mainnet&quot; is the live network with actual data while networks like "testnet&quot;, "ropsten&quot;, "rinkeby&quot; are test networks. @param [Hash] opts the optional parameters @option opts [String] :context In batch situations the user can use the context to correlate responses with requests. This property is present regardless of whether the response was successful or returned as an error. &#x60;context&#x60; is specified by the user. @option opts [SyncHDWalletXPubYPubZPubRB] :sync_hd_wallet_x_pub_y_pub_z_pub_rb @return [Array<(SyncHDWalletXPubYPubZPubR, Integer, Hash)>] SyncHDWalletXPubYPubZPubR data, response status code and response headers

# File lib/crypto_apis/api/utxo_based_api.rb, line 239
def sync_hd_wallet__x_pub_y_pub_z_pub_with_http_info(blockchain, network, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: UTXOBasedApi.sync_hd_wallet__x_pub_y_pub_z_pub ...'
  end
  # verify the required parameter 'blockchain' is set
  if @api_client.config.client_side_validation && blockchain.nil?
    fail ArgumentError, "Missing the required parameter 'blockchain' when calling UTXOBasedApi.sync_hd_wallet__x_pub_y_pub_z_pub"
  end
  # verify enum value
  allowable_values = ["bitcoin", "bitcoin-cash", "litecoin", "dogecoin", "dash"]
  if @api_client.config.client_side_validation && !allowable_values.include?(blockchain)
    fail ArgumentError, "invalid value for \"blockchain\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'network' is set
  if @api_client.config.client_side_validation && network.nil?
    fail ArgumentError, "Missing the required parameter 'network' when calling UTXOBasedApi.sync_hd_wallet__x_pub_y_pub_z_pub"
  end
  # verify enum value
  allowable_values = ["mainnet", "testnet"]
  if @api_client.config.client_side_validation && !allowable_values.include?(network)
    fail ArgumentError, "invalid value for \"network\", must be one of #{allowable_values}"
  end
  # resource path
  local_var_path = '/blockchain-data/{blockchain}/{network}/hd/sync'.sub('{' + 'blockchain' + '}', CGI.escape(blockchain.to_s)).sub('{' + 'network' + '}', CGI.escape(network.to_s))

  # query parameters
  query_params = opts[:query_params] || {}
  query_params[:'context'] = opts[:'context'] if !opts[:'context'].nil?

  # header parameters
  header_params = opts[:header_params] || {}
  # HTTP header 'Accept' (if needed)
  header_params['Accept'] = @api_client.select_header_accept(['application/json'])
  # HTTP header 'Content-Type'
  header_params['Content-Type'] = @api_client.select_header_content_type(['application/json'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'sync_hd_wallet_x_pub_y_pub_z_pub_rb'])

  # return_type
  return_type = opts[:debug_return_type] || 'SyncHDWalletXPubYPubZPubR'

  # auth_names
  auth_names = opts[:debug_auth_names] || ['ApiKey']

  new_options = opts.merge(
    :operation => :"UTXOBasedApi.sync_hd_wallet__x_pub_y_pub_z_pub",
    :header_params => header_params,
    :query_params => query_params,
    :form_params => form_params,
    :body => post_body,
    :auth_names => auth_names,
    :return_type => return_type
  )

  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: UTXOBasedApi#sync_hd_wallet__x_pub_y_pub_z_pub\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end