class CryptoApis::GeneratingApi
Attributes
Public Class Methods
# File lib/crypto_apis/api/generating_api.rb, line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
Generate Deposit Address Through this endpoint customers can generate a new Receiving/Deposit Addresses into their Wallet. @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 unique ID of the specific 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 [GenerateDepositAddressRB] :generate_deposit_address_rb @return [GenerateDepositAddressR]
# File lib/crypto_apis/api/generating_api.rb, line 31 def generate_deposit_address(blockchain, network, wallet_id, opts = {}) data, _status_code, _headers = generate_deposit_address_with_http_info(blockchain, network, wallet_id, opts) data end
Generate Deposit Address Through this endpoint customers can generate a new Receiving/Deposit Addresses into their Wallet. @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 unique ID of the specific 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 [GenerateDepositAddressRB] :generate_deposit_address_rb @return [Array<(GenerateDepositAddressR
, Integer, Hash)>] GenerateDepositAddressR
data, response status code and response headers
# File lib/crypto_apis/api/generating_api.rb, line 45 def generate_deposit_address_with_http_info(blockchain, network, wallet_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: GeneratingApi.generate_deposit_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 GeneratingApi.generate_deposit_address" 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 'network' is set if @api_client.config.client_side_validation && network.nil? fail ArgumentError, "Missing the required parameter 'network' when calling GeneratingApi.generate_deposit_address" 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 GeneratingApi.generate_deposit_address" end # resource path local_var_path = '/wallet-as-a-service/wallets/{walletId}/{blockchain}/{network}/addresses'.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[:'generate_deposit_address_rb']) # return_type return_type = opts[:debug_return_type] || 'GenerateDepositAddressR' # auth_names auth_names = opts[:debug_auth_names] || ['ApiKey'] new_options = opts.merge( :operation => :"GeneratingApi.generate_deposit_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: GeneratingApi#generate_deposit_address\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end