coinbase-sdk 0.7.0 → 0.11.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (155) hide show
  1. checksums.yaml +4 -4
  2. data/lib/coinbase/address/wallet_address.rb +28 -0
  3. data/lib/coinbase/address.rb +8 -3
  4. data/lib/coinbase/balance.rb +1 -1
  5. data/lib/coinbase/client/api/addresses_api.rb +1 -1
  6. data/lib/coinbase/client/api/assets_api.rb +1 -1
  7. data/lib/coinbase/client/api/balance_history_api.rb +1 -1
  8. data/lib/coinbase/client/api/contract_events_api.rb +1 -1
  9. data/lib/coinbase/client/api/contract_invocations_api.rb +1 -1
  10. data/lib/coinbase/client/api/external_addresses_api.rb +79 -1
  11. data/lib/coinbase/client/api/fund_api.rb +336 -0
  12. data/lib/coinbase/client/api/{wallet_stake_api.rb → mpc_wallet_stake_api.rb} +21 -21
  13. data/lib/coinbase/client/api/networks_api.rb +1 -1
  14. data/lib/coinbase/client/api/onchain_identity_api.rb +108 -0
  15. data/lib/coinbase/client/api/reputation_api.rb +160 -0
  16. data/lib/coinbase/client/api/server_signers_api.rb +1 -1
  17. data/lib/coinbase/client/api/smart_contracts_api.rb +81 -1
  18. data/lib/coinbase/client/api/stake_api.rb +158 -1
  19. data/lib/coinbase/client/api/trades_api.rb +1 -1
  20. data/lib/coinbase/client/api/transaction_history_api.rb +1 -1
  21. data/lib/coinbase/client/api/transfers_api.rb +1 -1
  22. data/lib/coinbase/client/api/users_api.rb +1 -1
  23. data/lib/coinbase/client/api/wallets_api.rb +1 -1
  24. data/lib/coinbase/client/api/webhooks_api.rb +6 -6
  25. data/lib/coinbase/client/api_client.rb +1 -1
  26. data/lib/coinbase/client/api_error.rb +1 -1
  27. data/lib/coinbase/client/configuration.rb +1 -1
  28. data/lib/coinbase/client/models/address.rb +1 -1
  29. data/lib/coinbase/client/models/address_balance_list.rb +1 -1
  30. data/lib/coinbase/client/models/address_historical_balance_list.rb +1 -1
  31. data/lib/coinbase/client/models/address_list.rb +1 -1
  32. data/lib/coinbase/client/models/address_reputation.rb +232 -0
  33. data/lib/coinbase/client/models/address_reputation_metadata.rb +376 -0
  34. data/lib/coinbase/client/models/address_risk.rb +223 -0
  35. data/lib/coinbase/client/models/address_transaction_list.rb +1 -1
  36. data/lib/coinbase/client/models/asset.rb +1 -1
  37. data/lib/coinbase/client/models/balance.rb +1 -1
  38. data/lib/coinbase/client/models/broadcast_contract_invocation_request.rb +1 -1
  39. data/lib/coinbase/client/models/broadcast_staking_operation_request.rb +1 -1
  40. data/lib/coinbase/client/models/broadcast_trade_request.rb +1 -1
  41. data/lib/coinbase/client/models/broadcast_transfer_request.rb +1 -1
  42. data/lib/coinbase/client/models/build_staking_operation_request.rb +2 -1
  43. data/lib/coinbase/client/models/contract_event.rb +1 -1
  44. data/lib/coinbase/client/models/contract_event_list.rb +1 -1
  45. data/lib/coinbase/client/models/contract_invocation.rb +1 -1
  46. data/lib/coinbase/client/models/contract_invocation_list.rb +1 -1
  47. data/lib/coinbase/client/models/create_address_request.rb +1 -1
  48. data/lib/coinbase/client/models/create_contract_invocation_request.rb +1 -1
  49. data/lib/coinbase/client/models/create_fund_operation_request.rb +249 -0
  50. data/lib/coinbase/client/models/create_fund_quote_request.rb +239 -0
  51. data/lib/coinbase/client/models/create_payload_signature_request.rb +1 -1
  52. data/lib/coinbase/client/models/create_server_signer_request.rb +1 -1
  53. data/lib/coinbase/client/models/create_smart_contract_request.rb +1 -1
  54. data/lib/coinbase/client/models/create_staking_operation_request.rb +2 -1
  55. data/lib/coinbase/client/models/create_trade_request.rb +1 -1
  56. data/lib/coinbase/client/models/create_transfer_request.rb +1 -1
  57. data/lib/coinbase/client/models/create_wallet_request.rb +1 -1
  58. data/lib/coinbase/client/models/create_wallet_request_wallet.rb +1 -1
  59. data/lib/coinbase/client/models/create_wallet_webhook_request.rb +2 -2
  60. data/lib/coinbase/client/models/create_webhook_request.rb +1 -1
  61. data/lib/coinbase/client/models/crypto_amount.rb +239 -0
  62. data/lib/coinbase/client/models/deploy_smart_contract_request.rb +1 -1
  63. data/lib/coinbase/client/models/erc20_transfer_event.rb +1 -1
  64. data/lib/coinbase/client/models/erc721_transfer_event.rb +1 -1
  65. data/lib/coinbase/client/models/error.rb +1 -1
  66. data/lib/coinbase/client/models/ethereum_token_transfer.rb +327 -0
  67. data/lib/coinbase/client/models/ethereum_transaction.rb +13 -2
  68. data/lib/coinbase/client/models/ethereum_transaction_access.rb +1 -1
  69. data/lib/coinbase/client/models/ethereum_transaction_access_list.rb +1 -1
  70. data/lib/coinbase/client/models/ethereum_transaction_flattened_trace.rb +1 -1
  71. data/lib/coinbase/client/models/ethereum_validator_metadata.rb +1 -1
  72. data/lib/coinbase/client/models/faucet_transaction.rb +21 -5
  73. data/lib/coinbase/client/models/feature_set.rb +1 -1
  74. data/lib/coinbase/client/models/fetch_historical_staking_balances200_response.rb +1 -1
  75. data/lib/coinbase/client/models/fetch_staking_rewards200_response.rb +1 -1
  76. data/lib/coinbase/client/models/fetch_staking_rewards_request.rb +1 -1
  77. data/lib/coinbase/client/models/fiat_amount.rb +240 -0
  78. data/lib/coinbase/client/models/fund_operation.rb +373 -0
  79. data/lib/coinbase/client/models/fund_operation_fees.rb +238 -0
  80. data/lib/coinbase/client/models/fund_operation_list.rb +275 -0
  81. data/lib/coinbase/client/models/fund_quote.rb +339 -0
  82. data/lib/coinbase/client/models/get_staking_context_request.rb +2 -1
  83. data/lib/coinbase/client/models/historical_balance.rb +1 -1
  84. data/lib/coinbase/client/models/multi_token_contract_options.rb +1 -1
  85. data/lib/coinbase/client/models/network.rb +1 -1
  86. data/lib/coinbase/client/models/network_identifier.rb +1 -1
  87. data/lib/coinbase/client/models/nft_contract_options.rb +1 -1
  88. data/lib/coinbase/client/models/onchain_name.rb +357 -0
  89. data/lib/coinbase/client/models/onchain_name_list.rb +262 -0
  90. data/lib/coinbase/client/models/payload_signature.rb +1 -1
  91. data/lib/coinbase/client/models/payload_signature_list.rb +1 -1
  92. data/lib/coinbase/client/models/read_contract_request.rb +249 -0
  93. data/lib/coinbase/client/models/seed_creation_event.rb +1 -1
  94. data/lib/coinbase/client/models/seed_creation_event_result.rb +1 -1
  95. data/lib/coinbase/client/models/server_signer.rb +1 -1
  96. data/lib/coinbase/client/models/server_signer_event.rb +1 -1
  97. data/lib/coinbase/client/models/server_signer_event_event.rb +1 -1
  98. data/lib/coinbase/client/models/server_signer_event_list.rb +1 -1
  99. data/lib/coinbase/client/models/server_signer_list.rb +1 -1
  100. data/lib/coinbase/client/models/signature_creation_event.rb +1 -1
  101. data/lib/coinbase/client/models/signature_creation_event_result.rb +1 -1
  102. data/lib/coinbase/client/models/signed_voluntary_exit_message_metadata.rb +1 -1
  103. data/lib/coinbase/client/models/smart_contract.rb +1 -1
  104. data/lib/coinbase/client/models/smart_contract_list.rb +1 -1
  105. data/lib/coinbase/client/models/smart_contract_options.rb +1 -1
  106. data/lib/coinbase/client/models/smart_contract_type.rb +1 -1
  107. data/lib/coinbase/client/models/solidity_value.rb +287 -0
  108. data/lib/coinbase/client/models/sponsored_send.rb +1 -1
  109. data/lib/coinbase/client/models/staking_balance.rb +1 -1
  110. data/lib/coinbase/client/models/staking_context.rb +1 -1
  111. data/lib/coinbase/client/models/staking_context_context.rb +1 -1
  112. data/lib/coinbase/client/models/staking_operation.rb +1 -1
  113. data/lib/coinbase/client/models/staking_operation_metadata.rb +1 -1
  114. data/lib/coinbase/client/models/staking_reward.rb +1 -1
  115. data/lib/coinbase/client/models/staking_reward_format.rb +1 -1
  116. data/lib/coinbase/client/models/staking_reward_usd_value.rb +1 -1
  117. data/lib/coinbase/client/models/token_contract_options.rb +1 -1
  118. data/lib/coinbase/client/models/token_transfer_type.rb +43 -0
  119. data/lib/coinbase/client/models/trade.rb +1 -1
  120. data/lib/coinbase/client/models/trade_list.rb +1 -1
  121. data/lib/coinbase/client/models/transaction.rb +1 -1
  122. data/lib/coinbase/client/models/transaction_content.rb +1 -1
  123. data/lib/coinbase/client/models/transaction_type.rb +1 -1
  124. data/lib/coinbase/client/models/transfer.rb +1 -1
  125. data/lib/coinbase/client/models/transfer_list.rb +1 -1
  126. data/lib/coinbase/client/models/update_webhook_request.rb +1 -8
  127. data/lib/coinbase/client/models/user.rb +1 -1
  128. data/lib/coinbase/client/models/validator.rb +1 -1
  129. data/lib/coinbase/client/models/validator_details.rb +1 -1
  130. data/lib/coinbase/client/models/validator_list.rb +1 -1
  131. data/lib/coinbase/client/models/validator_status.rb +1 -1
  132. data/lib/coinbase/client/models/wallet.rb +1 -1
  133. data/lib/coinbase/client/models/wallet_list.rb +1 -1
  134. data/lib/coinbase/client/models/webhook.rb +1 -1
  135. data/lib/coinbase/client/models/webhook_event_filter.rb +1 -1
  136. data/lib/coinbase/client/models/webhook_event_type.rb +1 -1
  137. data/lib/coinbase/client/models/webhook_event_type_filter.rb +1 -1
  138. data/lib/coinbase/client/models/webhook_list.rb +1 -1
  139. data/lib/coinbase/client/models/webhook_wallet_activity_filter.rb +1 -1
  140. data/lib/coinbase/client/version.rb +1 -1
  141. data/lib/coinbase/client.rb +23 -3
  142. data/lib/coinbase/crypto_amount.rb +62 -0
  143. data/lib/coinbase/faucet_transaction.rb +64 -4
  144. data/lib/coinbase/fiat_amount.rb +40 -0
  145. data/lib/coinbase/fund_operation.rb +228 -0
  146. data/lib/coinbase/fund_quote.rb +149 -0
  147. data/lib/coinbase/smart_contract.rb +95 -0
  148. data/lib/coinbase/staking_operation.rb +2 -2
  149. data/lib/coinbase/transaction.rb +8 -2
  150. data/lib/coinbase/validator.rb +7 -10
  151. data/lib/coinbase/version.rb +1 -1
  152. data/lib/coinbase/wallet.rb +13 -1
  153. data/lib/coinbase.rb +4 -0
  154. metadata +27 -4
  155. data/lib/coinbase/client/api/validators_api.rb +0 -179
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coinbase-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.11.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuga Cohler
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-09-26 00:00:00.000000000 Z
11
+ date: 2024-11-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bigdecimal
@@ -283,7 +283,11 @@ files:
283
283
  - lib/coinbase/client/api/contract_events_api.rb
284
284
  - lib/coinbase/client/api/contract_invocations_api.rb
285
285
  - lib/coinbase/client/api/external_addresses_api.rb
286
+ - lib/coinbase/client/api/fund_api.rb
287
+ - lib/coinbase/client/api/mpc_wallet_stake_api.rb
286
288
  - lib/coinbase/client/api/networks_api.rb
289
+ - lib/coinbase/client/api/onchain_identity_api.rb
290
+ - lib/coinbase/client/api/reputation_api.rb
287
291
  - lib/coinbase/client/api/server_signers_api.rb
288
292
  - lib/coinbase/client/api/smart_contracts_api.rb
289
293
  - lib/coinbase/client/api/stake_api.rb
@@ -291,8 +295,6 @@ files:
291
295
  - lib/coinbase/client/api/transaction_history_api.rb
292
296
  - lib/coinbase/client/api/transfers_api.rb
293
297
  - lib/coinbase/client/api/users_api.rb
294
- - lib/coinbase/client/api/validators_api.rb
295
- - lib/coinbase/client/api/wallet_stake_api.rb
296
298
  - lib/coinbase/client/api/wallets_api.rb
297
299
  - lib/coinbase/client/api/webhooks_api.rb
298
300
  - lib/coinbase/client/api_client.rb
@@ -302,6 +304,9 @@ files:
302
304
  - lib/coinbase/client/models/address_balance_list.rb
303
305
  - lib/coinbase/client/models/address_historical_balance_list.rb
304
306
  - lib/coinbase/client/models/address_list.rb
307
+ - lib/coinbase/client/models/address_reputation.rb
308
+ - lib/coinbase/client/models/address_reputation_metadata.rb
309
+ - lib/coinbase/client/models/address_risk.rb
305
310
  - lib/coinbase/client/models/address_transaction_list.rb
306
311
  - lib/coinbase/client/models/asset.rb
307
312
  - lib/coinbase/client/models/balance.rb
@@ -316,6 +321,8 @@ files:
316
321
  - lib/coinbase/client/models/contract_invocation_list.rb
317
322
  - lib/coinbase/client/models/create_address_request.rb
318
323
  - lib/coinbase/client/models/create_contract_invocation_request.rb
324
+ - lib/coinbase/client/models/create_fund_operation_request.rb
325
+ - lib/coinbase/client/models/create_fund_quote_request.rb
319
326
  - lib/coinbase/client/models/create_payload_signature_request.rb
320
327
  - lib/coinbase/client/models/create_server_signer_request.rb
321
328
  - lib/coinbase/client/models/create_smart_contract_request.rb
@@ -326,10 +333,12 @@ files:
326
333
  - lib/coinbase/client/models/create_wallet_request_wallet.rb
327
334
  - lib/coinbase/client/models/create_wallet_webhook_request.rb
328
335
  - lib/coinbase/client/models/create_webhook_request.rb
336
+ - lib/coinbase/client/models/crypto_amount.rb
329
337
  - lib/coinbase/client/models/deploy_smart_contract_request.rb
330
338
  - lib/coinbase/client/models/erc20_transfer_event.rb
331
339
  - lib/coinbase/client/models/erc721_transfer_event.rb
332
340
  - lib/coinbase/client/models/error.rb
341
+ - lib/coinbase/client/models/ethereum_token_transfer.rb
333
342
  - lib/coinbase/client/models/ethereum_transaction.rb
334
343
  - lib/coinbase/client/models/ethereum_transaction_access.rb
335
344
  - lib/coinbase/client/models/ethereum_transaction_access_list.rb
@@ -340,14 +349,22 @@ files:
340
349
  - lib/coinbase/client/models/fetch_historical_staking_balances200_response.rb
341
350
  - lib/coinbase/client/models/fetch_staking_rewards200_response.rb
342
351
  - lib/coinbase/client/models/fetch_staking_rewards_request.rb
352
+ - lib/coinbase/client/models/fiat_amount.rb
353
+ - lib/coinbase/client/models/fund_operation.rb
354
+ - lib/coinbase/client/models/fund_operation_fees.rb
355
+ - lib/coinbase/client/models/fund_operation_list.rb
356
+ - lib/coinbase/client/models/fund_quote.rb
343
357
  - lib/coinbase/client/models/get_staking_context_request.rb
344
358
  - lib/coinbase/client/models/historical_balance.rb
345
359
  - lib/coinbase/client/models/multi_token_contract_options.rb
346
360
  - lib/coinbase/client/models/network.rb
347
361
  - lib/coinbase/client/models/network_identifier.rb
348
362
  - lib/coinbase/client/models/nft_contract_options.rb
363
+ - lib/coinbase/client/models/onchain_name.rb
364
+ - lib/coinbase/client/models/onchain_name_list.rb
349
365
  - lib/coinbase/client/models/payload_signature.rb
350
366
  - lib/coinbase/client/models/payload_signature_list.rb
367
+ - lib/coinbase/client/models/read_contract_request.rb
351
368
  - lib/coinbase/client/models/seed_creation_event.rb
352
369
  - lib/coinbase/client/models/seed_creation_event_result.rb
353
370
  - lib/coinbase/client/models/server_signer.rb
@@ -362,6 +379,7 @@ files:
362
379
  - lib/coinbase/client/models/smart_contract_list.rb
363
380
  - lib/coinbase/client/models/smart_contract_options.rb
364
381
  - lib/coinbase/client/models/smart_contract_type.rb
382
+ - lib/coinbase/client/models/solidity_value.rb
365
383
  - lib/coinbase/client/models/sponsored_send.rb
366
384
  - lib/coinbase/client/models/staking_balance.rb
367
385
  - lib/coinbase/client/models/staking_context.rb
@@ -372,6 +390,7 @@ files:
372
390
  - lib/coinbase/client/models/staking_reward_format.rb
373
391
  - lib/coinbase/client/models/staking_reward_usd_value.rb
374
392
  - lib/coinbase/client/models/token_contract_options.rb
393
+ - lib/coinbase/client/models/token_transfer_type.rb
375
394
  - lib/coinbase/client/models/trade.rb
376
395
  - lib/coinbase/client/models/trade_list.rb
377
396
  - lib/coinbase/client/models/transaction.rb
@@ -398,9 +417,13 @@ files:
398
417
  - lib/coinbase/contract_event.rb
399
418
  - lib/coinbase/contract_invocation.rb
400
419
  - lib/coinbase/correlation.rb
420
+ - lib/coinbase/crypto_amount.rb
401
421
  - lib/coinbase/destination.rb
402
422
  - lib/coinbase/errors.rb
403
423
  - lib/coinbase/faucet_transaction.rb
424
+ - lib/coinbase/fiat_amount.rb
425
+ - lib/coinbase/fund_operation.rb
426
+ - lib/coinbase/fund_quote.rb
404
427
  - lib/coinbase/historical_balance.rb
405
428
  - lib/coinbase/middleware.rb
406
429
  - lib/coinbase/network.rb
@@ -1,179 +0,0 @@
1
- =begin
2
- #Coinbase Platform API
3
-
4
- #This is the OpenAPI 3.0 specification for the Coinbase Platform APIs, used in conjunction with the Coinbase Platform SDKs.
5
-
6
- The version of the OpenAPI document: 0.0.1-alpha
7
-
8
- Generated by: https://openapi-generator.tech
9
- Generator version: 7.8.0
10
-
11
- =end
12
-
13
- require 'cgi'
14
-
15
- module Coinbase::Client
16
- class ValidatorsApi
17
- attr_accessor :api_client
18
-
19
- def initialize(api_client = ApiClient.default)
20
- @api_client = api_client
21
- end
22
- # Get a validator belonging to the CDP project
23
- # Get a validator belonging to the user for a given network, asset and id.
24
- # @param network_id [String] The ID of the blockchain network.
25
- # @param asset_id [String] The symbol of the asset to get the validator for.
26
- # @param validator_id [String] The unique id of the validator to fetch details for.
27
- # @param [Hash] opts the optional parameters
28
- # @return [Validator]
29
- def get_validator(network_id, asset_id, validator_id, opts = {})
30
- data, _status_code, _headers = get_validator_with_http_info(network_id, asset_id, validator_id, opts)
31
- data
32
- end
33
-
34
- # Get a validator belonging to the CDP project
35
- # Get a validator belonging to the user for a given network, asset and id.
36
- # @param network_id [String] The ID of the blockchain network.
37
- # @param asset_id [String] The symbol of the asset to get the validator for.
38
- # @param validator_id [String] The unique id of the validator to fetch details for.
39
- # @param [Hash] opts the optional parameters
40
- # @return [Array<(Validator, Integer, Hash)>] Validator data, response status code and response headers
41
- def get_validator_with_http_info(network_id, asset_id, validator_id, opts = {})
42
- if @api_client.config.debugging
43
- @api_client.config.logger.debug 'Calling API: ValidatorsApi.get_validator ...'
44
- end
45
- # verify the required parameter 'network_id' is set
46
- if @api_client.config.client_side_validation && network_id.nil?
47
- fail ArgumentError, "Missing the required parameter 'network_id' when calling ValidatorsApi.get_validator"
48
- end
49
- # verify the required parameter 'asset_id' is set
50
- if @api_client.config.client_side_validation && asset_id.nil?
51
- fail ArgumentError, "Missing the required parameter 'asset_id' when calling ValidatorsApi.get_validator"
52
- end
53
- # verify the required parameter 'validator_id' is set
54
- if @api_client.config.client_side_validation && validator_id.nil?
55
- fail ArgumentError, "Missing the required parameter 'validator_id' when calling ValidatorsApi.get_validator"
56
- end
57
- # resource path
58
- local_var_path = '/v1/networks/{network_id}/assets/{asset_id}/validators/{validator_id}'.sub('{' + 'network_id' + '}', CGI.escape(network_id.to_s)).sub('{' + 'asset_id' + '}', CGI.escape(asset_id.to_s)).sub('{' + 'validator_id' + '}', CGI.escape(validator_id.to_s))
59
-
60
- # query parameters
61
- query_params = opts[:query_params] || {}
62
-
63
- # header parameters
64
- header_params = opts[:header_params] || {}
65
- # HTTP header 'Accept' (if needed)
66
- header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
67
-
68
- # form parameters
69
- form_params = opts[:form_params] || {}
70
-
71
- # http body (model)
72
- post_body = opts[:debug_body]
73
-
74
- # return_type
75
- return_type = opts[:debug_return_type] || 'Validator'
76
-
77
- # auth_names
78
- auth_names = opts[:debug_auth_names] || []
79
-
80
- new_options = opts.merge(
81
- :operation => :"ValidatorsApi.get_validator",
82
- :header_params => header_params,
83
- :query_params => query_params,
84
- :form_params => form_params,
85
- :body => post_body,
86
- :auth_names => auth_names,
87
- :return_type => return_type
88
- )
89
-
90
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
91
- if @api_client.config.debugging
92
- @api_client.config.logger.debug "API called: ValidatorsApi#get_validator\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
93
- end
94
- return data, status_code, headers
95
- end
96
-
97
- # List validators belonging to the CDP project
98
- # List validators belonging to the user for a given network and asset.
99
- # @param network_id [String] The ID of the blockchain network.
100
- # @param asset_id [String] The symbol of the asset to get the validators for.
101
- # @param [Hash] opts the optional parameters
102
- # @option opts [ValidatorStatus] :status A filter to list validators based on a status.
103
- # @option opts [Integer] :limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 50.
104
- # @option opts [String] :page A cursor for pagination across multiple pages of results. Don&#39;t include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results.
105
- # @return [ValidatorList]
106
- def list_validators(network_id, asset_id, opts = {})
107
- data, _status_code, _headers = list_validators_with_http_info(network_id, asset_id, opts)
108
- data
109
- end
110
-
111
- # List validators belonging to the CDP project
112
- # List validators belonging to the user for a given network and asset.
113
- # @param network_id [String] The ID of the blockchain network.
114
- # @param asset_id [String] The symbol of the asset to get the validators for.
115
- # @param [Hash] opts the optional parameters
116
- # @option opts [ValidatorStatus] :status A filter to list validators based on a status.
117
- # @option opts [Integer] :limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 50.
118
- # @option opts [String] :page A cursor for pagination across multiple pages of results. Don&#39;t include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results.
119
- # @return [Array<(ValidatorList, Integer, Hash)>] ValidatorList data, response status code and response headers
120
- def list_validators_with_http_info(network_id, asset_id, opts = {})
121
- if @api_client.config.debugging
122
- @api_client.config.logger.debug 'Calling API: ValidatorsApi.list_validators ...'
123
- end
124
- # verify the required parameter 'network_id' is set
125
- if @api_client.config.client_side_validation && network_id.nil?
126
- fail ArgumentError, "Missing the required parameter 'network_id' when calling ValidatorsApi.list_validators"
127
- end
128
- # verify the required parameter 'asset_id' is set
129
- if @api_client.config.client_side_validation && asset_id.nil?
130
- fail ArgumentError, "Missing the required parameter 'asset_id' when calling ValidatorsApi.list_validators"
131
- end
132
- if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'].to_s.length > 5000
133
- fail ArgumentError, 'invalid value for "opts[:"page"]" when calling ValidatorsApi.list_validators, the character length must be smaller than or equal to 5000.'
134
- end
135
-
136
- # resource path
137
- local_var_path = '/v1/networks/{network_id}/assets/{asset_id}/validators'.sub('{' + 'network_id' + '}', CGI.escape(network_id.to_s)).sub('{' + 'asset_id' + '}', CGI.escape(asset_id.to_s))
138
-
139
- # query parameters
140
- query_params = opts[:query_params] || {}
141
- query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
142
- query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
143
- query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
144
-
145
- # header parameters
146
- header_params = opts[:header_params] || {}
147
- # HTTP header 'Accept' (if needed)
148
- header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
149
-
150
- # form parameters
151
- form_params = opts[:form_params] || {}
152
-
153
- # http body (model)
154
- post_body = opts[:debug_body]
155
-
156
- # return_type
157
- return_type = opts[:debug_return_type] || 'ValidatorList'
158
-
159
- # auth_names
160
- auth_names = opts[:debug_auth_names] || []
161
-
162
- new_options = opts.merge(
163
- :operation => :"ValidatorsApi.list_validators",
164
- :header_params => header_params,
165
- :query_params => query_params,
166
- :form_params => form_params,
167
- :body => post_body,
168
- :auth_names => auth_names,
169
- :return_type => return_type
170
- )
171
-
172
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
173
- if @api_client.config.debugging
174
- @api_client.config.logger.debug "API called: ValidatorsApi#list_validators\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
175
- end
176
- return data, status_code, headers
177
- end
178
- end
179
- end