ccxt 4.4.28 → 4.4.29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/base/Exchange.js +3 -0
- package/dist/cjs/src/bitget.js +99 -6
- package/dist/cjs/src/bitopro.js +21 -21
- package/dist/cjs/src/bitrue.js +28 -28
- package/dist/cjs/src/bitvavo.js +4 -0
- package/dist/cjs/src/bybit.js +51 -646
- package/dist/cjs/src/coincatch.js +24 -4
- package/dist/cjs/src/lbank.js +7 -1
- package/dist/cjs/src/pro/bitvavo.js +2 -1
- package/dist/cjs/src/pro/mexc.js +198 -30
- package/dist/cjs/src/vertex.js +51 -6
- package/examples/README.md +0 -2
- package/examples/js/cli.js +7 -0
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/bybit.d.ts +0 -13
- package/js/src/base/Exchange.d.ts +1 -0
- package/js/src/base/Exchange.js +3 -0
- package/js/src/bitfinex2.d.ts +1 -1
- package/js/src/bitget.d.ts +2 -1
- package/js/src/bitget.js +99 -6
- package/js/src/bitmart.d.ts +1 -1
- package/js/src/bitopro.js +21 -21
- package/js/src/bitrue.js +28 -28
- package/js/src/bitvavo.js +4 -0
- package/js/src/bybit.d.ts +0 -8
- package/js/src/bybit.js +51 -646
- package/js/src/coincatch.d.ts +1 -1
- package/js/src/coincatch.js +24 -4
- package/js/src/lbank.js +7 -1
- package/js/src/pro/bitvavo.js +2 -1
- package/js/src/pro/mexc.js +198 -30
- package/js/src/vertex.d.ts +4 -2
- package/js/src/vertex.js +51 -6
- package/js/src/whitebit.d.ts +1 -1
- package/package.json +1 -1
package/dist/cjs/ccxt.js
CHANGED
|
@@ -197,7 +197,7 @@ var xt$1 = require('./src/pro/xt.js');
|
|
|
197
197
|
|
|
198
198
|
//-----------------------------------------------------------------------------
|
|
199
199
|
// this is updated by vss.js when building
|
|
200
|
-
const version = '4.4.
|
|
200
|
+
const version = '4.4.29';
|
|
201
201
|
Exchange["default"].ccxtVersion = version;
|
|
202
202
|
const exchanges = {
|
|
203
203
|
'ace': ace,
|
|
@@ -2069,6 +2069,9 @@ class Exchange {
|
|
|
2069
2069
|
async fetchOrderBook(symbol, limit = undefined, params = {}) {
|
|
2070
2070
|
throw new errors.NotSupported(this.id + ' fetchOrderBook() is not supported yet');
|
|
2071
2071
|
}
|
|
2072
|
+
async fetchOrderBookWs(symbol, limit = undefined, params = {}) {
|
|
2073
|
+
throw new errors.NotSupported(this.id + ' fetchOrderBookWs() is not supported yet');
|
|
2074
|
+
}
|
|
2072
2075
|
async fetchMarginMode(symbol, params = {}) {
|
|
2073
2076
|
if (this.has['fetchMarginModes']) {
|
|
2074
2077
|
const marginModes = await this.fetchMarginModes([symbol], params);
|
package/dist/cjs/src/bitget.js
CHANGED
|
@@ -84,7 +84,7 @@ class bitget extends bitget$1 {
|
|
|
84
84
|
'fetchFundingIntervals': false,
|
|
85
85
|
'fetchFundingRate': true,
|
|
86
86
|
'fetchFundingRateHistory': true,
|
|
87
|
-
'fetchFundingRates':
|
|
87
|
+
'fetchFundingRates': true,
|
|
88
88
|
'fetchIndexOHLCV': true,
|
|
89
89
|
'fetchIsolatedBorrowRate': true,
|
|
90
90
|
'fetchIsolatedBorrowRates': false,
|
|
@@ -6846,6 +6846,71 @@ class bitget extends bitget$1 {
|
|
|
6846
6846
|
const data = this.safeValue(response, 'data', []);
|
|
6847
6847
|
return this.parseFundingRate(data[0], market);
|
|
6848
6848
|
}
|
|
6849
|
+
async fetchFundingRates(symbols = undefined, params = {}) {
|
|
6850
|
+
/**
|
|
6851
|
+
* @method
|
|
6852
|
+
* @name bitget#fetchFundingRates
|
|
6853
|
+
* @description fetch the current funding rates for all markets
|
|
6854
|
+
* @see https://www.bitget.com/api-doc/contract/market/Get-All-Symbol-Ticker
|
|
6855
|
+
* @param {string[]} [symbols] list of unified market symbols
|
|
6856
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6857
|
+
* @param {string} [params.subType] *contract only* 'linear', 'inverse'
|
|
6858
|
+
* @param {string} [params.productType] *contract only* 'USDT-FUTURES', 'USDC-FUTURES', 'COIN-FUTURES', 'SUSDT-FUTURES', 'SUSDC-FUTURES' or 'SCOIN-FUTURES'
|
|
6859
|
+
* @returns {object} a dictionary of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rates-structure}, indexed by market symbols
|
|
6860
|
+
*/
|
|
6861
|
+
await this.loadMarkets();
|
|
6862
|
+
let market = undefined;
|
|
6863
|
+
if (symbols !== undefined) {
|
|
6864
|
+
const symbol = this.safeValue(symbols, 0);
|
|
6865
|
+
const sandboxMode = this.safeBool(this.options, 'sandboxMode', false);
|
|
6866
|
+
if (sandboxMode) {
|
|
6867
|
+
const sandboxSymbol = this.convertSymbolForSandbox(symbol);
|
|
6868
|
+
market = this.market(sandboxSymbol);
|
|
6869
|
+
}
|
|
6870
|
+
else {
|
|
6871
|
+
market = this.market(symbol);
|
|
6872
|
+
}
|
|
6873
|
+
}
|
|
6874
|
+
const request = {};
|
|
6875
|
+
let productType = undefined;
|
|
6876
|
+
[productType, params] = this.handleProductTypeAndParams(market, params);
|
|
6877
|
+
request['productType'] = productType;
|
|
6878
|
+
const response = await this.publicMixGetV2MixMarketTickers(this.extend(request, params));
|
|
6879
|
+
// {
|
|
6880
|
+
// "code": "00000",
|
|
6881
|
+
// "msg": "success",
|
|
6882
|
+
// "requestTime": 1700533773477,
|
|
6883
|
+
// "data": [
|
|
6884
|
+
// {
|
|
6885
|
+
// "symbol": "BTCUSD",
|
|
6886
|
+
// "lastPr": "29904.5",
|
|
6887
|
+
// "askPr": "29904.5",
|
|
6888
|
+
// "bidPr": "29903.5",
|
|
6889
|
+
// "bidSz": "0.5091",
|
|
6890
|
+
// "askSz": "2.2694",
|
|
6891
|
+
// "high24h": "0",
|
|
6892
|
+
// "low24h": "0",
|
|
6893
|
+
// "ts": "1695794271400",
|
|
6894
|
+
// "change24h": "0",
|
|
6895
|
+
// "baseVolume": "0",
|
|
6896
|
+
// "quoteVolume": "0",
|
|
6897
|
+
// "usdtVolume": "0",
|
|
6898
|
+
// "openUtc": "0",
|
|
6899
|
+
// "changeUtc24h": "0",
|
|
6900
|
+
// "indexPrice": "29132.353333",
|
|
6901
|
+
// "fundingRate": "-0.0007",
|
|
6902
|
+
// "holdingAmount": "125.6844",
|
|
6903
|
+
// "deliveryStartTime": null,
|
|
6904
|
+
// "deliveryTime": null,
|
|
6905
|
+
// "deliveryStatus": "delivery_normal",
|
|
6906
|
+
// "open24h": "0",
|
|
6907
|
+
// "markPrice": "12345"
|
|
6908
|
+
// },
|
|
6909
|
+
// ]
|
|
6910
|
+
// }
|
|
6911
|
+
const data = this.safeList(response, 'data', []);
|
|
6912
|
+
return this.parseFundingRates(data, market);
|
|
6913
|
+
}
|
|
6849
6914
|
parseFundingRate(contract, market = undefined) {
|
|
6850
6915
|
//
|
|
6851
6916
|
// fetchFundingRate
|
|
@@ -6862,11 +6927,39 @@ class bitget extends bitget$1 {
|
|
|
6862
6927
|
// "nextFundingTime": "1727942400000",
|
|
6863
6928
|
// "ratePeriod": "8"
|
|
6864
6929
|
// }
|
|
6865
|
-
//
|
|
6930
|
+
// fetchFundingRates
|
|
6931
|
+
// {
|
|
6932
|
+
// "symbol": "BTCUSD",
|
|
6933
|
+
// "lastPr": "29904.5",
|
|
6934
|
+
// "askPr": "29904.5",
|
|
6935
|
+
// "bidPr": "29903.5",
|
|
6936
|
+
// "bidSz": "0.5091",
|
|
6937
|
+
// "askSz": "2.2694",
|
|
6938
|
+
// "high24h": "0",
|
|
6939
|
+
// "low24h": "0",
|
|
6940
|
+
// "ts": "1695794271400",
|
|
6941
|
+
// "change24h": "0",
|
|
6942
|
+
// "baseVolume": "0",
|
|
6943
|
+
// "quoteVolume": "0",
|
|
6944
|
+
// "usdtVolume": "0",
|
|
6945
|
+
// "openUtc": "0",
|
|
6946
|
+
// "changeUtc24h": "0",
|
|
6947
|
+
// "indexPrice": "29132.353333",
|
|
6948
|
+
// "fundingRate": "-0.0007",
|
|
6949
|
+
// "holdingAmount": "125.6844",
|
|
6950
|
+
// "deliveryStartTime": null,
|
|
6951
|
+
// "deliveryTime": null,
|
|
6952
|
+
// "deliveryStatus": "delivery_normal",
|
|
6953
|
+
// "open24h": "0",
|
|
6954
|
+
// "markPrice": "12345"
|
|
6955
|
+
// }
|
|
6866
6956
|
const marketId = this.safeString(contract, 'symbol');
|
|
6867
6957
|
const symbol = this.safeSymbol(marketId, market, undefined, 'swap');
|
|
6868
6958
|
const fundingTimestamp = this.safeInteger(contract, 'nextFundingTime');
|
|
6869
6959
|
const interval = this.safeString(contract, 'ratePeriod');
|
|
6960
|
+
const timestamp = this.safeInteger(contract, 'ts');
|
|
6961
|
+
const markPrice = this.safeNumber(contract, 'markPrice');
|
|
6962
|
+
const indexPrice = this.safeNumber(contract, 'indexPrice');
|
|
6870
6963
|
let intervalString = undefined;
|
|
6871
6964
|
if (interval !== undefined) {
|
|
6872
6965
|
intervalString = interval + 'h';
|
|
@@ -6874,12 +6967,12 @@ class bitget extends bitget$1 {
|
|
|
6874
6967
|
return {
|
|
6875
6968
|
'info': contract,
|
|
6876
6969
|
'symbol': symbol,
|
|
6877
|
-
'markPrice':
|
|
6878
|
-
'indexPrice':
|
|
6970
|
+
'markPrice': markPrice,
|
|
6971
|
+
'indexPrice': indexPrice,
|
|
6879
6972
|
'interestRate': undefined,
|
|
6880
6973
|
'estimatedSettlePrice': undefined,
|
|
6881
|
-
'timestamp':
|
|
6882
|
-
'datetime':
|
|
6974
|
+
'timestamp': timestamp,
|
|
6975
|
+
'datetime': this.iso8601(timestamp),
|
|
6883
6976
|
'fundingRate': this.safeNumber(contract, 'fundingRate'),
|
|
6884
6977
|
'fundingTimestamp': fundingTimestamp,
|
|
6885
6978
|
'fundingDatetime': this.iso8601(fundingTimestamp),
|
package/dist/cjs/src/bitopro.js
CHANGED
|
@@ -226,7 +226,7 @@ class bitopro extends bitopro$1 {
|
|
|
226
226
|
* @returns {object} an associative dictionary of currencies
|
|
227
227
|
*/
|
|
228
228
|
const response = await this.publicGetProvisioningCurrencies(params);
|
|
229
|
-
const currencies = this.
|
|
229
|
+
const currencies = this.safeList(response, 'data', []);
|
|
230
230
|
//
|
|
231
231
|
// {
|
|
232
232
|
// "data":[
|
|
@@ -248,8 +248,8 @@ class bitopro extends bitopro$1 {
|
|
|
248
248
|
const currency = currencies[i];
|
|
249
249
|
const currencyId = this.safeString(currency, 'currency');
|
|
250
250
|
const code = this.safeCurrencyCode(currencyId);
|
|
251
|
-
const deposit = this.
|
|
252
|
-
const withdraw = this.
|
|
251
|
+
const deposit = this.safeBool(currency, 'deposit');
|
|
252
|
+
const withdraw = this.safeBool(currency, 'withdraw');
|
|
253
253
|
const fee = this.safeNumber(currency, 'withdrawFee');
|
|
254
254
|
const withdrawMin = this.safeNumber(currency, 'minWithdraw');
|
|
255
255
|
const withdrawMax = this.safeNumber(currency, 'maxWithdraw');
|
|
@@ -289,7 +289,7 @@ class bitopro extends bitopro$1 {
|
|
|
289
289
|
* @returns {object[]} an array of objects representing market data
|
|
290
290
|
*/
|
|
291
291
|
const response = await this.publicGetProvisioningTradingPairs();
|
|
292
|
-
const markets = this.
|
|
292
|
+
const markets = this.safeList(response, 'data', []);
|
|
293
293
|
//
|
|
294
294
|
// {
|
|
295
295
|
// "data":[
|
|
@@ -313,7 +313,7 @@ class bitopro extends bitopro$1 {
|
|
|
313
313
|
return this.parseMarkets(markets);
|
|
314
314
|
}
|
|
315
315
|
parseMarket(market) {
|
|
316
|
-
const active = !this.
|
|
316
|
+
const active = !this.safeBool(market, 'maintain');
|
|
317
317
|
const id = this.safeString(market, 'pair');
|
|
318
318
|
const uppercaseId = id.toUpperCase();
|
|
319
319
|
const baseId = this.safeString(market, 'base');
|
|
@@ -427,7 +427,7 @@ class bitopro extends bitopro$1 {
|
|
|
427
427
|
'pair': market['id'],
|
|
428
428
|
};
|
|
429
429
|
const response = await this.publicGetTickersPair(this.extend(request, params));
|
|
430
|
-
const ticker = this.
|
|
430
|
+
const ticker = this.safeDict(response, 'data', {});
|
|
431
431
|
//
|
|
432
432
|
// {
|
|
433
433
|
// "data":{
|
|
@@ -455,7 +455,7 @@ class bitopro extends bitopro$1 {
|
|
|
455
455
|
*/
|
|
456
456
|
await this.loadMarkets();
|
|
457
457
|
const response = await this.publicGetTickers();
|
|
458
|
-
const tickers = this.
|
|
458
|
+
const tickers = this.safeList(response, 'data', []);
|
|
459
459
|
//
|
|
460
460
|
// {
|
|
461
461
|
// "data":[
|
|
@@ -556,7 +556,7 @@ class bitopro extends bitopro$1 {
|
|
|
556
556
|
const type = this.safeStringLower(trade, 'type');
|
|
557
557
|
let side = this.safeStringLower(trade, 'action');
|
|
558
558
|
if (side === undefined) {
|
|
559
|
-
const isBuyer = this.
|
|
559
|
+
const isBuyer = this.safeBool(trade, 'isBuyer');
|
|
560
560
|
if (isBuyer) {
|
|
561
561
|
side = 'buy';
|
|
562
562
|
}
|
|
@@ -578,7 +578,7 @@ class bitopro extends bitopro$1 {
|
|
|
578
578
|
'rate': undefined,
|
|
579
579
|
};
|
|
580
580
|
}
|
|
581
|
-
const isTaker = this.
|
|
581
|
+
const isTaker = this.safeBool(trade, 'isTaker');
|
|
582
582
|
let takerOrMaker = undefined;
|
|
583
583
|
if (isTaker !== undefined) {
|
|
584
584
|
if (isTaker) {
|
|
@@ -622,7 +622,7 @@ class bitopro extends bitopro$1 {
|
|
|
622
622
|
'pair': market['id'],
|
|
623
623
|
};
|
|
624
624
|
const response = await this.publicGetTradesPair(this.extend(request, params));
|
|
625
|
-
const trades = this.
|
|
625
|
+
const trades = this.safeList(response, 'data', []);
|
|
626
626
|
//
|
|
627
627
|
// {
|
|
628
628
|
// "data":[
|
|
@@ -648,7 +648,7 @@ class bitopro extends bitopro$1 {
|
|
|
648
648
|
*/
|
|
649
649
|
await this.loadMarkets();
|
|
650
650
|
const response = await this.publicGetProvisioningLimitationsAndFees(params);
|
|
651
|
-
const tradingFeeRate = this.
|
|
651
|
+
const tradingFeeRate = this.safeDict(response, 'tradingFeeRate', {});
|
|
652
652
|
const first = this.safeValue(tradingFeeRate, 0);
|
|
653
653
|
//
|
|
654
654
|
// {
|
|
@@ -777,7 +777,7 @@ class bitopro extends bitopro$1 {
|
|
|
777
777
|
request['to'] = this.sum(request['from'], limit * timeframeInSeconds);
|
|
778
778
|
}
|
|
779
779
|
const response = await this.publicGetTradingHistoryPair(this.extend(request, params));
|
|
780
|
-
const data = this.
|
|
780
|
+
const data = this.safeList(response, 'data', []);
|
|
781
781
|
//
|
|
782
782
|
// {
|
|
783
783
|
// "data":[
|
|
@@ -874,7 +874,7 @@ class bitopro extends bitopro$1 {
|
|
|
874
874
|
*/
|
|
875
875
|
await this.loadMarkets();
|
|
876
876
|
const response = await this.privateGetAccountsBalance(params);
|
|
877
|
-
const balances = this.
|
|
877
|
+
const balances = this.safeList(response, 'data', []);
|
|
878
878
|
//
|
|
879
879
|
// {
|
|
880
880
|
// "data":[
|
|
@@ -1157,7 +1157,7 @@ class bitopro extends bitopro$1 {
|
|
|
1157
1157
|
else {
|
|
1158
1158
|
response = await this.privateDeleteOrdersAll(this.extend(request, params));
|
|
1159
1159
|
}
|
|
1160
|
-
const data = this.
|
|
1160
|
+
const data = this.safeDict(response, 'data', {});
|
|
1161
1161
|
//
|
|
1162
1162
|
// {
|
|
1163
1163
|
// "data":{
|
|
@@ -1247,7 +1247,7 @@ class bitopro extends bitopro$1 {
|
|
|
1247
1247
|
request['limit'] = limit;
|
|
1248
1248
|
}
|
|
1249
1249
|
const response = await this.privateGetOrdersAllPair(this.extend(request, params));
|
|
1250
|
-
let orders = this.
|
|
1250
|
+
let orders = this.safeList(response, 'data', []);
|
|
1251
1251
|
if (orders === undefined) {
|
|
1252
1252
|
orders = [];
|
|
1253
1253
|
}
|
|
@@ -1323,7 +1323,7 @@ class bitopro extends bitopro$1 {
|
|
|
1323
1323
|
'pair': market['id'],
|
|
1324
1324
|
};
|
|
1325
1325
|
const response = await this.privateGetOrdersTradesPair(this.extend(request, params));
|
|
1326
|
-
const trades = this.
|
|
1326
|
+
const trades = this.safeList(response, 'data', []);
|
|
1327
1327
|
//
|
|
1328
1328
|
// {
|
|
1329
1329
|
// "data":[
|
|
@@ -1471,7 +1471,7 @@ class bitopro extends bitopro$1 {
|
|
|
1471
1471
|
request['limit'] = limit;
|
|
1472
1472
|
}
|
|
1473
1473
|
const response = await this.privateGetWalletDepositHistoryCurrency(this.extend(request, params));
|
|
1474
|
-
const result = this.
|
|
1474
|
+
const result = this.safeList(response, 'data', []);
|
|
1475
1475
|
//
|
|
1476
1476
|
// {
|
|
1477
1477
|
// "data":[
|
|
@@ -1523,7 +1523,7 @@ class bitopro extends bitopro$1 {
|
|
|
1523
1523
|
request['limit'] = limit;
|
|
1524
1524
|
}
|
|
1525
1525
|
const response = await this.privateGetWalletWithdrawHistoryCurrency(this.extend(request, params));
|
|
1526
|
-
const result = this.
|
|
1526
|
+
const result = this.safeList(response, 'data', []);
|
|
1527
1527
|
//
|
|
1528
1528
|
// {
|
|
1529
1529
|
// "data":[
|
|
@@ -1565,7 +1565,7 @@ class bitopro extends bitopro$1 {
|
|
|
1565
1565
|
'currency': currency['id'],
|
|
1566
1566
|
};
|
|
1567
1567
|
const response = await this.privateGetWalletWithdrawCurrencySerial(this.extend(request, params));
|
|
1568
|
-
const result = this.
|
|
1568
|
+
const result = this.safeDict(response, 'data', {});
|
|
1569
1569
|
//
|
|
1570
1570
|
// {
|
|
1571
1571
|
// "data":{
|
|
@@ -1607,7 +1607,7 @@ class bitopro extends bitopro$1 {
|
|
|
1607
1607
|
'address': address,
|
|
1608
1608
|
};
|
|
1609
1609
|
if ('network' in params) {
|
|
1610
|
-
const networks = this.
|
|
1610
|
+
const networks = this.safeDict(this.options, 'networks', {});
|
|
1611
1611
|
const requestedNetwork = this.safeStringUpper(params, 'network');
|
|
1612
1612
|
params = this.omit(params, ['network']);
|
|
1613
1613
|
const networkId = this.safeString(networks, requestedNetwork);
|
|
@@ -1620,7 +1620,7 @@ class bitopro extends bitopro$1 {
|
|
|
1620
1620
|
request['message'] = tag;
|
|
1621
1621
|
}
|
|
1622
1622
|
const response = await this.privatePostWalletWithdrawCurrency(this.extend(request, params));
|
|
1623
|
-
const result = this.
|
|
1623
|
+
const result = this.safeDict(response, 'data', {});
|
|
1624
1624
|
//
|
|
1625
1625
|
// {
|
|
1626
1626
|
// "data":{
|
package/dist/cjs/src/bitrue.js
CHANGED
|
@@ -619,7 +619,7 @@ class bitrue extends bitrue$1 {
|
|
|
619
619
|
// }
|
|
620
620
|
//
|
|
621
621
|
const result = {};
|
|
622
|
-
const coins = this.
|
|
622
|
+
const coins = this.safeList(response, 'coins', []);
|
|
623
623
|
for (let i = 0; i < coins.length; i++) {
|
|
624
624
|
const currency = coins[i];
|
|
625
625
|
const id = this.safeString(currency, 'coin');
|
|
@@ -630,15 +630,15 @@ class bitrue extends bitrue$1 {
|
|
|
630
630
|
let minWithdrawString = undefined;
|
|
631
631
|
let maxWithdrawString = undefined;
|
|
632
632
|
let minWithdrawFeeString = undefined;
|
|
633
|
-
const networkDetails = this.
|
|
633
|
+
const networkDetails = this.safeList(currency, 'chainDetail', []);
|
|
634
634
|
const networks = {};
|
|
635
635
|
for (let j = 0; j < networkDetails.length; j++) {
|
|
636
636
|
const entry = networkDetails[j];
|
|
637
637
|
const networkId = this.safeString(entry, 'chain');
|
|
638
638
|
const network = this.networkIdToCode(networkId, code);
|
|
639
|
-
const enableDeposit = this.
|
|
639
|
+
const enableDeposit = this.safeBool(entry, 'enableDeposit');
|
|
640
640
|
deposit = (enableDeposit) ? enableDeposit : deposit;
|
|
641
|
-
const enableWithdraw = this.
|
|
641
|
+
const enableWithdraw = this.safeBool(entry, 'enableWithdraw');
|
|
642
642
|
withdraw = (enableWithdraw) ? enableWithdraw : withdraw;
|
|
643
643
|
const networkWithdrawFeeString = this.safeString(entry, 'withdrawFee');
|
|
644
644
|
if (networkWithdrawFeeString !== undefined) {
|
|
@@ -833,11 +833,11 @@ class bitrue extends bitrue$1 {
|
|
|
833
833
|
if (settle !== undefined) {
|
|
834
834
|
symbol += ':' + settle;
|
|
835
835
|
}
|
|
836
|
-
const filters = this.
|
|
836
|
+
const filters = this.safeList(market, 'filters', []);
|
|
837
837
|
const filtersByType = this.indexBy(filters, 'filterType');
|
|
838
838
|
const status = this.safeString(market, 'status');
|
|
839
|
-
const priceFilter = this.
|
|
840
|
-
const amountFilter = this.
|
|
839
|
+
const priceFilter = this.safeDict(filtersByType, 'PRICE_FILTER', {});
|
|
840
|
+
const amountFilter = this.safeDict(filtersByType, 'LOT_SIZE', {});
|
|
841
841
|
const defaultPricePrecision = this.safeString(market, 'pricePrecision');
|
|
842
842
|
const defaultAmountPrecision = this.safeString(market, 'quantityPrecision');
|
|
843
843
|
const pricePrecision = this.safeString(priceFilter, 'priceScale', defaultPricePrecision);
|
|
@@ -990,7 +990,7 @@ class bitrue extends bitrue$1 {
|
|
|
990
990
|
if (type === 'swap') {
|
|
991
991
|
if (subType !== undefined && subType === 'inverse') {
|
|
992
992
|
response = await this.dapiV2PrivateGetAccount(params);
|
|
993
|
-
result = this.
|
|
993
|
+
result = this.safeDict(response, 'data', {});
|
|
994
994
|
//
|
|
995
995
|
// {
|
|
996
996
|
// "code":"0",
|
|
@@ -1024,7 +1024,7 @@ class bitrue extends bitrue$1 {
|
|
|
1024
1024
|
}
|
|
1025
1025
|
else {
|
|
1026
1026
|
response = await this.fapiV2PrivateGetAccount(params);
|
|
1027
|
-
result = this.
|
|
1027
|
+
result = this.safeDict(response, 'data', {});
|
|
1028
1028
|
//
|
|
1029
1029
|
// {
|
|
1030
1030
|
// "code":"0",
|
|
@@ -1260,7 +1260,7 @@ class bitrue extends bitrue$1 {
|
|
|
1260
1260
|
'symbol': market['id'],
|
|
1261
1261
|
};
|
|
1262
1262
|
response = await this.spotV1PublicGetTicker24hr(this.extend(request, params));
|
|
1263
|
-
data = this.
|
|
1263
|
+
data = this.safeDict(response, 0, {});
|
|
1264
1264
|
}
|
|
1265
1265
|
else {
|
|
1266
1266
|
throw new errors.NotSupported(this.id + ' fetchTicker only support spot & swap markets');
|
|
@@ -1322,11 +1322,11 @@ class bitrue extends bitrue$1 {
|
|
|
1322
1322
|
*/
|
|
1323
1323
|
await this.loadMarkets();
|
|
1324
1324
|
const market = this.market(symbol);
|
|
1325
|
-
const timeframes = this.
|
|
1325
|
+
const timeframes = this.safeDict(this.options, 'timeframes', {});
|
|
1326
1326
|
let response = undefined;
|
|
1327
1327
|
let data = undefined;
|
|
1328
1328
|
if (market['swap']) {
|
|
1329
|
-
const timeframesFuture = this.
|
|
1329
|
+
const timeframesFuture = this.safeDict(timeframes, 'future', {});
|
|
1330
1330
|
const request = {
|
|
1331
1331
|
'contractName': market['id'],
|
|
1332
1332
|
// 1min / 5min / 15min / 30min / 1h / 1day / 1week / 1month
|
|
@@ -1344,7 +1344,7 @@ class bitrue extends bitrue$1 {
|
|
|
1344
1344
|
data = response;
|
|
1345
1345
|
}
|
|
1346
1346
|
else if (market['spot']) {
|
|
1347
|
-
const timeframesSpot = this.
|
|
1347
|
+
const timeframesSpot = this.safeDict(timeframes, 'spot', {});
|
|
1348
1348
|
const request = {
|
|
1349
1349
|
'symbol': market['id'],
|
|
1350
1350
|
// 1m / 5m / 15m / 30m / 1H / 2H / 4H / 12H / 1D / 1W
|
|
@@ -1357,7 +1357,7 @@ class bitrue extends bitrue$1 {
|
|
|
1357
1357
|
request['fromIdx'] = since;
|
|
1358
1358
|
}
|
|
1359
1359
|
response = await this.spotV1PublicGetMarketKline(this.extend(request, params));
|
|
1360
|
-
data = this.
|
|
1360
|
+
data = this.safeList(response, 'data', []);
|
|
1361
1361
|
}
|
|
1362
1362
|
else {
|
|
1363
1363
|
throw new errors.NotSupported(this.id + ' fetchOHLCV only support spot & swap markets');
|
|
@@ -1582,7 +1582,7 @@ class bitrue extends bitrue$1 {
|
|
|
1582
1582
|
// https://github.com/ccxt/ccxt/issues/13856
|
|
1583
1583
|
const tickers = {};
|
|
1584
1584
|
for (let i = 0; i < data.length; i++) {
|
|
1585
|
-
const ticker = this.
|
|
1585
|
+
const ticker = this.safeDict(data, i, {});
|
|
1586
1586
|
const market = this.market(this.safeValue(ticker, 'symbol'));
|
|
1587
1587
|
tickers[market['id']] = ticker;
|
|
1588
1588
|
}
|
|
@@ -1645,8 +1645,8 @@ class bitrue extends bitrue$1 {
|
|
|
1645
1645
|
const orderId = this.safeString(trade, 'orderId');
|
|
1646
1646
|
const id = this.safeString2(trade, 'id', 'tradeId');
|
|
1647
1647
|
let side = undefined;
|
|
1648
|
-
const buyerMaker = this.
|
|
1649
|
-
const isBuyer = this.
|
|
1648
|
+
const buyerMaker = this.safeBool(trade, 'isBuyerMaker'); // ignore "m" until Bitrue fixes api
|
|
1649
|
+
const isBuyer = this.safeBool(trade, 'isBuyer');
|
|
1650
1650
|
if (buyerMaker !== undefined) {
|
|
1651
1651
|
side = buyerMaker ? 'sell' : 'buy';
|
|
1652
1652
|
}
|
|
@@ -1661,7 +1661,7 @@ class bitrue extends bitrue$1 {
|
|
|
1661
1661
|
};
|
|
1662
1662
|
}
|
|
1663
1663
|
let takerOrMaker = undefined;
|
|
1664
|
-
const isMaker = this.
|
|
1664
|
+
const isMaker = this.safeBool(trade, 'isMaker');
|
|
1665
1665
|
if (isMaker !== undefined) {
|
|
1666
1666
|
takerOrMaker = isMaker ? 'maker' : 'taker';
|
|
1667
1667
|
}
|
|
@@ -1826,7 +1826,7 @@ class bitrue extends bitrue$1 {
|
|
|
1826
1826
|
const id = this.safeString(order, 'orderId');
|
|
1827
1827
|
let type = this.safeStringLower(order, 'type');
|
|
1828
1828
|
const side = this.safeStringLower(order, 'side');
|
|
1829
|
-
const fills = this.
|
|
1829
|
+
const fills = this.safeList(order, 'fills', []);
|
|
1830
1830
|
const clientOrderId = this.safeString(order, 'clientOrderId');
|
|
1831
1831
|
const timeInForce = this.safeString(order, 'timeInForce');
|
|
1832
1832
|
const postOnly = (type === 'limit_maker') || (timeInForce === 'GTX') || (type === 'post_only');
|
|
@@ -1973,7 +1973,7 @@ class bitrue extends bitrue$1 {
|
|
|
1973
1973
|
else if (market['inverse']) {
|
|
1974
1974
|
response = await this.dapiV2PrivatePostOrder(this.extend(request, params));
|
|
1975
1975
|
}
|
|
1976
|
-
data = this.
|
|
1976
|
+
data = this.safeDict(response, 'data', {});
|
|
1977
1977
|
}
|
|
1978
1978
|
else if (market['spot']) {
|
|
1979
1979
|
request['symbol'] = market['id'];
|
|
@@ -2063,7 +2063,7 @@ class bitrue extends bitrue$1 {
|
|
|
2063
2063
|
else if (market['inverse']) {
|
|
2064
2064
|
response = await this.dapiV2PrivateGetOrder(this.extend(request, params));
|
|
2065
2065
|
}
|
|
2066
|
-
data = this.
|
|
2066
|
+
data = this.safeDict(response, 'data', {});
|
|
2067
2067
|
}
|
|
2068
2068
|
else if (market['spot']) {
|
|
2069
2069
|
request['orderId'] = id; // spot market id is mandatory
|
|
@@ -2207,7 +2207,7 @@ class bitrue extends bitrue$1 {
|
|
|
2207
2207
|
else if (market['inverse']) {
|
|
2208
2208
|
response = await this.dapiV2PrivateGetOpenOrders(this.extend(request, params));
|
|
2209
2209
|
}
|
|
2210
|
-
data = this.
|
|
2210
|
+
data = this.safeList(response, 'data', []);
|
|
2211
2211
|
}
|
|
2212
2212
|
else if (market['spot']) {
|
|
2213
2213
|
request['symbol'] = market['id'];
|
|
@@ -2307,7 +2307,7 @@ class bitrue extends bitrue$1 {
|
|
|
2307
2307
|
else if (market['inverse']) {
|
|
2308
2308
|
response = await this.dapiV2PrivatePostCancel(this.extend(request, params));
|
|
2309
2309
|
}
|
|
2310
|
-
data = this.
|
|
2310
|
+
data = this.safeDict(response, 'data', {});
|
|
2311
2311
|
}
|
|
2312
2312
|
else if (market['spot']) {
|
|
2313
2313
|
request['symbol'] = market['id'];
|
|
@@ -2365,7 +2365,7 @@ class bitrue extends bitrue$1 {
|
|
|
2365
2365
|
else if (market['inverse']) {
|
|
2366
2366
|
response = await this.dapiV2PrivatePostAllOpenOrders(this.extend(request, params));
|
|
2367
2367
|
}
|
|
2368
|
-
data = this.
|
|
2368
|
+
data = this.safeList(response, 'data', []);
|
|
2369
2369
|
}
|
|
2370
2370
|
else {
|
|
2371
2371
|
throw new errors.NotSupported(this.id + ' cancelAllOrders only support future markets');
|
|
@@ -2420,7 +2420,7 @@ class bitrue extends bitrue$1 {
|
|
|
2420
2420
|
else if (market['inverse']) {
|
|
2421
2421
|
response = await this.dapiV2PrivateGetMyTrades(this.extend(request, params));
|
|
2422
2422
|
}
|
|
2423
|
-
data = this.
|
|
2423
|
+
data = this.safeList(response, 'data', []);
|
|
2424
2424
|
}
|
|
2425
2425
|
else if (market['spot']) {
|
|
2426
2426
|
request['symbol'] = market['id'];
|
|
@@ -2620,7 +2620,7 @@ class bitrue extends bitrue$1 {
|
|
|
2620
2620
|
'6': 'canceled',
|
|
2621
2621
|
},
|
|
2622
2622
|
};
|
|
2623
|
-
const statuses = this.
|
|
2623
|
+
const statuses = this.safeDict(statusesByType, type, {});
|
|
2624
2624
|
return this.safeString(statuses, status, status);
|
|
2625
2625
|
}
|
|
2626
2626
|
parseTransaction(transaction, currency = undefined) {
|
|
@@ -2811,7 +2811,7 @@ class bitrue extends bitrue$1 {
|
|
|
2811
2811
|
// "chainDetail": [ [Object] ]
|
|
2812
2812
|
// }
|
|
2813
2813
|
//
|
|
2814
|
-
const chainDetails = this.
|
|
2814
|
+
const chainDetails = this.safeList(fee, 'chainDetail', []);
|
|
2815
2815
|
const chainDetailLength = chainDetails.length;
|
|
2816
2816
|
const result = {
|
|
2817
2817
|
'info': fee,
|
|
@@ -2967,7 +2967,7 @@ class bitrue extends bitrue$1 {
|
|
|
2967
2967
|
*/
|
|
2968
2968
|
await this.loadMarkets();
|
|
2969
2969
|
const currency = this.currency(code);
|
|
2970
|
-
const accountTypes = this.
|
|
2970
|
+
const accountTypes = this.safeDict(this.options, 'accountsByType', {});
|
|
2971
2971
|
const fromId = this.safeString(accountTypes, fromAccount, fromAccount);
|
|
2972
2972
|
const toId = this.safeString(accountTypes, toAccount, toAccount);
|
|
2973
2973
|
const request = {
|
package/dist/cjs/src/bitvavo.js
CHANGED
|
@@ -1114,6 +1114,10 @@ class bitvavo extends bitvavo$1 {
|
|
|
1114
1114
|
if (postOnly) {
|
|
1115
1115
|
request['postOnly'] = true;
|
|
1116
1116
|
}
|
|
1117
|
+
const clientOrderId = this.safeString(params, 'clientOrderId');
|
|
1118
|
+
if (clientOrderId === undefined) {
|
|
1119
|
+
request['clientOrderId'] = this.uuid22();
|
|
1120
|
+
}
|
|
1117
1121
|
return this.extend(request, params);
|
|
1118
1122
|
}
|
|
1119
1123
|
async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
|