ccxt 4.5.14 → 4.5.16

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 (66) hide show
  1. package/README.md +20 -5
  2. package/dist/ccxt.browser.min.js +3 -3
  3. package/dist/cjs/ccxt.js +1 -1
  4. package/dist/cjs/src/ascendex.js +1 -0
  5. package/dist/cjs/src/backpack.js +7 -2
  6. package/dist/cjs/src/base/Exchange.js +46 -0
  7. package/dist/cjs/src/binance.js +3 -0
  8. package/dist/cjs/src/bingx.js +73 -46
  9. package/dist/cjs/src/bitget.js +19 -6
  10. package/dist/cjs/src/blofin.js +7 -6
  11. package/dist/cjs/src/bybit.js +16 -6
  12. package/dist/cjs/src/delta.js +98 -3
  13. package/dist/cjs/src/gate.js +152 -151
  14. package/dist/cjs/src/htx.js +1 -0
  15. package/dist/cjs/src/kraken.js +99 -4
  16. package/dist/cjs/src/kucoin.js +1 -0
  17. package/dist/cjs/src/mexc.js +1 -0
  18. package/dist/cjs/src/okx.js +10 -0
  19. package/dist/cjs/src/phemex.js +6 -3
  20. package/dist/cjs/src/poloniex.js +3 -0
  21. package/dist/cjs/src/pro/binance.js +1 -1
  22. package/dist/cjs/src/pro/kraken.js +1 -1
  23. package/dist/cjs/src/pro/upbit.js +25 -1
  24. package/dist/cjs/src/woo.js +41 -20
  25. package/js/ccxt.d.ts +1 -1
  26. package/js/ccxt.js +1 -1
  27. package/js/src/abstract/bingx.d.ts +17 -0
  28. package/js/src/abstract/bybit.d.ts +1 -0
  29. package/js/src/abstract/delta.d.ts +5 -1
  30. package/js/src/abstract/woo.d.ts +0 -3
  31. package/js/src/ascendex.js +1 -0
  32. package/js/src/backpack.d.ts +1 -1
  33. package/js/src/backpack.js +7 -2
  34. package/js/src/base/Exchange.d.ts +31 -0
  35. package/js/src/base/Exchange.js +47 -1
  36. package/js/src/base/types.d.ts +2 -0
  37. package/js/src/binance.js +3 -0
  38. package/js/src/bingx.d.ts +2 -2
  39. package/js/src/bingx.js +73 -46
  40. package/js/src/bitget.js +19 -6
  41. package/js/src/blofin.js +7 -6
  42. package/js/src/bybit.d.ts +1 -1
  43. package/js/src/bybit.js +16 -6
  44. package/js/src/delta.d.ts +13 -0
  45. package/js/src/delta.js +98 -3
  46. package/js/src/derive.js +1 -1
  47. package/js/src/gate.d.ts +140 -140
  48. package/js/src/gate.js +152 -151
  49. package/js/src/htx.js +1 -0
  50. package/js/src/kraken.d.ts +11 -1
  51. package/js/src/kraken.js +99 -4
  52. package/js/src/kucoin.js +1 -0
  53. package/js/src/mexc.js +1 -0
  54. package/js/src/okx.js +10 -0
  55. package/js/src/phemex.js +6 -3
  56. package/js/src/poloniex.js +3 -0
  57. package/js/src/pro/binance.js +1 -1
  58. package/js/src/pro/gate.js +1 -1
  59. package/js/src/pro/gemini.js +1 -1
  60. package/js/src/pro/kraken.d.ts +1 -1
  61. package/js/src/pro/kraken.js +1 -1
  62. package/js/src/pro/onetrading.js +1 -1
  63. package/js/src/pro/upbit.js +25 -1
  64. package/js/src/woo.d.ts +1 -1
  65. package/js/src/woo.js +41 -20
  66. package/package.json +1 -1
@@ -6830,6 +6830,7 @@ class htx extends htx$1["default"] {
6830
6830
  'repealed': 'failed',
6831
6831
  'wallet-transfer': 'pending',
6832
6832
  'pre-transfer': 'pending',
6833
+ 'verifying': 'pending',
6833
6834
  };
6834
6835
  return this.safeString(statuses, status, status);
6835
6836
  }
@@ -46,6 +46,7 @@ class kraken extends kraken$1["default"] {
46
46
  'createMarketOrderWithCost': false,
47
47
  'createMarketSellOrderWithCost': false,
48
48
  'createOrder': true,
49
+ 'createOrders': true,
49
50
  'createStopLimitOrder': true,
50
51
  'createStopMarketOrder': true,
51
52
  'createStopOrder': true,
@@ -473,7 +474,11 @@ class kraken extends kraken$1["default"] {
473
474
  'selfTradePrevention': true,
474
475
  'iceberg': true, // todo implement
475
476
  },
476
- 'createOrders': undefined,
477
+ 'createOrders': {
478
+ 'min': 2,
479
+ 'max': 15,
480
+ 'sameSymbolOnly': true,
481
+ },
477
482
  'fetchMyTrades': {
478
483
  'marginMode': false,
479
484
  'limit': undefined,
@@ -1678,6 +1683,79 @@ class kraken extends kraken$1["default"] {
1678
1683
  // this usingCost flag is used to help the parsing but omited from the order
1679
1684
  return this.parseOrder(result);
1680
1685
  }
1686
+ /**
1687
+ * @method
1688
+ * @name kraken#createOrders
1689
+ * @description create a list of trade orders
1690
+ * @see https://docs.kraken.com/api/docs/rest-api/add-order-batch/
1691
+ * @param {Array} orders list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
1692
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1693
+ * @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
1694
+ */
1695
+ async createOrders(orders, params = {}) {
1696
+ await this.loadMarkets();
1697
+ const ordersRequests = [];
1698
+ let orderSymbols = [];
1699
+ let symbol = undefined;
1700
+ let market = undefined;
1701
+ for (let i = 0; i < orders.length; i++) {
1702
+ const rawOrder = orders[i];
1703
+ const marketId = this.safeString(rawOrder, 'symbol');
1704
+ if (symbol === undefined) {
1705
+ symbol = marketId;
1706
+ }
1707
+ else {
1708
+ if (symbol !== marketId) {
1709
+ throw new errors.BadRequest(this.id + ' createOrders() requires all orders to have the same symbol');
1710
+ }
1711
+ }
1712
+ market = this.market(marketId);
1713
+ orderSymbols.push(marketId);
1714
+ const type = this.safeString(rawOrder, 'type');
1715
+ const side = this.safeString(rawOrder, 'side');
1716
+ const amount = this.safeValue(rawOrder, 'amount');
1717
+ const price = this.safeValue(rawOrder, 'price');
1718
+ const orderParams = this.safeDict(rawOrder, 'params', {});
1719
+ const req = {
1720
+ 'type': side,
1721
+ 'ordertype': type,
1722
+ 'volume': this.amountToPrecision(market['symbol'], amount),
1723
+ };
1724
+ const orderRequest = this.orderRequest('createOrders', marketId, type, req, amount, price, orderParams);
1725
+ ordersRequests.push(orderRequest[0]);
1726
+ }
1727
+ orderSymbols = this.marketSymbols(orderSymbols, undefined, false, true, true);
1728
+ let response = undefined;
1729
+ let request = {
1730
+ 'orders': ordersRequests,
1731
+ 'pair': market['id'],
1732
+ };
1733
+ request = this.extend(request, params);
1734
+ response = await this.privatePostAddOrderBatch(request);
1735
+ //
1736
+ // {
1737
+ // "error":[
1738
+ // ],
1739
+ // "result":{
1740
+ // "orders":[
1741
+ // {
1742
+ // "txid":"OEPPJX-34RMM-OROGZE",
1743
+ // "descr":{
1744
+ // "order":"sell 6.000000 ADAUSDC @ limit 0.400000"
1745
+ // }
1746
+ // },
1747
+ // {
1748
+ // "txid":"OLQY7O-OYBXW-W23PGL",
1749
+ // "descr":{
1750
+ // "order":"sell 6.000000 ADAUSDC @ limit 0.400000"
1751
+ // }
1752
+ // }
1753
+ // ]
1754
+ // }
1755
+ //
1756
+ const result = this.safeDict(response, 'result', {});
1757
+ return this.parseOrders(this.safeList(result, 'orders'));
1758
+ }
1681
1759
  findMarketByAltnameOrId(id) {
1682
1760
  const marketsByAltname = this.safeValue(this.options, 'marketsByAltname', {});
1683
1761
  if (id in marketsByAltname) {
@@ -3470,10 +3548,11 @@ class kraken extends kraken$1["default"] {
3470
3548
  isTriggerPercent = (price.endsWith('%')) ? true : false;
3471
3549
  }
3472
3550
  const isCancelOrderBatch = (path === 'CancelOrderBatch');
3551
+ const isBatchOrder = (path === 'AddOrderBatch');
3473
3552
  this.checkRequiredCredentials();
3474
3553
  const nonce = this.nonce().toString();
3475
3554
  // urlencodeNested is used to address https://github.com/ccxt/ccxt/issues/12872
3476
- if (isCancelOrderBatch || isTriggerPercent) {
3555
+ if (isCancelOrderBatch || isTriggerPercent || isBatchOrder) {
3477
3556
  body = this.json(this.extend({ 'nonce': nonce }, params));
3478
3557
  }
3479
3558
  else {
@@ -3489,7 +3568,7 @@ class kraken extends kraken$1["default"] {
3489
3568
  'API-Key': this.apiKey,
3490
3569
  'API-Sign': signature,
3491
3570
  };
3492
- if (isCancelOrderBatch || isTriggerPercent) {
3571
+ if (isCancelOrderBatch || isTriggerPercent || isBatchOrder) {
3493
3572
  headers['Content-Type'] = 'application/json';
3494
3573
  }
3495
3574
  else {
@@ -3514,10 +3593,10 @@ class kraken extends kraken$1["default"] {
3514
3593
  }
3515
3594
  if (body[0] === '{') {
3516
3595
  if (typeof response !== 'string') {
3596
+ const message = this.id + ' ' + body;
3517
3597
  if ('error' in response) {
3518
3598
  const numErrors = response['error'].length;
3519
3599
  if (numErrors) {
3520
- const message = this.id + ' ' + body;
3521
3600
  for (let i = 0; i < response['error'].length; i++) {
3522
3601
  const error = response['error'][i];
3523
3602
  this.throwExactlyMatchedException(this.exceptions['exact'], error, message);
@@ -3526,6 +3605,22 @@ class kraken extends kraken$1["default"] {
3526
3605
  throw new errors.ExchangeError(message);
3527
3606
  }
3528
3607
  }
3608
+ // handleCreateOrdersErrors:
3609
+ if ('result' in response) {
3610
+ const result = this.safeDict(response, 'result', {});
3611
+ if ('orders' in result) {
3612
+ const orders = this.safeList(result, 'orders', []);
3613
+ for (let i = 0; i < orders.length; i++) {
3614
+ const order = orders[i];
3615
+ const error = this.safeString(order, 'error');
3616
+ if (error !== undefined) {
3617
+ this.throwExactlyMatchedException(this.exceptions['exact'], error, message);
3618
+ this.throwBroadlyMatchedException(this.exceptions['broad'], error, message);
3619
+ throw new errors.ExchangeError(message);
3620
+ }
3621
+ }
3622
+ }
3623
+ }
3529
3624
  }
3530
3625
  }
3531
3626
  return undefined;
@@ -499,6 +499,7 @@ class kucoin extends kucoin$1["default"] {
499
499
  'order_not_exist': errors.OrderNotFound,
500
500
  'order_not_exist_or_not_allow_to_cancel': errors.InvalidOrder,
501
501
  'Order size below the minimum requirement.': errors.InvalidOrder,
502
+ 'Order size increment invalid.': errors.InvalidOrder,
502
503
  'The withdrawal amount is below the minimum requirement.': errors.ExchangeError,
503
504
  'Unsuccessful! Exceeded the max. funds out-transfer limit': errors.InsufficientFunds,
504
505
  'The amount increment is invalid.': errors.BadRequest,
@@ -931,6 +931,7 @@ class mexc extends mexc$1["default"] {
931
931
  '30029': errors.InvalidOrder,
932
932
  '30032': errors.InvalidOrder,
933
933
  '30041': errors.InvalidOrder,
934
+ '30087': errors.InvalidOrder,
934
935
  '60005': errors.ExchangeError,
935
936
  '700001': errors.AuthenticationError,
936
937
  '700002': errors.AuthenticationError,
@@ -1658,6 +1658,12 @@ class okx extends okx$1["default"] {
1658
1658
  // "uly": "BTC-USD"
1659
1659
  // }
1660
1660
  //
1661
+ // for swap "preopen" markets, only `instId` and `instType` are present
1662
+ //
1663
+ // instId: "ETH-USD_UM-SWAP",
1664
+ // instType: "SWAP",
1665
+ // state: "preopen",
1666
+ //
1661
1667
  const id = this.safeString(market, 'instId');
1662
1668
  let type = this.safeStringLower(market, 'instType');
1663
1669
  if (type === 'futures') {
@@ -1687,6 +1693,10 @@ class okx extends okx$1["default"] {
1687
1693
  const base = this.safeCurrencyCode(baseId);
1688
1694
  const quote = this.safeCurrencyCode(quoteId);
1689
1695
  let symbol = base + '/' + quote;
1696
+ // handle preopen empty markets
1697
+ if (base === '' || quote === '') {
1698
+ symbol = id;
1699
+ }
1690
1700
  let expiry = undefined;
1691
1701
  let strikePrice = undefined;
1692
1702
  let optionType = undefined;
@@ -3391,12 +3391,14 @@ class phemex extends phemex$1["default"] {
3391
3391
  if (symbol !== undefined) {
3392
3392
  market = this.market(symbol);
3393
3393
  }
3394
+ let type = undefined;
3395
+ [type, params] = this.handleMarketTypeAndParams('fetchMyTrades', market, params);
3394
3396
  const request = {};
3395
3397
  if (limit !== undefined) {
3396
3398
  limit = Math.min(200, limit);
3397
3399
  request['limit'] = limit;
3398
3400
  }
3399
- const isUSDTSettled = (symbol === undefined) || (this.safeString(market, 'settle') === 'USDT');
3401
+ const isUSDTSettled = (type !== 'spot') && ((symbol === undefined) || (this.safeString(market, 'settle') === 'USDT'));
3400
3402
  if (isUSDTSettled) {
3401
3403
  request['currency'] = 'USDT';
3402
3404
  request['offset'] = 0;
@@ -3404,7 +3406,7 @@ class phemex extends phemex$1["default"] {
3404
3406
  request['limit'] = 200;
3405
3407
  }
3406
3408
  }
3407
- else {
3409
+ else if (symbol !== undefined) {
3408
3410
  request['symbol'] = market['id'];
3409
3411
  }
3410
3412
  if (since !== undefined) {
@@ -3414,7 +3416,8 @@ class phemex extends phemex$1["default"] {
3414
3416
  if (isUSDTSettled) {
3415
3417
  response = await this.privateGetExchangeOrderV2TradingList(this.extend(request, params));
3416
3418
  }
3417
- else if (market['swap']) {
3419
+ else if (type === 'swap') {
3420
+ request['tradeType'] = 'Trade';
3418
3421
  response = await this.privateGetExchangeOrderTrade(this.extend(request, params));
3419
3422
  }
3420
3423
  else {
@@ -3616,6 +3616,9 @@ class poloniex extends poloniex$1["default"] {
3616
3616
  if (this.inArray(api, ['swapPublic', 'swapPrivate'])) {
3617
3617
  url = this.urls['api']['swap'];
3618
3618
  }
3619
+ if ('symbol' in params) {
3620
+ params['symbol'] = this.encodeURIComponent(params['symbol']); // handle symbols like 索拉拉/USDT'
3621
+ }
3619
3622
  const query = this.omit(params, this.extractParams(path));
3620
3623
  const implodedPath = this.implodeParams(path, params);
3621
3624
  if (api === 'public' || api === 'swapPublic') {
@@ -2332,7 +2332,7 @@ class binance extends binance$1["default"] {
2332
2332
  'apiKey': this.apiKey,
2333
2333
  }, params);
2334
2334
  extendedParams = this.keysort(extendedParams);
2335
- const query = this.urlencode(extendedParams);
2335
+ const query = this.rawencode(extendedParams);
2336
2336
  let signature = undefined;
2337
2337
  if (this.secret.indexOf('PRIVATE KEY') > -1) {
2338
2338
  if (this.secret.length > 120) {
@@ -588,7 +588,7 @@ class kraken extends kraken$1["default"] {
588
588
  }
589
589
  client.resolve(stored, messageHash);
590
590
  }
591
- handleOHLCV(client, message, subscription) {
591
+ handleOHLCV(client, message) {
592
592
  //
593
593
  // {
594
594
  // "channel": "ohlc",
@@ -402,12 +402,36 @@ class upbit extends upbit$1["default"] {
402
402
  'hostname': this.hostname,
403
403
  });
404
404
  url += '/private';
405
+ const client = this.client(url);
406
+ // Track private channel subscriptions to support multiple concurrent watches
407
+ const subscriptionsKey = 'upbitPrivateSubscriptions';
408
+ if (!(subscriptionsKey in client.subscriptions)) {
409
+ client.subscriptions[subscriptionsKey] = {};
410
+ }
411
+ let channelKey = channel;
412
+ if (symbol !== undefined) {
413
+ channelKey = channel + ':' + symbol;
414
+ }
415
+ const subscriptions = client.subscriptions[subscriptionsKey];
416
+ const isNewChannel = !(channelKey in subscriptions);
417
+ if (isNewChannel) {
418
+ subscriptions[channelKey] = request;
419
+ }
420
+ // Build subscription message with all requested private channels
421
+ // Format: [{'ticket': uuid}, {'type': 'myOrder'}, {'type': 'myAsset'}, ...]
422
+ const requests = [];
423
+ const channelKeys = Object.keys(subscriptions);
424
+ for (let i = 0; i < channelKeys.length; i++) {
425
+ requests.push(subscriptions[channelKeys[i]]);
426
+ }
405
427
  const message = [
406
428
  {
407
429
  'ticket': this.uuid(),
408
430
  },
409
- request,
410
431
  ];
432
+ for (let i = 0; i < requests.length; i++) {
433
+ message.push(requests[i]);
434
+ }
411
435
  return await this.watch(url, messageHash, message, messageHash);
412
436
  }
413
437
  /**
@@ -211,9 +211,7 @@ class woo extends woo$1["default"] {
211
211
  'post': {
212
212
  'order': 1,
213
213
  'order/cancel_all_after': 1,
214
- 'asset/main_sub_transfer': 30,
215
214
  'asset/ltv': 30,
216
- 'asset/withdraw': 30,
217
215
  'asset/internal_withdraw': 30,
218
216
  'interest/repay': 60,
219
217
  'client/account_mode': 120,
@@ -287,7 +285,6 @@ class woo extends woo$1["default"] {
287
285
  'spotMargin/maxMargin': 60,
288
286
  'algo/order/{oid}': 1,
289
287
  'algo/orders': 1,
290
- 'balances': 1,
291
288
  'positions': 3.33,
292
289
  'buypower': 1,
293
290
  'convert/exchangeInfo': 1,
@@ -2422,7 +2419,7 @@ class woo extends woo$1["default"] {
2422
2419
  */
2423
2420
  async fetchBalance(params = {}) {
2424
2421
  await this.loadMarkets();
2425
- const response = await this.v3PrivateGetBalances(params);
2422
+ const response = await this.v3PrivateGetAssetBalances(params);
2426
2423
  //
2427
2424
  // {
2428
2425
  // "success": true,
@@ -2752,14 +2749,14 @@ class woo extends woo$1["default"] {
2752
2749
  const networkizedCode = this.safeString(transaction, 'token');
2753
2750
  const currencyDefined = this.getCurrencyFromChaincode(networkizedCode, currency);
2754
2751
  const code = currencyDefined['code'];
2755
- let movementDirection = this.safeStringLower2(transaction, 'token_side', 'tokenSide');
2752
+ let movementDirection = this.safeStringLowerN(transaction, ['token_side', 'tokenSide', 'type']);
2756
2753
  if (movementDirection === 'withdraw') {
2757
2754
  movementDirection = 'withdrawal';
2758
2755
  }
2759
2756
  const fee = this.parseTokenAndFeeTemp(transaction, ['fee_token', 'feeToken'], ['fee_amount', 'feeAmount']);
2760
- const addressTo = this.safeString2(transaction, 'target_address', 'targetAddress');
2757
+ const addressTo = this.safeStringN(transaction, ['target_address', 'targetAddress', 'addressTo']);
2761
2758
  const addressFrom = this.safeString2(transaction, 'source_address', 'sourceAddress');
2762
- const timestamp = this.safeTimestamp2(transaction, 'created_time', 'createdTime');
2759
+ const timestamp = this.safeTimestampN(transaction, ['created_time', 'createdTime'], this.safeInteger(transaction, 'timestamp'));
2763
2760
  return {
2764
2761
  'info': transaction,
2765
2762
  'id': this.safeStringN(transaction, ['id', 'withdraw_id', 'withdrawId']),
@@ -2769,7 +2766,7 @@ class woo extends woo$1["default"] {
2769
2766
  'address': undefined,
2770
2767
  'addressFrom': addressFrom,
2771
2768
  'addressTo': addressTo,
2772
- 'tag': this.safeString(transaction, 'extra'),
2769
+ 'tag': this.safeString2(transaction, 'extra', 'tag'),
2773
2770
  'tagFrom': undefined,
2774
2771
  'tagTo': undefined,
2775
2772
  'type': movementDirection,
@@ -2780,7 +2777,7 @@ class woo extends woo$1["default"] {
2780
2777
  'comment': undefined,
2781
2778
  'internal': undefined,
2782
2779
  'fee': fee,
2783
- 'network': undefined,
2780
+ 'network': this.networkIdToCode(this.safeString(transaction, 'network')),
2784
2781
  };
2785
2782
  }
2786
2783
  parseTransactionStatus(status) {
@@ -2811,17 +2808,25 @@ class woo extends woo$1["default"] {
2811
2808
  const request = {
2812
2809
  'token': currency['id'],
2813
2810
  'amount': this.parseToNumeric(amount),
2814
- 'from_application_id': fromAccount,
2815
- 'to_application_id': toAccount,
2811
+ 'from': {
2812
+ 'applicationId': fromAccount,
2813
+ },
2814
+ 'to': {
2815
+ 'applicationId': toAccount,
2816
+ },
2816
2817
  };
2817
- const response = await this.v1PrivatePostAssetMainSubTransfer(this.extend(request, params));
2818
+ const response = await this.v3PrivatePostAssetTransfer(this.extend(request, params));
2818
2819
  //
2819
2820
  // {
2820
2821
  // "success": true,
2821
2822
  // "id": 200
2822
2823
  // }
2823
2824
  //
2824
- const transfer = this.parseTransfer(response, currency);
2825
+ const data = this.safeDict(response, 'data', {});
2826
+ data['timestamp'] = this.safeInteger(response, 'timestamp');
2827
+ data['token'] = currency['id'];
2828
+ data['status'] = 'ok';
2829
+ const transfer = this.parseTransfer(data, currency);
2825
2830
  const transferOptions = this.safeDict(this.options, 'transfer', {});
2826
2831
  const fillResponseFromRequest = this.safeBool(transferOptions, 'fillResponseFromRequest', true);
2827
2832
  if (fillResponseFromRequest) {
@@ -2935,7 +2940,7 @@ class woo extends woo$1["default"] {
2935
2940
  // }
2936
2941
  //
2937
2942
  const code = this.safeCurrencyCode(this.safeString(transfer, 'token'), currency);
2938
- const timestamp = this.safeTimestamp(transfer, 'createdTime');
2943
+ const timestamp = this.safeTimestamp2(transfer, 'createdTime', 'timestamp');
2939
2944
  const success = this.safeBool(transfer, 'success');
2940
2945
  let status = undefined;
2941
2946
  if (success !== undefined) {
@@ -2969,7 +2974,7 @@ class woo extends woo$1["default"] {
2969
2974
  * @method
2970
2975
  * @name woo#withdraw
2971
2976
  * @description make a withdrawal
2972
- * @see https://docs.woox.io/#token-withdraw
2977
+ * @see https://docs.woox.io/#token-withdraw-v3
2973
2978
  * @param {string} code unified currency code
2974
2979
  * @param {float} amount the amount to withdraw
2975
2980
  * @param {string} address the address to withdraw to
@@ -2989,17 +2994,33 @@ class woo extends woo$1["default"] {
2989
2994
  if (tag !== undefined) {
2990
2995
  request['extra'] = tag;
2991
2996
  }
2992
- let specialNetworkId = undefined;
2993
- [specialNetworkId, params] = this.getDedicatedNetworkId(currency, params);
2994
- request['token'] = specialNetworkId;
2995
- const response = await this.v1PrivatePostAssetWithdraw(this.extend(request, params));
2997
+ const network = this.safeString(params, 'network');
2998
+ if (network === undefined) {
2999
+ throw new errors.ArgumentsRequired(this.id + ' withdraw() requires a network parameter for ' + code);
3000
+ }
3001
+ params = this.omit(params, 'network');
3002
+ request['token'] = currency['id'];
3003
+ request['network'] = this.networkCodeToId(network);
3004
+ const response = await this.v3PrivatePostAssetWalletWithdraw(this.extend(request, params));
2996
3005
  //
2997
3006
  // {
2998
3007
  // "success": true,
2999
3008
  // "withdraw_id": "20200119145703654"
3000
3009
  // }
3001
3010
  //
3002
- return this.parseTransaction(response, currency);
3011
+ const data = this.safeDict(response, 'data', {});
3012
+ const transactionData = this.extend(data, {
3013
+ 'id': this.safeString(data, 'withdrawId'),
3014
+ 'timestamp': this.safeInteger(response, 'timestamp'),
3015
+ 'currency': code,
3016
+ 'amount': amount,
3017
+ 'addressTo': address,
3018
+ 'tag': tag,
3019
+ 'network': network,
3020
+ 'type': 'withdrawal',
3021
+ 'status': 'pending',
3022
+ });
3023
+ return this.parseTransaction(transactionData, currency);
3003
3024
  }
3004
3025
  /**
3005
3026
  * @method
package/js/ccxt.d.ts CHANGED
@@ -4,7 +4,7 @@ import * as functions from './src/base/functions.js';
4
4
  import * as errors from './src/base/errors.js';
5
5
  import type { Int, int, Str, Strings, Num, Bool, IndexType, OrderSide, OrderType, MarketType, SubType, Dict, NullableDict, List, NullableList, Fee, OHLCV, OHLCVC, implicitReturnType, Market, Currency, Dictionary, MinMax, FeeInterface, TradingFeeInterface, MarketInterface, Trade, Order, OrderBook, Ticker, Transaction, Tickers, CurrencyInterface, Balance, BalanceAccount, Account, PartialBalances, Balances, DepositAddress, WithdrawalResponse, FundingRate, FundingRates, Position, BorrowInterest, LeverageTier, LedgerEntry, DepositWithdrawFeeNetwork, DepositWithdrawFee, TransferEntry, CrossBorrowRate, IsolatedBorrowRate, FundingRateHistory, OpenInterest, Liquidation, OrderRequest, CancellationRequest, FundingHistory, MarketMarginModes, MarginMode, Greeks, Conversion, Option, LastPrice, Leverage, MarginModification, Leverages, LastPrices, Currencies, TradingFees, MarginModes, OptionChain, IsolatedBorrowRates, CrossBorrowRates, LeverageTiers, LongShortRatio, OrderBooks, OpenInterests, ConstructorArgs } from './src/base/types.js';
6
6
  import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, RestrictedLocation, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending, UnsubscribeError } from './src/base/errors.js';
7
- declare const version = "4.5.13";
7
+ declare const version = "4.5.15";
8
8
  import alpaca from './src/alpaca.js';
9
9
  import apex from './src/apex.js';
10
10
  import arkham from './src/arkham.js';
package/js/ccxt.js CHANGED
@@ -32,7 +32,7 @@ import * as errors from './src/base/errors.js';
32
32
  import { BaseError, ExchangeError, AuthenticationError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, OperationRejected, NoChange, MarginModeAlreadySet, MarketClosed, ManualInteractionNeeded, RestrictedLocation, InsufficientFunds, InvalidAddress, AddressPending, InvalidOrder, OrderNotFound, OrderNotCached, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, ContractUnavailable, NotSupported, InvalidProxySettings, ExchangeClosedByUser, OperationFailed, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, ChecksumError, RequestTimeout, BadResponse, NullResponse, CancelPending, UnsubscribeError } from './src/base/errors.js';
33
33
  //-----------------------------------------------------------------------------
34
34
  // this is updated by vss.js when building
35
- const version = '4.5.13';
35
+ const version = '4.5.15';
36
36
  Exchange.ccxtVersion = version;
37
37
  //-----------------------------------------------------------------------------
38
38
  import alpaca from './src/alpaca.js';
@@ -16,6 +16,9 @@ interface Exchange {
16
16
  spotV1PrivateGetTradeMyTrades(params?: {}): Promise<implicitReturnType>;
17
17
  spotV1PrivateGetUserCommissionRate(params?: {}): Promise<implicitReturnType>;
18
18
  spotV1PrivateGetAccountBalance(params?: {}): Promise<implicitReturnType>;
19
+ spotV1PrivateGetOcoOrderList(params?: {}): Promise<implicitReturnType>;
20
+ spotV1PrivateGetOcoOpenOrderList(params?: {}): Promise<implicitReturnType>;
21
+ spotV1PrivateGetOcoHistoryOrderList(params?: {}): Promise<implicitReturnType>;
19
22
  spotV1PrivatePostTradeOrder(params?: {}): Promise<implicitReturnType>;
20
23
  spotV1PrivatePostTradeCancel(params?: {}): Promise<implicitReturnType>;
21
24
  spotV1PrivatePostTradeBatchOrders(params?: {}): Promise<implicitReturnType>;
@@ -23,6 +26,8 @@ interface Exchange {
23
26
  spotV1PrivatePostTradeCancelOrders(params?: {}): Promise<implicitReturnType>;
24
27
  spotV1PrivatePostTradeCancelOpenOrders(params?: {}): Promise<implicitReturnType>;
25
28
  spotV1PrivatePostTradeCancelAllAfter(params?: {}): Promise<implicitReturnType>;
29
+ spotV1PrivatePostOcoOrder(params?: {}): Promise<implicitReturnType>;
30
+ spotV1PrivatePostOcoCancel(params?: {}): Promise<implicitReturnType>;
26
31
  spotV2PublicGetMarketDepth(params?: {}): Promise<implicitReturnType>;
27
32
  spotV2PublicGetMarketKline(params?: {}): Promise<implicitReturnType>;
28
33
  spotV3PrivateGetGetAssetTransfer(params?: {}): Promise<implicitReturnType>;
@@ -34,6 +39,7 @@ interface Exchange {
34
39
  swapV1PublicGetMarketHistoricalTrades(params?: {}): Promise<implicitReturnType>;
35
40
  swapV1PublicGetMarketMarkPriceKlines(params?: {}): Promise<implicitReturnType>;
36
41
  swapV1PublicGetTradeMultiAssetsRules(params?: {}): Promise<implicitReturnType>;
42
+ swapV1PublicGetTradingRules(params?: {}): Promise<implicitReturnType>;
37
43
  swapV1PrivateGetPositionSideDual(params?: {}): Promise<implicitReturnType>;
38
44
  swapV1PrivateGetTradeBatchCancelReplace(params?: {}): Promise<implicitReturnType>;
39
45
  swapV1PrivateGetTradeFullOrder(params?: {}): Promise<implicitReturnType>;
@@ -53,6 +59,8 @@ interface Exchange {
53
59
  swapV1PrivatePostTwapOrder(params?: {}): Promise<implicitReturnType>;
54
60
  swapV1PrivatePostTwapCancelOrder(params?: {}): Promise<implicitReturnType>;
55
61
  swapV1PrivatePostTradeAssetMode(params?: {}): Promise<implicitReturnType>;
62
+ swapV1PrivatePostTradeReverse(params?: {}): Promise<implicitReturnType>;
63
+ swapV1PrivatePostTradeAutoAddMargin(params?: {}): Promise<implicitReturnType>;
56
64
  swapV2PublicGetServerTime(params?: {}): Promise<implicitReturnType>;
57
65
  swapV2PublicGetQuoteContracts(params?: {}): Promise<implicitReturnType>;
58
66
  swapV2PublicGetQuotePrice(params?: {}): Promise<implicitReturnType>;
@@ -91,6 +99,7 @@ interface Exchange {
91
99
  swapV2PrivateDeleteTradeBatchOrders(params?: {}): Promise<implicitReturnType>;
92
100
  swapV2PrivateDeleteTradeAllOpenOrders(params?: {}): Promise<implicitReturnType>;
93
101
  swapV3PublicGetQuoteKlines(params?: {}): Promise<implicitReturnType>;
102
+ swapV3PrivateGetUserBalance(params?: {}): Promise<implicitReturnType>;
94
103
  cswapV1PublicGetMarketContracts(params?: {}): Promise<implicitReturnType>;
95
104
  cswapV1PublicGetMarketPremiumIndex(params?: {}): Promise<implicitReturnType>;
96
105
  cswapV1PublicGetMarketOpenInterest(params?: {}): Promise<implicitReturnType>;
@@ -159,6 +168,14 @@ interface Exchange {
159
168
  apiV3PrivatePostPostAssetTransfer(params?: {}): Promise<implicitReturnType>;
160
169
  apiAssetV1PrivatePostTransfer(params?: {}): Promise<implicitReturnType>;
161
170
  apiAssetV1PublicGetTransferSupportCoins(params?: {}): Promise<implicitReturnType>;
171
+ agentV1PrivateGetAccountInviteAccountList(params?: {}): Promise<implicitReturnType>;
172
+ agentV1PrivateGetRewardCommissionDataList(params?: {}): Promise<implicitReturnType>;
173
+ agentV1PrivateGetAccountInviteRelationCheck(params?: {}): Promise<implicitReturnType>;
174
+ agentV1PrivateGetAssetDepositDetailList(params?: {}): Promise<implicitReturnType>;
175
+ agentV1PrivateGetRewardThirdCommissionDataList(params?: {}): Promise<implicitReturnType>;
176
+ agentV1PrivateGetAssetPartnerData(params?: {}): Promise<implicitReturnType>;
177
+ agentV1PrivateGetCommissionDataListReferralCode(params?: {}): Promise<implicitReturnType>;
178
+ agentV1PrivateGetAccountSuperiorCheck(params?: {}): Promise<implicitReturnType>;
162
179
  }
163
180
  declare abstract class Exchange extends _Exchange {
164
181
  }
@@ -282,6 +282,7 @@ interface Exchange {
282
282
  privatePostV5AccountMmpReset(params?: {}): Promise<implicitReturnType>;
283
283
  privatePostV5AccountBorrow(params?: {}): Promise<implicitReturnType>;
284
284
  privatePostV5AccountRepay(params?: {}): Promise<implicitReturnType>;
285
+ privatePostV5AccountNoConvertRepay(params?: {}): Promise<implicitReturnType>;
285
286
  privatePostV5AssetExchangeQuoteApply(params?: {}): Promise<implicitReturnType>;
286
287
  privatePostV5AssetExchangeConvertExecute(params?: {}): Promise<implicitReturnType>;
287
288
  privatePostV5AssetTransferInterTransfer(params?: {}): Promise<implicitReturnType>;
@@ -14,6 +14,8 @@ interface Exchange {
14
14
  publicGetHistorySparklines(params?: {}): Promise<implicitReturnType>;
15
15
  publicGetSettings(params?: {}): Promise<implicitReturnType>;
16
16
  privateGetOrders(params?: {}): Promise<implicitReturnType>;
17
+ privateGetOrdersOrderId(params?: {}): Promise<implicitReturnType>;
18
+ privateGetOrdersClientOrderIdClientOid(params?: {}): Promise<implicitReturnType>;
17
19
  privateGetProductsProductIdOrdersLeverage(params?: {}): Promise<implicitReturnType>;
18
20
  privateGetPositionsMargined(params?: {}): Promise<implicitReturnType>;
19
21
  privateGetPositions(params?: {}): Promise<implicitReturnType>;
@@ -27,8 +29,8 @@ interface Exchange {
27
29
  privateGetUsersTradingPreferences(params?: {}): Promise<implicitReturnType>;
28
30
  privateGetSubAccounts(params?: {}): Promise<implicitReturnType>;
29
31
  privateGetProfile(params?: {}): Promise<implicitReturnType>;
32
+ privateGetHeartbeat(params?: {}): Promise<implicitReturnType>;
30
33
  privateGetDepositsAddress(params?: {}): Promise<implicitReturnType>;
31
- privateGetOrdersLeverage(params?: {}): Promise<implicitReturnType>;
32
34
  privatePostOrders(params?: {}): Promise<implicitReturnType>;
33
35
  privatePostOrdersBracket(params?: {}): Promise<implicitReturnType>;
34
36
  privatePostOrdersBatch(params?: {}): Promise<implicitReturnType>;
@@ -36,6 +38,8 @@ interface Exchange {
36
38
  privatePostPositionsChangeMargin(params?: {}): Promise<implicitReturnType>;
37
39
  privatePostPositionsCloseAll(params?: {}): Promise<implicitReturnType>;
38
40
  privatePostWalletsSubAccountBalanceTransfer(params?: {}): Promise<implicitReturnType>;
41
+ privatePostHeartbeatCreate(params?: {}): Promise<implicitReturnType>;
42
+ privatePostHeartbeat(params?: {}): Promise<implicitReturnType>;
39
43
  privatePostOrdersCancelAfter(params?: {}): Promise<implicitReturnType>;
40
44
  privatePostOrdersLeverage(params?: {}): Promise<implicitReturnType>;
41
45
  privatePutOrders(params?: {}): Promise<implicitReturnType>;
@@ -44,9 +44,7 @@ interface Exchange {
44
44
  v1PrivateGetClientFuturesLeverage(params?: {}): Promise<implicitReturnType>;
45
45
  v1PrivatePostOrder(params?: {}): Promise<implicitReturnType>;
46
46
  v1PrivatePostOrderCancelAllAfter(params?: {}): Promise<implicitReturnType>;
47
- v1PrivatePostAssetMainSubTransfer(params?: {}): Promise<implicitReturnType>;
48
47
  v1PrivatePostAssetLtv(params?: {}): Promise<implicitReturnType>;
49
- v1PrivatePostAssetWithdraw(params?: {}): Promise<implicitReturnType>;
50
48
  v1PrivatePostAssetInternalWithdraw(params?: {}): Promise<implicitReturnType>;
51
49
  v1PrivatePostInterestRepay(params?: {}): Promise<implicitReturnType>;
52
50
  v1PrivatePostClientAccountMode(params?: {}): Promise<implicitReturnType>;
@@ -102,7 +100,6 @@ interface Exchange {
102
100
  v3PrivateGetSpotMarginMaxMargin(params?: {}): Promise<implicitReturnType>;
103
101
  v3PrivateGetAlgoOrderOid(params?: {}): Promise<implicitReturnType>;
104
102
  v3PrivateGetAlgoOrders(params?: {}): Promise<implicitReturnType>;
105
- v3PrivateGetBalances(params?: {}): Promise<implicitReturnType>;
106
103
  v3PrivateGetPositions(params?: {}): Promise<implicitReturnType>;
107
104
  v3PrivateGetBuypower(params?: {}): Promise<implicitReturnType>;
108
105
  v3PrivateGetConvertExchangeInfo(params?: {}): Promise<implicitReturnType>;
@@ -39,6 +39,7 @@ export default class ascendex extends Exchange {
39
39
  'createStopMarketOrder': true,
40
40
  'createStopOrder': true,
41
41
  'fetchAccounts': true,
42
+ 'fetchAllGreeks': false,
42
43
  'fetchBalance': true,
43
44
  'fetchClosedOrders': true,
44
45
  'fetchCurrencies': true,
@@ -205,7 +205,7 @@ export default class backpack extends Exchange {
205
205
  * @param {string} address the address to withdraw to
206
206
  * @param {string} tag
207
207
  * @param {object} [params] extra parameters specific to the exchange API endpoint
208
- * @param {string} [params.network] the network to withdraw on (mandatory)
208
+ * @param {string} params.network the network to withdraw on (mandatory)
209
209
  * @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
210
210
  */
211
211
  withdraw(code: string, amount: number, address: string, tag?: Str, params?: {}): Promise<Transaction>;