coinbase-sdk 0.2.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (116) hide show
  1. checksums.yaml +4 -4
  2. data/lib/coinbase/address/wallet_address.rb +61 -0
  3. data/lib/coinbase/address.rb +25 -1
  4. data/lib/coinbase/client/api/addresses_api.rb +238 -8
  5. data/lib/coinbase/client/api/assets_api.rb +3 -3
  6. data/lib/coinbase/client/api/balance_history_api.rb +107 -0
  7. data/lib/coinbase/client/api/contract_events_api.rb +5 -5
  8. data/lib/coinbase/client/api/contract_invocations_api.rb +342 -0
  9. data/lib/coinbase/client/api/external_addresses_api.rb +24 -30
  10. data/lib/coinbase/client/api/networks_api.rb +3 -3
  11. data/lib/coinbase/client/api/server_signers_api.rb +8 -8
  12. data/lib/coinbase/client/api/stake_api.rb +7 -7
  13. data/lib/coinbase/client/api/trades_api.rb +6 -6
  14. data/lib/coinbase/client/api/transfers_api.rb +6 -6
  15. data/lib/coinbase/client/api/validators_api.rb +8 -8
  16. data/lib/coinbase/client/api/wallet_stake_api.rb +5 -5
  17. data/lib/coinbase/client/api/wallets_api.rb +11 -11
  18. data/lib/coinbase/client/api/webhooks_api.rb +6 -6
  19. data/lib/coinbase/client/api_client.rb +31 -25
  20. data/lib/coinbase/client/api_error.rb +2 -2
  21. data/lib/coinbase/client/configuration.rb +2 -2
  22. data/lib/coinbase/client/models/address.rb +2 -2
  23. data/lib/coinbase/client/models/address_balance_list.rb +2 -2
  24. data/lib/coinbase/client/models/address_historical_balance_list.rb +2 -2
  25. data/lib/coinbase/client/models/address_list.rb +2 -2
  26. data/lib/coinbase/client/models/address_transaction_list.rb +258 -0
  27. data/lib/coinbase/client/models/asset.rb +2 -2
  28. data/lib/coinbase/client/models/balance.rb +2 -2
  29. data/lib/coinbase/client/models/{user.rb → broadcast_contract_invocation_request.rb} +17 -26
  30. data/lib/coinbase/client/models/broadcast_staking_operation_request.rb +2 -2
  31. data/lib/coinbase/client/models/broadcast_trade_request.rb +2 -2
  32. data/lib/coinbase/client/models/broadcast_transfer_request.rb +2 -2
  33. data/lib/coinbase/client/models/build_staking_operation_request.rb +2 -2
  34. data/lib/coinbase/client/models/contract_event.rb +2 -2
  35. data/lib/coinbase/client/models/contract_event_list.rb +2 -2
  36. data/lib/coinbase/client/models/contract_invocation.rb +368 -0
  37. data/lib/coinbase/client/models/contract_invocation_list.rb +274 -0
  38. data/lib/coinbase/client/models/create_address_request.rb +2 -2
  39. data/lib/coinbase/client/models/create_contract_invocation_request.rb +276 -0
  40. data/lib/coinbase/client/models/create_payload_signature_request.rb +232 -0
  41. data/lib/coinbase/client/models/create_server_signer_request.rb +2 -2
  42. data/lib/coinbase/client/models/create_staking_operation_request.rb +2 -2
  43. data/lib/coinbase/client/models/create_trade_request.rb +2 -2
  44. data/lib/coinbase/client/models/create_transfer_request.rb +3 -3
  45. data/lib/coinbase/client/models/create_wallet_request.rb +2 -2
  46. data/lib/coinbase/client/models/create_wallet_request_wallet.rb +2 -2
  47. data/lib/coinbase/client/models/create_webhook_request.rb +30 -6
  48. data/lib/coinbase/client/models/erc20_transfer_event.rb +336 -0
  49. data/lib/coinbase/client/models/erc721_transfer_event.rb +336 -0
  50. data/lib/coinbase/client/models/error.rb +16 -6
  51. data/lib/coinbase/client/models/ethereum_transaction.rb +389 -0
  52. data/lib/coinbase/client/models/ethereum_transaction_access.rb +225 -0
  53. data/lib/coinbase/client/models/ethereum_transaction_access_list.rb +216 -0
  54. data/lib/coinbase/client/models/ethereum_transaction_flattened_trace.rb +378 -0
  55. data/lib/coinbase/client/models/ethereum_validator_metadata.rb +2 -2
  56. data/lib/coinbase/client/models/faucet_transaction.rb +2 -2
  57. data/lib/coinbase/client/models/feature_set.rb +2 -2
  58. data/lib/coinbase/client/models/fetch_historical_staking_balances200_response.rb +2 -2
  59. data/lib/coinbase/client/models/fetch_staking_rewards200_response.rb +2 -2
  60. data/lib/coinbase/client/models/fetch_staking_rewards_request.rb +2 -2
  61. data/lib/coinbase/client/models/get_staking_context_request.rb +2 -2
  62. data/lib/coinbase/client/models/historical_balance.rb +2 -2
  63. data/lib/coinbase/client/models/network.rb +4 -4
  64. data/lib/coinbase/client/models/network_identifier.rb +5 -3
  65. data/lib/coinbase/client/models/payload_signature.rb +335 -0
  66. data/lib/coinbase/client/models/payload_signature_list.rb +275 -0
  67. data/lib/coinbase/client/models/seed_creation_event.rb +2 -2
  68. data/lib/coinbase/client/models/seed_creation_event_result.rb +2 -2
  69. data/lib/coinbase/client/models/server_signer.rb +2 -2
  70. data/lib/coinbase/client/models/server_signer_event.rb +2 -2
  71. data/lib/coinbase/client/models/server_signer_event_event.rb +2 -2
  72. data/lib/coinbase/client/models/server_signer_event_list.rb +2 -2
  73. data/lib/coinbase/client/models/server_signer_list.rb +2 -2
  74. data/lib/coinbase/client/models/signature_creation_event.rb +2 -2
  75. data/lib/coinbase/client/models/signature_creation_event_result.rb +2 -2
  76. data/lib/coinbase/client/models/signed_voluntary_exit_message_metadata.rb +2 -2
  77. data/lib/coinbase/client/models/sponsored_send.rb +2 -2
  78. data/lib/coinbase/client/models/staking_balance.rb +2 -2
  79. data/lib/coinbase/client/models/staking_context.rb +2 -2
  80. data/lib/coinbase/client/models/staking_context_context.rb +2 -2
  81. data/lib/coinbase/client/models/staking_operation.rb +2 -2
  82. data/lib/coinbase/client/models/staking_operation_metadata.rb +2 -2
  83. data/lib/coinbase/client/models/staking_reward.rb +2 -2
  84. data/lib/coinbase/client/models/staking_reward_format.rb +2 -2
  85. data/lib/coinbase/client/models/staking_reward_usd_value.rb +2 -2
  86. data/lib/coinbase/client/models/trade.rb +2 -2
  87. data/lib/coinbase/client/models/trade_list.rb +2 -2
  88. data/lib/coinbase/client/models/transaction.rb +37 -8
  89. data/lib/coinbase/client/models/transaction_content.rb +104 -0
  90. data/lib/coinbase/client/models/transaction_type.rb +2 -2
  91. data/lib/coinbase/client/models/transfer.rb +2 -2
  92. data/lib/coinbase/client/models/transfer_list.rb +2 -2
  93. data/lib/coinbase/client/models/update_webhook_request.rb +3 -51
  94. data/lib/coinbase/client/models/validator.rb +2 -2
  95. data/lib/coinbase/client/models/validator_details.rb +2 -2
  96. data/lib/coinbase/client/models/validator_list.rb +2 -2
  97. data/lib/coinbase/client/models/validator_status.rb +2 -2
  98. data/lib/coinbase/client/models/wallet.rb +2 -2
  99. data/lib/coinbase/client/models/wallet_list.rb +2 -2
  100. data/lib/coinbase/client/models/webhook.rb +16 -6
  101. data/lib/coinbase/client/models/webhook_event_filter.rb +5 -5
  102. data/lib/coinbase/client/models/webhook_event_type.rb +2 -2
  103. data/lib/coinbase/client/models/webhook_list.rb +2 -2
  104. data/lib/coinbase/client/version.rb +2 -2
  105. data/lib/coinbase/client.rb +19 -4
  106. data/lib/coinbase/constants.rb +3 -0
  107. data/lib/coinbase/contract_invocation.rb +259 -0
  108. data/lib/coinbase/payload_signature.rb +181 -0
  109. data/lib/coinbase/transaction.rb +21 -0
  110. data/lib/coinbase/version.rb +1 -1
  111. data/lib/coinbase/wallet.rb +11 -1
  112. data/lib/coinbase/webhook.rb +17 -6
  113. data/lib/coinbase.rb +2 -0
  114. metadata +21 -5
  115. data/lib/coinbase/client/api/users_api.rb +0 -79
  116. data/lib/coinbase/client/models/feature.rb +0 -43
@@ -0,0 +1,181 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative 'constants'
4
+
5
+ module Coinbase
6
+ # A representation of a Payload Signature.
7
+ class PayloadSignature
8
+ # A representation of a Payload Signature status.
9
+ module Status
10
+ # The Payload Signature is pending signing.
11
+ # At this point, the Signature is not available yet.
12
+ PENDING = 'pending'
13
+
14
+ # The Payload Signature has been signed.
15
+ SIGNED = 'signed'
16
+
17
+ # The Payload Signature has failed.
18
+ FAILED = 'failed'
19
+
20
+ # The states that are considered terminal.
21
+ TERMINAL_STATES = [SIGNED, FAILED].freeze
22
+ end
23
+
24
+ class << self
25
+ # Creates a new PayloadSignature object.
26
+ # @param wallet_id [String] The Wallet ID associated with the signing Address
27
+ # @param address_id [String] The Address ID of the signing Address
28
+ # @param unsigned_payload [String] The hex-encoded Unsigned Payload
29
+ # @param signature [String] (Optional) The Signature if the Wallet is not using an MPC Server-Signer
30
+ # @return [PayloadSignature] The new Payload Signature object
31
+ # @raise [Coinbase::ApiError] If the request to create the Payload Signature fails
32
+ def create(wallet_id:, address_id:, unsigned_payload:, signature: nil)
33
+ create_payload_signature_request = {
34
+ unsigned_payload: unsigned_payload,
35
+ signature: signature
36
+ }.compact
37
+
38
+ model = Coinbase.call_api do
39
+ addresses_api.create_payload_signature(
40
+ wallet_id,
41
+ address_id,
42
+ create_payload_signature_request: create_payload_signature_request
43
+ )
44
+ end
45
+
46
+ new(model)
47
+ end
48
+
49
+ # Enumerates the payload signatures for a given address belonging to a wallet.
50
+ # The result is an enumerator that lazily fetches from the server, and can be iterated over,
51
+ # converted an array, etc...
52
+ # @return [Enumerable<Coinbase::PayloadSignature>] Enumerator that returns payload signatures
53
+ def list(wallet_id:, address_id:)
54
+ Coinbase::Pagination.enumerate(
55
+ ->(page) { fetch_page(wallet_id, address_id, page) }
56
+ ) do |payload_signature|
57
+ new(payload_signature)
58
+ end
59
+ end
60
+
61
+ private
62
+
63
+ def addresses_api
64
+ Coinbase::Client::AddressesApi.new(Coinbase.configuration.api_client)
65
+ end
66
+
67
+ def fetch_page(wallet_id, address_id, page)
68
+ addresses_api.list_payload_signatures(wallet_id, address_id, { limit: DEFAULT_PAGE_LIMIT, page: page })
69
+ end
70
+ end
71
+
72
+ # Returns a new PayloadSignature object. Do not use this method directly.
73
+ # Instead use Coinbase::PayloadSignature.create.
74
+ # @param model [Coinbase::Client::PayloadSignature] The underlying Payload Signature obejct
75
+ def initialize(model)
76
+ raise unless model.is_a?(Coinbase::Client::PayloadSignature)
77
+
78
+ @model = model
79
+ end
80
+
81
+ # Returns the Payload Signature ID.
82
+ # @return [String] The Payload Signature ID
83
+ def id
84
+ @model.payload_signature_id
85
+ end
86
+
87
+ # Returns the Wallet ID of the Payload Signature.
88
+ # @return [String] The Wallet ID
89
+ def wallet_id
90
+ @model.wallet_id
91
+ end
92
+
93
+ # Returns the Address ID of the Payload Signature.
94
+ # @return [String] The Address ID
95
+ def address_id
96
+ @model.address_id
97
+ end
98
+
99
+ # Returns the Unsigned Payload of the Payload Signature.
100
+ # @return [String] The Unsigned Payload
101
+ def unsigned_payload
102
+ @model.unsigned_payload
103
+ end
104
+
105
+ # Returns the Signature of the Payload Signature.
106
+ # @return [String] The Signature
107
+ def signature
108
+ @model.signature
109
+ end
110
+
111
+ # Returns the status of the Payload Signature.
112
+ # @return [Symbol] The status
113
+ def status
114
+ @model.status
115
+ end
116
+
117
+ # Returns whether the Payload Signature is in a terminal state.
118
+ # @return [Boolean] Whether the Payload Signature is in a terminal state
119
+ def terminal_state?
120
+ Status::TERMINAL_STATES.include?(status)
121
+ end
122
+
123
+ # # Reload reloads the Payload Signature model with the latest version from the server side.
124
+ # @return [PayloadSignature] The most recent version of Payload Signature from the server
125
+ def reload
126
+ @model = Coinbase.call_api do
127
+ addresses_api.get_payload_signature(wallet_id, address_id, id)
128
+ end
129
+
130
+ self
131
+ end
132
+
133
+ # Waits until the Payload Signature is signed or failed by polling the server at the given interval. Raises a
134
+ # Timeout::Error if the Payload Signature takes longer than the given timeout.
135
+ # @param interval_seconds [Integer] The interval at which to poll the server, in seconds
136
+ # @param timeout_seconds [Integer] The maximum amount of time to wait for the Payload Signature to be signed,
137
+ # in seconds.
138
+ # @return [PayloadSignature] The completed Payload Signature object
139
+ def wait!(interval_seconds = 0.2, timeout_seconds = 20)
140
+ start_time = Time.now
141
+
142
+ loop do
143
+ reload
144
+
145
+ return self if terminal_state?
146
+
147
+ raise Timeout::Error, 'Payload Signature timed out' if Time.now - start_time > timeout_seconds
148
+
149
+ self.sleep interval_seconds
150
+ end
151
+
152
+ self
153
+ end
154
+
155
+ # Returns a String representation of the Payload Signature.
156
+ # @return [String] a String representation of the Payload Signature
157
+ def to_s
158
+ Coinbase.pretty_print_object(
159
+ self.class,
160
+ id: id,
161
+ wallet_id: wallet_id,
162
+ address_id: address_id,
163
+ status: status,
164
+ unsigned_payload: unsigned_payload,
165
+ signature: signature
166
+ )
167
+ end
168
+
169
+ # Same as to_s.
170
+ # @return [String] a String representation of the PayloadSignature
171
+ def inspect
172
+ to_s
173
+ end
174
+
175
+ private
176
+
177
+ def addresses_api
178
+ Coinbase::Client::AddressesApi.new(Coinbase.configuration.api_client)
179
+ end
180
+ end
181
+ end
@@ -26,6 +26,9 @@ module Coinbase
26
26
  # The Transaction has failed for some reason.
27
27
  FAILED = 'failed'
28
28
 
29
+ # The Transaction isn't specified it's status in Receipt.
30
+ UNSPECIFIED = 'unspecified'
31
+
29
32
  # The states that are considered terminal on-chain.
30
33
  TERMINAL_STATES = [COMPLETE, FAILED].freeze
31
34
  end
@@ -80,12 +83,30 @@ module Coinbase
80
83
  Status::TERMINAL_STATES.include?(status)
81
84
  end
82
85
 
86
+ # Returns the block hash of which the Transaction is recorded.
87
+ # @return [String] The to block_hash
88
+ def block_hash
89
+ @model.block_hash
90
+ end
91
+
92
+ # Returns the block height of which the Transaction is recorded.
93
+ # @return [String] The to block_height
94
+ def block_height
95
+ @model.block_height
96
+ end
97
+
83
98
  # Returns the link to the transaction on the blockchain explorer.
84
99
  # @return [String] The link to the transaction on the blockchain explorer
85
100
  def transaction_link
86
101
  @model.transaction_link
87
102
  end
88
103
 
104
+ # Returns the block height of which the Transaction is recorded.
105
+ # @return [String] The to block_height
106
+ def content
107
+ @model.content
108
+ end
109
+
89
110
  # Returns the underlying raw transaction.
90
111
  # @return [Eth::Tx::Eip1559] The raw transaction
91
112
  def raw
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Coinbase
4
- VERSION = '0.2.0'
4
+ VERSION = '0.5.0'
5
5
  end
@@ -226,8 +226,18 @@ module Coinbase
226
226
  # @param options [Hash] Additional options for the staking operation
227
227
  # @return [BigDecimal] The claimable balance
228
228
 
229
+ # @!method sign_payload
230
+ # Signs the given unsigned payload.
231
+ # @param unsigned_payload [String] The hex-encoded hashed unsigned payload for the Address to sign.
232
+ # @return [Coinbase::PayloadSignature] The payload signature
233
+
234
+ # @!method invoke_contract
235
+ # Invokes a contract with the given ABI, method, and arguments.
236
+ # @param abi [Array<Hash>] The ABI of the contract
237
+ #
238
+
229
239
  def_delegators :default_address, :transfer, :trade, :faucet, :stake, :unstake, :claim_stake, :staking_balances,
230
- :stakeable_balance, :unstakeable_balance, :claimable_balance
240
+ :stakeable_balance, :unstakeable_balance, :claimable_balance, :sign_payload, :invoke_contract
231
241
 
232
242
  # Returns the addresses belonging to the Wallet.
233
243
  # @return [Array<Coinbase::WalletAddress>] The addresses belonging to the Wallet
@@ -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.2.0
4
+ version: 0.5.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-08-29 00:00:00.000000000 Z
11
+ date: 2024-09-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bigdecimal
@@ -279,14 +279,15 @@ files:
279
279
  - lib/coinbase/client.rb
280
280
  - lib/coinbase/client/api/addresses_api.rb
281
281
  - lib/coinbase/client/api/assets_api.rb
282
+ - lib/coinbase/client/api/balance_history_api.rb
282
283
  - lib/coinbase/client/api/contract_events_api.rb
284
+ - lib/coinbase/client/api/contract_invocations_api.rb
283
285
  - lib/coinbase/client/api/external_addresses_api.rb
284
286
  - lib/coinbase/client/api/networks_api.rb
285
287
  - lib/coinbase/client/api/server_signers_api.rb
286
288
  - lib/coinbase/client/api/stake_api.rb
287
289
  - lib/coinbase/client/api/trades_api.rb
288
290
  - lib/coinbase/client/api/transfers_api.rb
289
- - lib/coinbase/client/api/users_api.rb
290
291
  - lib/coinbase/client/api/validators_api.rb
291
292
  - lib/coinbase/client/api/wallet_stake_api.rb
292
293
  - lib/coinbase/client/api/wallets_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
@@ -314,10 +321,15 @@ files:
314
321
  - lib/coinbase/client/models/create_wallet_request.rb
315
322
  - lib/coinbase/client/models/create_wallet_request_wallet.rb
316
323
  - lib/coinbase/client/models/create_webhook_request.rb
324
+ - lib/coinbase/client/models/erc20_transfer_event.rb
325
+ - lib/coinbase/client/models/erc721_transfer_event.rb
317
326
  - lib/coinbase/client/models/error.rb
327
+ - lib/coinbase/client/models/ethereum_transaction.rb
328
+ - lib/coinbase/client/models/ethereum_transaction_access.rb
329
+ - lib/coinbase/client/models/ethereum_transaction_access_list.rb
330
+ - lib/coinbase/client/models/ethereum_transaction_flattened_trace.rb
318
331
  - lib/coinbase/client/models/ethereum_validator_metadata.rb
319
332
  - lib/coinbase/client/models/faucet_transaction.rb
320
- - lib/coinbase/client/models/feature.rb
321
333
  - lib/coinbase/client/models/feature_set.rb
322
334
  - lib/coinbase/client/models/fetch_historical_staking_balances200_response.rb
323
335
  - lib/coinbase/client/models/fetch_staking_rewards200_response.rb
@@ -326,6 +338,8 @@ files:
326
338
  - lib/coinbase/client/models/historical_balance.rb
327
339
  - lib/coinbase/client/models/network.rb
328
340
  - lib/coinbase/client/models/network_identifier.rb
341
+ - lib/coinbase/client/models/payload_signature.rb
342
+ - lib/coinbase/client/models/payload_signature_list.rb
329
343
  - lib/coinbase/client/models/seed_creation_event.rb
330
344
  - lib/coinbase/client/models/seed_creation_event_result.rb
331
345
  - lib/coinbase/client/models/server_signer.rb
@@ -348,11 +362,11 @@ files:
348
362
  - lib/coinbase/client/models/trade.rb
349
363
  - lib/coinbase/client/models/trade_list.rb
350
364
  - lib/coinbase/client/models/transaction.rb
365
+ - lib/coinbase/client/models/transaction_content.rb
351
366
  - lib/coinbase/client/models/transaction_type.rb
352
367
  - lib/coinbase/client/models/transfer.rb
353
368
  - lib/coinbase/client/models/transfer_list.rb
354
369
  - lib/coinbase/client/models/update_webhook_request.rb
355
- - lib/coinbase/client/models/user.rb
356
370
  - lib/coinbase/client/models/validator.rb
357
371
  - lib/coinbase/client/models/validator_details.rb
358
372
  - lib/coinbase/client/models/validator_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
@@ -1,79 +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
- Contact: yuga.cohler@coinbase.com
8
- Generated by: https://openapi-generator.tech
9
- Generator version: 7.7.0
10
-
11
- =end
12
-
13
- require 'cgi'
14
-
15
- module Coinbase::Client
16
- class UsersApi
17
- attr_accessor :api_client
18
-
19
- def initialize(api_client = ApiClient.default)
20
- @api_client = api_client
21
- end
22
- # Get current user
23
- # Get current user
24
- # @param [Hash] opts the optional parameters
25
- # @return [User]
26
- def get_current_user(opts = {})
27
- data, _status_code, _headers = get_current_user_with_http_info(opts)
28
- data
29
- end
30
-
31
- # Get current user
32
- # Get current user
33
- # @param [Hash] opts the optional parameters
34
- # @return [Array<(User, Integer, Hash)>] User data, response status code and response headers
35
- def get_current_user_with_http_info(opts = {})
36
- if @api_client.config.debugging
37
- @api_client.config.logger.debug 'Calling API: UsersApi.get_current_user ...'
38
- end
39
- # resource path
40
- local_var_path = '/v1/users/me'
41
-
42
- # query parameters
43
- query_params = opts[:query_params] || {}
44
-
45
- # header parameters
46
- header_params = opts[:header_params] || {}
47
- # HTTP header 'Accept' (if needed)
48
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
49
-
50
- # form parameters
51
- form_params = opts[:form_params] || {}
52
-
53
- # http body (model)
54
- post_body = opts[:debug_body]
55
-
56
- # return_type
57
- return_type = opts[:debug_return_type] || 'User'
58
-
59
- # auth_names
60
- auth_names = opts[:debug_auth_names] || []
61
-
62
- new_options = opts.merge(
63
- :operation => :"UsersApi.get_current_user",
64
- :header_params => header_params,
65
- :query_params => query_params,
66
- :form_params => form_params,
67
- :body => post_body,
68
- :auth_names => auth_names,
69
- :return_type => return_type
70
- )
71
-
72
- data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
73
- if @api_client.config.debugging
74
- @api_client.config.logger.debug "API called: UsersApi#get_current_user\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
75
- end
76
- return data, status_code, headers
77
- end
78
- end
79
- end
@@ -1,43 +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
- Contact: yuga.cohler@coinbase.com
8
- Generated by: https://openapi-generator.tech
9
- Generator version: 7.7.0
10
-
11
- =end
12
-
13
- require 'date'
14
- require 'time'
15
-
16
- module Coinbase::Client
17
- class Feature
18
- TRANSFER = "transfer".freeze
19
- TRADE = "trade".freeze
20
- FAUCET = "faucet".freeze
21
- SERVER_SIGNER = "server_signer".freeze
22
- UNKNOWN_DEFAULT_OPEN_API = "unknown_default_open_api".freeze
23
-
24
- def self.all_vars
25
- @all_vars ||= [TRANSFER, TRADE, FAUCET, SERVER_SIGNER, UNKNOWN_DEFAULT_OPEN_API].freeze
26
- end
27
-
28
- # Builds the enum from string
29
- # @param [String] The enum value in the form of the string
30
- # @return [String] The enum value
31
- def self.build_from_hash(value)
32
- new.build_from_hash(value)
33
- end
34
-
35
- # Builds the enum from string
36
- # @param [String] The enum value in the form of the string
37
- # @return [String] The enum value
38
- def build_from_hash(value)
39
- return value if Feature.all_vars.include?(value)
40
- raise "Invalid ENUM value #{value} for class #Feature"
41
- end
42
- end
43
- end