Class: CryptoApis::AutomaticTokensForwardingApi

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

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(api_client = ApiClient.default) ⇒ AutomaticTokensForwardingApi

Returns a new instance of AutomaticTokensForwardingApi.



19
20
21
# File 'lib/crypto_apis/api/automatic_tokens_forwarding_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/automatic_tokens_forwarding_api.rb', line 17

def api_client
  @api_client
end

Instance Method Details

#add_tokens_to_existing_from_address(blockchain, network, opts = {}) ⇒ AddTokensToExistingFromAddressR

Add Tokens To Existing fromAddress Through this endpoint customers can add **Automatic Tokens forwardings** to an already existing ‘fromAddress`. Unlike the "Create Automatic Tokens Forwarding" endpoint, where the `fromAddress` is generated each time, with this endpoint customers can add an automation from another token to one and the same `fromAddress`. The `fromAddress` can be used as a deposit address. Any funds received by this address will be automatically forwarded to `toAddress` based on what the customer has set for the automation. The `toAddress` is essentially the main address and destination for the automatic tokens forwarding. There is also a `minimumTransferAmount` which only when reached will then trigger the forwarding. Through this the customer can save from fees. Moreover, `feePriority` can be also set, which defines how quickly to move the tokens once they are received. The higher priority, the larger the fee will be. It can be "SLOW", "STANDARD" or "FAST". For this automatic forwarding the customer can set a callback subscription. warningCurrently we support fungible tokens (ERC-20) only, NFTs (ERC-721) are not supported./warning warningThe subscription will work for all incoming transactions until it is deleted. There is no need to do that for every transaction./warning

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.

  • 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.

  • :add_tokens_to_existing_from_address_rb (AddTokensToExistingFromAddressRB)

Returns:



30
31
32
33
# File 'lib/crypto_apis/api/automatic_tokens_forwarding_api.rb', line 30

def add_tokens_to_existing_from_address(blockchain, network, opts = {})
  data, _status_code, _headers = add_tokens_to_existing_from_address_with_http_info(blockchain, network, opts)
  data
end

#add_tokens_to_existing_from_address_with_http_info(blockchain, network, opts = {}) ⇒ Array<(AddTokensToExistingFromAddressR, Integer, Hash)>

Add Tokens To Existing fromAddress Through this endpoint customers can add **Automatic Tokens forwardings** to an already existing &#x60;fromAddress&#x60;. Unlike the &quot;Create Automatic Tokens Forwarding&quot; endpoint, where the &#x60;fromAddress&#x60; is generated each time, with this endpoint customers can add an automation from another token to one and the same &#x60;fromAddress&#x60;. The &#x60;fromAddress&#x60; can be used as a deposit address. Any funds received by this address will be automatically forwarded to &#x60;toAddress&#x60; based on what the customer has set for the automation. The &#x60;toAddress&#x60; is essentially the main address and destination for the automatic tokens forwarding. There is also a &#x60;minimumTransferAmount&#x60; which only when reached will then trigger the forwarding. Through this the customer can save from fees. Moreover, &#x60;feePriority&#x60; can be also set, which defines how quickly to move the tokens once they are received. The higher priority, the larger the fee will be. It can be &quot;SLOW&quot;, &quot;STANDARD&quot; or &quot;FAST&quot;. For this automatic forwarding the customer can set a callback subscription. warningCurrently we support fungible tokens (ERC-20) only, NFTs (ERC-721) are not supported./warning warningThe subscription will work for all incoming transactions until it is deleted. There is no need to do that for every transaction./warning

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.

  • 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.

  • :add_tokens_to_existing_from_address_rb (AddTokensToExistingFromAddressRB)

Returns:



43
44
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
# File 'lib/crypto_apis/api/automatic_tokens_forwarding_api.rb', line 43

def add_tokens_to_existing_from_address_with_http_info(blockchain, network, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AutomaticTokensForwardingApi.add_tokens_to_existing_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 AutomaticTokensForwardingApi.add_tokens_to_existing_from_address"
  end
  # verify enum value
  allowable_values = ["bitcoin", "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 AutomaticTokensForwardingApi.add_tokens_to_existing_from_address"
  end
  # verify enum value
  allowable_values = ["mainnet", "testnet", "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
  # resource path
  local_var_path = '/blockchain-automations/{blockchain}/{network}/tokens-forwarding/automations/add-token'.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'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'add_tokens_to_existing_from_address_rb'])

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

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

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

#create_automatic_tokens_forwarding(blockchain, network, opts = {}) ⇒ CreateAutomaticTokensForwardingR

Create Automatic Tokens Forwarding Through this endpoint customers can set up an automatic forwarding function specifically for tokens (not coins). They can have a ‘toAddress` which is essentially the main address and the destination for the automatic tokens forwarding. There is also a `minimumTransferAmount` which only when reached will then trigger the forwarding. Through this the customer can save from fees. Moreover, `feePriority` can be also set, which defines how quickly to move the tokens once they are received. The higher priority, the larger the fee will be. It can be "SLOW", "STANDARD" or "FAST". The response of this endpoint contains an attribute `fromAddress` which can be used as a deposit address. Any funds received by this address will be automatically forwarded to `toAddress` based on what the customer has set for the automation. For this automatic forwarding the customer can set a callback subscription. warningCurrently we support fungible tokens (ERC-20) only, NFTs (ERC-721) are not supported./warning warningThe subscription will work for all incoming transactions until it is deleted. There is no need to do that for every transaction./warning noteThis endpoint generates a new `fromAddress` each time./note

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.

  • 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.

  • :create_automatic_tokens_forwarding_rb (CreateAutomaticTokensForwardingRB)

Returns:



119
120
121
122
# File 'lib/crypto_apis/api/automatic_tokens_forwarding_api.rb', line 119

def create_automatic_tokens_forwarding(blockchain, network, opts = {})
  data, _status_code, _headers = create_automatic_tokens_forwarding_with_http_info(blockchain, network, opts)
  data
end

#create_automatic_tokens_forwarding_with_http_info(blockchain, network, opts = {}) ⇒ Array<(CreateAutomaticTokensForwardingR, Integer, Hash)>

Create Automatic Tokens Forwarding Through this endpoint customers can set up an automatic forwarding function specifically for tokens (not coins). They can have a &#x60;toAddress&#x60; which is essentially the main address and the destination for the automatic tokens forwarding. There is also a &#x60;minimumTransferAmount&#x60; which only when reached will then trigger the forwarding. Through this the customer can save from fees. Moreover, &#x60;feePriority&#x60; can be also set, which defines how quickly to move the tokens once they are received. The higher priority, the larger the fee will be. It can be &quot;SLOW&quot;, &quot;STANDARD&quot; or &quot;FAST&quot;. The response of this endpoint contains an attribute &#x60;fromAddress&#x60; which can be used as a deposit address. Any funds received by this address will be automatically forwarded to &#x60;toAddress&#x60; based on what the customer has set for the automation. For this automatic forwarding the customer can set a callback subscription. warningCurrently we support fungible tokens (ERC-20) only, NFTs (ERC-721) are not supported./warning warningThe subscription will work for all incoming transactions until it is deleted. There is no need to do that for every transaction./warning noteThis endpoint generates a new &#x60;fromAddress&#x60; each time./note

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.

  • 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.

  • :create_automatic_tokens_forwarding_rb (CreateAutomaticTokensForwardingRB)

Returns:



132
133
134
135
136
137
138
139
140
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
# File 'lib/crypto_apis/api/automatic_tokens_forwarding_api.rb', line 132

def create_automatic_tokens_forwarding_with_http_info(blockchain, network, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AutomaticTokensForwardingApi.create_automatic_tokens_forwarding ...'
  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 AutomaticTokensForwardingApi.create_automatic_tokens_forwarding"
  end
  # verify enum value
  allowable_values = ["bitcoin", "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 AutomaticTokensForwardingApi.create_automatic_tokens_forwarding"
  end
  # verify enum value
  allowable_values = ["mainnet", "testnet", "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
  # resource path
  local_var_path = '/blockchain-automations/{blockchain}/{network}/tokens-forwarding/automations'.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'
  content_type = @api_client.select_header_content_type(['application/json'])
  if !content_type.nil?
      header_params['Content-Type'] = content_type
  end

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'create_automatic_tokens_forwarding_rb'])

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

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

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

#delete_automatic_tokens_forwarding(blockchain, network, reference_id, opts = {}) ⇒ DeleteAutomaticTokensForwardingR

Delete Automatic Tokens Forwarding Through this endpoint customers can delete a forwarding function they have set for tokens (not coins). By setting a ‘fromAddress` and a `toAddress`, and specifying the amount, tokens can be transferred between addresses. A `feePriority` will be returned which represents the fee priority of the automation whether it is "SLOW", "STANDARD" OR "FAST". warningCurrently we support fungible tokens (ERC-20) only, NFTs (ERC-721) are not supported./warning warningThe subscription will work for all incoming transactions until it is deleted. There is no need to do that for every transaction./warning

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.

  • reference_id (String)

    Represents a unique ID used to reference the specific callback subscription.

  • 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:



208
209
210
211
# File 'lib/crypto_apis/api/automatic_tokens_forwarding_api.rb', line 208

def delete_automatic_tokens_forwarding(blockchain, network, reference_id, opts = {})
  data, _status_code, _headers = delete_automatic_tokens_forwarding_with_http_info(blockchain, network, reference_id, opts)
  data
end

#delete_automatic_tokens_forwarding_with_http_info(blockchain, network, reference_id, opts = {}) ⇒ Array<(DeleteAutomaticTokensForwardingR, Integer, Hash)>

Delete Automatic Tokens Forwarding Through this endpoint customers can delete a forwarding function they have set for tokens (not coins). By setting a &#x60;fromAddress&#x60; and a &#x60;toAddress&#x60;, and specifying the amount, tokens can be transferred between addresses. A &#x60;feePriority&#x60; will be returned which represents the fee priority of the automation whether it is &quot;SLOW&quot;, &quot;STANDARD&quot; OR &quot;FAST&quot;. warningCurrently we support fungible tokens (ERC-20) only, NFTs (ERC-721) are not supported./warning warningThe subscription will work for all incoming transactions until it is deleted. There is no need to do that for every transaction./warning

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.

  • reference_id (String)

    Represents a unique ID used to reference the specific callback subscription.

  • 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:



221
222
223
224
225
226
227
228
229
230
231
232
233
234
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
# File 'lib/crypto_apis/api/automatic_tokens_forwarding_api.rb', line 221

def delete_automatic_tokens_forwarding_with_http_info(blockchain, network, reference_id, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AutomaticTokensForwardingApi.delete_automatic_tokens_forwarding ...'
  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 AutomaticTokensForwardingApi.delete_automatic_tokens_forwarding"
  end
  # verify enum value
  allowable_values = ["bitcoin", "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 AutomaticTokensForwardingApi.delete_automatic_tokens_forwarding"
  end
  # verify enum value
  allowable_values = ["mainnet", "testnet", "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 'reference_id' is set
  if @api_client.config.client_side_validation && reference_id.nil?
    fail ArgumentError, "Missing the required parameter 'reference_id' when calling AutomaticTokensForwardingApi.delete_automatic_tokens_forwarding"
  end
  # resource path
  local_var_path = '/blockchain-automations/{blockchain}/{network}/tokens-forwarding/automations/{referenceId}'.sub('{' + 'blockchain' + '}', CGI.escape(blockchain.to_s)).sub('{' + 'network' + '}', CGI.escape(network.to_s)).sub('{' + 'referenceId' + '}', CGI.escape(reference_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'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

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

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

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

#get_fee_address_details(blockchain, network, opts = {}) ⇒ GetFeeAddressDetailsR

Get Fee Address Details Through this endpoint customers can obtain details about a fee address. Only one fee address per currency per network for a user’s account can be set no matter how many tokens or subscriptions they have or want to automatically forward. warningCurrently we support fungible tokens (ERC-20) only, NFTs (ERC-721) are not supported./warning

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.

  • 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:



295
296
297
298
# File 'lib/crypto_apis/api/automatic_tokens_forwarding_api.rb', line 295

def get_fee_address_details(blockchain, network, opts = {})
  data, _status_code, _headers = get_fee_address_details_with_http_info(blockchain, network, opts)
  data
end

#get_fee_address_details_with_http_info(blockchain, network, opts = {}) ⇒ Array<(GetFeeAddressDetailsR, Integer, Hash)>

Get Fee Address Details Through this endpoint customers can obtain details about a fee address. Only one fee address per currency per network for a user&#39;s account can be set no matter how many tokens or subscriptions they have or want to automatically forward. warningCurrently we support fungible tokens (ERC-20) only, NFTs (ERC-721) are not supported./warning

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.

  • 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:

  • (Array<(GetFeeAddressDetailsR, Integer, Hash)>)

    GetFeeAddressDetailsR data, response status code and response headers



307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
# File 'lib/crypto_apis/api/automatic_tokens_forwarding_api.rb', line 307

def get_fee_address_details_with_http_info(blockchain, network, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AutomaticTokensForwardingApi.get_fee_address_details ...'
  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 AutomaticTokensForwardingApi.get_fee_address_details"
  end
  # verify enum value
  allowable_values = ["bitcoin", "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 AutomaticTokensForwardingApi.get_fee_address_details"
  end
  # verify enum value
  allowable_values = ["mainnet", "testnet", "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
  # resource path
  local_var_path = '/blockchain-automations/{blockchain}/{network}/tokens-forwarding/fee-addresses'.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'])

  # form parameters
  form_params = opts[:form_params] || {}

  # http body (model)
  post_body = opts[:debug_body]

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

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

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

#list_tokens_forwarding_automations(blockchain, network, opts = {}) ⇒ ListTokensForwardingAutomationsR

List Tokens Forwarding Automations Through this endpoint customers can list all of their tokens forwarding automations (not coins). Customers can set up automatic forwarding functions for tokens by setting a ‘fromAddress` and a `toAddress`, and specifying the amount that can be transferred between addresses. A `feePriority` will be returned which represents the fee priority of the automation whether it is "SLOW", "STANDARD" OR "FAST". warningCurrently we support fungible tokens (ERC-20) only, NFTs (ERC-721) are not supported./warning warningThe subscription will work for all transactions until it is deleted. There is no need to do that for every transaction./warning

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.

  • 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:



379
380
381
382
# File 'lib/crypto_apis/api/automatic_tokens_forwarding_api.rb', line 379

def list_tokens_forwarding_automations(blockchain, network, opts = {})
  data, _status_code, _headers = list_tokens_forwarding_automations_with_http_info(blockchain, network, opts)
  data
end

#list_tokens_forwarding_automations_with_http_info(blockchain, network, opts = {}) ⇒ Array<(ListTokensForwardingAutomationsR, Integer, Hash)>

List Tokens Forwarding Automations Through this endpoint customers can list all of their tokens forwarding automations (not coins). Customers can set up automatic forwarding functions for tokens by setting a &#x60;fromAddress&#x60; and a &#x60;toAddress&#x60;, and specifying the amount that can be transferred between addresses. A &#x60;feePriority&#x60; will be returned which represents the fee priority of the automation whether it is &quot;SLOW&quot;, &quot;STANDARD&quot; OR &quot;FAST&quot;. warningCurrently we support fungible tokens (ERC-20) only, NFTs (ERC-721) are not supported./warning warningThe subscription will work for all transactions until it is deleted. There is no need to do that for every transaction./warning

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.

  • 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:



393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
# File 'lib/crypto_apis/api/automatic_tokens_forwarding_api.rb', line 393

def list_tokens_forwarding_automations_with_http_info(blockchain, network, opts = {})
  if @api_client.config.debugging
    @api_client.config.logger.debug 'Calling API: AutomaticTokensForwardingApi.list_tokens_forwarding_automations ...'
  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 AutomaticTokensForwardingApi.list_tokens_forwarding_automations"
  end
  # verify enum value
  allowable_values = ["bitcoin", "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 AutomaticTokensForwardingApi.list_tokens_forwarding_automations"
  end
  # verify enum value
  allowable_values = ["mainnet", "testnet", "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
  # resource path
  local_var_path = '/blockchain-automations/{blockchain}/{network}/tokens-forwarding/automations'.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?
  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] || 'ListTokensForwardingAutomationsR'

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

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