coinbase-sdk 0.11.0 → 0.13.0

Sign up to get free protection for your applications and to get access to all the features.
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Coinbase
4
- VERSION = '0.11.0'
4
+ VERSION = '0.13.0'
5
5
  end
@@ -4,27 +4,29 @@ module Coinbase
4
4
  class Wallet
5
5
  # The data required to recreate a Wallet.
6
6
  class Data
7
- attr_reader :wallet_id, :seed
7
+ attr_reader :wallet_id, :seed, :network_id
8
8
 
9
9
  # Returns a new Data object.
10
10
  # @param wallet_id [String] The ID of the Wallet
11
11
  # @param seed [String] The seed of the Wallet
12
- def initialize(wallet_id:, seed:)
12
+ # @param network_id [String, nil] The network ID of the Wallet (optional)
13
+ def initialize(wallet_id:, seed:, network_id: nil)
13
14
  @wallet_id = wallet_id
14
15
  @seed = seed
16
+ @network_id = network_id
15
17
  end
16
18
 
17
19
  # Converts the Data object to a Hash.
18
20
  # @return [Hash] The Hash representation of the Data object
19
21
  def to_hash
20
- { wallet_id: wallet_id, seed: seed }
22
+ { wallet_id: wallet_id, seed: seed, network_id: network_id }
21
23
  end
22
24
 
23
25
  # Creates a Data object from the given Hash.
24
26
  # @param data [Hash] The Hash to create the Data object from
25
27
  # @return [Data] The new Data object
26
28
  def self.from_hash(data)
27
- Data.new(wallet_id: data['wallet_id'], seed: data['seed'])
29
+ Data.new(wallet_id: data['wallet_id'], seed: data['seed'], network_id: data['network_id'])
28
30
  end
29
31
  end
30
32
  end
@@ -406,7 +406,7 @@ module Coinbase
406
406
 
407
407
  raise 'Cannot export Wallet without loaded seed' if @master.nil?
408
408
 
409
- Data.new(wallet_id: id, seed: @master.seed_hex)
409
+ Data.new(wallet_id: id, seed: @master.seed_hex, network_id: network.id)
410
410
  end
411
411
 
412
412
  # Returns whether the Wallet has a seed with which to derive keys and sign transactions.
@@ -447,7 +447,8 @@ module Coinbase
447
447
  seed: seed_to_store,
448
448
  encrypted: encrypt,
449
449
  auth_tag: auth_tag,
450
- iv: iv
450
+ iv: iv,
451
+ network_id: network.id
451
452
  }
452
453
 
453
454
  File.write(file_path, JSON.pretty_generate(existing_seeds_in_store))
data/lib/coinbase.rb CHANGED
@@ -1,15 +1,16 @@
1
1
  # frozen_string_literal: true
2
2
 
3
+ require_relative 'coinbase/client'
3
4
  require_relative 'coinbase/address'
4
5
  require_relative 'coinbase/address/wallet_address'
5
6
  require_relative 'coinbase/address/external_address'
7
+ require_relative 'coinbase/address_reputation'
6
8
  require_relative 'coinbase/asset'
7
9
  require_relative 'coinbase/authenticator'
8
10
  require_relative 'coinbase/correlation'
9
11
  require_relative 'coinbase/balance'
10
12
  require_relative 'coinbase/balance_map'
11
13
  require_relative 'coinbase/historical_balance'
12
- require_relative 'coinbase/client'
13
14
  require_relative 'coinbase/constants'
14
15
  require_relative 'coinbase/contract_event'
15
16
  require_relative 'coinbase/contract_invocation'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: coinbase-sdk
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.11.0
4
+ version: 0.13.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuga Cohler
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-11-27 00:00:00.000000000 Z
11
+ date: 2024-12-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bigdecimal
@@ -272,6 +272,7 @@ files:
272
272
  - lib/coinbase/address.rb
273
273
  - lib/coinbase/address/external_address.rb
274
274
  - lib/coinbase/address/wallet_address.rb
275
+ - lib/coinbase/address_reputation.rb
275
276
  - lib/coinbase/asset.rb
276
277
  - lib/coinbase/authenticator.rb
277
278
  - lib/coinbase/balance.rb
@@ -306,14 +307,13 @@ files:
306
307
  - lib/coinbase/client/models/address_list.rb
307
308
  - lib/coinbase/client/models/address_reputation.rb
308
309
  - lib/coinbase/client/models/address_reputation_metadata.rb
309
- - lib/coinbase/client/models/address_risk.rb
310
310
  - lib/coinbase/client/models/address_transaction_list.rb
311
311
  - lib/coinbase/client/models/asset.rb
312
312
  - lib/coinbase/client/models/balance.rb
313
313
  - lib/coinbase/client/models/broadcast_contract_invocation_request.rb
314
+ - lib/coinbase/client/models/broadcast_external_transfer_request.rb
314
315
  - lib/coinbase/client/models/broadcast_staking_operation_request.rb
315
316
  - lib/coinbase/client/models/broadcast_trade_request.rb
316
- - lib/coinbase/client/models/broadcast_transfer_request.rb
317
317
  - lib/coinbase/client/models/build_staking_operation_request.rb
318
318
  - lib/coinbase/client/models/contract_event.rb
319
319
  - lib/coinbase/client/models/contract_event_list.rb
@@ -321,6 +321,7 @@ files:
321
321
  - lib/coinbase/client/models/contract_invocation_list.rb
322
322
  - lib/coinbase/client/models/create_address_request.rb
323
323
  - lib/coinbase/client/models/create_contract_invocation_request.rb
324
+ - lib/coinbase/client/models/create_external_transfer_request.rb
324
325
  - lib/coinbase/client/models/create_fund_operation_request.rb
325
326
  - lib/coinbase/client/models/create_fund_quote_request.rb
326
327
  - lib/coinbase/client/models/create_payload_signature_request.rb
@@ -365,6 +366,7 @@ files:
365
366
  - lib/coinbase/client/models/payload_signature.rb
366
367
  - lib/coinbase/client/models/payload_signature_list.rb
367
368
  - lib/coinbase/client/models/read_contract_request.rb
369
+ - lib/coinbase/client/models/register_smart_contract_request.rb
368
370
  - lib/coinbase/client/models/seed_creation_event.rb
369
371
  - lib/coinbase/client/models/seed_creation_event_result.rb
370
372
  - lib/coinbase/client/models/server_signer.rb
@@ -376,6 +378,7 @@ files:
376
378
  - lib/coinbase/client/models/signature_creation_event_result.rb
377
379
  - lib/coinbase/client/models/signed_voluntary_exit_message_metadata.rb
378
380
  - lib/coinbase/client/models/smart_contract.rb
381
+ - lib/coinbase/client/models/smart_contract_activity_event.rb
379
382
  - lib/coinbase/client/models/smart_contract_list.rb
380
383
  - lib/coinbase/client/models/smart_contract_options.rb
381
384
  - lib/coinbase/client/models/smart_contract_type.rb
@@ -398,6 +401,7 @@ files:
398
401
  - lib/coinbase/client/models/transaction_type.rb
399
402
  - lib/coinbase/client/models/transfer.rb
400
403
  - lib/coinbase/client/models/transfer_list.rb
404
+ - lib/coinbase/client/models/update_smart_contract_request.rb
401
405
  - lib/coinbase/client/models/update_webhook_request.rb
402
406
  - lib/coinbase/client/models/user.rb
403
407
  - lib/coinbase/client/models/validator.rb
@@ -411,6 +415,7 @@ files:
411
415
  - lib/coinbase/client/models/webhook_event_type.rb
412
416
  - lib/coinbase/client/models/webhook_event_type_filter.rb
413
417
  - lib/coinbase/client/models/webhook_list.rb
418
+ - lib/coinbase/client/models/webhook_smart_contract_event_filter.rb
414
419
  - lib/coinbase/client/models/webhook_wallet_activity_filter.rb
415
420
  - lib/coinbase/client/version.rb
416
421
  - lib/coinbase/constants.rb
@@ -448,7 +453,7 @@ licenses:
448
453
  - Apache-2.0
449
454
  metadata:
450
455
  rubygems_mfa_required: 'true'
451
- post_install_message:
456
+ post_install_message:
452
457
  rdoc_options: []
453
458
  require_paths:
454
459
  - lib
@@ -464,7 +469,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
464
469
  version: '0'
465
470
  requirements: []
466
471
  rubygems_version: 3.1.6
467
- signing_key:
472
+ signing_key:
468
473
  specification_version: 4
469
474
  summary: Coinbase Ruby SDK
470
475
  test_files: []