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
@@ -6,14 +6,14 @@
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.8.0
9
+ Generator version: 7.9.0
10
10
 
11
11
  =end
12
12
 
13
13
  require 'cgi'
14
14
 
15
15
  module Coinbase::Client
16
- class WalletStakeApi
16
+ class MPCWalletStakeApi
17
17
  attr_accessor :api_client
18
18
 
19
19
  def initialize(api_client = ApiClient.default)
@@ -42,23 +42,23 @@ module Coinbase::Client
42
42
  # @return [Array<(StakingOperation, Integer, Hash)>] StakingOperation data, response status code and response headers
43
43
  def broadcast_staking_operation_with_http_info(wallet_id, address_id, staking_operation_id, broadcast_staking_operation_request, opts = {})
44
44
  if @api_client.config.debugging
45
- @api_client.config.logger.debug 'Calling API: WalletStakeApi.broadcast_staking_operation ...'
45
+ @api_client.config.logger.debug 'Calling API: MPCWalletStakeApi.broadcast_staking_operation ...'
46
46
  end
47
47
  # verify the required parameter 'wallet_id' is set
48
48
  if @api_client.config.client_side_validation && wallet_id.nil?
49
- fail ArgumentError, "Missing the required parameter 'wallet_id' when calling WalletStakeApi.broadcast_staking_operation"
49
+ fail ArgumentError, "Missing the required parameter 'wallet_id' when calling MPCWalletStakeApi.broadcast_staking_operation"
50
50
  end
51
51
  # verify the required parameter 'address_id' is set
52
52
  if @api_client.config.client_side_validation && address_id.nil?
53
- fail ArgumentError, "Missing the required parameter 'address_id' when calling WalletStakeApi.broadcast_staking_operation"
53
+ fail ArgumentError, "Missing the required parameter 'address_id' when calling MPCWalletStakeApi.broadcast_staking_operation"
54
54
  end
55
55
  # verify the required parameter 'staking_operation_id' is set
56
56
  if @api_client.config.client_side_validation && staking_operation_id.nil?
57
- fail ArgumentError, "Missing the required parameter 'staking_operation_id' when calling WalletStakeApi.broadcast_staking_operation"
57
+ fail ArgumentError, "Missing the required parameter 'staking_operation_id' when calling MPCWalletStakeApi.broadcast_staking_operation"
58
58
  end
59
59
  # verify the required parameter 'broadcast_staking_operation_request' is set
60
60
  if @api_client.config.client_side_validation && broadcast_staking_operation_request.nil?
61
- fail ArgumentError, "Missing the required parameter 'broadcast_staking_operation_request' when calling WalletStakeApi.broadcast_staking_operation"
61
+ fail ArgumentError, "Missing the required parameter 'broadcast_staking_operation_request' when calling MPCWalletStakeApi.broadcast_staking_operation"
62
62
  end
63
63
  # resource path
64
64
  local_var_path = '/v1/wallets/{wallet_id}/addresses/{address_id}/staking_operations/{staking_operation_id}/broadcast'.sub('{' + 'wallet_id' + '}', CGI.escape(wallet_id.to_s)).sub('{' + 'address_id' + '}', CGI.escape(address_id.to_s)).sub('{' + 'staking_operation_id' + '}', CGI.escape(staking_operation_id.to_s))
@@ -89,7 +89,7 @@ module Coinbase::Client
89
89
  auth_names = opts[:debug_auth_names] || []
90
90
 
91
91
  new_options = opts.merge(
92
- :operation => :"WalletStakeApi.broadcast_staking_operation",
92
+ :operation => :"MPCWalletStakeApi.broadcast_staking_operation",
93
93
  :header_params => header_params,
94
94
  :query_params => query_params,
95
95
  :form_params => form_params,
@@ -100,7 +100,7 @@ module Coinbase::Client
100
100
 
101
101
  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
102
102
  if @api_client.config.debugging
103
- @api_client.config.logger.debug "API called: WalletStakeApi#broadcast_staking_operation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
103
+ @api_client.config.logger.debug "API called: MPCWalletStakeApi#broadcast_staking_operation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
104
104
  end
105
105
  return data, status_code, headers
106
106
  end
@@ -126,19 +126,19 @@ module Coinbase::Client
126
126
  # @return [Array<(StakingOperation, Integer, Hash)>] StakingOperation data, response status code and response headers
127
127
  def create_staking_operation_with_http_info(wallet_id, address_id, create_staking_operation_request, opts = {})
128
128
  if @api_client.config.debugging
129
- @api_client.config.logger.debug 'Calling API: WalletStakeApi.create_staking_operation ...'
129
+ @api_client.config.logger.debug 'Calling API: MPCWalletStakeApi.create_staking_operation ...'
130
130
  end
131
131
  # verify the required parameter 'wallet_id' is set
132
132
  if @api_client.config.client_side_validation && wallet_id.nil?
133
- fail ArgumentError, "Missing the required parameter 'wallet_id' when calling WalletStakeApi.create_staking_operation"
133
+ fail ArgumentError, "Missing the required parameter 'wallet_id' when calling MPCWalletStakeApi.create_staking_operation"
134
134
  end
135
135
  # verify the required parameter 'address_id' is set
136
136
  if @api_client.config.client_side_validation && address_id.nil?
137
- fail ArgumentError, "Missing the required parameter 'address_id' when calling WalletStakeApi.create_staking_operation"
137
+ fail ArgumentError, "Missing the required parameter 'address_id' when calling MPCWalletStakeApi.create_staking_operation"
138
138
  end
139
139
  # verify the required parameter 'create_staking_operation_request' is set
140
140
  if @api_client.config.client_side_validation && create_staking_operation_request.nil?
141
- fail ArgumentError, "Missing the required parameter 'create_staking_operation_request' when calling WalletStakeApi.create_staking_operation"
141
+ fail ArgumentError, "Missing the required parameter 'create_staking_operation_request' when calling MPCWalletStakeApi.create_staking_operation"
142
142
  end
143
143
  # resource path
144
144
  local_var_path = '/v1/wallets/{wallet_id}/addresses/{address_id}/staking_operations'.sub('{' + 'wallet_id' + '}', CGI.escape(wallet_id.to_s)).sub('{' + 'address_id' + '}', CGI.escape(address_id.to_s))
@@ -169,7 +169,7 @@ module Coinbase::Client
169
169
  auth_names = opts[:debug_auth_names] || []
170
170
 
171
171
  new_options = opts.merge(
172
- :operation => :"WalletStakeApi.create_staking_operation",
172
+ :operation => :"MPCWalletStakeApi.create_staking_operation",
173
173
  :header_params => header_params,
174
174
  :query_params => query_params,
175
175
  :form_params => form_params,
@@ -180,7 +180,7 @@ module Coinbase::Client
180
180
 
181
181
  data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
182
182
  if @api_client.config.debugging
183
- @api_client.config.logger.debug "API called: WalletStakeApi#create_staking_operation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
183
+ @api_client.config.logger.debug "API called: MPCWalletStakeApi#create_staking_operation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
184
184
  end
185
185
  return data, status_code, headers
186
186
  end
@@ -206,19 +206,19 @@ module Coinbase::Client
206
206
  # @return [Array<(StakingOperation, Integer, Hash)>] StakingOperation data, response status code and response headers
207
207
  def get_staking_operation_with_http_info(wallet_id, address_id, staking_operation_id, opts = {})
208
208
  if @api_client.config.debugging
209
- @api_client.config.logger.debug 'Calling API: WalletStakeApi.get_staking_operation ...'
209
+ @api_client.config.logger.debug 'Calling API: MPCWalletStakeApi.get_staking_operation ...'
210
210
  end
211
211
  # verify the required parameter 'wallet_id' is set
212
212
  if @api_client.config.client_side_validation && wallet_id.nil?
213
- fail ArgumentError, "Missing the required parameter 'wallet_id' when calling WalletStakeApi.get_staking_operation"
213
+ fail ArgumentError, "Missing the required parameter 'wallet_id' when calling MPCWalletStakeApi.get_staking_operation"
214
214
  end
215
215
  # verify the required parameter 'address_id' is set
216
216
  if @api_client.config.client_side_validation && address_id.nil?
217
- fail ArgumentError, "Missing the required parameter 'address_id' when calling WalletStakeApi.get_staking_operation"
217
+ fail ArgumentError, "Missing the required parameter 'address_id' when calling MPCWalletStakeApi.get_staking_operation"
218
218
  end
219
219
  # verify the required parameter 'staking_operation_id' is set
220
220
  if @api_client.config.client_side_validation && staking_operation_id.nil?
221
- fail ArgumentError, "Missing the required parameter 'staking_operation_id' when calling WalletStakeApi.get_staking_operation"
221
+ fail ArgumentError, "Missing the required parameter 'staking_operation_id' when calling MPCWalletStakeApi.get_staking_operation"
222
222
  end
223
223
  # resource path
224
224
  local_var_path = '/v1/wallets/{wallet_id}/addresses/{address_id}/staking_operations/{staking_operation_id}'.sub('{' + 'wallet_id' + '}', CGI.escape(wallet_id.to_s)).sub('{' + 'address_id' + '}', CGI.escape(address_id.to_s)).sub('{' + 'staking_operation_id' + '}', CGI.escape(staking_operation_id.to_s))
@@ -244,7 +244,7 @@ module Coinbase::Client
244
244
  auth_names = opts[:debug_auth_names] || []
245
245
 
246
246
  new_options = opts.merge(
247
- :operation => :"WalletStakeApi.get_staking_operation",
247
+ :operation => :"MPCWalletStakeApi.get_staking_operation",
248
248
  :header_params => header_params,
249
249
  :query_params => query_params,
250
250
  :form_params => form_params,
@@ -255,7 +255,7 @@ module Coinbase::Client
255
255
 
256
256
  data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
257
257
  if @api_client.config.debugging
258
- @api_client.config.logger.debug "API called: WalletStakeApi#get_staking_operation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
258
+ @api_client.config.logger.debug "API called: MPCWalletStakeApi#get_staking_operation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
259
259
  end
260
260
  return data, status_code, headers
261
261
  end
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.8.0
9
+ Generator version: 7.9.0
10
10
 
11
11
  =end
12
12
 
@@ -0,0 +1,108 @@
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.9.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module Coinbase::Client
16
+ class OnchainIdentityApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Obtains onchain identity for an address on a specific network
23
+ # Obtains onchain identity for an address on a specific network
24
+ # @param network_id [String] The ID of the blockchain network
25
+ # @param address_id [String] The ID of the address to fetch the identity for
26
+ # @param [Hash] opts the optional parameters
27
+ # @option opts [Array<String>] :roles A filter by role of the names related to this address (managed or owned)
28
+ # @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 10.
29
+ # @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.
30
+ # @return [OnchainNameList]
31
+ def resolve_identity_by_address(network_id, address_id, opts = {})
32
+ data, _status_code, _headers = resolve_identity_by_address_with_http_info(network_id, address_id, opts)
33
+ data
34
+ end
35
+
36
+ # Obtains onchain identity for an address on a specific network
37
+ # Obtains onchain identity for an address on a specific network
38
+ # @param network_id [String] The ID of the blockchain network
39
+ # @param address_id [String] The ID of the address to fetch the identity for
40
+ # @param [Hash] opts the optional parameters
41
+ # @option opts [Array<String>] :roles A filter by role of the names related to this address (managed or owned)
42
+ # @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 10.
43
+ # @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.
44
+ # @return [Array<(OnchainNameList, Integer, Hash)>] OnchainNameList data, response status code and response headers
45
+ def resolve_identity_by_address_with_http_info(network_id, address_id, opts = {})
46
+ if @api_client.config.debugging
47
+ @api_client.config.logger.debug 'Calling API: OnchainIdentityApi.resolve_identity_by_address ...'
48
+ end
49
+ # verify the required parameter 'network_id' is set
50
+ if @api_client.config.client_side_validation && network_id.nil?
51
+ fail ArgumentError, "Missing the required parameter 'network_id' when calling OnchainIdentityApi.resolve_identity_by_address"
52
+ end
53
+ # verify the required parameter 'address_id' is set
54
+ if @api_client.config.client_side_validation && address_id.nil?
55
+ fail ArgumentError, "Missing the required parameter 'address_id' when calling OnchainIdentityApi.resolve_identity_by_address"
56
+ end
57
+ allowable_values = ["managed", "owned", "unknown_default_open_api"]
58
+ if @api_client.config.client_side_validation && opts[:'roles'] && !opts[:'roles'].all? { |item| allowable_values.include?(item) }
59
+ fail ArgumentError, "invalid value for \"roles\", must include one of #{allowable_values}"
60
+ end
61
+ if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'].to_s.length > 5000
62
+ fail ArgumentError, 'invalid value for "opts[:"page"]" when calling OnchainIdentityApi.resolve_identity_by_address, the character length must be smaller than or equal to 5000.'
63
+ end
64
+
65
+ # resource path
66
+ local_var_path = '/v1/networks/{network_id}/addresses/{address_id}/identity'.sub('{' + 'network_id' + '}', CGI.escape(network_id.to_s)).sub('{' + 'address_id' + '}', CGI.escape(address_id.to_s))
67
+
68
+ # query parameters
69
+ query_params = opts[:query_params] || {}
70
+ query_params[:'roles'] = @api_client.build_collection_param(opts[:'roles'], :csv) if !opts[:'roles'].nil?
71
+ query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
72
+ query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
73
+
74
+ # header parameters
75
+ header_params = opts[:header_params] || {}
76
+ # HTTP header 'Accept' (if needed)
77
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
78
+
79
+ # form parameters
80
+ form_params = opts[:form_params] || {}
81
+
82
+ # http body (model)
83
+ post_body = opts[:debug_body]
84
+
85
+ # return_type
86
+ return_type = opts[:debug_return_type] || 'OnchainNameList'
87
+
88
+ # auth_names
89
+ auth_names = opts[:debug_auth_names] || []
90
+
91
+ new_options = opts.merge(
92
+ :operation => :"OnchainIdentityApi.resolve_identity_by_address",
93
+ :header_params => header_params,
94
+ :query_params => query_params,
95
+ :form_params => form_params,
96
+ :body => post_body,
97
+ :auth_names => auth_names,
98
+ :return_type => return_type
99
+ )
100
+
101
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
102
+ if @api_client.config.debugging
103
+ @api_client.config.logger.debug "API called: OnchainIdentityApi#resolve_identity_by_address\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
104
+ end
105
+ return data, status_code, headers
106
+ end
107
+ end
108
+ end
@@ -0,0 +1,160 @@
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.9.0
10
+
11
+ =end
12
+
13
+ require 'cgi'
14
+
15
+ module Coinbase::Client
16
+ class ReputationApi
17
+ attr_accessor :api_client
18
+
19
+ def initialize(api_client = ApiClient.default)
20
+ @api_client = api_client
21
+ end
22
+ # Get the onchain reputation of an external address
23
+ # Get the onchain reputation of an external address
24
+ # @param network_id [String] The ID of the blockchain network.
25
+ # @param address_id [String] The ID of the address to fetch the reputation for.
26
+ # @param [Hash] opts the optional parameters
27
+ # @return [AddressReputation]
28
+ def get_address_reputation(network_id, address_id, opts = {})
29
+ data, _status_code, _headers = get_address_reputation_with_http_info(network_id, address_id, opts)
30
+ data
31
+ end
32
+
33
+ # Get the onchain reputation of an external address
34
+ # Get the onchain reputation of an external address
35
+ # @param network_id [String] The ID of the blockchain network.
36
+ # @param address_id [String] The ID of the address to fetch the reputation for.
37
+ # @param [Hash] opts the optional parameters
38
+ # @return [Array<(AddressReputation, Integer, Hash)>] AddressReputation data, response status code and response headers
39
+ def get_address_reputation_with_http_info(network_id, address_id, opts = {})
40
+ if @api_client.config.debugging
41
+ @api_client.config.logger.debug 'Calling API: ReputationApi.get_address_reputation ...'
42
+ end
43
+ # verify the required parameter 'network_id' is set
44
+ if @api_client.config.client_side_validation && network_id.nil?
45
+ fail ArgumentError, "Missing the required parameter 'network_id' when calling ReputationApi.get_address_reputation"
46
+ end
47
+ # verify the required parameter 'address_id' is set
48
+ if @api_client.config.client_side_validation && address_id.nil?
49
+ fail ArgumentError, "Missing the required parameter 'address_id' when calling ReputationApi.get_address_reputation"
50
+ end
51
+ # resource path
52
+ local_var_path = '/v1/networks/{network_id}/addresses/{address_id}/reputation'.sub('{' + 'network_id' + '}', CGI.escape(network_id.to_s)).sub('{' + 'address_id' + '}', CGI.escape(address_id.to_s))
53
+
54
+ # query parameters
55
+ query_params = opts[:query_params] || {}
56
+
57
+ # header parameters
58
+ header_params = opts[:header_params] || {}
59
+ # HTTP header 'Accept' (if needed)
60
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
61
+
62
+ # form parameters
63
+ form_params = opts[:form_params] || {}
64
+
65
+ # http body (model)
66
+ post_body = opts[:debug_body]
67
+
68
+ # return_type
69
+ return_type = opts[:debug_return_type] || 'AddressReputation'
70
+
71
+ # auth_names
72
+ auth_names = opts[:debug_auth_names] || []
73
+
74
+ new_options = opts.merge(
75
+ :operation => :"ReputationApi.get_address_reputation",
76
+ :header_params => header_params,
77
+ :query_params => query_params,
78
+ :form_params => form_params,
79
+ :body => post_body,
80
+ :auth_names => auth_names,
81
+ :return_type => return_type
82
+ )
83
+
84
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
85
+ if @api_client.config.debugging
86
+ @api_client.config.logger.debug "API called: ReputationApi#get_address_reputation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
87
+ end
88
+ return data, status_code, headers
89
+ end
90
+
91
+ # Get the risk of an address
92
+ # Get the risk of an address
93
+ # @param network_id [String] The ID of the blockchain network.
94
+ # @param address_id [String] The ID of the address to fetch the risk for.
95
+ # @param [Hash] opts the optional parameters
96
+ # @return [AddressRisk]
97
+ def get_address_risk(network_id, address_id, opts = {})
98
+ data, _status_code, _headers = get_address_risk_with_http_info(network_id, address_id, opts)
99
+ data
100
+ end
101
+
102
+ # Get the risk of an address
103
+ # Get the risk of an address
104
+ # @param network_id [String] The ID of the blockchain network.
105
+ # @param address_id [String] The ID of the address to fetch the risk for.
106
+ # @param [Hash] opts the optional parameters
107
+ # @return [Array<(AddressRisk, Integer, Hash)>] AddressRisk data, response status code and response headers
108
+ def get_address_risk_with_http_info(network_id, address_id, opts = {})
109
+ if @api_client.config.debugging
110
+ @api_client.config.logger.debug 'Calling API: ReputationApi.get_address_risk ...'
111
+ end
112
+ # verify the required parameter 'network_id' is set
113
+ if @api_client.config.client_side_validation && network_id.nil?
114
+ fail ArgumentError, "Missing the required parameter 'network_id' when calling ReputationApi.get_address_risk"
115
+ end
116
+ # verify the required parameter 'address_id' is set
117
+ if @api_client.config.client_side_validation && address_id.nil?
118
+ fail ArgumentError, "Missing the required parameter 'address_id' when calling ReputationApi.get_address_risk"
119
+ end
120
+ # resource path
121
+ local_var_path = '/v1/networks/{network_id}/addresses/{address_id}/risk'.sub('{' + 'network_id' + '}', CGI.escape(network_id.to_s)).sub('{' + 'address_id' + '}', CGI.escape(address_id.to_s))
122
+
123
+ # query parameters
124
+ query_params = opts[:query_params] || {}
125
+
126
+ # header parameters
127
+ header_params = opts[:header_params] || {}
128
+ # HTTP header 'Accept' (if needed)
129
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
130
+
131
+ # form parameters
132
+ form_params = opts[:form_params] || {}
133
+
134
+ # http body (model)
135
+ post_body = opts[:debug_body]
136
+
137
+ # return_type
138
+ return_type = opts[:debug_return_type] || 'AddressRisk'
139
+
140
+ # auth_names
141
+ auth_names = opts[:debug_auth_names] || []
142
+
143
+ new_options = opts.merge(
144
+ :operation => :"ReputationApi.get_address_risk",
145
+ :header_params => header_params,
146
+ :query_params => query_params,
147
+ :form_params => form_params,
148
+ :body => post_body,
149
+ :auth_names => auth_names,
150
+ :return_type => return_type
151
+ )
152
+
153
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
154
+ if @api_client.config.debugging
155
+ @api_client.config.logger.debug "API called: ReputationApi#get_address_risk\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
156
+ end
157
+ return data, status_code, headers
158
+ end
159
+ end
160
+ end
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.8.0
9
+ Generator version: 7.9.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
7
 
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.8.0
9
+ Generator version: 7.9.0
10
10
 
11
11
  =end
12
12
 
@@ -328,5 +328,85 @@ module Coinbase::Client
328
328
  end
329
329
  return data, status_code, headers
330
330
  end
331
+
332
+ # Read data from a smart contract
333
+ # Perform a read operation on a smart contract without creating a transaction
334
+ # @param network_id [String]
335
+ # @param contract_address [String]
336
+ # @param read_contract_request [ReadContractRequest]
337
+ # @param [Hash] opts the optional parameters
338
+ # @return [SolidityValue]
339
+ def read_contract(network_id, contract_address, read_contract_request, opts = {})
340
+ data, _status_code, _headers = read_contract_with_http_info(network_id, contract_address, read_contract_request, opts)
341
+ data
342
+ end
343
+
344
+ # Read data from a smart contract
345
+ # Perform a read operation on a smart contract without creating a transaction
346
+ # @param network_id [String]
347
+ # @param contract_address [String]
348
+ # @param read_contract_request [ReadContractRequest]
349
+ # @param [Hash] opts the optional parameters
350
+ # @return [Array<(SolidityValue, Integer, Hash)>] SolidityValue data, response status code and response headers
351
+ def read_contract_with_http_info(network_id, contract_address, read_contract_request, opts = {})
352
+ if @api_client.config.debugging
353
+ @api_client.config.logger.debug 'Calling API: SmartContractsApi.read_contract ...'
354
+ end
355
+ # verify the required parameter 'network_id' is set
356
+ if @api_client.config.client_side_validation && network_id.nil?
357
+ fail ArgumentError, "Missing the required parameter 'network_id' when calling SmartContractsApi.read_contract"
358
+ end
359
+ # verify the required parameter 'contract_address' is set
360
+ if @api_client.config.client_side_validation && contract_address.nil?
361
+ fail ArgumentError, "Missing the required parameter 'contract_address' when calling SmartContractsApi.read_contract"
362
+ end
363
+ # verify the required parameter 'read_contract_request' is set
364
+ if @api_client.config.client_side_validation && read_contract_request.nil?
365
+ fail ArgumentError, "Missing the required parameter 'read_contract_request' when calling SmartContractsApi.read_contract"
366
+ end
367
+ # resource path
368
+ local_var_path = '/v1/networks/{network_id}/smart_contracts/{contract_address}/read'.sub('{' + 'network_id' + '}', CGI.escape(network_id.to_s)).sub('{' + 'contract_address' + '}', CGI.escape(contract_address.to_s))
369
+
370
+ # query parameters
371
+ query_params = opts[:query_params] || {}
372
+
373
+ # header parameters
374
+ header_params = opts[:header_params] || {}
375
+ # HTTP header 'Accept' (if needed)
376
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
377
+ # HTTP header 'Content-Type'
378
+ content_type = @api_client.select_header_content_type(['application/json'])
379
+ if !content_type.nil?
380
+ header_params['Content-Type'] = content_type
381
+ end
382
+
383
+ # form parameters
384
+ form_params = opts[:form_params] || {}
385
+
386
+ # http body (model)
387
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(read_contract_request)
388
+
389
+ # return_type
390
+ return_type = opts[:debug_return_type] || 'SolidityValue'
391
+
392
+ # auth_names
393
+ auth_names = opts[:debug_auth_names] || []
394
+
395
+ new_options = opts.merge(
396
+ :operation => :"SmartContractsApi.read_contract",
397
+ :header_params => header_params,
398
+ :query_params => query_params,
399
+ :form_params => form_params,
400
+ :body => post_body,
401
+ :auth_names => auth_names,
402
+ :return_type => return_type
403
+ )
404
+
405
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
406
+ if @api_client.config.debugging
407
+ @api_client.config.logger.debug "API called: SmartContractsApi#read_contract\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
408
+ end
409
+ return data, status_code, headers
410
+ end
331
411
  end
332
412
  end