coinbase-sdk 0.2.0 → 0.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (116) hide show
  1. checksums.yaml +4 -4
  2. data/lib/coinbase/address/wallet_address.rb +61 -0
  3. data/lib/coinbase/address.rb +25 -1
  4. data/lib/coinbase/client/api/addresses_api.rb +238 -8
  5. data/lib/coinbase/client/api/assets_api.rb +3 -3
  6. data/lib/coinbase/client/api/balance_history_api.rb +107 -0
  7. data/lib/coinbase/client/api/contract_events_api.rb +5 -5
  8. data/lib/coinbase/client/api/contract_invocations_api.rb +342 -0
  9. data/lib/coinbase/client/api/external_addresses_api.rb +24 -30
  10. data/lib/coinbase/client/api/networks_api.rb +3 -3
  11. data/lib/coinbase/client/api/server_signers_api.rb +8 -8
  12. data/lib/coinbase/client/api/stake_api.rb +7 -7
  13. data/lib/coinbase/client/api/trades_api.rb +6 -6
  14. data/lib/coinbase/client/api/transfers_api.rb +6 -6
  15. data/lib/coinbase/client/api/validators_api.rb +8 -8
  16. data/lib/coinbase/client/api/wallet_stake_api.rb +5 -5
  17. data/lib/coinbase/client/api/wallets_api.rb +11 -11
  18. data/lib/coinbase/client/api/webhooks_api.rb +6 -6
  19. data/lib/coinbase/client/api_client.rb +31 -25
  20. data/lib/coinbase/client/api_error.rb +2 -2
  21. data/lib/coinbase/client/configuration.rb +2 -2
  22. data/lib/coinbase/client/models/address.rb +2 -2
  23. data/lib/coinbase/client/models/address_balance_list.rb +2 -2
  24. data/lib/coinbase/client/models/address_historical_balance_list.rb +2 -2
  25. data/lib/coinbase/client/models/address_list.rb +2 -2
  26. data/lib/coinbase/client/models/address_transaction_list.rb +258 -0
  27. data/lib/coinbase/client/models/asset.rb +2 -2
  28. data/lib/coinbase/client/models/balance.rb +2 -2
  29. data/lib/coinbase/client/models/{user.rb → broadcast_contract_invocation_request.rb} +17 -26
  30. data/lib/coinbase/client/models/broadcast_staking_operation_request.rb +2 -2
  31. data/lib/coinbase/client/models/broadcast_trade_request.rb +2 -2
  32. data/lib/coinbase/client/models/broadcast_transfer_request.rb +2 -2
  33. data/lib/coinbase/client/models/build_staking_operation_request.rb +2 -2
  34. data/lib/coinbase/client/models/contract_event.rb +2 -2
  35. data/lib/coinbase/client/models/contract_event_list.rb +2 -2
  36. data/lib/coinbase/client/models/contract_invocation.rb +368 -0
  37. data/lib/coinbase/client/models/contract_invocation_list.rb +274 -0
  38. data/lib/coinbase/client/models/create_address_request.rb +2 -2
  39. data/lib/coinbase/client/models/create_contract_invocation_request.rb +276 -0
  40. data/lib/coinbase/client/models/create_payload_signature_request.rb +232 -0
  41. data/lib/coinbase/client/models/create_server_signer_request.rb +2 -2
  42. data/lib/coinbase/client/models/create_staking_operation_request.rb +2 -2
  43. data/lib/coinbase/client/models/create_trade_request.rb +2 -2
  44. data/lib/coinbase/client/models/create_transfer_request.rb +3 -3
  45. data/lib/coinbase/client/models/create_wallet_request.rb +2 -2
  46. data/lib/coinbase/client/models/create_wallet_request_wallet.rb +2 -2
  47. data/lib/coinbase/client/models/create_webhook_request.rb +30 -6
  48. data/lib/coinbase/client/models/erc20_transfer_event.rb +336 -0
  49. data/lib/coinbase/client/models/erc721_transfer_event.rb +336 -0
  50. data/lib/coinbase/client/models/error.rb +16 -6
  51. data/lib/coinbase/client/models/ethereum_transaction.rb +389 -0
  52. data/lib/coinbase/client/models/ethereum_transaction_access.rb +225 -0
  53. data/lib/coinbase/client/models/ethereum_transaction_access_list.rb +216 -0
  54. data/lib/coinbase/client/models/ethereum_transaction_flattened_trace.rb +378 -0
  55. data/lib/coinbase/client/models/ethereum_validator_metadata.rb +2 -2
  56. data/lib/coinbase/client/models/faucet_transaction.rb +2 -2
  57. data/lib/coinbase/client/models/feature_set.rb +2 -2
  58. data/lib/coinbase/client/models/fetch_historical_staking_balances200_response.rb +2 -2
  59. data/lib/coinbase/client/models/fetch_staking_rewards200_response.rb +2 -2
  60. data/lib/coinbase/client/models/fetch_staking_rewards_request.rb +2 -2
  61. data/lib/coinbase/client/models/get_staking_context_request.rb +2 -2
  62. data/lib/coinbase/client/models/historical_balance.rb +2 -2
  63. data/lib/coinbase/client/models/network.rb +4 -4
  64. data/lib/coinbase/client/models/network_identifier.rb +5 -3
  65. data/lib/coinbase/client/models/payload_signature.rb +335 -0
  66. data/lib/coinbase/client/models/payload_signature_list.rb +275 -0
  67. data/lib/coinbase/client/models/seed_creation_event.rb +2 -2
  68. data/lib/coinbase/client/models/seed_creation_event_result.rb +2 -2
  69. data/lib/coinbase/client/models/server_signer.rb +2 -2
  70. data/lib/coinbase/client/models/server_signer_event.rb +2 -2
  71. data/lib/coinbase/client/models/server_signer_event_event.rb +2 -2
  72. data/lib/coinbase/client/models/server_signer_event_list.rb +2 -2
  73. data/lib/coinbase/client/models/server_signer_list.rb +2 -2
  74. data/lib/coinbase/client/models/signature_creation_event.rb +2 -2
  75. data/lib/coinbase/client/models/signature_creation_event_result.rb +2 -2
  76. data/lib/coinbase/client/models/signed_voluntary_exit_message_metadata.rb +2 -2
  77. data/lib/coinbase/client/models/sponsored_send.rb +2 -2
  78. data/lib/coinbase/client/models/staking_balance.rb +2 -2
  79. data/lib/coinbase/client/models/staking_context.rb +2 -2
  80. data/lib/coinbase/client/models/staking_context_context.rb +2 -2
  81. data/lib/coinbase/client/models/staking_operation.rb +2 -2
  82. data/lib/coinbase/client/models/staking_operation_metadata.rb +2 -2
  83. data/lib/coinbase/client/models/staking_reward.rb +2 -2
  84. data/lib/coinbase/client/models/staking_reward_format.rb +2 -2
  85. data/lib/coinbase/client/models/staking_reward_usd_value.rb +2 -2
  86. data/lib/coinbase/client/models/trade.rb +2 -2
  87. data/lib/coinbase/client/models/trade_list.rb +2 -2
  88. data/lib/coinbase/client/models/transaction.rb +37 -8
  89. data/lib/coinbase/client/models/transaction_content.rb +104 -0
  90. data/lib/coinbase/client/models/transaction_type.rb +2 -2
  91. data/lib/coinbase/client/models/transfer.rb +2 -2
  92. data/lib/coinbase/client/models/transfer_list.rb +2 -2
  93. data/lib/coinbase/client/models/update_webhook_request.rb +3 -51
  94. data/lib/coinbase/client/models/validator.rb +2 -2
  95. data/lib/coinbase/client/models/validator_details.rb +2 -2
  96. data/lib/coinbase/client/models/validator_list.rb +2 -2
  97. data/lib/coinbase/client/models/validator_status.rb +2 -2
  98. data/lib/coinbase/client/models/wallet.rb +2 -2
  99. data/lib/coinbase/client/models/wallet_list.rb +2 -2
  100. data/lib/coinbase/client/models/webhook.rb +16 -6
  101. data/lib/coinbase/client/models/webhook_event_filter.rb +5 -5
  102. data/lib/coinbase/client/models/webhook_event_type.rb +2 -2
  103. data/lib/coinbase/client/models/webhook_list.rb +2 -2
  104. data/lib/coinbase/client/version.rb +2 -2
  105. data/lib/coinbase/client.rb +19 -4
  106. data/lib/coinbase/constants.rb +3 -0
  107. data/lib/coinbase/contract_invocation.rb +259 -0
  108. data/lib/coinbase/payload_signature.rb +181 -0
  109. data/lib/coinbase/transaction.rb +21 -0
  110. data/lib/coinbase/version.rb +1 -1
  111. data/lib/coinbase/wallet.rb +11 -1
  112. data/lib/coinbase/webhook.rb +17 -6
  113. data/lib/coinbase.rb +2 -0
  114. metadata +21 -5
  115. data/lib/coinbase/client/api/users_api.rb +0 -79
  116. data/lib/coinbase/client/models/feature.rb +0 -43
@@ -4,9 +4,9 @@
4
4
  #This is the OpenAPI 3.0 specification for the Coinbase Platform APIs, used in conjunction with the Coinbase Platform SDKs.
5
5
 
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
- Contact: yuga.cohler@coinbase.com
7
+
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.7.0
9
+ Generator version: 7.8.0
10
10
 
11
11
  =end
12
12
 
@@ -69,7 +69,7 @@ module Coinbase::Client
69
69
  # header parameters
70
70
  header_params = opts[:header_params] || {}
71
71
  # HTTP header 'Accept' (if needed)
72
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
72
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
73
73
  # HTTP header 'Content-Type'
74
74
  content_type = @api_client.select_header_content_type(['application/json'])
75
75
  if !content_type.nil?
@@ -149,7 +149,7 @@ module Coinbase::Client
149
149
  # header parameters
150
150
  header_params = opts[:header_params] || {}
151
151
  # HTTP header 'Accept' (if needed)
152
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
152
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
153
153
  # HTTP header 'Content-Type'
154
154
  content_type = @api_client.select_header_content_type(['application/json'])
155
155
  if !content_type.nil?
@@ -229,7 +229,7 @@ module Coinbase::Client
229
229
  # header parameters
230
230
  header_params = opts[:header_params] || {}
231
231
  # HTTP header 'Accept' (if needed)
232
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
232
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
233
233
 
234
234
  # form parameters
235
235
  form_params = opts[:form_params] || {}
@@ -308,7 +308,7 @@ module Coinbase::Client
308
308
  # header parameters
309
309
  header_params = opts[:header_params] || {}
310
310
  # HTTP header 'Accept' (if needed)
311
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
311
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
312
312
 
313
313
  # form parameters
314
314
  form_params = opts[:form_params] || {}
@@ -4,9 +4,9 @@
4
4
  #This is the OpenAPI 3.0 specification for the Coinbase Platform APIs, used in conjunction with the Coinbase Platform SDKs.
5
5
 
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
- Contact: yuga.cohler@coinbase.com
7
+
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.7.0
9
+ Generator version: 7.8.0
10
10
 
11
11
  =end
12
12
 
@@ -69,7 +69,7 @@ module Coinbase::Client
69
69
  # header parameters
70
70
  header_params = opts[:header_params] || {}
71
71
  # HTTP header 'Accept' (if needed)
72
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
72
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
73
73
  # HTTP header 'Content-Type'
74
74
  content_type = @api_client.select_header_content_type(['application/json'])
75
75
  if !content_type.nil?
@@ -149,7 +149,7 @@ module Coinbase::Client
149
149
  # header parameters
150
150
  header_params = opts[:header_params] || {}
151
151
  # HTTP header 'Accept' (if needed)
152
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
152
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
153
153
  # HTTP header 'Content-Type'
154
154
  content_type = @api_client.select_header_content_type(['application/json'])
155
155
  if !content_type.nil?
@@ -229,7 +229,7 @@ module Coinbase::Client
229
229
  # header parameters
230
230
  header_params = opts[:header_params] || {}
231
231
  # HTTP header 'Accept' (if needed)
232
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
232
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
233
233
 
234
234
  # form parameters
235
235
  form_params = opts[:form_params] || {}
@@ -308,7 +308,7 @@ module Coinbase::Client
308
308
  # header parameters
309
309
  header_params = opts[:header_params] || {}
310
310
  # HTTP header 'Accept' (if needed)
311
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
311
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
312
312
 
313
313
  # form parameters
314
314
  form_params = opts[:form_params] || {}
@@ -4,9 +4,9 @@
4
4
  #This is the OpenAPI 3.0 specification for the Coinbase Platform APIs, used in conjunction with the Coinbase Platform SDKs.
5
5
 
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
- Contact: yuga.cohler@coinbase.com
7
+
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.7.0
9
+ Generator version: 7.8.0
10
10
 
11
11
  =end
12
12
 
@@ -20,7 +20,7 @@ module Coinbase::Client
20
20
  @api_client = api_client
21
21
  end
22
22
  # Get a validator belonging to the CDP project
23
- # Get a validator belonging to the user for a given network, asset and id.
23
+ # Get a validator belonging to the CDP project for a given network, asset and id.
24
24
  # @param network_id [String] The ID of the blockchain network.
25
25
  # @param asset_id [String] The symbol of the asset to get the validator for.
26
26
  # @param validator_id [String] The unique id of the validator to fetch details for.
@@ -32,7 +32,7 @@ module Coinbase::Client
32
32
  end
33
33
 
34
34
  # Get a validator belonging to the CDP project
35
- # Get a validator belonging to the user for a given network, asset and id.
35
+ # Get a validator belonging to the CDP project for a given network, asset and id.
36
36
  # @param network_id [String] The ID of the blockchain network.
37
37
  # @param asset_id [String] The symbol of the asset to get the validator for.
38
38
  # @param validator_id [String] The unique id of the validator to fetch details for.
@@ -63,7 +63,7 @@ module Coinbase::Client
63
63
  # header parameters
64
64
  header_params = opts[:header_params] || {}
65
65
  # HTTP header 'Accept' (if needed)
66
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
66
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
67
67
 
68
68
  # form parameters
69
69
  form_params = opts[:form_params] || {}
@@ -95,7 +95,7 @@ module Coinbase::Client
95
95
  end
96
96
 
97
97
  # List validators belonging to the CDP project
98
- # List validators belonging to the user for a given network and asset.
98
+ # List validators belonging to the CDP project for a given network and asset.
99
99
  # @param network_id [String] The ID of the blockchain network.
100
100
  # @param asset_id [String] The symbol of the asset to get the validators for.
101
101
  # @param [Hash] opts the optional parameters
@@ -109,7 +109,7 @@ module Coinbase::Client
109
109
  end
110
110
 
111
111
  # List validators belonging to the CDP project
112
- # List validators belonging to the user for a given network and asset.
112
+ # List validators belonging to the CDP project for a given network and asset.
113
113
  # @param network_id [String] The ID of the blockchain network.
114
114
  # @param asset_id [String] The symbol of the asset to get the validators for.
115
115
  # @param [Hash] opts the optional parameters
@@ -145,7 +145,7 @@ module Coinbase::Client
145
145
  # header parameters
146
146
  header_params = opts[:header_params] || {}
147
147
  # HTTP header 'Accept' (if needed)
148
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
148
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
149
149
 
150
150
  # form parameters
151
151
  form_params = opts[:form_params] || {}
@@ -4,9 +4,9 @@
4
4
  #This is the OpenAPI 3.0 specification for the Coinbase Platform APIs, used in conjunction with the Coinbase Platform SDKs.
5
5
 
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
- Contact: yuga.cohler@coinbase.com
7
+
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.7.0
9
+ Generator version: 7.8.0
10
10
 
11
11
  =end
12
12
 
@@ -69,7 +69,7 @@ module Coinbase::Client
69
69
  # header parameters
70
70
  header_params = opts[:header_params] || {}
71
71
  # HTTP header 'Accept' (if needed)
72
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
72
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
73
73
  # HTTP header 'Content-Type'
74
74
  content_type = @api_client.select_header_content_type(['application/json'])
75
75
  if !content_type.nil?
@@ -149,7 +149,7 @@ module Coinbase::Client
149
149
  # header parameters
150
150
  header_params = opts[:header_params] || {}
151
151
  # HTTP header 'Accept' (if needed)
152
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
152
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
153
153
  # HTTP header 'Content-Type'
154
154
  content_type = @api_client.select_header_content_type(['application/json'])
155
155
  if !content_type.nil?
@@ -229,7 +229,7 @@ module Coinbase::Client
229
229
  # header parameters
230
230
  header_params = opts[:header_params] || {}
231
231
  # HTTP header 'Accept' (if needed)
232
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
232
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
233
233
 
234
234
  # form parameters
235
235
  form_params = opts[:form_params] || {}
@@ -4,9 +4,9 @@
4
4
  #This is the OpenAPI 3.0 specification for the Coinbase Platform APIs, used in conjunction with the Coinbase Platform SDKs.
5
5
 
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
- Contact: yuga.cohler@coinbase.com
7
+
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.7.0
9
+ Generator version: 7.8.0
10
10
 
11
11
  =end
12
12
 
@@ -20,7 +20,7 @@ module Coinbase::Client
20
20
  @api_client = api_client
21
21
  end
22
22
  # Create a new wallet
23
- # Create a new wallet scoped to the user.
23
+ # Create a new wallet scoped to the CDP project.
24
24
  # @param [Hash] opts the optional parameters
25
25
  # @option opts [CreateWalletRequest] :create_wallet_request
26
26
  # @return [Wallet]
@@ -30,7 +30,7 @@ module Coinbase::Client
30
30
  end
31
31
 
32
32
  # Create a new wallet
33
- # Create a new wallet scoped to the user.
33
+ # Create a new wallet scoped to the CDP project.
34
34
  # @param [Hash] opts the optional parameters
35
35
  # @option opts [CreateWalletRequest] :create_wallet_request
36
36
  # @return [Array<(Wallet, Integer, Hash)>] Wallet data, response status code and response headers
@@ -47,7 +47,7 @@ module Coinbase::Client
47
47
  # header parameters
48
48
  header_params = opts[:header_params] || {}
49
49
  # HTTP header 'Accept' (if needed)
50
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
50
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
51
51
  # HTTP header 'Content-Type'
52
52
  content_type = @api_client.select_header_content_type(['application/json'])
53
53
  if !content_type.nil?
@@ -115,7 +115,7 @@ module Coinbase::Client
115
115
  # header parameters
116
116
  header_params = opts[:header_params] || {}
117
117
  # HTTP header 'Accept' (if needed)
118
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
118
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
119
119
 
120
120
  # form parameters
121
121
  form_params = opts[:form_params] || {}
@@ -184,7 +184,7 @@ module Coinbase::Client
184
184
  # header parameters
185
185
  header_params = opts[:header_params] || {}
186
186
  # HTTP header 'Accept' (if needed)
187
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
187
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
188
188
 
189
189
  # form parameters
190
190
  form_params = opts[:form_params] || {}
@@ -247,7 +247,7 @@ module Coinbase::Client
247
247
  # header parameters
248
248
  header_params = opts[:header_params] || {}
249
249
  # HTTP header 'Accept' (if needed)
250
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
250
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
251
251
 
252
252
  # form parameters
253
253
  form_params = opts[:form_params] || {}
@@ -279,7 +279,7 @@ module Coinbase::Client
279
279
  end
280
280
 
281
281
  # List wallets
282
- # List wallets belonging to the user.
282
+ # List wallets belonging to the CDP project.
283
283
  # @param [Hash] opts the optional parameters
284
284
  # @option opts [Integer] :limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
285
285
  # @option opts [String] :page A cursor for pagination across multiple pages of results. Don&#39;t include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results.
@@ -290,7 +290,7 @@ module Coinbase::Client
290
290
  end
291
291
 
292
292
  # List wallets
293
- # List wallets belonging to the user.
293
+ # List wallets belonging to the CDP project.
294
294
  # @param [Hash] opts the optional parameters
295
295
  # @option opts [Integer] :limit A limit on the number of objects to be returned. Limit can range between 1 and 100, and the default is 10.
296
296
  # @option opts [String] :page A cursor for pagination across multiple pages of results. Don&#39;t include this parameter on the first call. Use the next_page value returned in a previous response to request subsequent results.
@@ -314,7 +314,7 @@ module Coinbase::Client
314
314
  # header parameters
315
315
  header_params = opts[:header_params] || {}
316
316
  # HTTP header 'Accept' (if needed)
317
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
317
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
318
318
 
319
319
  # form parameters
320
320
  form_params = opts[:form_params] || {}
@@ -4,9 +4,9 @@
4
4
  #This is the OpenAPI 3.0 specification for the Coinbase Platform APIs, used in conjunction with the Coinbase Platform SDKs.
5
5
 
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
- Contact: yuga.cohler@coinbase.com
7
+
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.7.0
9
+ Generator version: 7.8.0
10
10
 
11
11
  =end
12
12
 
@@ -47,7 +47,7 @@ module Coinbase::Client
47
47
  # header parameters
48
48
  header_params = opts[:header_params] || {}
49
49
  # HTTP header 'Accept' (if needed)
50
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
50
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
51
51
  # HTTP header 'Content-Type'
52
52
  content_type = @api_client.select_header_content_type(['application/json'])
53
53
  if !content_type.nil?
@@ -115,7 +115,7 @@ module Coinbase::Client
115
115
  # header parameters
116
116
  header_params = opts[:header_params] || {}
117
117
  # HTTP header 'Accept' (if needed)
118
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
118
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
119
119
 
120
120
  # form parameters
121
121
  form_params = opts[:form_params] || {}
@@ -182,7 +182,7 @@ module Coinbase::Client
182
182
  # header parameters
183
183
  header_params = opts[:header_params] || {}
184
184
  # HTTP header 'Accept' (if needed)
185
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
185
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
186
186
 
187
187
  # form parameters
188
188
  form_params = opts[:form_params] || {}
@@ -247,7 +247,7 @@ module Coinbase::Client
247
247
  # header parameters
248
248
  header_params = opts[:header_params] || {}
249
249
  # HTTP header 'Accept' (if needed)
250
- header_params['Accept'] = @api_client.select_header_accept(['application/json'])
250
+ header_params['Accept'] = @api_client.select_header_accept(['application/json']) unless header_params['Accept']
251
251
  # HTTP header 'Content-Type'
252
252
  content_type = @api_client.select_header_content_type(['application/json'])
253
253
  if !content_type.nil?
@@ -4,9 +4,9 @@
4
4
  #This is the OpenAPI 3.0 specification for the Coinbase Platform APIs, used in conjunction with the Coinbase Platform SDKs.
5
5
 
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
- Contact: yuga.cohler@coinbase.com
7
+
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.7.0
9
+ Generator version: 7.8.0
10
10
 
11
11
  =end
12
12
 
@@ -164,35 +164,41 @@ module Coinbase::Client
164
164
  request.options.on_data = Proc.new do |chunk, overall_received_bytes|
165
165
  stream << chunk
166
166
  end
167
+
167
168
  stream
168
169
  end
169
170
 
170
171
  def deserialize_file(response, stream)
171
- body = response.body
172
- if @config.return_binary_data == true
173
- # return byte stream
174
- encoding = body.encoding
175
- stream.join.force_encoding(encoding)
172
+ body = response.body
173
+ encoding = body.encoding
174
+
175
+ # reconstruct content
176
+ content = stream.join
177
+ content = content.unpack('m').join if response.headers['Content-Transfer-Encoding'] == 'binary'
178
+ content = content.force_encoding(encoding)
179
+
180
+ # return byte stream
181
+ return content if @config.return_binary_data == true
182
+
183
+ # return file instead of binary data
184
+ content_disposition = response.headers['Content-Disposition']
185
+ if content_disposition && content_disposition =~ /filename=/i
186
+ filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1]
187
+ prefix = sanitize_filename(filename)
176
188
  else
177
- # return file instead of binary data
178
- content_disposition = response.headers['Content-Disposition']
179
- if content_disposition && content_disposition =~ /filename=/i
180
- filename = content_disposition[/filename=['"]?([^'"\s]+)['"]?/, 1]
181
- prefix = sanitize_filename(filename)
182
- else
183
- prefix = 'download-'
184
- end
185
- prefix = prefix + '-' unless prefix.end_with?('-')
186
- encoding = body.encoding
187
- tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding)
188
- tempfile.write(stream.join.force_encoding(encoding))
189
- tempfile.close
190
- config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
191
- "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
192
- "will be deleted automatically with GC. It's also recommended to delete the temp file "\
193
- "explicitly with `tempfile.delete`"
194
- tempfile
189
+ prefix = 'download-'
195
190
  end
191
+ prefix = prefix + '-' unless prefix.end_with?('-')
192
+
193
+ tempfile = Tempfile.open(prefix, @config.temp_folder_path, encoding: encoding)
194
+ tempfile.write(content)
195
+ tempfile.close
196
+
197
+ config.logger.info "Temp file written to #{tempfile.path}, please copy the file to a proper folder "\
198
+ "with e.g. `FileUtils.cp(tempfile.path, '/new/file/path')` otherwise the temp file "\
199
+ "will be deleted automatically with GC. It's also recommended to delete the temp file "\
200
+ "explicitly with `tempfile.delete`"
201
+ tempfile
196
202
  end
197
203
 
198
204
  def connection(opts)
@@ -4,9 +4,9 @@
4
4
  #This is the OpenAPI 3.0 specification for the Coinbase Platform APIs, used in conjunction with the Coinbase Platform SDKs.
5
5
 
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
- Contact: yuga.cohler@coinbase.com
7
+
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.7.0
9
+ Generator version: 7.8.0
10
10
 
11
11
  =end
12
12
 
@@ -4,9 +4,9 @@
4
4
  #This is the OpenAPI 3.0 specification for the Coinbase Platform APIs, used in conjunction with the Coinbase Platform SDKs.
5
5
 
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
- Contact: yuga.cohler@coinbase.com
7
+
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.7.0
9
+ Generator version: 7.8.0
10
10
 
11
11
  =end
12
12
 
@@ -4,9 +4,9 @@
4
4
  #This is the OpenAPI 3.0 specification for the Coinbase Platform APIs, used in conjunction with the Coinbase Platform SDKs.
5
5
 
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
- Contact: yuga.cohler@coinbase.com
7
+
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.7.0
9
+ Generator version: 7.8.0
10
10
 
11
11
  =end
12
12
 
@@ -4,9 +4,9 @@
4
4
  #This is the OpenAPI 3.0 specification for the Coinbase Platform APIs, used in conjunction with the Coinbase Platform SDKs.
5
5
 
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
- Contact: yuga.cohler@coinbase.com
7
+
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.7.0
9
+ Generator version: 7.8.0
10
10
 
11
11
  =end
12
12
 
@@ -4,9 +4,9 @@
4
4
  #This is the OpenAPI 3.0 specification for the Coinbase Platform APIs, used in conjunction with the Coinbase Platform SDKs.
5
5
 
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
- Contact: yuga.cohler@coinbase.com
7
+
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.7.0
9
+ Generator version: 7.8.0
10
10
 
11
11
  =end
12
12
 
@@ -4,9 +4,9 @@
4
4
  #This is the OpenAPI 3.0 specification for the Coinbase Platform APIs, used in conjunction with the Coinbase Platform SDKs.
5
5
 
6
6
  The version of the OpenAPI document: 0.0.1-alpha
7
- Contact: yuga.cohler@coinbase.com
7
+
8
8
  Generated by: https://openapi-generator.tech
9
- Generator version: 7.7.0
9
+ Generator version: 7.8.0
10
10
 
11
11
  =end
12
12