ccxt 4.3.45 → 4.3.47

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 (49) hide show
  1. package/README.md +127 -127
  2. package/dist/ccxt.browser.min.js +3 -3
  3. package/dist/cjs/ccxt.js +1 -1
  4. package/dist/cjs/src/base/Exchange.js +1 -0
  5. package/dist/cjs/src/base/functions/number.js +2 -2
  6. package/dist/cjs/src/binance.js +2 -0
  7. package/dist/cjs/src/bingx.js +25 -17
  8. package/dist/cjs/src/bitget.js +1 -1
  9. package/dist/cjs/src/bitmart.js +6 -1
  10. package/dist/cjs/src/bitteam.js +5 -7
  11. package/dist/cjs/src/coinmetro.js +8 -17
  12. package/dist/cjs/src/hyperliquid.js +56 -21
  13. package/dist/cjs/src/idex.js +1 -0
  14. package/dist/cjs/src/mexc.js +8 -6
  15. package/dist/cjs/src/okx.js +1 -0
  16. package/dist/cjs/src/oxfun.js +2 -2
  17. package/dist/cjs/src/pro/binanceus.js +0 -8
  18. package/dist/cjs/src/pro/coinex.js +3 -2
  19. package/dist/cjs/src/tokocrypto.js +8 -10
  20. package/dist/cjs/src/wavesexchange.js +1 -0
  21. package/dist/cjs/src/woofipro.js +1 -0
  22. package/js/ccxt.d.ts +1 -1
  23. package/js/ccxt.js +1 -1
  24. package/js/src/abstract/binance.d.ts +2 -0
  25. package/js/src/abstract/binancecoinm.d.ts +2 -0
  26. package/js/src/abstract/binanceus.d.ts +2 -0
  27. package/js/src/abstract/binanceusdm.d.ts +2 -0
  28. package/js/src/abstract/mexc.d.ts +2 -0
  29. package/js/src/base/Exchange.d.ts +1 -0
  30. package/js/src/base/Exchange.js +1 -0
  31. package/js/src/base/functions/number.js +2 -2
  32. package/js/src/binance.js +2 -0
  33. package/js/src/bingx.js +26 -18
  34. package/js/src/bitget.js +1 -1
  35. package/js/src/bitmart.js +6 -1
  36. package/js/src/bitteam.js +6 -8
  37. package/js/src/coinmetro.js +9 -18
  38. package/js/src/hyperliquid.d.ts +4 -3
  39. package/js/src/hyperliquid.js +56 -21
  40. package/js/src/idex.js +1 -0
  41. package/js/src/mexc.js +8 -6
  42. package/js/src/okx.js +1 -0
  43. package/js/src/oxfun.js +2 -2
  44. package/js/src/pro/binanceus.js +0 -8
  45. package/js/src/pro/coinex.js +3 -2
  46. package/js/src/tokocrypto.js +9 -11
  47. package/js/src/wavesexchange.js +1 -0
  48. package/js/src/woofipro.js +1 -0
  49. package/package.json +1 -1
@@ -615,6 +615,8 @@ interface Exchange {
615
615
  privateGetAccountCommission(params?: {}): Promise<implicitReturnType>;
616
616
  privatePostOrderOco(params?: {}): Promise<implicitReturnType>;
617
617
  privatePostOrderListOco(params?: {}): Promise<implicitReturnType>;
618
+ privatePostOrderListOto(params?: {}): Promise<implicitReturnType>;
619
+ privatePostOrderListOtoco(params?: {}): Promise<implicitReturnType>;
618
620
  privatePostSorOrder(params?: {}): Promise<implicitReturnType>;
619
621
  privatePostSorOrderTest(params?: {}): Promise<implicitReturnType>;
620
622
  privatePostOrder(params?: {}): Promise<implicitReturnType>;
@@ -615,6 +615,8 @@ interface binance {
615
615
  privateGetAccountCommission(params?: {}): Promise<implicitReturnType>;
616
616
  privatePostOrderOco(params?: {}): Promise<implicitReturnType>;
617
617
  privatePostOrderListOco(params?: {}): Promise<implicitReturnType>;
618
+ privatePostOrderListOto(params?: {}): Promise<implicitReturnType>;
619
+ privatePostOrderListOtoco(params?: {}): Promise<implicitReturnType>;
618
620
  privatePostSorOrder(params?: {}): Promise<implicitReturnType>;
619
621
  privatePostSorOrderTest(params?: {}): Promise<implicitReturnType>;
620
622
  privatePostOrder(params?: {}): Promise<implicitReturnType>;
@@ -667,6 +667,8 @@ interface binance {
667
667
  privateGetAccountCommission(params?: {}): Promise<implicitReturnType>;
668
668
  privatePostOrderOco(params?: {}): Promise<implicitReturnType>;
669
669
  privatePostOrderListOco(params?: {}): Promise<implicitReturnType>;
670
+ privatePostOrderListOto(params?: {}): Promise<implicitReturnType>;
671
+ privatePostOrderListOtoco(params?: {}): Promise<implicitReturnType>;
670
672
  privatePostSorOrder(params?: {}): Promise<implicitReturnType>;
671
673
  privatePostSorOrderTest(params?: {}): Promise<implicitReturnType>;
672
674
  privatePostOrder(params?: {}): Promise<implicitReturnType>;
@@ -615,6 +615,8 @@ interface binance {
615
615
  privateGetAccountCommission(params?: {}): Promise<implicitReturnType>;
616
616
  privatePostOrderOco(params?: {}): Promise<implicitReturnType>;
617
617
  privatePostOrderListOco(params?: {}): Promise<implicitReturnType>;
618
+ privatePostOrderListOto(params?: {}): Promise<implicitReturnType>;
619
+ privatePostOrderListOtoco(params?: {}): Promise<implicitReturnType>;
618
620
  privatePostSorOrder(params?: {}): Promise<implicitReturnType>;
619
621
  privatePostSorOrderTest(params?: {}): Promise<implicitReturnType>;
620
622
  privatePostOrder(params?: {}): Promise<implicitReturnType>;
@@ -63,6 +63,7 @@ interface Exchange {
63
63
  spotPrivatePostSubAccountMargin(params?: {}): Promise<implicitReturnType>;
64
64
  spotPrivatePostBatchOrders(params?: {}): Promise<implicitReturnType>;
65
65
  spotPrivatePostCapitalWithdrawApply(params?: {}): Promise<implicitReturnType>;
66
+ spotPrivatePostCapitalWithdraw(params?: {}): Promise<implicitReturnType>;
66
67
  spotPrivatePostCapitalTransfer(params?: {}): Promise<implicitReturnType>;
67
68
  spotPrivatePostCapitalTransferInternal(params?: {}): Promise<implicitReturnType>;
68
69
  spotPrivatePostCapitalDepositAddress(params?: {}): Promise<implicitReturnType>;
@@ -77,6 +78,7 @@ interface Exchange {
77
78
  spotPrivateDeleteMarginOrder(params?: {}): Promise<implicitReturnType>;
78
79
  spotPrivateDeleteMarginOpenOrders(params?: {}): Promise<implicitReturnType>;
79
80
  spotPrivateDeleteUserDataStream(params?: {}): Promise<implicitReturnType>;
81
+ spotPrivateDeleteCapitalWithdraw(params?: {}): Promise<implicitReturnType>;
80
82
  contractPublicGetPing(params?: {}): Promise<implicitReturnType>;
81
83
  contractPublicGetDetail(params?: {}): Promise<implicitReturnType>;
82
84
  contractPublicGetSupportCurrencies(params?: {}): Promise<implicitReturnType>;
@@ -291,6 +291,7 @@ export default class Exchange {
291
291
  certified: boolean;
292
292
  pro: boolean;
293
293
  alias: boolean;
294
+ dex: boolean;
294
295
  has: {
295
296
  publicAPI: boolean;
296
297
  privateAPI: boolean;
@@ -353,6 +353,7 @@ export default class Exchange {
353
353
  'certified': false,
354
354
  'pro': false,
355
355
  'alias': false,
356
+ 'dex': false,
356
357
  'has': {
357
358
  'publicAPI': true,
358
359
  'privateAPI': true,
@@ -84,8 +84,8 @@ const truncate_to_string = (num, precision = 0) => {
84
84
  const truncate = (num, precision = 0) => parseFloat(truncate_to_string(num, precision));
85
85
  function precisionFromString(str) {
86
86
  // support string formats like '1e-4'
87
- if (str.indexOf('e') > -1) {
88
- const numStr = str.replace(/\de/, '');
87
+ if (str.indexOf('e') > -1 || str.indexOf('E') > -1) {
88
+ const numStr = str.replace(/\d\.?\d*[eE]/, '');
89
89
  return parseInt(numStr) * -1;
90
90
  }
91
91
  // support integer formats (without dot) like '1', '10' etc [Note: bug in decimalToPrecision, so this should not be used atm]
package/js/src/binance.js CHANGED
@@ -990,6 +990,8 @@ export default class binance extends Exchange {
990
990
  'post': {
991
991
  'order/oco': 0.2,
992
992
  'orderList/oco': 0.2,
993
+ 'orderList/oto': 0.2,
994
+ 'orderList/otoco': 0.2,
993
995
  'sor/order': 0.2,
994
996
  'sor/order/test': 0.2,
995
997
  'order': 0.2,
package/js/src/bingx.js CHANGED
@@ -9,7 +9,7 @@ import Exchange from './abstract/bingx.js';
9
9
  import { AuthenticationError, PermissionDenied, AccountSuspended, ExchangeError, InsufficientFunds, BadRequest, OrderNotFound, DDoSProtection, BadSymbol, ArgumentsRequired, NotSupported, OperationFailed } from './base/errors.js';
10
10
  import { Precise } from './base/Precise.js';
11
11
  import { sha256 } from './static_dependencies/noble-hashes/sha256.js';
12
- import { DECIMAL_PLACES } from './base/functions/number.js';
12
+ import { TICK_SIZE } from './base/functions/number.js';
13
13
  // ---------------------------------------------------------------------------
14
14
  /**
15
15
  * @class bingx
@@ -388,7 +388,7 @@ export default class bingx extends Exchange {
388
388
  '1w': '1w',
389
389
  '1M': '1M',
390
390
  },
391
- 'precisionMode': DECIMAL_PLACES,
391
+ 'precisionMode': TICK_SIZE,
392
392
  'exceptions': {
393
393
  'exact': {
394
394
  '400': BadRequest,
@@ -613,18 +613,26 @@ export default class bingx extends Exchange {
613
613
  // "msg": "",
614
614
  // "data": [
615
615
  // {
616
- // "contractId": "100",
617
- // "symbol": "BTC-USDT",
618
- // "size": "0.0001",
619
- // "quantityPrecision": 4,
620
- // "pricePrecision": 1,
621
- // "feeRate": 0.0005,
622
- // "tradeMinLimit": 1,
623
- // "maxLongLeverage": 150,
624
- // "maxShortLeverage": 150,
625
- // "currency": "USDT",
626
- // "asset": "BTC",
627
- // "status": 1
616
+ // "contractId": "100",
617
+ // "symbol": "BTC-USDT",
618
+ // "size": "0.0001",
619
+ // "quantityPrecision": "4",
620
+ // "pricePrecision": "1",
621
+ // "feeRate": "0.0005",
622
+ // "makerFeeRate": "0.0002",
623
+ // "takerFeeRate": "0.0005",
624
+ // "tradeMinLimit": "0",
625
+ // "tradeMinQuantity": "0.0001",
626
+ // "tradeMinUSDT": "2",
627
+ // "maxLongLeverage": "125",
628
+ // "maxShortLeverage": "125",
629
+ // "currency": "USDT",
630
+ // "asset": "BTC",
631
+ // "status": "1",
632
+ // "apiStateOpen": "true",
633
+ // "apiStateClose": "true",
634
+ // "ensureTrigger": true,
635
+ // "triggerFeeRate": "0.00020000"
628
636
  // },
629
637
  // ...
630
638
  // ]
@@ -642,13 +650,13 @@ export default class bingx extends Exchange {
642
650
  const quote = this.safeCurrencyCode(quoteId);
643
651
  const currency = this.safeString(market, 'currency');
644
652
  const settle = this.safeCurrencyCode(currency);
645
- let pricePrecision = this.safeInteger(market, 'pricePrecision');
653
+ let pricePrecision = this.safeNumber(market, 'tickSize');
646
654
  if (pricePrecision === undefined) {
647
- pricePrecision = this.precisionFromString(this.safeString(market, 'tickSize'));
655
+ pricePrecision = this.parseNumber(this.parsePrecision(this.safeString(market, 'pricePrecision')));
648
656
  }
649
- let quantityPrecision = this.safeInteger(market, 'quantityPrecision');
657
+ let quantityPrecision = this.safeNumber(market, 'stepSize');
650
658
  if (quantityPrecision === undefined) {
651
- quantityPrecision = this.precisionFromString(this.safeString(market, 'stepSize'));
659
+ quantityPrecision = this.parseNumber(this.parsePrecision(this.safeString(market, 'quantityPrecision')));
652
660
  }
653
661
  const type = (settle !== undefined) ? 'swap' : 'spot';
654
662
  const spot = type === 'spot';
package/js/src/bitget.js CHANGED
@@ -4414,7 +4414,7 @@ export default class bitget extends Exchange {
4414
4414
  }
4415
4415
  if (marginMode !== undefined) {
4416
4416
  request['loanType'] = 'normal';
4417
- if (createMarketBuyOrderRequiresPrice && isMarketOrder && (side === 'buy')) {
4417
+ if (isMarketOrder && (side === 'buy')) {
4418
4418
  request['quoteSize'] = quantity;
4419
4419
  }
4420
4420
  else {
package/js/src/bitmart.js CHANGED
@@ -2333,7 +2333,7 @@ export default class bitmart extends Exchange {
2333
2333
  const trailingActivationPrice = this.safeNumber(order, 'activation_price');
2334
2334
  return this.safeOrder({
2335
2335
  'id': id,
2336
- 'clientOrderId': this.safeString(order, 'client_order_id'),
2336
+ 'clientOrderId': this.safeString2(order, 'client_order_id', 'clientOrderId'),
2337
2337
  'info': order,
2338
2338
  'timestamp': timestamp,
2339
2339
  'datetime': this.iso8601(timestamp),
@@ -2743,6 +2743,11 @@ export default class bitmart extends Exchange {
2743
2743
  if (ioc) {
2744
2744
  request['type'] = 'ioc';
2745
2745
  }
2746
+ const clientOrderId = this.safeString(params, 'clientOrderId');
2747
+ if (clientOrderId !== undefined) {
2748
+ params = this.omit(params, 'clientOrderId');
2749
+ request['client_order_id'] = clientOrderId;
2750
+ }
2746
2751
  return this.extend(request, params);
2747
2752
  }
2748
2753
  async cancelOrder(id, symbol = undefined, params = {}) {
package/js/src/bitteam.js CHANGED
@@ -7,7 +7,7 @@
7
7
  // ---------------------------------------------------------------------------
8
8
  import Exchange from './abstract/bitteam.js';
9
9
  import { ArgumentsRequired, AuthenticationError, BadRequest, BadSymbol, ExchangeError, ExchangeNotAvailable, InsufficientFunds, OrderNotFound } from './base/errors.js';
10
- import { DECIMAL_PLACES } from './base/functions/number.js';
10
+ import { TICK_SIZE } from './base/functions/number.js';
11
11
  import { Precise } from './base/Precise.js';
12
12
  // ---------------------------------------------------------------------------
13
13
  /**
@@ -193,7 +193,7 @@ export default class bitteam extends Exchange {
193
193
  'maker': this.parseNumber('0.002'),
194
194
  },
195
195
  },
196
- 'precisionMode': DECIMAL_PLACES,
196
+ 'precisionMode': TICK_SIZE,
197
197
  // exchange-specific options
198
198
  'options': {
199
199
  'networksById': {
@@ -354,8 +354,6 @@ export default class bitteam extends Exchange {
354
354
  const base = this.safeCurrencyCode(baseId);
355
355
  const quote = this.safeCurrencyCode(quoteId);
356
356
  const active = this.safeValue(market, 'active');
357
- const amountPrecision = this.safeInteger(market, 'baseStep');
358
- const pricePrecision = this.safeInteger(market, 'quoteStep');
359
357
  const timeStart = this.safeString(market, 'timeStart');
360
358
  const created = this.parse8601(timeStart);
361
359
  let minCost = undefined;
@@ -391,8 +389,8 @@ export default class bitteam extends Exchange {
391
389
  'strike': undefined,
392
390
  'optionType': undefined,
393
391
  'precision': {
394
- 'amount': amountPrecision,
395
- 'price': pricePrecision,
392
+ 'amount': this.parseNumber(this.parsePrecision(this.safeString(market, 'baseStep'))),
393
+ 'price': this.parseNumber(this.parsePrecision(this.safeString(market, 'quoteStep'))),
396
394
  },
397
395
  'limits': {
398
396
  'leverage': {
@@ -548,7 +546,7 @@ export default class bitteam extends Exchange {
548
546
  const numericId = this.safeInteger(currency, 'id');
549
547
  const code = this.safeCurrencyCode(id);
550
548
  const active = this.safeBool(currency, 'active', false);
551
- const precision = this.safeInteger(currency, 'precision');
549
+ const precision = this.parseNumber(this.parsePrecision(this.safeString(currency, 'precision')));
552
550
  const txLimits = this.safeValue(currency, 'txLimits', {});
553
551
  const minWithdraw = this.safeString(txLimits, 'minWithdraw');
554
552
  const maxWithdraw = this.safeString(txLimits, 'maxWithdraw');
@@ -570,7 +568,7 @@ export default class bitteam extends Exchange {
570
568
  const withdraw = this.safeValue(statuses, 'withdrawStatus');
571
569
  const networkIds = Object.keys(feesByNetworkId);
572
570
  const networks = {};
573
- const networkPrecision = this.safeInteger(currency, 'decimals');
571
+ const networkPrecision = this.parseNumber(this.parsePrecision(this.safeString(currency, 'decimals')));
574
572
  for (let j = 0; j < networkIds.length; j++) {
575
573
  const networkId = networkIds[j];
576
574
  const networkCode = this.networkIdToCode(networkId, code);
@@ -7,7 +7,7 @@
7
7
  // ---------------------------------------------------------------------------
8
8
  import Exchange from './abstract/coinmetro.js';
9
9
  import { ArgumentsRequired, BadRequest, BadSymbol, InsufficientFunds, InvalidOrder, ExchangeError, OrderNotFound, PermissionDenied, RateLimitExceeded } from './base/errors.js';
10
- import { DECIMAL_PLACES } from './base/functions/number.js';
10
+ import { TICK_SIZE } from './base/functions/number.js';
11
11
  import { Precise } from './base/Precise.js';
12
12
  // ---------------------------------------------------------------------------
13
13
  /**
@@ -208,7 +208,7 @@ export default class coinmetro extends Exchange {
208
208
  'maker': this.parseNumber('0'),
209
209
  },
210
210
  },
211
- 'precisionMode': DECIMAL_PLACES,
211
+ 'precisionMode': TICK_SIZE,
212
212
  // exchange-specific options
213
213
  'options': {
214
214
  'currenciesByIdForParseMarket': undefined,
@@ -312,7 +312,6 @@ export default class coinmetro extends Exchange {
312
312
  const deposit = this.safeValue(currency, 'canDeposit');
313
313
  const canTrade = this.safeValue(currency, 'canTrade');
314
314
  const active = canTrade ? withdraw : true;
315
- const precision = this.safeInteger(currency, 'digits');
316
315
  const minAmount = this.safeNumber(currency, 'minQty');
317
316
  result[code] = this.safeCurrencyStructure({
318
317
  'id': id,
@@ -323,7 +322,7 @@ export default class coinmetro extends Exchange {
323
322
  'deposit': deposit,
324
323
  'withdraw': withdraw,
325
324
  'fee': undefined,
326
- 'precision': precision,
325
+ 'precision': this.parseNumber(this.parsePrecision(this.safeString(currency, 'digits'))),
327
326
  'limits': {
328
327
  'amount': { 'min': minAmount, 'max': undefined },
329
328
  'withdraw': { 'min': undefined, 'max': undefined },
@@ -354,19 +353,14 @@ export default class coinmetro extends Exchange {
354
353
  //
355
354
  // [
356
355
  // {
357
- // "pair": "PERPEUR",
358
- // "precision": 5,
359
- // "margin": false
360
- // },
361
- // {
362
- // "pair": "PERPUSD",
356
+ // "pair": "YFIEUR",
363
357
  // "precision": 5,
364
358
  // "margin": false
365
359
  // },
366
360
  // {
367
- // "pair": "YFIEUR",
368
- // "precision": 5,
369
- // "margin": false
361
+ // "pair": "BTCEUR",
362
+ // "precision": 2,
363
+ // "margin": true
370
364
  // },
371
365
  // ...
372
366
  // ]
@@ -412,9 +406,7 @@ export default class coinmetro extends Exchange {
412
406
  'optionType': undefined,
413
407
  'precision': {
414
408
  'amount': basePrecisionAndLimits['precision'],
415
- 'price': quotePrecisionAndLimits['precision'],
416
- 'base': basePrecisionAndLimits['precision'],
417
- 'quote': quotePrecisionAndLimits['precision'],
409
+ 'price': this.parseNumber(this.parsePrecision(this.safeString(market, 'precision'))),
418
410
  },
419
411
  'limits': {
420
412
  'leverage': {
@@ -469,12 +461,11 @@ export default class coinmetro extends Exchange {
469
461
  parseMarketPrecisionAndLimits(currencyId) {
470
462
  const currencies = this.safeValue(this.options, 'currenciesByIdForParseMarket', {});
471
463
  const currency = this.safeValue(currencies, currencyId, {});
472
- const precision = this.safeInteger(currency, 'precision');
473
464
  const limits = this.safeValue(currency, 'limits', {});
474
465
  const amountLimits = this.safeValue(limits, 'amount', {});
475
466
  const minLimit = this.safeNumber(amountLimits, 'min');
476
467
  const result = {
477
- 'precision': precision,
468
+ 'precision': this.safeNumber(currency, 'precision'),
478
469
  'minLimit': minLimit,
479
470
  };
480
471
  return result;
@@ -1,5 +1,5 @@
1
1
  import Exchange from './abstract/hyperliquid.js';
2
- import type { Market, TransferEntry, Balances, Int, OrderBook, OHLCV, Str, FundingRateHistory, Order, OrderType, OrderSide, Trade, Strings, Position, OrderRequest, Dict, Num, MarginModification, Currencies, CancellationRequest, int } from './base/types.js';
2
+ import type { Market, TransferEntry, Balances, Int, OrderBook, OHLCV, Str, FundingRateHistory, Order, OrderType, OrderSide, Trade, Strings, Position, OrderRequest, Dict, Num, MarginModification, Currencies, CancellationRequest, int, Transaction, Currency } from './base/types.js';
3
3
  /**
4
4
  * @class hyperliquid
5
5
  * @augments Exchange
@@ -36,7 +36,7 @@ export default class hyperliquid extends Exchange {
36
36
  };
37
37
  actionHash(action: any, vaultAddress: any, nonce: any): any;
38
38
  signL1Action(action: any, nonce: any, vaultAdress?: any): object;
39
- buildSig(chainId: any, messageTypes: any, message: any): {
39
+ signUserSignedAction(messageTypes: any, message: any): {
40
40
  r: string;
41
41
  s: string;
42
42
  v: any;
@@ -77,7 +77,8 @@ export default class hyperliquid extends Exchange {
77
77
  modifyMarginHelper(symbol: string, amount: any, type: any, params?: {}): Promise<MarginModification>;
78
78
  parseMarginModification(data: Dict, market?: Market): MarginModification;
79
79
  transfer(code: string, amount: number, fromAccount: string, toAccount: string, params?: {}): Promise<TransferEntry>;
80
- withdraw(code: string, amount: any, address: any, tag?: any, params?: {}): Promise<any>;
80
+ withdraw(code: string, amount: number, address: string, tag?: any, params?: {}): Promise<Transaction>;
81
+ parseTransaction(transaction: Dict, currency?: Currency): Transaction;
81
82
  formatVaultAddress(address?: Str): string;
82
83
  handlePublicAddress(methodName: string, params: Dict): any[];
83
84
  coinToMarketId(coin: Str): string;
@@ -27,6 +27,7 @@ export default class hyperliquid extends Exchange {
27
27
  'rateLimit': 50,
28
28
  'certified': false,
29
29
  'pro': true,
30
+ 'dex': true,
30
31
  'has': {
31
32
  'CORS': undefined,
32
33
  'spot': true,
@@ -971,11 +972,12 @@ export default class hyperliquid extends Exchange {
971
972
  const signature = this.signMessage(msg, this.privateKey);
972
973
  return signature;
973
974
  }
974
- buildSig(chainId, messageTypes, message) {
975
+ signUserSignedAction(messageTypes, message) {
975
976
  const zeroAddress = this.safeString(this.options, 'zeroAddress');
977
+ const chainId = 421614; // check this out
976
978
  const domain = {
977
979
  'chainId': chainId,
978
- 'name': 'Exchange',
980
+ 'name': 'HyperliquidSignTransaction',
979
981
  'verifyingContract': zeroAddress,
980
982
  'version': '1',
981
983
  };
@@ -984,28 +986,26 @@ export default class hyperliquid extends Exchange {
984
986
  return signature;
985
987
  }
986
988
  buildTransferSig(message) {
987
- const isSandboxMode = this.safeBool(this.options, 'sandboxMode');
988
- const chainId = (isSandboxMode) ? 421614 : 42161;
989
989
  const messageTypes = {
990
- 'UsdTransferSignPayload': [
990
+ 'HyperliquidTransaction:UsdSend': [
991
+ { 'name': 'hyperliquidChain', 'type': 'string' },
991
992
  { 'name': 'destination', 'type': 'string' },
992
993
  { 'name': 'amount', 'type': 'string' },
993
994
  { 'name': 'time', 'type': 'uint64' },
994
995
  ],
995
996
  };
996
- return this.buildSig(chainId, messageTypes, message);
997
+ return this.signUserSignedAction(messageTypes, message);
997
998
  }
998
999
  buildWithdrawSig(message) {
999
- const isSandboxMode = this.safeBool(this.options, 'sandboxMode');
1000
- const chainId = (isSandboxMode) ? 421614 : 42161;
1001
1000
  const messageTypes = {
1002
- 'WithdrawFromBridge2SignPayload': [
1001
+ 'HyperliquidTransaction:Withdraw': [
1002
+ { 'name': 'hyperliquidChain', 'type': 'string' },
1003
1003
  { 'name': 'destination', 'type': 'string' },
1004
- { 'name': 'usd', 'type': 'string' },
1004
+ { 'name': 'amount', 'type': 'string' },
1005
1005
  { 'name': 'time', 'type': 'uint64' },
1006
1006
  ],
1007
1007
  };
1008
- return this.buildSig(chainId, messageTypes, message);
1008
+ return this.signUserSignedAction(messageTypes, message);
1009
1009
  }
1010
1010
  async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
1011
1011
  /**
@@ -2408,10 +2408,11 @@ export default class hyperliquid extends Exchange {
2408
2408
  if (code !== undefined) {
2409
2409
  code = code.toUpperCase();
2410
2410
  if (code !== 'USDC') {
2411
- throw new NotSupported(this.id + 'withdraw() only support USDC');
2411
+ throw new NotSupported(this.id + 'transfer() only support USDC');
2412
2412
  }
2413
2413
  }
2414
2414
  const payload = {
2415
+ 'hyperliquidChain': isSandboxMode ? 'Testnet' : 'Mainnet',
2415
2416
  'destination': toAccount,
2416
2417
  'amount': this.numberToString(amount),
2417
2418
  'time': nonce,
@@ -2419,9 +2420,12 @@ export default class hyperliquid extends Exchange {
2419
2420
  const sig = this.buildTransferSig(payload);
2420
2421
  const request = {
2421
2422
  'action': {
2422
- 'chain': (isSandboxMode) ? 'ArbitrumTestnet' : 'Arbitrum',
2423
- 'payload': payload,
2424
- 'type': 'usdTransfer',
2423
+ 'hyperliquidChain': payload['hyperliquidChain'],
2424
+ 'signatureChainId': '0x66eee',
2425
+ 'destination': toAccount,
2426
+ 'amount': amount.toString(),
2427
+ 'time': nonce,
2428
+ 'type': 'usdSend',
2425
2429
  },
2426
2430
  'nonce': nonce,
2427
2431
  'signature': sig,
@@ -2451,25 +2455,56 @@ export default class hyperliquid extends Exchange {
2451
2455
  throw new NotSupported(this.id + 'withdraw() only support USDC');
2452
2456
  }
2453
2457
  }
2454
- const isSandboxMode = this.safeBool(this.options, 'sandboxMode');
2458
+ const isSandboxMode = this.safeBool(this.options, 'sandboxMode', false);
2455
2459
  const nonce = this.milliseconds();
2456
2460
  const payload = {
2461
+ 'hyperliquidChain': isSandboxMode ? 'Testnet' : 'Mainnet',
2457
2462
  'destination': address,
2458
- 'usd': amount.toString(),
2463
+ 'amount': amount.toString(),
2459
2464
  'time': nonce,
2460
2465
  };
2461
2466
  const sig = this.buildWithdrawSig(payload);
2462
2467
  const request = {
2463
2468
  'action': {
2464
- 'chain': (isSandboxMode) ? 'ArbitrumTestnet' : 'Arbitrum',
2465
- 'payload': payload,
2466
- 'type': 'withdraw2',
2469
+ 'hyperliquidChain': payload['hyperliquidChain'],
2470
+ 'signatureChainId': '0x66eee',
2471
+ 'destination': address,
2472
+ 'amount': amount.toString(),
2473
+ 'time': nonce,
2474
+ 'type': 'withdraw3',
2467
2475
  },
2468
2476
  'nonce': nonce,
2469
2477
  'signature': sig,
2470
2478
  };
2471
2479
  const response = await this.privatePostExchange(this.extend(request, params));
2472
- return response;
2480
+ return this.parseTransaction(response);
2481
+ }
2482
+ parseTransaction(transaction, currency = undefined) {
2483
+ //
2484
+ // { status: 'ok', response: { type: 'default' } }
2485
+ //
2486
+ return {
2487
+ 'info': transaction,
2488
+ 'id': undefined,
2489
+ 'txid': undefined,
2490
+ 'timestamp': undefined,
2491
+ 'datetime': undefined,
2492
+ 'network': undefined,
2493
+ 'address': undefined,
2494
+ 'addressTo': undefined,
2495
+ 'addressFrom': undefined,
2496
+ 'tag': undefined,
2497
+ 'tagTo': undefined,
2498
+ 'tagFrom': undefined,
2499
+ 'type': undefined,
2500
+ 'amount': undefined,
2501
+ 'currency': undefined,
2502
+ 'status': this.safeString(transaction, 'status'),
2503
+ 'updated': undefined,
2504
+ 'comment': undefined,
2505
+ 'internal': undefined,
2506
+ 'fee': undefined,
2507
+ };
2473
2508
  }
2474
2509
  formatVaultAddress(address = undefined) {
2475
2510
  if (address === undefined) {
package/js/src/idex.js CHANGED
@@ -27,6 +27,7 @@ export default class idex extends Exchange {
27
27
  'rateLimit': 1000,
28
28
  'version': 'v3',
29
29
  'pro': true,
30
+ 'dex': true,
30
31
  'certified': false,
31
32
  'requiresWeb3': true,
32
33
  'has': {
package/js/src/mexc.js CHANGED
@@ -224,6 +224,7 @@ export default class mexc extends Exchange {
224
224
  'sub-account/margin': 1,
225
225
  'batchOrders': 10,
226
226
  'capital/withdraw/apply': 1,
227
+ 'capital/withdraw': 1,
227
228
  'capital/transfer': 1,
228
229
  'capital/transfer/internal': 1,
229
230
  'capital/deposit/address': 1,
@@ -242,6 +243,7 @@ export default class mexc extends Exchange {
242
243
  'margin/order': 1,
243
244
  'margin/openOrders': 1,
244
245
  'userDataStream': 1,
246
+ 'capital/withdraw': 1,
245
247
  },
246
248
  },
247
249
  },
@@ -1069,7 +1071,7 @@ export default class mexc extends Exchange {
1069
1071
  const chains = this.safeValue(currency, 'networkList', []);
1070
1072
  for (let j = 0; j < chains.length; j++) {
1071
1073
  const chain = chains[j];
1072
- const networkId = this.safeString(chain, 'network');
1074
+ const networkId = this.safeString2(chain, 'network', 'netWork');
1073
1075
  const network = this.networkIdToCode(networkId);
1074
1076
  const isDepositEnabled = this.safeBool(chain, 'depositEnable', false);
1075
1077
  const isWithdrawEnabled = this.safeBool(chain, 'withdrawEnable', false);
@@ -5225,7 +5227,7 @@ export default class mexc extends Exchange {
5225
5227
  * @method
5226
5228
  * @name mexc#withdraw
5227
5229
  * @description make a withdrawal
5228
- * @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#withdraw
5230
+ * @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#withdraw-new
5229
5231
  * @param {string} code unified currency code
5230
5232
  * @param {float} amount the amount to withdraw
5231
5233
  * @param {string} address the address to withdraw to
@@ -5235,7 +5237,7 @@ export default class mexc extends Exchange {
5235
5237
  */
5236
5238
  [tag, params] = this.handleWithdrawTagAndParams(tag, params);
5237
5239
  const networks = this.safeValue(this.options, 'networks', {});
5238
- let network = this.safeString2(params, 'network', 'chain'); // this line allows the user to specify either ERC20 or ETH
5240
+ let network = this.safeString2(params, 'network', 'netWork'); // this line allows the user to specify either ERC20 or ETH
5239
5241
  network = this.safeString(networks, network, network); // handle ETH > ERC-20 alias
5240
5242
  this.checkAddress(address);
5241
5243
  await this.loadMarkets();
@@ -5249,10 +5251,10 @@ export default class mexc extends Exchange {
5249
5251
  request['memo'] = tag;
5250
5252
  }
5251
5253
  if (network !== undefined) {
5252
- request['network'] = network;
5253
- params = this.omit(params, ['network', 'chain']);
5254
+ request['netWork'] = network;
5255
+ params = this.omit(params, ['network', 'netWork']);
5254
5256
  }
5255
- const response = await this.spotPrivatePostCapitalWithdrawApply(this.extend(request, params));
5257
+ const response = await this.spotPrivatePostCapitalWithdraw(this.extend(request, params));
5256
5258
  //
5257
5259
  // {
5258
5260
  // "id":"7213fea8e94b4a5593d507237e5a555b"
package/js/src/okx.js CHANGED
@@ -2461,6 +2461,7 @@ export default class okx extends Exchange {
2461
2461
  * @see https://www.okx.com/docs-v5/en/#funding-account-rest-api-get-balance
2462
2462
  * @see https://www.okx.com/docs-v5/en/#trading-account-rest-api-get-balance
2463
2463
  * @param {object} [params] extra parameters specific to the exchange API endpoint
2464
+ * @param {string} [params.type] wallet type, ['funding' or 'trading'] default is 'trading'
2464
2465
  * @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
2465
2466
  */
2466
2467
  await this.loadMarkets();
package/js/src/oxfun.js CHANGED
@@ -19,7 +19,7 @@ export default class oxfun extends Exchange {
19
19
  describe() {
20
20
  return this.deepExtend(super.describe(), {
21
21
  'id': 'oxfun',
22
- 'name': 'Oxfun',
22
+ 'name': 'OXFUN',
23
23
  'countries': ['PA'],
24
24
  'version': 'v3',
25
25
  'rateLimit': 120,
@@ -139,7 +139,7 @@ export default class oxfun extends Exchange {
139
139
  '1d': '86400s',
140
140
  },
141
141
  'urls': {
142
- 'logo': 'https://github.com/ccxt/ccxt/assets/43336371/9c7114b3-ec32-4cf7-a716-f807d7d071cd',
142
+ 'logo': 'https://github.com/ccxt/ccxt/assets/43336371/6a196124-c1ee-4fae-8573-962071b61a85',
143
143
  'referral': 'https://ox.fun/register?shareAccountId=5ZUD4a7G',
144
144
  'api': {
145
145
  'public': 'https://api.ox.fun',
@@ -44,14 +44,6 @@ export default class binanceus extends binance {
44
44
  'defaultType': 'spot',
45
45
  'fetchMarkets': ['spot'],
46
46
  },
47
- 'fees': {
48
- 'trading': {
49
- 'tierBased': false,
50
- 'percentage': true,
51
- 'taker': 0.0,
52
- 'maker': 0.0, // 0.1% trading fee, zero fees for all trading pairs before November 1
53
- },
54
- },
55
47
  });
56
48
  }
57
49
  }