ccxt 4.2.64 → 4.2.66
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 +358 -96
- package/dist/ccxt.browser.min.js +2 -2
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/base/Exchange.js +12 -0
- package/dist/cjs/src/bigone.js +6 -2
- package/dist/cjs/src/binance.js +26 -3
- package/dist/cjs/src/bingx.js +13 -4
- package/dist/cjs/src/bitfinex2.js +4 -4
- package/dist/cjs/src/bitget.js +16 -2
- package/dist/cjs/src/bitmex.js +3 -1
- package/dist/cjs/src/blofin.js +35 -0
- package/dist/cjs/src/btcmarkets.js +12 -0
- package/dist/cjs/src/coinbase.js +12 -2
- package/dist/cjs/src/delta.js +95 -1
- package/dist/cjs/src/hitbtc.js +1 -1
- package/dist/cjs/src/kucoin.js +85 -61
- package/dist/cjs/src/pro/bitfinex2.js +5 -4
- package/dist/cjs/src/pro/bitget.js +3 -3
- package/dist/cjs/src/pro/bitmart.js +28 -6
- package/dist/cjs/src/pro/currencycom.js +1 -1
- package/doc/manual.rst +1 -0
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/bitget.d.ts +5 -0
- package/js/src/abstract/blofin.d.ts +1 -0
- package/js/src/abstract/kucoin.d.ts +9 -0
- package/js/src/abstract/kucoinfutures.d.ts +9 -0
- package/js/src/base/Exchange.js +12 -0
- package/js/src/bigone.js +6 -2
- package/js/src/binance.d.ts +1 -1
- package/js/src/binance.js +26 -3
- package/js/src/bingx.js +13 -4
- package/js/src/bitfinex2.js +4 -4
- package/js/src/bitget.js +16 -2
- package/js/src/bitmex.js +3 -1
- package/js/src/blofin.d.ts +3 -1
- package/js/src/blofin.js +35 -0
- package/js/src/btcmarkets.js +12 -0
- package/js/src/coinbase.js +12 -2
- package/js/src/delta.d.ts +3 -1
- package/js/src/delta.js +95 -1
- package/js/src/gate.d.ts +1 -1
- package/js/src/hitbtc.js +1 -1
- package/js/src/kucoin.js +85 -61
- package/js/src/okx.d.ts +1 -1
- package/js/src/pro/bitfinex2.js +5 -4
- package/js/src/pro/bitget.js +3 -3
- package/js/src/pro/bitmart.js +28 -6
- package/js/src/pro/currencycom.d.ts +1 -1
- package/js/src/pro/currencycom.js +1 -1
- package/js/src/woo.d.ts +1 -1
- package/package.json +2 -2
- package/skip-tests.json +35 -13
package/js/src/pro/bitfinex2.js
CHANGED
|
@@ -323,11 +323,12 @@ export default class bitfinex2 extends bitfinex2Rest {
|
|
|
323
323
|
const messageLength = message.length;
|
|
324
324
|
if (messageLength === 2) {
|
|
325
325
|
// initial snapshot
|
|
326
|
-
|
|
326
|
+
const trades = this.safeList(message, 1, []);
|
|
327
327
|
// needs to be reversed to make chronological order
|
|
328
|
-
|
|
329
|
-
for (let i = 0; i <
|
|
330
|
-
const
|
|
328
|
+
const length = trades.length;
|
|
329
|
+
for (let i = 0; i < length; i++) {
|
|
330
|
+
const index = length - i - 1;
|
|
331
|
+
const parsed = this.parseWsTrade(trades[index], market);
|
|
331
332
|
stored.append(parsed);
|
|
332
333
|
}
|
|
333
334
|
}
|
package/js/src/pro/bitget.js
CHANGED
|
@@ -674,10 +674,10 @@ export default class bitget extends bitgetRest {
|
|
|
674
674
|
}
|
|
675
675
|
const data = this.safeList(message, 'data', []);
|
|
676
676
|
const length = data.length;
|
|
677
|
-
const maxLength = Math.max(length - 1, 0);
|
|
678
677
|
// fix chronological order by reversing
|
|
679
|
-
for (let i =
|
|
680
|
-
const
|
|
678
|
+
for (let i = 0; i < length; i++) {
|
|
679
|
+
const index = length - i - 1;
|
|
680
|
+
const rawTrade = data[index];
|
|
681
681
|
const parsed = this.parseWsTrade(rawTrade, market);
|
|
682
682
|
stored.append(parsed);
|
|
683
683
|
}
|
package/js/src/pro/bitmart.js
CHANGED
|
@@ -830,9 +830,9 @@ export default class bitmart extends bitmartRest {
|
|
|
830
830
|
const isSwap = ('group' in message);
|
|
831
831
|
if (isSwap) {
|
|
832
832
|
// in swap, chronologically decreasing: 1709536849322, 1709536848954,
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
symbol = this.handleTradeLoop(data[
|
|
833
|
+
for (let i = 0; i < length; i++) {
|
|
834
|
+
const index = length - i - 1;
|
|
835
|
+
symbol = this.handleTradeLoop(data[index]);
|
|
836
836
|
}
|
|
837
837
|
}
|
|
838
838
|
else {
|
|
@@ -1474,7 +1474,17 @@ export default class bitmart extends bitmartRest {
|
|
|
1474
1474
|
}
|
|
1475
1475
|
//
|
|
1476
1476
|
// {"event":"error","message":"Unrecognized request: {\"event\":\"subscribe\",\"channel\":\"spot/depth:BTC-USDT\"}","errorCode":30039}
|
|
1477
|
-
//
|
|
1477
|
+
//
|
|
1478
|
+
// subscribe events on spot:
|
|
1479
|
+
//
|
|
1480
|
+
// {"event":"subscribe", "topic":"spot/kline1m:BTC_USDT" }
|
|
1481
|
+
//
|
|
1482
|
+
// subscribe on contracts:
|
|
1483
|
+
//
|
|
1484
|
+
// {"action":"subscribe", "group":"futures/klineBin1m:BTCUSDT", "success":true, "request":{"action":"subscribe", "args":[ "futures/klineBin1m:BTCUSDT" ] } }
|
|
1485
|
+
//
|
|
1486
|
+
// regular updates - spot
|
|
1487
|
+
//
|
|
1478
1488
|
// {
|
|
1479
1489
|
// "table": "spot/depth",
|
|
1480
1490
|
// "action": "partial",
|
|
@@ -1495,10 +1505,21 @@ export default class bitmart extends bitmartRest {
|
|
|
1495
1505
|
// ]
|
|
1496
1506
|
// }
|
|
1497
1507
|
//
|
|
1508
|
+
// regular updates - contracts
|
|
1509
|
+
//
|
|
1510
|
+
// {
|
|
1511
|
+
// group: "futures/klineBin1m:BTCUSDT",
|
|
1512
|
+
// data: {
|
|
1513
|
+
// symbol: "BTCUSDT",
|
|
1514
|
+
// items: [ { o: "67944.7", "h": .... } ],
|
|
1515
|
+
// },
|
|
1516
|
+
// }
|
|
1517
|
+
//
|
|
1498
1518
|
// { data: '', table: "spot/user/order" }
|
|
1499
1519
|
//
|
|
1500
|
-
|
|
1501
|
-
|
|
1520
|
+
// the only realiable way (for both spot & swap) is to check 'data' key
|
|
1521
|
+
const isDataUpdate = ('data' in message);
|
|
1522
|
+
if (!isDataUpdate) {
|
|
1502
1523
|
const event = this.safeString2(message, 'event', 'action');
|
|
1503
1524
|
if (event !== undefined) {
|
|
1504
1525
|
const methods = {
|
|
@@ -1514,6 +1535,7 @@ export default class bitmart extends bitmartRest {
|
|
|
1514
1535
|
}
|
|
1515
1536
|
}
|
|
1516
1537
|
else {
|
|
1538
|
+
const channel = this.safeString2(message, 'table', 'group');
|
|
1517
1539
|
const methods = {
|
|
1518
1540
|
'depth': this.handleOrderBook,
|
|
1519
1541
|
'ticker': this.handleTicker,
|
|
@@ -26,7 +26,7 @@ export default class currencycom extends currencycomRest {
|
|
|
26
26
|
cost: number;
|
|
27
27
|
fee: any;
|
|
28
28
|
};
|
|
29
|
-
handleTrades(client: Client, message: any
|
|
29
|
+
handleTrades(client: Client, message: any): void;
|
|
30
30
|
findTimeframe(timeframe: any, defaultTimeframes?: any): string;
|
|
31
31
|
handleOHLCV(client: Client, message: any): void;
|
|
32
32
|
requestId(): any;
|
package/js/src/woo.d.ts
CHANGED
|
@@ -173,5 +173,5 @@ export default class woo extends Exchange {
|
|
|
173
173
|
fetchPositions(symbols?: Strings, params?: {}): Promise<import("./base/types.js").Position[]>;
|
|
174
174
|
parsePosition(position: any, market?: Market): import("./base/types.js").Position;
|
|
175
175
|
defaultNetworkCodeForCurrency(code: any): any;
|
|
176
|
-
setSandboxMode(enable:
|
|
176
|
+
setSandboxMode(enable: boolean): void;
|
|
177
177
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "ccxt",
|
|
3
|
-
"version": "4.2.
|
|
3
|
+
"version": "4.2.66",
|
|
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",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"build-docs": "node jsdoc2md.js && node examples2md.js",
|
|
37
37
|
"serve-docs": "docsify serve ./wiki",
|
|
38
38
|
"tsBuildFile": "tsc --skipLibCheck --strictNullChecks false --strict --noImplicitAny false --esModuleInterop --isolatedModules false --forceConsistentCasingInFileNames --removeComments false --target ES2020 --declaration --allowJs --checkJs false --moduleResolution Node --module ES2022 --outDir ./js/src --lib ES2020.BigInt --lib dom ",
|
|
39
|
-
"tsBuild": "tsc ||
|
|
39
|
+
"tsBuild": "tsc || echo \"\"",
|
|
40
40
|
"tsBuildExamples": "tsc -p ./examples/tsconfig.json",
|
|
41
41
|
"emitAPI": "node build/generateImplicitAPI.js",
|
|
42
42
|
"build": "npm run pre-transpile && npm run transpile && npm run post-transpile && npm run update-badges && npm run build-docs",
|
package/skip-tests.json
CHANGED
|
@@ -82,6 +82,18 @@
|
|
|
82
82
|
}
|
|
83
83
|
}
|
|
84
84
|
},
|
|
85
|
+
"binanceusdm ": {
|
|
86
|
+
"httpsProxy": "http://5.75.153.75:8002",
|
|
87
|
+
"wsProxy": "http://5.75.153.75:8002",
|
|
88
|
+
"skipMethods": {
|
|
89
|
+
"watchOrderBook": {
|
|
90
|
+
"spread": "https://app.travis-ci.com/github/ccxt/ccxt/builds/269352042#L3463"
|
|
91
|
+
},
|
|
92
|
+
"watchOrderBookForSymbols": {
|
|
93
|
+
"spread": "same"
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
},
|
|
85
97
|
"binanceus": {
|
|
86
98
|
"skipMethods": {
|
|
87
99
|
"loadMarkets": {
|
|
@@ -320,15 +332,17 @@
|
|
|
320
332
|
},
|
|
321
333
|
"fetchTickers": {
|
|
322
334
|
"spread": "https://app.travis-ci.com/github/ccxt/ccxt/builds/269177564#L3615",
|
|
323
|
-
"quoteVolume": "quoteVolume >= baseVolume * low is failing"
|
|
335
|
+
"quoteVolume": "quoteVolume >= baseVolume * low is failing",
|
|
336
|
+
"ask": "https://app.travis-ci.com/github/ccxt/ccxt/builds/269331129#L3609"
|
|
324
337
|
},
|
|
325
338
|
"fetchTicker": {
|
|
326
|
-
"spread": "same",
|
|
327
|
-
"quoteVolume": "same"
|
|
339
|
+
"spread": "same", "quoteVolume": "same", "ask": "same"
|
|
328
340
|
},
|
|
329
341
|
"watchTickers": {
|
|
330
|
-
"spread": "same",
|
|
331
|
-
|
|
342
|
+
"spread": "same", "quoteVolume": "same", "ask": "same"
|
|
343
|
+
},
|
|
344
|
+
"watchTicker": {
|
|
345
|
+
"spread": "same", "quoteVolume": "same", "ask": "same"
|
|
332
346
|
},
|
|
333
347
|
"fetchOrderBook": {
|
|
334
348
|
"spread": "https://app.travis-ci.com/github/ccxt/ccxt/builds/269177564#L3946"
|
|
@@ -601,7 +615,13 @@
|
|
|
601
615
|
"fetchOpenInterestHistory": {
|
|
602
616
|
"openInterestAmount": "openInterestAmount is not provided"
|
|
603
617
|
},
|
|
604
|
-
"fetchBorrowRate": "does not work with unified account"
|
|
618
|
+
"fetchBorrowRate": "does not work with unified account",
|
|
619
|
+
"watchOrderBook": {
|
|
620
|
+
"spread": "https://app.travis-ci.com/github/ccxt/ccxt/builds/269352042#L3669"
|
|
621
|
+
},
|
|
622
|
+
"watchOrderBookForSymbols": {
|
|
623
|
+
"spread": "same"
|
|
624
|
+
}
|
|
605
625
|
}
|
|
606
626
|
},
|
|
607
627
|
"bigone": {
|
|
@@ -1163,9 +1183,7 @@
|
|
|
1163
1183
|
"watchTrades": {
|
|
1164
1184
|
"timestamp": "ts several hours ahead in in future :)"
|
|
1165
1185
|
},
|
|
1166
|
-
"watchOHLCV":
|
|
1167
|
-
"0": "ts several hours ahead in in future :)"
|
|
1168
|
-
}
|
|
1186
|
+
"watchOHLCV": "some timestamp issues"
|
|
1169
1187
|
}
|
|
1170
1188
|
},
|
|
1171
1189
|
"lykke": {
|
|
@@ -1356,12 +1374,16 @@
|
|
|
1356
1374
|
"deposit":"not provided"
|
|
1357
1375
|
},
|
|
1358
1376
|
"fetchTickers": {
|
|
1359
|
-
"quoteVolume": "
|
|
1360
|
-
"baseVolume": "quoteVolume >= baseVolume * low is failing"
|
|
1377
|
+
"quoteVolume": "https://app.travis-ci.com/github/ccxt/ccxt/builds/269352042#L3690"
|
|
1361
1378
|
},
|
|
1362
1379
|
"fetchTicker": {
|
|
1363
|
-
"quoteVolume": "
|
|
1364
|
-
|
|
1380
|
+
"quoteVolume": "same"
|
|
1381
|
+
},
|
|
1382
|
+
"watchTickers": {
|
|
1383
|
+
"quoteVolume": "same"
|
|
1384
|
+
},
|
|
1385
|
+
"watchTicker": {
|
|
1386
|
+
"quoteVolume": "same"
|
|
1365
1387
|
},
|
|
1366
1388
|
"watchOrderBook": {
|
|
1367
1389
|
"nonce": "missing https://app.travis-ci.com/github/ccxt/ccxt/builds/267900037#L4807"
|