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
@@ -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
 
@@ -16,19 +16,22 @@ require 'time'
16
16
  module Coinbase::Client
17
17
  # Represents a smart contract on the blockchain
18
18
  class SmartContract
19
- # The unique identifier of the smart contract
19
+ # The unique identifier of the smart contract.
20
20
  attr_accessor :smart_contract_id
21
21
 
22
22
  # The name of the blockchain network
23
23
  attr_accessor :network_id
24
24
 
25
- # The ID of the wallet that deployed the smart contract
25
+ # The ID of the wallet that deployed the smart contract. If this smart contract was deployed externally, this will be omitted.
26
26
  attr_accessor :wallet_id
27
27
 
28
28
  # The EVM address of the smart contract
29
29
  attr_accessor :contract_address
30
30
 
31
- # The EVM address of the account that deployed the smart contract
31
+ # The name of the smart contract
32
+ attr_accessor :contract_name
33
+
34
+ # The EVM address of the account that deployed the smart contract. If this smart contract was deployed externally, this will be omitted.
32
35
  attr_accessor :deployer_address
33
36
 
34
37
  attr_accessor :type
@@ -40,6 +43,9 @@ module Coinbase::Client
40
43
 
41
44
  attr_accessor :transaction
42
45
 
46
+ # Whether the smart contract was deployed externally. If true, the deployer_address and transaction will be omitted.
47
+ attr_accessor :is_external
48
+
43
49
  class EnumAttributeValidator
44
50
  attr_reader :datatype
45
51
  attr_reader :allowable_values
@@ -69,11 +75,13 @@ module Coinbase::Client
69
75
  :'network_id' => :'network_id',
70
76
  :'wallet_id' => :'wallet_id',
71
77
  :'contract_address' => :'contract_address',
78
+ :'contract_name' => :'contract_name',
72
79
  :'deployer_address' => :'deployer_address',
73
80
  :'type' => :'type',
74
81
  :'options' => :'options',
75
82
  :'abi' => :'abi',
76
- :'transaction' => :'transaction'
83
+ :'transaction' => :'transaction',
84
+ :'is_external' => :'is_external'
77
85
  }
78
86
  end
79
87
 
@@ -89,11 +97,13 @@ module Coinbase::Client
89
97
  :'network_id' => :'String',
90
98
  :'wallet_id' => :'String',
91
99
  :'contract_address' => :'String',
100
+ :'contract_name' => :'String',
92
101
  :'deployer_address' => :'String',
93
102
  :'type' => :'SmartContractType',
94
103
  :'options' => :'SmartContractOptions',
95
104
  :'abi' => :'String',
96
- :'transaction' => :'Transaction'
105
+ :'transaction' => :'Transaction',
106
+ :'is_external' => :'Boolean'
97
107
  }
98
108
  end
99
109
 
@@ -132,8 +142,6 @@ module Coinbase::Client
132
142
 
133
143
  if attributes.key?(:'wallet_id')
134
144
  self.wallet_id = attributes[:'wallet_id']
135
- else
136
- self.wallet_id = nil
137
145
  end
138
146
 
139
147
  if attributes.key?(:'contract_address')
@@ -142,10 +150,14 @@ module Coinbase::Client
142
150
  self.contract_address = nil
143
151
  end
144
152
 
153
+ if attributes.key?(:'contract_name')
154
+ self.contract_name = attributes[:'contract_name']
155
+ else
156
+ self.contract_name = nil
157
+ end
158
+
145
159
  if attributes.key?(:'deployer_address')
146
160
  self.deployer_address = attributes[:'deployer_address']
147
- else
148
- self.deployer_address = nil
149
161
  end
150
162
 
151
163
  if attributes.key?(:'type')
@@ -156,8 +168,6 @@ module Coinbase::Client
156
168
 
157
169
  if attributes.key?(:'options')
158
170
  self.options = attributes[:'options']
159
- else
160
- self.options = nil
161
171
  end
162
172
 
163
173
  if attributes.key?(:'abi')
@@ -168,8 +178,12 @@ module Coinbase::Client
168
178
 
169
179
  if attributes.key?(:'transaction')
170
180
  self.transaction = attributes[:'transaction']
181
+ end
182
+
183
+ if attributes.key?(:'is_external')
184
+ self.is_external = attributes[:'is_external']
171
185
  else
172
- self.transaction = nil
186
+ self.is_external = nil
173
187
  end
174
188
  end
175
189
 
@@ -186,32 +200,24 @@ module Coinbase::Client
186
200
  invalid_properties.push('invalid value for "network_id", network_id cannot be nil.')
187
201
  end
188
202
 
189
- if @wallet_id.nil?
190
- invalid_properties.push('invalid value for "wallet_id", wallet_id cannot be nil.')
191
- end
192
-
193
203
  if @contract_address.nil?
194
204
  invalid_properties.push('invalid value for "contract_address", contract_address cannot be nil.')
195
205
  end
196
206
 
197
- if @deployer_address.nil?
198
- invalid_properties.push('invalid value for "deployer_address", deployer_address cannot be nil.')
207
+ if @contract_name.nil?
208
+ invalid_properties.push('invalid value for "contract_name", contract_name cannot be nil.')
199
209
  end
200
210
 
201
211
  if @type.nil?
202
212
  invalid_properties.push('invalid value for "type", type cannot be nil.')
203
213
  end
204
214
 
205
- if @options.nil?
206
- invalid_properties.push('invalid value for "options", options cannot be nil.')
207
- end
208
-
209
215
  if @abi.nil?
210
216
  invalid_properties.push('invalid value for "abi", abi cannot be nil.')
211
217
  end
212
218
 
213
- if @transaction.nil?
214
- invalid_properties.push('invalid value for "transaction", transaction cannot be nil.')
219
+ if @is_external.nil?
220
+ invalid_properties.push('invalid value for "is_external", is_external cannot be nil.')
215
221
  end
216
222
 
217
223
  invalid_properties
@@ -223,13 +229,11 @@ module Coinbase::Client
223
229
  warn '[DEPRECATED] the `valid?` method is obsolete'
224
230
  return false if @smart_contract_id.nil?
225
231
  return false if @network_id.nil?
226
- return false if @wallet_id.nil?
227
232
  return false if @contract_address.nil?
228
- return false if @deployer_address.nil?
233
+ return false if @contract_name.nil?
229
234
  return false if @type.nil?
230
- return false if @options.nil?
231
235
  return false if @abi.nil?
232
- return false if @transaction.nil?
236
+ return false if @is_external.nil?
233
237
  true
234
238
  end
235
239
 
@@ -242,11 +246,13 @@ module Coinbase::Client
242
246
  network_id == o.network_id &&
243
247
  wallet_id == o.wallet_id &&
244
248
  contract_address == o.contract_address &&
249
+ contract_name == o.contract_name &&
245
250
  deployer_address == o.deployer_address &&
246
251
  type == o.type &&
247
252
  options == o.options &&
248
253
  abi == o.abi &&
249
- transaction == o.transaction
254
+ transaction == o.transaction &&
255
+ is_external == o.is_external
250
256
  end
251
257
 
252
258
  # @see the `==` method
@@ -258,7 +264,7 @@ module Coinbase::Client
258
264
  # Calculates hash code according to all attributes.
259
265
  # @return [Integer] Hash code
260
266
  def hash
261
- [smart_contract_id, network_id, wallet_id, contract_address, deployer_address, type, options, abi, transaction].hash
267
+ [smart_contract_id, network_id, wallet_id, contract_address, contract_name, deployer_address, type, options, abi, transaction, is_external].hash
262
268
  end
263
269
 
264
270
  # Builds the object from hash
@@ -0,0 +1,386 @@
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
+ # Represents an event triggered by a smart contract activity on the blockchain. Contains information about the function, transaction, block, and involved addresses.
18
+ class SmartContractActivityEvent
19
+ # Unique identifier for the webhook that triggered this event.
20
+ attr_accessor :webhook_id
21
+
22
+ # Type of event, in this case, an ERC-721 token transfer.
23
+ attr_accessor :event_type
24
+
25
+ # Blockchain network where the event occurred.
26
+ attr_accessor :network
27
+
28
+ # Name of the project this smart contract belongs to.
29
+ attr_accessor :project_name
30
+
31
+ # Name of the contract.
32
+ attr_accessor :contract_name
33
+
34
+ # Name of the function.
35
+ attr_accessor :func
36
+
37
+ # Signature of the function.
38
+ attr_accessor :sig
39
+
40
+ # First 4 bytes of the Transaction, a unique ID.
41
+ attr_accessor :four_bytes
42
+
43
+ # Address of the smart contract.
44
+ attr_accessor :contract_address
45
+
46
+ # Hash of the block containing the transaction.
47
+ attr_accessor :block_hash
48
+
49
+ # Number of the block containing the transaction.
50
+ attr_accessor :block_number
51
+
52
+ # Timestamp when the block was mined.
53
+ attr_accessor :block_time
54
+
55
+ # Hash of the transaction that triggered the event.
56
+ attr_accessor :transaction_hash
57
+
58
+ # Position of the transaction within the block.
59
+ attr_accessor :transaction_index
60
+
61
+ # Position of the event log within the transaction.
62
+ attr_accessor :log_index
63
+
64
+ # Address of the initiator in the transfer.
65
+ attr_accessor :from
66
+
67
+ # Address of the recipient in the transfer.
68
+ attr_accessor :to
69
+
70
+ # Amount of tokens transferred, typically in the smallest unit (e.g., wei for Ethereum).
71
+ attr_accessor :value
72
+
73
+ # Attribute mapping from ruby-style variable name to JSON key.
74
+ def self.attribute_map
75
+ {
76
+ :'webhook_id' => :'webhookId',
77
+ :'event_type' => :'eventType',
78
+ :'network' => :'network',
79
+ :'project_name' => :'projectName',
80
+ :'contract_name' => :'contractName',
81
+ :'func' => :'func',
82
+ :'sig' => :'sig',
83
+ :'four_bytes' => :'fourBytes',
84
+ :'contract_address' => :'contractAddress',
85
+ :'block_hash' => :'blockHash',
86
+ :'block_number' => :'blockNumber',
87
+ :'block_time' => :'blockTime',
88
+ :'transaction_hash' => :'transactionHash',
89
+ :'transaction_index' => :'transactionIndex',
90
+ :'log_index' => :'logIndex',
91
+ :'from' => :'from',
92
+ :'to' => :'to',
93
+ :'value' => :'value'
94
+ }
95
+ end
96
+
97
+ # Returns all the JSON keys this model knows about
98
+ def self.acceptable_attributes
99
+ attribute_map.values
100
+ end
101
+
102
+ # Attribute type mapping.
103
+ def self.openapi_types
104
+ {
105
+ :'webhook_id' => :'String',
106
+ :'event_type' => :'String',
107
+ :'network' => :'String',
108
+ :'project_name' => :'String',
109
+ :'contract_name' => :'String',
110
+ :'func' => :'String',
111
+ :'sig' => :'String',
112
+ :'four_bytes' => :'String',
113
+ :'contract_address' => :'String',
114
+ :'block_hash' => :'String',
115
+ :'block_number' => :'Integer',
116
+ :'block_time' => :'Time',
117
+ :'transaction_hash' => :'String',
118
+ :'transaction_index' => :'Integer',
119
+ :'log_index' => :'Integer',
120
+ :'from' => :'String',
121
+ :'to' => :'String',
122
+ :'value' => :'Integer'
123
+ }
124
+ end
125
+
126
+ # List of attributes with nullable: true
127
+ def self.openapi_nullable
128
+ Set.new([
129
+ ])
130
+ end
131
+
132
+ # Initializes the object
133
+ # @param [Hash] attributes Model attributes in the form of hash
134
+ def initialize(attributes = {})
135
+ if (!attributes.is_a?(Hash))
136
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Coinbase::Client::SmartContractActivityEvent` initialize method"
137
+ end
138
+
139
+ # check to see if the attribute exists and convert string to symbol for hash key
140
+ attributes = attributes.each_with_object({}) { |(k, v), h|
141
+ if (!self.class.attribute_map.key?(k.to_sym))
142
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Coinbase::Client::SmartContractActivityEvent`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
143
+ end
144
+ h[k.to_sym] = v
145
+ }
146
+
147
+ if attributes.key?(:'webhook_id')
148
+ self.webhook_id = attributes[:'webhook_id']
149
+ end
150
+
151
+ if attributes.key?(:'event_type')
152
+ self.event_type = attributes[:'event_type']
153
+ end
154
+
155
+ if attributes.key?(:'network')
156
+ self.network = attributes[:'network']
157
+ end
158
+
159
+ if attributes.key?(:'project_name')
160
+ self.project_name = attributes[:'project_name']
161
+ end
162
+
163
+ if attributes.key?(:'contract_name')
164
+ self.contract_name = attributes[:'contract_name']
165
+ end
166
+
167
+ if attributes.key?(:'func')
168
+ self.func = attributes[:'func']
169
+ end
170
+
171
+ if attributes.key?(:'sig')
172
+ self.sig = attributes[:'sig']
173
+ end
174
+
175
+ if attributes.key?(:'four_bytes')
176
+ self.four_bytes = attributes[:'four_bytes']
177
+ end
178
+
179
+ if attributes.key?(:'contract_address')
180
+ self.contract_address = attributes[:'contract_address']
181
+ end
182
+
183
+ if attributes.key?(:'block_hash')
184
+ self.block_hash = attributes[:'block_hash']
185
+ end
186
+
187
+ if attributes.key?(:'block_number')
188
+ self.block_number = attributes[:'block_number']
189
+ end
190
+
191
+ if attributes.key?(:'block_time')
192
+ self.block_time = attributes[:'block_time']
193
+ end
194
+
195
+ if attributes.key?(:'transaction_hash')
196
+ self.transaction_hash = attributes[:'transaction_hash']
197
+ end
198
+
199
+ if attributes.key?(:'transaction_index')
200
+ self.transaction_index = attributes[:'transaction_index']
201
+ end
202
+
203
+ if attributes.key?(:'log_index')
204
+ self.log_index = attributes[:'log_index']
205
+ end
206
+
207
+ if attributes.key?(:'from')
208
+ self.from = attributes[:'from']
209
+ end
210
+
211
+ if attributes.key?(:'to')
212
+ self.to = attributes[:'to']
213
+ end
214
+
215
+ if attributes.key?(:'value')
216
+ self.value = attributes[:'value']
217
+ end
218
+ end
219
+
220
+ # Show invalid properties with the reasons. Usually used together with valid?
221
+ # @return Array for valid properties with the reasons
222
+ def list_invalid_properties
223
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
224
+ invalid_properties = Array.new
225
+ invalid_properties
226
+ end
227
+
228
+ # Check to see if the all the properties in the model are valid
229
+ # @return true if the model is valid
230
+ def valid?
231
+ warn '[DEPRECATED] the `valid?` method is obsolete'
232
+ true
233
+ end
234
+
235
+ # Checks equality by comparing each attribute.
236
+ # @param [Object] Object to be compared
237
+ def ==(o)
238
+ return true if self.equal?(o)
239
+ self.class == o.class &&
240
+ webhook_id == o.webhook_id &&
241
+ event_type == o.event_type &&
242
+ network == o.network &&
243
+ project_name == o.project_name &&
244
+ contract_name == o.contract_name &&
245
+ func == o.func &&
246
+ sig == o.sig &&
247
+ four_bytes == o.four_bytes &&
248
+ contract_address == o.contract_address &&
249
+ block_hash == o.block_hash &&
250
+ block_number == o.block_number &&
251
+ block_time == o.block_time &&
252
+ transaction_hash == o.transaction_hash &&
253
+ transaction_index == o.transaction_index &&
254
+ log_index == o.log_index &&
255
+ from == o.from &&
256
+ to == o.to &&
257
+ value == o.value
258
+ end
259
+
260
+ # @see the `==` method
261
+ # @param [Object] Object to be compared
262
+ def eql?(o)
263
+ self == o
264
+ end
265
+
266
+ # Calculates hash code according to all attributes.
267
+ # @return [Integer] Hash code
268
+ def hash
269
+ [webhook_id, event_type, network, project_name, contract_name, func, sig, four_bytes, contract_address, block_hash, block_number, block_time, transaction_hash, transaction_index, log_index, from, to, value].hash
270
+ end
271
+
272
+ # Builds the object from hash
273
+ # @param [Hash] attributes Model attributes in the form of hash
274
+ # @return [Object] Returns the model itself
275
+ def self.build_from_hash(attributes)
276
+ return nil unless attributes.is_a?(Hash)
277
+ attributes = attributes.transform_keys(&:to_sym)
278
+ transformed_hash = {}
279
+ openapi_types.each_pair do |key, type|
280
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
281
+ transformed_hash["#{key}"] = nil
282
+ elsif type =~ /\AArray<(.*)>/i
283
+ # check to ensure the input is an array given that the attribute
284
+ # is documented as an array but the input is not
285
+ if attributes[attribute_map[key]].is_a?(Array)
286
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
287
+ end
288
+ elsif !attributes[attribute_map[key]].nil?
289
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
290
+ end
291
+ end
292
+ new(transformed_hash)
293
+ end
294
+
295
+ # Deserializes the data based on type
296
+ # @param string type Data type
297
+ # @param string value Value to be deserialized
298
+ # @return [Object] Deserialized data
299
+ def self._deserialize(type, value)
300
+ case type.to_sym
301
+ when :Time
302
+ Time.parse(value)
303
+ when :Date
304
+ Date.parse(value)
305
+ when :String
306
+ value.to_s
307
+ when :Integer
308
+ value.to_i
309
+ when :Float
310
+ value.to_f
311
+ when :Boolean
312
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
313
+ true
314
+ else
315
+ false
316
+ end
317
+ when :Object
318
+ # generic object (usually a Hash), return directly
319
+ value
320
+ when /\AArray<(?<inner_type>.+)>\z/
321
+ inner_type = Regexp.last_match[:inner_type]
322
+ value.map { |v| _deserialize(inner_type, v) }
323
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
324
+ k_type = Regexp.last_match[:k_type]
325
+ v_type = Regexp.last_match[:v_type]
326
+ {}.tap do |hash|
327
+ value.each do |k, v|
328
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
329
+ end
330
+ end
331
+ else # model
332
+ # models (e.g. Pet) or oneOf
333
+ klass = Coinbase::Client.const_get(type)
334
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
335
+ end
336
+ end
337
+
338
+ # Returns the string representation of the object
339
+ # @return [String] String presentation of the object
340
+ def to_s
341
+ to_hash.to_s
342
+ end
343
+
344
+ # to_body is an alias to to_hash (backward compatibility)
345
+ # @return [Hash] Returns the object in the form of hash
346
+ def to_body
347
+ to_hash
348
+ end
349
+
350
+ # Returns the object in the form of hash
351
+ # @return [Hash] Returns the object in the form of hash
352
+ def to_hash
353
+ hash = {}
354
+ self.class.attribute_map.each_pair do |attr, param|
355
+ value = self.send(attr)
356
+ if value.nil?
357
+ is_nullable = self.class.openapi_nullable.include?(attr)
358
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
359
+ end
360
+
361
+ hash[param] = _to_hash(value)
362
+ end
363
+ hash
364
+ end
365
+
366
+ # Outputs non-array value in the form of hash
367
+ # For object, use to_hash. Otherwise, just return the value
368
+ # @param [Object] value Any valid value
369
+ # @return [Hash] Returns the value in the form of hash
370
+ def _to_hash(value)
371
+ if value.is_a?(Array)
372
+ value.compact.map { |v| _to_hash(v) }
373
+ elsif value.is_a?(Hash)
374
+ {}.tap do |hash|
375
+ value.each { |k, v| hash[k] = _to_hash(v) }
376
+ end
377
+ elsif value.respond_to? :to_hash
378
+ value.to_hash
379
+ else
380
+ value
381
+ end
382
+ end
383
+
384
+ end
385
+
386
+ 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
 
@@ -18,10 +18,11 @@ module Coinbase::Client
18
18
  ERC20 = "erc20".freeze
19
19
  ERC721 = "erc721".freeze
20
20
  ERC1155 = "erc1155".freeze
21
+ CUSTOM = "custom".freeze
21
22
  UNKNOWN_DEFAULT_OPEN_API = "unknown_default_open_api".freeze
22
23
 
23
24
  def self.all_vars
24
- @all_vars ||= [ERC20, ERC721, ERC1155, UNKNOWN_DEFAULT_OPEN_API].freeze
25
+ @all_vars ||= [ERC20, ERC721, ERC1155, CUSTOM, UNKNOWN_DEFAULT_OPEN_API].freeze
25
26
  end
26
27
 
27
28
  # Builds the enum from string
@@ -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
 
@@ -132,7 +132,7 @@ module Coinbase::Client
132
132
  def valid?
133
133
  warn '[DEPRECATED] the `valid?` method is obsolete'
134
134
  return false if @type.nil?
135
- type_validator = EnumAttributeValidator.new('String', ["uint8", "uint16", "uint32", "uint64", "uint128", "uint256", "int8", "int16", "int32", "int64", "int128", "int256", "address", "bool", "string", "bytes", "bytes1", "bytes2", "bytes3", "bytes4", "bytes5", "bytes6", "bytes7", "bytes8", "bytes9", "bytes10", "bytes11", "bytes12", "bytes13", "bytes14", "bytes15", "bytes16", "bytes17", "bytes18", "bytes19", "bytes20", "bytes21", "bytes22", "bytes23", "bytes24", "bytes25", "bytes26", "bytes27", "bytes28", "bytes29", "bytes30", "bytes31", "bytes32", "array", "tuple", "unknown_default_open_api"])
135
+ type_validator = EnumAttributeValidator.new('String', ["uint8", "uint16", "uint32", "uint64", "uint128", "uint160", "uint256", "int8", "int16", "int24", "int32", "int56", "int64", "int128", "int256", "address", "bool", "string", "bytes", "bytes1", "bytes2", "bytes3", "bytes4", "bytes5", "bytes6", "bytes7", "bytes8", "bytes9", "bytes10", "bytes11", "bytes12", "bytes13", "bytes14", "bytes15", "bytes16", "bytes17", "bytes18", "bytes19", "bytes20", "bytes21", "bytes22", "bytes23", "bytes24", "bytes25", "bytes26", "bytes27", "bytes28", "bytes29", "bytes30", "bytes31", "bytes32", "array", "tuple", "unknown_default_open_api"])
136
136
  return false unless type_validator.valid?(@type)
137
137
  true
138
138
  end
@@ -140,7 +140,7 @@ module Coinbase::Client
140
140
  # Custom attribute writer method checking allowed values (enum).
141
141
  # @param [Object] type Object to be assigned
142
142
  def type=(type)
143
- validator = EnumAttributeValidator.new('String', ["uint8", "uint16", "uint32", "uint64", "uint128", "uint256", "int8", "int16", "int32", "int64", "int128", "int256", "address", "bool", "string", "bytes", "bytes1", "bytes2", "bytes3", "bytes4", "bytes5", "bytes6", "bytes7", "bytes8", "bytes9", "bytes10", "bytes11", "bytes12", "bytes13", "bytes14", "bytes15", "bytes16", "bytes17", "bytes18", "bytes19", "bytes20", "bytes21", "bytes22", "bytes23", "bytes24", "bytes25", "bytes26", "bytes27", "bytes28", "bytes29", "bytes30", "bytes31", "bytes32", "array", "tuple", "unknown_default_open_api"])
143
+ validator = EnumAttributeValidator.new('String', ["uint8", "uint16", "uint32", "uint64", "uint128", "uint160", "uint256", "int8", "int16", "int24", "int32", "int56", "int64", "int128", "int256", "address", "bool", "string", "bytes", "bytes1", "bytes2", "bytes3", "bytes4", "bytes5", "bytes6", "bytes7", "bytes8", "bytes9", "bytes10", "bytes11", "bytes12", "bytes13", "bytes14", "bytes15", "bytes16", "bytes17", "bytes18", "bytes19", "bytes20", "bytes21", "bytes22", "bytes23", "bytes24", "bytes25", "bytes26", "bytes27", "bytes28", "bytes29", "bytes30", "bytes31", "bytes32", "array", "tuple", "unknown_default_open_api"])
144
144
  unless validator.valid?(type)
145
145
  fail ArgumentError, "invalid value for \"type\", must be one of #{validator.allowable_values}."
146
146
  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