coinbase-sdk 0.1.1 → 0.3.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 +60 -4
- data/lib/coinbase/address.rb +35 -9
- data/lib/coinbase/client/api/addresses_api.rb +234 -1
- data/lib/coinbase/client/api/assets_api.rb +1 -1
- data/lib/coinbase/client/api/contract_events_api.rb +1 -1
- data/lib/coinbase/client/api/contract_invocations_api.rb +342 -0
- data/lib/coinbase/client/api/external_addresses_api.rb +83 -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 -1
- 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 +1 -1
- data/lib/coinbase/client/api/wallet_stake_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_transaction_list.rb +258 -0
- 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 +222 -0
- 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 +1 -1
- data/lib/coinbase/client/models/contract_event_list.rb +1 -1
- data/lib/coinbase/client/models/contract_invocation.rb +351 -0
- data/lib/coinbase/client/models/contract_invocation_list.rb +274 -0
- data/lib/coinbase/client/models/create_address_request.rb +1 -1
- data/lib/coinbase/client/models/create_contract_invocation_request.rb +266 -0
- data/lib/coinbase/client/models/create_payload_signature_request.rb +232 -0
- 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 +29 -5
- data/lib/coinbase/client/models/error.rb +1 -1
- data/lib/coinbase/client/models/ethereum_transaction.rb +389 -0
- data/lib/coinbase/client/models/ethereum_transaction_access.rb +225 -0
- data/lib/coinbase/client/models/ethereum_transaction_access_list.rb +216 -0
- data/lib/coinbase/client/models/ethereum_transaction_flattened_trace.rb +378 -0
- 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/get_staking_context_request.rb +1 -1
- data/lib/coinbase/client/models/historical_balance.rb +1 -1
- data/lib/coinbase/client/models/network.rb +3 -3
- data/lib/coinbase/client/models/network_identifier.rb +3 -2
- data/lib/coinbase/client/models/payload_signature.rb +335 -0
- data/lib/coinbase/client/models/payload_signature_list.rb +275 -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/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/trade.rb +1 -1
- data/lib/coinbase/client/models/trade_list.rb +1 -1
- data/lib/coinbase/client/models/transaction.rb +36 -7
- data/lib/coinbase/client/models/transaction_content.rb +104 -0
- 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 +2 -50
- 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 +15 -5
- 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 +15 -1
- data/lib/coinbase/constants.rb +3 -0
- data/lib/coinbase/contract_invocation.rb +234 -0
- data/lib/coinbase/payload_signature.rb +181 -0
- data/lib/coinbase/staking_operation.rb +26 -0
- data/lib/coinbase/transaction.rb +21 -0
- data/lib/coinbase/version.rb +1 -1
- data/lib/coinbase/wallet.rb +12 -7
- data/lib/coinbase/webhook.rb +17 -6
- data/lib/coinbase.rb +2 -0
- metadata +18 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: d296ec1c6b60e1074b171eb5d32135a3942be0266348e42e101290b283039b9d
|
|
4
|
+
data.tar.gz: 1d0115be59726c67bb29e0b6415e1e20c211a82a2d8330490c56e8e0255e3f74
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 53d7ed283905e7336527d319b1a5ec025a912fc6f90beadd4de75aefaf8774d93d17a4767e40b04a4a45b306c99d11ec3f08cb64c1a78d503dd2a2b8fc1e1e1d
|
|
7
|
+
data.tar.gz: 46ae9c2699993a68c51cb5a1941733810429372c5cb41e08ccb1e4f0628f3366b8862604235d376970120057252a35ea77c9ef64ad9581b7925ead4bc5d8d979
|
|
@@ -95,11 +95,57 @@ module Coinbase
|
|
|
95
95
|
trade
|
|
96
96
|
end
|
|
97
97
|
|
|
98
|
-
#
|
|
98
|
+
# Invokes a contract method on the specified contract address, with the given ABI and arguments.
|
|
99
|
+
# @param contract_address [String] The address of the contract to invoke.
|
|
100
|
+
# @param abi [Array<Hash>] The ABI of the contract to invoke.
|
|
101
|
+
# @param method [String] The method to invoke on the contract.
|
|
102
|
+
# @param args [Hash] The arguments to pass to the contract method.
|
|
103
|
+
# The keys should be the argument names, and the values should be the argument values.
|
|
104
|
+
# @return [Coinbase::ContractInvocation] The contract invocation object.
|
|
105
|
+
def invoke_contract(contract_address:, abi:, method:, args:)
|
|
106
|
+
ensure_can_sign!
|
|
107
|
+
|
|
108
|
+
invocation = ContractInvocation.create(
|
|
109
|
+
address_id: id,
|
|
110
|
+
wallet_id: wallet_id,
|
|
111
|
+
contract_address: contract_address,
|
|
112
|
+
abi: abi,
|
|
113
|
+
method: method,
|
|
114
|
+
args: args
|
|
115
|
+
)
|
|
116
|
+
|
|
117
|
+
# If a server signer is managing keys, it will sign and broadcast the underlying transaction out of band.
|
|
118
|
+
return invocation if Coinbase.use_server_signer?
|
|
119
|
+
|
|
120
|
+
invocation.sign(@key)
|
|
121
|
+
invocation.broadcast!
|
|
122
|
+
invocation
|
|
123
|
+
end
|
|
124
|
+
|
|
125
|
+
# Signs the given unsigned payload.
|
|
126
|
+
# @param unsigned_payload [String] The hex-encoded hashed unsigned payload for the Address to sign.
|
|
127
|
+
# @return [Coinbase::PayloadSignature] The payload signature
|
|
128
|
+
def sign_payload(unsigned_payload:)
|
|
129
|
+
ensure_can_sign!
|
|
130
|
+
|
|
131
|
+
unless Coinbase.use_server_signer?
|
|
132
|
+
signature = Eth::Util.prefix_hex(@key.sign(Eth::Util.hex_to_bin(unsigned_payload)))
|
|
133
|
+
end
|
|
134
|
+
|
|
135
|
+
PayloadSignature.create(
|
|
136
|
+
wallet_id: wallet_id,
|
|
137
|
+
address_id: id,
|
|
138
|
+
unsigned_payload: unsigned_payload,
|
|
139
|
+
signature: signature
|
|
140
|
+
)
|
|
141
|
+
end
|
|
142
|
+
|
|
143
|
+
# Stakes the given amount of the given Asset. The stake operation
|
|
144
|
+
# may take a few minutes to complete in the case when infrastructure is spun up.
|
|
99
145
|
# @param amount [Integer, Float, BigDecimal] The amount of the Asset to stake.
|
|
100
146
|
# @param asset_id [Symbol] The ID of the Asset to stake. For Ether, :eth, :gwei, and :wei are supported.
|
|
101
147
|
# @param mode [Symbol] The staking mode. Defaults to :default.
|
|
102
|
-
# @param options [Hash] Additional options for the stake operation
|
|
148
|
+
# @param options [Hash] (Optional) Additional options for the stake operation. ({StakingOperation#create see_more})
|
|
103
149
|
# @param interval_seconds [Integer] The number of seconds to wait between polling for updates. Defaults to 5.
|
|
104
150
|
# @param timeout_seconds [Integer] The number of seconds to wait before timing out. Defaults to 600.
|
|
105
151
|
# @return [Coinbase::StakingOperation] The staking operation
|
|
@@ -116,7 +162,8 @@ module Coinbase
|
|
|
116
162
|
# @param amount [Integer, Float, BigDecimal] The amount of the Asset to unstake.
|
|
117
163
|
# @param asset_id [Symbol] The ID of the Asset to stake. For Ether, :eth, :gwei, and :wei are supported.
|
|
118
164
|
# @param mode [Symbol] The staking mode. Defaults to :default.
|
|
119
|
-
# @param options [Hash] Additional options for the
|
|
165
|
+
# @param options [Hash] (Optional) Additional options for the unstake operation.
|
|
166
|
+
# ({StakingOperation#create see_more})
|
|
120
167
|
# @param interval_seconds [Integer] The number of seconds to wait between polling for updates. Defaults to 5.
|
|
121
168
|
# @param timeout_seconds [Integer] The number of seconds to wait before timing out. Defaults to 600.
|
|
122
169
|
# @return [Coinbase::StakingOperation] The staking operation
|
|
@@ -133,7 +180,8 @@ module Coinbase
|
|
|
133
180
|
# @param amount [Integer, Float, BigDecimal] The amount of the Asset to claim.
|
|
134
181
|
# @param asset_id [Symbol] The ID of the Asset to stake. For Ether, :eth, :gwei, and :wei are supported.
|
|
135
182
|
# @param mode [Symbol] The staking mode. Defaults to :default.
|
|
136
|
-
# @param options [Hash] Additional options for the
|
|
183
|
+
# @param options [Hash] (Optional) Additional options for the claim_stake operation.
|
|
184
|
+
# ({StakingOperation#create see_more})
|
|
137
185
|
# @param interval_seconds [Integer] The number of seconds to wait between polling for updates. Defaults to 5.
|
|
138
186
|
# @param timeout_seconds [Integer] The number of seconds to wait before timing out. Defaults to 600.
|
|
139
187
|
# @return [Coinbase::StakingOperation] The staking operation
|
|
@@ -176,6 +224,14 @@ module Coinbase
|
|
|
176
224
|
Trade.list(wallet_id: wallet_id, address_id: id)
|
|
177
225
|
end
|
|
178
226
|
|
|
227
|
+
# Enumerates the payload signatures associated with the address.
|
|
228
|
+
# The result is an enumerator that lazily fetches from the server, and can be iterated over,
|
|
229
|
+
# converted to an array, etc...
|
|
230
|
+
# @return [Enumerable<Coinbase::PayloadSignature>] Enumerator that returns the address's payload signatures
|
|
231
|
+
def payload_signatures
|
|
232
|
+
PayloadSignature.list(wallet_id: wallet_id, address_id: id)
|
|
233
|
+
end
|
|
234
|
+
|
|
179
235
|
# Returns a String representation of the WalletAddress.
|
|
180
236
|
# @return [String] a String representation of the WalletAddress
|
|
181
237
|
def to_s
|
data/lib/coinbase/address.rb
CHANGED
|
@@ -72,15 +72,30 @@ module Coinbase
|
|
|
72
72
|
end
|
|
73
73
|
end
|
|
74
74
|
|
|
75
|
+
# Enumerates the transactions of address.
|
|
76
|
+
# The result is an enumerator that lazily fetches from the server, and can be iterated over,
|
|
77
|
+
# converted to an array, etc...
|
|
78
|
+
# @return [Enumerable<Coinbase::HistoricalBalance>] Enumerator that returns historical_balance
|
|
79
|
+
def transactions
|
|
80
|
+
Coinbase::Pagination.enumerate(
|
|
81
|
+
->(page) { list_transaction_page(page) }
|
|
82
|
+
) do |transaction|
|
|
83
|
+
Coinbase::Transaction.new(transaction)
|
|
84
|
+
end
|
|
85
|
+
end
|
|
86
|
+
|
|
75
87
|
# Requests funds for the address from the faucet and returns the faucet transaction.
|
|
76
88
|
# This is only supported on testnet networks.
|
|
89
|
+
# @param asset_id [Symbol] The ID of the Asset to transfer to the wallet.
|
|
77
90
|
# @return [Coinbase::FaucetTransaction] The successful faucet transaction
|
|
78
91
|
# @raise [Coinbase::FaucetLimitReachedError] If the faucet limit has been reached for the address or user.
|
|
79
92
|
# @raise [Coinbase::Client::ApiError] If an unexpected error occurs while requesting faucet funds.
|
|
80
|
-
def faucet
|
|
93
|
+
def faucet(asset_id: nil)
|
|
94
|
+
opts = { asset_id: asset_id }.compact
|
|
95
|
+
|
|
81
96
|
Coinbase.call_api do
|
|
82
97
|
Coinbase::FaucetTransaction.new(
|
|
83
|
-
addresses_api.request_external_faucet_funds(network.normalized_id, id)
|
|
98
|
+
addresses_api.request_external_faucet_funds(network.normalized_id, id, opts)
|
|
84
99
|
)
|
|
85
100
|
end
|
|
86
101
|
end
|
|
@@ -90,7 +105,7 @@ module Coinbase
|
|
|
90
105
|
# @param amount [Integer,String,BigDecimal] The amount of the asset to stake
|
|
91
106
|
# @param asset_id [Symbol] The asset to stake
|
|
92
107
|
# @param mode [Symbol] The staking mode. Defaults to :default.
|
|
93
|
-
# @param options [Hash] Additional options for the stake operation
|
|
108
|
+
# @param options [Hash] (Optional) Additional options for the stake operation. ({StakingOperation#build see_more})
|
|
94
109
|
# @return [Coinbase::StakingOperation] The stake operation
|
|
95
110
|
def build_stake_operation(amount, asset_id, mode: :default, options: {})
|
|
96
111
|
validate_can_perform_staking_action!(amount, asset_id, 'stakeable_balance', mode, options)
|
|
@@ -102,7 +117,7 @@ module Coinbase
|
|
|
102
117
|
# @param amount [Integer,String,BigDecimal] The amount of the asset to unstake
|
|
103
118
|
# @param asset_id [Symbol] The asset to unstake
|
|
104
119
|
# @param mode [Symbol] The staking mode. Defaults to :default.
|
|
105
|
-
# @param options [Hash] Additional options for the unstake operation
|
|
120
|
+
# @param options [Hash] (Optional) Additional options for the unstake operation. ({StakingOperation#build see_more})
|
|
106
121
|
# @return [Coinbase::StakingOperation] The unstake operation
|
|
107
122
|
def build_unstake_operation(amount, asset_id, mode: :default, options: {})
|
|
108
123
|
validate_can_perform_staking_action!(amount, asset_id, 'unstakeable_balance', mode, options)
|
|
@@ -114,7 +129,8 @@ module Coinbase
|
|
|
114
129
|
# @param amount [Integer,String,BigDecimal] The amount of the asset to claim
|
|
115
130
|
# @param asset_id [Symbol] The asset to claim
|
|
116
131
|
# @param mode [Symbol] The staking mode. Defaults to :default.
|
|
117
|
-
# @param options [Hash] Additional options for the claim_stake operation
|
|
132
|
+
# @param options [Hash] (Optional) Additional options for the claim_stake operation.
|
|
133
|
+
# ({StakingOperation#build see_more})
|
|
118
134
|
# @return [Coinbase::StakingOperation] The claim_stake operation
|
|
119
135
|
def build_claim_stake_operation(amount, asset_id, mode: :default, options: {})
|
|
120
136
|
validate_can_perform_staking_action!(amount, asset_id, 'claimable_balance', mode, options)
|
|
@@ -125,7 +141,9 @@ module Coinbase
|
|
|
125
141
|
# Retrieves the balances used for staking for the supplied asset.
|
|
126
142
|
# @param asset_id [Symbol] The asset to retrieve staking balances for
|
|
127
143
|
# @param mode [Symbol] The staking mode. Defaults to :default.
|
|
128
|
-
# @param options [Hash] Additional options for the staking
|
|
144
|
+
# @param options [Hash] (Optional) Additional options for fetching the staking balances
|
|
145
|
+
# @option options [String] (Optional) :validator_pub_keys List of comma separated validator public keys to retrieve
|
|
146
|
+
# staking balances for. (default: all validators) [asset_id: :eth, mode: :native]
|
|
129
147
|
# @return [Hash] The staking balances
|
|
130
148
|
# @return [BigDecimal] :stakeable_balance The amount of the asset that can be staked
|
|
131
149
|
# @return [BigDecimal] :unstakeable_balance The amount of the asset that is currently staked and cannot be unstaked
|
|
@@ -163,7 +181,7 @@ module Coinbase
|
|
|
163
181
|
# Retrieves the stakeable balance for the supplied asset.
|
|
164
182
|
# @param asset_id [Symbol] The asset to retrieve the stakeable balance for
|
|
165
183
|
# @param mode [Symbol] The staking mode. Defaults to :default.
|
|
166
|
-
# @param options [Hash] Additional options for the
|
|
184
|
+
# @param options [Hash] Additional options for fetching the stakeable balance
|
|
167
185
|
# @return [BigDecimal] The stakeable balance
|
|
168
186
|
def stakeable_balance(asset_id, mode: :default, options: {})
|
|
169
187
|
staking_balances(asset_id, mode: mode, options: options)[:stakeable_balance]
|
|
@@ -172,7 +190,7 @@ module Coinbase
|
|
|
172
190
|
# Retrieves the unstakeable balance for the supplied asset.
|
|
173
191
|
# @param asset_id [Symbol] The asset to retrieve the unstakeable balance for
|
|
174
192
|
# @param mode [Symbol] The staking mode. Defaults to :default.
|
|
175
|
-
# @param options [Hash] Additional options for the
|
|
193
|
+
# @param options [Hash] Additional options for fetching the unstakeable balance
|
|
176
194
|
# @return [BigDecimal] The unstakeable balance
|
|
177
195
|
def unstakeable_balance(asset_id, mode: :default, options: {})
|
|
178
196
|
staking_balances(asset_id, mode: mode, options: options)[:unstakeable_balance]
|
|
@@ -181,7 +199,7 @@ module Coinbase
|
|
|
181
199
|
# Retrieves the claimable balance for the supplied asset.
|
|
182
200
|
# @param asset_id [Symbol] The asset to retrieve the claimable balance for
|
|
183
201
|
# @param mode [Symbol] The staking mode. Defaults to :default.
|
|
184
|
-
# @param options [Hash] Additional options for the
|
|
202
|
+
# @param options [Hash] Additional options for fetching the claimable balance
|
|
185
203
|
# @return [BigDecimal] The claimable balance
|
|
186
204
|
def claimable_balance(asset_id, mode: :default, options: {})
|
|
187
205
|
staking_balances(asset_id, mode: mode, options: options)[:claimable_balance]
|
|
@@ -242,5 +260,13 @@ module Coinbase
|
|
|
242
260
|
{ limit: DEFAULT_PAGE_LIMIT, page: page }
|
|
243
261
|
)
|
|
244
262
|
end
|
|
263
|
+
|
|
264
|
+
def list_transaction_page(page)
|
|
265
|
+
addresses_api.list_address_transactions(
|
|
266
|
+
network.normalized_id,
|
|
267
|
+
id,
|
|
268
|
+
{ limit: DEFAULT_TRANSACTION_PAGE_LIMIT, page: page }
|
|
269
|
+
)
|
|
270
|
+
end
|
|
245
271
|
end
|
|
246
272
|
end
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
#This is the OpenAPI 3.0 specification for the Coinbase Platform APIs, used in conjunction with the Coinbase Platform SDKs.
|
|
5
5
|
|
|
6
6
|
The version of the OpenAPI document: 0.0.1-alpha
|
|
7
|
-
|
|
7
|
+
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.7.0
|
|
10
10
|
|
|
@@ -89,6 +89,82 @@ module Coinbase::Client
|
|
|
89
89
|
return data, status_code, headers
|
|
90
90
|
end
|
|
91
91
|
|
|
92
|
+
# Create a new payload signature.
|
|
93
|
+
# Create a new payload signature with an address.
|
|
94
|
+
# @param wallet_id [String] The ID of the wallet the address belongs to.
|
|
95
|
+
# @param address_id [String] The onchain address of the address to sign the payload with.
|
|
96
|
+
# @param [Hash] opts the optional parameters
|
|
97
|
+
# @option opts [CreatePayloadSignatureRequest] :create_payload_signature_request
|
|
98
|
+
# @return [PayloadSignature]
|
|
99
|
+
def create_payload_signature(wallet_id, address_id, opts = {})
|
|
100
|
+
data, _status_code, _headers = create_payload_signature_with_http_info(wallet_id, address_id, opts)
|
|
101
|
+
data
|
|
102
|
+
end
|
|
103
|
+
|
|
104
|
+
# Create a new payload signature.
|
|
105
|
+
# Create a new payload signature with an address.
|
|
106
|
+
# @param wallet_id [String] The ID of the wallet the address belongs to.
|
|
107
|
+
# @param address_id [String] The onchain address of the address to sign the payload with.
|
|
108
|
+
# @param [Hash] opts the optional parameters
|
|
109
|
+
# @option opts [CreatePayloadSignatureRequest] :create_payload_signature_request
|
|
110
|
+
# @return [Array<(PayloadSignature, Integer, Hash)>] PayloadSignature data, response status code and response headers
|
|
111
|
+
def create_payload_signature_with_http_info(wallet_id, address_id, opts = {})
|
|
112
|
+
if @api_client.config.debugging
|
|
113
|
+
@api_client.config.logger.debug 'Calling API: AddressesApi.create_payload_signature ...'
|
|
114
|
+
end
|
|
115
|
+
# verify the required parameter 'wallet_id' is set
|
|
116
|
+
if @api_client.config.client_side_validation && wallet_id.nil?
|
|
117
|
+
fail ArgumentError, "Missing the required parameter 'wallet_id' when calling AddressesApi.create_payload_signature"
|
|
118
|
+
end
|
|
119
|
+
# verify the required parameter 'address_id' is set
|
|
120
|
+
if @api_client.config.client_side_validation && address_id.nil?
|
|
121
|
+
fail ArgumentError, "Missing the required parameter 'address_id' when calling AddressesApi.create_payload_signature"
|
|
122
|
+
end
|
|
123
|
+
# resource path
|
|
124
|
+
local_var_path = '/v1/wallets/{wallet_id}/addresses/{address_id}/payload_signatures'.sub('{' + 'wallet_id' + '}', CGI.escape(wallet_id.to_s)).sub('{' + 'address_id' + '}', CGI.escape(address_id.to_s))
|
|
125
|
+
|
|
126
|
+
# query parameters
|
|
127
|
+
query_params = opts[:query_params] || {}
|
|
128
|
+
|
|
129
|
+
# header parameters
|
|
130
|
+
header_params = opts[:header_params] || {}
|
|
131
|
+
# HTTP header 'Accept' (if needed)
|
|
132
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
133
|
+
# HTTP header 'Content-Type'
|
|
134
|
+
content_type = @api_client.select_header_content_type(['application/json'])
|
|
135
|
+
if !content_type.nil?
|
|
136
|
+
header_params['Content-Type'] = content_type
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
# form parameters
|
|
140
|
+
form_params = opts[:form_params] || {}
|
|
141
|
+
|
|
142
|
+
# http body (model)
|
|
143
|
+
post_body = opts[:debug_body] || @api_client.object_to_http_body(opts[:'create_payload_signature_request'])
|
|
144
|
+
|
|
145
|
+
# return_type
|
|
146
|
+
return_type = opts[:debug_return_type] || 'PayloadSignature'
|
|
147
|
+
|
|
148
|
+
# auth_names
|
|
149
|
+
auth_names = opts[:debug_auth_names] || []
|
|
150
|
+
|
|
151
|
+
new_options = opts.merge(
|
|
152
|
+
:operation => :"AddressesApi.create_payload_signature",
|
|
153
|
+
:header_params => header_params,
|
|
154
|
+
:query_params => query_params,
|
|
155
|
+
:form_params => form_params,
|
|
156
|
+
:body => post_body,
|
|
157
|
+
:auth_names => auth_names,
|
|
158
|
+
:return_type => return_type
|
|
159
|
+
)
|
|
160
|
+
|
|
161
|
+
data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
|
|
162
|
+
if @api_client.config.debugging
|
|
163
|
+
@api_client.config.logger.debug "API called: AddressesApi#create_payload_signature\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
164
|
+
end
|
|
165
|
+
return data, status_code, headers
|
|
166
|
+
end
|
|
167
|
+
|
|
92
168
|
# Get address by onchain address
|
|
93
169
|
# Get address
|
|
94
170
|
# @param wallet_id [String] The ID of the wallet the address belongs to.
|
|
@@ -233,6 +309,81 @@ module Coinbase::Client
|
|
|
233
309
|
return data, status_code, headers
|
|
234
310
|
end
|
|
235
311
|
|
|
312
|
+
# Get payload signature.
|
|
313
|
+
# Get payload signature.
|
|
314
|
+
# @param wallet_id [String] The ID of the wallet the address belongs to.
|
|
315
|
+
# @param address_id [String] The onchain address of the address that signed the payload.
|
|
316
|
+
# @param payload_signature_id [String] The ID of the payload signature to fetch.
|
|
317
|
+
# @param [Hash] opts the optional parameters
|
|
318
|
+
# @return [PayloadSignature]
|
|
319
|
+
def get_payload_signature(wallet_id, address_id, payload_signature_id, opts = {})
|
|
320
|
+
data, _status_code, _headers = get_payload_signature_with_http_info(wallet_id, address_id, payload_signature_id, opts)
|
|
321
|
+
data
|
|
322
|
+
end
|
|
323
|
+
|
|
324
|
+
# Get payload signature.
|
|
325
|
+
# Get payload signature.
|
|
326
|
+
# @param wallet_id [String] The ID of the wallet the address belongs to.
|
|
327
|
+
# @param address_id [String] The onchain address of the address that signed the payload.
|
|
328
|
+
# @param payload_signature_id [String] The ID of the payload signature to fetch.
|
|
329
|
+
# @param [Hash] opts the optional parameters
|
|
330
|
+
# @return [Array<(PayloadSignature, Integer, Hash)>] PayloadSignature data, response status code and response headers
|
|
331
|
+
def get_payload_signature_with_http_info(wallet_id, address_id, payload_signature_id, opts = {})
|
|
332
|
+
if @api_client.config.debugging
|
|
333
|
+
@api_client.config.logger.debug 'Calling API: AddressesApi.get_payload_signature ...'
|
|
334
|
+
end
|
|
335
|
+
# verify the required parameter 'wallet_id' is set
|
|
336
|
+
if @api_client.config.client_side_validation && wallet_id.nil?
|
|
337
|
+
fail ArgumentError, "Missing the required parameter 'wallet_id' when calling AddressesApi.get_payload_signature"
|
|
338
|
+
end
|
|
339
|
+
# verify the required parameter 'address_id' is set
|
|
340
|
+
if @api_client.config.client_side_validation && address_id.nil?
|
|
341
|
+
fail ArgumentError, "Missing the required parameter 'address_id' when calling AddressesApi.get_payload_signature"
|
|
342
|
+
end
|
|
343
|
+
# verify the required parameter 'payload_signature_id' is set
|
|
344
|
+
if @api_client.config.client_side_validation && payload_signature_id.nil?
|
|
345
|
+
fail ArgumentError, "Missing the required parameter 'payload_signature_id' when calling AddressesApi.get_payload_signature"
|
|
346
|
+
end
|
|
347
|
+
# resource path
|
|
348
|
+
local_var_path = '/v1/wallets/{wallet_id}/addresses/{address_id}/payload_signatures/{payload_signature_id}'.sub('{' + 'wallet_id' + '}', CGI.escape(wallet_id.to_s)).sub('{' + 'address_id' + '}', CGI.escape(address_id.to_s)).sub('{' + 'payload_signature_id' + '}', CGI.escape(payload_signature_id.to_s))
|
|
349
|
+
|
|
350
|
+
# query parameters
|
|
351
|
+
query_params = opts[:query_params] || {}
|
|
352
|
+
|
|
353
|
+
# header parameters
|
|
354
|
+
header_params = opts[:header_params] || {}
|
|
355
|
+
# HTTP header 'Accept' (if needed)
|
|
356
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
357
|
+
|
|
358
|
+
# form parameters
|
|
359
|
+
form_params = opts[:form_params] || {}
|
|
360
|
+
|
|
361
|
+
# http body (model)
|
|
362
|
+
post_body = opts[:debug_body]
|
|
363
|
+
|
|
364
|
+
# return_type
|
|
365
|
+
return_type = opts[:debug_return_type] || 'PayloadSignature'
|
|
366
|
+
|
|
367
|
+
# auth_names
|
|
368
|
+
auth_names = opts[:debug_auth_names] || []
|
|
369
|
+
|
|
370
|
+
new_options = opts.merge(
|
|
371
|
+
:operation => :"AddressesApi.get_payload_signature",
|
|
372
|
+
:header_params => header_params,
|
|
373
|
+
:query_params => query_params,
|
|
374
|
+
:form_params => form_params,
|
|
375
|
+
:body => post_body,
|
|
376
|
+
:auth_names => auth_names,
|
|
377
|
+
:return_type => return_type
|
|
378
|
+
)
|
|
379
|
+
|
|
380
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
381
|
+
if @api_client.config.debugging
|
|
382
|
+
@api_client.config.logger.debug "API called: AddressesApi#get_payload_signature\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
383
|
+
end
|
|
384
|
+
return data, status_code, headers
|
|
385
|
+
end
|
|
386
|
+
|
|
236
387
|
# Get all balances for address
|
|
237
388
|
# Get address balances
|
|
238
389
|
# @param wallet_id [String] The ID of the wallet to fetch the balances for
|
|
@@ -382,11 +533,91 @@ module Coinbase::Client
|
|
|
382
533
|
return data, status_code, headers
|
|
383
534
|
end
|
|
384
535
|
|
|
536
|
+
# List payload signatures for an address.
|
|
537
|
+
# List payload signatures for an address.
|
|
538
|
+
# @param wallet_id [String] The ID of the wallet the address belongs to.
|
|
539
|
+
# @param address_id [String] The onchain address of the address whose payload signatures to fetch.
|
|
540
|
+
# @param [Hash] opts the optional parameters
|
|
541
|
+
# @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 10.
|
|
542
|
+
# @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.
|
|
543
|
+
# @return [PayloadSignatureList]
|
|
544
|
+
def list_payload_signatures(wallet_id, address_id, opts = {})
|
|
545
|
+
data, _status_code, _headers = list_payload_signatures_with_http_info(wallet_id, address_id, opts)
|
|
546
|
+
data
|
|
547
|
+
end
|
|
548
|
+
|
|
549
|
+
# List payload signatures for an address.
|
|
550
|
+
# List payload signatures for an address.
|
|
551
|
+
# @param wallet_id [String] The ID of the wallet the address belongs to.
|
|
552
|
+
# @param address_id [String] The onchain address of the address whose payload signatures to fetch.
|
|
553
|
+
# @param [Hash] opts the optional parameters
|
|
554
|
+
# @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 10.
|
|
555
|
+
# @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.
|
|
556
|
+
# @return [Array<(PayloadSignatureList, Integer, Hash)>] PayloadSignatureList data, response status code and response headers
|
|
557
|
+
def list_payload_signatures_with_http_info(wallet_id, address_id, opts = {})
|
|
558
|
+
if @api_client.config.debugging
|
|
559
|
+
@api_client.config.logger.debug 'Calling API: AddressesApi.list_payload_signatures ...'
|
|
560
|
+
end
|
|
561
|
+
# verify the required parameter 'wallet_id' is set
|
|
562
|
+
if @api_client.config.client_side_validation && wallet_id.nil?
|
|
563
|
+
fail ArgumentError, "Missing the required parameter 'wallet_id' when calling AddressesApi.list_payload_signatures"
|
|
564
|
+
end
|
|
565
|
+
# verify the required parameter 'address_id' is set
|
|
566
|
+
if @api_client.config.client_side_validation && address_id.nil?
|
|
567
|
+
fail ArgumentError, "Missing the required parameter 'address_id' when calling AddressesApi.list_payload_signatures"
|
|
568
|
+
end
|
|
569
|
+
if @api_client.config.client_side_validation && !opts[:'page'].nil? && opts[:'page'].to_s.length > 5000
|
|
570
|
+
fail ArgumentError, 'invalid value for "opts[:"page"]" when calling AddressesApi.list_payload_signatures, the character length must be smaller than or equal to 5000.'
|
|
571
|
+
end
|
|
572
|
+
|
|
573
|
+
# resource path
|
|
574
|
+
local_var_path = '/v1/wallets/{wallet_id}/addresses/{address_id}/payload_signatures'.sub('{' + 'wallet_id' + '}', CGI.escape(wallet_id.to_s)).sub('{' + 'address_id' + '}', CGI.escape(address_id.to_s))
|
|
575
|
+
|
|
576
|
+
# query parameters
|
|
577
|
+
query_params = opts[:query_params] || {}
|
|
578
|
+
query_params[:'limit'] = opts[:'limit'] if !opts[:'limit'].nil?
|
|
579
|
+
query_params[:'page'] = opts[:'page'] if !opts[:'page'].nil?
|
|
580
|
+
|
|
581
|
+
# header parameters
|
|
582
|
+
header_params = opts[:header_params] || {}
|
|
583
|
+
# HTTP header 'Accept' (if needed)
|
|
584
|
+
header_params['Accept'] = @api_client.select_header_accept(['application/json'])
|
|
585
|
+
|
|
586
|
+
# form parameters
|
|
587
|
+
form_params = opts[:form_params] || {}
|
|
588
|
+
|
|
589
|
+
# http body (model)
|
|
590
|
+
post_body = opts[:debug_body]
|
|
591
|
+
|
|
592
|
+
# return_type
|
|
593
|
+
return_type = opts[:debug_return_type] || 'PayloadSignatureList'
|
|
594
|
+
|
|
595
|
+
# auth_names
|
|
596
|
+
auth_names = opts[:debug_auth_names] || []
|
|
597
|
+
|
|
598
|
+
new_options = opts.merge(
|
|
599
|
+
:operation => :"AddressesApi.list_payload_signatures",
|
|
600
|
+
:header_params => header_params,
|
|
601
|
+
:query_params => query_params,
|
|
602
|
+
:form_params => form_params,
|
|
603
|
+
:body => post_body,
|
|
604
|
+
:auth_names => auth_names,
|
|
605
|
+
:return_type => return_type
|
|
606
|
+
)
|
|
607
|
+
|
|
608
|
+
data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
|
|
609
|
+
if @api_client.config.debugging
|
|
610
|
+
@api_client.config.logger.debug "API called: AddressesApi#list_payload_signatures\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
|
|
611
|
+
end
|
|
612
|
+
return data, status_code, headers
|
|
613
|
+
end
|
|
614
|
+
|
|
385
615
|
# Request faucet funds for onchain address.
|
|
386
616
|
# Request faucet funds to be sent to onchain address.
|
|
387
617
|
# @param wallet_id [String] The ID of the wallet the address belongs to.
|
|
388
618
|
# @param address_id [String] The onchain address of the address that is being fetched.
|
|
389
619
|
# @param [Hash] opts the optional parameters
|
|
620
|
+
# @option opts [String] :asset_id The ID of the asset to transfer from the faucet.
|
|
390
621
|
# @return [FaucetTransaction]
|
|
391
622
|
def request_faucet_funds(wallet_id, address_id, opts = {})
|
|
392
623
|
data, _status_code, _headers = request_faucet_funds_with_http_info(wallet_id, address_id, opts)
|
|
@@ -398,6 +629,7 @@ module Coinbase::Client
|
|
|
398
629
|
# @param wallet_id [String] The ID of the wallet the address belongs to.
|
|
399
630
|
# @param address_id [String] The onchain address of the address that is being fetched.
|
|
400
631
|
# @param [Hash] opts the optional parameters
|
|
632
|
+
# @option opts [String] :asset_id The ID of the asset to transfer from the faucet.
|
|
401
633
|
# @return [Array<(FaucetTransaction, Integer, Hash)>] FaucetTransaction data, response status code and response headers
|
|
402
634
|
def request_faucet_funds_with_http_info(wallet_id, address_id, opts = {})
|
|
403
635
|
if @api_client.config.debugging
|
|
@@ -416,6 +648,7 @@ module Coinbase::Client
|
|
|
416
648
|
|
|
417
649
|
# query parameters
|
|
418
650
|
query_params = opts[:query_params] || {}
|
|
651
|
+
query_params[:'asset_id'] = opts[:'asset_id'] if !opts[:'asset_id'].nil?
|
|
419
652
|
|
|
420
653
|
# header parameters
|
|
421
654
|
header_params = opts[:header_params] || {}
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
#This is the OpenAPI 3.0 specification for the Coinbase Platform APIs, used in conjunction with the Coinbase Platform SDKs.
|
|
5
5
|
|
|
6
6
|
The version of the OpenAPI document: 0.0.1-alpha
|
|
7
|
-
|
|
7
|
+
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.7.0
|
|
10
10
|
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
#This is the OpenAPI 3.0 specification for the Coinbase Platform APIs, used in conjunction with the Coinbase Platform SDKs.
|
|
5
5
|
|
|
6
6
|
The version of the OpenAPI document: 0.0.1-alpha
|
|
7
|
-
|
|
7
|
+
|
|
8
8
|
Generated by: https://openapi-generator.tech
|
|
9
9
|
Generator version: 7.7.0
|
|
10
10
|
|