coinbase-sdk 0.10.0 → 0.13.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (160) hide show
  1. checksums.yaml +4 -4
  2. data/lib/coinbase/address/wallet_address.rb +28 -0
  3. data/lib/coinbase/address.rb +22 -3
  4. data/lib/coinbase/address_reputation.rb +67 -0
  5. data/lib/coinbase/balance.rb +1 -1
  6. data/lib/coinbase/client/api/addresses_api.rb +10 -10
  7. data/lib/coinbase/client/api/assets_api.rb +2 -2
  8. data/lib/coinbase/client/api/balance_history_api.rb +2 -2
  9. data/lib/coinbase/client/api/contract_events_api.rb +2 -2
  10. data/lib/coinbase/client/api/contract_invocations_api.rb +5 -5
  11. data/lib/coinbase/client/api/external_addresses_api.rb +246 -5
  12. data/lib/coinbase/client/api/fund_api.rb +5 -5
  13. data/lib/coinbase/client/api/{wallet_stake_api.rb → mpc_wallet_stake_api.rb} +24 -24
  14. data/lib/coinbase/client/api/networks_api.rb +2 -2
  15. data/lib/coinbase/client/api/onchain_identity_api.rb +2 -2
  16. data/lib/coinbase/client/api/reputation_api.rb +91 -0
  17. data/lib/coinbase/client/api/server_signers_api.rb +7 -7
  18. data/lib/coinbase/client/api/smart_contracts_api.rb +169 -26
  19. data/lib/coinbase/client/api/stake_api.rb +163 -6
  20. data/lib/coinbase/client/api/trades_api.rb +5 -5
  21. data/lib/coinbase/client/api/transaction_history_api.rb +2 -2
  22. data/lib/coinbase/client/api/transfers_api.rb +14 -14
  23. data/lib/coinbase/client/api/users_api.rb +1 -1
  24. data/lib/coinbase/client/api/wallets_api.rb +6 -6
  25. data/lib/coinbase/client/api/webhooks_api.rb +6 -6
  26. data/lib/coinbase/client/api_client.rb +1 -1
  27. data/lib/coinbase/client/api_error.rb +1 -1
  28. data/lib/coinbase/client/configuration.rb +15 -1
  29. data/lib/coinbase/client/models/address.rb +1 -1
  30. data/lib/coinbase/client/models/address_balance_list.rb +1 -1
  31. data/lib/coinbase/client/models/address_historical_balance_list.rb +1 -1
  32. data/lib/coinbase/client/models/address_list.rb +1 -1
  33. data/lib/coinbase/client/models/address_reputation.rb +239 -0
  34. data/lib/coinbase/client/models/address_reputation_metadata.rb +376 -0
  35. data/lib/coinbase/client/models/address_transaction_list.rb +1 -1
  36. data/lib/coinbase/client/models/asset.rb +1 -1
  37. data/lib/coinbase/client/models/balance.rb +1 -1
  38. data/lib/coinbase/client/models/broadcast_contract_invocation_request.rb +1 -1
  39. data/lib/coinbase/client/models/{broadcast_transfer_request.rb → broadcast_external_transfer_request.rb} +4 -4
  40. data/lib/coinbase/client/models/broadcast_staking_operation_request.rb +1 -1
  41. data/lib/coinbase/client/models/broadcast_trade_request.rb +1 -1
  42. data/lib/coinbase/client/models/build_staking_operation_request.rb +2 -1
  43. data/lib/coinbase/client/models/contract_event.rb +1 -1
  44. data/lib/coinbase/client/models/contract_event_list.rb +1 -1
  45. data/lib/coinbase/client/models/contract_invocation.rb +1 -1
  46. data/lib/coinbase/client/models/contract_invocation_list.rb +1 -1
  47. data/lib/coinbase/client/models/create_address_request.rb +1 -1
  48. data/lib/coinbase/client/models/create_contract_invocation_request.rb +1 -1
  49. data/lib/coinbase/client/models/create_external_transfer_request.rb +273 -0
  50. data/lib/coinbase/client/models/create_fund_operation_request.rb +2 -2
  51. data/lib/coinbase/client/models/create_fund_quote_request.rb +2 -2
  52. data/lib/coinbase/client/models/create_payload_signature_request.rb +1 -1
  53. data/lib/coinbase/client/models/create_server_signer_request.rb +1 -1
  54. data/lib/coinbase/client/models/create_smart_contract_request.rb +1 -1
  55. data/lib/coinbase/client/models/create_staking_operation_request.rb +2 -1
  56. data/lib/coinbase/client/models/create_trade_request.rb +1 -1
  57. data/lib/coinbase/client/models/create_transfer_request.rb +2 -2
  58. data/lib/coinbase/client/models/create_wallet_request.rb +1 -1
  59. data/lib/coinbase/client/models/create_wallet_request_wallet.rb +1 -1
  60. data/lib/coinbase/client/models/create_wallet_webhook_request.rb +1 -1
  61. data/lib/coinbase/client/models/create_webhook_request.rb +1 -1
  62. data/lib/coinbase/client/models/crypto_amount.rb +1 -1
  63. data/lib/coinbase/client/models/deploy_smart_contract_request.rb +1 -1
  64. data/lib/coinbase/client/models/erc20_transfer_event.rb +1 -1
  65. data/lib/coinbase/client/models/erc721_transfer_event.rb +1 -1
  66. data/lib/coinbase/client/models/error.rb +1 -1
  67. data/lib/coinbase/client/models/ethereum_token_transfer.rb +1 -1
  68. data/lib/coinbase/client/models/ethereum_transaction.rb +15 -5
  69. data/lib/coinbase/client/models/ethereum_transaction_access.rb +1 -1
  70. data/lib/coinbase/client/models/ethereum_transaction_access_list.rb +1 -1
  71. data/lib/coinbase/client/models/ethereum_transaction_flattened_trace.rb +1 -1
  72. data/lib/coinbase/client/models/ethereum_validator_metadata.rb +1 -1
  73. data/lib/coinbase/client/models/faucet_transaction.rb +1 -1
  74. data/lib/coinbase/client/models/feature_set.rb +1 -1
  75. data/lib/coinbase/client/models/fetch_historical_staking_balances200_response.rb +1 -1
  76. data/lib/coinbase/client/models/fetch_staking_rewards200_response.rb +1 -1
  77. data/lib/coinbase/client/models/fetch_staking_rewards_request.rb +1 -1
  78. data/lib/coinbase/client/models/fiat_amount.rb +1 -1
  79. data/lib/coinbase/client/models/fund_operation.rb +1 -1
  80. data/lib/coinbase/client/models/fund_operation_fees.rb +1 -1
  81. data/lib/coinbase/client/models/fund_operation_list.rb +1 -1
  82. data/lib/coinbase/client/models/fund_quote.rb +1 -1
  83. data/lib/coinbase/client/models/get_staking_context_request.rb +2 -1
  84. data/lib/coinbase/client/models/historical_balance.rb +1 -1
  85. data/lib/coinbase/client/models/multi_token_contract_options.rb +1 -1
  86. data/lib/coinbase/client/models/network.rb +1 -1
  87. data/lib/coinbase/client/models/network_identifier.rb +1 -1
  88. data/lib/coinbase/client/models/nft_contract_options.rb +1 -1
  89. data/lib/coinbase/client/models/onchain_name.rb +1 -1
  90. data/lib/coinbase/client/models/onchain_name_list.rb +1 -1
  91. data/lib/coinbase/client/models/payload_signature.rb +1 -1
  92. data/lib/coinbase/client/models/payload_signature_list.rb +1 -1
  93. data/lib/coinbase/client/models/read_contract_request.rb +1 -1
  94. data/lib/coinbase/client/models/register_smart_contract_request.rb +252 -0
  95. data/lib/coinbase/client/models/seed_creation_event.rb +1 -1
  96. data/lib/coinbase/client/models/seed_creation_event_result.rb +1 -1
  97. data/lib/coinbase/client/models/server_signer.rb +1 -1
  98. data/lib/coinbase/client/models/server_signer_event.rb +1 -1
  99. data/lib/coinbase/client/models/server_signer_event_event.rb +1 -1
  100. data/lib/coinbase/client/models/server_signer_event_list.rb +1 -1
  101. data/lib/coinbase/client/models/server_signer_list.rb +1 -1
  102. data/lib/coinbase/client/models/signature_creation_event.rb +1 -1
  103. data/lib/coinbase/client/models/signature_creation_event_result.rb +1 -1
  104. data/lib/coinbase/client/models/signed_voluntary_exit_message_metadata.rb +1 -1
  105. data/lib/coinbase/client/models/smart_contract.rb +37 -31
  106. data/lib/coinbase/client/models/smart_contract_activity_event.rb +386 -0
  107. data/lib/coinbase/client/models/smart_contract_list.rb +1 -1
  108. data/lib/coinbase/client/models/smart_contract_options.rb +1 -1
  109. data/lib/coinbase/client/models/smart_contract_type.rb +3 -2
  110. data/lib/coinbase/client/models/solidity_value.rb +3 -3
  111. data/lib/coinbase/client/models/sponsored_send.rb +1 -1
  112. data/lib/coinbase/client/models/staking_balance.rb +1 -1
  113. data/lib/coinbase/client/models/staking_context.rb +1 -1
  114. data/lib/coinbase/client/models/staking_context_context.rb +1 -1
  115. data/lib/coinbase/client/models/staking_operation.rb +1 -1
  116. data/lib/coinbase/client/models/staking_operation_metadata.rb +1 -1
  117. data/lib/coinbase/client/models/staking_reward.rb +1 -1
  118. data/lib/coinbase/client/models/staking_reward_format.rb +1 -1
  119. data/lib/coinbase/client/models/staking_reward_usd_value.rb +1 -1
  120. data/lib/coinbase/client/models/token_contract_options.rb +1 -1
  121. data/lib/coinbase/client/models/token_transfer_type.rb +1 -1
  122. data/lib/coinbase/client/models/trade.rb +1 -1
  123. data/lib/coinbase/client/models/trade_list.rb +1 -1
  124. data/lib/coinbase/client/models/transaction.rb +1 -1
  125. data/lib/coinbase/client/models/transaction_content.rb +1 -1
  126. data/lib/coinbase/client/models/transaction_type.rb +1 -1
  127. data/lib/coinbase/client/models/transfer.rb +2 -37
  128. data/lib/coinbase/client/models/transfer_list.rb +1 -1
  129. data/lib/coinbase/client/models/update_smart_contract_request.rb +245 -0
  130. data/lib/coinbase/client/models/update_webhook_request.rb +1 -1
  131. data/lib/coinbase/client/models/user.rb +1 -1
  132. data/lib/coinbase/client/models/validator.rb +1 -1
  133. data/lib/coinbase/client/models/validator_details.rb +1 -1
  134. data/lib/coinbase/client/models/validator_list.rb +1 -1
  135. data/lib/coinbase/client/models/validator_status.rb +1 -1
  136. data/lib/coinbase/client/models/wallet.rb +1 -1
  137. data/lib/coinbase/client/models/wallet_list.rb +1 -1
  138. data/lib/coinbase/client/models/webhook.rb +1 -1
  139. data/lib/coinbase/client/models/webhook_event_filter.rb +1 -1
  140. data/lib/coinbase/client/models/webhook_event_type.rb +3 -2
  141. data/lib/coinbase/client/models/webhook_event_type_filter.rb +2 -1
  142. data/lib/coinbase/client/models/webhook_list.rb +1 -1
  143. data/lib/coinbase/client/models/webhook_smart_contract_event_filter.rb +225 -0
  144. data/lib/coinbase/client/models/webhook_wallet_activity_filter.rb +8 -1
  145. data/lib/coinbase/client/version.rb +1 -1
  146. data/lib/coinbase/client.rb +11 -4
  147. data/lib/coinbase/crypto_amount.rb +62 -0
  148. data/lib/coinbase/errors.rb +8 -0
  149. data/lib/coinbase/fiat_amount.rb +40 -0
  150. data/lib/coinbase/fund_operation.rb +228 -0
  151. data/lib/coinbase/fund_quote.rb +149 -0
  152. data/lib/coinbase/smart_contract.rb +337 -244
  153. data/lib/coinbase/staking_operation.rb +2 -2
  154. data/lib/coinbase/validator.rb +7 -10
  155. data/lib/coinbase/version.rb +1 -1
  156. data/lib/coinbase/wallet/data.rb +6 -4
  157. data/lib/coinbase/wallet.rb +16 -3
  158. data/lib/coinbase.rb +6 -1
  159. metadata +20 -8
  160. data/lib/coinbase/client/api/validators_api.rb +0 -179
@@ -0,0 +1,239 @@
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.10.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Coinbase::Client
17
+ # The reputation score with metadata of a blockchain address.
18
+ class AddressReputation
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
+
22
+ attr_accessor :metadata
23
+
24
+ # Attribute mapping from ruby-style variable name to JSON key.
25
+ def self.attribute_map
26
+ {
27
+ :'score' => :'score',
28
+ :'metadata' => :'metadata'
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
+ :'score' => :'Integer',
41
+ :'metadata' => :'AddressReputationMetadata'
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::AddressReputation` 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::AddressReputation`. 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?(:'score')
67
+ self.score = attributes[:'score']
68
+ else
69
+ self.score = nil
70
+ end
71
+
72
+ if attributes.key?(:'metadata')
73
+ self.metadata = attributes[:'metadata']
74
+ else
75
+ self.metadata = nil
76
+ end
77
+ end
78
+
79
+ # Show invalid properties with the reasons. Usually used together with valid?
80
+ # @return Array for valid properties with the reasons
81
+ def list_invalid_properties
82
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
83
+ invalid_properties = Array.new
84
+ if @score.nil?
85
+ invalid_properties.push('invalid value for "score", score cannot be nil.')
86
+ end
87
+
88
+ if @metadata.nil?
89
+ invalid_properties.push('invalid value for "metadata", metadata cannot be nil.')
90
+ end
91
+
92
+ invalid_properties
93
+ end
94
+
95
+ # Check to see if the all the properties in the model are valid
96
+ # @return true if the model is valid
97
+ def valid?
98
+ warn '[DEPRECATED] the `valid?` method is obsolete'
99
+ return false if @score.nil?
100
+ return false if @metadata.nil?
101
+ true
102
+ end
103
+
104
+ # Checks equality by comparing each attribute.
105
+ # @param [Object] Object to be compared
106
+ def ==(o)
107
+ return true if self.equal?(o)
108
+ self.class == o.class &&
109
+ score == o.score &&
110
+ metadata == o.metadata
111
+ end
112
+
113
+ # @see the `==` method
114
+ # @param [Object] Object to be compared
115
+ def eql?(o)
116
+ self == o
117
+ end
118
+
119
+ # Calculates hash code according to all attributes.
120
+ # @return [Integer] Hash code
121
+ def hash
122
+ [score, metadata].hash
123
+ end
124
+
125
+ # Builds the object from hash
126
+ # @param [Hash] attributes Model attributes in the form of hash
127
+ # @return [Object] Returns the model itself
128
+ def self.build_from_hash(attributes)
129
+ return nil unless attributes.is_a?(Hash)
130
+ attributes = attributes.transform_keys(&:to_sym)
131
+ transformed_hash = {}
132
+ openapi_types.each_pair do |key, type|
133
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
134
+ transformed_hash["#{key}"] = nil
135
+ elsif type =~ /\AArray<(.*)>/i
136
+ # check to ensure the input is an array given that the attribute
137
+ # is documented as an array but the input is not
138
+ if attributes[attribute_map[key]].is_a?(Array)
139
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
140
+ end
141
+ elsif !attributes[attribute_map[key]].nil?
142
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
143
+ end
144
+ end
145
+ new(transformed_hash)
146
+ end
147
+
148
+ # Deserializes the data based on type
149
+ # @param string type Data type
150
+ # @param string value Value to be deserialized
151
+ # @return [Object] Deserialized data
152
+ def self._deserialize(type, value)
153
+ case type.to_sym
154
+ when :Time
155
+ Time.parse(value)
156
+ when :Date
157
+ Date.parse(value)
158
+ when :String
159
+ value.to_s
160
+ when :Integer
161
+ value.to_i
162
+ when :Float
163
+ value.to_f
164
+ when :Boolean
165
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
166
+ true
167
+ else
168
+ false
169
+ end
170
+ when :Object
171
+ # generic object (usually a Hash), return directly
172
+ value
173
+ when /\AArray<(?<inner_type>.+)>\z/
174
+ inner_type = Regexp.last_match[:inner_type]
175
+ value.map { |v| _deserialize(inner_type, v) }
176
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
177
+ k_type = Regexp.last_match[:k_type]
178
+ v_type = Regexp.last_match[:v_type]
179
+ {}.tap do |hash|
180
+ value.each do |k, v|
181
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
182
+ end
183
+ end
184
+ else # model
185
+ # models (e.g. Pet) or oneOf
186
+ klass = Coinbase::Client.const_get(type)
187
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
188
+ end
189
+ end
190
+
191
+ # Returns the string representation of the object
192
+ # @return [String] String presentation of the object
193
+ def to_s
194
+ to_hash.to_s
195
+ end
196
+
197
+ # to_body is an alias to to_hash (backward compatibility)
198
+ # @return [Hash] Returns the object in the form of hash
199
+ def to_body
200
+ to_hash
201
+ end
202
+
203
+ # Returns the object in the form of hash
204
+ # @return [Hash] Returns the object in the form of hash
205
+ def to_hash
206
+ hash = {}
207
+ self.class.attribute_map.each_pair do |attr, param|
208
+ value = self.send(attr)
209
+ if value.nil?
210
+ is_nullable = self.class.openapi_nullable.include?(attr)
211
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
212
+ end
213
+
214
+ hash[param] = _to_hash(value)
215
+ end
216
+ hash
217
+ end
218
+
219
+ # Outputs non-array value in the form of hash
220
+ # For object, use to_hash. Otherwise, just return the value
221
+ # @param [Object] value Any valid value
222
+ # @return [Hash] Returns the value in the form of hash
223
+ def _to_hash(value)
224
+ if value.is_a?(Array)
225
+ value.compact.map { |v| _to_hash(v) }
226
+ elsif value.is_a?(Hash)
227
+ {}.tap do |hash|
228
+ value.each { |k, v| hash[k] = _to_hash(v) }
229
+ end
230
+ elsif value.respond_to? :to_hash
231
+ value.to_hash
232
+ else
233
+ value
234
+ end
235
+ end
236
+
237
+ end
238
+
239
+ end
@@ -0,0 +1,376 @@
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.10.0
10
+
11
+ =end
12
+
13
+ require 'date'
14
+ require 'time'
15
+
16
+ module Coinbase::Client
17
+ # The metadata for the reputation score of onchain address.
18
+ class AddressReputationMetadata
19
+ # The total number of transactions performed by the address.
20
+ attr_accessor :total_transactions
21
+
22
+ # The number of unique days the address was active.
23
+ attr_accessor :unique_days_active
24
+
25
+ # The longest streak of consecutive active days.
26
+ attr_accessor :longest_active_streak
27
+
28
+ # The current streak of consecutive active days.
29
+ attr_accessor :current_active_streak
30
+
31
+ # The total number of days the address has been active.
32
+ attr_accessor :activity_period_days
33
+
34
+ # The number of token swaps performed by the address.
35
+ attr_accessor :token_swaps_performed
36
+
37
+ # The number of bridge transactions performed by the address.
38
+ attr_accessor :bridge_transactions_performed
39
+
40
+ # The number of lend, borrow, or stake transactions performed by the address.
41
+ attr_accessor :lend_borrow_stake_transactions
42
+
43
+ # The number of interactions with ENS contracts.
44
+ attr_accessor :ens_contract_interactions
45
+
46
+ # The number of smart contracts deployed by the address.
47
+ attr_accessor :smart_contract_deployments
48
+
49
+ # Attribute mapping from ruby-style variable name to JSON key.
50
+ def self.attribute_map
51
+ {
52
+ :'total_transactions' => :'total_transactions',
53
+ :'unique_days_active' => :'unique_days_active',
54
+ :'longest_active_streak' => :'longest_active_streak',
55
+ :'current_active_streak' => :'current_active_streak',
56
+ :'activity_period_days' => :'activity_period_days',
57
+ :'token_swaps_performed' => :'token_swaps_performed',
58
+ :'bridge_transactions_performed' => :'bridge_transactions_performed',
59
+ :'lend_borrow_stake_transactions' => :'lend_borrow_stake_transactions',
60
+ :'ens_contract_interactions' => :'ens_contract_interactions',
61
+ :'smart_contract_deployments' => :'smart_contract_deployments'
62
+ }
63
+ end
64
+
65
+ # Returns all the JSON keys this model knows about
66
+ def self.acceptable_attributes
67
+ attribute_map.values
68
+ end
69
+
70
+ # Attribute type mapping.
71
+ def self.openapi_types
72
+ {
73
+ :'total_transactions' => :'Integer',
74
+ :'unique_days_active' => :'Integer',
75
+ :'longest_active_streak' => :'Integer',
76
+ :'current_active_streak' => :'Integer',
77
+ :'activity_period_days' => :'Integer',
78
+ :'token_swaps_performed' => :'Integer',
79
+ :'bridge_transactions_performed' => :'Integer',
80
+ :'lend_borrow_stake_transactions' => :'Integer',
81
+ :'ens_contract_interactions' => :'Integer',
82
+ :'smart_contract_deployments' => :'Integer'
83
+ }
84
+ end
85
+
86
+ # List of attributes with nullable: true
87
+ def self.openapi_nullable
88
+ Set.new([
89
+ ])
90
+ end
91
+
92
+ # Initializes the object
93
+ # @param [Hash] attributes Model attributes in the form of hash
94
+ def initialize(attributes = {})
95
+ if (!attributes.is_a?(Hash))
96
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Coinbase::Client::AddressReputationMetadata` initialize method"
97
+ end
98
+
99
+ # check to see if the attribute exists and convert string to symbol for hash key
100
+ attributes = attributes.each_with_object({}) { |(k, v), h|
101
+ if (!self.class.attribute_map.key?(k.to_sym))
102
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Coinbase::Client::AddressReputationMetadata`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
103
+ end
104
+ h[k.to_sym] = v
105
+ }
106
+
107
+ if attributes.key?(:'total_transactions')
108
+ self.total_transactions = attributes[:'total_transactions']
109
+ else
110
+ self.total_transactions = nil
111
+ end
112
+
113
+ if attributes.key?(:'unique_days_active')
114
+ self.unique_days_active = attributes[:'unique_days_active']
115
+ else
116
+ self.unique_days_active = nil
117
+ end
118
+
119
+ if attributes.key?(:'longest_active_streak')
120
+ self.longest_active_streak = attributes[:'longest_active_streak']
121
+ else
122
+ self.longest_active_streak = nil
123
+ end
124
+
125
+ if attributes.key?(:'current_active_streak')
126
+ self.current_active_streak = attributes[:'current_active_streak']
127
+ else
128
+ self.current_active_streak = nil
129
+ end
130
+
131
+ if attributes.key?(:'activity_period_days')
132
+ self.activity_period_days = attributes[:'activity_period_days']
133
+ else
134
+ self.activity_period_days = nil
135
+ end
136
+
137
+ if attributes.key?(:'token_swaps_performed')
138
+ self.token_swaps_performed = attributes[:'token_swaps_performed']
139
+ else
140
+ self.token_swaps_performed = nil
141
+ end
142
+
143
+ if attributes.key?(:'bridge_transactions_performed')
144
+ self.bridge_transactions_performed = attributes[:'bridge_transactions_performed']
145
+ else
146
+ self.bridge_transactions_performed = nil
147
+ end
148
+
149
+ if attributes.key?(:'lend_borrow_stake_transactions')
150
+ self.lend_borrow_stake_transactions = attributes[:'lend_borrow_stake_transactions']
151
+ else
152
+ self.lend_borrow_stake_transactions = nil
153
+ end
154
+
155
+ if attributes.key?(:'ens_contract_interactions')
156
+ self.ens_contract_interactions = attributes[:'ens_contract_interactions']
157
+ else
158
+ self.ens_contract_interactions = nil
159
+ end
160
+
161
+ if attributes.key?(:'smart_contract_deployments')
162
+ self.smart_contract_deployments = attributes[:'smart_contract_deployments']
163
+ else
164
+ self.smart_contract_deployments = nil
165
+ end
166
+ end
167
+
168
+ # Show invalid properties with the reasons. Usually used together with valid?
169
+ # @return Array for valid properties with the reasons
170
+ def list_invalid_properties
171
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
172
+ invalid_properties = Array.new
173
+ if @total_transactions.nil?
174
+ invalid_properties.push('invalid value for "total_transactions", total_transactions cannot be nil.')
175
+ end
176
+
177
+ if @unique_days_active.nil?
178
+ invalid_properties.push('invalid value for "unique_days_active", unique_days_active cannot be nil.')
179
+ end
180
+
181
+ if @longest_active_streak.nil?
182
+ invalid_properties.push('invalid value for "longest_active_streak", longest_active_streak cannot be nil.')
183
+ end
184
+
185
+ if @current_active_streak.nil?
186
+ invalid_properties.push('invalid value for "current_active_streak", current_active_streak cannot be nil.')
187
+ end
188
+
189
+ if @activity_period_days.nil?
190
+ invalid_properties.push('invalid value for "activity_period_days", activity_period_days cannot be nil.')
191
+ end
192
+
193
+ if @token_swaps_performed.nil?
194
+ invalid_properties.push('invalid value for "token_swaps_performed", token_swaps_performed cannot be nil.')
195
+ end
196
+
197
+ if @bridge_transactions_performed.nil?
198
+ invalid_properties.push('invalid value for "bridge_transactions_performed", bridge_transactions_performed cannot be nil.')
199
+ end
200
+
201
+ if @lend_borrow_stake_transactions.nil?
202
+ invalid_properties.push('invalid value for "lend_borrow_stake_transactions", lend_borrow_stake_transactions cannot be nil.')
203
+ end
204
+
205
+ if @ens_contract_interactions.nil?
206
+ invalid_properties.push('invalid value for "ens_contract_interactions", ens_contract_interactions cannot be nil.')
207
+ end
208
+
209
+ if @smart_contract_deployments.nil?
210
+ invalid_properties.push('invalid value for "smart_contract_deployments", smart_contract_deployments cannot be nil.')
211
+ end
212
+
213
+ invalid_properties
214
+ end
215
+
216
+ # Check to see if the all the properties in the model are valid
217
+ # @return true if the model is valid
218
+ def valid?
219
+ warn '[DEPRECATED] the `valid?` method is obsolete'
220
+ return false if @total_transactions.nil?
221
+ return false if @unique_days_active.nil?
222
+ return false if @longest_active_streak.nil?
223
+ return false if @current_active_streak.nil?
224
+ return false if @activity_period_days.nil?
225
+ return false if @token_swaps_performed.nil?
226
+ return false if @bridge_transactions_performed.nil?
227
+ return false if @lend_borrow_stake_transactions.nil?
228
+ return false if @ens_contract_interactions.nil?
229
+ return false if @smart_contract_deployments.nil?
230
+ true
231
+ end
232
+
233
+ # Checks equality by comparing each attribute.
234
+ # @param [Object] Object to be compared
235
+ def ==(o)
236
+ return true if self.equal?(o)
237
+ self.class == o.class &&
238
+ total_transactions == o.total_transactions &&
239
+ unique_days_active == o.unique_days_active &&
240
+ longest_active_streak == o.longest_active_streak &&
241
+ current_active_streak == o.current_active_streak &&
242
+ activity_period_days == o.activity_period_days &&
243
+ token_swaps_performed == o.token_swaps_performed &&
244
+ bridge_transactions_performed == o.bridge_transactions_performed &&
245
+ lend_borrow_stake_transactions == o.lend_borrow_stake_transactions &&
246
+ ens_contract_interactions == o.ens_contract_interactions &&
247
+ smart_contract_deployments == o.smart_contract_deployments
248
+ end
249
+
250
+ # @see the `==` method
251
+ # @param [Object] Object to be compared
252
+ def eql?(o)
253
+ self == o
254
+ end
255
+
256
+ # Calculates hash code according to all attributes.
257
+ # @return [Integer] Hash code
258
+ def hash
259
+ [total_transactions, unique_days_active, longest_active_streak, current_active_streak, activity_period_days, token_swaps_performed, bridge_transactions_performed, lend_borrow_stake_transactions, ens_contract_interactions, smart_contract_deployments].hash
260
+ end
261
+
262
+ # Builds the object from hash
263
+ # @param [Hash] attributes Model attributes in the form of hash
264
+ # @return [Object] Returns the model itself
265
+ def self.build_from_hash(attributes)
266
+ return nil unless attributes.is_a?(Hash)
267
+ attributes = attributes.transform_keys(&:to_sym)
268
+ transformed_hash = {}
269
+ openapi_types.each_pair do |key, type|
270
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
271
+ transformed_hash["#{key}"] = nil
272
+ elsif type =~ /\AArray<(.*)>/i
273
+ # check to ensure the input is an array given that the attribute
274
+ # is documented as an array but the input is not
275
+ if attributes[attribute_map[key]].is_a?(Array)
276
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
277
+ end
278
+ elsif !attributes[attribute_map[key]].nil?
279
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
280
+ end
281
+ end
282
+ new(transformed_hash)
283
+ end
284
+
285
+ # Deserializes the data based on type
286
+ # @param string type Data type
287
+ # @param string value Value to be deserialized
288
+ # @return [Object] Deserialized data
289
+ def self._deserialize(type, value)
290
+ case type.to_sym
291
+ when :Time
292
+ Time.parse(value)
293
+ when :Date
294
+ Date.parse(value)
295
+ when :String
296
+ value.to_s
297
+ when :Integer
298
+ value.to_i
299
+ when :Float
300
+ value.to_f
301
+ when :Boolean
302
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
303
+ true
304
+ else
305
+ false
306
+ end
307
+ when :Object
308
+ # generic object (usually a Hash), return directly
309
+ value
310
+ when /\AArray<(?<inner_type>.+)>\z/
311
+ inner_type = Regexp.last_match[:inner_type]
312
+ value.map { |v| _deserialize(inner_type, v) }
313
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
314
+ k_type = Regexp.last_match[:k_type]
315
+ v_type = Regexp.last_match[:v_type]
316
+ {}.tap do |hash|
317
+ value.each do |k, v|
318
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
319
+ end
320
+ end
321
+ else # model
322
+ # models (e.g. Pet) or oneOf
323
+ klass = Coinbase::Client.const_get(type)
324
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
325
+ end
326
+ end
327
+
328
+ # Returns the string representation of the object
329
+ # @return [String] String presentation of the object
330
+ def to_s
331
+ to_hash.to_s
332
+ end
333
+
334
+ # to_body is an alias to to_hash (backward compatibility)
335
+ # @return [Hash] Returns the object in the form of hash
336
+ def to_body
337
+ to_hash
338
+ end
339
+
340
+ # Returns the object in the form of hash
341
+ # @return [Hash] Returns the object in the form of hash
342
+ def to_hash
343
+ hash = {}
344
+ self.class.attribute_map.each_pair do |attr, param|
345
+ value = self.send(attr)
346
+ if value.nil?
347
+ is_nullable = self.class.openapi_nullable.include?(attr)
348
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
349
+ end
350
+
351
+ hash[param] = _to_hash(value)
352
+ end
353
+ hash
354
+ end
355
+
356
+ # Outputs non-array value in the form of hash
357
+ # For object, use to_hash. Otherwise, just return the value
358
+ # @param [Object] value Any valid value
359
+ # @return [Hash] Returns the value in the form of hash
360
+ def _to_hash(value)
361
+ if value.is_a?(Array)
362
+ value.compact.map { |v| _to_hash(v) }
363
+ elsif value.is_a?(Hash)
364
+ {}.tap do |hash|
365
+ value.each { |k, v| hash[k] = _to_hash(v) }
366
+ end
367
+ elsif value.respond_to? :to_hash
368
+ value.to_hash
369
+ else
370
+ value
371
+ end
372
+ end
373
+
374
+ end
375
+
376
+ end
@@ -6,7 +6,7 @@
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.8.0
9
+ Generator version: 7.10.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
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.8.0
9
+ Generator version: 7.10.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
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.8.0
9
+ Generator version: 7.10.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
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.8.0
9
+ Generator version: 7.10.0
10
10
 
11
11
  =end
12
12
 
@@ -6,7 +6,7 @@
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.8.0
9
+ Generator version: 7.10.0
10
10
 
11
11
  =end
12
12
 
@@ -14,7 +14,7 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Coinbase::Client
17
- class BroadcastTransferRequest
17
+ class BroadcastExternalTransferRequest
18
18
  # The hex-encoded signed payload of the transfer
19
19
  attr_accessor :signed_payload
20
20
 
@@ -47,13 +47,13 @@ module Coinbase::Client
47
47
  # @param [Hash] attributes Model attributes in the form of hash
48
48
  def initialize(attributes = {})
49
49
  if (!attributes.is_a?(Hash))
50
- fail ArgumentError, "The input argument (attributes) must be a hash in `Coinbase::Client::BroadcastTransferRequest` initialize method"
50
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Coinbase::Client::BroadcastExternalTransferRequest` initialize method"
51
51
  end
52
52
 
53
53
  # check to see if the attribute exists and convert string to symbol for hash key
54
54
  attributes = attributes.each_with_object({}) { |(k, v), h|
55
55
  if (!self.class.attribute_map.key?(k.to_sym))
56
- fail ArgumentError, "`#{k}` is not a valid attribute in `Coinbase::Client::BroadcastTransferRequest`. 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
57
57
  end
58
58
  h[k.to_sym] = v
59
59
  }
@@ -6,7 +6,7 @@
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.8.0
9
+ Generator version: 7.10.0
10
10
 
11
11
  =end
12
12