coinbase-sdk 0.10.0 → 0.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (152) hide show
  1. checksums.yaml +4 -4
  2. data/lib/coinbase/address/wallet_address.rb +28 -0
  3. data/lib/coinbase/balance.rb +1 -1
  4. data/lib/coinbase/client/api/addresses_api.rb +1 -1
  5. data/lib/coinbase/client/api/assets_api.rb +1 -1
  6. data/lib/coinbase/client/api/balance_history_api.rb +1 -1
  7. data/lib/coinbase/client/api/contract_events_api.rb +1 -1
  8. data/lib/coinbase/client/api/contract_invocations_api.rb +1 -1
  9. data/lib/coinbase/client/api/external_addresses_api.rb +1 -1
  10. data/lib/coinbase/client/api/fund_api.rb +1 -1
  11. data/lib/coinbase/client/api/{wallet_stake_api.rb → mpc_wallet_stake_api.rb} +21 -21
  12. data/lib/coinbase/client/api/networks_api.rb +1 -1
  13. data/lib/coinbase/client/api/onchain_identity_api.rb +1 -1
  14. data/lib/coinbase/client/api/reputation_api.rb +160 -0
  15. data/lib/coinbase/client/api/server_signers_api.rb +1 -1
  16. data/lib/coinbase/client/api/smart_contracts_api.rb +1 -1
  17. data/lib/coinbase/client/api/stake_api.rb +158 -1
  18. data/lib/coinbase/client/api/trades_api.rb +1 -1
  19. data/lib/coinbase/client/api/transaction_history_api.rb +1 -1
  20. data/lib/coinbase/client/api/transfers_api.rb +1 -1
  21. data/lib/coinbase/client/api/users_api.rb +1 -1
  22. data/lib/coinbase/client/api/wallets_api.rb +1 -1
  23. data/lib/coinbase/client/api/webhooks_api.rb +1 -1
  24. data/lib/coinbase/client/api_client.rb +1 -1
  25. data/lib/coinbase/client/api_error.rb +1 -1
  26. data/lib/coinbase/client/configuration.rb +1 -1
  27. data/lib/coinbase/client/models/address.rb +1 -1
  28. data/lib/coinbase/client/models/address_balance_list.rb +1 -1
  29. data/lib/coinbase/client/models/address_historical_balance_list.rb +1 -1
  30. data/lib/coinbase/client/models/address_list.rb +1 -1
  31. data/lib/coinbase/client/models/address_reputation.rb +232 -0
  32. data/lib/coinbase/client/models/address_reputation_metadata.rb +376 -0
  33. data/lib/coinbase/client/models/address_risk.rb +223 -0
  34. data/lib/coinbase/client/models/address_transaction_list.rb +1 -1
  35. data/lib/coinbase/client/models/asset.rb +1 -1
  36. data/lib/coinbase/client/models/balance.rb +1 -1
  37. data/lib/coinbase/client/models/broadcast_contract_invocation_request.rb +1 -1
  38. data/lib/coinbase/client/models/broadcast_staking_operation_request.rb +1 -1
  39. data/lib/coinbase/client/models/broadcast_trade_request.rb +1 -1
  40. data/lib/coinbase/client/models/broadcast_transfer_request.rb +1 -1
  41. data/lib/coinbase/client/models/build_staking_operation_request.rb +2 -1
  42. data/lib/coinbase/client/models/contract_event.rb +1 -1
  43. data/lib/coinbase/client/models/contract_event_list.rb +1 -1
  44. data/lib/coinbase/client/models/contract_invocation.rb +1 -1
  45. data/lib/coinbase/client/models/contract_invocation_list.rb +1 -1
  46. data/lib/coinbase/client/models/create_address_request.rb +1 -1
  47. data/lib/coinbase/client/models/create_contract_invocation_request.rb +1 -1
  48. data/lib/coinbase/client/models/create_fund_operation_request.rb +1 -1
  49. data/lib/coinbase/client/models/create_fund_quote_request.rb +1 -1
  50. data/lib/coinbase/client/models/create_payload_signature_request.rb +1 -1
  51. data/lib/coinbase/client/models/create_server_signer_request.rb +1 -1
  52. data/lib/coinbase/client/models/create_smart_contract_request.rb +1 -1
  53. data/lib/coinbase/client/models/create_staking_operation_request.rb +2 -1
  54. data/lib/coinbase/client/models/create_trade_request.rb +1 -1
  55. data/lib/coinbase/client/models/create_transfer_request.rb +1 -1
  56. data/lib/coinbase/client/models/create_wallet_request.rb +1 -1
  57. data/lib/coinbase/client/models/create_wallet_request_wallet.rb +1 -1
  58. data/lib/coinbase/client/models/create_wallet_webhook_request.rb +1 -1
  59. data/lib/coinbase/client/models/create_webhook_request.rb +1 -1
  60. data/lib/coinbase/client/models/crypto_amount.rb +1 -1
  61. data/lib/coinbase/client/models/deploy_smart_contract_request.rb +1 -1
  62. data/lib/coinbase/client/models/erc20_transfer_event.rb +1 -1
  63. data/lib/coinbase/client/models/erc721_transfer_event.rb +1 -1
  64. data/lib/coinbase/client/models/error.rb +1 -1
  65. data/lib/coinbase/client/models/ethereum_token_transfer.rb +1 -1
  66. data/lib/coinbase/client/models/ethereum_transaction.rb +1 -1
  67. data/lib/coinbase/client/models/ethereum_transaction_access.rb +1 -1
  68. data/lib/coinbase/client/models/ethereum_transaction_access_list.rb +1 -1
  69. data/lib/coinbase/client/models/ethereum_transaction_flattened_trace.rb +1 -1
  70. data/lib/coinbase/client/models/ethereum_validator_metadata.rb +1 -1
  71. data/lib/coinbase/client/models/faucet_transaction.rb +1 -1
  72. data/lib/coinbase/client/models/feature_set.rb +1 -1
  73. data/lib/coinbase/client/models/fetch_historical_staking_balances200_response.rb +1 -1
  74. data/lib/coinbase/client/models/fetch_staking_rewards200_response.rb +1 -1
  75. data/lib/coinbase/client/models/fetch_staking_rewards_request.rb +1 -1
  76. data/lib/coinbase/client/models/fiat_amount.rb +1 -1
  77. data/lib/coinbase/client/models/fund_operation.rb +1 -1
  78. data/lib/coinbase/client/models/fund_operation_fees.rb +1 -1
  79. data/lib/coinbase/client/models/fund_operation_list.rb +1 -1
  80. data/lib/coinbase/client/models/fund_quote.rb +1 -1
  81. data/lib/coinbase/client/models/get_staking_context_request.rb +2 -1
  82. data/lib/coinbase/client/models/historical_balance.rb +1 -1
  83. data/lib/coinbase/client/models/multi_token_contract_options.rb +1 -1
  84. data/lib/coinbase/client/models/network.rb +1 -1
  85. data/lib/coinbase/client/models/network_identifier.rb +1 -1
  86. data/lib/coinbase/client/models/nft_contract_options.rb +1 -1
  87. data/lib/coinbase/client/models/onchain_name.rb +1 -1
  88. data/lib/coinbase/client/models/onchain_name_list.rb +1 -1
  89. data/lib/coinbase/client/models/payload_signature.rb +1 -1
  90. data/lib/coinbase/client/models/payload_signature_list.rb +1 -1
  91. data/lib/coinbase/client/models/read_contract_request.rb +1 -1
  92. data/lib/coinbase/client/models/seed_creation_event.rb +1 -1
  93. data/lib/coinbase/client/models/seed_creation_event_result.rb +1 -1
  94. data/lib/coinbase/client/models/server_signer.rb +1 -1
  95. data/lib/coinbase/client/models/server_signer_event.rb +1 -1
  96. data/lib/coinbase/client/models/server_signer_event_event.rb +1 -1
  97. data/lib/coinbase/client/models/server_signer_event_list.rb +1 -1
  98. data/lib/coinbase/client/models/server_signer_list.rb +1 -1
  99. data/lib/coinbase/client/models/signature_creation_event.rb +1 -1
  100. data/lib/coinbase/client/models/signature_creation_event_result.rb +1 -1
  101. data/lib/coinbase/client/models/signed_voluntary_exit_message_metadata.rb +1 -1
  102. data/lib/coinbase/client/models/smart_contract.rb +1 -1
  103. data/lib/coinbase/client/models/smart_contract_list.rb +1 -1
  104. data/lib/coinbase/client/models/smart_contract_options.rb +1 -1
  105. data/lib/coinbase/client/models/smart_contract_type.rb +1 -1
  106. data/lib/coinbase/client/models/solidity_value.rb +3 -3
  107. data/lib/coinbase/client/models/sponsored_send.rb +1 -1
  108. data/lib/coinbase/client/models/staking_balance.rb +1 -1
  109. data/lib/coinbase/client/models/staking_context.rb +1 -1
  110. data/lib/coinbase/client/models/staking_context_context.rb +1 -1
  111. data/lib/coinbase/client/models/staking_operation.rb +1 -1
  112. data/lib/coinbase/client/models/staking_operation_metadata.rb +1 -1
  113. data/lib/coinbase/client/models/staking_reward.rb +1 -1
  114. data/lib/coinbase/client/models/staking_reward_format.rb +1 -1
  115. data/lib/coinbase/client/models/staking_reward_usd_value.rb +1 -1
  116. data/lib/coinbase/client/models/token_contract_options.rb +1 -1
  117. data/lib/coinbase/client/models/token_transfer_type.rb +1 -1
  118. data/lib/coinbase/client/models/trade.rb +1 -1
  119. data/lib/coinbase/client/models/trade_list.rb +1 -1
  120. data/lib/coinbase/client/models/transaction.rb +1 -1
  121. data/lib/coinbase/client/models/transaction_content.rb +1 -1
  122. data/lib/coinbase/client/models/transaction_type.rb +1 -1
  123. data/lib/coinbase/client/models/transfer.rb +1 -1
  124. data/lib/coinbase/client/models/transfer_list.rb +1 -1
  125. data/lib/coinbase/client/models/update_webhook_request.rb +1 -1
  126. data/lib/coinbase/client/models/user.rb +1 -1
  127. data/lib/coinbase/client/models/validator.rb +1 -1
  128. data/lib/coinbase/client/models/validator_details.rb +1 -1
  129. data/lib/coinbase/client/models/validator_list.rb +1 -1
  130. data/lib/coinbase/client/models/validator_status.rb +1 -1
  131. data/lib/coinbase/client/models/wallet.rb +1 -1
  132. data/lib/coinbase/client/models/wallet_list.rb +1 -1
  133. data/lib/coinbase/client/models/webhook.rb +1 -1
  134. data/lib/coinbase/client/models/webhook_event_filter.rb +1 -1
  135. data/lib/coinbase/client/models/webhook_event_type.rb +1 -1
  136. data/lib/coinbase/client/models/webhook_event_type_filter.rb +1 -1
  137. data/lib/coinbase/client/models/webhook_list.rb +1 -1
  138. data/lib/coinbase/client/models/webhook_wallet_activity_filter.rb +1 -1
  139. data/lib/coinbase/client/version.rb +1 -1
  140. data/lib/coinbase/client.rb +6 -3
  141. data/lib/coinbase/crypto_amount.rb +62 -0
  142. data/lib/coinbase/fiat_amount.rb +40 -0
  143. data/lib/coinbase/fund_operation.rb +228 -0
  144. data/lib/coinbase/fund_quote.rb +149 -0
  145. data/lib/coinbase/smart_contract.rb +2 -2
  146. data/lib/coinbase/staking_operation.rb +2 -2
  147. data/lib/coinbase/validator.rb +7 -10
  148. data/lib/coinbase/version.rb +1 -1
  149. data/lib/coinbase/wallet.rb +13 -1
  150. data/lib/coinbase.rb +4 -0
  151. metadata +11 -4
  152. data/lib/coinbase/client/api/validators_api.rb +0 -179
@@ -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