coinbase-sdk 0.11.0 → 0.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. checksums.yaml +4 -4
  2. data/lib/coinbase/address/wallet_address.rb +6 -3
  3. data/lib/coinbase/address.rb +22 -3
  4. data/lib/coinbase/address_reputation.rb +67 -0
  5. data/lib/coinbase/client/api/addresses_api.rb +9 -9
  6. data/lib/coinbase/client/api/assets_api.rb +1 -1
  7. data/lib/coinbase/client/api/balance_history_api.rb +1 -1
  8. data/lib/coinbase/client/api/contract_events_api.rb +1 -1
  9. data/lib/coinbase/client/api/contract_invocations_api.rb +4 -4
  10. data/lib/coinbase/client/api/external_addresses_api.rb +245 -4
  11. data/lib/coinbase/client/api/fund_api.rb +4 -4
  12. data/lib/coinbase/client/api/mpc_wallet_stake_api.rb +3 -3
  13. data/lib/coinbase/client/api/networks_api.rb +1 -1
  14. data/lib/coinbase/client/api/onchain_identity_api.rb +1 -1
  15. data/lib/coinbase/client/api/reputation_api.rb +1 -70
  16. data/lib/coinbase/client/api/server_signers_api.rb +6 -6
  17. data/lib/coinbase/client/api/smart_contracts_api.rb +168 -25
  18. data/lib/coinbase/client/api/stake_api.rb +7 -7
  19. data/lib/coinbase/client/api/trades_api.rb +4 -4
  20. data/lib/coinbase/client/api/transaction_history_api.rb +1 -1
  21. data/lib/coinbase/client/api/transfers_api.rb +4 -4
  22. data/lib/coinbase/client/api/wallets_api.rb +5 -5
  23. data/lib/coinbase/client/api/webhooks_api.rb +5 -5
  24. data/lib/coinbase/client/configuration.rb +14 -0
  25. data/lib/coinbase/client/models/address_reputation.rb +15 -8
  26. data/lib/coinbase/client/models/{address_risk.rb → broadcast_external_transfer_request.rb} +15 -16
  27. data/lib/coinbase/client/models/create_external_transfer_request.rb +283 -0
  28. data/lib/coinbase/client/models/create_fund_operation_request.rb +1 -1
  29. data/lib/coinbase/client/models/create_fund_quote_request.rb +1 -1
  30. data/lib/coinbase/client/models/create_transfer_request.rb +15 -5
  31. data/lib/coinbase/client/models/ethereum_transaction.rb +14 -4
  32. data/lib/coinbase/client/models/register_smart_contract_request.rb +252 -0
  33. data/lib/coinbase/client/models/smart_contract.rb +36 -30
  34. data/lib/coinbase/client/models/smart_contract_activity_event.rb +386 -0
  35. data/lib/coinbase/client/models/smart_contract_type.rb +2 -1
  36. data/lib/coinbase/client/models/transfer.rb +1 -36
  37. data/lib/coinbase/client/models/update_smart_contract_request.rb +245 -0
  38. data/lib/coinbase/client/models/webhook_event_type.rb +2 -1
  39. data/lib/coinbase/client/models/webhook_event_type_filter.rb +1 -0
  40. data/lib/coinbase/client/models/webhook_smart_contract_event_filter.rb +225 -0
  41. data/lib/coinbase/client/models/webhook_wallet_activity_filter.rb +7 -0
  42. data/lib/coinbase/client.rb +6 -1
  43. data/lib/coinbase/errors.rb +8 -0
  44. data/lib/coinbase/smart_contract.rb +338 -245
  45. data/lib/coinbase/transfer.rb +24 -2
  46. data/lib/coinbase/version.rb +1 -1
  47. data/lib/coinbase/wallet/data.rb +6 -4
  48. data/lib/coinbase/wallet.rb +3 -2
  49. data/lib/coinbase.rb +2 -1
  50. metadata +13 -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: fa14890bed93f5613455ae2c843ce354d6f77a503d7e977a31fc23f087cb4b3e
4
+ data.tar.gz: 5c20bc410f499e57284039c9dd5754c11a2445f4f74c354efe72b548d2e75885
5
5
  SHA512:
6
- metadata.gz: 77b9bb44dc2d19bd6005bb274786679c0cc47586a90ad77c7288256ebd5ea6a0126fcdd751c73941b2786835d427864cd78d9ccfc3b2275164434c9b0e5c58a8
7
- data.tar.gz: de1b59e1e4e3b077e65dbbc4d1a85ec988a4327cd29ecd9bec9167dbbf39762ad79df36ae508e25b48f87c9c4746069672baf52df86564434234208ec44731cf
6
+ metadata.gz: b76c1c202fed87626cdcb412e77e8bf5b92d659dfb9f6750428524850d204ea578d306c22cf72b27951c828fe2deb593fc95feb9460675a454466ba82ef54667
7
+ data.tar.gz: 75d6ca8f24371a7618bba1188ac4e7a05a5503c16b01cf7000af3c0b6e8f34d2047660aed2a2a087d94a29284aa65bcfa3c528d63b6093fcf962e1b8ebd2a6df
@@ -41,9 +41,11 @@ module Coinbase
41
41
  # default address. If a String, interprets it as the address ID.
42
42
  # @param gasless [Boolean] Whether gas fee for the transfer should be covered by Coinbase.
43
43
  # Defaults to false. Check the API documentation for network and asset support.
44
- # Whether the transfer should be gasless. Defaults to false.
44
+ # @param skip_batching [Boolean] When true, the Transfer will be submitted immediately.
45
+ # Otherwise, the Transfer will be batched.
46
+ # Defaults to false. Note: requires gasless option to be set to true.
45
47
  # @return [Coinbase::Transfer] The Transfer object.
46
- def transfer(amount, asset_id, destination, gasless: false)
48
+ def transfer(amount, asset_id, destination, gasless: false, skip_batching: false)
47
49
  ensure_can_sign!
48
50
  ensure_sufficient_balance!(amount, asset_id)
49
51
 
@@ -54,7 +56,8 @@ module Coinbase
54
56
  destination: destination,
55
57
  network: network,
56
58
  wallet_id: wallet_id,
57
- gasless: gasless
59
+ gasless: gasless,
60
+ skip_batching: skip_batching
58
61
  )
59
62
 
60
63
  # If a server signer is managing keys, it will sign and broadcast the underlying transfer transaction out of band.
@@ -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
@@ -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",
@@ -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",
@@ -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",
@@ -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",
@@ -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",
@@ -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",
@@ -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",
@@ -86,7 +86,7 @@ module Coinbase::Client
86
86
  return_type = opts[:debug_return_type] || 'StakingOperation'
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 => :"MPCWalletStakeApi.broadcast_staking_operation",
@@ -166,7 +166,7 @@ module Coinbase::Client
166
166
  return_type = opts[:debug_return_type] || 'StakingOperation'
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 => :"MPCWalletStakeApi.create_staking_operation",
@@ -241,7 +241,7 @@ module Coinbase::Client
241
241
  return_type = opts[:debug_return_type] || 'StakingOperation'
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 => :"MPCWalletStakeApi.get_staking_operation",
@@ -63,7 +63,7 @@ module Coinbase::Client
63
63
  return_type = opts[:debug_return_type] || 'Network'
64
64
 
65
65
  # auth_names
66
- auth_names = opts[:debug_auth_names] || []
66
+ auth_names = opts[:debug_auth_names] || ['apiKey', 'session']
67
67
 
68
68
  new_options = opts.merge(
69
69
  :operation => :"NetworksApi.get_network",