coinbase-sdk 0.13.0 → 0.14.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (147) hide show
  1. checksums.yaml +4 -4
  2. data/lib/coinbase/address/wallet_address.rb +6 -3
  3. data/lib/coinbase/client/api/addresses_api.rb +1 -1
  4. data/lib/coinbase/client/api/assets_api.rb +1 -1
  5. data/lib/coinbase/client/api/balance_history_api.rb +1 -1
  6. data/lib/coinbase/client/api/contract_events_api.rb +1 -1
  7. data/lib/coinbase/client/api/contract_invocations_api.rb +1 -1
  8. data/lib/coinbase/client/api/external_addresses_api.rb +1 -1
  9. data/lib/coinbase/client/api/fund_api.rb +1 -1
  10. data/lib/coinbase/client/api/mpc_wallet_stake_api.rb +1 -1
  11. data/lib/coinbase/client/api/networks_api.rb +1 -1
  12. data/lib/coinbase/client/api/onchain_identity_api.rb +1 -1
  13. data/lib/coinbase/client/api/reputation_api.rb +1 -1
  14. data/lib/coinbase/client/api/server_signers_api.rb +1 -1
  15. data/lib/coinbase/client/api/smart_contracts_api.rb +1 -1
  16. data/lib/coinbase/client/api/stake_api.rb +1 -1
  17. data/lib/coinbase/client/api/trades_api.rb +1 -1
  18. data/lib/coinbase/client/api/transaction_history_api.rb +1 -1
  19. data/lib/coinbase/client/api/transfers_api.rb +10 -10
  20. data/lib/coinbase/client/api/users_api.rb +1 -1
  21. data/lib/coinbase/client/api/wallets_api.rb +1 -1
  22. data/lib/coinbase/client/api/webhooks_api.rb +1 -1
  23. data/lib/coinbase/client/api_client.rb +1 -1
  24. data/lib/coinbase/client/api_error.rb +1 -1
  25. data/lib/coinbase/client/configuration.rb +1 -1
  26. data/lib/coinbase/client/models/address.rb +1 -1
  27. data/lib/coinbase/client/models/address_balance_list.rb +1 -1
  28. data/lib/coinbase/client/models/address_historical_balance_list.rb +1 -1
  29. data/lib/coinbase/client/models/address_list.rb +1 -1
  30. data/lib/coinbase/client/models/address_reputation.rb +1 -1
  31. data/lib/coinbase/client/models/address_reputation_metadata.rb +1 -1
  32. data/lib/coinbase/client/models/address_transaction_list.rb +1 -1
  33. data/lib/coinbase/client/models/asset.rb +1 -1
  34. data/lib/coinbase/client/models/balance.rb +1 -1
  35. data/lib/coinbase/client/models/broadcast_contract_invocation_request.rb +1 -1
  36. data/lib/coinbase/client/models/broadcast_external_transfer_request.rb +2 -2
  37. data/lib/coinbase/client/models/broadcast_staking_operation_request.rb +1 -1
  38. data/lib/coinbase/client/models/broadcast_trade_request.rb +1 -1
  39. data/lib/coinbase/client/models/broadcast_transfer_request.rb +222 -0
  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 +15 -5
  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 +1 -1
  54. data/lib/coinbase/client/models/create_trade_request.rb +1 -1
  55. data/lib/coinbase/client/models/create_transfer_request.rb +15 -5
  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 +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 +1 -1
  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 +1 -1
  104. data/lib/coinbase/client/models/smart_contract_activity_event.rb +1 -1
  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 +1 -1
  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 +1 -1
  126. data/lib/coinbase/client/models/transfer_list.rb +1 -1
  127. data/lib/coinbase/client/models/update_smart_contract_request.rb +1 -1
  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 +1 -1
  139. data/lib/coinbase/client/models/webhook_event_type_filter.rb +1 -1
  140. data/lib/coinbase/client/models/webhook_list.rb +1 -1
  141. data/lib/coinbase/client/models/webhook_smart_contract_event_filter.rb +1 -1
  142. data/lib/coinbase/client/models/webhook_wallet_activity_filter.rb +1 -1
  143. data/lib/coinbase/client/version.rb +1 -1
  144. data/lib/coinbase/client.rb +2 -1
  145. data/lib/coinbase/transfer.rb +24 -2
  146. data/lib/coinbase/version.rb +1 -1
  147. metadata +4 -3
@@ -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.10.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.10.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.10.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.10.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.10.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.10.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.10.0
9
+ Generator version: 7.9.0
10
10
 
11
11
  =end
12
12
 
@@ -30,6 +30,7 @@ Coinbase::Client.autoload :BroadcastContractInvocationRequest, 'coinbase/client/
30
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'
33
34
  Coinbase::Client.autoload :BuildStakingOperationRequest, 'coinbase/client/models/build_staking_operation_request'
34
35
  Coinbase::Client.autoload :ContractEvent, 'coinbase/client/models/contract_event'
35
36
  Coinbase::Client.autoload :ContractEventList, 'coinbase/client/models/contract_event_list'
@@ -22,9 +22,24 @@ module Coinbase
22
22
  # If the destination is a String, it uses it as the Address ID.
23
23
  # @param network [Coinbase::Network, Symbol] The Network or Network ID of the Asset
24
24
  # @param wallet_id [String] The Wallet ID of the sending Wallet
25
+ # @param gasless [Boolean] Whether the transfer should be gasless. Defaults to false.
26
+ # @param skip_batching [Boolean] When true, the Transfer will be submitted immediately.
27
+ # Otherwise, the Transfer will be batched. Defaults to false.
28
+ # Note: requires gasless option to be set to true.
25
29
  # @return [Transfer] The new pending Transfer object
26
30
  # @raise [Coinbase::ApiError] If the Transfer fails
27
- def create(address_id:, amount:, asset_id:, destination:, network:, wallet_id:, gasless: false)
31
+ def create(
32
+ address_id:,
33
+ amount:,
34
+ asset_id:,
35
+ destination:,
36
+ network:,
37
+ wallet_id:,
38
+ gasless: false,
39
+ skip_batching: false
40
+ )
41
+ ensure_can_skip_batching!(gasless, skip_batching)
42
+
28
43
  network = Coinbase::Network.from_id(network)
29
44
  asset = network.get_asset(asset_id)
30
45
 
@@ -37,7 +52,8 @@ module Coinbase
37
52
  asset_id: asset.primary_denomination.to_s,
38
53
  destination: Coinbase::Destination.new(destination, network: network).address_id,
39
54
  network_id: network.normalized_id,
40
- gasless: gasless
55
+ gasless: gasless,
56
+ skip_batching: skip_batching
41
57
  }
42
58
  )
43
59
  end
@@ -66,6 +82,12 @@ module Coinbase
66
82
  def fetch_page(wallet_id, address_id, page)
67
83
  transfers_api.list_transfers(wallet_id, address_id, { limit: DEFAULT_PAGE_LIMIT, page: page })
68
84
  end
85
+
86
+ def ensure_can_skip_batching!(gasless, skip_batching)
87
+ return unless skip_batching && !gasless
88
+
89
+ raise ArgumentError, 'Cannot skip batching without gasless option set to true'
90
+ end
69
91
  end
70
92
 
71
93
  # Returns a new Transfer object. Do not use this method directly. Instead, use Wallet#transfer or
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Coinbase
4
- VERSION = '0.13.0'
4
+ VERSION = '0.14.0'
5
5
  end
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.13.0
4
+ version: 0.14.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yuga Cohler
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-12-19 00:00:00.000000000 Z
11
+ date: 2025-01-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bigdecimal
@@ -314,6 +314,7 @@ files:
314
314
  - lib/coinbase/client/models/broadcast_external_transfer_request.rb
315
315
  - lib/coinbase/client/models/broadcast_staking_operation_request.rb
316
316
  - lib/coinbase/client/models/broadcast_trade_request.rb
317
+ - lib/coinbase/client/models/broadcast_transfer_request.rb
317
318
  - lib/coinbase/client/models/build_staking_operation_request.rb
318
319
  - lib/coinbase/client/models/contract_event.rb
319
320
  - lib/coinbase/client/models/contract_event_list.rb
@@ -461,7 +462,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
461
462
  requirements:
462
463
  - - ">="
463
464
  - !ruby/object:Gem::Version
464
- version: 2.7.0
465
+ version: 3.0.0
465
466
  required_rubygems_version: !ruby/object:Gem::Requirement
466
467
  requirements:
467
468
  - - ">="