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
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: bf3cd3f21e8ca2443b776f6cc4c276dde8199a595087cce2e924318a91f7f0bf
4
- data.tar.gz: 404b48c42fcdf6cda2062439ee9e17104912fdf7f359e5e60c1a2d8b95fce50a
3
+ metadata.gz: 951362a2f79356900b824b455f3ca5bd63e11170bf566d5a371b21980f37be90
4
+ data.tar.gz: e997072e7aa5686d3647ff8ceb6f25f4b79c847a2362b6c644d65d1428488878
5
5
  SHA512:
6
- metadata.gz: 77b9bb44dc2d19bd6005bb274786679c0cc47586a90ad77c7288256ebd5ea6a0126fcdd751c73941b2786835d427864cd78d9ccfc3b2275164434c9b0e5c58a8
7
- data.tar.gz: de1b59e1e4e3b077e65dbbc4d1a85ec988a4327cd29ecd9bec9167dbbf39762ad79df36ae508e25b48f87c9c4746069672baf52df86564434234208ec44731cf
6
+ metadata.gz: a1a13c7b746fb4fe1bfeb6ac8a2d1647df144c50a180dcf1e99616c20a3283e14b7958288443e82be92d21294220d2a15907f84e027772c961562f2b1ccde4ea
7
+ data.tar.gz: c6f8354c8940c6150300fd0f4b0d08f8810dc99d8b0a790d5c32b74a0c0962549f5f37ba47ee73969bac79e007effbebd591b673be158bde904ab82d047b1246
@@ -17,7 +17,14 @@ module Coinbase
17
17
  # Returns a String representation of the Address.
18
18
  # @return [String] a String representation of the Address
19
19
  def to_s
20
- Coinbase.pretty_print_object(self.class, id: id, network_id: network.id)
20
+ Coinbase.pretty_print_object(
21
+ self.class,
22
+ **{
23
+ id: id,
24
+ network_id: network.id,
25
+ reputation_score: @reputation.nil? ? nil : reputation.score
26
+ }.compact
27
+ )
21
28
  end
22
29
 
23
30
  # Same as to_s.
@@ -32,6 +39,18 @@ module Coinbase
32
39
  false
33
40
  end
34
41
 
42
+ # Returns the reputation of the Address.
43
+ # @return [Coinbase::AddressReputation] The reputation of the Address
44
+ def reputation
45
+ @reputation ||= Coinbase::AddressReputation.fetch(network: network, address_id: id)
46
+ end
47
+
48
+ # Returns wheth the Address's reputation is risky.
49
+ # @return [Boolean] true if the Address's reputation is risky
50
+ def risky?
51
+ reputation.risky?
52
+ end
53
+
35
54
  # Returns the balances of the Address.
36
55
  # @return [BalanceMap] The balances of the Address, keyed by asset ID. Ether balances are denominated
37
56
  # in ETH.
@@ -66,7 +85,7 @@ module Coinbase
66
85
  # @return [Enumerable<Coinbase::HistoricalBalance>] Enumerator that returns historical_balance
67
86
  def historical_balances(asset_id)
68
87
  Coinbase::Pagination.enumerate(
69
- ->(page) { list_page(asset_id, page) }
88
+ ->(page) { list_historical_balance_page(asset_id, page) }
70
89
  ) do |historical_balance|
71
90
  Coinbase::HistoricalBalance.from_model(historical_balance)
72
91
  end
@@ -265,7 +284,7 @@ module Coinbase
265
284
  @stake_api ||= Coinbase::Client::StakeApi.new(Coinbase.configuration.api_client)
266
285
  end
267
286
 
268
- def list_page(asset_id, page)
287
+ def list_historical_balance_page(asset_id, page)
269
288
  balance_history_api.list_address_historical_balance(
270
289
  network.normalized_id,
271
290
  id,
@@ -0,0 +1,67 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Coinbase
4
+ # A representation of the reputation of a blockchain address.
5
+ class AddressReputation
6
+ # A metadata object associated with an address reputation.
7
+ Metadata = Struct.new(
8
+ *Client::AddressReputationMetadata.attribute_map.keys.map(&:to_sym),
9
+ keyword_init: true
10
+ ) do
11
+ def to_s
12
+ Coinbase.pretty_print_object(
13
+ self.class,
14
+ **to_h
15
+ )
16
+ end
17
+ end
18
+
19
+ class << self
20
+ def fetch(address_id:, network: Coinbase.default_network)
21
+ network = Coinbase::Network.from_id(network)
22
+
23
+ model = Coinbase.call_api do
24
+ reputation_api.get_address_reputation(network.normalized_id, address_id)
25
+ end
26
+
27
+ new(model)
28
+ end
29
+
30
+ private
31
+
32
+ def reputation_api
33
+ Coinbase::Client::ReputationApi.new(Coinbase.configuration.api_client)
34
+ end
35
+ end
36
+
37
+ def initialize(model)
38
+ raise ArgumentError, 'must be an AddressReputation object' unless model.is_a?(Coinbase::Client::AddressReputation)
39
+
40
+ @model = model
41
+ end
42
+
43
+ def score
44
+ @model.score
45
+ end
46
+
47
+ def metadata
48
+ @metadata ||= Metadata.new(**@model.metadata)
49
+ end
50
+
51
+ def risky?
52
+ score.negative?
53
+ end
54
+
55
+ def to_s
56
+ Coinbase.pretty_print_object(
57
+ self.class,
58
+ score: score,
59
+ **metadata.to_h
60
+ )
61
+ end
62
+
63
+ def inspect
64
+ to_s
65
+ end
66
+ end
67
+ 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
 
@@ -70,7 +70,7 @@ module Coinbase::Client
70
70
  return_type = opts[:debug_return_type] || 'Address'
71
71
 
72
72
  # auth_names
73
- auth_names = opts[:debug_auth_names] || []
73
+ auth_names = opts[:debug_auth_names] || ['apiKey']
74
74
 
75
75
  new_options = opts.merge(
76
76
  :operation => :"AddressesApi.create_address",
@@ -146,7 +146,7 @@ module Coinbase::Client
146
146
  return_type = opts[:debug_return_type] || 'PayloadSignature'
147
147
 
148
148
  # auth_names
149
- auth_names = opts[:debug_auth_names] || []
149
+ auth_names = opts[:debug_auth_names] || ['apiKey']
150
150
 
151
151
  new_options = opts.merge(
152
152
  :operation => :"AddressesApi.create_payload_signature",
@@ -215,7 +215,7 @@ module Coinbase::Client
215
215
  return_type = opts[:debug_return_type] || 'Address'
216
216
 
217
217
  # auth_names
218
- auth_names = opts[:debug_auth_names] || []
218
+ auth_names = opts[:debug_auth_names] || ['apiKey', 'session']
219
219
 
220
220
  new_options = opts.merge(
221
221
  :operation => :"AddressesApi.get_address",
@@ -290,7 +290,7 @@ module Coinbase::Client
290
290
  return_type = opts[:debug_return_type] || 'Balance'
291
291
 
292
292
  # auth_names
293
- auth_names = opts[:debug_auth_names] || []
293
+ auth_names = opts[:debug_auth_names] || ['apiKey', 'session']
294
294
 
295
295
  new_options = opts.merge(
296
296
  :operation => :"AddressesApi.get_address_balance",
@@ -365,7 +365,7 @@ module Coinbase::Client
365
365
  return_type = opts[:debug_return_type] || 'PayloadSignature'
366
366
 
367
367
  # auth_names
368
- auth_names = opts[:debug_auth_names] || []
368
+ auth_names = opts[:debug_auth_names] || ['apiKey', 'session']
369
369
 
370
370
  new_options = opts.merge(
371
371
  :operation => :"AddressesApi.get_payload_signature",
@@ -441,7 +441,7 @@ module Coinbase::Client
441
441
  return_type = opts[:debug_return_type] || 'AddressBalanceList'
442
442
 
443
443
  # auth_names
444
- auth_names = opts[:debug_auth_names] || []
444
+ auth_names = opts[:debug_auth_names] || ['apiKey', 'session']
445
445
 
446
446
  new_options = opts.merge(
447
447
  :operation => :"AddressesApi.list_address_balances",
@@ -514,7 +514,7 @@ module Coinbase::Client
514
514
  return_type = opts[:debug_return_type] || 'AddressList'
515
515
 
516
516
  # auth_names
517
- auth_names = opts[:debug_auth_names] || []
517
+ auth_names = opts[:debug_auth_names] || ['apiKey', 'session']
518
518
 
519
519
  new_options = opts.merge(
520
520
  :operation => :"AddressesApi.list_addresses",
@@ -593,7 +593,7 @@ module Coinbase::Client
593
593
  return_type = opts[:debug_return_type] || 'PayloadSignatureList'
594
594
 
595
595
  # auth_names
596
- auth_names = opts[:debug_auth_names] || []
596
+ auth_names = opts[:debug_auth_names] || ['apiKey', 'session']
597
597
 
598
598
  new_options = opts.merge(
599
599
  :operation => :"AddressesApi.list_payload_signatures",
@@ -665,7 +665,7 @@ module Coinbase::Client
665
665
  return_type = opts[:debug_return_type] || 'FaucetTransaction'
666
666
 
667
667
  # auth_names
668
- auth_names = opts[:debug_auth_names] || []
668
+ auth_names = opts[:debug_auth_names] || ['apiKey']
669
669
 
670
670
  new_options = opts.merge(
671
671
  :operation => :"AddressesApi.request_faucet_funds",
@@ -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
 
@@ -69,7 +69,7 @@ module Coinbase::Client
69
69
  return_type = opts[:debug_return_type] || 'Asset'
70
70
 
71
71
  # auth_names
72
- auth_names = opts[:debug_auth_names] || []
72
+ auth_names = opts[:debug_auth_names] || ['apiKey', 'session']
73
73
 
74
74
  new_options = opts.merge(
75
75
  :operation => :"AssetsApi.get_asset",
@@ -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
 
@@ -85,7 +85,7 @@ module Coinbase::Client
85
85
  return_type = opts[:debug_return_type] || 'AddressHistoricalBalanceList'
86
86
 
87
87
  # auth_names
88
- auth_names = opts[:debug_auth_names] || []
88
+ auth_names = opts[:debug_auth_names] || ['apiKey', 'session']
89
89
 
90
90
  new_options = opts.merge(
91
91
  :operation => :"BalanceHistoryApi.list_address_historical_balance",
@@ -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
 
@@ -107,7 +107,7 @@ module Coinbase::Client
107
107
  return_type = opts[:debug_return_type] || 'ContractEventList'
108
108
 
109
109
  # auth_names
110
- auth_names = opts[:debug_auth_names] || []
110
+ auth_names = opts[:debug_auth_names] || ['apiKey', 'session']
111
111
 
112
112
  new_options = opts.merge(
113
113
  :operation => :"ContractEventsApi.list_contract_events",
@@ -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
 
@@ -86,7 +86,7 @@ module Coinbase::Client
86
86
  return_type = opts[:debug_return_type] || 'ContractInvocation'
87
87
 
88
88
  # auth_names
89
- auth_names = opts[:debug_auth_names] || []
89
+ auth_names = opts[:debug_auth_names] || ['apiKey']
90
90
 
91
91
  new_options = opts.merge(
92
92
  :operation => :"ContractInvocationsApi.broadcast_contract_invocation",
@@ -166,7 +166,7 @@ module Coinbase::Client
166
166
  return_type = opts[:debug_return_type] || 'ContractInvocation'
167
167
 
168
168
  # auth_names
169
- auth_names = opts[:debug_auth_names] || []
169
+ auth_names = opts[:debug_auth_names] || ['apiKey']
170
170
 
171
171
  new_options = opts.merge(
172
172
  :operation => :"ContractInvocationsApi.create_contract_invocation",
@@ -241,7 +241,7 @@ module Coinbase::Client
241
241
  return_type = opts[:debug_return_type] || 'ContractInvocation'
242
242
 
243
243
  # auth_names
244
- auth_names = opts[:debug_auth_names] || []
244
+ auth_names = opts[:debug_auth_names] || ['apiKey', 'session']
245
245
 
246
246
  new_options = opts.merge(
247
247
  :operation => :"ContractInvocationsApi.get_contract_invocation",
@@ -320,7 +320,7 @@ module Coinbase::Client
320
320
  return_type = opts[:debug_return_type] || 'ContractInvocationList'
321
321
 
322
322
  # auth_names
323
- auth_names = opts[:debug_auth_names] || []
323
+ auth_names = opts[:debug_auth_names] || ['apiKey', 'session']
324
324
 
325
325
  new_options = opts.merge(
326
326
  :operation => :"ContractInvocationsApi.list_contract_invocations",
@@ -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,6 +19,172 @@ module Coinbase::Client
19
19
  def initialize(api_client = ApiClient.default)
20
20
  @api_client = api_client
21
21
  end
22
+ # Broadcast an external address' transfer
23
+ # Broadcast an external address's transfer with a signed payload
24
+ # @param network_id [String] The ID of the network the address belongs to
25
+ # @param address_id [String] The ID of the address the transfer belongs to
26
+ # @param transfer_id [String] The ID of the transfer to broadcast
27
+ # @param broadcast_external_transfer_request [BroadcastExternalTransferRequest]
28
+ # @param [Hash] opts the optional parameters
29
+ # @return [Transfer]
30
+ def broadcast_external_transfer(network_id, address_id, transfer_id, broadcast_external_transfer_request, opts = {})
31
+ data, _status_code, _headers = broadcast_external_transfer_with_http_info(network_id, address_id, transfer_id, broadcast_external_transfer_request, opts)
32
+ data
33
+ end
34
+
35
+ # Broadcast an external address&#39; transfer
36
+ # Broadcast an external address&#39;s transfer with a signed payload
37
+ # @param network_id [String] The ID of the network the address belongs to
38
+ # @param address_id [String] The ID of the address the transfer belongs to
39
+ # @param transfer_id [String] The ID of the transfer to broadcast
40
+ # @param broadcast_external_transfer_request [BroadcastExternalTransferRequest]
41
+ # @param [Hash] opts the optional parameters
42
+ # @return [Array<(Transfer, Integer, Hash)>] Transfer data, response status code and response headers
43
+ def broadcast_external_transfer_with_http_info(network_id, address_id, transfer_id, broadcast_external_transfer_request, opts = {})
44
+ if @api_client.config.debugging
45
+ @api_client.config.logger.debug 'Calling API: ExternalAddressesApi.broadcast_external_transfer ...'
46
+ end
47
+ # verify the required parameter 'network_id' is set
48
+ if @api_client.config.client_side_validation && network_id.nil?
49
+ fail ArgumentError, "Missing the required parameter 'network_id' when calling ExternalAddressesApi.broadcast_external_transfer"
50
+ end
51
+ # verify the required parameter 'address_id' is set
52
+ if @api_client.config.client_side_validation && address_id.nil?
53
+ fail ArgumentError, "Missing the required parameter 'address_id' when calling ExternalAddressesApi.broadcast_external_transfer"
54
+ end
55
+ # verify the required parameter 'transfer_id' is set
56
+ if @api_client.config.client_side_validation && transfer_id.nil?
57
+ fail ArgumentError, "Missing the required parameter 'transfer_id' when calling ExternalAddressesApi.broadcast_external_transfer"
58
+ end
59
+ # verify the required parameter 'broadcast_external_transfer_request' is set
60
+ if @api_client.config.client_side_validation && broadcast_external_transfer_request.nil?
61
+ fail ArgumentError, "Missing the required parameter 'broadcast_external_transfer_request' when calling ExternalAddressesApi.broadcast_external_transfer"
62
+ end
63
+ # resource path
64
+ local_var_path = '/v1/networks/{network_id}/addresses/{address_id}/transfers/{transfer_id}/broadcast'.sub('{' + 'network_id' + '}', CGI.escape(network_id.to_s)).sub('{' + 'address_id' + '}', CGI.escape(address_id.to_s)).sub('{' + 'transfer_id' + '}', CGI.escape(transfer_id.to_s))
65
+
66
+ # query parameters
67
+ query_params = opts[:query_params] || {}
68
+
69
+ # header parameters
70
+ header_params = opts[:header_params] || {}
71
+ # HTTP header 'Accept' (if needed)
72
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
73
+ # HTTP header 'Content-Type'
74
+ content_type = @api_client.select_header_content_type(['application/json'])
75
+ if !content_type.nil?
76
+ header_params['Content-Type'] = content_type
77
+ end
78
+
79
+ # form parameters
80
+ form_params = opts[:form_params] || {}
81
+
82
+ # http body (model)
83
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(broadcast_external_transfer_request)
84
+
85
+ # return_type
86
+ return_type = opts[:debug_return_type] || 'Transfer'
87
+
88
+ # auth_names
89
+ auth_names = opts[:debug_auth_names] || ['apiKey']
90
+
91
+ new_options = opts.merge(
92
+ :operation => :"ExternalAddressesApi.broadcast_external_transfer",
93
+ :header_params => header_params,
94
+ :query_params => query_params,
95
+ :form_params => form_params,
96
+ :body => post_body,
97
+ :auth_names => auth_names,
98
+ :return_type => return_type
99
+ )
100
+
101
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
102
+ if @api_client.config.debugging
103
+ @api_client.config.logger.debug "API called: ExternalAddressesApi#broadcast_external_transfer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
104
+ end
105
+ return data, status_code, headers
106
+ end
107
+
108
+ # Create a new transfer
109
+ # Create a new transfer between addresses.
110
+ # @param network_id [String] The ID of the network the address is on
111
+ # @param address_id [String] The ID of the address to transfer from
112
+ # @param create_external_transfer_request [CreateExternalTransferRequest]
113
+ # @param [Hash] opts the optional parameters
114
+ # @return [Transfer]
115
+ def create_external_transfer(network_id, address_id, create_external_transfer_request, opts = {})
116
+ data, _status_code, _headers = create_external_transfer_with_http_info(network_id, address_id, create_external_transfer_request, opts)
117
+ data
118
+ end
119
+
120
+ # Create a new transfer
121
+ # Create a new transfer between addresses.
122
+ # @param network_id [String] The ID of the network the address is on
123
+ # @param address_id [String] The ID of the address to transfer from
124
+ # @param create_external_transfer_request [CreateExternalTransferRequest]
125
+ # @param [Hash] opts the optional parameters
126
+ # @return [Array<(Transfer, Integer, Hash)>] Transfer data, response status code and response headers
127
+ def create_external_transfer_with_http_info(network_id, address_id, create_external_transfer_request, opts = {})
128
+ if @api_client.config.debugging
129
+ @api_client.config.logger.debug 'Calling API: ExternalAddressesApi.create_external_transfer ...'
130
+ end
131
+ # verify the required parameter 'network_id' is set
132
+ if @api_client.config.client_side_validation && network_id.nil?
133
+ fail ArgumentError, "Missing the required parameter 'network_id' when calling ExternalAddressesApi.create_external_transfer"
134
+ end
135
+ # verify the required parameter 'address_id' is set
136
+ if @api_client.config.client_side_validation && address_id.nil?
137
+ fail ArgumentError, "Missing the required parameter 'address_id' when calling ExternalAddressesApi.create_external_transfer"
138
+ end
139
+ # verify the required parameter 'create_external_transfer_request' is set
140
+ if @api_client.config.client_side_validation && create_external_transfer_request.nil?
141
+ fail ArgumentError, "Missing the required parameter 'create_external_transfer_request' when calling ExternalAddressesApi.create_external_transfer"
142
+ end
143
+ # resource path
144
+ local_var_path = '/v1/networks/{network_id}/addresses/{address_id}/transfers'.sub('{' + 'network_id' + '}', CGI.escape(network_id.to_s)).sub('{' + 'address_id' + '}', CGI.escape(address_id.to_s))
145
+
146
+ # query parameters
147
+ query_params = opts[:query_params] || {}
148
+
149
+ # header parameters
150
+ header_params = opts[:header_params] || {}
151
+ # HTTP header 'Accept' (if needed)
152
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
153
+ # HTTP header 'Content-Type'
154
+ content_type = @api_client.select_header_content_type(['application/json'])
155
+ if !content_type.nil?
156
+ header_params['Content-Type'] = content_type
157
+ end
158
+
159
+ # form parameters
160
+ form_params = opts[:form_params] || {}
161
+
162
+ # http body (model)
163
+ post_body = opts[:debug_body] || @api_client.object_to_http_body(create_external_transfer_request)
164
+
165
+ # return_type
166
+ return_type = opts[:debug_return_type] || 'Transfer'
167
+
168
+ # auth_names
169
+ auth_names = opts[:debug_auth_names] || ['apiKey']
170
+
171
+ new_options = opts.merge(
172
+ :operation => :"ExternalAddressesApi.create_external_transfer",
173
+ :header_params => header_params,
174
+ :query_params => query_params,
175
+ :form_params => form_params,
176
+ :body => post_body,
177
+ :auth_names => auth_names,
178
+ :return_type => return_type
179
+ )
180
+
181
+ data, status_code, headers = @api_client.call_api(:POST, local_var_path, new_options)
182
+ if @api_client.config.debugging
183
+ @api_client.config.logger.debug "API called: ExternalAddressesApi#create_external_transfer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
184
+ end
185
+ return data, status_code, headers
186
+ end
187
+
22
188
  # Get the balance of an asset in an external address
23
189
  # Get the balance of an asset in an external address
24
190
  # @param network_id [String] The ID of the blockchain network
@@ -75,7 +241,7 @@ module Coinbase::Client
75
241
  return_type = opts[:debug_return_type] || 'Balance'
76
242
 
77
243
  # auth_names
78
- auth_names = opts[:debug_auth_names] || []
244
+ auth_names = opts[:debug_auth_names] || ['apiKey', 'session']
79
245
 
80
246
  new_options = opts.merge(
81
247
  :operation => :"ExternalAddressesApi.get_external_address_balance",
@@ -94,6 +260,81 @@ module Coinbase::Client
94
260
  return data, status_code, headers
95
261
  end
96
262
 
263
+ # Get a external address' transfer
264
+ # Get an external address' transfer by ID
265
+ # @param network_id [String] The ID of the network the address is on
266
+ # @param address_id [String] The ID of the address the transfer belongs to
267
+ # @param transfer_id [String] The ID of the transfer to fetch
268
+ # @param [Hash] opts the optional parameters
269
+ # @return [Transfer]
270
+ def get_external_transfer(network_id, address_id, transfer_id, opts = {})
271
+ data, _status_code, _headers = get_external_transfer_with_http_info(network_id, address_id, transfer_id, opts)
272
+ data
273
+ end
274
+
275
+ # Get a external address&#39; transfer
276
+ # Get an external address&#39; transfer by ID
277
+ # @param network_id [String] The ID of the network the address is on
278
+ # @param address_id [String] The ID of the address the transfer belongs to
279
+ # @param transfer_id [String] The ID of the transfer to fetch
280
+ # @param [Hash] opts the optional parameters
281
+ # @return [Array<(Transfer, Integer, Hash)>] Transfer data, response status code and response headers
282
+ def get_external_transfer_with_http_info(network_id, address_id, transfer_id, opts = {})
283
+ if @api_client.config.debugging
284
+ @api_client.config.logger.debug 'Calling API: ExternalAddressesApi.get_external_transfer ...'
285
+ end
286
+ # verify the required parameter 'network_id' is set
287
+ if @api_client.config.client_side_validation && network_id.nil?
288
+ fail ArgumentError, "Missing the required parameter 'network_id' when calling ExternalAddressesApi.get_external_transfer"
289
+ end
290
+ # verify the required parameter 'address_id' is set
291
+ if @api_client.config.client_side_validation && address_id.nil?
292
+ fail ArgumentError, "Missing the required parameter 'address_id' when calling ExternalAddressesApi.get_external_transfer"
293
+ end
294
+ # verify the required parameter 'transfer_id' is set
295
+ if @api_client.config.client_side_validation && transfer_id.nil?
296
+ fail ArgumentError, "Missing the required parameter 'transfer_id' when calling ExternalAddressesApi.get_external_transfer"
297
+ end
298
+ # resource path
299
+ local_var_path = '/v1/networks/{network_id}/addresses/{address_id}/transfers/{transfer_id}'.sub('{' + 'network_id' + '}', CGI.escape(network_id.to_s)).sub('{' + 'address_id' + '}', CGI.escape(address_id.to_s)).sub('{' + 'transfer_id' + '}', CGI.escape(transfer_id.to_s))
300
+
301
+ # query parameters
302
+ query_params = opts[:query_params] || {}
303
+
304
+ # header parameters
305
+ header_params = opts[:header_params] || {}
306
+ # HTTP header 'Accept' (if needed)
307
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
308
+
309
+ # form parameters
310
+ form_params = opts[:form_params] || {}
311
+
312
+ # http body (model)
313
+ post_body = opts[:debug_body]
314
+
315
+ # return_type
316
+ return_type = opts[:debug_return_type] || 'Transfer'
317
+
318
+ # auth_names
319
+ auth_names = opts[:debug_auth_names] || ['apiKey']
320
+
321
+ new_options = opts.merge(
322
+ :operation => :"ExternalAddressesApi.get_external_transfer",
323
+ :header_params => header_params,
324
+ :query_params => query_params,
325
+ :form_params => form_params,
326
+ :body => post_body,
327
+ :auth_names => auth_names,
328
+ :return_type => return_type
329
+ )
330
+
331
+ data, status_code, headers = @api_client.call_api(:GET, local_var_path, new_options)
332
+ if @api_client.config.debugging
333
+ @api_client.config.logger.debug "API called: ExternalAddressesApi#get_external_transfer\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}"
334
+ end
335
+ return data, status_code, headers
336
+ end
337
+
97
338
  # Get the status of a faucet transaction
98
339
  # Get the status of a faucet transaction
99
340
  # @param network_id [String] The ID of the blockchain network
@@ -150,7 +391,7 @@ module Coinbase::Client
150
391
  return_type = opts[:debug_return_type] || 'FaucetTransaction'
151
392
 
152
393
  # auth_names
153
- auth_names = opts[:debug_auth_names] || []
394
+ auth_names = opts[:debug_auth_names] || ['apiKey', 'session']
154
395
 
155
396
  new_options = opts.merge(
156
397
  :operation => :"ExternalAddressesApi.get_faucet_transaction",
@@ -226,7 +467,7 @@ module Coinbase::Client
226
467
  return_type = opts[:debug_return_type] || 'AddressBalanceList'
227
468
 
228
469
  # auth_names
229
- auth_names = opts[:debug_auth_names] || []
470
+ auth_names = opts[:debug_auth_names] || ['apiKey', 'session']
230
471
 
231
472
  new_options = opts.merge(
232
473
  :operation => :"ExternalAddressesApi.list_external_address_balances",
@@ -301,7 +542,7 @@ module Coinbase::Client
301
542
  return_type = opts[:debug_return_type] || 'FaucetTransaction'
302
543
 
303
544
  # auth_names
304
- auth_names = opts[:debug_auth_names] || []
545
+ auth_names = opts[:debug_auth_names] || ['apiKey', 'session']
305
546
 
306
547
  new_options = opts.merge(
307
548
  :operation => :"ExternalAddressesApi.request_external_faucet_funds",
@@ -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
 
@@ -80,7 +80,7 @@ module Coinbase::Client
80
80
  return_type = opts[:debug_return_type] || 'FundOperation'
81
81
 
82
82
  # auth_names
83
- auth_names = opts[:debug_auth_names] || []
83
+ auth_names = opts[:debug_auth_names] || ['apiKey']
84
84
 
85
85
  new_options = opts.merge(
86
86
  :operation => :"FundApi.create_fund_operation",
@@ -160,7 +160,7 @@ module Coinbase::Client
160
160
  return_type = opts[:debug_return_type] || 'FundQuote'
161
161
 
162
162
  # auth_names
163
- auth_names = opts[:debug_auth_names] || []
163
+ auth_names = opts[:debug_auth_names] || ['apiKey']
164
164
 
165
165
  new_options = opts.merge(
166
166
  :operation => :"FundApi.create_fund_quote",
@@ -235,7 +235,7 @@ module Coinbase::Client
235
235
  return_type = opts[:debug_return_type] || 'FundOperation'
236
236
 
237
237
  # auth_names
238
- auth_names = opts[:debug_auth_names] || []
238
+ auth_names = opts[:debug_auth_names] || ['apiKey', 'session']
239
239
 
240
240
  new_options = opts.merge(
241
241
  :operation => :"FundApi.get_fund_operation",
@@ -314,7 +314,7 @@ module Coinbase::Client
314
314
  return_type = opts[:debug_return_type] || 'FundOperationList'
315
315
 
316
316
  # auth_names
317
- auth_names = opts[:debug_auth_names] || []
317
+ auth_names = opts[:debug_auth_names] || ['apiKey', 'session']
318
318
 
319
319
  new_options = opts.merge(
320
320
  :operation => :"FundApi.list_fund_operations",