ccxt 4.2.8 → 4.2.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/README.md +3 -3
- package/build.sh +18 -2
- package/dist/ccxt.browser.js +387 -149
- package/dist/ccxt.browser.min.js +7 -7
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/base/Exchange.js +37 -8
- package/dist/cjs/src/binance.js +6 -1
- package/dist/cjs/src/bitmart.js +94 -15
- package/dist/cjs/src/bl3p.js +1 -1
- package/dist/cjs/src/btcalpha.js +1 -1
- package/dist/cjs/src/cryptocom.js +3 -1
- package/dist/cjs/src/deribit.js +39 -22
- package/dist/cjs/src/kraken.js +1 -1
- package/dist/cjs/src/kucoin.js +1 -1
- package/dist/cjs/src/lykke.js +1 -1
- package/dist/cjs/src/ndax.js +1 -1
- package/dist/cjs/src/pro/binance.js +17 -1
- package/dist/cjs/src/pro/bitget.js +3 -1
- package/dist/cjs/src/pro/bitmart.js +52 -15
- package/dist/cjs/src/pro/blockchaincom.js +2 -28
- package/dist/cjs/src/pro/bybit.js +3 -1
- package/dist/cjs/src/pro/coinbasepro.js +9 -16
- package/dist/cjs/src/pro/cryptocom.js +110 -28
- package/dist/cjs/src/pro/luno.js +5 -5
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/base/Exchange.d.ts +4 -3
- package/js/src/base/Exchange.js +37 -8
- package/js/src/binance.js +6 -1
- package/js/src/bitmart.js +95 -16
- package/js/src/bl3p.d.ts +2 -2
- package/js/src/bl3p.js +1 -1
- package/js/src/btcalpha.d.ts +2 -2
- package/js/src/btcalpha.js +1 -1
- package/js/src/cryptocom.js +3 -1
- package/js/src/deribit.js +39 -22
- package/js/src/kraken.d.ts +2 -2
- package/js/src/kraken.js +1 -1
- package/js/src/kucoin.js +1 -1
- package/js/src/lykke.d.ts +2 -2
- package/js/src/lykke.js +1 -1
- package/js/src/ndax.d.ts +2 -2
- package/js/src/ndax.js +1 -1
- package/js/src/pro/binance.js +17 -1
- package/js/src/pro/bitget.js +3 -1
- package/js/src/pro/bitmart.d.ts +1 -0
- package/js/src/pro/bitmart.js +52 -15
- package/js/src/pro/blockchaincom.d.ts +1 -11
- package/js/src/pro/blockchaincom.js +2 -28
- package/js/src/pro/bybit.js +3 -1
- package/js/src/pro/coinbasepro.js +9 -16
- package/js/src/pro/cryptocom.d.ts +3 -1
- package/js/src/pro/cryptocom.js +111 -29
- package/js/src/pro/luno.d.ts +4 -4
- package/js/src/pro/luno.js +5 -5
- package/js/src/static_dependencies/jsencrypt/lib/jsbn/jsbn.d.ts +1 -1
- package/package.json +1 -1
package/dist/ccxt.browser.js
CHANGED
|
@@ -9851,11 +9851,11 @@ class Exchange {
|
|
|
9851
9851
|
}
|
|
9852
9852
|
return result;
|
|
9853
9853
|
}
|
|
9854
|
-
parseBidsAsks(bidasks, priceKey = 0, amountKey = 1) {
|
|
9854
|
+
parseBidsAsks(bidasks, priceKey = 0, amountKey = 1, countOrIdKey = 2) {
|
|
9855
9855
|
bidasks = this.toArray(bidasks);
|
|
9856
9856
|
const result = [];
|
|
9857
9857
|
for (let i = 0; i < bidasks.length; i++) {
|
|
9858
|
-
result.push(this.parseBidAsk(bidasks[i], priceKey, amountKey));
|
|
9858
|
+
result.push(this.parseBidAsk(bidasks[i], priceKey, amountKey, countOrIdKey));
|
|
9859
9859
|
}
|
|
9860
9860
|
return result;
|
|
9861
9861
|
}
|
|
@@ -10024,9 +10024,9 @@ class Exchange {
|
|
|
10024
10024
|
const value = this.safeString2(dictionary, key1, key2);
|
|
10025
10025
|
return this.parseNumber(value, d);
|
|
10026
10026
|
}
|
|
10027
|
-
parseOrderBook(orderbook, symbol, timestamp = undefined, bidsKey = 'bids', asksKey = 'asks', priceKey = 0, amountKey = 1) {
|
|
10028
|
-
const bids = this.parseBidsAsks(this.safeValue(orderbook, bidsKey, []), priceKey, amountKey);
|
|
10029
|
-
const asks = this.parseBidsAsks(this.safeValue(orderbook, asksKey, []), priceKey, amountKey);
|
|
10027
|
+
parseOrderBook(orderbook, symbol, timestamp = undefined, bidsKey = 'bids', asksKey = 'asks', priceKey = 0, amountKey = 1, countOrIdKey = 2) {
|
|
10028
|
+
const bids = this.parseBidsAsks(this.safeValue(orderbook, bidsKey, []), priceKey, amountKey, countOrIdKey);
|
|
10029
|
+
const asks = this.parseBidsAsks(this.safeValue(orderbook, asksKey, []), priceKey, amountKey, countOrIdKey);
|
|
10030
10030
|
return {
|
|
10031
10031
|
'symbol': symbol,
|
|
10032
10032
|
'bids': this.sortBy(bids, 0, true),
|
|
@@ -10341,10 +10341,15 @@ class Exchange {
|
|
|
10341
10341
|
async fetchBidsAsks(symbols = undefined, params = {}) {
|
|
10342
10342
|
throw new _errors_js__WEBPACK_IMPORTED_MODULE_3__.NotSupported(this.id + ' fetchBidsAsks() is not supported yet');
|
|
10343
10343
|
}
|
|
10344
|
-
parseBidAsk(bidask, priceKey = 0, amountKey = 1) {
|
|
10344
|
+
parseBidAsk(bidask, priceKey = 0, amountKey = 1, countOrIdKey = 2) {
|
|
10345
10345
|
const price = this.safeNumber(bidask, priceKey);
|
|
10346
10346
|
const amount = this.safeNumber(bidask, amountKey);
|
|
10347
|
-
|
|
10347
|
+
const countOrId = this.safeInteger(bidask, countOrIdKey);
|
|
10348
|
+
const bidAsk = [price, amount];
|
|
10349
|
+
if (countOrId !== undefined) {
|
|
10350
|
+
bidAsk.push(countOrId);
|
|
10351
|
+
}
|
|
10352
|
+
return bidAsk;
|
|
10348
10353
|
}
|
|
10349
10354
|
safeCurrency(currencyId, currency = undefined) {
|
|
10350
10355
|
if ((currencyId === undefined) && (currency !== undefined)) {
|
|
@@ -10392,7 +10397,7 @@ class Exchange {
|
|
|
10392
10397
|
}
|
|
10393
10398
|
}
|
|
10394
10399
|
}
|
|
10395
|
-
else if (delimiter !== undefined) {
|
|
10400
|
+
else if (delimiter !== undefined && delimiter !== '') {
|
|
10396
10401
|
const parts = marketId.split(delimiter);
|
|
10397
10402
|
const partsLength = parts.length;
|
|
10398
10403
|
if (partsLength === 2) {
|
|
@@ -10553,6 +10558,30 @@ class Exchange {
|
|
|
10553
10558
|
}
|
|
10554
10559
|
return [value, params];
|
|
10555
10560
|
}
|
|
10561
|
+
handleOptionAndParams2(params, methodName, methodName2, optionName, defaultValue = undefined) {
|
|
10562
|
+
// This method can be used to obtain method specific properties, i.e: this.handleOptionAndParams (params, 'fetchPosition', 'marginMode', 'isolated')
|
|
10563
|
+
const defaultOptionName = 'default' + this.capitalize(optionName); // we also need to check the 'defaultXyzWhatever'
|
|
10564
|
+
// check if params contain the key
|
|
10565
|
+
let value = this.safeValue2(params, optionName, defaultOptionName);
|
|
10566
|
+
if (value !== undefined) {
|
|
10567
|
+
params = this.omit(params, [optionName, defaultOptionName]);
|
|
10568
|
+
}
|
|
10569
|
+
else {
|
|
10570
|
+
// check if exchange has properties for this method
|
|
10571
|
+
const exchangeWideMethodOptions = this.safeValue2(this.options, methodName, methodName2);
|
|
10572
|
+
if (exchangeWideMethodOptions !== undefined) {
|
|
10573
|
+
// check if the option is defined inside this method's props
|
|
10574
|
+
value = this.safeValue2(exchangeWideMethodOptions, optionName, defaultOptionName);
|
|
10575
|
+
}
|
|
10576
|
+
if (value === undefined) {
|
|
10577
|
+
// if it's still undefined, check if global exchange-wide option exists
|
|
10578
|
+
value = this.safeValue2(this.options, optionName, defaultOptionName);
|
|
10579
|
+
}
|
|
10580
|
+
// if it's still undefined, use the default value
|
|
10581
|
+
value = (value !== undefined) ? value : defaultValue;
|
|
10582
|
+
}
|
|
10583
|
+
return [value, params];
|
|
10584
|
+
}
|
|
10556
10585
|
handleOption(methodName, optionName, defaultValue = undefined) {
|
|
10557
10586
|
// eslint-disable-next-line no-unused-vars
|
|
10558
10587
|
const [result, empty] = this.handleOptionAndParams({}, methodName, optionName, defaultValue);
|
|
@@ -20305,7 +20334,12 @@ class binance extends _abstract_binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
20305
20334
|
response = await this.dapiPublicGetTickerBookTicker(params);
|
|
20306
20335
|
}
|
|
20307
20336
|
else {
|
|
20308
|
-
|
|
20337
|
+
const request = {};
|
|
20338
|
+
if (symbols !== undefined) {
|
|
20339
|
+
const marketIds = this.marketIds(symbols);
|
|
20340
|
+
request['symbols'] = this.json(marketIds);
|
|
20341
|
+
}
|
|
20342
|
+
response = await this.publicGetTickerBookTicker(this.extend(request, params));
|
|
20309
20343
|
}
|
|
20310
20344
|
return this.parseTickers(response, symbols);
|
|
20311
20345
|
}
|
|
@@ -50329,7 +50363,11 @@ class bitmart extends _abstract_bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
50329
50363
|
'30012': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.AuthenticationError,
|
|
50330
50364
|
'30013': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.RateLimitExceeded,
|
|
50331
50365
|
'30014': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeNotAvailable,
|
|
50332
|
-
|
|
50366
|
+
'30016': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.OnMaintenance,
|
|
50367
|
+
'30017': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.RateLimitExceeded,
|
|
50368
|
+
'30018': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest,
|
|
50369
|
+
'30019': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.PermissionDenied,
|
|
50370
|
+
// funding account & sub account errors
|
|
50333
50371
|
'60000': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest,
|
|
50334
50372
|
'60001': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest,
|
|
50335
50373
|
'60002': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest,
|
|
@@ -50346,13 +50384,31 @@ class bitmart extends _abstract_bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
50346
50384
|
'60020': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.PermissionDenied,
|
|
50347
50385
|
'60021': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.PermissionDenied,
|
|
50348
50386
|
'60022': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.PermissionDenied,
|
|
50387
|
+
'60026': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.PermissionDenied,
|
|
50388
|
+
'60027': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.PermissionDenied,
|
|
50389
|
+
'60028': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.AccountSuspended,
|
|
50390
|
+
'60029': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.AccountSuspended,
|
|
50349
50391
|
'60030': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest,
|
|
50350
50392
|
'60031': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest,
|
|
50351
50393
|
'60050': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError,
|
|
50352
50394
|
'60051': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError,
|
|
50353
50395
|
'61001': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InsufficientFunds,
|
|
50354
50396
|
'61003': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest,
|
|
50355
|
-
|
|
50397
|
+
'61004': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest,
|
|
50398
|
+
'61005': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest,
|
|
50399
|
+
'61006': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.NotSupported,
|
|
50400
|
+
'61007': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError,
|
|
50401
|
+
'61008': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError,
|
|
50402
|
+
// spot public errors
|
|
50403
|
+
'70000': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError,
|
|
50404
|
+
'70001': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest,
|
|
50405
|
+
'70002': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadSymbol,
|
|
50406
|
+
'71001': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest,
|
|
50407
|
+
'71002': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest,
|
|
50408
|
+
'71003': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest,
|
|
50409
|
+
'71004': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest,
|
|
50410
|
+
'71005': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest,
|
|
50411
|
+
// spot & margin errors
|
|
50356
50412
|
'50000': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest,
|
|
50357
50413
|
'50001': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadSymbol,
|
|
50358
50414
|
'50002': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest,
|
|
@@ -50372,26 +50428,75 @@ class bitmart extends _abstract_bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
50372
50428
|
'50016': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest,
|
|
50373
50429
|
'50017': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest,
|
|
50374
50430
|
'50018': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest,
|
|
50375
|
-
'50019': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.
|
|
50376
|
-
'51004': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InsufficientFunds,
|
|
50377
|
-
// '50019': ExchangeError, // 400, Invalid status. validate status is [1=Failed, 2=Success, 3=Frozen Failed, 4=Frozen Success, 5=Partially Filled, 6=Fully Fulled, 7=Canceling, 8=Canceled
|
|
50431
|
+
'50019': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError,
|
|
50378
50432
|
'50020': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InsufficientFunds,
|
|
50379
50433
|
'50021': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest,
|
|
50380
50434
|
'50022': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeNotAvailable,
|
|
50381
50435
|
'50023': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadSymbol,
|
|
50436
|
+
'50024': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest,
|
|
50437
|
+
'50025': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest,
|
|
50438
|
+
'50026': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest,
|
|
50439
|
+
'50027': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest,
|
|
50440
|
+
'50028': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest,
|
|
50382
50441
|
'50029': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InvalidOrder,
|
|
50383
|
-
'50030': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.
|
|
50442
|
+
'50030': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.OrderNotFound,
|
|
50443
|
+
'50031': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.OrderNotFound,
|
|
50384
50444
|
'50032': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.OrderNotFound,
|
|
50445
|
+
'50033': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InvalidOrder,
|
|
50385
50446
|
// below Error codes used interchangeably for both failed postOnly and IOC orders depending on market price and order side
|
|
50386
|
-
'50035': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InvalidOrder,
|
|
50387
50447
|
'50034': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InvalidOrder,
|
|
50448
|
+
'50035': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InvalidOrder,
|
|
50449
|
+
'50036': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError,
|
|
50450
|
+
'50037': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest,
|
|
50451
|
+
'50038': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest,
|
|
50452
|
+
'50039': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest,
|
|
50453
|
+
'50040': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadSymbol,
|
|
50454
|
+
'50041': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError,
|
|
50455
|
+
'50042': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest,
|
|
50456
|
+
'51000': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadSymbol,
|
|
50457
|
+
'51001': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError,
|
|
50458
|
+
'51002': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError,
|
|
50459
|
+
'51003': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError,
|
|
50460
|
+
'51004': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InsufficientFunds,
|
|
50461
|
+
'51005': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InvalidOrder,
|
|
50462
|
+
'51006': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InvalidOrder,
|
|
50463
|
+
'51007': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest,
|
|
50464
|
+
'51008': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError,
|
|
50465
|
+
'51009': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InvalidOrder,
|
|
50466
|
+
'51010': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InvalidOrder,
|
|
50388
50467
|
'51011': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InvalidOrder,
|
|
50468
|
+
'51012': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InvalidOrder,
|
|
50469
|
+
'51013': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InvalidOrder,
|
|
50470
|
+
'51014': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InvalidOrder,
|
|
50471
|
+
'51015': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InvalidOrder,
|
|
50472
|
+
'52000': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest,
|
|
50473
|
+
'52001': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest,
|
|
50474
|
+
'52002': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest,
|
|
50475
|
+
'52003': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest,
|
|
50476
|
+
'52004': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest,
|
|
50389
50477
|
'53000': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.AccountSuspended,
|
|
50390
50478
|
'53001': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.AccountSuspended,
|
|
50479
|
+
'53002': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.PermissionDenied,
|
|
50480
|
+
'53003': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.PermissionDenied,
|
|
50481
|
+
'53005': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.PermissionDenied,
|
|
50482
|
+
'53006': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.PermissionDenied,
|
|
50483
|
+
'53007': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.PermissionDenied,
|
|
50484
|
+
'53008': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.PermissionDenied,
|
|
50485
|
+
'53009': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.PermissionDenied,
|
|
50486
|
+
'53010': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.PermissionDenied,
|
|
50391
50487
|
'57001': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest,
|
|
50392
50488
|
'58001': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest,
|
|
50393
50489
|
'59001': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError,
|
|
50394
50490
|
'59002': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError,
|
|
50491
|
+
'59003': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError,
|
|
50492
|
+
'59004': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError,
|
|
50493
|
+
'59005': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.PermissionDenied,
|
|
50494
|
+
'59006': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError,
|
|
50495
|
+
'59007': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError,
|
|
50496
|
+
'59008': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError,
|
|
50497
|
+
'59009': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError,
|
|
50498
|
+
'59010': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InsufficientFunds,
|
|
50499
|
+
'59011': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError,
|
|
50395
50500
|
// contract errors
|
|
50396
50501
|
'40001': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError,
|
|
50397
50502
|
'40002': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.ExchangeError,
|
|
@@ -50427,14 +50532,22 @@ class bitmart extends _abstract_bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
50427
50532
|
'40032': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InvalidOrder,
|
|
50428
50533
|
'40033': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InvalidOrder,
|
|
50429
50534
|
'40034': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadSymbol,
|
|
50430
|
-
'
|
|
50431
|
-
'
|
|
50432
|
-
'
|
|
50433
|
-
'
|
|
50434
|
-
'
|
|
50435
|
-
'
|
|
50436
|
-
'
|
|
50437
|
-
'
|
|
50535
|
+
'40035': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.OrderNotFound,
|
|
50536
|
+
'40036': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InvalidOrder,
|
|
50537
|
+
'40037': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.OrderNotFound,
|
|
50538
|
+
'40038': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest,
|
|
50539
|
+
'40039': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest,
|
|
50540
|
+
'40040': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InvalidOrder,
|
|
50541
|
+
'40041': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InvalidOrder,
|
|
50542
|
+
'40042': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InvalidOrder,
|
|
50543
|
+
'40043': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InvalidOrder,
|
|
50544
|
+
'40044': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InvalidOrder,
|
|
50545
|
+
'40045': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InvalidOrder,
|
|
50546
|
+
'40046': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.PermissionDenied,
|
|
50547
|
+
'40047': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.PermissionDenied,
|
|
50548
|
+
'40048': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest,
|
|
50549
|
+
'40049': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadRequest,
|
|
50550
|
+
'40050': _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.InvalidOrder, // 403, Client OrderId duplicated with existing orders
|
|
50438
50551
|
},
|
|
50439
50552
|
'broad': {},
|
|
50440
50553
|
},
|
|
@@ -72711,7 +72824,7 @@ class bl3p extends _abstract_bl3p_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
72711
72824
|
const response = await this.privatePostGENMKTMoneyInfo(params);
|
|
72712
72825
|
return this.parseBalance(response);
|
|
72713
72826
|
}
|
|
72714
|
-
parseBidAsk(bidask, priceKey = 0, amountKey = 1) {
|
|
72827
|
+
parseBidAsk(bidask, priceKey = 0, amountKey = 1, countOrIdKey = 2) {
|
|
72715
72828
|
const price = this.safeString(bidask, priceKey);
|
|
72716
72829
|
const size = this.safeString(bidask, amountKey);
|
|
72717
72830
|
return [
|
|
@@ -74550,7 +74663,7 @@ class btcalpha extends _abstract_btcalpha_js__WEBPACK_IMPORTED_MODULE_0__/* ["de
|
|
|
74550
74663
|
const response = await this.publicGetOrderbookPairName(this.extend(request, params));
|
|
74551
74664
|
return this.parseOrderBook(response, market['symbol'], undefined, 'buy', 'sell', 'price', 'amount');
|
|
74552
74665
|
}
|
|
74553
|
-
parseBidsAsks(bidasks, priceKey = 0, amountKey = 1) {
|
|
74666
|
+
parseBidsAsks(bidasks, priceKey = 0, amountKey = 1, countOrIdKey = 2) {
|
|
74554
74667
|
const result = [];
|
|
74555
74668
|
for (let i = 0; i < bidasks.length; i++) {
|
|
74556
74669
|
const bidask = bidasks[i];
|
|
@@ -106496,6 +106609,7 @@ class cryptocom extends _abstract_cryptocom_js__WEBPACK_IMPORTED_MODULE_0__/* ["
|
|
|
106496
106609
|
// "p": "26386.00",
|
|
106497
106610
|
// "q": "0.00453",
|
|
106498
106611
|
// "t": 1686944282062,
|
|
106612
|
+
// "tn" : 1704476468851524373,
|
|
106499
106613
|
// "d": "4611686018455979970",
|
|
106500
106614
|
// "i": "BTC_USD"
|
|
106501
106615
|
// },
|
|
@@ -107666,7 +107780,8 @@ class cryptocom extends _abstract_cryptocom_js__WEBPACK_IMPORTED_MODULE_0__/* ["
|
|
|
107666
107780
|
// "s": "sell",
|
|
107667
107781
|
// "p": "26386.00",
|
|
107668
107782
|
// "q": "0.00453",
|
|
107669
|
-
// "
|
|
107783
|
+
// "tn": 1686944282062,
|
|
107784
|
+
// "tn": 1704476468851524373,
|
|
107670
107785
|
// "d": "4611686018455979970",
|
|
107671
107786
|
// "i": "BTC_USD"
|
|
107672
107787
|
// }
|
|
@@ -115756,27 +115871,18 @@ class deribit extends _abstract_deribit_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
115756
115871
|
* @param {string} symbol unified symbol of the market to create an order in
|
|
115757
115872
|
* @param {string} type 'market' or 'limit'
|
|
115758
115873
|
* @param {string} side 'buy' or 'sell'
|
|
115759
|
-
* @param {float} amount how much
|
|
115874
|
+
* @param {float} amount how much you want to trade in units of the base currency. For inverse perpetual and futures the amount is in the quote currency USD. For options it is in the underlying assets base currency.
|
|
115760
115875
|
* @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
|
|
115761
115876
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
115877
|
+
* @param {string} [params.trigger] the trigger type 'index_price', 'mark_price', or 'last_price', default is 'last_price'
|
|
115878
|
+
* @param {float} [params.trailingAmount] the quote amount to trail away from the current market price
|
|
115762
115879
|
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
115763
115880
|
*/
|
|
115764
115881
|
await this.loadMarkets();
|
|
115765
115882
|
const market = this.market(symbol);
|
|
115766
|
-
if (market['inverse']) {
|
|
115767
|
-
amount = this.amountToPrecision(symbol, amount);
|
|
115768
|
-
}
|
|
115769
|
-
else if (market['settle'] === 'USDC') {
|
|
115770
|
-
amount = this.amountToPrecision(symbol, amount);
|
|
115771
|
-
}
|
|
115772
|
-
else {
|
|
115773
|
-
amount = this.currencyToPrecision(symbol, amount);
|
|
115774
|
-
}
|
|
115775
115883
|
const request = {
|
|
115776
115884
|
'instrument_name': market['id'],
|
|
115777
|
-
|
|
115778
|
-
// for options it is in corresponding cryptocurrency contracts, e.g., BTC or ETH
|
|
115779
|
-
'amount': amount,
|
|
115885
|
+
'amount': this.amountToPrecision(symbol, amount),
|
|
115780
115886
|
'type': type, // limit, stop_limit, market, stop_market, default is limit
|
|
115781
115887
|
// 'label': 'string', // user-defined label for the order (maximum 64 characters)
|
|
115782
115888
|
// 'price': this.priceToPrecision (symbol, 123.45), // only for limit and stop_limit orders
|
|
@@ -115789,12 +115895,15 @@ class deribit extends _abstract_deribit_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
115789
115895
|
// 'trigger': 'index_price', // mark_price, last_price, required for stop_limit orders
|
|
115790
115896
|
// 'advanced': 'usd', // 'implv', advanced option order type, options only
|
|
115791
115897
|
};
|
|
115898
|
+
const trigger = this.safeString(params, 'trigger', 'last_price');
|
|
115792
115899
|
const timeInForce = this.safeStringUpper(params, 'timeInForce');
|
|
115793
115900
|
const reduceOnly = this.safeValue2(params, 'reduceOnly', 'reduce_only');
|
|
115794
115901
|
// only stop loss sell orders are allowed when price crossed from above
|
|
115795
115902
|
const stopLossPrice = this.safeValue(params, 'stopLossPrice');
|
|
115796
115903
|
// only take profit buy orders are allowed when price crossed from below
|
|
115797
115904
|
const takeProfitPrice = this.safeValue(params, 'takeProfitPrice');
|
|
115905
|
+
const trailingAmount = this.safeString2(params, 'trailingAmount', 'trigger_offset');
|
|
115906
|
+
const isTrailingAmountOrder = trailingAmount !== undefined;
|
|
115798
115907
|
const isStopLimit = type === 'stop_limit';
|
|
115799
115908
|
const isStopMarket = type === 'stop_market';
|
|
115800
115909
|
const isTakeLimit = type === 'take_limit';
|
|
@@ -115816,10 +115925,15 @@ class deribit extends _abstract_deribit_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
115816
115925
|
else {
|
|
115817
115926
|
request['type'] = 'market';
|
|
115818
115927
|
}
|
|
115819
|
-
if (
|
|
115928
|
+
if (isTrailingAmountOrder) {
|
|
115929
|
+
request['trigger'] = trigger;
|
|
115930
|
+
request['type'] = 'trailing_stop';
|
|
115931
|
+
request['trigger_offset'] = this.parseToNumeric(trailingAmount);
|
|
115932
|
+
}
|
|
115933
|
+
else if (isStopOrder) {
|
|
115820
115934
|
const triggerPrice = (stopLossPrice !== undefined) ? stopLossPrice : takeProfitPrice;
|
|
115821
115935
|
request['trigger_price'] = this.priceToPrecision(symbol, triggerPrice);
|
|
115822
|
-
request['trigger'] =
|
|
115936
|
+
request['trigger'] = trigger;
|
|
115823
115937
|
if (isStopLossOrder) {
|
|
115824
115938
|
if (isMarketOrder) {
|
|
115825
115939
|
// stop_market (sell only)
|
|
@@ -115859,7 +115973,7 @@ class deribit extends _abstract_deribit_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
115859
115973
|
request['time_in_force'] = 'fill_or_kill';
|
|
115860
115974
|
}
|
|
115861
115975
|
}
|
|
115862
|
-
params = this.omit(params, ['timeInForce', 'stopLossPrice', 'takeProfitPrice', 'postOnly', 'reduceOnly']);
|
|
115976
|
+
params = this.omit(params, ['timeInForce', 'stopLossPrice', 'takeProfitPrice', 'postOnly', 'reduceOnly', 'trailingAmount']);
|
|
115863
115977
|
let response = undefined;
|
|
115864
115978
|
if (this.capitalize(side) === 'Buy') {
|
|
115865
115979
|
response = await this.privateGetBuy(this.extend(request, params));
|
|
@@ -115926,25 +116040,43 @@ class deribit extends _abstract_deribit_js__WEBPACK_IMPORTED_MODULE_0__/* ["defa
|
|
|
115926
116040
|
return this.parseOrder(order, market);
|
|
115927
116041
|
}
|
|
115928
116042
|
async editOrder(id, symbol, type, side, amount = undefined, price = undefined, params = {}) {
|
|
116043
|
+
/**
|
|
116044
|
+
* @method
|
|
116045
|
+
* @name deribit#editOrder
|
|
116046
|
+
* @description edit a trade order
|
|
116047
|
+
* @see https://docs.deribit.com/#private-edit
|
|
116048
|
+
* @param {string} id edit order id
|
|
116049
|
+
* @param {string} [symbol] unified symbol of the market to edit an order in
|
|
116050
|
+
* @param {string} [type] 'market' or 'limit'
|
|
116051
|
+
* @param {string} [side] 'buy' or 'sell'
|
|
116052
|
+
* @param {float} amount how much you want to trade in units of the base currency, inverse swap and future use the quote currency
|
|
116053
|
+
* @param {float} [price] the price at which the order is to be fullfilled, in units of the base currency, ignored in market orders
|
|
116054
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
116055
|
+
* @param {float} [params.trailingAmount] the quote amount to trail away from the current market price
|
|
116056
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
116057
|
+
*/
|
|
115929
116058
|
if (amount === undefined) {
|
|
115930
116059
|
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ArgumentsRequired(this.id + ' editOrder() requires an amount argument');
|
|
115931
116060
|
}
|
|
115932
|
-
if (price === undefined) {
|
|
115933
|
-
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ArgumentsRequired(this.id + ' editOrder() requires a price argument');
|
|
115934
|
-
}
|
|
115935
116061
|
await this.loadMarkets();
|
|
115936
116062
|
const request = {
|
|
115937
116063
|
'order_id': id,
|
|
115938
|
-
// for perpetual and futures the amount is in USD
|
|
115939
|
-
// for options it is in corresponding cryptocurrency contracts, e.g., BTC or ETH
|
|
115940
116064
|
'amount': this.amountToPrecision(symbol, amount),
|
|
115941
|
-
'price': this.priceToPrecision(symbol, price), // required
|
|
115942
116065
|
// 'post_only': false, // if the new price would cause the order to be filled immediately (as taker), the price will be changed to be just below the spread.
|
|
115943
116066
|
// 'reject_post_only': false, // if true the order is put to order book unmodified or request is rejected
|
|
115944
116067
|
// 'reduce_only': false, // if true, the order is intended to only reduce a current position
|
|
115945
116068
|
// 'stop_price': false, // stop price, required for stop_limit orders
|
|
115946
116069
|
// 'advanced': 'usd', // 'implv', advanced option order type, options only
|
|
115947
116070
|
};
|
|
116071
|
+
if (price !== undefined) {
|
|
116072
|
+
request['price'] = this.priceToPrecision(symbol, price);
|
|
116073
|
+
}
|
|
116074
|
+
const trailingAmount = this.safeString2(params, 'trailingAmount', 'trigger_offset');
|
|
116075
|
+
const isTrailingAmountOrder = trailingAmount !== undefined;
|
|
116076
|
+
if (isTrailingAmountOrder) {
|
|
116077
|
+
request['trigger_offset'] = this.parseToNumeric(trailingAmount);
|
|
116078
|
+
params = this.omit(params, 'trigger_offset');
|
|
116079
|
+
}
|
|
115948
116080
|
const response = await this.privateGetEdit(this.extend(request, params));
|
|
115949
116081
|
const result = this.safeValue(response, 'result', {});
|
|
115950
116082
|
const order = this.safeValue(result, 'order');
|
|
@@ -154205,7 +154337,7 @@ class kraken extends _abstract_kraken_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
154205
154337
|
'tierBased': true,
|
|
154206
154338
|
};
|
|
154207
154339
|
}
|
|
154208
|
-
parseBidAsk(bidask, priceKey = 0, amountKey = 1) {
|
|
154340
|
+
parseBidAsk(bidask, priceKey = 0, amountKey = 1, countOrIdKey = 2) {
|
|
154209
154341
|
const price = this.safeNumber(bidask, priceKey);
|
|
154210
154342
|
const amount = this.safeNumber(bidask, amountKey);
|
|
154211
154343
|
const timestamp = this.safeInteger(bidask, 2);
|
|
@@ -161161,7 +161293,7 @@ class kucoin extends _abstract_kucoin_js__WEBPACK_IMPORTED_MODULE_0__/* ["defaul
|
|
|
161161
161293
|
// }
|
|
161162
161294
|
// }
|
|
161163
161295
|
const responseData = this.safeValue(response, 'data', {});
|
|
161164
|
-
const orders = this.safeValue(responseData, 'items',
|
|
161296
|
+
const orders = this.safeValue(responseData, 'items', responseData);
|
|
161165
161297
|
return this.parseOrders(orders, market, since, limit);
|
|
161166
161298
|
}
|
|
161167
161299
|
async fetchClosedOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
@@ -174366,7 +174498,7 @@ class lykke extends _abstract_lykke_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"
|
|
|
174366
174498
|
//
|
|
174367
174499
|
return this.parseTrades(payload, market, since, limit);
|
|
174368
174500
|
}
|
|
174369
|
-
parseBidAsk(bidask, priceKey = 0, amountKey = 1) {
|
|
174501
|
+
parseBidAsk(bidask, priceKey = 0, amountKey = 1, countOrIdKey = 2) {
|
|
174370
174502
|
const price = this.safeString(bidask, priceKey);
|
|
174371
174503
|
const amount = _base_Precise_js__WEBPACK_IMPORTED_MODULE_3__/* .Precise */ .O.stringAbs(this.safeString(bidask, amountKey));
|
|
174372
174504
|
return [this.parseNumber(price), this.parseNumber(amount)];
|
|
@@ -181443,7 +181575,7 @@ class ndax extends _abstract_ndax_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
181443
181575
|
'info': market,
|
|
181444
181576
|
};
|
|
181445
181577
|
}
|
|
181446
|
-
parseOrderBook(orderbook, symbol, timestamp = undefined, bidsKey = 'bids', asksKey = 'asks', priceKey = 6, amountKey = 8) {
|
|
181578
|
+
parseOrderBook(orderbook, symbol, timestamp = undefined, bidsKey = 'bids', asksKey = 'asks', priceKey = 6, amountKey = 8, countOrIdKey = 2) {
|
|
181447
181579
|
let nonce = undefined;
|
|
181448
181580
|
const result = {
|
|
181449
181581
|
'symbol': symbol,
|
|
@@ -209728,7 +209860,10 @@ class binance extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
209728
209860
|
name = this.safeString(params, 'name', name);
|
|
209729
209861
|
params = this.omit(params, 'name');
|
|
209730
209862
|
let wsParams = [];
|
|
209731
|
-
|
|
209863
|
+
let messageHash = 'tickers';
|
|
209864
|
+
if (symbols !== undefined) {
|
|
209865
|
+
messageHash = 'tickers::' + symbols.join(',');
|
|
209866
|
+
}
|
|
209732
209867
|
if (name === 'bookTicker') {
|
|
209733
209868
|
if (marketIds === undefined) {
|
|
209734
209869
|
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ArgumentsRequired(this.id + ' watchTickers() requires symbols for bookTicker');
|
|
@@ -209921,6 +210056,19 @@ class binance extends _binance_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
209921
210056
|
this.tickers[symbol] = result;
|
|
209922
210057
|
newTickers.push(result);
|
|
209923
210058
|
}
|
|
210059
|
+
const messageHashes = this.findMessageHashes(client, 'tickers::');
|
|
210060
|
+
for (let i = 0; i < messageHashes.length; i++) {
|
|
210061
|
+
const messageHash = messageHashes[i];
|
|
210062
|
+
const parts = messageHash.split('::');
|
|
210063
|
+
const symbolsString = parts[1];
|
|
210064
|
+
const symbols = symbolsString.split(',');
|
|
210065
|
+
const tickers = this.filterByArray(newTickers, 'symbol', symbols);
|
|
210066
|
+
const tickersSymbols = Object.keys(tickers);
|
|
210067
|
+
const numTickers = tickersSymbols.length;
|
|
210068
|
+
if (numTickers > 0) {
|
|
210069
|
+
client.resolve(tickers, messageHash);
|
|
210070
|
+
}
|
|
210071
|
+
}
|
|
209924
210072
|
client.resolve(newTickers, 'tickers');
|
|
209925
210073
|
}
|
|
209926
210074
|
signParams(params = {}) {
|
|
@@ -214735,7 +214883,9 @@ class bitget extends _bitget_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z
|
|
|
214735
214883
|
}
|
|
214736
214884
|
const tickers = await this.watchPublicMultiple(messageHashes, topics, params);
|
|
214737
214885
|
if (this.newUpdates) {
|
|
214738
|
-
|
|
214886
|
+
const result = {};
|
|
214887
|
+
result[tickers['symbol']] = tickers;
|
|
214888
|
+
return result;
|
|
214739
214889
|
}
|
|
214740
214890
|
return this.filterByArray(this.tickers, 'symbol', symbols);
|
|
214741
214891
|
}
|
|
@@ -216613,22 +216763,39 @@ class bitmart extends _bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
216613
216763
|
const market = this.getMarketFromSymbols(symbols);
|
|
216614
216764
|
let type = 'spot';
|
|
216615
216765
|
[type, params] = this.handleMarketTypeAndParams('watchTickers', market, params);
|
|
216766
|
+
const url = this.implodeHostname(this.urls['api']['ws'][type]['public']);
|
|
216616
216767
|
symbols = this.marketSymbols(symbols);
|
|
216617
|
-
|
|
216618
|
-
|
|
216768
|
+
let messageHash = 'tickers::' + type;
|
|
216769
|
+
if (symbols !== undefined) {
|
|
216770
|
+
messageHash += '::' + symbols.join(',');
|
|
216619
216771
|
}
|
|
216620
|
-
|
|
216621
|
-
|
|
216622
|
-
|
|
216772
|
+
let request = undefined;
|
|
216773
|
+
let tickers = undefined;
|
|
216774
|
+
const isSpot = (type === 'spot');
|
|
216775
|
+
if (isSpot) {
|
|
216776
|
+
if (symbols === undefined) {
|
|
216777
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.ArgumentsRequired(this.id + ' watchTickers() for ' + type + ' market type requires symbols argument to be provided');
|
|
216778
|
+
}
|
|
216779
|
+
const marketIds = this.marketIds(symbols);
|
|
216780
|
+
const finalArray = [];
|
|
216781
|
+
for (let i = 0; i < marketIds.length; i++) {
|
|
216782
|
+
finalArray.push('spot/ticker:' + marketIds[i]);
|
|
216783
|
+
}
|
|
216784
|
+
request = {
|
|
216785
|
+
'op': 'subscribe',
|
|
216786
|
+
'args': finalArray,
|
|
216787
|
+
};
|
|
216788
|
+
tickers = await this.watch(url, messageHash, this.deepExtend(request, params), messageHash);
|
|
216789
|
+
}
|
|
216790
|
+
else {
|
|
216791
|
+
request = {
|
|
216792
|
+
'action': 'subscribe',
|
|
216793
|
+
'args': ['futures/ticker'],
|
|
216794
|
+
};
|
|
216795
|
+
tickers = await this.watch(url, messageHash, this.deepExtend(request, params), messageHash);
|
|
216623
216796
|
}
|
|
216624
|
-
const messageHash = 'tickers';
|
|
216625
|
-
const request = {
|
|
216626
|
-
'action': 'subscribe',
|
|
216627
|
-
'args': ['futures/ticker'],
|
|
216628
|
-
};
|
|
216629
|
-
const newTickers = await this.watch(url, messageHash, this.deepExtend(request, params), messageHash);
|
|
216630
216797
|
if (this.newUpdates) {
|
|
216631
|
-
return
|
|
216798
|
+
return tickers;
|
|
216632
216799
|
}
|
|
216633
216800
|
return this.filterByArray(this.tickers, 'symbol', symbols);
|
|
216634
216801
|
}
|
|
@@ -217027,7 +217194,7 @@ class bitmart extends _bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
217027
217194
|
// }
|
|
217028
217195
|
//
|
|
217029
217196
|
const marketId = this.safeString(position, 'symbol');
|
|
217030
|
-
market = this.safeMarket(marketId, market,
|
|
217197
|
+
market = this.safeMarket(marketId, market, undefined, 'swap');
|
|
217031
217198
|
const symbol = market['symbol'];
|
|
217032
217199
|
const openTimestamp = this.safeInteger(position, 'create_time');
|
|
217033
217200
|
const timestamp = this.safeInteger(position, 'update_time');
|
|
@@ -217213,16 +217380,36 @@ class bitmart extends _bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
217213
217380
|
const messageHash = table + ':' + marketId;
|
|
217214
217381
|
this.tickers[symbol] = ticker;
|
|
217215
217382
|
client.resolve(ticker, messageHash);
|
|
217383
|
+
this.resolveMessageHashesForSymbol(client, symbol, ticker, 'tickers::');
|
|
217216
217384
|
}
|
|
217217
217385
|
}
|
|
217218
217386
|
else {
|
|
217387
|
+
// on each update for contract markets, single ticker is provided
|
|
217219
217388
|
const ticker = this.parseWsSwapTicker(data);
|
|
217220
217389
|
const symbol = this.safeString(ticker, 'symbol');
|
|
217221
217390
|
this.tickers[symbol] = ticker;
|
|
217222
|
-
client.resolve(ticker, 'tickers');
|
|
217391
|
+
client.resolve(ticker, 'tickers::swap');
|
|
217392
|
+
this.resolveMessageHashesForSymbol(client, symbol, ticker, 'tickers::');
|
|
217223
217393
|
}
|
|
217224
217394
|
return message;
|
|
217225
217395
|
}
|
|
217396
|
+
resolveMessageHashesForSymbol(client, symbol, result, prexif) {
|
|
217397
|
+
const prefixSeparator = '::';
|
|
217398
|
+
const symbolsSeparator = ',';
|
|
217399
|
+
const messageHashes = this.findMessageHashes(client, prexif);
|
|
217400
|
+
for (let i = 0; i < messageHashes.length; i++) {
|
|
217401
|
+
const messageHash = messageHashes[i];
|
|
217402
|
+
const parts = messageHash.split(prefixSeparator);
|
|
217403
|
+
const length = parts.length;
|
|
217404
|
+
const symbolsString = parts[length - 1];
|
|
217405
|
+
const symbols = symbolsString.split(symbolsSeparator);
|
|
217406
|
+
if (this.inArray(symbol, symbols)) {
|
|
217407
|
+
const response = {};
|
|
217408
|
+
response[symbol] = result;
|
|
217409
|
+
client.resolve(response, messageHash);
|
|
217410
|
+
}
|
|
217411
|
+
}
|
|
217412
|
+
}
|
|
217226
217413
|
parseWsSwapTicker(ticker, market = undefined) {
|
|
217227
217414
|
//
|
|
217228
217415
|
// {
|
|
@@ -217369,7 +217556,7 @@ class bitmart extends _bitmart_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */
|
|
|
217369
217556
|
}
|
|
217370
217557
|
else {
|
|
217371
217558
|
const marketId = this.safeString(data, 'symbol');
|
|
217372
|
-
const market = this.safeMarket(marketId, undefined,
|
|
217559
|
+
const market = this.safeMarket(marketId, undefined, undefined, 'swap');
|
|
217373
217560
|
const symbol = market['symbol'];
|
|
217374
217561
|
const items = this.safeValue(data, 'items', []);
|
|
217375
217562
|
this.ohlcvs[symbol] = this.safeValue(this.ohlcvs, symbol, {});
|
|
@@ -223482,7 +223669,7 @@ class blockchaincom extends _blockchaincom_js__WEBPACK_IMPORTED_MODULE_0__/* ["d
|
|
|
223482
223669
|
return message;
|
|
223483
223670
|
}
|
|
223484
223671
|
else if (event === 'snapshot') {
|
|
223485
|
-
const snapshot = this.
|
|
223672
|
+
const snapshot = this.parseOrderBook(message, symbol, timestamp, 'bids', 'asks', 'px', 'qty', 'num');
|
|
223486
223673
|
storedOrderBook.reset(snapshot);
|
|
223487
223674
|
}
|
|
223488
223675
|
else if (event === 'updated') {
|
|
@@ -223498,34 +223685,8 @@ class blockchaincom extends _blockchaincom_js__WEBPACK_IMPORTED_MODULE_0__/* ["d
|
|
|
223498
223685
|
}
|
|
223499
223686
|
client.resolve(storedOrderBook, messageHash);
|
|
223500
223687
|
}
|
|
223501
|
-
parseCountedBidAsk(bidAsk, priceKey = 0, amountKey = 1, countKey = 2) {
|
|
223502
|
-
const price = this.safeNumber(bidAsk, priceKey);
|
|
223503
|
-
const amount = this.safeNumber(bidAsk, amountKey);
|
|
223504
|
-
const count = this.safeNumber(bidAsk, countKey);
|
|
223505
|
-
return [price, amount, count];
|
|
223506
|
-
}
|
|
223507
|
-
parseCountedBidsAsks(bidasks, priceKey = 0, amountKey = 1, countKey = 2) {
|
|
223508
|
-
bidasks = this.toArray(bidasks);
|
|
223509
|
-
const result = [];
|
|
223510
|
-
for (let i = 0; i < bidasks.length; i++) {
|
|
223511
|
-
result.push(this.parseCountedBidAsk(bidasks[i], priceKey, amountKey, countKey));
|
|
223512
|
-
}
|
|
223513
|
-
return result;
|
|
223514
|
-
}
|
|
223515
|
-
parseCountedOrderBook(orderbook, symbol, timestamp = undefined, bidsKey = 'bids', asksKey = 'asks', priceKey = 0, amountKey = 1, countKey = 2) {
|
|
223516
|
-
const bids = this.parseCountedBidsAsks(this.safeValue(orderbook, bidsKey, []), priceKey, amountKey, countKey);
|
|
223517
|
-
const asks = this.parseCountedBidsAsks(this.safeValue(orderbook, asksKey, []), priceKey, amountKey, countKey);
|
|
223518
|
-
return {
|
|
223519
|
-
'symbol': symbol,
|
|
223520
|
-
'bids': this.sortBy(bids, 0, true),
|
|
223521
|
-
'asks': this.sortBy(asks, 0),
|
|
223522
|
-
'timestamp': timestamp,
|
|
223523
|
-
'datetime': this.iso8601(timestamp),
|
|
223524
|
-
'nonce': undefined,
|
|
223525
|
-
};
|
|
223526
|
-
}
|
|
223527
223688
|
handleDelta(bookside, delta) {
|
|
223528
|
-
const bookArray = this.
|
|
223689
|
+
const bookArray = this.parseBidAsk(delta, 'px', 'qty', 'num');
|
|
223529
223690
|
bookside.storeArray(bookArray);
|
|
223530
223691
|
}
|
|
223531
223692
|
handleDeltas(bookside, deltas) {
|
|
@@ -223838,7 +223999,9 @@ class bybit extends _bybit_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
223838
223999
|
}
|
|
223839
224000
|
const ticker = await this.watchTopics(url, messageHashes, topics, params);
|
|
223840
224001
|
if (this.newUpdates) {
|
|
223841
|
-
|
|
224002
|
+
const result = {};
|
|
224003
|
+
result[ticker['symbol']] = ticker;
|
|
224004
|
+
return result;
|
|
223842
224005
|
}
|
|
223843
224006
|
return this.filterByArray(this.tickers, 'symbol', symbols);
|
|
223844
224007
|
}
|
|
@@ -227642,7 +227805,7 @@ class coinbasepro extends _coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/* ["defau
|
|
|
227642
227805
|
const symbol = symbols[i];
|
|
227643
227806
|
market = this.market(symbol);
|
|
227644
227807
|
productIds.push(market['id']);
|
|
227645
|
-
messageHashes.push(messageHashStart + ':' + market['
|
|
227808
|
+
messageHashes.push(messageHashStart + ':' + market['symbol']);
|
|
227646
227809
|
}
|
|
227647
227810
|
let url = this.urls['api']['ws'];
|
|
227648
227811
|
if ('signature' in params) {
|
|
@@ -227687,10 +227850,12 @@ class coinbasepro extends _coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/* ["defau
|
|
|
227687
227850
|
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_2__.BadSymbol(this.id + ' watchTickers requires a non-empty symbols array');
|
|
227688
227851
|
}
|
|
227689
227852
|
const channel = 'ticker';
|
|
227690
|
-
const messageHash = '
|
|
227691
|
-
const
|
|
227853
|
+
const messageHash = 'ticker';
|
|
227854
|
+
const ticker = await this.subscribeMultiple(channel, symbols, messageHash, params);
|
|
227692
227855
|
if (this.newUpdates) {
|
|
227693
|
-
|
|
227856
|
+
const result = {};
|
|
227857
|
+
result[ticker['symbol']] = ticker;
|
|
227858
|
+
return result;
|
|
227694
227859
|
}
|
|
227695
227860
|
return this.filterByArray(this.tickers, 'symbol', symbols);
|
|
227696
227861
|
}
|
|
@@ -228302,19 +228467,10 @@ class coinbasepro extends _coinbasepro_js__WEBPACK_IMPORTED_MODULE_0__/* ["defau
|
|
|
228302
228467
|
const ticker = this.parseTicker(message);
|
|
228303
228468
|
const symbol = ticker['symbol'];
|
|
228304
228469
|
this.tickers[symbol] = ticker;
|
|
228305
|
-
const
|
|
228306
|
-
const
|
|
228470
|
+
const messageHash = 'ticker:' + symbol;
|
|
228471
|
+
const idMessageHash = 'ticker:' + marketId;
|
|
228307
228472
|
client.resolve(ticker, messageHash);
|
|
228308
|
-
|
|
228309
|
-
for (let i = 0; i < messageHashes.length; i++) {
|
|
228310
|
-
const currentMessageHash = messageHashes[i];
|
|
228311
|
-
const parts = currentMessageHash.split('::');
|
|
228312
|
-
const symbolsString = parts[1];
|
|
228313
|
-
const symbols = symbolsString.split(',');
|
|
228314
|
-
if (this.inArray(symbol, symbols)) {
|
|
228315
|
-
client.resolve(ticker, currentMessageHash);
|
|
228316
|
-
}
|
|
228317
|
-
}
|
|
228473
|
+
client.resolve(ticker, idMessageHash);
|
|
228318
228474
|
}
|
|
228319
228475
|
return message;
|
|
228320
228476
|
}
|
|
@@ -229714,6 +229870,8 @@ class cryptocom extends _cryptocom_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
229714
229870
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
229715
229871
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
229716
229872
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
229873
|
+
* @param {string} [params.bookSubscriptionType] The subscription type. Allowed values: SNAPSHOT full snapshot. This is the default if not specified. SNAPSHOT_AND_UPDATE delta updates
|
|
229874
|
+
* @param {int} [params.bookUpdateFrequency] Book update interval in ms. Allowed values: 100 for snapshot subscription 10 for delta subscription
|
|
229717
229875
|
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
229718
229876
|
*/
|
|
229719
229877
|
return await this.watchOrderBookForSymbols([symbol], limit, params);
|
|
@@ -229727,6 +229885,8 @@ class cryptocom extends _cryptocom_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
229727
229885
|
* @param {string[]} symbols unified array of symbols
|
|
229728
229886
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
229729
229887
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
229888
|
+
* @param {string} [params.bookSubscriptionType] The subscription type. Allowed values: SNAPSHOT full snapshot. This is the default if not specified. SNAPSHOT_AND_UPDATE delta updates
|
|
229889
|
+
* @param {int} [params.bookUpdateFrequency] Book update interval in ms. Allowed values: 100 for snapshot subscription 10 for delta subscription
|
|
229730
229890
|
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
229731
229891
|
*/
|
|
229732
229892
|
await this.loadMarkets();
|
|
@@ -229734,12 +229894,26 @@ class cryptocom extends _cryptocom_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
229734
229894
|
const topics = [];
|
|
229735
229895
|
const messageHashes = [];
|
|
229736
229896
|
if (!limit) {
|
|
229737
|
-
limit =
|
|
229897
|
+
limit = 50;
|
|
229898
|
+
}
|
|
229899
|
+
const topicParams = this.safeValue(params, 'params');
|
|
229900
|
+
if (topicParams === undefined) {
|
|
229901
|
+
params['params'] = {};
|
|
229902
|
+
}
|
|
229903
|
+
let bookSubscriptionType = undefined;
|
|
229904
|
+
[bookSubscriptionType, params] = this.handleOptionAndParams2(params, 'watchOrderBook', 'watchOrderBookForSymbols', 'bookSubscriptionType', 'SNAPSHOT_AND_UPDATE');
|
|
229905
|
+
if (bookSubscriptionType !== undefined) {
|
|
229906
|
+
params['params']['bookSubscriptionType'] = bookSubscriptionType;
|
|
229907
|
+
}
|
|
229908
|
+
let bookUpdateFrequency = undefined;
|
|
229909
|
+
[bookUpdateFrequency, params] = this.handleOptionAndParams2(params, 'watchOrderBook', 'watchOrderBookForSymbols', 'bookUpdateFrequency');
|
|
229910
|
+
if (bookUpdateFrequency !== undefined) {
|
|
229911
|
+
params['params']['bookSubscriptionType'] = bookSubscriptionType;
|
|
229738
229912
|
}
|
|
229739
229913
|
for (let i = 0; i < symbols.length; i++) {
|
|
229740
229914
|
const symbol = symbols[i];
|
|
229741
229915
|
const market = this.market(symbol);
|
|
229742
|
-
const currentTopic = 'book' + '.' + market['id'] + '.' + limit;
|
|
229916
|
+
const currentTopic = 'book' + '.' + market['id'] + '.' + limit.toString();
|
|
229743
229917
|
const messageHash = 'orderbook:' + market['symbol'];
|
|
229744
229918
|
messageHashes.push(messageHash);
|
|
229745
229919
|
topics.push(currentTopic);
|
|
@@ -229747,27 +229921,72 @@ class cryptocom extends _cryptocom_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
229747
229921
|
const orderbook = await this.watchPublicMultiple(messageHashes, topics, params);
|
|
229748
229922
|
return orderbook.limit();
|
|
229749
229923
|
}
|
|
229750
|
-
|
|
229751
|
-
|
|
229924
|
+
handleDelta(bookside, delta) {
|
|
229925
|
+
const price = this.safeFloat(delta, 0);
|
|
229926
|
+
const amount = this.safeFloat(delta, 1);
|
|
229927
|
+
const count = this.safeInteger(delta, 2);
|
|
229928
|
+
bookside.store(price, amount, count);
|
|
229929
|
+
}
|
|
229930
|
+
handleDeltas(bookside, deltas) {
|
|
229931
|
+
for (let i = 0; i < deltas.length; i++) {
|
|
229932
|
+
this.handleDelta(bookside, deltas[i]);
|
|
229933
|
+
}
|
|
229934
|
+
}
|
|
229935
|
+
handleOrderBook(client, message) {
|
|
229752
229936
|
//
|
|
229753
|
-
//
|
|
229754
|
-
//
|
|
229755
|
-
//
|
|
229756
|
-
//
|
|
229757
|
-
//
|
|
229758
|
-
//
|
|
229759
|
-
//
|
|
229760
|
-
//
|
|
229761
|
-
//
|
|
229762
|
-
//
|
|
229763
|
-
//
|
|
229764
|
-
//
|
|
229765
|
-
//
|
|
229766
|
-
//
|
|
229767
|
-
//
|
|
229768
|
-
//
|
|
229769
|
-
//
|
|
229770
|
-
//
|
|
229937
|
+
// snapshot
|
|
229938
|
+
// {
|
|
229939
|
+
// "instrument_name":"LTC_USDT",
|
|
229940
|
+
// "subscription":"book.LTC_USDT.150",
|
|
229941
|
+
// "channel":"book",
|
|
229942
|
+
// "depth":150,
|
|
229943
|
+
// "data": [
|
|
229944
|
+
// {
|
|
229945
|
+
// "bids": [
|
|
229946
|
+
// [122.21, 0.74041, 4]
|
|
229947
|
+
// ],
|
|
229948
|
+
// "asks": [
|
|
229949
|
+
// [122.29, 0.00002, 1]
|
|
229950
|
+
// ]
|
|
229951
|
+
// "t": 1648123943803,
|
|
229952
|
+
// "s":754560122
|
|
229953
|
+
// }
|
|
229954
|
+
// ]
|
|
229955
|
+
// }
|
|
229956
|
+
// update
|
|
229957
|
+
// {
|
|
229958
|
+
// "instrument_name":"BTC_USDT",
|
|
229959
|
+
// "subscription":"book.BTC_USDT.50",
|
|
229960
|
+
// "channel":"book.update",
|
|
229961
|
+
// "depth":50,
|
|
229962
|
+
// "data":[
|
|
229963
|
+
// {
|
|
229964
|
+
// "update":{
|
|
229965
|
+
// "asks":[
|
|
229966
|
+
// [
|
|
229967
|
+
// "43755.46",
|
|
229968
|
+
// "0.10000",
|
|
229969
|
+
// "1"
|
|
229970
|
+
// ],
|
|
229971
|
+
// ...
|
|
229972
|
+
// ],
|
|
229973
|
+
// "bids":[
|
|
229974
|
+
// [
|
|
229975
|
+
// "43737.46",
|
|
229976
|
+
// "0.14096",
|
|
229977
|
+
// "1"
|
|
229978
|
+
// ],
|
|
229979
|
+
// ...
|
|
229980
|
+
// ]
|
|
229981
|
+
// },
|
|
229982
|
+
// "t":1704484068898,
|
|
229983
|
+
// "tt":1704484068892,
|
|
229984
|
+
// "u":78795598253024,
|
|
229985
|
+
// "pu":78795598162080,
|
|
229986
|
+
// "cs":-781431132
|
|
229987
|
+
// }
|
|
229988
|
+
// ]
|
|
229989
|
+
// }
|
|
229771
229990
|
//
|
|
229772
229991
|
const marketId = this.safeString(message, 'instrument_name');
|
|
229773
229992
|
const market = this.safeMarket(marketId);
|
|
@@ -229775,14 +229994,32 @@ class cryptocom extends _cryptocom_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
229775
229994
|
let data = this.safeValue(message, 'data');
|
|
229776
229995
|
data = this.safeValue(data, 0);
|
|
229777
229996
|
const timestamp = this.safeInteger(data, 't');
|
|
229778
|
-
const snapshot = this.parseOrderBook(data, symbol, timestamp);
|
|
229779
|
-
snapshot['nonce'] = this.safeInteger(data, 's');
|
|
229780
229997
|
let orderbook = this.safeValue(this.orderbooks, symbol);
|
|
229781
229998
|
if (orderbook === undefined) {
|
|
229782
229999
|
const limit = this.safeInteger(message, 'depth');
|
|
229783
|
-
orderbook = this.
|
|
230000
|
+
orderbook = this.countedOrderBook({}, limit);
|
|
229784
230001
|
}
|
|
229785
|
-
|
|
230002
|
+
const channel = this.safeString(message, 'channel');
|
|
230003
|
+
const nonce = this.safeInteger2(data, 'u', 's');
|
|
230004
|
+
let books = data;
|
|
230005
|
+
if (channel === 'book') { // snapshot
|
|
230006
|
+
orderbook.reset({});
|
|
230007
|
+
orderbook['symbol'] = symbol;
|
|
230008
|
+
orderbook['timestamp'] = timestamp;
|
|
230009
|
+
orderbook['datetime'] = this.iso8601(timestamp);
|
|
230010
|
+
orderbook['nonce'] = nonce;
|
|
230011
|
+
}
|
|
230012
|
+
else {
|
|
230013
|
+
books = this.safeValue(data, 'update', {});
|
|
230014
|
+
const previousNonce = this.safeInteger(data, 'pu');
|
|
230015
|
+
const currentNonce = orderbook['nonce'];
|
|
230016
|
+
if (currentNonce !== previousNonce) {
|
|
230017
|
+
throw new _base_errors_js__WEBPACK_IMPORTED_MODULE_1__.InvalidNonce(this.id + ' watchOrderBook() ' + symbol + ' ' + previousNonce + ' != ' + nonce);
|
|
230018
|
+
}
|
|
230019
|
+
}
|
|
230020
|
+
this.handleDeltas(orderbook['asks'], this.safeValue(books, 'asks', []));
|
|
230021
|
+
this.handleDeltas(orderbook['bids'], this.safeValue(books, 'bids', []));
|
|
230022
|
+
orderbook['nonce'] = nonce;
|
|
229786
230023
|
this.orderbooks[symbol] = orderbook;
|
|
229787
230024
|
const messageHash = 'orderbook:' + symbol;
|
|
229788
230025
|
client.resolve(orderbook, messageHash);
|
|
@@ -230404,7 +230641,7 @@ class cryptocom extends _cryptocom_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
230404
230641
|
},
|
|
230405
230642
|
'nonce': id,
|
|
230406
230643
|
};
|
|
230407
|
-
const message = this.
|
|
230644
|
+
const message = this.deepExtend(request, params);
|
|
230408
230645
|
return await this.watchMultiple(url, messageHashes, message, messageHashes);
|
|
230409
230646
|
}
|
|
230410
230647
|
async watchPrivateRequest(nonce, params = {}) {
|
|
@@ -230471,7 +230708,8 @@ class cryptocom extends _cryptocom_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"]
|
|
|
230471
230708
|
'candlestick': this.handleOHLCV,
|
|
230472
230709
|
'ticker': this.handleTicker,
|
|
230473
230710
|
'trade': this.handleTrades,
|
|
230474
|
-
'book': this.
|
|
230711
|
+
'book': this.handleOrderBook,
|
|
230712
|
+
'book.update': this.handleOrderBook,
|
|
230475
230713
|
'user.order': this.handleOrders,
|
|
230476
230714
|
'user.trade': this.handleTrades,
|
|
230477
230715
|
'user.balance': this.handleBalance,
|
|
@@ -245758,9 +245996,9 @@ class luno extends _luno_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
245758
245996
|
storedOrderBook['nonce'] = nonce;
|
|
245759
245997
|
client.resolve(storedOrderBook, messageHash);
|
|
245760
245998
|
}
|
|
245761
|
-
customParseOrderBook(orderbook, symbol, timestamp = undefined, bidsKey = 'bids', asksKey = 'asks', priceKey = 'price', amountKey = 'volume',
|
|
245762
|
-
const bids = this.parseBidsAsks(this.safeValue(orderbook, bidsKey, []), priceKey, amountKey,
|
|
245763
|
-
const asks = this.parseBidsAsks(this.safeValue(orderbook, asksKey, []), priceKey, amountKey,
|
|
245999
|
+
customParseOrderBook(orderbook, symbol, timestamp = undefined, bidsKey = 'bids', asksKey = 'asks', priceKey = 'price', amountKey = 'volume', countOrIdKey = 2) {
|
|
246000
|
+
const bids = this.parseBidsAsks(this.safeValue(orderbook, bidsKey, []), priceKey, amountKey, countOrIdKey);
|
|
246001
|
+
const asks = this.parseBidsAsks(this.safeValue(orderbook, asksKey, []), priceKey, amountKey, countOrIdKey);
|
|
245764
246002
|
return {
|
|
245765
246003
|
'symbol': symbol,
|
|
245766
246004
|
'bids': this.sortBy(bids, 0, true),
|
|
@@ -245770,7 +246008,7 @@ class luno extends _luno_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
245770
246008
|
'nonce': undefined,
|
|
245771
246009
|
};
|
|
245772
246010
|
}
|
|
245773
|
-
parseBidsAsks(bidasks, priceKey = 'price', amountKey = 'volume', thirdKey =
|
|
246011
|
+
parseBidsAsks(bidasks, priceKey = 'price', amountKey = 'volume', thirdKey = 2) {
|
|
245774
246012
|
bidasks = this.toArray(bidasks);
|
|
245775
246013
|
const result = [];
|
|
245776
246014
|
for (let i = 0; i < bidasks.length; i++) {
|
|
@@ -245778,7 +246016,7 @@ class luno extends _luno_js__WEBPACK_IMPORTED_MODULE_0__/* ["default"] */ .Z {
|
|
|
245778
246016
|
}
|
|
245779
246017
|
return result;
|
|
245780
246018
|
}
|
|
245781
|
-
customParseBidAsk(bidask, priceKey = 'price', amountKey = 'volume', thirdKey =
|
|
246019
|
+
customParseBidAsk(bidask, priceKey = 'price', amountKey = 'volume', thirdKey = 2) {
|
|
245782
246020
|
const price = this.safeNumber(bidask, priceKey);
|
|
245783
246021
|
const amount = this.safeNumber(bidask, amountKey);
|
|
245784
246022
|
const result = [price, amount];
|
|
@@ -292003,7 +292241,7 @@ SOFTWARE.
|
|
|
292003
292241
|
|
|
292004
292242
|
//-----------------------------------------------------------------------------
|
|
292005
292243
|
// this is updated by vss.js when building
|
|
292006
|
-
const version = '4.2.
|
|
292244
|
+
const version = '4.2.10';
|
|
292007
292245
|
_src_base_Exchange_js__WEBPACK_IMPORTED_MODULE_0__/* .Exchange */ .e.ccxtVersion = version;
|
|
292008
292246
|
//-----------------------------------------------------------------------------
|
|
292009
292247
|
|