coinbase-sdk 0.10.0 → 0.13.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/address.rb +22 -3
- data/lib/coinbase/address_reputation.rb +67 -0
- data/lib/coinbase/balance.rb +1 -1
- data/lib/coinbase/client/api/addresses_api.rb +10 -10
- data/lib/coinbase/client/api/assets_api.rb +2 -2
- data/lib/coinbase/client/api/balance_history_api.rb +2 -2
- data/lib/coinbase/client/api/contract_events_api.rb +2 -2
- data/lib/coinbase/client/api/contract_invocations_api.rb +5 -5
- data/lib/coinbase/client/api/external_addresses_api.rb +246 -5
- data/lib/coinbase/client/api/fund_api.rb +5 -5
- data/lib/coinbase/client/api/{wallet_stake_api.rb → mpc_wallet_stake_api.rb} +24 -24
- data/lib/coinbase/client/api/networks_api.rb +2 -2
- data/lib/coinbase/client/api/onchain_identity_api.rb +2 -2
- data/lib/coinbase/client/api/reputation_api.rb +91 -0
- data/lib/coinbase/client/api/server_signers_api.rb +7 -7
- data/lib/coinbase/client/api/smart_contracts_api.rb +169 -26
- data/lib/coinbase/client/api/stake_api.rb +163 -6
- data/lib/coinbase/client/api/trades_api.rb +5 -5
- data/lib/coinbase/client/api/transaction_history_api.rb +2 -2
- data/lib/coinbase/client/api/transfers_api.rb +14 -14
- data/lib/coinbase/client/api/users_api.rb +1 -1
- data/lib/coinbase/client/api/wallets_api.rb +6 -6
- data/lib/coinbase/client/api/webhooks_api.rb +6 -6
- data/lib/coinbase/client/api_client.rb +1 -1
- data/lib/coinbase/client/api_error.rb +1 -1
- data/lib/coinbase/client/configuration.rb +15 -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 +239 -0
- data/lib/coinbase/client/models/address_reputation_metadata.rb +376 -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_transfer_request.rb → broadcast_external_transfer_request.rb} +4 -4
- 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/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_external_transfer_request.rb +273 -0
- data/lib/coinbase/client/models/create_fund_operation_request.rb +2 -2
- data/lib/coinbase/client/models/create_fund_quote_request.rb +2 -2
- 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 +2 -2
- 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 +15 -5
- 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/register_smart_contract_request.rb +252 -0
- 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 +37 -31
- data/lib/coinbase/client/models/smart_contract_activity_event.rb +386 -0
- 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 +3 -2
- 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 +2 -37
- data/lib/coinbase/client/models/transfer_list.rb +1 -1
- data/lib/coinbase/client/models/update_smart_contract_request.rb +245 -0
- 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 +3 -2
- data/lib/coinbase/client/models/webhook_event_type_filter.rb +2 -1
- data/lib/coinbase/client/models/webhook_list.rb +1 -1
- data/lib/coinbase/client/models/webhook_smart_contract_event_filter.rb +225 -0
- data/lib/coinbase/client/models/webhook_wallet_activity_filter.rb +8 -1
- data/lib/coinbase/client/version.rb +1 -1
- data/lib/coinbase/client.rb +11 -4
- data/lib/coinbase/crypto_amount.rb +62 -0
- data/lib/coinbase/errors.rb +8 -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 +337 -244
- 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/data.rb +6 -4
- data/lib/coinbase/wallet.rb +16 -3
- data/lib/coinbase.rb +6 -1
- metadata +20 -8
- data/lib/coinbase/client/api/validators_api.rb +0 -179
@@ -107,7 +107,7 @@ module Coinbase
|
|
107
107
|
private_class_method :stake_api
|
108
108
|
|
109
109
|
def self.wallet_stake_api
|
110
|
-
Coinbase::Client::
|
110
|
+
Coinbase::Client::MPCWalletStakeApi.new(Coinbase.configuration.api_client)
|
111
111
|
end
|
112
112
|
|
113
113
|
private_class_method :wallet_stake_api
|
@@ -324,7 +324,7 @@ module Coinbase
|
|
324
324
|
end
|
325
325
|
|
326
326
|
def wallet_stake_api
|
327
|
-
@wallet_stake_api ||= Coinbase::Client::
|
327
|
+
@wallet_stake_api ||= Coinbase::Client::MPCWalletStakeApi.new(Coinbase.configuration.api_client)
|
328
328
|
end
|
329
329
|
|
330
330
|
def update_transactions(transactions)
|
data/lib/coinbase/validator.rb
CHANGED
@@ -33,12 +33,9 @@ module Coinbase
|
|
33
33
|
network = Coinbase::Network.from_id(network)
|
34
34
|
|
35
35
|
validator = Coinbase.call_api do
|
36
|
-
|
37
|
-
network.normalized_id,
|
38
|
-
asset_id,
|
39
|
-
validator_id
|
40
|
-
)
|
36
|
+
stake_api.get_validator(network.normalized_id, asset_id, validator_id)
|
41
37
|
end
|
38
|
+
|
42
39
|
new(validator)
|
43
40
|
end
|
44
41
|
|
@@ -57,7 +54,7 @@ module Coinbase
|
|
57
54
|
# Returns a string representation of the Validator.
|
58
55
|
# @return [String] a string representation of the Validator
|
59
56
|
def to_s
|
60
|
-
|
57
|
+
Coinbase.pretty_print_object(self, validator_id: validator_id, status: status)
|
61
58
|
end
|
62
59
|
|
63
60
|
# Same as to_s.
|
@@ -68,7 +65,7 @@ module Coinbase
|
|
68
65
|
|
69
66
|
def self.list_page(network, asset_id, status, page)
|
70
67
|
Coinbase.call_api do
|
71
|
-
|
68
|
+
stake_api.list_validators(
|
72
69
|
network.normalized_id,
|
73
70
|
asset_id,
|
74
71
|
{
|
@@ -81,10 +78,10 @@ module Coinbase
|
|
81
78
|
|
82
79
|
private_class_method :list_page
|
83
80
|
|
84
|
-
def self.
|
85
|
-
Coinbase::Client::
|
81
|
+
def self.stake_api
|
82
|
+
Coinbase::Client::StakeApi.new(Coinbase.configuration.api_client)
|
86
83
|
end
|
87
84
|
|
88
|
-
private_class_method :
|
85
|
+
private_class_method :stake_api
|
89
86
|
end
|
90
87
|
end
|
data/lib/coinbase/version.rb
CHANGED
data/lib/coinbase/wallet/data.rb
CHANGED
@@ -4,27 +4,29 @@ module Coinbase
|
|
4
4
|
class Wallet
|
5
5
|
# The data required to recreate a Wallet.
|
6
6
|
class Data
|
7
|
-
attr_reader :wallet_id, :seed
|
7
|
+
attr_reader :wallet_id, :seed, :network_id
|
8
8
|
|
9
9
|
# Returns a new Data object.
|
10
10
|
# @param wallet_id [String] The ID of the Wallet
|
11
11
|
# @param seed [String] The seed of the Wallet
|
12
|
-
|
12
|
+
# @param network_id [String, nil] The network ID of the Wallet (optional)
|
13
|
+
def initialize(wallet_id:, seed:, network_id: nil)
|
13
14
|
@wallet_id = wallet_id
|
14
15
|
@seed = seed
|
16
|
+
@network_id = network_id
|
15
17
|
end
|
16
18
|
|
17
19
|
# Converts the Data object to a Hash.
|
18
20
|
# @return [Hash] The Hash representation of the Data object
|
19
21
|
def to_hash
|
20
|
-
{ wallet_id: wallet_id, seed: seed }
|
22
|
+
{ wallet_id: wallet_id, seed: seed, network_id: network_id }
|
21
23
|
end
|
22
24
|
|
23
25
|
# Creates a Data object from the given Hash.
|
24
26
|
# @param data [Hash] The Hash to create the Data object from
|
25
27
|
# @return [Data] The new Data object
|
26
28
|
def self.from_hash(data)
|
27
|
-
Data.new(wallet_id: data['wallet_id'], seed: data['seed'])
|
29
|
+
Data.new(wallet_id: data['wallet_id'], seed: data['seed'], network_id: data['network_id'])
|
28
30
|
end
|
29
31
|
end
|
30
32
|
end
|
data/lib/coinbase/wallet.rb
CHANGED
@@ -258,9 +258,21 @@ module Coinbase
|
|
258
258
|
# @return [Coinbase::SmartContract] The deployed multi-token contract.
|
259
259
|
# @raise [AddressCannotSignError] if the Address does not have a private key backing it.
|
260
260
|
|
261
|
+
# @!method quote_fund
|
262
|
+
# Gets a quote for a fund operation to fund the address from your Coinbase platform,
|
263
|
+
# account for the amount of the specified Asset.
|
264
|
+
# @param asset_id [Symbol] The ID of the Asset to trade from. For Ether, :eth, :gwei, and :wei are supported.
|
265
|
+
# @return [Coinbase::FundQuote] The FundQuote object.
|
266
|
+
|
267
|
+
# @!method fund
|
268
|
+
# Funds the address from your account on the Coinbase Platform for the given amount of the given Asset.
|
269
|
+
# @param amount [Integer, Float, BigDecimal] The amount of the Asset to fund the wallet with.
|
270
|
+
# @param asset_id [Symbol] The ID of the Asset to trade from. For Ether, :eth, :gwei, and :wei are supported.
|
271
|
+
# @return [Coinbase::FundOperation] The FundOperation object.
|
272
|
+
|
261
273
|
def_delegators :default_address, :transfer, :trade, :faucet, :stake, :unstake, :claim_stake, :staking_balances,
|
262
274
|
:stakeable_balance, :unstakeable_balance, :claimable_balance, :sign_payload, :invoke_contract,
|
263
|
-
:deploy_token, :deploy_nft, :deploy_multi_token
|
275
|
+
:deploy_token, :deploy_nft, :deploy_multi_token, :quote_fund, :fund
|
264
276
|
|
265
277
|
# Returns the addresses belonging to the Wallet.
|
266
278
|
# @return [Array<Coinbase::WalletAddress>] The addresses belonging to the Wallet
|
@@ -394,7 +406,7 @@ module Coinbase
|
|
394
406
|
|
395
407
|
raise 'Cannot export Wallet without loaded seed' if @master.nil?
|
396
408
|
|
397
|
-
Data.new(wallet_id: id, seed: @master.seed_hex)
|
409
|
+
Data.new(wallet_id: id, seed: @master.seed_hex, network_id: network.id)
|
398
410
|
end
|
399
411
|
|
400
412
|
# Returns whether the Wallet has a seed with which to derive keys and sign transactions.
|
@@ -435,7 +447,8 @@ module Coinbase
|
|
435
447
|
seed: seed_to_store,
|
436
448
|
encrypted: encrypt,
|
437
449
|
auth_tag: auth_tag,
|
438
|
-
iv: iv
|
450
|
+
iv: iv,
|
451
|
+
network_id: network.id
|
439
452
|
}
|
440
453
|
|
441
454
|
File.write(file_path, JSON.pretty_generate(existing_seeds_in_store))
|
data/lib/coinbase.rb
CHANGED
@@ -1,23 +1,28 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require_relative 'coinbase/client'
|
3
4
|
require_relative 'coinbase/address'
|
4
5
|
require_relative 'coinbase/address/wallet_address'
|
5
6
|
require_relative 'coinbase/address/external_address'
|
7
|
+
require_relative 'coinbase/address_reputation'
|
6
8
|
require_relative 'coinbase/asset'
|
7
9
|
require_relative 'coinbase/authenticator'
|
8
10
|
require_relative 'coinbase/correlation'
|
9
11
|
require_relative 'coinbase/balance'
|
10
12
|
require_relative 'coinbase/balance_map'
|
11
13
|
require_relative 'coinbase/historical_balance'
|
12
|
-
require_relative 'coinbase/client'
|
13
14
|
require_relative 'coinbase/constants'
|
14
15
|
require_relative 'coinbase/contract_event'
|
15
16
|
require_relative 'coinbase/contract_invocation'
|
17
|
+
require_relative 'coinbase/crypto_amount'
|
16
18
|
require_relative 'coinbase/destination'
|
17
19
|
require_relative 'coinbase/errors'
|
18
20
|
require_relative 'coinbase/faucet_transaction'
|
21
|
+
require_relative 'coinbase/fiat_amount'
|
19
22
|
require_relative 'coinbase/middleware'
|
20
23
|
require_relative 'coinbase/network'
|
24
|
+
require_relative 'coinbase/fund_operation'
|
25
|
+
require_relative 'coinbase/fund_quote'
|
21
26
|
require_relative 'coinbase/pagination'
|
22
27
|
require_relative 'coinbase/payload_signature'
|
23
28
|
require_relative 'coinbase/trade'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: coinbase-sdk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.13.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yuga Cohler
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-12-19 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bigdecimal
|
@@ -272,6 +272,7 @@ files:
|
|
272
272
|
- lib/coinbase/address.rb
|
273
273
|
- lib/coinbase/address/external_address.rb
|
274
274
|
- lib/coinbase/address/wallet_address.rb
|
275
|
+
- lib/coinbase/address_reputation.rb
|
275
276
|
- lib/coinbase/asset.rb
|
276
277
|
- lib/coinbase/authenticator.rb
|
277
278
|
- lib/coinbase/balance.rb
|
@@ -284,8 +285,10 @@ files:
|
|
284
285
|
- lib/coinbase/client/api/contract_invocations_api.rb
|
285
286
|
- lib/coinbase/client/api/external_addresses_api.rb
|
286
287
|
- lib/coinbase/client/api/fund_api.rb
|
288
|
+
- lib/coinbase/client/api/mpc_wallet_stake_api.rb
|
287
289
|
- lib/coinbase/client/api/networks_api.rb
|
288
290
|
- lib/coinbase/client/api/onchain_identity_api.rb
|
291
|
+
- lib/coinbase/client/api/reputation_api.rb
|
289
292
|
- lib/coinbase/client/api/server_signers_api.rb
|
290
293
|
- lib/coinbase/client/api/smart_contracts_api.rb
|
291
294
|
- lib/coinbase/client/api/stake_api.rb
|
@@ -293,8 +296,6 @@ files:
|
|
293
296
|
- lib/coinbase/client/api/transaction_history_api.rb
|
294
297
|
- lib/coinbase/client/api/transfers_api.rb
|
295
298
|
- lib/coinbase/client/api/users_api.rb
|
296
|
-
- lib/coinbase/client/api/validators_api.rb
|
297
|
-
- lib/coinbase/client/api/wallet_stake_api.rb
|
298
299
|
- lib/coinbase/client/api/wallets_api.rb
|
299
300
|
- lib/coinbase/client/api/webhooks_api.rb
|
300
301
|
- lib/coinbase/client/api_client.rb
|
@@ -304,13 +305,15 @@ files:
|
|
304
305
|
- lib/coinbase/client/models/address_balance_list.rb
|
305
306
|
- lib/coinbase/client/models/address_historical_balance_list.rb
|
306
307
|
- lib/coinbase/client/models/address_list.rb
|
308
|
+
- lib/coinbase/client/models/address_reputation.rb
|
309
|
+
- lib/coinbase/client/models/address_reputation_metadata.rb
|
307
310
|
- lib/coinbase/client/models/address_transaction_list.rb
|
308
311
|
- lib/coinbase/client/models/asset.rb
|
309
312
|
- lib/coinbase/client/models/balance.rb
|
310
313
|
- lib/coinbase/client/models/broadcast_contract_invocation_request.rb
|
314
|
+
- lib/coinbase/client/models/broadcast_external_transfer_request.rb
|
311
315
|
- lib/coinbase/client/models/broadcast_staking_operation_request.rb
|
312
316
|
- lib/coinbase/client/models/broadcast_trade_request.rb
|
313
|
-
- lib/coinbase/client/models/broadcast_transfer_request.rb
|
314
317
|
- lib/coinbase/client/models/build_staking_operation_request.rb
|
315
318
|
- lib/coinbase/client/models/contract_event.rb
|
316
319
|
- lib/coinbase/client/models/contract_event_list.rb
|
@@ -318,6 +321,7 @@ files:
|
|
318
321
|
- lib/coinbase/client/models/contract_invocation_list.rb
|
319
322
|
- lib/coinbase/client/models/create_address_request.rb
|
320
323
|
- lib/coinbase/client/models/create_contract_invocation_request.rb
|
324
|
+
- lib/coinbase/client/models/create_external_transfer_request.rb
|
321
325
|
- lib/coinbase/client/models/create_fund_operation_request.rb
|
322
326
|
- lib/coinbase/client/models/create_fund_quote_request.rb
|
323
327
|
- lib/coinbase/client/models/create_payload_signature_request.rb
|
@@ -362,6 +366,7 @@ files:
|
|
362
366
|
- lib/coinbase/client/models/payload_signature.rb
|
363
367
|
- lib/coinbase/client/models/payload_signature_list.rb
|
364
368
|
- lib/coinbase/client/models/read_contract_request.rb
|
369
|
+
- lib/coinbase/client/models/register_smart_contract_request.rb
|
365
370
|
- lib/coinbase/client/models/seed_creation_event.rb
|
366
371
|
- lib/coinbase/client/models/seed_creation_event_result.rb
|
367
372
|
- lib/coinbase/client/models/server_signer.rb
|
@@ -373,6 +378,7 @@ files:
|
|
373
378
|
- lib/coinbase/client/models/signature_creation_event_result.rb
|
374
379
|
- lib/coinbase/client/models/signed_voluntary_exit_message_metadata.rb
|
375
380
|
- lib/coinbase/client/models/smart_contract.rb
|
381
|
+
- lib/coinbase/client/models/smart_contract_activity_event.rb
|
376
382
|
- lib/coinbase/client/models/smart_contract_list.rb
|
377
383
|
- lib/coinbase/client/models/smart_contract_options.rb
|
378
384
|
- lib/coinbase/client/models/smart_contract_type.rb
|
@@ -395,6 +401,7 @@ files:
|
|
395
401
|
- lib/coinbase/client/models/transaction_type.rb
|
396
402
|
- lib/coinbase/client/models/transfer.rb
|
397
403
|
- lib/coinbase/client/models/transfer_list.rb
|
404
|
+
- lib/coinbase/client/models/update_smart_contract_request.rb
|
398
405
|
- lib/coinbase/client/models/update_webhook_request.rb
|
399
406
|
- lib/coinbase/client/models/user.rb
|
400
407
|
- lib/coinbase/client/models/validator.rb
|
@@ -408,15 +415,20 @@ files:
|
|
408
415
|
- lib/coinbase/client/models/webhook_event_type.rb
|
409
416
|
- lib/coinbase/client/models/webhook_event_type_filter.rb
|
410
417
|
- lib/coinbase/client/models/webhook_list.rb
|
418
|
+
- lib/coinbase/client/models/webhook_smart_contract_event_filter.rb
|
411
419
|
- lib/coinbase/client/models/webhook_wallet_activity_filter.rb
|
412
420
|
- lib/coinbase/client/version.rb
|
413
421
|
- lib/coinbase/constants.rb
|
414
422
|
- lib/coinbase/contract_event.rb
|
415
423
|
- lib/coinbase/contract_invocation.rb
|
416
424
|
- lib/coinbase/correlation.rb
|
425
|
+
- lib/coinbase/crypto_amount.rb
|
417
426
|
- lib/coinbase/destination.rb
|
418
427
|
- lib/coinbase/errors.rb
|
419
428
|
- lib/coinbase/faucet_transaction.rb
|
429
|
+
- lib/coinbase/fiat_amount.rb
|
430
|
+
- lib/coinbase/fund_operation.rb
|
431
|
+
- lib/coinbase/fund_quote.rb
|
420
432
|
- lib/coinbase/historical_balance.rb
|
421
433
|
- lib/coinbase/middleware.rb
|
422
434
|
- lib/coinbase/network.rb
|
@@ -441,7 +453,7 @@ licenses:
|
|
441
453
|
- Apache-2.0
|
442
454
|
metadata:
|
443
455
|
rubygems_mfa_required: 'true'
|
444
|
-
post_install_message:
|
456
|
+
post_install_message:
|
445
457
|
rdoc_options: []
|
446
458
|
require_paths:
|
447
459
|
- lib
|
@@ -457,7 +469,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
457
469
|
version: '0'
|
458
470
|
requirements: []
|
459
471
|
rubygems_version: 3.1.6
|
460
|
-
signing_key:
|
472
|
+
signing_key:
|
461
473
|
specification_version: 4
|
462
474
|
summary: Coinbase Ruby SDK
|
463
475
|
test_files: []
|
@@ -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
|