ccxt 4.2.28 → 4.2.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CONTRIBUTING.md +4 -1
- package/README.md +6 -6
- package/dist/ccxt.browser.js +1865 -558
- package/dist/ccxt.browser.min.js +7 -7
- package/dist/cjs/ccxt.js +3 -1
- package/dist/cjs/src/ascendex.js +5 -5
- package/dist/cjs/src/base/Exchange.js +114 -21
- package/dist/cjs/src/base/errors.js +3 -3
- package/dist/cjs/src/base/functions/type.js +12 -0
- package/dist/cjs/src/bigone.js +2 -2
- package/dist/cjs/src/binance.js +896 -217
- package/dist/cjs/src/bingx.js +1 -1
- package/dist/cjs/src/bitfinex.js +1 -1
- package/dist/cjs/src/bitfinex2.js +52 -62
- package/dist/cjs/src/bitget.js +8 -4
- package/dist/cjs/src/bitmart.js +3 -3
- package/dist/cjs/src/bitmex.js +9 -6
- package/dist/cjs/src/bitrue.js +1 -1
- package/dist/cjs/src/bitso.js +1 -1
- package/dist/cjs/src/bitteam.js +2 -2
- package/dist/cjs/src/btcalpha.js +1 -1
- package/dist/cjs/src/bybit.js +28 -12
- package/dist/cjs/src/coinbase.js +12 -5
- package/dist/cjs/src/coincheck.js +1 -1
- package/dist/cjs/src/coinex.js +2 -2
- package/dist/cjs/src/coinlist.js +1 -1
- package/dist/cjs/src/coinmate.js +1 -1
- package/dist/cjs/src/coinmetro.js +12 -6
- package/dist/cjs/src/coinsph.js +1 -1
- package/dist/cjs/src/cryptocom.js +3 -3
- package/dist/cjs/src/digifinex.js +6 -4
- package/dist/cjs/src/exmo.js +2 -2
- package/dist/cjs/src/gate.js +5 -5
- package/dist/cjs/src/gemini.js +3 -3
- package/dist/cjs/src/hitbtc.js +14 -20
- package/dist/cjs/src/hollaex.js +2 -2
- package/dist/cjs/src/htx.js +5 -5
- package/dist/cjs/src/huobijp.js +1 -1
- package/dist/cjs/src/krakenfutures.js +1 -1
- package/dist/cjs/src/kucoin.js +17 -17
- package/dist/cjs/src/kucoinfutures.js +3 -3
- package/dist/cjs/src/lbank.js +1 -1
- package/dist/cjs/src/mexc.js +7 -7
- package/dist/cjs/src/novadax.js +1 -1
- package/dist/cjs/src/okcoin.js +2 -2
- package/dist/cjs/src/okx.js +24 -10
- package/dist/cjs/src/p2b.js +1 -0
- package/dist/cjs/src/phemex.js +3 -3
- package/dist/cjs/src/poloniexfutures.js +3 -3
- package/dist/cjs/src/pro/alpaca.js +1 -1
- package/dist/cjs/src/pro/binance.js +4 -4
- package/dist/cjs/src/pro/bitget.js +1 -1
- package/dist/cjs/src/pro/bitmart.js +1 -1
- package/dist/cjs/src/pro/bitmex.js +49 -6
- package/dist/cjs/src/pro/bitvavo.js +1 -1
- package/dist/cjs/src/pro/bybit.js +2 -2
- package/dist/cjs/src/pro/cex.js +2 -2
- package/dist/cjs/src/pro/coinbase.js +1 -1
- package/dist/cjs/src/pro/independentreserve.js +1 -1
- package/dist/cjs/src/pro/okx.js +1 -1
- package/dist/cjs/src/pro/onetrading.js +2 -2
- package/dist/cjs/src/pro/p2b.js +432 -0
- package/dist/cjs/src/pro/probit.js +5 -5
- package/dist/cjs/src/pro/whitebit.js +1 -1
- package/dist/cjs/src/probit.js +1 -1
- package/dist/cjs/src/timex.js +1 -1
- package/dist/cjs/src/tokocrypto.js +3 -3
- package/dist/cjs/src/wavesexchange.js +2 -2
- package/dist/cjs/src/whitebit.js +2 -2
- package/dist/cjs/src/woo.js +3 -3
- package/dist/cjs/src/yobit.js +1 -1
- package/dist/cjs/src/zaif.js +1 -1
- package/dist/cjs/src/zonda.js +3 -3
- package/js/ccxt.d.ts +4 -1
- package/js/ccxt.js +3 -1
- package/js/src/abstract/bybit.d.ts +2 -2
- package/js/src/abstract/okx.d.ts +1 -0
- package/js/src/ascendex.js +5 -5
- package/js/src/base/Exchange.d.ts +10 -1
- package/js/src/base/Exchange.js +114 -21
- package/js/src/base/errorHierarchy.d.ts +7 -6
- package/js/src/base/errorHierarchy.js +7 -6
- package/js/src/base/errors.d.ts +3 -3
- package/js/src/base/errors.js +3 -3
- package/js/src/base/functions/type.js +12 -0
- package/js/src/bigone.js +2 -2
- package/js/src/binance.d.ts +1 -0
- package/js/src/binance.js +897 -218
- package/js/src/bingx.js +1 -1
- package/js/src/bitfinex.js +1 -1
- package/js/src/bitfinex2.js +52 -62
- package/js/src/bitget.js +8 -4
- package/js/src/bitmart.js +3 -3
- package/js/src/bitmex.js +9 -6
- package/js/src/bitrue.js +1 -1
- package/js/src/bitso.d.ts +1 -1
- package/js/src/bitso.js +1 -1
- package/js/src/bitteam.js +2 -2
- package/js/src/btcalpha.js +1 -1
- package/js/src/bybit.js +28 -12
- package/js/src/coinbase.js +12 -5
- package/js/src/coincheck.js +1 -1
- package/js/src/coinex.js +2 -2
- package/js/src/coinlist.js +1 -1
- package/js/src/coinmate.js +1 -1
- package/js/src/coinmetro.d.ts +1 -1
- package/js/src/coinmetro.js +12 -6
- package/js/src/coinsph.js +1 -1
- package/js/src/cryptocom.js +3 -3
- package/js/src/digifinex.js +6 -4
- package/js/src/exmo.js +2 -2
- package/js/src/gate.js +5 -5
- package/js/src/gemini.d.ts +1 -1
- package/js/src/gemini.js +3 -3
- package/js/src/hitbtc.js +14 -20
- package/js/src/hollaex.js +2 -2
- package/js/src/htx.js +5 -5
- package/js/src/huobijp.js +1 -1
- package/js/src/krakenfutures.js +1 -1
- package/js/src/kucoin.js +17 -17
- package/js/src/kucoinfutures.js +3 -3
- package/js/src/lbank.js +1 -1
- package/js/src/mexc.js +7 -7
- package/js/src/novadax.js +1 -1
- package/js/src/okcoin.js +2 -2
- package/js/src/okx.js +24 -10
- package/js/src/p2b.js +1 -0
- package/js/src/phemex.js +3 -3
- package/js/src/poloniexfutures.js +3 -3
- package/js/src/pro/alpaca.js +1 -1
- package/js/src/pro/binance.js +4 -4
- package/js/src/pro/bitget.js +1 -1
- package/js/src/pro/bitmart.js +1 -1
- package/js/src/pro/bitmex.d.ts +2 -1
- package/js/src/pro/bitmex.js +49 -6
- package/js/src/pro/bitvavo.js +1 -1
- package/js/src/pro/bybit.js +2 -2
- package/js/src/pro/cex.js +2 -2
- package/js/src/pro/coinbase.js +2 -2
- package/js/src/pro/independentreserve.js +1 -1
- package/js/src/pro/okx.js +1 -1
- package/js/src/pro/onetrading.js +2 -2
- package/js/src/pro/p2b.d.ts +23 -0
- package/js/src/pro/p2b.js +433 -0
- package/js/src/pro/probit.js +5 -5
- package/js/src/pro/whitebit.js +1 -1
- package/js/src/probit.js +1 -1
- package/js/src/timex.js +1 -1
- package/js/src/tokocrypto.js +3 -3
- package/js/src/wavesexchange.js +2 -2
- package/js/src/whitebit.js +2 -2
- package/js/src/woo.js +3 -3
- package/js/src/yobit.js +1 -1
- package/js/src/zaif.js +1 -1
- package/js/src/zonda.d.ts +1 -1
- package/js/src/zonda.js +3 -3
- package/package.json +1 -1
- package/skip-tests.json +3 -10
package/dist/cjs/ccxt.js
CHANGED
|
@@ -164,6 +164,7 @@ var ndax$1 = require('./src/pro/ndax.js');
|
|
|
164
164
|
var okcoin$1 = require('./src/pro/okcoin.js');
|
|
165
165
|
var okx$1 = require('./src/pro/okx.js');
|
|
166
166
|
var onetrading$1 = require('./src/pro/onetrading.js');
|
|
167
|
+
var p2b$1 = require('./src/pro/p2b.js');
|
|
167
168
|
var phemex$1 = require('./src/pro/phemex.js');
|
|
168
169
|
var poloniex$1 = require('./src/pro/poloniex.js');
|
|
169
170
|
var poloniexfutures$1 = require('./src/pro/poloniexfutures.js');
|
|
@@ -175,7 +176,7 @@ var woo$1 = require('./src/pro/woo.js');
|
|
|
175
176
|
|
|
176
177
|
//-----------------------------------------------------------------------------
|
|
177
178
|
// this is updated by vss.js when building
|
|
178
|
-
const version = '4.2.
|
|
179
|
+
const version = '4.2.30';
|
|
179
180
|
Exchange["default"].ccxtVersion = version;
|
|
180
181
|
const exchanges = {
|
|
181
182
|
'ace': ace,
|
|
@@ -332,6 +333,7 @@ const pro = {
|
|
|
332
333
|
'okcoin': okcoin$1,
|
|
333
334
|
'okx': okx$1,
|
|
334
335
|
'onetrading': onetrading$1,
|
|
336
|
+
'p2b': p2b$1,
|
|
335
337
|
'phemex': phemex$1,
|
|
336
338
|
'poloniex': poloniex$1,
|
|
337
339
|
'poloniexfutures': poloniexfutures$1,
|
package/dist/cjs/src/ascendex.js
CHANGED
|
@@ -619,7 +619,7 @@ class ascendex extends ascendex$1 {
|
|
|
619
619
|
symbol = base + '/' + quote + ':' + settle;
|
|
620
620
|
}
|
|
621
621
|
const fee = this.safeNumber(market, 'commissionReserveRate');
|
|
622
|
-
const marginTradable = this.
|
|
622
|
+
const marginTradable = this.safeBool(market, 'marginTradable', false);
|
|
623
623
|
result.push({
|
|
624
624
|
'id': id,
|
|
625
625
|
'symbol': symbol,
|
|
@@ -814,7 +814,7 @@ class ascendex extends ascendex$1 {
|
|
|
814
814
|
let marginMode = undefined;
|
|
815
815
|
[marketType, params] = this.handleMarketTypeAndParams('fetchBalance', undefined, params);
|
|
816
816
|
[marginMode, params] = this.handleMarginModeAndParams('fetchBalance', params);
|
|
817
|
-
const isMargin = this.
|
|
817
|
+
const isMargin = this.safeBool(params, 'margin', false);
|
|
818
818
|
const isCross = marginMode === 'cross';
|
|
819
819
|
marketType = (isMargin || isCross) ? 'margin' : marketType;
|
|
820
820
|
params = this.omit(params, 'margin');
|
|
@@ -1174,7 +1174,7 @@ class ascendex extends ascendex$1 {
|
|
|
1174
1174
|
const timestamp = this.safeInteger(trade, 'ts');
|
|
1175
1175
|
const priceString = this.safeString2(trade, 'price', 'p');
|
|
1176
1176
|
const amountString = this.safeString(trade, 'q');
|
|
1177
|
-
const buyerIsMaker = this.
|
|
1177
|
+
const buyerIsMaker = this.safeBool(trade, 'bm', false);
|
|
1178
1178
|
const side = buyerIsMaker ? 'sell' : 'buy';
|
|
1179
1179
|
market = this.safeMarket(undefined, market);
|
|
1180
1180
|
return this.safeTrade({
|
|
@@ -1518,7 +1518,7 @@ class ascendex extends ascendex$1 {
|
|
|
1518
1518
|
const isLimitOrder = ((type === 'limit') || (type === 'stop_limit'));
|
|
1519
1519
|
const timeInForce = this.safeString(params, 'timeInForce');
|
|
1520
1520
|
const postOnly = this.isPostOnly(isMarketOrder, false, params);
|
|
1521
|
-
const reduceOnly = this.
|
|
1521
|
+
const reduceOnly = this.safeBool(params, 'reduceOnly', false);
|
|
1522
1522
|
const stopPrice = this.safeValue2(params, 'triggerPrice', 'stopPrice');
|
|
1523
1523
|
if (isLimitOrder) {
|
|
1524
1524
|
request['orderPrice'] = this.priceToPrecision(symbol, price);
|
|
@@ -3161,7 +3161,7 @@ class ascendex extends ascendex$1 {
|
|
|
3161
3161
|
// { "code": "0" }
|
|
3162
3162
|
//
|
|
3163
3163
|
const transferOptions = this.safeValue(this.options, 'transfer', {});
|
|
3164
|
-
const fillResponseFromRequest = this.
|
|
3164
|
+
const fillResponseFromRequest = this.safeBool(transferOptions, 'fillResponseFromRequest', true);
|
|
3165
3165
|
const transfer = this.parseTransfer(response, currency);
|
|
3166
3166
|
if (fillResponseFromRequest) {
|
|
3167
3167
|
transfer['fromAccount'] = fromAccount;
|
|
@@ -1407,6 +1407,99 @@ class Exchange {
|
|
|
1407
1407
|
// ########################################################################
|
|
1408
1408
|
// ------------------------------------------------------------------------
|
|
1409
1409
|
// METHODS BELOW THIS LINE ARE TRANSPILED FROM JAVASCRIPT TO PYTHON AND PHP
|
|
1410
|
+
safeBoolN(dictionaryOrList, keys, defaultValue = undefined) {
|
|
1411
|
+
/**
|
|
1412
|
+
* @ignore
|
|
1413
|
+
* @method
|
|
1414
|
+
* @description safely extract boolean value from dictionary or list
|
|
1415
|
+
* @returns {bool | undefined}
|
|
1416
|
+
*/
|
|
1417
|
+
const value = this.safeValueN(dictionaryOrList, keys, defaultValue);
|
|
1418
|
+
if (typeof value === 'boolean') {
|
|
1419
|
+
return value;
|
|
1420
|
+
}
|
|
1421
|
+
return defaultValue;
|
|
1422
|
+
}
|
|
1423
|
+
safeBool2(dictionary, key1, key2, defaultValue = undefined) {
|
|
1424
|
+
/**
|
|
1425
|
+
* @ignore
|
|
1426
|
+
* @method
|
|
1427
|
+
* @description safely extract boolean value from dictionary or list
|
|
1428
|
+
* @returns {bool | undefined}
|
|
1429
|
+
*/
|
|
1430
|
+
return this.safeBoolN(dictionary, [key1, key2], defaultValue);
|
|
1431
|
+
}
|
|
1432
|
+
safeBool(dictionary, key, defaultValue = undefined) {
|
|
1433
|
+
/**
|
|
1434
|
+
* @ignore
|
|
1435
|
+
* @method
|
|
1436
|
+
* @description safely extract boolean value from dictionary or list
|
|
1437
|
+
* @returns {bool | undefined}
|
|
1438
|
+
*/
|
|
1439
|
+
return this.safeBoolN(dictionary, [key], defaultValue);
|
|
1440
|
+
}
|
|
1441
|
+
safeDictN(dictionaryOrList, keys, defaultValue = undefined) {
|
|
1442
|
+
/**
|
|
1443
|
+
* @ignore
|
|
1444
|
+
* @method
|
|
1445
|
+
* @description safely extract a dictionary from dictionary or list
|
|
1446
|
+
* @returns {object | undefined}
|
|
1447
|
+
*/
|
|
1448
|
+
const value = this.safeValueN(dictionaryOrList, keys, defaultValue);
|
|
1449
|
+
if (typeof value === 'object') {
|
|
1450
|
+
return value;
|
|
1451
|
+
}
|
|
1452
|
+
return defaultValue;
|
|
1453
|
+
}
|
|
1454
|
+
safeDict(dictionary, key, defaultValue = undefined) {
|
|
1455
|
+
/**
|
|
1456
|
+
* @ignore
|
|
1457
|
+
* @method
|
|
1458
|
+
* @description safely extract a dictionary from dictionary or list
|
|
1459
|
+
* @returns {object | undefined}
|
|
1460
|
+
*/
|
|
1461
|
+
return this.safeDictN(dictionary, [key], defaultValue);
|
|
1462
|
+
}
|
|
1463
|
+
safeDict2(dictionary, key1, key2, defaultValue = undefined) {
|
|
1464
|
+
/**
|
|
1465
|
+
* @ignore
|
|
1466
|
+
* @method
|
|
1467
|
+
* @description safely extract a dictionary from dictionary or list
|
|
1468
|
+
* @returns {object | undefined}
|
|
1469
|
+
*/
|
|
1470
|
+
return this.safeDictN(dictionary, [key1, key2], defaultValue);
|
|
1471
|
+
}
|
|
1472
|
+
safeListN(dictionaryOrList, keys, defaultValue = undefined) {
|
|
1473
|
+
/**
|
|
1474
|
+
* @ignore
|
|
1475
|
+
* @method
|
|
1476
|
+
* @description safely extract an Array from dictionary or list
|
|
1477
|
+
* @returns {Array | undefined}
|
|
1478
|
+
*/
|
|
1479
|
+
const value = this.safeValueN(dictionaryOrList, keys, defaultValue);
|
|
1480
|
+
if (Array.isArray(value)) {
|
|
1481
|
+
return value;
|
|
1482
|
+
}
|
|
1483
|
+
return defaultValue;
|
|
1484
|
+
}
|
|
1485
|
+
safeList2(dictionaryOrList, key1, key2, defaultValue = undefined) {
|
|
1486
|
+
/**
|
|
1487
|
+
* @ignore
|
|
1488
|
+
* @method
|
|
1489
|
+
* @description safely extract an Array from dictionary or list
|
|
1490
|
+
* @returns {Array | undefined}
|
|
1491
|
+
*/
|
|
1492
|
+
return this.safeListN(dictionaryOrList, [key1, key2], defaultValue);
|
|
1493
|
+
}
|
|
1494
|
+
safeList(dictionaryOrList, key, defaultValue = undefined) {
|
|
1495
|
+
/**
|
|
1496
|
+
* @ignore
|
|
1497
|
+
* @method
|
|
1498
|
+
* @description safely extract an Array from dictionary or list
|
|
1499
|
+
* @returns {Array | undefined}
|
|
1500
|
+
*/
|
|
1501
|
+
return this.safeListN(dictionaryOrList, [key], defaultValue);
|
|
1502
|
+
}
|
|
1410
1503
|
handleDeltas(orderbook, deltas) {
|
|
1411
1504
|
for (let i = 0; i < deltas.length; i++) {
|
|
1412
1505
|
this.handleDelta(orderbook, deltas[i]);
|
|
@@ -1891,7 +1984,7 @@ class Exchange {
|
|
|
1891
1984
|
fee['cost'] = this.safeNumber(fee, 'cost');
|
|
1892
1985
|
}
|
|
1893
1986
|
const timestamp = this.safeInteger(entry, 'timestamp');
|
|
1894
|
-
const info = this.
|
|
1987
|
+
const info = this.safeDict(entry, 'info', {});
|
|
1895
1988
|
return {
|
|
1896
1989
|
'id': this.safeString(entry, 'id'),
|
|
1897
1990
|
'timestamp': timestamp,
|
|
@@ -2063,7 +2156,7 @@ class Exchange {
|
|
|
2063
2156
|
for (let i = 0; i < values.length; i++) {
|
|
2064
2157
|
const market = values[i];
|
|
2065
2158
|
const defaultCurrencyPrecision = (this.precisionMode === DECIMAL_PLACES) ? 8 : this.parseNumber('1e-8');
|
|
2066
|
-
const marketPrecision = this.
|
|
2159
|
+
const marketPrecision = this.safeDict(market, 'precision', {});
|
|
2067
2160
|
if ('base' in market) {
|
|
2068
2161
|
const currency = this.safeCurrencyStructure({
|
|
2069
2162
|
'id': this.safeString2(market, 'baseId', 'base'),
|
|
@@ -2093,7 +2186,7 @@ class Exchange {
|
|
|
2093
2186
|
const resultingCurrencies = [];
|
|
2094
2187
|
for (let i = 0; i < codes.length; i++) {
|
|
2095
2188
|
const code = codes[i];
|
|
2096
|
-
const groupedCurrenciesCode = this.
|
|
2189
|
+
const groupedCurrenciesCode = this.safeList(groupedCurrencies, code, []);
|
|
2097
2190
|
let highestPrecisionCurrency = this.safeValue(groupedCurrenciesCode, 0);
|
|
2098
2191
|
for (let j = 1; j < groupedCurrenciesCode.length; j++) {
|
|
2099
2192
|
const currentCurrency = groupedCurrenciesCode[j];
|
|
@@ -2176,7 +2269,7 @@ class Exchange {
|
|
|
2176
2269
|
const parseSymbol = symbol === undefined;
|
|
2177
2270
|
const parseSide = side === undefined;
|
|
2178
2271
|
const shouldParseFees = parseFee || parseFees;
|
|
2179
|
-
const fees = this.
|
|
2272
|
+
const fees = this.safeList(order, 'fees', []);
|
|
2180
2273
|
let trades = [];
|
|
2181
2274
|
if (parseFilled || parseCost || shouldParseFees) {
|
|
2182
2275
|
const rawTrades = this.safeValue(order, 'trades', trades);
|
|
@@ -2310,7 +2403,7 @@ class Exchange {
|
|
|
2310
2403
|
}
|
|
2311
2404
|
}
|
|
2312
2405
|
// ensure that the average field is calculated correctly
|
|
2313
|
-
const inverse = this.
|
|
2406
|
+
const inverse = this.safeBool(market, 'inverse', false);
|
|
2314
2407
|
const contractSize = this.numberToString(this.safeValue(market, 'contractSize', 1));
|
|
2315
2408
|
// inverse
|
|
2316
2409
|
// price = filled * contract size / cost
|
|
@@ -2364,12 +2457,12 @@ class Exchange {
|
|
|
2364
2457
|
entry['amount'] = this.safeNumber(entry, 'amount');
|
|
2365
2458
|
entry['price'] = this.safeNumber(entry, 'price');
|
|
2366
2459
|
entry['cost'] = this.safeNumber(entry, 'cost');
|
|
2367
|
-
const tradeFee = this.
|
|
2460
|
+
const tradeFee = this.safeDict(entry, 'fee', {});
|
|
2368
2461
|
tradeFee['cost'] = this.safeNumber(tradeFee, 'cost');
|
|
2369
2462
|
if ('rate' in tradeFee) {
|
|
2370
2463
|
tradeFee['rate'] = this.safeNumber(tradeFee, 'rate');
|
|
2371
2464
|
}
|
|
2372
|
-
const entryFees = this.
|
|
2465
|
+
const entryFees = this.safeList(entry, 'fees', []);
|
|
2373
2466
|
for (let j = 0; j < entryFees.length; j++) {
|
|
2374
2467
|
entryFees[j]['cost'] = this.safeNumber(entryFees[j], 'cost');
|
|
2375
2468
|
}
|
|
@@ -2544,7 +2637,7 @@ class Exchange {
|
|
|
2544
2637
|
const contractSize = this.safeString(market, 'contractSize');
|
|
2545
2638
|
let multiplyPrice = price;
|
|
2546
2639
|
if (contractSize !== undefined) {
|
|
2547
|
-
const inverse = this.
|
|
2640
|
+
const inverse = this.safeBool(market, 'inverse', false);
|
|
2548
2641
|
if (inverse) {
|
|
2549
2642
|
multiplyPrice = Precise["default"].stringDiv('1', price);
|
|
2550
2643
|
}
|
|
@@ -2787,12 +2880,12 @@ class Exchange {
|
|
|
2787
2880
|
}
|
|
2788
2881
|
convertTradingViewToOHLCV(ohlcvs, timestamp = 't', open = 'o', high = 'h', low = 'l', close = 'c', volume = 'v', ms = false) {
|
|
2789
2882
|
const result = [];
|
|
2790
|
-
const timestamps = this.
|
|
2791
|
-
const opens = this.
|
|
2792
|
-
const highs = this.
|
|
2793
|
-
const lows = this.
|
|
2794
|
-
const closes = this.
|
|
2795
|
-
const volumes = this.
|
|
2883
|
+
const timestamps = this.safeList(ohlcvs, timestamp, []);
|
|
2884
|
+
const opens = this.safeList(ohlcvs, open, []);
|
|
2885
|
+
const highs = this.safeList(ohlcvs, high, []);
|
|
2886
|
+
const lows = this.safeList(ohlcvs, low, []);
|
|
2887
|
+
const closes = this.safeList(ohlcvs, close, []);
|
|
2888
|
+
const volumes = this.safeList(ohlcvs, volume, []);
|
|
2796
2889
|
for (let i = 0; i < timestamps.length; i++) {
|
|
2797
2890
|
result.push([
|
|
2798
2891
|
ms ? this.safeInteger(timestamps, i) : this.safeTimestamp(timestamps, i),
|
|
@@ -2827,10 +2920,10 @@ class Exchange {
|
|
|
2827
2920
|
async fetchWebEndpoint(method, endpointMethod, returnAsJson, startRegex = undefined, endRegex = undefined) {
|
|
2828
2921
|
let errorMessage = '';
|
|
2829
2922
|
const options = this.safeValue(this.options, method, {});
|
|
2830
|
-
const muteOnFailure = this.
|
|
2923
|
+
const muteOnFailure = this.safeBool(options, 'webApiMuteFailure', true);
|
|
2831
2924
|
try {
|
|
2832
2925
|
// if it was not explicitly disabled, then don't fetch
|
|
2833
|
-
if (this.
|
|
2926
|
+
if (this.safeBool(options, 'webApiEnable', true) !== true) {
|
|
2834
2927
|
return undefined;
|
|
2835
2928
|
}
|
|
2836
2929
|
const maxRetries = this.safeValue(options, 'webApiRetries', 10);
|
|
@@ -3041,7 +3134,7 @@ class Exchange {
|
|
|
3041
3134
|
if (currencyCode !== undefined) {
|
|
3042
3135
|
const defaultNetworkCodeReplacements = this.safeValue(this.options, 'defaultNetworkCodeReplacements', {});
|
|
3043
3136
|
if (currencyCode in defaultNetworkCodeReplacements) {
|
|
3044
|
-
const replacementObject = this.
|
|
3137
|
+
const replacementObject = this.safeDict(defaultNetworkCodeReplacements, currencyCode, {});
|
|
3045
3138
|
networkCode = this.safeString(replacementObject, networkCode, networkCode);
|
|
3046
3139
|
}
|
|
3047
3140
|
}
|
|
@@ -3143,7 +3236,7 @@ class Exchange {
|
|
|
3143
3236
|
const id = this.safeString(item, marketIdKey);
|
|
3144
3237
|
const market = this.safeMarket(id, undefined, undefined, 'swap');
|
|
3145
3238
|
const symbol = market['symbol'];
|
|
3146
|
-
const contract = this.
|
|
3239
|
+
const contract = this.safeBool(market, 'contract', false);
|
|
3147
3240
|
if (contract && ((symbols === undefined) || this.inArray(symbol, symbols))) {
|
|
3148
3241
|
tiers[symbol] = this.parseMarketLeverageTiers(item, market);
|
|
3149
3242
|
}
|
|
@@ -4314,8 +4407,8 @@ class Exchange {
|
|
|
4314
4407
|
const currency = this.currencies[code];
|
|
4315
4408
|
let precision = this.safeValue(currency, 'precision');
|
|
4316
4409
|
if (networkCode !== undefined) {
|
|
4317
|
-
const networks = this.
|
|
4318
|
-
const networkItem = this.
|
|
4410
|
+
const networks = this.safeDict(currency, 'networks', {});
|
|
4411
|
+
const networkItem = this.safeDict(networks, networkCode, {});
|
|
4319
4412
|
precision = this.safeValue(networkItem, 'precision', precision);
|
|
4320
4413
|
}
|
|
4321
4414
|
if (precision === undefined) {
|
|
@@ -4617,7 +4710,7 @@ class Exchange {
|
|
|
4617
4710
|
* @returns {Array}
|
|
4618
4711
|
*/
|
|
4619
4712
|
const timeInForce = this.safeStringUpper(params, 'timeInForce');
|
|
4620
|
-
let postOnly = this.
|
|
4713
|
+
let postOnly = this.safeBool(params, 'postOnly', false);
|
|
4621
4714
|
const ioc = timeInForce === 'IOC';
|
|
4622
4715
|
const fok = timeInForce === 'FOK';
|
|
4623
4716
|
const po = timeInForce === 'PO';
|
|
@@ -88,7 +88,7 @@ class BadRequest extends ExchangeError {
|
|
|
88
88
|
this.name = 'BadRequest';
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
-
class OperationRejected extends
|
|
91
|
+
class OperationRejected extends ExchangeError {
|
|
92
92
|
constructor(message) {
|
|
93
93
|
super(message);
|
|
94
94
|
this.name = 'OperationRejected';
|
|
@@ -100,7 +100,7 @@ class BadSymbol extends BadRequest {
|
|
|
100
100
|
this.name = 'BadSymbol';
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
|
-
class NoChange extends
|
|
103
|
+
class NoChange extends OperationRejected {
|
|
104
104
|
constructor(message) {
|
|
105
105
|
super(message);
|
|
106
106
|
this.name = 'NoChange';
|
|
@@ -221,7 +221,7 @@ class DDoSProtection extends NetworkError {
|
|
|
221
221
|
this.name = 'DDoSProtection';
|
|
222
222
|
}
|
|
223
223
|
}
|
|
224
|
-
class RateLimitExceeded extends
|
|
224
|
+
class RateLimitExceeded extends NetworkError {
|
|
225
225
|
constructor(message) {
|
|
226
226
|
super(message);
|
|
227
227
|
this.name = 'RateLimitExceeded';
|
|
@@ -96,6 +96,9 @@ const safeFloatN = (o, k, $default) => {
|
|
|
96
96
|
return isNumber(n) ? n : $default;
|
|
97
97
|
};
|
|
98
98
|
const safeIntegerN = (o, k, $default) => {
|
|
99
|
+
if (o === undefined) {
|
|
100
|
+
return $default;
|
|
101
|
+
}
|
|
99
102
|
const n = asInteger(getValueFromKeysInArray(o, k));
|
|
100
103
|
return isNumber(n) ? n : $default;
|
|
101
104
|
};
|
|
@@ -108,14 +111,23 @@ const safeTimestampN = (o, k, $default) => {
|
|
|
108
111
|
return isNumber(n) ? parseInt(n * 1000) : $default;
|
|
109
112
|
};
|
|
110
113
|
const safeValueN = (o, k, $default) => {
|
|
114
|
+
if (o === undefined) {
|
|
115
|
+
return $default;
|
|
116
|
+
}
|
|
111
117
|
const x = getValueFromKeysInArray(o, k);
|
|
112
118
|
return hasProps(x) ? x : $default;
|
|
113
119
|
};
|
|
114
120
|
const safeStringN = (o, k, $default) => {
|
|
121
|
+
if (o === undefined) {
|
|
122
|
+
return $default;
|
|
123
|
+
}
|
|
115
124
|
const x = getValueFromKeysInArray(o, k);
|
|
116
125
|
return isStringCoercible(x) ? String(x) : $default;
|
|
117
126
|
};
|
|
118
127
|
const safeStringLowerN = (o, k, $default) => {
|
|
128
|
+
if (o === undefined) {
|
|
129
|
+
return $default;
|
|
130
|
+
}
|
|
119
131
|
const x = getValueFromKeysInArray(o, k);
|
|
120
132
|
return isStringCoercible(x) ? String(x).toLowerCase() : $default;
|
|
121
133
|
};
|
package/dist/cjs/src/bigone.js
CHANGED
|
@@ -1469,7 +1469,7 @@ class bigone extends bigone$1 {
|
|
|
1469
1469
|
const requestSide = isBuy ? 'BID' : 'ASK';
|
|
1470
1470
|
let uppercaseType = type.toUpperCase();
|
|
1471
1471
|
const isLimit = uppercaseType === 'LIMIT';
|
|
1472
|
-
const exchangeSpecificParam = this.
|
|
1472
|
+
const exchangeSpecificParam = this.safeBool(params, 'post_only', false);
|
|
1473
1473
|
let postOnly = undefined;
|
|
1474
1474
|
[postOnly, params] = this.handlePostOnly((uppercaseType === 'MARKET'), exchangeSpecificParam, params);
|
|
1475
1475
|
const triggerPrice = this.safeStringN(params, ['triggerPrice', 'stopPrice', 'stop_price']);
|
|
@@ -2101,7 +2101,7 @@ class bigone extends bigone$1 {
|
|
|
2101
2101
|
//
|
|
2102
2102
|
const transfer = this.parseTransfer(response, currency);
|
|
2103
2103
|
const transferOptions = this.safeValue(this.options, 'transfer', {});
|
|
2104
|
-
const fillResponseFromRequest = this.
|
|
2104
|
+
const fillResponseFromRequest = this.safeBool(transferOptions, 'fillResponseFromRequest', true);
|
|
2105
2105
|
if (fillResponseFromRequest) {
|
|
2106
2106
|
transfer['fromAccount'] = fromAccount;
|
|
2107
2107
|
transfer['toAccount'] = toAccount;
|