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.
- checksums.yaml +4 -4
- data/lib/coinbase/address/wallet_address.rb +61 -0
- data/lib/coinbase/address.rb +25 -1
- data/lib/coinbase/client/api/addresses_api.rb +238 -8
- data/lib/coinbase/client/api/assets_api.rb +3 -3
- data/lib/coinbase/client/api/balance_history_api.rb +107 -0
- data/lib/coinbase/client/api/contract_events_api.rb +5 -5
- data/lib/coinbase/client/api/contract_invocations_api.rb +342 -0
- data/lib/coinbase/client/api/external_addresses_api.rb +24 -30
- data/lib/coinbase/client/api/networks_api.rb +3 -3
- data/lib/coinbase/client/api/server_signers_api.rb +8 -8
- data/lib/coinbase/client/api/stake_api.rb +7 -7
- data/lib/coinbase/client/api/trades_api.rb +6 -6
- data/lib/coinbase/client/api/transfers_api.rb +6 -6
- data/lib/coinbase/client/api/validators_api.rb +8 -8
- data/lib/coinbase/client/api/wallet_stake_api.rb +5 -5
- data/lib/coinbase/client/api/wallets_api.rb +11 -11
- data/lib/coinbase/client/api/webhooks_api.rb +6 -6
- data/lib/coinbase/client/api_client.rb +31 -25
- data/lib/coinbase/client/api_error.rb +2 -2
- data/lib/coinbase/client/configuration.rb +2 -2
- data/lib/coinbase/client/models/address.rb +2 -2
- data/lib/coinbase/client/models/address_balance_list.rb +2 -2
- data/lib/coinbase/client/models/address_historical_balance_list.rb +2 -2
- data/lib/coinbase/client/models/address_list.rb +2 -2
- data/lib/coinbase/client/models/address_transaction_list.rb +258 -0
- data/lib/coinbase/client/models/asset.rb +2 -2
- data/lib/coinbase/client/models/balance.rb +2 -2
- data/lib/coinbase/client/models/{user.rb → broadcast_contract_invocation_request.rb} +17 -26
- data/lib/coinbase/client/models/broadcast_staking_operation_request.rb +2 -2
- data/lib/coinbase/client/models/broadcast_trade_request.rb +2 -2
- data/lib/coinbase/client/models/broadcast_transfer_request.rb +2 -2
- data/lib/coinbase/client/models/build_staking_operation_request.rb +2 -2
- data/lib/coinbase/client/models/contract_event.rb +2 -2
- data/lib/coinbase/client/models/contract_event_list.rb +2 -2
- data/lib/coinbase/client/models/contract_invocation.rb +368 -0
- data/lib/coinbase/client/models/contract_invocation_list.rb +274 -0
- data/lib/coinbase/client/models/create_address_request.rb +2 -2
- data/lib/coinbase/client/models/create_contract_invocation_request.rb +276 -0
- data/lib/coinbase/client/models/create_payload_signature_request.rb +232 -0
- data/lib/coinbase/client/models/create_server_signer_request.rb +2 -2
- data/lib/coinbase/client/models/create_staking_operation_request.rb +2 -2
- data/lib/coinbase/client/models/create_trade_request.rb +2 -2
- data/lib/coinbase/client/models/create_transfer_request.rb +3 -3
- data/lib/coinbase/client/models/create_wallet_request.rb +2 -2
- data/lib/coinbase/client/models/create_wallet_request_wallet.rb +2 -2
- data/lib/coinbase/client/models/create_webhook_request.rb +30 -6
- data/lib/coinbase/client/models/erc20_transfer_event.rb +336 -0
- data/lib/coinbase/client/models/erc721_transfer_event.rb +336 -0
- data/lib/coinbase/client/models/error.rb +16 -6
- data/lib/coinbase/client/models/ethereum_transaction.rb +389 -0
- data/lib/coinbase/client/models/ethereum_transaction_access.rb +225 -0
- data/lib/coinbase/client/models/ethereum_transaction_access_list.rb +216 -0
- data/lib/coinbase/client/models/ethereum_transaction_flattened_trace.rb +378 -0
- data/lib/coinbase/client/models/ethereum_validator_metadata.rb +2 -2
- data/lib/coinbase/client/models/faucet_transaction.rb +2 -2
- data/lib/coinbase/client/models/feature_set.rb +2 -2
- data/lib/coinbase/client/models/fetch_historical_staking_balances200_response.rb +2 -2
- data/lib/coinbase/client/models/fetch_staking_rewards200_response.rb +2 -2
- data/lib/coinbase/client/models/fetch_staking_rewards_request.rb +2 -2
- data/lib/coinbase/client/models/get_staking_context_request.rb +2 -2
- data/lib/coinbase/client/models/historical_balance.rb +2 -2
- data/lib/coinbase/client/models/network.rb +4 -4
- data/lib/coinbase/client/models/network_identifier.rb +5 -3
- data/lib/coinbase/client/models/payload_signature.rb +335 -0
- data/lib/coinbase/client/models/payload_signature_list.rb +275 -0
- data/lib/coinbase/client/models/seed_creation_event.rb +2 -2
- data/lib/coinbase/client/models/seed_creation_event_result.rb +2 -2
- data/lib/coinbase/client/models/server_signer.rb +2 -2
- data/lib/coinbase/client/models/server_signer_event.rb +2 -2
- data/lib/coinbase/client/models/server_signer_event_event.rb +2 -2
- data/lib/coinbase/client/models/server_signer_event_list.rb +2 -2
- data/lib/coinbase/client/models/server_signer_list.rb +2 -2
- data/lib/coinbase/client/models/signature_creation_event.rb +2 -2
- data/lib/coinbase/client/models/signature_creation_event_result.rb +2 -2
- data/lib/coinbase/client/models/signed_voluntary_exit_message_metadata.rb +2 -2
- data/lib/coinbase/client/models/sponsored_send.rb +2 -2
- data/lib/coinbase/client/models/staking_balance.rb +2 -2
- data/lib/coinbase/client/models/staking_context.rb +2 -2
- data/lib/coinbase/client/models/staking_context_context.rb +2 -2
- data/lib/coinbase/client/models/staking_operation.rb +2 -2
- data/lib/coinbase/client/models/staking_operation_metadata.rb +2 -2
- data/lib/coinbase/client/models/staking_reward.rb +2 -2
- data/lib/coinbase/client/models/staking_reward_format.rb +2 -2
- data/lib/coinbase/client/models/staking_reward_usd_value.rb +2 -2
- data/lib/coinbase/client/models/trade.rb +2 -2
- data/lib/coinbase/client/models/trade_list.rb +2 -2
- data/lib/coinbase/client/models/transaction.rb +37 -8
- data/lib/coinbase/client/models/transaction_content.rb +104 -0
- data/lib/coinbase/client/models/transaction_type.rb +2 -2
- data/lib/coinbase/client/models/transfer.rb +2 -2
- data/lib/coinbase/client/models/transfer_list.rb +2 -2
- data/lib/coinbase/client/models/update_webhook_request.rb +3 -51
- data/lib/coinbase/client/models/validator.rb +2 -2
- data/lib/coinbase/client/models/validator_details.rb +2 -2
- data/lib/coinbase/client/models/validator_list.rb +2 -2
- data/lib/coinbase/client/models/validator_status.rb +2 -2
- data/lib/coinbase/client/models/wallet.rb +2 -2
- data/lib/coinbase/client/models/wallet_list.rb +2 -2
- data/lib/coinbase/client/models/webhook.rb +16 -6
- data/lib/coinbase/client/models/webhook_event_filter.rb +5 -5
- data/lib/coinbase/client/models/webhook_event_type.rb +2 -2
- data/lib/coinbase/client/models/webhook_list.rb +2 -2
- data/lib/coinbase/client/version.rb +2 -2
- data/lib/coinbase/client.rb +19 -4
- data/lib/coinbase/constants.rb +3 -0
- data/lib/coinbase/contract_invocation.rb +259 -0
- data/lib/coinbase/payload_signature.rb +181 -0
- data/lib/coinbase/transaction.rb +21 -0
- data/lib/coinbase/version.rb +1 -1
- data/lib/coinbase/wallet.rb +11 -1
- data/lib/coinbase/webhook.rb +17 -6
- data/lib/coinbase.rb +2 -0
- metadata +21 -5
- data/lib/coinbase/client/api/users_api.rb +0 -79
- data/lib/coinbase/client/models/feature.rb +0 -43
@@ -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
|
-
|
7
|
+
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
Generator version: 7.
|
9
|
+
Generator version: 7.8.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -203,7 +203,7 @@ module Coinbase::Client
|
|
203
203
|
return false if @display_name.nil?
|
204
204
|
return false if @chain_id.nil?
|
205
205
|
return false if @protocol_family.nil?
|
206
|
-
protocol_family_validator = EnumAttributeValidator.new('String', ["evm", "unknown_default_open_api"])
|
206
|
+
protocol_family_validator = EnumAttributeValidator.new('String', ["evm", "solana", "unknown_default_open_api"])
|
207
207
|
return false unless protocol_family_validator.valid?(@protocol_family)
|
208
208
|
return false if @is_testnet.nil?
|
209
209
|
return false if @native_asset.nil?
|
@@ -214,7 +214,7 @@ module Coinbase::Client
|
|
214
214
|
# Custom attribute writer method checking allowed values (enum).
|
215
215
|
# @param [Object] protocol_family Object to be assigned
|
216
216
|
def protocol_family=(protocol_family)
|
217
|
-
validator = EnumAttributeValidator.new('String', ["evm", "unknown_default_open_api"])
|
217
|
+
validator = EnumAttributeValidator.new('String', ["evm", "solana", "unknown_default_open_api"])
|
218
218
|
unless validator.valid?(protocol_family)
|
219
219
|
fail ArgumentError, "invalid value for \"protocol_family\", must be one of #{validator.allowable_values}."
|
220
220
|
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
|
-
|
7
|
+
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
Generator version: 7.
|
9
|
+
Generator version: 7.8.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|
@@ -20,10 +20,12 @@ module Coinbase::Client
|
|
20
20
|
ETHEREUM_HOLESKY = "ethereum-holesky".freeze
|
21
21
|
ETHEREUM_MAINNET = "ethereum-mainnet".freeze
|
22
22
|
POLYGON_MAINNET = "polygon-mainnet".freeze
|
23
|
+
SOLANA_DEVNET = "solana-devnet".freeze
|
24
|
+
ARBITRUM_MAINNET = "arbitrum-mainnet".freeze
|
23
25
|
UNKNOWN_DEFAULT_OPEN_API = "unknown_default_open_api".freeze
|
24
26
|
|
25
27
|
def self.all_vars
|
26
|
-
@all_vars ||= [BASE_SEPOLIA, BASE_MAINNET, ETHEREUM_HOLESKY, ETHEREUM_MAINNET, POLYGON_MAINNET, UNKNOWN_DEFAULT_OPEN_API].freeze
|
28
|
+
@all_vars ||= [BASE_SEPOLIA, BASE_MAINNET, ETHEREUM_HOLESKY, ETHEREUM_MAINNET, POLYGON_MAINNET, SOLANA_DEVNET, ARBITRUM_MAINNET, UNKNOWN_DEFAULT_OPEN_API].freeze
|
27
29
|
end
|
28
30
|
|
29
31
|
# Builds the enum from string
|
@@ -0,0 +1,335 @@
|
|
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
|
+
# A payload signed by an address.
|
18
|
+
class PayloadSignature
|
19
|
+
# The ID of the payload signature.
|
20
|
+
attr_accessor :payload_signature_id
|
21
|
+
|
22
|
+
# The ID of the wallet that owns the address.
|
23
|
+
attr_accessor :wallet_id
|
24
|
+
|
25
|
+
# The onchain address of the signer.
|
26
|
+
attr_accessor :address_id
|
27
|
+
|
28
|
+
# The unsigned payload. This is the payload that needs to be signed by the signer address.
|
29
|
+
attr_accessor :unsigned_payload
|
30
|
+
|
31
|
+
# The signature of the payload.
|
32
|
+
attr_accessor :signature
|
33
|
+
|
34
|
+
# The status of the payload signature.
|
35
|
+
attr_accessor :status
|
36
|
+
|
37
|
+
class EnumAttributeValidator
|
38
|
+
attr_reader :datatype
|
39
|
+
attr_reader :allowable_values
|
40
|
+
|
41
|
+
def initialize(datatype, allowable_values)
|
42
|
+
@allowable_values = allowable_values.map do |value|
|
43
|
+
case datatype.to_s
|
44
|
+
when /Integer/i
|
45
|
+
value.to_i
|
46
|
+
when /Float/i
|
47
|
+
value.to_f
|
48
|
+
else
|
49
|
+
value
|
50
|
+
end
|
51
|
+
end
|
52
|
+
end
|
53
|
+
|
54
|
+
def valid?(value)
|
55
|
+
!value || allowable_values.include?(value)
|
56
|
+
end
|
57
|
+
end
|
58
|
+
|
59
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
60
|
+
def self.attribute_map
|
61
|
+
{
|
62
|
+
:'payload_signature_id' => :'payload_signature_id',
|
63
|
+
:'wallet_id' => :'wallet_id',
|
64
|
+
:'address_id' => :'address_id',
|
65
|
+
:'unsigned_payload' => :'unsigned_payload',
|
66
|
+
:'signature' => :'signature',
|
67
|
+
:'status' => :'status'
|
68
|
+
}
|
69
|
+
end
|
70
|
+
|
71
|
+
# Returns all the JSON keys this model knows about
|
72
|
+
def self.acceptable_attributes
|
73
|
+
attribute_map.values
|
74
|
+
end
|
75
|
+
|
76
|
+
# Attribute type mapping.
|
77
|
+
def self.openapi_types
|
78
|
+
{
|
79
|
+
:'payload_signature_id' => :'String',
|
80
|
+
:'wallet_id' => :'String',
|
81
|
+
:'address_id' => :'String',
|
82
|
+
:'unsigned_payload' => :'String',
|
83
|
+
:'signature' => :'String',
|
84
|
+
:'status' => :'String'
|
85
|
+
}
|
86
|
+
end
|
87
|
+
|
88
|
+
# List of attributes with nullable: true
|
89
|
+
def self.openapi_nullable
|
90
|
+
Set.new([
|
91
|
+
])
|
92
|
+
end
|
93
|
+
|
94
|
+
# Initializes the object
|
95
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
96
|
+
def initialize(attributes = {})
|
97
|
+
if (!attributes.is_a?(Hash))
|
98
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Coinbase::Client::PayloadSignature` initialize method"
|
99
|
+
end
|
100
|
+
|
101
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
102
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
103
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
104
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Coinbase::Client::PayloadSignature`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
105
|
+
end
|
106
|
+
h[k.to_sym] = v
|
107
|
+
}
|
108
|
+
|
109
|
+
if attributes.key?(:'payload_signature_id')
|
110
|
+
self.payload_signature_id = attributes[:'payload_signature_id']
|
111
|
+
else
|
112
|
+
self.payload_signature_id = nil
|
113
|
+
end
|
114
|
+
|
115
|
+
if attributes.key?(:'wallet_id')
|
116
|
+
self.wallet_id = attributes[:'wallet_id']
|
117
|
+
else
|
118
|
+
self.wallet_id = nil
|
119
|
+
end
|
120
|
+
|
121
|
+
if attributes.key?(:'address_id')
|
122
|
+
self.address_id = attributes[:'address_id']
|
123
|
+
else
|
124
|
+
self.address_id = nil
|
125
|
+
end
|
126
|
+
|
127
|
+
if attributes.key?(:'unsigned_payload')
|
128
|
+
self.unsigned_payload = attributes[:'unsigned_payload']
|
129
|
+
else
|
130
|
+
self.unsigned_payload = nil
|
131
|
+
end
|
132
|
+
|
133
|
+
if attributes.key?(:'signature')
|
134
|
+
self.signature = attributes[:'signature']
|
135
|
+
end
|
136
|
+
|
137
|
+
if attributes.key?(:'status')
|
138
|
+
self.status = attributes[:'status']
|
139
|
+
else
|
140
|
+
self.status = nil
|
141
|
+
end
|
142
|
+
end
|
143
|
+
|
144
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
145
|
+
# @return Array for valid properties with the reasons
|
146
|
+
def list_invalid_properties
|
147
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
148
|
+
invalid_properties = Array.new
|
149
|
+
if @payload_signature_id.nil?
|
150
|
+
invalid_properties.push('invalid value for "payload_signature_id", payload_signature_id cannot be nil.')
|
151
|
+
end
|
152
|
+
|
153
|
+
if @wallet_id.nil?
|
154
|
+
invalid_properties.push('invalid value for "wallet_id", wallet_id cannot be nil.')
|
155
|
+
end
|
156
|
+
|
157
|
+
if @address_id.nil?
|
158
|
+
invalid_properties.push('invalid value for "address_id", address_id cannot be nil.')
|
159
|
+
end
|
160
|
+
|
161
|
+
if @unsigned_payload.nil?
|
162
|
+
invalid_properties.push('invalid value for "unsigned_payload", unsigned_payload cannot be nil.')
|
163
|
+
end
|
164
|
+
|
165
|
+
if @status.nil?
|
166
|
+
invalid_properties.push('invalid value for "status", status cannot be nil.')
|
167
|
+
end
|
168
|
+
|
169
|
+
invalid_properties
|
170
|
+
end
|
171
|
+
|
172
|
+
# Check to see if the all the properties in the model are valid
|
173
|
+
# @return true if the model is valid
|
174
|
+
def valid?
|
175
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
176
|
+
return false if @payload_signature_id.nil?
|
177
|
+
return false if @wallet_id.nil?
|
178
|
+
return false if @address_id.nil?
|
179
|
+
return false if @unsigned_payload.nil?
|
180
|
+
return false if @status.nil?
|
181
|
+
status_validator = EnumAttributeValidator.new('String', ["pending", "signed", "failed", "unknown_default_open_api"])
|
182
|
+
return false unless status_validator.valid?(@status)
|
183
|
+
true
|
184
|
+
end
|
185
|
+
|
186
|
+
# Custom attribute writer method checking allowed values (enum).
|
187
|
+
# @param [Object] status Object to be assigned
|
188
|
+
def status=(status)
|
189
|
+
validator = EnumAttributeValidator.new('String', ["pending", "signed", "failed", "unknown_default_open_api"])
|
190
|
+
unless validator.valid?(status)
|
191
|
+
fail ArgumentError, "invalid value for \"status\", must be one of #{validator.allowable_values}."
|
192
|
+
end
|
193
|
+
@status = status
|
194
|
+
end
|
195
|
+
|
196
|
+
# Checks equality by comparing each attribute.
|
197
|
+
# @param [Object] Object to be compared
|
198
|
+
def ==(o)
|
199
|
+
return true if self.equal?(o)
|
200
|
+
self.class == o.class &&
|
201
|
+
payload_signature_id == o.payload_signature_id &&
|
202
|
+
wallet_id == o.wallet_id &&
|
203
|
+
address_id == o.address_id &&
|
204
|
+
unsigned_payload == o.unsigned_payload &&
|
205
|
+
signature == o.signature &&
|
206
|
+
status == o.status
|
207
|
+
end
|
208
|
+
|
209
|
+
# @see the `==` method
|
210
|
+
# @param [Object] Object to be compared
|
211
|
+
def eql?(o)
|
212
|
+
self == o
|
213
|
+
end
|
214
|
+
|
215
|
+
# Calculates hash code according to all attributes.
|
216
|
+
# @return [Integer] Hash code
|
217
|
+
def hash
|
218
|
+
[payload_signature_id, wallet_id, address_id, unsigned_payload, signature, status].hash
|
219
|
+
end
|
220
|
+
|
221
|
+
# Builds the object from hash
|
222
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
223
|
+
# @return [Object] Returns the model itself
|
224
|
+
def self.build_from_hash(attributes)
|
225
|
+
return nil unless attributes.is_a?(Hash)
|
226
|
+
attributes = attributes.transform_keys(&:to_sym)
|
227
|
+
transformed_hash = {}
|
228
|
+
openapi_types.each_pair do |key, type|
|
229
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
230
|
+
transformed_hash["#{key}"] = nil
|
231
|
+
elsif type =~ /\AArray<(.*)>/i
|
232
|
+
# check to ensure the input is an array given that the attribute
|
233
|
+
# is documented as an array but the input is not
|
234
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
235
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
236
|
+
end
|
237
|
+
elsif !attributes[attribute_map[key]].nil?
|
238
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
239
|
+
end
|
240
|
+
end
|
241
|
+
new(transformed_hash)
|
242
|
+
end
|
243
|
+
|
244
|
+
# Deserializes the data based on type
|
245
|
+
# @param string type Data type
|
246
|
+
# @param string value Value to be deserialized
|
247
|
+
# @return [Object] Deserialized data
|
248
|
+
def self._deserialize(type, value)
|
249
|
+
case type.to_sym
|
250
|
+
when :Time
|
251
|
+
Time.parse(value)
|
252
|
+
when :Date
|
253
|
+
Date.parse(value)
|
254
|
+
when :String
|
255
|
+
value.to_s
|
256
|
+
when :Integer
|
257
|
+
value.to_i
|
258
|
+
when :Float
|
259
|
+
value.to_f
|
260
|
+
when :Boolean
|
261
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
262
|
+
true
|
263
|
+
else
|
264
|
+
false
|
265
|
+
end
|
266
|
+
when :Object
|
267
|
+
# generic object (usually a Hash), return directly
|
268
|
+
value
|
269
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
270
|
+
inner_type = Regexp.last_match[:inner_type]
|
271
|
+
value.map { |v| _deserialize(inner_type, v) }
|
272
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
273
|
+
k_type = Regexp.last_match[:k_type]
|
274
|
+
v_type = Regexp.last_match[:v_type]
|
275
|
+
{}.tap do |hash|
|
276
|
+
value.each do |k, v|
|
277
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
278
|
+
end
|
279
|
+
end
|
280
|
+
else # model
|
281
|
+
# models (e.g. Pet) or oneOf
|
282
|
+
klass = Coinbase::Client.const_get(type)
|
283
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
284
|
+
end
|
285
|
+
end
|
286
|
+
|
287
|
+
# Returns the string representation of the object
|
288
|
+
# @return [String] String presentation of the object
|
289
|
+
def to_s
|
290
|
+
to_hash.to_s
|
291
|
+
end
|
292
|
+
|
293
|
+
# to_body is an alias to to_hash (backward compatibility)
|
294
|
+
# @return [Hash] Returns the object in the form of hash
|
295
|
+
def to_body
|
296
|
+
to_hash
|
297
|
+
end
|
298
|
+
|
299
|
+
# Returns the object in the form of hash
|
300
|
+
# @return [Hash] Returns the object in the form of hash
|
301
|
+
def to_hash
|
302
|
+
hash = {}
|
303
|
+
self.class.attribute_map.each_pair do |attr, param|
|
304
|
+
value = self.send(attr)
|
305
|
+
if value.nil?
|
306
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
307
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
308
|
+
end
|
309
|
+
|
310
|
+
hash[param] = _to_hash(value)
|
311
|
+
end
|
312
|
+
hash
|
313
|
+
end
|
314
|
+
|
315
|
+
# Outputs non-array value in the form of hash
|
316
|
+
# For object, use to_hash. Otherwise, just return the value
|
317
|
+
# @param [Object] value Any valid value
|
318
|
+
# @return [Hash] Returns the value in the form of hash
|
319
|
+
def _to_hash(value)
|
320
|
+
if value.is_a?(Array)
|
321
|
+
value.compact.map { |v| _to_hash(v) }
|
322
|
+
elsif value.is_a?(Hash)
|
323
|
+
{}.tap do |hash|
|
324
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
325
|
+
end
|
326
|
+
elsif value.respond_to? :to_hash
|
327
|
+
value.to_hash
|
328
|
+
else
|
329
|
+
value
|
330
|
+
end
|
331
|
+
end
|
332
|
+
|
333
|
+
end
|
334
|
+
|
335
|
+
end
|
@@ -0,0 +1,275 @@
|
|
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
|
+
#
|
18
|
+
class PayloadSignatureList
|
19
|
+
attr_accessor :data
|
20
|
+
|
21
|
+
# True if this list has another page of items after this one that can be fetched.
|
22
|
+
attr_accessor :has_more
|
23
|
+
|
24
|
+
# The page token to be used to fetch the next page.
|
25
|
+
attr_accessor :next_page
|
26
|
+
|
27
|
+
# The total number of payload signatures for the address.
|
28
|
+
attr_accessor :total_count
|
29
|
+
|
30
|
+
# Attribute mapping from ruby-style variable name to JSON key.
|
31
|
+
def self.attribute_map
|
32
|
+
{
|
33
|
+
:'data' => :'data',
|
34
|
+
:'has_more' => :'has_more',
|
35
|
+
:'next_page' => :'next_page',
|
36
|
+
:'total_count' => :'total_count'
|
37
|
+
}
|
38
|
+
end
|
39
|
+
|
40
|
+
# Returns all the JSON keys this model knows about
|
41
|
+
def self.acceptable_attributes
|
42
|
+
attribute_map.values
|
43
|
+
end
|
44
|
+
|
45
|
+
# Attribute type mapping.
|
46
|
+
def self.openapi_types
|
47
|
+
{
|
48
|
+
:'data' => :'Array<PayloadSignature>',
|
49
|
+
:'has_more' => :'Boolean',
|
50
|
+
:'next_page' => :'String',
|
51
|
+
:'total_count' => :'Integer'
|
52
|
+
}
|
53
|
+
end
|
54
|
+
|
55
|
+
# List of attributes with nullable: true
|
56
|
+
def self.openapi_nullable
|
57
|
+
Set.new([
|
58
|
+
])
|
59
|
+
end
|
60
|
+
|
61
|
+
# Initializes the object
|
62
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
63
|
+
def initialize(attributes = {})
|
64
|
+
if (!attributes.is_a?(Hash))
|
65
|
+
fail ArgumentError, "The input argument (attributes) must be a hash in `Coinbase::Client::PayloadSignatureList` initialize method"
|
66
|
+
end
|
67
|
+
|
68
|
+
# check to see if the attribute exists and convert string to symbol for hash key
|
69
|
+
attributes = attributes.each_with_object({}) { |(k, v), h|
|
70
|
+
if (!self.class.attribute_map.key?(k.to_sym))
|
71
|
+
fail ArgumentError, "`#{k}` is not a valid attribute in `Coinbase::Client::PayloadSignatureList`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
|
72
|
+
end
|
73
|
+
h[k.to_sym] = v
|
74
|
+
}
|
75
|
+
|
76
|
+
if attributes.key?(:'data')
|
77
|
+
if (value = attributes[:'data']).is_a?(Array)
|
78
|
+
self.data = value
|
79
|
+
end
|
80
|
+
else
|
81
|
+
self.data = nil
|
82
|
+
end
|
83
|
+
|
84
|
+
if attributes.key?(:'has_more')
|
85
|
+
self.has_more = attributes[:'has_more']
|
86
|
+
else
|
87
|
+
self.has_more = nil
|
88
|
+
end
|
89
|
+
|
90
|
+
if attributes.key?(:'next_page')
|
91
|
+
self.next_page = attributes[:'next_page']
|
92
|
+
else
|
93
|
+
self.next_page = nil
|
94
|
+
end
|
95
|
+
|
96
|
+
if attributes.key?(:'total_count')
|
97
|
+
self.total_count = attributes[:'total_count']
|
98
|
+
else
|
99
|
+
self.total_count = nil
|
100
|
+
end
|
101
|
+
end
|
102
|
+
|
103
|
+
# Show invalid properties with the reasons. Usually used together with valid?
|
104
|
+
# @return Array for valid properties with the reasons
|
105
|
+
def list_invalid_properties
|
106
|
+
warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
|
107
|
+
invalid_properties = Array.new
|
108
|
+
if @data.nil?
|
109
|
+
invalid_properties.push('invalid value for "data", data cannot be nil.')
|
110
|
+
end
|
111
|
+
|
112
|
+
if @has_more.nil?
|
113
|
+
invalid_properties.push('invalid value for "has_more", has_more cannot be nil.')
|
114
|
+
end
|
115
|
+
|
116
|
+
if @next_page.nil?
|
117
|
+
invalid_properties.push('invalid value for "next_page", next_page cannot be nil.')
|
118
|
+
end
|
119
|
+
|
120
|
+
if @total_count.nil?
|
121
|
+
invalid_properties.push('invalid value for "total_count", total_count cannot be nil.')
|
122
|
+
end
|
123
|
+
|
124
|
+
invalid_properties
|
125
|
+
end
|
126
|
+
|
127
|
+
# Check to see if the all the properties in the model are valid
|
128
|
+
# @return true if the model is valid
|
129
|
+
def valid?
|
130
|
+
warn '[DEPRECATED] the `valid?` method is obsolete'
|
131
|
+
return false if @data.nil?
|
132
|
+
return false if @has_more.nil?
|
133
|
+
return false if @next_page.nil?
|
134
|
+
return false if @total_count.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
|
+
data == o.data &&
|
144
|
+
has_more == o.has_more &&
|
145
|
+
next_page == o.next_page &&
|
146
|
+
total_count == o.total_count
|
147
|
+
end
|
148
|
+
|
149
|
+
# @see the `==` method
|
150
|
+
# @param [Object] Object to be compared
|
151
|
+
def eql?(o)
|
152
|
+
self == o
|
153
|
+
end
|
154
|
+
|
155
|
+
# Calculates hash code according to all attributes.
|
156
|
+
# @return [Integer] Hash code
|
157
|
+
def hash
|
158
|
+
[data, has_more, next_page, total_count].hash
|
159
|
+
end
|
160
|
+
|
161
|
+
# Builds the object from hash
|
162
|
+
# @param [Hash] attributes Model attributes in the form of hash
|
163
|
+
# @return [Object] Returns the model itself
|
164
|
+
def self.build_from_hash(attributes)
|
165
|
+
return nil unless attributes.is_a?(Hash)
|
166
|
+
attributes = attributes.transform_keys(&:to_sym)
|
167
|
+
transformed_hash = {}
|
168
|
+
openapi_types.each_pair do |key, type|
|
169
|
+
if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
|
170
|
+
transformed_hash["#{key}"] = nil
|
171
|
+
elsif type =~ /\AArray<(.*)>/i
|
172
|
+
# check to ensure the input is an array given that the attribute
|
173
|
+
# is documented as an array but the input is not
|
174
|
+
if attributes[attribute_map[key]].is_a?(Array)
|
175
|
+
transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
|
176
|
+
end
|
177
|
+
elsif !attributes[attribute_map[key]].nil?
|
178
|
+
transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
|
179
|
+
end
|
180
|
+
end
|
181
|
+
new(transformed_hash)
|
182
|
+
end
|
183
|
+
|
184
|
+
# Deserializes the data based on type
|
185
|
+
# @param string type Data type
|
186
|
+
# @param string value Value to be deserialized
|
187
|
+
# @return [Object] Deserialized data
|
188
|
+
def self._deserialize(type, value)
|
189
|
+
case type.to_sym
|
190
|
+
when :Time
|
191
|
+
Time.parse(value)
|
192
|
+
when :Date
|
193
|
+
Date.parse(value)
|
194
|
+
when :String
|
195
|
+
value.to_s
|
196
|
+
when :Integer
|
197
|
+
value.to_i
|
198
|
+
when :Float
|
199
|
+
value.to_f
|
200
|
+
when :Boolean
|
201
|
+
if value.to_s =~ /\A(true|t|yes|y|1)\z/i
|
202
|
+
true
|
203
|
+
else
|
204
|
+
false
|
205
|
+
end
|
206
|
+
when :Object
|
207
|
+
# generic object (usually a Hash), return directly
|
208
|
+
value
|
209
|
+
when /\AArray<(?<inner_type>.+)>\z/
|
210
|
+
inner_type = Regexp.last_match[:inner_type]
|
211
|
+
value.map { |v| _deserialize(inner_type, v) }
|
212
|
+
when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
|
213
|
+
k_type = Regexp.last_match[:k_type]
|
214
|
+
v_type = Regexp.last_match[:v_type]
|
215
|
+
{}.tap do |hash|
|
216
|
+
value.each do |k, v|
|
217
|
+
hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
|
218
|
+
end
|
219
|
+
end
|
220
|
+
else # model
|
221
|
+
# models (e.g. Pet) or oneOf
|
222
|
+
klass = Coinbase::Client.const_get(type)
|
223
|
+
klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
|
224
|
+
end
|
225
|
+
end
|
226
|
+
|
227
|
+
# Returns the string representation of the object
|
228
|
+
# @return [String] String presentation of the object
|
229
|
+
def to_s
|
230
|
+
to_hash.to_s
|
231
|
+
end
|
232
|
+
|
233
|
+
# to_body is an alias to to_hash (backward compatibility)
|
234
|
+
# @return [Hash] Returns the object in the form of hash
|
235
|
+
def to_body
|
236
|
+
to_hash
|
237
|
+
end
|
238
|
+
|
239
|
+
# Returns the object in the form of hash
|
240
|
+
# @return [Hash] Returns the object in the form of hash
|
241
|
+
def to_hash
|
242
|
+
hash = {}
|
243
|
+
self.class.attribute_map.each_pair do |attr, param|
|
244
|
+
value = self.send(attr)
|
245
|
+
if value.nil?
|
246
|
+
is_nullable = self.class.openapi_nullable.include?(attr)
|
247
|
+
next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
|
248
|
+
end
|
249
|
+
|
250
|
+
hash[param] = _to_hash(value)
|
251
|
+
end
|
252
|
+
hash
|
253
|
+
end
|
254
|
+
|
255
|
+
# Outputs non-array value in the form of hash
|
256
|
+
# For object, use to_hash. Otherwise, just return the value
|
257
|
+
# @param [Object] value Any valid value
|
258
|
+
# @return [Hash] Returns the value in the form of hash
|
259
|
+
def _to_hash(value)
|
260
|
+
if value.is_a?(Array)
|
261
|
+
value.compact.map { |v| _to_hash(v) }
|
262
|
+
elsif value.is_a?(Hash)
|
263
|
+
{}.tap do |hash|
|
264
|
+
value.each { |k, v| hash[k] = _to_hash(v) }
|
265
|
+
end
|
266
|
+
elsif value.respond_to? :to_hash
|
267
|
+
value.to_hash
|
268
|
+
else
|
269
|
+
value
|
270
|
+
end
|
271
|
+
end
|
272
|
+
|
273
|
+
end
|
274
|
+
|
275
|
+
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
|
-
|
7
|
+
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
Generator version: 7.
|
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
|
-
|
7
|
+
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
Generator version: 7.
|
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
|
-
|
7
|
+
|
8
8
|
Generated by: https://openapi-generator.tech
|
9
|
-
Generator version: 7.
|
9
|
+
Generator version: 7.8.0
|
10
10
|
|
11
11
|
=end
|
12
12
|
|