ccxt 4.1.91 → 4.1.95

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.
@@ -197,6 +197,8 @@ class coinbase extends coinbase$1 {
197
197
  'brokerage/products/{product_id}',
198
198
  'brokerage/products/{product_id}/candles',
199
199
  'brokerage/products/{product_id}/ticker',
200
+ 'brokerage/portfolios',
201
+ 'brokerage/portfolios/{portfolio_uuid}',
200
202
  'brokerage/transaction_summary',
201
203
  'brokerage/product_book',
202
204
  'brokerage/best_bid_ask',
@@ -208,9 +210,17 @@ class coinbase extends coinbase$1 {
208
210
  'brokerage/orders/batch_cancel',
209
211
  'brokerage/orders/edit',
210
212
  'brokerage/orders/edit_preview',
213
+ 'brokerage/portfolios',
214
+ 'brokerage/portfolios/move_funds',
211
215
  'brokerage/convert/quote',
212
216
  'brokerage/convert/trade/{trade_id}',
213
217
  ],
218
+ 'put': [
219
+ 'brokerage/portfolios/{portfolio_uuid}',
220
+ ],
221
+ 'delete': [
222
+ 'brokerage/portfolios/{portfolio_uuid}',
223
+ ],
214
224
  },
215
225
  },
216
226
  },
@@ -266,7 +276,9 @@ class coinbase extends coinbase$1 {
266
276
  'invalid_scope': errors.AuthenticationError,
267
277
  'not_found': errors.ExchangeError,
268
278
  'rate_limit_exceeded': errors.RateLimitExceeded,
269
- 'internal_server_error': errors.ExchangeError, // 500 Internal server error
279
+ 'internal_server_error': errors.ExchangeError,
280
+ 'UNSUPPORTED_ORDER_CONFIGURATION': errors.BadRequest,
281
+ 'INSUFFICIENT_FUND': errors.BadRequest,
270
282
  },
271
283
  'broad': {
272
284
  'request timestamp expired': errors.InvalidNonce,
@@ -2271,6 +2283,8 @@ class coinbase extends coinbase$1 {
2271
2283
  params = this.omit(params, ['timeInForce', 'triggerPrice', 'stopLossPrice', 'takeProfitPrice', 'stopPrice', 'stop_price', 'stopDirection', 'stop_direction', 'clientOrderId', 'postOnly', 'post_only', 'end_time']);
2272
2284
  const response = await this.v3PrivatePostBrokerageOrders(this.extend(request, params));
2273
2285
  //
2286
+ // successful order
2287
+ //
2274
2288
  // {
2275
2289
  // "success": true,
2276
2290
  // "failure_reason": "UNKNOWN_FAILURE_REASON",
@@ -2284,9 +2298,37 @@ class coinbase extends coinbase$1 {
2284
2298
  // "order_configuration": null
2285
2299
  // }
2286
2300
  //
2301
+ // failed order
2302
+ //
2303
+ // {
2304
+ // "success": false,
2305
+ // "failure_reason": "UNKNOWN_FAILURE_REASON",
2306
+ // "order_id": "",
2307
+ // "error_response": {
2308
+ // "error": "UNSUPPORTED_ORDER_CONFIGURATION",
2309
+ // "message": "source is not enabled for trading",
2310
+ // "error_details": "",
2311
+ // "new_order_failure_reason": "UNSUPPORTED_ORDER_CONFIGURATION"
2312
+ // },
2313
+ // "order_configuration": {
2314
+ // "limit_limit_gtc": {
2315
+ // "base_size": "100",
2316
+ // "limit_price": "40000",
2317
+ // "post_only": false
2318
+ // }
2319
+ // }
2320
+ // }
2321
+ //
2287
2322
  const success = this.safeValue(response, 'success');
2288
2323
  if (success !== true) {
2289
- throw new errors.BadRequest(this.id + ' createOrder() has failed, check your arguments and parameters');
2324
+ const errorResponse = this.safeValue(response, 'error_response');
2325
+ const errorTitle = this.safeString(errorResponse, 'error');
2326
+ const errorMessage = this.safeString(errorResponse, 'message');
2327
+ if (errorResponse !== undefined) {
2328
+ this.throwExactlyMatchedException(this.exceptions['exact'], errorTitle, errorMessage);
2329
+ this.throwBroadlyMatchedException(this.exceptions['broad'], errorTitle, errorMessage);
2330
+ throw new errors.ExchangeError(errorMessage);
2331
+ }
2290
2332
  }
2291
2333
  const data = this.safeValue(response, 'success_response', {});
2292
2334
  return this.parseOrder(data, market);