ccxt 4.4.47 → 4.4.49
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/ccxt.browser.min.js +16 -16
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/ace.js +1 -1
- package/dist/cjs/src/binance.js +18 -14
- package/dist/cjs/src/bingx.js +88 -30
- package/dist/cjs/src/bitget.js +16 -12
- package/dist/cjs/src/bitmart.js +7 -2
- package/dist/cjs/src/bitmex.js +8 -5
- package/dist/cjs/src/bybit.js +7 -2
- package/dist/cjs/src/coinbase.js +11 -1
- package/dist/cjs/src/coincatch.js +86 -2
- package/dist/cjs/src/coincheck.js +52 -0
- package/dist/cjs/src/coinlist.js +77 -0
- package/dist/cjs/src/coinmate.js +63 -0
- package/dist/cjs/src/coinmetro.js +68 -0
- package/dist/cjs/src/coinone.js +56 -0
- package/dist/cjs/src/coinsph.js +85 -10
- package/dist/cjs/src/coinspot.js +47 -0
- package/dist/cjs/src/currencycom.js +72 -0
- package/dist/cjs/src/defx.js +93 -6
- package/dist/cjs/src/delta.js +83 -1
- package/dist/cjs/src/deribit.js +82 -0
- package/dist/cjs/src/digifinex.js +131 -11
- package/dist/cjs/src/ellipx.js +61 -0
- package/dist/cjs/src/exmo.js +58 -0
- package/dist/cjs/src/gate.js +10 -1
- package/dist/cjs/src/hitbtc.js +99 -0
- package/dist/cjs/src/hollaex.js +73 -0
- package/dist/cjs/src/htx.js +10 -2
- package/dist/cjs/src/huobijp.js +73 -0
- package/dist/cjs/src/hyperliquid.js +28 -2
- package/dist/cjs/src/idex.js +71 -0
- package/dist/cjs/src/independentreserve.js +124 -0
- package/dist/cjs/src/indodax.js +61 -0
- package/dist/cjs/src/kraken.js +1 -1
- package/dist/cjs/src/krakenfutures.js +4 -4
- package/dist/cjs/src/kuna.js +60 -1
- package/dist/cjs/src/latoken.js +64 -0
- package/dist/cjs/src/lbank.js +70 -0
- package/dist/cjs/src/luno.js +73 -0
- package/dist/cjs/src/lykke.js +64 -0
- package/dist/cjs/src/mercado.js +65 -0
- package/dist/cjs/src/mexc.js +1 -1
- package/dist/cjs/src/myokx.js +10 -0
- package/dist/cjs/src/ndax.js +71 -0
- package/dist/cjs/src/novadax.js +74 -0
- package/dist/cjs/src/oceanex.js +69 -0
- package/dist/cjs/src/okcoin.js +79 -2
- package/dist/cjs/src/okx.js +9 -1
- package/dist/cjs/src/onetrading.js +66 -0
- package/dist/cjs/src/oxfun.js +66 -0
- package/dist/cjs/src/p2b.js +63 -1
- package/dist/cjs/src/paradex.js +73 -2
- package/dist/cjs/src/phemex.js +103 -0
- package/dist/cjs/src/poloniex.js +61 -0
- package/dist/cjs/src/poloniexfutures.js +74 -0
- package/dist/cjs/src/pro/bitmart.js +6 -0
- package/dist/cjs/src/upbit.js +61 -0
- package/dist/cjs/src/woo.js +6 -1
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/independentreserve.d.ts +6 -0
- package/js/src/ace.js +1 -1
- package/js/src/binance.d.ts +7 -0
- package/js/src/binance.js +18 -14
- package/js/src/bingx.d.ts +8 -0
- package/js/src/bingx.js +88 -30
- package/js/src/bitget.d.ts +1 -0
- package/js/src/bitget.js +16 -12
- package/js/src/bitmart.js +7 -2
- package/js/src/bitmex.js +8 -5
- package/js/src/bybit.d.ts +1 -1
- package/js/src/bybit.js +7 -2
- package/js/src/coinbase.d.ts +1 -0
- package/js/src/coinbase.js +11 -1
- package/js/src/coincatch.d.ts +1 -2
- package/js/src/coincatch.js +86 -2
- package/js/src/coincheck.js +52 -0
- package/js/src/coinlist.js +77 -0
- package/js/src/coinmate.js +63 -0
- package/js/src/coinmetro.js +68 -0
- package/js/src/coinone.js +56 -0
- package/js/src/coinsph.d.ts +2 -1
- package/js/src/coinsph.js +85 -10
- package/js/src/coinspot.js +47 -0
- package/js/src/currencycom.js +72 -0
- package/js/src/defx.js +93 -6
- package/js/src/delta.js +83 -1
- package/js/src/deribit.js +82 -0
- package/js/src/digifinex.d.ts +1 -0
- package/js/src/digifinex.js +131 -11
- package/js/src/ellipx.d.ts +1 -0
- package/js/src/ellipx.js +61 -0
- package/js/src/exmo.js +58 -0
- package/js/src/gate.d.ts +1 -0
- package/js/src/gate.js +10 -1
- package/js/src/hitbtc.js +99 -0
- package/js/src/hollaex.js +73 -0
- package/js/src/htx.d.ts +1 -0
- package/js/src/htx.js +10 -2
- package/js/src/huobijp.js +73 -0
- package/js/src/hyperliquid.d.ts +1 -0
- package/js/src/hyperliquid.js +28 -2
- package/js/src/idex.js +71 -0
- package/js/src/independentreserve.js +124 -0
- package/js/src/indodax.js +61 -0
- package/js/src/kraken.js +1 -1
- package/js/src/krakenfutures.js +4 -4
- package/js/src/kuna.js +60 -1
- package/js/src/latoken.js +64 -0
- package/js/src/lbank.js +70 -0
- package/js/src/luno.js +73 -0
- package/js/src/lykke.js +64 -0
- package/js/src/mercado.js +65 -0
- package/js/src/mexc.js +1 -1
- package/js/src/myokx.js +10 -0
- package/js/src/ndax.js +71 -0
- package/js/src/novadax.js +74 -0
- package/js/src/oceanex.js +69 -0
- package/js/src/okcoin.js +79 -2
- package/js/src/okx.d.ts +1 -0
- package/js/src/okx.js +9 -1
- package/js/src/onetrading.js +66 -0
- package/js/src/oxfun.js +66 -0
- package/js/src/p2b.js +63 -1
- package/js/src/paradex.js +73 -2
- package/js/src/phemex.js +103 -0
- package/js/src/poloniex.js +61 -0
- package/js/src/poloniexfutures.js +74 -0
- package/js/src/pro/bitmart.d.ts +1 -0
- package/js/src/pro/bitmart.js +6 -0
- package/js/src/upbit.js +61 -0
- package/js/src/woo.js +6 -1
- package/package.json +2 -2
package/dist/cjs/ccxt.js
CHANGED
|
@@ -202,7 +202,7 @@ var xt$1 = require('./src/pro/xt.js');
|
|
|
202
202
|
|
|
203
203
|
//-----------------------------------------------------------------------------
|
|
204
204
|
// this is updated by vss.js when building
|
|
205
|
-
const version = '4.4.
|
|
205
|
+
const version = '4.4.49';
|
|
206
206
|
Exchange["default"].ccxtVersion = version;
|
|
207
207
|
const exchanges = {
|
|
208
208
|
'ace': ace,
|
package/dist/cjs/src/ace.js
CHANGED
|
@@ -475,7 +475,7 @@ class ace extends ace$1 {
|
|
|
475
475
|
// }
|
|
476
476
|
//
|
|
477
477
|
const orderBook = this.safeDict(response, 'attachment');
|
|
478
|
-
return this.parseOrderBook(orderBook, market['symbol'], undefined, 'bids', 'asks');
|
|
478
|
+
return this.parseOrderBook(orderBook, market['symbol'], undefined, 'bids', 'asks', 1, 0);
|
|
479
479
|
}
|
|
480
480
|
parseOHLCV(ohlcv, market = undefined) {
|
|
481
481
|
//
|
package/dist/cjs/src/binance.js
CHANGED
|
@@ -9870,20 +9870,24 @@ class binance extends binance$1 {
|
|
|
9870
9870
|
// "fundingTime": "1621267200000",
|
|
9871
9871
|
// }
|
|
9872
9872
|
//
|
|
9873
|
-
|
|
9874
|
-
|
|
9875
|
-
|
|
9876
|
-
|
|
9877
|
-
|
|
9878
|
-
|
|
9879
|
-
|
|
9880
|
-
|
|
9881
|
-
|
|
9882
|
-
|
|
9883
|
-
|
|
9884
|
-
|
|
9885
|
-
|
|
9886
|
-
|
|
9873
|
+
return this.parseFundingRateHistories(response, market, since, limit);
|
|
9874
|
+
}
|
|
9875
|
+
parseFundingRateHistory(contract, market = undefined) {
|
|
9876
|
+
//
|
|
9877
|
+
// {
|
|
9878
|
+
// "symbol": "BTCUSDT",
|
|
9879
|
+
// "fundingRate": "0.00063521",
|
|
9880
|
+
// "fundingTime": "1621267200000",
|
|
9881
|
+
// }
|
|
9882
|
+
//
|
|
9883
|
+
const timestamp = this.safeInteger(contract, 'fundingTime');
|
|
9884
|
+
return {
|
|
9885
|
+
'info': contract,
|
|
9886
|
+
'symbol': this.safeSymbol(this.safeString(contract, 'symbol'), undefined, undefined, 'swap'),
|
|
9887
|
+
'fundingRate': this.safeNumber(contract, 'fundingRate'),
|
|
9888
|
+
'timestamp': timestamp,
|
|
9889
|
+
'datetime': this.iso8601(timestamp),
|
|
9890
|
+
};
|
|
9887
9891
|
}
|
|
9888
9892
|
/**
|
|
9889
9893
|
* @method
|
package/dist/cjs/src/bingx.js
CHANGED
|
@@ -821,8 +821,8 @@ class bingx extends bingx$1 {
|
|
|
821
821
|
// "symbols": [
|
|
822
822
|
// {
|
|
823
823
|
// "symbol": "GEAR-USDT",
|
|
824
|
-
// "minQty": 735,
|
|
825
|
-
// "maxQty": 2941177,
|
|
824
|
+
// "minQty": 735, // deprecated
|
|
825
|
+
// "maxQty": 2941177, // deprecated
|
|
826
826
|
// "minNotional": 5,
|
|
827
827
|
// "maxNotional": 20000,
|
|
828
828
|
// "status": 1,
|
|
@@ -946,6 +946,10 @@ class bingx extends bingx$1 {
|
|
|
946
946
|
}
|
|
947
947
|
const isInverse = (spot) ? undefined : checkIsInverse;
|
|
948
948
|
const isLinear = (spot) ? undefined : checkIsLinear;
|
|
949
|
+
let minAmount = undefined;
|
|
950
|
+
if (!spot) {
|
|
951
|
+
minAmount = this.safeNumber2(market, 'minQty', 'tradeMinQuantity');
|
|
952
|
+
}
|
|
949
953
|
let timeOnline = this.safeInteger(market, 'timeOnline');
|
|
950
954
|
if (timeOnline === 0) {
|
|
951
955
|
timeOnline = undefined;
|
|
@@ -987,8 +991,8 @@ class bingx extends bingx$1 {
|
|
|
987
991
|
'max': undefined,
|
|
988
992
|
},
|
|
989
993
|
'amount': {
|
|
990
|
-
'min':
|
|
991
|
-
'max':
|
|
994
|
+
'min': minAmount,
|
|
995
|
+
'max': undefined,
|
|
992
996
|
},
|
|
993
997
|
'price': {
|
|
994
998
|
'min': minTickSize,
|
|
@@ -1656,22 +1660,24 @@ class bingx extends bingx$1 {
|
|
|
1656
1660
|
// }
|
|
1657
1661
|
//
|
|
1658
1662
|
const data = this.safeList(response, 'data', []);
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1663
|
+
return this.parseFundingRateHistories(data, market, since, limit);
|
|
1664
|
+
}
|
|
1665
|
+
parseFundingRateHistory(contract, market = undefined) {
|
|
1666
|
+
//
|
|
1667
|
+
// {
|
|
1668
|
+
// "symbol": "BTC-USDT",
|
|
1669
|
+
// "fundingRate": "0.0001",
|
|
1670
|
+
// "fundingTime": 1585684800000
|
|
1671
|
+
// }
|
|
1672
|
+
//
|
|
1673
|
+
const timestamp = this.safeInteger(contract, 'fundingTime');
|
|
1674
|
+
return {
|
|
1675
|
+
'info': contract,
|
|
1676
|
+
'symbol': this.safeSymbol(this.safeString(contract, 'symbol'), market, '-', 'swap'),
|
|
1677
|
+
'fundingRate': this.safeNumber(contract, 'fundingRate'),
|
|
1678
|
+
'timestamp': timestamp,
|
|
1679
|
+
'datetime': this.iso8601(timestamp),
|
|
1680
|
+
};
|
|
1675
1681
|
}
|
|
1676
1682
|
/**
|
|
1677
1683
|
* @method
|
|
@@ -2343,12 +2349,14 @@ class bingx extends bingx$1 {
|
|
|
2343
2349
|
else {
|
|
2344
2350
|
const linearSwapData = this.safeDict(response, 'data', {});
|
|
2345
2351
|
const linearSwapBalance = this.safeDict(linearSwapData, 'balance');
|
|
2346
|
-
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
+
if (linearSwapBalance) {
|
|
2353
|
+
const currencyId = this.safeString(linearSwapBalance, 'asset');
|
|
2354
|
+
const code = this.safeCurrencyCode(currencyId);
|
|
2355
|
+
const account = this.account();
|
|
2356
|
+
account['free'] = this.safeString(linearSwapBalance, 'availableMargin');
|
|
2357
|
+
account['used'] = this.safeString(linearSwapBalance, 'usedMargin');
|
|
2358
|
+
result[code] = account;
|
|
2359
|
+
}
|
|
2352
2360
|
}
|
|
2353
2361
|
return this.safeBalance(result);
|
|
2354
2362
|
}
|
|
@@ -6452,6 +6460,48 @@ class bingx extends bingx$1 {
|
|
|
6452
6460
|
'tierBased': false,
|
|
6453
6461
|
};
|
|
6454
6462
|
}
|
|
6463
|
+
customEncode(params) {
|
|
6464
|
+
const sortedParams = this.keysort(params);
|
|
6465
|
+
const keys = Object.keys(sortedParams);
|
|
6466
|
+
let adjustedValue = undefined;
|
|
6467
|
+
let result = undefined;
|
|
6468
|
+
for (let i = 0; i < keys.length; i++) {
|
|
6469
|
+
const key = keys[i];
|
|
6470
|
+
let value = sortedParams[key];
|
|
6471
|
+
if (Array.isArray(value)) {
|
|
6472
|
+
let arrStr = undefined;
|
|
6473
|
+
for (let j = 0; j < value.length; j++) {
|
|
6474
|
+
const arrayElement = value[j];
|
|
6475
|
+
const isString = (typeof arrayElement === 'string');
|
|
6476
|
+
if (isString) {
|
|
6477
|
+
if (j > 0) {
|
|
6478
|
+
arrStr += ',' + '"' + arrayElement.toString() + '"';
|
|
6479
|
+
}
|
|
6480
|
+
else {
|
|
6481
|
+
arrStr = '"' + arrayElement.toString() + '"';
|
|
6482
|
+
}
|
|
6483
|
+
}
|
|
6484
|
+
else {
|
|
6485
|
+
if (j > 0) {
|
|
6486
|
+
arrStr += ',' + arrayElement.toString();
|
|
6487
|
+
}
|
|
6488
|
+
else {
|
|
6489
|
+
arrStr = arrayElement.toString();
|
|
6490
|
+
}
|
|
6491
|
+
}
|
|
6492
|
+
}
|
|
6493
|
+
adjustedValue = '[' + arrStr + ']';
|
|
6494
|
+
value = adjustedValue;
|
|
6495
|
+
}
|
|
6496
|
+
if (i === 0) {
|
|
6497
|
+
result = key + '=' + value;
|
|
6498
|
+
}
|
|
6499
|
+
else {
|
|
6500
|
+
result += '&' + key + '=' + value;
|
|
6501
|
+
}
|
|
6502
|
+
}
|
|
6503
|
+
return result;
|
|
6504
|
+
}
|
|
6455
6505
|
sign(path, section = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
|
|
6456
6506
|
let type = section[0];
|
|
6457
6507
|
let version = section[1];
|
|
@@ -6487,16 +6537,24 @@ class bingx extends bingx$1 {
|
|
|
6487
6537
|
else if (access === 'private') {
|
|
6488
6538
|
this.checkRequiredCredentials();
|
|
6489
6539
|
const isJsonContentType = (((type === 'subAccount') || (type === 'account/transfer')) && (method === 'POST'));
|
|
6490
|
-
|
|
6491
|
-
|
|
6540
|
+
let parsedParams = undefined;
|
|
6541
|
+
let encodeRequest = undefined;
|
|
6542
|
+
if (isJsonContentType) {
|
|
6543
|
+
encodeRequest = this.customEncode(params);
|
|
6544
|
+
}
|
|
6545
|
+
else {
|
|
6546
|
+
parsedParams = this.parseParams(params);
|
|
6547
|
+
encodeRequest = this.rawencode(parsedParams);
|
|
6548
|
+
}
|
|
6549
|
+
const signature = this.hmac(this.encode(encodeRequest), this.encode(this.secret), sha256.sha256);
|
|
6492
6550
|
headers = {
|
|
6493
6551
|
'X-BX-APIKEY': this.apiKey,
|
|
6494
6552
|
'X-SOURCE-KEY': this.safeString(this.options, 'broker', 'CCXT'),
|
|
6495
6553
|
};
|
|
6496
6554
|
if (isJsonContentType) {
|
|
6497
6555
|
headers['Content-Type'] = 'application/json';
|
|
6498
|
-
|
|
6499
|
-
body = this.json(
|
|
6556
|
+
params['signature'] = signature;
|
|
6557
|
+
body = this.json(params);
|
|
6500
6558
|
}
|
|
6501
6559
|
else {
|
|
6502
6560
|
const query = this.urlencode(parsedParams);
|
package/dist/cjs/src/bitget.js
CHANGED
|
@@ -1381,18 +1381,18 @@ class bitget extends bitget$1 {
|
|
|
1381
1381
|
'1m': 30,
|
|
1382
1382
|
'3m': 30,
|
|
1383
1383
|
'5m': 30,
|
|
1384
|
-
'10m':
|
|
1384
|
+
'10m': 30,
|
|
1385
1385
|
'15m': 52,
|
|
1386
|
-
'30m':
|
|
1386
|
+
'30m': 62,
|
|
1387
1387
|
'1h': 83,
|
|
1388
1388
|
'2h': 120,
|
|
1389
1389
|
'4h': 240,
|
|
1390
1390
|
'6h': 360,
|
|
1391
1391
|
'12h': 360,
|
|
1392
|
-
'1d':
|
|
1393
|
-
'3d':
|
|
1394
|
-
'1w':
|
|
1395
|
-
'1M':
|
|
1392
|
+
'1d': 300,
|
|
1393
|
+
'3d': 300,
|
|
1394
|
+
'1w': 300,
|
|
1395
|
+
'1M': 300,
|
|
1396
1396
|
},
|
|
1397
1397
|
},
|
|
1398
1398
|
'fetchTrades': {
|
|
@@ -3554,6 +3554,7 @@ class bitget extends bitget$1 {
|
|
|
3554
3554
|
* @param {int} [limit] the maximum amount of candles to fetch
|
|
3555
3555
|
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3556
3556
|
* @param {int} [params.until] timestamp in ms of the latest candle to fetch
|
|
3557
|
+
* @param {boolean} [params.useHistoryEndpoint] whether to force to use historical endpoint (it has max limit of 200)
|
|
3557
3558
|
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
3558
3559
|
* @param {string} [params.price] *swap only* "mark" (to fetch mark price candles) or "index" (to fetch index price candles)
|
|
3559
3560
|
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
@@ -3566,9 +3567,10 @@ class bitget extends bitget$1 {
|
|
|
3566
3567
|
let paginate = false;
|
|
3567
3568
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchOHLCV', 'paginate');
|
|
3568
3569
|
if (paginate) {
|
|
3569
|
-
return await this.fetchPaginatedCallDeterministic('fetchOHLCV', symbol, since, limit, timeframe, params,
|
|
3570
|
+
return await this.fetchPaginatedCallDeterministic('fetchOHLCV', symbol, since, limit, timeframe, params, maxLimitForRecentEndpoint);
|
|
3570
3571
|
}
|
|
3571
3572
|
const sandboxMode = this.safeBool(this.options, 'sandboxMode', false);
|
|
3573
|
+
const useHistoryEndpoint = this.safeBool(params, 'useHistoryEndpoint', false);
|
|
3572
3574
|
let market = undefined;
|
|
3573
3575
|
if (sandboxMode) {
|
|
3574
3576
|
const sandboxSymbol = this.convertSymbolForSandbox(symbol);
|
|
@@ -3598,7 +3600,7 @@ class bitget extends bitget$1 {
|
|
|
3598
3600
|
const ohlcOptions = this.safeDict(this.options, 'fetchOHLCV', {});
|
|
3599
3601
|
const retrievableDaysMap = this.safeDict(ohlcOptions, 'maxDaysPerTimeframe', {});
|
|
3600
3602
|
const maxRetrievableDaysForRecent = this.safeInteger(retrievableDaysMap, timeframe, 30); // default to safe minimum
|
|
3601
|
-
const endpointTsBoundary = now - maxRetrievableDaysForRecent * msInDay;
|
|
3603
|
+
const endpointTsBoundary = now - (maxRetrievableDaysForRecent - 1) * msInDay;
|
|
3602
3604
|
if (limitDefined) {
|
|
3603
3605
|
limit = Math.min(limit, maxLimitForRecentEndpoint);
|
|
3604
3606
|
request['limit'] = limit;
|
|
@@ -3637,7 +3639,7 @@ class bitget extends bitget$1 {
|
|
|
3637
3639
|
// make request
|
|
3638
3640
|
if (market['spot']) {
|
|
3639
3641
|
// checks if we need history endpoint
|
|
3640
|
-
if (historicalEndpointNeeded) {
|
|
3642
|
+
if (historicalEndpointNeeded || useHistoryEndpoint) {
|
|
3641
3643
|
response = await this.publicSpotGetV2SpotMarketHistoryCandles(this.extend(request, params));
|
|
3642
3644
|
}
|
|
3643
3645
|
else {
|
|
@@ -3669,7 +3671,7 @@ class bitget extends bitget$1 {
|
|
|
3669
3671
|
response = await this.publicMixGetV2MixMarketHistoryIndexCandles(extended);
|
|
3670
3672
|
}
|
|
3671
3673
|
else {
|
|
3672
|
-
if (historicalEndpointNeeded) {
|
|
3674
|
+
if (historicalEndpointNeeded || useHistoryEndpoint) {
|
|
3673
3675
|
response = await this.publicMixGetV2MixMarketHistoryCandles(extended);
|
|
3674
3676
|
}
|
|
3675
3677
|
else {
|
|
@@ -4332,8 +4334,10 @@ class bitget extends bitget$1 {
|
|
|
4332
4334
|
if (!market['spot']) {
|
|
4333
4335
|
throw new errors.NotSupported(this.id + ' createMarketBuyOrderWithCost() supports spot orders only');
|
|
4334
4336
|
}
|
|
4335
|
-
|
|
4336
|
-
|
|
4337
|
+
const req = {
|
|
4338
|
+
'createMarketBuyOrderRequiresPrice': false,
|
|
4339
|
+
};
|
|
4340
|
+
return await this.createOrder(symbol, 'market', 'buy', cost, undefined, this.extend(req, params));
|
|
4337
4341
|
}
|
|
4338
4342
|
/**
|
|
4339
4343
|
* @method
|
package/dist/cjs/src/bitmart.js
CHANGED
|
@@ -526,6 +526,8 @@ class bitmart extends bitmart$1 {
|
|
|
526
526
|
'defaultNetworks': {
|
|
527
527
|
'USDT': 'ERC20',
|
|
528
528
|
},
|
|
529
|
+
'timeDifference': 0,
|
|
530
|
+
'adjustForTimeDifference': false,
|
|
529
531
|
'networks': {
|
|
530
532
|
'ERC20': 'ERC20',
|
|
531
533
|
'SOL': 'SOL',
|
|
@@ -1140,6 +1142,9 @@ class bitmart extends bitmart$1 {
|
|
|
1140
1142
|
* @returns {object[]} an array of objects representing market data
|
|
1141
1143
|
*/
|
|
1142
1144
|
async fetchMarkets(params = {}) {
|
|
1145
|
+
if (this.options['adjustForTimeDifference']) {
|
|
1146
|
+
await this.loadTimeDifference();
|
|
1147
|
+
}
|
|
1143
1148
|
const spot = await this.fetchSpotMarkets(params);
|
|
1144
1149
|
const contract = await this.fetchContractMarkets(params);
|
|
1145
1150
|
return this.arrayConcat(spot, contract);
|
|
@@ -5300,7 +5305,7 @@ class bitmart extends bitmart$1 {
|
|
|
5300
5305
|
return this.filterBySinceLimit(sorted, since, limit);
|
|
5301
5306
|
}
|
|
5302
5307
|
nonce() {
|
|
5303
|
-
return this.milliseconds();
|
|
5308
|
+
return this.milliseconds() - this.options['timeDifference'];
|
|
5304
5309
|
}
|
|
5305
5310
|
sign(path, api = 'public', method = 'GET', params = {}, headers = undefined, body = undefined) {
|
|
5306
5311
|
const parts = path.split('/');
|
|
@@ -5320,7 +5325,7 @@ class bitmart extends bitmart$1 {
|
|
|
5320
5325
|
}
|
|
5321
5326
|
if (api === 'private') {
|
|
5322
5327
|
this.checkRequiredCredentials();
|
|
5323
|
-
const timestamp = this.
|
|
5328
|
+
const timestamp = this.nonce().toString();
|
|
5324
5329
|
const brokerId = this.safeString(this.options, 'brokerId', 'CCXTxBitmart000');
|
|
5325
5330
|
headers = {
|
|
5326
5331
|
'X-BM-KEY': this.apiKey,
|
package/dist/cjs/src/bitmex.js
CHANGED
|
@@ -299,9 +299,11 @@ class bitmex extends bitmex$1 {
|
|
|
299
299
|
'trailing': true,
|
|
300
300
|
'marketBuyRequiresPrice': false,
|
|
301
301
|
'marketBuyByCost': false,
|
|
302
|
-
|
|
303
|
-
'selfTradePrevention':
|
|
304
|
-
'
|
|
302
|
+
// exchange-supported features
|
|
303
|
+
// 'selfTradePrevention': true,
|
|
304
|
+
// 'twap': false,
|
|
305
|
+
// 'iceberg': false,
|
|
306
|
+
// 'oco': false,
|
|
305
307
|
},
|
|
306
308
|
'createOrders': undefined,
|
|
307
309
|
'fetchMyTrades': {
|
|
@@ -332,7 +334,7 @@ class bitmex extends bitmex$1 {
|
|
|
332
334
|
'fetchClosedOrders': {
|
|
333
335
|
'marginMode': false,
|
|
334
336
|
'limit': 500,
|
|
335
|
-
'
|
|
337
|
+
'daysBackClosed': undefined,
|
|
336
338
|
'daysBackCanceled': undefined,
|
|
337
339
|
'untilDays': 1000000,
|
|
338
340
|
'trigger': false,
|
|
@@ -2608,7 +2610,8 @@ class bitmex extends bitmex$1 {
|
|
|
2608
2610
|
}
|
|
2609
2611
|
}
|
|
2610
2612
|
symbols = this.marketSymbols(symbols);
|
|
2611
|
-
|
|
2613
|
+
const result = this.parseFundingRates(filteredResponse);
|
|
2614
|
+
return this.filterByArray(result, 'symbol', symbols);
|
|
2612
2615
|
}
|
|
2613
2616
|
parseFundingRate(contract, market = undefined) {
|
|
2614
2617
|
// see response sample under "fetchMarkets" because same endpoint is being used here
|
package/dist/cjs/src/bybit.js
CHANGED
|
@@ -3333,7 +3333,12 @@ class bybit extends bybit$1 {
|
|
|
3333
3333
|
account['free'] = free;
|
|
3334
3334
|
}
|
|
3335
3335
|
else {
|
|
3336
|
-
|
|
3336
|
+
const locked = this.safeString(coinEntry, 'locked', '0');
|
|
3337
|
+
const totalPositionIm = this.safeString(coinEntry, 'totalPositionIM', '0');
|
|
3338
|
+
const totalOrderIm = this.safeString(coinEntry, 'totalOrderIM', '0');
|
|
3339
|
+
let totalUsed = Precise["default"].stringAdd(locked, totalPositionIm);
|
|
3340
|
+
totalUsed = Precise["default"].stringAdd(totalUsed, totalOrderIm);
|
|
3341
|
+
account['used'] = totalUsed;
|
|
3337
3342
|
}
|
|
3338
3343
|
// account['used'] = this.safeString (coinEntry, 'locked');
|
|
3339
3344
|
const currencyId = this.safeString(coinEntry, 'coin');
|
|
@@ -3858,7 +3863,7 @@ class bybit extends bybit$1 {
|
|
|
3858
3863
|
* @param {bool} [params.reduceOnly] true or false whether the order is reduce-only
|
|
3859
3864
|
* @param {string} [params.positionIdx] *contracts only* 0 for one-way mode, 1 buy side of hedged mode, 2 sell side of hedged mode
|
|
3860
3865
|
* @param {bool} [params.hedged] *contracts only* true for hedged mode, false for one way mode, default is false
|
|
3861
|
-
* @param {
|
|
3866
|
+
* @param {int} [params.isLeverage] *unified spot only* false then spot trading true then margin trading
|
|
3862
3867
|
* @param {string} [params.tpslMode] *contract only* 'full' or 'partial'
|
|
3863
3868
|
* @param {string} [params.mmp] *option only* market maker protection
|
|
3864
3869
|
* @param {string} [params.triggerDirection] *contract only* the direction for trigger orders, 'above' or 'below'
|
package/dist/cjs/src/coinbase.js
CHANGED
|
@@ -367,6 +367,8 @@ class coinbase extends coinbase$1 {
|
|
|
367
367
|
'createMarketBuyOrderRequiresPrice': true,
|
|
368
368
|
'advanced': true,
|
|
369
369
|
'fetchMarkets': 'fetchMarketsV3',
|
|
370
|
+
'timeDifference': 0,
|
|
371
|
+
'adjustForTimeDifference': false,
|
|
370
372
|
'fetchTicker': 'fetchTickerV3',
|
|
371
373
|
'fetchTickers': 'fetchTickersV3',
|
|
372
374
|
'fetchAccounts': 'fetchAccountsV3',
|
|
@@ -1275,6 +1277,9 @@ class coinbase extends coinbase$1 {
|
|
|
1275
1277
|
* @returns {object[]} an array of objects representing market data
|
|
1276
1278
|
*/
|
|
1277
1279
|
async fetchMarkets(params = {}) {
|
|
1280
|
+
if (this.options['adjustForTimeDifference']) {
|
|
1281
|
+
await this.loadTimeDifference();
|
|
1282
|
+
}
|
|
1278
1283
|
const method = this.safeString(this.options, 'fetchMarkets', 'fetchMarketsV3');
|
|
1279
1284
|
if (method === 'fetchMarketsV3') {
|
|
1280
1285
|
return await this.fetchMarketsV3(params);
|
|
@@ -4881,6 +4886,9 @@ class coinbase extends coinbase$1 {
|
|
|
4881
4886
|
const token = rsa.jwt(request, this.encode(this.secret), sha256.sha256, false, { 'kid': this.apiKey, 'nonce': nonce, 'alg': 'ES256' });
|
|
4882
4887
|
return token;
|
|
4883
4888
|
}
|
|
4889
|
+
nonce() {
|
|
4890
|
+
return this.milliseconds() - this.options['timeDifference'];
|
|
4891
|
+
}
|
|
4884
4892
|
sign(path, api = [], method = 'GET', params = {}, headers = undefined, body = undefined) {
|
|
4885
4893
|
const version = api[0];
|
|
4886
4894
|
const signed = api[1] === 'private';
|
|
@@ -4953,7 +4961,9 @@ class coinbase extends coinbase$1 {
|
|
|
4953
4961
|
authorizationString = 'Bearer ' + token;
|
|
4954
4962
|
}
|
|
4955
4963
|
else {
|
|
4956
|
-
const
|
|
4964
|
+
const nonce = this.nonce();
|
|
4965
|
+
const timestamp = this.parseToInt(nonce / 1000);
|
|
4966
|
+
const timestampString = timestamp.toString();
|
|
4957
4967
|
const auth = timestampString + method + savedPath + payload;
|
|
4958
4968
|
const signature = this.hmac(this.encode(auth), this.encode(this.secret), sha256.sha256);
|
|
4959
4969
|
headers = {
|
|
@@ -410,6 +410,91 @@ class coincatch extends coincatch$1 {
|
|
|
410
410
|
'CronosChain': 'CRO', // todo check
|
|
411
411
|
},
|
|
412
412
|
},
|
|
413
|
+
'features': {
|
|
414
|
+
'default': {
|
|
415
|
+
'sandbox': false,
|
|
416
|
+
'createOrder': {
|
|
417
|
+
'marginMode': false,
|
|
418
|
+
'triggerPrice': true,
|
|
419
|
+
'triggerPriceType': {
|
|
420
|
+
'last': true,
|
|
421
|
+
'mark': true,
|
|
422
|
+
'index': false,
|
|
423
|
+
},
|
|
424
|
+
'triggerDirection': false,
|
|
425
|
+
'stopLossPrice': false,
|
|
426
|
+
'takeProfitPrice': false,
|
|
427
|
+
'attachedStopLossTakeProfit': undefined,
|
|
428
|
+
'timeInForce': {
|
|
429
|
+
'IOC': true,
|
|
430
|
+
'FOK': true,
|
|
431
|
+
'PO': true,
|
|
432
|
+
'GTD': false,
|
|
433
|
+
},
|
|
434
|
+
'hedged': false,
|
|
435
|
+
'trailing': false,
|
|
436
|
+
'leverage': false,
|
|
437
|
+
'marketBuyByCost': true,
|
|
438
|
+
'marketBuyRequiresPrice': false,
|
|
439
|
+
'selfTradePrevention': false,
|
|
440
|
+
'iceberg': false,
|
|
441
|
+
},
|
|
442
|
+
'createOrders': {
|
|
443
|
+
'max': 50,
|
|
444
|
+
},
|
|
445
|
+
'fetchMyTrades': {
|
|
446
|
+
'marginMode': false,
|
|
447
|
+
'limit': 500,
|
|
448
|
+
'daysBack': 100000,
|
|
449
|
+
'untilDays': 100000, // todo implement
|
|
450
|
+
},
|
|
451
|
+
'fetchOrder': {
|
|
452
|
+
'marginMode': false,
|
|
453
|
+
'trigger': false,
|
|
454
|
+
'trailing': false,
|
|
455
|
+
},
|
|
456
|
+
'fetchOpenOrders': {
|
|
457
|
+
'marginMode': false,
|
|
458
|
+
'limit': 100,
|
|
459
|
+
'trigger': true,
|
|
460
|
+
'trailing': false,
|
|
461
|
+
'marketType': true,
|
|
462
|
+
},
|
|
463
|
+
'fetchOrders': undefined,
|
|
464
|
+
'fetchClosedOrders': undefined,
|
|
465
|
+
'fetchOHLCV': {
|
|
466
|
+
'limit': 1000,
|
|
467
|
+
},
|
|
468
|
+
},
|
|
469
|
+
'spot': {
|
|
470
|
+
'extends': 'default',
|
|
471
|
+
},
|
|
472
|
+
'forDerivatives': {
|
|
473
|
+
'extends': 'default',
|
|
474
|
+
'createOrder': {
|
|
475
|
+
// todo check
|
|
476
|
+
'attachedStopLossTakeProfit': {
|
|
477
|
+
'triggerPriceType': undefined,
|
|
478
|
+
'price': false,
|
|
479
|
+
},
|
|
480
|
+
},
|
|
481
|
+
'fetchMyTrades': {
|
|
482
|
+
'limit': 100,
|
|
483
|
+
},
|
|
484
|
+
},
|
|
485
|
+
'swap': {
|
|
486
|
+
'linear': {
|
|
487
|
+
'extends': 'forDerivatives',
|
|
488
|
+
},
|
|
489
|
+
'inverse': {
|
|
490
|
+
'extends': 'forDerivatives',
|
|
491
|
+
},
|
|
492
|
+
},
|
|
493
|
+
'future': {
|
|
494
|
+
'linear': undefined,
|
|
495
|
+
'inverse': undefined,
|
|
496
|
+
},
|
|
497
|
+
},
|
|
413
498
|
'commonCurrencies': {},
|
|
414
499
|
'exceptions': {
|
|
415
500
|
'exact': {
|
|
@@ -2650,8 +2735,7 @@ class coincatch extends coincatch$1 {
|
|
|
2650
2735
|
* @method
|
|
2651
2736
|
* @name coincatch#createOrders
|
|
2652
2737
|
* @description create a list of trade orders (all orders should be of the same symbol)
|
|
2653
|
-
* @see https://
|
|
2654
|
-
* @see https://hashkeyglobal-apidoc.readme.io/reference/batch-create-new-futures-order
|
|
2738
|
+
* @see https://coincatch.github.io/github.io/en/spot/#batch-order
|
|
2655
2739
|
* @param {Array} orders list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params (max 50 entries)
|
|
2656
2740
|
* @param {object} [params] extra parameters specific to the api endpoint
|
|
2657
2741
|
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
@@ -152,6 +152,58 @@ class coincheck extends coincheck$1 {
|
|
|
152
152
|
// 'LTC/BTC': { 'id': 'ltc_btc', 'symbol': 'LTC/BTC', 'base': 'LTC', 'quote': 'BTC', 'baseId': 'ltc', 'quoteId': 'btc' },
|
|
153
153
|
// 'DASH/BTC': { 'id': 'dash_btc', 'symbol': 'DASH/BTC', 'base': 'DASH', 'quote': 'BTC', 'baseId': 'dash', 'quoteId': 'btc' },
|
|
154
154
|
},
|
|
155
|
+
'features': {
|
|
156
|
+
'spot': {
|
|
157
|
+
'sandbox': false,
|
|
158
|
+
'createOrder': {
|
|
159
|
+
'marginMode': false,
|
|
160
|
+
'triggerPrice': false,
|
|
161
|
+
'triggerPriceType': undefined,
|
|
162
|
+
'triggerDirection': false,
|
|
163
|
+
'stopLossPrice': false,
|
|
164
|
+
'takeProfitPrice': false,
|
|
165
|
+
'attachedStopLossTakeProfit': undefined,
|
|
166
|
+
'timeInForce': {
|
|
167
|
+
'IOC': false,
|
|
168
|
+
'FOK': false,
|
|
169
|
+
'PO': true,
|
|
170
|
+
'GTD': false,
|
|
171
|
+
},
|
|
172
|
+
'hedged': false,
|
|
173
|
+
'trailing': false,
|
|
174
|
+
'leverage': false,
|
|
175
|
+
'marketBuyByCost': false,
|
|
176
|
+
'marketBuyRequiresPrice': false,
|
|
177
|
+
'selfTradePrevention': false,
|
|
178
|
+
'iceberg': false,
|
|
179
|
+
},
|
|
180
|
+
'createOrders': undefined,
|
|
181
|
+
'fetchMyTrades': {
|
|
182
|
+
'marginMode': false,
|
|
183
|
+
'limit': undefined,
|
|
184
|
+
'daysBack': undefined,
|
|
185
|
+
'untilDays': undefined,
|
|
186
|
+
},
|
|
187
|
+
'fetchOrder': undefined,
|
|
188
|
+
'fetchOpenOrders': {
|
|
189
|
+
'marginMode': false,
|
|
190
|
+
'limit': undefined,
|
|
191
|
+
'trigger': false,
|
|
192
|
+
'trailing': false,
|
|
193
|
+
},
|
|
194
|
+
'fetchOrders': undefined,
|
|
195
|
+
'fetchClosedOrders': undefined,
|
|
196
|
+
'fetchOHLCV': undefined,
|
|
197
|
+
},
|
|
198
|
+
'swap': {
|
|
199
|
+
'linear': undefined,
|
|
200
|
+
'inverse': undefined,
|
|
201
|
+
},
|
|
202
|
+
'future': {
|
|
203
|
+
'linear': undefined,
|
|
204
|
+
'inverse': undefined,
|
|
205
|
+
},
|
|
206
|
+
},
|
|
155
207
|
'fees': {
|
|
156
208
|
'trading': {
|
|
157
209
|
'tierBased': false,
|