ccxt 4.3.5 → 4.3.7
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/cjs/ccxt.js +1 -1
- package/dist/cjs/src/ace.js +5 -0
- package/dist/cjs/src/alpaca.js +6 -0
- package/dist/cjs/src/base/Exchange.js +37 -0
- package/dist/cjs/src/binance.js +4 -0
- package/dist/cjs/src/bingx.js +47 -0
- package/dist/cjs/src/bitbank.js +3 -0
- package/dist/cjs/src/bitget.js +74 -1
- package/dist/cjs/src/bithumb.js +4 -0
- package/dist/cjs/src/bitmex.js +26 -0
- package/dist/cjs/src/bitopro.js +5 -0
- package/dist/cjs/src/bitso.js +3 -0
- package/dist/cjs/src/bitstamp.js +3 -0
- package/dist/cjs/src/bitteam.js +4 -0
- package/dist/cjs/src/bitvavo.js +3 -0
- package/dist/cjs/src/bl3p.js +3 -0
- package/dist/cjs/src/btcalpha.js +3 -0
- package/dist/cjs/src/btcbox.js +3 -0
- package/dist/cjs/src/btcmarkets.js +3 -0
- package/dist/cjs/src/btcturk.js +3 -0
- package/dist/cjs/src/bybit.js +209 -12
- package/dist/cjs/src/cex.js +6 -0
- package/dist/cjs/src/coinbase.js +100 -21
- package/dist/cjs/src/coinbaseinternational.js +2 -0
- package/dist/cjs/src/coinbasepro.js +6 -0
- package/dist/cjs/src/coincheck.js +3 -0
- package/dist/cjs/src/coinex.js +180 -75
- package/dist/cjs/src/coinlist.js +4 -0
- package/dist/cjs/src/coinmate.js +3 -0
- package/dist/cjs/src/coinone.js +3 -0
- package/dist/cjs/src/coinsph.js +4 -0
- package/dist/cjs/src/coinspot.js +3 -0
- package/dist/cjs/src/cryptocom.js +34 -0
- package/dist/cjs/src/exmo.js +5 -0
- package/dist/cjs/src/gate.js +124 -22
- package/dist/cjs/src/hitbtc.js +4 -3
- package/dist/cjs/src/htx.js +30 -0
- package/dist/cjs/src/hyperliquid.js +40 -0
- package/dist/cjs/src/idex.js +3 -0
- package/dist/cjs/src/independentreserve.js +3 -0
- package/dist/cjs/src/indodax.js +3 -0
- package/dist/cjs/src/kraken.js +30 -0
- package/dist/cjs/src/krakenfutures.js +28 -0
- package/dist/cjs/src/kucoin.js +2 -0
- package/dist/cjs/src/kucoinfutures.js +4 -2
- package/dist/cjs/src/latoken.js +6 -0
- package/dist/cjs/src/luno.js +3 -0
- package/dist/cjs/src/lykke.js +5 -0
- package/dist/cjs/src/mercado.js +3 -0
- package/dist/cjs/src/mexc.js +111 -0
- package/dist/cjs/src/ndax.js +4 -0
- package/dist/cjs/src/novadax.js +4 -0
- package/dist/cjs/src/okx.js +196 -0
- package/dist/cjs/src/onetrading.js +3 -0
- package/dist/cjs/src/p2b.js +3 -0
- package/dist/cjs/src/pro/bitget.js +1 -1
- package/dist/cjs/src/pro/bybit.js +1 -1
- package/dist/cjs/src/pro/coinbase.js +30 -29
- package/dist/cjs/src/probit.js +3 -0
- package/dist/cjs/src/timex.js +3 -0
- package/dist/cjs/src/tradeogre.js +3 -0
- package/dist/cjs/src/wavesexchange.js +3 -0
- package/dist/cjs/src/wazirx.js +3 -0
- package/dist/cjs/src/whitebit.js +42 -0
- package/dist/cjs/src/woo.js +31 -0
- package/dist/cjs/src/yobit.js +3 -0
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/binance.d.ts +1 -0
- package/js/src/abstract/binancecoinm.d.ts +1 -0
- package/js/src/abstract/binanceus.d.ts +1 -0
- package/js/src/abstract/binanceusdm.d.ts +1 -0
- package/js/src/abstract/bingx.d.ts +1 -0
- package/js/src/abstract/coinbase.d.ts +5 -0
- package/js/src/abstract/woo.d.ts +1 -0
- package/js/src/ace.js +5 -0
- package/js/src/alpaca.js +6 -0
- package/js/src/ascendex.d.ts +2 -2
- package/js/src/base/Exchange.d.ts +5 -0
- package/js/src/base/Exchange.js +37 -0
- package/js/src/bigone.d.ts +1 -1
- package/js/src/binance.d.ts +3 -3
- package/js/src/binance.js +4 -0
- package/js/src/bingx.d.ts +2 -1
- package/js/src/bingx.js +47 -0
- package/js/src/bitbank.d.ts +1 -1
- package/js/src/bitbank.js +3 -0
- package/js/src/bitfinex.d.ts +1 -1
- package/js/src/bitfinex2.d.ts +1 -1
- package/js/src/bitflyer.d.ts +1 -1
- package/js/src/bitget.d.ts +4 -3
- package/js/src/bitget.js +74 -1
- package/js/src/bithumb.d.ts +1 -1
- package/js/src/bithumb.js +4 -0
- package/js/src/bitmart.d.ts +1 -1
- package/js/src/bitmex.d.ts +2 -1
- package/js/src/bitmex.js +26 -0
- package/js/src/bitopro.d.ts +1 -1
- package/js/src/bitopro.js +5 -0
- package/js/src/bitrue.d.ts +1 -1
- package/js/src/bitso.d.ts +1 -1
- package/js/src/bitso.js +3 -0
- package/js/src/bitstamp.d.ts +1 -1
- package/js/src/bitstamp.js +3 -0
- package/js/src/bitteam.js +4 -0
- package/js/src/bitvavo.d.ts +1 -1
- package/js/src/bitvavo.js +3 -0
- package/js/src/bl3p.js +3 -0
- package/js/src/blockchaincom.d.ts +1 -1
- package/js/src/btcalpha.js +3 -0
- package/js/src/btcbox.js +3 -0
- package/js/src/btcmarkets.d.ts +1 -1
- package/js/src/btcmarkets.js +3 -0
- package/js/src/btcturk.js +3 -0
- package/js/src/bybit.d.ts +8 -6
- package/js/src/bybit.js +209 -12
- package/js/src/cex.js +6 -0
- package/js/src/coinbase.d.ts +1 -1
- package/js/src/coinbase.js +100 -21
- package/js/src/coinbaseinternational.d.ts +1 -1
- package/js/src/coinbaseinternational.js +2 -0
- package/js/src/coinbasepro.d.ts +1 -1
- package/js/src/coinbasepro.js +6 -0
- package/js/src/coincheck.js +3 -0
- package/js/src/coinex.d.ts +8 -7
- package/js/src/coinex.js +180 -75
- package/js/src/coinlist.d.ts +1 -1
- package/js/src/coinlist.js +4 -0
- package/js/src/coinmate.d.ts +1 -1
- package/js/src/coinmate.js +3 -0
- package/js/src/coinone.js +3 -0
- package/js/src/coinsph.d.ts +1 -1
- package/js/src/coinsph.js +4 -0
- package/js/src/coinspot.js +3 -0
- package/js/src/cryptocom.d.ts +3 -2
- package/js/src/cryptocom.js +34 -0
- package/js/src/delta.d.ts +2 -2
- package/js/src/deribit.d.ts +1 -1
- package/js/src/digifinex.d.ts +3 -3
- package/js/src/exmo.d.ts +3 -3
- package/js/src/exmo.js +5 -0
- package/js/src/gate.d.ts +8 -7
- package/js/src/gate.js +124 -22
- package/js/src/gemini.d.ts +1 -1
- package/js/src/hitbtc.d.ts +3 -3
- package/js/src/hitbtc.js +4 -3
- package/js/src/hollaex.d.ts +1 -1
- package/js/src/htx.d.ts +2 -1
- package/js/src/htx.js +30 -0
- package/js/src/huobijp.d.ts +1 -1
- package/js/src/hyperliquid.d.ts +3 -2
- package/js/src/hyperliquid.js +40 -0
- package/js/src/idex.d.ts +1 -1
- package/js/src/idex.js +3 -0
- package/js/src/independentreserve.js +3 -0
- package/js/src/indodax.d.ts +1 -1
- package/js/src/indodax.js +3 -0
- package/js/src/kraken.d.ts +2 -1
- package/js/src/kraken.js +30 -0
- package/js/src/krakenfutures.d.ts +1 -0
- package/js/src/krakenfutures.js +28 -0
- package/js/src/kucoin.d.ts +1 -1
- package/js/src/kucoin.js +2 -0
- package/js/src/kucoinfutures.d.ts +1 -1
- package/js/src/kucoinfutures.js +4 -2
- package/js/src/kuna.d.ts +1 -1
- package/js/src/latoken.js +6 -0
- package/js/src/lbank.d.ts +1 -1
- package/js/src/luno.js +3 -0
- package/js/src/lykke.d.ts +1 -1
- package/js/src/lykke.js +5 -0
- package/js/src/mercado.d.ts +1 -1
- package/js/src/mercado.js +3 -0
- package/js/src/mexc.d.ts +4 -3
- package/js/src/mexc.js +111 -0
- package/js/src/ndax.d.ts +1 -1
- package/js/src/ndax.js +4 -0
- package/js/src/novadax.d.ts +1 -1
- package/js/src/novadax.js +4 -0
- package/js/src/okcoin.d.ts +1 -1
- package/js/src/okx.d.ts +11 -8
- package/js/src/okx.js +196 -0
- package/js/src/onetrading.d.ts +1 -1
- package/js/src/onetrading.js +3 -0
- package/js/src/p2b.js +3 -0
- package/js/src/phemex.d.ts +1 -1
- package/js/src/poloniex.d.ts +1 -1
- package/js/src/pro/bitget.d.ts +1 -1
- package/js/src/pro/bitget.js +1 -1
- package/js/src/pro/bybit.js +1 -1
- package/js/src/pro/coinbase.d.ts +2 -2
- package/js/src/pro/coinbase.js +30 -29
- package/js/src/probit.d.ts +1 -1
- package/js/src/probit.js +3 -0
- package/js/src/timex.js +3 -0
- package/js/src/tokocrypto.d.ts +1 -1
- package/js/src/tradeogre.js +3 -0
- package/js/src/upbit.d.ts +1 -1
- package/js/src/wavesexchange.d.ts +1 -1
- package/js/src/wavesexchange.js +3 -0
- package/js/src/wazirx.js +3 -0
- package/js/src/whitebit.d.ts +2 -1
- package/js/src/whitebit.js +42 -0
- package/js/src/woo.d.ts +3 -2
- package/js/src/woo.js +31 -0
- package/js/src/yobit.d.ts +1 -1
- package/js/src/yobit.js +3 -0
- package/js/src/zaif.d.ts +1 -1
- package/js/src/zonda.d.ts +1 -1
- package/package.json +1 -1
package/js/src/krakenfutures.js
CHANGED
|
@@ -34,6 +34,7 @@ export default class krakenfutures extends Exchange {
|
|
|
34
34
|
'future': true,
|
|
35
35
|
'option': false,
|
|
36
36
|
'cancelAllOrders': true,
|
|
37
|
+
'cancelAllOrdersAfter': true,
|
|
37
38
|
'cancelOrder': true,
|
|
38
39
|
'cancelOrders': true,
|
|
39
40
|
'createMarketOrder': false,
|
|
@@ -1272,6 +1273,33 @@ export default class krakenfutures extends Exchange {
|
|
|
1272
1273
|
const response = await this.privatePostCancelallorders(this.extend(request, params));
|
|
1273
1274
|
return response;
|
|
1274
1275
|
}
|
|
1276
|
+
async cancelAllOrdersAfter(timeout, params = {}) {
|
|
1277
|
+
/**
|
|
1278
|
+
* @method
|
|
1279
|
+
* @name krakenfutures#cancelAllOrdersAfter
|
|
1280
|
+
* @description dead man's switch, cancel all orders after the given timeout
|
|
1281
|
+
* @see https://docs.futures.kraken.com/#http-api-trading-v3-api-order-management-dead-man-39-s-switch
|
|
1282
|
+
* @param {number} timeout time in milliseconds, 0 represents cancel the timer
|
|
1283
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1284
|
+
* @returns {object} the api result
|
|
1285
|
+
*/
|
|
1286
|
+
await this.loadMarkets();
|
|
1287
|
+
const request = {
|
|
1288
|
+
'timeout': (timeout > 0) ? (this.parseToInt(timeout / 1000)) : 0,
|
|
1289
|
+
};
|
|
1290
|
+
const response = await this.privatePostCancelallordersafter(this.extend(request, params));
|
|
1291
|
+
//
|
|
1292
|
+
// {
|
|
1293
|
+
// "result": "success",
|
|
1294
|
+
// "serverTime": "2018-06-19T16:51:23.839Z",
|
|
1295
|
+
// "status": {
|
|
1296
|
+
// "currentTime": "2018-06-19T16:51:23.839Z",
|
|
1297
|
+
// "triggerTime": "0"
|
|
1298
|
+
// }
|
|
1299
|
+
// }
|
|
1300
|
+
//
|
|
1301
|
+
return response;
|
|
1302
|
+
}
|
|
1275
1303
|
async fetchOpenOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
1276
1304
|
/**
|
|
1277
1305
|
* @method
|
package/js/src/kucoin.d.ts
CHANGED
|
@@ -86,7 +86,7 @@ export default class kucoin extends Exchange {
|
|
|
86
86
|
fetchTrades(symbol: string, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
|
|
87
87
|
parseTrade(trade: any, market?: Market): Trade;
|
|
88
88
|
fetchTradingFee(symbol: string, params?: {}): Promise<TradingFeeInterface>;
|
|
89
|
-
withdraw(code: string, amount: number, address:
|
|
89
|
+
withdraw(code: string, amount: number, address: string, tag?: any, params?: {}): Promise<Transaction>;
|
|
90
90
|
loadCurrencyPrecision(currency: any, networkCode?: Str): Promise<void>;
|
|
91
91
|
parseTransactionStatus(status: any): string;
|
|
92
92
|
parseTransaction(transaction: any, currency?: Currency): Transaction;
|
package/js/src/kucoin.js
CHANGED
|
@@ -91,7 +91,9 @@ export default class kucoin extends Exchange {
|
|
|
91
91
|
'fetchOrderBooks': false,
|
|
92
92
|
'fetchOrdersByStatus': true,
|
|
93
93
|
'fetchOrderTrades': true,
|
|
94
|
+
'fetchPositionHistory': false,
|
|
94
95
|
'fetchPositionMode': false,
|
|
96
|
+
'fetchPositionsHistory': false,
|
|
95
97
|
'fetchPremiumIndexOHLCV': false,
|
|
96
98
|
'fetchStatus': true,
|
|
97
99
|
'fetchTicker': true,
|
|
@@ -37,7 +37,7 @@ export default class kucoinfutures extends kucoin {
|
|
|
37
37
|
createContractOrderRequest(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): any;
|
|
38
38
|
cancelOrder(id: string, symbol?: Str, params?: {}): Promise<any>;
|
|
39
39
|
cancelAllOrders(symbol?: Str, params?: {}): Promise<any>;
|
|
40
|
-
addMargin(symbol: string, amount:
|
|
40
|
+
addMargin(symbol: string, amount: number, params?: {}): Promise<MarginModification>;
|
|
41
41
|
parseMarginModification(info: any, market?: Market): MarginModification;
|
|
42
42
|
fetchOrdersByStatus(status: any, symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
43
43
|
fetchClosedOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
package/js/src/kucoinfutures.js
CHANGED
|
@@ -81,8 +81,10 @@ export default class kucoinfutures extends kucoin {
|
|
|
81
81
|
'fetchOrder': true,
|
|
82
82
|
'fetchOrderBook': true,
|
|
83
83
|
'fetchPosition': true,
|
|
84
|
+
'fetchPositionHistory': false,
|
|
84
85
|
'fetchPositionMode': false,
|
|
85
86
|
'fetchPositions': true,
|
|
87
|
+
'fetchPositionsHistory': false,
|
|
86
88
|
'fetchPremiumIndexOHLCV': false,
|
|
87
89
|
'fetchStatus': true,
|
|
88
90
|
'fetchTicker': true,
|
|
@@ -2198,8 +2200,8 @@ export default class kucoinfutures extends kucoin {
|
|
|
2198
2200
|
// symbol (String) [optional] Symbol of the contract
|
|
2199
2201
|
// side (String) [optional] buy or sell
|
|
2200
2202
|
// type (String) [optional] limit, market, limit_stop or market_stop
|
|
2201
|
-
// startAt (long) [optional] Start time (
|
|
2202
|
-
// endAt (long) [optional] End time (
|
|
2203
|
+
// startAt (long) [optional] Start time (millisecond)
|
|
2204
|
+
// endAt (long) [optional] End time (millisecond)
|
|
2203
2205
|
};
|
|
2204
2206
|
let market = undefined;
|
|
2205
2207
|
if (symbol !== undefined) {
|
package/js/src/kuna.d.ts
CHANGED
|
@@ -54,7 +54,7 @@ export default class kuna extends Exchange {
|
|
|
54
54
|
fetchClosedOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
55
55
|
fetchOrdersByStatus(status: any, symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
56
56
|
fetchMyTrades(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
|
|
57
|
-
withdraw(code: string, amount: number, address:
|
|
57
|
+
withdraw(code: string, amount: number, address: string, tag?: any, params?: {}): Promise<Transaction>;
|
|
58
58
|
fetchWithdrawals(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
|
|
59
59
|
fetchWithdrawal(id: string, code?: Str, params?: {}): Promise<Transaction>;
|
|
60
60
|
createDepositAddress(code: string, params?: {}): Promise<{
|
package/js/src/latoken.js
CHANGED
|
@@ -58,7 +58,13 @@ export default class latoken extends Exchange {
|
|
|
58
58
|
'fetchOrder': true,
|
|
59
59
|
'fetchOrderBook': true,
|
|
60
60
|
'fetchOrders': true,
|
|
61
|
+
'fetchPosition': false,
|
|
62
|
+
'fetchPositionHistory': false,
|
|
61
63
|
'fetchPositionMode': false,
|
|
64
|
+
'fetchPositions': false,
|
|
65
|
+
'fetchPositionsForSymbol': false,
|
|
66
|
+
'fetchPositionsHistory': false,
|
|
67
|
+
'fetchPositionsRisk': false,
|
|
62
68
|
'fetchTicker': true,
|
|
63
69
|
'fetchTickers': true,
|
|
64
70
|
'fetchTime': true,
|
package/js/src/lbank.d.ts
CHANGED
|
@@ -51,7 +51,7 @@ export default class lbank extends Exchange {
|
|
|
51
51
|
network: string;
|
|
52
52
|
info: any;
|
|
53
53
|
}>;
|
|
54
|
-
withdraw(code: string, amount: number, address:
|
|
54
|
+
withdraw(code: string, amount: number, address: string, tag?: any, params?: {}): Promise<Transaction>;
|
|
55
55
|
parseTransactionStatus(status: any, type: any): string;
|
|
56
56
|
parseTransaction(transaction: any, currency?: Currency): Transaction;
|
|
57
57
|
fetchDeposits(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
|
package/js/src/luno.js
CHANGED
|
@@ -64,8 +64,11 @@ export default class luno extends Exchange {
|
|
|
64
64
|
'fetchOrderBook': true,
|
|
65
65
|
'fetchOrders': true,
|
|
66
66
|
'fetchPosition': false,
|
|
67
|
+
'fetchPositionHistory': false,
|
|
67
68
|
'fetchPositionMode': false,
|
|
68
69
|
'fetchPositions': false,
|
|
70
|
+
'fetchPositionsForSymbol': false,
|
|
71
|
+
'fetchPositionsHistory': false,
|
|
69
72
|
'fetchPositionsRisk': false,
|
|
70
73
|
'fetchPremiumIndexOHLCV': false,
|
|
71
74
|
'fetchTicker': true,
|
package/js/src/lykke.d.ts
CHANGED
|
@@ -35,7 +35,7 @@ export default class lykke extends Exchange {
|
|
|
35
35
|
}>;
|
|
36
36
|
parseTransaction(transaction: any, currency?: Currency): Transaction;
|
|
37
37
|
fetchDepositsWithdrawals(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
|
|
38
|
-
withdraw(code: string, amount: number, address:
|
|
38
|
+
withdraw(code: string, amount: number, address: string, tag?: any, params?: {}): Promise<Transaction>;
|
|
39
39
|
sign(path: any, api?: string, method?: string, params?: {}, headers?: any, body?: any): {
|
|
40
40
|
url: string;
|
|
41
41
|
method: string;
|
package/js/src/lykke.js
CHANGED
|
@@ -66,8 +66,13 @@ export default class lykke extends Exchange {
|
|
|
66
66
|
'fetchOrderBook': true,
|
|
67
67
|
'fetchOrders': false,
|
|
68
68
|
'fetchOrderTrades': false,
|
|
69
|
+
'fetchPosition': false,
|
|
70
|
+
'fetchPositionHistory': false,
|
|
69
71
|
'fetchPositionMode': false,
|
|
70
72
|
'fetchPositions': false,
|
|
73
|
+
'fetchPositionsForSymbol': false,
|
|
74
|
+
'fetchPositionsHistory': false,
|
|
75
|
+
'fetchPositionsRisk': false,
|
|
71
76
|
'fetchPremiumIndexOHLCV': false,
|
|
72
77
|
'fetchTicker': true,
|
|
73
78
|
'fetchTickers': true,
|
package/js/src/mercado.d.ts
CHANGED
|
@@ -19,7 +19,7 @@ export default class mercado extends Exchange {
|
|
|
19
19
|
parseOrderStatus(status: any): string;
|
|
20
20
|
parseOrder(order: any, market?: Market): Order;
|
|
21
21
|
fetchOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
|
|
22
|
-
withdraw(code: string, amount: number, address:
|
|
22
|
+
withdraw(code: string, amount: number, address: string, tag?: any, params?: {}): Promise<Transaction>;
|
|
23
23
|
parseTransaction(transaction: any, currency?: Currency): Transaction;
|
|
24
24
|
parseOHLCV(ohlcv: any, market?: Market): OHLCV;
|
|
25
25
|
fetchOHLCV(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<OHLCV[]>;
|
package/js/src/mercado.js
CHANGED
|
@@ -66,8 +66,11 @@ export default class mercado extends Exchange {
|
|
|
66
66
|
'fetchOrderBook': true,
|
|
67
67
|
'fetchOrders': true,
|
|
68
68
|
'fetchPosition': false,
|
|
69
|
+
'fetchPositionHistory': false,
|
|
69
70
|
'fetchPositionMode': false,
|
|
70
71
|
'fetchPositions': false,
|
|
72
|
+
'fetchPositionsForSymbol': false,
|
|
73
|
+
'fetchPositionsHistory': false,
|
|
71
74
|
'fetchPositionsRisk': false,
|
|
72
75
|
'fetchPremiumIndexOHLCV': false,
|
|
73
76
|
'fetchTicker': true,
|
package/js/src/mexc.d.ts
CHANGED
|
@@ -59,8 +59,8 @@ export default class mexc extends Exchange {
|
|
|
59
59
|
fetchMyTrades(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
|
|
60
60
|
fetchOrderTrades(id: string, symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
|
|
61
61
|
modifyMarginHelper(symbol: string, amount: any, addOrReduce: any, params?: {}): Promise<any>;
|
|
62
|
-
reduceMargin(symbol: string, amount:
|
|
63
|
-
addMargin(symbol: string, amount:
|
|
62
|
+
reduceMargin(symbol: string, amount: number, params?: {}): Promise<MarginModification>;
|
|
63
|
+
addMargin(symbol: string, amount: number, params?: {}): Promise<MarginModification>;
|
|
64
64
|
setLeverage(leverage: Int, symbol?: Str, params?: {}): Promise<any>;
|
|
65
65
|
fetchFundingHistory(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<FundingHistory[]>;
|
|
66
66
|
parseFundingRate(contract: any, market?: Market): {
|
|
@@ -153,7 +153,7 @@ export default class mexc extends Exchange {
|
|
|
153
153
|
};
|
|
154
154
|
parseAccountId(status: any): string;
|
|
155
155
|
parseTransferStatus(status: any): string;
|
|
156
|
-
withdraw(code: string, amount: number, address:
|
|
156
|
+
withdraw(code: string, amount: number, address: string, tag?: any, params?: {}): Promise<Transaction>;
|
|
157
157
|
setPositionMode(hedged: boolean, symbol?: Str, params?: {}): Promise<any>;
|
|
158
158
|
fetchPositionMode(symbol?: Str, params?: {}): Promise<{
|
|
159
159
|
info: any;
|
|
@@ -175,6 +175,7 @@ export default class mexc extends Exchange {
|
|
|
175
175
|
fetchLeverage(symbol: string, params?: {}): Promise<Leverage>;
|
|
176
176
|
parseLeverage(leverage: any, market?: any): Leverage;
|
|
177
177
|
handleMarginModeAndParams(methodName: any, params?: {}, defaultValue?: any): any[];
|
|
178
|
+
fetchPositionsHistory(symbols?: Strings, since?: Int, limit?: Int, params?: {}): Promise<Position[]>;
|
|
178
179
|
sign(path: any, api?: string, method?: string, params?: {}, headers?: any, body?: any): {
|
|
179
180
|
url: any;
|
|
180
181
|
method: string;
|
package/js/src/mexc.js
CHANGED
|
@@ -93,8 +93,10 @@ export default class mexc extends Exchange {
|
|
|
93
93
|
'fetchOrders': true,
|
|
94
94
|
'fetchOrderTrades': true,
|
|
95
95
|
'fetchPosition': true,
|
|
96
|
+
'fetchPositionHistory': 'emulated',
|
|
96
97
|
'fetchPositionMode': true,
|
|
97
98
|
'fetchPositions': true,
|
|
99
|
+
'fetchPositionsHistory': true,
|
|
98
100
|
'fetchPositionsRisk': undefined,
|
|
99
101
|
'fetchPremiumIndexOHLCV': false,
|
|
100
102
|
'fetchStatus': true,
|
|
@@ -4867,6 +4869,8 @@ export default class mexc extends Exchange {
|
|
|
4867
4869
|
return this.parsePositions(data, symbols);
|
|
4868
4870
|
}
|
|
4869
4871
|
parsePosition(position, market = undefined) {
|
|
4872
|
+
//
|
|
4873
|
+
// fetchPositions
|
|
4870
4874
|
//
|
|
4871
4875
|
// {
|
|
4872
4876
|
// "positionId": 1394650,
|
|
@@ -4891,6 +4895,40 @@ export default class mexc extends Exchange {
|
|
|
4891
4895
|
// "autoAddIm": false
|
|
4892
4896
|
// }
|
|
4893
4897
|
//
|
|
4898
|
+
// fetchPositionsHistory
|
|
4899
|
+
//
|
|
4900
|
+
// {
|
|
4901
|
+
// positionId: '390281084',
|
|
4902
|
+
// symbol: 'RVN_USDT',
|
|
4903
|
+
// positionType: '1',
|
|
4904
|
+
// openType: '2',
|
|
4905
|
+
// state: '3',
|
|
4906
|
+
// holdVol: '0',
|
|
4907
|
+
// frozenVol: '0',
|
|
4908
|
+
// closeVol: '1141',
|
|
4909
|
+
// holdAvgPrice: '0.03491',
|
|
4910
|
+
// holdAvgPriceFullyScale: '0.03491',
|
|
4911
|
+
// openAvgPrice: '0.03491',
|
|
4912
|
+
// openAvgPriceFullyScale: '0.03491',
|
|
4913
|
+
// closeAvgPrice: '0.03494',
|
|
4914
|
+
// liquidatePrice: '0.03433',
|
|
4915
|
+
// oim: '0',
|
|
4916
|
+
// im: '0',
|
|
4917
|
+
// holdFee: '0',
|
|
4918
|
+
// realised: '0.1829',
|
|
4919
|
+
// leverage: '50',
|
|
4920
|
+
// createTime: '1711512408000',
|
|
4921
|
+
// updateTime: '1711512553000',
|
|
4922
|
+
// autoAddIm: false,
|
|
4923
|
+
// version: '4',
|
|
4924
|
+
// profitRatio: '0.0227',
|
|
4925
|
+
// newOpenAvgPrice: '0.03491',
|
|
4926
|
+
// newCloseAvgPrice: '0.03494',
|
|
4927
|
+
// closeProfitLoss: '0.3423',
|
|
4928
|
+
// fee: '0.1593977',
|
|
4929
|
+
// positionShowStatus: 'CLOSED'
|
|
4930
|
+
// }
|
|
4931
|
+
//
|
|
4894
4932
|
market = this.safeMarket(this.safeString(position, 'symbol'), market);
|
|
4895
4933
|
const symbol = market['symbol'];
|
|
4896
4934
|
const contracts = this.safeString(position, 'holdVol');
|
|
@@ -5528,6 +5566,79 @@ export default class mexc extends Exchange {
|
|
|
5528
5566
|
}
|
|
5529
5567
|
return [marginMode, params];
|
|
5530
5568
|
}
|
|
5569
|
+
async fetchPositionsHistory(symbols = undefined, since = undefined, limit = undefined, params = {}) {
|
|
5570
|
+
/**
|
|
5571
|
+
* @method
|
|
5572
|
+
* @name mexc#fetchPositionsHistory
|
|
5573
|
+
* @description fetches historical positions
|
|
5574
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-the-user-s-history-position-information
|
|
5575
|
+
* @param {string[]} [symbols] unified contract symbols
|
|
5576
|
+
* @param {int} [since] not used by mexc fetchPositionsHistory
|
|
5577
|
+
* @param {int} [limit] the maximum amount of candles to fetch, default=1000
|
|
5578
|
+
* @param {object} params extra parameters specific to the exchange api endpoint
|
|
5579
|
+
*
|
|
5580
|
+
* EXCHANGE SPECIFIC PARAMETERS
|
|
5581
|
+
* @param {int} type position type,1: long, 2: short
|
|
5582
|
+
* @param {int} page_num current page number, default is 1
|
|
5583
|
+
* @returns {object[]} a list of [position structures]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
5584
|
+
*/
|
|
5585
|
+
await this.loadMarkets();
|
|
5586
|
+
const request = {};
|
|
5587
|
+
if (symbols !== undefined) {
|
|
5588
|
+
const symbolsLength = symbols.length;
|
|
5589
|
+
if (symbolsLength === 1) {
|
|
5590
|
+
const market = this.market(symbols[0]);
|
|
5591
|
+
request['symbol'] = market['id'];
|
|
5592
|
+
}
|
|
5593
|
+
}
|
|
5594
|
+
if (limit !== undefined) {
|
|
5595
|
+
request['page_size'] = limit;
|
|
5596
|
+
}
|
|
5597
|
+
const response = await this.contractPrivateGetPositionListHistoryPositions(this.extend(request, params));
|
|
5598
|
+
//
|
|
5599
|
+
// {
|
|
5600
|
+
// success: true,
|
|
5601
|
+
// code: '0',
|
|
5602
|
+
// data: [
|
|
5603
|
+
// {
|
|
5604
|
+
// positionId: '390281084',
|
|
5605
|
+
// symbol: 'RVN_USDT',
|
|
5606
|
+
// positionType: '1',
|
|
5607
|
+
// openType: '2',
|
|
5608
|
+
// state: '3',
|
|
5609
|
+
// holdVol: '0',
|
|
5610
|
+
// frozenVol: '0',
|
|
5611
|
+
// closeVol: '1141',
|
|
5612
|
+
// holdAvgPrice: '0.03491',
|
|
5613
|
+
// holdAvgPriceFullyScale: '0.03491',
|
|
5614
|
+
// openAvgPrice: '0.03491',
|
|
5615
|
+
// openAvgPriceFullyScale: '0.03491',
|
|
5616
|
+
// closeAvgPrice: '0.03494',
|
|
5617
|
+
// liquidatePrice: '0.03433',
|
|
5618
|
+
// oim: '0',
|
|
5619
|
+
// im: '0',
|
|
5620
|
+
// holdFee: '0',
|
|
5621
|
+
// realised: '0.1829',
|
|
5622
|
+
// leverage: '50',
|
|
5623
|
+
// createTime: '1711512408000',
|
|
5624
|
+
// updateTime: '1711512553000',
|
|
5625
|
+
// autoAddIm: false,
|
|
5626
|
+
// version: '4',
|
|
5627
|
+
// profitRatio: '0.0227',
|
|
5628
|
+
// newOpenAvgPrice: '0.03491',
|
|
5629
|
+
// newCloseAvgPrice: '0.03494',
|
|
5630
|
+
// closeProfitLoss: '0.3423',
|
|
5631
|
+
// fee: '0.1593977',
|
|
5632
|
+
// positionShowStatus: 'CLOSED'
|
|
5633
|
+
// },
|
|
5634
|
+
// ...
|
|
5635
|
+
// ]
|
|
5636
|
+
// }
|
|
5637
|
+
//
|
|
5638
|
+
const data = this.safeList(response, 'data');
|
|
5639
|
+
const positions = this.parsePositions(data, symbols, params);
|
|
5640
|
+
return this.filterBySinceLimit(positions, since, limit);
|
|
5641
|
+
}
|
|
5531
5642
|
sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
|
|
5532
5643
|
const section = this.safeString(api, 0);
|
|
5533
5644
|
const access = this.safeString(api, 1);
|
package/js/src/ndax.d.ts
CHANGED
|
@@ -76,7 +76,7 @@ export default class ndax extends Exchange {
|
|
|
76
76
|
fetchWithdrawals(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
|
|
77
77
|
parseTransactionStatusByType(status: any, type?: any): string;
|
|
78
78
|
parseTransaction(transaction: any, currency?: Currency): Transaction;
|
|
79
|
-
withdraw(code: string, amount: number, address:
|
|
79
|
+
withdraw(code: string, amount: number, address: string, tag?: any, params?: {}): Promise<Transaction>;
|
|
80
80
|
nonce(): number;
|
|
81
81
|
sign(path: any, api?: string, method?: string, params?: {}, headers?: any, body?: any): {
|
|
82
82
|
url: string;
|
package/js/src/ndax.js
CHANGED
|
@@ -73,7 +73,11 @@ export default class ndax extends Exchange {
|
|
|
73
73
|
'fetchOrders': true,
|
|
74
74
|
'fetchOrderTrades': true,
|
|
75
75
|
'fetchPosition': false,
|
|
76
|
+
'fetchPositionHistory': false,
|
|
77
|
+
'fetchPositionMode': false,
|
|
76
78
|
'fetchPositions': false,
|
|
79
|
+
'fetchPositionsForSymbol': false,
|
|
80
|
+
'fetchPositionsHistory': false,
|
|
77
81
|
'fetchPositionsRisk': false,
|
|
78
82
|
'fetchPremiumIndexOHLCV': false,
|
|
79
83
|
'fetchTicker': true,
|
package/js/src/novadax.d.ts
CHANGED
|
@@ -42,7 +42,7 @@ export default class novadax extends Exchange {
|
|
|
42
42
|
status: string;
|
|
43
43
|
};
|
|
44
44
|
parseTransferStatus(status: any): string;
|
|
45
|
-
withdraw(code: string, amount: number, address:
|
|
45
|
+
withdraw(code: string, amount: number, address: string, tag?: any, params?: {}): Promise<Transaction>;
|
|
46
46
|
fetchAccounts(params?: {}): Promise<Account[]>;
|
|
47
47
|
fetchDeposits(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
|
|
48
48
|
fetchWithdrawals(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
|
package/js/src/novadax.js
CHANGED
|
@@ -78,7 +78,11 @@ export default class novadax extends Exchange {
|
|
|
78
78
|
'fetchOrders': true,
|
|
79
79
|
'fetchOrderTrades': true,
|
|
80
80
|
'fetchPosition': false,
|
|
81
|
+
'fetchPositionHistory': false,
|
|
82
|
+
'fetchPositionMode': false,
|
|
81
83
|
'fetchPositions': false,
|
|
84
|
+
'fetchPositionsForSymbol': false,
|
|
85
|
+
'fetchPositionsHistory': false,
|
|
82
86
|
'fetchPositionsRisk': false,
|
|
83
87
|
'fetchPremiumIndexOHLCV': false,
|
|
84
88
|
'fetchTicker': true,
|
package/js/src/okcoin.d.ts
CHANGED
|
@@ -56,7 +56,7 @@ export default class okcoin extends Exchange {
|
|
|
56
56
|
status: string;
|
|
57
57
|
};
|
|
58
58
|
parseTransferStatus(status: any): string;
|
|
59
|
-
withdraw(code: string, amount: number, address:
|
|
59
|
+
withdraw(code: string, amount: number, address: string, tag?: any, params?: {}): Promise<Transaction>;
|
|
60
60
|
fetchDeposits(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
|
|
61
61
|
fetchWithdrawals(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
|
|
62
62
|
parseTransactionStatus(status: any): string;
|
package/js/src/okx.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import Exchange from './abstract/okx.js';
|
|
2
|
-
import type { TransferEntry, Int, OrderSide, OrderType, Trade, OHLCV, Order, FundingRateHistory, OrderRequest, FundingHistory, Str, Transaction, Ticker, OrderBook, Balances, Tickers, Market, Greeks, Strings, MarketInterface, Currency, Leverage, Num, Account, OptionChain, Option, MarginModification, TradingFeeInterface, Currencies, Conversion } from './base/types.js';
|
|
2
|
+
import type { TransferEntry, Int, OrderSide, OrderType, Trade, OHLCV, Order, FundingRateHistory, OrderRequest, FundingHistory, Str, Transaction, Ticker, OrderBook, Balances, Tickers, Market, Greeks, Strings, MarketInterface, Currency, Leverage, Num, Account, OptionChain, Option, MarginModification, TradingFeeInterface, Currencies, Conversion, CancellationRequest, Position } from './base/types.js';
|
|
3
3
|
/**
|
|
4
4
|
* @class okx
|
|
5
5
|
* @augments Exchange
|
|
@@ -49,6 +49,8 @@ export default class okx extends Exchange {
|
|
|
49
49
|
cancelOrder(id: string, symbol?: Str, params?: {}): Promise<any>;
|
|
50
50
|
parseIds(ids: any): any;
|
|
51
51
|
cancelOrders(ids: any, symbol?: Str, params?: {}): Promise<Order[]>;
|
|
52
|
+
cancelOrdersForSymbols(orders: CancellationRequest[], params?: {}): Promise<Order[]>;
|
|
53
|
+
cancelAllOrdersAfter(timeout: Int, params?: {}): Promise<any>;
|
|
52
54
|
parseOrderStatus(status: any): string;
|
|
53
55
|
parseOrder(order: any, market?: Market): Order;
|
|
54
56
|
fetchOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
|
|
@@ -85,7 +87,7 @@ export default class okx extends Exchange {
|
|
|
85
87
|
};
|
|
86
88
|
fetchDepositAddressesByNetwork(code: string, params?: {}): Promise<{}>;
|
|
87
89
|
fetchDepositAddress(code: string, params?: {}): Promise<any>;
|
|
88
|
-
withdraw(code: string, amount: number, address:
|
|
90
|
+
withdraw(code: string, amount: number, address: string, tag?: any, params?: {}): Promise<Transaction>;
|
|
89
91
|
fetchDeposits(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
|
|
90
92
|
fetchDeposit(id: string, code?: Str, params?: {}): Promise<Transaction>;
|
|
91
93
|
fetchWithdrawals(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<Transaction[]>;
|
|
@@ -94,10 +96,10 @@ export default class okx extends Exchange {
|
|
|
94
96
|
parseTransaction(transaction: any, currency?: Currency): Transaction;
|
|
95
97
|
fetchLeverage(symbol: string, params?: {}): Promise<Leverage>;
|
|
96
98
|
parseLeverage(leverage: any, market?: any): Leverage;
|
|
97
|
-
fetchPosition(symbol: string, params?: {}): Promise<
|
|
98
|
-
fetchPositions(symbols?: Strings, params?: {}): Promise<
|
|
99
|
-
fetchPositionsForSymbol(symbol: string, params?: {}): Promise<
|
|
100
|
-
parsePosition(position: any, market?: Market):
|
|
99
|
+
fetchPosition(symbol: string, params?: {}): Promise<Position>;
|
|
100
|
+
fetchPositions(symbols?: Strings, params?: {}): Promise<Position[]>;
|
|
101
|
+
fetchPositionsForSymbol(symbol: string, params?: {}): Promise<Position[]>;
|
|
102
|
+
parsePosition(position: any, market?: Market): Position;
|
|
101
103
|
transfer(code: string, amount: number, fromAccount: string, toAccount: string, params?: {}): Promise<TransferEntry>;
|
|
102
104
|
parseTransfer(transfer: any, currency?: Currency): {
|
|
103
105
|
info: any;
|
|
@@ -194,8 +196,8 @@ export default class okx extends Exchange {
|
|
|
194
196
|
fetchBorrowRateHistory(code: string, since?: Int, limit?: Int, params?: {}): Promise<any>;
|
|
195
197
|
modifyMarginHelper(symbol: string, amount: any, type: any, params?: {}): Promise<MarginModification>;
|
|
196
198
|
parseMarginModification(data: any, market?: Market): MarginModification;
|
|
197
|
-
reduceMargin(symbol: string, amount:
|
|
198
|
-
addMargin(symbol: string, amount:
|
|
199
|
+
reduceMargin(symbol: string, amount: number, params?: {}): Promise<MarginModification>;
|
|
200
|
+
addMargin(symbol: string, amount: number, params?: {}): Promise<MarginModification>;
|
|
199
201
|
fetchMarketLeverageTiers(symbol: string, params?: {}): Promise<any[]>;
|
|
200
202
|
parseMarketLeverageTiers(info: any, market?: Market): any[];
|
|
201
203
|
fetchBorrowInterest(code?: Str, symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<any>;
|
|
@@ -305,4 +307,5 @@ export default class okx extends Exchange {
|
|
|
305
307
|
fetchConvertCurrencies(params?: {}): Promise<Currencies>;
|
|
306
308
|
handleErrors(httpCode: any, reason: any, url: any, method: any, headers: any, body: any, response: any, requestHeaders: any, requestBody: any): any;
|
|
307
309
|
fetchMarginAdjustmentHistory(symbol?: Str, type?: Str, since?: Num, limit?: Num, params?: {}): Promise<MarginModification[]>;
|
|
310
|
+
fetchPositionsHistory(symbols?: Strings, since?: Int, limit?: Int, params?: {}): Promise<Position[]>;
|
|
308
311
|
}
|