ccxt 4.4.39 → 4.4.41
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.min.js +3 -3
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/ascendex.js +9 -9
- package/dist/cjs/src/base/Exchange.js +32 -21
- package/dist/cjs/src/binance.js +37 -43
- package/dist/cjs/src/bingx.js +4 -3
- package/dist/cjs/src/bit2c.js +0 -1
- package/dist/cjs/src/bitbank.js +0 -1
- package/dist/cjs/src/bitbns.js +0 -1
- package/dist/cjs/src/bitfinex.js +18 -19
- package/dist/cjs/src/bitfinex1.js +0 -1
- package/dist/cjs/src/bitflyer.js +0 -1
- package/dist/cjs/src/bitget.js +2 -2
- package/dist/cjs/src/bithumb.js +0 -1
- package/dist/cjs/src/bitmart.js +257 -5
- package/dist/cjs/src/bitmex.js +5 -6
- package/dist/cjs/src/bitopro.js +4 -5
- package/dist/cjs/src/bitrue.js +5 -7
- package/dist/cjs/src/bitso.js +1 -2
- package/dist/cjs/src/bitstamp.js +1 -2
- package/dist/cjs/src/bitteam.js +1 -3
- package/dist/cjs/src/bitvavo.js +2 -4
- package/dist/cjs/src/blockchaincom.js +5 -5
- package/dist/cjs/src/blofin.js +10 -10
- package/dist/cjs/src/btcalpha.js +0 -1
- package/dist/cjs/src/btcbox.js +0 -1
- package/dist/cjs/src/btcmarkets.js +1 -3
- package/dist/cjs/src/bybit.js +10 -11
- package/dist/cjs/src/cex.js +1 -1
- package/dist/cjs/src/coinbase.js +77 -1
- package/dist/cjs/src/coinbaseexchange.js +1 -1
- package/dist/cjs/src/coinbaseinternational.js +62 -0
- package/dist/cjs/src/coincatch.js +1 -1
- package/dist/cjs/src/coinex.js +9 -9
- package/dist/cjs/src/coinlist.js +1 -1
- package/dist/cjs/src/coinmetro.js +1 -1
- package/dist/cjs/src/cryptocom.js +91 -2
- package/dist/cjs/src/currencycom.js +1 -1
- package/dist/cjs/src/defx.js +1 -2
- package/dist/cjs/src/delta.js +1 -1
- package/dist/cjs/src/digifinex.js +1 -1
- package/dist/cjs/src/exmo.js +64 -6
- package/dist/cjs/src/gate.js +2 -2
- package/dist/cjs/src/hashkey.js +3 -5
- package/dist/cjs/src/htx.js +2 -2
- package/dist/cjs/src/hyperliquid.js +66 -2
- package/dist/cjs/src/kraken.js +130 -27
- package/dist/cjs/src/kucoin.js +30 -25
- package/dist/cjs/src/luno.js +1 -1
- package/dist/cjs/src/mexc.js +138 -2
- package/dist/cjs/src/ndax.js +1 -1
- package/dist/cjs/src/okcoin.js +18 -18
- package/dist/cjs/src/okx.js +27 -22
- package/dist/cjs/src/phemex.js +12 -8
- package/dist/cjs/src/poloniex.js +1 -1
- package/dist/cjs/src/poloniexfutures.js +6 -6
- package/dist/cjs/src/pro/bitget.js +1 -1
- package/dist/cjs/src/pro/bybit.js +13 -1
- package/dist/cjs/src/pro/coinex.js +2 -2
- package/dist/cjs/src/pro/gate.js +6 -6
- package/dist/cjs/src/pro/kucoin.js +3 -3
- package/dist/cjs/src/pro/okx.js +11 -11
- package/dist/cjs/src/pro/upbit.js +3 -3
- package/dist/cjs/src/vertex.js +11 -11
- package/dist/cjs/src/woo.js +33 -33
- package/dist/cjs/src/woofipro.js +24 -24
- package/dist/cjs/src/xt.js +31 -28
- package/dist/cjs/src/zonda.js +1 -1
- package/js/ccxt.d.ts +3 -3
- package/js/ccxt.js +1 -1
- package/js/src/abstract/bitmart.d.ts +2 -0
- package/js/src/abstract/okx.d.ts +5 -0
- package/js/src/ascendex.d.ts +2 -2
- package/js/src/ascendex.js +9 -9
- package/js/src/base/Exchange.d.ts +6 -3
- package/js/src/base/Exchange.js +32 -21
- package/js/src/base/types.d.ts +2 -0
- package/js/src/binance.d.ts +9 -9
- package/js/src/binance.js +37 -43
- package/js/src/bingx.d.ts +1 -1
- package/js/src/bingx.js +4 -3
- package/js/src/bit2c.js +0 -1
- package/js/src/bitbank.js +0 -1
- package/js/src/bitbns.js +0 -1
- package/js/src/bitfinex.d.ts +3 -3
- package/js/src/bitfinex.js +18 -19
- package/js/src/bitfinex1.js +0 -1
- package/js/src/bitflyer.js +0 -1
- package/js/src/bitget.d.ts +1 -1
- package/js/src/bitget.js +2 -2
- package/js/src/bithumb.js +0 -1
- package/js/src/bitmart.d.ts +53 -2
- package/js/src/bitmart.js +257 -5
- package/js/src/bitmex.d.ts +1 -1
- package/js/src/bitmex.js +5 -6
- package/js/src/bitopro.js +4 -5
- package/js/src/bitrue.js +5 -7
- package/js/src/bitso.d.ts +1 -1
- package/js/src/bitso.js +1 -2
- package/js/src/bitstamp.d.ts +1 -1
- package/js/src/bitstamp.js +1 -2
- package/js/src/bitteam.js +1 -3
- package/js/src/bitvavo.d.ts +1 -1
- package/js/src/bitvavo.js +2 -4
- package/js/src/blockchaincom.js +5 -5
- package/js/src/blofin.d.ts +3 -3
- package/js/src/blofin.js +10 -10
- package/js/src/btcalpha.js +0 -1
- package/js/src/btcbox.js +0 -1
- package/js/src/btcmarkets.js +1 -3
- package/js/src/bybit.d.ts +1 -1
- package/js/src/bybit.js +10 -11
- package/js/src/cex.d.ts +1 -1
- package/js/src/cex.js +1 -1
- package/js/src/coinbase.d.ts +1 -1
- package/js/src/coinbase.js +77 -1
- package/js/src/coinbaseexchange.d.ts +1 -1
- package/js/src/coinbaseexchange.js +1 -1
- package/js/src/coinbaseinternational.js +62 -0
- package/js/src/coincatch.d.ts +1 -1
- package/js/src/coincatch.js +1 -1
- package/js/src/coinex.js +9 -9
- package/js/src/coinlist.d.ts +1 -1
- package/js/src/coinlist.js +1 -1
- package/js/src/coinmetro.d.ts +1 -1
- package/js/src/coinmetro.js +1 -1
- package/js/src/cryptocom.d.ts +2 -2
- package/js/src/cryptocom.js +91 -2
- package/js/src/currencycom.d.ts +1 -1
- package/js/src/currencycom.js +1 -1
- package/js/src/defx.d.ts +1 -2
- package/js/src/defx.js +1 -2
- package/js/src/delta.d.ts +1 -1
- package/js/src/delta.js +1 -1
- package/js/src/digifinex.d.ts +1 -1
- package/js/src/digifinex.js +1 -1
- package/js/src/exmo.d.ts +35 -0
- package/js/src/exmo.js +64 -6
- package/js/src/gate.d.ts +1 -1
- package/js/src/gate.js +2 -2
- package/js/src/hashkey.d.ts +1 -1
- package/js/src/hashkey.js +3 -5
- package/js/src/htx.d.ts +1 -1
- package/js/src/htx.js +2 -2
- package/js/src/hyperliquid.d.ts +21 -2
- package/js/src/hyperliquid.js +66 -2
- package/js/src/kraken.d.ts +14 -8
- package/js/src/kraken.js +130 -27
- package/js/src/kucoin.d.ts +13 -13
- package/js/src/kucoin.js +30 -25
- package/js/src/luno.d.ts +1 -1
- package/js/src/luno.js +1 -1
- package/js/src/mexc.d.ts +1 -2
- package/js/src/mexc.js +138 -2
- package/js/src/ndax.d.ts +1 -1
- package/js/src/ndax.js +1 -1
- package/js/src/okcoin.d.ts +4 -4
- package/js/src/okcoin.js +18 -18
- package/js/src/okx.d.ts +3 -3
- package/js/src/okx.js +27 -22
- package/js/src/phemex.js +12 -8
- package/js/src/poloniex.d.ts +1 -1
- package/js/src/poloniex.js +1 -1
- package/js/src/poloniexfutures.d.ts +1 -1
- package/js/src/poloniexfutures.js +6 -6
- package/js/src/pro/bitget.d.ts +1 -1
- package/js/src/pro/bitget.js +1 -1
- package/js/src/pro/bybit.d.ts +1 -1
- package/js/src/pro/bybit.js +13 -1
- package/js/src/pro/coinex.js +2 -2
- package/js/src/pro/gate.d.ts +2 -2
- package/js/src/pro/gate.js +6 -6
- package/js/src/pro/kucoin.d.ts +1 -1
- package/js/src/pro/kucoin.js +3 -3
- package/js/src/pro/okx.d.ts +2 -2
- package/js/src/pro/okx.js +11 -11
- package/js/src/pro/upbit.d.ts +3 -3
- package/js/src/pro/upbit.js +3 -3
- package/js/src/vertex.d.ts +3 -3
- package/js/src/vertex.js +11 -11
- package/js/src/woo.d.ts +7 -7
- package/js/src/woo.js +33 -33
- package/js/src/woofipro.d.ts +1 -1
- package/js/src/woofipro.js +24 -24
- package/js/src/xt.d.ts +7 -7
- package/js/src/xt.js +31 -28
- package/js/src/zonda.d.ts +1 -1
- package/js/src/zonda.js +1 -1
- package/package.json +2 -2
package/js/src/kraken.d.ts
CHANGED
|
@@ -122,7 +122,7 @@ export default class kraken extends Exchange {
|
|
|
122
122
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
123
123
|
* @param {int} [params.until] timestamp in ms of the latest ledger entry
|
|
124
124
|
* @param {int} [params.end] timestamp in seconds of the latest ledger entry
|
|
125
|
-
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger
|
|
125
|
+
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
|
|
126
126
|
*/
|
|
127
127
|
fetchLedger(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<LedgerEntry[]>;
|
|
128
128
|
fetchLedgerEntriesByIds(ids: any, code?: Str, params?: {}): Promise<LedgerEntry[]>;
|
|
@@ -280,11 +280,13 @@ export default class kraken extends Exchange {
|
|
|
280
280
|
* @method
|
|
281
281
|
* @name kraken#cancelOrder
|
|
282
282
|
* @description cancels an open order
|
|
283
|
-
* @see https://docs.kraken.com/rest
|
|
283
|
+
* @see https://docs.kraken.com/api/docs/rest-api/cancel-order
|
|
284
284
|
* @param {string} id order id
|
|
285
|
-
* @param {string} symbol unified symbol of the market the order was made in
|
|
285
|
+
* @param {string} [symbol] unified symbol of the market the order was made in
|
|
286
286
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
287
|
-
* @
|
|
287
|
+
* @param {string} [params.clientOrderId] the orders client order id
|
|
288
|
+
* @param {int} [params.userref] the orders user reference id
|
|
289
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
288
290
|
*/
|
|
289
291
|
cancelOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
|
|
290
292
|
/**
|
|
@@ -322,11 +324,13 @@ export default class kraken extends Exchange {
|
|
|
322
324
|
* @method
|
|
323
325
|
* @name kraken#fetchOpenOrders
|
|
324
326
|
* @description fetch all unfilled currently open orders
|
|
325
|
-
* @see https://docs.kraken.com/rest
|
|
326
|
-
* @param {string} symbol unified market symbol
|
|
327
|
+
* @see https://docs.kraken.com/api/docs/rest-api/get-open-orders
|
|
328
|
+
* @param {string} [symbol] unified market symbol
|
|
327
329
|
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
328
330
|
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
329
331
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
332
|
+
* @param {string} [params.clientOrderId] the orders client order id
|
|
333
|
+
* @param {int} [params.userref] the orders user reference id
|
|
330
334
|
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
331
335
|
*/
|
|
332
336
|
fetchOpenOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
@@ -334,12 +338,14 @@ export default class kraken extends Exchange {
|
|
|
334
338
|
* @method
|
|
335
339
|
* @name kraken#fetchClosedOrders
|
|
336
340
|
* @description fetches information on multiple closed orders made by the user
|
|
337
|
-
* @see https://docs.kraken.com/rest
|
|
338
|
-
* @param {string} symbol unified market symbol of the market orders were made in
|
|
341
|
+
* @see https://docs.kraken.com/api/docs/rest-api/get-closed-orders
|
|
342
|
+
* @param {string} [symbol] unified market symbol of the market orders were made in
|
|
339
343
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
340
344
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
341
345
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
342
346
|
* @param {int} [params.until] timestamp in ms of the latest entry
|
|
347
|
+
* @param {string} [params.clientOrderId] the orders client order id
|
|
348
|
+
* @param {int} [params.userref] the orders user reference id
|
|
343
349
|
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
344
350
|
*/
|
|
345
351
|
fetchClosedOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
package/js/src/kraken.js
CHANGED
|
@@ -1137,7 +1137,7 @@ export default class kraken extends Exchange {
|
|
|
1137
1137
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1138
1138
|
* @param {int} [params.until] timestamp in ms of the latest ledger entry
|
|
1139
1139
|
* @param {int} [params.end] timestamp in seconds of the latest ledger entry
|
|
1140
|
-
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger
|
|
1140
|
+
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
|
|
1141
1141
|
*/
|
|
1142
1142
|
async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
1143
1143
|
// https://www.kraken.com/features/api#get-ledgers-info
|
|
@@ -1655,6 +1655,37 @@ export default class kraken extends Exchange {
|
|
|
1655
1655
|
// }
|
|
1656
1656
|
// }
|
|
1657
1657
|
//
|
|
1658
|
+
// fetchOpenOrders
|
|
1659
|
+
//
|
|
1660
|
+
// {
|
|
1661
|
+
// "refid": null,
|
|
1662
|
+
// "userref": null,
|
|
1663
|
+
// "cl_ord_id": "1234",
|
|
1664
|
+
// "status": "open",
|
|
1665
|
+
// "opentm": 1733815269.370054,
|
|
1666
|
+
// "starttm": 0,
|
|
1667
|
+
// "expiretm": 0,
|
|
1668
|
+
// "descr": {
|
|
1669
|
+
// "pair": "XBTUSD",
|
|
1670
|
+
// "type": "buy",
|
|
1671
|
+
// "ordertype": "limit",
|
|
1672
|
+
// "price": "70000.0",
|
|
1673
|
+
// "price2": "0",
|
|
1674
|
+
// "leverage": "none",
|
|
1675
|
+
// "order": "buy 0.00010000 XBTUSD @ limit 70000.0",
|
|
1676
|
+
// "close": ""
|
|
1677
|
+
// },
|
|
1678
|
+
// "vol": "0.00010000",
|
|
1679
|
+
// "vol_exec": "0.00000000",
|
|
1680
|
+
// "cost": "0.00000",
|
|
1681
|
+
// "fee": "0.00000",
|
|
1682
|
+
// "price": "0.00000",
|
|
1683
|
+
// "stopprice": "0.00000",
|
|
1684
|
+
// "limitprice": "0.00000",
|
|
1685
|
+
// "misc": "",
|
|
1686
|
+
// "oflags": "fciq"
|
|
1687
|
+
// }
|
|
1688
|
+
//
|
|
1658
1689
|
const description = this.safeDict(order, 'descr', {});
|
|
1659
1690
|
const orderDescriptionObj = this.safeDict(order, 'descr'); // can be null
|
|
1660
1691
|
let orderDescription = undefined;
|
|
@@ -1745,7 +1776,8 @@ export default class kraken extends Exchange {
|
|
|
1745
1776
|
const txid = this.safeList(order, 'txid');
|
|
1746
1777
|
id = this.safeString(txid, 0);
|
|
1747
1778
|
}
|
|
1748
|
-
const
|
|
1779
|
+
const userref = this.safeString(order, 'userref');
|
|
1780
|
+
const clientOrderId = this.safeString(order, 'cl_ord_id', userref);
|
|
1749
1781
|
const rawTrades = this.safeValue(order, 'trades', []);
|
|
1750
1782
|
const trades = [];
|
|
1751
1783
|
for (let i = 0; i < rawTrades.length; i++) {
|
|
@@ -1980,10 +2012,10 @@ export default class kraken extends Exchange {
|
|
|
1980
2012
|
let request = {
|
|
1981
2013
|
'txid': id,
|
|
1982
2014
|
};
|
|
1983
|
-
const clientOrderId = this.
|
|
2015
|
+
const clientOrderId = this.safeString2(params, 'clientOrderId', 'cl_ord_id');
|
|
1984
2016
|
if (clientOrderId !== undefined) {
|
|
1985
2017
|
request['cl_ord_id'] = clientOrderId;
|
|
1986
|
-
params = this.omit(params, 'clientOrderId');
|
|
2018
|
+
params = this.omit(params, ['clientOrderId', 'cl_ord_id']);
|
|
1987
2019
|
request = this.omit(request, 'txid');
|
|
1988
2020
|
}
|
|
1989
2021
|
const isMarket = (type === 'market');
|
|
@@ -2274,20 +2306,28 @@ export default class kraken extends Exchange {
|
|
|
2274
2306
|
* @method
|
|
2275
2307
|
* @name kraken#cancelOrder
|
|
2276
2308
|
* @description cancels an open order
|
|
2277
|
-
* @see https://docs.kraken.com/rest
|
|
2309
|
+
* @see https://docs.kraken.com/api/docs/rest-api/cancel-order
|
|
2278
2310
|
* @param {string} id order id
|
|
2279
|
-
* @param {string} symbol unified symbol of the market the order was made in
|
|
2311
|
+
* @param {string} [symbol] unified symbol of the market the order was made in
|
|
2280
2312
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2281
|
-
* @
|
|
2313
|
+
* @param {string} [params.clientOrderId] the orders client order id
|
|
2314
|
+
* @param {int} [params.userref] the orders user reference id
|
|
2315
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2282
2316
|
*/
|
|
2283
2317
|
async cancelOrder(id, symbol = undefined, params = {}) {
|
|
2284
2318
|
await this.loadMarkets();
|
|
2285
2319
|
let response = undefined;
|
|
2286
|
-
const
|
|
2287
|
-
|
|
2288
|
-
|
|
2320
|
+
const requestId = this.safeValue(params, 'userref', id); // string or integer
|
|
2321
|
+
params = this.omit(params, 'userref');
|
|
2322
|
+
let request = {
|
|
2323
|
+
'txid': requestId, // order id or userref
|
|
2289
2324
|
};
|
|
2290
|
-
|
|
2325
|
+
const clientOrderId = this.safeString2(params, 'clientOrderId', 'cl_ord_id');
|
|
2326
|
+
if (clientOrderId !== undefined) {
|
|
2327
|
+
request['cl_ord_id'] = clientOrderId;
|
|
2328
|
+
params = this.omit(params, ['clientOrderId', 'cl_ord_id']);
|
|
2329
|
+
request = this.omit(request, 'txid');
|
|
2330
|
+
}
|
|
2291
2331
|
try {
|
|
2292
2332
|
response = await this.privatePostCancelOrder(this.extend(request, params));
|
|
2293
2333
|
//
|
|
@@ -2399,11 +2439,13 @@ export default class kraken extends Exchange {
|
|
|
2399
2439
|
* @method
|
|
2400
2440
|
* @name kraken#fetchOpenOrders
|
|
2401
2441
|
* @description fetch all unfilled currently open orders
|
|
2402
|
-
* @see https://docs.kraken.com/rest
|
|
2403
|
-
* @param {string} symbol unified market symbol
|
|
2442
|
+
* @see https://docs.kraken.com/api/docs/rest-api/get-open-orders
|
|
2443
|
+
* @param {string} [symbol] unified market symbol
|
|
2404
2444
|
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
2405
2445
|
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
2406
2446
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2447
|
+
* @param {string} [params.clientOrderId] the orders client order id
|
|
2448
|
+
* @param {int} [params.userref] the orders user reference id
|
|
2407
2449
|
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2408
2450
|
*/
|
|
2409
2451
|
async fetchOpenOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
@@ -2412,31 +2454,81 @@ export default class kraken extends Exchange {
|
|
|
2412
2454
|
if (since !== undefined) {
|
|
2413
2455
|
request['start'] = this.parseToInt(since / 1000);
|
|
2414
2456
|
}
|
|
2415
|
-
|
|
2416
|
-
|
|
2457
|
+
const userref = this.safeInteger(params, 'userref');
|
|
2458
|
+
if (userref !== undefined) {
|
|
2459
|
+
request['userref'] = userref;
|
|
2460
|
+
params = this.omit(params, 'userref');
|
|
2461
|
+
}
|
|
2462
|
+
const clientOrderId = this.safeString(params, 'clientOrderId');
|
|
2417
2463
|
if (clientOrderId !== undefined) {
|
|
2418
|
-
request['
|
|
2419
|
-
|
|
2464
|
+
request['cl_ord_id'] = clientOrderId;
|
|
2465
|
+
params = this.omit(params, 'clientOrderId');
|
|
2420
2466
|
}
|
|
2421
|
-
const response = await this.privatePostOpenOrders(this.extend(request,
|
|
2467
|
+
const response = await this.privatePostOpenOrders(this.extend(request, params));
|
|
2468
|
+
//
|
|
2469
|
+
// {
|
|
2470
|
+
// "error": [],
|
|
2471
|
+
// "result": {
|
|
2472
|
+
// "open": {
|
|
2473
|
+
// "O45M52-BFD5S-YXKQOU": {
|
|
2474
|
+
// "refid": null,
|
|
2475
|
+
// "userref": null,
|
|
2476
|
+
// "cl_ord_id": "1234",
|
|
2477
|
+
// "status": "open",
|
|
2478
|
+
// "opentm": 1733815269.370054,
|
|
2479
|
+
// "starttm": 0,
|
|
2480
|
+
// "expiretm": 0,
|
|
2481
|
+
// "descr": {
|
|
2482
|
+
// "pair": "XBTUSD",
|
|
2483
|
+
// "type": "buy",
|
|
2484
|
+
// "ordertype": "limit",
|
|
2485
|
+
// "price": "70000.0",
|
|
2486
|
+
// "price2": "0",
|
|
2487
|
+
// "leverage": "none",
|
|
2488
|
+
// "order": "buy 0.00010000 XBTUSD @ limit 70000.0",
|
|
2489
|
+
// "close": ""
|
|
2490
|
+
// },
|
|
2491
|
+
// "vol": "0.00010000",
|
|
2492
|
+
// "vol_exec": "0.00000000",
|
|
2493
|
+
// "cost": "0.00000",
|
|
2494
|
+
// "fee": "0.00000",
|
|
2495
|
+
// "price": "0.00000",
|
|
2496
|
+
// "stopprice": "0.00000",
|
|
2497
|
+
// "limitprice": "0.00000",
|
|
2498
|
+
// "misc": "",
|
|
2499
|
+
// "oflags": "fciq"
|
|
2500
|
+
// }
|
|
2501
|
+
// }
|
|
2502
|
+
// }
|
|
2503
|
+
// }
|
|
2504
|
+
//
|
|
2422
2505
|
let market = undefined;
|
|
2423
2506
|
if (symbol !== undefined) {
|
|
2424
2507
|
market = this.market(symbol);
|
|
2425
2508
|
}
|
|
2426
2509
|
const result = this.safeDict(response, 'result', {});
|
|
2427
|
-
const
|
|
2510
|
+
const open = this.safeDict(result, 'open', {});
|
|
2511
|
+
const orders = [];
|
|
2512
|
+
const orderIds = Object.keys(open);
|
|
2513
|
+
for (let i = 0; i < orderIds.length; i++) {
|
|
2514
|
+
const id = orderIds[i];
|
|
2515
|
+
const item = open[id];
|
|
2516
|
+
orders.push(this.extend({ 'id': id }, item));
|
|
2517
|
+
}
|
|
2428
2518
|
return this.parseOrders(orders, market, since, limit);
|
|
2429
2519
|
}
|
|
2430
2520
|
/**
|
|
2431
2521
|
* @method
|
|
2432
2522
|
* @name kraken#fetchClosedOrders
|
|
2433
2523
|
* @description fetches information on multiple closed orders made by the user
|
|
2434
|
-
* @see https://docs.kraken.com/rest
|
|
2435
|
-
* @param {string} symbol unified market symbol of the market orders were made in
|
|
2524
|
+
* @see https://docs.kraken.com/api/docs/rest-api/get-closed-orders
|
|
2525
|
+
* @param {string} [symbol] unified market symbol of the market orders were made in
|
|
2436
2526
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
2437
2527
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
2438
2528
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2439
2529
|
* @param {int} [params.until] timestamp in ms of the latest entry
|
|
2530
|
+
* @param {string} [params.clientOrderId] the orders client order id
|
|
2531
|
+
* @param {int} [params.userref] the orders user reference id
|
|
2440
2532
|
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2441
2533
|
*/
|
|
2442
2534
|
async fetchClosedOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
@@ -2445,14 +2537,18 @@ export default class kraken extends Exchange {
|
|
|
2445
2537
|
if (since !== undefined) {
|
|
2446
2538
|
request['start'] = this.parseToInt(since / 1000);
|
|
2447
2539
|
}
|
|
2448
|
-
|
|
2449
|
-
|
|
2540
|
+
const userref = this.safeInteger(params, 'userref');
|
|
2541
|
+
if (userref !== undefined) {
|
|
2542
|
+
request['userref'] = userref;
|
|
2543
|
+
params = this.omit(params, 'userref');
|
|
2544
|
+
}
|
|
2545
|
+
const clientOrderId = this.safeString(params, 'clientOrderId');
|
|
2450
2546
|
if (clientOrderId !== undefined) {
|
|
2451
|
-
request['
|
|
2452
|
-
|
|
2547
|
+
request['cl_ord_id'] = clientOrderId;
|
|
2548
|
+
params = this.omit(params, 'clientOrderId');
|
|
2453
2549
|
}
|
|
2454
2550
|
[request, params] = this.handleUntilOption('end', request, params);
|
|
2455
|
-
const response = await this.privatePostClosedOrders(this.extend(request,
|
|
2551
|
+
const response = await this.privatePostClosedOrders(this.extend(request, params));
|
|
2456
2552
|
//
|
|
2457
2553
|
// {
|
|
2458
2554
|
// "error":[],
|
|
@@ -2497,7 +2593,14 @@ export default class kraken extends Exchange {
|
|
|
2497
2593
|
market = this.market(symbol);
|
|
2498
2594
|
}
|
|
2499
2595
|
const result = this.safeDict(response, 'result', {});
|
|
2500
|
-
const
|
|
2596
|
+
const closed = this.safeDict(result, 'closed', {});
|
|
2597
|
+
const orders = [];
|
|
2598
|
+
const orderIds = Object.keys(closed);
|
|
2599
|
+
for (let i = 0; i < orderIds.length; i++) {
|
|
2600
|
+
const id = orderIds[i];
|
|
2601
|
+
const item = closed[id];
|
|
2602
|
+
orders.push(this.extend({ 'id': id }, item));
|
|
2603
|
+
}
|
|
2501
2604
|
return this.parseOrders(orders, market, since, limit);
|
|
2502
2605
|
}
|
|
2503
2606
|
parseTransactionStatus(status) {
|
package/js/src/kucoin.d.ts
CHANGED
|
@@ -231,7 +231,7 @@ export default class kucoin extends Exchange {
|
|
|
231
231
|
* market orders --------------------------------------------------
|
|
232
232
|
* @param {string} [params.funds] // Amount of quote currency to use
|
|
233
233
|
* stop orders ----------------------------------------------------
|
|
234
|
-
* @param {string} [params.stop] Either loss or entry, the default is loss. Requires
|
|
234
|
+
* @param {string} [params.stop] Either loss or entry, the default is loss. Requires triggerPrice to be defined
|
|
235
235
|
* margin orders --------------------------------------------------
|
|
236
236
|
* @param {float} [params.leverage] Leverage size of the order
|
|
237
237
|
* @param {string} [params.stp] '', // self trade prevention, CN, CO, CB or DC
|
|
@@ -323,7 +323,7 @@ export default class kucoin extends Exchange {
|
|
|
323
323
|
* @param {string} id order id
|
|
324
324
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
325
325
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
326
|
-
* @param {bool} [params.
|
|
326
|
+
* @param {bool} [params.trigger] True if cancelling a stop order
|
|
327
327
|
* @param {bool} [params.hf] false, // true for hf order
|
|
328
328
|
* @param {bool} [params.sync] false, // true to use the hf sync call
|
|
329
329
|
* @returns Response from the exchange
|
|
@@ -338,7 +338,7 @@ export default class kucoin extends Exchange {
|
|
|
338
338
|
* @see https://docs.kucoin.com/spot-hf/#cancel-all-hf-orders-by-symbol
|
|
339
339
|
* @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
|
|
340
340
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
341
|
-
* @param {bool} [params.
|
|
341
|
+
* @param {bool} [params.trigger] *invalid for isolated margin* true if cancelling all stop orders
|
|
342
342
|
* @param {string} [params.marginMode] 'cross' or 'isolated'
|
|
343
343
|
* @param {string} [params.orderIds] *stop orders only* Comma seperated order IDs
|
|
344
344
|
* @param {bool} [params.hf] false, // true for hf order
|
|
@@ -362,9 +362,9 @@ export default class kucoin extends Exchange {
|
|
|
362
362
|
* @param {string} [params.side] buy or sell
|
|
363
363
|
* @param {string} [params.type] limit, market, limit_stop or market_stop
|
|
364
364
|
* @param {string} [params.tradeType] TRADE for spot trading, MARGIN_TRADE for Margin Trading
|
|
365
|
-
* @param {int} [params.currentPage] *
|
|
366
|
-
* @param {string} [params.orderIds] *
|
|
367
|
-
* @param {bool} [params.
|
|
365
|
+
* @param {int} [params.currentPage] *trigger orders only* current page
|
|
366
|
+
* @param {string} [params.orderIds] *trigger orders only* comma seperated order ID list
|
|
367
|
+
* @param {bool} [params.trigger] True if fetching a trigger order
|
|
368
368
|
* @param {bool} [params.hf] false, // true for hf order
|
|
369
369
|
* @returns An [array of order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
370
370
|
*/
|
|
@@ -385,7 +385,7 @@ export default class kucoin extends Exchange {
|
|
|
385
385
|
* @param {string} [params.side] buy or sell
|
|
386
386
|
* @param {string} [params.type] limit, market, limit_stop or market_stop
|
|
387
387
|
* @param {string} [params.tradeType] TRADE for spot trading, MARGIN_TRADE for Margin Trading
|
|
388
|
-
* @param {bool} [params.
|
|
388
|
+
* @param {bool} [params.trigger] True if fetching a trigger order
|
|
389
389
|
* @param {bool} [params.hf] false, // true for hf order
|
|
390
390
|
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
391
391
|
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
@@ -404,12 +404,12 @@ export default class kucoin extends Exchange {
|
|
|
404
404
|
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
405
405
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
406
406
|
* @param {int} [params.until] end time in ms
|
|
407
|
-
* @param {bool} [params.
|
|
407
|
+
* @param {bool} [params.trigger] true if fetching trigger orders
|
|
408
408
|
* @param {string} [params.side] buy or sell
|
|
409
409
|
* @param {string} [params.type] limit, market, limit_stop or market_stop
|
|
410
410
|
* @param {string} [params.tradeType] TRADE for spot trading, MARGIN_TRADE for Margin Trading
|
|
411
|
-
* @param {int} [params.currentPage] *
|
|
412
|
-
* @param {string} [params.orderIds] *
|
|
411
|
+
* @param {int} [params.currentPage] *trigger orders only* current page
|
|
412
|
+
* @param {string} [params.orderIds] *trigger orders only* comma seperated order ID list
|
|
413
413
|
* @param {bool} [params.hf] false, // true for hf order
|
|
414
414
|
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
415
415
|
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
@@ -426,9 +426,9 @@ export default class kucoin extends Exchange {
|
|
|
426
426
|
* @see https://docs.kucoin.com/spot-hf/#details-of-a-single-hf-order
|
|
427
427
|
* @see https://docs.kucoin.com/spot-hf/#obtain-details-of-a-single-hf-order-using-clientoid
|
|
428
428
|
* @param {string} id Order id
|
|
429
|
-
* @param {string} symbol not sent to exchange except for
|
|
429
|
+
* @param {string} symbol not sent to exchange except for trigger orders with clientOid, but used internally by CCXT to filter
|
|
430
430
|
* @param {object} [params] exchange specific parameters
|
|
431
|
-
* @param {bool} [params.
|
|
431
|
+
* @param {bool} [params.trigger] true if fetching a trigger order
|
|
432
432
|
* @param {bool} [params.hf] false, // true for hf order
|
|
433
433
|
* @param {bool} [params.clientOid] unique order id created by users to identify their orders
|
|
434
434
|
* @returns An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
@@ -581,7 +581,7 @@ export default class kucoin extends Exchange {
|
|
|
581
581
|
* @param {boolean} [params.hf] default false, when true will fetch ledger entries for the high frequency trading account
|
|
582
582
|
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
583
583
|
* @param {boolean} [params.paginate] 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)
|
|
584
|
-
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger
|
|
584
|
+
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
|
|
585
585
|
*/
|
|
586
586
|
fetchLedger(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<LedgerEntry[]>;
|
|
587
587
|
calculateRateLimiterCost(api: any, method: any, path: any, params: any, config?: {}): any;
|
package/js/src/kucoin.js
CHANGED
|
@@ -643,6 +643,8 @@ export default class kucoin extends Exchange {
|
|
|
643
643
|
'version': 'v1',
|
|
644
644
|
'symbolSeparator': '-',
|
|
645
645
|
'fetchMyTradesMethod': 'private_get_fills',
|
|
646
|
+
'timeDifference': 0,
|
|
647
|
+
'adjustForTimeDifference': false,
|
|
646
648
|
'fetchCurrencies': {
|
|
647
649
|
'webApiEnable': true,
|
|
648
650
|
'webApiRetries': 1,
|
|
@@ -1059,7 +1061,7 @@ export default class kucoin extends Exchange {
|
|
|
1059
1061
|
});
|
|
1060
1062
|
}
|
|
1061
1063
|
nonce() {
|
|
1062
|
-
return this.milliseconds();
|
|
1064
|
+
return this.milliseconds() - this.options['timeDifference'];
|
|
1063
1065
|
}
|
|
1064
1066
|
/**
|
|
1065
1067
|
* @method
|
|
@@ -1300,6 +1302,9 @@ export default class kucoin extends Exchange {
|
|
|
1300
1302
|
'info': market,
|
|
1301
1303
|
});
|
|
1302
1304
|
}
|
|
1305
|
+
if (this.options['adjustForTimeDifference']) {
|
|
1306
|
+
await this.loadTimeDifference();
|
|
1307
|
+
}
|
|
1303
1308
|
return result;
|
|
1304
1309
|
}
|
|
1305
1310
|
/**
|
|
@@ -2235,7 +2240,7 @@ export default class kucoin extends Exchange {
|
|
|
2235
2240
|
* market orders --------------------------------------------------
|
|
2236
2241
|
* @param {string} [params.funds] // Amount of quote currency to use
|
|
2237
2242
|
* stop orders ----------------------------------------------------
|
|
2238
|
-
* @param {string} [params.stop] Either loss or entry, the default is loss. Requires
|
|
2243
|
+
* @param {string} [params.stop] Either loss or entry, the default is loss. Requires triggerPrice to be defined
|
|
2239
2244
|
* margin orders --------------------------------------------------
|
|
2240
2245
|
* @param {float} [params.leverage] Leverage size of the order
|
|
2241
2246
|
* @param {string} [params.stp] '', // self trade prevention, CN, CO, CB or DC
|
|
@@ -2576,7 +2581,7 @@ export default class kucoin extends Exchange {
|
|
|
2576
2581
|
* @param {string} id order id
|
|
2577
2582
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
2578
2583
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2579
|
-
* @param {bool} [params.
|
|
2584
|
+
* @param {bool} [params.trigger] True if cancelling a stop order
|
|
2580
2585
|
* @param {bool} [params.hf] false, // true for hf order
|
|
2581
2586
|
* @param {bool} [params.sync] false, // true to use the hf sync call
|
|
2582
2587
|
* @returns Response from the exchange
|
|
@@ -2585,7 +2590,7 @@ export default class kucoin extends Exchange {
|
|
|
2585
2590
|
await this.loadMarkets();
|
|
2586
2591
|
const request = {};
|
|
2587
2592
|
const clientOrderId = this.safeString2(params, 'clientOid', 'clientOrderId');
|
|
2588
|
-
const
|
|
2593
|
+
const trigger = this.safeBool2(params, 'stop', 'trigger', false);
|
|
2589
2594
|
let hf = undefined;
|
|
2590
2595
|
[hf, params] = this.handleHfAndParams(params);
|
|
2591
2596
|
let useSync = false;
|
|
@@ -2601,7 +2606,7 @@ export default class kucoin extends Exchange {
|
|
|
2601
2606
|
params = this.omit(params, ['clientOid', 'clientOrderId', 'stop', 'trigger']);
|
|
2602
2607
|
if (clientOrderId !== undefined) {
|
|
2603
2608
|
request['clientOid'] = clientOrderId;
|
|
2604
|
-
if (
|
|
2609
|
+
if (trigger) {
|
|
2605
2610
|
response = await this.privateDeleteStopOrderCancelOrderByClientOid(this.extend(request, params));
|
|
2606
2611
|
//
|
|
2607
2612
|
// {
|
|
@@ -2645,7 +2650,7 @@ export default class kucoin extends Exchange {
|
|
|
2645
2650
|
}
|
|
2646
2651
|
else {
|
|
2647
2652
|
request['orderId'] = id;
|
|
2648
|
-
if (
|
|
2653
|
+
if (trigger) {
|
|
2649
2654
|
response = await this.privateDeleteStopOrderOrderId(this.extend(request, params));
|
|
2650
2655
|
//
|
|
2651
2656
|
// {
|
|
@@ -2697,7 +2702,7 @@ export default class kucoin extends Exchange {
|
|
|
2697
2702
|
* @see https://docs.kucoin.com/spot-hf/#cancel-all-hf-orders-by-symbol
|
|
2698
2703
|
* @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
|
|
2699
2704
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2700
|
-
* @param {bool} [params.
|
|
2705
|
+
* @param {bool} [params.trigger] *invalid for isolated margin* true if cancelling all stop orders
|
|
2701
2706
|
* @param {string} [params.marginMode] 'cross' or 'isolated'
|
|
2702
2707
|
* @param {string} [params.orderIds] *stop orders only* Comma seperated order IDs
|
|
2703
2708
|
* @param {bool} [params.hf] false, // true for hf order
|
|
@@ -2706,7 +2711,7 @@ export default class kucoin extends Exchange {
|
|
|
2706
2711
|
async cancelAllOrders(symbol = undefined, params = {}) {
|
|
2707
2712
|
await this.loadMarkets();
|
|
2708
2713
|
const request = {};
|
|
2709
|
-
const
|
|
2714
|
+
const trigger = this.safeBool(params, 'stop', false);
|
|
2710
2715
|
let hf = undefined;
|
|
2711
2716
|
[hf, params] = this.handleHfAndParams(params);
|
|
2712
2717
|
params = this.omit(params, 'stop');
|
|
@@ -2716,12 +2721,12 @@ export default class kucoin extends Exchange {
|
|
|
2716
2721
|
}
|
|
2717
2722
|
if (marginMode !== undefined) {
|
|
2718
2723
|
request['tradeType'] = this.options['marginModes'][marginMode];
|
|
2719
|
-
if (marginMode === 'isolated' &&
|
|
2724
|
+
if (marginMode === 'isolated' && trigger) {
|
|
2720
2725
|
throw new BadRequest(this.id + ' cancelAllOrders does not support isolated margin for stop orders');
|
|
2721
2726
|
}
|
|
2722
2727
|
}
|
|
2723
2728
|
let response = undefined;
|
|
2724
|
-
if (
|
|
2729
|
+
if (trigger) {
|
|
2725
2730
|
response = await this.privateDeleteStopOrderCancel(this.extend(request, query));
|
|
2726
2731
|
}
|
|
2727
2732
|
else if (hf) {
|
|
@@ -2754,9 +2759,9 @@ export default class kucoin extends Exchange {
|
|
|
2754
2759
|
* @param {string} [params.side] buy or sell
|
|
2755
2760
|
* @param {string} [params.type] limit, market, limit_stop or market_stop
|
|
2756
2761
|
* @param {string} [params.tradeType] TRADE for spot trading, MARGIN_TRADE for Margin Trading
|
|
2757
|
-
* @param {int} [params.currentPage] *
|
|
2758
|
-
* @param {string} [params.orderIds] *
|
|
2759
|
-
* @param {bool} [params.
|
|
2762
|
+
* @param {int} [params.currentPage] *trigger orders only* current page
|
|
2763
|
+
* @param {string} [params.orderIds] *trigger orders only* comma seperated order ID list
|
|
2764
|
+
* @param {bool} [params.trigger] True if fetching a trigger order
|
|
2760
2765
|
* @param {bool} [params.hf] false, // true for hf order
|
|
2761
2766
|
* @returns An [array of order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2762
2767
|
*/
|
|
@@ -2878,7 +2883,7 @@ export default class kucoin extends Exchange {
|
|
|
2878
2883
|
* @param {string} [params.side] buy or sell
|
|
2879
2884
|
* @param {string} [params.type] limit, market, limit_stop or market_stop
|
|
2880
2885
|
* @param {string} [params.tradeType] TRADE for spot trading, MARGIN_TRADE for Margin Trading
|
|
2881
|
-
* @param {bool} [params.
|
|
2886
|
+
* @param {bool} [params.trigger] True if fetching a trigger order
|
|
2882
2887
|
* @param {bool} [params.hf] false, // true for hf order
|
|
2883
2888
|
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
2884
2889
|
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
@@ -2905,12 +2910,12 @@ export default class kucoin extends Exchange {
|
|
|
2905
2910
|
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
2906
2911
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2907
2912
|
* @param {int} [params.until] end time in ms
|
|
2908
|
-
* @param {bool} [params.
|
|
2913
|
+
* @param {bool} [params.trigger] true if fetching trigger orders
|
|
2909
2914
|
* @param {string} [params.side] buy or sell
|
|
2910
2915
|
* @param {string} [params.type] limit, market, limit_stop or market_stop
|
|
2911
2916
|
* @param {string} [params.tradeType] TRADE for spot trading, MARGIN_TRADE for Margin Trading
|
|
2912
|
-
* @param {int} [params.currentPage] *
|
|
2913
|
-
* @param {string} [params.orderIds] *
|
|
2917
|
+
* @param {int} [params.currentPage] *trigger orders only* current page
|
|
2918
|
+
* @param {string} [params.orderIds] *trigger orders only* comma seperated order ID list
|
|
2914
2919
|
* @param {bool} [params.hf] false, // true for hf order
|
|
2915
2920
|
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
2916
2921
|
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
@@ -2935,9 +2940,9 @@ export default class kucoin extends Exchange {
|
|
|
2935
2940
|
* @see https://docs.kucoin.com/spot-hf/#details-of-a-single-hf-order
|
|
2936
2941
|
* @see https://docs.kucoin.com/spot-hf/#obtain-details-of-a-single-hf-order-using-clientoid
|
|
2937
2942
|
* @param {string} id Order id
|
|
2938
|
-
* @param {string} symbol not sent to exchange except for
|
|
2943
|
+
* @param {string} symbol not sent to exchange except for trigger orders with clientOid, but used internally by CCXT to filter
|
|
2939
2944
|
* @param {object} [params] exchange specific parameters
|
|
2940
|
-
* @param {bool} [params.
|
|
2945
|
+
* @param {bool} [params.trigger] true if fetching a trigger order
|
|
2941
2946
|
* @param {bool} [params.hf] false, // true for hf order
|
|
2942
2947
|
* @param {bool} [params.clientOid] unique order id created by users to identify their orders
|
|
2943
2948
|
* @returns An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
@@ -2946,7 +2951,7 @@ export default class kucoin extends Exchange {
|
|
|
2946
2951
|
await this.loadMarkets();
|
|
2947
2952
|
const request = {};
|
|
2948
2953
|
const clientOrderId = this.safeString2(params, 'clientOid', 'clientOrderId');
|
|
2949
|
-
const
|
|
2954
|
+
const trigger = this.safeBool2(params, 'stop', 'trigger', false);
|
|
2950
2955
|
let hf = undefined;
|
|
2951
2956
|
[hf, params] = this.handleHfAndParams(params);
|
|
2952
2957
|
let market = undefined;
|
|
@@ -2963,7 +2968,7 @@ export default class kucoin extends Exchange {
|
|
|
2963
2968
|
let response = undefined;
|
|
2964
2969
|
if (clientOrderId !== undefined) {
|
|
2965
2970
|
request['clientOid'] = clientOrderId;
|
|
2966
|
-
if (
|
|
2971
|
+
if (trigger) {
|
|
2967
2972
|
if (symbol !== undefined) {
|
|
2968
2973
|
request['symbol'] = market['id'];
|
|
2969
2974
|
}
|
|
@@ -2984,7 +2989,7 @@ export default class kucoin extends Exchange {
|
|
|
2984
2989
|
throw new InvalidOrder(this.id + ' fetchOrder() requires an order id');
|
|
2985
2990
|
}
|
|
2986
2991
|
request['orderId'] = id;
|
|
2987
|
-
if (
|
|
2992
|
+
if (trigger) {
|
|
2988
2993
|
response = await this.privateGetStopOrderOrderId(this.extend(request, params));
|
|
2989
2994
|
}
|
|
2990
2995
|
else if (hf) {
|
|
@@ -3127,7 +3132,7 @@ export default class kucoin extends Exchange {
|
|
|
3127
3132
|
const feeCurrencyId = this.safeString(order, 'feeCurrency');
|
|
3128
3133
|
const cancelExist = this.safeBool(order, 'cancelExist', false);
|
|
3129
3134
|
const responseStop = this.safeString(order, 'stop');
|
|
3130
|
-
const
|
|
3135
|
+
const trigger = responseStop !== undefined;
|
|
3131
3136
|
const stopTriggered = this.safeBool(order, 'stopTriggered', false);
|
|
3132
3137
|
const isActive = this.safeBool2(order, 'isActive', 'active');
|
|
3133
3138
|
const responseStatus = this.safeString(order, 'status');
|
|
@@ -3140,7 +3145,7 @@ export default class kucoin extends Exchange {
|
|
|
3140
3145
|
status = 'closed';
|
|
3141
3146
|
}
|
|
3142
3147
|
}
|
|
3143
|
-
if (
|
|
3148
|
+
if (trigger) {
|
|
3144
3149
|
if (responseStatus === 'NEW') {
|
|
3145
3150
|
status = 'open';
|
|
3146
3151
|
}
|
|
@@ -4367,7 +4372,7 @@ export default class kucoin extends Exchange {
|
|
|
4367
4372
|
* @param {boolean} [params.hf] default false, when true will fetch ledger entries for the high frequency trading account
|
|
4368
4373
|
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
4369
4374
|
* @param {boolean} [params.paginate] 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)
|
|
4370
|
-
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger
|
|
4375
|
+
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
|
|
4371
4376
|
*/
|
|
4372
4377
|
async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
4373
4378
|
await this.loadMarkets();
|
package/js/src/luno.d.ts
CHANGED
|
@@ -202,7 +202,7 @@ export default class luno extends Exchange {
|
|
|
202
202
|
* @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
|
|
203
203
|
* @param {int} [limit] max number of ledger entries to return, default is undefined
|
|
204
204
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
205
|
-
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger
|
|
205
|
+
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
|
|
206
206
|
*/
|
|
207
207
|
fetchLedger(code?: Str, since?: Int, limit?: Int, params?: {}): Promise<LedgerEntry[]>;
|
|
208
208
|
parseLedgerComment(comment: any): {
|
package/js/src/luno.js
CHANGED
|
@@ -999,7 +999,7 @@ export default class luno extends Exchange {
|
|
|
999
999
|
* @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
|
|
1000
1000
|
* @param {int} [limit] max number of ledger entries to return, default is undefined
|
|
1001
1001
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1002
|
-
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger
|
|
1002
|
+
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger}
|
|
1003
1003
|
*/
|
|
1004
1004
|
async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
1005
1005
|
await this.loadMarkets();
|
package/js/src/mexc.d.ts
CHANGED
|
@@ -215,7 +215,6 @@ export default class mexc extends Exchange {
|
|
|
215
215
|
* @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
216
216
|
* @param {string} [marginMode] only 'isolated' is supported for spot-margin trading
|
|
217
217
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
218
|
-
* @param {float} [params.triggerPrice] The price at which a trigger order is triggered at
|
|
219
218
|
* @param {bool} [params.postOnly] if true, the order will only be posted if it will be a maker order
|
|
220
219
|
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
221
220
|
*/
|
|
@@ -223,7 +222,7 @@ export default class mexc extends Exchange {
|
|
|
223
222
|
/**
|
|
224
223
|
* @ignore
|
|
225
224
|
* @method
|
|
226
|
-
* @name mexc#
|
|
225
|
+
* @name mexc#createSwapOrder
|
|
227
226
|
* @description create a trade order
|
|
228
227
|
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#new-order
|
|
229
228
|
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#order-under-maintenance
|