ccxt 4.2.44 → 4.2.46
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/CHANGELOG.md +3099 -8415
- package/README.md +4 -4
- package/change.sh +4 -2
- package/dist/ccxt.browser.js +1242 -195
- package/dist/ccxt.browser.min.js +7 -7
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/base/Exchange.js +48 -0
- package/dist/cjs/src/base/ws/Cache.js +13 -5
- package/dist/cjs/src/base/ws/OrderBook.js +2 -2
- package/dist/cjs/src/binance.js +407 -21
- package/dist/cjs/src/bingx.js +43 -5
- package/dist/cjs/src/bitfinex2.js +1 -0
- package/dist/cjs/src/bithumb.js +5 -0
- package/dist/cjs/src/bitstamp.js +1 -1
- package/dist/cjs/src/btcturk.js +11 -0
- package/dist/cjs/src/bybit.js +96 -43
- package/dist/cjs/src/coinbase.js +228 -38
- package/dist/cjs/src/coincheck.js +11 -0
- package/dist/cjs/src/coinmate.js +114 -1
- package/dist/cjs/src/coinspot.js +7 -0
- package/dist/cjs/src/cryptocom.js +2 -2
- package/dist/cjs/src/deribit.js +1 -1
- package/dist/cjs/src/hitbtc.js +2 -0
- package/dist/cjs/src/idex.js +60 -1
- package/dist/cjs/src/latoken.js +3 -0
- package/dist/cjs/src/mercado.js +3 -0
- package/dist/cjs/src/oceanex.js +3 -0
- package/dist/cjs/src/okx.js +1 -0
- package/dist/cjs/src/pro/bitget.js +12 -8
- package/dist/cjs/src/pro/bitmart.js +11 -11
- package/dist/cjs/src/pro/bitmex.js +4 -4
- package/dist/cjs/src/pro/cex.js +2 -2
- package/dist/cjs/src/pro/gate.js +76 -42
- package/dist/cjs/src/pro/gemini.js +4 -3
- package/dist/cjs/src/pro/hitbtc.js +1 -0
- package/dist/cjs/src/probit.js +3 -3
- package/dist/cjs/src/timex.js +65 -0
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/bequant.d.ts +2 -0
- package/js/src/abstract/bitcoincom.d.ts +2 -0
- package/js/src/abstract/bithumb.d.ts +5 -0
- package/js/src/abstract/coinbase.d.ts +1 -0
- package/js/src/abstract/coinmate.d.ts +12 -0
- package/js/src/abstract/fmfwio.d.ts +2 -0
- package/js/src/abstract/hitbtc.d.ts +2 -0
- package/js/src/abstract/hitbtc3.d.ts +2 -0
- package/js/src/abstract/okx.d.ts +1 -0
- package/js/src/base/Exchange.d.ts +12 -6
- package/js/src/base/Exchange.js +48 -0
- package/js/src/base/ws/Cache.d.ts +5 -1
- package/js/src/base/ws/Cache.js +13 -5
- package/js/src/base/ws/OrderBook.d.ts +5 -1
- package/js/src/base/ws/OrderBook.js +3 -3
- package/js/src/binance.d.ts +2 -1
- package/js/src/binance.js +407 -21
- package/js/src/bingx.d.ts +2 -1
- package/js/src/bingx.js +43 -5
- package/js/src/bitfinex2.js +1 -0
- package/js/src/bithumb.js +5 -0
- package/js/src/bitstamp.js +1 -1
- package/js/src/btcturk.js +11 -0
- package/js/src/bybit.d.ts +4 -1
- package/js/src/bybit.js +96 -43
- package/js/src/coinbase.d.ts +10 -4
- package/js/src/coinbase.js +228 -38
- package/js/src/coincheck.js +11 -0
- package/js/src/coinmate.d.ts +3 -1
- package/js/src/coinmate.js +114 -1
- package/js/src/coinspot.js +7 -0
- package/js/src/cryptocom.js +2 -2
- package/js/src/deribit.js +1 -1
- package/js/src/hitbtc.js +2 -0
- package/js/src/idex.d.ts +14 -0
- package/js/src/idex.js +60 -1
- package/js/src/latoken.js +3 -0
- package/js/src/mercado.js +3 -0
- package/js/src/oceanex.js +3 -0
- package/js/src/okx.js +1 -0
- package/js/src/pro/bitget.js +12 -8
- package/js/src/pro/bitmart.js +11 -11
- package/js/src/pro/bitmex.js +4 -4
- package/js/src/pro/cex.js +2 -2
- package/js/src/pro/gate.d.ts +4 -0
- package/js/src/pro/gate.js +76 -42
- package/js/src/pro/gemini.js +4 -3
- package/js/src/pro/hitbtc.js +1 -0
- package/js/src/probit.js +3 -3
- package/js/src/timex.d.ts +14 -0
- package/js/src/timex.js +65 -0
- package/package.json +1 -1
- package/skip-tests.json +4 -0
package/dist/cjs/src/bithumb.js
CHANGED
|
@@ -88,6 +88,11 @@ class bithumb extends bithumb$1 {
|
|
|
88
88
|
'orderbook/ALL_{quoteId}',
|
|
89
89
|
'orderbook/{baseId}_{quoteId}',
|
|
90
90
|
'transaction_history/{baseId}_{quoteId}',
|
|
91
|
+
'network-info',
|
|
92
|
+
'assetsstatus/multichain/ALL',
|
|
93
|
+
'assetsstatus/multichain/{currency}',
|
|
94
|
+
'withdraw/minimum/ALL',
|
|
95
|
+
'withdraw/minimum/{currency}',
|
|
91
96
|
'assetsstatus/ALL',
|
|
92
97
|
'assetsstatus/{baseId}',
|
|
93
98
|
'candlestick/{baseId}_{quoteId}/{interval}',
|
package/dist/cjs/src/bitstamp.js
CHANGED
|
@@ -818,7 +818,7 @@ class bitstamp extends bitstamp$1 {
|
|
|
818
818
|
for (let i = 0; i < ids.length; i++) {
|
|
819
819
|
const id = ids[i];
|
|
820
820
|
if (id.indexOf('_') < 0) {
|
|
821
|
-
const value = this.
|
|
821
|
+
const value = this.safeInteger(transaction, id);
|
|
822
822
|
if ((value !== undefined) && (value !== 0)) {
|
|
823
823
|
return id;
|
|
824
824
|
}
|
package/dist/cjs/src/btcturk.js
CHANGED
|
@@ -144,6 +144,7 @@ class btcturk extends btcturk$1 {
|
|
|
144
144
|
* @method
|
|
145
145
|
* @name btcturk#fetchMarkets
|
|
146
146
|
* @description retrieves data on all markets for btcturk
|
|
147
|
+
* @see https://docs.btcturk.com/public-endpoints/exchange-info
|
|
147
148
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
148
149
|
* @returns {object[]} an array of objects representing market data
|
|
149
150
|
*/
|
|
@@ -293,6 +294,7 @@ class btcturk extends btcturk$1 {
|
|
|
293
294
|
* @method
|
|
294
295
|
* @name btcturk#fetchBalance
|
|
295
296
|
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
297
|
+
* @see https://docs.btcturk.com/private-endpoints/account-balance
|
|
296
298
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
297
299
|
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
298
300
|
*/
|
|
@@ -321,6 +323,7 @@ class btcturk extends btcturk$1 {
|
|
|
321
323
|
* @method
|
|
322
324
|
* @name btcturk#fetchOrderBook
|
|
323
325
|
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
326
|
+
* @see https://docs.btcturk.com/public-endpoints/orderbook
|
|
324
327
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
325
328
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
326
329
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -401,6 +404,7 @@ class btcturk extends btcturk$1 {
|
|
|
401
404
|
* @method
|
|
402
405
|
* @name btcturk#fetchTickers
|
|
403
406
|
* @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
|
407
|
+
* @see https://docs.btcturk.com/public-endpoints/ticker
|
|
404
408
|
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
405
409
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
406
410
|
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
@@ -415,6 +419,7 @@ class btcturk extends btcturk$1 {
|
|
|
415
419
|
* @method
|
|
416
420
|
* @name btcturk#fetchTicker
|
|
417
421
|
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
422
|
+
* @see https://docs.btcturk.com/public-endpoints/ticker
|
|
418
423
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
419
424
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
420
425
|
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
@@ -490,6 +495,7 @@ class btcturk extends btcturk$1 {
|
|
|
490
495
|
* @method
|
|
491
496
|
* @name btcturk#fetchTrades
|
|
492
497
|
* @description get the list of most recent trades for a particular symbol
|
|
498
|
+
* @see https://docs.btcturk.com/public-endpoints/trades
|
|
493
499
|
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
494
500
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
495
501
|
* @param {int} [limit] the maximum amount of trades to fetch
|
|
@@ -653,6 +659,7 @@ class btcturk extends btcturk$1 {
|
|
|
653
659
|
* @method
|
|
654
660
|
* @name btcturk#createOrder
|
|
655
661
|
* @description create a trade order
|
|
662
|
+
* @see https://docs.btcturk.com/private-endpoints/submit-order
|
|
656
663
|
* @param {string} symbol unified symbol of the market to create an order in
|
|
657
664
|
* @param {string} type 'market' or 'limit'
|
|
658
665
|
* @param {string} side 'buy' or 'sell'
|
|
@@ -687,6 +694,7 @@ class btcturk extends btcturk$1 {
|
|
|
687
694
|
* @method
|
|
688
695
|
* @name btcturk#cancelOrder
|
|
689
696
|
* @description cancels an open order
|
|
697
|
+
* @see https://docs.btcturk.com/private-endpoints/cancel-order
|
|
690
698
|
* @param {string} id order id
|
|
691
699
|
* @param {string} symbol not used by btcturk cancelOrder ()
|
|
692
700
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
@@ -702,6 +710,7 @@ class btcturk extends btcturk$1 {
|
|
|
702
710
|
* @method
|
|
703
711
|
* @name btcturk#fetchOpenOrders
|
|
704
712
|
* @description fetch all unfilled currently open orders
|
|
713
|
+
* @see https://docs.btcturk.com/private-endpoints/open-orders
|
|
705
714
|
* @param {string} symbol unified market symbol
|
|
706
715
|
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
707
716
|
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
@@ -726,6 +735,7 @@ class btcturk extends btcturk$1 {
|
|
|
726
735
|
* @method
|
|
727
736
|
* @name btcturk#fetchOrders
|
|
728
737
|
* @description fetches information on multiple orders made by the user
|
|
738
|
+
* @see https://docs.btcturk.com/private-endpoints/all-orders
|
|
729
739
|
* @param {string} symbol unified market symbol of the market orders were made in
|
|
730
740
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
731
741
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
@@ -848,6 +858,7 @@ class btcturk extends btcturk$1 {
|
|
|
848
858
|
* @method
|
|
849
859
|
* @name btcturk#fetchMyTrades
|
|
850
860
|
* @description fetch all trades made by the user
|
|
861
|
+
* @see https://docs.btcturk.com/private-endpoints/user-transactions
|
|
851
862
|
* @param {string} symbol unified market symbol
|
|
852
863
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
853
864
|
* @param {int} [limit] the maximum number of trades structures to retrieve
|
package/dist/cjs/src/bybit.js
CHANGED
|
@@ -56,7 +56,9 @@ class bybit extends bybit$1 {
|
|
|
56
56
|
'fetchBorrowInterest': false,
|
|
57
57
|
'fetchBorrowRateHistories': false,
|
|
58
58
|
'fetchBorrowRateHistory': false,
|
|
59
|
+
'fetchCanceledAndClosedOrders': true,
|
|
59
60
|
'fetchCanceledOrders': true,
|
|
61
|
+
'fetchClosedOrder': true,
|
|
60
62
|
'fetchClosedOrders': true,
|
|
61
63
|
'fetchCrossBorrowRate': true,
|
|
62
64
|
'fetchCrossBorrowRates': false,
|
|
@@ -84,10 +86,11 @@ class bybit extends bybit$1 {
|
|
|
84
86
|
'fetchOHLCV': true,
|
|
85
87
|
'fetchOpenInterest': true,
|
|
86
88
|
'fetchOpenInterestHistory': true,
|
|
89
|
+
'fetchOpenOrder': true,
|
|
87
90
|
'fetchOpenOrders': true,
|
|
88
|
-
'fetchOrder':
|
|
91
|
+
'fetchOrder': false,
|
|
89
92
|
'fetchOrderBook': true,
|
|
90
|
-
'fetchOrders':
|
|
93
|
+
'fetchOrders': false,
|
|
91
94
|
'fetchOrderTrades': true,
|
|
92
95
|
'fetchPosition': true,
|
|
93
96
|
'fetchPositions': true,
|
|
@@ -3441,35 +3444,6 @@ class bybit extends bybit$1 {
|
|
|
3441
3444
|
'trades': undefined,
|
|
3442
3445
|
}, market);
|
|
3443
3446
|
}
|
|
3444
|
-
async fetchOrder(id, symbol = undefined, params = {}) {
|
|
3445
|
-
/**
|
|
3446
|
-
* @method
|
|
3447
|
-
* @name bybit#fetchOrder
|
|
3448
|
-
* @description fetches information on an order made by the user
|
|
3449
|
-
* @see https://bybit-exchange.github.io/docs/v5/order/order-list
|
|
3450
|
-
* @param {string} symbol unified symbol of the market the order was made in
|
|
3451
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3452
|
-
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
3453
|
-
*/
|
|
3454
|
-
if (symbol === undefined) {
|
|
3455
|
-
throw new errors.ArgumentsRequired(this.id + ' fetchOrder() requires a symbol argument');
|
|
3456
|
-
}
|
|
3457
|
-
await this.loadMarkets();
|
|
3458
|
-
const request = {
|
|
3459
|
-
'orderId': id,
|
|
3460
|
-
};
|
|
3461
|
-
const result = await this.fetchOrders(symbol, undefined, undefined, this.extend(request, params));
|
|
3462
|
-
const length = result.length;
|
|
3463
|
-
if (length === 0) {
|
|
3464
|
-
const isTrigger = this.safeBoolN(params, ['trigger', 'stop'], false);
|
|
3465
|
-
const extra = isTrigger ? '' : 'If you are trying to fetch SL/TP conditional order, you might try setting params["trigger"] = true';
|
|
3466
|
-
throw new errors.OrderNotFound('Order ' + id.toString() + ' was not found.' + extra);
|
|
3467
|
-
}
|
|
3468
|
-
if (length > 1) {
|
|
3469
|
-
throw new errors.InvalidOrder(this.id + ' returned more than one order');
|
|
3470
|
-
}
|
|
3471
|
-
return this.safeValue(result, 0);
|
|
3472
|
-
}
|
|
3473
3447
|
async createMarketBuyOrderWithCost(symbol, cost, params = {}) {
|
|
3474
3448
|
/**
|
|
3475
3449
|
* @method
|
|
@@ -4505,29 +4479,99 @@ class bybit extends bybit$1 {
|
|
|
4505
4479
|
const data = this.safeValue(result, 'dataList', []);
|
|
4506
4480
|
return this.parseOrders(data, market, since, limit);
|
|
4507
4481
|
}
|
|
4482
|
+
async fetchOrder(id, symbol = undefined, params = {}) {
|
|
4483
|
+
throw new errors.NotSupported(this.id + ' fetchOrder() is not supported after the 5/02 update, please use fetchOpenOrder or fetchClosedOrder');
|
|
4484
|
+
}
|
|
4508
4485
|
async fetchOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
4486
|
+
throw new errors.NotSupported(this.id + ' fetchOrders() is not supported after the 5/02 update, please use fetchOpenOrders, fetchClosedOrders or fetchCanceledOrders');
|
|
4487
|
+
}
|
|
4488
|
+
async fetchClosedOrder(id, symbol = undefined, params = {}) {
|
|
4489
|
+
/**
|
|
4490
|
+
* @method
|
|
4491
|
+
* @name bybit#fetchClosedOrder
|
|
4492
|
+
* @description fetches information on a closed order made by the user
|
|
4493
|
+
* @see https://bybit-exchange.github.io/docs/v5/order/order-list
|
|
4494
|
+
* @param {string} id order id
|
|
4495
|
+
* @param {string} [symbol] unified symbol of the market the order was made in
|
|
4496
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4497
|
+
* @param {boolean} [params.stop] set to true for fetching a closed stop order
|
|
4498
|
+
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
4499
|
+
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
4500
|
+
* @param {string} [params.orderFilter] 'Order' or 'StopOrder' or 'tpslOrder'
|
|
4501
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4502
|
+
*/
|
|
4503
|
+
await this.loadMarkets();
|
|
4504
|
+
const request = {
|
|
4505
|
+
'orderId': id,
|
|
4506
|
+
};
|
|
4507
|
+
const result = await this.fetchClosedOrders(symbol, undefined, undefined, this.extend(request, params));
|
|
4508
|
+
const length = result.length;
|
|
4509
|
+
if (length === 0) {
|
|
4510
|
+
const isTrigger = this.safeBoolN(params, ['trigger', 'stop'], false);
|
|
4511
|
+
const extra = isTrigger ? '' : 'If you are trying to fetch SL/TP conditional order, you might try setting params["trigger"] = true';
|
|
4512
|
+
throw new errors.OrderNotFound('Order ' + id.toString() + ' was not found.' + extra);
|
|
4513
|
+
}
|
|
4514
|
+
if (length > 1) {
|
|
4515
|
+
throw new errors.InvalidOrder(this.id + ' returned more than one order');
|
|
4516
|
+
}
|
|
4517
|
+
return this.safeValue(result, 0);
|
|
4518
|
+
}
|
|
4519
|
+
async fetchOpenOrder(id, symbol = undefined, params = {}) {
|
|
4520
|
+
/**
|
|
4521
|
+
* @method
|
|
4522
|
+
* @name bybit#fetchOpenOrder
|
|
4523
|
+
* @description fetches information on an open order made by the user
|
|
4524
|
+
* @see https://bybit-exchange.github.io/docs/v5/order/open-order
|
|
4525
|
+
* @param {string} id order id
|
|
4526
|
+
* @param {string} [symbol] unified symbol of the market the order was made in
|
|
4527
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4528
|
+
* @param {boolean} [params.stop] set to true for fetching an open stop order
|
|
4529
|
+
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
4530
|
+
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
4531
|
+
* @param {string} [params.baseCoin] Base coin. Supports linear, inverse & option
|
|
4532
|
+
* @param {string} [params.settleCoin] Settle coin. Supports linear, inverse & option
|
|
4533
|
+
* @param {string} [params.orderFilter] 'Order' or 'StopOrder' or 'tpslOrder'
|
|
4534
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4535
|
+
*/
|
|
4536
|
+
await this.loadMarkets();
|
|
4537
|
+
const request = {
|
|
4538
|
+
'orderId': id,
|
|
4539
|
+
};
|
|
4540
|
+
const result = await this.fetchOpenOrders(symbol, undefined, undefined, this.extend(request, params));
|
|
4541
|
+
const length = result.length;
|
|
4542
|
+
if (length === 0) {
|
|
4543
|
+
const isTrigger = this.safeBoolN(params, ['trigger', 'stop'], false);
|
|
4544
|
+
const extra = isTrigger ? '' : 'If you are trying to fetch SL/TP conditional order, you might try setting params["trigger"] = true';
|
|
4545
|
+
throw new errors.OrderNotFound('Order ' + id.toString() + ' was not found.' + extra);
|
|
4546
|
+
}
|
|
4547
|
+
if (length > 1) {
|
|
4548
|
+
throw new errors.InvalidOrder(this.id + ' returned more than one order');
|
|
4549
|
+
}
|
|
4550
|
+
return this.safeValue(result, 0);
|
|
4551
|
+
}
|
|
4552
|
+
async fetchCanceledAndClosedOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
4509
4553
|
/**
|
|
4510
4554
|
* @method
|
|
4511
|
-
* @name bybit#
|
|
4512
|
-
* @description fetches information on multiple orders made by the user
|
|
4555
|
+
* @name bybit#fetchCanceledAndClosedOrders
|
|
4556
|
+
* @description fetches information on multiple canceled and closed orders made by the user
|
|
4513
4557
|
* @see https://bybit-exchange.github.io/docs/v5/order/order-list
|
|
4514
|
-
* @param {string} symbol unified market symbol of the market orders were made in
|
|
4558
|
+
* @param {string} [symbol] unified market symbol of the market orders were made in
|
|
4515
4559
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
4516
4560
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
4517
4561
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4518
|
-
* @param {boolean} [params.stop] true
|
|
4562
|
+
* @param {boolean} [params.stop] set to true for fetching stop orders
|
|
4519
4563
|
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
4520
4564
|
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
4521
4565
|
* @param {string} [params.orderFilter] 'Order' or 'StopOrder' or 'tpslOrder'
|
|
4522
4566
|
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
4523
|
-
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [
|
|
4567
|
+
* @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)
|
|
4524
4568
|
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4525
4569
|
*/
|
|
4526
4570
|
await this.loadMarkets();
|
|
4527
4571
|
let paginate = false;
|
|
4528
|
-
[paginate, params] = this.handleOptionAndParams(params, '
|
|
4572
|
+
[paginate, params] = this.handleOptionAndParams(params, 'fetchCanceledAndClosedOrders', 'paginate');
|
|
4529
4573
|
if (paginate) {
|
|
4530
|
-
return await this.fetchPaginatedCallCursor('
|
|
4574
|
+
return await this.fetchPaginatedCallCursor('fetchCanceledAndClosedOrders', symbol, since, limit, params, 'nextPageCursor', 'nextPageCursor', undefined, 50);
|
|
4531
4575
|
}
|
|
4532
4576
|
const [enableUnifiedMargin, enableUnifiedAccount] = await this.isUnifiedEnabled();
|
|
4533
4577
|
const isUnifiedAccount = (enableUnifiedMargin || enableUnifiedAccount);
|
|
@@ -4540,7 +4584,7 @@ class bybit extends bybit$1 {
|
|
|
4540
4584
|
request['symbol'] = market['id'];
|
|
4541
4585
|
}
|
|
4542
4586
|
let type = undefined;
|
|
4543
|
-
[type, params] = this.getBybitType('
|
|
4587
|
+
[type, params] = this.getBybitType('fetchCanceledAndClosedOrders', market, params);
|
|
4544
4588
|
if (((type === 'option') || isUsdcSettled) && !isUnifiedAccount) {
|
|
4545
4589
|
return await this.fetchUsdcOrders(symbol, since, limit, params);
|
|
4546
4590
|
}
|
|
@@ -4622,17 +4666,23 @@ class bybit extends bybit$1 {
|
|
|
4622
4666
|
* @name bybit#fetchClosedOrders
|
|
4623
4667
|
* @description fetches information on multiple closed orders made by the user
|
|
4624
4668
|
* @see https://bybit-exchange.github.io/docs/v5/order/order-list
|
|
4625
|
-
* @param {string} symbol unified market symbol of the market orders were made in
|
|
4669
|
+
* @param {string} [symbol] unified market symbol of the market orders were made in
|
|
4626
4670
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
4627
4671
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
4628
4672
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4673
|
+
* @param {boolean} [params.stop] set to true for fetching closed stop orders
|
|
4674
|
+
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
4675
|
+
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
4676
|
+
* @param {string} [params.orderFilter] 'Order' or 'StopOrder' or 'tpslOrder'
|
|
4677
|
+
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
4678
|
+
* @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)
|
|
4629
4679
|
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4630
4680
|
*/
|
|
4631
4681
|
await this.loadMarkets();
|
|
4632
4682
|
const request = {
|
|
4633
4683
|
'orderStatus': 'Filled',
|
|
4634
4684
|
};
|
|
4635
|
-
return await this.
|
|
4685
|
+
return await this.fetchCanceledAndClosedOrders(symbol, since, limit, this.extend(request, params));
|
|
4636
4686
|
}
|
|
4637
4687
|
async fetchCanceledOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
4638
4688
|
/**
|
|
@@ -4640,20 +4690,23 @@ class bybit extends bybit$1 {
|
|
|
4640
4690
|
* @name bybit#fetchCanceledOrders
|
|
4641
4691
|
* @description fetches information on multiple canceled orders made by the user
|
|
4642
4692
|
* @see https://bybit-exchange.github.io/docs/v5/order/order-list
|
|
4643
|
-
* @param {string} symbol unified market symbol of the market orders were made in
|
|
4693
|
+
* @param {string} [symbol] unified market symbol of the market orders were made in
|
|
4644
4694
|
* @param {int} [since] timestamp in ms of the earliest order, default is undefined
|
|
4645
4695
|
* @param {int} [limit] max number of orders to return, default is undefined
|
|
4646
4696
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4647
4697
|
* @param {boolean} [params.stop] true if stop order
|
|
4648
4698
|
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
4649
4699
|
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
4700
|
+
* @param {string} [params.orderFilter] 'Order' or 'StopOrder' or 'tpslOrder'
|
|
4701
|
+
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
4702
|
+
* @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)
|
|
4650
4703
|
* @returns {object} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4651
4704
|
*/
|
|
4652
4705
|
await this.loadMarkets();
|
|
4653
4706
|
const request = {
|
|
4654
4707
|
'orderStatus': 'Cancelled',
|
|
4655
4708
|
};
|
|
4656
|
-
return await this.
|
|
4709
|
+
return await this.fetchCanceledAndClosedOrders(symbol, since, limit, this.extend(request, params));
|
|
4657
4710
|
}
|
|
4658
4711
|
async fetchUsdcOpenOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
4659
4712
|
await this.loadMarkets();
|