ccxt 4.4.33 → 4.4.34

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 (103) hide show
  1. package/README.md +8 -7
  2. package/dist/ccxt.browser.min.js +6 -6
  3. package/dist/cjs/ccxt.js +4 -1
  4. package/dist/cjs/src/abstract/ellipx.js +9 -0
  5. package/dist/cjs/src/alpaca.js +2 -0
  6. package/dist/cjs/src/base/Exchange.js +32 -6
  7. package/dist/cjs/src/binance.js +19 -14
  8. package/dist/cjs/src/bingx.js +156 -9
  9. package/dist/cjs/src/bitbank.js +5 -0
  10. package/dist/cjs/src/bitbns.js +2 -0
  11. package/dist/cjs/src/bitfinex2.js +2 -1
  12. package/dist/cjs/src/bitget.js +177 -44
  13. package/dist/cjs/src/bitmex.js +2 -0
  14. package/dist/cjs/src/bitopro.js +3 -0
  15. package/dist/cjs/src/bitrue.js +1 -0
  16. package/dist/cjs/src/btcmarkets.js +2 -0
  17. package/dist/cjs/src/bybit.js +14 -11
  18. package/dist/cjs/src/cex.js +13 -4
  19. package/dist/cjs/src/coinbase.js +3 -2
  20. package/dist/cjs/src/coinex.js +1 -0
  21. package/dist/cjs/src/coinone.js +7 -7
  22. package/dist/cjs/src/coinsph.js +7 -7
  23. package/dist/cjs/src/coinspot.js +39 -39
  24. package/dist/cjs/src/cryptocom.js +36 -34
  25. package/dist/cjs/src/ellipx.js +1871 -0
  26. package/dist/cjs/src/gate.js +2 -1
  27. package/dist/cjs/src/hyperliquid.js +2 -0
  28. package/dist/cjs/src/krakenfutures.js +3 -1
  29. package/dist/cjs/src/okcoin.js +2 -0
  30. package/dist/cjs/src/okx.js +15 -11
  31. package/dist/cjs/src/onetrading.js +14 -1
  32. package/dist/cjs/src/paradex.js +2 -0
  33. package/dist/cjs/src/phemex.js +23 -0
  34. package/dist/cjs/src/poloniex.js +3 -1
  35. package/dist/cjs/src/poloniexfutures.js +3 -1
  36. package/dist/cjs/src/pro/idex.js +5 -0
  37. package/dist/cjs/src/pro/probit.js +4 -2
  38. package/dist/cjs/src/pro/woo.js +15 -15
  39. package/dist/cjs/src/vertex.js +2 -0
  40. package/dist/cjs/src/woo.js +69 -69
  41. package/examples/js/cli.js +1 -1
  42. package/js/ccxt.d.ts +5 -2
  43. package/js/ccxt.js +4 -2
  44. package/js/src/abstract/bingx.d.ts +16 -0
  45. package/js/src/abstract/bitbank.d.ts +5 -0
  46. package/js/src/abstract/bitfinex2.d.ts +1 -0
  47. package/js/src/abstract/ellipx.d.ts +28 -0
  48. package/js/src/abstract/ellipx.js +11 -0
  49. package/js/src/alpaca.js +2 -0
  50. package/js/src/base/Exchange.d.ts +8 -0
  51. package/js/src/base/Exchange.js +32 -6
  52. package/js/src/binance.js +19 -14
  53. package/js/src/bingx.d.ts +3 -1
  54. package/js/src/bingx.js +156 -9
  55. package/js/src/bitbank.js +5 -0
  56. package/js/src/bitbns.js +2 -0
  57. package/js/src/bitfinex2.js +2 -1
  58. package/js/src/bitget.d.ts +4 -4
  59. package/js/src/bitget.js +177 -44
  60. package/js/src/bitmex.js +2 -0
  61. package/js/src/bitopro.d.ts +1 -0
  62. package/js/src/bitopro.js +3 -0
  63. package/js/src/bitrue.js +1 -0
  64. package/js/src/btcmarkets.d.ts +1 -0
  65. package/js/src/btcmarkets.js +2 -0
  66. package/js/src/bybit.d.ts +3 -2
  67. package/js/src/bybit.js +14 -11
  68. package/js/src/cex.d.ts +1 -0
  69. package/js/src/cex.js +13 -4
  70. package/js/src/coinbase.d.ts +2 -1
  71. package/js/src/coinbase.js +3 -2
  72. package/js/src/coinex.js +1 -0
  73. package/js/src/coinone.js +7 -7
  74. package/js/src/coinsph.js +7 -7
  75. package/js/src/coinspot.js +39 -39
  76. package/js/src/cryptocom.d.ts +1 -1
  77. package/js/src/cryptocom.js +36 -34
  78. package/js/src/ellipx.d.ts +236 -0
  79. package/js/src/ellipx.js +1874 -0
  80. package/js/src/gate.d.ts +2 -2
  81. package/js/src/gate.js +2 -1
  82. package/js/src/hyperliquid.js +2 -0
  83. package/js/src/krakenfutures.js +3 -1
  84. package/js/src/okcoin.js +2 -0
  85. package/js/src/okx.d.ts +1 -1
  86. package/js/src/okx.js +15 -11
  87. package/js/src/onetrading.d.ts +5 -0
  88. package/js/src/onetrading.js +15 -2
  89. package/js/src/paradex.js +2 -0
  90. package/js/src/phemex.js +23 -0
  91. package/js/src/poloniex.d.ts +1 -1
  92. package/js/src/poloniex.js +3 -1
  93. package/js/src/poloniexfutures.d.ts +1 -1
  94. package/js/src/poloniexfutures.js +3 -1
  95. package/js/src/pro/idex.d.ts +5 -0
  96. package/js/src/pro/idex.js +5 -0
  97. package/js/src/pro/probit.js +4 -2
  98. package/js/src/pro/woo.d.ts +11 -11
  99. package/js/src/pro/woo.js +15 -15
  100. package/js/src/vertex.js +2 -0
  101. package/js/src/woo.d.ts +60 -60
  102. package/js/src/woo.js +69 -69
  103. package/package.json +3 -3
@@ -62,6 +62,7 @@ interface Exchange {
62
62
  publicGetPulseHist(params?: {}): Promise<implicitReturnType>;
63
63
  publicGetPulseProfileNickname(params?: {}): Promise<implicitReturnType>;
64
64
  publicGetFundingStatsSymbolHist(params?: {}): Promise<implicitReturnType>;
65
+ publicGetExtVasps(params?: {}): Promise<implicitReturnType>;
65
66
  publicPostCalcTradeAvg(params?: {}): Promise<implicitReturnType>;
66
67
  publicPostCalcFx(params?: {}): Promise<implicitReturnType>;
67
68
  privatePostAuthRWallets(params?: {}): Promise<implicitReturnType>;
@@ -0,0 +1,28 @@
1
+ import { implicitReturnType } from '../base/types.js';
2
+ import { Exchange as _Exchange } from '../base/Exchange.js';
3
+ interface Exchange {
4
+ _restGetMarket(params?: {}): Promise<implicitReturnType>;
5
+ _restGetMarketCurrencyPair(params?: {}): Promise<implicitReturnType>;
6
+ _restGetCryptoTokenInfo(params?: {}): Promise<implicitReturnType>;
7
+ publicGetMarketCurrencyPairGetDepth(params?: {}): Promise<implicitReturnType>;
8
+ publicGetMarketCurrencyPairTicker(params?: {}): Promise<implicitReturnType>;
9
+ publicGetMarketCurrencyPairGetTrades(params?: {}): Promise<implicitReturnType>;
10
+ publicGetMarketCurrencyPairGetGraph(params?: {}): Promise<implicitReturnType>;
11
+ publicGetCMCSummary(params?: {}): Promise<implicitReturnType>;
12
+ publicGetCMCCurrencyPairTicker(params?: {}): Promise<implicitReturnType>;
13
+ privateGetUserWallet(params?: {}): Promise<implicitReturnType>;
14
+ privateGetMarketCurrencyPairOrder(params?: {}): Promise<implicitReturnType>;
15
+ privateGetMarketOrderOrderUuid(params?: {}): Promise<implicitReturnType>;
16
+ privateGetMarketCurrencyPairTrade(params?: {}): Promise<implicitReturnType>;
17
+ privateGetMarketTradeFeeQuery(params?: {}): Promise<implicitReturnType>;
18
+ privateGetUnitCurrency(params?: {}): Promise<implicitReturnType>;
19
+ privateGetCryptoTokenCurrency(params?: {}): Promise<implicitReturnType>;
20
+ privateGetCryptoTokenCurrencyChains(params?: {}): Promise<implicitReturnType>;
21
+ privatePostMarketCurrencyPairOrder(params?: {}): Promise<implicitReturnType>;
22
+ privatePostCryptoAddressFetch(params?: {}): Promise<implicitReturnType>;
23
+ privatePostCryptoDisbursementWithdraw(params?: {}): Promise<implicitReturnType>;
24
+ privateDeleteMarketOrderOrderUuid(params?: {}): Promise<implicitReturnType>;
25
+ }
26
+ declare abstract class Exchange extends _Exchange {
27
+ }
28
+ export default Exchange;
@@ -0,0 +1,11 @@
1
+ // ----------------------------------------------------------------------------
2
+
3
+ // PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
4
+ // https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
5
+ // EDIT THE CORRESPONDENT .ts FILE INSTEAD
6
+
7
+ // -------------------------------------------------------------------------------
8
+ import { Exchange as _Exchange } from '../base/Exchange.js';
9
+ class Exchange extends _Exchange {
10
+ }
11
+ export default Exchange;
package/js/src/alpaca.js CHANGED
@@ -54,6 +54,8 @@ export default class alpaca extends Exchange {
54
54
  'closeAllPositions': false,
55
55
  'closePosition': false,
56
56
  'createOrder': true,
57
+ 'createStopOrder': true,
58
+ 'createTriggerOrder': true,
57
59
  'editOrder': true,
58
60
  'fetchBalance': false,
59
61
  'fetchBidsAsks': false,
@@ -734,6 +734,12 @@ export default class Exchange {
734
734
  filterByLimit(array: object[], limit?: Int, key?: IndexType, fromStart?: boolean): any;
735
735
  filterBySinceLimit(array: object[], since?: Int, limit?: Int, key?: IndexType, tail?: boolean): any;
736
736
  filterByValueSinceLimit(array: object[], field: IndexType, value?: any, since?: Int, limit?: Int, key?: string, tail?: boolean): any;
737
+ /**
738
+ * @method
739
+ * @name Exchange#setSandboxMode
740
+ * @description set the sandbox mode for the exchange
741
+ * @param {boolean} enabled true to enable sandbox mode, false to disable it
742
+ */
737
743
  setSandboxMode(enabled: boolean): void;
738
744
  sign(path: any, api?: any, method?: string, params?: {}, headers?: any, body?: any): {};
739
745
  fetchAccounts(params?: {}): Promise<Account[]>;
@@ -888,6 +894,7 @@ export default class Exchange {
888
894
  convertOHLCVToTradingView(ohlcvs: number[][], timestamp?: string, open?: string, high?: string, low?: string, close?: string, volume?: string, ms?: boolean): {};
889
895
  fetchWebEndpoint(method: any, endpointMethod: any, returnAsJson: any, startRegex?: any, endRegex?: any): Promise<any>;
890
896
  marketIds(symbols?: Strings): any[];
897
+ currencyIds(codes?: Strings): any[];
891
898
  marketsForSymbols(symbols?: Strings): any[];
892
899
  marketSymbols(symbols?: Strings, type?: Str, allowEmpty?: boolean, sameTypeOnly?: boolean, sameSubTypeOnly?: boolean): any[];
893
900
  marketCodes(codes?: Strings): any[];
@@ -916,6 +923,7 @@ export default class Exchange {
916
923
  parseLedger(data: any, currency?: Currency, since?: Int, limit?: Int, params?: {}): LedgerEntry[];
917
924
  nonce(): number;
918
925
  setHeaders(headers: any): any;
926
+ currencyId(code: string): string;
919
927
  marketId(symbol: string): string;
920
928
  symbol(symbol: string): string;
921
929
  handleParamString(params: object, paramName: string, defaultValue?: Str): [string, object];
@@ -1944,7 +1944,7 @@ export default class Exchange {
1944
1944
  const entryFiledEqualValue = entry[field] === value;
1945
1945
  const firstCondition = valueIsDefined ? entryFiledEqualValue : true;
1946
1946
  const entryKeyValue = this.safeValue(entry, key);
1947
- const entryKeyGESince = (entryKeyValue) && since && (entryKeyValue >= since);
1947
+ const entryKeyGESince = (entryKeyValue) && (since !== undefined) && (entryKeyValue >= since);
1948
1948
  const secondCondition = sinceIsDefined ? entryKeyGESince : true;
1949
1949
  if (firstCondition && secondCondition) {
1950
1950
  result.push(entry);
@@ -1956,6 +1956,12 @@ export default class Exchange {
1956
1956
  }
1957
1957
  return this.filterByLimit(result, limit, key, sinceIsDefined);
1958
1958
  }
1959
+ /**
1960
+ * @method
1961
+ * @name Exchange#setSandboxMode
1962
+ * @description set the sandbox mode for the exchange
1963
+ * @param {boolean} enabled true to enable sandbox mode, false to disable it
1964
+ */
1959
1965
  setSandboxMode(enabled) {
1960
1966
  if (enabled) {
1961
1967
  if ('test' in this.urls) {
@@ -2344,7 +2350,7 @@ export default class Exchange {
2344
2350
  this.features = {};
2345
2351
  const unifiedMarketTypes = ['spot', 'swap', 'future', 'option'];
2346
2352
  const subTypes = ['linear', 'inverse'];
2347
- // atm only support basic methods to avoid to be able to maintain, eg: 'createOrder', 'fetchOrder', 'fetchOrders', 'fetchMyTrades'
2353
+ // atm only support basic methods, eg: 'createOrder', 'fetchOrder', 'fetchOrders', 'fetchMyTrades'
2348
2354
  for (let i = 0; i < unifiedMarketTypes.length; i++) {
2349
2355
  const marketType = unifiedMarketTypes[i];
2350
2356
  // if marketType is not filled for this exchange, don't add that in `features`
@@ -2370,8 +2376,8 @@ export default class Exchange {
2370
2376
  const extendsStr = this.safeString(featuresObj, 'extends');
2371
2377
  if (extendsStr !== undefined) {
2372
2378
  featuresObj = this.omit(featuresObj, 'extends');
2373
- const extendObj = initialFeatures[extendsStr];
2374
- featuresObj = this.extend(extendObj, featuresObj); // Warning, do not use deepExtend here, because we override only one level
2379
+ const extendObj = this.featuresMapper(initialFeatures, extendsStr);
2380
+ featuresObj = this.deepExtend(extendObj, featuresObj);
2375
2381
  }
2376
2382
  //
2377
2383
  // corrections
@@ -2382,9 +2388,9 @@ export default class Exchange {
2382
2388
  featuresObj['createOrder']['stopLoss'] = value;
2383
2389
  featuresObj['createOrder']['takeProfit'] = value;
2384
2390
  }
2385
- // omit 'hedged' from spot
2391
+ // false 'hedged' for spot
2386
2392
  if (marketType === 'spot') {
2387
- featuresObj['createOrder']['hedged'] = undefined;
2393
+ featuresObj['createOrder']['hedged'] = false;
2388
2394
  }
2389
2395
  }
2390
2396
  return featuresObj;
@@ -3493,6 +3499,16 @@ export default class Exchange {
3493
3499
  }
3494
3500
  return result;
3495
3501
  }
3502
+ currencyIds(codes = undefined) {
3503
+ if (codes === undefined) {
3504
+ return codes;
3505
+ }
3506
+ const result = [];
3507
+ for (let i = 0; i < codes.length; i++) {
3508
+ result.push(this.currencyId(codes[i]));
3509
+ }
3510
+ return result;
3511
+ }
3496
3512
  marketsForSymbols(symbols = undefined) {
3497
3513
  if (symbols === undefined) {
3498
3514
  return symbols;
@@ -3919,6 +3935,16 @@ export default class Exchange {
3919
3935
  setHeaders(headers) {
3920
3936
  return headers;
3921
3937
  }
3938
+ currencyId(code) {
3939
+ let currency = this.safeDict(this.currencies, code);
3940
+ if (currency === undefined) {
3941
+ currency = this.safeCurrency(code);
3942
+ }
3943
+ if (currency !== undefined) {
3944
+ return currency['id'];
3945
+ }
3946
+ return code;
3947
+ }
3922
3948
  marketId(symbol) {
3923
3949
  const market = this.market(symbol);
3924
3950
  if (market !== undefined) {
package/js/src/binance.js CHANGED
@@ -1563,13 +1563,13 @@ export default class binance extends Exchange {
1563
1563
  'spot': {
1564
1564
  'sandbox': true,
1565
1565
  'createOrder': {
1566
+ 'marginMode': true,
1566
1567
  'triggerPrice': true,
1567
1568
  'triggerPriceType': undefined,
1568
1569
  'triggerDirection': false,
1569
1570
  'stopLossPrice': true,
1570
1571
  'takeProfitPrice': true,
1571
1572
  'attachedStopLossTakeProfit': undefined,
1572
- 'marginMode': true,
1573
1573
  'timeInForce': {
1574
1574
  'GTC': true,
1575
1575
  'IOC': true,
@@ -1587,6 +1587,7 @@ export default class binance extends Exchange {
1587
1587
  },
1588
1588
  'createOrders': undefined,
1589
1589
  'fetchMyTrades': {
1590
+ 'marginMode': false,
1590
1591
  'limit': 1000,
1591
1592
  'daysBack': undefined,
1592
1593
  'untilDays': 1, // days between start-end
@@ -1597,25 +1598,25 @@ export default class binance extends Exchange {
1597
1598
  'trailing': false,
1598
1599
  },
1599
1600
  'fetchOpenOrders': {
1600
- 'limit': undefined,
1601
1601
  'marginMode': true,
1602
+ 'limit': undefined,
1602
1603
  'trigger': false,
1603
1604
  'trailing': false,
1604
1605
  },
1605
1606
  'fetchOrders': {
1607
+ 'marginMode': true,
1606
1608
  'limit': 1000,
1607
1609
  'daysBack': undefined,
1608
1610
  'untilDays': 10000,
1609
- 'marginMode': true,
1610
1611
  'trigger': false,
1611
1612
  'trailing': false,
1612
1613
  },
1613
1614
  'fetchClosedOrders': {
1615
+ 'marginMode': true,
1614
1616
  'limit': 1000,
1615
1617
  'daysBackClosed': undefined,
1616
1618
  'daysBackCanceled': undefined,
1617
1619
  'untilDays': 10000,
1618
- 'marginMode': true,
1619
1620
  'trigger': false,
1620
1621
  'trailing': false,
1621
1622
  },
@@ -1626,6 +1627,7 @@ export default class binance extends Exchange {
1626
1627
  'default': {
1627
1628
  'sandbox': true,
1628
1629
  'createOrder': {
1630
+ 'marginMode': false,
1629
1631
  'triggerPrice': true,
1630
1632
  'triggerPriceType': {
1631
1633
  'mark': true,
@@ -1635,7 +1637,6 @@ export default class binance extends Exchange {
1635
1637
  'stopLossPrice': true,
1636
1638
  'takeProfitPrice': true,
1637
1639
  'attachedStopLossTakeProfit': undefined,
1638
- 'marginMode': false,
1639
1640
  'timeInForce': {
1640
1641
  'GTC': true,
1641
1642
  'IOC': true,
@@ -1656,6 +1657,7 @@ export default class binance extends Exchange {
1656
1657
  'max': 5,
1657
1658
  },
1658
1659
  'fetchMyTrades': {
1660
+ 'marginMode': false,
1659
1661
  'daysBack': undefined,
1660
1662
  'limit': 1000,
1661
1663
  'untilDays': 7,
@@ -1666,25 +1668,25 @@ export default class binance extends Exchange {
1666
1668
  'trailing': false,
1667
1669
  },
1668
1670
  'fetchOpenOrders': {
1669
- 'limit': 500,
1670
1671
  'marginMode': true,
1672
+ 'limit': 500,
1671
1673
  'trigger': false,
1672
1674
  'trailing': false,
1673
1675
  },
1674
1676
  'fetchOrders': {
1677
+ 'marginMode': true,
1675
1678
  'limit': 1000,
1676
1679
  'daysBack': 90,
1677
1680
  'untilDays': 7,
1678
- 'marginMode': true,
1679
1681
  'trigger': false,
1680
1682
  'trailing': false,
1681
1683
  },
1682
1684
  'fetchClosedOrders': {
1685
+ 'marginMode': true,
1683
1686
  'limit': 1000,
1684
1687
  'daysBackClosed': 90,
1685
1688
  'daysBackCanceled': 3,
1686
1689
  'untilDays': 7,
1687
- 'marginMode': true,
1688
1690
  'trigger': false,
1689
1691
  'trailing': false,
1690
1692
  },
@@ -2112,6 +2114,7 @@ export default class binance extends Exchange {
2112
2114
  '-4141': OperationRejected,
2113
2115
  '-4144': BadSymbol,
2114
2116
  '-4164': InvalidOrder,
2117
+ '-4136': InvalidOrder,
2115
2118
  '-4165': BadRequest,
2116
2119
  '-4167': BadRequest,
2117
2120
  '-4168': BadRequest,
@@ -6390,6 +6393,7 @@ export default class binance extends Exchange {
6390
6393
  const typeRequest = isPortfolioMarginConditional ? 'strategyType' : 'type';
6391
6394
  request[typeRequest] = uppercaseType;
6392
6395
  // additional required fields depending on the order type
6396
+ const closePosition = this.safeBool(params, 'closePosition', false);
6393
6397
  let timeInForceIsRequired = false;
6394
6398
  let priceIsRequired = false;
6395
6399
  let stopPriceIsRequired = false;
@@ -6469,14 +6473,15 @@ export default class binance extends Exchange {
6469
6473
  priceIsRequired = true;
6470
6474
  }
6471
6475
  else if ((uppercaseType === 'STOP_MARKET') || (uppercaseType === 'TAKE_PROFIT_MARKET')) {
6472
- const closePosition = this.safeBool(params, 'closePosition');
6473
- if (closePosition === undefined) {
6476
+ if (!closePosition) {
6474
6477
  quantityIsRequired = true;
6475
6478
  }
6476
6479
  stopPriceIsRequired = true;
6477
6480
  }
6478
6481
  else if (uppercaseType === 'TRAILING_STOP_MARKET') {
6479
- quantityIsRequired = true;
6482
+ if (!closePosition) {
6483
+ quantityIsRequired = true;
6484
+ }
6480
6485
  if (trailingPercent === undefined) {
6481
6486
  throw new InvalidOrder(this.id + ' createOrder() requires a trailingPercent param for a ' + type + ' order');
6482
6487
  }
@@ -11927,13 +11932,13 @@ export default class binance extends Exchange {
11927
11932
  getExceptionsByUrl(url, exactOrBroad) {
11928
11933
  let marketType = undefined;
11929
11934
  const hostname = (this.hostname !== undefined) ? this.hostname : 'binance.com';
11930
- if (url.startsWith('https://api.' + hostname + '/')) {
11935
+ if (url.startsWith('https://api.' + hostname + '/') || url.startsWith('https://testnet.binance.vision')) {
11931
11936
  marketType = 'spot';
11932
11937
  }
11933
- else if (url.startsWith('https://dapi.' + hostname + '/')) {
11938
+ else if (url.startsWith('https://dapi.' + hostname + '/') || url.startsWith('https://testnet.binancefuture.com/dapi')) {
11934
11939
  marketType = 'inverse';
11935
11940
  }
11936
- else if (url.startsWith('https://fapi.' + hostname + '/')) {
11941
+ else if (url.startsWith('https://fapi.' + hostname + '/') || url.startsWith('https://testnet.binancefuture.com/fapi')) {
11937
11942
  marketType = 'linear';
11938
11943
  }
11939
11944
  else if (url.startsWith('https://eapi.' + hostname + '/')) {
package/js/src/bingx.d.ts CHANGED
@@ -367,7 +367,8 @@ export default class bingx extends Exchange {
367
367
  * @method
368
368
  * @name bingx#fetchOrders
369
369
  * @description fetches information on multiple orders made by the user
370
- * @see https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#User's%20All%20Orders
370
+ * @see https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#All%20Orders
371
+ * @see https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Query%20Order%20history (returns less fields than above)
371
372
  * @param {string} symbol unified market symbol of the market orders were made in
372
373
  * @param {int} [since] the earliest time in ms to fetch orders for
373
374
  * @param {int} [limit] the maximum number of order structures to retrieve
@@ -573,6 +574,7 @@ export default class bingx extends Exchange {
573
574
  * @description fetch all trades made by the user
574
575
  * @see https://bingx-api.github.io/docs/#/en-us/spot/trade-api.html#Query%20transaction%20details
575
576
  * @see https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Query%20historical%20transaction%20orders
577
+ * @see https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Query%20historical%20transaction%20details
576
578
  * @see https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#Query%20Order%20Trade%20Detail
577
579
  * @param {string} [symbol] unified market symbol
578
580
  * @param {int} [since] the earliest time in ms to fetch trades for
package/js/src/bingx.js CHANGED
@@ -46,6 +46,7 @@ export default class bingx extends Exchange {
46
46
  'createOrders': true,
47
47
  'createOrderWithTakeProfitAndStopLoss': true,
48
48
  'createStopLossOrder': true,
49
+ 'createStopOrder': true,
49
50
  'createTakeProfitOrder': true,
50
51
  'createTrailingAmountOrder': true,
51
52
  'createTrailingPercentOrder': true,
@@ -199,6 +200,8 @@ export default class bingx extends Exchange {
199
200
  'get': {
200
201
  'ticker/price': 1,
201
202
  'market/historicalTrades': 1,
203
+ 'market/markPriceKlines': 1,
204
+ 'trade/multiAssetsRules': 1,
202
205
  },
203
206
  },
204
207
  'private': {
@@ -207,12 +210,24 @@ export default class bingx extends Exchange {
207
210
  'market/markPriceKlines': 1,
208
211
  'trade/batchCancelReplace': 5,
209
212
  'trade/fullOrder': 2,
213
+ 'maintMarginRatio': 2,
214
+ 'trade/positionHistory': 2,
210
215
  'positionMargin/history': 2,
216
+ 'twap/openOrders': 5,
217
+ 'twap/historyOrders': 5,
218
+ 'twap/orderDetail': 5,
219
+ 'trade/assetMode': 5,
220
+ 'user/marginAssets': 5,
211
221
  },
212
222
  'post': {
213
223
  'trade/cancelReplace': 2,
214
224
  'positionSide/dual': 5,
225
+ 'trade/batchCancelReplace': 5,
215
226
  'trade/closePosition': 2,
227
+ 'trade/getVst': 5,
228
+ 'twap/order': 5,
229
+ 'twap/cancelOrder': 5,
230
+ 'trade/assetMode': 5,
216
231
  },
217
232
  },
218
233
  },
@@ -245,6 +260,7 @@ export default class bingx extends Exchange {
245
260
  'trade/forceOrders': 1,
246
261
  'trade/allOrders': 2,
247
262
  'trade/allFillOrders': 2,
263
+ 'trade/fillHistory': 2,
248
264
  'user/income/export': 2,
249
265
  'user/commissionRate': 2,
250
266
  'quote/bookTicker': 1,
@@ -302,6 +318,7 @@ export default class bingx extends Exchange {
302
318
  'post': {
303
319
  'trade/order': 2,
304
320
  'trade/leverage': 2,
321
+ 'trade/allOpenOrders': 2,
305
322
  'trade/closeAllPositions': 2,
306
323
  'trade/marginType': 2,
307
324
  'trade/positionMargin': 2,
@@ -500,6 +517,136 @@ export default class bingx extends Exchange {
500
517
  'MATIC': 'POLYGON',
501
518
  },
502
519
  },
520
+ 'features': {
521
+ 'defaultForLinear': {
522
+ 'sandbox': true,
523
+ 'createOrder': {
524
+ 'marginMode': false,
525
+ 'triggerPrice': true,
526
+ 'triggerPriceType': {
527
+ 'last': true,
528
+ 'mark': true,
529
+ 'index': true,
530
+ },
531
+ 'triggerDirection': false,
532
+ 'stopLossPrice': true,
533
+ 'takeProfitPrice': true,
534
+ 'attachedStopLossTakeProfit': {
535
+ 'triggerPriceType': {
536
+ 'last': true,
537
+ 'mark': true,
538
+ 'index': true,
539
+ },
540
+ 'limitPrice': true,
541
+ },
542
+ 'timeInForce': {
543
+ 'GTC': true,
544
+ 'IOC': true,
545
+ 'FOK': true,
546
+ 'PO': true,
547
+ 'GTD': false,
548
+ },
549
+ 'hedged': true,
550
+ 'trailing': true,
551
+ },
552
+ 'createOrders': {
553
+ 'max': 5,
554
+ },
555
+ 'fetchMyTrades': {
556
+ 'marginMode': false,
557
+ 'limit': 512,
558
+ 'daysBack': 30,
559
+ 'untilDays': 30, // 30 for 'allFillOrders', 7 for 'fillHistory'
560
+ },
561
+ 'fetchOrder': {
562
+ 'marginMode': false,
563
+ 'trigger': false,
564
+ 'trailing': false,
565
+ },
566
+ 'fetchOpenOrders': {
567
+ 'marginMode': false,
568
+ 'limit': undefined,
569
+ 'trigger': false,
570
+ 'trailing': false,
571
+ },
572
+ 'fetchOrders': {
573
+ 'marginMode': false,
574
+ 'limit': 1000,
575
+ 'daysBack': 20000,
576
+ 'untilDays': 7,
577
+ 'trigger': false,
578
+ 'trailing': false,
579
+ },
580
+ 'fetchClosedOrders': {
581
+ 'marginMode': false,
582
+ 'limit': 1000,
583
+ 'daysBackClosed': undefined,
584
+ 'daysBackCanceled': undefined,
585
+ 'untilDays': 7,
586
+ 'trigger': false,
587
+ 'trailing': false,
588
+ },
589
+ 'fetchOHLCV': {
590
+ 'limit': 1440,
591
+ },
592
+ },
593
+ 'defaultForInverse': {
594
+ 'extends': 'defaultForLinear',
595
+ 'fetchMyTrades': {
596
+ 'limit': 1000,
597
+ 'daysBack': undefined,
598
+ 'untilDays': undefined,
599
+ },
600
+ 'fetchOHLCV': {
601
+ 'limit': 1440,
602
+ },
603
+ 'fetchOrders': undefined,
604
+ 'fetchClosedOrders': {
605
+ 'marginMode': false,
606
+ 'limit': 1000,
607
+ 'daysBackClosed': undefined,
608
+ 'daysBackCanceled': undefined,
609
+ 'untilDays': 7,
610
+ 'trigger': false,
611
+ 'trailing': false,
612
+ },
613
+ },
614
+ //
615
+ 'spot': {
616
+ 'extends': 'defaultForLinear',
617
+ 'createOrder': {
618
+ 'triggerPriceType': undefined,
619
+ 'attachedStopLossTakeProfit': undefined,
620
+ 'trailing': false,
621
+ },
622
+ 'fetchMyTrades': {
623
+ 'limit': 1000,
624
+ 'daysBack': 1,
625
+ 'untilDays': 1,
626
+ },
627
+ 'fetchOrders': undefined,
628
+ 'fetchClosedOrders': {
629
+ 'limit': 100,
630
+ 'untilDays': undefined,
631
+ },
632
+ },
633
+ 'swap': {
634
+ 'linear': {
635
+ 'extends': 'defaultForLinear',
636
+ },
637
+ 'inverse': {
638
+ 'extends': 'defaultForInverse',
639
+ },
640
+ },
641
+ 'future': {
642
+ 'linear': {
643
+ 'extends': 'defaultForLinear',
644
+ },
645
+ 'inverse': {
646
+ 'extends': 'defaultForInverse',
647
+ },
648
+ },
649
+ },
503
650
  });
504
651
  }
505
652
  /**
@@ -3957,7 +4104,8 @@ export default class bingx extends Exchange {
3957
4104
  * @method
3958
4105
  * @name bingx#fetchOrders
3959
4106
  * @description fetches information on multiple orders made by the user
3960
- * @see https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#User's%20All%20Orders
4107
+ * @see https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#All%20Orders
4108
+ * @see https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Query%20Order%20history (returns less fields than above)
3961
4109
  * @param {string} symbol unified market symbol of the market orders were made in
3962
4110
  * @param {int} [since] the earliest time in ms to fetch orders for
3963
4111
  * @param {int} [limit] the maximum number of order structures to retrieve
@@ -3968,7 +4116,7 @@ export default class bingx extends Exchange {
3968
4116
  */
3969
4117
  async fetchOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
3970
4118
  await this.loadMarkets();
3971
- const request = {};
4119
+ let request = {};
3972
4120
  let market = undefined;
3973
4121
  if (symbol !== undefined) {
3974
4122
  market = this.market(symbol);
@@ -3985,12 +4133,7 @@ export default class bingx extends Exchange {
3985
4133
  if (since !== undefined) {
3986
4134
  request['startTime'] = since;
3987
4135
  }
3988
- const until = this.safeInteger(params, 'until'); // unified in milliseconds
3989
- const endTime = this.safeInteger(params, 'endTime', until); // exchange-specific in milliseconds
3990
- params = this.omit(params, ['endTime', 'until']);
3991
- if (endTime !== undefined) {
3992
- request['endTime'] = endTime;
3993
- }
4136
+ [request, params] = this.handleUntilOption('endTime', request, params);
3994
4137
  const response = await this.swapV1PrivateGetTradeFullOrder(this.extend(request, params));
3995
4138
  //
3996
4139
  // {
@@ -4276,6 +4419,9 @@ export default class bingx extends Exchange {
4276
4419
  response = await this.contractV1PrivateGetAllOrders(this.extend(request, params));
4277
4420
  }
4278
4421
  else if (type === 'spot') {
4422
+ if (limit !== undefined) {
4423
+ request['limit'] = limit;
4424
+ }
4279
4425
  response = await this.spotV1PrivateGetTradeHistoryOrders(this.extend(request, params));
4280
4426
  //
4281
4427
  // {
@@ -5098,6 +5244,7 @@ export default class bingx extends Exchange {
5098
5244
  * @description fetch all trades made by the user
5099
5245
  * @see https://bingx-api.github.io/docs/#/en-us/spot/trade-api.html#Query%20transaction%20details
5100
5246
  * @see https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Query%20historical%20transaction%20orders
5247
+ * @see https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Query%20historical%20transaction%20details
5101
5248
  * @see https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#Query%20Order%20Trade%20Detail
5102
5249
  * @param {string} [symbol] unified market symbol
5103
5250
  * @param {int} [since] the earliest time in ms to fetch trades for
@@ -5161,7 +5308,7 @@ export default class bingx extends Exchange {
5161
5308
  request[startTimeReq] = since;
5162
5309
  }
5163
5310
  else if (market['swap']) {
5164
- request['startTs'] = now - 7776000000; // 90 days
5311
+ request['startTs'] = now - 30 * 24 * 60 * 60 * 1000; // 30 days for swap
5165
5312
  }
5166
5313
  const until = this.safeInteger(params, 'until');
5167
5314
  params = this.omit(params, 'until');
package/js/src/bitbank.js CHANGED
@@ -123,8 +123,11 @@ export default class bitbank extends Exchange {
123
123
  'user/assets',
124
124
  'user/spot/order',
125
125
  'user/spot/active_orders',
126
+ 'user/margin/positions',
126
127
  'user/spot/trade_history',
127
128
  'user/deposit_history',
129
+ 'user/unconfirmed_deposits',
130
+ 'user/deposit_originators',
128
131
  'user/withdrawal_account',
129
132
  'user/withdrawal_history',
130
133
  'spot/status',
@@ -135,6 +138,8 @@ export default class bitbank extends Exchange {
135
138
  'user/spot/cancel_order',
136
139
  'user/spot/cancel_orders',
137
140
  'user/spot/orders_info',
141
+ 'user/confirm_deposits',
142
+ 'user/confirm_deposits_all',
138
143
  'user/request_withdrawal',
139
144
  ],
140
145
  },
package/js/src/bitbns.js CHANGED
@@ -35,6 +35,8 @@ export default class bitbns extends Exchange {
35
35
  'cancelAllOrders': false,
36
36
  'cancelOrder': true,
37
37
  'createOrder': true,
38
+ 'createStopOrder': true,
39
+ 'createTriggerOrder': true,
38
40
  'fetchBalance': true,
39
41
  'fetchDepositAddress': true,
40
42
  'fetchDepositAddresses': false,
@@ -207,7 +207,8 @@ export default class bitfinex2 extends Exchange {
207
207
  'rankings/{key}:{timeframe}:{symbol}/hist': 2.7,
208
208
  'pulse/hist': 2.7,
209
209
  'pulse/profile/{nickname}': 2.7,
210
- 'funding/stats/{symbol}/hist': 10, // ratelimit not in docs
210
+ 'funding/stats/{symbol}/hist': 10,
211
+ 'ext/vasps': 1,
211
212
  },
212
213
  'post': {
213
214
  'calc/trade/avg': 2.7,