ccxt 4.3.33 → 4.3.35

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 (135) hide show
  1. package/README.md +3 -3
  2. package/dist/ccxt.browser.min.js +2 -2
  3. package/dist/cjs/ccxt.js +1 -1
  4. package/dist/cjs/src/alpaca.js +1 -1
  5. package/dist/cjs/src/base/Exchange.js +37 -0
  6. package/dist/cjs/src/binance.js +1 -0
  7. package/dist/cjs/src/bitmart.js +2 -9
  8. package/dist/cjs/src/coinbase.js +169 -55
  9. package/dist/cjs/src/coinex.js +26 -19
  10. package/dist/cjs/src/kraken.js +3 -1
  11. package/dist/cjs/src/pro/binance.js +352 -0
  12. package/dist/cjs/src/pro/bitget.js +31 -1
  13. package/dist/cjs/src/pro/bitmex.js +108 -0
  14. package/dist/cjs/src/pro/bybit.js +85 -0
  15. package/dist/cjs/src/pro/gate.js +183 -0
  16. package/dist/cjs/src/pro/kucoinfutures.js +4 -0
  17. package/dist/cjs/src/pro/okx.js +258 -0
  18. package/js/ccxt.d.ts +1 -1
  19. package/js/ccxt.js +1 -1
  20. package/js/src/abstract/binance.d.ts +1 -0
  21. package/js/src/abstract/binancecoinm.d.ts +1 -0
  22. package/js/src/abstract/binanceus.d.ts +1 -0
  23. package/js/src/abstract/binanceusdm.d.ts +1 -0
  24. package/js/src/ace.d.ts +3 -3
  25. package/js/src/alpaca.d.ts +3 -3
  26. package/js/src/alpaca.js +1 -1
  27. package/js/src/ascendex.d.ts +3 -3
  28. package/js/src/base/Exchange.d.ts +14 -3
  29. package/js/src/base/Exchange.js +37 -0
  30. package/js/src/base/types.d.ts +1 -0
  31. package/js/src/bigone.d.ts +3 -3
  32. package/js/src/binance.d.ts +4 -4
  33. package/js/src/binance.js +1 -0
  34. package/js/src/bingx.d.ts +3 -3
  35. package/js/src/bit2c.d.ts +2 -2
  36. package/js/src/bitbank.d.ts +2 -2
  37. package/js/src/bitbns.d.ts +2 -2
  38. package/js/src/bitfinex.d.ts +3 -3
  39. package/js/src/bitfinex2.d.ts +1 -1
  40. package/js/src/bitflyer.d.ts +2 -2
  41. package/js/src/bitget.d.ts +4 -4
  42. package/js/src/bithumb.d.ts +2 -2
  43. package/js/src/bitmart.d.ts +3 -3
  44. package/js/src/bitmart.js +2 -9
  45. package/js/src/bitmex.d.ts +4 -4
  46. package/js/src/bitopro.d.ts +4 -4
  47. package/js/src/bitrue.d.ts +3 -3
  48. package/js/src/bitso.d.ts +3 -3
  49. package/js/src/bitstamp.d.ts +3 -3
  50. package/js/src/bitteam.d.ts +4 -4
  51. package/js/src/bitvavo.d.ts +3 -3
  52. package/js/src/blockchaincom.d.ts +2 -2
  53. package/js/src/blofin.d.ts +4 -4
  54. package/js/src/btcalpha.d.ts +4 -4
  55. package/js/src/btcbox.d.ts +2 -2
  56. package/js/src/btcmarkets.d.ts +4 -4
  57. package/js/src/btcturk.d.ts +2 -2
  58. package/js/src/bybit.d.ts +3 -3
  59. package/js/src/cex.d.ts +2 -2
  60. package/js/src/coinbase.d.ts +4 -3
  61. package/js/src/coinbase.js +169 -55
  62. package/js/src/coinbaseexchange.d.ts +2 -2
  63. package/js/src/coinbaseinternational.d.ts +4 -4
  64. package/js/src/coincheck.d.ts +3 -3
  65. package/js/src/coinex.d.ts +3 -3
  66. package/js/src/coinex.js +26 -19
  67. package/js/src/coinlist.d.ts +3 -3
  68. package/js/src/coinmate.d.ts +3 -3
  69. package/js/src/coinmetro.d.ts +3 -3
  70. package/js/src/coinone.d.ts +2 -2
  71. package/js/src/coinsph.d.ts +3 -3
  72. package/js/src/cryptocom.d.ts +2 -2
  73. package/js/src/currencycom.d.ts +3 -3
  74. package/js/src/delta.d.ts +2 -2
  75. package/js/src/deribit.d.ts +3 -3
  76. package/js/src/digifinex.d.ts +3 -3
  77. package/js/src/exmo.d.ts +3 -3
  78. package/js/src/gate.d.ts +3 -3
  79. package/js/src/gemini.d.ts +3 -3
  80. package/js/src/hitbtc.d.ts +3 -3
  81. package/js/src/hollaex.d.ts +2 -2
  82. package/js/src/htx.d.ts +3 -3
  83. package/js/src/huobijp.d.ts +3 -3
  84. package/js/src/hyperliquid.d.ts +3 -3
  85. package/js/src/idex.d.ts +3 -3
  86. package/js/src/indodax.d.ts +3 -3
  87. package/js/src/kraken.d.ts +3 -3
  88. package/js/src/kraken.js +3 -1
  89. package/js/src/krakenfutures.d.ts +2 -2
  90. package/js/src/kucoin.d.ts +3 -3
  91. package/js/src/kuna.d.ts +3 -3
  92. package/js/src/latoken.d.ts +3 -3
  93. package/js/src/lbank.d.ts +2 -2
  94. package/js/src/luno.d.ts +2 -2
  95. package/js/src/lykke.d.ts +2 -2
  96. package/js/src/mercado.d.ts +2 -2
  97. package/js/src/mexc.d.ts +2 -2
  98. package/js/src/ndax.d.ts +3 -3
  99. package/js/src/novadax.d.ts +4 -4
  100. package/js/src/oceanex.d.ts +3 -3
  101. package/js/src/okcoin.d.ts +4 -4
  102. package/js/src/okx.d.ts +4 -4
  103. package/js/src/onetrading.d.ts +3 -3
  104. package/js/src/p2b.d.ts +3 -3
  105. package/js/src/paymium.d.ts +2 -2
  106. package/js/src/phemex.d.ts +5 -5
  107. package/js/src/poloniex.d.ts +4 -4
  108. package/js/src/poloniexfutures.d.ts +3 -3
  109. package/js/src/pro/binance.d.ts +9 -2
  110. package/js/src/pro/binance.js +352 -0
  111. package/js/src/pro/bitget.js +31 -1
  112. package/js/src/pro/bitmex.d.ts +4 -1
  113. package/js/src/pro/bitmex.js +108 -0
  114. package/js/src/pro/bybit.d.ts +4 -1
  115. package/js/src/pro/bybit.js +85 -0
  116. package/js/src/pro/gate.d.ts +5 -1
  117. package/js/src/pro/gate.js +183 -0
  118. package/js/src/pro/kucoinfutures.js +4 -0
  119. package/js/src/pro/okx.d.ts +8 -1
  120. package/js/src/pro/okx.js +258 -0
  121. package/js/src/probit.d.ts +4 -4
  122. package/js/src/static_dependencies/jsencrypt/lib/jsbn/jsbn.d.ts +1 -1
  123. package/js/src/timex.d.ts +3 -3
  124. package/js/src/tokocrypto.d.ts +2 -2
  125. package/js/src/tradeogre.d.ts +2 -2
  126. package/js/src/upbit.d.ts +4 -4
  127. package/js/src/wavesexchange.d.ts +2 -2
  128. package/js/src/wazirx.d.ts +4 -4
  129. package/js/src/whitebit.d.ts +4 -4
  130. package/js/src/woo.d.ts +4 -4
  131. package/js/src/woofipro.d.ts +4 -4
  132. package/js/src/yobit.d.ts +2 -2
  133. package/js/src/zaif.d.ts +3 -3
  134. package/js/src/zonda.d.ts +2 -2
  135. package/package.json +1 -1
@@ -3,6 +3,7 @@ import _binance from '../binance.js';
3
3
  interface binance {
4
4
  sapiGetSystemStatus(params?: {}): Promise<implicitReturnType>;
5
5
  sapiGetAccountSnapshot(params?: {}): Promise<implicitReturnType>;
6
+ sapiGetAccountInfo(params?: {}): Promise<implicitReturnType>;
6
7
  sapiGetMarginAsset(params?: {}): Promise<implicitReturnType>;
7
8
  sapiGetMarginPair(params?: {}): Promise<implicitReturnType>;
8
9
  sapiGetMarginAllAssets(params?: {}): Promise<implicitReturnType>;
package/js/src/ace.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import Exchange from './abstract/ace.js';
2
- import type { Balances, Dict, Int, Market, Num, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade } from './base/types.js';
2
+ import type { Balances, Dict, Int, Market, Num, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, int } from './base/types.js';
3
3
  /**
4
4
  * @class ace
5
5
  * @augments Exchange
@@ -7,7 +7,7 @@ import type { Balances, Dict, Int, Market, Num, OHLCV, Order, OrderBook, OrderSi
7
7
  export default class ace extends Exchange {
8
8
  describe(): any;
9
9
  fetchMarkets(params?: {}): Promise<Market[]>;
10
- parseMarket(market: any): Market;
10
+ parseMarket(market: Dict): Market;
11
11
  parseTicker(ticker: Dict, market?: Market): Ticker;
12
12
  fetchTicker(symbol: string, params?: {}): Promise<Ticker>;
13
13
  fetchTickers(symbols?: Strings, params?: {}): Promise<Tickers>;
@@ -31,5 +31,5 @@ export default class ace extends Exchange {
31
31
  body: any;
32
32
  headers: any;
33
33
  };
34
- handleErrors(code: any, reason: any, url: any, method: any, headers: any, body: any, response: any, requestHeaders: any, requestBody: any): any;
34
+ handleErrors(code: int, reason: string, url: string, method: string, headers: Dict, body: string, response: any, requestHeaders: any, requestBody: any): any;
35
35
  }
@@ -1,5 +1,5 @@
1
1
  import Exchange from './abstract/alpaca.js';
2
- import type { Dict, Int, Market, Num, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Trade } from './base/types.js';
2
+ import type { Dict, Int, Market, Num, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Trade, int } from './base/types.js';
3
3
  /**
4
4
  * @class alpaca
5
5
  * @augments Exchange
@@ -14,7 +14,7 @@ export default class alpaca extends Exchange {
14
14
  fetchOHLCV(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<OHLCV[]>;
15
15
  parseOHLCV(ohlcv: any, market?: Market): OHLCV;
16
16
  createOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): Promise<Order>;
17
- cancelOrder(id: string, symbol?: Str, params?: {}): Promise<any>;
17
+ cancelOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
18
18
  cancelAllOrders(symbol?: Str, params?: {}): Promise<any>;
19
19
  fetchOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
20
20
  fetchOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
@@ -30,5 +30,5 @@ export default class alpaca extends Exchange {
30
30
  body: any;
31
31
  headers: any;
32
32
  };
33
- handleErrors(code: any, reason: any, url: any, method: any, headers: any, body: any, response: any, requestHeaders: any, requestBody: any): any;
33
+ handleErrors(code: int, reason: string, url: string, method: string, headers: Dict, body: string, response: any, requestHeaders: any, requestBody: any): any;
34
34
  }
package/js/src/alpaca.js CHANGED
@@ -794,7 +794,7 @@ export default class alpaca extends Exchange {
794
794
  // "message": "order is not found."
795
795
  // }
796
796
  //
797
- return this.safeValue(response, 'message', {});
797
+ return this.parseOrder(response);
798
798
  }
799
799
  async cancelAllOrders(symbol = undefined, params = {}) {
800
800
  /**
@@ -1,5 +1,5 @@
1
1
  import Exchange from './abstract/ascendex.js';
2
- import type { TransferEntry, FundingHistory, Int, OHLCV, Order, OrderSide, OrderType, OrderRequest, Str, Trade, Balances, Transaction, Ticker, OrderBook, Tickers, Strings, Num, Currency, Market, Leverage, Leverages, Account, MarginModes, MarginMode, MarginModification, Currencies, TradingFees, Dict, LeverageTier, LeverageTiers } from './base/types.js';
2
+ import type { TransferEntry, FundingHistory, Int, OHLCV, Order, OrderSide, OrderType, OrderRequest, Str, Trade, Balances, Transaction, Ticker, OrderBook, Tickers, Strings, Num, Currency, Market, Leverage, Leverages, Account, MarginModes, MarginMode, MarginModification, Currencies, TradingFees, Dict, LeverageTier, LeverageTiers, int } from './base/types.js';
3
3
  /**
4
4
  * @class ascendex
5
5
  * @augments Exchange
@@ -46,7 +46,7 @@ export default class ascendex extends Exchange {
46
46
  fetchDeposits(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
47
47
  fetchWithdrawals(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
48
48
  fetchDepositsWithdrawals(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
49
- parseTransactionStatus(status: any): string;
49
+ parseTransactionStatus(status: Str): string;
50
50
  parseTransaction(transaction: Dict, currency?: Currency): Transaction;
51
51
  fetchPositions(symbols?: Strings, params?: {}): Promise<import("./base/types.js").Position[]>;
52
52
  parsePosition(position: Dict, market?: Market): import("./base/types.js").Position;
@@ -103,5 +103,5 @@ export default class ascendex extends Exchange {
103
103
  body: any;
104
104
  headers: any;
105
105
  };
106
- handleErrors(httpCode: any, reason: any, url: any, method: any, headers: any, body: any, response: any, requestHeaders: any, requestBody: any): any;
106
+ handleErrors(httpCode: int, reason: string, url: string, method: string, headers: Dict, body: string, response: any, requestHeaders: any, requestBody: any): any;
107
107
  }
@@ -3,7 +3,7 @@ import { // eslint-disable-line object-curly-newline
3
3
  ExchangeError, AuthenticationError, DDoSProtection, RequestTimeout, ExchangeNotAvailable, RateLimitExceeded } from "./errors.js";
4
4
  import WsClient from './ws/WsClient.js';
5
5
  import { OrderBook as WsOrderBook, IndexedOrderBook, CountedOrderBook } from './ws/OrderBook.js';
6
- 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, TransferEntries, FundingRates, LeverageTiers, Bool } from './types.js';
6
+ 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, TransferEntries, FundingRates, LeverageTiers, Bool, int } from './types.js';
7
7
  export type { Market, Trade, Fee, Ticker, OHLCV, OHLCVC, Order, OrderBook, Balance, Balances, Dictionary, Transaction, DepositAddressResponse, Currency, MinMax, IndexType, Int, Bool, OrderType, OrderSide, Position, LedgerEntry, BorrowInterest, OpenInterest, LeverageTier, TransferEntry, CrossBorrowRate, FundingRateHistory, Liquidation, FundingHistory, OrderRequest, MarginMode, Tickers, Greeks, Option, OptionChain, Str, Num, MarketInterface, CurrencyInterface, BalanceAccount, MarginModes, MarketType, Leverage, Leverages, LastPrice, LastPrices, Account, Strings, Conversion } from './types.js';
8
8
  import { ArrayCache, ArrayCacheByTimestamp } from './ws/Cache.js';
9
9
  import { OrderBook as Ob } from './ws/OrderBook.js';
@@ -76,6 +76,7 @@ export default class Exchange {
76
76
  walletAddress: string;
77
77
  token: string;
78
78
  balance: {};
79
+ liquidations: Dictionary<Liquidation>;
79
80
  orderbooks: Dictionary<Ob>;
80
81
  tickers: Dictionary<Ticker>;
81
82
  fundingRates: Dictionary<FundingRate>;
@@ -85,6 +86,7 @@ export default class Exchange {
85
86
  trades: Dictionary<ArrayCache>;
86
87
  transactions: {};
87
88
  ohlcvs: Dictionary<Dictionary<ArrayCacheByTimestamp>>;
89
+ myLiquidations: Dictionary<Liquidation>;
88
90
  myTrades: ArrayCache;
89
91
  positions: any;
90
92
  urls: {
@@ -498,6 +500,10 @@ export default class Exchange {
498
500
  watchTickers: any;
499
501
  watchTrades: any;
500
502
  watchTradesForSymbols: any;
503
+ watchLiquidations: any;
504
+ watchLiquidationsForSymbols: any;
505
+ watchMyLiquidations: any;
506
+ watchMyLiquidationsForSymbols: any;
501
507
  withdraw: any;
502
508
  ws: any;
503
509
  };
@@ -689,6 +695,10 @@ export default class Exchange {
689
695
  fetchAccounts(params?: {}): Promise<Account[]>;
690
696
  fetchTrades(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
691
697
  fetchTradesWs(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
698
+ watchLiquidations(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<Liquidation[]>;
699
+ watchLiquidationsForSymbols(symbols: string[], since?: Int, limit?: Int, params?: {}): Promise<Liquidation[]>;
700
+ watchMyLiquidations(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<Liquidation[]>;
701
+ watchMyLiquidationsForSymbols(symbols: string[], since?: Int, limit?: Int, params?: {}): Promise<Liquidation[]>;
692
702
  watchTrades(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
693
703
  watchTradesForSymbols(symbols: string[], since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
694
704
  watchMyTradesForSymbols(symbols: string[], since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
@@ -703,7 +713,7 @@ export default class Exchange {
703
713
  watchOrderBook(symbol: string, limit?: Int, params?: {}): Promise<OrderBook>;
704
714
  fetchTime(params?: {}): Promise<Int>;
705
715
  fetchTradingLimits(symbols?: Strings, params?: {}): Promise<{}>;
706
- parseMarket(market: any): Market;
716
+ parseMarket(market: Dict): Market;
707
717
  parseMarkets(markets: any): Market[];
708
718
  parseTicker(ticker: Dict, market?: Market): Ticker;
709
719
  parseDepositAddress(depositAddress: any, currency?: Currency): object;
@@ -797,6 +807,7 @@ export default class Exchange {
797
807
  };
798
808
  safeLiquidation(liquidation: object, market?: Market): Liquidation;
799
809
  safeTrade(trade: object, market?: Market): Trade;
810
+ findNearestCeiling(arr: number[], providedValue: number): number;
800
811
  invertFlatStringDictionary(dict: any): {};
801
812
  reduceFeesByCurrency(fees: any): any[];
802
813
  safeTicker(ticker: object, market?: Market): Ticker;
@@ -909,7 +920,7 @@ export default class Exchange {
909
920
  throwExactlyMatchedException(exact: any, string: any, message: any): void;
910
921
  throwBroadlyMatchedException(broad: any, string: any, message: any): void;
911
922
  findBroadlyMatchedKey(broad: any, string: any): string;
912
- handleErrors(statusCode: any, statusText: any, url: any, method: any, responseHeaders: any, responseBody: any, response: any, requestHeaders: any, requestBody: any): any;
923
+ handleErrors(statusCode: int, statusText: string, url: string, method: string, responseHeaders: Dict, responseBody: string, response: any, requestHeaders: any, requestBody: any): any;
913
924
  calculateRateLimiterCost(api: any, method: any, path: any, params: any, config?: {}): any;
914
925
  fetchTicker(symbol: string, params?: {}): Promise<Ticker>;
915
926
  fetchTickerWs(symbol: string, params?: {}): Promise<Ticker>;
@@ -60,6 +60,7 @@ export default class Exchange {
60
60
  this.verbose = false;
61
61
  this.twofa = undefined; // two-factor authentication (2FA)
62
62
  this.balance = {};
63
+ this.liquidations = {};
63
64
  this.orderbooks = {};
64
65
  this.tickers = {};
65
66
  this.fundingRates = {};
@@ -67,6 +68,7 @@ export default class Exchange {
67
68
  this.orders = undefined;
68
69
  this.triggerOrders = undefined;
69
70
  this.transactions = {};
71
+ this.myLiquidations = {};
70
72
  this.requiresWeb3 = false;
71
73
  this.requiresEddsa = false;
72
74
  this.enableLastJsonResponse = true;
@@ -264,10 +266,12 @@ export default class Exchange {
264
266
  this.balance = {};
265
267
  this.orderbooks = {};
266
268
  this.tickers = {};
269
+ this.liquidations = {};
267
270
  this.orders = undefined;
268
271
  this.trades = {};
269
272
  this.transactions = {};
270
273
  this.ohlcvs = {};
274
+ this.myLiquidations = {};
271
275
  this.myTrades = undefined;
272
276
  this.positions = undefined;
273
277
  // web3 and cryptography flags
@@ -558,6 +562,10 @@ export default class Exchange {
558
562
  'watchTickers': undefined,
559
563
  'watchTrades': undefined,
560
564
  'watchTradesForSymbols': undefined,
565
+ 'watchLiquidations': undefined,
566
+ 'watchLiquidationsForSymbols': undefined,
567
+ 'watchMyLiquidations': undefined,
568
+ 'watchMyLiquidationsForSymbols': undefined,
561
569
  'withdraw': undefined,
562
570
  'ws': undefined,
563
571
  },
@@ -1914,6 +1922,24 @@ export default class Exchange {
1914
1922
  async fetchTradesWs(symbol, since = undefined, limit = undefined, params = {}) {
1915
1923
  throw new NotSupported(this.id + ' fetchTradesWs() is not supported yet');
1916
1924
  }
1925
+ async watchLiquidations(symbol, since = undefined, limit = undefined, params = {}) {
1926
+ if (this.has['watchLiquidationsForSymbols']) {
1927
+ return this.watchLiquidationsForSymbols([symbol], since, limit, params);
1928
+ }
1929
+ throw new NotSupported(this.id + ' watchLiquidations() is not supported yet');
1930
+ }
1931
+ async watchLiquidationsForSymbols(symbols, since = undefined, limit = undefined, params = {}) {
1932
+ throw new NotSupported(this.id + ' watchLiquidationsForSymbols() is not supported yet');
1933
+ }
1934
+ async watchMyLiquidations(symbol, since = undefined, limit = undefined, params = {}) {
1935
+ if (this.has['watchMyLiquidationsForSymbols']) {
1936
+ return this.watchMyLiquidationsForSymbols([symbol], since, limit, params);
1937
+ }
1938
+ throw new NotSupported(this.id + ' watchMyLiquidations() is not supported yet');
1939
+ }
1940
+ async watchMyLiquidationsForSymbols(symbols, since = undefined, limit = undefined, params = {}) {
1941
+ throw new NotSupported(this.id + ' watchMyLiquidationsForSymbols() is not supported yet');
1942
+ }
1917
1943
  async watchTrades(symbol, since = undefined, limit = undefined, params = {}) {
1918
1944
  throw new NotSupported(this.id + ' watchTrades() is not supported yet');
1919
1945
  }
@@ -2923,6 +2949,17 @@ export default class Exchange {
2923
2949
  trade['cost'] = this.parseNumber(cost);
2924
2950
  return trade;
2925
2951
  }
2952
+ findNearestCeiling(arr, providedValue) {
2953
+ // i.e. findNearestCeiling ([ 10, 30, 50], 23) returns 30
2954
+ const length = arr.length;
2955
+ for (let i = 0; i < length; i++) {
2956
+ const current = arr[i];
2957
+ if (providedValue <= current) {
2958
+ return current;
2959
+ }
2960
+ }
2961
+ return arr[length - 1];
2962
+ }
2926
2963
  invertFlatStringDictionary(dict) {
2927
2964
  const reversed = {};
2928
2965
  const keys = Object.keys(dict);
@@ -1,4 +1,5 @@
1
1
  export declare type Int = number | undefined;
2
+ export declare type int = number;
2
3
  export declare type Str = string | undefined;
3
4
  export declare type Strings = string[] | undefined;
4
5
  export declare type Num = number | undefined;
@@ -1,5 +1,5 @@
1
1
  import Exchange from './abstract/bigone.js';
2
- import type { TransferEntry, Balances, Currency, Int, Market, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, Num, Currencies, Dict } from './base/types.js';
2
+ import type { TransferEntry, Balances, Currency, Int, Market, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, Num, Currencies, Dict, int } from './base/types.js';
3
3
  /**
4
4
  * @class bigone
5
5
  * @augments Exchange
@@ -47,7 +47,7 @@ export default class bigone extends Exchange {
47
47
  network: string;
48
48
  info: any;
49
49
  }>;
50
- parseTransactionStatus(status: any): string;
50
+ parseTransactionStatus(status: Str): string;
51
51
  parseTransaction(transaction: Dict, currency?: Currency): Transaction;
52
52
  fetchDeposits(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
53
53
  fetchWithdrawals(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
@@ -55,5 +55,5 @@ export default class bigone extends Exchange {
55
55
  parseTransfer(transfer: Dict, currency?: Currency): TransferEntry;
56
56
  parseTransferStatus(status: Str): Str;
57
57
  withdraw(code: string, amount: number, address: string, tag?: any, params?: {}): Promise<Transaction>;
58
- handleErrors(httpCode: any, reason: any, url: any, method: any, headers: any, body: any, response: any, requestHeaders: any, requestBody: any): any;
58
+ handleErrors(httpCode: int, reason: string, url: string, method: string, headers: Dict, body: string, response: any, requestHeaders: any, requestBody: any): any;
59
59
  }
@@ -1,5 +1,5 @@
1
1
  import Exchange from './abstract/binance.js';
2
- import type { TransferEntry, Int, OrderSide, Balances, OrderType, Trade, OHLCV, Order, FundingRateHistory, OpenInterest, Liquidation, OrderRequest, Str, Transaction, Ticker, OrderBook, Tickers, Market, Greeks, Strings, Currency, MarketInterface, MarginMode, MarginModes, Leverage, Leverages, Num, Option, MarginModification, TradingFeeInterface, Currencies, TradingFees, Conversion, CrossBorrowRate, IsolatedBorrowRates, IsolatedBorrowRate, Dict, TransferEntries, LeverageTier, LeverageTiers } from './base/types.js';
2
+ import type { TransferEntry, Int, OrderSide, Balances, OrderType, Trade, OHLCV, Order, FundingRateHistory, OpenInterest, Liquidation, OrderRequest, Str, Transaction, Ticker, OrderBook, Tickers, Market, Greeks, Strings, Currency, MarketInterface, MarginMode, MarginModes, Leverage, Leverages, Num, Option, MarginModification, TradingFeeInterface, Currencies, TradingFees, Conversion, CrossBorrowRate, IsolatedBorrowRates, IsolatedBorrowRate, Dict, TransferEntries, LeverageTier, LeverageTiers, int } from './base/types.js';
3
3
  /**
4
4
  * @class binance
5
5
  * @augments Exchange
@@ -18,7 +18,7 @@ export default class binance extends Exchange {
18
18
  fetchTime(params?: {}): Promise<number>;
19
19
  fetchCurrencies(params?: {}): Promise<Currencies>;
20
20
  fetchMarkets(params?: {}): Promise<Market[]>;
21
- parseMarket(market: any): Market;
21
+ parseMarket(market: Dict): Market;
22
22
  parseBalanceHelper(entry: any): import("./base/types.js").BalanceAccount;
23
23
  parseBalanceCustom(response: any, type?: any, marginMode?: any, isPortfolioMargin?: boolean): Balances;
24
24
  fetchBalance(params?: {}): Promise<Balances>;
@@ -272,8 +272,8 @@ export default class binance extends Exchange {
272
272
  body: any;
273
273
  headers: any;
274
274
  };
275
- getExceptionsByUrl(url: any, exactOrBroad: any): import("./base/types.js").Dictionary<any>;
276
- handleErrors(code: any, reason: any, url: any, method: any, headers: any, body: any, response: any, requestHeaders: any, requestBody: any): any;
275
+ getExceptionsByUrl(url: string, exactOrBroad: string): import("./base/types.js").Dictionary<any>;
276
+ handleErrors(code: int, reason: string, url: string, method: string, headers: Dict, body: string, response: any, requestHeaders: any, requestBody: any): any;
277
277
  calculateRateLimiterCost(api: any, method: any, path: any, params: any, config?: {}): any;
278
278
  request(path: any, api?: string, method?: string, params?: {}, headers?: any, body?: any, config?: {}): Promise<any>;
279
279
  modifyMarginHelper(symbol: string, amount: any, addOrReduce: any, params?: {}): Promise<any>;
package/js/src/binance.js CHANGED
@@ -242,6 +242,7 @@ export default class binance extends Exchange {
242
242
  'system/status': 0.1,
243
243
  // these endpoints require this.apiKey
244
244
  'accountSnapshot': 240,
245
+ 'account/info': 0.1,
245
246
  'margin/asset': 1,
246
247
  'margin/pair': 1,
247
248
  'margin/allAssets': 0.1,
package/js/src/bingx.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import Exchange from './abstract/bingx.js';
2
- import type { TransferEntry, Int, OrderSide, OHLCV, FundingRateHistory, Order, OrderType, OrderRequest, Str, Trade, Balances, Transaction, Ticker, OrderBook, Tickers, Market, Strings, Currency, Position, Dict, Leverage, MarginMode, Num, MarginModification, Currencies, TransferEntries } from './base/types.js';
2
+ import type { TransferEntry, Int, OrderSide, OHLCV, FundingRateHistory, Order, OrderType, OrderRequest, Str, Trade, Balances, Transaction, Ticker, OrderBook, Tickers, Market, Strings, Currency, Position, Dict, Leverage, MarginMode, Num, MarginModification, Currencies, TransferEntries, int } from './base/types.js';
3
3
  /**
4
4
  * @class bingx
5
5
  * @augments Exchange
@@ -10,7 +10,7 @@ export default class bingx extends Exchange {
10
10
  fetchCurrencies(params?: {}): Promise<Currencies>;
11
11
  fetchSpotMarkets(params: any): Promise<import("./base/types.js").MarketInterface[]>;
12
12
  fetchSwapMarkets(params: any): Promise<import("./base/types.js").MarketInterface[]>;
13
- parseMarket(market: any): Market;
13
+ parseMarket(market: Dict): Market;
14
14
  fetchMarkets(params?: {}): Promise<Market[]>;
15
15
  fetchOHLCV(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<OHLCV[]>;
16
16
  parseOHLCV(ohlcv: any, market?: Market): OHLCV;
@@ -133,5 +133,5 @@ export default class bingx extends Exchange {
133
133
  };
134
134
  nonce(): number;
135
135
  setSandboxMode(enable: boolean): void;
136
- handleErrors(httpCode: any, reason: any, url: any, method: any, headers: any, body: any, response: any, requestHeaders: any, requestBody: any): any;
136
+ handleErrors(httpCode: int, reason: string, url: string, method: string, headers: Dict, body: string, response: any, requestHeaders: any, requestBody: any): any;
137
137
  }
package/js/src/bit2c.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import Exchange from './abstract/bit2c.js';
2
- import type { Balances, Currency, Dict, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Ticker, Trade, TradingFees } from './base/types.js';
2
+ import type { Balances, Currency, Dict, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Ticker, Trade, TradingFees, int } from './base/types.js';
3
3
  /**
4
4
  * @class bit2c
5
5
  * @augments Exchange
@@ -43,5 +43,5 @@ export default class bit2c extends Exchange {
43
43
  body: any;
44
44
  headers: any;
45
45
  };
46
- handleErrors(httpCode: any, reason: any, url: any, method: any, headers: any, body: any, response: any, requestHeaders: any, requestBody: any): any;
46
+ handleErrors(httpCode: int, reason: string, url: string, method: string, headers: Dict, body: string, response: any, requestHeaders: any, requestBody: any): any;
47
47
  }
@@ -1,5 +1,5 @@
1
1
  import Exchange from './abstract/bitbank.js';
2
- import type { Balances, Currency, Dict, Int, Market, Num, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Ticker, Trade, TradingFees, Transaction } from './base/types.js';
2
+ import type { Balances, Currency, Dict, Int, Market, Num, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Ticker, Trade, TradingFees, Transaction, int } from './base/types.js';
3
3
  /**
4
4
  * @class bitbank
5
5
  * @augments Exchange
@@ -41,5 +41,5 @@ export default class bitbank extends Exchange {
41
41
  body: any;
42
42
  headers: any;
43
43
  };
44
- handleErrors(httpCode: any, reason: any, url: any, method: any, headers: any, body: any, response: any, requestHeaders: any, requestBody: any): any;
44
+ handleErrors(httpCode: int, reason: string, url: string, method: string, headers: Dict, body: string, response: any, requestHeaders: any, requestBody: any): any;
45
45
  }
@@ -1,5 +1,5 @@
1
1
  import Exchange from './abstract/bitbns.js';
2
- import type { Balances, Currency, Dict, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction } from './base/types.js';
2
+ import type { Balances, Currency, Dict, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, int } from './base/types.js';
3
3
  /**
4
4
  * @class bitbns
5
5
  * @augments Exchange
@@ -46,5 +46,5 @@ export default class bitbns extends Exchange {
46
46
  body: any;
47
47
  headers: any;
48
48
  };
49
- handleErrors(httpCode: any, reason: any, url: any, method: any, headers: any, body: any, response: any, requestHeaders: any, requestBody: any): any;
49
+ handleErrors(httpCode: int, reason: string, url: string, method: string, headers: Dict, body: string, response: any, requestHeaders: any, requestBody: any): any;
50
50
  }
@@ -1,5 +1,5 @@
1
1
  import Exchange from './abstract/bitfinex.js';
2
- import type { TransferEntry, Balances, Currency, Int, Market, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, Num, TradingFees, Dict } from './base/types.js';
2
+ import type { TransferEntry, Balances, Currency, Int, Market, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, Num, TradingFees, Dict, int } from './base/types.js';
3
3
  /**
4
4
  * @class bitfinex
5
5
  * @augments Exchange
@@ -63,7 +63,7 @@ export default class bitfinex extends Exchange {
63
63
  }>;
64
64
  fetchDepositsWithdrawals(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
65
65
  parseTransaction(transaction: Dict, currency?: Currency): Transaction;
66
- parseTransactionStatus(status: any): string;
66
+ parseTransactionStatus(status: Str): string;
67
67
  withdraw(code: string, amount: number, address: string, tag?: any, params?: {}): Promise<Transaction>;
68
68
  fetchPositions(symbols?: Strings, params?: {}): Promise<any>;
69
69
  nonce(): number;
@@ -73,5 +73,5 @@ export default class bitfinex extends Exchange {
73
73
  body: any;
74
74
  headers: any;
75
75
  };
76
- handleErrors(code: any, reason: any, url: any, method: any, headers: any, body: any, response: any, requestHeaders: any, requestBody: any): any;
76
+ handleErrors(code: int, reason: string, url: string, method: string, headers: Dict, body: string, response: any, requestHeaders: any, requestBody: any): any;
77
77
  }
@@ -64,7 +64,7 @@ export default class bitfinex2 extends Exchange {
64
64
  network: any;
65
65
  info: any;
66
66
  }>;
67
- parseTransactionStatus(status: any): string;
67
+ parseTransactionStatus(status: Str): string;
68
68
  parseTransaction(transaction: Dict, currency?: Currency): Transaction;
69
69
  fetchTradingFees(params?: {}): Promise<TradingFees>;
70
70
  fetchDepositsWithdrawals(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
@@ -1,5 +1,5 @@
1
1
  import Exchange from './abstract/bitflyer.js';
2
- import type { Balances, Currency, Dict, Int, Market, MarketInterface, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Trade, TradingFeeInterface, Transaction } from './base/types.js';
2
+ import type { Balances, Currency, Dict, Int, Market, MarketInterface, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Trade, TradingFeeInterface, Transaction, int } from './base/types.js';
3
3
  /**
4
4
  * @class bitflyer
5
5
  * @augments Exchange
@@ -39,5 +39,5 @@ export default class bitflyer extends Exchange {
39
39
  body: any;
40
40
  headers: any;
41
41
  };
42
- handleErrors(code: any, reason: any, url: any, method: any, headers: any, body: any, response: any, requestHeaders: any, requestBody: any): any;
42
+ handleErrors(code: int, reason: string, url: string, method: string, headers: Dict, body: string, response: any, requestHeaders: any, requestBody: any): any;
43
43
  }
@@ -1,5 +1,5 @@
1
1
  import Exchange from './abstract/bitget.js';
2
- import type { Int, OrderSide, OrderType, Trade, OHLCV, Order, FundingRateHistory, OrderRequest, FundingHistory, Balances, Str, Transaction, Ticker, OrderBook, Tickers, Market, Strings, Currency, Position, Liquidation, TransferEntry, Leverage, MarginMode, Num, MarginModification, TradingFeeInterface, Currencies, TradingFees, Conversion, CrossBorrowRate, IsolatedBorrowRate, Dict, TransferEntries, LeverageTier } from './base/types.js';
2
+ import type { Int, OrderSide, OrderType, Trade, OHLCV, Order, FundingRateHistory, OrderRequest, FundingHistory, Balances, Str, Transaction, Ticker, OrderBook, Tickers, Market, Strings, Currency, Position, Liquidation, TransferEntry, Leverage, MarginMode, Num, MarginModification, TradingFeeInterface, Currencies, TradingFees, Conversion, CrossBorrowRate, IsolatedBorrowRate, Dict, TransferEntries, LeverageTier, int } from './base/types.js';
3
3
  /**
4
4
  * @class bitget
5
5
  * @augments Exchange
@@ -11,7 +11,7 @@ export default class bitget extends Exchange {
11
11
  handleProductTypeAndParams(market?: any, params?: {}): {}[];
12
12
  fetchTime(params?: {}): Promise<number>;
13
13
  fetchMarkets(params?: {}): Promise<Market[]>;
14
- parseMarket(market: any): Market;
14
+ parseMarket(market: Dict): Market;
15
15
  fetchMarketsByType(type: any, params?: {}): Promise<import("./base/types.js").MarketInterface[]>;
16
16
  fetchCurrencies(params?: {}): Promise<Currencies>;
17
17
  fetchMarketLeverageTiers(symbol: string, params?: {}): Promise<LeverageTier[]>;
@@ -20,7 +20,7 @@ export default class bitget extends Exchange {
20
20
  withdraw(code: string, amount: number, address: string, tag?: any, params?: {}): Promise<Transaction>;
21
21
  fetchWithdrawals(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
22
22
  parseTransaction(transaction: Dict, currency?: Currency): Transaction;
23
- parseTransactionStatus(status: any): string;
23
+ parseTransactionStatus(status: Str): string;
24
24
  fetchDepositAddress(code: string, params?: {}): Promise<{
25
25
  currency: string;
26
26
  address: string;
@@ -240,7 +240,7 @@ export default class bitget extends Exchange {
240
240
  fetchConvertTradeHistory(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Conversion[]>;
241
241
  parseConversion(conversion: Dict, fromCurrency?: Currency, toCurrency?: Currency): Conversion;
242
242
  fetchConvertCurrencies(params?: {}): Promise<Currencies>;
243
- handleErrors(code: any, reason: any, url: any, method: any, headers: any, body: any, response: any, requestHeaders: any, requestBody: any): any;
243
+ handleErrors(code: int, reason: string, url: string, method: string, headers: Dict, body: string, response: any, requestHeaders: any, requestBody: any): any;
244
244
  sign(path: any, api?: any[], method?: string, params?: {}, headers?: any, body?: any): {
245
245
  url: string;
246
246
  method: string;
@@ -1,5 +1,5 @@
1
1
  import Exchange from './abstract/bithumb.js';
2
- import type { Balances, Currency, Dict, Int, Market, MarketInterface, Num, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction } from './base/types.js';
2
+ import type { Balances, Currency, Dict, Int, Market, MarketInterface, Num, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, int } from './base/types.js';
3
3
  /**
4
4
  * @class bithumb
5
5
  * @augments Exchange
@@ -36,5 +36,5 @@ export default class bithumb extends Exchange {
36
36
  body: any;
37
37
  headers: any;
38
38
  };
39
- handleErrors(httpCode: any, reason: any, url: any, method: any, headers: any, body: any, response: any, requestHeaders: any, requestBody: any): any;
39
+ handleErrors(httpCode: int, reason: string, url: string, method: string, headers: Dict, body: string, response: any, requestHeaders: any, requestBody: any): any;
40
40
  }
@@ -1,5 +1,5 @@
1
1
  import Exchange from './abstract/bitmart.js';
2
- import type { Int, OrderSide, Balances, OrderType, OHLCV, Order, Str, Trade, Transaction, Ticker, OrderBook, Tickers, Strings, Currency, Market, TransferEntry, Num, TradingFeeInterface, Currencies, IsolatedBorrowRates, IsolatedBorrowRate, Dict, TransferEntries, OrderRequest } from './base/types.js';
2
+ import type { Int, OrderSide, Balances, OrderType, OHLCV, Order, Str, Trade, Transaction, Ticker, OrderBook, Tickers, Strings, Currency, Market, TransferEntry, Num, TradingFeeInterface, Currencies, IsolatedBorrowRates, IsolatedBorrowRate, Dict, TransferEntries, OrderRequest, int } from './base/types.js';
3
3
  /**
4
4
  * @class bitmart
5
5
  * @augments Exchange
@@ -88,7 +88,7 @@ export default class bitmart extends Exchange {
88
88
  fetchDeposits(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
89
89
  fetchWithdrawal(id: string, code?: Str, params?: {}): Promise<Transaction>;
90
90
  fetchWithdrawals(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
91
- parseTransactionStatus(status: any): string;
91
+ parseTransactionStatus(status: Str): string;
92
92
  parseTransaction(transaction: Dict, currency?: Currency): Transaction;
93
93
  repayIsolatedMargin(symbol: string, code: string, amount: any, params?: {}): Promise<any>;
94
94
  borrowIsolatedMargin(symbol: string, code: string, amount: number, params?: {}): Promise<any>;
@@ -175,5 +175,5 @@ export default class bitmart extends Exchange {
175
175
  body: any;
176
176
  headers: any;
177
177
  };
178
- handleErrors(code: any, reason: any, url: any, method: any, headers: any, body: any, response: any, requestHeaders: any, requestBody: any): any;
178
+ handleErrors(code: int, reason: string, url: string, method: string, headers: Dict, body: string, response: any, requestHeaders: any, requestBody: any): any;
179
179
  }
package/js/src/bitmart.js CHANGED
@@ -1185,16 +1185,9 @@ export default class bitmart extends Exchange {
1185
1185
  market = this.safeMarket(marketId, market);
1186
1186
  const symbol = market['symbol'];
1187
1187
  const last = this.safeString2(ticker, 'close_24h', 'last_price');
1188
- let percentage = this.safeString(ticker, 'price_change_percent_24h');
1188
+ let percentage = Precise.stringAbs(this.safeString(ticker, 'price_change_percent_24h'));
1189
1189
  if (percentage === undefined) {
1190
- const percentageRaw = this.safeString(ticker, 'fluctuation');
1191
- if ((percentageRaw !== undefined) && (percentageRaw !== '0')) { // a few tickers show strictly '0' in fluctuation field
1192
- const direction = percentageRaw[0];
1193
- percentage = direction + Precise.stringMul(percentageRaw.replace(direction, ''), '100');
1194
- }
1195
- else if (percentageRaw === '0') {
1196
- percentage = '0';
1197
- }
1190
+ percentage = Precise.stringAbs(Precise.stringMul(this.safeString(ticker, 'fluctuation'), '100'));
1198
1191
  }
1199
1192
  let baseVolume = this.safeString(ticker, 'base_volume_24h');
1200
1193
  let quoteVolume = this.safeString(ticker, 'quote_volume_24h');
@@ -1,5 +1,5 @@
1
1
  import Exchange from './abstract/bitmex.js';
2
- import type { Int, OrderSide, OrderType, Trade, OHLCV, Order, Liquidation, OrderBook, Balances, Str, Dict, Transaction, Ticker, Tickers, Market, Strings, Currency, Leverage, Leverages, Num, Currencies } from './base/types.js';
2
+ import type { Int, OrderSide, OrderType, Trade, OHLCV, Order, Liquidation, OrderBook, Balances, Str, Dict, Transaction, Ticker, Tickers, Market, Strings, Currency, Leverage, Leverages, Num, Currencies, int } from './base/types.js';
3
3
  /**
4
4
  * @class bitmex
5
5
  * @augments Exchange
@@ -13,7 +13,7 @@ export default class bitmex extends Exchange {
13
13
  convertFromRawQuantity(symbol: any, rawQuantity: any, currencySide?: string): number;
14
14
  convertFromRawCost(symbol: any, rawQuantity: any): number;
15
15
  fetchMarkets(params?: {}): Promise<Market[]>;
16
- parseMarket(market: any): Market;
16
+ parseMarket(market: Dict): Market;
17
17
  parseBalance(response: any): Balances;
18
18
  fetchBalance(params?: {}): Promise<Balances>;
19
19
  fetchOrderBook(symbol: string, limit?: Int, params?: {}): Promise<OrderBook>;
@@ -45,7 +45,7 @@ export default class bitmex extends Exchange {
45
45
  };
46
46
  fetchLedger(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<any>;
47
47
  fetchDepositsWithdrawals(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
48
- parseTransactionStatus(status: any): string;
48
+ parseTransactionStatus(status: Str): string;
49
49
  parseTransaction(transaction: Dict, currency?: Currency): Transaction;
50
50
  fetchTicker(symbol: string, params?: {}): Promise<Ticker>;
51
51
  fetchTickers(symbols?: Strings, params?: {}): Promise<Tickers>;
@@ -110,7 +110,7 @@ export default class bitmex extends Exchange {
110
110
  calculateRateLimiterCost(api: any, method: any, path: any, params: any, config?: {}): any;
111
111
  fetchLiquidations(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<Liquidation[]>;
112
112
  parseLiquidation(liquidation: any, market?: Market): Liquidation;
113
- handleErrors(code: any, reason: any, url: any, method: any, headers: any, body: any, response: any, requestHeaders: any, requestBody: any): any;
113
+ handleErrors(code: int, reason: string, url: string, method: string, headers: Dict, body: string, response: any, requestHeaders: any, requestBody: any): any;
114
114
  nonce(): number;
115
115
  sign(path: any, api?: string, method?: string, params?: {}, headers?: any, body?: any): {
116
116
  url: string;
@@ -1,5 +1,5 @@
1
1
  import Exchange from './abstract/bitopro.js';
2
- import type { Balances, Currencies, Currency, Dict, Int, Market, Num, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFees, Transaction } from './base/types.js';
2
+ import type { Balances, Currencies, Currency, Dict, Int, Market, Num, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFees, Transaction, int } from './base/types.js';
3
3
  /**
4
4
  * @class bitopro
5
5
  * @augments Exchange
@@ -8,7 +8,7 @@ export default class bitopro extends Exchange {
8
8
  describe(): any;
9
9
  fetchCurrencies(params?: {}): Promise<Currencies>;
10
10
  fetchMarkets(params?: {}): Promise<Market[]>;
11
- parseMarket(market: any): Market;
11
+ parseMarket(market: Dict): Market;
12
12
  parseTicker(ticker: Dict, market?: Market): Ticker;
13
13
  fetchTicker(symbol: string, params?: {}): Promise<Ticker>;
14
14
  fetchTickers(symbols?: Strings, params?: {}): Promise<Tickers>;
@@ -32,7 +32,7 @@ export default class bitopro extends Exchange {
32
32
  fetchOpenOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
33
33
  fetchClosedOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
34
34
  fetchMyTrades(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
35
- parseTransactionStatus(status: any): string;
35
+ parseTransactionStatus(status: Str): string;
36
36
  parseTransaction(transaction: Dict, currency?: Currency): Transaction;
37
37
  fetchDeposits(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
38
38
  fetchWithdrawals(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
@@ -57,5 +57,5 @@ export default class bitopro extends Exchange {
57
57
  body: any;
58
58
  headers: any;
59
59
  };
60
- handleErrors(code: any, reason: any, url: any, method: any, headers: any, body: any, response: any, requestHeaders: any, requestBody: any): any;
60
+ handleErrors(code: int, reason: string, url: string, method: string, headers: Dict, body: string, response: any, requestHeaders: any, requestBody: any): any;
61
61
  }
@@ -1,5 +1,5 @@
1
1
  import Exchange from './abstract/bitrue.js';
2
- import type { Balances, Currencies, Currency, Dict, Int, MarginModification, Market, Num, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntries, TransferEntry } from './base/types.js';
2
+ import type { Balances, Currencies, Currency, Dict, Int, MarginModification, Market, Num, OHLCV, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, Transaction, TransferEntries, TransferEntry, int } from './base/types.js';
3
3
  /**
4
4
  * @class bitrue
5
5
  * @augments Exchange
@@ -19,7 +19,7 @@ export default class bitrue extends Exchange {
19
19
  safeNetwork(networkId: any): string;
20
20
  fetchCurrencies(params?: {}): Promise<Currencies>;
21
21
  fetchMarkets(params?: {}): Promise<Market[]>;
22
- parseMarket(market: any): Market;
22
+ parseMarket(market: Dict): Market;
23
23
  parseBalance(response: any): Balances;
24
24
  fetchBalance(params?: {}): Promise<Balances>;
25
25
  fetchOrderBook(symbol: string, limit?: Int, params?: {}): Promise<OrderBook>;
@@ -70,6 +70,6 @@ export default class bitrue extends Exchange {
70
70
  body: any;
71
71
  headers: any;
72
72
  };
73
- handleErrors(code: any, reason: any, url: any, method: any, headers: any, body: any, response: any, requestHeaders: any, requestBody: any): any;
73
+ handleErrors(code: int, reason: string, url: string, method: string, headers: Dict, body: string, response: any, requestHeaders: any, requestBody: any): any;
74
74
  calculateRateLimiterCost(api: any, method: any, path: any, params: any, config?: {}): any;
75
75
  }