class CryptoApis::TransactionsApi
Attributes
Public Class Methods
# File lib/crypto_apis/api/transactions_api.rb, line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
Create Coins Transaction Request from Address Through this endpoint users can create a new single transaction request from one address to another. @param address [String] Defines the specific source address for the transaction. @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 wallet_id [String] Represents the sender's specific and unique Wallet ID of the sender. @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 [CreateCoinsTransactionRequestFromAddressRB] :create_coins_transaction_request_from_address_rb @return [CreateCoinsTransactionRequestFromAddressR]
# File lib/crypto_apis/api/transactions_api.rb, line 32 def create_coins_transaction_request_from_address(address, blockchain, network, wallet_id, opts = {}) data, _status_code, _headers = create_coins_transaction_request_from_address_with_http_info(address, blockchain, network, wallet_id, opts) data end
Create Coins Transaction Request from Address Through this endpoint users can create a new single transaction request from one address to another. @param address [String] Defines the specific source address for the transaction. @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 wallet_id [String] Represents the sender's specific and unique Wallet ID of the sender. @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 [CreateCoinsTransactionRequestFromAddressRB] :create_coins_transaction_request_from_address_rb @return [Array<(CreateCoinsTransactionRequestFromAddressR
, Integer, Hash)>] CreateCoinsTransactionRequestFromAddressR
data, response status code and response headers
# File lib/crypto_apis/api/transactions_api.rb, line 47 def create_coins_transaction_request_from_address_with_http_info(address, blockchain, network, wallet_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TransactionsApi.create_coins_transaction_request_from_address ...' end # verify the required parameter 'address' is set if @api_client.config.client_side_validation && address.nil? fail ArgumentError, "Missing the required parameter 'address' when calling TransactionsApi.create_coins_transaction_request_from_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 TransactionsApi.create_coins_transaction_request_from_address" end # verify enum value allowable_values = ["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 'network' is set if @api_client.config.client_side_validation && network.nil? fail ArgumentError, "Missing the required parameter 'network' when calling TransactionsApi.create_coins_transaction_request_from_address" end # verify enum value allowable_values = ["mainnet"] 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 'wallet_id' is set if @api_client.config.client_side_validation && wallet_id.nil? fail ArgumentError, "Missing the required parameter 'wallet_id' when calling TransactionsApi.create_coins_transaction_request_from_address" end # resource path local_var_path = '/wallet-as-a-service/wallets/{walletId}/{blockchain}/{network}/addresses/{address}/transaction-requests'.sub('{' + 'address' + '}', CGI.escape(address.to_s)).sub('{' + 'blockchain' + '}', CGI.escape(blockchain.to_s)).sub('{' + 'network' + '}', CGI.escape(network.to_s)).sub('{' + 'walletId' + '}', CGI.escape(wallet_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']) # 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_coins_transaction_request_from_address_rb']) # return_type return_type = opts[:debug_return_type] || 'CreateCoinsTransactionRequestFromAddressR' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKey'] new_options = opts.merge( :operation => :"TransactionsApi.create_coins_transaction_request_from_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: TransactionsApi#create_coins_transaction_request_from_address\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Create Coins Transaction Request from Wallet Through this endpoint users can create a new transaction request from the entire Wallet instead from just a specific address. This endpoint can generate transactions from multiple to multiple addresses. {warning}This is available only for UTXO-based protocols such as Bitcoin, Bitcoin Cash, Litecoin, etc. It **is not** available for Account-based protocols like Ethereum.{/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" is the live network with actual data while networks like "testnet", "ropsten", "rinkeby" are test networks. @param wallet_id [String] Represents the sender's specific and unique Wallet ID of the sender. @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 [CreateCoinsTransactionRequestFromWalletRB] :create_coins_transaction_request_from_wallet_rb @return [CreateCoinsTransactionRequestFromWalletR]
# File lib/crypto_apis/api/transactions_api.rb, line 129 def create_coins_transaction_request_from_wallet(blockchain, network, wallet_id, opts = {}) data, _status_code, _headers = create_coins_transaction_request_from_wallet_with_http_info(blockchain, network, wallet_id, opts) data end
Create Coins Transaction Request from Wallet Through this endpoint users can create a new transaction request from the entire Wallet instead from just a specific address. This endpoint can generate transactions from multiple to multiple addresses. {warning}This is available only for UTXO-based protocols such as Bitcoin, Bitcoin Cash, Litecoin, etc. It **is not** available for Account-based protocols like Ethereum.{/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" is the live network with actual data while networks like "testnet", "ropsten", "rinkeby" are test networks. @param wallet_id [String] Represents the sender's specific and unique Wallet ID of the sender. @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 [CreateCoinsTransactionRequestFromWalletRB] :create_coins_transaction_request_from_wallet_rb @return [Array<(CreateCoinsTransactionRequestFromWalletR
, Integer, Hash)>] CreateCoinsTransactionRequestFromWalletR
data, response status code and response headers
# File lib/crypto_apis/api/transactions_api.rb, line 143 def create_coins_transaction_request_from_wallet_with_http_info(blockchain, network, wallet_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TransactionsApi.create_coins_transaction_request_from_wallet ...' 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 TransactionsApi.create_coins_transaction_request_from_wallet" 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 TransactionsApi.create_coins_transaction_request_from_wallet" 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 # verify the required parameter 'wallet_id' is set if @api_client.config.client_side_validation && wallet_id.nil? fail ArgumentError, "Missing the required parameter 'wallet_id' when calling TransactionsApi.create_coins_transaction_request_from_wallet" end # resource path local_var_path = '/wallet-as-a-service/wallets/{walletId}/{blockchain}/{network}/transaction-requests'.sub('{' + 'blockchain' + '}', CGI.escape(blockchain.to_s)).sub('{' + 'network' + '}', CGI.escape(network.to_s)).sub('{' + 'walletId' + '}', CGI.escape(wallet_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']) # 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_coins_transaction_request_from_wallet_rb']) # return_type return_type = opts[:debug_return_type] || 'CreateCoinsTransactionRequestFromWalletR' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKey'] new_options = opts.merge( :operation => :"TransactionsApi.create_coins_transaction_request_from_wallet", :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: TransactionsApi#create_coins_transaction_request_from_wallet\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Create Tokens Transaction Request from Address Through this endpoint users can make a single token transaction. {warning}This applies only to fungible tokens, not NFTs (non-fungible tokens).{/warning} {note}To have an operational callback subscription, you need to first verify a domain for the Callback URL. Please see more information on Callbacks [here](developers.cryptoapis.io/technical-documentation/general-information/callbacks#callback-url).{/note} {warning}Crypto APIs will notify the user **only when** the event occurs. There are cases when the specific event doesn't happen at all, or takes a long time to do so. A callback notification **will not** be sent if the event does not or cannot occur, or will take long time to occur.{/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" is the live network with actual data while networks like "testnet", "ropsten", "rinkeby" are test networks. @param sender_address [String] Defines the specific source address for the transaction. @param wallet_id [String] Defines the unique ID of the Wallet. @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 [CreateTokensTransactionRequestFromAddressRB] :create_tokens_transaction_request_from_address_rb @return [CreateTokensTransactionRequestFromAddressR]
# File lib/crypto_apis/api/transactions_api.rb, line 222 def create_tokens_transaction_request_from_address(blockchain, network, sender_address, wallet_id, opts = {}) data, _status_code, _headers = create_tokens_transaction_request_from_address_with_http_info(blockchain, network, sender_address, wallet_id, opts) data end
Create Tokens Transaction Request from Address Through this endpoint users can make a single token transaction. {warning}This applies only to fungible tokens, not NFTs (non-fungible tokens).{/warning} {note}To have an operational callback subscription, you need to first verify a domain for the Callback URL. Please see more information on Callbacks [here](developers.cryptoapis.io/technical-documentation/general-information/callbacks#callback-url).{/note} {warning}Crypto APIs will notify the user **only when** the event occurs. There are cases when the specific event doesn't happen at all, or takes a long time to do so. A callback notification **will not** be sent if the event does not or cannot occur, or will take long time to occur.{/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" is the live network with actual data while networks like "testnet", "ropsten", "rinkeby" are test networks. @param sender_address [String] Defines the specific source address for the transaction. @param wallet_id [String] Defines the unique ID of the Wallet. @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 [CreateTokensTransactionRequestFromAddressRB] :create_tokens_transaction_request_from_address_rb @return [Array<(CreateTokensTransactionRequestFromAddressR
, Integer, Hash)>] CreateTokensTransactionRequestFromAddressR
data, response status code and response headers
# File lib/crypto_apis/api/transactions_api.rb, line 237 def create_tokens_transaction_request_from_address_with_http_info(blockchain, network, sender_address, wallet_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TransactionsApi.create_tokens_transaction_request_from_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 TransactionsApi.create_tokens_transaction_request_from_address" end # verify enum value allowable_values = ["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 'network' is set if @api_client.config.client_side_validation && network.nil? fail ArgumentError, "Missing the required parameter 'network' when calling TransactionsApi.create_tokens_transaction_request_from_address" end # verify enum value allowable_values = ["mainnet"] 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 'sender_address' is set if @api_client.config.client_side_validation && sender_address.nil? fail ArgumentError, "Missing the required parameter 'sender_address' when calling TransactionsApi.create_tokens_transaction_request_from_address" end # verify the required parameter 'wallet_id' is set if @api_client.config.client_side_validation && wallet_id.nil? fail ArgumentError, "Missing the required parameter 'wallet_id' when calling TransactionsApi.create_tokens_transaction_request_from_address" end # resource path local_var_path = '/wallet-as-a-service/wallets/{walletId}/{blockchain}/{network}/addresses/{senderAddress}/token-transaction-requests'.sub('{' + 'blockchain' + '}', CGI.escape(blockchain.to_s)).sub('{' + 'network' + '}', CGI.escape(network.to_s)).sub('{' + 'senderAddress' + '}', CGI.escape(sender_address.to_s)).sub('{' + 'walletId' + '}', CGI.escape(wallet_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']) # 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_tokens_transaction_request_from_address_rb']) # return_type return_type = opts[:debug_return_type] || 'CreateTokensTransactionRequestFromAddressR' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKey'] new_options = opts.merge( :operation => :"TransactionsApi.create_tokens_transaction_request_from_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: TransactionsApi#create_tokens_transaction_request_from_address\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end