coinbase-sdk 0.0.8 → 0.0.9

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 (77) hide show
  1. checksums.yaml +4 -4
  2. data/lib/coinbase/address/external_address.rb +173 -0
  3. data/lib/coinbase/address/wallet_address.rb +219 -0
  4. data/lib/coinbase/address.rb +32 -219
  5. data/lib/coinbase/asset.rb +1 -1
  6. data/lib/coinbase/authenticator.rb +2 -0
  7. data/lib/coinbase/client/api/addresses_api.rb +1 -1
  8. data/lib/coinbase/client/api/assets_api.rb +1 -1
  9. data/lib/coinbase/client/api/external_addresses_api.rb +1 -1
  10. data/lib/coinbase/client/api/server_signers_api.rb +1 -1
  11. data/lib/coinbase/client/api/stake_api.rb +1 -1
  12. data/lib/coinbase/client/api/trades_api.rb +1 -1
  13. data/lib/coinbase/client/api/transfers_api.rb +1 -1
  14. data/lib/coinbase/client/api/users_api.rb +1 -1
  15. data/lib/coinbase/client/api/wallets_api.rb +1 -1
  16. data/lib/coinbase/client/api_client.rb +3 -3
  17. data/lib/coinbase/client/api_error.rb +1 -1
  18. data/lib/coinbase/client/configuration.rb +1 -1
  19. data/lib/coinbase/client/models/address.rb +1 -1
  20. data/lib/coinbase/client/models/address_balance_list.rb +1 -1
  21. data/lib/coinbase/client/models/address_list.rb +1 -1
  22. data/lib/coinbase/client/models/asset.rb +1 -1
  23. data/lib/coinbase/client/models/balance.rb +1 -1
  24. data/lib/coinbase/client/models/broadcast_trade_request.rb +1 -1
  25. data/lib/coinbase/client/models/broadcast_transfer_request.rb +1 -1
  26. data/lib/coinbase/client/models/build_staking_operation_request.rb +1 -1
  27. data/lib/coinbase/client/models/create_address_request.rb +1 -1
  28. data/lib/coinbase/client/models/create_server_signer_request.rb +22 -5
  29. data/lib/coinbase/client/models/create_trade_request.rb +1 -1
  30. data/lib/coinbase/client/models/create_transfer_request.rb +1 -1
  31. data/lib/coinbase/client/models/create_wallet_request.rb +1 -1
  32. data/lib/coinbase/client/models/create_wallet_request_wallet.rb +1 -1
  33. data/lib/coinbase/client/models/error.rb +1 -1
  34. data/lib/coinbase/client/models/faucet_transaction.rb +23 -5
  35. data/lib/coinbase/client/models/feature.rb +1 -1
  36. data/lib/coinbase/client/models/fetch_staking_rewards200_response.rb +1 -1
  37. data/lib/coinbase/client/models/fetch_staking_rewards_request.rb +2 -15
  38. data/lib/coinbase/client/models/get_staking_context_request.rb +1 -1
  39. data/lib/coinbase/client/models/partial_eth_staking_context.rb +4 -7
  40. data/lib/coinbase/client/models/seed_creation_event.rb +1 -1
  41. data/lib/coinbase/client/models/seed_creation_event_result.rb +1 -1
  42. data/lib/coinbase/client/models/server_signer.rb +22 -5
  43. data/lib/coinbase/client/models/server_signer_event.rb +1 -1
  44. data/lib/coinbase/client/models/server_signer_event_event.rb +1 -1
  45. data/lib/coinbase/client/models/server_signer_event_list.rb +1 -1
  46. data/lib/coinbase/client/models/server_signer_list.rb +1 -1
  47. data/lib/coinbase/client/models/signature_creation_event.rb +1 -1
  48. data/lib/coinbase/client/models/signature_creation_event_result.rb +1 -1
  49. data/lib/coinbase/client/models/staking_context.rb +1 -1
  50. data/lib/coinbase/client/models/staking_context_context.rb +1 -1
  51. data/lib/coinbase/client/models/staking_operation.rb +15 -12
  52. data/lib/coinbase/client/models/staking_reward.rb +21 -5
  53. data/lib/coinbase/client/models/staking_reward_format.rb +40 -0
  54. data/lib/coinbase/client/models/trade.rb +1 -1
  55. data/lib/coinbase/client/models/trade_list.rb +1 -1
  56. data/lib/coinbase/client/models/transaction.rb +1 -1
  57. data/lib/coinbase/client/models/transaction_type.rb +1 -1
  58. data/lib/coinbase/client/models/transfer.rb +1 -1
  59. data/lib/coinbase/client/models/transfer_list.rb +1 -1
  60. data/lib/coinbase/client/models/user.rb +1 -1
  61. data/lib/coinbase/client/models/wallet.rb +1 -1
  62. data/lib/coinbase/client/models/wallet_list.rb +1 -1
  63. data/lib/coinbase/client/version.rb +1 -1
  64. data/lib/coinbase/client.rb +2 -1
  65. data/lib/coinbase/errors.rb +7 -0
  66. data/lib/coinbase/faucet_transaction.rb +5 -4
  67. data/lib/coinbase/pagination.rb +26 -0
  68. data/lib/coinbase/staking_operation.rb +29 -0
  69. data/lib/coinbase/staking_reward.rb +79 -0
  70. data/lib/coinbase/transaction.rb +6 -0
  71. data/lib/coinbase/user.rb +5 -51
  72. data/lib/coinbase/wallet.rb +95 -100
  73. data/lib/coinbase.rb +11 -0
  74. metadata +8 -19
  75. data/lib/coinbase/client/api/balances_api.rb +0 -97
  76. data/lib/coinbase/client/api/transfer_api.rb +0 -114
  77. data/lib/coinbase/client/models/request_faucet_funds200_response.rb +0 -222
@@ -1,50 +1,37 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require_relative 'balance_map'
4
- require_relative 'constants'
5
- require_relative 'wallet'
6
- require 'bigdecimal'
7
- require 'eth'
8
- require 'jimson'
9
-
10
3
  module Coinbase
11
4
  # A representation of a blockchain Address, which is a user-controlled account on a Network. Addresses are used to
12
- # send and receive Assets, and should be created using Wallet#create_address. Addresses require an
13
- # Eth::Key to sign transaction data.
5
+ # send and receive Assets.
6
+ # @attr_reader [Symbol] network_id The Network ID
7
+ # @attr_reader [String] id The onchain Address ID
14
8
  class Address
15
- # Returns a new Address object. Do not use this method directly. Instead, use Wallet#create_address, or use
16
- # the Wallet's default_address.
17
- # @param model [Coinbase::Client::Address] The underlying Address object
18
- # @param key [Eth::Key] The key backing the Address. Can be nil.
19
- def initialize(model, key)
20
- @model = model
21
- @key = key
22
- end
9
+ attr_reader :network_id, :id
23
10
 
24
- # Returns the Network ID of the Address.
25
- # @return [Symbol] The Network ID
26
- def network_id
27
- Coinbase.to_sym(@model.network_id)
11
+ # Returns a new Address object.
12
+ # @param network_id [Symbol] The Network ID
13
+ # @param id [String] The onchain Address ID
14
+ def initialize(network_id, id)
15
+ @network_id = Coinbase.to_sym(network_id)
16
+ @id = id
28
17
  end
29
18
 
30
- # Returns the Wallet ID of the Address.
31
- # @return [String] The Wallet ID
32
- def wallet_id
33
- @model.wallet_id
19
+ # Returns a String representation of the Address.
20
+ # @return [String] a String representation of the Address
21
+ def to_s
22
+ "Coinbase::Address{id: '#{id}', network_id: '#{network_id}'}"
34
23
  end
35
24
 
36
- # Returns the Address ID.
37
- # @return [String] The Address ID
38
- def id
39
- @model.address_id
25
+ # Same as to_s.
26
+ # @return [String] a String representation of the Address
27
+ def inspect
28
+ to_s
40
29
  end
41
30
 
42
- # Sets the private key backing the Address. This key is used to sign transactions.
43
- # @param key [Eth::Key] The key backing the Address
44
- def key=(key)
45
- raise 'Private key is already set' unless @key.nil?
46
-
47
- @key = key
31
+ # Returns true if the Address can sign transactions.
32
+ # @return [Boolean] true if the Address can sign transactions
33
+ def can_sign?
34
+ false
48
35
  end
49
36
 
50
37
  # Returns the balances of the Address.
@@ -52,7 +39,7 @@ module Coinbase
52
39
  # in ETH.
53
40
  def balances
54
41
  response = Coinbase.call_api do
55
- addresses_api.list_address_balances(wallet_id, id)
42
+ addresses_api.list_external_address_balances(Coinbase.normalize_network(network_id), id)
56
43
  end
57
44
 
58
45
  Coinbase::BalanceMap.from_balances(response.data)
@@ -63,7 +50,11 @@ module Coinbase
63
50
  # @return [BigDecimal] The balance of the Asset
64
51
  def balance(asset_id)
65
52
  response = Coinbase.call_api do
66
- addresses_api.get_address_balance(wallet_id, id, Coinbase::Asset.primary_denomination(asset_id).to_s)
53
+ addresses_api.get_external_address_balance(
54
+ Coinbase.normalize_network(network_id),
55
+ id,
56
+ Coinbase::Asset.primary_denomination(asset_id).to_s
57
+ )
67
58
  end
68
59
 
69
60
  return BigDecimal('0') if response.nil?
@@ -71,69 +62,6 @@ module Coinbase
71
62
  Coinbase::Balance.from_model_and_asset_id(response, asset_id).amount
72
63
  end
73
64
 
74
- # Transfers the given amount of the given Asset to the specified address or wallet.
75
- # Only same-network Transfers are supported.
76
- # @param amount [Integer, Float, BigDecimal] The amount of the Asset to send.
77
- # @param asset_id [Symbol] The ID of the Asset to send. For Ether, :eth, :gwei, and :wei are supported.
78
- # @param destination [Wallet | Address | String] The destination of the transfer. If a Wallet, sends to the Wallet's
79
- # default address. If a String, interprets it as the address ID.
80
- # @return [Coinbase::Transfer] The Transfer object.
81
- def transfer(amount, asset_id, destination)
82
- asset = Asset.fetch(network_id, asset_id)
83
-
84
- destination_address, destination_network = destination_address_and_network(destination)
85
-
86
- validate_can_transfer!(amount, asset, destination_network)
87
-
88
- transfer = create_transfer(amount, asset, destination_address)
89
-
90
- # If a server signer is managing keys, it will sign and broadcast the underlying transfer transaction out of band.
91
- return transfer if Coinbase.use_server_signer?
92
-
93
- broadcast_transfer(transfer, transfer.transaction.sign(@key))
94
- end
95
-
96
- # Trades the given amount of the given Asset for another Asset.
97
- # Only same-network Trades are supported.
98
- # @param amount [Integer, Float, BigDecimal] The amount of the Asset to send.
99
- # @param from_asset_id [Symbol] The ID of the Asset to trade from. For Ether, :eth, :gwei, and :wei are supported.
100
- # @param to_asset_id [Symbol] The ID of the Asset to trade to. For Ether, :eth, :gwei, and :wei are supported.
101
- # @return [Coinbase::Trade] The Trade object.
102
- def trade(amount, from_asset_id, to_asset_id)
103
- from_asset = Asset.fetch(network_id, from_asset_id)
104
- to_asset = Asset.fetch(network_id, to_asset_id)
105
-
106
- validate_can_trade!(amount, from_asset)
107
-
108
- trade = create_trade(amount, from_asset, to_asset)
109
-
110
- # NOTE: Trading does not yet support server signers at this point.
111
-
112
- payloads = { signed_payload: trade.transaction.sign(@key) }
113
-
114
- payloads[:approve_tx_signed_payload] = trade.approve_transaction.sign(@key) unless trade.approve_transaction.nil?
115
-
116
- broadcast_trade(trade, **payloads)
117
- end
118
-
119
- # Returns whether the Address has a private key backing it to sign transactions.
120
- # @return [Boolean] Whether the Address has a private key backing it to sign transactions.
121
- def can_sign?
122
- !@key.nil?
123
- end
124
-
125
- # Returns a String representation of the Address.
126
- # @return [String] a String representation of the Address
127
- def to_s
128
- "Coinbase::Address{id: '#{id}', network_id: '#{network_id}', wallet_id: '#{wallet_id}'}"
129
- end
130
-
131
- # Same as to_s.
132
- # @return [String] a String representation of the Address
133
- def inspect
134
- to_s
135
- end
136
-
137
65
  # Requests funds for the address from the faucet and returns the faucet transaction.
138
66
  # This is only supported on testnet networks.
139
67
  # @return [Coinbase::FaucetTransaction] The successful faucet transaction
@@ -141,131 +69,16 @@ module Coinbase
141
69
  # @raise [Coinbase::Client::ApiError] If an unexpected error occurs while requesting faucet funds.
142
70
  def faucet
143
71
  Coinbase.call_api do
144
- Coinbase::FaucetTransaction.new(addresses_api.request_faucet_funds(wallet_id, id))
145
- end
146
- end
147
-
148
- # Exports the Address's private key to a hex string.
149
- # @return [String] The Address's private key as a hex String
150
- def export
151
- raise 'Cannot export key without private key loaded' if @key.nil?
152
-
153
- @key.private_hex
154
- end
155
-
156
- # Returns all of the transfers associated with the address.
157
- # @return [Array<Coinbase::Transfer>] The transfers associated with the address
158
- def transfers
159
- transfers = []
160
- page = nil
161
-
162
- loop do
163
- response = Coinbase.call_api do
164
- transfers_api.list_transfers(wallet_id, id, { limit: 100, page: page })
165
- end
166
-
167
- break if response.data.empty?
168
-
169
- transfers.concat(response.data.map { |transfer| Coinbase::Transfer.new(transfer) })
170
-
171
- break unless response.has_more
172
-
173
- page = response.next_page
72
+ Coinbase::FaucetTransaction.new(
73
+ addresses_api.request_external_faucet_funds(Coinbase.normalize_network(network_id), id)
74
+ )
174
75
  end
175
-
176
- transfers
177
76
  end
178
77
 
179
78
  private
180
79
 
181
80
  def addresses_api
182
- @addresses_api ||= Coinbase::Client::AddressesApi.new(Coinbase.configuration.api_client)
183
- end
184
-
185
- def transfers_api
186
- @transfers_api ||= Coinbase::Client::TransfersApi.new(Coinbase.configuration.api_client)
187
- end
188
-
189
- def trades_api
190
- @trades_api ||= Coinbase::Client::TradesApi.new(Coinbase.configuration.api_client)
191
- end
192
-
193
- def destination_address_and_network(destination)
194
- return [destination.default_address.id, destination.network_id] if destination.is_a?(Wallet)
195
- return [destination.id, destination.network_id] if destination.is_a?(Address)
196
-
197
- [destination, network_id]
198
- end
199
-
200
- def validate_can_transfer!(amount, asset, destination_network_id)
201
- raise 'Cannot transfer from address without private key loaded' unless can_sign? || Coinbase.use_server_signer?
202
-
203
- raise ArgumentError, 'Transfer must be on the same Network' unless destination_network_id == network_id
204
-
205
- current_balance = balance(asset.asset_id)
206
-
207
- return unless current_balance < amount
208
-
209
- raise ArgumentError, "Insufficient funds: #{amount} requested, but only #{current_balance} available"
210
- end
211
-
212
- def create_transfer(amount, asset, destination)
213
- create_transfer_request = {
214
- amount: asset.to_atomic_amount(amount).to_i.to_s,
215
- network_id: network_id,
216
- asset_id: asset.primary_denomination.to_s,
217
- destination: destination
218
- }
219
-
220
- transfer_model = Coinbase.call_api do
221
- transfers_api.create_transfer(wallet_id, id, create_transfer_request)
222
- end
223
-
224
- Coinbase::Transfer.new(transfer_model)
225
- end
226
-
227
- def broadcast_transfer(transfer, signed_payload)
228
- transfer_model = Coinbase.call_api do
229
- transfers_api.broadcast_transfer(wallet_id, id, transfer.id, { signed_payload: signed_payload })
230
- end
231
-
232
- Coinbase::Transfer.new(transfer_model)
233
- end
234
-
235
- def validate_can_trade!(amount, from_asset)
236
- raise 'Cannot trade from address without private key loaded' unless can_sign?
237
-
238
- current_balance = balance(from_asset.asset_id)
239
-
240
- return unless current_balance < amount
241
-
242
- raise ArgumentError, "Insufficient funds: #{amount} requested, but only #{current_balance} available"
243
- end
244
-
245
- def create_trade(amount, from_asset, to_asset)
246
- create_trade_request = {
247
- amount: from_asset.to_atomic_amount(amount).to_i.to_s,
248
- from_asset_id: from_asset.primary_denomination.to_s,
249
- to_asset_id: to_asset.primary_denomination.to_s
250
- }
251
-
252
- trade_model = Coinbase.call_api do
253
- trades_api.create_trade(wallet_id, id, create_trade_request)
254
- end
255
-
256
- Coinbase::Trade.new(trade_model)
257
- end
258
-
259
- def broadcast_trade(trade, signed_payload:, approve_tx_signed_payload: nil)
260
- req = { signed_payload: signed_payload }
261
-
262
- req[:approve_transaction_signed_payload] = approve_tx_signed_payload unless approve_tx_signed_payload.nil?
263
-
264
- trade_model = Coinbase.call_api do
265
- trades_api.broadcast_trade(wallet_id, id, trade.id, req)
266
- end
267
-
268
- Coinbase::Trade.new(trade_model)
81
+ @addresses_api ||= Coinbase::Client::ExternalAddressesApi.new(Coinbase.configuration.api_client)
269
82
  end
270
83
  end
271
84
  end
@@ -23,7 +23,7 @@ module Coinbase
23
23
 
24
24
  # Handle the non-primary denomination case at the asset level.
25
25
  # TODO: Push this logic down to the backend.
26
- if asset_id && asset_id != Coinbase.to_sym(asset_model.asset_id)
26
+ if asset_id && Coinbase.to_sym(asset_id) != Coinbase.to_sym(asset_model.asset_id)
27
27
  case asset_id
28
28
  when :gwei
29
29
  decimals = GWEI_DECIMALS
@@ -45,6 +45,8 @@ module Coinbase
45
45
  uris: [uri]
46
46
  }
47
47
 
48
+ raise Coinbase::InvalidConfiguration, 'API key not configured' unless Coinbase.configured?
49
+
48
50
  private_key = OpenSSL::PKey.read(Coinbase.configuration.api_key_private_key)
49
51
  JWT.encode(claims, private_key, 'ES256', header)
50
52
  end
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
7
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.5.0
9
+ Generator version: 7.6.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
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.5.0
9
+ Generator version: 7.6.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
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.5.0
9
+ Generator version: 7.6.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
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.5.0
9
+ Generator version: 7.6.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
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.5.0
9
+ Generator version: 7.6.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
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.5.0
9
+ Generator version: 7.6.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
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.5.0
9
+ Generator version: 7.6.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
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.5.0
9
+ Generator version: 7.6.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
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.5.0
9
+ Generator version: 7.6.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
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.5.0
9
+ Generator version: 7.6.0
10
10
 
11
11
  =end
12
12
 
@@ -249,7 +249,7 @@ module Coinbase::Client
249
249
  # @param [String] mime MIME
250
250
  # @return [Boolean] True if the MIME is application/json
251
251
  def json_mime?(mime)
252
- (mime == '*/*') || !(mime =~ /Application\/.*json(?!p)(;.*)?/i).nil?
252
+ (mime == '*/*') || !(mime =~ /^Application\/.*json(?!p)(;.*)?/i).nil?
253
253
  end
254
254
 
255
255
  # Deserialize the response to the given return type.
@@ -328,7 +328,7 @@ module Coinbase::Client
328
328
  # @param [String] filename the filename to be sanitized
329
329
  # @return [String] the sanitized filename
330
330
  def sanitize_filename(filename)
331
- filename.gsub(/.*[\/\\]/, '')
331
+ filename.split(/[\/\\]/).last
332
332
  end
333
333
 
334
334
  def build_request_url(path, opts = {})
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
7
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.5.0
9
+ Generator version: 7.6.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
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.5.0
9
+ Generator version: 7.6.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
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.5.0
9
+ Generator version: 7.6.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
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.5.0
9
+ Generator version: 7.6.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
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.5.0
9
+ Generator version: 7.6.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
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.5.0
9
+ Generator version: 7.6.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
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.5.0
9
+ Generator version: 7.6.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
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.5.0
9
+ Generator version: 7.6.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
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.5.0
9
+ Generator version: 7.6.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
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.5.0
9
+ Generator version: 7.6.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
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.5.0
9
+ Generator version: 7.6.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
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.5.0
9
+ Generator version: 7.6.0
10
10
 
11
11
  =end
12
12
 
@@ -21,11 +21,15 @@ module Coinbase::Client
21
21
  # The enrollment data of the server signer. This will be the base64 encoded server-signer-id.
22
22
  attr_accessor :enrollment_data
23
23
 
24
+ # Whether the Server-Signer uses MPC.
25
+ attr_accessor :is_mpc
26
+
24
27
  # Attribute mapping from ruby-style variable name to JSON key.
25
28
  def self.attribute_map
26
29
  {
27
30
  :'server_signer_id' => :'server_signer_id',
28
- :'enrollment_data' => :'enrollment_data'
31
+ :'enrollment_data' => :'enrollment_data',
32
+ :'is_mpc' => :'is_mpc'
29
33
  }
30
34
  end
31
35
 
@@ -38,7 +42,8 @@ module Coinbase::Client
38
42
  def self.openapi_types
39
43
  {
40
44
  :'server_signer_id' => :'String',
41
- :'enrollment_data' => :'String'
45
+ :'enrollment_data' => :'String',
46
+ :'is_mpc' => :'Boolean'
42
47
  }
43
48
  end
44
49
 
@@ -74,6 +79,12 @@ module Coinbase::Client
74
79
  else
75
80
  self.enrollment_data = nil
76
81
  end
82
+
83
+ if attributes.key?(:'is_mpc')
84
+ self.is_mpc = attributes[:'is_mpc']
85
+ else
86
+ self.is_mpc = nil
87
+ end
77
88
  end
78
89
 
79
90
  # Show invalid properties with the reasons. Usually used together with valid?
@@ -89,6 +100,10 @@ module Coinbase::Client
89
100
  invalid_properties.push('invalid value for "enrollment_data", enrollment_data cannot be nil.')
90
101
  end
91
102
 
103
+ if @is_mpc.nil?
104
+ invalid_properties.push('invalid value for "is_mpc", is_mpc cannot be nil.')
105
+ end
106
+
92
107
  invalid_properties
93
108
  end
94
109
 
@@ -98,6 +113,7 @@ module Coinbase::Client
98
113
  warn '[DEPRECATED] the `valid?` method is obsolete'
99
114
  return false if @server_signer_id.nil?
100
115
  return false if @enrollment_data.nil?
116
+ return false if @is_mpc.nil?
101
117
  true
102
118
  end
103
119
 
@@ -107,7 +123,8 @@ module Coinbase::Client
107
123
  return true if self.equal?(o)
108
124
  self.class == o.class &&
109
125
  server_signer_id == o.server_signer_id &&
110
- enrollment_data == o.enrollment_data
126
+ enrollment_data == o.enrollment_data &&
127
+ is_mpc == o.is_mpc
111
128
  end
112
129
 
113
130
  # @see the `==` method
@@ -119,7 +136,7 @@ module Coinbase::Client
119
136
  # Calculates hash code according to all attributes.
120
137
  # @return [Integer] Hash code
121
138
  def hash
122
- [server_signer_id, enrollment_data].hash
139
+ [server_signer_id, enrollment_data, is_mpc].hash
123
140
  end
124
141
 
125
142
  # Builds the object from hash
@@ -6,7 +6,7 @@
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
7
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.5.0
9
+ Generator version: 7.6.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
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.5.0
9
+ Generator version: 7.6.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
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.5.0
9
+ Generator version: 7.6.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
  Contact: yuga.cohler@coinbase.com
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.5.0
9
+ Generator version: 7.6.0
10
10
 
11
11
  =end
12
12