ccxt 4.4.57 → 4.4.59

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 (109) hide show
  1. package/README.md +29 -32
  2. package/dist/ccxt.browser.min.js +3 -3
  3. package/dist/cjs/ccxt.js +1 -6
  4. package/dist/cjs/src/alpaca.js +1 -1
  5. package/dist/cjs/src/ascendex.js +2 -0
  6. package/dist/cjs/src/base/Exchange.js +4 -3
  7. package/dist/cjs/src/bigone.js +2 -2
  8. package/dist/cjs/src/binance.js +22 -3
  9. package/dist/cjs/src/bit2c.js +7 -7
  10. package/dist/cjs/src/bitget.js +7 -0
  11. package/dist/cjs/src/bitmart.js +161 -97
  12. package/dist/cjs/src/blofin.js +1 -2
  13. package/dist/cjs/src/bybit.js +16 -3
  14. package/dist/cjs/src/coinbase.js +9 -2
  15. package/dist/cjs/src/coinbaseinternational.js +1 -1
  16. package/dist/cjs/src/hitbtc.js +1 -1
  17. package/dist/cjs/src/hyperliquid.js +96 -4
  18. package/dist/cjs/src/pro/binanceus.js +1 -1
  19. package/dist/cjs/src/pro/bybit.js +6 -1
  20. package/dist/cjs/src/pro/mexc.js +4 -1
  21. package/dist/cjs/src/timex.js +15 -2
  22. package/dist/cjs/src/vertex.js +2 -2
  23. package/dist/cjs/src/whitebit.js +2 -1
  24. package/dist/cjs/src/xt.js +62 -3
  25. package/js/ccxt.d.ts +2 -8
  26. package/js/ccxt.js +2 -6
  27. package/js/src/abstract/xt.d.ts +1 -0
  28. package/js/src/alpaca.d.ts +1 -1
  29. package/js/src/alpaca.js +1 -1
  30. package/js/src/ascendex.d.ts +1 -1
  31. package/js/src/ascendex.js +2 -0
  32. package/js/src/base/Exchange.d.ts +1 -331
  33. package/js/src/base/Exchange.js +4 -3
  34. package/js/src/base/types.d.ts +2 -2
  35. package/js/src/bigone.d.ts +1 -1
  36. package/js/src/bigone.js +2 -2
  37. package/js/src/binance.d.ts +1 -1
  38. package/js/src/binance.js +22 -3
  39. package/js/src/bingx.d.ts +1 -1
  40. package/js/src/bit2c.js +7 -7
  41. package/js/src/bitget.d.ts +1 -1
  42. package/js/src/bitget.js +7 -0
  43. package/js/src/bitmart.d.ts +5 -1
  44. package/js/src/bitmart.js +161 -97
  45. package/js/src/bitrue.d.ts +1 -1
  46. package/js/src/bitvavo.d.ts +1 -1
  47. package/js/src/blofin.js +1 -2
  48. package/js/src/btcmarkets.d.ts +1 -1
  49. package/js/src/bybit.d.ts +1 -1
  50. package/js/src/bybit.js +16 -3
  51. package/js/src/cex.d.ts +1 -1
  52. package/js/src/coinbase.d.ts +1 -1
  53. package/js/src/coinbase.js +9 -2
  54. package/js/src/coinbaseexchange.d.ts +2 -2
  55. package/js/src/coinbaseinternational.js +1 -1
  56. package/js/src/coincatch.d.ts +1 -1
  57. package/js/src/coinex.d.ts +1 -1
  58. package/js/src/coinlist.d.ts +1 -1
  59. package/js/src/coinsph.d.ts +1 -1
  60. package/js/src/currencycom.d.ts +1 -1
  61. package/js/src/defx.d.ts +1 -1
  62. package/js/src/delta.d.ts +1 -1
  63. package/js/src/deribit.d.ts +1 -1
  64. package/js/src/digifinex.d.ts +1 -1
  65. package/js/src/gate.d.ts +1 -1
  66. package/js/src/hitbtc.js +1 -1
  67. package/js/src/htx.d.ts +1 -1
  68. package/js/src/huobijp.d.ts +1 -1
  69. package/js/src/hyperliquid.d.ts +21 -0
  70. package/js/src/hyperliquid.js +96 -4
  71. package/js/src/idex.d.ts +1 -1
  72. package/js/src/indodax.d.ts +1 -1
  73. package/js/src/kraken.d.ts +1 -1
  74. package/js/src/kucoin.d.ts +1 -1
  75. package/js/src/kucoinfutures.d.ts +1 -1
  76. package/js/src/kuna.d.ts +1 -1
  77. package/js/src/latoken.d.ts +1 -1
  78. package/js/src/lbank.d.ts +1 -1
  79. package/js/src/mexc.d.ts +1 -1
  80. package/js/src/novadax.d.ts +1 -1
  81. package/js/src/oceanex.d.ts +1 -1
  82. package/js/src/okcoin.d.ts +1 -1
  83. package/js/src/okx.d.ts +1 -1
  84. package/js/src/onetrading.d.ts +1 -1
  85. package/js/src/paradex.d.ts +1 -1
  86. package/js/src/poloniex.d.ts +1 -1
  87. package/js/src/poloniexfutures.d.ts +1 -1
  88. package/js/src/pro/binanceus.js +1 -1
  89. package/js/src/pro/bybit.js +6 -1
  90. package/js/src/pro/mexc.js +4 -1
  91. package/js/src/probit.d.ts +1 -1
  92. package/js/src/timex.d.ts +2 -1
  93. package/js/src/timex.js +15 -2
  94. package/js/src/tokocrypto.d.ts +1 -1
  95. package/js/src/vertex.d.ts +1 -1
  96. package/js/src/vertex.js +2 -2
  97. package/js/src/whitebit.d.ts +1 -1
  98. package/js/src/whitebit.js +2 -1
  99. package/js/src/woo.d.ts +1 -1
  100. package/js/src/woofipro.d.ts +1 -1
  101. package/js/src/xt.d.ts +13 -1
  102. package/js/src/xt.js +62 -3
  103. package/package.json +1 -1
  104. package/js/src/bitbay.d.ts +0 -4
  105. package/js/src/bitbay.js +0 -18
  106. package/js/src/bitfinex2.d.ts +0 -506
  107. package/js/src/bitfinex2.js +0 -3778
  108. package/js/src/wazirx.d.ts +0 -216
  109. package/js/src/wazirx.js +0 -1368
@@ -1,6 +1,4 @@
1
1
  import * as functions from './functions.js';
2
- import { // eslint-disable-line object-curly-newline
3
- ExchangeError, AuthenticationError, DDoSProtection, RequestTimeout, ExchangeNotAvailable, RateLimitExceeded } from "./errors.js";
4
2
  import WsClient from './ws/WsClient.js';
5
3
  import { OrderBook as WsOrderBook, IndexedOrderBook, CountedOrderBook } from './ws/OrderBook.js';
6
4
  import type { Market, Trade, Ticker, OHLCV, OHLCVC, Order, OrderBook, Balance, Balances, Dictionary, Transaction, DepositAddressResponse, Currency, MinMax, IndexType, Int, OrderType, OrderSide, Position, FundingRate, DepositWithdrawFeeNetwork, LedgerEntry, BorrowInterest, OpenInterest, LeverageTier, TransferEntry, FundingRateHistory, Liquidation, FundingHistory, OrderRequest, MarginMode, Tickers, Greeks, Option, OptionChain, Str, Num, MarketInterface, CurrencyInterface, BalanceAccount, MarginModes, MarketType, Leverage, Leverages, LastPrice, LastPrices, Account, Strings, MarginModification, TradingFeeInterface, Currencies, TradingFees, Conversion, CancellationRequest, IsolatedBorrowRate, IsolatedBorrowRates, CrossBorrowRates, CrossBorrowRate, Dict, FundingRates, LeverageTiers, Bool, int, DepositAddress, LongShortRatio, OrderBooks, OpenInterests } from './types.js';
@@ -383,335 +381,7 @@ export default class Exchange {
383
381
  createSafeDictionary(): {};
384
382
  randomBytes(length: number): string;
385
383
  randNumber(size: number): number;
386
- describe(): {
387
- id: any;
388
- name: any;
389
- countries: any;
390
- enableRateLimit: boolean;
391
- rateLimit: number;
392
- timeout: number;
393
- certified: boolean;
394
- pro: boolean;
395
- alias: boolean;
396
- dex: boolean;
397
- has: {
398
- publicAPI: boolean;
399
- privateAPI: boolean;
400
- CORS: any;
401
- sandbox: any;
402
- spot: any;
403
- margin: any;
404
- swap: any;
405
- future: any;
406
- option: any;
407
- addMargin: any;
408
- borrowCrossMargin: any;
409
- borrowIsolatedMargin: any;
410
- borrowMargin: any;
411
- cancelAllOrders: any;
412
- cancelAllOrdersWs: any;
413
- cancelOrder: boolean;
414
- cancelOrderWs: any;
415
- cancelOrders: any;
416
- cancelOrdersWs: any;
417
- closeAllPositions: any;
418
- closePosition: any;
419
- createDepositAddress: any;
420
- createLimitBuyOrder: any;
421
- createLimitBuyOrderWs: any;
422
- createLimitOrder: boolean;
423
- createLimitOrderWs: any;
424
- createLimitSellOrder: any;
425
- createLimitSellOrderWs: any;
426
- createMarketBuyOrder: any;
427
- createMarketBuyOrderWs: any;
428
- createMarketBuyOrderWithCost: any;
429
- createMarketBuyOrderWithCostWs: any;
430
- createMarketOrder: boolean;
431
- createMarketOrderWs: boolean;
432
- createMarketOrderWithCost: any;
433
- createMarketOrderWithCostWs: any;
434
- createMarketSellOrder: any;
435
- createMarketSellOrderWs: any;
436
- createMarketSellOrderWithCost: any;
437
- createMarketSellOrderWithCostWs: any;
438
- createOrder: boolean;
439
- createOrderWs: any;
440
- createOrders: any;
441
- createOrderWithTakeProfitAndStopLoss: any;
442
- createOrderWithTakeProfitAndStopLossWs: any;
443
- createPostOnlyOrder: any;
444
- createPostOnlyOrderWs: any;
445
- createReduceOnlyOrder: any;
446
- createReduceOnlyOrderWs: any;
447
- createStopLimitOrder: any;
448
- createStopLimitOrderWs: any;
449
- createStopLossOrder: any;
450
- createStopLossOrderWs: any;
451
- createStopMarketOrder: any;
452
- createStopMarketOrderWs: any;
453
- createStopOrder: any;
454
- createStopOrderWs: any;
455
- createTakeProfitOrder: any;
456
- createTakeProfitOrderWs: any;
457
- createTrailingAmountOrder: any;
458
- createTrailingAmountOrderWs: any;
459
- createTrailingPercentOrder: any;
460
- createTrailingPercentOrderWs: any;
461
- createTriggerOrder: any;
462
- createTriggerOrderWs: any;
463
- deposit: any;
464
- editOrder: string;
465
- editOrderWs: any;
466
- fetchAccounts: any;
467
- fetchBalance: boolean;
468
- fetchBalanceWs: any;
469
- fetchBidsAsks: any;
470
- fetchBorrowInterest: any;
471
- fetchBorrowRate: any;
472
- fetchBorrowRateHistories: any;
473
- fetchBorrowRateHistory: any;
474
- fetchBorrowRates: any;
475
- fetchBorrowRatesPerSymbol: any;
476
- fetchCanceledAndClosedOrders: any;
477
- fetchCanceledOrders: any;
478
- fetchClosedOrder: any;
479
- fetchClosedOrders: any;
480
- fetchClosedOrdersWs: any;
481
- fetchConvertCurrencies: any;
482
- fetchConvertQuote: any;
483
- fetchConvertTrade: any;
484
- fetchConvertTradeHistory: any;
485
- fetchCrossBorrowRate: any;
486
- fetchCrossBorrowRates: any;
487
- fetchCurrencies: string;
488
- fetchCurrenciesWs: string;
489
- fetchDeposit: any;
490
- fetchDepositAddress: any;
491
- fetchDepositAddresses: any;
492
- fetchDepositAddressesByNetwork: any;
493
- fetchDeposits: any;
494
- fetchDepositsWithdrawals: any;
495
- fetchDepositsWs: any;
496
- fetchDepositWithdrawFee: any;
497
- fetchDepositWithdrawFees: any;
498
- fetchFundingHistory: any;
499
- fetchFundingRate: any;
500
- fetchFundingRateHistory: any;
501
- fetchFundingInterval: any;
502
- fetchFundingIntervals: any;
503
- fetchFundingRates: any;
504
- fetchGreeks: any;
505
- fetchIndexOHLCV: any;
506
- fetchIsolatedBorrowRate: any;
507
- fetchIsolatedBorrowRates: any;
508
- fetchMarginAdjustmentHistory: any;
509
- fetchIsolatedPositions: any;
510
- fetchL2OrderBook: boolean;
511
- fetchL3OrderBook: any;
512
- fetchLastPrices: any;
513
- fetchLedger: any;
514
- fetchLedgerEntry: any;
515
- fetchLeverage: any;
516
- fetchLeverages: any;
517
- fetchLeverageTiers: any;
518
- fetchLiquidations: any;
519
- fetchLongShortRatio: any;
520
- fetchLongShortRatioHistory: any;
521
- fetchMarginMode: any;
522
- fetchMarginModes: any;
523
- fetchMarketLeverageTiers: any;
524
- fetchMarkets: boolean;
525
- fetchMarketsWs: any;
526
- fetchMarkOHLCV: any;
527
- fetchMyLiquidations: any;
528
- fetchMySettlementHistory: any;
529
- fetchMyTrades: any;
530
- fetchMyTradesWs: any;
531
- fetchOHLCV: any;
532
- fetchOHLCVWs: any;
533
- fetchOpenInterest: any;
534
- fetchOpenInterests: any;
535
- fetchOpenInterestHistory: any;
536
- fetchOpenOrder: any;
537
- fetchOpenOrders: any;
538
- fetchOpenOrdersWs: any;
539
- fetchOption: any;
540
- fetchOptionChain: any;
541
- fetchOrder: any;
542
- fetchOrderBook: boolean;
543
- fetchOrderBooks: any;
544
- fetchOrderBookWs: any;
545
- fetchOrders: any;
546
- fetchOrdersByStatus: any;
547
- fetchOrdersWs: any;
548
- fetchOrderTrades: any;
549
- fetchOrderWs: any;
550
- fetchPosition: any;
551
- fetchPositionHistory: any;
552
- fetchPositionsHistory: any;
553
- fetchPositionWs: any;
554
- fetchPositionMode: any;
555
- fetchPositions: any;
556
- fetchPositionsWs: any;
557
- fetchPositionsForSymbol: any;
558
- fetchPositionsForSymbolWs: any;
559
- fetchPositionsRisk: any;
560
- fetchPremiumIndexOHLCV: any;
561
- fetchSettlementHistory: any;
562
- fetchStatus: any;
563
- fetchTicker: boolean;
564
- fetchTickerWs: any;
565
- fetchTickers: any;
566
- fetchMarkPrices: any;
567
- fetchTickersWs: any;
568
- fetchTime: any;
569
- fetchTrades: boolean;
570
- fetchTradesWs: any;
571
- fetchTradingFee: any;
572
- fetchTradingFees: any;
573
- fetchTradingFeesWs: any;
574
- fetchTradingLimits: any;
575
- fetchTransactionFee: any;
576
- fetchTransactionFees: any;
577
- fetchTransactions: any;
578
- fetchTransfer: any;
579
- fetchTransfers: any;
580
- fetchUnderlyingAssets: any;
581
- fetchVolatilityHistory: any;
582
- fetchWithdrawAddresses: any;
583
- fetchWithdrawal: any;
584
- fetchWithdrawals: any;
585
- fetchWithdrawalsWs: any;
586
- fetchWithdrawalWhitelist: any;
587
- reduceMargin: any;
588
- repayCrossMargin: any;
589
- repayIsolatedMargin: any;
590
- setLeverage: any;
591
- setMargin: any;
592
- setMarginMode: any;
593
- setPositionMode: any;
594
- signIn: any;
595
- transfer: any;
596
- watchBalance: any;
597
- watchMyTrades: any;
598
- watchOHLCV: any;
599
- watchOHLCVForSymbols: any;
600
- watchOrderBook: any;
601
- watchOrderBookForSymbols: any;
602
- watchOrders: any;
603
- watchOrdersForSymbols: any;
604
- watchPosition: any;
605
- watchPositions: any;
606
- watchStatus: any;
607
- watchTicker: any;
608
- watchTickers: any;
609
- watchTrades: any;
610
- watchTradesForSymbols: any;
611
- watchLiquidations: any;
612
- watchLiquidationsForSymbols: any;
613
- watchMyLiquidations: any;
614
- watchMyLiquidationsForSymbols: any;
615
- withdraw: any;
616
- ws: any;
617
- };
618
- urls: {
619
- logo: any;
620
- api: any;
621
- www: any;
622
- doc: any;
623
- fees: any;
624
- };
625
- api: any;
626
- requiredCredentials: {
627
- apiKey: boolean;
628
- secret: boolean;
629
- uid: boolean;
630
- accountId: boolean;
631
- login: boolean;
632
- password: boolean;
633
- twofa: boolean;
634
- privateKey: boolean;
635
- walletAddress: boolean;
636
- token: boolean;
637
- };
638
- markets: any;
639
- currencies: {};
640
- timeframes: any;
641
- fees: {
642
- trading: {
643
- tierBased: any;
644
- percentage: any;
645
- taker: any;
646
- maker: any;
647
- };
648
- funding: {
649
- tierBased: any;
650
- percentage: any;
651
- withdraw: {};
652
- deposit: {};
653
- };
654
- };
655
- status: {
656
- status: string;
657
- updated: any;
658
- eta: any;
659
- url: any;
660
- };
661
- exceptions: any;
662
- httpExceptions: {
663
- '422': typeof ExchangeError;
664
- '418': typeof DDoSProtection;
665
- '429': typeof RateLimitExceeded;
666
- '404': typeof ExchangeNotAvailable;
667
- '409': typeof ExchangeNotAvailable;
668
- '410': typeof ExchangeNotAvailable;
669
- '451': typeof ExchangeNotAvailable;
670
- '500': typeof ExchangeNotAvailable;
671
- '501': typeof ExchangeNotAvailable;
672
- '502': typeof ExchangeNotAvailable;
673
- '520': typeof ExchangeNotAvailable;
674
- '521': typeof ExchangeNotAvailable;
675
- '522': typeof ExchangeNotAvailable;
676
- '525': typeof ExchangeNotAvailable;
677
- '526': typeof ExchangeNotAvailable;
678
- '400': typeof ExchangeNotAvailable;
679
- '403': typeof ExchangeNotAvailable;
680
- '405': typeof ExchangeNotAvailable;
681
- '503': typeof ExchangeNotAvailable;
682
- '530': typeof ExchangeNotAvailable;
683
- '408': typeof RequestTimeout;
684
- '504': typeof RequestTimeout;
685
- '401': typeof AuthenticationError;
686
- '407': typeof AuthenticationError;
687
- '511': typeof AuthenticationError;
688
- };
689
- commonCurrencies: {
690
- XBT: string;
691
- BCC: string;
692
- BCHSV: string;
693
- };
694
- precisionMode: number;
695
- paddingMode: number;
696
- limits: {
697
- leverage: {
698
- min: any;
699
- max: any;
700
- };
701
- amount: {
702
- min: any;
703
- max: any;
704
- };
705
- price: {
706
- min: any;
707
- max: any;
708
- };
709
- cost: {
710
- min: any;
711
- max: any;
712
- };
713
- };
714
- };
384
+ describe(): any;
715
385
  safeBoolN(dictionaryOrList: any, keys: IndexType[], defaultValue?: boolean): boolean | undefined;
716
386
  safeBool2(dictionary: any, key1: IndexType, key2: IndexType, defaultValue?: boolean): boolean | undefined;
717
387
  safeBool(dictionary: any, key: IndexType, defaultValue?: boolean): boolean | undefined;
@@ -290,7 +290,7 @@ export default class Exchange {
290
290
  this.requiresEddsa = false;
291
291
  // response handling flags and properties
292
292
  this.lastRestRequestTimestamp = 0;
293
- this.enableLastJsonResponse = true;
293
+ this.enableLastJsonResponse = false;
294
294
  this.enableLastHttpResponse = true;
295
295
  this.enableLastResponseHeaders = true;
296
296
  this.last_http_response = undefined;
@@ -3396,7 +3396,7 @@ export default class Exchange {
3396
3396
  let change = this.omitZero(this.safeString(ticker, 'change'));
3397
3397
  let percentage = this.omitZero(this.safeString(ticker, 'percentage'));
3398
3398
  let average = this.omitZero(this.safeString(ticker, 'average'));
3399
- let vwap = this.omitZero(this.safeString(ticker, 'vwap'));
3399
+ let vwap = this.safeString(ticker, 'vwap');
3400
3400
  const baseVolume = this.safeString(ticker, 'baseVolume');
3401
3401
  const quoteVolume = this.safeString(ticker, 'quoteVolume');
3402
3402
  if (vwap === undefined) {
@@ -6294,7 +6294,8 @@ export default class Exchange {
6294
6294
  result.push(parsed);
6295
6295
  }
6296
6296
  const sorted = this.sortBy(result, 'timestamp');
6297
- return this.filterBySinceLimit(sorted, since, limit);
6297
+ const symbol = this.safeString(market, 'symbol');
6298
+ return this.filterBySymbolSinceLimit(sorted, symbol, since, limit);
6298
6299
  }
6299
6300
  getMarketFromSymbols(symbols = undefined) {
6300
6301
  if (symbols === undefined) {
@@ -45,8 +45,8 @@ export interface MarketInterface {
45
45
  uppercaseId?: Str;
46
46
  lowercaseId?: Str;
47
47
  symbol: string;
48
- base: Str;
49
- quote: Str;
48
+ base: string;
49
+ quote: string;
50
50
  baseId: Str;
51
51
  quoteId: Str;
52
52
  active: Bool;
@@ -52,7 +52,7 @@ export default class bigone extends Exchange {
52
52
  * @param {object} [params] extra parameters specific to the exchange API endpoint
53
53
  * @returns {int} the current integer timestamp in milliseconds from the exchange server
54
54
  */
55
- fetchTime(params?: {}): Promise<number>;
55
+ fetchTime(params?: {}): Promise<Int>;
56
56
  /**
57
57
  * @method
58
58
  * @name bigone#fetchOrderBook
package/js/src/bigone.js CHANGED
@@ -1179,8 +1179,8 @@ export default class bigone extends Exchange {
1179
1179
  'cost': undefined,
1180
1180
  'info': trade,
1181
1181
  };
1182
- let makerCurrencyCode = undefined;
1183
- let takerCurrencyCode = undefined;
1182
+ let makerCurrencyCode;
1183
+ let takerCurrencyCode;
1184
1184
  if (takerOrMaker !== undefined) {
1185
1185
  if (side === 'buy') {
1186
1186
  if (takerOrMaker === 'maker') {
@@ -26,7 +26,7 @@ export default class binance extends Exchange {
26
26
  * @param {string} [params.subType] "linear" or "inverse"
27
27
  * @returns {int} the current integer timestamp in milliseconds from the exchange server
28
28
  */
29
- fetchTime(params?: {}): Promise<number>;
29
+ fetchTime(params?: {}): Promise<Int>;
30
30
  /**
31
31
  * @method
32
32
  * @name binance#fetchCurrencies
package/js/src/binance.js CHANGED
@@ -1564,6 +1564,7 @@ export default class binance extends Exchange {
1564
1564
  'legalMoneyCurrenciesById': {
1565
1565
  'BUSD': 'USD',
1566
1566
  },
1567
+ 'defaultWithdrawPrecision': 0.00000001,
1567
1568
  },
1568
1569
  'features': {
1569
1570
  'spot': {
@@ -1614,6 +1615,7 @@ export default class binance extends Exchange {
1614
1615
  'limit': undefined,
1615
1616
  'trigger': false,
1616
1617
  'trailing': false,
1618
+ 'symbolRequired': false,
1617
1619
  },
1618
1620
  'fetchOrders': {
1619
1621
  'marginMode': true,
@@ -3108,6 +3110,7 @@ export default class binance extends Exchange {
3108
3110
  const id = this.safeString(entry, 'coin');
3109
3111
  const name = this.safeString(entry, 'name');
3110
3112
  const code = this.safeCurrencyCode(id);
3113
+ const isFiat = this.safeBool(entry, 'isLegalMoney');
3111
3114
  let minPrecision = undefined;
3112
3115
  let isWithdrawEnabled = true;
3113
3116
  let isDepositEnabled = true;
@@ -3119,6 +3122,7 @@ export default class binance extends Exchange {
3119
3122
  const networkItem = networkList[j];
3120
3123
  const network = this.safeString(networkItem, 'network');
3121
3124
  const networkCode = this.networkIdToCode(network);
3125
+ const isETF = (network === 'ETF'); // e.g. BTCUP, ETHDOWN
3122
3126
  // const name = this.safeString (networkItem, 'name');
3123
3127
  const withdrawFee = this.safeNumber(networkItem, 'withdrawFee');
3124
3128
  const depositEnable = this.safeBool(networkItem, 'depositEnable');
@@ -3130,12 +3134,26 @@ export default class binance extends Exchange {
3130
3134
  if (isDefault || (fee === undefined)) {
3131
3135
  fee = withdrawFee;
3132
3136
  }
3137
+ // todo: default networks in "setMarkets" overload
3138
+ // if (isDefault) {
3139
+ // this.options['defaultNetworkCodesForCurrencies'][code] = networkCode;
3140
+ // }
3133
3141
  const precisionTick = this.safeString(networkItem, 'withdrawIntegerMultiple');
3134
- // avoid zero values, which are mostly from fiat or leveraged tokens : https://github.com/ccxt/ccxt/pull/14902#issuecomment-1271636731
3135
- // so, when there is zero instead of i.e. 0.001, then we skip those cases, because we don't know the precision - it might be because of network is suspended or other reasons
3142
+ let withdrawPrecision = precisionTick;
3143
+ // avoid zero values, which are mostly from fiat or leveraged tokens or some abandoned coins : https://github.com/ccxt/ccxt/pull/14902#issuecomment-1271636731
3136
3144
  if (!Precise.stringEq(precisionTick, '0')) {
3137
3145
  minPrecision = (minPrecision === undefined) ? precisionTick : Precise.stringMin(minPrecision, precisionTick);
3138
3146
  }
3147
+ else {
3148
+ if (!isFiat && !isETF) {
3149
+ // non-fiat and non-ETF currency, there are many cases when precision is set to zero (probably bug, we've reported to binance already)
3150
+ // in such cases, we can set default precision of 8 (which is in UI for such coins)
3151
+ withdrawPrecision = this.omitZero(this.safeString(networkItem, 'withdrawInternalMin'));
3152
+ if (withdrawPrecision === undefined) {
3153
+ withdrawPrecision = this.safeString(this.options, 'defaultWithdrawPrecision');
3154
+ }
3155
+ }
3156
+ }
3139
3157
  networks[networkCode] = {
3140
3158
  'info': networkItem,
3141
3159
  'id': network,
@@ -3144,7 +3162,7 @@ export default class binance extends Exchange {
3144
3162
  'deposit': depositEnable,
3145
3163
  'withdraw': withdrawEnable,
3146
3164
  'fee': withdrawFee,
3147
- 'precision': this.parseNumber(precisionTick),
3165
+ 'precision': this.parseNumber(withdrawPrecision),
3148
3166
  'limits': {
3149
3167
  'withdraw': {
3150
3168
  'min': this.safeNumber(networkItem, 'withdrawMin'),
@@ -3174,6 +3192,7 @@ export default class binance extends Exchange {
3174
3192
  'id': id,
3175
3193
  'name': name,
3176
3194
  'code': code,
3195
+ 'type': isFiat ? 'fiat' : 'crypto',
3177
3196
  'precision': this.parseNumber(minPrecision),
3178
3197
  'info': entry,
3179
3198
  'active': active,
package/js/src/bingx.d.ts CHANGED
@@ -14,7 +14,7 @@ export default class bingx extends Exchange {
14
14
  * @param {object} [params] extra parameters specific to the exchange API endpoint
15
15
  * @returns {int} the current integer timestamp in milliseconds from the bingx server
16
16
  */
17
- fetchTime(params?: {}): Promise<number>;
17
+ fetchTime(params?: {}): Promise<Int>;
18
18
  /**
19
19
  * @method
20
20
  * @name bingx#fetchCurrencies
package/js/src/bit2c.js CHANGED
@@ -638,7 +638,7 @@ export default class bit2c extends Exchange {
638
638
  // 0 = New
639
639
  // 1 = Open
640
640
  // 5 = Completed
641
- let status = undefined;
641
+ let status;
642
642
  if (isNewOrder) {
643
643
  const tempStatus = this.safeInteger(orderUnified, 'status_type');
644
644
  if (tempStatus === 0 || tempStatus === 1) {
@@ -819,13 +819,13 @@ export default class bit2c extends Exchange {
819
819
  // "isMaker": True,
820
820
  // }
821
821
  //
822
- let timestamp = undefined;
823
- let id = undefined;
822
+ let timestamp;
823
+ let id;
824
824
  let price = undefined;
825
825
  let amount = undefined;
826
826
  let orderId = undefined;
827
827
  let fee = undefined;
828
- let side = undefined;
828
+ let side;
829
829
  let makerOrTaker = undefined;
830
830
  const reference = this.safeString(trade, 'reference');
831
831
  if (reference !== undefined) {
@@ -841,11 +841,11 @@ export default class bit2c extends Exchange {
841
841
  const isMaker = this.safeValue(trade, 'isMaker');
842
842
  makerOrTaker = isMaker ? 'maker' : 'taker';
843
843
  orderId = isMaker ? reference_parts[2] : reference_parts[1];
844
- side = this.safeInteger(trade, 'action');
845
- if (side === 0) {
844
+ const action = this.safeInteger(trade, 'action');
845
+ if (action === 0) {
846
846
  side = 'buy';
847
847
  }
848
- else if (side === 1) {
848
+ else {
849
849
  side = 'sell';
850
850
  }
851
851
  const feeCost = this.safeString(trade, 'feeAmount');
@@ -17,7 +17,7 @@ export default class bitget extends Exchange {
17
17
  * @param {object} [params] extra parameters specific to the exchange API endpoint
18
18
  * @returns {int} the current integer timestamp in milliseconds from the exchange server
19
19
  */
20
- fetchTime(params?: {}): Promise<number>;
20
+ fetchTime(params?: {}): Promise<Int>;
21
21
  /**
22
22
  * @method
23
23
  * @name bitget#fetchMarkets
package/js/src/bitget.js CHANGED
@@ -9375,6 +9375,13 @@ export default class bitget extends Exchange {
9375
9375
  headers['Content-Type'] = 'application/json';
9376
9376
  }
9377
9377
  }
9378
+ const sandboxMode = this.safeBool(this.options, 'sandboxMode', false);
9379
+ if (sandboxMode) {
9380
+ if (headers === undefined) {
9381
+ headers = {};
9382
+ }
9383
+ headers['PAPTRADING'] = '1';
9384
+ }
9378
9385
  return { 'url': url, 'method': method, 'body': body, 'headers': headers };
9379
9386
  }
9380
9387
  }
@@ -13,7 +13,7 @@ export default class bitmart extends Exchange {
13
13
  * @param {object} [params] extra parameters specific to the exchange API endpoint
14
14
  * @returns {int} the current integer timestamp in milliseconds from the exchange server
15
15
  */
16
- fetchTime(params?: {}): Promise<number>;
16
+ fetchTime(params?: {}): Promise<Int>;
17
17
  /**
18
18
  * @method
19
19
  * @name bitmart#fetchStatus
@@ -47,6 +47,7 @@ export default class bitmart extends Exchange {
47
47
  * @returns {object} an associative dictionary of currencies
48
48
  */
49
49
  fetchCurrencies(params?: {}): Promise<Currencies>;
50
+ getCurrencyIdFromCodeAndNetwork(currencyCode: Str, networkCode: Str): Str;
50
51
  /**
51
52
  * @method
52
53
  * @name bitmart#fetchTransactionFee
@@ -54,6 +55,7 @@ export default class bitmart extends Exchange {
54
55
  * @description please use fetchDepositWithdrawFee instead
55
56
  * @param {string} code unified currency code
56
57
  * @param {object} [params] extra parameters specific to the exchange API endpoint
58
+ * @param {string} [params.network] the network code of the currency
57
59
  * @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
58
60
  */
59
61
  fetchTransactionFee(code: string, params?: {}): Promise<{
@@ -79,6 +81,7 @@ export default class bitmart extends Exchange {
79
81
  * @description fetch the fee for deposits and withdrawals
80
82
  * @param {string} code unified currency code
81
83
  * @param {object} [params] extra parameters specific to the exchange API endpoint
84
+ * @param {string} [params.network] the network code of the currency
82
85
  * @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
83
86
  */
84
87
  fetchDepositWithdrawFee(code: string, params?: {}): Promise<any>;
@@ -390,6 +393,7 @@ export default class bitmart extends Exchange {
390
393
  * @param {string} address the address to withdraw to
391
394
  * @param {string} tag
392
395
  * @param {object} [params] extra parameters specific to the exchange API endpoint
396
+ * @param {string} [params.network] the network name for this withdrawal
393
397
  * @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
394
398
  */
395
399
  withdraw(code: string, amount: number, address: string, tag?: any, params?: {}): Promise<Transaction>;