ccxt 4.1.8 → 4.1.10
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/.git-templates/hooks/pre-push +55 -0
- package/README.md +3 -3
- package/dist/ccxt.browser.js +1458 -302
- package/dist/ccxt.browser.min.js +7 -7
- package/dist/cjs/ccxt.js +3 -1
- package/dist/cjs/src/base/Exchange.js +59 -3
- package/dist/cjs/src/bingx.js +103 -41
- package/dist/cjs/src/bitbns.js +107 -83
- package/dist/cjs/src/bitget.js +35 -17
- package/dist/cjs/src/btcalpha.js +9 -1
- package/dist/cjs/src/btcmarkets.js +5 -5
- package/dist/cjs/src/coinex.js +14 -2
- package/dist/cjs/src/deribit.js +6 -0
- package/dist/cjs/src/gate.js +9 -1
- package/dist/cjs/src/hitbtc.js +20 -2
- package/dist/cjs/src/kucoinfutures.js +2 -2
- package/dist/cjs/src/phemex.js +20 -1
- package/dist/cjs/src/pro/bingx.js +891 -0
- package/dist/cjs/src/probit.js +3 -0
- package/dist/cjs/src/woo.js +21 -1
- package/js/ccxt.d.ts +6 -3
- package/js/ccxt.js +3 -1
- package/js/src/abstract/bingx.d.ts +1 -0
- package/js/src/base/Exchange.d.ts +6 -3
- package/js/src/base/Exchange.js +59 -3
- package/js/src/base/types.d.ts +7 -0
- package/js/src/binance.d.ts +17 -17
- package/js/src/bingx.d.ts +4 -3
- package/js/src/bingx.js +103 -41
- package/js/src/bitbns.d.ts +1 -1
- package/js/src/bitbns.js +107 -83
- package/js/src/bitfinex2.d.ts +13 -13
- package/js/src/bitget.d.ts +15 -15
- package/js/src/bitget.js +35 -17
- package/js/src/bitmex.d.ts +15 -15
- package/js/src/btcalpha.js +9 -1
- package/js/src/btcmarkets.js +5 -5
- package/js/src/bybit.d.ts +23 -23
- package/js/src/coinbase.d.ts +16 -16
- package/js/src/coinbasepro.d.ts +12 -12
- package/js/src/coinex.d.ts +2 -2
- package/js/src/coinex.js +14 -2
- package/js/src/cryptocom.d.ts +12 -12
- package/js/src/deribit.d.ts +2 -2
- package/js/src/deribit.js +6 -0
- package/js/src/digifinex.d.ts +2 -2
- package/js/src/gate.d.ts +10 -10
- package/js/src/gate.js +9 -1
- package/js/src/hitbtc.d.ts +2 -2
- package/js/src/hitbtc.js +20 -2
- package/js/src/huobi.d.ts +16 -16
- package/js/src/kraken.d.ts +2 -2
- package/js/src/krakenfutures.d.ts +6 -6
- package/js/src/kucoin.d.ts +13 -13
- package/js/src/kucoinfutures.d.ts +10 -10
- package/js/src/kucoinfutures.js +2 -2
- package/js/src/mexc.d.ts +3 -3
- package/js/src/okx.d.ts +13 -13
- package/js/src/phemex.d.ts +2 -2
- package/js/src/phemex.js +20 -1
- package/js/src/poloniex.d.ts +5 -5
- package/js/src/pro/bingx.d.ts +24 -0
- package/js/src/pro/bingx.js +892 -0
- package/js/src/probit.js +3 -0
- package/js/src/woo.d.ts +2 -2
- package/js/src/woo.js +21 -1
- package/package.json +1 -1
- package/pyproject.toml +8 -0
- package/skip-tests.json +4 -1
package/dist/cjs/src/hitbtc.js
CHANGED
|
@@ -1573,19 +1573,28 @@ class hitbtc extends hitbtc$1 {
|
|
|
1573
1573
|
* @method
|
|
1574
1574
|
* @name hitbtc#fetchOHLCV
|
|
1575
1575
|
* @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
1576
|
+
* @see https://api.hitbtc.com/#candles
|
|
1576
1577
|
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
1577
1578
|
* @param {string} timeframe the length of time each candle represents
|
|
1578
1579
|
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
1579
1580
|
* @param {int} [limit] the maximum amount of candles to fetch
|
|
1580
1581
|
* @param {object} [params] extra parameters specific to the hitbtc api endpoint
|
|
1582
|
+
* @param {int} [params.until] timestamp in ms of the latest funding rate
|
|
1583
|
+
* @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)
|
|
1581
1584
|
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
1582
1585
|
*/
|
|
1583
1586
|
await this.loadMarkets();
|
|
1587
|
+
let paginate = false;
|
|
1588
|
+
[paginate, params] = this.handleOptionAndParams(params, 'fetchOHLCV', 'paginate');
|
|
1589
|
+
if (paginate) {
|
|
1590
|
+
return await this.fetchPaginatedCallDeterministic('fetchOHLCV', symbol, since, limit, timeframe, params, 1000);
|
|
1591
|
+
}
|
|
1584
1592
|
const market = this.market(symbol);
|
|
1585
|
-
|
|
1593
|
+
let request = {
|
|
1586
1594
|
'symbols': market['id'],
|
|
1587
1595
|
'period': this.safeString(this.timeframes, timeframe, timeframe),
|
|
1588
1596
|
};
|
|
1597
|
+
[request, params] = this.handleUntilOption('till', request, params);
|
|
1589
1598
|
if (since !== undefined) {
|
|
1590
1599
|
request['from'] = this.iso8601(since);
|
|
1591
1600
|
}
|
|
@@ -2380,16 +2389,24 @@ class hitbtc extends hitbtc$1 {
|
|
|
2380
2389
|
/**
|
|
2381
2390
|
* @method
|
|
2382
2391
|
* @name hitbtc#fetchFundingRateHistory
|
|
2392
|
+
* @see https://api.hitbtc.com/#funding-history
|
|
2383
2393
|
* @description fetches historical funding rate prices
|
|
2384
2394
|
* @param {string} symbol unified symbol of the market to fetch the funding rate history for
|
|
2385
2395
|
* @param {int} [since] timestamp in ms of the earliest funding rate to fetch
|
|
2386
2396
|
* @param {int} [limit] the maximum amount of [funding rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-history-structure} to fetch
|
|
2387
2397
|
* @param {object} [params] extra parameters specific to the hitbtc api endpoint
|
|
2398
|
+
* @param {int} [params.until] timestamp in ms of the latest funding rate
|
|
2399
|
+
* @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)
|
|
2388
2400
|
* @returns {object[]} a list of [funding rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-history-structure}
|
|
2389
2401
|
*/
|
|
2390
2402
|
await this.loadMarkets();
|
|
2403
|
+
let paginate = false;
|
|
2404
|
+
[paginate, params] = this.handleOptionAndParams(params, 'fetchFundingRateHistory', 'paginate');
|
|
2405
|
+
if (paginate) {
|
|
2406
|
+
return await this.fetchPaginatedCallDeterministic('fetchFundingRateHistory', symbol, since, limit, '8h', params, 1000);
|
|
2407
|
+
}
|
|
2391
2408
|
let market = undefined;
|
|
2392
|
-
|
|
2409
|
+
let request = {
|
|
2393
2410
|
// all arguments are optional
|
|
2394
2411
|
// 'symbols': Comma separated list of symbol codes,
|
|
2395
2412
|
// 'sort': 'DESC' or 'ASC'
|
|
@@ -2398,6 +2415,7 @@ class hitbtc extends hitbtc$1 {
|
|
|
2398
2415
|
// 'limit': 100,
|
|
2399
2416
|
// 'offset': 0,
|
|
2400
2417
|
};
|
|
2418
|
+
[request, params] = this.handleUntilOption('till', request, params);
|
|
2401
2419
|
if (symbol !== undefined) {
|
|
2402
2420
|
market = this.market(symbol);
|
|
2403
2421
|
symbol = market['symbol'];
|
|
@@ -2325,12 +2325,12 @@ class kucoinfutures extends kucoinfutures$1 {
|
|
|
2325
2325
|
async fetchFundingRateHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
2326
2326
|
/**
|
|
2327
2327
|
* @method
|
|
2328
|
-
* @name
|
|
2328
|
+
* @name kucoinfutures#fetchFundingRateHistory
|
|
2329
2329
|
* @description fetches historical funding rate prices
|
|
2330
2330
|
* @param {string} symbol unified symbol of the market to fetch the funding rate history for
|
|
2331
2331
|
* @param {int} [since] not used by kucuoinfutures
|
|
2332
2332
|
* @param {int} [limit] the maximum amount of [funding rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-history-structure} to fetch
|
|
2333
|
-
* @param {object} [params] extra parameters specific to the
|
|
2333
|
+
* @param {object} [params] extra parameters specific to the kucoinfutures api endpoint
|
|
2334
2334
|
* @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)
|
|
2335
2335
|
* @returns {object[]} a list of [funding rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-history-structure}
|
|
2336
2336
|
*/
|
package/dist/cjs/src/phemex.js
CHANGED
|
@@ -4328,6 +4328,19 @@ class phemex extends phemex$1 {
|
|
|
4328
4328
|
return this.safeString(statuses, status, status);
|
|
4329
4329
|
}
|
|
4330
4330
|
async fetchFundingRateHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
4331
|
+
/**
|
|
4332
|
+
* @method
|
|
4333
|
+
* @name phemex#fetchFundingRateHistory
|
|
4334
|
+
* @description fetches historical funding rate prices
|
|
4335
|
+
* @see https://phemex-docs.github.io/#query-funding-rate-history-2
|
|
4336
|
+
* @param {string} symbol unified symbol of the market to fetch the funding rate history for
|
|
4337
|
+
* @param {int} [since] timestamp in ms of the earliest funding rate to fetch
|
|
4338
|
+
* @param {int} [limit] the maximum amount of [funding rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-history-structure} to fetch
|
|
4339
|
+
* @param {object} [params] extra parameters specific to the phemex api endpoint
|
|
4340
|
+
* @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)
|
|
4341
|
+
* @param {int} [params.until] timestamp in ms of the latest funding rate
|
|
4342
|
+
* @returns {object[]} a list of [funding rate structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#funding-rate-history-structure}
|
|
4343
|
+
*/
|
|
4331
4344
|
this.checkRequiredSymbol('fetchFundingRateHistory', symbol);
|
|
4332
4345
|
await this.loadMarkets();
|
|
4333
4346
|
const market = this.market(symbol);
|
|
@@ -4335,6 +4348,11 @@ class phemex extends phemex$1 {
|
|
|
4335
4348
|
if (!market['swap']) {
|
|
4336
4349
|
throw new errors.BadRequest(this.id + ' fetchFundingRateHistory() supports swap contracts only');
|
|
4337
4350
|
}
|
|
4351
|
+
let paginate = false;
|
|
4352
|
+
[paginate, params] = this.handleOptionAndParams(params, 'fetchFundingRateHistory', 'paginate');
|
|
4353
|
+
if (paginate) {
|
|
4354
|
+
return await this.fetchPaginatedCallDeterministic('fetchFundingRateHistory', symbol, since, limit, '8h', params, 100);
|
|
4355
|
+
}
|
|
4338
4356
|
let customSymbol = undefined;
|
|
4339
4357
|
if (isUsdtSettled) {
|
|
4340
4358
|
customSymbol = '.' + market['id'] + 'FR8H'; // phemex requires a custom symbol for funding rate history
|
|
@@ -4342,7 +4360,7 @@ class phemex extends phemex$1 {
|
|
|
4342
4360
|
else {
|
|
4343
4361
|
customSymbol = '.' + market['baseId'] + 'FR8H';
|
|
4344
4362
|
}
|
|
4345
|
-
|
|
4363
|
+
let request = {
|
|
4346
4364
|
'symbol': customSymbol,
|
|
4347
4365
|
};
|
|
4348
4366
|
if (since !== undefined) {
|
|
@@ -4351,6 +4369,7 @@ class phemex extends phemex$1 {
|
|
|
4351
4369
|
if (limit !== undefined) {
|
|
4352
4370
|
request['limit'] = limit;
|
|
4353
4371
|
}
|
|
4372
|
+
[request, params] = this.handleUntilOption('end', request, params);
|
|
4354
4373
|
let response = undefined;
|
|
4355
4374
|
if (isUsdtSettled) {
|
|
4356
4375
|
response = await this.v2GetApiDataPublicDataFundingRateHistory(this.extend(request, params));
|