coinbase-sdk 0.0.16 → 0.1.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 +24 -17
- data/lib/coinbase/address.rb +17 -19
- data/lib/coinbase/asset.rb +11 -8
- 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/contract_events_api.rb +18 -10
- data/lib/coinbase/client/api/external_addresses_api.rb +1 -1
- data/lib/coinbase/client/api/networks_api.rb +1 -1
- data/lib/coinbase/client/api/server_signers_api.rb +1 -1
- data/lib/coinbase/client/api/stake_api.rb +1 -242
- data/lib/coinbase/client/api/trades_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/validators_api.rb +3 -3
- data/lib/coinbase/client/api/wallet_stake_api.rb +263 -0
- 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 +11 -1
- data/lib/coinbase/client/models/address.rb +22 -5
- 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/asset.rb +1 -1
- data/lib/coinbase/client/models/balance.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 +1 -1
- data/lib/coinbase/client/models/contract_event.rb +100 -9
- data/lib/coinbase/client/models/contract_event_list.rb +1 -1
- data/lib/coinbase/client/models/create_address_request.rb +15 -5
- data/lib/coinbase/client/models/create_server_signer_request.rb +1 -1
- data/lib/coinbase/client/models/create_staking_operation_request.rb +1 -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_webhook_request.rb +1 -1
- data/lib/coinbase/client/models/error.rb +1 -1
- data/lib/coinbase/client/models/ethereum_validator_metadata.rb +12 -12
- data/lib/coinbase/client/models/faucet_transaction.rb +1 -1
- data/lib/coinbase/client/models/feature.rb +3 -2
- 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/get_staking_context_request.rb +1 -1
- data/lib/coinbase/client/models/historical_balance.rb +1 -1
- data/lib/coinbase/client/models/network.rb +15 -5
- data/lib/coinbase/client/models/network_identifier.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/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 +3 -3
- 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/trade.rb +1 -1
- data/lib/coinbase/client/models/trade_list.rb +1 -1
- data/lib/coinbase/client/models/transaction.rb +16 -6
- 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 +24 -3
- 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 +52 -0
- 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_list.rb +1 -1
- data/lib/coinbase/client/version.rb +1 -1
- data/lib/coinbase/client.rb +3 -1
- data/lib/coinbase/constants.rb +0 -10
- data/lib/coinbase/contract_event.rb +104 -0
- data/lib/coinbase/correlation.rb +30 -0
- data/lib/coinbase/destination.rb +11 -9
- data/lib/coinbase/errors.rb +7 -0
- data/lib/coinbase/middleware.rb +2 -0
- data/lib/coinbase/network.rb +103 -20
- data/lib/coinbase/smart_contract.rb +106 -0
- data/lib/coinbase/staking_balance.rb +11 -5
- data/lib/coinbase/staking_operation.rb +134 -36
- data/lib/coinbase/staking_reward.rb +1 -1
- data/lib/coinbase/trade.rb +10 -9
- data/lib/coinbase/transaction.rb +6 -0
- data/lib/coinbase/transfer.rb +11 -10
- data/lib/coinbase/validator.rb +18 -10
- data/lib/coinbase/version.rb +5 -0
- data/lib/coinbase/wallet.rb +137 -145
- data/lib/coinbase/webhook.rb +181 -0
- data/lib/coinbase.rb +50 -19
- metadata +9 -9
- data/lib/coinbase/client/models/ethereum_validator.rb +0 -374
- data/lib/coinbase/client/models/get_validator200_response.rb +0 -221
- data/lib/coinbase/client/models/get_validator200_response_validator.rb +0 -214
- data/lib/coinbase/client/models/native_eth_staking_context.rb +0 -254
- data/lib/coinbase/client/models/partial_eth_staking_context.rb +0 -254
- data/lib/coinbase/client/models/validator_list_data.rb +0 -216
- data/lib/coinbase/user.rb +0 -65
@@ -6,7 +6,7 @@
|
|
6
6
|
The version of the OpenAPI document: 0.0.1-alpha
|
7
7
|
Contact: yuga.cohler@coinbase.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
Generator version: 7.
|
9
|
+
Generator version: 7.7.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -19,92 +19,6 @@ module Coinbase::Client
|
|
19
19
|
def initialize(api_client = ApiClient.default)
|
20
20
|
@api_client = api_client
|
21
21
|
end
|
22
|
-
# Broadcast a staking operation
|
23
|
-
# Broadcast a staking operation.
|
24
|
-
# @param wallet_id [String] The ID of the wallet the address belongs to.
|
25
|
-
# @param address_id [String] The ID of the address the staking operation belongs to.
|
26
|
-
# @param staking_operation_id [String] The ID of the staking operation to broadcast.
|
27
|
-
# @param broadcast_staking_operation_request [BroadcastStakingOperationRequest]
|
28
|
-
# @param [Hash] opts the optional parameters
|
29
|
-
# @return [StakingOperation]
|
30
|
-
def broadcast_staking_operation(wallet_id, address_id, staking_operation_id, broadcast_staking_operation_request, opts = {})
|
31
|
-
data, _status_code, _headers = broadcast_staking_operation_with_http_info(wallet_id, address_id, staking_operation_id, broadcast_staking_operation_request, opts)
|
32
|
-
data
|
33
|
-
end
|
34
|
-
|
35
|
-
# Broadcast a staking operation
|
36
|
-
# Broadcast a staking operation.
|
37
|
-
# @param wallet_id [String] The ID of the wallet the address belongs to.
|
38
|
-
# @param address_id [String] The ID of the address the staking operation belongs to.
|
39
|
-
# @param staking_operation_id [String] The ID of the staking operation to broadcast.
|
40
|
-
# @param broadcast_staking_operation_request [BroadcastStakingOperationRequest]
|
41
|
-
# @param [Hash] opts the optional parameters
|
42
|
-
# @return [Array<(StakingOperation, Integer, Hash)>] StakingOperation data, response status code and response headers
|
43
|
-
def broadcast_staking_operation_with_http_info(wallet_id, address_id, staking_operation_id, broadcast_staking_operation_request, opts = {})
|
44
|
-
if @api_client.config.debugging
|
45
|
-
@api_client.config.logger.debug 'Calling API: StakeApi.broadcast_staking_operation ...'
|
46
|
-
end
|
47
|
-
# verify the required parameter 'wallet_id' is set
|
48
|
-
if @api_client.config.client_side_validation && wallet_id.nil?
|
49
|
-
fail ArgumentError, "Missing the required parameter 'wallet_id' when calling StakeApi.broadcast_staking_operation"
|
50
|
-
end
|
51
|
-
# verify the required parameter 'address_id' is set
|
52
|
-
if @api_client.config.client_side_validation && address_id.nil?
|
53
|
-
fail ArgumentError, "Missing the required parameter 'address_id' when calling StakeApi.broadcast_staking_operation"
|
54
|
-
end
|
55
|
-
# verify the required parameter 'staking_operation_id' is set
|
56
|
-
if @api_client.config.client_side_validation && staking_operation_id.nil?
|
57
|
-
fail ArgumentError, "Missing the required parameter 'staking_operation_id' when calling StakeApi.broadcast_staking_operation"
|
58
|
-
end
|
59
|
-
# verify the required parameter 'broadcast_staking_operation_request' is set
|
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 StakeApi.broadcast_staking_operation"
|
62
|
-
end
|
63
|
-
# resource path
|
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))
|
65
|
-
|
66
|
-
# query parameters
|
67
|
-
query_params = opts[:query_params] || {}
|
68
|
-
|
69
|
-
# header parameters
|
70
|
-
header_params = opts[:header_params] || {}
|
71
|
-
# HTTP header 'Accept' (if needed)
|
72
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
73
|
-
# HTTP header 'Content-Type'
|
74
|
-
content_type = @api_client.select_header_content_type(['application/json'])
|
75
|
-
if !content_type.nil?
|
76
|
-
header_params['Content-Type'] = content_type
|
77
|
-
end
|
78
|
-
|
79
|
-
# form parameters
|
80
|
-
form_params = opts[:form_params] || {}
|
81
|
-
|
82
|
-
# http body (model)
|
83
|
-
post_body = opts[:debug_body] || @api_client.object_to_http_body(broadcast_staking_operation_request)
|
84
|
-
|
85
|
-
# return_type
|
86
|
-
return_type = opts[:debug_return_type] || 'StakingOperation'
|
87
|
-
|
88
|
-
# auth_names
|
89
|
-
auth_names = opts[:debug_auth_names] || []
|
90
|
-
|
91
|
-
new_options = opts.merge(
|
92
|
-
:operation => :"StakeApi.broadcast_staking_operation",
|
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(:POST, local_var_path, new_options)
|
102
|
-
if @api_client.config.debugging
|
103
|
-
@api_client.config.logger.debug "API called: StakeApi#broadcast_staking_operation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
104
|
-
end
|
105
|
-
return data, status_code, headers
|
106
|
-
end
|
107
|
-
|
108
22
|
# Build a new staking operation
|
109
23
|
# Build a new staking operation
|
110
24
|
# @param build_staking_operation_request [BuildStakingOperationRequest]
|
@@ -173,86 +87,6 @@ module Coinbase::Client
|
|
173
87
|
return data, status_code, headers
|
174
88
|
end
|
175
89
|
|
176
|
-
# Create a new staking operation for an address
|
177
|
-
# Create a new staking operation.
|
178
|
-
# @param wallet_id [String] The ID of the wallet the address belongs to.
|
179
|
-
# @param address_id [String] The ID of the address to create the staking operation for.
|
180
|
-
# @param create_staking_operation_request [CreateStakingOperationRequest]
|
181
|
-
# @param [Hash] opts the optional parameters
|
182
|
-
# @return [StakingOperation]
|
183
|
-
def create_staking_operation(wallet_id, address_id, create_staking_operation_request, opts = {})
|
184
|
-
data, _status_code, _headers = create_staking_operation_with_http_info(wallet_id, address_id, create_staking_operation_request, opts)
|
185
|
-
data
|
186
|
-
end
|
187
|
-
|
188
|
-
# Create a new staking operation for an address
|
189
|
-
# Create a new staking operation.
|
190
|
-
# @param wallet_id [String] The ID of the wallet the address belongs to.
|
191
|
-
# @param address_id [String] The ID of the address to create the staking operation for.
|
192
|
-
# @param create_staking_operation_request [CreateStakingOperationRequest]
|
193
|
-
# @param [Hash] opts the optional parameters
|
194
|
-
# @return [Array<(StakingOperation, Integer, Hash)>] StakingOperation data, response status code and response headers
|
195
|
-
def create_staking_operation_with_http_info(wallet_id, address_id, create_staking_operation_request, opts = {})
|
196
|
-
if @api_client.config.debugging
|
197
|
-
@api_client.config.logger.debug 'Calling API: StakeApi.create_staking_operation ...'
|
198
|
-
end
|
199
|
-
# verify the required parameter 'wallet_id' is set
|
200
|
-
if @api_client.config.client_side_validation && wallet_id.nil?
|
201
|
-
fail ArgumentError, "Missing the required parameter 'wallet_id' when calling StakeApi.create_staking_operation"
|
202
|
-
end
|
203
|
-
# verify the required parameter 'address_id' is set
|
204
|
-
if @api_client.config.client_side_validation && address_id.nil?
|
205
|
-
fail ArgumentError, "Missing the required parameter 'address_id' when calling StakeApi.create_staking_operation"
|
206
|
-
end
|
207
|
-
# verify the required parameter 'create_staking_operation_request' is set
|
208
|
-
if @api_client.config.client_side_validation && create_staking_operation_request.nil?
|
209
|
-
fail ArgumentError, "Missing the required parameter 'create_staking_operation_request' when calling StakeApi.create_staking_operation"
|
210
|
-
end
|
211
|
-
# resource path
|
212
|
-
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))
|
213
|
-
|
214
|
-
# query parameters
|
215
|
-
query_params = opts[:query_params] || {}
|
216
|
-
|
217
|
-
# header parameters
|
218
|
-
header_params = opts[:header_params] || {}
|
219
|
-
# HTTP header 'Accept' (if needed)
|
220
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
221
|
-
# HTTP header 'Content-Type'
|
222
|
-
content_type = @api_client.select_header_content_type(['application/json'])
|
223
|
-
if !content_type.nil?
|
224
|
-
header_params['Content-Type'] = content_type
|
225
|
-
end
|
226
|
-
|
227
|
-
# form parameters
|
228
|
-
form_params = opts[:form_params] || {}
|
229
|
-
|
230
|
-
# http body (model)
|
231
|
-
post_body = opts[:debug_body] || @api_client.object_to_http_body(create_staking_operation_request)
|
232
|
-
|
233
|
-
# return_type
|
234
|
-
return_type = opts[:debug_return_type] || 'StakingOperation'
|
235
|
-
|
236
|
-
# auth_names
|
237
|
-
auth_names = opts[:debug_auth_names] || []
|
238
|
-
|
239
|
-
new_options = opts.merge(
|
240
|
-
:operation => :"StakeApi.create_staking_operation",
|
241
|
-
:header_params => header_params,
|
242
|
-
:query_params => query_params,
|
243
|
-
:form_params => form_params,
|
244
|
-
:body => post_body,
|
245
|
-
:auth_names => auth_names,
|
246
|
-
:return_type => return_type
|
247
|
-
)
|
248
|
-
|
249
|
-
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
250
|
-
if @api_client.config.debugging
|
251
|
-
@api_client.config.logger.debug "API called: StakeApi#create_staking_operation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
252
|
-
end
|
253
|
-
return data, status_code, headers
|
254
|
-
end
|
255
|
-
|
256
90
|
# Fetch historical staking balances
|
257
91
|
# Fetch historical staking balances for given address.
|
258
92
|
# @param network_id [String] The ID of the blockchain network.
|
@@ -593,80 +427,5 @@ module Coinbase::Client
|
|
593
427
|
end
|
594
428
|
return data, status_code, headers
|
595
429
|
end
|
596
|
-
|
597
|
-
# Get the latest state of a staking operation
|
598
|
-
# Get the latest state of a staking operation.
|
599
|
-
# @param wallet_id [String] The ID of the wallet the address belongs to
|
600
|
-
# @param address_id [String] The ID of the address to fetch the staking operation for.
|
601
|
-
# @param staking_operation_id [String] The ID of the staking operation.
|
602
|
-
# @param [Hash] opts the optional parameters
|
603
|
-
# @return [StakingOperation]
|
604
|
-
def get_staking_operation(wallet_id, address_id, staking_operation_id, opts = {})
|
605
|
-
data, _status_code, _headers = get_staking_operation_with_http_info(wallet_id, address_id, staking_operation_id, opts)
|
606
|
-
data
|
607
|
-
end
|
608
|
-
|
609
|
-
# Get the latest state of a staking operation
|
610
|
-
# Get the latest state of a staking operation.
|
611
|
-
# @param wallet_id [String] The ID of the wallet the address belongs to
|
612
|
-
# @param address_id [String] The ID of the address to fetch the staking operation for.
|
613
|
-
# @param staking_operation_id [String] The ID of the staking operation.
|
614
|
-
# @param [Hash] opts the optional parameters
|
615
|
-
# @return [Array<(StakingOperation, Integer, Hash)>] StakingOperation data, response status code and response headers
|
616
|
-
def get_staking_operation_with_http_info(wallet_id, address_id, staking_operation_id, opts = {})
|
617
|
-
if @api_client.config.debugging
|
618
|
-
@api_client.config.logger.debug 'Calling API: StakeApi.get_staking_operation ...'
|
619
|
-
end
|
620
|
-
# verify the required parameter 'wallet_id' is set
|
621
|
-
if @api_client.config.client_side_validation && wallet_id.nil?
|
622
|
-
fail ArgumentError, "Missing the required parameter 'wallet_id' when calling StakeApi.get_staking_operation"
|
623
|
-
end
|
624
|
-
# verify the required parameter 'address_id' is set
|
625
|
-
if @api_client.config.client_side_validation && address_id.nil?
|
626
|
-
fail ArgumentError, "Missing the required parameter 'address_id' when calling StakeApi.get_staking_operation"
|
627
|
-
end
|
628
|
-
# verify the required parameter 'staking_operation_id' is set
|
629
|
-
if @api_client.config.client_side_validation && staking_operation_id.nil?
|
630
|
-
fail ArgumentError, "Missing the required parameter 'staking_operation_id' when calling StakeApi.get_staking_operation"
|
631
|
-
end
|
632
|
-
# resource path
|
633
|
-
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))
|
634
|
-
|
635
|
-
# query parameters
|
636
|
-
query_params = opts[:query_params] || {}
|
637
|
-
|
638
|
-
# header parameters
|
639
|
-
header_params = opts[:header_params] || {}
|
640
|
-
# HTTP header 'Accept' (if needed)
|
641
|
-
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
642
|
-
|
643
|
-
# form parameters
|
644
|
-
form_params = opts[:form_params] || {}
|
645
|
-
|
646
|
-
# http body (model)
|
647
|
-
post_body = opts[:debug_body]
|
648
|
-
|
649
|
-
# return_type
|
650
|
-
return_type = opts[:debug_return_type] || 'StakingOperation'
|
651
|
-
|
652
|
-
# auth_names
|
653
|
-
auth_names = opts[:debug_auth_names] || []
|
654
|
-
|
655
|
-
new_options = opts.merge(
|
656
|
-
:operation => :"StakeApi.get_staking_operation",
|
657
|
-
:header_params => header_params,
|
658
|
-
:query_params => query_params,
|
659
|
-
:form_params => form_params,
|
660
|
-
:body => post_body,
|
661
|
-
:auth_names => auth_names,
|
662
|
-
:return_type => return_type
|
663
|
-
)
|
664
|
-
|
665
|
-
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
666
|
-
if @api_client.config.debugging
|
667
|
-
@api_client.config.logger.debug "API called: StakeApi#get_staking_operation\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
668
|
-
end
|
669
|
-
return data, status_code, headers
|
670
|
-
end
|
671
430
|
end
|
672
431
|
end
|
@@ -6,7 +6,7 @@
|
|
6
6
|
The version of the OpenAPI document: 0.0.1-alpha
|
7
7
|
Contact: yuga.cohler@coinbase.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
Generator version: 7.
|
9
|
+
Generator version: 7.7.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -99,7 +99,7 @@ module Coinbase::Client
|
|
99
99
|
# @param network_id [String] The ID of the blockchain network.
|
100
100
|
# @param asset_id [String] The symbol of the asset to get the validators for.
|
101
101
|
# @param [Hash] opts the optional parameters
|
102
|
-
# @option opts [
|
102
|
+
# @option opts [ValidatorStatus] :status A filter to list validators based on a status.
|
103
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
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
105
|
# @return [ValidatorList]
|
@@ -113,7 +113,7 @@ module Coinbase::Client
|
|
113
113
|
# @param network_id [String] The ID of the blockchain network.
|
114
114
|
# @param asset_id [String] The symbol of the asset to get the validators for.
|
115
115
|
# @param [Hash] opts the optional parameters
|
116
|
-
# @option opts [
|
116
|
+
# @option opts [ValidatorStatus] :status A filter to list validators based on a status.
|
117
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
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
119
|
# @return [Array<(ValidatorList, Integer, Hash)>] ValidatorList data, response status code and response headers
|
@@ -0,0 +1,263 @@
|
|
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
|
+
Contact: yuga.cohler@coinbase.com
|
8
|
+
Generated by: https://openapi-generator.tech
|
9
|
+
Generator version: 7.7.0
|
10
|
+
|
11
|
+
=end
|
12
|
+
|
13
|
+
require 'cgi'
|
14
|
+
|
15
|
+
module Coinbase::Client
|
16
|
+
class WalletStakeApi
|
17
|
+
attr_accessor :api_client
|
18
|
+
|
19
|
+
def initialize(api_client = ApiClient.default)
|
20
|
+
@api_client = api_client
|
21
|
+
end
|
22
|
+
# Broadcast a staking operation
|
23
|
+
# Broadcast a staking operation.
|
24
|
+
# @param wallet_id [String] The ID of the wallet the address belongs to.
|
25
|
+
# @param address_id [String] The ID of the address the staking operation belongs to.
|
26
|
+
# @param staking_operation_id [String] The ID of the staking operation to broadcast.
|
27
|
+
# @param broadcast_staking_operation_request [BroadcastStakingOperationRequest]
|
28
|
+
# @param [Hash] opts the optional parameters
|
29
|
+
# @return [StakingOperation]
|
30
|
+
def broadcast_staking_operation(wallet_id, address_id, staking_operation_id, broadcast_staking_operation_request, opts = {})
|
31
|
+
data, _status_code, _headers = broadcast_staking_operation_with_http_info(wallet_id, address_id, staking_operation_id, broadcast_staking_operation_request, opts)
|
32
|
+
data
|
33
|
+
end
|
34
|
+
|
35
|
+
# Broadcast a staking operation
|
36
|
+
# Broadcast a staking operation.
|
37
|
+
# @param wallet_id [String] The ID of the wallet the address belongs to.
|
38
|
+
# @param address_id [String] The ID of the address the staking operation belongs to.
|
39
|
+
# @param staking_operation_id [String] The ID of the staking operation to broadcast.
|
40
|
+
# @param broadcast_staking_operation_request [BroadcastStakingOperationRequest]
|
41
|
+
# @param [Hash] opts the optional parameters
|
42
|
+
# @return [Array<(StakingOperation, Integer, Hash)>] StakingOperation data, response status code and response headers
|
43
|
+
def broadcast_staking_operation_with_http_info(wallet_id, address_id, staking_operation_id, broadcast_staking_operation_request, opts = {})
|
44
|
+
if @api_client.config.debugging
|
45
|
+
@api_client.config.logger.debug 'Calling API: WalletStakeApi.broadcast_staking_operation ...'
|
46
|
+
end
|
47
|
+
# verify the required parameter 'wallet_id' is set
|
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"
|
50
|
+
end
|
51
|
+
# verify the required parameter 'address_id' is set
|
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"
|
54
|
+
end
|
55
|
+
# verify the required parameter 'staking_operation_id' is set
|
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"
|
58
|
+
end
|
59
|
+
# verify the required parameter 'broadcast_staking_operation_request' is set
|
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"
|
62
|
+
end
|
63
|
+
# resource path
|
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))
|
65
|
+
|
66
|
+
# query parameters
|
67
|
+
query_params = opts[:query_params] || {}
|
68
|
+
|
69
|
+
# header parameters
|
70
|
+
header_params = opts[:header_params] || {}
|
71
|
+
# HTTP header 'Accept' (if needed)
|
72
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
73
|
+
# HTTP header 'Content-Type'
|
74
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
75
|
+
if !content_type.nil?
|
76
|
+
header_params['Content-Type'] = content_type
|
77
|
+
end
|
78
|
+
|
79
|
+
# form parameters
|
80
|
+
form_params = opts[:form_params] || {}
|
81
|
+
|
82
|
+
# http body (model)
|
83
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(broadcast_staking_operation_request)
|
84
|
+
|
85
|
+
# return_type
|
86
|
+
return_type = opts[:debug_return_type] || 'StakingOperation'
|
87
|
+
|
88
|
+
# auth_names
|
89
|
+
auth_names = opts[:debug_auth_names] || []
|
90
|
+
|
91
|
+
new_options = opts.merge(
|
92
|
+
:operation => :"WalletStakeApi.broadcast_staking_operation",
|
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(:POST, local_var_path, new_options)
|
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}"
|
104
|
+
end
|
105
|
+
return data, status_code, headers
|
106
|
+
end
|
107
|
+
|
108
|
+
# Create a new staking operation for an address
|
109
|
+
# Create a new staking operation.
|
110
|
+
# @param wallet_id [String] The ID of the wallet the address belongs to.
|
111
|
+
# @param address_id [String] The ID of the address to create the staking operation for.
|
112
|
+
# @param create_staking_operation_request [CreateStakingOperationRequest]
|
113
|
+
# @param [Hash] opts the optional parameters
|
114
|
+
# @return [StakingOperation]
|
115
|
+
def create_staking_operation(wallet_id, address_id, create_staking_operation_request, opts = {})
|
116
|
+
data, _status_code, _headers = create_staking_operation_with_http_info(wallet_id, address_id, create_staking_operation_request, opts)
|
117
|
+
data
|
118
|
+
end
|
119
|
+
|
120
|
+
# Create a new staking operation for an address
|
121
|
+
# Create a new staking operation.
|
122
|
+
# @param wallet_id [String] The ID of the wallet the address belongs to.
|
123
|
+
# @param address_id [String] The ID of the address to create the staking operation for.
|
124
|
+
# @param create_staking_operation_request [CreateStakingOperationRequest]
|
125
|
+
# @param [Hash] opts the optional parameters
|
126
|
+
# @return [Array<(StakingOperation, Integer, Hash)>] StakingOperation data, response status code and response headers
|
127
|
+
def create_staking_operation_with_http_info(wallet_id, address_id, create_staking_operation_request, opts = {})
|
128
|
+
if @api_client.config.debugging
|
129
|
+
@api_client.config.logger.debug 'Calling API: WalletStakeApi.create_staking_operation ...'
|
130
|
+
end
|
131
|
+
# verify the required parameter 'wallet_id' is set
|
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"
|
134
|
+
end
|
135
|
+
# verify the required parameter 'address_id' is set
|
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"
|
138
|
+
end
|
139
|
+
# verify the required parameter 'create_staking_operation_request' is set
|
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"
|
142
|
+
end
|
143
|
+
# resource path
|
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))
|
145
|
+
|
146
|
+
# query parameters
|
147
|
+
query_params = opts[:query_params] || {}
|
148
|
+
|
149
|
+
# header parameters
|
150
|
+
header_params = opts[:header_params] || {}
|
151
|
+
# HTTP header 'Accept' (if needed)
|
152
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
153
|
+
# HTTP header 'Content-Type'
|
154
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
155
|
+
if !content_type.nil?
|
156
|
+
header_params['Content-Type'] = content_type
|
157
|
+
end
|
158
|
+
|
159
|
+
# form parameters
|
160
|
+
form_params = opts[:form_params] || {}
|
161
|
+
|
162
|
+
# http body (model)
|
163
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(create_staking_operation_request)
|
164
|
+
|
165
|
+
# return_type
|
166
|
+
return_type = opts[:debug_return_type] || 'StakingOperation'
|
167
|
+
|
168
|
+
# auth_names
|
169
|
+
auth_names = opts[:debug_auth_names] || []
|
170
|
+
|
171
|
+
new_options = opts.merge(
|
172
|
+
:operation => :"WalletStakeApi.create_staking_operation",
|
173
|
+
:header_params => header_params,
|
174
|
+
:query_params => query_params,
|
175
|
+
:form_params => form_params,
|
176
|
+
:body => post_body,
|
177
|
+
:auth_names => auth_names,
|
178
|
+
:return_type => return_type
|
179
|
+
)
|
180
|
+
|
181
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
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}"
|
184
|
+
end
|
185
|
+
return data, status_code, headers
|
186
|
+
end
|
187
|
+
|
188
|
+
# Get the latest state of a staking operation
|
189
|
+
# Get the latest state of a staking operation.
|
190
|
+
# @param wallet_id [String] The ID of the wallet the address belongs to
|
191
|
+
# @param address_id [String] The ID of the address to fetch the staking operation for.
|
192
|
+
# @param staking_operation_id [String] The ID of the staking operation.
|
193
|
+
# @param [Hash] opts the optional parameters
|
194
|
+
# @return [StakingOperation]
|
195
|
+
def get_staking_operation(wallet_id, address_id, staking_operation_id, opts = {})
|
196
|
+
data, _status_code, _headers = get_staking_operation_with_http_info(wallet_id, address_id, staking_operation_id, opts)
|
197
|
+
data
|
198
|
+
end
|
199
|
+
|
200
|
+
# Get the latest state of a staking operation
|
201
|
+
# Get the latest state of a staking operation.
|
202
|
+
# @param wallet_id [String] The ID of the wallet the address belongs to
|
203
|
+
# @param address_id [String] The ID of the address to fetch the staking operation for.
|
204
|
+
# @param staking_operation_id [String] The ID of the staking operation.
|
205
|
+
# @param [Hash] opts the optional parameters
|
206
|
+
# @return [Array<(StakingOperation, Integer, Hash)>] StakingOperation data, response status code and response headers
|
207
|
+
def get_staking_operation_with_http_info(wallet_id, address_id, staking_operation_id, opts = {})
|
208
|
+
if @api_client.config.debugging
|
209
|
+
@api_client.config.logger.debug 'Calling API: WalletStakeApi.get_staking_operation ...'
|
210
|
+
end
|
211
|
+
# verify the required parameter 'wallet_id' is set
|
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"
|
214
|
+
end
|
215
|
+
# verify the required parameter 'address_id' is set
|
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"
|
218
|
+
end
|
219
|
+
# verify the required parameter 'staking_operation_id' is set
|
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"
|
222
|
+
end
|
223
|
+
# resource path
|
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))
|
225
|
+
|
226
|
+
# query parameters
|
227
|
+
query_params = opts[:query_params] || {}
|
228
|
+
|
229
|
+
# header parameters
|
230
|
+
header_params = opts[:header_params] || {}
|
231
|
+
# HTTP header 'Accept' (if needed)
|
232
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
233
|
+
|
234
|
+
# form parameters
|
235
|
+
form_params = opts[:form_params] || {}
|
236
|
+
|
237
|
+
# http body (model)
|
238
|
+
post_body = opts[:debug_body]
|
239
|
+
|
240
|
+
# return_type
|
241
|
+
return_type = opts[:debug_return_type] || 'StakingOperation'
|
242
|
+
|
243
|
+
# auth_names
|
244
|
+
auth_names = opts[:debug_auth_names] || []
|
245
|
+
|
246
|
+
new_options = opts.merge(
|
247
|
+
:operation => :"WalletStakeApi.get_staking_operation",
|
248
|
+
:header_params => header_params,
|
249
|
+
:query_params => query_params,
|
250
|
+
:form_params => form_params,
|
251
|
+
:body => post_body,
|
252
|
+
:auth_names => auth_names,
|
253
|
+
:return_type => return_type
|
254
|
+
)
|
255
|
+
|
256
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
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}"
|
259
|
+
end
|
260
|
+
return data, status_code, headers
|
261
|
+
end
|
262
|
+
end
|
263
|
+
end
|
@@ -6,7 +6,7 @@
|
|
6
6
|
The version of the OpenAPI document: 0.0.1-alpha
|
7
7
|
Contact: yuga.cohler@coinbase.com
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
Generator version: 7.
|
9
|
+
Generator version: 7.7.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -79,6 +79,14 @@ module Coinbase::Client
|
|
79
79
|
# @return [true, false]
|
80
80
|
attr_accessor :debugging
|
81
81
|
|
82
|
+
# Set this to ignore operation servers for the API client. This is useful when you need to
|
83
|
+
# send requests to a different server than the one specified in the OpenAPI document.
|
84
|
+
# Will default to the base url defined in the spec but can be overridden by setting
|
85
|
+
# `scheme`, `host`, `base_path` directly.
|
86
|
+
# Default to false.
|
87
|
+
# @return [true, false]
|
88
|
+
attr_accessor :ignore_operation_servers
|
89
|
+
|
82
90
|
# Defines the logger used for debugging.
|
83
91
|
# Default to `Rails.logger` (when in Rails) or logging to STDOUT.
|
84
92
|
#
|
@@ -170,6 +178,7 @@ module Coinbase::Client
|
|
170
178
|
@return_binary_data = false
|
171
179
|
@params_encoder = nil
|
172
180
|
@debugging = false
|
181
|
+
@ignore_operation_servers = false
|
173
182
|
@inject_format = false
|
174
183
|
@force_ending_format = false
|
175
184
|
@logger = defined?(Rails) ? Rails.logger : Logger.new(STDOUT)
|
@@ -204,6 +213,7 @@ module Coinbase::Client
|
|
204
213
|
|
205
214
|
# Returns base URL for specified operation based on server settings
|
206
215
|
def base_url(operation = nil)
|
216
|
+
return "#{scheme}://#{[host, base_path].join('/').gsub(/\/+/, '/')}".sub(/\/+\z/, '') if ignore_operation_servers
|
207
217
|
if operation_server_settings.key?(operation) then
|
208
218
|
index = server_operation_index.fetch(operation, server_index)
|
209
219
|
server_url(index.nil? ? 0 : index, server_operation_variables.fetch(operation, server_variables), operation_server_settings[operation])
|