ccxt 4.3.42 → 4.3.44

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 (52) hide show
  1. package/README.md +9 -7
  2. package/dist/ccxt.browser.min.js +3 -3
  3. package/dist/cjs/ccxt.js +4 -1
  4. package/dist/cjs/src/binance.js +169 -44
  5. package/dist/cjs/src/btcmarkets.js +31 -2
  6. package/dist/cjs/src/coinex.js +106 -107
  7. package/dist/cjs/src/lykke.js +10 -2
  8. package/dist/cjs/src/ndax.js +5 -1
  9. package/dist/cjs/src/phemex.js +5 -4
  10. package/dist/cjs/src/poloniexfutures.js +2 -2
  11. package/dist/cjs/src/pro/bitget.js +28 -21
  12. package/dist/cjs/src/pro/bitmex.js +9 -0
  13. package/dist/cjs/src/pro/bybit.js +1 -1
  14. package/dist/cjs/src/pro/mexc.js +1 -1
  15. package/dist/cjs/src/pro/woo.js +1 -1
  16. package/dist/cjs/src/tradeogre.js +11 -5
  17. package/dist/cjs/src/wavesexchange.js +2 -2
  18. package/dist/cjs/src/wazirx.js +38 -15
  19. package/dist/cjs/src/xt.js +134 -95
  20. package/dist/cjs/src/zonda.js +9 -1
  21. package/js/ccxt.d.ts +6 -3
  22. package/js/ccxt.js +4 -2
  23. package/js/src/abstract/coinex.d.ts +2 -1
  24. package/js/src/abstract/xt.d.ts +155 -0
  25. package/js/src/abstract/xt.js +11 -0
  26. package/js/src/binance.js +169 -44
  27. package/js/src/btcmarkets.d.ts +2 -2
  28. package/js/src/btcmarkets.js +31 -2
  29. package/js/src/coinex.js +106 -107
  30. package/js/src/lykke.d.ts +2 -2
  31. package/js/src/lykke.js +10 -2
  32. package/js/src/ndax.d.ts +1 -1
  33. package/js/src/ndax.js +5 -1
  34. package/js/src/phemex.js +6 -5
  35. package/js/src/poloniexfutures.js +2 -2
  36. package/js/src/pro/bitget.js +28 -21
  37. package/js/src/pro/bitmex.js +9 -0
  38. package/js/src/pro/bybit.js +1 -1
  39. package/js/src/pro/mexc.js +1 -1
  40. package/js/src/pro/woo.js +1 -1
  41. package/js/src/static_dependencies/jsencrypt/lib/jsbn/jsbn.d.ts +1 -1
  42. package/js/src/tradeogre.d.ts +1 -1
  43. package/js/src/tradeogre.js +12 -6
  44. package/js/src/wavesexchange.d.ts +1 -20
  45. package/js/src/wavesexchange.js +2 -2
  46. package/js/src/wazirx.d.ts +1 -1
  47. package/js/src/wazirx.js +38 -15
  48. package/js/src/xt.d.ts +161 -0
  49. package/js/src/xt.js +4761 -0
  50. package/js/src/zonda.d.ts +1 -1
  51. package/js/src/zonda.js +9 -1
  52. package/package.json +1 -1
package/js/src/coinex.js CHANGED
@@ -21,7 +21,7 @@ export default class coinex extends Exchange {
21
21
  return this.deepExtend(super.describe(), {
22
22
  'id': 'coinex',
23
23
  'name': 'CoinEx',
24
- 'version': 'v1',
24
+ 'version': 'v2',
25
25
  'countries': ['CN'],
26
26
  // IP ratelimit is 400 requests per second
27
27
  // rateLimit = 1000ms / 400 = 2.5
@@ -318,6 +318,8 @@ export default class coinex extends Exchange {
318
318
  'futures/position-level': 1,
319
319
  'futures/liquidation-history': 1,
320
320
  'futures/basis-history': 1,
321
+ 'assets/deposit-withdraw-config': 1,
322
+ 'assets/all-deposit-withdraw-config': 1,
321
323
  },
322
324
  },
323
325
  'private': {
@@ -340,7 +342,6 @@ export default class coinex extends Exchange {
340
342
  'assets/deposit-address': 40,
341
343
  'assets/deposit-history': 40,
342
344
  'assets/withdraw': 40,
343
- 'assets/deposit-withdraw-config': 1,
344
345
  'assets/transfer-history': 40,
345
346
  'spot/order-status': 8,
346
347
  'spot/batch-order-status': 8,
@@ -534,131 +535,129 @@ export default class coinex extends Exchange {
534
535
  });
535
536
  }
536
537
  async fetchCurrencies(params = {}) {
537
- const response = await this.v1PublicGetCommonAssetConfig(params);
538
+ /**
539
+ * @method
540
+ * @name coinex#fetchCurrencies
541
+ * @description fetches all available currencies on an exchange
542
+ * @see https://docs.coinex.com/api/v2/assets/deposit-withdrawal/http/list-all-deposit-withdrawal-config
543
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
544
+ * @returns {object} an associative dictionary of currencies
545
+ */
546
+ const response = await this.v2PublicGetAssetsAllDepositWithdrawConfig(params);
547
+ //
538
548
  // {
539
549
  // "code": 0,
540
- // "data": {
541
- // "USDT-ERC20": {
542
- // "asset": "USDT",
543
- // "chain": "ERC20",
544
- // "withdrawal_precision": 6,
545
- // "can_deposit": true,
546
- // "can_withdraw": true,
547
- // "deposit_least_amount": "4.9",
548
- // "withdraw_least_amount": "4.9",
549
- // "withdraw_tx_fee": "4.9",
550
- // "explorer_asset_url": "https://etherscan.io/token/0xdac17f958d2ee523a2206206994597c13d831ec7"
551
- // },
552
- // ...
553
- // },
554
- // "message": "Success",
550
+ // "data": [
551
+ // {
552
+ // "asset": {
553
+ // "ccy": "CET",
554
+ // "deposit_enabled": true,
555
+ // "withdraw_enabled": true,
556
+ // "inter_transfer_enabled": true,
557
+ // "is_st": false
558
+ // },
559
+ // "chains": [
560
+ // {
561
+ // "chain": "CSC",
562
+ // "min_deposit_amount": "0.8",
563
+ // "min_withdraw_amount": "8",
564
+ // "deposit_enabled": true,
565
+ // "withdraw_enabled": true,
566
+ // "deposit_delay_minutes": 0,
567
+ // "safe_confirmations": 10,
568
+ // "irreversible_confirmations": 20,
569
+ // "deflation_rate": "0",
570
+ // "withdrawal_fee": "0.026",
571
+ // "withdrawal_precision": 8,
572
+ // "memo": "",
573
+ // "is_memo_required_for_deposit": false,
574
+ // "explorer_asset_url": ""
575
+ // },
576
+ // ]
577
+ // }
578
+ // ],
579
+ // "message": "OK"
555
580
  // }
556
581
  //
557
- const data = this.safeValue(response, 'data', []);
558
- const coins = Object.keys(data);
582
+ const data = this.safeList(response, 'data', []);
559
583
  const result = {};
560
- for (let i = 0; i < coins.length; i++) {
561
- const coin = coins[i];
562
- const currency = data[coin];
563
- const currencyId = this.safeString(currency, 'asset');
564
- const networkId = this.safeString(currency, 'chain');
584
+ for (let i = 0; i < data.length; i++) {
585
+ const coin = data[i];
586
+ const asset = this.safeDict(coin, 'asset', {});
587
+ const chains = this.safeList(coin, 'chains', []);
588
+ const currencyId = this.safeString(asset, 'ccy');
589
+ if (currencyId === undefined) {
590
+ continue; // coinex returns empty structures for some reason
591
+ }
565
592
  const code = this.safeCurrencyCode(currencyId);
566
- const precisionString = this.parsePrecision(this.safeString(currency, 'withdrawal_precision'));
567
- const precision = this.parseNumber(precisionString);
568
- const canDeposit = this.safeValue(currency, 'can_deposit');
569
- const canWithdraw = this.safeValue(currency, 'can_withdraw');
570
- const feeString = this.safeString(currency, 'withdraw_tx_fee');
571
- const fee = this.parseNumber(feeString);
572
- const minNetworkDepositString = this.safeString(currency, 'deposit_least_amount');
573
- const minNetworkDeposit = this.parseNumber(minNetworkDepositString);
574
- const minNetworkWithdrawString = this.safeString(currency, 'withdraw_least_amount');
575
- const minNetworkWithdraw = this.parseNumber(minNetworkWithdrawString);
576
- if (this.safeValue(result, code) === undefined) {
577
- result[code] = {
578
- 'id': currencyId,
579
- 'numericId': undefined,
580
- 'code': code,
581
- 'info': undefined,
593
+ const canDeposit = this.safeBool(asset, 'deposit_enabled');
594
+ const canWithdraw = this.safeBool(asset, 'withdraw_enabled');
595
+ const firstChain = this.safeDict(chains, 0, {});
596
+ const firstPrecisionString = this.parsePrecision(this.safeString(firstChain, 'withdrawal_precision'));
597
+ result[code] = {
598
+ 'id': currencyId,
599
+ 'code': code,
600
+ 'name': undefined,
601
+ 'active': canDeposit && canWithdraw,
602
+ 'deposit': canDeposit,
603
+ 'withdraw': canWithdraw,
604
+ 'fee': undefined,
605
+ 'precision': this.parseNumber(firstPrecisionString),
606
+ 'limits': {
607
+ 'amount': {
608
+ 'min': undefined,
609
+ 'max': undefined,
610
+ },
611
+ 'deposit': {
612
+ 'min': undefined,
613
+ 'max': undefined,
614
+ },
615
+ 'withdraw': {
616
+ 'min': undefined,
617
+ 'max': undefined,
618
+ },
619
+ },
620
+ 'networks': {},
621
+ 'info': coin,
622
+ };
623
+ for (let j = 0; j < chains.length; j++) {
624
+ const chain = chains[j];
625
+ const networkId = this.safeString(chain, 'chain');
626
+ const precisionString = this.parsePrecision(this.safeString(chain, 'withdrawal_precision'));
627
+ const feeString = this.safeString(chain, 'withdrawal_fee');
628
+ const minNetworkDepositString = this.safeString(chain, 'min_deposit_amount');
629
+ const minNetworkWithdrawString = this.safeString(chain, 'min_withdraw_amount');
630
+ const canDepositChain = this.safeBool(chain, 'deposit_enabled');
631
+ const canWithdrawChain = this.safeBool(chain, 'withdraw_enabled');
632
+ const network = {
633
+ 'id': networkId,
634
+ 'network': networkId,
582
635
  'name': undefined,
583
- 'active': canDeposit && canWithdraw,
584
- 'deposit': canDeposit,
585
- 'withdraw': canWithdraw,
586
- 'fee': fee,
587
- 'precision': precision,
636
+ 'active': canDepositChain && canWithdrawChain,
637
+ 'deposit': canDepositChain,
638
+ 'withdraw': canWithdrawChain,
639
+ 'fee': this.parseNumber(feeString),
640
+ 'precision': this.parseNumber(precisionString),
588
641
  'limits': {
589
642
  'amount': {
590
643
  'min': undefined,
591
644
  'max': undefined,
592
645
  },
593
646
  'deposit': {
594
- 'min': minNetworkDeposit,
647
+ 'min': this.parseNumber(minNetworkDepositString),
595
648
  'max': undefined,
596
649
  },
597
650
  'withdraw': {
598
- 'min': minNetworkWithdraw,
651
+ 'min': this.parseNumber(minNetworkWithdrawString),
599
652
  'max': undefined,
600
653
  },
601
654
  },
655
+ 'info': chain,
602
656
  };
657
+ const networks = this.safeDict(result[code], 'networks', {});
658
+ networks[networkId] = network;
659
+ result[code]['networks'] = networks;
603
660
  }
604
- let minFeeString = this.safeString(result[code], 'fee');
605
- if (feeString !== undefined) {
606
- minFeeString = (minFeeString === undefined) ? feeString : Precise.stringMin(feeString, minFeeString);
607
- }
608
- let depositAvailable = this.safeValue(result[code], 'deposit');
609
- depositAvailable = (canDeposit) ? canDeposit : depositAvailable;
610
- let withdrawAvailable = this.safeValue(result[code], 'withdraw');
611
- withdrawAvailable = (canWithdraw) ? canWithdraw : withdrawAvailable;
612
- let minDepositString = this.safeString(result[code]['limits']['deposit'], 'min');
613
- if (minNetworkDepositString !== undefined) {
614
- minDepositString = (minDepositString === undefined) ? minNetworkDepositString : Precise.stringMin(minNetworkDepositString, minDepositString);
615
- }
616
- let minWithdrawString = this.safeString(result[code]['limits']['withdraw'], 'min');
617
- if (minNetworkWithdrawString !== undefined) {
618
- minWithdrawString = (minWithdrawString === undefined) ? minNetworkWithdrawString : Precise.stringMin(minNetworkWithdrawString, minWithdrawString);
619
- }
620
- let minPrecisionString = this.safeString(result[code], 'precision');
621
- if (precisionString !== undefined) {
622
- minPrecisionString = (minPrecisionString === undefined) ? precisionString : Precise.stringMin(precisionString, minPrecisionString);
623
- }
624
- const networks = this.safeValue(result[code], 'networks', {});
625
- const network = {
626
- 'info': currency,
627
- 'id': networkId,
628
- 'network': networkId,
629
- 'name': undefined,
630
- 'limits': {
631
- 'amount': {
632
- 'min': undefined,
633
- 'max': undefined,
634
- },
635
- 'deposit': {
636
- 'min': this.safeNumber(currency, 'deposit_least_amount'),
637
- 'max': undefined,
638
- },
639
- 'withdraw': {
640
- 'min': this.safeNumber(currency, 'withdraw_least_amount'),
641
- 'max': undefined,
642
- },
643
- },
644
- 'active': canDeposit && canWithdraw,
645
- 'deposit': canDeposit,
646
- 'withdraw': canWithdraw,
647
- 'fee': fee,
648
- 'precision': precision,
649
- };
650
- networks[networkId] = network;
651
- result[code]['networks'] = networks;
652
- result[code]['active'] = depositAvailable && withdrawAvailable;
653
- result[code]['deposit'] = depositAvailable;
654
- result[code]['withdraw'] = withdrawAvailable;
655
- const info = this.safeValue(result[code], 'info', []);
656
- info.push(currency);
657
- result[code]['info'] = info;
658
- result[code]['fee'] = this.parseNumber(minFeeString);
659
- result[code]['precision'] = this.parseNumber(minPrecisionString);
660
- result[code]['limits']['deposit']['min'] = this.parseNumber(minDepositString);
661
- result[code]['limits']['withdraw']['min'] = this.parseNumber(minWithdrawString);
662
661
  }
663
662
  return result;
664
663
  }
@@ -5431,7 +5430,7 @@ export default class coinex extends Exchange {
5431
5430
  const request = {
5432
5431
  'ccy': currency['id'],
5433
5432
  };
5434
- const response = await this.v2PrivateGetAssetsDepositWithdrawConfig(this.extend(request, params));
5433
+ const response = await this.v2PublicGetAssetsDepositWithdrawConfig(this.extend(request, params));
5435
5434
  //
5436
5435
  // {
5437
5436
  // "code": 0,
package/js/src/lykke.d.ts CHANGED
@@ -19,8 +19,8 @@ export default class lykke extends Exchange {
19
19
  parseOrderStatus(status: Str): string;
20
20
  parseOrder(order: Dict, market?: Market): Order;
21
21
  createOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): Promise<Order>;
22
- cancelOrder(id: string, symbol?: Str, params?: {}): Promise<any>;
23
- cancelAllOrders(symbol?: Str, params?: {}): Promise<any>;
22
+ cancelOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
23
+ cancelAllOrders(symbol?: Str, params?: {}): Promise<Order[]>;
24
24
  fetchOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
25
25
  fetchOpenOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
26
26
  fetchClosedOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
package/js/src/lykke.js CHANGED
@@ -883,7 +883,10 @@ export default class lykke extends Exchange {
883
883
  // "error":null
884
884
  // }
885
885
  //
886
- return await this.privateDeleteOrdersOrderId(this.extend(request, params));
886
+ const response = await this.privateDeleteOrdersOrderId(this.extend(request, params));
887
+ return this.safeOrder({
888
+ 'info': response,
889
+ });
887
890
  }
888
891
  async cancelAllOrders(symbol = undefined, params = {}) {
889
892
  /**
@@ -910,7 +913,12 @@ export default class lykke extends Exchange {
910
913
  // "error":null
911
914
  // }
912
915
  //
913
- return await this.privateDeleteOrders(this.extend(request, params));
916
+ const response = await this.privateDeleteOrders(this.extend(request, params));
917
+ return [
918
+ this.safeOrder({
919
+ 'info': response,
920
+ }),
921
+ ];
914
922
  }
915
923
  async fetchOrder(id, symbol = undefined, params = {}) {
916
924
  /**
package/js/src/ndax.d.ts CHANGED
@@ -45,7 +45,7 @@ export default class ndax extends Exchange {
45
45
  createOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): Promise<Order>;
46
46
  editOrder(id: string, symbol: string, type: OrderType, side: OrderSide, amount?: Num, price?: Num, params?: {}): Promise<Order>;
47
47
  fetchMyTrades(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
48
- cancelAllOrders(symbol?: Str, params?: {}): Promise<any>;
48
+ cancelAllOrders(symbol?: Str, params?: {}): Promise<Order[]>;
49
49
  cancelOrder(id: string, symbol?: Str, params?: {}): Promise<any>;
50
50
  fetchOpenOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
51
51
  fetchOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
package/js/src/ndax.js CHANGED
@@ -1575,7 +1575,11 @@ export default class ndax extends Exchange {
1575
1575
  // "detail":null
1576
1576
  // }
1577
1577
  //
1578
- return response;
1578
+ return [
1579
+ this.safeOrder({
1580
+ 'info': response,
1581
+ }),
1582
+ ];
1579
1583
  }
1580
1584
  async cancelOrder(id, symbol = undefined, params = {}) {
1581
1585
  /**
package/js/src/phemex.js CHANGED
@@ -6,7 +6,7 @@
6
6
 
7
7
  // ----------------------------------------------------------------------------
8
8
  import Exchange from './abstract/phemex.js';
9
- import { ExchangeError, BadSymbol, AuthenticationError, InsufficientFunds, InvalidOrder, ArgumentsRequired, OrderNotFound, BadRequest, PermissionDenied, AccountSuspended, CancelPending, DDoSProtection, DuplicateOrderId, RateLimitExceeded, NotSupported } from './base/errors.js';
9
+ import { ExchangeError, BadSymbol, AuthenticationError, InsufficientFunds, InvalidOrder, ArgumentsRequired, OrderNotFound, BadRequest, PermissionDenied, AccountSuspended, CancelPending, DDoSProtection, DuplicateOrderId, RateLimitExceeded } from './base/errors.js';
10
10
  import { Precise } from './base/Precise.js';
11
11
  import { TICK_SIZE } from './base/functions/number.js';
12
12
  import { sha256 } from './static_dependencies/noble-hashes/sha256.js';
@@ -2957,6 +2957,7 @@ export default class phemex extends Exchange {
2957
2957
  /**
2958
2958
  * @method
2959
2959
  * @name phemex#fetchOrder
2960
+ * @see https://phemex-docs.github.io/#query-orders-by-ids
2960
2961
  * @description fetches information on an order made by the user
2961
2962
  * @param {string} symbol unified symbol of the market the order was made in
2962
2963
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -2967,9 +2968,6 @@ export default class phemex extends Exchange {
2967
2968
  }
2968
2969
  await this.loadMarkets();
2969
2970
  const market = this.market(symbol);
2970
- if (market['settle'] === 'USDT') {
2971
- throw new NotSupported(this.id + 'fetchOrder() is not supported yet for USDT settled swap markets'); // https://github.com/phemex/phemex-api-docs/blob/master/Public-Hedged-Perpetual-API.md#query-user-order-by-orderid-or-query-user-order-by-client-order-id
2972
- }
2973
2971
  const request = {
2974
2972
  'symbol': market['id'],
2975
2973
  };
@@ -2982,7 +2980,10 @@ export default class phemex extends Exchange {
2982
2980
  request['orderID'] = id;
2983
2981
  }
2984
2982
  let response = undefined;
2985
- if (market['spot']) {
2983
+ if (market['settle'] === 'USDT') {
2984
+ response = await this.privateGetApiDataGFuturesOrdersByOrderId(this.extend(request, params));
2985
+ }
2986
+ else if (market['spot']) {
2986
2987
  response = await this.privateGetSpotOrdersActive(this.extend(request, params));
2987
2988
  }
2988
2989
  else {
@@ -1239,7 +1239,7 @@ export default class poloniexfutures extends Exchange {
1239
1239
  const cancelledOrderIdsLength = cancelledOrderIds.length;
1240
1240
  for (let i = 0; i < cancelledOrderIdsLength; i++) {
1241
1241
  const cancelledOrderId = this.safeString(cancelledOrderIds, i);
1242
- result.push({
1242
+ result.push(this.safeOrder({
1243
1243
  'id': cancelledOrderId,
1244
1244
  'clientOrderId': undefined,
1245
1245
  'timestamp': undefined,
@@ -1261,7 +1261,7 @@ export default class poloniexfutures extends Exchange {
1261
1261
  'postOnly': undefined,
1262
1262
  'stopPrice': undefined,
1263
1263
  'info': response,
1264
- });
1264
+ }));
1265
1265
  }
1266
1266
  return result;
1267
1267
  }
@@ -1228,23 +1228,30 @@ export default class bitget extends bitgetRest {
1228
1228
  // isolated and cross margin
1229
1229
  //
1230
1230
  // {
1231
- // "enterPointSource": "web",
1232
- // "force": "gtc",
1233
- // "feeDetail": [],
1234
- // "orderType": "limit",
1235
- // "price": "35000.000000000",
1236
- // "quoteSize": "10.500000000",
1237
- // "side": "buy",
1238
- // "status": "live",
1239
- // "baseSize": "0.000300000",
1240
- // "cTime": "1701923982427",
1241
- // "clientOid": "4902047879864dc980c4840e9906db4e",
1242
- // "fillPrice": "0.000000000",
1243
- // "baseVolume": "0.000000000",
1244
- // "fillTotalAmount": "0.000000000",
1245
- // "loanType": "auto-loan-and-repay",
1246
- // "orderId": "1116515595178356737"
1247
- // }
1231
+ // enterPointSource: "web",
1232
+ // feeDetail: [
1233
+ // {
1234
+ // feeCoin: "AAVE",
1235
+ // deduction: "no",
1236
+ // totalDeductionFee: "0",
1237
+ // totalFee: "-0.00010740",
1238
+ // },
1239
+ // ],
1240
+ // force: "gtc",
1241
+ // orderType: "limit",
1242
+ // price: "93.170000000",
1243
+ // fillPrice: "93.170000000",
1244
+ // baseSize: "0.110600000", // total amount of order
1245
+ // quoteSize: "10.304602000", // total cost of order (independently if order is filled or pending)
1246
+ // baseVolume: "0.107400000", // filled amount of order (during order's lifecycle, and not for this specific incoming update)
1247
+ // fillTotalAmount: "10.006458000", // filled cost of order (during order's lifecycle, and not for this specific incoming update)
1248
+ // side: "buy",
1249
+ // status: "partially_filled",
1250
+ // cTime: "1717875017306",
1251
+ // clientOid: "b57afe789a06454e9c560a2aab7f7201",
1252
+ // loanType: "auto-loan",
1253
+ // orderId: "1183419084588060673",
1254
+ // }
1248
1255
  //
1249
1256
  const isSpot = !('posMode' in order);
1250
1257
  const isMargin = ('loanType' in order);
@@ -1285,12 +1292,12 @@ export default class bitget extends bitgetRest {
1285
1292
  let filledAmount = undefined;
1286
1293
  let cost = undefined;
1287
1294
  let remaining = undefined;
1288
- const totalFilled = this.safeString(order, 'accBaseVolume');
1295
+ let totalFilled = this.safeString(order, 'accBaseVolume');
1289
1296
  if (isSpot) {
1290
1297
  if (isMargin) {
1291
- filledAmount = this.omitZero(this.safeString(order, 'fillTotalAmount'));
1292
- totalAmount = this.omitZero(this.safeString(order, 'baseSize')); // for margin trading
1293
- cost = this.safeString(order, 'quoteSize');
1298
+ totalAmount = this.safeString(order, 'baseSize');
1299
+ totalFilled = this.safeString(order, 'baseVolume');
1300
+ cost = this.safeString(order, 'fillTotalAmount');
1294
1301
  }
1295
1302
  else {
1296
1303
  const partialFillAmount = this.safeString(order, 'baseVolume');
@@ -1539,11 +1539,17 @@ export default class bitmex extends bitmexRest {
1539
1539
  //
1540
1540
  const action = this.safeString(message, 'action');
1541
1541
  const table = this.safeString(message, 'table');
1542
+ if (table === undefined) {
1543
+ return; // protecting from weird updates
1544
+ }
1542
1545
  const data = this.safeValue(message, 'data', []);
1543
1546
  // if it's an initial snapshot
1544
1547
  if (action === 'partial') {
1545
1548
  const filter = this.safeDict(message, 'filter', {});
1546
1549
  const marketId = this.safeValue(filter, 'symbol');
1550
+ if (marketId === undefined) {
1551
+ return; // protecting from weird update
1552
+ }
1547
1553
  const market = this.safeMarket(marketId);
1548
1554
  const symbol = market['symbol'];
1549
1555
  if (table === 'orderBookL2') {
@@ -1576,6 +1582,9 @@ export default class bitmex extends bitmexRest {
1576
1582
  const numUpdatesByMarketId = {};
1577
1583
  for (let i = 0; i < data.length; i++) {
1578
1584
  const marketId = this.safeValue(data[i], 'symbol');
1585
+ if (marketId === undefined) {
1586
+ return; // protecting from weird update
1587
+ }
1579
1588
  if (!(marketId in numUpdatesByMarketId)) {
1580
1589
  numUpdatesByMarketId[marketId] = 0;
1581
1590
  }
@@ -126,7 +126,7 @@ export default class bybit extends bybitRest {
126
126
  },
127
127
  'streaming': {
128
128
  'ping': this.ping,
129
- 'keepAlive': 19000,
129
+ 'keepAlive': 18000,
130
130
  },
131
131
  });
132
132
  }
@@ -64,7 +64,7 @@ export default class mexc extends mexcRest {
64
64
  },
65
65
  'streaming': {
66
66
  'ping': this.ping,
67
- 'keepAlive': 10000,
67
+ 'keepAlive': 8000,
68
68
  },
69
69
  'exceptions': {},
70
70
  });
package/js/src/pro/woo.js CHANGED
@@ -56,7 +56,7 @@ export default class woo extends wooRest {
56
56
  },
57
57
  'streaming': {
58
58
  'ping': this.ping,
59
- 'keepAlive': 10000,
59
+ 'keepAlive': 9000,
60
60
  },
61
61
  'exceptions': {
62
62
  'ws': {
@@ -15,7 +15,7 @@ export declare class BigInteger {
15
15
  protected intValue(): number;
16
16
  protected byteValue(): number;
17
17
  protected shortValue(): number;
18
- protected signum(): 1 | 0 | -1;
18
+ protected signum(): 0 | 1 | -1;
19
19
  toByteArray(): number[];
20
20
  protected equals(a: BigInteger): boolean;
21
21
  protected min(a: BigInteger): BigInteger;
@@ -18,7 +18,7 @@ export default class tradeogre extends Exchange {
18
18
  parseBalance(response: any): import("./base/types.js").Balances;
19
19
  createOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): Promise<Order>;
20
20
  cancelOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
21
- cancelAllOrders(symbol?: Str, params?: {}): Promise<Order>;
21
+ cancelAllOrders(symbol?: Str, params?: {}): Promise<Order[]>;
22
22
  fetchOpenOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
23
23
  fetchOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
24
24
  parseOrder(order: Dict, market?: Market): Order;
@@ -6,7 +6,7 @@
6
6
 
7
7
  // ---------------------------------------------------------------------------
8
8
  import Exchange from './abstract/tradeogre.js';
9
- import { InsufficientFunds, AuthenticationError, BadRequest, ExchangeError } from './base/errors.js';
9
+ import { InsufficientFunds, AuthenticationError, BadRequest, ExchangeError, ArgumentsRequired } from './base/errors.js';
10
10
  import { TICK_SIZE } from './base/functions/number.js';
11
11
  // ---------------------------------------------------------------------------
12
12
  /**
@@ -452,7 +452,7 @@ export default class tradeogre extends Exchange {
452
452
  * @name tradeogre#createOrder
453
453
  * @description create a trade order
454
454
  * @param {string} symbol unified symbol of the market to create an order in
455
- * @param {string} type not used by tradeogre
455
+ * @param {string} type must be 'limit'
456
456
  * @param {string} side 'buy' or 'sell'
457
457
  * @param {float} amount how much of currency you want to trade in units of base currency
458
458
  * @param {float} price the price at which the order is to be fullfilled, in units of the quote currency
@@ -461,14 +461,17 @@ export default class tradeogre extends Exchange {
461
461
  */
462
462
  await this.loadMarkets();
463
463
  const market = this.market(symbol);
464
+ if (type === 'market') {
465
+ throw new BadRequest(this.id + ' createOrder does not support market orders');
466
+ }
467
+ if (price === undefined) {
468
+ throw new ArgumentsRequired(this.id + ' createOrder requires a limit parameter');
469
+ }
464
470
  const request = {
465
471
  'market': market['id'],
466
472
  'quantity': this.parseToNumeric(this.amountToPrecision(symbol, amount)),
467
473
  'price': this.parseToNumeric(this.priceToPrecision(symbol, price)),
468
474
  };
469
- if (type === 'market') {
470
- throw new BadRequest(this.id + ' createOrder does not support market orders');
471
- }
472
475
  let response = undefined;
473
476
  if (side === 'buy') {
474
477
  response = await this.privatePostOrderBuy(this.extend(request, params));
@@ -505,7 +508,10 @@ export default class tradeogre extends Exchange {
505
508
  * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
506
509
  */
507
510
  await this.loadMarkets();
508
- return await this.cancelOrder('all', symbol, params);
511
+ const response = await this.cancelOrder('all', symbol, params);
512
+ return [
513
+ response,
514
+ ];
509
515
  }
510
516
  async fetchOpenOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
511
517
  /**
@@ -53,26 +53,7 @@ export default class wavesexchange extends Exchange {
53
53
  safeGetDynamic(settings: any): any;
54
54
  safeGetRates(dynamic: any): any;
55
55
  createOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): Promise<Order>;
56
- cancelOrder(id: string, symbol?: Str, params?: {}): Promise<{
57
- info: any;
58
- id: string;
59
- clientOrderId: any;
60
- timestamp: any;
61
- datetime: any;
62
- lastTradeTimestamp: any;
63
- symbol: string;
64
- type: any;
65
- side: any;
66
- price: any;
67
- amount: any;
68
- cost: any;
69
- average: any;
70
- filled: any;
71
- remaining: any;
72
- status: any;
73
- fee: any;
74
- trades: any;
75
- }>;
56
+ cancelOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
76
57
  fetchOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
77
58
  fetchOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
78
59
  fetchOpenOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
@@ -1502,7 +1502,7 @@ export default class wavesexchange extends Exchange {
1502
1502
  const firstMessage = this.safeValue(message, 0);
1503
1503
  const firstOrder = this.safeValue(firstMessage, 0);
1504
1504
  const returnedId = this.safeString(firstOrder, 'orderId');
1505
- return {
1505
+ return this.safeOrder({
1506
1506
  'info': response,
1507
1507
  'id': returnedId,
1508
1508
  'clientOrderId': undefined,
@@ -1521,7 +1521,7 @@ export default class wavesexchange extends Exchange {
1521
1521
  'status': undefined,
1522
1522
  'fee': undefined,
1523
1523
  'trades': undefined,
1524
- };
1524
+ });
1525
1525
  }
1526
1526
  async fetchOrder(id, symbol = undefined, params = {}) {
1527
1527
  /**