ccxt 4.4.49 → 4.4.53

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 (158) hide show
  1. package/README.md +6 -3
  2. package/dist/ccxt.browser.min.js +3 -3
  3. package/dist/cjs/ccxt.js +1 -1
  4. package/dist/cjs/src/alpaca.js +65 -2
  5. package/dist/cjs/src/base/Exchange.js +112 -3
  6. package/dist/cjs/src/binance.js +42 -19
  7. package/dist/cjs/src/bitfinex1.js +22 -22
  8. package/dist/cjs/src/blofin.js +6 -2
  9. package/dist/cjs/src/bybit.js +2 -2
  10. package/dist/cjs/src/coinex.js +5 -5
  11. package/dist/cjs/src/coinmetro.js +21 -4
  12. package/dist/cjs/src/defx.js +1 -1
  13. package/dist/cjs/src/deribit.js +23 -4
  14. package/dist/cjs/src/ellipx.js +1 -0
  15. package/dist/cjs/src/gate.js +2 -2
  16. package/dist/cjs/src/hollaex.js +15 -20
  17. package/dist/cjs/src/htx.js +6 -4
  18. package/dist/cjs/src/hyperliquid.js +4 -4
  19. package/dist/cjs/src/krakenfutures.js +1 -1
  20. package/dist/cjs/src/kucoin.js +52 -74
  21. package/dist/cjs/src/kuna.js +1 -1
  22. package/dist/cjs/src/mexc.js +29 -8
  23. package/dist/cjs/src/okcoin.js +13 -5
  24. package/dist/cjs/src/okx.js +1 -1
  25. package/dist/cjs/src/onetrading.js +1 -1
  26. package/dist/cjs/src/paradex.js +2 -2
  27. package/dist/cjs/src/paymium.js +42 -0
  28. package/dist/cjs/src/pro/binance.js +2 -0
  29. package/dist/cjs/src/pro/bitfinex1.js +4 -4
  30. package/dist/cjs/src/pro/bitvavo.js +1 -1
  31. package/dist/cjs/src/pro/blofin.js +9 -1
  32. package/dist/cjs/src/pro/bybit.js +1 -1
  33. package/dist/cjs/src/pro/coincatch.js +2 -2
  34. package/dist/cjs/src/pro/coinex.js +4 -1
  35. package/dist/cjs/src/pro/cryptocom.js +2 -2
  36. package/dist/cjs/src/pro/defx.js +1 -1
  37. package/dist/cjs/src/pro/exmo.js +1 -1
  38. package/dist/cjs/src/pro/gemini.js +1 -1
  39. package/dist/cjs/src/pro/hashkey.js +2 -2
  40. package/dist/cjs/src/pro/htx.js +8 -8
  41. package/dist/cjs/src/pro/hyperliquid.js +2 -2
  42. package/dist/cjs/src/pro/kucoin.js +1 -1
  43. package/dist/cjs/src/pro/okx.js +1 -1
  44. package/dist/cjs/src/pro/oxfun.js +1 -1
  45. package/dist/cjs/src/probit.js +77 -9
  46. package/dist/cjs/src/timex.js +67 -0
  47. package/dist/cjs/src/tokocrypto.js +82 -5
  48. package/dist/cjs/src/tradeogre.js +55 -2
  49. package/dist/cjs/src/vertex.js +65 -2
  50. package/dist/cjs/src/wavesexchange.js +73 -0
  51. package/dist/cjs/src/wazirx.js +59 -3
  52. package/dist/cjs/src/whitebit.js +80 -4
  53. package/dist/cjs/src/xt.js +112 -0
  54. package/dist/cjs/src/yobit.js +56 -0
  55. package/dist/cjs/src/zaif.js +55 -0
  56. package/dist/cjs/src/zonda.js +56 -0
  57. package/examples/README.md +6 -0
  58. package/js/ccxt.d.ts +1 -1
  59. package/js/ccxt.js +1 -1
  60. package/js/src/abstract/binance.d.ts +1 -0
  61. package/js/src/abstract/binancecoinm.d.ts +1 -0
  62. package/js/src/abstract/binanceus.d.ts +1 -0
  63. package/js/src/abstract/binanceusdm.d.ts +1 -0
  64. package/js/src/alpaca.d.ts +35 -0
  65. package/js/src/alpaca.js +65 -2
  66. package/js/src/base/Exchange.d.ts +2 -0
  67. package/js/src/base/Exchange.js +112 -3
  68. package/js/src/binance.d.ts +4 -1
  69. package/js/src/binance.js +42 -19
  70. package/js/src/bitfinex1.d.ts +22 -22
  71. package/js/src/bitfinex1.js +22 -22
  72. package/js/src/blofin.d.ts +1 -1
  73. package/js/src/blofin.js +6 -2
  74. package/js/src/bybit.d.ts +2 -2
  75. package/js/src/bybit.js +2 -2
  76. package/js/src/coinex.js +5 -5
  77. package/js/src/coinmetro.d.ts +1 -1
  78. package/js/src/coinmetro.js +21 -4
  79. package/js/src/defx.d.ts +1 -1
  80. package/js/src/defx.js +1 -1
  81. package/js/src/deribit.d.ts +1 -1
  82. package/js/src/deribit.js +23 -4
  83. package/js/src/ellipx.d.ts +1 -0
  84. package/js/src/ellipx.js +1 -0
  85. package/js/src/gate.d.ts +1 -1
  86. package/js/src/gate.js +2 -2
  87. package/js/src/hollaex.d.ts +2 -1
  88. package/js/src/hollaex.js +15 -20
  89. package/js/src/htx.d.ts +1 -1
  90. package/js/src/htx.js +6 -4
  91. package/js/src/hyperliquid.d.ts +3 -3
  92. package/js/src/hyperliquid.js +4 -4
  93. package/js/src/krakenfutures.d.ts +1 -1
  94. package/js/src/krakenfutures.js +1 -1
  95. package/js/src/kucoin.js +52 -74
  96. package/js/src/kuna.d.ts +1 -1
  97. package/js/src/kuna.js +1 -1
  98. package/js/src/mexc.d.ts +1 -1
  99. package/js/src/mexc.js +29 -8
  100. package/js/src/okcoin.js +13 -5
  101. package/js/src/okx.d.ts +1 -1
  102. package/js/src/okx.js +1 -1
  103. package/js/src/onetrading.d.ts +1 -1
  104. package/js/src/onetrading.js +1 -1
  105. package/js/src/paradex.d.ts +1 -1
  106. package/js/src/paradex.js +2 -2
  107. package/js/src/paymium.js +42 -0
  108. package/js/src/pro/binance.js +2 -0
  109. package/js/src/pro/bitfinex1.d.ts +4 -4
  110. package/js/src/pro/bitfinex1.js +4 -4
  111. package/js/src/pro/bitvavo.d.ts +1 -1
  112. package/js/src/pro/bitvavo.js +1 -1
  113. package/js/src/pro/blofin.d.ts +1 -1
  114. package/js/src/pro/blofin.js +9 -1
  115. package/js/src/pro/bybit.d.ts +1 -1
  116. package/js/src/pro/bybit.js +1 -1
  117. package/js/src/pro/coincatch.d.ts +2 -2
  118. package/js/src/pro/coincatch.js +2 -2
  119. package/js/src/pro/coinex.js +4 -1
  120. package/js/src/pro/cryptocom.d.ts +2 -2
  121. package/js/src/pro/cryptocom.js +2 -2
  122. package/js/src/pro/defx.d.ts +1 -1
  123. package/js/src/pro/defx.js +1 -1
  124. package/js/src/pro/exmo.d.ts +1 -1
  125. package/js/src/pro/exmo.js +1 -1
  126. package/js/src/pro/gemini.d.ts +1 -1
  127. package/js/src/pro/gemini.js +1 -1
  128. package/js/src/pro/hashkey.d.ts +2 -2
  129. package/js/src/pro/hashkey.js +2 -2
  130. package/js/src/pro/htx.d.ts +8 -8
  131. package/js/src/pro/htx.js +8 -8
  132. package/js/src/pro/hyperliquid.d.ts +2 -2
  133. package/js/src/pro/hyperliquid.js +2 -2
  134. package/js/src/pro/kucoin.d.ts +1 -1
  135. package/js/src/pro/kucoin.js +1 -1
  136. package/js/src/pro/okx.d.ts +1 -1
  137. package/js/src/pro/okx.js +1 -1
  138. package/js/src/pro/oxfun.d.ts +1 -1
  139. package/js/src/pro/oxfun.js +1 -1
  140. package/js/src/probit.d.ts +1 -0
  141. package/js/src/probit.js +77 -9
  142. package/js/src/timex.js +67 -0
  143. package/js/src/tokocrypto.d.ts +2 -3
  144. package/js/src/tokocrypto.js +82 -5
  145. package/js/src/tradeogre.d.ts +4 -2
  146. package/js/src/tradeogre.js +55 -2
  147. package/js/src/vertex.js +65 -2
  148. package/js/src/wavesexchange.js +73 -0
  149. package/js/src/wazirx.js +59 -3
  150. package/js/src/whitebit.js +80 -4
  151. package/js/src/xt.js +112 -0
  152. package/js/src/yobit.js +56 -0
  153. package/js/src/zaif.js +55 -0
  154. package/js/src/zonda.d.ts +1 -0
  155. package/js/src/zonda.js +56 -0
  156. package/package.json +2 -2
  157. package/js/src/hitbtc3.d.ts +0 -8
  158. package/js/src/hitbtc3.js +0 -20
@@ -28,7 +28,7 @@ export default class hyperliquid extends Exchange {
28
28
  fetchMarkets(params?: {}): Promise<Market[]>;
29
29
  /**
30
30
  * @method
31
- * @name hyperliquid#fetchMarkets
31
+ * @name hyperliquid#fetchSwapMarkets
32
32
  * @description retrieves data on all swap markets for hyperliquid
33
33
  * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-perpetuals-asset-contexts-includes-mark-price-current-funding-open-interest-etc
34
34
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -37,7 +37,7 @@ export default class hyperliquid extends Exchange {
37
37
  fetchSwapMarkets(params?: {}): Promise<Market[]>;
38
38
  /**
39
39
  * @method
40
- * @name calculatePricePrecision
40
+ * @name hyperliquid#calculatePricePrecision
41
41
  * @description Helper function to calculate the Hyperliquid DECIMAL_PLACES price precision
42
42
  * @param {float} price the price to use in the calculation
43
43
  * @param {int} amountPrecision the amountPrecision to use in the calculation
@@ -47,7 +47,7 @@ export default class hyperliquid extends Exchange {
47
47
  calculatePricePrecision(price: number, amountPrecision: number, maxDecimals: number): number;
48
48
  /**
49
49
  * @method
50
- * @name hyperliquid#fetchMarkets
50
+ * @name hyperliquid#fetchSpotMarkets
51
51
  * @description retrieves data on all spot markets for hyperliquid
52
52
  * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/spot#retrieve-spot-asset-contexts
53
53
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -400,7 +400,7 @@ export default class hyperliquid extends Exchange {
400
400
  }
401
401
  /**
402
402
  * @method
403
- * @name hyperliquid#fetchMarkets
403
+ * @name hyperliquid#fetchSwapMarkets
404
404
  * @description retrieves data on all swap markets for hyperliquid
405
405
  * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-perpetuals-asset-contexts-includes-mark-price-current-funding-open-interest-etc
406
406
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -455,7 +455,7 @@ export default class hyperliquid extends Exchange {
455
455
  }
456
456
  /**
457
457
  * @method
458
- * @name calculatePricePrecision
458
+ * @name hyperliquid#calculatePricePrecision
459
459
  * @description Helper function to calculate the Hyperliquid DECIMAL_PLACES price precision
460
460
  * @param {float} price the price to use in the calculation
461
461
  * @param {int} amountPrecision the amountPrecision to use in the calculation
@@ -504,7 +504,7 @@ export default class hyperliquid extends Exchange {
504
504
  }
505
505
  /**
506
506
  * @method
507
- * @name hyperliquid#fetchMarkets
507
+ * @name hyperliquid#fetchSpotMarkets
508
508
  * @description retrieves data on all spot markets for hyperliquid
509
509
  * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/spot#retrieve-spot-asset-contexts
510
510
  * @param {object} [params] extra parameters specific to the exchange API endpoint
@@ -1402,7 +1402,7 @@ export default class hyperliquid extends Exchange {
1402
1402
  createOrdersRequest(orders, params = {}) {
1403
1403
  /**
1404
1404
  * @method
1405
- * @name hyperliquid#createOrders
1405
+ * @name hyperliquid#createOrdersRequest
1406
1406
  * @description create a list of trade orders
1407
1407
  * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#place-an-order
1408
1408
  * @param {Array} orders list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
@@ -39,7 +39,7 @@ export default class krakenfutures extends Exchange {
39
39
  parseTicker(ticker: Dict, market?: Market): Ticker;
40
40
  /**
41
41
  * @method
42
- * @name kraken#fetchOHLCV
42
+ * @name krakenfutures#fetchOHLCV
43
43
  * @see https://docs.futures.kraken.com/#http-api-charts-candles
44
44
  * @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
45
45
  * @param {string} symbol unified symbol of the market to fetch OHLCV data for
@@ -702,7 +702,7 @@ export default class krakenfutures extends Exchange {
702
702
  }
703
703
  /**
704
704
  * @method
705
- * @name kraken#fetchOHLCV
705
+ * @name krakenfutures#fetchOHLCV
706
706
  * @see https://docs.futures.kraken.com/#http-api-charts-candles
707
707
  * @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
708
708
  * @param {string} symbol unified symbol of the market to fetch OHLCV data for
package/js/src/kucoin.js CHANGED
@@ -1344,8 +1344,7 @@ export default class kucoin extends Exchange {
1344
1344
  * @returns {object} an associative dictionary of currencies
1345
1345
  */
1346
1346
  async fetchCurrencies(params = {}) {
1347
- const promises = [];
1348
- promises.push(this.publicGetCurrencies(params));
1347
+ const response = await this.publicGetCurrencies(params);
1349
1348
  //
1350
1349
  // {
1351
1350
  // "code":"200000",
@@ -1371,92 +1370,40 @@ export default class kucoin extends Exchange {
1371
1370
  // "isDepositEnabled":false,
1372
1371
  // "confirms":12,
1373
1372
  // "preConfirms":12,
1373
+ // "withdrawPrecision": 8,
1374
+ // "maxWithdraw": null,
1375
+ // "maxDeposit": null,
1376
+ // "needTag": false,
1374
1377
  // "contractAddress":"0xa6446d655a0c34bc4f05042ee88170d056cbaf45",
1375
1378
  // "depositFeeRate": "0.001", // present for some currencies/networks
1376
1379
  // }
1377
1380
  // ]
1378
1381
  // },
1379
- // }
1380
- //
1381
- promises.push(this.fetchWebEndpoint('fetchCurrencies', 'webExchangeGetCurrencyCurrencyChainInfo', true));
1382
- //
1383
- // {
1384
- // "success": true,
1385
- // "code": "200",
1386
- // "msg": "success",
1387
- // "retry": false,
1388
- // "data": [
1389
- // {
1390
- // "status": "enabled",
1391
- // "currency": "BTC",
1392
- // "isChainEnabled": "true",
1393
- // "chain": "btc",
1394
- // "chainName": "BTC",
1395
- // "chainFullName": "Bitcoin",
1396
- // "walletPrecision": "8",
1397
- // "isDepositEnabled": "true",
1398
- // "depositMinSize": "0.00005",
1399
- // "confirmationCount": "2",
1400
- // "isWithdrawEnabled": "true",
1401
- // "withdrawMinSize": "0.001",
1402
- // "withdrawMinFee": "0.0005",
1403
- // "withdrawFeeRate": "0",
1404
- // "depositDisabledTip": "Wallet Maintenance",
1405
- // "preDepositTipEnabled": "true",
1406
- // "preDepositTip": "Do not transfer from ETH network directly",
1407
- // "withdrawDisabledTip": "",
1408
- // "preWithdrawTipEnabled": "false",
1409
- // "preWithdrawTip": "",
1410
- // "orgAddress": "",
1411
- // "userAddressName": "Memo",
1412
- // },
1413
1382
  // ]
1414
1383
  // }
1415
1384
  //
1416
- const responses = await Promise.all(promises);
1417
- const currenciesResponse = this.safeDict(responses, 0, {});
1418
- const currenciesData = this.safeList(currenciesResponse, 'data', []);
1419
- const additionalResponse = this.safeDict(responses, 1, {});
1420
- const additionalData = this.safeList(additionalResponse, 'data', []);
1421
- const additionalDataGrouped = this.groupBy(additionalData, 'currency');
1385
+ const currenciesData = this.safeList(response, 'data', []);
1422
1386
  const result = {};
1423
1387
  for (let i = 0; i < currenciesData.length; i++) {
1424
1388
  const entry = currenciesData[i];
1425
1389
  const id = this.safeString(entry, 'currency');
1426
1390
  const name = this.safeString(entry, 'fullName');
1427
1391
  const code = this.safeCurrencyCode(id);
1428
- let isWithdrawEnabled = undefined;
1429
- let isDepositEnabled = undefined;
1430
1392
  const networks = {};
1431
1393
  const chains = this.safeList(entry, 'chains', []);
1432
- const extraChainsData = this.indexBy(this.safeList(additionalDataGrouped, id, []), 'chain');
1433
1394
  const rawPrecision = this.safeString(entry, 'precision');
1434
1395
  const precision = this.parseNumber(this.parsePrecision(rawPrecision));
1435
1396
  const chainsLength = chains.length;
1436
1397
  if (!chainsLength) {
1437
- // https://t.me/KuCoin_API/173118
1438
- isWithdrawEnabled = false;
1439
- isDepositEnabled = false;
1398
+ // one buggy coin, which doesn't contain info https://t.me/KuCoin_API/173118
1399
+ continue;
1440
1400
  }
1441
1401
  for (let j = 0; j < chainsLength; j++) {
1442
1402
  const chain = chains[j];
1443
1403
  const chainId = this.safeString(chain, 'chainId');
1444
1404
  const networkCode = this.networkIdToCode(chainId, code);
1445
1405
  const chainWithdrawEnabled = this.safeBool(chain, 'isWithdrawEnabled', false);
1446
- if (isWithdrawEnabled === undefined) {
1447
- isWithdrawEnabled = chainWithdrawEnabled;
1448
- }
1449
- else {
1450
- isWithdrawEnabled = isWithdrawEnabled || chainWithdrawEnabled;
1451
- }
1452
1406
  const chainDepositEnabled = this.safeBool(chain, 'isDepositEnabled', false);
1453
- if (isDepositEnabled === undefined) {
1454
- isDepositEnabled = chainDepositEnabled;
1455
- }
1456
- else {
1457
- isDepositEnabled = isDepositEnabled || chainDepositEnabled;
1458
- }
1459
- const chainExtraData = this.safeDict(extraChainsData, chainId, {});
1460
1407
  networks[networkCode] = {
1461
1408
  'info': chain,
1462
1409
  'id': chainId,
@@ -1466,35 +1413,35 @@ export default class kucoin extends Exchange {
1466
1413
  'fee': this.safeNumber(chain, 'withdrawalMinFee'),
1467
1414
  'deposit': chainDepositEnabled,
1468
1415
  'withdraw': chainWithdrawEnabled,
1469
- 'precision': this.parseNumber(this.parsePrecision(this.safeString(chainExtraData, 'walletPrecision'))),
1416
+ 'precision': this.parseNumber(this.parsePrecision(this.safeString(chain, 'withdrawPrecision'))),
1470
1417
  'limits': {
1471
1418
  'withdraw': {
1472
1419
  'min': this.safeNumber(chain, 'withdrawalMinSize'),
1473
- 'max': undefined,
1420
+ 'max': this.safeNumber(chain, 'maxWithdraw'),
1474
1421
  },
1475
1422
  'deposit': {
1476
1423
  'min': this.safeNumber(chain, 'depositMinSize'),
1477
- 'max': undefined,
1424
+ 'max': this.safeNumber(chain, 'maxDeposit'),
1478
1425
  },
1479
1426
  },
1480
1427
  };
1481
1428
  }
1482
1429
  // kucoin has determined 'fiat' currencies with below logic
1483
1430
  const isFiat = (rawPrecision === '2') && (chainsLength === 0);
1484
- result[code] = {
1431
+ result[code] = this.safeCurrencyStructure({
1485
1432
  'id': id,
1486
1433
  'name': name,
1487
1434
  'code': code,
1488
1435
  'type': isFiat ? 'fiat' : 'crypto',
1489
1436
  'precision': precision,
1490
1437
  'info': entry,
1491
- 'active': (isDepositEnabled || isWithdrawEnabled),
1492
- 'deposit': isDepositEnabled,
1493
- 'withdraw': isWithdrawEnabled,
1494
- 'fee': undefined,
1495
- 'limits': this.limits,
1496
1438
  'networks': networks,
1497
- };
1439
+ 'deposit': undefined,
1440
+ 'withdraw': undefined,
1441
+ 'active': undefined,
1442
+ 'fee': undefined,
1443
+ 'limits': undefined,
1444
+ });
1498
1445
  }
1499
1446
  return result;
1500
1447
  }
@@ -1638,6 +1585,37 @@ export default class kucoin extends Exchange {
1638
1585
  // "chain": "ERC20"
1639
1586
  // }
1640
1587
  //
1588
+ if ('chains' in fee) {
1589
+ // if data obtained through `currencies` endpoint
1590
+ const resultNew = {
1591
+ 'info': fee,
1592
+ 'withdraw': {
1593
+ 'fee': undefined,
1594
+ 'percentage': false,
1595
+ },
1596
+ 'deposit': {
1597
+ 'fee': undefined,
1598
+ 'percentage': undefined,
1599
+ },
1600
+ 'networks': {},
1601
+ };
1602
+ const chains = this.safeList(fee, 'chains', []);
1603
+ for (let i = 0; i < chains.length; i++) {
1604
+ const chain = chains[i];
1605
+ const networkCodeNew = this.networkIdToCode(this.safeString(chain, 'chainId'), this.safeString(currency, 'code'));
1606
+ resultNew['networks'][networkCodeNew] = {
1607
+ 'withdraw': {
1608
+ 'fee': this.safeNumber(chain, 'withdrawMinFee'),
1609
+ 'percentage': false,
1610
+ },
1611
+ 'deposit': {
1612
+ 'fee': undefined,
1613
+ 'percentage': undefined,
1614
+ },
1615
+ };
1616
+ }
1617
+ return resultNew;
1618
+ }
1641
1619
  const minWithdrawFee = this.safeNumber(fee, 'withdrawMinFee');
1642
1620
  const result = {
1643
1621
  'info': fee,
@@ -3240,15 +3218,15 @@ export default class kucoin extends Exchange {
3240
3218
  market = this.market(symbol);
3241
3219
  request['symbol'] = market['id'];
3242
3220
  }
3243
- if (limit !== undefined) {
3244
- request['pageSize'] = limit;
3245
- }
3246
3221
  const method = this.options['fetchMyTradesMethod'];
3247
3222
  let parseResponseData = false;
3248
3223
  let response = undefined;
3249
3224
  [request, params] = this.handleUntilOption('endAt', request, params);
3250
3225
  if (hf) {
3251
3226
  // does not return trades earlier than 2019-02-18T00:00:00Z
3227
+ if (limit !== undefined) {
3228
+ request['limit'] = limit;
3229
+ }
3252
3230
  if (since !== undefined) {
3253
3231
  // only returns trades up to one week after the since param
3254
3232
  request['startAt'] = since;
package/js/src/kuna.d.ts CHANGED
@@ -131,7 +131,7 @@ export default class kuna extends Exchange {
131
131
  cancelOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
132
132
  /**
133
133
  * @method
134
- * @name kuna#cancelOrder
134
+ * @name kuna#cancelOrders
135
135
  * @description cancels an open order
136
136
  * @param {string} ids order ids
137
137
  * @param {string} symbol not used by kuna cancelOrder
package/js/src/kuna.js CHANGED
@@ -1082,7 +1082,7 @@ export default class kuna extends Exchange {
1082
1082
  }
1083
1083
  /**
1084
1084
  * @method
1085
- * @name kuna#cancelOrder
1085
+ * @name kuna#cancelOrders
1086
1086
  * @description cancels an open order
1087
1087
  * @param {string} ids order ids
1088
1088
  * @param {string} symbol not used by kuna cancelOrder
package/js/src/mexc.d.ts CHANGED
@@ -191,7 +191,7 @@ export default class mexc extends Exchange {
191
191
  * @param {bool} [params.postOnly] if true, the order will only be posted if it will be a maker order
192
192
  * @param {bool} [params.reduceOnly] *contract only* indicates if this order is to reduce the size of a position
193
193
  * @param {bool} [params.hedged] *swap only* true for hedged mode, false for one way mode, default is false
194
- *
194
+ * @param {string} [params.timeInForce] 'IOC' or 'FOK', default is 'GTC'
195
195
  * EXCHANGE SPECIFIC PARAMETERS
196
196
  * @param {int} [params.leverage] *contract only* leverage is necessary on isolated margin
197
197
  * @param {long} [params.positionId] *contract only* it is recommended to fill in this parameter when closing a position
package/js/src/mexc.js CHANGED
@@ -1384,6 +1384,7 @@ export default class mexc extends Exchange {
1384
1384
  const quote = this.safeCurrencyCode(quoteId);
1385
1385
  const settle = this.safeCurrencyCode(settleId);
1386
1386
  const state = this.safeString(market, 'state');
1387
+ const isLinear = quote === settle;
1387
1388
  result.push({
1388
1389
  'id': id,
1389
1390
  'symbol': base + '/' + quote + ':' + settle,
@@ -1401,8 +1402,8 @@ export default class mexc extends Exchange {
1401
1402
  'option': false,
1402
1403
  'active': (state === '0'),
1403
1404
  'contract': true,
1404
- 'linear': true,
1405
- 'inverse': false,
1405
+ 'linear': isLinear,
1406
+ 'inverse': !isLinear,
1406
1407
  'taker': this.safeNumber(market, 'takerFeeRate'),
1407
1408
  'maker': this.safeNumber(market, 'makerFeeRate'),
1408
1409
  'contractSize': this.safeNumber(market, 'contractSize'),
@@ -2298,7 +2299,7 @@ export default class mexc extends Exchange {
2298
2299
  * @param {bool} [params.postOnly] if true, the order will only be posted if it will be a maker order
2299
2300
  * @param {bool} [params.reduceOnly] *contract only* indicates if this order is to reduce the size of a position
2300
2301
  * @param {bool} [params.hedged] *swap only* true for hedged mode, false for one way mode, default is false
2301
- *
2302
+ * @param {string} [params.timeInForce] 'IOC' or 'FOK', default is 'GTC'
2302
2303
  * EXCHANGE SPECIFIC PARAMETERS
2303
2304
  * @param {int} [params.leverage] *contract only* leverage is necessary on isolated margin
2304
2305
  * @param {long} [params.positionId] *contract only* it is recommended to fill in this parameter when closing a position
@@ -2367,6 +2368,16 @@ export default class mexc extends Exchange {
2367
2368
  if (postOnly) {
2368
2369
  request['type'] = 'LIMIT_MAKER';
2369
2370
  }
2371
+ const tif = this.safeString(params, 'timeInForce');
2372
+ if (tif !== undefined) {
2373
+ params = this.omit(params, 'timeInForce');
2374
+ if (tif === 'IOC') {
2375
+ request['type'] = 'IMMEDIATE_OR_CANCEL';
2376
+ }
2377
+ else if (tif === 'FOK') {
2378
+ request['type'] = 'FILL_OR_KILL';
2379
+ }
2380
+ }
2370
2381
  return this.extend(request, params);
2371
2382
  }
2372
2383
  /**
@@ -5993,13 +6004,23 @@ export default class mexc extends Exchange {
5993
6004
  else {
5994
6005
  url = this.urls['api'][section][access] + '/api/' + this.version + '/' + path;
5995
6006
  }
5996
- let paramsEncoded = '';
6007
+ let urlParams = params;
5997
6008
  if (access === 'private') {
5998
- params['timestamp'] = this.nonce();
5999
- params['recvWindow'] = this.safeInteger(this.options, 'recvWindow', 5000);
6009
+ if (section === 'broker' && ((method === 'POST') || (method === 'PUT') || (method === 'DELETE'))) {
6010
+ urlParams = {
6011
+ 'timestamp': this.nonce(),
6012
+ 'recvWindow': this.safeInteger(this.options, 'recvWindow', 5000),
6013
+ };
6014
+ body = this.json(params);
6015
+ }
6016
+ else {
6017
+ urlParams['timestamp'] = this.nonce();
6018
+ urlParams['recvWindow'] = this.safeInteger(this.options, 'recvWindow', 5000);
6019
+ }
6000
6020
  }
6001
- if (Object.keys(params).length) {
6002
- paramsEncoded = this.urlencode(params);
6021
+ let paramsEncoded = '';
6022
+ if (Object.keys(urlParams).length) {
6023
+ paramsEncoded = this.urlencode(urlParams);
6003
6024
  url += '?' + paramsEncoded;
6004
6025
  }
6005
6026
  if (access === 'private') {
package/js/src/okcoin.js CHANGED
@@ -691,12 +691,20 @@ export default class okcoin extends Exchange {
691
691
  async fetchTime(params = {}) {
692
692
  const response = await this.publicGetPublicTime(params);
693
693
  //
694
- // {
695
- // "iso": "2015-01-07T23:47:25.201Z",
696
- // "epoch": 1420674445.201
697
- // }
694
+ // {
695
+ // "code": "0",
696
+ // "data":
697
+ // [
698
+ // {
699
+ // "ts": "1737379360033"
700
+ // }
701
+ // ],
702
+ // "msg": ""
703
+ // }
698
704
  //
699
- return this.parse8601(this.safeString(response, 'iso'));
705
+ const data = this.safeList(response, 'data');
706
+ const timestamp = this.safeDict(data, 0);
707
+ return this.safeInteger(timestamp, 'ts');
700
708
  }
701
709
  /**
702
710
  * @method
package/js/src/okx.d.ts CHANGED
@@ -577,7 +577,7 @@ export default class okx extends Exchange {
577
577
  fetchPositions(symbols?: Strings, params?: {}): Promise<Position[]>;
578
578
  /**
579
579
  * @method
580
- * @name okx#fetchPositions
580
+ * @name okx#fetchPositionsForSymbol
581
581
  * @see https://www.okx.com/docs-v5/en/#rest-api-account-get-positions
582
582
  * @description fetch all open positions for specific symbol
583
583
  * @param {string} symbol unified market symbol
package/js/src/okx.js CHANGED
@@ -5733,7 +5733,7 @@ export default class okx extends Exchange {
5733
5733
  }
5734
5734
  /**
5735
5735
  * @method
5736
- * @name okx#fetchPositions
5736
+ * @name okx#fetchPositionsForSymbol
5737
5737
  * @see https://www.okx.com/docs-v5/en/#rest-api-account-get-positions
5738
5738
  * @description fetch all open positions for specific symbol
5739
5739
  * @param {string} symbol unified market symbol
@@ -117,7 +117,7 @@ export default class onetrading extends Exchange {
117
117
  * @description create a trade order
118
118
  * @see https://docs.onetrading.com/#create-order
119
119
  * @param {string} symbol unified symbol of the market to create an order in
120
- * @param {string} type 'market' or 'limit'
120
+ * @param {string} type 'limit'
121
121
  * @param {string} side 'buy' or 'sell'
122
122
  * @param {float} amount how much of currency you want to trade in units of base currency
123
123
  * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
@@ -1205,7 +1205,7 @@ export default class onetrading extends Exchange {
1205
1205
  * @description create a trade order
1206
1206
  * @see https://docs.onetrading.com/#create-order
1207
1207
  * @param {string} symbol unified symbol of the market to create an order in
1208
- * @param {string} type 'market' or 'limit'
1208
+ * @param {string} type 'limit'
1209
1209
  * @param {string} side 'buy' or 'sell'
1210
1210
  * @param {float} amount how much of currency you want to trade in units of base currency
1211
1211
  * @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
@@ -246,7 +246,7 @@ export default class paradex extends Exchange {
246
246
  fetchMyTrades(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
247
247
  /**
248
248
  * @method
249
- * @name paradex#fetchPositions
249
+ * @name paradex#fetchPosition
250
250
  * @description fetch data on an open position
251
251
  * @see https://docs.api.prod.paradex.trade/#list-open-positions
252
252
  * @param {string} symbol unified market symbol of the market the position is held in
package/js/src/paradex.js CHANGED
@@ -959,7 +959,7 @@ export default class paradex extends Exchange {
959
959
  //
960
960
  // {
961
961
  // "symbol": "BTC-USD-PERP",
962
- // "oracle_price": "68465.17449906",
962
+ // "oracle_price": "68465.17449904",
963
963
  // "mark_price": "68465.17449906",
964
964
  // "last_traded_price": "68495.1",
965
965
  // "bid": "68477.6",
@@ -1722,7 +1722,7 @@ export default class paradex extends Exchange {
1722
1722
  }
1723
1723
  /**
1724
1724
  * @method
1725
- * @name paradex#fetchPositions
1725
+ * @name paradex#fetchPosition
1726
1726
  * @description fetch data on an open position
1727
1727
  * @see https://docs.api.prod.paradex.trade/#list-open-positions
1728
1728
  * @param {string} symbol unified market symbol of the market the position is held in
package/js/src/paymium.js CHANGED
@@ -114,6 +114,48 @@ export default class paymium extends Exchange {
114
114
  },
115
115
  },
116
116
  'precisionMode': TICK_SIZE,
117
+ 'features': {
118
+ 'spot': {
119
+ 'sandbox': false,
120
+ 'createOrder': {
121
+ 'marginMode': false,
122
+ 'triggerPrice': false,
123
+ 'triggerDirection': false,
124
+ 'triggerPriceType': undefined,
125
+ 'stopLossPrice': false,
126
+ 'takeProfitPrice': false,
127
+ 'attachedStopLossTakeProfit': undefined,
128
+ 'timeInForce': {
129
+ 'IOC': false,
130
+ 'FOK': false,
131
+ 'PO': false,
132
+ 'GTD': false,
133
+ },
134
+ 'hedged': false,
135
+ 'trailing': false,
136
+ 'leverage': false,
137
+ 'marketBuyByCost': true,
138
+ 'marketBuyRequiresPrice': false,
139
+ 'selfTradePrevention': false,
140
+ 'iceberg': false,
141
+ },
142
+ 'createOrders': undefined,
143
+ 'fetchMyTrades': undefined,
144
+ 'fetchOrder': undefined,
145
+ 'fetchOpenOrders': undefined,
146
+ 'fetchOrders': undefined,
147
+ 'fetchClosedOrders': undefined,
148
+ 'fetchOHLCV': undefined, // todo
149
+ },
150
+ 'swap': {
151
+ 'linear': undefined,
152
+ 'inverse': undefined,
153
+ },
154
+ 'future': {
155
+ 'linear': undefined,
156
+ 'inverse': undefined,
157
+ },
158
+ },
117
159
  });
118
160
  }
119
161
  parseBalance(response) {
@@ -2361,6 +2361,7 @@ export default class binance extends binanceRest {
2361
2361
  let response = undefined;
2362
2362
  if (isPortfolioMargin) {
2363
2363
  response = await this.papiPostListenKey(params);
2364
+ params = this.extend(params, { 'portfolioMargin': true });
2364
2365
  }
2365
2366
  else if (type === 'future') {
2366
2367
  response = await this.fapiPrivatePostListenKey(params);
@@ -2416,6 +2417,7 @@ export default class binance extends binanceRest {
2416
2417
  try {
2417
2418
  if (isPortfolioMargin) {
2418
2419
  await this.papiPutListenKey(this.extend(request, params));
2420
+ params = this.extend(params, { 'portfolioMargin': true });
2419
2421
  }
2420
2422
  else if (type === 'future') {
2421
2423
  await this.fapiPrivatePutListenKey(this.extend(request, params));
@@ -6,7 +6,7 @@ export default class bitfinex1 extends bitfinex1Rest {
6
6
  subscribe(channel: any, symbol: any, params?: {}): Promise<any>;
7
7
  /**
8
8
  * @method
9
- * @name bitfinex#watchTrades
9
+ * @name bitfinex1#watchTrades
10
10
  * @description get the list of most recent trades for a particular symbol
11
11
  * @see https://docs.bitfinex.com/v1/reference/ws-public-trades
12
12
  * @param {string} symbol unified symbol of the market to fetch trades for
@@ -18,7 +18,7 @@ export default class bitfinex1 extends bitfinex1Rest {
18
18
  watchTrades(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
19
19
  /**
20
20
  * @method
21
- * @name bitfinex#watchTicker
21
+ * @name bitfinex1#watchTicker
22
22
  * @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
23
23
  * @see https://docs.bitfinex.com/v1/reference/ws-public-ticker
24
24
  * @param {string} symbol unified symbol of the market to fetch the ticker for
@@ -31,7 +31,7 @@ export default class bitfinex1 extends bitfinex1Rest {
31
31
  handleTicker(client: Client, message: any, subscription: any): void;
32
32
  /**
33
33
  * @method
34
- * @name bitfinex#watchOrderBook
34
+ * @name bitfinex1#watchOrderBook
35
35
  * @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
36
36
  * @see https://docs.bitfinex.com/v1/reference/ws-public-order-books
37
37
  * @param {string} symbol unified symbol of the market to fetch the order book for
@@ -49,7 +49,7 @@ export default class bitfinex1 extends bitfinex1Rest {
49
49
  watchOrder(id: any, symbol?: Str, params?: {}): Promise<any>;
50
50
  /**
51
51
  * @method
52
- * @name bitfinex#watchOrders
52
+ * @name bitfinex1#watchOrders
53
53
  * @description watches information on multiple orders made by the user
54
54
  * @see https://docs.bitfinex.com/v1/reference/ws-auth-order-updates
55
55
  * @see https://docs.bitfinex.com/v1/reference/ws-auth-order-snapshots
@@ -58,7 +58,7 @@ export default class bitfinex1 extends bitfinex1Rest {
58
58
  }
59
59
  /**
60
60
  * @method
61
- * @name bitfinex#watchTrades
61
+ * @name bitfinex1#watchTrades
62
62
  * @description get the list of most recent trades for a particular symbol
63
63
  * @see https://docs.bitfinex.com/v1/reference/ws-public-trades
64
64
  * @param {string} symbol unified symbol of the market to fetch trades for
@@ -78,7 +78,7 @@ export default class bitfinex1 extends bitfinex1Rest {
78
78
  }
79
79
  /**
80
80
  * @method
81
- * @name bitfinex#watchTicker
81
+ * @name bitfinex1#watchTicker
82
82
  * @description watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
83
83
  * @see https://docs.bitfinex.com/v1/reference/ws-public-ticker
84
84
  * @param {string} symbol unified symbol of the market to fetch the ticker for
@@ -251,7 +251,7 @@ export default class bitfinex1 extends bitfinex1Rest {
251
251
  }
252
252
  /**
253
253
  * @method
254
- * @name bitfinex#watchOrderBook
254
+ * @name bitfinex1#watchOrderBook
255
255
  * @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
256
256
  * @see https://docs.bitfinex.com/v1/reference/ws-public-order-books
257
257
  * @param {string} symbol unified symbol of the market to fetch the order book for
@@ -462,7 +462,7 @@ export default class bitfinex1 extends bitfinex1Rest {
462
462
  }
463
463
  /**
464
464
  * @method
465
- * @name bitfinex#watchOrders
465
+ * @name bitfinex1#watchOrders
466
466
  * @description watches information on multiple orders made by the user
467
467
  * @see https://docs.bitfinex.com/v1/reference/ws-auth-order-updates
468
468
  * @see https://docs.bitfinex.com/v1/reference/ws-auth-order-snapshots
@@ -28,7 +28,7 @@ export default class bitvavo extends bitvavoRest {
28
28
  handleTicker(client: Client, message: any): void;
29
29
  /**
30
30
  * @method
31
- * @name mexc#watchBidsAsks
31
+ * @name bitvavo#watchBidsAsks
32
32
  * @description watches best bid & ask for symbols
33
33
  * @see https://docs.bitvavo.com/#tag/Market-data-subscription-WebSocket/paths/~1subscribeTicker24h/post
34
34
  * @param {string[]} symbols unified symbol of the market to fetch the ticker for