ccxt 4.4.75 → 4.4.78

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 (114) hide show
  1. package/README.md +3 -3
  2. package/dist/ccxt.browser.min.js +7 -7
  3. package/dist/cjs/ccxt.js +8 -4
  4. package/dist/cjs/src/abstract/apex.js +9 -0
  5. package/dist/cjs/src/apex.js +1949 -0
  6. package/dist/cjs/src/base/Exchange.js +49 -3
  7. package/dist/cjs/src/binance.js +44 -220
  8. package/dist/cjs/src/bitget.js +139 -71
  9. package/dist/cjs/src/bitmex.js +4 -4
  10. package/dist/cjs/src/bitrue.js +48 -0
  11. package/dist/cjs/src/cex.js +1 -1
  12. package/dist/cjs/src/coinbase.js +32 -3
  13. package/dist/cjs/src/coincatch.js +68 -0
  14. package/dist/cjs/src/coinex.js +3 -0
  15. package/dist/cjs/src/coinlist.js +85 -1
  16. package/dist/cjs/src/hitbtc.js +3 -0
  17. package/dist/cjs/src/hyperliquid.js +13 -4
  18. package/dist/cjs/src/mexc.js +50 -57
  19. package/dist/cjs/src/okx.js +23 -8
  20. package/dist/cjs/src/paradex.js +3 -12
  21. package/dist/cjs/src/phemex.js +2 -1
  22. package/dist/cjs/src/poloniex.js +1 -1
  23. package/dist/cjs/src/pro/apex.js +1043 -0
  24. package/dist/cjs/src/pro/coinbase.js +4 -8
  25. package/dist/cjs/src/pro/gate.js +27 -2
  26. package/dist/cjs/src/pro/hollaex.js +2 -2
  27. package/dist/cjs/src/pro/hyperliquid.js +1 -1
  28. package/dist/cjs/src/pro/p2b.js +2 -2
  29. package/dist/cjs/src/pro/tradeogre.js +283 -0
  30. package/dist/cjs/src/probit.js +1 -0
  31. package/dist/cjs/src/static_dependencies/zklink/zklink-sdk-web.js +2645 -0
  32. package/dist/cjs/src/tradeogre.js +2 -1
  33. package/dist/cjs/src/upbit.js +299 -93
  34. package/dist/cjs/src/whitebit.js +1 -0
  35. package/dist/cjs/src/woo.js +3 -1
  36. package/dist/cjs/src/xt.js +131 -4
  37. package/js/ccxt.d.ts +11 -5
  38. package/js/ccxt.js +8 -4
  39. package/js/src/abstract/apex.d.ts +34 -0
  40. package/js/src/abstract/myokx.d.ts +4 -0
  41. package/js/src/abstract/okx.d.ts +4 -0
  42. package/js/src/abstract/upbit.d.ts +15 -1
  43. package/js/src/abstract/xt.d.ts +3 -0
  44. package/js/src/apex.d.ts +333 -0
  45. package/js/src/apex.js +1951 -0
  46. package/js/src/ascendex.d.ts +3 -3
  47. package/js/src/base/Exchange.d.ts +3 -0
  48. package/js/src/base/Exchange.js +49 -2
  49. package/js/src/binance.d.ts +9 -7
  50. package/js/src/binance.js +44 -220
  51. package/js/src/bitfinex.d.ts +3 -3
  52. package/js/src/bitflyer.d.ts +2 -2
  53. package/js/src/bitget.d.ts +2 -0
  54. package/js/src/bitget.js +139 -71
  55. package/js/src/bitmart.d.ts +4 -4
  56. package/js/src/bitmex.d.ts +3 -3
  57. package/js/src/bitmex.js +4 -4
  58. package/js/src/bitrue.js +48 -0
  59. package/js/src/cex.js +1 -1
  60. package/js/src/coinbase.d.ts +6 -4
  61. package/js/src/coinbase.js +32 -3
  62. package/js/src/coinbaseexchange.d.ts +1 -1
  63. package/js/src/coincatch.d.ts +11 -0
  64. package/js/src/coincatch.js +68 -0
  65. package/js/src/coinex.js +3 -0
  66. package/js/src/coinlist.d.ts +12 -1
  67. package/js/src/coinlist.js +85 -1
  68. package/js/src/cryptocom.d.ts +4 -4
  69. package/js/src/deribit.d.ts +4 -4
  70. package/js/src/derive.d.ts +3 -3
  71. package/js/src/digifinex.d.ts +4 -4
  72. package/js/src/hitbtc.js +3 -0
  73. package/js/src/htx.d.ts +4 -4
  74. package/js/src/hyperliquid.d.ts +1 -0
  75. package/js/src/hyperliquid.js +13 -4
  76. package/js/src/kraken.d.ts +3 -3
  77. package/js/src/krakenfutures.d.ts +2 -2
  78. package/js/src/kucoinfutures.d.ts +5 -5
  79. package/js/src/mexc.d.ts +1 -0
  80. package/js/src/mexc.js +50 -57
  81. package/js/src/okx.js +23 -8
  82. package/js/src/oxfun.d.ts +3 -3
  83. package/js/src/paradex.js +3 -12
  84. package/js/src/phemex.d.ts +3 -3
  85. package/js/src/phemex.js +2 -1
  86. package/js/src/poloniex.d.ts +3 -3
  87. package/js/src/poloniex.js +1 -1
  88. package/js/src/pro/apex.d.ts +160 -0
  89. package/js/src/pro/apex.js +1044 -0
  90. package/js/src/pro/coinbase.js +4 -8
  91. package/js/src/pro/gate.js +27 -2
  92. package/js/src/pro/hollaex.js +2 -2
  93. package/js/src/pro/hyperliquid.js +1 -1
  94. package/js/src/pro/p2b.js +2 -2
  95. package/js/src/pro/tradeogre.d.ts +49 -0
  96. package/js/src/pro/tradeogre.js +284 -0
  97. package/js/src/probit.js +1 -0
  98. package/js/src/static_dependencies/zklink/zklink-sdk-web.d.ts +1279 -0
  99. package/js/src/static_dependencies/zklink/zklink-sdk-web.js +4282 -0
  100. package/js/src/tradeogre.js +2 -1
  101. package/js/src/upbit.d.ts +34 -4
  102. package/js/src/upbit.js +299 -93
  103. package/js/src/vertex.d.ts +3 -3
  104. package/js/src/whitebit.js +1 -0
  105. package/js/src/woo.d.ts +4 -4
  106. package/js/src/woo.js +3 -1
  107. package/js/src/woofipro.d.ts +4 -4
  108. package/js/src/xt.d.ts +23 -4
  109. package/js/src/xt.js +131 -4
  110. package/package.json +2 -2
  111. package/js/src/abstract/ace.d.ts +0 -18
  112. package/js/src/ace.d.ts +0 -158
  113. package/js/src/ace.js +0 -1181
  114. /package/js/src/abstract/{ace.js → apex.js} +0 -0
package/js/src/mexc.js CHANGED
@@ -1091,87 +1091,48 @@ export default class mexc extends Exchange {
1091
1091
  const id = this.safeString(currency, 'coin');
1092
1092
  const code = this.safeCurrencyCode(id);
1093
1093
  const name = this.safeString(currency, 'name');
1094
- let currencyActive = false;
1095
- let currencyFee = undefined;
1096
- let currencyWithdrawMin = undefined;
1097
- let currencyWithdrawMax = undefined;
1098
- let depositEnabled = false;
1099
- let withdrawEnabled = false;
1100
1094
  const networks = {};
1101
1095
  const chains = this.safeValue(currency, 'networkList', []);
1102
1096
  for (let j = 0; j < chains.length; j++) {
1103
1097
  const chain = chains[j];
1104
1098
  const networkId = this.safeString2(chain, 'netWork', 'network');
1105
1099
  const network = this.networkIdToCode(networkId);
1106
- const isDepositEnabled = this.safeBool(chain, 'depositEnable', false);
1107
- const isWithdrawEnabled = this.safeBool(chain, 'withdrawEnable', false);
1108
- const active = (isDepositEnabled && isWithdrawEnabled);
1109
- currencyActive = active || currencyActive;
1110
- const withdrawMin = this.safeString(chain, 'withdrawMin');
1111
- const withdrawMax = this.safeString(chain, 'withdrawMax');
1112
- currencyWithdrawMin = (currencyWithdrawMin === undefined) ? withdrawMin : currencyWithdrawMin;
1113
- currencyWithdrawMax = (currencyWithdrawMax === undefined) ? withdrawMax : currencyWithdrawMax;
1114
- const fee = this.safeNumber(chain, 'withdrawFee');
1115
- currencyFee = (currencyFee === undefined) ? fee : currencyFee;
1116
- if (Precise.stringGt(currencyWithdrawMin, withdrawMin)) {
1117
- currencyWithdrawMin = withdrawMin;
1118
- }
1119
- if (Precise.stringLt(currencyWithdrawMax, withdrawMax)) {
1120
- currencyWithdrawMax = withdrawMax;
1121
- }
1122
- if (isDepositEnabled) {
1123
- depositEnabled = true;
1124
- }
1125
- if (isWithdrawEnabled) {
1126
- withdrawEnabled = true;
1127
- }
1128
1100
  networks[network] = {
1129
1101
  'info': chain,
1130
1102
  'id': networkId,
1131
1103
  'network': network,
1132
- 'active': active,
1133
- 'deposit': isDepositEnabled,
1134
- 'withdraw': isWithdrawEnabled,
1135
- 'fee': fee,
1104
+ 'active': undefined,
1105
+ 'deposit': this.safeBool(chain, 'depositEnable', false),
1106
+ 'withdraw': this.safeBool(chain, 'withdrawEnable', false),
1107
+ 'fee': this.safeNumber(chain, 'withdrawFee'),
1136
1108
  'precision': undefined,
1137
1109
  'limits': {
1138
1110
  'withdraw': {
1139
- 'min': withdrawMin,
1140
- 'max': withdrawMax,
1111
+ 'min': this.safeString(chain, 'withdrawMin'),
1112
+ 'max': this.safeString(chain, 'withdrawMax'),
1141
1113
  },
1142
1114
  },
1143
1115
  };
1144
1116
  }
1145
- const networkKeys = Object.keys(networks);
1146
- const networkKeysLength = networkKeys.length;
1147
- if ((networkKeysLength === 1) || ('NONE' in networks)) {
1148
- const defaultNetwork = this.safeValue2(networks, 'NONE', networkKeysLength - 1);
1149
- if (defaultNetwork !== undefined) {
1150
- currencyFee = defaultNetwork['fee'];
1151
- }
1152
- }
1153
- result[code] = {
1117
+ result[code] = this.safeCurrencyStructure({
1154
1118
  'info': currency,
1155
1119
  'id': id,
1156
1120
  'code': code,
1157
1121
  'name': name,
1158
- 'active': currencyActive,
1159
- 'deposit': depositEnabled,
1160
- 'withdraw': withdrawEnabled,
1161
- 'fee': currencyFee,
1122
+ 'active': undefined,
1123
+ 'deposit': undefined,
1124
+ 'withdraw': undefined,
1125
+ 'fee': undefined,
1162
1126
  'precision': undefined,
1163
1127
  'limits': {
1164
1128
  'amount': {
1165
1129
  'min': undefined,
1166
1130
  'max': undefined,
1167
1131
  },
1168
- 'withdraw': {
1169
- 'min': currencyWithdrawMin,
1170
- 'max': currencyWithdrawMax,
1171
- },
1172
1132
  },
1133
+ 'type': 'crypto',
1173
1134
  'networks': networks,
1174
- };
1135
+ });
1175
1136
  }
1176
1137
  return result;
1177
1138
  }
@@ -3429,13 +3390,27 @@ export default class mexc extends Exchange {
3429
3390
  }
3430
3391
  parseOrder(order, market = undefined) {
3431
3392
  //
3432
- // spot: createOrder
3393
+ // spot
3394
+ // createOrder
3433
3395
  //
3434
- // {
3396
+ // {
3397
+ // "symbol": "FARTCOINUSDT",
3398
+ // "orderId": "C02__342252993005723644225",
3399
+ // "orderListId": "-1",
3400
+ // "price": "1.1",
3401
+ // "origQty": "6.3",
3402
+ // "type": "IMMEDIATE_OR_CANCEL",
3403
+ // "side": "SELL",
3404
+ // "transactTime": "1745852205223"
3405
+ // }
3406
+ //
3407
+ // unknown endpoint on spot
3408
+ //
3409
+ // {
3435
3410
  // "symbol": "BTCUSDT",
3436
3411
  // "orderId": "123738410679123456",
3437
3412
  // "orderListId": -1
3438
- // }
3413
+ // }
3439
3414
  //
3440
3415
  // margin: createOrder
3441
3416
  //
@@ -3600,6 +3575,11 @@ export default class mexc extends Exchange {
3600
3575
  else {
3601
3576
  id = this.safeString2(order, 'orderId', 'id');
3602
3577
  }
3578
+ let timeInForce = this.parseOrderTimeInForce(this.safeString(order, 'timeInForce'));
3579
+ const typeRaw = this.safeString(order, 'type');
3580
+ if (timeInForce === undefined) {
3581
+ timeInForce = this.getTifFromRawOrderType(typeRaw);
3582
+ }
3603
3583
  const marketId = this.safeString(order, 'symbol');
3604
3584
  market = this.safeMarket(marketId, market);
3605
3585
  const timestamp = this.safeIntegerN(order, ['time', 'createTime', 'transactTime']);
@@ -3622,8 +3602,8 @@ export default class mexc extends Exchange {
3622
3602
  'lastTradeTimestamp': undefined,
3623
3603
  'status': this.parseOrderStatus(this.safeString2(order, 'status', 'state')),
3624
3604
  'symbol': market['symbol'],
3625
- 'type': this.parseOrderType(this.safeString(order, 'type')),
3626
- 'timeInForce': this.parseOrderTimeInForce(this.safeString(order, 'timeInForce')),
3605
+ 'type': this.parseOrderType(typeRaw),
3606
+ 'timeInForce': timeInForce,
3627
3607
  'side': this.parseOrderSide(this.safeString(order, 'side')),
3628
3608
  'price': this.safeNumber(order, 'price'),
3629
3609
  'triggerPrice': this.safeNumber2(order, 'stopPrice', 'triggerPrice'),
@@ -3652,6 +3632,9 @@ export default class mexc extends Exchange {
3652
3632
  'MARKET': 'market',
3653
3633
  'LIMIT': 'limit',
3654
3634
  'LIMIT_MAKER': 'limit',
3635
+ // on spot, during submission below types are used only accepted as limit order
3636
+ 'IMMEDIATE_OR_CANCEL': 'limit',
3637
+ 'FILL_OR_KILL': 'limit',
3655
3638
  };
3656
3639
  return this.safeString(statuses, status, status);
3657
3640
  }
@@ -3679,6 +3662,16 @@ export default class mexc extends Exchange {
3679
3662
  };
3680
3663
  return this.safeString(statuses, status, status);
3681
3664
  }
3665
+ getTifFromRawOrderType(orderType = undefined) {
3666
+ const statuses = {
3667
+ 'LIMIT': 'GTC',
3668
+ 'LIMIT_MAKER': 'POST_ONLY',
3669
+ 'IMMEDIATE_OR_CANCEL': 'IOC',
3670
+ 'FILL_OR_KILL': 'FOK',
3671
+ 'MARKET': 'IOC',
3672
+ };
3673
+ return this.safeString(statuses, orderType, orderType);
3674
+ }
3682
3675
  async fetchAccountHelper(type, params) {
3683
3676
  if (type === 'spot') {
3684
3677
  return await this.spotPrivateGetAccount(params);
package/js/src/okx.js CHANGED
@@ -375,6 +375,7 @@ export default class okx extends Exchange {
375
375
  'asset/subaccount/managed-subaccount-bills': 5 / 3,
376
376
  'users/entrust-subaccount-list': 10,
377
377
  'account/subaccount/interest-limits': 4,
378
+ 'users/subaccount/apikey': 10,
378
379
  // grid trading
379
380
  'tradingBot/grid/orders-algo-pending': 1,
380
381
  'tradingBot/grid/orders-algo-history': 1,
@@ -507,6 +508,9 @@ export default class okx extends Exchange {
507
508
  'asset/subaccount/transfer': 10,
508
509
  'users/subaccount/set-transfer-out': 10,
509
510
  'account/subaccount/set-loan-allocation': 4,
511
+ 'users/subaccount/create-subaccount': 10,
512
+ 'users/subaccount/subaccount-apikey': 10,
513
+ 'users/subaccount/delete-apikey': 10,
510
514
  // grid trading
511
515
  'tradingBot/grid/order-algo': 1,
512
516
  'tradingBot/grid/amend-order-algo': 1,
@@ -917,6 +921,11 @@ export default class okx extends Exchange {
917
921
  '59506': ExchangeError,
918
922
  '59507': ExchangeError,
919
923
  '59508': AccountSuspended,
924
+ '59515': ExchangeError,
925
+ '59516': ExchangeError,
926
+ '59517': ExchangeError,
927
+ '59518': ExchangeError,
928
+ '59519': ExchangeError,
920
929
  '59642': BadRequest,
921
930
  '59643': ExchangeError,
922
931
  // WebSocket error Codes from 60000-63999
@@ -1599,8 +1608,8 @@ export default class okx extends Exchange {
1599
1608
  const swap = (type === 'swap');
1600
1609
  const option = (type === 'option');
1601
1610
  const contract = swap || future || option;
1602
- let baseId = this.safeString(market, 'baseCcy');
1603
- let quoteId = this.safeString(market, 'quoteCcy');
1611
+ let baseId = this.safeString(market, 'baseCcy', ''); // defaulting to '' because some weird preopen markets have empty baseId
1612
+ let quoteId = this.safeString(market, 'quoteCcy', '');
1604
1613
  const settleId = this.safeString(market, 'settleCcy');
1605
1614
  const settle = this.safeCurrencyCode(settleId);
1606
1615
  const underlying = this.safeString(market, 'uly');
@@ -1616,19 +1625,25 @@ export default class okx extends Exchange {
1616
1625
  let strikePrice = undefined;
1617
1626
  let optionType = undefined;
1618
1627
  if (contract) {
1619
- symbol = symbol + ':' + settle;
1628
+ if (settle !== undefined) {
1629
+ symbol = symbol + ':' + settle;
1630
+ }
1620
1631
  if (future) {
1621
1632
  expiry = this.safeInteger(market, 'expTime');
1622
- const ymd = this.yymmdd(expiry);
1623
- symbol = symbol + '-' + ymd;
1633
+ if (expiry !== undefined) {
1634
+ const ymd = this.yymmdd(expiry);
1635
+ symbol = symbol + '-' + ymd;
1636
+ }
1624
1637
  }
1625
1638
  else if (option) {
1626
1639
  expiry = this.safeInteger(market, 'expTime');
1627
1640
  strikePrice = this.safeString(market, 'stk');
1628
1641
  optionType = this.safeString(market, 'optType');
1629
- const ymd = this.yymmdd(expiry);
1630
- symbol = symbol + '-' + ymd + '-' + strikePrice + '-' + optionType;
1631
- optionType = (optionType === 'P') ? 'put' : 'call';
1642
+ if (expiry !== undefined) {
1643
+ const ymd = this.yymmdd(expiry);
1644
+ symbol = symbol + '-' + ymd + '-' + strikePrice + '-' + optionType;
1645
+ optionType = (optionType === 'P') ? 'put' : 'call';
1646
+ }
1632
1647
  }
1633
1648
  }
1634
1649
  const tickSize = this.safeString(market, 'tickSz');
package/js/src/oxfun.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import Exchange from './abstract/oxfun.js';
2
- import type { Account, Balances, Currencies, Currency, Int, Market, Num, OHLCV, Order, OrderBook, OrderType, OrderSide, OrderRequest, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry, FundingRate, FundingRates, DepositAddress, LeverageTier, LeverageTiers } from './base/types.js';
2
+ import type { Account, Balances, Currencies, Currency, Int, Market, Num, OHLCV, Order, OrderBook, OrderType, OrderSide, OrderRequest, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntry, FundingRate, FundingRates, DepositAddress, LeverageTier, LeverageTiers, Position } from './base/types.js';
3
3
  /**
4
4
  * @class oxfun
5
5
  * @augments Exchange
@@ -301,8 +301,8 @@ export default class oxfun extends Exchange {
301
301
  * @param {boolean} [params.subAcc]
302
302
  * @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
303
303
  */
304
- fetchPositions(symbols?: Strings, params?: {}): Promise<import("./base/types.js").Position[]>;
305
- parsePosition(position: any, market?: Market): import("./base/types.js").Position;
304
+ fetchPositions(symbols?: Strings, params?: {}): Promise<Position[]>;
305
+ parsePosition(position: any, market?: Market): Position;
306
306
  /**
307
307
  * @method
308
308
  * @name oxfun#createOrder
package/js/src/paradex.js CHANGED
@@ -710,18 +710,9 @@ export default class paradex extends Exchange {
710
710
  async fetchTickers(symbols = undefined, params = {}) {
711
711
  await this.loadMarkets();
712
712
  symbols = this.marketSymbols(symbols);
713
- const request = {};
714
- if (symbols !== undefined) {
715
- if (Array.isArray(symbols)) {
716
- request['market'] = this.marketId(symbols[0]);
717
- }
718
- else {
719
- request['market'] = this.marketId(symbols);
720
- }
721
- }
722
- else {
723
- request['market'] = 'ALL';
724
- }
713
+ const request = {
714
+ 'market': 'ALL',
715
+ };
725
716
  const response = await this.publicGetMarketsSummary(this.extend(request, params));
726
717
  //
727
718
  // {
@@ -1,5 +1,5 @@
1
1
  import Exchange from './abstract/phemex.js';
2
- import type { TransferEntry, Balances, Currency, FundingHistory, FundingRateHistory, Int, Market, Num, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, MarginModification, Currencies, Dict, LeverageTier, LeverageTiers, int, FundingRate, DepositAddress, Conversion } from './base/types.js';
2
+ import type { TransferEntry, Balances, Currency, FundingHistory, FundingRateHistory, Int, Market, Num, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, MarginModification, Currencies, Dict, LeverageTier, LeverageTiers, int, FundingRate, DepositAddress, Conversion, Position } from './base/types.js';
3
3
  /**
4
4
  * @class phemex
5
5
  * @augments Exchange
@@ -293,8 +293,8 @@ export default class phemex extends Exchange {
293
293
  * @param {string} [params.method] *USDT contracts only* 'privateGetGAccountsAccountPositions' or 'privateGetAccountsPositions' default is 'privateGetGAccountsAccountPositions'
294
294
  * @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
295
295
  */
296
- fetchPositions(symbols?: Strings, params?: {}): Promise<import("./base/types.js").Position[]>;
297
- parsePosition(position: Dict, market?: Market): import("./base/types.js").Position;
296
+ fetchPositions(symbols?: Strings, params?: {}): Promise<Position[]>;
297
+ parsePosition(position: Dict, market?: Market): Position;
298
298
  /**
299
299
  * @method
300
300
  * @name phemex#fetchFundingHistory
package/js/src/phemex.js CHANGED
@@ -1165,7 +1165,8 @@ export default class phemex extends Exchange {
1165
1165
  },
1166
1166
  },
1167
1167
  'valueScale': valueScale,
1168
- 'networks': {},
1168
+ 'networks': undefined,
1169
+ 'type': 'crypto',
1169
1170
  };
1170
1171
  }
1171
1172
  return result;
@@ -1,5 +1,5 @@
1
1
  import Exchange from './abstract/poloniex.js';
2
- import type { TransferEntry, Int, Leverage, OrderSide, OrderType, OHLCV, Trade, OrderBook, Order, Balances, Str, MarginModification, Transaction, Ticker, Tickers, Market, Strings, Currency, Num, Currencies, TradingFees, Dict, int, DepositAddress } from './base/types.js';
2
+ import type { TransferEntry, Int, Leverage, OrderSide, OrderType, OHLCV, Trade, OrderBook, Order, Balances, Str, MarginModification, Transaction, Ticker, Tickers, Market, Strings, Currency, Num, Currencies, TradingFees, Dict, int, DepositAddress, Position } from './base/types.js';
3
3
  /**
4
4
  * @class poloniex
5
5
  * @augments Exchange
@@ -404,8 +404,8 @@ export default class poloniex extends Exchange {
404
404
  * @param {boolean} [params.standard] whether to fetch standard contract positions
405
405
  * @returns {object[]} a list of [position structures]{@link https://docs.ccxt.com/#/?id=position-structure}
406
406
  */
407
- fetchPositions(symbols?: Strings, params?: {}): Promise<import("./base/types.js").Position[]>;
408
- parsePosition(position: Dict, market?: Market): import("./base/types.js").Position;
407
+ fetchPositions(symbols?: Strings, params?: {}): Promise<Position[]>;
408
+ parsePosition(position: Dict, market?: Market): Position;
409
409
  modifyMarginHelper(symbol: string, amount: any, type: any, params?: {}): Promise<MarginModification>;
410
410
  parseMarginModification(data: Dict, market?: Market): MarginModification;
411
411
  /**
@@ -1855,7 +1855,7 @@ export default class poloniex extends Exchange {
1855
1855
  const isTrigger = this.safeValue2(params, 'trigger', 'stop');
1856
1856
  params = this.omit(params, ['trigger', 'stop']);
1857
1857
  let response = undefined;
1858
- if (!market['spot']) {
1858
+ if (marketType !== 'spot') {
1859
1859
  const raw = await this.swapPrivateGetV3TradeOrderOpens(this.extend(request, params));
1860
1860
  //
1861
1861
  // {
@@ -0,0 +1,160 @@
1
+ import apexRest from '../apex.js';
2
+ import type { Int, Trade, OrderBook, Ticker, Strings, Tickers } from '../base/types.js';
3
+ import Client from '../base/ws/Client.js';
4
+ import { OHLCV, Order, Position, Str } from '../base/types.js';
5
+ export default class apex extends apexRest {
6
+ describe(): any;
7
+ /**
8
+ * @method
9
+ * @name apex#watchTrades
10
+ * @description watches information on multiple trades made in a market
11
+ * @see https://api-docs.pro.apex.exchange/#websocket-v3-for-omni-websocket-endpoint
12
+ * @param {string} symbol unified market symbol of the market trades were made in
13
+ * @param {int} [since] the earliest time in ms to fetch trades for
14
+ * @param {int} [limit] the maximum number of trade structures to retrieve
15
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
16
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
17
+ */
18
+ watchTrades(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
19
+ /**
20
+ * @method
21
+ * @name apex#watchTradesForSymbols
22
+ * @description get the list of most recent trades for a list of symbols
23
+ * @see https://api-docs.pro.apex.exchange/#websocket-v3-for-omni-websocket-endpoint
24
+ * @param {string[]} symbols unified symbol of the market to fetch trades for
25
+ * @param {int} [since] timestamp in ms of the earliest trade to fetch
26
+ * @param {int} [limit] the maximum amount of trades to fetch
27
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
28
+ * @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
29
+ */
30
+ watchTradesForSymbols(symbols: string[], since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
31
+ handleTrades(client: Client, message: any): void;
32
+ parseWsTrade(trade: any, market?: any): Trade;
33
+ /**
34
+ * @method
35
+ * @name apex#watchOrderBook
36
+ * @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
37
+ * @see https://api-docs.pro.apex.exchange/#websocket-v3-for-omni-websocket-endpoint
38
+ * @param {string} symbol unified symbol of the market to fetch the order book for
39
+ * @param {int} [limit] the maximum amount of order book entries to return.
40
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
41
+ * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
42
+ */
43
+ watchOrderBook(symbol: string, limit?: Int, params?: {}): Promise<OrderBook>;
44
+ /**
45
+ * @method
46
+ * @name apex#watchOrderBookForSymbols
47
+ * @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
48
+ * @see https://api-docs.pro.apex.exchange/#websocket-v3-for-omni-websocket-endpoint
49
+ * @param {string[]} symbols unified array of symbols
50
+ * @param {int} [limit] the maximum amount of order book entries to return.
51
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
52
+ * @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
53
+ */
54
+ watchOrderBookForSymbols(symbols: string[], limit?: Int, params?: {}): Promise<OrderBook>;
55
+ watchTopics(url: any, messageHashes: any, topics: any, params?: {}): Promise<any>;
56
+ handleOrderBook(client: Client, message: any): void;
57
+ handleDelta(bookside: any, delta: any): void;
58
+ handleDeltas(bookside: any, deltas: any): void;
59
+ /**
60
+ * @method
61
+ * @name apex#watchTicker
62
+ * @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
63
+ * @see https://api-docs.pro.apex.exchange/#websocket-v3-for-omni-websocket-endpoint
64
+ * @param {string} symbol unified symbol of the market to fetch the ticker for
65
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
66
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
67
+ */
68
+ watchTicker(symbol: string, params?: {}): Promise<Ticker>;
69
+ /**
70
+ * @method
71
+ * @name apex#watchTickers
72
+ * @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
73
+ * @see https://api-docs.pro.apex.exchange/#websocket-v3-for-omni-websocket-endpoint
74
+ * @param {string[]} symbols unified symbol of the market to fetch the ticker for
75
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
76
+ * @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
77
+ */
78
+ watchTickers(symbols?: Strings, params?: {}): Promise<Tickers>;
79
+ handleTicker(client: Client, message: any): void;
80
+ /**
81
+ * @method
82
+ * @name apex#watchOHLCV
83
+ * @description watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
84
+ * @see https://api-docs.pro.apex.exchange/#websocket-v3-for-omni-websocket-endpoint
85
+ * @param {string} symbol unified symbol of the market to fetch OHLCV data for
86
+ * @param {string} timeframe the length of time each candle represents
87
+ * @param {int} [since] timestamp in ms of the earliest candle to fetch
88
+ * @param {int} [limit] the maximum amount of candles to fetch
89
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
90
+ * @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
91
+ */
92
+ watchOHLCV(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<OHLCV[]>;
93
+ /**
94
+ * @method
95
+ * @name apex#watchOHLCVForSymbols
96
+ * @description watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
97
+ * @see https://api-docs.pro.apex.exchange/#websocket-v3-for-omni-websocket-endpoint
98
+ * @param {string[][]} symbolsAndTimeframes array of arrays containing unified symbols and timeframes to fetch OHLCV data for, example [['BTC/USDT', '1m'], ['LTC/USDT', '5m']]
99
+ * @param {int} [since] timestamp in ms of the earliest candle to fetch
100
+ * @param {int} [limit] the maximum amount of candles to fetch
101
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
102
+ * @returns {object} A list of candles ordered as timestamp, open, high, low, close, volume
103
+ */
104
+ watchOHLCVForSymbols(symbolsAndTimeframes: string[][], since?: Int, limit?: Int, params?: {}): Promise<import("../base/types.js").Dictionary<import("../base/types.js").Dictionary<OHLCV[]>>>;
105
+ handleOHLCV(client: Client, message: any): void;
106
+ parseWsOHLCV(ohlcv: any, market?: any): OHLCV;
107
+ /**
108
+ * @method
109
+ * @name apex#watchMyTrades
110
+ * @description watches information on multiple trades made by the user
111
+ * @see https://api-docs.pro.apex.exchange/#private-websocket
112
+ * @param {string} symbol unified market symbol of the market orders were made in
113
+ * @param {int} [since] the earliest time in ms to fetch orders for
114
+ * @param {int} [limit] the maximum number of order structures to retrieve
115
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
116
+ * @param {boolean} [params.unifiedMargin] use unified margin account
117
+ * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
118
+ */
119
+ watchMyTrades(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
120
+ /**
121
+ * @method
122
+ * @name apex#watchPositions
123
+ * @see https://api-docs.pro.apex.exchange/#private-websocket
124
+ * @description watch all open positions
125
+ * @param {string[]} [symbols] list of unified market symbols
126
+ * @param {int} [since] the earliest time in ms to fetch positions for
127
+ * @param {int} [limit] the maximum number of positions to retrieve
128
+ * @param {object} params extra parameters specific to the exchange API endpoint
129
+ * @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/en/latest/manual.html#position-structure}
130
+ */
131
+ watchPositions(symbols?: Strings, since?: Int, limit?: Int, params?: {}): Promise<Position[]>;
132
+ /**
133
+ * @method
134
+ * @name apex#watchOrders
135
+ * @description watches information on multiple orders made by the user
136
+ * @see https://api-docs.pro.apex.exchange/#private-websocket
137
+ * @param {string} symbol unified market symbol of the market orders were made in
138
+ * @param {int} [since] the earliest time in ms to fetch orders for
139
+ * @param {int} [limit] the maximum number of order structures to retrieve
140
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
141
+ * @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
142
+ */
143
+ watchOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
144
+ handleMyTrades(client: Client, lists: any): void;
145
+ handleOrder(client: Client, lists: any): void;
146
+ setPositionsCache(client: Client, symbols?: Strings): void;
147
+ loadPositionsSnapshot(client: any, messageHash: any): Promise<void>;
148
+ handlePositions(client: any, lists: any): void;
149
+ authenticate(url: any, params?: {}): Promise<any>;
150
+ handleErrorMessage(client: Client, message: any): boolean;
151
+ handleMessage(client: Client, message: any): void;
152
+ ping(client: Client): {
153
+ args: string[];
154
+ op: string;
155
+ };
156
+ handlePong(client: Client, message: any): any;
157
+ handleAccount(client: Client, message: any): void;
158
+ handleAuthenticate(client: Client, message: any): any;
159
+ handleSubscriptionStatus(client: Client, message: any): any;
160
+ }