coinbase-sdk 0.1.1 → 0.3.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 +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
data/lib/coinbase/webhook.rb
CHANGED
@@ -22,6 +22,8 @@ module Coinbase
|
|
22
22
|
# @param event_filters [Array<Hash>] Filters applied to the events that determine
|
23
23
|
# which specific events trigger the webhook. Each filter should be a hash that
|
24
24
|
# can include keys like `contract_address`, `from_address`, or `to_address`.
|
25
|
+
# @param signature_header [String] The custom header to be used for x-webhook-signature header on callbacks,
|
26
|
+
# so developers can verify the requests are coming from Coinbase.
|
25
27
|
# @return [Coinbase::Webhook] A new instance of Webhook.
|
26
28
|
#
|
27
29
|
# @example Create a new webhook
|
@@ -29,16 +31,18 @@ module Coinbase
|
|
29
31
|
# network_id: :ethereum_mainnet,
|
30
32
|
# notification_uri: 'https://example.com/callback',
|
31
33
|
# event_type: 'transaction',
|
32
|
-
# event_filters: [{ 'contract_address' => '0x...', 'from_address' => '0x...', 'to_address' => '0x...' }]
|
34
|
+
# event_filters: [{ 'contract_address' => '0x...', 'from_address' => '0x...', 'to_address' => '0x...' }],
|
35
|
+
# signature_header: 'example_header'
|
33
36
|
# )
|
34
|
-
def create(network_id:, notification_uri:, event_type:, event_filters:)
|
37
|
+
def create(network_id:, notification_uri:, event_type:, event_filters:, signature_header: '')
|
35
38
|
model = Coinbase.call_api do
|
36
39
|
webhooks_api.create_webhook(
|
37
40
|
create_webhook_request: {
|
38
41
|
network_id: Coinbase.normalize_network(network_id),
|
39
42
|
notification_uri: notification_uri,
|
40
43
|
event_type: event_type,
|
41
|
-
event_filters: event_filters
|
44
|
+
event_filters: event_filters,
|
45
|
+
signature_header: signature_header
|
42
46
|
}
|
43
47
|
)
|
44
48
|
end
|
@@ -112,6 +116,14 @@ module Coinbase
|
|
112
116
|
@model.event_filters
|
113
117
|
end
|
114
118
|
|
119
|
+
# Returns the signature header for the webhook. It is used as the value of callback header
|
120
|
+
# with key 'x-webhook-signature'.
|
121
|
+
#
|
122
|
+
# @return [String] The signature header value.
|
123
|
+
def signature_header
|
124
|
+
@model.signature_header
|
125
|
+
end
|
126
|
+
|
115
127
|
# Updates the webhook with a new notification URI.
|
116
128
|
#
|
117
129
|
# @param notification_uri [String] The new URI for webhook notifications.
|
@@ -124,9 +136,7 @@ module Coinbase
|
|
124
136
|
webhooks_api.update_webhook(
|
125
137
|
id,
|
126
138
|
update_webhook_request: {
|
127
|
-
network_id: network_id,
|
128
139
|
notification_uri: notification_uri,
|
129
|
-
event_type: event_type,
|
130
140
|
event_filters: event_filters.map(&:to_hash)
|
131
141
|
}
|
132
142
|
)
|
@@ -162,7 +172,8 @@ module Coinbase
|
|
162
172
|
network_id: @model.network_id,
|
163
173
|
event_type: @model.event_type,
|
164
174
|
notification_uri: @model.notification_uri,
|
165
|
-
event_filters: @model.event_filters.map(&:to_hash).to_json
|
175
|
+
event_filters: @model.event_filters.map(&:to_hash).to_json,
|
176
|
+
signature_header: @model.signature_header
|
166
177
|
)
|
167
178
|
end
|
168
179
|
|
data/lib/coinbase.rb
CHANGED
@@ -12,12 +12,14 @@ require_relative 'coinbase/historical_balance'
|
|
12
12
|
require_relative 'coinbase/client'
|
13
13
|
require_relative 'coinbase/constants'
|
14
14
|
require_relative 'coinbase/contract_event'
|
15
|
+
require_relative 'coinbase/contract_invocation'
|
15
16
|
require_relative 'coinbase/destination'
|
16
17
|
require_relative 'coinbase/errors'
|
17
18
|
require_relative 'coinbase/faucet_transaction'
|
18
19
|
require_relative 'coinbase/middleware'
|
19
20
|
require_relative 'coinbase/network'
|
20
21
|
require_relative 'coinbase/pagination'
|
22
|
+
require_relative 'coinbase/payload_signature'
|
21
23
|
require_relative 'coinbase/trade'
|
22
24
|
require_relative 'coinbase/transfer'
|
23
25
|
require_relative 'coinbase/transaction'
|
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.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yuga Cohler
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2024-
|
11
|
+
date: 2024-09-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bigdecimal
|
@@ -280,6 +280,7 @@ files:
|
|
280
280
|
- lib/coinbase/client/api/addresses_api.rb
|
281
281
|
- lib/coinbase/client/api/assets_api.rb
|
282
282
|
- lib/coinbase/client/api/contract_events_api.rb
|
283
|
+
- lib/coinbase/client/api/contract_invocations_api.rb
|
283
284
|
- lib/coinbase/client/api/external_addresses_api.rb
|
284
285
|
- lib/coinbase/client/api/networks_api.rb
|
285
286
|
- lib/coinbase/client/api/server_signers_api.rb
|
@@ -298,15 +299,21 @@ files:
|
|
298
299
|
- lib/coinbase/client/models/address_balance_list.rb
|
299
300
|
- lib/coinbase/client/models/address_historical_balance_list.rb
|
300
301
|
- lib/coinbase/client/models/address_list.rb
|
302
|
+
- lib/coinbase/client/models/address_transaction_list.rb
|
301
303
|
- lib/coinbase/client/models/asset.rb
|
302
304
|
- lib/coinbase/client/models/balance.rb
|
305
|
+
- lib/coinbase/client/models/broadcast_contract_invocation_request.rb
|
303
306
|
- lib/coinbase/client/models/broadcast_staking_operation_request.rb
|
304
307
|
- lib/coinbase/client/models/broadcast_trade_request.rb
|
305
308
|
- lib/coinbase/client/models/broadcast_transfer_request.rb
|
306
309
|
- lib/coinbase/client/models/build_staking_operation_request.rb
|
307
310
|
- lib/coinbase/client/models/contract_event.rb
|
308
311
|
- lib/coinbase/client/models/contract_event_list.rb
|
312
|
+
- lib/coinbase/client/models/contract_invocation.rb
|
313
|
+
- lib/coinbase/client/models/contract_invocation_list.rb
|
309
314
|
- lib/coinbase/client/models/create_address_request.rb
|
315
|
+
- lib/coinbase/client/models/create_contract_invocation_request.rb
|
316
|
+
- lib/coinbase/client/models/create_payload_signature_request.rb
|
310
317
|
- lib/coinbase/client/models/create_server_signer_request.rb
|
311
318
|
- lib/coinbase/client/models/create_staking_operation_request.rb
|
312
319
|
- lib/coinbase/client/models/create_trade_request.rb
|
@@ -315,6 +322,10 @@ files:
|
|
315
322
|
- lib/coinbase/client/models/create_wallet_request_wallet.rb
|
316
323
|
- lib/coinbase/client/models/create_webhook_request.rb
|
317
324
|
- lib/coinbase/client/models/error.rb
|
325
|
+
- lib/coinbase/client/models/ethereum_transaction.rb
|
326
|
+
- lib/coinbase/client/models/ethereum_transaction_access.rb
|
327
|
+
- lib/coinbase/client/models/ethereum_transaction_access_list.rb
|
328
|
+
- lib/coinbase/client/models/ethereum_transaction_flattened_trace.rb
|
318
329
|
- lib/coinbase/client/models/ethereum_validator_metadata.rb
|
319
330
|
- lib/coinbase/client/models/faucet_transaction.rb
|
320
331
|
- lib/coinbase/client/models/feature.rb
|
@@ -326,6 +337,8 @@ files:
|
|
326
337
|
- lib/coinbase/client/models/historical_balance.rb
|
327
338
|
- lib/coinbase/client/models/network.rb
|
328
339
|
- lib/coinbase/client/models/network_identifier.rb
|
340
|
+
- lib/coinbase/client/models/payload_signature.rb
|
341
|
+
- lib/coinbase/client/models/payload_signature_list.rb
|
329
342
|
- lib/coinbase/client/models/seed_creation_event.rb
|
330
343
|
- lib/coinbase/client/models/seed_creation_event_result.rb
|
331
344
|
- lib/coinbase/client/models/server_signer.rb
|
@@ -348,6 +361,7 @@ files:
|
|
348
361
|
- lib/coinbase/client/models/trade.rb
|
349
362
|
- lib/coinbase/client/models/trade_list.rb
|
350
363
|
- lib/coinbase/client/models/transaction.rb
|
364
|
+
- lib/coinbase/client/models/transaction_content.rb
|
351
365
|
- lib/coinbase/client/models/transaction_type.rb
|
352
366
|
- lib/coinbase/client/models/transfer.rb
|
353
367
|
- lib/coinbase/client/models/transfer_list.rb
|
@@ -366,6 +380,7 @@ files:
|
|
366
380
|
- lib/coinbase/client/version.rb
|
367
381
|
- lib/coinbase/constants.rb
|
368
382
|
- lib/coinbase/contract_event.rb
|
383
|
+
- lib/coinbase/contract_invocation.rb
|
369
384
|
- lib/coinbase/correlation.rb
|
370
385
|
- lib/coinbase/destination.rb
|
371
386
|
- lib/coinbase/errors.rb
|
@@ -374,6 +389,7 @@ files:
|
|
374
389
|
- lib/coinbase/middleware.rb
|
375
390
|
- lib/coinbase/network.rb
|
376
391
|
- lib/coinbase/pagination.rb
|
392
|
+
- lib/coinbase/payload_signature.rb
|
377
393
|
- lib/coinbase/server_signer.rb
|
378
394
|
- lib/coinbase/smart_contract.rb
|
379
395
|
- lib/coinbase/sponsored_send.rb
|