coinbase-sdk 0.10.0 → 0.11.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/coinbase/address/wallet_address.rb +28 -0
- data/lib/coinbase/balance.rb +1 -1
- data/lib/coinbase/client/api/addresses_api.rb +1 -1
- data/lib/coinbase/client/api/assets_api.rb +1 -1
- data/lib/coinbase/client/api/balance_history_api.rb +1 -1
- data/lib/coinbase/client/api/contract_events_api.rb +1 -1
- data/lib/coinbase/client/api/contract_invocations_api.rb +1 -1
- data/lib/coinbase/client/api/external_addresses_api.rb +1 -1
- data/lib/coinbase/client/api/fund_api.rb +1 -1
- data/lib/coinbase/client/api/{wallet_stake_api.rb → mpc_wallet_stake_api.rb} +21 -21
- data/lib/coinbase/client/api/networks_api.rb +1 -1
- data/lib/coinbase/client/api/onchain_identity_api.rb +1 -1
- data/lib/coinbase/client/api/reputation_api.rb +160 -0
- data/lib/coinbase/client/api/server_signers_api.rb +1 -1
- data/lib/coinbase/client/api/smart_contracts_api.rb +1 -1
- data/lib/coinbase/client/api/stake_api.rb +158 -1
- data/lib/coinbase/client/api/trades_api.rb +1 -1
- data/lib/coinbase/client/api/transaction_history_api.rb +1 -1
- data/lib/coinbase/client/api/transfers_api.rb +1 -1
- data/lib/coinbase/client/api/users_api.rb +1 -1
- data/lib/coinbase/client/api/wallets_api.rb +1 -1
- data/lib/coinbase/client/api/webhooks_api.rb +1 -1
- data/lib/coinbase/client/api_client.rb +1 -1
- data/lib/coinbase/client/api_error.rb +1 -1
- data/lib/coinbase/client/configuration.rb +1 -1
- data/lib/coinbase/client/models/address.rb +1 -1
- data/lib/coinbase/client/models/address_balance_list.rb +1 -1
- data/lib/coinbase/client/models/address_historical_balance_list.rb +1 -1
- data/lib/coinbase/client/models/address_list.rb +1 -1
- data/lib/coinbase/client/models/address_reputation.rb +232 -0
- data/lib/coinbase/client/models/address_reputation_metadata.rb +376 -0
- data/lib/coinbase/client/models/address_risk.rb +223 -0
- data/lib/coinbase/client/models/address_transaction_list.rb +1 -1
- data/lib/coinbase/client/models/asset.rb +1 -1
- data/lib/coinbase/client/models/balance.rb +1 -1
- data/lib/coinbase/client/models/broadcast_contract_invocation_request.rb +1 -1
- data/lib/coinbase/client/models/broadcast_staking_operation_request.rb +1 -1
- data/lib/coinbase/client/models/broadcast_trade_request.rb +1 -1
- data/lib/coinbase/client/models/broadcast_transfer_request.rb +1 -1
- data/lib/coinbase/client/models/build_staking_operation_request.rb +2 -1
- data/lib/coinbase/client/models/contract_event.rb +1 -1
- data/lib/coinbase/client/models/contract_event_list.rb +1 -1
- data/lib/coinbase/client/models/contract_invocation.rb +1 -1
- data/lib/coinbase/client/models/contract_invocation_list.rb +1 -1
- data/lib/coinbase/client/models/create_address_request.rb +1 -1
- data/lib/coinbase/client/models/create_contract_invocation_request.rb +1 -1
- data/lib/coinbase/client/models/create_fund_operation_request.rb +1 -1
- data/lib/coinbase/client/models/create_fund_quote_request.rb +1 -1
- data/lib/coinbase/client/models/create_payload_signature_request.rb +1 -1
- data/lib/coinbase/client/models/create_server_signer_request.rb +1 -1
- data/lib/coinbase/client/models/create_smart_contract_request.rb +1 -1
- data/lib/coinbase/client/models/create_staking_operation_request.rb +2 -1
- data/lib/coinbase/client/models/create_trade_request.rb +1 -1
- data/lib/coinbase/client/models/create_transfer_request.rb +1 -1
- data/lib/coinbase/client/models/create_wallet_request.rb +1 -1
- data/lib/coinbase/client/models/create_wallet_request_wallet.rb +1 -1
- data/lib/coinbase/client/models/create_wallet_webhook_request.rb +1 -1
- data/lib/coinbase/client/models/create_webhook_request.rb +1 -1
- data/lib/coinbase/client/models/crypto_amount.rb +1 -1
- data/lib/coinbase/client/models/deploy_smart_contract_request.rb +1 -1
- data/lib/coinbase/client/models/erc20_transfer_event.rb +1 -1
- data/lib/coinbase/client/models/erc721_transfer_event.rb +1 -1
- data/lib/coinbase/client/models/error.rb +1 -1
- data/lib/coinbase/client/models/ethereum_token_transfer.rb +1 -1
- data/lib/coinbase/client/models/ethereum_transaction.rb +1 -1
- data/lib/coinbase/client/models/ethereum_transaction_access.rb +1 -1
- data/lib/coinbase/client/models/ethereum_transaction_access_list.rb +1 -1
- data/lib/coinbase/client/models/ethereum_transaction_flattened_trace.rb +1 -1
- data/lib/coinbase/client/models/ethereum_validator_metadata.rb +1 -1
- data/lib/coinbase/client/models/faucet_transaction.rb +1 -1
- data/lib/coinbase/client/models/feature_set.rb +1 -1
- data/lib/coinbase/client/models/fetch_historical_staking_balances200_response.rb +1 -1
- data/lib/coinbase/client/models/fetch_staking_rewards200_response.rb +1 -1
- data/lib/coinbase/client/models/fetch_staking_rewards_request.rb +1 -1
- data/lib/coinbase/client/models/fiat_amount.rb +1 -1
- data/lib/coinbase/client/models/fund_operation.rb +1 -1
- data/lib/coinbase/client/models/fund_operation_fees.rb +1 -1
- data/lib/coinbase/client/models/fund_operation_list.rb +1 -1
- data/lib/coinbase/client/models/fund_quote.rb +1 -1
- data/lib/coinbase/client/models/get_staking_context_request.rb +2 -1
- data/lib/coinbase/client/models/historical_balance.rb +1 -1
- data/lib/coinbase/client/models/multi_token_contract_options.rb +1 -1
- data/lib/coinbase/client/models/network.rb +1 -1
- data/lib/coinbase/client/models/network_identifier.rb +1 -1
- data/lib/coinbase/client/models/nft_contract_options.rb +1 -1
- data/lib/coinbase/client/models/onchain_name.rb +1 -1
- data/lib/coinbase/client/models/onchain_name_list.rb +1 -1
- data/lib/coinbase/client/models/payload_signature.rb +1 -1
- data/lib/coinbase/client/models/payload_signature_list.rb +1 -1
- data/lib/coinbase/client/models/read_contract_request.rb +1 -1
- data/lib/coinbase/client/models/seed_creation_event.rb +1 -1
- data/lib/coinbase/client/models/seed_creation_event_result.rb +1 -1
- data/lib/coinbase/client/models/server_signer.rb +1 -1
- data/lib/coinbase/client/models/server_signer_event.rb +1 -1
- data/lib/coinbase/client/models/server_signer_event_event.rb +1 -1
- data/lib/coinbase/client/models/server_signer_event_list.rb +1 -1
- data/lib/coinbase/client/models/server_signer_list.rb +1 -1
- data/lib/coinbase/client/models/signature_creation_event.rb +1 -1
- data/lib/coinbase/client/models/signature_creation_event_result.rb +1 -1
- data/lib/coinbase/client/models/signed_voluntary_exit_message_metadata.rb +1 -1
- data/lib/coinbase/client/models/smart_contract.rb +1 -1
- data/lib/coinbase/client/models/smart_contract_list.rb +1 -1
- data/lib/coinbase/client/models/smart_contract_options.rb +1 -1
- data/lib/coinbase/client/models/smart_contract_type.rb +1 -1
- data/lib/coinbase/client/models/solidity_value.rb +3 -3
- data/lib/coinbase/client/models/sponsored_send.rb +1 -1
- data/lib/coinbase/client/models/staking_balance.rb +1 -1
- data/lib/coinbase/client/models/staking_context.rb +1 -1
- data/lib/coinbase/client/models/staking_context_context.rb +1 -1
- data/lib/coinbase/client/models/staking_operation.rb +1 -1
- data/lib/coinbase/client/models/staking_operation_metadata.rb +1 -1
- data/lib/coinbase/client/models/staking_reward.rb +1 -1
- data/lib/coinbase/client/models/staking_reward_format.rb +1 -1
- data/lib/coinbase/client/models/staking_reward_usd_value.rb +1 -1
- data/lib/coinbase/client/models/token_contract_options.rb +1 -1
- data/lib/coinbase/client/models/token_transfer_type.rb +1 -1
- data/lib/coinbase/client/models/trade.rb +1 -1
- data/lib/coinbase/client/models/trade_list.rb +1 -1
- data/lib/coinbase/client/models/transaction.rb +1 -1
- data/lib/coinbase/client/models/transaction_content.rb +1 -1
- data/lib/coinbase/client/models/transaction_type.rb +1 -1
- data/lib/coinbase/client/models/transfer.rb +1 -1
- data/lib/coinbase/client/models/transfer_list.rb +1 -1
- data/lib/coinbase/client/models/update_webhook_request.rb +1 -1
- data/lib/coinbase/client/models/user.rb +1 -1
- data/lib/coinbase/client/models/validator.rb +1 -1
- data/lib/coinbase/client/models/validator_details.rb +1 -1
- data/lib/coinbase/client/models/validator_list.rb +1 -1
- data/lib/coinbase/client/models/validator_status.rb +1 -1
- data/lib/coinbase/client/models/wallet.rb +1 -1
- data/lib/coinbase/client/models/wallet_list.rb +1 -1
- data/lib/coinbase/client/models/webhook.rb +1 -1
- data/lib/coinbase/client/models/webhook_event_filter.rb +1 -1
- data/lib/coinbase/client/models/webhook_event_type.rb +1 -1
- data/lib/coinbase/client/models/webhook_event_type_filter.rb +1 -1
- data/lib/coinbase/client/models/webhook_list.rb +1 -1
- data/lib/coinbase/client/models/webhook_wallet_activity_filter.rb +1 -1
- data/lib/coinbase/client/version.rb +1 -1
- data/lib/coinbase/client.rb +6 -3
- data/lib/coinbase/crypto_amount.rb +62 -0
- data/lib/coinbase/fiat_amount.rb +40 -0
- data/lib/coinbase/fund_operation.rb +228 -0
- data/lib/coinbase/fund_quote.rb +149 -0
- data/lib/coinbase/smart_contract.rb +2 -2
- data/lib/coinbase/staking_operation.rb +2 -2
- data/lib/coinbase/validator.rb +7 -10
- data/lib/coinbase/version.rb +1 -1
- data/lib/coinbase/wallet.rb +13 -1
- data/lib/coinbase.rb +4 -0
- metadata +11 -4
- 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'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'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
|