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,276 @@
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 CreateContractInvocationRequest
18
+ # The address of the contract to invoke.
19
+ attr_accessor :contract_address
20
+
21
+ # The method to invoke on the contract.
22
+ attr_accessor :method
23
+
24
+ # The JSON-encoded arguments to pass to the contract method. The keys should be the argument names and the values should be the argument values.
25
+ attr_accessor :args
26
+
27
+ # The JSON-encoded ABI of the contract.
28
+ attr_accessor :abi
29
+
30
+ # The amount in atomic units of the native asset to send to the contract for a payable method
31
+ attr_accessor :amount
32
+
33
+ # Attribute mapping from ruby-style variable name to JSON key.
34
+ def self.attribute_map
35
+ {
36
+ :'contract_address' => :'contract_address',
37
+ :'method' => :'method',
38
+ :'args' => :'args',
39
+ :'abi' => :'abi',
40
+ :'amount' => :'amount'
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
+ :'contract_address' => :'String',
53
+ :'method' => :'String',
54
+ :'args' => :'String',
55
+ :'abi' => :'String',
56
+ :'amount' => :'String'
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::CreateContractInvocationRequest` 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::CreateContractInvocationRequest`. 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?(:'contract_address')
82
+ self.contract_address = attributes[:'contract_address']
83
+ else
84
+ self.contract_address = nil
85
+ end
86
+
87
+ if attributes.key?(:'method')
88
+ self.method = attributes[:'method']
89
+ else
90
+ self.method = nil
91
+ end
92
+
93
+ if attributes.key?(:'args')
94
+ self.args = attributes[:'args']
95
+ else
96
+ self.args = nil
97
+ end
98
+
99
+ if attributes.key?(:'abi')
100
+ self.abi = attributes[:'abi']
101
+ end
102
+
103
+ if attributes.key?(:'amount')
104
+ self.amount = attributes[:'amount']
105
+ end
106
+ end
107
+
108
+ # Show invalid properties with the reasons. Usually used together with valid?
109
+ # @return Array for valid properties with the reasons
110
+ def list_invalid_properties
111
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
112
+ invalid_properties = Array.new
113
+ if @contract_address.nil?
114
+ invalid_properties.push('invalid value for "contract_address", contract_address cannot be nil.')
115
+ end
116
+
117
+ if @method.nil?
118
+ invalid_properties.push('invalid value for "method", method cannot be nil.')
119
+ end
120
+
121
+ if @args.nil?
122
+ invalid_properties.push('invalid value for "args", args cannot be nil.')
123
+ end
124
+
125
+ invalid_properties
126
+ end
127
+
128
+ # Check to see if the all the properties in the model are valid
129
+ # @return true if the model is valid
130
+ def valid?
131
+ warn '[DEPRECATED] the `valid?` method is obsolete'
132
+ return false if @contract_address.nil?
133
+ return false if @method.nil?
134
+ return false if @args.nil?
135
+ true
136
+ end
137
+
138
+ # Checks equality by comparing each attribute.
139
+ # @param [Object] Object to be compared
140
+ def ==(o)
141
+ return true if self.equal?(o)
142
+ self.class == o.class &&
143
+ contract_address == o.contract_address &&
144
+ method == o.method &&
145
+ args == o.args &&
146
+ abi == o.abi &&
147
+ amount == o.amount
148
+ end
149
+
150
+ # @see the `==` method
151
+ # @param [Object] Object to be compared
152
+ def eql?(o)
153
+ self == o
154
+ end
155
+
156
+ # Calculates hash code according to all attributes.
157
+ # @return [Integer] Hash code
158
+ def hash
159
+ [contract_address, method, args, abi, amount].hash
160
+ end
161
+
162
+ # Builds the object from hash
163
+ # @param [Hash] attributes Model attributes in the form of hash
164
+ # @return [Object] Returns the model itself
165
+ def self.build_from_hash(attributes)
166
+ return nil unless attributes.is_a?(Hash)
167
+ attributes = attributes.transform_keys(&:to_sym)
168
+ transformed_hash = {}
169
+ openapi_types.each_pair do |key, type|
170
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
171
+ transformed_hash["#{key}"] = nil
172
+ elsif type =~ /\AArray<(.*)>/i
173
+ # check to ensure the input is an array given that the attribute
174
+ # is documented as an array but the input is not
175
+ if attributes[attribute_map[key]].is_a?(Array)
176
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
177
+ end
178
+ elsif !attributes[attribute_map[key]].nil?
179
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
180
+ end
181
+ end
182
+ new(transformed_hash)
183
+ end
184
+
185
+ # Deserializes the data based on type
186
+ # @param string type Data type
187
+ # @param string value Value to be deserialized
188
+ # @return [Object] Deserialized data
189
+ def self._deserialize(type, value)
190
+ case type.to_sym
191
+ when :Time
192
+ Time.parse(value)
193
+ when :Date
194
+ Date.parse(value)
195
+ when :String
196
+ value.to_s
197
+ when :Integer
198
+ value.to_i
199
+ when :Float
200
+ value.to_f
201
+ when :Boolean
202
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
203
+ true
204
+ else
205
+ false
206
+ end
207
+ when :Object
208
+ # generic object (usually a Hash), return directly
209
+ value
210
+ when /\AArray<(?<inner_type>.+)>\z/
211
+ inner_type = Regexp.last_match[:inner_type]
212
+ value.map { |v| _deserialize(inner_type, v) }
213
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
214
+ k_type = Regexp.last_match[:k_type]
215
+ v_type = Regexp.last_match[:v_type]
216
+ {}.tap do |hash|
217
+ value.each do |k, v|
218
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
219
+ end
220
+ end
221
+ else # model
222
+ # models (e.g. Pet) or oneOf
223
+ klass = Coinbase::Client.const_get(type)
224
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
225
+ end
226
+ end
227
+
228
+ # Returns the string representation of the object
229
+ # @return [String] String presentation of the object
230
+ def to_s
231
+ to_hash.to_s
232
+ end
233
+
234
+ # to_body is an alias to to_hash (backward compatibility)
235
+ # @return [Hash] Returns the object in the form of hash
236
+ def to_body
237
+ to_hash
238
+ end
239
+
240
+ # Returns the object in the form of hash
241
+ # @return [Hash] Returns the object in the form of hash
242
+ def to_hash
243
+ hash = {}
244
+ self.class.attribute_map.each_pair do |attr, param|
245
+ value = self.send(attr)
246
+ if value.nil?
247
+ is_nullable = self.class.openapi_nullable.include?(attr)
248
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
249
+ end
250
+
251
+ hash[param] = _to_hash(value)
252
+ end
253
+ hash
254
+ end
255
+
256
+ # Outputs non-array value in the form of hash
257
+ # For object, use to_hash. Otherwise, just return the value
258
+ # @param [Object] value Any valid value
259
+ # @return [Hash] Returns the value in the form of hash
260
+ def _to_hash(value)
261
+ if value.is_a?(Array)
262
+ value.compact.map { |v| _to_hash(v) }
263
+ elsif value.is_a?(Hash)
264
+ {}.tap do |hash|
265
+ value.each { |k, v| hash[k] = _to_hash(v) }
266
+ end
267
+ elsif value.respond_to? :to_hash
268
+ value.to_hash
269
+ else
270
+ value
271
+ end
272
+ end
273
+
274
+ end
275
+
276
+ end
@@ -0,0 +1,232 @@
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 CreatePayloadSignatureRequest
18
+ # The unsigned payload.
19
+ attr_accessor :unsigned_payload
20
+
21
+ # The signature of the payload.
22
+ attr_accessor :signature
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'unsigned_payload' => :'unsigned_payload',
28
+ :'signature' => :'signature'
29
+ }
30
+ end
31
+
32
+ # Returns all the JSON keys this model knows about
33
+ def self.acceptable_attributes
34
+ attribute_map.values
35
+ end
36
+
37
+ # Attribute type mapping.
38
+ def self.openapi_types
39
+ {
40
+ :'unsigned_payload' => :'String',
41
+ :'signature' => :'String'
42
+ }
43
+ end
44
+
45
+ # List of attributes with nullable: true
46
+ def self.openapi_nullable
47
+ Set.new([
48
+ ])
49
+ end
50
+
51
+ # Initializes the object
52
+ # @param [Hash] attributes Model attributes in the form of hash
53
+ def initialize(attributes = {})
54
+ if (!attributes.is_a?(Hash))
55
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Coinbase::Client::CreatePayloadSignatureRequest` initialize method"
56
+ end
57
+
58
+ # check to see if the attribute exists and convert string to symbol for hash key
59
+ attributes = attributes.each_with_object({}) { |(k, v), h|
60
+ if (!self.class.attribute_map.key?(k.to_sym))
61
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Coinbase::Client::CreatePayloadSignatureRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
62
+ end
63
+ h[k.to_sym] = v
64
+ }
65
+
66
+ if attributes.key?(:'unsigned_payload')
67
+ self.unsigned_payload = attributes[:'unsigned_payload']
68
+ else
69
+ self.unsigned_payload = nil
70
+ end
71
+
72
+ if attributes.key?(:'signature')
73
+ self.signature = attributes[:'signature']
74
+ end
75
+ end
76
+
77
+ # Show invalid properties with the reasons. Usually used together with valid?
78
+ # @return Array for valid properties with the reasons
79
+ def list_invalid_properties
80
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
81
+ invalid_properties = Array.new
82
+ if @unsigned_payload.nil?
83
+ invalid_properties.push('invalid value for "unsigned_payload", unsigned_payload cannot be nil.')
84
+ end
85
+
86
+ invalid_properties
87
+ end
88
+
89
+ # Check to see if the all the properties in the model are valid
90
+ # @return true if the model is valid
91
+ def valid?
92
+ warn '[DEPRECATED] the `valid?` method is obsolete'
93
+ return false if @unsigned_payload.nil?
94
+ true
95
+ end
96
+
97
+ # Checks equality by comparing each attribute.
98
+ # @param [Object] Object to be compared
99
+ def ==(o)
100
+ return true if self.equal?(o)
101
+ self.class == o.class &&
102
+ unsigned_payload == o.unsigned_payload &&
103
+ signature == o.signature
104
+ end
105
+
106
+ # @see the `==` method
107
+ # @param [Object] Object to be compared
108
+ def eql?(o)
109
+ self == o
110
+ end
111
+
112
+ # Calculates hash code according to all attributes.
113
+ # @return [Integer] Hash code
114
+ def hash
115
+ [unsigned_payload, signature].hash
116
+ end
117
+
118
+ # Builds the object from hash
119
+ # @param [Hash] attributes Model attributes in the form of hash
120
+ # @return [Object] Returns the model itself
121
+ def self.build_from_hash(attributes)
122
+ return nil unless attributes.is_a?(Hash)
123
+ attributes = attributes.transform_keys(&:to_sym)
124
+ transformed_hash = {}
125
+ openapi_types.each_pair do |key, type|
126
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
127
+ transformed_hash["#{key}"] = nil
128
+ elsif type =~ /\AArray<(.*)>/i
129
+ # check to ensure the input is an array given that the attribute
130
+ # is documented as an array but the input is not
131
+ if attributes[attribute_map[key]].is_a?(Array)
132
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
133
+ end
134
+ elsif !attributes[attribute_map[key]].nil?
135
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
136
+ end
137
+ end
138
+ new(transformed_hash)
139
+ end
140
+
141
+ # Deserializes the data based on type
142
+ # @param string type Data type
143
+ # @param string value Value to be deserialized
144
+ # @return [Object] Deserialized data
145
+ def self._deserialize(type, value)
146
+ case type.to_sym
147
+ when :Time
148
+ Time.parse(value)
149
+ when :Date
150
+ Date.parse(value)
151
+ when :String
152
+ value.to_s
153
+ when :Integer
154
+ value.to_i
155
+ when :Float
156
+ value.to_f
157
+ when :Boolean
158
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
159
+ true
160
+ else
161
+ false
162
+ end
163
+ when :Object
164
+ # generic object (usually a Hash), return directly
165
+ value
166
+ when /\AArray<(?<inner_type>.+)>\z/
167
+ inner_type = Regexp.last_match[:inner_type]
168
+ value.map { |v| _deserialize(inner_type, v) }
169
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
170
+ k_type = Regexp.last_match[:k_type]
171
+ v_type = Regexp.last_match[:v_type]
172
+ {}.tap do |hash|
173
+ value.each do |k, v|
174
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
175
+ end
176
+ end
177
+ else # model
178
+ # models (e.g. Pet) or oneOf
179
+ klass = Coinbase::Client.const_get(type)
180
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
181
+ end
182
+ end
183
+
184
+ # Returns the string representation of the object
185
+ # @return [String] String presentation of the object
186
+ def to_s
187
+ to_hash.to_s
188
+ end
189
+
190
+ # to_body is an alias to to_hash (backward compatibility)
191
+ # @return [Hash] Returns the object in the form of hash
192
+ def to_body
193
+ to_hash
194
+ end
195
+
196
+ # Returns the object in the form of hash
197
+ # @return [Hash] Returns the object in the form of hash
198
+ def to_hash
199
+ hash = {}
200
+ self.class.attribute_map.each_pair do |attr, param|
201
+ value = self.send(attr)
202
+ if value.nil?
203
+ is_nullable = self.class.openapi_nullable.include?(attr)
204
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
205
+ end
206
+
207
+ hash[param] = _to_hash(value)
208
+ end
209
+ hash
210
+ end
211
+
212
+ # Outputs non-array value in the form of hash
213
+ # For object, use to_hash. Otherwise, just return the value
214
+ # @param [Object] value Any valid value
215
+ # @return [Hash] Returns the value in the form of hash
216
+ def _to_hash(value)
217
+ if value.is_a?(Array)
218
+ value.compact.map { |v| _to_hash(v) }
219
+ elsif value.is_a?(Hash)
220
+ {}.tap do |hash|
221
+ value.each { |k, v| hash[k] = _to_hash(v) }
222
+ end
223
+ elsif value.respond_to? :to_hash
224
+ value.to_hash
225
+ else
226
+ value
227
+ end
228
+ end
229
+
230
+ end
231
+
232
+ 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
 
@@ -24,7 +24,7 @@ module Coinbase::Client
24
24
  # The ID of the asset to transfer
25
25
  attr_accessor :asset_id
26
26
 
27
- # The destination address
27
+ # The destination address, which can be a 0x address, Basename, or ENS name
28
28
  attr_accessor :destination
29
29
 
30
30
  # Whether the transfer uses sponsored gas
@@ -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
 
@@ -26,6 +26,9 @@ module Coinbase::Client
26
26
  # The URL to which the notifications will be sent
27
27
  attr_accessor :notification_uri
28
28
 
29
+ # The custom header to be used for x-webhook-signature header on callbacks, so developers can verify the requests are coming from Coinbase.
30
+ attr_accessor :signature_header
31
+
29
32
  class EnumAttributeValidator
30
33
  attr_reader :datatype
31
34
  attr_reader :allowable_values
@@ -54,7 +57,8 @@ module Coinbase::Client
54
57
  :'network_id' => :'network_id',
55
58
  :'event_type' => :'event_type',
56
59
  :'event_filters' => :'event_filters',
57
- :'notification_uri' => :'notification_uri'
60
+ :'notification_uri' => :'notification_uri',
61
+ :'signature_header' => :'signature_header'
58
62
  }
59
63
  end
60
64
 
@@ -69,7 +73,8 @@ module Coinbase::Client
69
73
  :'network_id' => :'String',
70
74
  :'event_type' => :'WebhookEventType',
71
75
  :'event_filters' => :'Array<WebhookEventFilter>',
72
- :'notification_uri' => :'String'
76
+ :'notification_uri' => :'String',
77
+ :'signature_header' => :'String'
73
78
  }
74
79
  end
75
80
 
@@ -102,12 +107,16 @@ module Coinbase::Client
102
107
 
103
108
  if attributes.key?(:'event_type')
104
109
  self.event_type = attributes[:'event_type']
110
+ else
111
+ self.event_type = nil
105
112
  end
106
113
 
107
114
  if attributes.key?(:'event_filters')
108
115
  if (value = attributes[:'event_filters']).is_a?(Array)
109
116
  self.event_filters = value
110
117
  end
118
+ else
119
+ self.event_filters = nil
111
120
  end
112
121
 
113
122
  if attributes.key?(:'notification_uri')
@@ -115,6 +124,10 @@ module Coinbase::Client
115
124
  else
116
125
  self.notification_uri = nil
117
126
  end
127
+
128
+ if attributes.key?(:'signature_header')
129
+ self.signature_header = attributes[:'signature_header']
130
+ end
118
131
  end
119
132
 
120
133
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -126,6 +139,14 @@ module Coinbase::Client
126
139
  invalid_properties.push('invalid value for "network_id", network_id cannot be nil.')
127
140
  end
128
141
 
142
+ if @event_type.nil?
143
+ invalid_properties.push('invalid value for "event_type", event_type cannot be nil.')
144
+ end
145
+
146
+ if @event_filters.nil?
147
+ invalid_properties.push('invalid value for "event_filters", event_filters cannot be nil.')
148
+ end
149
+
129
150
  if @notification_uri.nil?
130
151
  invalid_properties.push('invalid value for "notification_uri", notification_uri cannot be nil.')
131
152
  end
@@ -138,6 +159,8 @@ module Coinbase::Client
138
159
  def valid?
139
160
  warn '[DEPRECATED] the `valid?` method is obsolete'
140
161
  return false if @network_id.nil?
162
+ return false if @event_type.nil?
163
+ return false if @event_filters.nil?
141
164
  return false if @notification_uri.nil?
142
165
  true
143
166
  end
@@ -150,7 +173,8 @@ module Coinbase::Client
150
173
  network_id == o.network_id &&
151
174
  event_type == o.event_type &&
152
175
  event_filters == o.event_filters &&
153
- notification_uri == o.notification_uri
176
+ notification_uri == o.notification_uri &&
177
+ signature_header == o.signature_header
154
178
  end
155
179
 
156
180
  # @see the `==` method
@@ -162,7 +186,7 @@ module Coinbase::Client
162
186
  # Calculates hash code according to all attributes.
163
187
  # @return [Integer] Hash code
164
188
  def hash
165
- [network_id, event_type, event_filters, notification_uri].hash
189
+ [network_id, event_type, event_filters, notification_uri, signature_header].hash
166
190
  end
167
191
 
168
192
  # Builds the object from hash