ccxt 4.3.61 → 4.3.63
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.min.js +3 -3
- package/dist/cjs/ccxt.js +2 -1
- package/dist/cjs/src/ace.js +34 -15
- package/dist/cjs/src/base/Exchange.js +8 -1
- package/dist/cjs/src/base/errors.js +8 -1
- package/dist/cjs/src/binance.js +50 -43
- package/dist/cjs/src/bingx.js +507 -184
- package/dist/cjs/src/bybit.js +1 -1
- package/dist/cjs/src/cryptocom.js +18 -2
- package/dist/cjs/src/mercado.js +5 -1
- package/dist/cjs/src/pro/alpaca.js +3 -3
- package/dist/cjs/src/pro/binance.js +60 -38
- package/dist/cjs/src/pro/bingx.js +2 -2
- package/dist/cjs/src/pro/bitfinex2.js +8 -5
- package/dist/cjs/src/pro/bitget.js +5 -2
- package/dist/cjs/src/pro/bitmex.js +1 -1
- package/dist/cjs/src/pro/bitopro.js +1 -1
- package/dist/cjs/src/pro/bitvavo.js +1 -1
- package/dist/cjs/src/pro/bybit.js +49 -23
- package/dist/cjs/src/pro/coinbaseexchange.js +2 -2
- package/dist/cjs/src/pro/coincheck.js +1 -1
- package/dist/cjs/src/pro/coinone.js +1 -1
- package/dist/cjs/src/pro/cryptocom.js +8 -2
- package/dist/cjs/src/pro/deribit.js +1 -1
- package/dist/cjs/src/pro/gate.js +8 -4
- package/dist/cjs/src/pro/hollaex.js +1 -1
- package/dist/cjs/src/pro/htx.js +6 -2
- package/dist/cjs/src/pro/hyperliquid.js +3 -3
- package/dist/cjs/src/pro/independentreserve.js +5 -3
- package/dist/cjs/src/pro/kraken.js +83 -5
- package/dist/cjs/src/pro/kucoin.js +1 -1
- package/dist/cjs/src/pro/mexc.js +1 -1
- package/dist/cjs/src/pro/okx.js +4 -4
- package/dist/cjs/src/pro/oxfun.js +1 -1
- package/dist/cjs/src/pro/phemex.js +1 -1
- package/dist/cjs/src/pro/poloniexfutures.js +5 -1
- package/dist/cjs/src/pro/upbit.js +1 -1
- package/dist/cjs/src/pro/vertex.js +2 -2
- package/dist/cjs/src/pro/whitebit.js +1 -1
- package/dist/cjs/src/pro/woo.js +1 -1
- package/dist/cjs/src/pro/woofipro.js +1 -1
- package/dist/cjs/src/tradeogre.js +1 -1
- package/dist/cjs/src/woo.js +313 -81
- package/dist/cjs/src/xt.js +1 -1
- package/js/ccxt.d.ts +3 -3
- package/js/ccxt.js +3 -3
- package/js/src/abstract/cryptocom.d.ts +11 -0
- package/js/src/abstract/woo.d.ts +3 -0
- package/js/src/ace.js +34 -15
- package/js/src/base/Exchange.d.ts +1 -0
- package/js/src/base/Exchange.js +8 -1
- package/js/src/base/errorHierarchy.d.ts +3 -1
- package/js/src/base/errorHierarchy.js +3 -1
- package/js/src/base/errors.d.ts +5 -1
- package/js/src/base/errors.js +8 -2
- package/js/src/base/ws/Client.d.ts +1 -1
- package/js/src/binance.js +50 -43
- package/js/src/bingx.d.ts +1 -0
- package/js/src/bingx.js +507 -184
- package/js/src/bybit.js +1 -1
- package/js/src/coinbaseinternational.d.ts +1 -1
- package/js/src/cryptocom.js +18 -2
- package/js/src/mercado.js +5 -1
- package/js/src/pro/alpaca.js +3 -3
- package/js/src/pro/binance.d.ts +1 -0
- package/js/src/pro/binance.js +61 -39
- package/js/src/pro/bingx.js +2 -2
- package/js/src/pro/bitfinex2.js +9 -6
- package/js/src/pro/bitget.js +6 -3
- package/js/src/pro/bitmex.js +1 -1
- package/js/src/pro/bitopro.js +1 -1
- package/js/src/pro/bitvavo.js +1 -1
- package/js/src/pro/bybit.d.ts +1 -0
- package/js/src/pro/bybit.js +49 -23
- package/js/src/pro/coinbaseexchange.js +2 -2
- package/js/src/pro/coincheck.js +1 -1
- package/js/src/pro/coinone.js +1 -1
- package/js/src/pro/cryptocom.js +9 -3
- package/js/src/pro/deribit.js +1 -1
- package/js/src/pro/gate.js +9 -5
- package/js/src/pro/hollaex.js +1 -1
- package/js/src/pro/htx.js +7 -3
- package/js/src/pro/hyperliquid.js +3 -3
- package/js/src/pro/independentreserve.js +6 -4
- package/js/src/pro/kraken.d.ts +3 -1
- package/js/src/pro/kraken.js +84 -6
- package/js/src/pro/kucoin.js +1 -1
- package/js/src/pro/mexc.js +1 -1
- package/js/src/pro/okx.js +5 -5
- package/js/src/pro/oxfun.js +1 -1
- package/js/src/pro/phemex.js +1 -1
- package/js/src/pro/poloniexfutures.js +6 -2
- package/js/src/pro/upbit.js +1 -1
- package/js/src/pro/vertex.js +2 -2
- package/js/src/pro/whitebit.js +1 -1
- package/js/src/pro/woo.js +1 -1
- package/js/src/pro/woofipro.js +1 -1
- package/js/src/tradeogre.js +1 -1
- package/js/src/woo.d.ts +5 -1
- package/js/src/woo.js +313 -81
- package/js/src/xt.d.ts +3 -3
- package/js/src/xt.js +1 -1
- package/package.json +1 -1
|
@@ -561,7 +561,7 @@ class deribit extends deribit$1 {
|
|
|
561
561
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
562
562
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
563
563
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
564
|
-
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure
|
|
564
|
+
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
565
565
|
*/
|
|
566
566
|
await this.loadMarkets();
|
|
567
567
|
await this.authenticate(params);
|
package/dist/cjs/src/pro/gate.js
CHANGED
|
@@ -94,6 +94,7 @@ class gate extends gate$1 {
|
|
|
94
94
|
'interval': '100ms',
|
|
95
95
|
'snapshotDelay': 10,
|
|
96
96
|
'snapshotMaxRetries': 3,
|
|
97
|
+
'checksum': true,
|
|
97
98
|
},
|
|
98
99
|
'watchBalance': {
|
|
99
100
|
'settle': 'usdt',
|
|
@@ -479,10 +480,13 @@ class gate extends gate$1 {
|
|
|
479
480
|
this.handleDelta(storedOrderBook, delta);
|
|
480
481
|
}
|
|
481
482
|
else {
|
|
482
|
-
const error = new errors.InvalidNonce(this.id + ' orderbook update has a nonce bigger than u');
|
|
483
483
|
delete client.subscriptions[messageHash];
|
|
484
484
|
delete this.orderbooks[symbol];
|
|
485
|
-
|
|
485
|
+
const checksum = this.handleOption('watchOrderBook', 'checksum', true);
|
|
486
|
+
if (checksum) {
|
|
487
|
+
const error = new errors.ChecksumError(this.id + ' ' + this.orderbookChecksumMessage(symbol));
|
|
488
|
+
client.reject(error, messageHash);
|
|
489
|
+
}
|
|
486
490
|
}
|
|
487
491
|
client.resolve(storedOrderBook, messageHash);
|
|
488
492
|
}
|
|
@@ -842,7 +846,7 @@ class gate extends gate$1 {
|
|
|
842
846
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
843
847
|
* @param {int} [limit] the maximum number of trade structures to retrieve
|
|
844
848
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
845
|
-
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
|
|
849
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
846
850
|
*/
|
|
847
851
|
await this.loadMarkets();
|
|
848
852
|
let subType = undefined;
|
|
@@ -1190,7 +1194,7 @@ class gate extends gate$1 {
|
|
|
1190
1194
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1191
1195
|
* @param {string} [params.type] spot, margin, swap, future, or option. Required if listening to all symbols.
|
|
1192
1196
|
* @param {boolean} [params.isInverse] if future, listen to inverse or linear contracts
|
|
1193
|
-
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure
|
|
1197
|
+
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1194
1198
|
*/
|
|
1195
1199
|
await this.loadMarkets();
|
|
1196
1200
|
let market = undefined;
|
|
@@ -173,7 +173,7 @@ class hollaex extends hollaex$1 {
|
|
|
173
173
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
174
174
|
* @param {int} [limit] the maximum number of trade structures to retrieve
|
|
175
175
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
176
|
-
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
|
|
176
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
177
177
|
*/
|
|
178
178
|
await this.loadMarkets();
|
|
179
179
|
let messageHash = 'usertrade';
|
package/dist/cjs/src/pro/htx.js
CHANGED
|
@@ -97,6 +97,7 @@ class htx extends htx$1 {
|
|
|
97
97
|
'api': 'api',
|
|
98
98
|
'watchOrderBook': {
|
|
99
99
|
'maxRetries': 3,
|
|
100
|
+
'checksum': true,
|
|
100
101
|
},
|
|
101
102
|
'ws': {
|
|
102
103
|
'gunzip': true,
|
|
@@ -568,7 +569,10 @@ class htx extends htx$1 {
|
|
|
568
569
|
orderbook['nonce'] = version;
|
|
569
570
|
}
|
|
570
571
|
if ((prevSeqNum !== undefined) && prevSeqNum > orderbook['nonce']) {
|
|
571
|
-
|
|
572
|
+
const checksum = this.handleOption('watchOrderBook', 'checksum', true);
|
|
573
|
+
if (checksum) {
|
|
574
|
+
throw new errors.ChecksumError(this.id + ' ' + this.orderbookChecksumMessage(symbol));
|
|
575
|
+
}
|
|
572
576
|
}
|
|
573
577
|
const spotConditon = market['spot'] && (prevSeqNum === orderbook['nonce']);
|
|
574
578
|
const nonSpotCondition = market['contract'] && (version - 1 === orderbook['nonce']);
|
|
@@ -668,7 +672,7 @@ class htx extends htx$1 {
|
|
|
668
672
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
669
673
|
* @param {int} [limit] the maximum number of trade structures to retrieve
|
|
670
674
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
671
|
-
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
|
|
675
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
672
676
|
*/
|
|
673
677
|
this.checkRequiredCredentials();
|
|
674
678
|
await this.loadMarkets();
|
|
@@ -128,7 +128,7 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
128
128
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
129
129
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
130
130
|
* @param {string} [params.user] user address, will default to this.walletAddress if not provided
|
|
131
|
-
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure
|
|
131
|
+
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
132
132
|
*/
|
|
133
133
|
let userAddress = undefined;
|
|
134
134
|
[userAddress, params] = this.handlePublicAddress('watchMyTrades', params);
|
|
@@ -219,7 +219,7 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
219
219
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
220
220
|
* @param {int} [limit] the maximum number of trade structures to retrieve
|
|
221
221
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
222
|
-
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
|
|
222
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
223
223
|
*/
|
|
224
224
|
await this.loadMarkets();
|
|
225
225
|
const market = this.market(symbol);
|
|
@@ -419,7 +419,7 @@ class hyperliquid extends hyperliquid$1 {
|
|
|
419
419
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
420
420
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
421
421
|
* @param {string} [params.user] user address, will default to this.walletAddress if not provided
|
|
422
|
-
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure
|
|
422
|
+
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
423
423
|
*/
|
|
424
424
|
await this.loadMarkets();
|
|
425
425
|
let userAddress = undefined;
|
|
@@ -26,7 +26,9 @@ class independentreserve extends independentreserve$1 {
|
|
|
26
26
|
},
|
|
27
27
|
},
|
|
28
28
|
'options': {
|
|
29
|
-
'
|
|
29
|
+
'watchOrderBook': {
|
|
30
|
+
'checksum': true, // TODO: currently only working for snapshot
|
|
31
|
+
},
|
|
30
32
|
},
|
|
31
33
|
'streaming': {},
|
|
32
34
|
'exceptions': {},
|
|
@@ -196,7 +198,7 @@ class independentreserve extends independentreserve$1 {
|
|
|
196
198
|
orderbook['timestamp'] = timestamp;
|
|
197
199
|
orderbook['datetime'] = this.iso8601(timestamp);
|
|
198
200
|
}
|
|
199
|
-
const checksum = this.
|
|
201
|
+
const checksum = this.handleOption('watchOrderBook', 'checksum', true);
|
|
200
202
|
if (checksum && receivedSnapshot) {
|
|
201
203
|
const storedAsks = orderbook['asks'];
|
|
202
204
|
const storedBids = orderbook['bids'];
|
|
@@ -216,7 +218,7 @@ class independentreserve extends independentreserve$1 {
|
|
|
216
218
|
const calculatedChecksum = this.crc32(payload, true);
|
|
217
219
|
const responseChecksum = this.safeInteger(orderBook, 'Crc32');
|
|
218
220
|
if (calculatedChecksum !== responseChecksum) {
|
|
219
|
-
const error = new errors.
|
|
221
|
+
const error = new errors.ChecksumError(this.id + ' ' + this.orderbookChecksumMessage(symbol));
|
|
220
222
|
delete client.subscriptions[messageHash];
|
|
221
223
|
delete this.orderbooks[symbol];
|
|
222
224
|
client.reject(error, messageHash);
|
|
@@ -12,7 +12,7 @@ class kraken extends kraken$1 {
|
|
|
12
12
|
return this.deepExtend(super.describe(), {
|
|
13
13
|
'has': {
|
|
14
14
|
'ws': true,
|
|
15
|
-
'watchBalance':
|
|
15
|
+
'watchBalance': true,
|
|
16
16
|
'watchMyTrades': true,
|
|
17
17
|
'watchOHLCV': true,
|
|
18
18
|
'watchOrderBook': true,
|
|
@@ -35,6 +35,7 @@ class kraken extends kraken$1 {
|
|
|
35
35
|
'ws': {
|
|
36
36
|
'public': 'wss://ws.kraken.com',
|
|
37
37
|
'private': 'wss://ws-auth.kraken.com',
|
|
38
|
+
'privateV2': 'wss://ws-auth.kraken.com/v2',
|
|
38
39
|
'beta': 'wss://beta-ws.kraken.com',
|
|
39
40
|
'beta-private': 'wss://beta-ws-auth.kraken.com',
|
|
40
41
|
},
|
|
@@ -48,7 +49,9 @@ class kraken extends kraken$1 {
|
|
|
48
49
|
'OHLCVLimit': 1000,
|
|
49
50
|
'ordersLimit': 1000,
|
|
50
51
|
'symbolsByOrderId': {},
|
|
51
|
-
'
|
|
52
|
+
'watchOrderBook': {
|
|
53
|
+
'checksum': true,
|
|
54
|
+
},
|
|
52
55
|
},
|
|
53
56
|
'exceptions': {
|
|
54
57
|
'ws': {
|
|
@@ -746,7 +749,7 @@ class kraken extends kraken$1 {
|
|
|
746
749
|
}
|
|
747
750
|
// don't remove this line or I will poop on your face
|
|
748
751
|
orderbook.limit();
|
|
749
|
-
const checksum = this.
|
|
752
|
+
const checksum = this.handleOption('watchOrderBook', 'checksum', true);
|
|
750
753
|
if (checksum) {
|
|
751
754
|
const priceString = this.safeString(example, 0);
|
|
752
755
|
const amountString = this.safeString(example, 1);
|
|
@@ -768,7 +771,7 @@ class kraken extends kraken$1 {
|
|
|
768
771
|
const payload = payloadArray.join('');
|
|
769
772
|
const localChecksum = this.crc32(payload, false);
|
|
770
773
|
if (localChecksum !== c) {
|
|
771
|
-
const error = new errors.
|
|
774
|
+
const error = new errors.ChecksumError(this.id + ' ' + this.orderbookChecksumMessage(symbol));
|
|
772
775
|
delete client.subscriptions[messageHash];
|
|
773
776
|
delete this.orderbooks[symbol];
|
|
774
777
|
client.reject(error, messageHash);
|
|
@@ -881,7 +884,7 @@ class kraken extends kraken$1 {
|
|
|
881
884
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
882
885
|
* @param {int} [limit] the maximum number of trade structures to retrieve
|
|
883
886
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
884
|
-
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
|
|
887
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
885
888
|
*/
|
|
886
889
|
return await this.watchPrivate('ownTrades', symbol, since, limit, params);
|
|
887
890
|
}
|
|
@@ -1326,6 +1329,71 @@ class kraken extends kraken$1 {
|
|
|
1326
1329
|
const url = this.urls['api']['ws']['public'];
|
|
1327
1330
|
return await this.watchMultiple(url, messageHashes, this.deepExtend(request, params), messageHashes, subscriptionArgs);
|
|
1328
1331
|
}
|
|
1332
|
+
async watchBalance(params = {}) {
|
|
1333
|
+
/**
|
|
1334
|
+
* @method
|
|
1335
|
+
* @name kraken#watchBalance
|
|
1336
|
+
* @description watch balance and get the amount of funds available for trading or funds locked in orders
|
|
1337
|
+
* @see https://docs.kraken.com/api/docs/websocket-v2/balances
|
|
1338
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1339
|
+
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
1340
|
+
*/
|
|
1341
|
+
await this.loadMarkets();
|
|
1342
|
+
const token = await this.authenticate();
|
|
1343
|
+
const messageHash = 'balances';
|
|
1344
|
+
const url = this.urls['api']['ws']['privateV2'];
|
|
1345
|
+
const requestId = this.requestId();
|
|
1346
|
+
const subscribe = {
|
|
1347
|
+
'method': 'subscribe',
|
|
1348
|
+
'req_id': requestId,
|
|
1349
|
+
'params': {
|
|
1350
|
+
'channel': 'balances',
|
|
1351
|
+
'token': token,
|
|
1352
|
+
},
|
|
1353
|
+
};
|
|
1354
|
+
const request = this.deepExtend(subscribe, params);
|
|
1355
|
+
return await this.watch(url, messageHash, request, messageHash);
|
|
1356
|
+
}
|
|
1357
|
+
handleBalance(client, message) {
|
|
1358
|
+
//
|
|
1359
|
+
// {
|
|
1360
|
+
// "channel": "balances",
|
|
1361
|
+
// "data": [
|
|
1362
|
+
// {
|
|
1363
|
+
// "asset": "BTC",
|
|
1364
|
+
// "asset_class": "currency",
|
|
1365
|
+
// "balance": 1.2,
|
|
1366
|
+
// "wallets": [
|
|
1367
|
+
// {
|
|
1368
|
+
// "type": "spot",
|
|
1369
|
+
// "id": "main",
|
|
1370
|
+
// "balance": 1.2
|
|
1371
|
+
// }
|
|
1372
|
+
// ]
|
|
1373
|
+
// }
|
|
1374
|
+
// ],
|
|
1375
|
+
// "type": "snapshot",
|
|
1376
|
+
// "sequence": 1
|
|
1377
|
+
// }
|
|
1378
|
+
//
|
|
1379
|
+
const data = this.safeList(message, 'data', []);
|
|
1380
|
+
const result = { 'info': message };
|
|
1381
|
+
for (let i = 0; i < data.length; i++) {
|
|
1382
|
+
const currencyId = this.safeString(data[i], 'asset');
|
|
1383
|
+
const code = this.safeCurrencyCode(currencyId);
|
|
1384
|
+
const account = this.account();
|
|
1385
|
+
const eq = this.safeString(data[i], 'balance');
|
|
1386
|
+
account['total'] = eq;
|
|
1387
|
+
result[code] = account;
|
|
1388
|
+
}
|
|
1389
|
+
const type = 'spot';
|
|
1390
|
+
const balance = this.safeBalance(result);
|
|
1391
|
+
const oldBalance = this.safeValue(this.balance, type, {});
|
|
1392
|
+
const newBalance = this.deepExtend(oldBalance, balance);
|
|
1393
|
+
this.balance[type] = this.safeBalance(newBalance);
|
|
1394
|
+
const channel = this.safeString(message, 'channel');
|
|
1395
|
+
client.resolve(this.balance[type], channel);
|
|
1396
|
+
}
|
|
1329
1397
|
getMessageHash(unifiedElementName, subChannelName = undefined, symbol = undefined) {
|
|
1330
1398
|
// unifiedElementName can be : orderbook, trade, ticker, bidask ...
|
|
1331
1399
|
// subChannelName only applies to channel that needs specific variation (i.e. depth_50, depth_100..) to be selected
|
|
@@ -1429,6 +1497,16 @@ class kraken extends kraken$1 {
|
|
|
1429
1497
|
}
|
|
1430
1498
|
}
|
|
1431
1499
|
else {
|
|
1500
|
+
const channel = this.safeString(message, 'channel');
|
|
1501
|
+
if (channel !== undefined) {
|
|
1502
|
+
const methods = {
|
|
1503
|
+
'balances': this.handleBalance,
|
|
1504
|
+
};
|
|
1505
|
+
const method = this.safeValue(methods, channel);
|
|
1506
|
+
if (method !== undefined) {
|
|
1507
|
+
method.call(this, client, message);
|
|
1508
|
+
}
|
|
1509
|
+
}
|
|
1432
1510
|
if (this.handleErrorMessage(client, message)) {
|
|
1433
1511
|
const event = this.safeString(message, 'event');
|
|
1434
1512
|
const methods = {
|
|
@@ -987,7 +987,7 @@ class kucoin extends kucoin$1 {
|
|
|
987
987
|
* @param {int} [limit] the maximum number of trade structures to retrieve
|
|
988
988
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
989
989
|
* @param {string} [params.method] '/spotMarket/tradeOrders' or '/spot/tradeFills' default is '/spotMarket/tradeOrders'
|
|
990
|
-
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
|
|
990
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
991
991
|
*/
|
|
992
992
|
await this.loadMarkets();
|
|
993
993
|
const url = await this.negotiate(true);
|
package/dist/cjs/src/pro/mexc.js
CHANGED
|
@@ -614,7 +614,7 @@ class mexc extends mexc$1 {
|
|
|
614
614
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
615
615
|
* @param {int} [limit] the maximum number of trade structures to retrieve
|
|
616
616
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
617
|
-
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
|
|
617
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
618
618
|
*/
|
|
619
619
|
await this.loadMarkets();
|
|
620
620
|
let messageHash = 'myTrades';
|
package/dist/cjs/src/pro/okx.js
CHANGED
|
@@ -46,6 +46,7 @@ class okx extends okx$1 {
|
|
|
46
46
|
},
|
|
47
47
|
'options': {
|
|
48
48
|
'watchOrderBook': {
|
|
49
|
+
'checksum': true,
|
|
49
50
|
//
|
|
50
51
|
// bbo-tbt
|
|
51
52
|
// 1. Newly added channel that sends tick-by-tick Level 1 data
|
|
@@ -93,7 +94,6 @@ class okx extends okx$1 {
|
|
|
93
94
|
'ws': {
|
|
94
95
|
// 'inflate': true,
|
|
95
96
|
},
|
|
96
|
-
'checksum': true,
|
|
97
97
|
},
|
|
98
98
|
'streaming': {
|
|
99
99
|
// okex does not support built-in ws protocol-level ping-pong
|
|
@@ -919,7 +919,7 @@ class okx extends okx$1 {
|
|
|
919
919
|
this.handleDeltas(storedBids, bids);
|
|
920
920
|
const marketId = this.safeString(message, 'instId');
|
|
921
921
|
const symbol = this.safeSymbol(marketId);
|
|
922
|
-
const checksum = this.
|
|
922
|
+
const checksum = this.handleOption('watchOrderBook', 'checksum', true);
|
|
923
923
|
if (checksum) {
|
|
924
924
|
const asksLength = storedAsks.length;
|
|
925
925
|
const bidsLength = storedBids.length;
|
|
@@ -938,7 +938,7 @@ class okx extends okx$1 {
|
|
|
938
938
|
const responseChecksum = this.safeInteger(message, 'checksum');
|
|
939
939
|
const localChecksum = this.crc32(payload, true);
|
|
940
940
|
if (responseChecksum !== localChecksum) {
|
|
941
|
-
const error = new errors.
|
|
941
|
+
const error = new errors.ChecksumError(this.id + ' ' + this.orderbookChecksumMessage(symbol));
|
|
942
942
|
delete client.subscriptions[messageHash];
|
|
943
943
|
delete this.orderbooks[symbol];
|
|
944
944
|
client.reject(error, messageHash);
|
|
@@ -1223,7 +1223,7 @@ class okx extends okx$1 {
|
|
|
1223
1223
|
* @param {bool} [params.stop] true if fetching trigger or conditional trades
|
|
1224
1224
|
* @param {string} [params.type] 'spot', 'swap', 'future', 'option', 'ANY', 'SPOT', 'MARGIN', 'SWAP', 'FUTURES' or 'OPTION'
|
|
1225
1225
|
* @param {string} [params.marginMode] 'cross' or 'isolated', for automatically setting the type to spot margin
|
|
1226
|
-
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
|
|
1226
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
1227
1227
|
*/
|
|
1228
1228
|
// By default, receive order updates from any instrument type
|
|
1229
1229
|
let type = undefined;
|
|
@@ -77,7 +77,7 @@ class oxfun extends oxfun$1 {
|
|
|
77
77
|
* @param {int} [limit] the maximum number of trade structures to retrieve
|
|
78
78
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
79
79
|
* @param {int|string} [params.tag] If given it will be echoed in the reply and the max size of tag is 32
|
|
80
|
-
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
|
|
80
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
81
81
|
*/
|
|
82
82
|
return await this.watchTradesForSymbols([symbol], since, limit, params);
|
|
83
83
|
}
|
|
@@ -730,7 +730,7 @@ class phemex extends phemex$1 {
|
|
|
730
730
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
731
731
|
* @param {int} [limit] the maximum number of trade structures to retrieve
|
|
732
732
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
733
|
-
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
|
|
733
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
734
734
|
*/
|
|
735
735
|
await this.loadMarkets();
|
|
736
736
|
let market = undefined;
|
|
@@ -49,6 +49,7 @@ class poloniexfutures extends poloniexfutures$1 {
|
|
|
49
49
|
'method': '/contractMarket/level2',
|
|
50
50
|
'snapshotDelay': 5,
|
|
51
51
|
'snapshotMaxRetries': 3,
|
|
52
|
+
'checksum': true,
|
|
52
53
|
},
|
|
53
54
|
'streamLimit': 5,
|
|
54
55
|
'streamBySubscriptionsHash': {},
|
|
@@ -857,7 +858,10 @@ class poloniexfutures extends poloniexfutures$1 {
|
|
|
857
858
|
return;
|
|
858
859
|
}
|
|
859
860
|
if (nonce !== lastSequence) {
|
|
860
|
-
|
|
861
|
+
const checksum = this.handleOption('watchOrderBook', 'checksum', true);
|
|
862
|
+
if (checksum) {
|
|
863
|
+
throw new errors.ChecksumError(this.id + ' ' + this.orderbookChecksumMessage(''));
|
|
864
|
+
}
|
|
861
865
|
}
|
|
862
866
|
const changes = this.safeList(delta, 'changes');
|
|
863
867
|
for (let i = 0; i < changes.length; i++) {
|
|
@@ -306,7 +306,7 @@ class upbit extends upbit$1 {
|
|
|
306
306
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
307
307
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
308
308
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
309
|
-
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
|
|
309
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
310
310
|
*/
|
|
311
311
|
await this.loadMarkets();
|
|
312
312
|
const channel = 'myOrder';
|
|
@@ -84,7 +84,7 @@ class vertex extends vertex$1 {
|
|
|
84
84
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
85
85
|
* @param {int} [limit] the maximum number of trade structures to retrieve
|
|
86
86
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
87
|
-
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
|
|
87
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
88
88
|
*/
|
|
89
89
|
await this.loadMarkets();
|
|
90
90
|
const market = this.market(symbol);
|
|
@@ -145,7 +145,7 @@ class vertex extends vertex$1 {
|
|
|
145
145
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
146
146
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
147
147
|
* @param {string} [params.user] user address, will default to this.walletAddress if not provided
|
|
148
|
-
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure
|
|
148
|
+
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
149
149
|
*/
|
|
150
150
|
if (symbol === undefined) {
|
|
151
151
|
throw new errors.ArgumentsRequired(this.id + ' watchMyTrades requires a symbol.');
|
|
@@ -475,7 +475,7 @@ class whitebit extends whitebit$1 {
|
|
|
475
475
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
476
476
|
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
477
477
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
478
|
-
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure
|
|
478
|
+
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
479
479
|
*/
|
|
480
480
|
if (symbol === undefined) {
|
|
481
481
|
throw new errors.ArgumentsRequired(this.id + ' watchOrders() requires a symbol argument');
|
package/dist/cjs/src/pro/woo.js
CHANGED
|
@@ -376,7 +376,7 @@ class woo extends woo$1 {
|
|
|
376
376
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
377
377
|
* @param {int} [limit] the maximum number of trade structures to retrieve
|
|
378
378
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
379
|
-
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
|
|
379
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
380
380
|
*/
|
|
381
381
|
await this.loadMarkets();
|
|
382
382
|
const market = this.market(symbol);
|
|
@@ -374,7 +374,7 @@ class woofipro extends woofipro$1 {
|
|
|
374
374
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
375
375
|
* @param {int} [limit] the maximum number of trade structures to retrieve
|
|
376
376
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
377
|
-
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
|
|
377
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
378
378
|
*/
|
|
379
379
|
await this.loadMarkets();
|
|
380
380
|
const market = this.market(symbol);
|
|
@@ -215,7 +215,7 @@ class tradeogre extends tradeogre$1 {
|
|
|
215
215
|
'inverse': undefined,
|
|
216
216
|
'contractSize': undefined,
|
|
217
217
|
'taker': this.fees['trading']['taker'],
|
|
218
|
-
'maker': this.fees['trading']['
|
|
218
|
+
'maker': this.fees['trading']['maker'],
|
|
219
219
|
'expiry': undefined,
|
|
220
220
|
'expiryDatetime': undefined,
|
|
221
221
|
'strike': undefined,
|