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,216 @@
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.8.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Coinbase::Client
17
+ class EthereumTransactionAccessList
18
+ attr_accessor :access_list
19
+
20
+ # Attribute mapping from ruby-style variable name to JSON key.
21
+ def self.attribute_map
22
+ {
23
+ :'access_list' => :'access_list'
24
+ }
25
+ end
26
+
27
+ # Returns all the JSON keys this model knows about
28
+ def self.acceptable_attributes
29
+ attribute_map.values
30
+ end
31
+
32
+ # Attribute type mapping.
33
+ def self.openapi_types
34
+ {
35
+ :'access_list' => :'Array<EthereumTransactionAccess>'
36
+ }
37
+ end
38
+
39
+ # List of attributes with nullable: true
40
+ def self.openapi_nullable
41
+ Set.new([
42
+ ])
43
+ end
44
+
45
+ # Initializes the object
46
+ # @param [Hash] attributes Model attributes in the form of hash
47
+ def initialize(attributes = {})
48
+ if (!attributes.is_a?(Hash))
49
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Coinbase::Client::EthereumTransactionAccessList` initialize method"
50
+ end
51
+
52
+ # check to see if the attribute exists and convert string to symbol for hash key
53
+ attributes = attributes.each_with_object({}) { |(k, v), h|
54
+ if (!self.class.attribute_map.key?(k.to_sym))
55
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Coinbase::Client::EthereumTransactionAccessList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
56
+ end
57
+ h[k.to_sym] = v
58
+ }
59
+
60
+ if attributes.key?(:'access_list')
61
+ if (value = attributes[:'access_list']).is_a?(Array)
62
+ self.access_list = value
63
+ end
64
+ end
65
+ end
66
+
67
+ # Show invalid properties with the reasons. Usually used together with valid?
68
+ # @return Array for valid properties with the reasons
69
+ def list_invalid_properties
70
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
71
+ invalid_properties = Array.new
72
+ invalid_properties
73
+ end
74
+
75
+ # Check to see if the all the properties in the model are valid
76
+ # @return true if the model is valid
77
+ def valid?
78
+ warn '[DEPRECATED] the `valid?` method is obsolete'
79
+ true
80
+ end
81
+
82
+ # Checks equality by comparing each attribute.
83
+ # @param [Object] Object to be compared
84
+ def ==(o)
85
+ return true if self.equal?(o)
86
+ self.class == o.class &&
87
+ access_list == o.access_list
88
+ end
89
+
90
+ # @see the `==` method
91
+ # @param [Object] Object to be compared
92
+ def eql?(o)
93
+ self == o
94
+ end
95
+
96
+ # Calculates hash code according to all attributes.
97
+ # @return [Integer] Hash code
98
+ def hash
99
+ [access_list].hash
100
+ end
101
+
102
+ # Builds the object from hash
103
+ # @param [Hash] attributes Model attributes in the form of hash
104
+ # @return [Object] Returns the model itself
105
+ def self.build_from_hash(attributes)
106
+ return nil unless attributes.is_a?(Hash)
107
+ attributes = attributes.transform_keys(&:to_sym)
108
+ transformed_hash = {}
109
+ openapi_types.each_pair do |key, type|
110
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
111
+ transformed_hash["#{key}"] = nil
112
+ elsif type =~ /\AArray<(.*)>/i
113
+ # check to ensure the input is an array given that the attribute
114
+ # is documented as an array but the input is not
115
+ if attributes[attribute_map[key]].is_a?(Array)
116
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
117
+ end
118
+ elsif !attributes[attribute_map[key]].nil?
119
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
120
+ end
121
+ end
122
+ new(transformed_hash)
123
+ end
124
+
125
+ # Deserializes the data based on type
126
+ # @param string type Data type
127
+ # @param string value Value to be deserialized
128
+ # @return [Object] Deserialized data
129
+ def self._deserialize(type, value)
130
+ case type.to_sym
131
+ when :Time
132
+ Time.parse(value)
133
+ when :Date
134
+ Date.parse(value)
135
+ when :String
136
+ value.to_s
137
+ when :Integer
138
+ value.to_i
139
+ when :Float
140
+ value.to_f
141
+ when :Boolean
142
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
143
+ true
144
+ else
145
+ false
146
+ end
147
+ when :Object
148
+ # generic object (usually a Hash), return directly
149
+ value
150
+ when /\AArray<(?<inner_type>.+)>\z/
151
+ inner_type = Regexp.last_match[:inner_type]
152
+ value.map { |v| _deserialize(inner_type, v) }
153
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
154
+ k_type = Regexp.last_match[:k_type]
155
+ v_type = Regexp.last_match[:v_type]
156
+ {}.tap do |hash|
157
+ value.each do |k, v|
158
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
159
+ end
160
+ end
161
+ else # model
162
+ # models (e.g. Pet) or oneOf
163
+ klass = Coinbase::Client.const_get(type)
164
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
165
+ end
166
+ end
167
+
168
+ # Returns the string representation of the object
169
+ # @return [String] String presentation of the object
170
+ def to_s
171
+ to_hash.to_s
172
+ end
173
+
174
+ # to_body is an alias to to_hash (backward compatibility)
175
+ # @return [Hash] Returns the object in the form of hash
176
+ def to_body
177
+ to_hash
178
+ end
179
+
180
+ # Returns the object in the form of hash
181
+ # @return [Hash] Returns the object in the form of hash
182
+ def to_hash
183
+ hash = {}
184
+ self.class.attribute_map.each_pair do |attr, param|
185
+ value = self.send(attr)
186
+ if value.nil?
187
+ is_nullable = self.class.openapi_nullable.include?(attr)
188
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
189
+ end
190
+
191
+ hash[param] = _to_hash(value)
192
+ end
193
+ hash
194
+ end
195
+
196
+ # Outputs non-array value in the form of hash
197
+ # For object, use to_hash. Otherwise, just return the value
198
+ # @param [Object] value Any valid value
199
+ # @return [Hash] Returns the value in the form of hash
200
+ def _to_hash(value)
201
+ if value.is_a?(Array)
202
+ value.compact.map { |v| _to_hash(v) }
203
+ elsif value.is_a?(Hash)
204
+ {}.tap do |hash|
205
+ value.each { |k, v| hash[k] = _to_hash(v) }
206
+ end
207
+ elsif value.respond_to? :to_hash
208
+ value.to_hash
209
+ else
210
+ value
211
+ end
212
+ end
213
+
214
+ end
215
+
216
+ end
@@ -0,0 +1,378 @@
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.8.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Coinbase::Client
17
+ class EthereumTransactionFlattenedTrace
18
+ attr_accessor :error
19
+
20
+ attr_accessor :type
21
+
22
+ attr_accessor :from
23
+
24
+ attr_accessor :to
25
+
26
+ attr_accessor :value
27
+
28
+ attr_accessor :gas
29
+
30
+ attr_accessor :gas_used
31
+
32
+ attr_accessor :input
33
+
34
+ attr_accessor :output
35
+
36
+ attr_accessor :sub_traces
37
+
38
+ attr_accessor :trace_address
39
+
40
+ attr_accessor :trace_type
41
+
42
+ attr_accessor :call_type
43
+
44
+ attr_accessor :trace_id
45
+
46
+ attr_accessor :status
47
+
48
+ attr_accessor :block_hash
49
+
50
+ attr_accessor :block_number
51
+
52
+ attr_accessor :transaction_hash
53
+
54
+ attr_accessor :transaction_index
55
+
56
+ # Attribute mapping from ruby-style variable name to JSON key.
57
+ def self.attribute_map
58
+ {
59
+ :'error' => :'error',
60
+ :'type' => :'type',
61
+ :'from' => :'from',
62
+ :'to' => :'to',
63
+ :'value' => :'value',
64
+ :'gas' => :'gas',
65
+ :'gas_used' => :'gas_used',
66
+ :'input' => :'input',
67
+ :'output' => :'output',
68
+ :'sub_traces' => :'sub_traces',
69
+ :'trace_address' => :'trace_address',
70
+ :'trace_type' => :'trace_type',
71
+ :'call_type' => :'call_type',
72
+ :'trace_id' => :'trace_id',
73
+ :'status' => :'status',
74
+ :'block_hash' => :'block_hash',
75
+ :'block_number' => :'block_number',
76
+ :'transaction_hash' => :'transaction_hash',
77
+ :'transaction_index' => :'transaction_index'
78
+ }
79
+ end
80
+
81
+ # Returns all the JSON keys this model knows about
82
+ def self.acceptable_attributes
83
+ attribute_map.values
84
+ end
85
+
86
+ # Attribute type mapping.
87
+ def self.openapi_types
88
+ {
89
+ :'error' => :'String',
90
+ :'type' => :'String',
91
+ :'from' => :'String',
92
+ :'to' => :'String',
93
+ :'value' => :'String',
94
+ :'gas' => :'Integer',
95
+ :'gas_used' => :'Integer',
96
+ :'input' => :'String',
97
+ :'output' => :'String',
98
+ :'sub_traces' => :'Integer',
99
+ :'trace_address' => :'Array<Integer>',
100
+ :'trace_type' => :'String',
101
+ :'call_type' => :'String',
102
+ :'trace_id' => :'String',
103
+ :'status' => :'Integer',
104
+ :'block_hash' => :'String',
105
+ :'block_number' => :'Integer',
106
+ :'transaction_hash' => :'String',
107
+ :'transaction_index' => :'Integer'
108
+ }
109
+ end
110
+
111
+ # List of attributes with nullable: true
112
+ def self.openapi_nullable
113
+ Set.new([
114
+ ])
115
+ end
116
+
117
+ # Initializes the object
118
+ # @param [Hash] attributes Model attributes in the form of hash
119
+ def initialize(attributes = {})
120
+ if (!attributes.is_a?(Hash))
121
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Coinbase::Client::EthereumTransactionFlattenedTrace` initialize method"
122
+ end
123
+
124
+ # check to see if the attribute exists and convert string to symbol for hash key
125
+ attributes = attributes.each_with_object({}) { |(k, v), h|
126
+ if (!self.class.attribute_map.key?(k.to_sym))
127
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Coinbase::Client::EthereumTransactionFlattenedTrace`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
128
+ end
129
+ h[k.to_sym] = v
130
+ }
131
+
132
+ if attributes.key?(:'error')
133
+ self.error = attributes[:'error']
134
+ end
135
+
136
+ if attributes.key?(:'type')
137
+ self.type = attributes[:'type']
138
+ end
139
+
140
+ if attributes.key?(:'from')
141
+ self.from = attributes[:'from']
142
+ end
143
+
144
+ if attributes.key?(:'to')
145
+ self.to = attributes[:'to']
146
+ end
147
+
148
+ if attributes.key?(:'value')
149
+ self.value = attributes[:'value']
150
+ end
151
+
152
+ if attributes.key?(:'gas')
153
+ self.gas = attributes[:'gas']
154
+ end
155
+
156
+ if attributes.key?(:'gas_used')
157
+ self.gas_used = attributes[:'gas_used']
158
+ end
159
+
160
+ if attributes.key?(:'input')
161
+ self.input = attributes[:'input']
162
+ end
163
+
164
+ if attributes.key?(:'output')
165
+ self.output = attributes[:'output']
166
+ end
167
+
168
+ if attributes.key?(:'sub_traces')
169
+ self.sub_traces = attributes[:'sub_traces']
170
+ end
171
+
172
+ if attributes.key?(:'trace_address')
173
+ if (value = attributes[:'trace_address']).is_a?(Array)
174
+ self.trace_address = value
175
+ end
176
+ end
177
+
178
+ if attributes.key?(:'trace_type')
179
+ self.trace_type = attributes[:'trace_type']
180
+ end
181
+
182
+ if attributes.key?(:'call_type')
183
+ self.call_type = attributes[:'call_type']
184
+ end
185
+
186
+ if attributes.key?(:'trace_id')
187
+ self.trace_id = attributes[:'trace_id']
188
+ end
189
+
190
+ if attributes.key?(:'status')
191
+ self.status = attributes[:'status']
192
+ end
193
+
194
+ if attributes.key?(:'block_hash')
195
+ self.block_hash = attributes[:'block_hash']
196
+ end
197
+
198
+ if attributes.key?(:'block_number')
199
+ self.block_number = attributes[:'block_number']
200
+ end
201
+
202
+ if attributes.key?(:'transaction_hash')
203
+ self.transaction_hash = attributes[:'transaction_hash']
204
+ end
205
+
206
+ if attributes.key?(:'transaction_index')
207
+ self.transaction_index = attributes[:'transaction_index']
208
+ end
209
+ end
210
+
211
+ # Show invalid properties with the reasons. Usually used together with valid?
212
+ # @return Array for valid properties with the reasons
213
+ def list_invalid_properties
214
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
215
+ invalid_properties = Array.new
216
+ invalid_properties
217
+ end
218
+
219
+ # Check to see if the all the properties in the model are valid
220
+ # @return true if the model is valid
221
+ def valid?
222
+ warn '[DEPRECATED] the `valid?` method is obsolete'
223
+ true
224
+ end
225
+
226
+ # Checks equality by comparing each attribute.
227
+ # @param [Object] Object to be compared
228
+ def ==(o)
229
+ return true if self.equal?(o)
230
+ self.class == o.class &&
231
+ error == o.error &&
232
+ type == o.type &&
233
+ from == o.from &&
234
+ to == o.to &&
235
+ value == o.value &&
236
+ gas == o.gas &&
237
+ gas_used == o.gas_used &&
238
+ input == o.input &&
239
+ output == o.output &&
240
+ sub_traces == o.sub_traces &&
241
+ trace_address == o.trace_address &&
242
+ trace_type == o.trace_type &&
243
+ call_type == o.call_type &&
244
+ trace_id == o.trace_id &&
245
+ status == o.status &&
246
+ block_hash == o.block_hash &&
247
+ block_number == o.block_number &&
248
+ transaction_hash == o.transaction_hash &&
249
+ transaction_index == o.transaction_index
250
+ end
251
+
252
+ # @see the `==` method
253
+ # @param [Object] Object to be compared
254
+ def eql?(o)
255
+ self == o
256
+ end
257
+
258
+ # Calculates hash code according to all attributes.
259
+ # @return [Integer] Hash code
260
+ def hash
261
+ [error, type, from, to, value, gas, gas_used, input, output, sub_traces, trace_address, trace_type, call_type, trace_id, status, block_hash, block_number, transaction_hash, transaction_index].hash
262
+ end
263
+
264
+ # Builds the object from hash
265
+ # @param [Hash] attributes Model attributes in the form of hash
266
+ # @return [Object] Returns the model itself
267
+ def self.build_from_hash(attributes)
268
+ return nil unless attributes.is_a?(Hash)
269
+ attributes = attributes.transform_keys(&:to_sym)
270
+ transformed_hash = {}
271
+ openapi_types.each_pair do |key, type|
272
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
273
+ transformed_hash["#{key}"] = nil
274
+ elsif type =~ /\AArray<(.*)>/i
275
+ # check to ensure the input is an array given that the attribute
276
+ # is documented as an array but the input is not
277
+ if attributes[attribute_map[key]].is_a?(Array)
278
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
279
+ end
280
+ elsif !attributes[attribute_map[key]].nil?
281
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
282
+ end
283
+ end
284
+ new(transformed_hash)
285
+ end
286
+
287
+ # Deserializes the data based on type
288
+ # @param string type Data type
289
+ # @param string value Value to be deserialized
290
+ # @return [Object] Deserialized data
291
+ def self._deserialize(type, value)
292
+ case type.to_sym
293
+ when :Time
294
+ Time.parse(value)
295
+ when :Date
296
+ Date.parse(value)
297
+ when :String
298
+ value.to_s
299
+ when :Integer
300
+ value.to_i
301
+ when :Float
302
+ value.to_f
303
+ when :Boolean
304
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
305
+ true
306
+ else
307
+ false
308
+ end
309
+ when :Object
310
+ # generic object (usually a Hash), return directly
311
+ value
312
+ when /\AArray<(?<inner_type>.+)>\z/
313
+ inner_type = Regexp.last_match[:inner_type]
314
+ value.map { |v| _deserialize(inner_type, v) }
315
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
316
+ k_type = Regexp.last_match[:k_type]
317
+ v_type = Regexp.last_match[:v_type]
318
+ {}.tap do |hash|
319
+ value.each do |k, v|
320
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
321
+ end
322
+ end
323
+ else # model
324
+ # models (e.g. Pet) or oneOf
325
+ klass = Coinbase::Client.const_get(type)
326
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
327
+ end
328
+ end
329
+
330
+ # Returns the string representation of the object
331
+ # @return [String] String presentation of the object
332
+ def to_s
333
+ to_hash.to_s
334
+ end
335
+
336
+ # to_body is an alias to to_hash (backward compatibility)
337
+ # @return [Hash] Returns the object in the form of hash
338
+ def to_body
339
+ to_hash
340
+ end
341
+
342
+ # Returns the object in the form of hash
343
+ # @return [Hash] Returns the object in the form of hash
344
+ def to_hash
345
+ hash = {}
346
+ self.class.attribute_map.each_pair do |attr, param|
347
+ value = self.send(attr)
348
+ if value.nil?
349
+ is_nullable = self.class.openapi_nullable.include?(attr)
350
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
351
+ end
352
+
353
+ hash[param] = _to_hash(value)
354
+ end
355
+ hash
356
+ end
357
+
358
+ # Outputs non-array value in the form of hash
359
+ # For object, use to_hash. Otherwise, just return the value
360
+ # @param [Object] value Any valid value
361
+ # @return [Hash] Returns the value in the form of hash
362
+ def _to_hash(value)
363
+ if value.is_a?(Array)
364
+ value.compact.map { |v| _to_hash(v) }
365
+ elsif value.is_a?(Hash)
366
+ {}.tap do |hash|
367
+ value.each { |k, v| hash[k] = _to_hash(v) }
368
+ end
369
+ elsif value.respond_to? :to_hash
370
+ value.to_hash
371
+ else
372
+ value
373
+ end
374
+ end
375
+
376
+ end
377
+
378
+ end
@@ -4,9 +4,9 @@
4
4
  #This is the OpenAPI 3.0 specification for the Coinbase Platform APIs, used in conjunction with the Coinbase Platform SDKs.
5
5
 
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
- Contact: yuga.cohler@coinbase.com
7
+
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.7.0
9
+ Generator version: 7.8.0
10
10
 
11
11
  =end
12
12
 
@@ -4,9 +4,9 @@
4
4
  #This is the OpenAPI 3.0 specification for the Coinbase Platform APIs, used in conjunction with the Coinbase Platform SDKs.
5
5
 
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
- Contact: yuga.cohler@coinbase.com
7
+
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.7.0
9
+ Generator version: 7.8.0
10
10
 
11
11
  =end
12
12
 
@@ -4,9 +4,9 @@
4
4
  #This is the OpenAPI 3.0 specification for the Coinbase Platform APIs, used in conjunction with the Coinbase Platform SDKs.
5
5
 
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
- Contact: yuga.cohler@coinbase.com
7
+
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.7.0
9
+ Generator version: 7.8.0
10
10
 
11
11
  =end
12
12
 
@@ -4,9 +4,9 @@
4
4
  #This is the OpenAPI 3.0 specification for the Coinbase Platform APIs, used in conjunction with the Coinbase Platform SDKs.
5
5
 
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
- Contact: yuga.cohler@coinbase.com
7
+
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.7.0
9
+ Generator version: 7.8.0
10
10
 
11
11
  =end
12
12
 
@@ -4,9 +4,9 @@
4
4
  #This is the OpenAPI 3.0 specification for the Coinbase Platform APIs, used in conjunction with the Coinbase Platform SDKs.
5
5
 
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
- Contact: yuga.cohler@coinbase.com
7
+
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.7.0
9
+ Generator version: 7.8.0
10
10
 
11
11
  =end
12
12
 
@@ -4,9 +4,9 @@
4
4
  #This is the OpenAPI 3.0 specification for the Coinbase Platform APIs, used in conjunction with the Coinbase Platform SDKs.
5
5
 
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
- Contact: yuga.cohler@coinbase.com
7
+
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.7.0
9
+ Generator version: 7.8.0
10
10
 
11
11
  =end
12
12
 
@@ -4,9 +4,9 @@
4
4
  #This is the OpenAPI 3.0 specification for the Coinbase Platform APIs, used in conjunction with the Coinbase Platform SDKs.
5
5
 
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
- Contact: yuga.cohler@coinbase.com
7
+
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.7.0
9
+ Generator version: 7.8.0
10
10
 
11
11
  =end
12
12
 
@@ -4,9 +4,9 @@
4
4
  #This is the OpenAPI 3.0 specification for the Coinbase Platform APIs, used in conjunction with the Coinbase Platform SDKs.
5
5
 
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
- Contact: yuga.cohler@coinbase.com
7
+
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.7.0
9
+ Generator version: 7.8.0
10
10
 
11
11
  =end
12
12