ccxt 4.2.35 → 4.2.37
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/CONTRIBUTING.md +3 -2
- package/README.md +5 -5
- package/dist/ccxt.browser.js +880 -329
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/base/Exchange.js +3 -3
- package/dist/cjs/src/base/ws/Client.js +5 -2
- package/dist/cjs/src/binance.js +395 -115
- package/dist/cjs/src/bitfinex.js +21 -0
- package/dist/cjs/src/bitfinex2.js +122 -122
- package/dist/cjs/src/bitget.js +28 -39
- package/dist/cjs/src/bithumb.js +14 -0
- package/dist/cjs/src/bitmex.js +22 -3
- package/dist/cjs/src/bybit.js +13 -4
- package/dist/cjs/src/pro/binance.js +2 -2
- package/dist/cjs/src/pro/gemini.js +190 -3
- package/dist/cjs/src/woo.js +64 -35
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/base/Exchange.d.ts +1 -0
- package/js/src/base/Exchange.js +3 -3
- package/js/src/base/types.d.ts +2 -0
- package/js/src/base/ws/Client.js +5 -2
- package/js/src/binance.js +395 -115
- package/js/src/bitfinex.js +21 -0
- package/js/src/bitfinex2.js +122 -122
- package/js/src/bitget.js +28 -39
- package/js/src/bithumb.js +14 -0
- package/js/src/bitmex.js +22 -3
- package/js/src/bybit.js +13 -4
- package/js/src/pro/binance.js +2 -2
- package/js/src/pro/gemini.d.ts +5 -0
- package/js/src/pro/gemini.js +191 -4
- package/js/src/woo.js +64 -35
- package/package.json +2 -2
package/js/src/woo.js
CHANGED
|
@@ -1546,11 +1546,12 @@ export default class woo extends Exchange {
|
|
|
1546
1546
|
* @method
|
|
1547
1547
|
* @name woo#fetchOHLCV
|
|
1548
1548
|
* @see https://docs.woo.org/#kline-public
|
|
1549
|
+
* @see https://docs.woo.org/#kline-historical-data-public
|
|
1549
1550
|
* @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
1550
1551
|
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
1551
1552
|
* @param {string} timeframe the length of time each candle represents
|
|
1552
1553
|
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
1553
|
-
* @param {int} [limit]
|
|
1554
|
+
* @param {int} [limit] max=1000, max=100 when since is defined and is less than (now - (999 * (timeframe in ms)))
|
|
1554
1555
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1555
1556
|
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
1556
1557
|
*/
|
|
@@ -1560,42 +1561,70 @@ export default class woo extends Exchange {
|
|
|
1560
1561
|
'symbol': market['id'],
|
|
1561
1562
|
'type': this.safeString(this.timeframes, timeframe, timeframe),
|
|
1562
1563
|
};
|
|
1563
|
-
|
|
1564
|
+
let useHistEndpoint = since !== undefined;
|
|
1565
|
+
if ((limit !== undefined) && (since !== undefined)) {
|
|
1566
|
+
const oneThousandCandles = this.parseTimeframe(timeframe) * 1000 * 999; // 999 because there will be delay between this and the request, causing the latest candle to be excluded sometimes
|
|
1567
|
+
const startWithLimit = this.milliseconds() - oneThousandCandles;
|
|
1568
|
+
useHistEndpoint = since < startWithLimit;
|
|
1569
|
+
}
|
|
1570
|
+
if (useHistEndpoint) {
|
|
1571
|
+
request['start_time'] = since;
|
|
1572
|
+
}
|
|
1573
|
+
else if (limit !== undefined) { // the hist endpoint does not accept limit
|
|
1564
1574
|
request['limit'] = Math.min(limit, 1000);
|
|
1565
1575
|
}
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1572
|
-
|
|
1573
|
-
|
|
1574
|
-
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1576
|
+
let response = undefined;
|
|
1577
|
+
if (!useHistEndpoint) {
|
|
1578
|
+
response = await this.v1PublicGetKline(this.extend(request, params));
|
|
1579
|
+
//
|
|
1580
|
+
// {
|
|
1581
|
+
// "success": true,
|
|
1582
|
+
// "rows": [
|
|
1583
|
+
// {
|
|
1584
|
+
// "open": "0.94238",
|
|
1585
|
+
// "close": "0.94271",
|
|
1586
|
+
// "low": "0.94238",
|
|
1587
|
+
// "high": "0.94296",
|
|
1588
|
+
// "volume": "73.55",
|
|
1589
|
+
// "amount": "69.32040520",
|
|
1590
|
+
// "symbol": "SPOT_WOO_USDT",
|
|
1591
|
+
// "type": "1m",
|
|
1592
|
+
// "start_timestamp": "1641584700000",
|
|
1593
|
+
// "end_timestamp": "1641584760000"
|
|
1594
|
+
// },
|
|
1595
|
+
// ...
|
|
1596
|
+
// ]
|
|
1597
|
+
// }
|
|
1598
|
+
//
|
|
1599
|
+
}
|
|
1600
|
+
else {
|
|
1601
|
+
response = await this.v1PubGetHistKline(this.extend(request, params));
|
|
1602
|
+
response = this.safeDict(response, 'data');
|
|
1603
|
+
//
|
|
1604
|
+
// {
|
|
1605
|
+
// "success": true,
|
|
1606
|
+
// "data": {
|
|
1607
|
+
// "rows": [
|
|
1608
|
+
// {
|
|
1609
|
+
// "symbol": "SPOT_BTC_USDT",
|
|
1610
|
+
// "open": 44181.40000000,
|
|
1611
|
+
// "close": 44174.29000000,
|
|
1612
|
+
// "high": 44193.44000000,
|
|
1613
|
+
// "low": 44148.34000000,
|
|
1614
|
+
// "volume": 110.11930100,
|
|
1615
|
+
// "amount": 4863796.24318878,
|
|
1616
|
+
// "type": "1m",
|
|
1617
|
+
// "start_timestamp": 1704153600000,
|
|
1618
|
+
// "end_timestamp": 1704153660000
|
|
1619
|
+
// },
|
|
1620
|
+
// ...
|
|
1621
|
+
// ]
|
|
1622
|
+
// }
|
|
1623
|
+
// }
|
|
1624
|
+
//
|
|
1625
|
+
}
|
|
1626
|
+
const rows = this.safeValue(response, 'rows', []);
|
|
1627
|
+
return this.parseOHLCVs(rows, market, timeframe, since, limit);
|
|
1599
1628
|
}
|
|
1600
1629
|
parseOHLCV(ohlcv, market = undefined) {
|
|
1601
1630
|
// example response in fetchOHLCV
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ccxt",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.37",
|
|
4
4
|
"description": "A JavaScript / TypeScript / Python / C# / PHP cryptocurrency trading library with support for 100+ exchanges",
|
|
5
5
|
"unpkg": "dist/ccxt.browser.js",
|
|
6
6
|
"type": "module",
|
|
@@ -144,7 +144,7 @@
|
|
|
144
144
|
"as-table": "1.0.37",
|
|
145
145
|
"asciichart": "^1.5.25",
|
|
146
146
|
"assert": "^2.0.0",
|
|
147
|
-
"ast-transpiler": "^0.0.
|
|
147
|
+
"ast-transpiler": "^0.0.43",
|
|
148
148
|
"docsify": "^4.11.4",
|
|
149
149
|
"eslint": "8.22.0",
|
|
150
150
|
"eslint-config-airbnb-base": "15.0.0",
|