coinbase-sdk 0.0.10 → 0.0.14

Sign up to get free protection for your applications and to get access to all the features.
Files changed (93) hide show
  1. checksums.yaml +4 -4
  2. data/lib/coinbase/address/external_address.rb +3 -166
  3. data/lib/coinbase/address/wallet_address.rb +80 -107
  4. data/lib/coinbase/address.rb +128 -0
  5. data/lib/coinbase/client/api/addresses_api.rb +1 -1
  6. data/lib/coinbase/client/api/assets_api.rb +3 -3
  7. data/lib/coinbase/client/api/contract_events_api.rb +121 -0
  8. data/lib/coinbase/client/api/external_addresses_api.rb +1 -1
  9. data/lib/coinbase/client/api/server_signers_api.rb +1 -1
  10. data/lib/coinbase/client/api/stake_api.rb +242 -1
  11. data/lib/coinbase/client/api/trades_api.rb +1 -1
  12. data/lib/coinbase/client/api/transfers_api.rb +1 -1
  13. data/lib/coinbase/client/api/users_api.rb +1 -1
  14. data/lib/coinbase/client/api/validators_api.rb +1 -1
  15. data/lib/coinbase/client/api/wallets_api.rb +1 -1
  16. data/lib/coinbase/client/api/webhooks_api.rb +286 -0
  17. data/lib/coinbase/client/api_client.rb +1 -1
  18. data/lib/coinbase/client/api_error.rb +1 -1
  19. data/lib/coinbase/client/configuration.rb +11 -1
  20. data/lib/coinbase/client/models/address.rb +1 -1
  21. data/lib/coinbase/client/models/address_balance_list.rb +1 -1
  22. data/lib/coinbase/client/models/address_list.rb +1 -1
  23. data/lib/coinbase/client/models/asset.rb +1 -1
  24. data/lib/coinbase/client/models/balance.rb +1 -1
  25. data/lib/coinbase/client/models/broadcast_staking_operation_request.rb +239 -0
  26. data/lib/coinbase/client/models/broadcast_trade_request.rb +1 -1
  27. data/lib/coinbase/client/models/broadcast_transfer_request.rb +1 -1
  28. data/lib/coinbase/client/models/build_staking_operation_request.rb +1 -1
  29. data/lib/coinbase/client/models/contract_event.rb +336 -0
  30. data/lib/coinbase/client/models/contract_event_list.rb +259 -0
  31. data/lib/coinbase/client/models/create_address_request.rb +1 -1
  32. data/lib/coinbase/client/models/create_server_signer_request.rb +1 -1
  33. data/lib/coinbase/client/models/create_staking_operation_request.rb +274 -0
  34. data/lib/coinbase/client/models/create_trade_request.rb +1 -1
  35. data/lib/coinbase/client/models/create_transfer_request.rb +1 -1
  36. data/lib/coinbase/client/models/create_wallet_request.rb +1 -1
  37. data/lib/coinbase/client/models/create_wallet_request_wallet.rb +1 -1
  38. data/lib/coinbase/client/models/create_webhook_request.rb +282 -0
  39. data/lib/coinbase/client/models/error.rb +1 -1
  40. data/lib/coinbase/client/models/ethereum_validator_metadata.rb +1 -1
  41. data/lib/coinbase/client/models/faucet_transaction.rb +1 -1
  42. data/lib/coinbase/client/models/feature.rb +1 -1
  43. data/lib/coinbase/client/models/fetch_staking_rewards200_response.rb +1 -1
  44. data/lib/coinbase/client/models/fetch_staking_rewards_request.rb +1 -1
  45. data/lib/coinbase/client/models/get_staking_context_request.rb +1 -1
  46. data/lib/coinbase/client/models/native_eth_staking_context.rb +1 -1
  47. data/lib/coinbase/client/models/partial_eth_staking_context.rb +1 -1
  48. data/lib/coinbase/client/models/seed_creation_event.rb +1 -1
  49. data/lib/coinbase/client/models/seed_creation_event_result.rb +1 -1
  50. data/lib/coinbase/client/models/server_signer.rb +1 -1
  51. data/lib/coinbase/client/models/server_signer_event.rb +1 -1
  52. data/lib/coinbase/client/models/server_signer_event_event.rb +1 -1
  53. data/lib/coinbase/client/models/server_signer_event_list.rb +1 -1
  54. data/lib/coinbase/client/models/server_signer_list.rb +1 -1
  55. data/lib/coinbase/client/models/signature_creation_event.rb +1 -1
  56. data/lib/coinbase/client/models/signature_creation_event_result.rb +1 -1
  57. data/lib/coinbase/client/models/signed_voluntary_exit_message_metadata.rb +1 -1
  58. data/lib/coinbase/client/models/staking_context.rb +1 -1
  59. data/lib/coinbase/client/models/staking_context_context.rb +1 -1
  60. data/lib/coinbase/client/models/staking_operation.rb +16 -6
  61. data/lib/coinbase/client/models/staking_operation_metadata.rb +1 -1
  62. data/lib/coinbase/client/models/staking_reward.rb +1 -1
  63. data/lib/coinbase/client/models/staking_reward_format.rb +1 -1
  64. data/lib/coinbase/client/models/trade.rb +1 -1
  65. data/lib/coinbase/client/models/trade_list.rb +1 -1
  66. data/lib/coinbase/client/models/transaction.rb +1 -1
  67. data/lib/coinbase/client/models/transaction_type.rb +1 -1
  68. data/lib/coinbase/client/models/transfer.rb +5 -93
  69. data/lib/coinbase/client/models/transfer_list.rb +1 -1
  70. data/lib/coinbase/client/models/update_webhook_request.rb +289 -0
  71. data/lib/coinbase/client/models/user.rb +1 -1
  72. data/lib/coinbase/client/models/validator.rb +1 -1
  73. data/lib/coinbase/client/models/validator_details.rb +1 -1
  74. data/lib/coinbase/client/models/validator_list.rb +1 -1
  75. data/lib/coinbase/client/models/wallet.rb +1 -1
  76. data/lib/coinbase/client/models/wallet_list.rb +1 -1
  77. data/lib/coinbase/client/models/webhook.rb +299 -0
  78. data/lib/coinbase/client/models/webhook_event_filter.rb +236 -0
  79. data/lib/coinbase/client/models/webhook_event_type.rb +41 -0
  80. data/lib/coinbase/client/models/webhook_list.rb +244 -0
  81. data/lib/coinbase/client/version.rb +1 -1
  82. data/lib/coinbase/client.rb +13 -1
  83. data/lib/coinbase/constants.rb +3 -0
  84. data/lib/coinbase/destination.rb +51 -0
  85. data/lib/coinbase/errors.rb +14 -0
  86. data/lib/coinbase/middleware.rb +12 -0
  87. data/lib/coinbase/staking_operation.rb +106 -5
  88. data/lib/coinbase/trade.rb +87 -5
  89. data/lib/coinbase/transaction.rb +13 -2
  90. data/lib/coinbase/transfer.rb +86 -7
  91. data/lib/coinbase/wallet.rb +77 -4
  92. data/lib/coinbase.rb +3 -1
  93. metadata +29 -2
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
7
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.6.0
9
+ Generator version: 7.7.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
7
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.6.0
9
+ Generator version: 7.7.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
7
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.6.0
9
+ Generator version: 7.7.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
7
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.6.0
9
+ Generator version: 7.7.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
7
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.6.0
9
+ Generator version: 7.7.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
7
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.6.0
9
+ Generator version: 7.7.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
7
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.6.0
9
+ Generator version: 7.7.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
7
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.6.0
9
+ Generator version: 7.7.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
7
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.6.0
9
+ Generator version: 7.7.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
7
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.6.0
9
+ Generator version: 7.7.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
7
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.6.0
9
+ Generator version: 7.7.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
7
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.6.0
9
+ Generator version: 7.7.0
10
10
 
11
11
  =end
12
12
 
@@ -19,16 +19,19 @@ module Coinbase::Client
19
19
  # The unique ID of the staking operation.
20
20
  attr_accessor :id
21
21
 
22
+ # The ID of the wallet that owns the address.
23
+ attr_accessor :wallet_id
24
+
22
25
  # The ID of the blockchain network.
23
26
  attr_accessor :network_id
24
27
 
25
28
  # The onchain address orchestrating the staking operation.
26
29
  attr_accessor :address_id
27
30
 
28
- # The status of the staking operation
31
+ # The status of the staking operation.
29
32
  attr_accessor :status
30
33
 
31
- # The transaction(s) that will execute the staking operation onchain
34
+ # The transaction(s) that will execute the staking operation onchain.
32
35
  attr_accessor :transactions
33
36
 
34
37
  attr_accessor :metadata
@@ -59,6 +62,7 @@ module Coinbase::Client
59
62
  def self.attribute_map
60
63
  {
61
64
  :'id' => :'id',
65
+ :'wallet_id' => :'wallet_id',
62
66
  :'network_id' => :'network_id',
63
67
  :'address_id' => :'address_id',
64
68
  :'status' => :'status',
@@ -76,6 +80,7 @@ module Coinbase::Client
76
80
  def self.openapi_types
77
81
  {
78
82
  :'id' => :'String',
83
+ :'wallet_id' => :'String',
79
84
  :'network_id' => :'String',
80
85
  :'address_id' => :'String',
81
86
  :'status' => :'String',
@@ -111,6 +116,10 @@ module Coinbase::Client
111
116
  self.id = nil
112
117
  end
113
118
 
119
+ if attributes.key?(:'wallet_id')
120
+ self.wallet_id = attributes[:'wallet_id']
121
+ end
122
+
114
123
  if attributes.key?(:'network_id')
115
124
  self.network_id = attributes[:'network_id']
116
125
  else
@@ -178,7 +187,7 @@ module Coinbase::Client
178
187
  return false if @network_id.nil?
179
188
  return false if @address_id.nil?
180
189
  return false if @status.nil?
181
- status_validator = EnumAttributeValidator.new('String', ["initialized", "pending", "complete", "failed"])
190
+ status_validator = EnumAttributeValidator.new('String', ["initialized", "pending", "complete", "failed", "unspecified"])
182
191
  return false unless status_validator.valid?(@status)
183
192
  return false if @transactions.nil?
184
193
  true
@@ -187,7 +196,7 @@ module Coinbase::Client
187
196
  # Custom attribute writer method checking allowed values (enum).
188
197
  # @param [Object] status Object to be assigned
189
198
  def status=(status)
190
- validator = EnumAttributeValidator.new('String', ["initialized", "pending", "complete", "failed"])
199
+ validator = EnumAttributeValidator.new('String', ["initialized", "pending", "complete", "failed", "unspecified"])
191
200
  unless validator.valid?(status)
192
201
  fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
193
202
  end
@@ -200,6 +209,7 @@ module Coinbase::Client
200
209
  return true if self.equal?(o)
201
210
  self.class == o.class &&
202
211
  id == o.id &&
212
+ wallet_id == o.wallet_id &&
203
213
  network_id == o.network_id &&
204
214
  address_id == o.address_id &&
205
215
  status == o.status &&
@@ -216,7 +226,7 @@ module Coinbase::Client
216
226
  # Calculates hash code according to all attributes.
217
227
  # @return [Integer] Hash code
218
228
  def hash
219
- [id, network_id, address_id, status, transactions, metadata].hash
229
+ [id, wallet_id, network_id, address_id, status, transactions, metadata].hash
220
230
  end
221
231
 
222
232
  # Builds the object from hash
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
7
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.6.0
9
+ Generator version: 7.7.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
7
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.6.0
9
+ Generator version: 7.7.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
7
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.6.0
9
+ Generator version: 7.7.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
7
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.6.0
9
+ Generator version: 7.7.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
7
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.6.0
9
+ Generator version: 7.7.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
7
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.6.0
9
+ Generator version: 7.7.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
7
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.6.0
9
+ Generator version: 7.7.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
7
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.6.0
9
+ Generator version: 7.7.0
10
10
 
11
11
  =end
12
12
 
@@ -41,40 +41,6 @@ module Coinbase::Client
41
41
 
42
42
  attr_accessor :transaction
43
43
 
44
- # The unsigned payload of the transfer. This is the payload that needs to be signed by the sender.
45
- attr_accessor :unsigned_payload
46
-
47
- # The signed payload of the transfer. This is the payload that has been signed by the sender.
48
- attr_accessor :signed_payload
49
-
50
- # The hash of the transfer transaction
51
- attr_accessor :transaction_hash
52
-
53
- # The status of the transfer
54
- attr_accessor :status
55
-
56
- class EnumAttributeValidator
57
- attr_reader :datatype
58
- attr_reader :allowable_values
59
-
60
- def initialize(datatype, allowable_values)
61
- @allowable_values = allowable_values.map do |value|
62
- case datatype.to_s
63
- when /Integer/i
64
- value.to_i
65
- when /Float/i
66
- value.to_f
67
- else
68
- value
69
- end
70
- end
71
- end
72
-
73
- def valid?(value)
74
- !value || allowable_values.include?(value)
75
- end
76
- end
77
-
78
44
  # Attribute mapping from ruby-style variable name to JSON key.
79
45
  def self.attribute_map
80
46
  {
@@ -86,11 +52,7 @@ module Coinbase::Client
86
52
  :'asset_id' => :'asset_id',
87
53
  :'asset' => :'asset',
88
54
  :'transfer_id' => :'transfer_id',
89
- :'transaction' => :'transaction',
90
- :'unsigned_payload' => :'unsigned_payload',
91
- :'signed_payload' => :'signed_payload',
92
- :'transaction_hash' => :'transaction_hash',
93
- :'status' => :'status'
55
+ :'transaction' => :'transaction'
94
56
  }
95
57
  end
96
58
 
@@ -110,11 +72,7 @@ module Coinbase::Client
110
72
  :'asset_id' => :'String',
111
73
  :'asset' => :'Asset',
112
74
  :'transfer_id' => :'String',
113
- :'transaction' => :'Transaction',
114
- :'unsigned_payload' => :'String',
115
- :'signed_payload' => :'String',
116
- :'transaction_hash' => :'String',
117
- :'status' => :'String'
75
+ :'transaction' => :'Transaction'
118
76
  }
119
77
  end
120
78
 
@@ -192,26 +150,6 @@ module Coinbase::Client
192
150
  else
193
151
  self.transaction = nil
194
152
  end
195
-
196
- if attributes.key?(:'unsigned_payload')
197
- self.unsigned_payload = attributes[:'unsigned_payload']
198
- else
199
- self.unsigned_payload = nil
200
- end
201
-
202
- if attributes.key?(:'signed_payload')
203
- self.signed_payload = attributes[:'signed_payload']
204
- end
205
-
206
- if attributes.key?(:'transaction_hash')
207
- self.transaction_hash = attributes[:'transaction_hash']
208
- end
209
-
210
- if attributes.key?(:'status')
211
- self.status = attributes[:'status']
212
- else
213
- self.status = nil
214
- end
215
153
  end
216
154
 
217
155
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -255,14 +193,6 @@ module Coinbase::Client
255
193
  invalid_properties.push('invalid value for "transaction", transaction cannot be nil.')
256
194
  end
257
195
 
258
- if @unsigned_payload.nil?
259
- invalid_properties.push('invalid value for "unsigned_payload", unsigned_payload cannot be nil.')
260
- end
261
-
262
- if @status.nil?
263
- invalid_properties.push('invalid value for "status", status cannot be nil.')
264
- end
265
-
266
196
  invalid_properties
267
197
  end
268
198
 
@@ -279,23 +209,9 @@ module Coinbase::Client
279
209
  return false if @asset.nil?
280
210
  return false if @transfer_id.nil?
281
211
  return false if @transaction.nil?
282
- return false if @unsigned_payload.nil?
283
- return false if @status.nil?
284
- status_validator = EnumAttributeValidator.new('String', ["pending", "broadcast", "complete", "failed"])
285
- return false unless status_validator.valid?(@status)
286
212
  true
287
213
  end
288
214
 
289
- # Custom attribute writer method checking allowed values (enum).
290
- # @param [Object] status Object to be assigned
291
- def status=(status)
292
- validator = EnumAttributeValidator.new('String', ["pending", "broadcast", "complete", "failed"])
293
- unless validator.valid?(status)
294
- fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
295
- end
296
- @status = status
297
- end
298
-
299
215
  # Checks equality by comparing each attribute.
300
216
  # @param [Object] Object to be compared
301
217
  def ==(o)
@@ -309,11 +225,7 @@ module Coinbase::Client
309
225
  asset_id == o.asset_id &&
310
226
  asset == o.asset &&
311
227
  transfer_id == o.transfer_id &&
312
- transaction == o.transaction &&
313
- unsigned_payload == o.unsigned_payload &&
314
- signed_payload == o.signed_payload &&
315
- transaction_hash == o.transaction_hash &&
316
- status == o.status
228
+ transaction == o.transaction
317
229
  end
318
230
 
319
231
  # @see the `==` method
@@ -325,7 +237,7 @@ module Coinbase::Client
325
237
  # Calculates hash code according to all attributes.
326
238
  # @return [Integer] Hash code
327
239
  def hash
328
- [network_id, wallet_id, address_id, destination, amount, asset_id, asset, transfer_id, transaction, unsigned_payload, signed_payload, transaction_hash, status].hash
240
+ [network_id, wallet_id, address_id, destination, amount, asset_id, asset, transfer_id, transaction].hash
329
241
  end
330
242
 
331
243
  # Builds the object from hash
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
7
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.6.0
9
+ Generator version: 7.7.0
10
10
 
11
11
  =end
12
12