ccxt 4.1.12 → 4.1.13

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 (86) hide show
  1. package/README.md +3 -3
  2. package/dist/ccxt.browser.js +947 -15
  3. package/dist/ccxt.browser.min.js +2 -2
  4. package/dist/cjs/ccxt.js +1 -1
  5. package/dist/cjs/src/ace.js +1 -0
  6. package/dist/cjs/src/alpaca.js +1 -0
  7. package/dist/cjs/src/base/Exchange.js +30 -0
  8. package/dist/cjs/src/bigone.js +1 -0
  9. package/dist/cjs/src/binance.js +231 -1
  10. package/dist/cjs/src/bingx.js +1 -0
  11. package/dist/cjs/src/bitbank.js +1 -0
  12. package/dist/cjs/src/bitbns.js +1 -0
  13. package/dist/cjs/src/bitfinex.js +1 -0
  14. package/dist/cjs/src/bitfinex2.js +1 -0
  15. package/dist/cjs/src/bitflyer.js +1 -0
  16. package/dist/cjs/src/bitforex.js +1 -0
  17. package/dist/cjs/src/bitget.js +11 -2
  18. package/dist/cjs/src/bithumb.js +1 -0
  19. package/dist/cjs/src/bitmart.js +103 -0
  20. package/dist/cjs/src/bitmex.js +70 -0
  21. package/dist/cjs/src/bitopro.js +1 -0
  22. package/dist/cjs/src/bitpanda.js +1 -0
  23. package/dist/cjs/src/bitrue.js +1 -0
  24. package/dist/cjs/src/bitso.js +1 -0
  25. package/dist/cjs/src/bitstamp.js +1 -0
  26. package/dist/cjs/src/bitvavo.js +1 -0
  27. package/dist/cjs/src/blockchaincom.js +1 -0
  28. package/dist/cjs/src/btcalpha.js +1 -0
  29. package/dist/cjs/src/btcmarkets.js +1 -0
  30. package/dist/cjs/src/btcturk.js +1 -0
  31. package/dist/cjs/src/bybit.js +3 -3
  32. package/dist/cjs/src/deribit.js +163 -0
  33. package/dist/cjs/src/gate.js +189 -0
  34. package/dist/cjs/src/huobi.js +102 -0
  35. package/dist/cjs/src/kucoin.js +1 -0
  36. package/dist/cjs/src/kucoinfutures.js +1 -1
  37. package/dist/cjs/src/okx.js +1 -0
  38. package/dist/cjs/src/poloniex.js +20 -7
  39. package/js/ccxt.d.ts +3 -3
  40. package/js/ccxt.js +1 -1
  41. package/js/src/abstract/poloniex.d.ts +18 -5
  42. package/js/src/ace.js +1 -0
  43. package/js/src/alpaca.js +1 -0
  44. package/js/src/base/Exchange.d.ts +6 -2
  45. package/js/src/base/Exchange.js +30 -0
  46. package/js/src/base/types.d.ts +9 -0
  47. package/js/src/bigone.js +1 -0
  48. package/js/src/binance.d.ts +13 -1
  49. package/js/src/binance.js +231 -1
  50. package/js/src/bingx.d.ts +1 -0
  51. package/js/src/bingx.js +1 -0
  52. package/js/src/bitbank.js +1 -0
  53. package/js/src/bitbns.js +1 -0
  54. package/js/src/bitfinex.js +1 -0
  55. package/js/src/bitfinex2.js +1 -0
  56. package/js/src/bitflyer.js +1 -0
  57. package/js/src/bitforex.js +1 -0
  58. package/js/src/bitget.js +11 -2
  59. package/js/src/bithumb.js +1 -0
  60. package/js/src/bitmart.d.ts +12 -0
  61. package/js/src/bitmart.js +103 -0
  62. package/js/src/bitmex.d.ts +13 -1
  63. package/js/src/bitmex.js +70 -0
  64. package/js/src/bitopro.js +1 -0
  65. package/js/src/bitpanda.js +1 -0
  66. package/js/src/bitrue.js +1 -0
  67. package/js/src/bitso.js +1 -0
  68. package/js/src/bitstamp.js +1 -0
  69. package/js/src/bitvavo.js +1 -0
  70. package/js/src/blockchaincom.js +1 -0
  71. package/js/src/btcalpha.js +1 -0
  72. package/js/src/btcmarkets.js +1 -0
  73. package/js/src/btcturk.js +1 -0
  74. package/js/src/bybit.js +3 -3
  75. package/js/src/deribit.d.ts +14 -0
  76. package/js/src/deribit.js +163 -0
  77. package/js/src/gate.d.ts +13 -0
  78. package/js/src/gate.js +189 -0
  79. package/js/src/huobi.d.ts +12 -0
  80. package/js/src/huobi.js +102 -0
  81. package/js/src/kucoin.js +1 -0
  82. package/js/src/kucoinfutures.js +1 -1
  83. package/js/src/okx.js +1 -0
  84. package/js/src/poloniex.js +20 -7
  85. package/package.json +1 -1
  86. package/skip-tests.json +61 -5
@@ -104,39 +104,51 @@ class poloniex extends poloniex$1 {
104
104
  'markets/{symbol}': 1,
105
105
  'currencies': 20,
106
106
  'currencies/{currency}': 20,
107
+ 'v2/currencies': 20,
108
+ 'v2/currencies/{currency}': 20,
107
109
  'timestamp': 1,
108
110
  'markets/price': 1,
109
111
  'markets/{symbol}/price': 1,
112
+ 'markets/markPrice': 1,
113
+ 'markets/{symbol}/markPrice': 1,
114
+ 'markets/{symbol}/markPriceComponents': 1,
110
115
  'markets/{symbol}/orderBook': 1,
111
116
  'markets/{symbol}/candles': 1,
112
117
  'markets/{symbol}/trades': 20,
113
118
  'markets/ticker24h': 20,
114
119
  'markets/{symbol}/ticker24h': 20,
120
+ 'markets/collateralInfo': 1,
121
+ 'markets/{currency}/collateralInfo': 1,
122
+ 'markets/borrowRatesInfo': 1,
115
123
  },
116
124
  },
117
125
  'private': {
118
126
  'get': {
119
127
  'accounts': 4,
120
- 'accounts/activity': 4,
121
128
  'accounts/balances': 4,
122
129
  'accounts/{id}/balances': 4,
130
+ 'accounts/activity': 20,
123
131
  'accounts/transfer': 20,
124
132
  'accounts/transfer/{id}': 4,
133
+ 'feeinfo': 20,
134
+ 'accounts/interest/history': 1,
125
135
  'subaccounts': 4,
126
136
  'subaccounts/balances': 20,
127
137
  'subaccounts/{id}/balances': 4,
128
138
  'subaccounts/transfer': 20,
129
139
  'subaccounts/transfer/{id}': 4,
130
- 'feeinfo': 20,
131
140
  'wallets/addresses': 20,
132
- 'wallets/activity': 20,
133
141
  'wallets/addresses/{currency}': 20,
142
+ 'wallets/activity': 20,
143
+ 'margin/accountMargin': 4,
144
+ 'margin/borrowStatus': 4,
145
+ 'margin/maxSize': 4,
134
146
  'orders': 20,
135
147
  'orders/{id}': 4,
136
- 'orders/history': 20,
137
148
  'orders/killSwitchStatus': 4,
138
149
  'smartorders': 20,
139
150
  'smartorders/{id}': 4,
151
+ 'orders/history': 20,
140
152
  'smartorders/history': 20,
141
153
  'trades': 20,
142
154
  'orders/{id}/trades': 4,
@@ -146,9 +158,10 @@ class poloniex extends poloniex$1 {
146
158
  'subaccounts/transfer': 20,
147
159
  'wallets/address': 20,
148
160
  'wallets/withdraw': 20,
161
+ 'v2/wallets/withdraw': 20,
149
162
  'orders': 4,
150
- 'orders/killSwitch': 4,
151
163
  'orders/batch': 20,
164
+ 'orders/killSwitch': 4,
152
165
  'smartorders': 4,
153
166
  },
154
167
  'delete': {
@@ -160,8 +173,8 @@ class poloniex extends poloniex$1 {
160
173
  'smartorders': 20,
161
174
  },
162
175
  'put': {
163
- 'orders/{id}': 4,
164
- 'smartorders/{id}': 4,
176
+ 'orders/{id}': 20,
177
+ 'smartorders/{id}': 20,
165
178
  },
166
179
  },
167
180
  },
package/js/ccxt.d.ts CHANGED
@@ -2,9 +2,9 @@ import { Exchange } from './src/base/Exchange.js';
2
2
  import { Precise } from './src/base/Precise.js';
3
3
  import * as functions from './src/base/functions.js';
4
4
  import * as errors from './src/base/errors.js';
5
- import { Market, Trade, Fee, Ticker, OrderBook, Order, Transaction, Tickers, Currency, Balance, DepositAddress, WithdrawalResponse, DepositAddressResponse, OHLCV, Balances, PartialBalances, Dictionary, MinMax, Position, FundingRateHistory } from './src/base/types.js';
5
+ import { Market, Trade, Fee, Ticker, OrderBook, Order, Transaction, Tickers, Currency, Balance, DepositAddress, WithdrawalResponse, DepositAddressResponse, OHLCV, Balances, PartialBalances, Dictionary, MinMax, Position, FundingRateHistory, Liquidation } from './src/base/types.js';
6
6
  import { BaseError, ExchangeError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, NotSupported, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, AuthenticationError, AddressPending, NoChange } from './src/base/errors.js';
7
- declare const version = "4.1.11";
7
+ declare const version = "4.1.12";
8
8
  import ace from './src/ace.js';
9
9
  import alpaca from './src/alpaca.js';
10
10
  import ascendex from './src/ascendex.js';
@@ -513,5 +513,5 @@ declare const ccxt: {
513
513
  zaif: typeof zaif;
514
514
  zonda: typeof zonda;
515
515
  } & typeof functions & typeof errors;
516
- export { version, Exchange, exchanges, pro, Precise, functions, errors, BaseError, ExchangeError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, NotSupported, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, AuthenticationError, AddressPending, NoChange, Market, Trade, Fee, Ticker, OrderBook, Order, Transaction, Tickers, Currency, Balance, DepositAddress, WithdrawalResponse, DepositAddressResponse, OHLCV, Balances, PartialBalances, Dictionary, MinMax, Position, FundingRateHistory, ace, alpaca, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbay, bitbns, bitcoincom, bitfinex, bitfinex2, bitflyer, bitforex, bitget, bithumb, bitmart, bitmex, bitopro, bitpanda, bitrue, bitso, bitstamp, bitstamp1, bittrex, bitvavo, bl3p, blockchaincom, btcalpha, btcbox, btcmarkets, btctradeua, btcturk, bybit, cex, coinbase, coinbaseprime, coinbasepro, coincheck, coinex, coinfalcon, coinmate, coinone, coinsph, coinspot, cryptocom, currencycom, delta, deribit, digifinex, exmo, fmfwio, gate, gateio, gemini, hitbtc, hitbtc3, hollaex, huobi, huobijp, huobipro, idex, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, kuna, latoken, lbank, lbank2, luno, lykke, mercado, mexc, mexc3, ndax, novadax, oceanex, okcoin, okex, okex5, okx, paymium, phemex, poloniex, poloniexfutures, probit, tidex, timex, tokocrypto, upbit, wavesexchange, wazirx, whitebit, woo, yobit, zaif, zonda, };
516
+ export { version, Exchange, exchanges, pro, Precise, functions, errors, BaseError, ExchangeError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, NotSupported, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, AuthenticationError, AddressPending, NoChange, Market, Trade, Fee, Ticker, OrderBook, Order, Transaction, Tickers, Currency, Balance, DepositAddress, WithdrawalResponse, DepositAddressResponse, OHLCV, Balances, PartialBalances, Dictionary, MinMax, Position, FundingRateHistory, Liquidation, ace, alpaca, ascendex, bequant, bigone, binance, binancecoinm, binanceus, binanceusdm, bingx, bit2c, bitbank, bitbay, bitbns, bitcoincom, bitfinex, bitfinex2, bitflyer, bitforex, bitget, bithumb, bitmart, bitmex, bitopro, bitpanda, bitrue, bitso, bitstamp, bitstamp1, bittrex, bitvavo, bl3p, blockchaincom, btcalpha, btcbox, btcmarkets, btctradeua, btcturk, bybit, cex, coinbase, coinbaseprime, coinbasepro, coincheck, coinex, coinfalcon, coinmate, coinone, coinsph, coinspot, cryptocom, currencycom, delta, deribit, digifinex, exmo, fmfwio, gate, gateio, gemini, hitbtc, hitbtc3, hollaex, huobi, huobijp, huobipro, idex, independentreserve, indodax, kraken, krakenfutures, kucoin, kucoinfutures, kuna, latoken, lbank, lbank2, luno, lykke, mercado, mexc, mexc3, ndax, novadax, oceanex, okcoin, okex, okex5, okx, paymium, phemex, poloniex, poloniexfutures, probit, tidex, timex, tokocrypto, upbit, wavesexchange, wazirx, whitebit, woo, yobit, zaif, zonda, };
517
517
  export default ccxt;
package/js/ccxt.js CHANGED
@@ -38,7 +38,7 @@ import * as errors from './src/base/errors.js';
38
38
  import { BaseError, ExchangeError, PermissionDenied, AccountNotEnabled, AccountSuspended, ArgumentsRequired, BadRequest, BadSymbol, MarginModeAlreadySet, BadResponse, NullResponse, InsufficientFunds, InvalidAddress, InvalidOrder, OrderNotFound, OrderNotCached, CancelPending, OrderImmediatelyFillable, OrderNotFillable, DuplicateOrderId, NotSupported, NetworkError, DDoSProtection, RateLimitExceeded, ExchangeNotAvailable, OnMaintenance, InvalidNonce, RequestTimeout, AuthenticationError, AddressPending, NoChange } from './src/base/errors.js';
39
39
  //-----------------------------------------------------------------------------
40
40
  // this is updated by vss.js when building
41
- const version = '4.1.12';
41
+ const version = '4.1.13';
42
42
  Exchange.ccxtVersion = version;
43
43
  //-----------------------------------------------------------------------------
44
44
  import ace from './src/ace.js';
@@ -5,35 +5,47 @@ interface Exchange {
5
5
  publicGetMarketsSymbol(params?: {}): Promise<implicitReturnType>;
6
6
  publicGetCurrencies(params?: {}): Promise<implicitReturnType>;
7
7
  publicGetCurrenciesCurrency(params?: {}): Promise<implicitReturnType>;
8
+ publicGetV2Currencies(params?: {}): Promise<implicitReturnType>;
9
+ publicGetV2CurrenciesCurrency(params?: {}): Promise<implicitReturnType>;
8
10
  publicGetTimestamp(params?: {}): Promise<implicitReturnType>;
9
11
  publicGetMarketsPrice(params?: {}): Promise<implicitReturnType>;
10
12
  publicGetMarketsSymbolPrice(params?: {}): Promise<implicitReturnType>;
13
+ publicGetMarketsMarkPrice(params?: {}): Promise<implicitReturnType>;
14
+ publicGetMarketsSymbolMarkPrice(params?: {}): Promise<implicitReturnType>;
15
+ publicGetMarketsSymbolMarkPriceComponents(params?: {}): Promise<implicitReturnType>;
11
16
  publicGetMarketsSymbolOrderBook(params?: {}): Promise<implicitReturnType>;
12
17
  publicGetMarketsSymbolCandles(params?: {}): Promise<implicitReturnType>;
13
18
  publicGetMarketsSymbolTrades(params?: {}): Promise<implicitReturnType>;
14
19
  publicGetMarketsTicker24h(params?: {}): Promise<implicitReturnType>;
15
20
  publicGetMarketsSymbolTicker24h(params?: {}): Promise<implicitReturnType>;
21
+ publicGetMarketsCollateralInfo(params?: {}): Promise<implicitReturnType>;
22
+ publicGetMarketsCurrencyCollateralInfo(params?: {}): Promise<implicitReturnType>;
23
+ publicGetMarketsBorrowRatesInfo(params?: {}): Promise<implicitReturnType>;
16
24
  privateGetAccounts(params?: {}): Promise<implicitReturnType>;
17
- privateGetAccountsActivity(params?: {}): Promise<implicitReturnType>;
18
25
  privateGetAccountsBalances(params?: {}): Promise<implicitReturnType>;
19
26
  privateGetAccountsIdBalances(params?: {}): Promise<implicitReturnType>;
27
+ privateGetAccountsActivity(params?: {}): Promise<implicitReturnType>;
20
28
  privateGetAccountsTransfer(params?: {}): Promise<implicitReturnType>;
21
29
  privateGetAccountsTransferId(params?: {}): Promise<implicitReturnType>;
30
+ privateGetFeeinfo(params?: {}): Promise<implicitReturnType>;
31
+ privateGetAccountsInterestHistory(params?: {}): Promise<implicitReturnType>;
22
32
  privateGetSubaccounts(params?: {}): Promise<implicitReturnType>;
23
33
  privateGetSubaccountsBalances(params?: {}): Promise<implicitReturnType>;
24
34
  privateGetSubaccountsIdBalances(params?: {}): Promise<implicitReturnType>;
25
35
  privateGetSubaccountsTransfer(params?: {}): Promise<implicitReturnType>;
26
36
  privateGetSubaccountsTransferId(params?: {}): Promise<implicitReturnType>;
27
- privateGetFeeinfo(params?: {}): Promise<implicitReturnType>;
28
37
  privateGetWalletsAddresses(params?: {}): Promise<implicitReturnType>;
29
- privateGetWalletsActivity(params?: {}): Promise<implicitReturnType>;
30
38
  privateGetWalletsAddressesCurrency(params?: {}): Promise<implicitReturnType>;
39
+ privateGetWalletsActivity(params?: {}): Promise<implicitReturnType>;
40
+ privateGetMarginAccountMargin(params?: {}): Promise<implicitReturnType>;
41
+ privateGetMarginBorrowStatus(params?: {}): Promise<implicitReturnType>;
42
+ privateGetMarginMaxSize(params?: {}): Promise<implicitReturnType>;
31
43
  privateGetOrders(params?: {}): Promise<implicitReturnType>;
32
44
  privateGetOrdersId(params?: {}): Promise<implicitReturnType>;
33
- privateGetOrdersHistory(params?: {}): Promise<implicitReturnType>;
34
45
  privateGetOrdersKillSwitchStatus(params?: {}): Promise<implicitReturnType>;
35
46
  privateGetSmartorders(params?: {}): Promise<implicitReturnType>;
36
47
  privateGetSmartordersId(params?: {}): Promise<implicitReturnType>;
48
+ privateGetOrdersHistory(params?: {}): Promise<implicitReturnType>;
37
49
  privateGetSmartordersHistory(params?: {}): Promise<implicitReturnType>;
38
50
  privateGetTrades(params?: {}): Promise<implicitReturnType>;
39
51
  privateGetOrdersIdTrades(params?: {}): Promise<implicitReturnType>;
@@ -41,9 +53,10 @@ interface Exchange {
41
53
  privatePostSubaccountsTransfer(params?: {}): Promise<implicitReturnType>;
42
54
  privatePostWalletsAddress(params?: {}): Promise<implicitReturnType>;
43
55
  privatePostWalletsWithdraw(params?: {}): Promise<implicitReturnType>;
56
+ privatePostV2WalletsWithdraw(params?: {}): Promise<implicitReturnType>;
44
57
  privatePostOrders(params?: {}): Promise<implicitReturnType>;
45
- privatePostOrdersKillSwitch(params?: {}): Promise<implicitReturnType>;
46
58
  privatePostOrdersBatch(params?: {}): Promise<implicitReturnType>;
59
+ privatePostOrdersKillSwitch(params?: {}): Promise<implicitReturnType>;
47
60
  privatePostSmartorders(params?: {}): Promise<implicitReturnType>;
48
61
  privateDeleteOrdersId(params?: {}): Promise<implicitReturnType>;
49
62
  privateDeleteOrdersCancelByIds(params?: {}): Promise<implicitReturnType>;
package/js/src/ace.js CHANGED
@@ -245,6 +245,7 @@ export default class ace extends Exchange {
245
245
  'amount': this.parseNumber(this.parsePrecision(this.safeString(market, 'basePrecision'))),
246
246
  },
247
247
  'active': undefined,
248
+ 'created': undefined,
248
249
  'info': market,
249
250
  });
250
251
  }
package/js/src/alpaca.js CHANGED
@@ -309,6 +309,7 @@ export default class alpaca extends Exchange {
309
309
  'max': undefined,
310
310
  },
311
311
  },
312
+ 'created': undefined,
312
313
  'info': asset,
313
314
  });
314
315
  }
@@ -4,8 +4,8 @@ ExchangeError, AuthenticationError, DDoSProtection, RequestTimeout, ExchangeNotA
4
4
  import WsClient from './ws/WsClient.js';
5
5
  import { Future } from './ws/Future.js';
6
6
  import { OrderBook as WsOrderBook, IndexedOrderBook, CountedOrderBook } from './ws/OrderBook.js';
7
- import { Market, Trade, Ticker, OHLCV, OHLCVC, Order, OrderBook, Balance, Balances, Dictionary, DepositAddressResponse, Currency, MinMax, IndexType, Int, OrderType, OrderSide, Position, FundingRateHistory, OpenInterest } from './types.js';
8
- export { Market, Trade, Fee, Position, Ticker } from './types.js';
7
+ import { Market, Trade, Ticker, OHLCV, OHLCVC, Order, OrderBook, Balance, Balances, Dictionary, DepositAddressResponse, Currency, MinMax, IndexType, Int, OrderType, OrderSide, Position, FundingRateHistory, OpenInterest, Liquidation } from './types.js';
8
+ export { Market, Trade, Fee, Ticker, OHLCV, OHLCVC, Order, OrderBook, Balance, Balances, Dictionary, Transaction, DepositAddressResponse, Currency, MinMax, IndexType, Int, OrderType, OrderSide, Position, FundingRateHistory, Liquidation } from './types.js';
9
9
  /**
10
10
  * @class Exchange
11
11
  */
@@ -724,6 +724,8 @@ export default class Exchange {
724
724
  fetchOpenOrdersWs(symbol?: string, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
725
725
  fetchClosedOrders(symbol?: string, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
726
726
  fetchMyTrades(symbol?: string, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
727
+ fetchMyLiquidations(symbol?: string, since?: Int, limit?: Int, params?: {}): Promise<Liquidation[]>;
728
+ fetchLiquidations(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<Liquidation[]>;
727
729
  fetchMyTradesWs(symbol?: string, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
728
730
  watchMyTrades(symbol?: string, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
729
731
  fetchOHLCVWs(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<OHLCV[]>;
@@ -816,5 +818,7 @@ export default class Exchange {
816
818
  removeRepeatedElementsFromArray(input: any): any;
817
819
  handleUntilOption(key: any, request: any, params: any, multiplier?: number): any[];
818
820
  safeOpenInterest(interest: any, market?: any): OpenInterest;
821
+ parseLiquidation(liquidation: any, market?: any): Liquidation;
822
+ parseLiquidations(liquidations: any, market?: any, since?: Int, limit?: Int): Liquidation[];
819
823
  }
820
824
  export { Exchange, };
@@ -3270,6 +3270,12 @@ export default class Exchange {
3270
3270
  async fetchMyTrades(symbol = undefined, since = undefined, limit = undefined, params = {}) {
3271
3271
  throw new NotSupported(this.id + ' fetchMyTrades() is not supported yet');
3272
3272
  }
3273
+ async fetchMyLiquidations(symbol = undefined, since = undefined, limit = undefined, params = {}) {
3274
+ throw new NotSupported(this.id + ' fetchMyLiquidations() is not supported yet');
3275
+ }
3276
+ async fetchLiquidations(symbol, since = undefined, limit = undefined, params = {}) {
3277
+ throw new NotSupported(this.id + ' fetchLiquidations() is not supported yet');
3278
+ }
3273
3279
  async fetchMyTradesWs(symbol = undefined, since = undefined, limit = undefined, params = {}) {
3274
3280
  throw new NotSupported(this.id + ' fetchMyTradesWs() is not supported yet');
3275
3281
  }
@@ -4394,5 +4400,29 @@ export default class Exchange {
4394
4400
  'info': this.safeValue(interest, 'info'),
4395
4401
  });
4396
4402
  }
4403
+ parseLiquidation(liquidation, market = undefined) {
4404
+ throw new NotSupported(this.id + ' parseLiquidation () is not supported yet');
4405
+ }
4406
+ parseLiquidations(liquidations, market = undefined, since = undefined, limit = undefined) {
4407
+ /**
4408
+ * @ignore
4409
+ * @method
4410
+ * @description parses liquidation info from the exchange response
4411
+ * @param {object[]} liquidations each item describes an instance of a liquidation event
4412
+ * @param {object} market ccxt market
4413
+ * @param {int} [since] when defined, the response items are filtered to only include items after this timestamp
4414
+ * @param {int} [limit] limits the number of items in the response
4415
+ * @returns {object[]} an array of [liquidation structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#liquidation-structure}
4416
+ */
4417
+ const result = [];
4418
+ for (let i = 0; i < liquidations.length; i++) {
4419
+ const entry = liquidations[i];
4420
+ const parsed = this.parseLiquidation(entry, market);
4421
+ result.push(parsed);
4422
+ }
4423
+ const sorted = this.sortBy(result, 'timestamp');
4424
+ const symbol = this.safeString(market, 'symbol');
4425
+ return this.filterBySymbolSinceLimit(sorted, symbol, since, limit);
4426
+ }
4397
4427
  }
4398
4428
  export { Exchange, };
@@ -218,6 +218,15 @@ export interface OpenInterest {
218
218
  datetime?: string;
219
219
  info: any;
220
220
  }
221
+ export interface Liquidation {
222
+ info: any;
223
+ symbol: string;
224
+ timestamp?: number;
225
+ datetime?: string;
226
+ price: number;
227
+ baseValue?: number;
228
+ quoteValue?: number;
229
+ }
221
230
  /** [ timestamp, open, high, low, close, volume ] */
222
231
  export declare type OHLCV = [number, number, number, number, number, number];
223
232
  /** [ timestamp, open, high, low, close, volume, count ] */
package/js/src/bigone.js CHANGED
@@ -570,6 +570,7 @@ export default class bigone extends Exchange {
570
570
  'max': this.safeNumber(market, 'max_quote_value'),
571
571
  },
572
572
  },
573
+ 'created': undefined,
573
574
  'info': market,
574
575
  };
575
576
  result.push(entry);
@@ -1,5 +1,5 @@
1
1
  import Exchange from './abstract/binance.js';
2
- import { Market, Int, OrderSide, Balances, OrderType, Trade, OHLCV, Order, FundingRateHistory, OpenInterest } from './base/types.js';
2
+ import { Market, Int, OrderSide, Balances, OrderType, Trade, OHLCV, Order, FundingRateHistory, OpenInterest, Liquidation } from './base/types.js';
3
3
  /**
4
4
  * @class binance
5
5
  * @extends Exchange
@@ -497,4 +497,16 @@ export default class binance extends Exchange {
497
497
  fetchOpenInterestHistory(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<OpenInterest[]>;
498
498
  fetchOpenInterest(symbol: string, params?: {}): Promise<OpenInterest>;
499
499
  parseOpenInterest(interest: any, market?: any): OpenInterest;
500
+ fetchMyLiquidations(symbol?: string, since?: Int, limit?: Int, params?: {}): Promise<Liquidation[]>;
501
+ parseLiquidation(liquidation: any, market?: any): {
502
+ info: any;
503
+ symbol: any;
504
+ contracts: number;
505
+ contractSize: number;
506
+ price: number;
507
+ baseValue: number;
508
+ quoteValue: number;
509
+ timestamp: number;
510
+ datetime: string;
511
+ };
500
512
  }
package/js/src/binance.js CHANGED
@@ -77,9 +77,11 @@ export default class binance extends Exchange {
77
77
  'fetchLedger': true,
78
78
  'fetchLeverage': false,
79
79
  'fetchLeverageTiers': true,
80
+ 'fetchLiquidations': false,
80
81
  'fetchMarketLeverageTiers': 'emulated',
81
82
  'fetchMarkets': true,
82
83
  'fetchMarkOHLCV': true,
84
+ 'fetchMyLiquidations': true,
83
85
  'fetchMySettlementHistory': true,
84
86
  'fetchMyTrades': true,
85
87
  'fetchOHLCV': true,
@@ -8261,13 +8263,15 @@ export default class binance extends Exchange {
8261
8263
  let type = undefined;
8262
8264
  let subType = undefined;
8263
8265
  let currency = undefined;
8266
+ if (code !== undefined) {
8267
+ currency = this.currency(code);
8268
+ }
8264
8269
  let method = undefined;
8265
8270
  const request = {};
8266
8271
  [type, params] = this.handleMarketTypeAndParams('fetchLedger', undefined, params);
8267
8272
  [subType, params] = this.handleSubTypeAndParams('fetchLedger', undefined, params);
8268
8273
  if (type === 'option') {
8269
8274
  this.checkRequiredArgument('fetchLedger', code, 'code');
8270
- currency = this.currency(code);
8271
8275
  request['currency'] = currency['id'];
8272
8276
  method = 'eapiPrivateGetBill';
8273
8277
  }
@@ -9222,4 +9226,230 @@ export default class binance extends Exchange {
9222
9226
  'info': interest,
9223
9227
  }, market);
9224
9228
  }
9229
+ async fetchMyLiquidations(symbol = undefined, since = undefined, limit = undefined, params = {}) {
9230
+ /**
9231
+ * @method
9232
+ * @name binance#fetchMyLiquidations
9233
+ * @description retrieves the users liquidated positions
9234
+ * @see https://binance-docs.github.io/apidocs/spot/en/#get-force-liquidation-record-user_data
9235
+ * @see https://binance-docs.github.io/apidocs/futures/en/#user-39-s-force-orders-user_data
9236
+ * @see https://binance-docs.github.io/apidocs/delivery/en/#user-39-s-force-orders-user_data
9237
+ * @param {string} [symbol] unified CCXT market symbol
9238
+ * @param {int} [since] the earliest time in ms to fetch liquidations for
9239
+ * @param {int} [limit] the maximum number of liquidation structures to retrieve
9240
+ * @param {object} [params] exchange specific parameters for the binance api endpoint
9241
+ * @param {int} [params.until] timestamp in ms of the latest liquidation
9242
+ * @param {boolean} [params.paginate] *spot only* default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
9243
+ * @returns {object} an array of [liquidation structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#liquidation-structure}
9244
+ */
9245
+ await this.loadMarkets();
9246
+ let paginate = false;
9247
+ [paginate, params] = this.handleOptionAndParams(params, 'fetchMyLiquidations', 'paginate');
9248
+ if (paginate) {
9249
+ return await this.fetchPaginatedCallIncremental('fetchMyLiquidations', symbol, since, limit, params, 'current', 100);
9250
+ }
9251
+ let market = undefined;
9252
+ if (symbol !== undefined) {
9253
+ market = this.market(symbol);
9254
+ }
9255
+ let type = undefined;
9256
+ [type, params] = this.handleMarketTypeAndParams('fetchMyLiquidations', market, params);
9257
+ let subType = undefined;
9258
+ [subType, params] = this.handleSubTypeAndParams('fetchMyLiquidations', market, params, 'linear');
9259
+ let request = {};
9260
+ if (type !== 'spot') {
9261
+ request['autoCloseType'] = 'LIQUIDATION';
9262
+ }
9263
+ if (market !== undefined) {
9264
+ const symbolKey = market['spot'] ? 'isolatedSymbol' : 'symbol';
9265
+ request[symbolKey] = market['id'];
9266
+ }
9267
+ if (since !== undefined) {
9268
+ request['startTime'] = since;
9269
+ }
9270
+ if (limit !== undefined) {
9271
+ if (type === 'spot') {
9272
+ request['size'] = limit;
9273
+ }
9274
+ else {
9275
+ request['limit'] = limit;
9276
+ }
9277
+ }
9278
+ [request, params] = this.handleUntilOption('endTime', request, params);
9279
+ let response = undefined;
9280
+ if (type === 'spot') {
9281
+ response = await this.sapiGetMarginForceLiquidationRec(this.extend(request, params));
9282
+ }
9283
+ else if (subType === 'linear') {
9284
+ response = await this.fapiPrivateGetForceOrders(this.extend(request, params));
9285
+ }
9286
+ else if (subType === 'inverse') {
9287
+ response = await this.dapiPrivateGetForceOrders(this.extend(request, params));
9288
+ }
9289
+ else {
9290
+ throw new NotSupported(this.id + ' fetchMyLiquidations() does not support ' + market['type'] + ' markets');
9291
+ }
9292
+ //
9293
+ // margin
9294
+ //
9295
+ // {
9296
+ // "rows": [
9297
+ // {
9298
+ // "avgPrice": "0.00388359",
9299
+ // "executedQty": "31.39000000",
9300
+ // "orderId": 180015097,
9301
+ // "price": "0.00388110",
9302
+ // "qty": "31.39000000",
9303
+ // "side": "SELL",
9304
+ // "symbol": "BNBBTC",
9305
+ // "timeInForce": "GTC",
9306
+ // "isIsolated": true,
9307
+ // "updatedTime": 1558941374745
9308
+ // }
9309
+ // ],
9310
+ // "total": 1
9311
+ // }
9312
+ //
9313
+ // linear
9314
+ //
9315
+ // [
9316
+ // {
9317
+ // "orderId": 6071832819,
9318
+ // "symbol": "BTCUSDT",
9319
+ // "status": "FILLED",
9320
+ // "clientOrderId": "autoclose-1596107620040000020",
9321
+ // "price": "10871.09",
9322
+ // "avgPrice": "10913.21000",
9323
+ // "origQty": "0.001",
9324
+ // "executedQty": "0.001",
9325
+ // "cumQuote": "10.91321",
9326
+ // "timeInForce": "IOC",
9327
+ // "type": "LIMIT",
9328
+ // "reduceOnly": false,
9329
+ // "closePosition": false,
9330
+ // "side": "SELL",
9331
+ // "positionSide": "BOTH",
9332
+ // "stopPrice": "0",
9333
+ // "workingType": "CONTRACT_PRICE",
9334
+ // "origType": "LIMIT",
9335
+ // "time": 1596107620044,
9336
+ // "updateTime": 1596107620087
9337
+ // },
9338
+ // ]
9339
+ //
9340
+ // inverse
9341
+ //
9342
+ // [
9343
+ // {
9344
+ // "orderId": 165123080,
9345
+ // "symbol": "BTCUSD_200925",
9346
+ // "pair": "BTCUSD",
9347
+ // "status": "FILLED",
9348
+ // "clientOrderId": "autoclose-1596542005017000006",
9349
+ // "price": "11326.9",
9350
+ // "avgPrice": "11326.9",
9351
+ // "origQty": "1",
9352
+ // "executedQty": "1",
9353
+ // "cumBase": "0.00882854",
9354
+ // "timeInForce": "IOC",
9355
+ // "type": "LIMIT",
9356
+ // "reduceOnly": false,
9357
+ // "closePosition": false,
9358
+ // "side": "SELL",
9359
+ // "positionSide": "BOTH",
9360
+ // "stopPrice": "0",
9361
+ // "workingType": "CONTRACT_PRICE",
9362
+ // "priceProtect": false,
9363
+ // "origType": "LIMIT",
9364
+ // "time": 1596542005019,
9365
+ // "updateTime": 1596542005050
9366
+ // },
9367
+ // ]
9368
+ //
9369
+ const liquidations = this.safeValue(response, 'rows', response);
9370
+ return this.parseLiquidations(liquidations, market, since, limit);
9371
+ }
9372
+ parseLiquidation(liquidation, market = undefined) {
9373
+ //
9374
+ // margin
9375
+ //
9376
+ // {
9377
+ // "avgPrice": "0.00388359",
9378
+ // "executedQty": "31.39000000",
9379
+ // "orderId": 180015097,
9380
+ // "price": "0.00388110",
9381
+ // "qty": "31.39000000",
9382
+ // "side": "SELL",
9383
+ // "symbol": "BNBBTC",
9384
+ // "timeInForce": "GTC",
9385
+ // "isIsolated": true,
9386
+ // "updatedTime": 1558941374745
9387
+ // }
9388
+ //
9389
+ // linear
9390
+ //
9391
+ // {
9392
+ // "orderId": 6071832819,
9393
+ // "symbol": "BTCUSDT",
9394
+ // "status": "FILLED",
9395
+ // "clientOrderId": "autoclose-1596107620040000020",
9396
+ // "price": "10871.09",
9397
+ // "avgPrice": "10913.21000",
9398
+ // "origQty": "0.001",
9399
+ // "executedQty": "0.001",
9400
+ // "cumQuote": "10.91321",
9401
+ // "timeInForce": "IOC",
9402
+ // "type": "LIMIT",
9403
+ // "reduceOnly": false,
9404
+ // "closePosition": false,
9405
+ // "side": "SELL",
9406
+ // "positionSide": "BOTH",
9407
+ // "stopPrice": "0",
9408
+ // "workingType": "CONTRACT_PRICE",
9409
+ // "origType": "LIMIT",
9410
+ // "time": 1596107620044,
9411
+ // "updateTime": 1596107620087
9412
+ // }
9413
+ //
9414
+ // inverse
9415
+ //
9416
+ // {
9417
+ // "orderId": 165123080,
9418
+ // "symbol": "BTCUSD_200925",
9419
+ // "pair": "BTCUSD",
9420
+ // "status": "FILLED",
9421
+ // "clientOrderId": "autoclose-1596542005017000006",
9422
+ // "price": "11326.9",
9423
+ // "avgPrice": "11326.9",
9424
+ // "origQty": "1",
9425
+ // "executedQty": "1",
9426
+ // "cumBase": "0.00882854",
9427
+ // "timeInForce": "IOC",
9428
+ // "type": "LIMIT",
9429
+ // "reduceOnly": false,
9430
+ // "closePosition": false,
9431
+ // "side": "SELL",
9432
+ // "positionSide": "BOTH",
9433
+ // "stopPrice": "0",
9434
+ // "workingType": "CONTRACT_PRICE",
9435
+ // "priceProtect": false,
9436
+ // "origType": "LIMIT",
9437
+ // "time": 1596542005019,
9438
+ // "updateTime": 1596542005050
9439
+ // }
9440
+ //
9441
+ const marketId = this.safeString(liquidation, 'symbol');
9442
+ const timestamp = this.safeInteger2(liquidation, 'updatedTime', 'updateTime');
9443
+ return {
9444
+ 'info': liquidation,
9445
+ 'symbol': this.safeSymbol(marketId, market),
9446
+ 'contracts': this.safeNumber(liquidation, 'executedQty'),
9447
+ 'contractSize': this.safeNumber(market, 'contractSize'),
9448
+ 'price': this.safeNumber(liquidation, 'avgPrice'),
9449
+ 'baseValue': this.safeNumber(liquidation, 'cumBase'),
9450
+ 'quoteValue': this.safeNumber(liquidation, 'cumQuote'),
9451
+ 'timestamp': timestamp,
9452
+ 'datetime': this.iso8601(timestamp),
9453
+ };
9454
+ }
9225
9455
  }
package/js/src/bingx.d.ts CHANGED
@@ -56,6 +56,7 @@ export default class bingx extends Exchange {
56
56
  max: number;
57
57
  };
58
58
  };
59
+ created: any;
59
60
  info: any;
60
61
  };
61
62
  fetchMarkets(params?: {}): Promise<any>;
package/js/src/bingx.js CHANGED
@@ -613,6 +613,7 @@ export default class bingx extends Exchange {
613
613
  'max': this.safeNumber(market, 'maxNotional'),
614
614
  },
615
615
  },
616
+ 'created': undefined,
616
617
  'info': market,
617
618
  };
618
619
  return entry;
package/js/src/bitbank.js CHANGED
@@ -249,6 +249,7 @@ export default class bitbank extends Exchange {
249
249
  'max': undefined,
250
250
  },
251
251
  },
252
+ 'created': undefined,
252
253
  'info': entry,
253
254
  });
254
255
  }
package/js/src/bitbns.js CHANGED
@@ -278,6 +278,7 @@ export default class bitbns extends Exchange {
278
278
  'max': this.safeNumber(costLimits, 'max'),
279
279
  },
280
280
  },
281
+ 'created': undefined,
281
282
  'info': market,
282
283
  });
283
284
  }
@@ -657,6 +657,7 @@ export default class bitfinex extends Exchange {
657
657
  'max': undefined,
658
658
  },
659
659
  },
660
+ 'created': undefined,
660
661
  'info': market,
661
662
  });
662
663
  }
@@ -577,6 +577,7 @@ export default class bitfinex2 extends Exchange {
577
577
  'max': undefined,
578
578
  },
579
579
  },
580
+ 'created': undefined,
580
581
  'info': market,
581
582
  });
582
583
  }
@@ -295,6 +295,7 @@ export default class bitflyer extends Exchange {
295
295
  'max': undefined,
296
296
  },
297
297
  },
298
+ 'created': undefined,
298
299
  'info': market,
299
300
  });
300
301
  }