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.
- 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
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bf3cd3f21e8ca2443b776f6cc4c276dde8199a595087cce2e924318a91f7f0bf
|
4
|
+
data.tar.gz: 404b48c42fcdf6cda2062439ee9e17104912fdf7f359e5e60c1a2d8b95fce50a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 77b9bb44dc2d19bd6005bb274786679c0cc47586a90ad77c7288256ebd5ea6a0126fcdd751c73941b2786835d427864cd78d9ccfc3b2275164434c9b0e5c58a8
|
7
|
+
data.tar.gz: de1b59e1e4e3b077e65dbbc4d1a85ec988a4327cd29ecd9bec9167dbbf39762ad79df36ae508e25b48f87c9c4746069672baf52df86564434234208ec44731cf
|
@@ -217,6 +217,34 @@ module Coinbase
|
|
217
217
|
)
|
218
218
|
end
|
219
219
|
|
220
|
+
# Funds the address from your account on the Coinbase Platform for the given amount of the given Asset.
|
221
|
+
# @param amount [Integer, Float, BigDecimal] The amount of the Asset to fund the wallet with.
|
222
|
+
# @param asset_id [Symbol] The ID of the Asset to trade from. For Ether, :eth, :gwei, and :wei are supported.
|
223
|
+
# @return [Coinbase::FundOperation] The FundOperation object.
|
224
|
+
def fund(amount, asset_id)
|
225
|
+
FundOperation.create(
|
226
|
+
address_id: id,
|
227
|
+
amount: amount,
|
228
|
+
asset_id: asset_id,
|
229
|
+
network: network,
|
230
|
+
wallet_id: wallet_id
|
231
|
+
)
|
232
|
+
end
|
233
|
+
|
234
|
+
# Gets a quote for a fund operation to fund the address from your Coinbase platform,
|
235
|
+
# account for the amount of the specified Asset.
|
236
|
+
# @param asset_id [Symbol] The ID of the Asset to trade from. For Ether, :eth, :gwei, and :wei are supported.
|
237
|
+
# @return [Coinbase::FundQuote] The FundQuote object.
|
238
|
+
def quote_fund(amount, asset_id)
|
239
|
+
FundQuote.create(
|
240
|
+
address_id: id,
|
241
|
+
amount: amount,
|
242
|
+
asset_id: asset_id,
|
243
|
+
network: network,
|
244
|
+
wallet_id: wallet_id
|
245
|
+
)
|
246
|
+
end
|
247
|
+
|
220
248
|
# Stakes the given amount of the given Asset. The stake operation
|
221
249
|
# may take a few minutes to complete in the case when infrastructure is spun up.
|
222
250
|
# @param amount [Integer, Float, BigDecimal] The amount of the Asset to stake.
|
data/lib/coinbase/balance.rb
CHANGED
@@ -43,7 +43,7 @@ module Coinbase
|
|
43
43
|
# Returns a string representation of the Balance.
|
44
44
|
# @return [String] a string representation of the Balance
|
45
45
|
def to_s
|
46
|
-
|
46
|
+
Coinbase.pretty_print_object(self.class, amount: amount.to_s('F'), asset_id: asset_id)
|
47
47
|
end
|
48
48
|
|
49
49
|
# Same as to_s.
|
@@ -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.
|
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
|
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:
|
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
|
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
|
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
|
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
|
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 => :"
|
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:
|
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:
|
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
|
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
|
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
|
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 => :"
|
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:
|
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:
|
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
|
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
|
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
|
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 => :"
|
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:
|
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
|
@@ -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.
|
9
|
+
Generator version: 7.9.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -419,5 +419,162 @@ module Coinbase::Client
|
|
419
419
|
end
|
420
420
|
return data, status_code, headers
|
421
421
|
end
|
422
|
+
|
423
|
+
# Get a validator belonging to the CDP project
|
424
|
+
# Get a validator belonging to the user for a given network, asset and id.
|
425
|
+
# @param network_id [String] The ID of the blockchain network.
|
426
|
+
# @param asset_id [String] The symbol of the asset to get the validator for.
|
427
|
+
# @param validator_id [String] The unique id of the validator to fetch details for.
|
428
|
+
# @param [Hash] opts the optional parameters
|
429
|
+
# @return [Validator]
|
430
|
+
def get_validator(network_id, asset_id, validator_id, opts = {})
|
431
|
+
data, _status_code, _headers = get_validator_with_http_info(network_id, asset_id, validator_id, opts)
|
432
|
+
data
|
433
|
+
end
|
434
|
+
|
435
|
+
# Get a validator belonging to the CDP project
|
436
|
+
# Get a validator belonging to the user for a given network, asset and id.
|
437
|
+
# @param network_id [String] The ID of the blockchain network.
|
438
|
+
# @param asset_id [String] The symbol of the asset to get the validator for.
|
439
|
+
# @param validator_id [String] The unique id of the validator to fetch details for.
|
440
|
+
# @param [Hash] opts the optional parameters
|
441
|
+
# @return [Array<(Validator, Integer, Hash)>] Validator data, response status code and response headers
|
442
|
+
def get_validator_with_http_info(network_id, asset_id, validator_id, opts = {})
|
443
|
+
if @api_client.config.debugging
|
444
|
+
@api_client.config.logger.debug 'Calling API: StakeApi.get_validator ...'
|
445
|
+
end
|
446
|
+
# verify the required parameter 'network_id' is set
|
447
|
+
if @api_client.config.client_side_validation && network_id.nil?
|
448
|
+
fail ArgumentError, "Missing the required parameter 'network_id' when calling StakeApi.get_validator"
|
449
|
+
end
|
450
|
+
# verify the required parameter 'asset_id' is set
|
451
|
+
if @api_client.config.client_side_validation && asset_id.nil?
|
452
|
+
fail ArgumentError, "Missing the required parameter 'asset_id' when calling StakeApi.get_validator"
|
453
|
+
end
|
454
|
+
# verify the required parameter 'validator_id' is set
|
455
|
+
if @api_client.config.client_side_validation && validator_id.nil?
|
456
|
+
fail ArgumentError, "Missing the required parameter 'validator_id' when calling StakeApi.get_validator"
|
457
|
+
end
|
458
|
+
# resource path
|
459
|
+
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))
|
460
|
+
|
461
|
+
# query parameters
|
462
|
+
query_params = opts[:query_params] || {}
|
463
|
+
|
464
|
+
# header parameters
|
465
|
+
header_params = opts[:header_params] || {}
|
466
|
+
# HTTP header 'Accept' (if needed)
|
467
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
468
|
+
|
469
|
+
# form parameters
|
470
|
+
form_params = opts[:form_params] || {}
|
471
|
+
|
472
|
+
# http body (model)
|
473
|
+
post_body = opts[:debug_body]
|
474
|
+
|
475
|
+
# return_type
|
476
|
+
return_type = opts[:debug_return_type] || 'Validator'
|
477
|
+
|
478
|
+
# auth_names
|
479
|
+
auth_names = opts[:debug_auth_names] || []
|
480
|
+
|
481
|
+
new_options = opts.merge(
|
482
|
+
:operation => :"StakeApi.get_validator",
|
483
|
+
:header_params => header_params,
|
484
|
+
:query_params => query_params,
|
485
|
+
:form_params => form_params,
|
486
|
+
:body => post_body,
|
487
|
+
:auth_names => auth_names,
|
488
|
+
:return_type => return_type
|
489
|
+
)
|
490
|
+
|
491
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
492
|
+
if @api_client.config.debugging
|
493
|
+
@api_client.config.logger.debug "API called: StakeApi#get_validator\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
494
|
+
end
|
495
|
+
return data, status_code, headers
|
496
|
+
end
|
497
|
+
|
498
|
+
# List validators belonging to the CDP project
|
499
|
+
# List validators belonging to the user for a given network and asset.
|
500
|
+
# @param network_id [String] The ID of the blockchain network.
|
501
|
+
# @param asset_id [String] The symbol of the asset to get the validators for.
|
502
|
+
# @param [Hash] opts the optional parameters
|
503
|
+
# @option opts [ValidatorStatus] :status A filter to list validators based on a status.
|
504
|
+
# @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.
|
505
|
+
# @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.
|
506
|
+
# @return [ValidatorList]
|
507
|
+
def list_validators(network_id, asset_id, opts = {})
|
508
|
+
data, _status_code, _headers = list_validators_with_http_info(network_id, asset_id, opts)
|
509
|
+
data
|
510
|
+
end
|
511
|
+
|
512
|
+
# List validators belonging to the CDP project
|
513
|
+
# List validators belonging to the user for a given network and asset.
|
514
|
+
# @param network_id [String] The ID of the blockchain network.
|
515
|
+
# @param asset_id [String] The symbol of the asset to get the validators for.
|
516
|
+
# @param [Hash] opts the optional parameters
|
517
|
+
# @option opts [ValidatorStatus] :status A filter to list validators based on a status.
|
518
|
+
# @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.
|
519
|
+
# @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.
|
520
|
+
# @return [Array<(ValidatorList, Integer, Hash)>] ValidatorList data, response status code and response headers
|
521
|
+
def list_validators_with_http_info(network_id, asset_id, opts = {})
|
522
|
+
if @api_client.config.debugging
|
523
|
+
@api_client.config.logger.debug 'Calling API: StakeApi.list_validators ...'
|
524
|
+
end
|
525
|
+
# verify the required parameter 'network_id' is set
|
526
|
+
if @api_client.config.client_side_validation && network_id.nil?
|
527
|
+
fail ArgumentError, "Missing the required parameter 'network_id' when calling StakeApi.list_validators"
|
528
|
+
end
|
529
|
+
# verify the required parameter 'asset_id' is set
|
530
|
+
if @api_client.config.client_side_validation && asset_id.nil?
|
531
|
+
fail ArgumentError, "Missing the required parameter 'asset_id' when calling StakeApi.list_validators"
|
532
|
+
end
|
533
|
+
if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'].to_s.length > 5000
|
534
|
+
fail ArgumentError, 'invalid value for "opts[:"page"]" when calling StakeApi.list_validators, the character length must be smaller than or equal to 5000.'
|
535
|
+
end
|
536
|
+
|
537
|
+
# resource path
|
538
|
+
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))
|
539
|
+
|
540
|
+
# query parameters
|
541
|
+
query_params = opts[:query_params] || {}
|
542
|
+
query_params[:'status'] = opts[:'status'] if !opts[:'status'].nil?
|
543
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
544
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
545
|
+
|
546
|
+
# header parameters
|
547
|
+
header_params = opts[:header_params] || {}
|
548
|
+
# HTTP header 'Accept' (if needed)
|
549
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
|
550
|
+
|
551
|
+
# form parameters
|
552
|
+
form_params = opts[:form_params] || {}
|
553
|
+
|
554
|
+
# http body (model)
|
555
|
+
post_body = opts[:debug_body]
|
556
|
+
|
557
|
+
# return_type
|
558
|
+
return_type = opts[:debug_return_type] || 'ValidatorList'
|
559
|
+
|
560
|
+
# auth_names
|
561
|
+
auth_names = opts[:debug_auth_names] || []
|
562
|
+
|
563
|
+
new_options = opts.merge(
|
564
|
+
:operation => :"StakeApi.list_validators",
|
565
|
+
:header_params => header_params,
|
566
|
+
:query_params => query_params,
|
567
|
+
:form_params => form_params,
|
568
|
+
:body => post_body,
|
569
|
+
:auth_names => auth_names,
|
570
|
+
:return_type => return_type
|
571
|
+
)
|
572
|
+
|
573
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
574
|
+
if @api_client.config.debugging
|
575
|
+
@api_client.config.logger.debug "API called: StakeApi#list_validators\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
576
|
+
end
|
577
|
+
return data, status_code, headers
|
578
|
+
end
|
422
579
|
end
|
423
580
|
end
|