class CryptoApis::AutomaticCoinsForwardingApi

Attributes

api_client[RW]

Public Class Methods

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

Public Instance Methods

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

Create Automatic Coins Forwarding Through this endpoint customers can set up an automatic forwarding function specifically for coins (not tokens). They can have a `toAddress` which is essentially the main address and the destination for the automatic coins forwarding. There is also a `minimumTransferAmount` which only when reached will then trigger the forwarding. Through this the customer can save from fees. Moreover, `feePriority` can be also set, which defines how quickly to move the coins once they are received. The higher priority, the larger the fee will be. It can be "SLOW", "STANDARD" or "FAST". The response of this endpoint contains an attribute `fromAddress` which can be used as a deposit address. Any funds received by this address will be automatically forwarded to `toAddress` based on what the customer has set for the automation. For this automatic forwarding the customer can set a callback subscription. {warning}The subscription will work for all incoming transactions until it is deleted. There is no need to do that for every transaction.{/warning} {note}This endpoint generates a new `fromAddress` each time.{/note} @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" 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 [CreateAutomaticCoinsForwardingRB] :create_automatic_coins_forwarding_rb @return [CreateAutomaticCoinsForwardingR]

# File lib/crypto_apis/api/automatic_coins_forwarding_api.rb, line 30
def create_automatic_coins_forwarding(blockchain, network, opts = {})
  data, _status_code, _headers = create_automatic_coins_forwarding_with_http_info(blockchain, network, opts)
  data
end
create_automatic_coins_forwarding_with_http_info(blockchain, network, opts = {}) click to toggle source

Create Automatic Coins Forwarding Through this endpoint customers can set up an automatic forwarding function specifically for coins (not tokens). They can have a &#x60;toAddress&#x60; which is essentially the main address and the destination for the automatic coins forwarding. There is also a &#x60;minimumTransferAmount&#x60; which only when reached will then trigger the forwarding. Through this the customer can save from fees. Moreover, &#x60;feePriority&#x60; can be also set, which defines how quickly to move the coins once they are received. The higher priority, the larger the fee will be. It can be "SLOW&quot;, "STANDARD&quot; or "FAST&quot;. The response of this endpoint contains an attribute &#x60;fromAddress&#x60; which can be used as a deposit address. Any funds received by this address will be automatically forwarded to &#x60;toAddress&#x60; based on what the customer has set for the automation. For this automatic forwarding the customer can set a callback subscription. {warning}The subscription will work for all incoming transactions until it is deleted. There is no need to do that for every transaction.{/warning} {note}This endpoint generates a new &#x60;fromAddress&#x60; each time.{/note} @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 [CreateAutomaticCoinsForwardingRB] :create_automatic_coins_forwarding_rb @return [Array<(CreateAutomaticCoinsForwardingR, Integer, Hash)>] CreateAutomaticCoinsForwardingR data, response status code and response headers

# File lib/crypto_apis/api/automatic_coins_forwarding_api.rb, line 43
def create_automatic_coins_forwarding_with_http_info(blockchain, network, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AutomaticCoinsForwardingApi.create_automatic_coins_forwarding ...'
  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 AutomaticCoinsForwardingApi.create_automatic_coins_forwarding"
  end
  # verify enum value
  allowable_values = ["bitcoin", "bitcoin-cash", "litecoin", "dogecoin", "dash", "ethereum", "ethereum-classic"]
  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 AutomaticCoinsForwardingApi.create_automatic_coins_forwarding"
  end
  # verify enum value
  allowable_values = ["mainnet", "testnet", "ropsten", "rinkeby", "mordor"]
  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-automations/{blockchain}/{network}/coins-forwarding/automations'.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[:'create_automatic_coins_forwarding_rb'])

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

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

  new_options = opts.merge(
    :operation => :"AutomaticCoinsForwardingApi.create_automatic_coins_forwarding",
    :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: AutomaticCoinsForwardingApi#create_automatic_coins_forwarding\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
delete_automatic_coins_forwarding(blockchain, network, reference_id, opts = {}) click to toggle source

Delete Automatic Coins Forwarding Through this endpoint customers can delete a forwarding function they have set for coins (not tokens). By setting a `fromAddress` and a `toAddress`, and specifying the amount, coins can be transferred between addresses. A `feePriority` will be returned which represents the fee priority of the automation whether it is "SLOW", "STANDARD" OR "FAST". {warning}The subscription will work for all incoming transactions until it is deleted. There is no need to do that for every transaction.{/warning} @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 reference_id [String] Represents a unique ID used to reference the specific callback subscription. @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. @return [DeleteAutomaticCoinsForwardingR]

# File lib/crypto_apis/api/automatic_coins_forwarding_api.rb, line 116
def delete_automatic_coins_forwarding(blockchain, network, reference_id, opts = {})
  data, _status_code, _headers = delete_automatic_coins_forwarding_with_http_info(blockchain, network, reference_id, opts)
  data
end
delete_automatic_coins_forwarding_with_http_info(blockchain, network, reference_id, opts = {}) click to toggle source

Delete Automatic Coins Forwarding Through this endpoint customers can delete a forwarding function they have set for coins (not tokens). By setting a &#x60;fromAddress&#x60; and a &#x60;toAddress&#x60;, and specifying the amount, coins can be transferred between addresses. A &#x60;feePriority&#x60; will be returned which represents the fee priority of the automation whether it is "SLOW&quot;, "STANDARD&quot; OR "FAST&quot;. {warning}The subscription will work for all incoming transactions until it is deleted. There is no need to do that for every transaction.{/warning} @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 reference_id [String] Represents a unique ID used to reference the specific callback subscription. @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. @return [Array<(DeleteAutomaticCoinsForwardingR, Integer, Hash)>] DeleteAutomaticCoinsForwardingR data, response status code and response headers

# File lib/crypto_apis/api/automatic_coins_forwarding_api.rb, line 129
def delete_automatic_coins_forwarding_with_http_info(blockchain, network, reference_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AutomaticCoinsForwardingApi.delete_automatic_coins_forwarding ...'
  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 AutomaticCoinsForwardingApi.delete_automatic_coins_forwarding"
  end
  # verify enum value
  allowable_values = ["bitcoin", "bitcoin-cash", "litecoin", "dogecoin", "dash", "ethereum", "ethereum-classic"]
  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 AutomaticCoinsForwardingApi.delete_automatic_coins_forwarding"
  end
  # verify enum value
  allowable_values = ["mainnet", "testnet", "ropsten", "rinkeby", "mordor"]
  if @api_client.config.client_side_validation && !allowable_values.include?(network)
    fail ArgumentError, "invalid value for \"network\", must be one of #{allowable_values}"
  end
  # verify the required parameter 'reference_id' is set
  if @api_client.config.client_side_validation && reference_id.nil?
    fail ArgumentError, "Missing the required parameter 'reference_id' when calling AutomaticCoinsForwardingApi.delete_automatic_coins_forwarding"
  end
  # resource path
  local_var_path = '/blockchain-automations/{blockchain}/{network}/coins-forwarding/automations/{referenceId}'.sub('{' + 'blockchain' + '}', CGI.escape(blockchain.to_s)).sub('{' + 'network' + '}', CGI.escape(network.to_s)).sub('{' + 'referenceId' + '}', CGI.escape(reference_id.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'])

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

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

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

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

  new_options = opts.merge(
    :operation => :"AutomaticCoinsForwardingApi.delete_automatic_coins_forwarding",
    :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(:DELETE, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: AutomaticCoinsForwardingApi#delete_automatic_coins_forwarding\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end
list_coins_forwarding_automations(blockchain, network, opts = {}) click to toggle source

List Coins Forwarding Automations Through this endpoint customers can list all of their coins forwarding automations (not tokens). Customers can set up automatic forwarding functions for coins by setting a `fromAddress` and a `toAddress`, and specifying the amount that can be transferred between addresses. A `feePriority` will be returned which represents the fee priority of the automation whether it is "SLOW", "STANDARD" OR "FAST". {warning}The subscription will work for all transactions until it is deleted. There is no need to do that for every transaction.{/warning} @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 [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 [ListCoinsForwardingAutomationsR]

# File lib/crypto_apis/api/automatic_coins_forwarding_api.rb, line 205
def list_coins_forwarding_automations(blockchain, network, opts = {})
  data, _status_code, _headers = list_coins_forwarding_automations_with_http_info(blockchain, network, opts)
  data
end
list_coins_forwarding_automations_with_http_info(blockchain, network, opts = {}) click to toggle source

List Coins Forwarding Automations Through this endpoint customers can list all of their coins forwarding automations (not tokens). Customers can set up automatic forwarding functions for coins by setting a &#x60;fromAddress&#x60; and a &#x60;toAddress&#x60;, and specifying the amount that can be transferred between addresses. A &#x60;feePriority&#x60; will be returned which represents the fee priority of the automation whether it is "SLOW&quot;, "STANDARD&quot; OR "FAST&quot;. {warning}The subscription will work for all transactions until it is deleted. There is no need to do that for every transaction.{/warning} @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 [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<(ListCoinsForwardingAutomationsR, Integer, Hash)>] ListCoinsForwardingAutomationsR data, response status code and response headers

# File lib/crypto_apis/api/automatic_coins_forwarding_api.rb, line 219
def list_coins_forwarding_automations_with_http_info(blockchain, network, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AutomaticCoinsForwardingApi.list_coins_forwarding_automations ...'
  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 AutomaticCoinsForwardingApi.list_coins_forwarding_automations"
  end
  # verify enum value
  allowable_values = ["bitcoin", "bitcoin-cash", "litecoin", "dogecoin", "dash", "ethereum", "ethereum-classic"]
  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 AutomaticCoinsForwardingApi.list_coins_forwarding_automations"
  end
  # verify enum value
  allowable_values = ["mainnet", "testnet", "ropsten", "rinkeby", "mordor"]
  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-automations/{blockchain}/{network}/coins-forwarding/automations'.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?
  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] || 'ListCoinsForwardingAutomationsR'

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

  new_options = opts.merge(
    :operation => :"AutomaticCoinsForwardingApi.list_coins_forwarding_automations",
    :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: AutomaticCoinsForwardingApi#list_coins_forwarding_automations\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end