ccxt 4.1.5 → 4.1.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/ccxt.browser.js +1106 -55
- package/dist/ccxt.browser.min.js +12 -12
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/base/Exchange.js +216 -0
- package/dist/cjs/src/binance.js +96 -1
- package/dist/cjs/src/bingx.js +24 -0
- package/dist/cjs/src/bitfinex2.js +55 -11
- package/dist/cjs/src/bitget.js +132 -12
- package/dist/cjs/src/bitmex.js +49 -0
- package/dist/cjs/src/bybit.js +56 -3
- package/dist/cjs/src/coinbase.js +85 -6
- package/dist/cjs/src/coinbasepro.js +18 -0
- package/dist/cjs/src/cryptocom.js +30 -0
- package/dist/cjs/src/gate.js +56 -3
- package/dist/cjs/src/huobi.js +69 -4
- package/dist/cjs/src/kraken.js +17 -3
- package/dist/cjs/src/krakenfutures.js +24 -0
- package/dist/cjs/src/kucoin.js +59 -4
- package/dist/cjs/src/kucoinfutures.js +35 -1
- package/dist/cjs/src/okx.js +66 -4
- package/dist/cjs/src/poloniex.js +18 -2
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/base/Exchange.d.ts +7 -0
- package/js/src/base/Exchange.js +216 -0
- package/js/src/binance.d.ts +5 -5
- package/js/src/binance.js +96 -1
- package/js/src/bingx.d.ts +1 -1
- package/js/src/bingx.js +24 -0
- package/js/src/bitfinex2.d.ts +3 -3
- package/js/src/bitfinex2.js +56 -12
- package/js/src/bitget.d.ts +7 -6
- package/js/src/bitget.js +132 -12
- package/js/src/bitmex.d.ts +6 -6
- package/js/src/bitmex.js +49 -0
- package/js/src/bybit.d.ts +6 -6
- package/js/src/bybit.js +56 -3
- package/js/src/coinbase.d.ts +5 -5
- package/js/src/coinbase.js +86 -7
- package/js/src/coinbasepro.d.ts +5 -5
- package/js/src/coinbasepro.js +18 -0
- package/js/src/cryptocom.d.ts +4 -4
- package/js/src/cryptocom.js +30 -0
- package/js/src/gate.d.ts +4 -4
- package/js/src/gate.js +56 -3
- package/js/src/huobi.d.ts +2 -2
- package/js/src/huobi.js +69 -4
- package/js/src/kraken.d.ts +1 -1
- package/js/src/kraken.js +17 -3
- package/js/src/krakenfutures.d.ts +2 -2
- package/js/src/krakenfutures.js +24 -0
- package/js/src/kucoin.d.ts +5 -5
- package/js/src/kucoin.js +59 -4
- package/js/src/kucoinfutures.d.ts +4 -4
- package/js/src/kucoinfutures.js +35 -1
- package/js/src/okx.d.ts +6 -6
- package/js/src/okx.js +66 -4
- package/js/src/poloniex.d.ts +1 -1
- package/js/src/poloniex.js +18 -2
- package/package.json +1 -1
package/dist/cjs/src/bybit.js
CHANGED
|
@@ -2386,10 +2386,16 @@ class bybit extends bybit$1 {
|
|
|
2386
2386
|
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
2387
2387
|
* @param {int} [limit] the maximum amount of candles to fetch
|
|
2388
2388
|
* @param {object} [params] extra parameters specific to the bybit api endpoint
|
|
2389
|
+
* @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)
|
|
2389
2390
|
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
2390
2391
|
*/
|
|
2391
2392
|
this.checkRequiredSymbol('fetchOHLCV', symbol);
|
|
2392
2393
|
await this.loadMarkets();
|
|
2394
|
+
let paginate = false;
|
|
2395
|
+
[paginate, params] = this.handleOptionAndParams(params, 'fetchOHLCV', 'paginate');
|
|
2396
|
+
if (paginate) {
|
|
2397
|
+
return await this.fetchPaginatedCallDeterministic('fetchOHLCV', symbol, since, limit, timeframe, params, 1000);
|
|
2398
|
+
}
|
|
2393
2399
|
const market = this.market(symbol);
|
|
2394
2400
|
const request = {
|
|
2395
2401
|
'symbol': market['id'],
|
|
@@ -2624,6 +2630,7 @@ class bybit extends bybit$1 {
|
|
|
2624
2630
|
* @param {int} [limit] the maximum amount of [funding rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-history-structure} to fetch
|
|
2625
2631
|
* @param {object} [params] extra parameters specific to the bybit api endpoint
|
|
2626
2632
|
* @param {int} [params.until] timestamp in ms of the latest funding rate
|
|
2633
|
+
* @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)
|
|
2627
2634
|
* @returns {object[]} a list of [funding rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-history-structure}
|
|
2628
2635
|
*/
|
|
2629
2636
|
this.checkRequiredSymbol('fetchFundingRateHistory', symbol);
|
|
@@ -2631,6 +2638,11 @@ class bybit extends bybit$1 {
|
|
|
2631
2638
|
if (limit === undefined) {
|
|
2632
2639
|
limit = 200;
|
|
2633
2640
|
}
|
|
2641
|
+
let paginate = false;
|
|
2642
|
+
[paginate, params] = this.handleOptionAndParams(params, 'fetchFundingRateHistory', 'paginate');
|
|
2643
|
+
if (paginate) {
|
|
2644
|
+
return await this.fetchPaginatedCallDeterministic('fetchFundingRateHistory', symbol, since, limit, '8h', params, 200);
|
|
2645
|
+
}
|
|
2634
2646
|
const request = {
|
|
2635
2647
|
// 'category': '', // Product type. linear,inverse
|
|
2636
2648
|
// 'symbol': '', // Symbol name
|
|
@@ -4450,9 +4462,16 @@ class bybit extends bybit$1 {
|
|
|
4450
4462
|
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
4451
4463
|
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
4452
4464
|
* @param {string} [params.orderFilter] 'Order' or 'StopOrder' or 'tpslOrder'
|
|
4465
|
+
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
4466
|
+
* @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)
|
|
4453
4467
|
* @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
|
|
4454
4468
|
*/
|
|
4455
4469
|
await this.loadMarkets();
|
|
4470
|
+
let paginate = false;
|
|
4471
|
+
[paginate, params] = this.handleOptionAndParams(params, 'fetchOrders', 'paginate');
|
|
4472
|
+
if (paginate) {
|
|
4473
|
+
return await this.fetchPaginatedCallCursor('fetchOrders', symbol, since, limit, params, 'nextPageCursor', 'nextPageCursor', undefined, 50);
|
|
4474
|
+
}
|
|
4456
4475
|
const [enableUnifiedMargin, enableUnifiedAccount] = await this.isUnifiedEnabled();
|
|
4457
4476
|
const isUnifiedAccount = (enableUnifiedMargin || enableUnifiedAccount);
|
|
4458
4477
|
const request = {};
|
|
@@ -4824,9 +4843,15 @@ class bybit extends bybit$1 {
|
|
|
4824
4843
|
* @param {boolean} [params.stop] true if stop order
|
|
4825
4844
|
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
4826
4845
|
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
4846
|
+
* @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)
|
|
4827
4847
|
* @returns {Trade[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure}
|
|
4828
4848
|
*/
|
|
4829
4849
|
await this.loadMarkets();
|
|
4850
|
+
let paginate = false;
|
|
4851
|
+
[paginate, params] = this.handleOptionAndParams(params, 'fetchMyTrades', 'paginate');
|
|
4852
|
+
if (paginate) {
|
|
4853
|
+
return await this.fetchPaginatedCallCursor('fetchMyTrades', symbol, since, limit, params, 'nextPageCursor', 'nextPageCursor', undefined, 100);
|
|
4854
|
+
}
|
|
4830
4855
|
const [enableUnifiedMargin, enableUnifiedAccount] = await this.isUnifiedEnabled();
|
|
4831
4856
|
const isUnifiedAccount = (enableUnifiedMargin || enableUnifiedAccount);
|
|
4832
4857
|
const request = {};
|
|
@@ -5040,11 +5065,17 @@ class bybit extends bybit$1 {
|
|
|
5040
5065
|
* @param {int} [params.until] the latest time in ms to fetch deposits for, default = 30 days after since
|
|
5041
5066
|
*
|
|
5042
5067
|
* EXCHANGE SPECIFIC PARAMETERS
|
|
5068
|
+
* @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)
|
|
5043
5069
|
* @param {string} [params.cursor] used for pagination
|
|
5044
5070
|
* @returns {object[]} a list of [transaction structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#transaction-structure}
|
|
5045
5071
|
*/
|
|
5046
5072
|
await this.loadMarkets();
|
|
5047
|
-
|
|
5073
|
+
let paginate = false;
|
|
5074
|
+
[paginate, params] = this.handleOptionAndParams(params, 'fetchDeposits', 'paginate');
|
|
5075
|
+
if (paginate) {
|
|
5076
|
+
return await this.fetchPaginatedCallCursor('fetchDeposits', code, since, limit, params, 'nextPageCursor', 'nextPageCursor', undefined, 50);
|
|
5077
|
+
}
|
|
5078
|
+
let request = {
|
|
5048
5079
|
// 'coin': currency['id'],
|
|
5049
5080
|
// 'limit': 20, // max 50
|
|
5050
5081
|
// 'cursor': '',
|
|
@@ -5060,6 +5091,7 @@ class bybit extends bybit$1 {
|
|
|
5060
5091
|
if (limit !== undefined) {
|
|
5061
5092
|
request['limit'] = limit;
|
|
5062
5093
|
}
|
|
5094
|
+
[request, params] = this.handleUntilOption('endTime', request, params);
|
|
5063
5095
|
const response = await this.privateGetV5AssetDepositQueryRecord(this.extend(request, params));
|
|
5064
5096
|
//
|
|
5065
5097
|
// {
|
|
@@ -5101,10 +5133,17 @@ class bybit extends bybit$1 {
|
|
|
5101
5133
|
* @param {int} [since] the earliest time in ms to fetch withdrawals for
|
|
5102
5134
|
* @param {int} [limit] the maximum number of withdrawals structures to retrieve
|
|
5103
5135
|
* @param {object} [params] extra parameters specific to the bybit api endpoint
|
|
5136
|
+
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
5137
|
+
* @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)
|
|
5104
5138
|
* @returns {object[]} a list of [transaction structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#transaction-structure}
|
|
5105
5139
|
*/
|
|
5106
5140
|
await this.loadMarkets();
|
|
5107
|
-
|
|
5141
|
+
let paginate = false;
|
|
5142
|
+
[paginate, params] = this.handleOptionAndParams(params, 'fetchWithdrawals', 'paginate');
|
|
5143
|
+
if (paginate) {
|
|
5144
|
+
return await this.fetchPaginatedCallCursor('fetchWithdrawals', code, since, limit, params, 'nextPageCursor', 'nextPageCursor', undefined, 50);
|
|
5145
|
+
}
|
|
5146
|
+
let request = {
|
|
5108
5147
|
// 'coin': currency['id'],
|
|
5109
5148
|
// 'limit': 20, // max 50
|
|
5110
5149
|
// 'cusor': '',
|
|
@@ -5120,6 +5159,7 @@ class bybit extends bybit$1 {
|
|
|
5120
5159
|
if (limit !== undefined) {
|
|
5121
5160
|
request['limit'] = limit;
|
|
5122
5161
|
}
|
|
5162
|
+
[request, params] = this.handleUntilOption('endTime', request, params);
|
|
5123
5163
|
const response = await this.privateGetV5AssetWithdrawQueryRecord(this.extend(request, params));
|
|
5124
5164
|
//
|
|
5125
5165
|
// {
|
|
@@ -6385,6 +6425,11 @@ class bybit extends bybit$1 {
|
|
|
6385
6425
|
throw new errors.BadRequest(this.id + 'fetchOpenInterestHistory cannot use the 1m timeframe');
|
|
6386
6426
|
}
|
|
6387
6427
|
await this.loadMarkets();
|
|
6428
|
+
const paginate = this.safeValue(params, 'paginate');
|
|
6429
|
+
if (paginate) {
|
|
6430
|
+
params = this.omit(params, 'paginate');
|
|
6431
|
+
return await this.fetchPaginatedCallDeterministic('fetchOpenInterestHistory', symbol, since, limit, timeframe, params, 500);
|
|
6432
|
+
}
|
|
6388
6433
|
const market = this.market(symbol);
|
|
6389
6434
|
if (market['spot'] || market['option']) {
|
|
6390
6435
|
throw new errors.BadRequest(this.id + ' fetchOpenInterestHistory() symbol does not support market ' + symbol);
|
|
@@ -6597,11 +6642,18 @@ class bybit extends bybit$1 {
|
|
|
6597
6642
|
* @param {int} [since] the earliest time in ms to fetch transfers for
|
|
6598
6643
|
* @param {int} [limit] the maximum number of transfers structures to retrieve
|
|
6599
6644
|
* @param {object} [params] extra parameters specific to the bybit api endpoint
|
|
6645
|
+
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
6646
|
+
* @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)
|
|
6600
6647
|
* @returns {object[]} a list of [transfer structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#transfer-structure}
|
|
6601
6648
|
*/
|
|
6602
6649
|
await this.loadMarkets();
|
|
6650
|
+
let paginate = false;
|
|
6651
|
+
[paginate, params] = this.handleOptionAndParams(params, 'fetchTransfers', 'paginate');
|
|
6652
|
+
if (paginate) {
|
|
6653
|
+
return await this.fetchPaginatedCallCursor('fetchTransfers', code, since, limit, params, 'nextPageCursor', 'nextPageCursor', undefined, 50);
|
|
6654
|
+
}
|
|
6603
6655
|
let currency = undefined;
|
|
6604
|
-
|
|
6656
|
+
let request = {};
|
|
6605
6657
|
if (code !== undefined) {
|
|
6606
6658
|
currency = this.safeCurrencyCode(code);
|
|
6607
6659
|
request['coin'] = currency;
|
|
@@ -6612,6 +6664,7 @@ class bybit extends bybit$1 {
|
|
|
6612
6664
|
if (limit !== undefined) {
|
|
6613
6665
|
request['limit'] = limit;
|
|
6614
6666
|
}
|
|
6667
|
+
[request, params] = this.handleUntilOption('endTime', request, params);
|
|
6615
6668
|
const response = await this.privateGetV5AssetTransferQueryInterTransferList(this.extend(request, params));
|
|
6616
6669
|
//
|
|
6617
6670
|
// {
|
package/dist/cjs/src/coinbase.js
CHANGED
|
@@ -2400,9 +2400,16 @@ class coinbase extends coinbase$1 {
|
|
|
2400
2400
|
* @param {int} [since] the earliest time in ms to fetch orders
|
|
2401
2401
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
2402
2402
|
* @param {object} [params] extra parameters specific to the coinbase api endpoint
|
|
2403
|
+
* @param {int} [params.until] the latest time in ms to fetch trades for
|
|
2404
|
+
* @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)
|
|
2403
2405
|
* @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
|
|
2404
2406
|
*/
|
|
2405
2407
|
await this.loadMarkets();
|
|
2408
|
+
let paginate = false;
|
|
2409
|
+
[paginate, params] = this.handleOptionAndParams(params, 'fetchOrders', 'paginate');
|
|
2410
|
+
if (paginate) {
|
|
2411
|
+
return await this.fetchPaginatedCallCursor('fetchOrders', symbol, since, limit, params, 'cursor', 'cursor', undefined, 100);
|
|
2412
|
+
}
|
|
2406
2413
|
let market = undefined;
|
|
2407
2414
|
if (symbol !== undefined) {
|
|
2408
2415
|
market = this.market(symbol);
|
|
@@ -2417,6 +2424,11 @@ class coinbase extends coinbase$1 {
|
|
|
2417
2424
|
if (since !== undefined) {
|
|
2418
2425
|
request['start_date'] = this.iso8601(since);
|
|
2419
2426
|
}
|
|
2427
|
+
const until = this.safeValueN(params, ['until', 'till']);
|
|
2428
|
+
if (until !== undefined) {
|
|
2429
|
+
params = this.omit(params, ['until', 'till']);
|
|
2430
|
+
request['end_date'] = this.iso8601(until);
|
|
2431
|
+
}
|
|
2420
2432
|
const response = await this.v3PrivateGetBrokerageOrdersHistoricalBatch(this.extend(request, params));
|
|
2421
2433
|
//
|
|
2422
2434
|
// {
|
|
@@ -2461,6 +2473,12 @@ class coinbase extends coinbase$1 {
|
|
|
2461
2473
|
// }
|
|
2462
2474
|
//
|
|
2463
2475
|
const orders = this.safeValue(response, 'orders', []);
|
|
2476
|
+
const first = this.safeValue(orders, 0);
|
|
2477
|
+
const cursor = this.safeString(response, 'cursor');
|
|
2478
|
+
if ((cursor !== undefined) && (cursor !== '')) {
|
|
2479
|
+
first['cursor'] = cursor;
|
|
2480
|
+
orders[0] = first;
|
|
2481
|
+
}
|
|
2464
2482
|
return this.parseOrders(orders, market, since, limit);
|
|
2465
2483
|
}
|
|
2466
2484
|
async fetchOrdersByStatus(status, symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
@@ -2482,6 +2500,11 @@ class coinbase extends coinbase$1 {
|
|
|
2482
2500
|
if (since !== undefined) {
|
|
2483
2501
|
request['start_date'] = this.iso8601(since);
|
|
2484
2502
|
}
|
|
2503
|
+
const until = this.safeValueN(params, ['until', 'till']);
|
|
2504
|
+
if (until !== undefined) {
|
|
2505
|
+
params = this.omit(params, ['until', 'till']);
|
|
2506
|
+
request['end_date'] = this.iso8601(until);
|
|
2507
|
+
}
|
|
2485
2508
|
const response = await this.v3PrivateGetBrokerageOrdersHistoricalBatch(this.extend(request, params));
|
|
2486
2509
|
//
|
|
2487
2510
|
// {
|
|
@@ -2526,6 +2549,12 @@ class coinbase extends coinbase$1 {
|
|
|
2526
2549
|
// }
|
|
2527
2550
|
//
|
|
2528
2551
|
const orders = this.safeValue(response, 'orders', []);
|
|
2552
|
+
const first = this.safeValue(orders, 0);
|
|
2553
|
+
const cursor = this.safeString(response, 'cursor');
|
|
2554
|
+
if ((cursor !== undefined) && (cursor !== '')) {
|
|
2555
|
+
first['cursor'] = cursor;
|
|
2556
|
+
orders[0] = first;
|
|
2557
|
+
}
|
|
2529
2558
|
return this.parseOrders(orders, market, since, limit);
|
|
2530
2559
|
}
|
|
2531
2560
|
async fetchOpenOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
@@ -2538,8 +2567,16 @@ class coinbase extends coinbase$1 {
|
|
|
2538
2567
|
* @param {int} [since] timestamp in ms of the earliest order, default is undefined
|
|
2539
2568
|
* @param {int} [limit] the maximum number of open order structures to retrieve
|
|
2540
2569
|
* @param {object} [params] extra parameters specific to the coinbase api endpoint
|
|
2570
|
+
* @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)
|
|
2571
|
+
* @param {int} [params.until] the latest time in ms to fetch trades for
|
|
2541
2572
|
* @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
|
|
2542
2573
|
*/
|
|
2574
|
+
await this.loadMarkets();
|
|
2575
|
+
let paginate = false;
|
|
2576
|
+
[paginate, params] = this.handleOptionAndParams(params, 'fetchOpenOrders', 'paginate');
|
|
2577
|
+
if (paginate) {
|
|
2578
|
+
return await this.fetchPaginatedCallCursor('fetchOpenOrders', symbol, since, limit, params, 'cursor', 'cursor', undefined, 100);
|
|
2579
|
+
}
|
|
2543
2580
|
return await this.fetchOrdersByStatus('OPEN', symbol, since, limit, params);
|
|
2544
2581
|
}
|
|
2545
2582
|
async fetchClosedOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
@@ -2552,8 +2589,16 @@ class coinbase extends coinbase$1 {
|
|
|
2552
2589
|
* @param {int} [since] timestamp in ms of the earliest order, default is undefined
|
|
2553
2590
|
* @param {int} [limit] the maximum number of closed order structures to retrieve
|
|
2554
2591
|
* @param {object} [params] extra parameters specific to the coinbase api endpoint
|
|
2592
|
+
* @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)
|
|
2593
|
+
* @param {int} [params.until] the latest time in ms to fetch trades for
|
|
2555
2594
|
* @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
|
|
2556
2595
|
*/
|
|
2596
|
+
await this.loadMarkets();
|
|
2597
|
+
let paginate = false;
|
|
2598
|
+
[paginate, params] = this.handleOptionAndParams(params, 'fetchClosedOrders', 'paginate');
|
|
2599
|
+
if (paginate) {
|
|
2600
|
+
return await this.fetchPaginatedCallCursor('fetchClosedOrders', symbol, since, limit, params, 'cursor', 'cursor', undefined, 100);
|
|
2601
|
+
}
|
|
2557
2602
|
return await this.fetchOrdersByStatus('FILLED', symbol, since, limit, params);
|
|
2558
2603
|
}
|
|
2559
2604
|
async fetchCanceledOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
@@ -2581,24 +2626,40 @@ class coinbase extends coinbase$1 {
|
|
|
2581
2626
|
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
2582
2627
|
* @param {int} [limit] the maximum amount of candles to fetch, not used by coinbase
|
|
2583
2628
|
* @param {object} [params] extra parameters specific to the coinbase api endpoint
|
|
2629
|
+
* @param {int} [params.until] the latest time in ms to fetch trades for
|
|
2630
|
+
* @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)
|
|
2584
2631
|
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
2585
2632
|
*/
|
|
2586
2633
|
await this.loadMarkets();
|
|
2634
|
+
let paginate = false;
|
|
2635
|
+
[paginate, params] = this.handleOptionAndParams(params, 'fetchOHLCV', 'paginate', false);
|
|
2636
|
+
if (paginate) {
|
|
2637
|
+
return await this.fetchPaginatedCallDeterministic('fetchOHLCV', symbol, since, limit, timeframe, params, 299);
|
|
2638
|
+
}
|
|
2587
2639
|
const market = this.market(symbol);
|
|
2588
|
-
const end = this.seconds().toString();
|
|
2589
2640
|
const request = {
|
|
2590
2641
|
'product_id': market['id'],
|
|
2591
2642
|
'granularity': this.safeString(this.timeframes, timeframe, timeframe),
|
|
2592
|
-
'end': end,
|
|
2593
2643
|
};
|
|
2644
|
+
const until = this.safeValueN(params, ['until', 'till', 'end']);
|
|
2645
|
+
params = this.omit(params, ['until', 'till']);
|
|
2646
|
+
const duration = this.parseTimeframe(timeframe);
|
|
2647
|
+
const candles300 = 300 * duration;
|
|
2648
|
+
let sinceString = undefined;
|
|
2594
2649
|
if (since !== undefined) {
|
|
2595
|
-
|
|
2596
|
-
const timeframeToSeconds = Precise["default"].stringDiv(sinceString, '1000');
|
|
2597
|
-
request['start'] = this.decimalToPrecision(timeframeToSeconds, number.TRUNCATE, 0, number.DECIMAL_PLACES);
|
|
2650
|
+
sinceString = this.numberToString(this.parseToInt(since / 1000));
|
|
2598
2651
|
}
|
|
2599
2652
|
else {
|
|
2600
|
-
|
|
2653
|
+
const now = this.seconds().toString();
|
|
2654
|
+
sinceString = Precise["default"].stringSub(now, candles300.toString());
|
|
2655
|
+
}
|
|
2656
|
+
request['start'] = sinceString;
|
|
2657
|
+
let endString = this.numberToString(until);
|
|
2658
|
+
if (until === undefined) {
|
|
2659
|
+
// 300 candles max
|
|
2660
|
+
endString = Precise["default"].stringAdd(sinceString, candles300.toString());
|
|
2601
2661
|
}
|
|
2662
|
+
request['end'] = endString;
|
|
2602
2663
|
const response = await this.v3PrivateGetBrokerageProductsProductIdCandles(this.extend(request, params));
|
|
2603
2664
|
//
|
|
2604
2665
|
// {
|
|
@@ -2689,9 +2750,16 @@ class coinbase extends coinbase$1 {
|
|
|
2689
2750
|
* @param {int} [since] timestamp in ms of the earliest order, default is undefined
|
|
2690
2751
|
* @param {int} [limit] the maximum number of trade structures to fetch
|
|
2691
2752
|
* @param {object} [params] extra parameters specific to the coinbase api endpoint
|
|
2753
|
+
* @param {int} [params.until] the latest time in ms to fetch trades for
|
|
2754
|
+
* @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)
|
|
2692
2755
|
* @returns {Trade[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure}
|
|
2693
2756
|
*/
|
|
2694
2757
|
await this.loadMarkets();
|
|
2758
|
+
let paginate = false;
|
|
2759
|
+
[paginate, params] = this.handleOptionAndParams(params, 'fetchMyTrades', 'paginate');
|
|
2760
|
+
if (paginate) {
|
|
2761
|
+
return await this.fetchPaginatedCallCursor('fetchMyTrades', symbol, since, limit, params, 'cursor', 'cursor', undefined, 100);
|
|
2762
|
+
}
|
|
2695
2763
|
let market = undefined;
|
|
2696
2764
|
if (symbol !== undefined) {
|
|
2697
2765
|
market = this.market(symbol);
|
|
@@ -2706,6 +2774,11 @@ class coinbase extends coinbase$1 {
|
|
|
2706
2774
|
if (since !== undefined) {
|
|
2707
2775
|
request['start_sequence_timestamp'] = this.iso8601(since);
|
|
2708
2776
|
}
|
|
2777
|
+
const until = this.safeValueN(params, ['until', 'till']);
|
|
2778
|
+
if (until !== undefined) {
|
|
2779
|
+
params = this.omit(params, ['until', 'till']);
|
|
2780
|
+
request['end_sequence_timestamp'] = this.iso8601(until);
|
|
2781
|
+
}
|
|
2709
2782
|
const response = await this.v3PrivateGetBrokerageOrdersHistoricalFills(this.extend(request, params));
|
|
2710
2783
|
//
|
|
2711
2784
|
// {
|
|
@@ -2731,6 +2804,12 @@ class coinbase extends coinbase$1 {
|
|
|
2731
2804
|
// }
|
|
2732
2805
|
//
|
|
2733
2806
|
const trades = this.safeValue(response, 'fills', []);
|
|
2807
|
+
const first = this.safeValue(trades, 0);
|
|
2808
|
+
const cursor = this.safeString(response, 'cursor');
|
|
2809
|
+
if ((cursor !== undefined) && (cursor !== '')) {
|
|
2810
|
+
first['cursor'] = cursor;
|
|
2811
|
+
trades[0] = first;
|
|
2812
|
+
}
|
|
2734
2813
|
return this.parseTrades(trades, market, since, limit);
|
|
2735
2814
|
}
|
|
2736
2815
|
async fetchOrderBook(symbol, limit = undefined, params = {}) {
|
|
@@ -783,9 +783,15 @@ class coinbasepro extends coinbasepro$1 {
|
|
|
783
783
|
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
784
784
|
* @param {object} [params] extra parameters specific to the coinbasepro api endpoint
|
|
785
785
|
* @param {int} [params.until] the latest time in ms to fetch trades for
|
|
786
|
+
* @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)
|
|
786
787
|
* @returns {Trade[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure}
|
|
787
788
|
*/
|
|
788
789
|
this.checkRequiredSymbol('fetchMyTrades', symbol);
|
|
790
|
+
let paginate = false;
|
|
791
|
+
[paginate, params] = this.handleOptionAndParams(params, 'fetchMyTrades', 'paginate');
|
|
792
|
+
if (paginate) {
|
|
793
|
+
return await this.fetchPaginatedCallDynamic('fetchMyTrades', symbol, since, limit, params, 100);
|
|
794
|
+
}
|
|
789
795
|
await this.loadMarkets();
|
|
790
796
|
const market = this.market(symbol);
|
|
791
797
|
const request = {
|
|
@@ -904,9 +910,15 @@ class coinbasepro extends coinbasepro$1 {
|
|
|
904
910
|
* @param {int} [limit] the maximum amount of candles to fetch
|
|
905
911
|
* @param {object} [params] extra parameters specific to the coinbasepro api endpoint
|
|
906
912
|
* @param {int} [params.until] the latest time in ms to fetch trades for
|
|
913
|
+
* @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)
|
|
907
914
|
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
908
915
|
*/
|
|
909
916
|
await this.loadMarkets();
|
|
917
|
+
let paginate = false;
|
|
918
|
+
[paginate, params] = this.handleOptionAndParams(params, 'fetchOHLCV', 'paginate', false);
|
|
919
|
+
if (paginate) {
|
|
920
|
+
return await this.fetchPaginatedCallDeterministic('fetchOHLCV', symbol, since, limit, timeframe, params, 300);
|
|
921
|
+
}
|
|
910
922
|
const market = this.market(symbol);
|
|
911
923
|
const parsedTimeframe = this.safeInteger(this.timeframes, timeframe);
|
|
912
924
|
const request = {
|
|
@@ -1133,9 +1145,15 @@ class coinbasepro extends coinbasepro$1 {
|
|
|
1133
1145
|
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
1134
1146
|
* @param {object} [params] extra parameters specific to the coinbasepro api endpoint
|
|
1135
1147
|
* @param {int} [params.until] the latest time in ms to fetch open orders for
|
|
1148
|
+
* @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)
|
|
1136
1149
|
* @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
|
|
1137
1150
|
*/
|
|
1138
1151
|
await this.loadMarkets();
|
|
1152
|
+
let paginate = false;
|
|
1153
|
+
[paginate, params] = this.handleOptionAndParams(params, 'fetchOpenOrders', 'paginate');
|
|
1154
|
+
if (paginate) {
|
|
1155
|
+
return await this.fetchPaginatedCallDynamic('fetchOpenOrders', symbol, since, limit, params, 100);
|
|
1156
|
+
}
|
|
1139
1157
|
const request = {};
|
|
1140
1158
|
let market = undefined;
|
|
1141
1159
|
if (symbol !== undefined) {
|
|
@@ -652,9 +652,15 @@ class cryptocom extends cryptocom$1 {
|
|
|
652
652
|
* @param {int} [limit] the maximum number of order structures to retrieve, default 100 max 100
|
|
653
653
|
* @param {object} [params] extra parameters specific to the cryptocom api endpoint
|
|
654
654
|
* @param {int} [params.until] timestamp in ms for the ending date filter, default is the current time
|
|
655
|
+
* @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)
|
|
655
656
|
* @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
|
|
656
657
|
*/
|
|
657
658
|
await this.loadMarkets();
|
|
659
|
+
let paginate = false;
|
|
660
|
+
[paginate, params] = this.handleOptionAndParams(params, 'fetchOrders', 'paginate');
|
|
661
|
+
if (paginate) {
|
|
662
|
+
return await this.fetchPaginatedCallDynamic('fetchOrders', symbol, since, limit, params);
|
|
663
|
+
}
|
|
658
664
|
let market = undefined;
|
|
659
665
|
const request = {};
|
|
660
666
|
if (symbol !== undefined) {
|
|
@@ -727,9 +733,15 @@ class cryptocom extends cryptocom$1 {
|
|
|
727
733
|
* @param {int} [limit] the maximum number of trades to fetch
|
|
728
734
|
* @param {object} [params] extra parameters specific to the cryptocom api endpoint
|
|
729
735
|
* @param {int} [params.until] timestamp in ms for the ending date filter, default is the current time
|
|
736
|
+
* @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)
|
|
730
737
|
* @returns {Trade[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#public-trades}
|
|
731
738
|
*/
|
|
732
739
|
await this.loadMarkets();
|
|
740
|
+
let paginate = false;
|
|
741
|
+
[paginate, params] = this.handleOptionAndParams(params, 'fetchTrades', 'paginate');
|
|
742
|
+
if (paginate) {
|
|
743
|
+
return await this.fetchPaginatedCallDynamic('fetchTrades', symbol, since, limit, params);
|
|
744
|
+
}
|
|
733
745
|
const market = this.market(symbol);
|
|
734
746
|
const request = {
|
|
735
747
|
'instrument_name': market['id'],
|
|
@@ -781,9 +793,15 @@ class cryptocom extends cryptocom$1 {
|
|
|
781
793
|
* @param {int} [limit] the maximum amount of candles to fetch
|
|
782
794
|
* @param {object} [params] extra parameters specific to the cryptocom api endpoint
|
|
783
795
|
* @param {int} [params.until] timestamp in ms for the ending date filter, default is the current time
|
|
796
|
+
* @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)
|
|
784
797
|
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
785
798
|
*/
|
|
786
799
|
await this.loadMarkets();
|
|
800
|
+
let paginate = false;
|
|
801
|
+
[paginate, params] = this.handleOptionAndParams(params, 'fetchOHLCV', 'paginate', false);
|
|
802
|
+
if (paginate) {
|
|
803
|
+
return await this.fetchPaginatedCallDeterministic('fetchOHLCV', symbol, since, limit, timeframe, params, 300);
|
|
804
|
+
}
|
|
787
805
|
const market = this.market(symbol);
|
|
788
806
|
const request = {
|
|
789
807
|
'instrument_name': market['id'],
|
|
@@ -1273,9 +1291,15 @@ class cryptocom extends cryptocom$1 {
|
|
|
1273
1291
|
* @param {int} [limit] the maximum number of trade structures to retrieve
|
|
1274
1292
|
* @param {object} [params] extra parameters specific to the cryptocom api endpoint
|
|
1275
1293
|
* @param {int} [params.until] timestamp in ms for the ending date filter, default is the current time
|
|
1294
|
+
* @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)
|
|
1276
1295
|
* @returns {Trade[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure}
|
|
1277
1296
|
*/
|
|
1278
1297
|
await this.loadMarkets();
|
|
1298
|
+
let paginate = false;
|
|
1299
|
+
[paginate, params] = this.handleOptionAndParams(params, 'fetchMyTrades', 'paginate');
|
|
1300
|
+
if (paginate) {
|
|
1301
|
+
return await this.fetchPaginatedCallDynamic('fetchMyTrades', symbol, since, limit, params);
|
|
1302
|
+
}
|
|
1279
1303
|
const request = {};
|
|
1280
1304
|
let market = undefined;
|
|
1281
1305
|
if (symbol !== undefined) {
|
|
@@ -2762,10 +2786,16 @@ class cryptocom extends cryptocom$1 {
|
|
|
2762
2786
|
* @param {int} [limit] the maximum amount of [funding rate structures] to fetch
|
|
2763
2787
|
* @param {object} [params] extra parameters specific to the cryptocom api endpoint
|
|
2764
2788
|
* @param {int} [params.until] timestamp in ms for the ending date filter, default is the current time
|
|
2789
|
+
* @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)
|
|
2765
2790
|
* @returns {object[]} a list of [funding rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-history-structure}
|
|
2766
2791
|
*/
|
|
2767
2792
|
this.checkRequiredSymbol('fetchFundingRateHistory', symbol);
|
|
2768
2793
|
await this.loadMarkets();
|
|
2794
|
+
let paginate = false;
|
|
2795
|
+
[paginate, params] = this.handleOptionAndParams(params, 'fetchFundingRateHistory', 'paginate');
|
|
2796
|
+
if (paginate) {
|
|
2797
|
+
return await this.fetchPaginatedCallDeterministic('fetchFundingRateHistory', symbol, since, limit, '8h', params);
|
|
2798
|
+
}
|
|
2769
2799
|
const market = this.market(symbol);
|
|
2770
2800
|
if (!market['swap']) {
|
|
2771
2801
|
throw new errors.BadSymbol(this.id + ' fetchFundingRateHistory() supports swap contracts only');
|
package/dist/cjs/src/gate.js
CHANGED
|
@@ -2824,10 +2824,16 @@ class gate extends gate$1 {
|
|
|
2824
2824
|
* @param {object} [params] extra parameters specific to the gateio api endpoint
|
|
2825
2825
|
* @param {string} [params.price] "mark" or "index" for mark price and index price candles
|
|
2826
2826
|
* @param {int} [params.until] timestamp in ms of the latest candle to fetch
|
|
2827
|
+
* @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)
|
|
2827
2828
|
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume (units in quote currency)
|
|
2828
2829
|
*/
|
|
2829
2830
|
await this.loadMarkets();
|
|
2830
2831
|
const market = this.market(symbol);
|
|
2832
|
+
let paginate = false;
|
|
2833
|
+
[paginate, params] = this.handleOptionAndParams(params, 'fetchOHLCV', 'paginate');
|
|
2834
|
+
if (paginate) {
|
|
2835
|
+
return await this.fetchPaginatedCallDeterministic('fetchOHLCV', symbol, since, limit, timeframe, params, 1000);
|
|
2836
|
+
}
|
|
2831
2837
|
if (market['option']) {
|
|
2832
2838
|
return await this.fetchOptionOHLCV(symbol, timeframe, since, limit, params);
|
|
2833
2839
|
}
|
|
@@ -2993,9 +2999,16 @@ class gate extends gate$1 {
|
|
|
2993
2999
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
2994
3000
|
* @param {int} [limit] the maximum amount of trades to fetch
|
|
2995
3001
|
* @param {object} [params] extra parameters specific to the gate api endpoint
|
|
3002
|
+
* @param {int} [params.until] timestamp in ms of the latest trade to fetch
|
|
3003
|
+
* @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)
|
|
2996
3004
|
* @returns {Trade[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#public-trades}
|
|
2997
3005
|
*/
|
|
2998
3006
|
await this.loadMarkets();
|
|
3007
|
+
let paginate = false;
|
|
3008
|
+
[paginate, params] = this.handleOptionAndParams(params, 'fetchTrades', 'paginate');
|
|
3009
|
+
if (paginate) {
|
|
3010
|
+
return await this.fetchPaginatedCallDynamic('fetchTrades', symbol, since, limit, params);
|
|
3011
|
+
}
|
|
2999
3012
|
const market = this.market(symbol);
|
|
3000
3013
|
//
|
|
3001
3014
|
// spot
|
|
@@ -3026,6 +3039,11 @@ class gate extends gate$1 {
|
|
|
3026
3039
|
'future': 'publicDeliveryGetSettleTrades',
|
|
3027
3040
|
'option': 'publicOptionsGetTrades',
|
|
3028
3041
|
});
|
|
3042
|
+
const until = this.safeInteger2(params, 'to', 'until');
|
|
3043
|
+
if (until !== undefined) {
|
|
3044
|
+
params = this.omit(params, ['until']);
|
|
3045
|
+
request['to'] = this.parseToInt(until / 1000);
|
|
3046
|
+
}
|
|
3029
3047
|
if (limit !== undefined) {
|
|
3030
3048
|
request['limit'] = limit; // default 100, max 1000
|
|
3031
3049
|
}
|
|
@@ -3133,9 +3151,15 @@ class gate extends gate$1 {
|
|
|
3133
3151
|
* @param {int} [params.offset] *contract only* list offset, starting from 0
|
|
3134
3152
|
* @param {string} [params.last_id] *contract only* specify list staring point using the id of last record in previous list-query results
|
|
3135
3153
|
* @param {int} [params.count_total] *contract only* whether to return total number matched, default to 0(no return)
|
|
3154
|
+
* @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)
|
|
3136
3155
|
* @returns {Trade[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure}
|
|
3137
3156
|
*/
|
|
3138
3157
|
await this.loadMarkets();
|
|
3158
|
+
let paginate = false;
|
|
3159
|
+
[paginate, params] = this.handleOptionAndParams(params, 'fetchMyTrades', 'paginate');
|
|
3160
|
+
if (paginate) {
|
|
3161
|
+
return await this.fetchPaginatedCallDynamic('fetchMyTrades', symbol, since, limit, params);
|
|
3162
|
+
}
|
|
3139
3163
|
let type = undefined;
|
|
3140
3164
|
let marginMode = undefined;
|
|
3141
3165
|
let request = {};
|
|
@@ -3394,11 +3418,18 @@ class gate extends gate$1 {
|
|
|
3394
3418
|
* @param {string} code unified currency code
|
|
3395
3419
|
* @param {int} [since] the earliest time in ms to fetch deposits for
|
|
3396
3420
|
* @param {int} [limit] the maximum number of deposits structures to retrieve
|
|
3421
|
+
* @param {int} [params.until] end time in ms
|
|
3397
3422
|
* @param {object} [params] extra parameters specific to the gate api endpoint
|
|
3423
|
+
* @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)
|
|
3398
3424
|
* @returns {object[]} a list of [transaction structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#transaction-structure}
|
|
3399
3425
|
*/
|
|
3400
3426
|
await this.loadMarkets();
|
|
3401
|
-
|
|
3427
|
+
let paginate = false;
|
|
3428
|
+
[paginate, params] = this.handleOptionAndParams(params, 'fetchDeposits', 'paginate');
|
|
3429
|
+
if (paginate) {
|
|
3430
|
+
return await this.fetchPaginatedCallDynamic('fetchDeposits', code, since, limit, params);
|
|
3431
|
+
}
|
|
3432
|
+
let request = {};
|
|
3402
3433
|
let currency = undefined;
|
|
3403
3434
|
if (code !== undefined) {
|
|
3404
3435
|
currency = this.currency(code);
|
|
@@ -3412,6 +3443,7 @@ class gate extends gate$1 {
|
|
|
3412
3443
|
request['from'] = start;
|
|
3413
3444
|
request['to'] = this.sum(start, 30 * 24 * 60 * 60);
|
|
3414
3445
|
}
|
|
3446
|
+
[request, params] = this.handleUntilOption('to', request, params);
|
|
3415
3447
|
const response = await this.privateWalletGetDeposits(this.extend(request, params));
|
|
3416
3448
|
return this.parseTransactions(response, currency);
|
|
3417
3449
|
}
|
|
@@ -3424,10 +3456,17 @@ class gate extends gate$1 {
|
|
|
3424
3456
|
* @param {int} [since] the earliest time in ms to fetch withdrawals for
|
|
3425
3457
|
* @param {int} [limit] the maximum number of withdrawals structures to retrieve
|
|
3426
3458
|
* @param {object} [params] extra parameters specific to the gate api endpoint
|
|
3459
|
+
* @param {int} [params.until] end time in ms
|
|
3460
|
+
* @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)
|
|
3427
3461
|
* @returns {object[]} a list of [transaction structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#transaction-structure}
|
|
3428
3462
|
*/
|
|
3429
3463
|
await this.loadMarkets();
|
|
3430
|
-
|
|
3464
|
+
let paginate = false;
|
|
3465
|
+
[paginate, params] = this.handleOptionAndParams(params, 'fetchWithdrawals', 'paginate');
|
|
3466
|
+
if (paginate) {
|
|
3467
|
+
return await this.fetchPaginatedCallDynamic('fetchWithdrawals', code, since, limit, params);
|
|
3468
|
+
}
|
|
3469
|
+
let request = {};
|
|
3431
3470
|
let currency = undefined;
|
|
3432
3471
|
if (code !== undefined) {
|
|
3433
3472
|
currency = this.currency(code);
|
|
@@ -3441,6 +3480,7 @@ class gate extends gate$1 {
|
|
|
3441
3480
|
request['from'] = start;
|
|
3442
3481
|
request['to'] = this.sum(start, 30 * 24 * 60 * 60);
|
|
3443
3482
|
}
|
|
3483
|
+
[request, params] = this.handleUntilOption('to', request, params);
|
|
3444
3484
|
const response = await this.privateWalletGetWithdrawals(this.extend(request, params));
|
|
3445
3485
|
return this.parseTransactions(response, currency);
|
|
3446
3486
|
}
|
|
@@ -5729,6 +5769,11 @@ class gate extends gate$1 {
|
|
|
5729
5769
|
* @returns {object} an open interest structure{@link https://github.com/ccxt/ccxt/wiki/Manual#interest-history-structure}
|
|
5730
5770
|
*/
|
|
5731
5771
|
await this.loadMarkets();
|
|
5772
|
+
let paginate = false;
|
|
5773
|
+
[paginate, params] = this.handleOptionAndParams(params, 'fetchOpenInterestHistory', 'paginate', false);
|
|
5774
|
+
if (paginate) {
|
|
5775
|
+
return await this.fetchPaginatedCallDeterministic('fetchOpenInterestHistory', symbol, since, limit, timeframe, params, 100);
|
|
5776
|
+
}
|
|
5732
5777
|
const market = this.market(symbol);
|
|
5733
5778
|
if (!market['swap']) {
|
|
5734
5779
|
throw new errors.BadRequest(this.id + ' fetchOpenInterest() supports swap markets only');
|
|
@@ -5987,13 +6032,20 @@ class gate extends gate$1 {
|
|
|
5987
6032
|
* @param {int} [since] timestamp in ms of the earliest ledger entry
|
|
5988
6033
|
* @param {int} [limit] max number of ledger entries to return
|
|
5989
6034
|
* @param {object} [params] extra parameters specific to the gate api endpoint
|
|
6035
|
+
* @param {int} [params.until] end time in ms
|
|
6036
|
+
* @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)
|
|
5990
6037
|
* @returns {object} a [ledger structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#ledger-structure}
|
|
5991
6038
|
*/
|
|
5992
6039
|
await this.loadMarkets();
|
|
6040
|
+
let paginate = false;
|
|
6041
|
+
[paginate, params] = this.handleOptionAndParams(params, 'fetchLedger', 'paginate');
|
|
6042
|
+
if (paginate) {
|
|
6043
|
+
return await this.fetchPaginatedCallDynamic('fetchLedger', code, since, limit, params);
|
|
6044
|
+
}
|
|
5993
6045
|
let type = undefined;
|
|
5994
6046
|
let currency = undefined;
|
|
5995
6047
|
let response = undefined;
|
|
5996
|
-
|
|
6048
|
+
let request = {};
|
|
5997
6049
|
[type, params] = this.handleMarketTypeAndParams('fetchLedger', undefined, params);
|
|
5998
6050
|
if ((type === 'spot') || (type === 'margin')) {
|
|
5999
6051
|
if (code !== undefined) {
|
|
@@ -6013,6 +6065,7 @@ class gate extends gate$1 {
|
|
|
6013
6065
|
if (limit !== undefined) {
|
|
6014
6066
|
request['limit'] = limit;
|
|
6015
6067
|
}
|
|
6068
|
+
[request, params] = this.handleUntilOption('to', request, params);
|
|
6016
6069
|
if (type === 'spot') {
|
|
6017
6070
|
response = await this.privateSpotGetAccountBook(this.extend(request, params));
|
|
6018
6071
|
}
|