class CryptoApis::FeaturesApi

Attributes

api_client[RW]

Public Class Methods

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

Public Instance Methods

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

Broadcast Locally Signed Transaction Through this endpoint customers can broadcast transactions that have been already signed locally. Instead of using a node for broadcasting a signed transaction users can use this endpoint. We then keep the user posted about the status by sending you a callback with a success or failure status. @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 [BroadcastLocallySignedTransactionRB] :broadcast_locally_signed_transaction_rb @return [BroadcastLocallySignedTransactionR]

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

Broadcast Locally Signed Transaction Through this endpoint customers can broadcast transactions that have been already signed locally. Instead of using a node for broadcasting a signed transaction users can use this endpoint. We then keep the user posted about the status by sending you a callback with a success or failure status. @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 [BroadcastLocallySignedTransactionRB] :broadcast_locally_signed_transaction_rb @return [Array<(BroadcastLocallySignedTransactionR, Integer, Hash)>] BroadcastLocallySignedTransactionR data, response status code and response headers

# File lib/crypto_apis/api/features_api.rb, line 43
def broadcast_locally_signed_transaction_with_http_info(blockchain, network, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FeaturesApi.broadcast_locally_signed_transaction ...'
  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 FeaturesApi.broadcast_locally_signed_transaction"
  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 FeaturesApi.broadcast_locally_signed_transaction"
  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-tools/{blockchain}/{network}/transactions/broadcast'.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[:'broadcast_locally_signed_transaction_rb'])

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

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

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

Validate Address This endpoint checks user public addresses whether they are valid or not. @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 [ValidateAddressRB] :validate_address_rb @return [ValidateAddressR]

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

Validate Address This endpoint checks user public addresses whether they are valid or not. @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 [ValidateAddressRB] :validate_address_rb @return [Array<(ValidateAddressR, Integer, Hash)>] ValidateAddressR data, response status code and response headers

# File lib/crypto_apis/api/features_api.rb, line 129
def validate_address_with_http_info(blockchain, network, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: FeaturesApi.validate_address ...'
  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 FeaturesApi.validate_address"
  end
  # verify enum value
  allowable_values = ["bitcoin", "bitcoin-cash", "litecoin", "dogecoin", "dash", "ethereum", "ethereum-classic", "xrp", "zilliqa"]
  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 FeaturesApi.validate_address"
  end
  # verify enum value
  allowable_values = ["mainnet", "testnet", "ropsten", "rinkeby", "mordor", "kotti"]
  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-tools/{blockchain}/{network}/addresses/validate'.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[:'validate_address_rb'])

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

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

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