coinbase-sdk 0.11.0 → 0.13.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (151) hide show
  1. checksums.yaml +4 -4
  2. data/lib/coinbase/address.rb +22 -3
  3. data/lib/coinbase/address_reputation.rb +67 -0
  4. data/lib/coinbase/client/api/addresses_api.rb +10 -10
  5. data/lib/coinbase/client/api/assets_api.rb +2 -2
  6. data/lib/coinbase/client/api/balance_history_api.rb +2 -2
  7. data/lib/coinbase/client/api/contract_events_api.rb +2 -2
  8. data/lib/coinbase/client/api/contract_invocations_api.rb +5 -5
  9. data/lib/coinbase/client/api/external_addresses_api.rb +246 -5
  10. data/lib/coinbase/client/api/fund_api.rb +5 -5
  11. data/lib/coinbase/client/api/mpc_wallet_stake_api.rb +4 -4
  12. data/lib/coinbase/client/api/networks_api.rb +2 -2
  13. data/lib/coinbase/client/api/onchain_identity_api.rb +2 -2
  14. data/lib/coinbase/client/api/reputation_api.rb +2 -71
  15. data/lib/coinbase/client/api/server_signers_api.rb +7 -7
  16. data/lib/coinbase/client/api/smart_contracts_api.rb +169 -26
  17. data/lib/coinbase/client/api/stake_api.rb +8 -8
  18. data/lib/coinbase/client/api/trades_api.rb +5 -5
  19. data/lib/coinbase/client/api/transaction_history_api.rb +2 -2
  20. data/lib/coinbase/client/api/transfers_api.rb +14 -14
  21. data/lib/coinbase/client/api/users_api.rb +1 -1
  22. data/lib/coinbase/client/api/wallets_api.rb +6 -6
  23. data/lib/coinbase/client/api/webhooks_api.rb +6 -6
  24. data/lib/coinbase/client/api_client.rb +1 -1
  25. data/lib/coinbase/client/api_error.rb +1 -1
  26. data/lib/coinbase/client/configuration.rb +15 -1
  27. data/lib/coinbase/client/models/address.rb +1 -1
  28. data/lib/coinbase/client/models/address_balance_list.rb +1 -1
  29. data/lib/coinbase/client/models/address_historical_balance_list.rb +1 -1
  30. data/lib/coinbase/client/models/address_list.rb +1 -1
  31. data/lib/coinbase/client/models/address_reputation.rb +16 -9
  32. data/lib/coinbase/client/models/address_reputation_metadata.rb +1 -1
  33. data/lib/coinbase/client/models/address_transaction_list.rb +1 -1
  34. data/lib/coinbase/client/models/asset.rb +1 -1
  35. data/lib/coinbase/client/models/balance.rb +1 -1
  36. data/lib/coinbase/client/models/broadcast_contract_invocation_request.rb +1 -1
  37. data/lib/coinbase/client/models/{broadcast_transfer_request.rb → broadcast_external_transfer_request.rb} +4 -4
  38. data/lib/coinbase/client/models/broadcast_staking_operation_request.rb +1 -1
  39. data/lib/coinbase/client/models/broadcast_trade_request.rb +1 -1
  40. data/lib/coinbase/client/models/build_staking_operation_request.rb +1 -1
  41. data/lib/coinbase/client/models/contract_event.rb +1 -1
  42. data/lib/coinbase/client/models/contract_event_list.rb +1 -1
  43. data/lib/coinbase/client/models/contract_invocation.rb +1 -1
  44. data/lib/coinbase/client/models/contract_invocation_list.rb +1 -1
  45. data/lib/coinbase/client/models/create_address_request.rb +1 -1
  46. data/lib/coinbase/client/models/create_contract_invocation_request.rb +1 -1
  47. data/lib/coinbase/client/models/create_external_transfer_request.rb +273 -0
  48. data/lib/coinbase/client/models/create_fund_operation_request.rb +2 -2
  49. data/lib/coinbase/client/models/create_fund_quote_request.rb +2 -2
  50. data/lib/coinbase/client/models/create_payload_signature_request.rb +1 -1
  51. data/lib/coinbase/client/models/create_server_signer_request.rb +1 -1
  52. data/lib/coinbase/client/models/create_smart_contract_request.rb +1 -1
  53. data/lib/coinbase/client/models/create_staking_operation_request.rb +1 -1
  54. data/lib/coinbase/client/models/create_trade_request.rb +1 -1
  55. data/lib/coinbase/client/models/create_transfer_request.rb +2 -2
  56. data/lib/coinbase/client/models/create_wallet_request.rb +1 -1
  57. data/lib/coinbase/client/models/create_wallet_request_wallet.rb +1 -1
  58. data/lib/coinbase/client/models/create_wallet_webhook_request.rb +1 -1
  59. data/lib/coinbase/client/models/create_webhook_request.rb +1 -1
  60. data/lib/coinbase/client/models/crypto_amount.rb +1 -1
  61. data/lib/coinbase/client/models/deploy_smart_contract_request.rb +1 -1
  62. data/lib/coinbase/client/models/erc20_transfer_event.rb +1 -1
  63. data/lib/coinbase/client/models/erc721_transfer_event.rb +1 -1
  64. data/lib/coinbase/client/models/error.rb +1 -1
  65. data/lib/coinbase/client/models/ethereum_token_transfer.rb +1 -1
  66. data/lib/coinbase/client/models/ethereum_transaction.rb +15 -5
  67. data/lib/coinbase/client/models/ethereum_transaction_access.rb +1 -1
  68. data/lib/coinbase/client/models/ethereum_transaction_access_list.rb +1 -1
  69. data/lib/coinbase/client/models/ethereum_transaction_flattened_trace.rb +1 -1
  70. data/lib/coinbase/client/models/ethereum_validator_metadata.rb +1 -1
  71. data/lib/coinbase/client/models/faucet_transaction.rb +1 -1
  72. data/lib/coinbase/client/models/feature_set.rb +1 -1
  73. data/lib/coinbase/client/models/fetch_historical_staking_balances200_response.rb +1 -1
  74. data/lib/coinbase/client/models/fetch_staking_rewards200_response.rb +1 -1
  75. data/lib/coinbase/client/models/fetch_staking_rewards_request.rb +1 -1
  76. data/lib/coinbase/client/models/fiat_amount.rb +1 -1
  77. data/lib/coinbase/client/models/fund_operation.rb +1 -1
  78. data/lib/coinbase/client/models/fund_operation_fees.rb +1 -1
  79. data/lib/coinbase/client/models/fund_operation_list.rb +1 -1
  80. data/lib/coinbase/client/models/fund_quote.rb +1 -1
  81. data/lib/coinbase/client/models/get_staking_context_request.rb +1 -1
  82. data/lib/coinbase/client/models/historical_balance.rb +1 -1
  83. data/lib/coinbase/client/models/multi_token_contract_options.rb +1 -1
  84. data/lib/coinbase/client/models/network.rb +1 -1
  85. data/lib/coinbase/client/models/network_identifier.rb +1 -1
  86. data/lib/coinbase/client/models/nft_contract_options.rb +1 -1
  87. data/lib/coinbase/client/models/onchain_name.rb +1 -1
  88. data/lib/coinbase/client/models/onchain_name_list.rb +1 -1
  89. data/lib/coinbase/client/models/payload_signature.rb +1 -1
  90. data/lib/coinbase/client/models/payload_signature_list.rb +1 -1
  91. data/lib/coinbase/client/models/read_contract_request.rb +1 -1
  92. data/lib/coinbase/client/models/register_smart_contract_request.rb +252 -0
  93. data/lib/coinbase/client/models/seed_creation_event.rb +1 -1
  94. data/lib/coinbase/client/models/seed_creation_event_result.rb +1 -1
  95. data/lib/coinbase/client/models/server_signer.rb +1 -1
  96. data/lib/coinbase/client/models/server_signer_event.rb +1 -1
  97. data/lib/coinbase/client/models/server_signer_event_event.rb +1 -1
  98. data/lib/coinbase/client/models/server_signer_event_list.rb +1 -1
  99. data/lib/coinbase/client/models/server_signer_list.rb +1 -1
  100. data/lib/coinbase/client/models/signature_creation_event.rb +1 -1
  101. data/lib/coinbase/client/models/signature_creation_event_result.rb +1 -1
  102. data/lib/coinbase/client/models/signed_voluntary_exit_message_metadata.rb +1 -1
  103. data/lib/coinbase/client/models/smart_contract.rb +37 -31
  104. data/lib/coinbase/client/models/smart_contract_activity_event.rb +386 -0
  105. data/lib/coinbase/client/models/smart_contract_list.rb +1 -1
  106. data/lib/coinbase/client/models/smart_contract_options.rb +1 -1
  107. data/lib/coinbase/client/models/smart_contract_type.rb +3 -2
  108. data/lib/coinbase/client/models/solidity_value.rb +1 -1
  109. data/lib/coinbase/client/models/sponsored_send.rb +1 -1
  110. data/lib/coinbase/client/models/staking_balance.rb +1 -1
  111. data/lib/coinbase/client/models/staking_context.rb +1 -1
  112. data/lib/coinbase/client/models/staking_context_context.rb +1 -1
  113. data/lib/coinbase/client/models/staking_operation.rb +1 -1
  114. data/lib/coinbase/client/models/staking_operation_metadata.rb +1 -1
  115. data/lib/coinbase/client/models/staking_reward.rb +1 -1
  116. data/lib/coinbase/client/models/staking_reward_format.rb +1 -1
  117. data/lib/coinbase/client/models/staking_reward_usd_value.rb +1 -1
  118. data/lib/coinbase/client/models/token_contract_options.rb +1 -1
  119. data/lib/coinbase/client/models/token_transfer_type.rb +1 -1
  120. data/lib/coinbase/client/models/trade.rb +1 -1
  121. data/lib/coinbase/client/models/trade_list.rb +1 -1
  122. data/lib/coinbase/client/models/transaction.rb +1 -1
  123. data/lib/coinbase/client/models/transaction_content.rb +1 -1
  124. data/lib/coinbase/client/models/transaction_type.rb +1 -1
  125. data/lib/coinbase/client/models/transfer.rb +2 -37
  126. data/lib/coinbase/client/models/transfer_list.rb +1 -1
  127. data/lib/coinbase/client/models/update_smart_contract_request.rb +245 -0
  128. data/lib/coinbase/client/models/update_webhook_request.rb +1 -1
  129. data/lib/coinbase/client/models/user.rb +1 -1
  130. data/lib/coinbase/client/models/validator.rb +1 -1
  131. data/lib/coinbase/client/models/validator_details.rb +1 -1
  132. data/lib/coinbase/client/models/validator_list.rb +1 -1
  133. data/lib/coinbase/client/models/validator_status.rb +1 -1
  134. data/lib/coinbase/client/models/wallet.rb +1 -1
  135. data/lib/coinbase/client/models/wallet_list.rb +1 -1
  136. data/lib/coinbase/client/models/webhook.rb +1 -1
  137. data/lib/coinbase/client/models/webhook_event_filter.rb +1 -1
  138. data/lib/coinbase/client/models/webhook_event_type.rb +3 -2
  139. data/lib/coinbase/client/models/webhook_event_type_filter.rb +2 -1
  140. data/lib/coinbase/client/models/webhook_list.rb +1 -1
  141. data/lib/coinbase/client/models/{address_risk.rb → webhook_smart_contract_event_filter.rb} +19 -17
  142. data/lib/coinbase/client/models/webhook_wallet_activity_filter.rb +8 -1
  143. data/lib/coinbase/client/version.rb +1 -1
  144. data/lib/coinbase/client.rb +7 -3
  145. data/lib/coinbase/errors.rb +8 -0
  146. data/lib/coinbase/smart_contract.rb +338 -245
  147. data/lib/coinbase/version.rb +1 -1
  148. data/lib/coinbase/wallet/data.rb +6 -4
  149. data/lib/coinbase/wallet.rb +3 -2
  150. data/lib/coinbase.rb +2 -1
  151. metadata +12 -7
@@ -0,0 +1,245 @@
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
+ # Smart Contract data to be updated
18
+ class UpdateSmartContractRequest
19
+ # ABI of the smart contract
20
+ attr_accessor :abi
21
+
22
+ # Name of the smart contract
23
+ attr_accessor :contract_name
24
+
25
+ # Attribute mapping from ruby-style variable name to JSON key.
26
+ def self.attribute_map
27
+ {
28
+ :'abi' => :'abi',
29
+ :'contract_name' => :'contract_name'
30
+ }
31
+ end
32
+
33
+ # Returns all the JSON keys this model knows about
34
+ def self.acceptable_attributes
35
+ attribute_map.values
36
+ end
37
+
38
+ # Attribute type mapping.
39
+ def self.openapi_types
40
+ {
41
+ :'abi' => :'String',
42
+ :'contract_name' => :'String'
43
+ }
44
+ end
45
+
46
+ # List of attributes with nullable: true
47
+ def self.openapi_nullable
48
+ Set.new([
49
+ ])
50
+ end
51
+
52
+ # Initializes the object
53
+ # @param [Hash] attributes Model attributes in the form of hash
54
+ def initialize(attributes = {})
55
+ if (!attributes.is_a?(Hash))
56
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Coinbase::Client::UpdateSmartContractRequest` initialize method"
57
+ end
58
+
59
+ # check to see if the attribute exists and convert string to symbol for hash key
60
+ attributes = attributes.each_with_object({}) { |(k, v), h|
61
+ if (!self.class.attribute_map.key?(k.to_sym))
62
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Coinbase::Client::UpdateSmartContractRequest`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
63
+ end
64
+ h[k.to_sym] = v
65
+ }
66
+
67
+ if attributes.key?(:'abi')
68
+ self.abi = attributes[:'abi']
69
+ end
70
+
71
+ if attributes.key?(:'contract_name')
72
+ self.contract_name = attributes[:'contract_name']
73
+ end
74
+ end
75
+
76
+ # Show invalid properties with the reasons. Usually used together with valid?
77
+ # @return Array for valid properties with the reasons
78
+ def list_invalid_properties
79
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
80
+ invalid_properties = Array.new
81
+ if !@contract_name.nil? && @contract_name.to_s.length > 100
82
+ invalid_properties.push('invalid value for "contract_name", the character length must be smaller than or equal to 100.')
83
+ end
84
+
85
+ invalid_properties
86
+ end
87
+
88
+ # Check to see if the all the properties in the model are valid
89
+ # @return true if the model is valid
90
+ def valid?
91
+ warn '[DEPRECATED] the `valid?` method is obsolete'
92
+ return false if !@contract_name.nil? && @contract_name.to_s.length > 100
93
+ true
94
+ end
95
+
96
+ # Custom attribute writer method with validation
97
+ # @param [Object] contract_name Value to be assigned
98
+ def contract_name=(contract_name)
99
+ if contract_name.nil?
100
+ fail ArgumentError, 'contract_name cannot be nil'
101
+ end
102
+
103
+ if contract_name.to_s.length > 100
104
+ fail ArgumentError, 'invalid value for "contract_name", the character length must be smaller than or equal to 100.'
105
+ end
106
+
107
+ @contract_name = contract_name
108
+ end
109
+
110
+ # Checks equality by comparing each attribute.
111
+ # @param [Object] Object to be compared
112
+ def ==(o)
113
+ return true if self.equal?(o)
114
+ self.class == o.class &&
115
+ abi == o.abi &&
116
+ contract_name == o.contract_name
117
+ end
118
+
119
+ # @see the `==` method
120
+ # @param [Object] Object to be compared
121
+ def eql?(o)
122
+ self == o
123
+ end
124
+
125
+ # Calculates hash code according to all attributes.
126
+ # @return [Integer] Hash code
127
+ def hash
128
+ [abi, contract_name].hash
129
+ end
130
+
131
+ # Builds the object from hash
132
+ # @param [Hash] attributes Model attributes in the form of hash
133
+ # @return [Object] Returns the model itself
134
+ def self.build_from_hash(attributes)
135
+ return nil unless attributes.is_a?(Hash)
136
+ attributes = attributes.transform_keys(&:to_sym)
137
+ transformed_hash = {}
138
+ openapi_types.each_pair do |key, type|
139
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
140
+ transformed_hash["#{key}"] = nil
141
+ elsif type =~ /\AArray<(.*)>/i
142
+ # check to ensure the input is an array given that the attribute
143
+ # is documented as an array but the input is not
144
+ if attributes[attribute_map[key]].is_a?(Array)
145
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
146
+ end
147
+ elsif !attributes[attribute_map[key]].nil?
148
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
149
+ end
150
+ end
151
+ new(transformed_hash)
152
+ end
153
+
154
+ # Deserializes the data based on type
155
+ # @param string type Data type
156
+ # @param string value Value to be deserialized
157
+ # @return [Object] Deserialized data
158
+ def self._deserialize(type, value)
159
+ case type.to_sym
160
+ when :Time
161
+ Time.parse(value)
162
+ when :Date
163
+ Date.parse(value)
164
+ when :String
165
+ value.to_s
166
+ when :Integer
167
+ value.to_i
168
+ when :Float
169
+ value.to_f
170
+ when :Boolean
171
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
172
+ true
173
+ else
174
+ false
175
+ end
176
+ when :Object
177
+ # generic object (usually a Hash), return directly
178
+ value
179
+ when /\AArray<(?<inner_type>.+)>\z/
180
+ inner_type = Regexp.last_match[:inner_type]
181
+ value.map { |v| _deserialize(inner_type, v) }
182
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
183
+ k_type = Regexp.last_match[:k_type]
184
+ v_type = Regexp.last_match[:v_type]
185
+ {}.tap do |hash|
186
+ value.each do |k, v|
187
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
188
+ end
189
+ end
190
+ else # model
191
+ # models (e.g. Pet) or oneOf
192
+ klass = Coinbase::Client.const_get(type)
193
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
194
+ end
195
+ end
196
+
197
+ # Returns the string representation of the object
198
+ # @return [String] String presentation of the object
199
+ def to_s
200
+ to_hash.to_s
201
+ end
202
+
203
+ # to_body is an alias to to_hash (backward compatibility)
204
+ # @return [Hash] Returns the object in the form of hash
205
+ def to_body
206
+ to_hash
207
+ end
208
+
209
+ # Returns the object in the form of hash
210
+ # @return [Hash] Returns the object in the form of hash
211
+ def to_hash
212
+ hash = {}
213
+ self.class.attribute_map.each_pair do |attr, param|
214
+ value = self.send(attr)
215
+ if value.nil?
216
+ is_nullable = self.class.openapi_nullable.include?(attr)
217
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
218
+ end
219
+
220
+ hash[param] = _to_hash(value)
221
+ end
222
+ hash
223
+ end
224
+
225
+ # Outputs non-array value in the form of hash
226
+ # For object, use to_hash. Otherwise, just return the value
227
+ # @param [Object] value Any valid value
228
+ # @return [Hash] Returns the value in the form of hash
229
+ def _to_hash(value)
230
+ if value.is_a?(Array)
231
+ value.compact.map { |v| _to_hash(v) }
232
+ elsif value.is_a?(Hash)
233
+ {}.tap do |hash|
234
+ value.each { |k, v| hash[k] = _to_hash(v) }
235
+ end
236
+ elsif value.respond_to? :to_hash
237
+ value.to_hash
238
+ else
239
+ value
240
+ end
241
+ end
242
+
243
+ end
244
+
245
+ 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.9.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.9.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.9.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.9.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.9.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.9.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.9.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.9.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.9.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.9.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.9.0
9
+ Generator version: 7.10.0
10
10
 
11
11
  =end
12
12
 
@@ -19,10 +19,11 @@ module Coinbase::Client
19
19
  ERC20_TRANSFER = "erc20_transfer".freeze
20
20
  ERC721_TRANSFER = "erc721_transfer".freeze
21
21
  WALLET_ACTIVITY = "wallet_activity".freeze
22
+ SMART_CONTRACT_EVENT_ACTIVITY = "smart_contract_event_activity".freeze
22
23
  UNKNOWN_DEFAULT_OPEN_API = "unknown_default_open_api".freeze
23
24
 
24
25
  def self.all_vars
25
- @all_vars ||= [UNSPECIFIED, ERC20_TRANSFER, ERC721_TRANSFER, WALLET_ACTIVITY, UNKNOWN_DEFAULT_OPEN_API].freeze
26
+ @all_vars ||= [UNSPECIFIED, ERC20_TRANSFER, ERC721_TRANSFER, WALLET_ACTIVITY, SMART_CONTRACT_EVENT_ACTIVITY, UNKNOWN_DEFAULT_OPEN_API].freeze
26
27
  end
27
28
 
28
29
  # 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.9.0
9
+ Generator version: 7.10.0
10
10
 
11
11
  =end
12
12
 
@@ -20,6 +20,7 @@ module Coinbase::Client
20
20
  # List of class defined in oneOf (OpenAPI v3)
21
21
  def openapi_one_of
22
22
  [
23
+ :'WebhookSmartContractEventFilter',
23
24
  :'WebhookWalletActivityFilter'
24
25
  ]
25
26
  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.9.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.9.0
9
+ Generator version: 7.10.0
10
10
 
11
11
  =end
12
12
 
@@ -14,15 +14,15 @@ require 'date'
14
14
  require 'time'
15
15
 
16
16
  module Coinbase::Client
17
- # The risk score of a blockchain address.
18
- class AddressRisk
19
- # The lower the score is, the higher the risk is. The score lies between -100 to 0.
20
- attr_accessor :risk_score
17
+ # Filter for smart contract events. This filter allows the client to specify smart contract addresses to monitor for activities such as contract function calls.
18
+ class WebhookSmartContractEventFilter
19
+ # A list of smart contract addresses to filter on.
20
+ attr_accessor :contract_addresses
21
21
 
22
22
  # Attribute mapping from ruby-style variable name to JSON key.
23
23
  def self.attribute_map
24
24
  {
25
- :'risk_score' => :'risk_score'
25
+ :'contract_addresses' => :'contract_addresses'
26
26
  }
27
27
  end
28
28
 
@@ -34,7 +34,7 @@ module Coinbase::Client
34
34
  # Attribute type mapping.
35
35
  def self.openapi_types
36
36
  {
37
- :'risk_score' => :'Integer'
37
+ :'contract_addresses' => :'Array<String>'
38
38
  }
39
39
  end
40
40
 
@@ -48,21 +48,23 @@ module Coinbase::Client
48
48
  # @param [Hash] attributes Model attributes in the form of hash
49
49
  def initialize(attributes = {})
50
50
  if (!attributes.is_a?(Hash))
51
- fail ArgumentError, "The input argument (attributes) must be a hash in `Coinbase::Client::AddressRisk` initialize method"
51
+ fail ArgumentError, "The input argument (attributes) must be a hash in `Coinbase::Client::WebhookSmartContractEventFilter` initialize method"
52
52
  end
53
53
 
54
54
  # check to see if the attribute exists and convert string to symbol for hash key
55
55
  attributes = attributes.each_with_object({}) { |(k, v), h|
56
56
  if (!self.class.attribute_map.key?(k.to_sym))
57
- fail ArgumentError, "`#{k}` is not a valid attribute in `Coinbase::Client::AddressRisk`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
57
+ fail ArgumentError, "`#{k}` is not a valid attribute in `Coinbase::Client::WebhookSmartContractEventFilter`. Please check the name to make sure it's valid. List of attributes: " + self.class.attribute_map.keys.inspect
58
58
  end
59
59
  h[k.to_sym] = v
60
60
  }
61
61
 
62
- if attributes.key?(:'risk_score')
63
- self.risk_score = attributes[:'risk_score']
62
+ if attributes.key?(:'contract_addresses')
63
+ if (value = attributes[:'contract_addresses']).is_a?(Array)
64
+ self.contract_addresses = value
65
+ end
64
66
  else
65
- self.risk_score = nil
67
+ self.contract_addresses = nil
66
68
  end
67
69
  end
68
70
 
@@ -71,8 +73,8 @@ module Coinbase::Client
71
73
  def list_invalid_properties
72
74
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
73
75
  invalid_properties = Array.new
74
- if @risk_score.nil?
75
- invalid_properties.push('invalid value for "risk_score", risk_score cannot be nil.')
76
+ if @contract_addresses.nil?
77
+ invalid_properties.push('invalid value for "contract_addresses", contract_addresses cannot be nil.')
76
78
  end
77
79
 
78
80
  invalid_properties
@@ -82,7 +84,7 @@ module Coinbase::Client
82
84
  # @return true if the model is valid
83
85
  def valid?
84
86
  warn '[DEPRECATED] the `valid?` method is obsolete'
85
- return false if @risk_score.nil?
87
+ return false if @contract_addresses.nil?
86
88
  true
87
89
  end
88
90
 
@@ -91,7 +93,7 @@ module Coinbase::Client
91
93
  def ==(o)
92
94
  return true if self.equal?(o)
93
95
  self.class == o.class &&
94
- risk_score == o.risk_score
96
+ contract_addresses == o.contract_addresses
95
97
  end
96
98
 
97
99
  # @see the `==` method
@@ -103,7 +105,7 @@ module Coinbase::Client
103
105
  # Calculates hash code according to all attributes.
104
106
  # @return [Integer] Hash code
105
107
  def hash
106
- [risk_score].hash
108
+ [contract_addresses].hash
107
109
  end
108
110
 
109
111
  # Builds the object from hash
@@ -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.9.0
9
+ Generator version: 7.10.0
10
10
 
11
11
  =end
12
12
 
@@ -72,6 +72,8 @@ module Coinbase::Client
72
72
 
73
73
  if attributes.key?(:'wallet_id')
74
74
  self.wallet_id = attributes[:'wallet_id']
75
+ else
76
+ self.wallet_id = nil
75
77
  end
76
78
  end
77
79
 
@@ -80,6 +82,10 @@ module Coinbase::Client
80
82
  def list_invalid_properties
81
83
  warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
82
84
  invalid_properties = Array.new
85
+ if @wallet_id.nil?
86
+ invalid_properties.push('invalid value for "wallet_id", wallet_id cannot be nil.')
87
+ end
88
+
83
89
  invalid_properties
84
90
  end
85
91
 
@@ -87,6 +93,7 @@ module Coinbase::Client
87
93
  # @return true if the model is valid
88
94
  def valid?
89
95
  warn '[DEPRECATED] the `valid?` method is obsolete'
96
+ return false if @wallet_id.nil?
90
97
  true
91
98
  end
92
99
 
@@ -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.9.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.9.0
9
+ Generator version: 7.10.0
10
10
 
11
11
  =end
12
12
 
@@ -23,14 +23,13 @@ Coinbase::Client.autoload :AddressHistoricalBalanceList, 'coinbase/client/models
23
23
  Coinbase::Client.autoload :AddressList, 'coinbase/client/models/address_list'
24
24
  Coinbase::Client.autoload :AddressReputation, 'coinbase/client/models/address_reputation'
25
25
  Coinbase::Client.autoload :AddressReputationMetadata, 'coinbase/client/models/address_reputation_metadata'
26
- Coinbase::Client.autoload :AddressRisk, 'coinbase/client/models/address_risk'
27
26
  Coinbase::Client.autoload :AddressTransactionList, 'coinbase/client/models/address_transaction_list'
28
27
  Coinbase::Client.autoload :Asset, 'coinbase/client/models/asset'
29
28
  Coinbase::Client.autoload :Balance, 'coinbase/client/models/balance'
30
29
  Coinbase::Client.autoload :BroadcastContractInvocationRequest, 'coinbase/client/models/broadcast_contract_invocation_request'
30
+ Coinbase::Client.autoload :BroadcastExternalTransferRequest, 'coinbase/client/models/broadcast_external_transfer_request'
31
31
  Coinbase::Client.autoload :BroadcastStakingOperationRequest, 'coinbase/client/models/broadcast_staking_operation_request'
32
32
  Coinbase::Client.autoload :BroadcastTradeRequest, 'coinbase/client/models/broadcast_trade_request'
33
- Coinbase::Client.autoload :BroadcastTransferRequest, 'coinbase/client/models/broadcast_transfer_request'
34
33
  Coinbase::Client.autoload :BuildStakingOperationRequest, 'coinbase/client/models/build_staking_operation_request'
35
34
  Coinbase::Client.autoload :ContractEvent, 'coinbase/client/models/contract_event'
36
35
  Coinbase::Client.autoload :ContractEventList, 'coinbase/client/models/contract_event_list'
@@ -38,6 +37,7 @@ Coinbase::Client.autoload :ContractInvocation, 'coinbase/client/models/contract_
38
37
  Coinbase::Client.autoload :ContractInvocationList, 'coinbase/client/models/contract_invocation_list'
39
38
  Coinbase::Client.autoload :CreateAddressRequest, 'coinbase/client/models/create_address_request'
40
39
  Coinbase::Client.autoload :CreateContractInvocationRequest, 'coinbase/client/models/create_contract_invocation_request'
40
+ Coinbase::Client.autoload :CreateExternalTransferRequest, 'coinbase/client/models/create_external_transfer_request'
41
41
  Coinbase::Client.autoload :CreateFundOperationRequest, 'coinbase/client/models/create_fund_operation_request'
42
42
  Coinbase::Client.autoload :CreateFundQuoteRequest, 'coinbase/client/models/create_fund_quote_request'
43
43
  Coinbase::Client.autoload :CreatePayloadSignatureRequest, 'coinbase/client/models/create_payload_signature_request'
@@ -82,6 +82,7 @@ Coinbase::Client.autoload :OnchainNameList, 'coinbase/client/models/onchain_name
82
82
  Coinbase::Client.autoload :PayloadSignature, 'coinbase/client/models/payload_signature'
83
83
  Coinbase::Client.autoload :PayloadSignatureList, 'coinbase/client/models/payload_signature_list'
84
84
  Coinbase::Client.autoload :ReadContractRequest, 'coinbase/client/models/read_contract_request'
85
+ Coinbase::Client.autoload :RegisterSmartContractRequest, 'coinbase/client/models/register_smart_contract_request'
85
86
  Coinbase::Client.autoload :SeedCreationEvent, 'coinbase/client/models/seed_creation_event'
86
87
  Coinbase::Client.autoload :SeedCreationEventResult, 'coinbase/client/models/seed_creation_event_result'
87
88
  Coinbase::Client.autoload :ServerSigner, 'coinbase/client/models/server_signer'
@@ -93,6 +94,7 @@ Coinbase::Client.autoload :SignatureCreationEvent, 'coinbase/client/models/signa
93
94
  Coinbase::Client.autoload :SignatureCreationEventResult, 'coinbase/client/models/signature_creation_event_result'
94
95
  Coinbase::Client.autoload :SignedVoluntaryExitMessageMetadata, 'coinbase/client/models/signed_voluntary_exit_message_metadata'
95
96
  Coinbase::Client.autoload :SmartContract, 'coinbase/client/models/smart_contract'
97
+ Coinbase::Client.autoload :SmartContractActivityEvent, 'coinbase/client/models/smart_contract_activity_event'
96
98
  Coinbase::Client.autoload :SmartContractList, 'coinbase/client/models/smart_contract_list'
97
99
  Coinbase::Client.autoload :SmartContractOptions, 'coinbase/client/models/smart_contract_options'
98
100
  Coinbase::Client.autoload :SmartContractType, 'coinbase/client/models/smart_contract_type'
@@ -115,6 +117,7 @@ Coinbase::Client.autoload :TransactionContent, 'coinbase/client/models/transacti
115
117
  Coinbase::Client.autoload :TransactionType, 'coinbase/client/models/transaction_type'
116
118
  Coinbase::Client.autoload :Transfer, 'coinbase/client/models/transfer'
117
119
  Coinbase::Client.autoload :TransferList, 'coinbase/client/models/transfer_list'
120
+ Coinbase::Client.autoload :UpdateSmartContractRequest, 'coinbase/client/models/update_smart_contract_request'
118
121
  Coinbase::Client.autoload :UpdateWebhookRequest, 'coinbase/client/models/update_webhook_request'
119
122
  Coinbase::Client.autoload :User, 'coinbase/client/models/user'
120
123
  Coinbase::Client.autoload :Validator, 'coinbase/client/models/validator'
@@ -128,6 +131,7 @@ Coinbase::Client.autoload :WebhookEventFilter, 'coinbase/client/models/webhook_e
128
131
  Coinbase::Client.autoload :WebhookEventType, 'coinbase/client/models/webhook_event_type'
129
132
  Coinbase::Client.autoload :WebhookEventTypeFilter, 'coinbase/client/models/webhook_event_type_filter'
130
133
  Coinbase::Client.autoload :WebhookList, 'coinbase/client/models/webhook_list'
134
+ Coinbase::Client.autoload :WebhookSmartContractEventFilter, 'coinbase/client/models/webhook_smart_contract_event_filter'
131
135
  Coinbase::Client.autoload :WebhookWalletActivityFilter, 'coinbase/client/models/webhook_wallet_activity_filter'
132
136
 
133
137
  # APIs
@@ -84,6 +84,14 @@ module Coinbase
84
84
  end
85
85
  end
86
86
 
87
+ # An error raised when attempting to manage an external contract on-chain,
88
+ # e.g. sign the deployment tx, deploy the contract, etc...
89
+ class ManageExternalContractError < StandardError
90
+ def initialize(action = 'manage')
91
+ super("Cannot #{action} external smart contract")
92
+ end
93
+ end
94
+
87
95
  # An error raised when an address attempts to sign a transaction without a private key.
88
96
  class AddressCannotSignError < StandardError
89
97
  def initialize(msg = 'Address cannot sign transaction without private key loaded')