Class: Coinbase::Client::ContractEventsApi
- Inherits:
-
Object
- Object
- Coinbase::Client::ContractEventsApi
- Defined in:
- lib/coinbase/client/api/contract_events_api.rb
Instance Attribute Summary collapse
-
#api_client ⇒ Object
Returns the value of attribute api_client.
Instance Method Summary collapse
-
#initialize(api_client = ApiClient.default) ⇒ ContractEventsApi
constructor
A new instance of ContractEventsApi.
-
#list_contract_events(network_id, protocol_name, contract_address, contract_name, event_name, from_block_height, to_block_height, opts = {}) ⇒ ContractEventList
List contract events Retrieve events for a specific contract.
-
#list_contract_events_with_http_info(network_id, protocol_name, contract_address, contract_name, event_name, from_block_height, to_block_height, opts = {}) ⇒ Array<(ContractEventList, Integer, Hash)>
List contract events Retrieve events for a specific contract.
Constructor Details
#initialize(api_client = ApiClient.default) ⇒ ContractEventsApi
Returns a new instance of ContractEventsApi.
19 20 21 |
# File 'lib/coinbase/client/api/contract_events_api.rb', line 19 def initialize(api_client = ApiClient.default) @api_client = api_client end |
Instance Attribute Details
#api_client ⇒ Object
Returns the value of attribute api_client.
17 18 19 |
# File 'lib/coinbase/client/api/contract_events_api.rb', line 17 def api_client @api_client end |
Instance Method Details
#list_contract_events(network_id, protocol_name, contract_address, contract_name, event_name, from_block_height, to_block_height, opts = {}) ⇒ ContractEventList
List contract events Retrieve events for a specific contract
34 35 36 37 |
# File 'lib/coinbase/client/api/contract_events_api.rb', line 34 def list_contract_events(network_id, protocol_name, contract_address, contract_name, event_name, from_block_height, to_block_height, opts = {}) data, _status_code, _headers = list_contract_events_with_http_info(network_id, protocol_name, contract_address, contract_name, event_name, from_block_height, to_block_height, opts) data end |
#list_contract_events_with_http_info(network_id, protocol_name, contract_address, contract_name, event_name, from_block_height, to_block_height, opts = {}) ⇒ Array<(ContractEventList, Integer, Hash)>
List contract events Retrieve events for a specific contract
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 |
# File 'lib/coinbase/client/api/contract_events_api.rb', line 51 def list_contract_events_with_http_info(network_id, protocol_name, contract_address, contract_name, event_name, from_block_height, to_block_height, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: ContractEventsApi.list_contract_events ...' end # verify the required parameter 'network_id' is set if @api_client.config.client_side_validation && network_id.nil? fail ArgumentError, "Missing the required parameter 'network_id' when calling ContractEventsApi.list_contract_events" end # verify the required parameter 'protocol_name' is set if @api_client.config.client_side_validation && protocol_name.nil? fail ArgumentError, "Missing the required parameter 'protocol_name' when calling ContractEventsApi.list_contract_events" end # verify the required parameter 'contract_address' is set if @api_client.config.client_side_validation && contract_address.nil? fail ArgumentError, "Missing the required parameter 'contract_address' when calling ContractEventsApi.list_contract_events" end # verify the required parameter 'contract_name' is set if @api_client.config.client_side_validation && contract_name.nil? fail ArgumentError, "Missing the required parameter 'contract_name' when calling ContractEventsApi.list_contract_events" end # verify the required parameter 'event_name' is set if @api_client.config.client_side_validation && event_name.nil? fail ArgumentError, "Missing the required parameter 'event_name' when calling ContractEventsApi.list_contract_events" end # verify the required parameter 'from_block_height' is set if @api_client.config.client_side_validation && from_block_height.nil? fail ArgumentError, "Missing the required parameter 'from_block_height' when calling ContractEventsApi.list_contract_events" end # verify the required parameter 'to_block_height' is set if @api_client.config.client_side_validation && to_block_height.nil? fail ArgumentError, "Missing the required parameter 'to_block_height' when calling ContractEventsApi.list_contract_events" end # resource path local_var_path = '/v1/networks/{network_id}/smart_contracts/{contract_address}/events'.sub('{' + 'network_id' + '}', CGI.escape(network_id.to_s)).sub('{' + 'contract_address' + '}', CGI.escape(contract_address.to_s)) # query parameters query_params = opts[:query_params] || {} query_params[:'protocol_name'] = protocol_name query_params[:'contract_name'] = contract_name query_params[:'event_name'] = event_name query_params[:'from_block_height'] = from_block_height query_params[:'to_block_height'] = to_block_height query_params[:'next_page'] = opts[:'next_page'] if !opts[:'next_page'].nil? # header parameters header_params = opts[:header_params] || {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept'] # form parameters form_params = opts[:form_params] || {} # http body (model) post_body = opts[:debug_body] # return_type return_type = opts[:debug_return_type] || 'ContractEventList' # auth_names auth_names = opts[:debug_auth_names] || [] = opts.merge( :operation => :"ContractEventsApi.list_contract_events", :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, ) if @api_client.config.debugging @api_client.config.logger.debug "API called: ContractEventsApi#list_contract_events\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end |