ccxt 4.5.55 → 4.5.56

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 (177) hide show
  1. package/README.md +209 -5
  2. package/dist/ccxt.browser.min.js +3 -3
  3. package/dist/cjs/ccxt.js +1 -1
  4. package/dist/cjs/src/aftermath.js +10 -5
  5. package/dist/cjs/src/alpaca.js +2 -2
  6. package/dist/cjs/src/apex.js +25 -16
  7. package/dist/cjs/src/arkham.js +7 -4
  8. package/dist/cjs/src/ascendex.js +6 -3
  9. package/dist/cjs/src/base/Exchange.js +3 -3
  10. package/dist/cjs/src/bigone.js +7 -4
  11. package/dist/cjs/src/binance.js +4 -4
  12. package/dist/cjs/src/bingx.js +4 -4
  13. package/dist/cjs/src/bitflyer.js +2 -1
  14. package/dist/cjs/src/bitget.js +14 -3
  15. package/dist/cjs/src/bitmart.js +5 -4
  16. package/dist/cjs/src/bitmex.js +7 -4
  17. package/dist/cjs/src/bitopro.js +1 -1
  18. package/dist/cjs/src/bitrue.js +2 -1
  19. package/dist/cjs/src/bitso.js +6 -3
  20. package/dist/cjs/src/bitstamp.js +5 -3
  21. package/dist/cjs/src/bittrade.js +2 -1
  22. package/dist/cjs/src/blofin.js +2 -1
  23. package/dist/cjs/src/bybit.js +19 -17
  24. package/dist/cjs/src/bybiteu.js +1 -0
  25. package/dist/cjs/src/coinbaseexchange.js +2 -1
  26. package/dist/cjs/src/coinbaseinternational.js +15 -9
  27. package/dist/cjs/src/coinex.js +5 -3
  28. package/dist/cjs/src/coinsph.js +4 -4
  29. package/dist/cjs/src/cryptocom.js +6 -6
  30. package/dist/cjs/src/deepcoin.js +6 -3
  31. package/dist/cjs/src/delta.js +2 -1
  32. package/dist/cjs/src/deribit.js +4 -2
  33. package/dist/cjs/src/derive.js +5 -3
  34. package/dist/cjs/src/digifinex.js +2 -1
  35. package/dist/cjs/src/exmo.js +12 -39
  36. package/dist/cjs/src/foxbit.js +1 -1
  37. package/dist/cjs/src/gemini.js +4 -2
  38. package/dist/cjs/src/grvt.js +13 -7
  39. package/dist/cjs/src/hashkey.js +4 -4
  40. package/dist/cjs/src/hibachi.js +1 -1
  41. package/dist/cjs/src/hitbtc.js +2 -1
  42. package/dist/cjs/src/htx.js +9 -5
  43. package/dist/cjs/src/hyperliquid.js +19 -13
  44. package/dist/cjs/src/indodax.js +2 -1
  45. package/dist/cjs/src/kraken.js +14 -13
  46. package/dist/cjs/src/krakenfutures.js +2 -1
  47. package/dist/cjs/src/lbank.js +8 -4
  48. package/dist/cjs/src/lighter.js +1 -1
  49. package/dist/cjs/src/luno.js +1 -1
  50. package/dist/cjs/src/mercado.js +2 -1
  51. package/dist/cjs/src/mexc.js +24 -14
  52. package/dist/cjs/src/modetrade.js +1 -1
  53. package/dist/cjs/src/okx.js +6 -3
  54. package/dist/cjs/src/oxfun.js +5 -3
  55. package/dist/cjs/src/p2b.js +8 -4
  56. package/dist/cjs/src/paradex.js +3 -2
  57. package/dist/cjs/src/phemex.js +4 -2
  58. package/dist/cjs/src/poloniex.js +2 -1
  59. package/dist/cjs/src/pro/apex.js +10 -1
  60. package/dist/cjs/src/pro/aster.js +10 -9
  61. package/dist/cjs/src/pro/binance.js +3 -3
  62. package/dist/cjs/src/pro/bingx.js +7 -2
  63. package/dist/cjs/src/pro/bitmart.js +10 -0
  64. package/dist/cjs/src/pro/bitmex.js +1 -1
  65. package/dist/cjs/src/pro/grvt.js +8 -0
  66. package/dist/cjs/src/pro/htx.js +4 -4
  67. package/dist/cjs/src/pro/krakenfutures.js +16 -4
  68. package/dist/cjs/src/pro/modetrade.js +3 -3
  69. package/dist/cjs/src/pro/okx.js +4 -4
  70. package/dist/cjs/src/pro/oxfun.js +4 -4
  71. package/dist/cjs/src/pro/woo.js +4 -4
  72. package/dist/cjs/src/pro/woofipro.js +3 -3
  73. package/dist/cjs/src/pro/xt.js +1 -1
  74. package/dist/cjs/src/toobit.js +1 -1
  75. package/dist/cjs/src/woo.js +1 -1
  76. package/dist/cjs/src/woofipro.js +1 -1
  77. package/dist/cjs/src/xt.js +2 -1
  78. package/dist/cjs/src/yobit.js +4 -2
  79. package/dist/cjs/src/zebpay.js +3 -3
  80. package/js/ccxt.d.ts +1 -1
  81. package/js/ccxt.js +1 -1
  82. package/js/src/abstract/mexc.d.ts +1 -0
  83. package/js/src/aftermath.js +10 -5
  84. package/js/src/alpaca.js +2 -2
  85. package/js/src/apex.d.ts +1 -1
  86. package/js/src/apex.js +25 -16
  87. package/js/src/arkham.js +7 -4
  88. package/js/src/ascendex.js +6 -3
  89. package/js/src/base/Exchange.js +3 -3
  90. package/js/src/bigone.js +7 -4
  91. package/js/src/binance.js +4 -4
  92. package/js/src/bingx.js +4 -4
  93. package/js/src/bitflyer.js +2 -1
  94. package/js/src/bitget.js +14 -3
  95. package/js/src/bitmart.js +5 -4
  96. package/js/src/bitmex.js +7 -4
  97. package/js/src/bitopro.js +1 -1
  98. package/js/src/bitrue.js +2 -1
  99. package/js/src/bitso.js +6 -3
  100. package/js/src/bitstamp.js +5 -3
  101. package/js/src/bittrade.js +2 -1
  102. package/js/src/blofin.js +2 -1
  103. package/js/src/bybit.d.ts +1 -1
  104. package/js/src/bybit.js +19 -17
  105. package/js/src/bybiteu.js +1 -0
  106. package/js/src/coinbaseexchange.js +2 -1
  107. package/js/src/coinbaseinternational.d.ts +1 -1
  108. package/js/src/coinbaseinternational.js +15 -9
  109. package/js/src/coinex.d.ts +1 -1
  110. package/js/src/coinex.js +5 -3
  111. package/js/src/coinsph.js +4 -4
  112. package/js/src/cryptocom.js +6 -6
  113. package/js/src/deepcoin.js +6 -3
  114. package/js/src/delta.js +2 -1
  115. package/js/src/deribit.js +4 -2
  116. package/js/src/derive.js +5 -3
  117. package/js/src/digifinex.js +2 -1
  118. package/js/src/exmo.js +12 -39
  119. package/js/src/foxbit.js +1 -1
  120. package/js/src/gemini.js +4 -2
  121. package/js/src/grvt.d.ts +1 -1
  122. package/js/src/grvt.js +13 -7
  123. package/js/src/hashkey.js +4 -4
  124. package/js/src/hibachi.d.ts +1 -1
  125. package/js/src/hibachi.js +1 -1
  126. package/js/src/hitbtc.js +2 -1
  127. package/js/src/htx.js +9 -5
  128. package/js/src/hyperliquid.d.ts +4 -4
  129. package/js/src/hyperliquid.js +19 -13
  130. package/js/src/indodax.js +2 -1
  131. package/js/src/kraken.js +14 -13
  132. package/js/src/krakenfutures.js +2 -1
  133. package/js/src/lbank.js +8 -4
  134. package/js/src/lighter.d.ts +1 -1
  135. package/js/src/lighter.js +1 -1
  136. package/js/src/luno.js +1 -1
  137. package/js/src/mercado.js +2 -1
  138. package/js/src/mexc.d.ts +2 -2
  139. package/js/src/mexc.js +24 -14
  140. package/js/src/modetrade.js +1 -1
  141. package/js/src/okx.js +6 -3
  142. package/js/src/oxfun.js +5 -3
  143. package/js/src/p2b.js +8 -4
  144. package/js/src/paradex.js +3 -2
  145. package/js/src/phemex.js +4 -2
  146. package/js/src/poloniex.js +2 -1
  147. package/js/src/pro/apex.js +10 -1
  148. package/js/src/pro/aster.js +10 -9
  149. package/js/src/pro/binance.d.ts +1 -1
  150. package/js/src/pro/binance.js +3 -3
  151. package/js/src/pro/bingx.js +7 -2
  152. package/js/src/pro/bitmart.js +10 -0
  153. package/js/src/pro/bitmex.js +1 -1
  154. package/js/src/pro/grvt.js +8 -0
  155. package/js/src/pro/htx.d.ts +4 -4
  156. package/js/src/pro/htx.js +4 -4
  157. package/js/src/pro/krakenfutures.d.ts +4 -4
  158. package/js/src/pro/krakenfutures.js +16 -4
  159. package/js/src/pro/modetrade.d.ts +3 -3
  160. package/js/src/pro/modetrade.js +3 -3
  161. package/js/src/pro/okx.d.ts +4 -4
  162. package/js/src/pro/okx.js +4 -4
  163. package/js/src/pro/oxfun.d.ts +4 -4
  164. package/js/src/pro/oxfun.js +4 -4
  165. package/js/src/pro/woo.d.ts +4 -4
  166. package/js/src/pro/woo.js +4 -4
  167. package/js/src/pro/woofipro.d.ts +3 -3
  168. package/js/src/pro/woofipro.js +3 -3
  169. package/js/src/pro/xt.js +1 -1
  170. package/js/src/toobit.d.ts +1 -1
  171. package/js/src/toobit.js +1 -1
  172. package/js/src/woo.js +1 -1
  173. package/js/src/woofipro.js +1 -1
  174. package/js/src/xt.js +2 -1
  175. package/js/src/yobit.js +4 -2
  176. package/js/src/zebpay.js +3 -3
  177. package/package.json +21 -7
package/js/src/grvt.js CHANGED
@@ -1826,7 +1826,7 @@ export default class grvt extends Exchange {
1826
1826
  }
1827
1827
  async loadAccountInfos() {
1828
1828
  if (this.safeString(this.options, 'userMainAccountId') !== undefined) {
1829
- return;
1829
+ return false;
1830
1830
  }
1831
1831
  const promises = [];
1832
1832
  promises.push(this.privateTradingPostFullV1AggregatedAccountSummary());
@@ -1879,6 +1879,7 @@ export default class grvt extends Exchange {
1879
1879
  const subAccountId = this.safeString(subAccountIds, 0);
1880
1880
  this.options['accountId'] = subAccountId;
1881
1881
  }
1882
+ return true;
1882
1883
  }
1883
1884
  /**
1884
1885
  * @method
@@ -1971,8 +1972,10 @@ export default class grvt extends Exchange {
1971
1972
  }
1972
1973
  params = this.omit(params, ['clientOrderId']);
1973
1974
  const isMarketOrder = (type === 'market');
1975
+ const subAccountId = this.getSubAccountId(params);
1976
+ const isReduceOnly = this.safeBool(params, 'reduceOnly', false);
1974
1977
  const orderRequest = {
1975
- 'sub_account_id': this.getSubAccountId(params),
1978
+ 'sub_account_id': subAccountId,
1976
1979
  'time_in_force': undefined,
1977
1980
  'legs': [orderLeg],
1978
1981
  'signature': this.defaultSignature(),
@@ -1981,7 +1984,7 @@ export default class grvt extends Exchange {
1981
1984
  },
1982
1985
  'is_market': isMarketOrder,
1983
1986
  'post_only': false,
1984
- 'reduce_only': this.safeBool(params, 'reduceOnly', false),
1987
+ 'reduce_only': isReduceOnly,
1985
1988
  // 'order_id': null,
1986
1989
  // 'state': null,
1987
1990
  };
@@ -2614,8 +2617,9 @@ export default class grvt extends Exchange {
2614
2617
  */
2615
2618
  async fetchOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
2616
2619
  await this.loadMarketsAndSignIn();
2620
+ const subAccountId = this.getSubAccountId(params);
2617
2621
  let request = {
2618
- 'sub_account_id': this.getSubAccountId(params),
2622
+ 'sub_account_id': subAccountId,
2619
2623
  };
2620
2624
  let market = undefined;
2621
2625
  if (symbol !== undefined) {
@@ -2791,8 +2795,9 @@ export default class grvt extends Exchange {
2791
2795
  */
2792
2796
  async fetchOrder(id, symbol = undefined, params = {}) {
2793
2797
  await this.loadMarketsAndSignIn();
2798
+ const subAccountId = this.getSubAccountId(params);
2794
2799
  const request = {
2795
- 'sub_account_id': this.getSubAccountId(params),
2800
+ 'sub_account_id': subAccountId,
2796
2801
  };
2797
2802
  const clientOrderId = this.safeString2(params, 'clientOrderId', 'client_order_id');
2798
2803
  if (clientOrderId !== undefined) {
@@ -3055,7 +3060,7 @@ export default class grvt extends Exchange {
3055
3060
  // }
3056
3061
  //
3057
3062
  const result = this.safeDict(response, 'result', {});
3058
- return this.parseOrders([result], undefined);
3063
+ return this.parseOrders([result]);
3059
3064
  }
3060
3065
  /**
3061
3066
  * @method
@@ -3070,8 +3075,9 @@ export default class grvt extends Exchange {
3070
3075
  */
3071
3076
  async cancelOrder(id, symbol = undefined, params = {}) {
3072
3077
  await this.loadMarketsAndSignIn();
3078
+ const subAccoubntId = this.getSubAccountId(params);
3073
3079
  const request = {
3074
- 'sub_account_id': this.getSubAccountId(params),
3080
+ 'sub_account_id': subAccoubntId,
3075
3081
  };
3076
3082
  const clientOrderId = this.safeString2(params, 'clientOrderId', 'client_order_id');
3077
3083
  if (clientOrderId !== undefined) {
package/js/src/hashkey.js CHANGED
@@ -3043,7 +3043,7 @@ export default class hashkey extends Exchange {
3043
3043
  [marketType, params] = this.handleMarketTypeAndParams(methodName, market, params, marketType);
3044
3044
  let response = undefined;
3045
3045
  if (marketType === 'spot') {
3046
- response = await this.privateDeleteApiV1SpotCancelOrderByIds(this.extend(request));
3046
+ response = await this.privateDeleteApiV1SpotCancelOrderByIds(request);
3047
3047
  //
3048
3048
  // {
3049
3049
  // "code": "0000",
@@ -3052,7 +3052,7 @@ export default class hashkey extends Exchange {
3052
3052
  //
3053
3053
  }
3054
3054
  else if (marketType === 'swap') {
3055
- response = this.privateDeleteApiV1FuturesCancelOrderByIds(this.extend(request));
3055
+ response = await this.privateDeleteApiV1FuturesCancelOrderByIds(request);
3056
3056
  }
3057
3057
  else {
3058
3058
  throw new NotSupported(this.id + ' ' + methodName + '() is not supported for ' + marketType + ' type of markets');
@@ -4333,8 +4333,8 @@ export default class hashkey extends Exchange {
4333
4333
  return undefined;
4334
4334
  }
4335
4335
  let errorInArray = false;
4336
- let responseCodeString = this.safeString(response, 'code', undefined);
4337
- const responseCodeInteger = this.safeInteger(response, 'code', undefined); // some codes in response are returned as '0000' others as 0
4336
+ let responseCodeString = this.safeString(response, 'code');
4337
+ const responseCodeInteger = this.safeInteger(response, 'code'); // some codes in response are returned as '0000' others as 0
4338
4338
  if (responseCodeInteger === 0) {
4339
4339
  const result = this.safeList(response, 'result', []); // for batch methods
4340
4340
  for (let i = 0; i < result.length; i++) {
@@ -69,7 +69,7 @@ export default class hibachi extends Exchange {
69
69
  * @method
70
70
  * @name hibachi#fetchTradingFees
71
71
  * @description fetch the trading fee
72
- * @param params extra parameters
72
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
73
73
  * @returns {object} a map of market symbols to [fee structures]{@link https://docs.ccxt.com/?id=fee-structure}
74
74
  */
75
75
  fetchTradingFees(params?: {}): Promise<TradingFees>;
package/js/src/hibachi.js CHANGED
@@ -745,7 +745,7 @@ export default class hibachi extends Exchange {
745
745
  * @method
746
746
  * @name hibachi#fetchTradingFees
747
747
  * @description fetch the trading fee
748
- * @param params extra parameters
748
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
749
749
  * @returns {object} a map of market symbols to [fee structures]{@link https://docs.ccxt.com/?id=fee-structure}
750
750
  */
751
751
  async fetchTradingFees(params = {}) {
package/js/src/hitbtc.js CHANGED
@@ -3440,8 +3440,9 @@ export default class hitbtc extends Exchange {
3440
3440
  // "positions": null
3441
3441
  // }
3442
3442
  //
3443
+ const parsedAmount = this.parseNumber(amount);
3443
3444
  return this.extend(this.parseMarginModification(response, market), {
3444
- 'amount': this.parseNumber(amount),
3445
+ 'amount': parsedAmount,
3445
3446
  'type': type,
3446
3447
  });
3447
3448
  }
package/js/src/htx.js CHANGED
@@ -3414,7 +3414,7 @@ export default class htx extends Exchange {
3414
3414
  for (let i = 0; i < accounts.length; i++) {
3415
3415
  const account = accounts[i];
3416
3416
  const info = this.safeValue(account, 'info');
3417
- const subtype = this.safeString(info, 'subtype', undefined);
3417
+ const subtype = this.safeString(info, 'subtype');
3418
3418
  const typeFromAccount = this.safeString(account, 'type');
3419
3419
  if (type === 'margin') {
3420
3420
  if (subtype === marketId) {
@@ -3847,7 +3847,8 @@ export default class htx extends Exchange {
3847
3847
  // "ts": 1770293281344
3848
3848
  // }
3849
3849
  //
3850
- let result = { 'info': response };
3850
+ const finalResponse = response;
3851
+ let result = { 'info': finalResponse };
3851
3852
  const data = this.safeValue(response, 'data');
3852
3853
  if (isMultiAssetMode) {
3853
3854
  const details = this.safeList(data, 'details', []);
@@ -7582,7 +7583,8 @@ export default class htx extends Exchange {
7582
7583
  const sortedRequest = this.keysort(request);
7583
7584
  let auth = this.urlencode(sortedRequest, true); // true is a go only requirment
7584
7585
  // unfortunately, PHP demands double quotes for the escaped newline symbol
7585
- const payload = [method, this.hostname, url, auth].join("\n"); // eslint-disable-line quotes
7586
+ const content = [method, this.hostname, url, auth];
7587
+ const payload = content.join("\n"); // eslint-disable-line quotes
7586
7588
  const signature = this.hmac(this.encode(payload), this.encode(this.secret), sha256, 'base64');
7587
7589
  auth += '&' + this.urlencode({ 'Signature': signature });
7588
7590
  url += '?' + auth;
@@ -7664,7 +7666,8 @@ export default class htx extends Exchange {
7664
7666
  }
7665
7667
  let auth = this.urlencode(request, true).replace('%2c', '%2C'); // in c# it manually needs to be uppercased
7666
7668
  // unfortunately, PHP demands double quotes for the escaped newline symbol
7667
- const payload = [method, hostname, url, auth].join("\n"); // eslint-disable-line quotes
7669
+ const content2 = [method, hostname, url, auth];
7670
+ const payload = content2.join("\n"); // eslint-disable-line quotes
7668
7671
  const signature = this.hmac(this.encode(payload), this.encode(this.secret), sha256, 'base64');
7669
7672
  auth += '&' + this.urlencode({ 'Signature': signature });
7670
7673
  url += '?' + auth;
@@ -7683,8 +7686,9 @@ export default class htx extends Exchange {
7683
7686
  };
7684
7687
  }
7685
7688
  }
7689
+ const finalHostname = hostname; // java req
7686
7690
  url = this.implodeParams(this.urls['api'][type], {
7687
- 'hostname': hostname,
7691
+ 'hostname': finalHostname,
7688
7692
  }) + url;
7689
7693
  }
7690
7694
  return { 'url': url, 'method': method, 'body': body, 'headers': headers };
@@ -237,8 +237,8 @@ export default class hyperliquid extends Exchange {
237
237
  * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#query-a-users-abstraction-state
238
238
  * @description returns enableUnifiedMargin so the user can check if unified account is enabled
239
239
  * @param {string} method the method for which we want to check if unified margin is enabled, this is used to check options for specific methods (e.g. fetchBalance can have a specific option to enable unified margin)
240
- * @param address
241
- * @param shouldRefresh
240
+ * @param {string} [address] the wallet address to query; defaults to the configured walletAddress
241
+ * @param {boolean} [shouldRefresh] force a fresh request instead of returning the cached value
242
242
  * @param {object} [params] extra parameters specific to the exchange API endpoint
243
243
  * @returns {bool} enableUnifiedMargin
244
244
  */
@@ -258,8 +258,8 @@ export default class hyperliquid extends Exchange {
258
258
  * @method
259
259
  * @name hyperliquid#enableUserDexAbstraction
260
260
  * @description If set, actions on HIP-3 perps will automatically transfer collateral from validator-operated USDC perps balance for HIP-3 DEXs where USDC is the collateral token, and spot otherwise
261
- * @param enabled
262
- * @param params
261
+ * @param {boolean} enabled whether to enable user dex abstraction
262
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
263
263
  * @param {string} [params.type] 'userDexAbstraction' or 'agentEnableDexAbstraction' default is 'userDexAbstraction'
264
264
  * @returns dictionary response from the exchange
265
265
  */
@@ -1836,8 +1836,8 @@ export default class hyperliquid extends Exchange {
1836
1836
  * @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#query-a-users-abstraction-state
1837
1837
  * @description returns enableUnifiedMargin so the user can check if unified account is enabled
1838
1838
  * @param {string} method the method for which we want to check if unified margin is enabled, this is used to check options for specific methods (e.g. fetchBalance can have a specific option to enable unified margin)
1839
- * @param address
1840
- * @param shouldRefresh
1839
+ * @param {string} [address] the wallet address to query; defaults to the configured walletAddress
1840
+ * @param {boolean} [shouldRefresh] force a fresh request instead of returning the cached value
1841
1841
  * @param {object} [params] extra parameters specific to the exchange API endpoint
1842
1842
  * @returns {bool} enableUnifiedMargin
1843
1843
  */
@@ -1931,8 +1931,8 @@ export default class hyperliquid extends Exchange {
1931
1931
  * @method
1932
1932
  * @name hyperliquid#enableUserDexAbstraction
1933
1933
  * @description If set, actions on HIP-3 perps will automatically transfer collateral from validator-operated USDC perps balance for HIP-3 DEXs where USDC is the collateral token, and spot otherwise
1934
- * @param enabled
1935
- * @param params
1934
+ * @param {boolean} enabled whether to enable user dex abstraction
1935
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
1936
1936
  * @param {string} [params.type] 'userDexAbstraction' or 'agentEnableDexAbstraction' default is 'userDexAbstraction'
1937
1937
  * @returns dictionary response from the exchange
1938
1938
  */
@@ -2144,7 +2144,7 @@ export default class hyperliquid extends Exchange {
2144
2144
  ordersToBeParsed.push(order);
2145
2145
  }
2146
2146
  }
2147
- return this.parseOrders(ordersToBeParsed, undefined);
2147
+ return this.parseOrders(ordersToBeParsed);
2148
2148
  }
2149
2149
  createOrderRequest(symbol, type, side, amount, price = undefined, params = {}) {
2150
2150
  const market = this.market(symbol);
@@ -2188,10 +2188,11 @@ export default class hyperliquid extends Exchange {
2188
2188
  else {
2189
2189
  triggerPrice = this.priceToPrecision(symbol, stopLossPrice);
2190
2190
  }
2191
+ const tpSlType = (isTp) ? 'tp' : 'sl';
2191
2192
  orderType['trigger'] = {
2192
2193
  'isMarket': isMarket,
2193
2194
  'triggerPx': triggerPrice,
2194
- 'tpsl': (isTp) ? 'tp' : 'sl',
2195
+ 'tpsl': tpSlType,
2195
2196
  };
2196
2197
  }
2197
2198
  else {
@@ -2512,9 +2513,10 @@ export default class hyperliquid extends Exchange {
2512
2513
  else {
2513
2514
  cancelAction['type'] = 'cancel';
2514
2515
  for (let i = 0; i < ids.length; i++) {
2516
+ const o = this.parseToNumeric(ids[i]);
2515
2517
  cancelReq.push({
2516
2518
  'a': baseId,
2517
- 'o': this.parseToNumeric(ids[i]),
2519
+ 'o': o,
2518
2520
  });
2519
2521
  }
2520
2522
  }
@@ -2722,10 +2724,11 @@ export default class hyperliquid extends Exchange {
2722
2724
  else {
2723
2725
  triggerPrice = this.priceToPrecision(symbol, stopLossPrice);
2724
2726
  }
2727
+ const tpSlType = (isTp) ? 'tp' : 'sl';
2725
2728
  orderType['trigger'] = {
2726
2729
  'isMarket': isMarket,
2727
2730
  'triggerPx': triggerPrice,
2728
- 'tpsl': (isTp) ? 'tp' : 'sl',
2731
+ 'tpsl': tpSlType,
2729
2732
  };
2730
2733
  }
2731
2734
  else {
@@ -3316,8 +3319,9 @@ export default class hyperliquid extends Exchange {
3316
3319
  //
3317
3320
  const error = this.safeString(order, 'error');
3318
3321
  if (error !== undefined) {
3322
+ const finalOrder = order; // java req
3319
3323
  return this.safeOrder({
3320
- 'info': order,
3324
+ 'info': finalOrder,
3321
3325
  'status': 'rejected',
3322
3326
  });
3323
3327
  }
@@ -3352,6 +3356,7 @@ export default class hyperliquid extends Exchange {
3352
3356
  if (tif !== undefined) {
3353
3357
  postOnly = (tif === 'ALO');
3354
3358
  }
3359
+ const triggerPx = this.safeBool(entry, 'isTrigger') ? this.safeNumber(entry, 'triggerPx') : undefined;
3355
3360
  return this.safeOrder({
3356
3361
  'info': order,
3357
3362
  'id': this.safeString(entry, 'oid'),
@@ -3367,7 +3372,7 @@ export default class hyperliquid extends Exchange {
3367
3372
  'reduceOnly': this.safeBool(entry, 'reduceOnly'),
3368
3373
  'side': side,
3369
3374
  'price': this.safeString(entry, 'limitPx'),
3370
- 'triggerPrice': this.safeBool(entry, 'isTrigger') ? this.safeNumber(entry, 'triggerPx') : undefined,
3375
+ 'triggerPrice': triggerPx,
3371
3376
  'amount': totalAmount,
3372
3377
  'cost': undefined,
3373
3378
  'average': this.safeString(entry, 'avgPx'),
@@ -3639,7 +3644,7 @@ export default class hyperliquid extends Exchange {
3639
3644
  const data = this.safeList(response, 'assetPositions', []);
3640
3645
  const result = [];
3641
3646
  for (let i = 0; i < data.length; i++) {
3642
- result.push(this.parsePosition(data[i], undefined));
3647
+ result.push(this.parsePosition(data[i]));
3643
3648
  }
3644
3649
  return this.filterByArrayPositions(result, 'symbol', symbols, false);
3645
3650
  }
@@ -3953,10 +3958,11 @@ export default class hyperliquid extends Exchange {
3953
3958
  vaultAddress = this.formatVaultAddress(vaultAddress);
3954
3959
  strAmount = strAmount + ' subaccount:' + vaultAddress;
3955
3960
  }
3961
+ const strAmountFinal = strAmount; // java req
3956
3962
  const toPerp = (toAccount === 'perp') || (toAccount === 'swap');
3957
3963
  const transferPayload = {
3958
3964
  'hyperliquidChain': isSandboxMode ? 'Testnet' : 'Mainnet',
3959
- 'amount': strAmount,
3965
+ 'amount': strAmountFinal,
3960
3966
  'toPerp': toPerp,
3961
3967
  'nonce': nonce,
3962
3968
  };
@@ -3966,7 +3972,7 @@ export default class hyperliquid extends Exchange {
3966
3972
  'hyperliquidChain': transferPayload['hyperliquidChain'],
3967
3973
  'signatureChainId': '0x66eee',
3968
3974
  'type': 'usdClassTransfer',
3969
- 'amount': strAmount,
3975
+ 'amount': strAmountFinal,
3970
3976
  'toPerp': toPerp,
3971
3977
  'nonce': nonce,
3972
3978
  },
package/js/src/indodax.js CHANGED
@@ -1386,10 +1386,11 @@ export default class indodax extends Exchange {
1386
1386
  network = this.networkIdToCode(networkId).toUpperCase();
1387
1387
  }
1388
1388
  }
1389
+ const finalNetwork = network; // java req
1389
1390
  result[code] = {
1390
1391
  'info': {},
1391
1392
  'currency': code,
1392
- 'network': network,
1393
+ 'network': finalNetwork,
1393
1394
  'address': address,
1394
1395
  'tag': undefined,
1395
1396
  };
package/js/src/kraken.js CHANGED
@@ -1728,10 +1728,11 @@ export default class kraken extends Exchange {
1728
1728
  const amount = this.safeValue(rawOrder, 'amount');
1729
1729
  const price = this.safeValue(rawOrder, 'price');
1730
1730
  const orderParams = this.safeDict(rawOrder, 'params', {});
1731
+ const parsedAmount = this.amountToPrecision(market['symbol'], amount);
1731
1732
  const req = {
1732
1733
  'type': side,
1733
1734
  'ordertype': type,
1734
- 'volume': this.amountToPrecision(market['symbol'], amount),
1735
+ 'volume': parsedAmount,
1735
1736
  };
1736
1737
  const orderRequest = this.orderRequest('createOrders', marketId, type, req, amount, price, orderParams);
1737
1738
  ordersRequests.push(orderRequest[0]);
@@ -2069,12 +2070,12 @@ export default class kraken extends Exchange {
2069
2070
  stopLossPrice = triggerPrice;
2070
2071
  }
2071
2072
  }
2072
- let finalType = this.parseOrderType(rawType);
2073
+ let typeParsed = this.parseOrderType(rawType);
2073
2074
  // unlike from endpoints which provide eg: "take-profit-limit"
2074
2075
  // for "space-delimited" orders we dont have market/limit suffixes, their format is
2075
2076
  // eg: `stop loss > limit 123`, so we need to parse them manually
2076
- if (this.inArray(finalType, ['stop loss', 'take profit'])) {
2077
- finalType = (price === undefined) ? 'market' : 'limit';
2077
+ if (this.inArray(typeParsed, ['stop loss', 'take profit'])) {
2078
+ typeParsed = (price === undefined) ? 'market' : 'limit';
2078
2079
  }
2079
2080
  const amendId = this.safeString(order, 'amend_id');
2080
2081
  if (amendId !== undefined) {
@@ -2089,7 +2090,7 @@ export default class kraken extends Exchange {
2089
2090
  'lastTradeTimestamp': undefined,
2090
2091
  'status': status,
2091
2092
  'symbol': symbol,
2092
- 'type': finalType,
2093
+ 'type': typeParsed,
2093
2094
  'timeInForce': undefined,
2094
2095
  'postOnly': isPostOnly,
2095
2096
  'side': side,
@@ -3491,16 +3492,16 @@ export default class kraken extends Exchange {
3491
3492
  async transfer(code, amount, fromAccount, toAccount, params = {}) {
3492
3493
  await this.loadMarkets();
3493
3494
  const currency = this.currency(code);
3494
- fromAccount = this.parseAccountType(fromAccount);
3495
- toAccount = this.parseAccountType(toAccount);
3495
+ const fromAccountParsed = this.parseAccountType(fromAccount);
3496
+ const toAccountParsed = this.parseAccountType(toAccount);
3496
3497
  const request = {
3497
3498
  'amount': this.currencyToPrecision(code, amount),
3498
- 'from': fromAccount,
3499
- 'to': toAccount,
3499
+ 'from': fromAccountParsed,
3500
+ 'to': toAccountParsed,
3500
3501
  'asset': currency['id'],
3501
3502
  };
3502
- if (fromAccount !== 'Spot Wallet') {
3503
- throw new BadRequest(this.id + ' transfer cannot transfer from ' + fromAccount + ' to ' + toAccount + '. Use krakenfutures instead to transfer from the futures account.');
3503
+ if (fromAccountParsed !== 'Spot Wallet') {
3504
+ throw new BadRequest(this.id + ' transfer cannot transfer from ' + fromAccountParsed + ' to ' + toAccountParsed + '. Use krakenfutures instead to transfer from the futures account.');
3504
3505
  }
3505
3506
  const response = await this.privatePostWalletTransfer(this.extend(request, params));
3506
3507
  //
@@ -3515,8 +3516,8 @@ export default class kraken extends Exchange {
3515
3516
  const transfer = this.parseTransfer(response, currency);
3516
3517
  return this.extend(transfer, {
3517
3518
  'amount': amount,
3518
- 'fromAccount': fromAccount,
3519
- 'toAccount': toAccount,
3519
+ 'fromAccount': fromAccountParsed,
3520
+ 'toAccount': toAccountParsed,
3520
3521
  });
3521
3522
  }
3522
3523
  parseTransfer(transfer, currency = undefined) {
@@ -2045,6 +2045,7 @@ export default class krakenfutures extends Exchange {
2045
2045
  const innerStatus = this.safeString(order, 'status');
2046
2046
  const fetchOrderPriceTriggerOptions = this.safeDict(orderDictFromFetchOrder, 'priceTriggerOptions', {});
2047
2047
  const fetchOrderTriggerPrice = this.safeString(fetchOrderPriceTriggerOptions, 'triggerPrice');
2048
+ const unifiedSymbol = this.safeSymbol(this.safeString(orderDictFromFetchOrder, 'symbol'), market);
2048
2049
  return this.safeOrder({
2049
2050
  'info': order,
2050
2051
  'id': this.safeString(orderDictFromFetchOrder, 'orderId'),
@@ -2053,7 +2054,7 @@ export default class krakenfutures extends Exchange {
2053
2054
  'datetime': datetime,
2054
2055
  'lastTradeTimestamp': undefined,
2055
2056
  'lastUpdateTimestamp': this.parse8601(this.safeString(orderDictFromFetchOrder, 'lastUpdateTimestamp')),
2056
- 'symbol': this.safeSymbol(this.safeString(orderDictFromFetchOrder, 'symbol'), market),
2057
+ 'symbol': unifiedSymbol,
2057
2058
  'type': undefined,
2058
2059
  'timeInForce': undefined,
2059
2060
  'postOnly': undefined,
package/js/src/lbank.js CHANGED
@@ -1055,9 +1055,10 @@ export default class lbank extends Exchange {
1055
1055
  let fee = undefined;
1056
1056
  const feeCost = this.safeString(trade, 'tradeFee');
1057
1057
  if (feeCost !== undefined) {
1058
+ const feeCurr = (side === 'buy') ? market['base'] : market['quote'];
1058
1059
  fee = {
1059
1060
  'cost': feeCost,
1060
- 'currency': (side === 'buy') ? market['base'] : market['quote'],
1061
+ 'currency': feeCurr,
1061
1062
  'rate': this.safeString(trade, 'tradeFeeRate'),
1062
1063
  };
1063
1064
  }
@@ -1180,11 +1181,13 @@ export default class lbank extends Exchange {
1180
1181
  const duration = this.parseTimeframe(timeframe);
1181
1182
  since = this.milliseconds() - (duration * 1000 * limit);
1182
1183
  }
1184
+ const parsedSince = this.parseToInt(since / 1000);
1185
+ const parsedLimit = Math.min(limit + 1, 2000); // max 2000;
1183
1186
  const request = {
1184
1187
  'symbol': market['id'],
1185
1188
  'type': this.safeString(this.timeframes, timeframe, timeframe),
1186
- 'time': this.parseToInt(since / 1000),
1187
- 'size': Math.min(limit + 1, 2000), // max 2000
1189
+ 'time': parsedSince,
1190
+ 'size': parsedLimit,
1188
1191
  };
1189
1192
  const response = await this.spotPublicGetKline(this.extend(request, params));
1190
1193
  const ohlcvs = this.safeList(response, 'data', []);
@@ -2973,9 +2976,10 @@ export default class lbank extends Exchange {
2973
2976
  else {
2974
2977
  signatureMethod = 'HmacSHA256';
2975
2978
  }
2979
+ const finalSig = signatureMethod; // java req
2976
2980
  const auth = this.rawencode(this.keysort(this.extend({
2977
2981
  'echostr': echostr,
2978
- 'signature_method': signatureMethod,
2982
+ 'signature_method': finalSig,
2979
2983
  'timestamp': timestamp,
2980
2984
  }, query)));
2981
2985
  const encoded = this.encode(auth);
@@ -13,7 +13,7 @@ export default class lighter extends Exchange {
13
13
  * @method
14
14
  * @name lighter#preLoadLighterLibrary
15
15
  * @description if the required credentials are available in options, it will pre-load the lighter Signer to avoid delaying sensitive calls like createOrder the first time they're executed
16
- * @param params
16
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
17
17
  * @returns {boolean} true if the signer was loaded, false otherwise
18
18
  */
19
19
  preLoadLighterLibrary(params?: {}): Promise<boolean>;
package/js/src/lighter.js CHANGED
@@ -438,7 +438,7 @@ export default class lighter extends Exchange {
438
438
  * @method
439
439
  * @name lighter#preLoadLighterLibrary
440
440
  * @description if the required credentials are available in options, it will pre-load the lighter Signer to avoid delaying sensitive calls like createOrder the first time they're executed
441
- * @param params
441
+ * @param {object} [params] extra parameters specific to the exchange API endpoint
442
442
  * @returns {boolean} true if the signer was loaded, false otherwise
443
443
  */
444
444
  async preLoadLighterLibrary(params = {}) {
package/js/src/luno.js CHANGED
@@ -1271,7 +1271,7 @@ export default class luno extends Exchange {
1271
1271
  const firstWord = this.safeString(words, 0);
1272
1272
  const thirdWord = this.safeString(words, 2);
1273
1273
  const fourthWord = this.safeString(words, 3);
1274
- let type = this.safeString(types, firstWord, undefined);
1274
+ let type = this.safeString(types, firstWord);
1275
1275
  if ((type === undefined) && (thirdWord === 'fee')) {
1276
1276
  type = 'fee';
1277
1277
  }
package/js/src/mercado.js CHANGED
@@ -680,6 +680,7 @@ export default class mercado extends Exchange {
680
680
  const filled = this.safeString(order, 'executed_quantity');
681
681
  const lastTradeTimestamp = this.safeTimestamp(order, 'updated_timestamp');
682
682
  const rawTrades = this.safeValue(order, 'operations', []);
683
+ const symbol = market['symbol'];
683
684
  return this.safeOrder({
684
685
  'info': order,
685
686
  'id': id,
@@ -687,7 +688,7 @@ export default class mercado extends Exchange {
687
688
  'timestamp': timestamp,
688
689
  'datetime': this.iso8601(timestamp),
689
690
  'lastTradeTimestamp': lastTradeTimestamp,
690
- 'symbol': market['symbol'],
691
+ 'symbol': symbol,
691
692
  'type': 'limit',
692
693
  'timeInForce': undefined,
693
694
  'postOnly': undefined,
package/js/src/mexc.d.ts CHANGED
@@ -626,8 +626,8 @@ export default class mexc extends Exchange {
626
626
  * @description fetch a history of internal transfers made on an account
627
627
  * @see https://mexcdevelop.github.io/apidocs/spot_v2_en/#get-internal-assets-transfer-records
628
628
  * @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-the-user-39-s-asset-transfer-records
629
- * @see https://www.mexc.com/api-docs/spot-v3/wallet-endpoints#query-user-universal-transfer-history * @param {string} code unified currency code of the currency transferred
630
- * @param code
629
+ * @see https://www.mexc.com/api-docs/spot-v3/wallet-endpoints#query-user-universal-transfer-history
630
+ * @param {string} [code] unified currency code of the currency transferred
631
631
  * @param {int} [since] the earliest time in ms to fetch transfers for
632
632
  * @param {int} [limit] the maximum number of transfers structures to retrieve
633
633
  * @param {object} [params] extra parameters specific to the exchange API endpoint