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.
- package/README.md +3 -3
- package/dist/ccxt.browser.js +947 -15
- package/dist/ccxt.browser.min.js +2 -2
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/ace.js +1 -0
- package/dist/cjs/src/alpaca.js +1 -0
- package/dist/cjs/src/base/Exchange.js +30 -0
- package/dist/cjs/src/bigone.js +1 -0
- package/dist/cjs/src/binance.js +231 -1
- package/dist/cjs/src/bingx.js +1 -0
- package/dist/cjs/src/bitbank.js +1 -0
- package/dist/cjs/src/bitbns.js +1 -0
- package/dist/cjs/src/bitfinex.js +1 -0
- package/dist/cjs/src/bitfinex2.js +1 -0
- package/dist/cjs/src/bitflyer.js +1 -0
- package/dist/cjs/src/bitforex.js +1 -0
- package/dist/cjs/src/bitget.js +11 -2
- package/dist/cjs/src/bithumb.js +1 -0
- package/dist/cjs/src/bitmart.js +103 -0
- package/dist/cjs/src/bitmex.js +70 -0
- package/dist/cjs/src/bitopro.js +1 -0
- package/dist/cjs/src/bitpanda.js +1 -0
- package/dist/cjs/src/bitrue.js +1 -0
- package/dist/cjs/src/bitso.js +1 -0
- package/dist/cjs/src/bitstamp.js +1 -0
- package/dist/cjs/src/bitvavo.js +1 -0
- package/dist/cjs/src/blockchaincom.js +1 -0
- package/dist/cjs/src/btcalpha.js +1 -0
- package/dist/cjs/src/btcmarkets.js +1 -0
- package/dist/cjs/src/btcturk.js +1 -0
- package/dist/cjs/src/bybit.js +3 -3
- package/dist/cjs/src/deribit.js +163 -0
- package/dist/cjs/src/gate.js +189 -0
- package/dist/cjs/src/huobi.js +102 -0
- package/dist/cjs/src/kucoin.js +1 -0
- package/dist/cjs/src/kucoinfutures.js +1 -1
- package/dist/cjs/src/okx.js +1 -0
- package/dist/cjs/src/poloniex.js +20 -7
- package/js/ccxt.d.ts +3 -3
- package/js/ccxt.js +1 -1
- package/js/src/abstract/poloniex.d.ts +18 -5
- package/js/src/ace.js +1 -0
- package/js/src/alpaca.js +1 -0
- package/js/src/base/Exchange.d.ts +6 -2
- package/js/src/base/Exchange.js +30 -0
- package/js/src/base/types.d.ts +9 -0
- package/js/src/bigone.js +1 -0
- package/js/src/binance.d.ts +13 -1
- package/js/src/binance.js +231 -1
- package/js/src/bingx.d.ts +1 -0
- package/js/src/bingx.js +1 -0
- package/js/src/bitbank.js +1 -0
- package/js/src/bitbns.js +1 -0
- package/js/src/bitfinex.js +1 -0
- package/js/src/bitfinex2.js +1 -0
- package/js/src/bitflyer.js +1 -0
- package/js/src/bitforex.js +1 -0
- package/js/src/bitget.js +11 -2
- package/js/src/bithumb.js +1 -0
- package/js/src/bitmart.d.ts +12 -0
- package/js/src/bitmart.js +103 -0
- package/js/src/bitmex.d.ts +13 -1
- package/js/src/bitmex.js +70 -0
- package/js/src/bitopro.js +1 -0
- package/js/src/bitpanda.js +1 -0
- package/js/src/bitrue.js +1 -0
- package/js/src/bitso.js +1 -0
- package/js/src/bitstamp.js +1 -0
- package/js/src/bitvavo.js +1 -0
- package/js/src/blockchaincom.js +1 -0
- package/js/src/btcalpha.js +1 -0
- package/js/src/btcmarkets.js +1 -0
- package/js/src/btcturk.js +1 -0
- package/js/src/bybit.js +3 -3
- package/js/src/deribit.d.ts +14 -0
- package/js/src/deribit.js +163 -0
- package/js/src/gate.d.ts +13 -0
- package/js/src/gate.js +189 -0
- package/js/src/huobi.d.ts +12 -0
- package/js/src/huobi.js +102 -0
- package/js/src/kucoin.js +1 -0
- package/js/src/kucoinfutures.js +1 -1
- package/js/src/okx.js +1 -0
- package/js/src/poloniex.js +20 -7
- package/package.json +1 -1
- package/skip-tests.json +61 -5
package/dist/cjs/src/poloniex.js
CHANGED
|
@@ -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}':
|
|
164
|
-
'smartorders/{id}':
|
|
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.
|
|
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.
|
|
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
package/js/src/alpaca.js
CHANGED
|
@@ -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,
|
|
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, };
|
package/js/src/base/Exchange.js
CHANGED
|
@@ -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, };
|
package/js/src/base/types.d.ts
CHANGED
|
@@ -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
package/js/src/binance.d.ts
CHANGED
|
@@ -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
package/js/src/bingx.js
CHANGED
package/js/src/bitbank.js
CHANGED
package/js/src/bitbns.js
CHANGED
package/js/src/bitfinex.js
CHANGED
package/js/src/bitfinex2.js
CHANGED