Class: CryptoApis::InternalApi

Inherits:
Object
  • Object
show all
Defined in:
lib/crypto_apis/api/internal_api.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ InternalApi

Returns a new instance of InternalApi.



19
20
21
# File 'lib/crypto_apis/api/internal_api.rb', line 19

def initialize(api_client = ApiClient.default)
  @api_client = api_client
end

Instance Attribute Details

#api_clientObject

Returns the value of attribute api_client.



17
18
19
# File 'lib/crypto_apis/api/internal_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#get_internal_transaction_by_transaction_hash_and_operation_id(blockchain, network, operation_id, transaction_hash, opts = {}) ⇒ GetInternalTransactionByTransactionHashAndOperationIdR

Get Internal Transaction by Transaction Hash and Operation Id Through this endpoint customers can obtain detailed information about a specific Internal Transaction by using the attributes ‘transactionHash` (the parent transaction’s Hash) and ‘operationId` (type trace address). An internal transaction is the result of a smart contract being triggered by an EOA or a subsequent contract call.

Parameters:

  • blockchain (String)

    Represents the specific blockchain protocol name, e.g. Ethereum, Bitcoin, etc.

  • 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" are test networks.

  • operation_id (String)

    Represents the unique internal transaction ID in regards to the parent transaction (type trace address).

  • transaction_hash (String)

    String identifier of the parent transaction of the internal transaction represented in CryptoAPIs.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :context (String)

    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.

Returns:



31
32
33
34
# File 'lib/crypto_apis/api/internal_api.rb', line 31

def get_internal_transaction_by_transaction_hash_and_operation_id(blockchain, network, operation_id, transaction_hash, opts = {})
  data, _status_code, _headers = get_internal_transaction_by_transaction_hash_and_operation_id_with_http_info(blockchain, network, operation_id, transaction_hash, opts)
  data
end

#get_internal_transaction_by_transaction_hash_and_operation_id_with_http_info(blockchain, network, operation_id, transaction_hash, opts = {}) ⇒ Array<(GetInternalTransactionByTransactionHashAndOperationIdR, Integer, Hash)>

Get Internal Transaction by Transaction Hash and Operation Id Through this endpoint customers can obtain detailed information about a specific Internal Transaction by using the attributes &#x60;transactionHash&#x60; (the parent transaction&#39;s Hash) and &#x60;operationId&#x60; (type trace address). An internal transaction is the result of a smart contract being triggered by an EOA or a subsequent contract call.

Parameters:

  • blockchain (String)

    Represents the specific blockchain protocol name, e.g. Ethereum, Bitcoin, etc.

  • 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. - &quot;mainnet&quot; is the live network with actual data while networks like &quot;testnet&quot;, &quot;ropsten&quot; are test networks.

  • operation_id (String)

    Represents the unique internal transaction ID in regards to the parent transaction (type trace address).

  • transaction_hash (String)

    String identifier of the parent transaction of the internal transaction represented in CryptoAPIs.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :context (String)

    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.

Returns:



45
46
47
48
49
50
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
# File 'lib/crypto_apis/api/internal_api.rb', line 45

def get_internal_transaction_by_transaction_hash_and_operation_id_with_http_info(blockchain, network, operation_id, transaction_hash, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: InternalApi.get_internal_transaction_by_transaction_hash_and_operation_id ...'
  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 InternalApi.get_internal_transaction_by_transaction_hash_and_operation_id"
  end
  # verify enum value
  allowable_values = ["ethereum", "binance-smart-chain", "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 InternalApi.get_internal_transaction_by_transaction_hash_and_operation_id"
  end
  # verify enum value
  allowable_values = ["mainnet", "testnet", "mordor", "ropsten"]
  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 'operation_id' is set
  if @api_client.config.client_side_validation && operation_id.nil?
    fail ArgumentError, "Missing the required parameter 'operation_id' when calling InternalApi.get_internal_transaction_by_transaction_hash_and_operation_id"
  end
  # verify the required parameter 'transaction_hash' is set
  if @api_client.config.client_side_validation && transaction_hash.nil?
    fail ArgumentError, "Missing the required parameter 'transaction_hash' when calling InternalApi.get_internal_transaction_by_transaction_hash_and_operation_id"
  end
  # resource path
  local_var_path = '/blockchain-data/{blockchain}/{network}/transactions/{transactionHash}/internal/{operationId}'.sub('{' + 'blockchain' + '}', CGI.escape(blockchain.to_s)).sub('{' + 'network' + '}', CGI.escape(network.to_s)).sub('{' + 'operationId' + '}', CGI.escape(operation_id.to_s)).sub('{' + 'transactionHash' + '}', CGI.escape(transaction_hash.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] || 'GetInternalTransactionByTransactionHashAndOperationIdR'

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

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

#list_internal_transaction_details_by_transaction_hash(blockchain, network, transaction_hash, opts = {}) ⇒ ListInternalTransactionDetailsByTransactionHashR

List Internal Transaction Details by Transaction Hash Through this endpoint customers can list internal transactions along with their details by a specific attribute ‘transactionHash`, which is the parent transaction’s Hash. An internal transaction is the result of a smart contract being triggered by an EOA or a subsequent contract call.

Parameters:

  • blockchain (String)

    Represents the specific blockchain protocol name, e.g. Ethereum, Bitcoin, etc.

  • 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. - &quot;mainnet&quot; is the live network with actual data while networks like &quot;testnet&quot;, &quot;ropsten&quot; are test networks.

  • transaction_hash (String)

    String identifier of the parent transaction of the internal transaction represented in CryptoAPIs.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :context (String)

    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.

  • :limit (Integer)

    Defines how many items should be returned in the response per page basis. (default to 50)

  • :offset (Integer)

    The starting index of the response items, i.e. where the response should start listing the returned items. (default to 0)

Returns:



126
127
128
129
# File 'lib/crypto_apis/api/internal_api.rb', line 126

def list_internal_transaction_details_by_transaction_hash(blockchain, network, transaction_hash, opts = {})
  data, _status_code, _headers = list_internal_transaction_details_by_transaction_hash_with_http_info(blockchain, network, transaction_hash, opts)
  data
end

#list_internal_transaction_details_by_transaction_hash_with_http_info(blockchain, network, transaction_hash, opts = {}) ⇒ Array<(ListInternalTransactionDetailsByTransactionHashR, Integer, Hash)>

List Internal Transaction Details by Transaction Hash Through this endpoint customers can list internal transactions along with their details by a specific attribute &#x60;transactionHash&#x60;, which is the parent transaction&#39;s Hash. An internal transaction is the result of a smart contract being triggered by an EOA or a subsequent contract call.

Parameters:

  • blockchain (String)

    Represents the specific blockchain protocol name, e.g. Ethereum, Bitcoin, etc.

  • 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. - &quot;mainnet&quot; is the live network with actual data while networks like &quot;testnet&quot;, &quot;ropsten&quot; are test networks.

  • transaction_hash (String)

    String identifier of the parent transaction of the internal transaction represented in CryptoAPIs.

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :context (String)

    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.

  • :limit (Integer)

    Defines how many items should be returned in the response per page basis. (default to 50)

  • :offset (Integer)

    The starting index of the response items, i.e. where the response should start listing the returned items. (default to 0)

Returns:



141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
# File 'lib/crypto_apis/api/internal_api.rb', line 141

def list_internal_transaction_details_by_transaction_hash_with_http_info(blockchain, network, transaction_hash, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: InternalApi.list_internal_transaction_details_by_transaction_hash ...'
  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 InternalApi.list_internal_transaction_details_by_transaction_hash"
  end
  # verify enum value
  allowable_values = ["ethereum", "binance-smart-chain", "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 InternalApi.list_internal_transaction_details_by_transaction_hash"
  end
  # verify enum value
  allowable_values = ["mainnet", "testnet", "mordor", "ropsten"]
  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 'transaction_hash' is set
  if @api_client.config.client_side_validation && transaction_hash.nil?
    fail ArgumentError, "Missing the required parameter 'transaction_hash' when calling InternalApi.list_internal_transaction_details_by_transaction_hash"
  end
  # resource path
  local_var_path = '/blockchain-data/{blockchain}/{network}/transactions/{transactionHash}/internal'.sub('{' + 'blockchain' + '}', CGI.escape(blockchain.to_s)).sub('{' + 'network' + '}', CGI.escape(network.to_s)).sub('{' + 'transactionHash' + '}', CGI.escape(transaction_hash.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] || 'ListInternalTransactionDetailsByTransactionHashR'

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

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

#list_internal_transactions_by_address(blockchain, network, address, opts = {}) ⇒ ListInternalTransactionsByAddressR

List Internal Transactions By Address Through this endpoint customers can list internal transactions by the ‘address` attribute.

Parameters:

  • blockchain (String)

    Represents the specific blockchain protocol name, e.g. Ethereum, Bitcoin, etc.

  • 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. - &quot;mainnet&quot; is the live network with actual data while networks like &quot;testnet&quot;, &quot;ropsten&quot; are test networks.

  • address (String)

    String identifier of the address document represented in CryptoAPIs

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :context (String)

    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.

  • :limit (Integer)

    Defines how many items should be returned in the response per page basis. (default to 50)

  • :offset (Integer)

    The starting index of the response items, i.e. where the response should start listing the returned items. (default to 0)

Returns:



220
221
222
223
# File 'lib/crypto_apis/api/internal_api.rb', line 220

def list_internal_transactions_by_address(blockchain, network, address, opts = {})
  data, _status_code, _headers = list_internal_transactions_by_address_with_http_info(blockchain, network, address, opts)
  data
end

#list_internal_transactions_by_address_with_http_info(blockchain, network, address, opts = {}) ⇒ Array<(ListInternalTransactionsByAddressR, Integer, Hash)>

List Internal Transactions By Address Through this endpoint customers can list internal transactions by the &#x60;address&#x60; attribute.

Parameters:

  • blockchain (String)

    Represents the specific blockchain protocol name, e.g. Ethereum, Bitcoin, etc.

  • 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. - &quot;mainnet&quot; is the live network with actual data while networks like &quot;testnet&quot;, &quot;ropsten&quot; are test networks.

  • address (String)

    String identifier of the address document represented in CryptoAPIs

  • opts (Hash) (defaults to: {})

    the optional parameters

Options Hash (opts):

  • :context (String)

    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.

  • :limit (Integer)

    Defines how many items should be returned in the response per page basis. (default to 50)

  • :offset (Integer)

    The starting index of the response items, i.e. where the response should start listing the returned items. (default to 0)

Returns:



235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
# File 'lib/crypto_apis/api/internal_api.rb', line 235

def list_internal_transactions_by_address_with_http_info(blockchain, network, address, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: InternalApi.list_internal_transactions_by_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 InternalApi.list_internal_transactions_by_address"
  end
  # verify enum value
  allowable_values = ["ethereum", "ethereum-classic", "binance-smart-chain"]
  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 InternalApi.list_internal_transactions_by_address"
  end
  # verify enum value
  allowable_values = ["mainnet", "ropsten", "mordor", "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 'address' is set
  if @api_client.config.client_side_validation && address.nil?
    fail ArgumentError, "Missing the required parameter 'address' when calling InternalApi.list_internal_transactions_by_address"
  end
  # resource path
  local_var_path = '/blockchain-data/{blockchain}/{network}/addresses/{address}/internal'.sub('{' + 'blockchain' + '}', CGI.escape(blockchain.to_s)).sub('{' + 'network' + '}', CGI.escape(network.to_s)).sub('{' + 'address' + '}', CGI.escape(address.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] || 'ListInternalTransactionsByAddressR'

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

  new_options = opts.merge(
    :operation => :"InternalApi.list_internal_transactions_by_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(:GET, local_var_path, new_options)
  if @api_client.config.debugging
    @api_client.config.logger.debug "API called: InternalApi#list_internal_transactions_by_address\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
  end
  return data, status_code, headers
end