coinbase-sdk 0.0.14 → 0.1.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.
Files changed (62) hide show
  1. checksums.yaml +4 -4
  2. data/lib/coinbase/address/wallet_address.rb +31 -21
  3. data/lib/coinbase/address.rb +51 -17
  4. data/lib/coinbase/asset.rb +11 -8
  5. data/lib/coinbase/client/api/contract_events_api.rb +17 -9
  6. data/lib/coinbase/client/api/external_addresses_api.rb +85 -0
  7. data/lib/coinbase/client/api/networks_api.rb +85 -0
  8. data/lib/coinbase/client/api/stake_api.rb +74 -195
  9. data/lib/coinbase/client/api/validators_api.rb +2 -2
  10. data/lib/coinbase/client/api/wallet_stake_api.rb +263 -0
  11. data/lib/coinbase/client/models/address.rb +21 -4
  12. data/lib/coinbase/client/models/{native_eth_staking_context.rb → address_historical_balance_list.rb} +39 -35
  13. data/lib/coinbase/client/models/contract_event.rb +99 -8
  14. data/lib/coinbase/client/models/create_address_request.rb +14 -4
  15. data/lib/coinbase/client/models/create_transfer_request.rb +14 -4
  16. data/lib/coinbase/client/models/ethereum_validator_metadata.rb +11 -11
  17. data/lib/coinbase/client/models/feature.rb +2 -1
  18. data/lib/coinbase/client/models/feature_set.rb +307 -0
  19. data/lib/coinbase/client/models/{partial_eth_staking_context.rb → fetch_historical_staking_balances200_response.rb} +39 -35
  20. data/lib/coinbase/client/models/historical_balance.rb +273 -0
  21. data/lib/coinbase/client/models/network.rb +365 -0
  22. data/lib/coinbase/client/models/network_identifier.rb +44 -0
  23. data/lib/coinbase/client/models/sponsored_send.rb +338 -0
  24. data/lib/coinbase/client/models/staking_balance.rb +289 -0
  25. data/lib/coinbase/client/models/staking_context_context.rb +222 -74
  26. data/lib/coinbase/client/models/staking_operation.rb +2 -2
  27. data/lib/coinbase/client/models/staking_reward.rb +22 -6
  28. data/lib/coinbase/client/models/staking_reward_format.rb +2 -1
  29. data/lib/coinbase/client/models/staking_reward_usd_value.rb +257 -0
  30. data/lib/coinbase/client/models/transaction.rb +17 -7
  31. data/lib/coinbase/client/models/transaction_type.rb +2 -1
  32. data/lib/coinbase/client/models/transfer.rb +101 -8
  33. data/lib/coinbase/client/models/validator.rb +23 -2
  34. data/lib/coinbase/client/models/validator_status.rb +52 -0
  35. data/lib/coinbase/client/models/wallet.rb +13 -16
  36. data/lib/coinbase/client/models/webhook_event_type.rb +2 -1
  37. data/lib/coinbase/client.rb +12 -3
  38. data/lib/coinbase/constants.rb +0 -10
  39. data/lib/coinbase/contract_event.rb +104 -0
  40. data/lib/coinbase/correlation.rb +30 -0
  41. data/lib/coinbase/destination.rb +11 -9
  42. data/lib/coinbase/errors.rb +14 -0
  43. data/lib/coinbase/historical_balance.rb +53 -0
  44. data/lib/coinbase/middleware.rb +2 -0
  45. data/lib/coinbase/network.rb +103 -20
  46. data/lib/coinbase/server_signer.rb +14 -3
  47. data/lib/coinbase/smart_contract.rb +106 -0
  48. data/lib/coinbase/sponsored_send.rb +110 -0
  49. data/lib/coinbase/staking_balance.rb +92 -0
  50. data/lib/coinbase/staking_operation.rb +134 -36
  51. data/lib/coinbase/staking_reward.rb +18 -0
  52. data/lib/coinbase/trade.rb +10 -9
  53. data/lib/coinbase/transaction.rb +13 -3
  54. data/lib/coinbase/transfer.rb +65 -36
  55. data/lib/coinbase/validator.rb +18 -10
  56. data/lib/coinbase/version.rb +5 -0
  57. data/lib/coinbase/wallet/data.rb +31 -0
  58. data/lib/coinbase/wallet.rb +143 -182
  59. data/lib/coinbase/webhook.rb +181 -0
  60. data/lib/coinbase.rb +64 -21
  61. metadata +51 -5
  62. data/lib/coinbase/user.rb +0 -65
@@ -0,0 +1,257 @@
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
+ # The USD value of the reward
18
+ class StakingRewardUSDValue
19
+ # The value of the reward in USD
20
+ attr_accessor :amount
21
+
22
+ # The conversion price from native currency to USD
23
+ attr_accessor :conversion_price
24
+
25
+ # The time of the conversion in UTC.
26
+ attr_accessor :conversion_time
27
+
28
+ # Attribute mapping from ruby-style variable name to JSON key.
29
+ def self.attribute_map
30
+ {
31
+ :'amount' => :'amount',
32
+ :'conversion_price' => :'conversion_price',
33
+ :'conversion_time' => :'conversion_time'
34
+ }
35
+ end
36
+
37
+ # Returns all the JSON keys this model knows about
38
+ def self.acceptable_attributes
39
+ attribute_map.values
40
+ end
41
+
42
+ # Attribute type mapping.
43
+ def self.openapi_types
44
+ {
45
+ :'amount' => :'String',
46
+ :'conversion_price' => :'String',
47
+ :'conversion_time' => :'Time'
48
+ }
49
+ end
50
+
51
+ # List of attributes with nullable: true
52
+ def self.openapi_nullable
53
+ Set.new([
54
+ ])
55
+ end
56
+
57
+ # Initializes the object
58
+ # @param [Hash] attributes Model attributes in the form of hash
59
+ def initialize(attributes = {})
60
+ if (!attributes.is_a?(Hash))
61
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Coinbase::Client::StakingRewardUSDValue` initialize method"
62
+ end
63
+
64
+ # check to see if the attribute exists and convert string to symbol for hash key
65
+ attributes = attributes.each_with_object({}) { |(k, v), h|
66
+ if (!self.class.attribute_map.key?(k.to_sym))
67
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Coinbase::Client::StakingRewardUSDValue`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
68
+ end
69
+ h[k.to_sym] = v
70
+ }
71
+
72
+ if attributes.key?(:'amount')
73
+ self.amount = attributes[:'amount']
74
+ else
75
+ self.amount = nil
76
+ end
77
+
78
+ if attributes.key?(:'conversion_price')
79
+ self.conversion_price = attributes[:'conversion_price']
80
+ else
81
+ self.conversion_price = nil
82
+ end
83
+
84
+ if attributes.key?(:'conversion_time')
85
+ self.conversion_time = attributes[:'conversion_time']
86
+ else
87
+ self.conversion_time = nil
88
+ end
89
+ end
90
+
91
+ # Show invalid properties with the reasons. Usually used together with valid?
92
+ # @return Array for valid properties with the reasons
93
+ def list_invalid_properties
94
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
95
+ invalid_properties = Array.new
96
+ if @amount.nil?
97
+ invalid_properties.push('invalid value for "amount", amount cannot be nil.')
98
+ end
99
+
100
+ if @conversion_price.nil?
101
+ invalid_properties.push('invalid value for "conversion_price", conversion_price cannot be nil.')
102
+ end
103
+
104
+ if @conversion_time.nil?
105
+ invalid_properties.push('invalid value for "conversion_time", conversion_time cannot be nil.')
106
+ end
107
+
108
+ invalid_properties
109
+ end
110
+
111
+ # Check to see if the all the properties in the model are valid
112
+ # @return true if the model is valid
113
+ def valid?
114
+ warn '[DEPRECATED] the `valid?` method is obsolete'
115
+ return false if @amount.nil?
116
+ return false if @conversion_price.nil?
117
+ return false if @conversion_time.nil?
118
+ true
119
+ end
120
+
121
+ # Checks equality by comparing each attribute.
122
+ # @param [Object] Object to be compared
123
+ def ==(o)
124
+ return true if self.equal?(o)
125
+ self.class == o.class &&
126
+ amount == o.amount &&
127
+ conversion_price == o.conversion_price &&
128
+ conversion_time == o.conversion_time
129
+ end
130
+
131
+ # @see the `==` method
132
+ # @param [Object] Object to be compared
133
+ def eql?(o)
134
+ self == o
135
+ end
136
+
137
+ # Calculates hash code according to all attributes.
138
+ # @return [Integer] Hash code
139
+ def hash
140
+ [amount, conversion_price, conversion_time].hash
141
+ end
142
+
143
+ # Builds the object from hash
144
+ # @param [Hash] attributes Model attributes in the form of hash
145
+ # @return [Object] Returns the model itself
146
+ def self.build_from_hash(attributes)
147
+ return nil unless attributes.is_a?(Hash)
148
+ attributes = attributes.transform_keys(&:to_sym)
149
+ transformed_hash = {}
150
+ openapi_types.each_pair do |key, type|
151
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
152
+ transformed_hash["#{key}"] = nil
153
+ elsif type =~ /\AArray<(.*)>/i
154
+ # check to ensure the input is an array given that the attribute
155
+ # is documented as an array but the input is not
156
+ if attributes[attribute_map[key]].is_a?(Array)
157
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
158
+ end
159
+ elsif !attributes[attribute_map[key]].nil?
160
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
161
+ end
162
+ end
163
+ new(transformed_hash)
164
+ end
165
+
166
+ # Deserializes the data based on type
167
+ # @param string type Data type
168
+ # @param string value Value to be deserialized
169
+ # @return [Object] Deserialized data
170
+ def self._deserialize(type, value)
171
+ case type.to_sym
172
+ when :Time
173
+ Time.parse(value)
174
+ when :Date
175
+ Date.parse(value)
176
+ when :String
177
+ value.to_s
178
+ when :Integer
179
+ value.to_i
180
+ when :Float
181
+ value.to_f
182
+ when :Boolean
183
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
184
+ true
185
+ else
186
+ false
187
+ end
188
+ when :Object
189
+ # generic object (usually a Hash), return directly
190
+ value
191
+ when /\AArray<(?<inner_type>.+)>\z/
192
+ inner_type = Regexp.last_match[:inner_type]
193
+ value.map { |v| _deserialize(inner_type, v) }
194
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
195
+ k_type = Regexp.last_match[:k_type]
196
+ v_type = Regexp.last_match[:v_type]
197
+ {}.tap do |hash|
198
+ value.each do |k, v|
199
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
200
+ end
201
+ end
202
+ else # model
203
+ # models (e.g. Pet) or oneOf
204
+ klass = Coinbase::Client.const_get(type)
205
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
206
+ end
207
+ end
208
+
209
+ # Returns the string representation of the object
210
+ # @return [String] String presentation of the object
211
+ def to_s
212
+ to_hash.to_s
213
+ end
214
+
215
+ # to_body is an alias to to_hash (backward compatibility)
216
+ # @return [Hash] Returns the object in the form of hash
217
+ def to_body
218
+ to_hash
219
+ end
220
+
221
+ # Returns the object in the form of hash
222
+ # @return [Hash] Returns the object in the form of hash
223
+ def to_hash
224
+ hash = {}
225
+ self.class.attribute_map.each_pair do |attr, param|
226
+ value = self.send(attr)
227
+ if value.nil?
228
+ is_nullable = self.class.openapi_nullable.include?(attr)
229
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
230
+ end
231
+
232
+ hash[param] = _to_hash(value)
233
+ end
234
+ hash
235
+ end
236
+
237
+ # Outputs non-array value in the form of hash
238
+ # For object, use to_hash. Otherwise, just return the value
239
+ # @param [Object] value Any valid value
240
+ # @return [Hash] Returns the value in the form of hash
241
+ def _to_hash(value)
242
+ if value.is_a?(Array)
243
+ value.compact.map { |v| _to_hash(v) }
244
+ elsif value.is_a?(Hash)
245
+ {}.tap do |hash|
246
+ value.each { |k, v| hash[k] = _to_hash(v) }
247
+ end
248
+ elsif value.respond_to? :to_hash
249
+ value.to_hash
250
+ else
251
+ value
252
+ end
253
+ end
254
+
255
+ end
256
+
257
+ end
@@ -16,25 +16,28 @@ require 'time'
16
16
  module Coinbase::Client
17
17
  # An onchain transaction.
18
18
  class Transaction
19
- # The ID of the blockchain network
19
+ # The ID of the blockchain network.
20
20
  attr_accessor :network_id
21
21
 
22
- # The onchain address of the sender
22
+ # The onchain address of the sender.
23
23
  attr_accessor :from_address_id
24
24
 
25
+ # The onchain address of the recipient.
26
+ attr_accessor :to_address_id
27
+
25
28
  # The unsigned payload of the transaction. This is the payload that needs to be signed by the sender.
26
29
  attr_accessor :unsigned_payload
27
30
 
28
31
  # The signed payload of the transaction. This is the payload that has been signed by the sender.
29
32
  attr_accessor :signed_payload
30
33
 
31
- # The hash of the transaction
34
+ # The hash of the transaction.
32
35
  attr_accessor :transaction_hash
33
36
 
34
37
  # The link to view the transaction on a block explorer. This is optional and may not be present for all transactions.
35
38
  attr_accessor :transaction_link
36
39
 
37
- # The status of the transaction
40
+ # The status of the transaction.
38
41
  attr_accessor :status
39
42
 
40
43
  class EnumAttributeValidator
@@ -64,6 +67,7 @@ module Coinbase::Client
64
67
  {
65
68
  :'network_id' => :'network_id',
66
69
  :'from_address_id' => :'from_address_id',
70
+ :'to_address_id' => :'to_address_id',
67
71
  :'unsigned_payload' => :'unsigned_payload',
68
72
  :'signed_payload' => :'signed_payload',
69
73
  :'transaction_hash' => :'transaction_hash',
@@ -82,6 +86,7 @@ module Coinbase::Client
82
86
  {
83
87
  :'network_id' => :'String',
84
88
  :'from_address_id' => :'String',
89
+ :'to_address_id' => :'String',
85
90
  :'unsigned_payload' => :'String',
86
91
  :'signed_payload' => :'String',
87
92
  :'transaction_hash' => :'String',
@@ -123,6 +128,10 @@ module Coinbase::Client
123
128
  self.from_address_id = nil
124
129
  end
125
130
 
131
+ if attributes.key?(:'to_address_id')
132
+ self.to_address_id = attributes[:'to_address_id']
133
+ end
134
+
126
135
  if attributes.key?(:'unsigned_payload')
127
136
  self.unsigned_payload = attributes[:'unsigned_payload']
128
137
  else
@@ -180,7 +189,7 @@ module Coinbase::Client
180
189
  return false if @from_address_id.nil?
181
190
  return false if @unsigned_payload.nil?
182
191
  return false if @status.nil?
183
- status_validator = EnumAttributeValidator.new('String', ["pending", "signed", "broadcast", "complete", "failed"])
192
+ status_validator = EnumAttributeValidator.new('String', ["pending", "signed", "broadcast", "complete", "failed", "unknown_default_open_api"])
184
193
  return false unless status_validator.valid?(@status)
185
194
  true
186
195
  end
@@ -188,7 +197,7 @@ module Coinbase::Client
188
197
  # Custom attribute writer method checking allowed values (enum).
189
198
  # @param [Object] status Object to be assigned
190
199
  def status=(status)
191
- validator = EnumAttributeValidator.new('String', ["pending", "signed", "broadcast", "complete", "failed"])
200
+ validator = EnumAttributeValidator.new('String', ["pending", "signed", "broadcast", "complete", "failed", "unknown_default_open_api"])
192
201
  unless validator.valid?(status)
193
202
  fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
194
203
  end
@@ -202,6 +211,7 @@ module Coinbase::Client
202
211
  self.class == o.class &&
203
212
  network_id == o.network_id &&
204
213
  from_address_id == o.from_address_id &&
214
+ to_address_id == o.to_address_id &&
205
215
  unsigned_payload == o.unsigned_payload &&
206
216
  signed_payload == o.signed_payload &&
207
217
  transaction_hash == o.transaction_hash &&
@@ -218,7 +228,7 @@ module Coinbase::Client
218
228
  # Calculates hash code according to all attributes.
219
229
  # @return [Integer] Hash code
220
230
  def hash
221
- [network_id, from_address_id, unsigned_payload, signed_payload, transaction_hash, transaction_link, status].hash
231
+ [network_id, from_address_id, to_address_id, unsigned_payload, signed_payload, transaction_hash, transaction_link, status].hash
222
232
  end
223
233
 
224
234
  # Builds the object from hash
@@ -16,9 +16,10 @@ require 'time'
16
16
  module Coinbase::Client
17
17
  class TransactionType
18
18
  TRANSFER = "transfer".freeze
19
+ UNKNOWN_DEFAULT_OPEN_API = "unknown_default_open_api".freeze
19
20
 
20
21
  def self.all_vars
21
- @all_vars ||= [TRANSFER].freeze
22
+ @all_vars ||= [TRANSFER, UNKNOWN_DEFAULT_OPEN_API].freeze
22
23
  end
23
24
 
24
25
  # Builds the enum from string
@@ -41,6 +41,45 @@ module Coinbase::Client
41
41
 
42
42
  attr_accessor :transaction
43
43
 
44
+ attr_accessor :sponsored_send
45
+
46
+ # The unsigned payload of the transfer. This is the payload that needs to be signed by the sender.
47
+ attr_accessor :unsigned_payload
48
+
49
+ # The signed payload of the transfer. This is the payload that has been signed by the sender.
50
+ attr_accessor :signed_payload
51
+
52
+ # The hash of the transfer transaction
53
+ attr_accessor :transaction_hash
54
+
55
+ # The status of the transfer
56
+ attr_accessor :status
57
+
58
+ # Whether the transfer uses sponsored gas
59
+ attr_accessor :gasless
60
+
61
+ class EnumAttributeValidator
62
+ attr_reader :datatype
63
+ attr_reader :allowable_values
64
+
65
+ def initialize(datatype, allowable_values)
66
+ @allowable_values = allowable_values.map do |value|
67
+ case datatype.to_s
68
+ when /Integer/i
69
+ value.to_i
70
+ when /Float/i
71
+ value.to_f
72
+ else
73
+ value
74
+ end
75
+ end
76
+ end
77
+
78
+ def valid?(value)
79
+ !value || allowable_values.include?(value)
80
+ end
81
+ end
82
+
44
83
  # Attribute mapping from ruby-style variable name to JSON key.
45
84
  def self.attribute_map
46
85
  {
@@ -52,7 +91,13 @@ module Coinbase::Client
52
91
  :'asset_id' => :'asset_id',
53
92
  :'asset' => :'asset',
54
93
  :'transfer_id' => :'transfer_id',
55
- :'transaction' => :'transaction'
94
+ :'transaction' => :'transaction',
95
+ :'sponsored_send' => :'sponsored_send',
96
+ :'unsigned_payload' => :'unsigned_payload',
97
+ :'signed_payload' => :'signed_payload',
98
+ :'transaction_hash' => :'transaction_hash',
99
+ :'status' => :'status',
100
+ :'gasless' => :'gasless'
56
101
  }
57
102
  end
58
103
 
@@ -72,7 +117,13 @@ module Coinbase::Client
72
117
  :'asset_id' => :'String',
73
118
  :'asset' => :'Asset',
74
119
  :'transfer_id' => :'String',
75
- :'transaction' => :'Transaction'
120
+ :'transaction' => :'Transaction',
121
+ :'sponsored_send' => :'SponsoredSend',
122
+ :'unsigned_payload' => :'String',
123
+ :'signed_payload' => :'String',
124
+ :'transaction_hash' => :'String',
125
+ :'status' => :'String',
126
+ :'gasless' => :'Boolean'
76
127
  }
77
128
  end
78
129
 
@@ -147,8 +198,32 @@ module Coinbase::Client
147
198
 
148
199
  if attributes.key?(:'transaction')
149
200
  self.transaction = attributes[:'transaction']
201
+ end
202
+
203
+ if attributes.key?(:'sponsored_send')
204
+ self.sponsored_send = attributes[:'sponsored_send']
205
+ end
206
+
207
+ if attributes.key?(:'unsigned_payload')
208
+ self.unsigned_payload = attributes[:'unsigned_payload']
209
+ end
210
+
211
+ if attributes.key?(:'signed_payload')
212
+ self.signed_payload = attributes[:'signed_payload']
213
+ end
214
+
215
+ if attributes.key?(:'transaction_hash')
216
+ self.transaction_hash = attributes[:'transaction_hash']
217
+ end
218
+
219
+ if attributes.key?(:'status')
220
+ self.status = attributes[:'status']
221
+ end
222
+
223
+ if attributes.key?(:'gasless')
224
+ self.gasless = attributes[:'gasless']
150
225
  else
151
- self.transaction = nil
226
+ self.gasless = nil
152
227
  end
153
228
  end
154
229
 
@@ -189,8 +264,8 @@ module Coinbase::Client
189
264
  invalid_properties.push('invalid value for "transfer_id", transfer_id cannot be nil.')
190
265
  end
191
266
 
192
- if @transaction.nil?
193
- invalid_properties.push('invalid value for "transaction", transaction cannot be nil.')
267
+ if @gasless.nil?
268
+ invalid_properties.push('invalid value for "gasless", gasless cannot be nil.')
194
269
  end
195
270
 
196
271
  invalid_properties
@@ -208,10 +283,22 @@ module Coinbase::Client
208
283
  return false if @asset_id.nil?
209
284
  return false if @asset.nil?
210
285
  return false if @transfer_id.nil?
211
- return false if @transaction.nil?
286
+ status_validator = EnumAttributeValidator.new('String', ["pending", "broadcast", "complete", "failed", "unknown_default_open_api"])
287
+ return false unless status_validator.valid?(@status)
288
+ return false if @gasless.nil?
212
289
  true
213
290
  end
214
291
 
292
+ # Custom attribute writer method checking allowed values (enum).
293
+ # @param [Object] status Object to be assigned
294
+ def status=(status)
295
+ validator = EnumAttributeValidator.new('String', ["pending", "broadcast", "complete", "failed", "unknown_default_open_api"])
296
+ unless validator.valid?(status)
297
+ fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
298
+ end
299
+ @status = status
300
+ end
301
+
215
302
  # Checks equality by comparing each attribute.
216
303
  # @param [Object] Object to be compared
217
304
  def ==(o)
@@ -225,7 +312,13 @@ module Coinbase::Client
225
312
  asset_id == o.asset_id &&
226
313
  asset == o.asset &&
227
314
  transfer_id == o.transfer_id &&
228
- transaction == o.transaction
315
+ transaction == o.transaction &&
316
+ sponsored_send == o.sponsored_send &&
317
+ unsigned_payload == o.unsigned_payload &&
318
+ signed_payload == o.signed_payload &&
319
+ transaction_hash == o.transaction_hash &&
320
+ status == o.status &&
321
+ gasless == o.gasless
229
322
  end
230
323
 
231
324
  # @see the `==` method
@@ -237,7 +330,7 @@ module Coinbase::Client
237
330
  # Calculates hash code according to all attributes.
238
331
  # @return [Integer] Hash code
239
332
  def hash
240
- [network_id, wallet_id, address_id, destination, amount, asset_id, asset, transfer_id, transaction].hash
333
+ [network_id, wallet_id, address_id, destination, amount, asset_id, asset, transfer_id, transaction, sponsored_send, unsigned_payload, signed_payload, transaction_hash, status, gasless].hash
241
334
  end
242
335
 
243
336
  # Builds the object from hash
@@ -25,11 +25,32 @@ module Coinbase::Client
25
25
  # The ID of the asset that the validator helps stake.
26
26
  attr_accessor :asset_id
27
27
 
28
- # The status of the validator.
29
28
  attr_accessor :status
30
29
 
31
30
  attr_accessor :details
32
31
 
32
+ class EnumAttributeValidator
33
+ attr_reader :datatype
34
+ attr_reader :allowable_values
35
+
36
+ def initialize(datatype, allowable_values)
37
+ @allowable_values = allowable_values.map do |value|
38
+ case datatype.to_s
39
+ when /Integer/i
40
+ value.to_i
41
+ when /Float/i
42
+ value.to_f
43
+ else
44
+ value
45
+ end
46
+ end
47
+ end
48
+
49
+ def valid?(value)
50
+ !value || allowable_values.include?(value)
51
+ end
52
+ end
53
+
33
54
  # Attribute mapping from ruby-style variable name to JSON key.
34
55
  def self.attribute_map
35
56
  {
@@ -52,7 +73,7 @@ module Coinbase::Client
52
73
  :'validator_id' => :'String',
53
74
  :'network_id' => :'String',
54
75
  :'asset_id' => :'String',
55
- :'status' => :'String',
76
+ :'status' => :'ValidatorStatus',
56
77
  :'details' => :'ValidatorDetails'
57
78
  }
58
79
  end
@@ -0,0 +1,52 @@
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 ValidatorStatus
18
+ UNKNOWN = "unknown".freeze
19
+ PROVISIONING = "provisioning".freeze
20
+ PROVISIONED = "provisioned".freeze
21
+ DEPOSITED = "deposited".freeze
22
+ PENDING_ACTIVATION = "pending_activation".freeze
23
+ ACTIVE = "active".freeze
24
+ EXITING = "exiting".freeze
25
+ EXITED = "exited".freeze
26
+ WITHDRAWAL_AVAILABLE = "withdrawal_available".freeze
27
+ WITHDRAWAL_COMPLETE = "withdrawal_complete".freeze
28
+ ACTIVE_SLASHED = "active_slashed".freeze
29
+ EXITED_SLASHED = "exited_slashed".freeze
30
+ REAPED = "reaped".freeze
31
+ UNKNOWN_DEFAULT_OPEN_API = "unknown_default_open_api".freeze
32
+
33
+ def self.all_vars
34
+ @all_vars ||= [UNKNOWN, PROVISIONING, PROVISIONED, DEPOSITED, PENDING_ACTIVATION, ACTIVE, EXITING, EXITED, WITHDRAWAL_AVAILABLE, WITHDRAWAL_COMPLETE, ACTIVE_SLASHED, EXITED_SLASHED, REAPED, UNKNOWN_DEFAULT_OPEN_API].freeze
35
+ end
36
+
37
+ # Builds the enum from string
38
+ # @param [String] The enum value in the form of the string
39
+ # @return [String] The enum value
40
+ def self.build_from_hash(value)
41
+ new.build_from_hash(value)
42
+ end
43
+
44
+ # Builds the enum from string
45
+ # @param [String] The enum value in the form of the string
46
+ # @return [String] The enum value
47
+ def build_from_hash(value)
48
+ return value if ValidatorStatus.all_vars.include?(value)
49
+ raise "Invalid ENUM value #{value} for class #ValidatorStatus"
50
+ end
51
+ end
52
+ end