ccxt 4.5.48 → 4.5.50

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 (60) hide show
  1. package/README.md +7 -5
  2. package/dist/ccxt.browser.min.js +10 -10
  3. package/dist/cjs/ccxt.js +6 -1
  4. package/dist/cjs/src/abstract/weex.js +11 -0
  5. package/dist/cjs/src/base/Exchange.js +48 -13
  6. package/dist/cjs/src/bitget.js +1 -0
  7. package/dist/cjs/src/btcbox.js +1 -1
  8. package/dist/cjs/src/bullish.js +2 -1
  9. package/dist/cjs/src/gate.js +0 -1
  10. package/dist/cjs/src/hibachi.js +1 -1
  11. package/dist/cjs/src/kraken.js +1 -0
  12. package/dist/cjs/src/krakenfutures.js +10 -1
  13. package/dist/cjs/src/kucoin.js +5 -1
  14. package/dist/cjs/src/lighter.js +312 -144
  15. package/dist/cjs/src/mexc.js +7 -12
  16. package/dist/cjs/src/okx.js +46 -1
  17. package/dist/cjs/src/paradex.js +5 -2
  18. package/dist/cjs/src/pro/binance.js +1 -1
  19. package/dist/cjs/src/pro/cex.js +1 -1
  20. package/dist/cjs/src/pro/coinbase.js +1 -1
  21. package/dist/cjs/src/pro/hyperliquid.js +361 -1
  22. package/dist/cjs/src/pro/lighter.js +339 -18
  23. package/dist/cjs/src/pro/weex.js +1906 -0
  24. package/dist/cjs/src/weex.js +3823 -0
  25. package/js/ccxt.d.ts +8 -2
  26. package/js/ccxt.js +6 -2
  27. package/js/src/abstract/myokx.d.ts +34 -0
  28. package/js/src/abstract/okx.d.ts +34 -0
  29. package/js/src/abstract/okxus.d.ts +34 -0
  30. package/js/src/abstract/weex.d.ts +83 -0
  31. package/js/src/abstract/weex.js +11 -0
  32. package/js/src/base/Exchange.d.ts +5 -1
  33. package/js/src/base/Exchange.js +48 -13
  34. package/js/src/bitget.js +1 -0
  35. package/js/src/btcbox.js +1 -1
  36. package/js/src/bullish.js +2 -1
  37. package/js/src/gate.js +0 -1
  38. package/js/src/hibachi.js +1 -1
  39. package/js/src/kraken.js +1 -0
  40. package/js/src/krakenfutures.js +10 -1
  41. package/js/src/kucoin.d.ts +4 -0
  42. package/js/src/kucoin.js +5 -1
  43. package/js/src/lighter.d.ts +12 -2
  44. package/js/src/lighter.js +313 -145
  45. package/js/src/mexc.d.ts +2 -0
  46. package/js/src/mexc.js +7 -12
  47. package/js/src/okx.js +46 -1
  48. package/js/src/paradex.js +5 -2
  49. package/js/src/pro/binance.js +1 -1
  50. package/js/src/pro/cex.js +1 -1
  51. package/js/src/pro/coinbase.js +1 -1
  52. package/js/src/pro/hyperliquid.d.ts +48 -1
  53. package/js/src/pro/hyperliquid.js +362 -2
  54. package/js/src/pro/lighter.d.ts +37 -2
  55. package/js/src/pro/lighter.js +339 -18
  56. package/js/src/pro/weex.d.ts +330 -0
  57. package/js/src/pro/weex.js +1905 -0
  58. package/js/src/weex.d.ts +675 -0
  59. package/js/src/weex.js +3822 -0
  60. package/package.json +1 -1
@@ -1599,7 +1599,7 @@ export default class Exchange {
1599
1599
  unlockId() {
1600
1600
  return undefined; // c# stub
1601
1601
  }
1602
- async loadLighterLibrary(libraryPath, chainId, privateKey, apiKeyIndex, accountIndex) {
1602
+ async loadLighterLibrary(libraryPath, chainId, privateKey, apiKeyIndex, accountIndex, createClient = false) {
1603
1603
  // wasmExecPathExample: '/opt/homebrew/opt/go/libexec/lib/wasm/wasm_exec.js';
1604
1604
  // libraryPath eg: '/Users/cjg/Git/lighter-go/lighter.wasm';
1605
1605
  if (libraryPath === undefined || libraryPath === '') {
@@ -1619,11 +1619,16 @@ export default class Exchange {
1619
1619
  const bytes = new Uint8Array(readFile(libraryPath, null)); // it should point to lighter.wasm
1620
1620
  const { instance } = await WebAssembly.instantiate(bytes, go.importObject);
1621
1621
  go.run(instance);
1622
- // createCLient
1622
+ if (createClient) {
1623
+ this.lighterCreateClient(undefined, chainId, privateKey, apiKeyIndex, accountIndex);
1624
+ }
1625
+ return {}; // empty object we will read it from globalThis
1626
+ }
1627
+ lighterCreateClient(signer, chainId, privateKey, apiKeyIndex, accountIndex) {
1623
1628
  const url = this.implodeHostname(this.urls['api']['public']);
1624
1629
  const res = globalThis.CreateClient(url, privateKey, chainId, apiKeyIndex, accountIndex);
1625
1630
  this.checkLighterSignedError(res);
1626
- return {}; // empty object we will read it from globalThis
1631
+ return signer;
1627
1632
  }
1628
1633
  // eslint-disable-next-line no-unused-vars
1629
1634
  lighterSignCreateGroupedOrders(signer, request) {
@@ -1644,13 +1649,15 @@ export default class Exchange {
1644
1649
  'OrderExpiry': order['order_expiry'],
1645
1650
  });
1646
1651
  }
1647
- const res = globalThis.SignCreateGroupedOrders(request['grouping_type'], ordersArr, orders.length, request['nonce'], request['api_key_index'], request['account_index']);
1652
+ const res = globalThis.SignCreateGroupedOrders(request['grouping_type'], ordersArr, orders.length, 0, // skip nonce
1653
+ request['nonce'], request['api_key_index'], request['account_index']);
1648
1654
  this.checkLighterSignedError(res);
1649
1655
  return [res.txType, res.txInfo];
1650
1656
  }
1651
1657
  // eslint-disable-next-line no-unused-vars
1652
1658
  lighterSignCreateOrder(signer, request) {
1653
- const res = (globalThis.SignCreateOrder(parseInt(request['market_index']), request['client_order_index'], request['base_amount'], request['avg_execution_price'], request['is_ask'], request['order_type'], request['time_in_force'], request['reduce_only'], request['trigger_price'], request['order_expiry'], request['nonce'], request['api_key_index'], request['account_index']));
1659
+ const res = (globalThis.SignCreateOrder(parseInt(request['market_index']), request['client_order_index'], request['base_amount'], request['avg_execution_price'], request['is_ask'], request['order_type'], request['time_in_force'], request['reduce_only'], request['trigger_price'], request['order_expiry'], request['integrator_account_index'], request['integrator_taker_fee'], request['integrator_maker_fee'], 0, // skip nonce
1660
+ request['nonce'], request['api_key_index'], request['account_index']));
1654
1661
  this.checkLighterSignedError(res);
1655
1662
  return [res.txType, res.txInfo];
1656
1663
  }
@@ -1660,38 +1667,45 @@ export default class Exchange {
1660
1667
  }
1661
1668
  }
1662
1669
  lighterSignCancelOrder(signer, request) {
1663
- const res = (globalThis.SignCancelOrder(request['market_index'], request['order_index'], request['nonce'], request['api_key_index'], request['account_index']));
1670
+ const res = (globalThis.SignCancelOrder(request['market_index'], request['order_index'], 0, // skip nonce
1671
+ request['nonce'], request['api_key_index'], request['account_index']));
1664
1672
  this.checkLighterSignedError(res);
1665
1673
  return [res.txType, res.txInfo];
1666
1674
  }
1667
1675
  lighterSignWithdraw(signer, request) {
1668
- const res = (globalThis.SignWithdraw(request['asset_index'], request['route_type'], request['amount'], request['nonce'], request['api_key_index'], request['account_index']));
1676
+ const res = (globalThis.SignWithdraw(request['asset_index'], request['route_type'], request['amount'], 0, // skip nonce
1677
+ request['nonce'], request['api_key_index'], request['account_index']));
1669
1678
  this.checkLighterSignedError(res);
1670
1679
  return [res.txType, res.txInfo];
1671
1680
  }
1672
1681
  // eslint-disable-next-line no-unused-vars
1673
1682
  lighterSignCreateSubAccount(signer, request) {
1674
- const res = (globalThis.SignCreateSubAccount(request['nonce'], request['api_key_index'], request['account_index']));
1683
+ const res = (globalThis.SignCreateSubAccount(0, // skip nonce
1684
+ request['nonce'], request['api_key_index'], request['account_index']));
1675
1685
  this.checkLighterSignedError(res);
1676
1686
  return [res.txType, res.txInfo];
1677
1687
  }
1678
1688
  lighterSignCancelAllOrders(signer, request) {
1679
- const res = (globalThis.SignCancelAllOrders(request['time_in_force'], request['time'], request['nonce'], request['api_key_index'], request['account_index']));
1689
+ const res = (globalThis.SignCancelAllOrders(request['time_in_force'], request['time'], 0, // skip nonce
1690
+ request['nonce'], request['api_key_index'], request['account_index']));
1680
1691
  this.checkLighterSignedError(res);
1681
1692
  return [res.txType, res.txInfo];
1682
1693
  }
1683
1694
  lighterSignModifyOrder(signer, request) {
1684
- const res = (globalThis.SignModifyOrder(request['market_index'], request['index'], request['base_amount'], request['price'], request['trigger_price'], request['nonce'], request['api_key_index'], request['account_index']));
1695
+ const res = (globalThis.SignModifyOrder(request['market_index'], request['index'], request['base_amount'], request['price'], request['trigger_price'], request['integrator_account_index'], request['integrator_taker_fee'], request['integrator_maker_fee'], 0, // skip nonce
1696
+ request['nonce'], request['api_key_index'], request['account_index']));
1685
1697
  this.checkLighterSignedError(res);
1686
1698
  return [res.txType, res.txInfo];
1687
1699
  }
1688
1700
  lighterSignTransfer(signer, request) {
1689
- const res = globalThis.SignTransfer(request['to_account_index'], request['asset_index'], request['from_route_type'], request['to_route_type'], request['amount'], request['usdc_fee'], request['memo'], request['nonce'], request['api_key_index'], request['account_index']);
1701
+ const res = globalThis.SignTransfer(request['to_account_index'], request['asset_index'], request['from_route_type'], request['to_route_type'], request['amount'], request['usdc_fee'], request['memo'], 0, // skip nonce
1702
+ request['nonce'], request['api_key_index'], request['account_index']);
1690
1703
  this.checkLighterSignedError(res);
1691
1704
  return [res.txType, res.txInfo];
1692
1705
  }
1693
1706
  lighterSignUpdateLeverage(signer, request) {
1694
- const res = (globalThis.SignUpdateLeverage(request['market_index'], request['initial_margin_fraction'], request['margin_mode'], request['nonce'], request['api_key_index'], request['account_index']));
1707
+ const res = (globalThis.SignUpdateLeverage(request['market_index'], request['initial_margin_fraction'], request['margin_mode'], 0, // skip nonce
1708
+ request['nonce'], request['api_key_index'], request['account_index']));
1695
1709
  this.checkLighterSignedError(res);
1696
1710
  return [res.txType, res.txInfo];
1697
1711
  }
@@ -1701,10 +1715,31 @@ export default class Exchange {
1701
1715
  return res.authToken;
1702
1716
  }
1703
1717
  lighterSignUpdateMargin(signer, request) {
1704
- const res = globalThis.SignUpdateMargin(request['market_index'], request['usdc_amount'], request['direction'], request['nonce'], request['api_key_index'], request['account_index']);
1718
+ const res = globalThis.SignUpdateMargin(request['market_index'], request['usdc_amount'], request['direction'], 0, // skip nonce
1719
+ request['nonce'], request['api_key_index'], request['account_index']);
1705
1720
  this.checkLighterSignedError(res);
1706
1721
  return [res.txType, res.txInfo];
1707
1722
  }
1723
+ // eslint-disable-next-line no-unused-vars
1724
+ lighterSignApproveIntegrator(signer, request) {
1725
+ const res = globalThis.SignApproveIntegrator(request['integrator_account_index'], request['integrator_taker_fee'], request['integrator_maker_fee'], request['integrator_taker_fee'], request['integrator_maker_fee'], request['approval_expiry'], 0, // skip nonce
1726
+ request['nonce'], request['api_key_index'], request['account_index']);
1727
+ this.checkLighterSignedError(res);
1728
+ return [res.txType, res.txInfo, res.messageToSign];
1729
+ }
1730
+ // eslint-disable-next-line no-unused-vars
1731
+ lighterGenerateApiKey(signer) {
1732
+ const res = globalThis.GenerateAPIKey();
1733
+ this.checkLighterSignedError(res);
1734
+ return [res.privateKey, res.publicKey];
1735
+ }
1736
+ // eslint-disable-next-line no-unused-vars
1737
+ lighterSignChangePubkey(signer, request) {
1738
+ const res = globalThis.SignChangePubKey(Buffer.from(request['pubkey']).toString(), 0, // skip nonce
1739
+ request['nonce'], request['api_key_index'], request['account_index']);
1740
+ this.checkLighterSignedError(res);
1741
+ return [res.txType, res.txInfo, res.messageToSign];
1742
+ }
1708
1743
  /* eslint-enable */
1709
1744
  // ------------------------------------------------------------------------
1710
1745
  // ########################################################################
package/js/src/bitget.js CHANGED
@@ -1394,6 +1394,7 @@ export default class bitget extends Exchange {
1394
1394
  '43115': OnMaintenance,
1395
1395
  '45110': InvalidOrder,
1396
1396
  '40774': InvalidOrder,
1397
+ '40917': InvalidOrder,
1397
1398
  '45122': InvalidOrder,
1398
1399
  // spot
1399
1400
  'invalid sign': AuthenticationError,
package/js/src/btcbox.js CHANGED
@@ -625,7 +625,7 @@ export default class btcbox extends Exchange {
625
625
  //
626
626
  // {
627
627
  // "id":11,
628
- // "datetime":"2014-10-21 10:47:20",
628
+ // "datetime":"2014-10-21 10:47:21",
629
629
  // "type":"sell",
630
630
  // "price":42000,
631
631
  // "amount_original":1.2,
package/js/src/bullish.js CHANGED
@@ -821,7 +821,8 @@ export default class bullish extends Exchange {
821
821
  expiryDatetime = this.safeString(market, 'expiryDatetime');
822
822
  const idParts = id.split('-');
823
823
  const datePart = this.safeString(idParts, 2);
824
- symbol += '-' + datePart;
824
+ const dateYmd = datePart.slice(2);
825
+ symbol += '-' + dateYmd;
825
826
  if (type === 'future') {
826
827
  future = true;
827
828
  }
package/js/src/gate.js CHANGED
@@ -720,7 +720,6 @@ export default class gate extends Exchange {
720
720
  'MPH': 'MORPHER',
721
721
  'POINT': 'GATEPOINT',
722
722
  'RAI': 'RAIREFLEXINDEX',
723
- 'RED': 'RedLang',
724
723
  'SBTC': 'SUPERBITCOIN',
725
724
  'TNC': 'TRINITYNETWORKCREDIT',
726
725
  'VAI': 'VAIOT',
package/js/src/hibachi.js CHANGED
@@ -1739,7 +1739,7 @@ export default class hibachi extends Exchange {
1739
1739
  // "status": "pending",
1740
1740
  // "timestampSec": 1752692872,
1741
1741
  // "token": "USDT",
1742
- // "transactionHash": "0x408e48881e0ba77d8638e3fe57bc06bdec513ddaa8b672e0aefa7e22e2f18b5e",
1742
+ // "transactionHash": "0x408e48881e0ba77d8638e3fe57bc06bdec513ddaa8b672e0aefa7e22e2f18b4e",
1743
1743
  // "transactionType": "deposit"
1744
1744
  // },
1745
1745
  // {
package/js/src/kraken.js CHANGED
@@ -562,6 +562,7 @@ export default class kraken extends Exchange {
562
562
  'EFunding:No funding method': BadRequest,
563
563
  'EFunding:Unknown asset': BadSymbol,
564
564
  'EService:Market in post_only mode': OnMaintenance,
565
+ 'EService:Market in cancel_only mode': OnMaintenance,
565
566
  'EGeneral:Too many requests': DDoSProtection,
566
567
  'ETrade:User Locked': AccountSuspended, // {"error":["ETrade:User Locked"]}
567
568
  },
@@ -1570,7 +1570,7 @@ export default class krakenfutures extends Exchange {
1570
1570
  request['count'] = limit;
1571
1571
  }
1572
1572
  if (since !== undefined) {
1573
- request['from'] = since;
1573
+ request['since'] = since;
1574
1574
  }
1575
1575
  const isTrigger = this.safeBool2(params, 'trigger', 'stop', false);
1576
1576
  let response = undefined;
@@ -1587,6 +1587,7 @@ export default class krakenfutures extends Exchange {
1587
1587
  const order = allOrders[i];
1588
1588
  const event = this.safeDict(order, 'event', {});
1589
1589
  const orderPlaced = this.safeDict2(event, 'OrderPlaced', 'OrderTriggerActivated');
1590
+ const orderUpdated = this.safeDict(event, 'OrderUpdated');
1590
1591
  if (orderPlaced !== undefined) {
1591
1592
  const innerOrder = this.safeDict(orderPlaced, 'order', {});
1592
1593
  const filled = this.safeString(innerOrder, 'filled');
@@ -1595,6 +1596,14 @@ export default class krakenfutures extends Exchange {
1595
1596
  closedOrders.push(innerOrder);
1596
1597
  }
1597
1598
  }
1599
+ else if (orderUpdated !== undefined) {
1600
+ const reason = this.safeString(orderUpdated, 'reason');
1601
+ if (reason === 'full_fill') {
1602
+ const newOrder = this.safeDict(orderUpdated, 'newOrder', {});
1603
+ newOrder['status'] = 'closed';
1604
+ closedOrders.push(newOrder);
1605
+ }
1606
+ }
1598
1607
  }
1599
1608
  return this.parseOrders(closedOrders, market, since, limit);
1600
1609
  }
@@ -1448,6 +1448,8 @@ export default class kucoin extends Exchange {
1448
1448
  * @param {string} symbol unified market symbol of the market the position is held in
1449
1449
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1450
1450
  * @param {boolean} [params.uta] set to true for the unified trading account (uta), defaults to false
1451
+ * @param {integer} [params.pageSize] *uta only* page size for the uta endpoint (default 50, max 200)
1452
+ * @param {integer} [params.pageNumber] *uta only* page number for the uta endpoint (default 1)
1451
1453
  * @returns {object} a [position structure]{@link https://docs.ccxt.com/?id=position-structure}
1452
1454
  */
1453
1455
  fetchPosition(symbol: string, params?: {}): Promise<Position>;
@@ -1460,6 +1462,8 @@ export default class kucoin extends Exchange {
1460
1462
  * @param {string[]|undefined} symbols list of unified market symbols
1461
1463
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1462
1464
  * @param {boolean} [params.uta] set to true for the unified trading account (uta), defaults to false
1465
+ * @param {integer} [params.pageSize] *uta only* page size for the uta endpoint (default 50, max 200)
1466
+ * @param {integer} [params.pageNumber] *uta only* page number for the uta endpoint (default 1)
1463
1467
  * @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/?id=position-structure}
1464
1468
  */
1465
1469
  fetchPositions(symbols?: Strings, params?: {}): Promise<Position[]>;
package/js/src/kucoin.js CHANGED
@@ -9968,6 +9968,8 @@ export default class kucoin extends Exchange {
9968
9968
  * @param {string} symbol unified market symbol of the market the position is held in
9969
9969
  * @param {object} [params] extra parameters specific to the exchange API endpoint
9970
9970
  * @param {boolean} [params.uta] set to true for the unified trading account (uta), defaults to false
9971
+ * @param {integer} [params.pageSize] *uta only* page size for the uta endpoint (default 50, max 200)
9972
+ * @param {integer} [params.pageNumber] *uta only* page number for the uta endpoint (default 1)
9971
9973
  * @returns {object} a [position structure]{@link https://docs.ccxt.com/?id=position-structure}
9972
9974
  */
9973
9975
  async fetchPosition(symbol, params = {}) {
@@ -10068,6 +10070,8 @@ export default class kucoin extends Exchange {
10068
10070
  * @param {string[]|undefined} symbols list of unified market symbols
10069
10071
  * @param {object} [params] extra parameters specific to the exchange API endpoint
10070
10072
  * @param {boolean} [params.uta] set to true for the unified trading account (uta), defaults to false
10073
+ * @param {integer} [params.pageSize] *uta only* page size for the uta endpoint (default 50, max 200)
10074
+ * @param {integer} [params.pageNumber] *uta only* page number for the uta endpoint (default 1)
10071
10075
  * @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/?id=position-structure}
10072
10076
  */
10073
10077
  async fetchPositions(symbols = undefined, params = {}) {
@@ -10076,7 +10080,7 @@ export default class kucoin extends Exchange {
10076
10080
  [uta, params] = this.handleOptionAndParams(params, 'fetchPositions', 'uta', uta);
10077
10081
  let response = undefined;
10078
10082
  if (uta) {
10079
- response = await this.utaPrivateGetAccountModePositionOpenList(this.extend(params, { 'accountMode': 'unified' }));
10083
+ response = await this.utaPrivateGetAccountModePositionOpenList(this.extend({ 'accountMode': 'unified', 'limit': 200 }, params));
10080
10084
  }
10081
10085
  else {
10082
10086
  response = await this.futuresPrivateGetPositions(params);
@@ -6,7 +6,9 @@ import type { Dict, FundingRate, FundingRates, Int, int, Market, OHLCV, OrderBoo
6
6
  */
7
7
  export default class lighter extends Exchange {
8
8
  describe(): any;
9
- loadAccount(chainId: any, privateKey: any, apiKeyIndex: any, accountIndex: any, params?: {}): Promise<import("./base/types.js").Dictionary<any>>;
9
+ loadAccount(chainId: any, privateKey: any, apiKeyIndex: string, accountIndex: string, params?: {}): Promise<any>;
10
+ initAuthObject(strAccountIndex: string, strApiKeyIndex: string): void;
11
+ getLighterPrivateKey(strAccountIndex: string, strApiKeyIndex: string): any;
10
12
  /**
11
13
  * @method
12
14
  * @name lighter#preLoadLighterLibrary
@@ -15,10 +17,17 @@ export default class lighter extends Exchange {
15
17
  * @returns {boolean} true if the signer was loaded, false otherwise
16
18
  */
17
19
  preLoadLighterLibrary(params?: {}): Promise<boolean>;
18
- handleAccountIndex(params: object, methodName1: string, optionName1: string, optionName2: string, defaultValue?: any): Promise<(number | object)[]>;
20
+ handleApiKeyIndex(params: object, methodName1: string, optionName1: string, optionName2: string, defaultValue?: any): any[];
21
+ handleAccountIndex(params: object, methodName1: string, optionName1: string, optionName2: string, defaultValue?: any): Promise<any[]>;
19
22
  createSubAccount(name: string, params?: {}): Promise<any>;
20
23
  createAuth(params?: {}): string;
21
24
  pow(n: string, m: string): string;
25
+ hashMessage(message: string): string;
26
+ signHash(hash: any, privateKey: any): string;
27
+ signL1AndPrepareTxInfo(txInfo: any, message: any, privateKey: any): string;
28
+ handleBuilderFeeApproval(accountIndex: number, apiKeyIndex: number): Promise<boolean>;
29
+ approveBuilderFee(builder: number, takerFeeRate: number, makerFeeRate: number, accountIndex: number, apiKeyIndex: number, params?: object): Promise<any>;
30
+ changeApiKey(params?: object): Promise<any>;
22
31
  setSandboxMode(enable: boolean): void;
23
32
  createOrderRequest(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): any[];
24
33
  fetchNonce(accountIndex: any, apiKeyIndex: any, params?: {}): Promise<number>;
@@ -167,6 +176,7 @@ export default class lighter extends Exchange {
167
176
  * @param {object} [params] extra parameters specific to the exchange API endpoint
168
177
  * @param {string} [params.by] fetch balance by 'index' or 'l1_address', defaults to 'index'
169
178
  * @param {string} [params.value] fetch balance value, account index or l1 address
179
+ * @param {string} [params.type] 'spot', 'swap', default is 'swap'
170
180
  * @returns {object} a [balance structure]{@link https://docs.ccxt.com/?id=balance-structure}
171
181
  */
172
182
  fetchBalance(params?: {}): Promise<Balances>;