ccxt 4.3.15 → 4.3.17
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/cjs/ccxt.js +1 -1
- package/dist/cjs/src/alpaca.js +1 -0
- package/dist/cjs/src/ascendex.js +1 -0
- package/dist/cjs/src/base/Exchange.js +24 -15
- package/dist/cjs/src/base/Precise.js +3 -2
- package/dist/cjs/src/base/ws/WsClient.js +4 -0
- package/dist/cjs/src/binance.js +10 -9
- package/dist/cjs/src/bingx.js +1 -0
- package/dist/cjs/src/bitmex.js +1 -0
- package/dist/cjs/src/bybit.js +11 -7
- package/dist/cjs/src/coinbaseinternational.js +1 -0
- package/dist/cjs/src/coinmetro.js +1 -0
- package/dist/cjs/src/cryptocom.js +1 -0
- package/dist/cjs/src/currencycom.js +1 -0
- package/dist/cjs/src/deribit.js +1 -0
- package/dist/cjs/src/gate.js +1 -0
- package/dist/cjs/src/gemini.js +1 -0
- package/dist/cjs/src/hitbtc.js +1 -0
- package/dist/cjs/src/hollaex.js +1 -0
- package/dist/cjs/src/hyperliquid.js +5 -0
- package/dist/cjs/src/idex.js +1 -0
- package/dist/cjs/src/krakenfutures.js +1 -0
- package/dist/cjs/src/ndax.js +1 -0
- package/dist/cjs/src/okx.js +18 -0
- package/dist/cjs/src/phemex.js +1 -0
- package/dist/cjs/src/poloniex.js +1 -0
- package/dist/cjs/src/pro/bitfinex2.js +2 -0
- package/dist/cjs/src/pro/bitget.js +3 -0
- package/dist/cjs/src/pro/bybit.js +3 -3
- package/dist/cjs/src/pro/htx.js +2 -0
- package/dist/cjs/src/pro/independentreserve.js +2 -0
- package/dist/cjs/src/pro/kraken.js +2 -0
- package/dist/cjs/src/pro/okx.js +22 -22
- package/dist/cjs/src/probit.js +1 -0
- package/dist/cjs/src/wavesexchange.js +1 -0
- package/dist/cjs/src/woo.js +1 -0
- package/dist/cjs/src/zaif.js +1 -1
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/alpaca.js +1 -0
- package/js/src/ascendex.js +1 -0
- package/js/src/base/Exchange.d.ts +1 -0
- package/js/src/base/Exchange.js +24 -15
- package/js/src/base/Precise.d.ts +19 -19
- package/js/src/base/Precise.js +3 -2
- package/js/src/base/errors.d.ts +37 -37
- package/js/src/base/ws/WsClient.d.ts +1 -1
- package/js/src/base/ws/WsClient.js +4 -0
- package/js/src/binance.js +10 -9
- package/js/src/bingx.js +1 -0
- package/js/src/bitmex.js +1 -0
- package/js/src/bybit.js +11 -7
- package/js/src/coinbaseinternational.js +1 -0
- package/js/src/coinmetro.js +1 -0
- package/js/src/cryptocom.js +1 -0
- package/js/src/currencycom.js +1 -0
- package/js/src/deribit.js +1 -0
- package/js/src/gate.js +1 -0
- package/js/src/gemini.js +1 -0
- package/js/src/hitbtc.js +1 -0
- package/js/src/hollaex.js +1 -0
- package/js/src/hyperliquid.js +5 -0
- package/js/src/idex.js +1 -0
- package/js/src/krakenfutures.js +1 -0
- package/js/src/kuna.d.ts +1 -1
- package/js/src/ndax.js +1 -0
- package/js/src/okx.js +19 -1
- package/js/src/phemex.js +1 -0
- package/js/src/poloniex.js +1 -0
- package/js/src/pro/bitfinex2.js +2 -0
- package/js/src/pro/bitget.js +3 -0
- package/js/src/pro/bybit.js +3 -3
- package/js/src/pro/htx.js +2 -0
- package/js/src/pro/independentreserve.js +2 -0
- package/js/src/pro/kraken.js +2 -0
- package/js/src/pro/okx.js +23 -23
- package/js/src/probit.js +1 -0
- package/js/src/wavesexchange.js +1 -0
- package/js/src/woo.js +1 -0
- package/js/src/zaif.js +1 -1
- package/package.json +1 -1
package/js/src/bybit.js
CHANGED
|
@@ -122,6 +122,7 @@ export default class bybit extends Exchange {
|
|
|
122
122
|
'fetchVolatilityHistory': true,
|
|
123
123
|
'fetchWithdrawals': true,
|
|
124
124
|
'repayCrossMargin': true,
|
|
125
|
+
'sandbox': true,
|
|
125
126
|
'setLeverage': true,
|
|
126
127
|
'setMarginMode': true,
|
|
127
128
|
'setPositionMode': true,
|
|
@@ -1493,6 +1494,7 @@ export default class bybit extends Exchange {
|
|
|
1493
1494
|
// "quoteCoin": "USDT",
|
|
1494
1495
|
// "innovation": "0",
|
|
1495
1496
|
// "status": "Trading",
|
|
1497
|
+
// "marginTrading": "both",
|
|
1496
1498
|
// "lotSizeFilter": {
|
|
1497
1499
|
// "basePrecision": "0.000001",
|
|
1498
1500
|
// "quotePrecision": "0.00000001",
|
|
@@ -1529,7 +1531,9 @@ export default class bybit extends Exchange {
|
|
|
1529
1531
|
const lotSizeFilter = this.safeDict(market, 'lotSizeFilter');
|
|
1530
1532
|
const priceFilter = this.safeDict(market, 'priceFilter');
|
|
1531
1533
|
const quotePrecision = this.safeNumber(lotSizeFilter, 'quotePrecision');
|
|
1532
|
-
|
|
1534
|
+
const marginTrading = this.safeString(market, 'marginTrading', 'none');
|
|
1535
|
+
const allowsMargin = marginTrading !== 'none';
|
|
1536
|
+
result.push(this.safeMarketStructure({
|
|
1533
1537
|
'id': id,
|
|
1534
1538
|
'symbol': symbol,
|
|
1535
1539
|
'base': base,
|
|
@@ -1540,7 +1544,7 @@ export default class bybit extends Exchange {
|
|
|
1540
1544
|
'settleId': undefined,
|
|
1541
1545
|
'type': 'spot',
|
|
1542
1546
|
'spot': true,
|
|
1543
|
-
'margin':
|
|
1547
|
+
'margin': allowsMargin,
|
|
1544
1548
|
'swap': false,
|
|
1545
1549
|
'future': false,
|
|
1546
1550
|
'option': false,
|
|
@@ -1579,7 +1583,7 @@ export default class bybit extends Exchange {
|
|
|
1579
1583
|
},
|
|
1580
1584
|
'created': undefined,
|
|
1581
1585
|
'info': market,
|
|
1582
|
-
});
|
|
1586
|
+
}));
|
|
1583
1587
|
}
|
|
1584
1588
|
return result;
|
|
1585
1589
|
}
|
|
@@ -1704,7 +1708,7 @@ export default class bybit extends Exchange {
|
|
|
1704
1708
|
symbol = symbol + '-' + this.yymmdd(expiry);
|
|
1705
1709
|
}
|
|
1706
1710
|
const contractSize = inverse ? this.safeNumber2(lotSizeFilter, 'minTradingQty', 'minOrderQty') : this.parseNumber('1');
|
|
1707
|
-
result.push({
|
|
1711
|
+
result.push(this.safeMarketStructure({
|
|
1708
1712
|
'id': id,
|
|
1709
1713
|
'symbol': symbol,
|
|
1710
1714
|
'base': base,
|
|
@@ -1754,7 +1758,7 @@ export default class bybit extends Exchange {
|
|
|
1754
1758
|
},
|
|
1755
1759
|
'created': this.safeInteger(market, 'launchTime'),
|
|
1756
1760
|
'info': market,
|
|
1757
|
-
});
|
|
1761
|
+
}));
|
|
1758
1762
|
}
|
|
1759
1763
|
return result;
|
|
1760
1764
|
}
|
|
@@ -1837,7 +1841,7 @@ export default class bybit extends Exchange {
|
|
|
1837
1841
|
const optionLetter = this.safeString(splitId, 3);
|
|
1838
1842
|
const isActive = (status === 'Trading');
|
|
1839
1843
|
if (isActive || (this.options['loadAllOptions']) || (this.options['loadExpiredOptions'])) {
|
|
1840
|
-
result.push({
|
|
1844
|
+
result.push(this.safeMarketStructure({
|
|
1841
1845
|
'id': id,
|
|
1842
1846
|
'symbol': base + '/' + quote + ':' + settle + '-' + this.yymmdd(expiry) + '-' + strike + '-' + optionLetter,
|
|
1843
1847
|
'base': base,
|
|
@@ -1887,7 +1891,7 @@ export default class bybit extends Exchange {
|
|
|
1887
1891
|
},
|
|
1888
1892
|
'created': this.safeInteger(market, 'launchTime'),
|
|
1889
1893
|
'info': market,
|
|
1890
|
-
});
|
|
1894
|
+
}));
|
|
1891
1895
|
}
|
|
1892
1896
|
}
|
|
1893
1897
|
return result;
|
package/js/src/coinmetro.js
CHANGED
package/js/src/cryptocom.js
CHANGED
package/js/src/currencycom.js
CHANGED
|
@@ -104,6 +104,7 @@ export default class currencycom extends Exchange {
|
|
|
104
104
|
'fetchWithdrawal': undefined,
|
|
105
105
|
'fetchWithdrawals': true,
|
|
106
106
|
'reduceMargin': undefined,
|
|
107
|
+
'sandbox': true,
|
|
107
108
|
'setLeverage': undefined,
|
|
108
109
|
'setMarginMode': undefined,
|
|
109
110
|
'setPositionMode': undefined,
|
package/js/src/deribit.js
CHANGED
package/js/src/gate.js
CHANGED
package/js/src/gemini.js
CHANGED
package/js/src/hitbtc.js
CHANGED
package/js/src/hollaex.js
CHANGED
package/js/src/hyperliquid.js
CHANGED
|
@@ -109,6 +109,7 @@ export default class hyperliquid extends Exchange {
|
|
|
109
109
|
'reduceMargin': true,
|
|
110
110
|
'repayCrossMargin': false,
|
|
111
111
|
'repayIsolatedMargin': false,
|
|
112
|
+
'sandbox': true,
|
|
112
113
|
'setLeverage': true,
|
|
113
114
|
'setMarginMode': true,
|
|
114
115
|
'setPositionMode': false,
|
|
@@ -443,6 +444,10 @@ export default class hyperliquid extends Exchange {
|
|
|
443
444
|
for (let i = 0; i < meta.length; i++) {
|
|
444
445
|
const market = this.safeDict(meta, i, {});
|
|
445
446
|
const marketName = this.safeString(market, 'name');
|
|
447
|
+
if (marketName.indexOf('/') < 0) {
|
|
448
|
+
// there are some weird spot markets in testnet, eg @2
|
|
449
|
+
continue;
|
|
450
|
+
}
|
|
446
451
|
const marketParts = marketName.split('/');
|
|
447
452
|
const baseName = this.safeString(marketParts, 0);
|
|
448
453
|
const quoteId = this.safeString(marketParts, 1);
|
package/js/src/idex.js
CHANGED
package/js/src/krakenfutures.js
CHANGED
package/js/src/kuna.d.ts
CHANGED
package/js/src/ndax.js
CHANGED
package/js/src/okx.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
// ---------------------------------------------------------------------------
|
|
8
8
|
import Exchange from './abstract/okx.js';
|
|
9
|
-
import { ExchangeError, ExchangeNotAvailable, OnMaintenance, ArgumentsRequired, BadRequest, AccountSuspended, InvalidAddress, PermissionDenied, InsufficientFunds, InvalidNonce, InvalidOrder, OrderNotFound, AuthenticationError, RequestTimeout, BadSymbol, RateLimitExceeded, NetworkError, CancelPending, NotSupported, AccountNotEnabled, ContractUnavailable } from './base/errors.js';
|
|
9
|
+
import { ExchangeError, ExchangeNotAvailable, OnMaintenance, ArgumentsRequired, BadRequest, AccountSuspended, InvalidAddress, DDoSProtection, PermissionDenied, InsufficientFunds, InvalidNonce, InvalidOrder, OrderNotFound, AuthenticationError, RequestTimeout, BadSymbol, RateLimitExceeded, NetworkError, CancelPending, NotSupported, AccountNotEnabled, ContractUnavailable } from './base/errors.js';
|
|
10
10
|
import { Precise } from './base/Precise.js';
|
|
11
11
|
import { TICK_SIZE } from './base/functions/number.js';
|
|
12
12
|
import { sha256 } from './static_dependencies/noble-hashes/sha256.js';
|
|
@@ -141,6 +141,7 @@ export default class okx extends Exchange {
|
|
|
141
141
|
'fetchWithdrawalWhitelist': false,
|
|
142
142
|
'reduceMargin': true,
|
|
143
143
|
'repayCrossMargin': true,
|
|
144
|
+
'sandbox': true,
|
|
144
145
|
'setLeverage': true,
|
|
145
146
|
'setMargin': false,
|
|
146
147
|
'setMarginMode': true,
|
|
@@ -891,7 +892,24 @@ export default class okx extends Exchange {
|
|
|
891
892
|
'60017': BadRequest,
|
|
892
893
|
'60018': BadRequest,
|
|
893
894
|
'60019': BadRequest,
|
|
895
|
+
'60020': ExchangeError,
|
|
896
|
+
'60021': AccountNotEnabled,
|
|
897
|
+
'60022': AuthenticationError,
|
|
898
|
+
'60023': DDoSProtection,
|
|
899
|
+
'60024': AuthenticationError,
|
|
900
|
+
'60025': ExchangeError,
|
|
901
|
+
'60026': AuthenticationError,
|
|
902
|
+
'60027': ArgumentsRequired,
|
|
903
|
+
'60028': NotSupported,
|
|
904
|
+
'60029': AccountNotEnabled,
|
|
905
|
+
'60030': AccountNotEnabled,
|
|
906
|
+
'60031': AuthenticationError,
|
|
907
|
+
'60032': AuthenticationError,
|
|
894
908
|
'63999': ExchangeError,
|
|
909
|
+
'64000': BadRequest,
|
|
910
|
+
'64001': BadRequest,
|
|
911
|
+
'64002': BadRequest,
|
|
912
|
+
'64003': AccountNotEnabled,
|
|
895
913
|
'70010': BadRequest,
|
|
896
914
|
'70013': BadRequest,
|
|
897
915
|
'70016': BadRequest, // Please specify your instrument settings for at least one instType.
|
package/js/src/phemex.js
CHANGED
package/js/src/poloniex.js
CHANGED
package/js/src/pro/bitfinex2.js
CHANGED
|
@@ -685,6 +685,8 @@ export default class bitfinex2 extends bitfinex2Rest {
|
|
|
685
685
|
const responseChecksum = this.safeInteger(message, 2);
|
|
686
686
|
if (responseChecksum !== localChecksum) {
|
|
687
687
|
const error = new InvalidNonce(this.id + ' invalid checksum');
|
|
688
|
+
delete client.subscriptions[messageHash];
|
|
689
|
+
delete this.orderbooks[symbol];
|
|
688
690
|
client.reject(error, messageHash);
|
|
689
691
|
}
|
|
690
692
|
}
|
package/js/src/pro/bitget.js
CHANGED
|
@@ -563,7 +563,10 @@ export default class bitget extends bitgetRest {
|
|
|
563
563
|
const responseChecksum = this.safeInteger(rawOrderBook, 'checksum');
|
|
564
564
|
if (calculatedChecksum !== responseChecksum) {
|
|
565
565
|
const error = new InvalidNonce(this.id + ' invalid checksum');
|
|
566
|
+
delete client.subscriptions[messageHash];
|
|
567
|
+
delete this.orderbooks[symbol];
|
|
566
568
|
client.reject(error, messageHash);
|
|
569
|
+
return;
|
|
567
570
|
}
|
|
568
571
|
}
|
|
569
572
|
}
|
package/js/src/pro/bybit.js
CHANGED
|
@@ -15,11 +15,11 @@ export default class bybit extends bybitRest {
|
|
|
15
15
|
return this.deepExtend(super.describe(), {
|
|
16
16
|
'has': {
|
|
17
17
|
'ws': true,
|
|
18
|
-
'createOrderWs':
|
|
19
|
-
'editOrderWs':
|
|
18
|
+
'createOrderWs': true,
|
|
19
|
+
'editOrderWs': true,
|
|
20
20
|
'fetchOpenOrdersWs': false,
|
|
21
21
|
'fetchOrderWs': false,
|
|
22
|
-
'cancelOrderWs':
|
|
22
|
+
'cancelOrderWs': true,
|
|
23
23
|
'cancelOrdersWs': false,
|
|
24
24
|
'cancelAllOrdersWs': false,
|
|
25
25
|
'fetchTradesWs': false,
|
package/js/src/pro/htx.js
CHANGED
|
@@ -220,6 +220,8 @@ export default class independentreserve extends independentreserveRest {
|
|
|
220
220
|
const responseChecksum = this.safeInteger(orderBook, 'Crc32');
|
|
221
221
|
if (calculatedChecksum !== responseChecksum) {
|
|
222
222
|
const error = new InvalidNonce(this.id + ' invalid checksum');
|
|
223
|
+
delete client.subscriptions[messageHash];
|
|
224
|
+
delete this.orderbooks[symbol];
|
|
223
225
|
client.reject(error, messageHash);
|
|
224
226
|
}
|
|
225
227
|
}
|
package/js/src/pro/kraken.js
CHANGED
|
@@ -770,6 +770,8 @@ export default class kraken extends krakenRest {
|
|
|
770
770
|
const localChecksum = this.crc32(payload, false);
|
|
771
771
|
if (localChecksum !== c) {
|
|
772
772
|
const error = new InvalidNonce(this.id + ' invalid checksum');
|
|
773
|
+
delete client.subscriptions[messageHash];
|
|
774
|
+
delete this.orderbooks[symbol];
|
|
773
775
|
client.reject(error, messageHash);
|
|
774
776
|
return;
|
|
775
777
|
}
|
package/js/src/pro/okx.js
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
// ---------------------------------------------------------------------------
|
|
8
8
|
import okxRest from '../okx.js';
|
|
9
|
-
import { ArgumentsRequired,
|
|
9
|
+
import { ArgumentsRequired, BadRequest, ExchangeError, InvalidNonce, AuthenticationError } from '../base/errors.js';
|
|
10
10
|
import { ArrayCache, ArrayCacheByTimestamp, ArrayCacheBySymbolById, ArrayCacheBySymbolBySide } from '../base/ws/Cache.js';
|
|
11
11
|
import { sha256 } from '../static_dependencies/noble-hashes/sha256.js';
|
|
12
12
|
// ---------------------------------------------------------------------------
|
|
@@ -453,10 +453,12 @@ export default class okx extends okxRest {
|
|
|
453
453
|
/**
|
|
454
454
|
* @method
|
|
455
455
|
* @name okx#watchOrderBook
|
|
456
|
+
* @see https://www.okx.com/docs-v5/en/#order-book-trading-market-data-ws-order-book-channel
|
|
456
457
|
* @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
457
458
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
458
459
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
459
460
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
461
|
+
* @param {string} [params.depth] okx order book depth, can be books, books5, books-l2-tbt, books50-l2-tbt, bbo-tbt
|
|
460
462
|
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
461
463
|
*/
|
|
462
464
|
//
|
|
@@ -488,16 +490,18 @@ export default class okx extends okxRest {
|
|
|
488
490
|
/**
|
|
489
491
|
* @method
|
|
490
492
|
* @name okx#watchOrderBookForSymbols
|
|
493
|
+
* @see https://www.okx.com/docs-v5/en/#order-book-trading-market-data-ws-order-book-channel
|
|
491
494
|
* @description watches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
492
495
|
* @param {string[]} symbols unified array of symbols
|
|
493
496
|
* @param {int} [limit] 1,5, 400, 50 (l2-tbt, vip4+) or 40000 (vip5+) the maximum amount of order book entries to return
|
|
494
497
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
498
|
+
* @param {string} [params.depth] okx order book depth, can be books, books5, books-l2-tbt, books50-l2-tbt, bbo-tbt
|
|
495
499
|
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
496
500
|
*/
|
|
497
501
|
await this.loadMarkets();
|
|
498
502
|
symbols = this.marketSymbols(symbols);
|
|
499
|
-
|
|
500
|
-
|
|
503
|
+
let depth = undefined;
|
|
504
|
+
[depth, params] = this.handleOptionAndParams(params, 'watchOrderBook', 'depth', 'books');
|
|
501
505
|
if (limit !== undefined) {
|
|
502
506
|
if (limit === 1) {
|
|
503
507
|
depth = 'bbo-tbt';
|
|
@@ -505,17 +509,17 @@ export default class okx extends okxRest {
|
|
|
505
509
|
else if (limit > 1 && limit <= 5) {
|
|
506
510
|
depth = 'books5';
|
|
507
511
|
}
|
|
508
|
-
else if (limit === 400) {
|
|
509
|
-
depth = 'books';
|
|
510
|
-
}
|
|
511
512
|
else if (limit === 50) {
|
|
512
513
|
depth = 'books50-l2-tbt'; // Make sure you have VIP4 and above
|
|
513
514
|
}
|
|
514
|
-
else if (limit ===
|
|
515
|
-
depth = 'books
|
|
515
|
+
else if (limit === 400) {
|
|
516
|
+
depth = 'books';
|
|
516
517
|
}
|
|
517
518
|
}
|
|
518
519
|
if ((depth === 'books-l2-tbt') || (depth === 'books50-l2-tbt')) {
|
|
520
|
+
if (!this.checkRequiredCredentials(false)) {
|
|
521
|
+
throw new AuthenticationError(this.id + ' watchOrderBook/watchOrderBookForSymbols requires authentication for this depth. Add credentials or change the depth option to books or books5');
|
|
522
|
+
}
|
|
519
523
|
await this.authenticate({ 'access': 'public' });
|
|
520
524
|
}
|
|
521
525
|
const topics = [];
|
|
@@ -579,6 +583,8 @@ export default class okx extends okxRest {
|
|
|
579
583
|
const storedBids = orderbook['bids'];
|
|
580
584
|
this.handleDeltas(storedAsks, asks);
|
|
581
585
|
this.handleDeltas(storedBids, bids);
|
|
586
|
+
const marketId = this.safeString(message, 'instId');
|
|
587
|
+
const symbol = this.safeSymbol(marketId);
|
|
582
588
|
const checksum = this.safeBool(this.options, 'checksum', true);
|
|
583
589
|
if (checksum) {
|
|
584
590
|
const asksLength = storedAsks.length;
|
|
@@ -599,6 +605,8 @@ export default class okx extends okxRest {
|
|
|
599
605
|
const localChecksum = this.crc32(payload, true);
|
|
600
606
|
if (responseChecksum !== localChecksum) {
|
|
601
607
|
const error = new InvalidNonce(this.id + ' invalid checksum');
|
|
608
|
+
delete client.subscriptions[messageHash];
|
|
609
|
+
delete this.orderbooks[symbol];
|
|
602
610
|
client.reject(error, messageHash);
|
|
603
611
|
}
|
|
604
612
|
}
|
|
@@ -693,10 +701,10 @@ export default class okx extends okxRest {
|
|
|
693
701
|
// ]
|
|
694
702
|
// }
|
|
695
703
|
//
|
|
696
|
-
const arg = this.
|
|
704
|
+
const arg = this.safeDict(message, 'arg', {});
|
|
697
705
|
const channel = this.safeString(arg, 'channel');
|
|
698
706
|
const action = this.safeString(message, 'action');
|
|
699
|
-
const data = this.
|
|
707
|
+
const data = this.safeList(message, 'data', []);
|
|
700
708
|
const marketId = this.safeString(arg, 'instId');
|
|
701
709
|
const market = this.safeMarket(marketId);
|
|
702
710
|
const symbol = market['symbol'];
|
|
@@ -1526,29 +1534,21 @@ export default class okx extends okxRest {
|
|
|
1526
1534
|
// { event: 'error', msg: "Illegal request: {"op":"subscribe","args":["spot/ticker:BTC-USDT"]}", code: "60012" }
|
|
1527
1535
|
// { event: 'error", msg: "channel:ticker,instId:BTC-USDT doesn"t exist", code: "60018" }
|
|
1528
1536
|
//
|
|
1529
|
-
const errorCode = this.
|
|
1537
|
+
const errorCode = this.safeString(message, 'code');
|
|
1530
1538
|
try {
|
|
1531
|
-
if (errorCode) {
|
|
1539
|
+
if (errorCode && errorCode !== '0') {
|
|
1532
1540
|
const feedback = this.id + ' ' + this.json(message);
|
|
1533
1541
|
this.throwExactlyMatchedException(this.exceptions['exact'], errorCode, feedback);
|
|
1534
1542
|
const messageString = this.safeValue(message, 'msg');
|
|
1535
1543
|
if (messageString !== undefined) {
|
|
1536
1544
|
this.throwBroadlyMatchedException(this.exceptions['broad'], messageString, feedback);
|
|
1537
1545
|
}
|
|
1546
|
+
throw new ExchangeError(feedback);
|
|
1538
1547
|
}
|
|
1539
1548
|
}
|
|
1540
1549
|
catch (e) {
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
client.reject(e, messageHash);
|
|
1544
|
-
if (messageHash in client.subscriptions) {
|
|
1545
|
-
delete client.subscriptions[messageHash];
|
|
1546
|
-
}
|
|
1547
|
-
return false;
|
|
1548
|
-
}
|
|
1549
|
-
else {
|
|
1550
|
-
client.reject(e);
|
|
1551
|
-
}
|
|
1550
|
+
client.reject(e);
|
|
1551
|
+
return false;
|
|
1552
1552
|
}
|
|
1553
1553
|
return message;
|
|
1554
1554
|
}
|
package/js/src/probit.js
CHANGED
package/js/src/wavesexchange.js
CHANGED
package/js/src/woo.js
CHANGED
package/js/src/zaif.js
CHANGED
|
@@ -678,7 +678,7 @@ export default class zaif extends Exchange {
|
|
|
678
678
|
};
|
|
679
679
|
}
|
|
680
680
|
customNonce() {
|
|
681
|
-
const num = (this.milliseconds() / 1000)
|
|
681
|
+
const num = this.numberToString(this.milliseconds() / 1000);
|
|
682
682
|
const nonce = parseFloat(num);
|
|
683
683
|
return nonce.toFixed(8);
|
|
684
684
|
}
|
package/package.json
CHANGED