coinbase-sdk 0.10.0 → 0.11.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 (152) hide show
  1. checksums.yaml +4 -4
  2. data/lib/coinbase/address/wallet_address.rb +28 -0
  3. data/lib/coinbase/balance.rb +1 -1
  4. data/lib/coinbase/client/api/addresses_api.rb +1 -1
  5. data/lib/coinbase/client/api/assets_api.rb +1 -1
  6. data/lib/coinbase/client/api/balance_history_api.rb +1 -1
  7. data/lib/coinbase/client/api/contract_events_api.rb +1 -1
  8. data/lib/coinbase/client/api/contract_invocations_api.rb +1 -1
  9. data/lib/coinbase/client/api/external_addresses_api.rb +1 -1
  10. data/lib/coinbase/client/api/fund_api.rb +1 -1
  11. data/lib/coinbase/client/api/{wallet_stake_api.rb → mpc_wallet_stake_api.rb} +21 -21
  12. data/lib/coinbase/client/api/networks_api.rb +1 -1
  13. data/lib/coinbase/client/api/onchain_identity_api.rb +1 -1
  14. data/lib/coinbase/client/api/reputation_api.rb +160 -0
  15. data/lib/coinbase/client/api/server_signers_api.rb +1 -1
  16. data/lib/coinbase/client/api/smart_contracts_api.rb +1 -1
  17. data/lib/coinbase/client/api/stake_api.rb +158 -1
  18. data/lib/coinbase/client/api/trades_api.rb +1 -1
  19. data/lib/coinbase/client/api/transaction_history_api.rb +1 -1
  20. data/lib/coinbase/client/api/transfers_api.rb +1 -1
  21. data/lib/coinbase/client/api/users_api.rb +1 -1
  22. data/lib/coinbase/client/api/wallets_api.rb +1 -1
  23. data/lib/coinbase/client/api/webhooks_api.rb +1 -1
  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 +1 -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 +232 -0
  32. data/lib/coinbase/client/models/address_reputation_metadata.rb +376 -0
  33. data/lib/coinbase/client/models/address_risk.rb +223 -0
  34. data/lib/coinbase/client/models/address_transaction_list.rb +1 -1
  35. data/lib/coinbase/client/models/asset.rb +1 -1
  36. data/lib/coinbase/client/models/balance.rb +1 -1
  37. data/lib/coinbase/client/models/broadcast_contract_invocation_request.rb +1 -1
  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/broadcast_transfer_request.rb +1 -1
  41. data/lib/coinbase/client/models/build_staking_operation_request.rb +2 -1
  42. data/lib/coinbase/client/models/contract_event.rb +1 -1
  43. data/lib/coinbase/client/models/contract_event_list.rb +1 -1
  44. data/lib/coinbase/client/models/contract_invocation.rb +1 -1
  45. data/lib/coinbase/client/models/contract_invocation_list.rb +1 -1
  46. data/lib/coinbase/client/models/create_address_request.rb +1 -1
  47. data/lib/coinbase/client/models/create_contract_invocation_request.rb +1 -1
  48. data/lib/coinbase/client/models/create_fund_operation_request.rb +1 -1
  49. data/lib/coinbase/client/models/create_fund_quote_request.rb +1 -1
  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 +2 -1
  54. data/lib/coinbase/client/models/create_trade_request.rb +1 -1
  55. data/lib/coinbase/client/models/create_transfer_request.rb +1 -1
  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 +1 -1
  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 +2 -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/seed_creation_event.rb +1 -1
  93. data/lib/coinbase/client/models/seed_creation_event_result.rb +1 -1
  94. data/lib/coinbase/client/models/server_signer.rb +1 -1
  95. data/lib/coinbase/client/models/server_signer_event.rb +1 -1
  96. data/lib/coinbase/client/models/server_signer_event_event.rb +1 -1
  97. data/lib/coinbase/client/models/server_signer_event_list.rb +1 -1
  98. data/lib/coinbase/client/models/server_signer_list.rb +1 -1
  99. data/lib/coinbase/client/models/signature_creation_event.rb +1 -1
  100. data/lib/coinbase/client/models/signature_creation_event_result.rb +1 -1
  101. data/lib/coinbase/client/models/signed_voluntary_exit_message_metadata.rb +1 -1
  102. data/lib/coinbase/client/models/smart_contract.rb +1 -1
  103. data/lib/coinbase/client/models/smart_contract_list.rb +1 -1
  104. data/lib/coinbase/client/models/smart_contract_options.rb +1 -1
  105. data/lib/coinbase/client/models/smart_contract_type.rb +1 -1
  106. data/lib/coinbase/client/models/solidity_value.rb +3 -3
  107. data/lib/coinbase/client/models/sponsored_send.rb +1 -1
  108. data/lib/coinbase/client/models/staking_balance.rb +1 -1
  109. data/lib/coinbase/client/models/staking_context.rb +1 -1
  110. data/lib/coinbase/client/models/staking_context_context.rb +1 -1
  111. data/lib/coinbase/client/models/staking_operation.rb +1 -1
  112. data/lib/coinbase/client/models/staking_operation_metadata.rb +1 -1
  113. data/lib/coinbase/client/models/staking_reward.rb +1 -1
  114. data/lib/coinbase/client/models/staking_reward_format.rb +1 -1
  115. data/lib/coinbase/client/models/staking_reward_usd_value.rb +1 -1
  116. data/lib/coinbase/client/models/token_contract_options.rb +1 -1
  117. data/lib/coinbase/client/models/token_transfer_type.rb +1 -1
  118. data/lib/coinbase/client/models/trade.rb +1 -1
  119. data/lib/coinbase/client/models/trade_list.rb +1 -1
  120. data/lib/coinbase/client/models/transaction.rb +1 -1
  121. data/lib/coinbase/client/models/transaction_content.rb +1 -1
  122. data/lib/coinbase/client/models/transaction_type.rb +1 -1
  123. data/lib/coinbase/client/models/transfer.rb +1 -1
  124. data/lib/coinbase/client/models/transfer_list.rb +1 -1
  125. data/lib/coinbase/client/models/update_webhook_request.rb +1 -1
  126. data/lib/coinbase/client/models/user.rb +1 -1
  127. data/lib/coinbase/client/models/validator.rb +1 -1
  128. data/lib/coinbase/client/models/validator_details.rb +1 -1
  129. data/lib/coinbase/client/models/validator_list.rb +1 -1
  130. data/lib/coinbase/client/models/validator_status.rb +1 -1
  131. data/lib/coinbase/client/models/wallet.rb +1 -1
  132. data/lib/coinbase/client/models/wallet_list.rb +1 -1
  133. data/lib/coinbase/client/models/webhook.rb +1 -1
  134. data/lib/coinbase/client/models/webhook_event_filter.rb +1 -1
  135. data/lib/coinbase/client/models/webhook_event_type.rb +1 -1
  136. data/lib/coinbase/client/models/webhook_event_type_filter.rb +1 -1
  137. data/lib/coinbase/client/models/webhook_list.rb +1 -1
  138. data/lib/coinbase/client/models/webhook_wallet_activity_filter.rb +1 -1
  139. data/lib/coinbase/client/version.rb +1 -1
  140. data/lib/coinbase/client.rb +6 -3
  141. data/lib/coinbase/crypto_amount.rb +62 -0
  142. data/lib/coinbase/fiat_amount.rb +40 -0
  143. data/lib/coinbase/fund_operation.rb +228 -0
  144. data/lib/coinbase/fund_quote.rb +149 -0
  145. data/lib/coinbase/smart_contract.rb +2 -2
  146. data/lib/coinbase/staking_operation.rb +2 -2
  147. data/lib/coinbase/validator.rb +7 -10
  148. data/lib/coinbase/version.rb +1 -1
  149. data/lib/coinbase/wallet.rb +13 -1
  150. data/lib/coinbase.rb +4 -0
  151. metadata +11 -4
  152. 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.9.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.9.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.9.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.9.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.9.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.9.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.9.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.9.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.9.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.9.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.9.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.9.0
10
10
 
11
11
  =end
12
12
 
@@ -0,0 +1,232 @@
1
+ =begin
2
+ #Coinbase Platform API
3
+
4
+ #This is the OpenAPI 3.0 specification for the Coinbase Platform APIs, used in conjunction with the Coinbase Platform SDKs.
5
+
6
+ The version of the OpenAPI document: 0.0.1-alpha
7
+
8
+ Generated by: https://openapi-generator.tech
9
+ Generator version: 7.9.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 reputation score of a wallet address which lie between 0 to 100.
20
+ attr_accessor :reputation_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
+ :'reputation_score' => :'reputation_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
+ :'reputation_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?(:'reputation_score')
67
+ self.reputation_score = attributes[:'reputation_score']
68
+ end
69
+
70
+ if attributes.key?(:'metadata')
71
+ self.metadata = attributes[:'metadata']
72
+ else
73
+ self.metadata = nil
74
+ end
75
+ end
76
+
77
+ # Show invalid properties with the reasons. Usually used together with valid?
78
+ # @return Array for valid properties with the reasons
79
+ def list_invalid_properties
80
+ warn '[DEPRECATED] the `list_invalid_properties` method is obsolete'
81
+ invalid_properties = Array.new
82
+ if @metadata.nil?
83
+ invalid_properties.push('invalid value for "metadata", metadata cannot be nil.')
84
+ end
85
+
86
+ invalid_properties
87
+ end
88
+
89
+ # Check to see if the all the properties in the model are valid
90
+ # @return true if the model is valid
91
+ def valid?
92
+ warn '[DEPRECATED] the `valid?` method is obsolete'
93
+ return false if @metadata.nil?
94
+ true
95
+ end
96
+
97
+ # Checks equality by comparing each attribute.
98
+ # @param [Object] Object to be compared
99
+ def ==(o)
100
+ return true if self.equal?(o)
101
+ self.class == o.class &&
102
+ reputation_score == o.reputation_score &&
103
+ metadata == o.metadata
104
+ end
105
+
106
+ # @see the `==` method
107
+ # @param [Object] Object to be compared
108
+ def eql?(o)
109
+ self == o
110
+ end
111
+
112
+ # Calculates hash code according to all attributes.
113
+ # @return [Integer] Hash code
114
+ def hash
115
+ [reputation_score, metadata].hash
116
+ end
117
+
118
+ # Builds the object from hash
119
+ # @param [Hash] attributes Model attributes in the form of hash
120
+ # @return [Object] Returns the model itself
121
+ def self.build_from_hash(attributes)
122
+ return nil unless attributes.is_a?(Hash)
123
+ attributes = attributes.transform_keys(&:to_sym)
124
+ transformed_hash = {}
125
+ openapi_types.each_pair do |key, type|
126
+ if attributes.key?(attribute_map[key]) && attributes[attribute_map[key]].nil?
127
+ transformed_hash["#{key}"] = nil
128
+ elsif type =~ /\AArray<(.*)>/i
129
+ # check to ensure the input is an array given that the attribute
130
+ # is documented as an array but the input is not
131
+ if attributes[attribute_map[key]].is_a?(Array)
132
+ transformed_hash["#{key}"] = attributes[attribute_map[key]].map { |v| _deserialize($1, v) }
133
+ end
134
+ elsif !attributes[attribute_map[key]].nil?
135
+ transformed_hash["#{key}"] = _deserialize(type, attributes[attribute_map[key]])
136
+ end
137
+ end
138
+ new(transformed_hash)
139
+ end
140
+
141
+ # Deserializes the data based on type
142
+ # @param string type Data type
143
+ # @param string value Value to be deserialized
144
+ # @return [Object] Deserialized data
145
+ def self._deserialize(type, value)
146
+ case type.to_sym
147
+ when :Time
148
+ Time.parse(value)
149
+ when :Date
150
+ Date.parse(value)
151
+ when :String
152
+ value.to_s
153
+ when :Integer
154
+ value.to_i
155
+ when :Float
156
+ value.to_f
157
+ when :Boolean
158
+ if value.to_s =~ /\A(true|t|yes|y|1)\z/i
159
+ true
160
+ else
161
+ false
162
+ end
163
+ when :Object
164
+ # generic object (usually a Hash), return directly
165
+ value
166
+ when /\AArray<(?<inner_type>.+)>\z/
167
+ inner_type = Regexp.last_match[:inner_type]
168
+ value.map { |v| _deserialize(inner_type, v) }
169
+ when /\AHash<(?<k_type>.+?), (?<v_type>.+)>\z/
170
+ k_type = Regexp.last_match[:k_type]
171
+ v_type = Regexp.last_match[:v_type]
172
+ {}.tap do |hash|
173
+ value.each do |k, v|
174
+ hash[_deserialize(k_type, k)] = _deserialize(v_type, v)
175
+ end
176
+ end
177
+ else # model
178
+ # models (e.g. Pet) or oneOf
179
+ klass = Coinbase::Client.const_get(type)
180
+ klass.respond_to?(:openapi_any_of) || klass.respond_to?(:openapi_one_of) ? klass.build(value) : klass.build_from_hash(value)
181
+ end
182
+ end
183
+
184
+ # Returns the string representation of the object
185
+ # @return [String] String presentation of the object
186
+ def to_s
187
+ to_hash.to_s
188
+ end
189
+
190
+ # to_body is an alias to to_hash (backward compatibility)
191
+ # @return [Hash] Returns the object in the form of hash
192
+ def to_body
193
+ to_hash
194
+ end
195
+
196
+ # Returns the object in the form of hash
197
+ # @return [Hash] Returns the object in the form of hash
198
+ def to_hash
199
+ hash = {}
200
+ self.class.attribute_map.each_pair do |attr, param|
201
+ value = self.send(attr)
202
+ if value.nil?
203
+ is_nullable = self.class.openapi_nullable.include?(attr)
204
+ next if !is_nullable || (is_nullable && !instance_variable_defined?(:"@#{attr}"))
205
+ end
206
+
207
+ hash[param] = _to_hash(value)
208
+ end
209
+ hash
210
+ end
211
+
212
+ # Outputs non-array value in the form of hash
213
+ # For object, use to_hash. Otherwise, just return the value
214
+ # @param [Object] value Any valid value
215
+ # @return [Hash] Returns the value in the form of hash
216
+ def _to_hash(value)
217
+ if value.is_a?(Array)
218
+ value.compact.map { |v| _to_hash(v) }
219
+ elsif value.is_a?(Hash)
220
+ {}.tap do |hash|
221
+ value.each { |k, v| hash[k] = _to_hash(v) }
222
+ end
223
+ elsif value.respond_to? :to_hash
224
+ value.to_hash
225
+ else
226
+ value
227
+ end
228
+ end
229
+
230
+ end
231
+
232
+ end