coinbase-sdk 0.11.0 → 0.14.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 (50) hide show
  1. checksums.yaml +4 -4
  2. data/lib/coinbase/address/wallet_address.rb +6 -3
  3. data/lib/coinbase/address.rb +22 -3
  4. data/lib/coinbase/address_reputation.rb +67 -0
  5. data/lib/coinbase/client/api/addresses_api.rb +9 -9
  6. data/lib/coinbase/client/api/assets_api.rb +1 -1
  7. data/lib/coinbase/client/api/balance_history_api.rb +1 -1
  8. data/lib/coinbase/client/api/contract_events_api.rb +1 -1
  9. data/lib/coinbase/client/api/contract_invocations_api.rb +4 -4
  10. data/lib/coinbase/client/api/external_addresses_api.rb +245 -4
  11. data/lib/coinbase/client/api/fund_api.rb +4 -4
  12. data/lib/coinbase/client/api/mpc_wallet_stake_api.rb +3 -3
  13. data/lib/coinbase/client/api/networks_api.rb +1 -1
  14. data/lib/coinbase/client/api/onchain_identity_api.rb +1 -1
  15. data/lib/coinbase/client/api/reputation_api.rb +1 -70
  16. data/lib/coinbase/client/api/server_signers_api.rb +6 -6
  17. data/lib/coinbase/client/api/smart_contracts_api.rb +168 -25
  18. data/lib/coinbase/client/api/stake_api.rb +7 -7
  19. data/lib/coinbase/client/api/trades_api.rb +4 -4
  20. data/lib/coinbase/client/api/transaction_history_api.rb +1 -1
  21. data/lib/coinbase/client/api/transfers_api.rb +4 -4
  22. data/lib/coinbase/client/api/wallets_api.rb +5 -5
  23. data/lib/coinbase/client/api/webhooks_api.rb +5 -5
  24. data/lib/coinbase/client/configuration.rb +14 -0
  25. data/lib/coinbase/client/models/address_reputation.rb +15 -8
  26. data/lib/coinbase/client/models/{address_risk.rb → broadcast_external_transfer_request.rb} +15 -16
  27. data/lib/coinbase/client/models/create_external_transfer_request.rb +283 -0
  28. data/lib/coinbase/client/models/create_fund_operation_request.rb +1 -1
  29. data/lib/coinbase/client/models/create_fund_quote_request.rb +1 -1
  30. data/lib/coinbase/client/models/create_transfer_request.rb +15 -5
  31. data/lib/coinbase/client/models/ethereum_transaction.rb +14 -4
  32. data/lib/coinbase/client/models/register_smart_contract_request.rb +252 -0
  33. data/lib/coinbase/client/models/smart_contract.rb +36 -30
  34. data/lib/coinbase/client/models/smart_contract_activity_event.rb +386 -0
  35. data/lib/coinbase/client/models/smart_contract_type.rb +2 -1
  36. data/lib/coinbase/client/models/transfer.rb +1 -36
  37. data/lib/coinbase/client/models/update_smart_contract_request.rb +245 -0
  38. data/lib/coinbase/client/models/webhook_event_type.rb +2 -1
  39. data/lib/coinbase/client/models/webhook_event_type_filter.rb +1 -0
  40. data/lib/coinbase/client/models/webhook_smart_contract_event_filter.rb +225 -0
  41. data/lib/coinbase/client/models/webhook_wallet_activity_filter.rb +7 -0
  42. data/lib/coinbase/client.rb +6 -1
  43. data/lib/coinbase/errors.rb +8 -0
  44. data/lib/coinbase/smart_contract.rb +338 -245
  45. data/lib/coinbase/transfer.rb +24 -2
  46. data/lib/coinbase/version.rb +1 -1
  47. data/lib/coinbase/wallet/data.rb +6 -4
  48. data/lib/coinbase/wallet.rb +3 -2
  49. data/lib/coinbase.rb +2 -1
  50. metadata +13 -7
@@ -16,15 +16,15 @@ require 'time'
16
16
  module Coinbase::Client
17
17
  # The reputation score with metadata of a blockchain address.
18
18
  class AddressReputation
19
- # The reputation score of a wallet address which lie between 0 to 100.
20
- attr_accessor :reputation_score
19
+ # The score of a wallet address, ranging from -100 to 100. A negative score indicates a bad reputation, while a positive score indicates a good reputation.
20
+ attr_accessor :score
21
21
 
22
22
  attr_accessor :metadata
23
23
 
24
24
  # Attribute mapping from ruby-style variable name to JSON key.
25
25
  def self.attribute_map
26
26
  {
27
- :'reputation_score' => :'reputation_score',
27
+ :'score' => :'score',
28
28
  :'metadata' => :'metadata'
29
29
  }
30
30
  end
@@ -37,7 +37,7 @@ module Coinbase::Client
37
37
  # Attribute type mapping.
38
38
  def self.openapi_types
39
39
  {
40
- :'reputation_score' => :'Integer',
40
+ :'score' => :'Integer',
41
41
  :'metadata' => :'AddressReputationMetadata'
42
42
  }
43
43
  end
@@ -63,8 +63,10 @@ module Coinbase::Client
63
63
  h[k.to_sym] = v
64
64
  }
65
65
 
66
- if attributes.key?(:'reputation_score')
67
- self.reputation_score = attributes[:'reputation_score']
66
+ if attributes.key?(:'score')
67
+ self.score = attributes[:'score']
68
+ else
69
+ self.score = nil
68
70
  end
69
71
 
70
72
  if attributes.key?(:'metadata')
@@ -79,6 +81,10 @@ module Coinbase::Client
79
81
  def list_invalid_properties
80
82
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
81
83
  invalid_properties = Array.new
84
+ if @score.nil?
85
+ invalid_properties.push('invalid value for "score", score cannot be nil.')
86
+ end
87
+
82
88
  if @metadata.nil?
83
89
  invalid_properties.push('invalid value for "metadata", metadata cannot be nil.')
84
90
  end
@@ -90,6 +96,7 @@ module Coinbase::Client
90
96
  # @return true if the model is valid
91
97
  def valid?
92
98
  warn '[DEPRECATED] the `valid?` method is obsolete'
99
+ return false if @score.nil?
93
100
  return false if @metadata.nil?
94
101
  true
95
102
  end
@@ -99,7 +106,7 @@ module Coinbase::Client
99
106
  def ==(o)
100
107
  return true if self.equal?(o)
101
108
  self.class == o.class &&
102
- reputation_score == o.reputation_score &&
109
+ score == o.score &&
103
110
  metadata == o.metadata
104
111
  end
105
112
 
@@ -112,7 +119,7 @@ module Coinbase::Client
112
119
  # Calculates hash code according to all attributes.
113
120
  # @return [Integer] Hash code
114
121
  def hash
115
- [reputation_score, metadata].hash
122
+ [score, metadata].hash
116
123
  end
117
124
 
118
125
  # Builds the object from hash
@@ -14,15 +14,14 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Coinbase::Client
17
- # The risk score of a blockchain address.
18
- class AddressRisk
19
- # The lower the score is, the higher the risk is. The score lies between -100 to 0.
20
- attr_accessor :risk_score
17
+ class BroadcastExternalTransferRequest
18
+ # The hex-encoded signed payload of the external transfer
19
+ attr_accessor :signed_payload
21
20
 
22
21
  # Attribute mapping from ruby-style variable name to JSON key.
23
22
  def self.attribute_map
24
23
  {
25
- :'risk_score' => :'risk_score'
24
+ :'signed_payload' => :'signed_payload'
26
25
  }
27
26
  end
28
27
 
@@ -34,7 +33,7 @@ module Coinbase::Client
34
33
  # Attribute type mapping.
35
34
  def self.openapi_types
36
35
  {
37
- :'risk_score' => :'Integer'
36
+ :'signed_payload' => :'String'
38
37
  }
39
38
  end
40
39
 
@@ -48,21 +47,21 @@ module Coinbase::Client
48
47
  # @param [Hash] attributes Model attributes in the form of hash
49
48
  def initialize(attributes = {})
50
49
  if (!attributes.is_a?(Hash))
51
- fail ArgumentError, "The input argument (attributes) must be a hash in `Coinbase::Client::AddressRisk` initialize method"
50
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Coinbase::Client::BroadcastExternalTransferRequest` initialize method"
52
51
  end
53
52
 
54
53
  # check to see if the attribute exists and convert string to symbol for hash key
55
54
  attributes = attributes.each_with_object({}) { |(k, v), h|
56
55
  if (!self.class.attribute_map.key?(k.to_sym))
57
- fail ArgumentError, "`#{k}` is not a valid attribute in `Coinbase::Client::AddressRisk`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
56
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Coinbase::Client::BroadcastExternalTransferRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
58
57
  end
59
58
  h[k.to_sym] = v
60
59
  }
61
60
 
62
- if attributes.key?(:'risk_score')
63
- self.risk_score = attributes[:'risk_score']
61
+ if attributes.key?(:'signed_payload')
62
+ self.signed_payload = attributes[:'signed_payload']
64
63
  else
65
- self.risk_score = nil
64
+ self.signed_payload = nil
66
65
  end
67
66
  end
68
67
 
@@ -71,8 +70,8 @@ module Coinbase::Client
71
70
  def list_invalid_properties
72
71
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
73
72
  invalid_properties = Array.new
74
- if @risk_score.nil?
75
- invalid_properties.push('invalid value for "risk_score", risk_score cannot be nil.')
73
+ if @signed_payload.nil?
74
+ invalid_properties.push('invalid value for "signed_payload", signed_payload cannot be nil.')
76
75
  end
77
76
 
78
77
  invalid_properties
@@ -82,7 +81,7 @@ module Coinbase::Client
82
81
  # @return true if the model is valid
83
82
  def valid?
84
83
  warn '[DEPRECATED] the `valid?` method is obsolete'
85
- return false if @risk_score.nil?
84
+ return false if @signed_payload.nil?
86
85
  true
87
86
  end
88
87
 
@@ -91,7 +90,7 @@ module Coinbase::Client
91
90
  def ==(o)
92
91
  return true if self.equal?(o)
93
92
  self.class == o.class &&
94
- risk_score == o.risk_score
93
+ signed_payload == o.signed_payload
95
94
  end
96
95
 
97
96
  # @see the `==` method
@@ -103,7 +102,7 @@ module Coinbase::Client
103
102
  # Calculates hash code according to all attributes.
104
103
  # @return [Integer] Hash code
105
104
  def hash
106
- [risk_score].hash
105
+ [signed_payload].hash
107
106
  end
108
107
 
109
108
  # Builds the object from hash
@@ -0,0 +1,283 @@
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
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.9.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Coinbase::Client
17
+ class CreateExternalTransferRequest
18
+ # The amount to transfer
19
+ attr_accessor :amount
20
+
21
+ # The ID of the asset to transfer. Can be an asset symbol or a token contract address.
22
+ attr_accessor :asset_id
23
+
24
+ # The destination address, which can be a 0x address, Basename, or ENS name
25
+ attr_accessor :destination
26
+
27
+ # Whether the transfer uses sponsored gas
28
+ attr_accessor :gasless
29
+
30
+ # When true, the transfer will be submitted immediately. Otherwise, the transfer will be batched. Defaults to false. Note: Requires the gasless option to be set to true.
31
+ attr_accessor :skip_batching
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'amount' => :'amount',
37
+ :'asset_id' => :'asset_id',
38
+ :'destination' => :'destination',
39
+ :'gasless' => :'gasless',
40
+ :'skip_batching' => :'skip_batching'
41
+ }
42
+ end
43
+
44
+ # Returns all the JSON keys this model knows about
45
+ def self.acceptable_attributes
46
+ attribute_map.values
47
+ end
48
+
49
+ # Attribute type mapping.
50
+ def self.openapi_types
51
+ {
52
+ :'amount' => :'String',
53
+ :'asset_id' => :'String',
54
+ :'destination' => :'String',
55
+ :'gasless' => :'Boolean',
56
+ :'skip_batching' => :'Boolean'
57
+ }
58
+ end
59
+
60
+ # List of attributes with nullable: true
61
+ def self.openapi_nullable
62
+ Set.new([
63
+ ])
64
+ end
65
+
66
+ # Initializes the object
67
+ # @param [Hash] attributes Model attributes in the form of hash
68
+ def initialize(attributes = {})
69
+ if (!attributes.is_a?(Hash))
70
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Coinbase::Client::CreateExternalTransferRequest` initialize method"
71
+ end
72
+
73
+ # check to see if the attribute exists and convert string to symbol for hash key
74
+ attributes = attributes.each_with_object({}) { |(k, v), h|
75
+ if (!self.class.attribute_map.key?(k.to_sym))
76
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Coinbase::Client::CreateExternalTransferRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
77
+ end
78
+ h[k.to_sym] = v
79
+ }
80
+
81
+ if attributes.key?(:'amount')
82
+ self.amount = attributes[:'amount']
83
+ else
84
+ self.amount = nil
85
+ end
86
+
87
+ if attributes.key?(:'asset_id')
88
+ self.asset_id = attributes[:'asset_id']
89
+ else
90
+ self.asset_id = nil
91
+ end
92
+
93
+ if attributes.key?(:'destination')
94
+ self.destination = attributes[:'destination']
95
+ else
96
+ self.destination = nil
97
+ end
98
+
99
+ if attributes.key?(:'gasless')
100
+ self.gasless = attributes[:'gasless']
101
+ else
102
+ self.gasless = nil
103
+ end
104
+
105
+ if attributes.key?(:'skip_batching')
106
+ self.skip_batching = attributes[:'skip_batching']
107
+ end
108
+ end
109
+
110
+ # Show invalid properties with the reasons. Usually used together with valid?
111
+ # @return Array for valid properties with the reasons
112
+ def list_invalid_properties
113
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
114
+ invalid_properties = Array.new
115
+ if @amount.nil?
116
+ invalid_properties.push('invalid value for "amount", amount cannot be nil.')
117
+ end
118
+
119
+ if @asset_id.nil?
120
+ invalid_properties.push('invalid value for "asset_id", asset_id cannot be nil.')
121
+ end
122
+
123
+ if @destination.nil?
124
+ invalid_properties.push('invalid value for "destination", destination cannot be nil.')
125
+ end
126
+
127
+ if @gasless.nil?
128
+ invalid_properties.push('invalid value for "gasless", gasless cannot be nil.')
129
+ end
130
+
131
+ invalid_properties
132
+ end
133
+
134
+ # Check to see if the all the properties in the model are valid
135
+ # @return true if the model is valid
136
+ def valid?
137
+ warn '[DEPRECATED] the `valid?` method is obsolete'
138
+ return false if @amount.nil?
139
+ return false if @asset_id.nil?
140
+ return false if @destination.nil?
141
+ return false if @gasless.nil?
142
+ true
143
+ end
144
+
145
+ # Checks equality by comparing each attribute.
146
+ # @param [Object] Object to be compared
147
+ def ==(o)
148
+ return true if self.equal?(o)
149
+ self.class == o.class &&
150
+ amount == o.amount &&
151
+ asset_id == o.asset_id &&
152
+ destination == o.destination &&
153
+ gasless == o.gasless &&
154
+ skip_batching == o.skip_batching
155
+ end
156
+
157
+ # @see the `==` method
158
+ # @param [Object] Object to be compared
159
+ def eql?(o)
160
+ self == o
161
+ end
162
+
163
+ # Calculates hash code according to all attributes.
164
+ # @return [Integer] Hash code
165
+ def hash
166
+ [amount, asset_id, destination, gasless, skip_batching].hash
167
+ end
168
+
169
+ # Builds the object from hash
170
+ # @param [Hash] attributes Model attributes in the form of hash
171
+ # @return [Object] Returns the model itself
172
+ def self.build_from_hash(attributes)
173
+ return nil unless attributes.is_a?(Hash)
174
+ attributes = attributes.transform_keys(&:to_sym)
175
+ transformed_hash = {}
176
+ openapi_types.each_pair do |key, type|
177
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
178
+ transformed_hash["#{key}"] = nil
179
+ elsif type =~ /\AArray<(.*)>/i
180
+ # check to ensure the input is an array given that the attribute
181
+ # is documented as an array but the input is not
182
+ if attributes[attribute_map[key]].is_a?(Array)
183
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
184
+ end
185
+ elsif !attributes[attribute_map[key]].nil?
186
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
187
+ end
188
+ end
189
+ new(transformed_hash)
190
+ end
191
+
192
+ # Deserializes the data based on type
193
+ # @param string type Data type
194
+ # @param string value Value to be deserialized
195
+ # @return [Object] Deserialized data
196
+ def self._deserialize(type, value)
197
+ case type.to_sym
198
+ when :Time
199
+ Time.parse(value)
200
+ when :Date
201
+ Date.parse(value)
202
+ when :String
203
+ value.to_s
204
+ when :Integer
205
+ value.to_i
206
+ when :Float
207
+ value.to_f
208
+ when :Boolean
209
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
210
+ true
211
+ else
212
+ false
213
+ end
214
+ when :Object
215
+ # generic object (usually a Hash), return directly
216
+ value
217
+ when /\AArray<(?<inner_type>.+)>\z/
218
+ inner_type = Regexp.last_match[:inner_type]
219
+ value.map { |v| _deserialize(inner_type, v) }
220
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
221
+ k_type = Regexp.last_match[:k_type]
222
+ v_type = Regexp.last_match[:v_type]
223
+ {}.tap do |hash|
224
+ value.each do |k, v|
225
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
226
+ end
227
+ end
228
+ else # model
229
+ # models (e.g. Pet) or oneOf
230
+ klass = Coinbase::Client.const_get(type)
231
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
232
+ end
233
+ end
234
+
235
+ # Returns the string representation of the object
236
+ # @return [String] String presentation of the object
237
+ def to_s
238
+ to_hash.to_s
239
+ end
240
+
241
+ # to_body is an alias to to_hash (backward compatibility)
242
+ # @return [Hash] Returns the object in the form of hash
243
+ def to_body
244
+ to_hash
245
+ end
246
+
247
+ # Returns the object in the form of hash
248
+ # @return [Hash] Returns the object in the form of hash
249
+ def to_hash
250
+ hash = {}
251
+ self.class.attribute_map.each_pair do |attr, param|
252
+ value = self.send(attr)
253
+ if value.nil?
254
+ is_nullable = self.class.openapi_nullable.include?(attr)
255
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
256
+ end
257
+
258
+ hash[param] = _to_hash(value)
259
+ end
260
+ hash
261
+ end
262
+
263
+ # Outputs non-array value in the form of hash
264
+ # For object, use to_hash. Otherwise, just return the value
265
+ # @param [Object] value Any valid value
266
+ # @return [Hash] Returns the value in the form of hash
267
+ def _to_hash(value)
268
+ if value.is_a?(Array)
269
+ value.compact.map { |v| _to_hash(v) }
270
+ elsif value.is_a?(Hash)
271
+ {}.tap do |hash|
272
+ value.each { |k, v| hash[k] = _to_hash(v) }
273
+ end
274
+ elsif value.respond_to? :to_hash
275
+ value.to_hash
276
+ else
277
+ value
278
+ end
279
+ end
280
+
281
+ end
282
+
283
+ end
@@ -18,7 +18,7 @@ module Coinbase::Client
18
18
  # The amount of the asset to fund the address with in atomic units.
19
19
  attr_accessor :amount
20
20
 
21
- # The ID of the asset to fund the address with.
21
+ # The ID of the asset to fund the address with. Can be an asset symbol or a token contract address.
22
22
  attr_accessor :asset_id
23
23
 
24
24
  # The Optional ID of the fund quote to fund the address with. If omitted we will generate a quote and immediately execute it.
@@ -18,7 +18,7 @@ module Coinbase::Client
18
18
  # The amount of the asset to fund the address with in atomic units.
19
19
  attr_accessor :amount
20
20
 
21
- # The ID of the asset to fund the address with.
21
+ # The ID of the asset to fund the address with. Can be an asset symbol alias or a token contract address.
22
22
  attr_accessor :asset_id
23
23
 
24
24
  # Attribute mapping from ruby-style variable name to JSON key.
@@ -21,7 +21,7 @@ module Coinbase::Client
21
21
  # The ID of the blockchain network
22
22
  attr_accessor :network_id
23
23
 
24
- # The ID of the asset to transfer
24
+ # The ID of the asset to transfer. Can be an asset symbol or a token contract address.
25
25
  attr_accessor :asset_id
26
26
 
27
27
  # The destination address, which can be a 0x address, Basename, or ENS name
@@ -30,6 +30,9 @@ module Coinbase::Client
30
30
  # Whether the transfer uses sponsored gas
31
31
  attr_accessor :gasless
32
32
 
33
+ # When true, the transfer will be submitted immediately. Otherwise, the transfer will be batched. Defaults to false
34
+ attr_accessor :skip_batching
35
+
33
36
  # Attribute mapping from ruby-style variable name to JSON key.
34
37
  def self.attribute_map
35
38
  {
@@ -37,7 +40,8 @@ module Coinbase::Client
37
40
  :'network_id' => :'network_id',
38
41
  :'asset_id' => :'asset_id',
39
42
  :'destination' => :'destination',
40
- :'gasless' => :'gasless'
43
+ :'gasless' => :'gasless',
44
+ :'skip_batching' => :'skip_batching'
41
45
  }
42
46
  end
43
47
 
@@ -53,7 +57,8 @@ module Coinbase::Client
53
57
  :'network_id' => :'String',
54
58
  :'asset_id' => :'String',
55
59
  :'destination' => :'String',
56
- :'gasless' => :'Boolean'
60
+ :'gasless' => :'Boolean',
61
+ :'skip_batching' => :'Boolean'
57
62
  }
58
63
  end
59
64
 
@@ -105,6 +110,10 @@ module Coinbase::Client
105
110
  if attributes.key?(:'gasless')
106
111
  self.gasless = attributes[:'gasless']
107
112
  end
113
+
114
+ if attributes.key?(:'skip_batching')
115
+ self.skip_batching = attributes[:'skip_batching']
116
+ end
108
117
  end
109
118
 
110
119
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -151,7 +160,8 @@ module Coinbase::Client
151
160
  network_id == o.network_id &&
152
161
  asset_id == o.asset_id &&
153
162
  destination == o.destination &&
154
- gasless == o.gasless
163
+ gasless == o.gasless &&
164
+ skip_batching == o.skip_batching
155
165
  end
156
166
 
157
167
  # @see the `==` method
@@ -163,7 +173,7 @@ module Coinbase::Client
163
173
  # Calculates hash code according to all attributes.
164
174
  # @return [Integer] Hash code
165
175
  def hash
166
- [amount, network_id, asset_id, destination, gasless].hash
176
+ [amount, network_id, asset_id, destination, gasless, skip_batching].hash
167
177
  end
168
178
 
169
179
  # Builds the object from hash
@@ -66,6 +66,9 @@ module Coinbase::Client
66
66
  # This is for handling optimism rollup specific EIP-2718 transaction type field.
67
67
  attr_accessor :mint
68
68
 
69
+ # RLP encoded transaction as a hex string (prefixed with 0x) for native compatibility with popular eth clients such as etherjs, viem etc.
70
+ attr_accessor :rlp_encoded_tx
71
+
69
72
  # Attribute mapping from ruby-style variable name to JSON key.
70
73
  def self.attribute_map
71
74
  {
@@ -86,7 +89,8 @@ module Coinbase::Client
86
89
  :'token_transfers' => :'token_transfers',
87
90
  :'flattened_traces' => :'flattened_traces',
88
91
  :'block_timestamp' => :'block_timestamp',
89
- :'mint' => :'mint'
92
+ :'mint' => :'mint',
93
+ :'rlp_encoded_tx' => :'rlp_encoded_tx'
90
94
  }
91
95
  end
92
96
 
@@ -115,7 +119,8 @@ module Coinbase::Client
115
119
  :'token_transfers' => :'Array<EthereumTokenTransfer>',
116
120
  :'flattened_traces' => :'Array<EthereumTransactionFlattenedTrace>',
117
121
  :'block_timestamp' => :'Time',
118
- :'mint' => :'String'
122
+ :'mint' => :'String',
123
+ :'rlp_encoded_tx' => :'String'
119
124
  }
120
125
  end
121
126
 
@@ -219,6 +224,10 @@ module Coinbase::Client
219
224
  if attributes.key?(:'mint')
220
225
  self.mint = attributes[:'mint']
221
226
  end
227
+
228
+ if attributes.key?(:'rlp_encoded_tx')
229
+ self.rlp_encoded_tx = attributes[:'rlp_encoded_tx']
230
+ end
222
231
  end
223
232
 
224
233
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -268,7 +277,8 @@ module Coinbase::Client
268
277
  token_transfers == o.token_transfers &&
269
278
  flattened_traces == o.flattened_traces &&
270
279
  block_timestamp == o.block_timestamp &&
271
- mint == o.mint
280
+ mint == o.mint &&
281
+ rlp_encoded_tx == o.rlp_encoded_tx
272
282
  end
273
283
 
274
284
  # @see the `==` method
@@ -280,7 +290,7 @@ module Coinbase::Client
280
290
  # Calculates hash code according to all attributes.
281
291
  # @return [Integer] Hash code
282
292
  def hash
283
- [from, gas, gas_price, hash, input, nonce, to, index, value, type, max_fee_per_gas, max_priority_fee_per_gas, priority_fee_per_gas, transaction_access_list, token_transfers, flattened_traces, block_timestamp, mint].hash
293
+ [from, gas, gas_price, hash, input, nonce, to, index, value, type, max_fee_per_gas, max_priority_fee_per_gas, priority_fee_per_gas, transaction_access_list, token_transfers, flattened_traces, block_timestamp, mint, rlp_encoded_tx].hash
284
294
  end
285
295
 
286
296
  # Builds the object from hash