ccxt 4.4.28 → 4.4.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/README.md +3 -3
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/alpaca.js +59 -7
- package/dist/cjs/src/base/Exchange.js +3 -0
- package/dist/cjs/src/binance.js +9 -0
- package/dist/cjs/src/bitbns.js +12 -12
- package/dist/cjs/src/bitfinex.js +9 -9
- package/dist/cjs/src/bitget.js +99 -6
- package/dist/cjs/src/bitmart.js +53 -53
- 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/deribit.js +7 -3
- package/dist/cjs/src/hyperliquid.js +108 -4
- package/dist/cjs/src/lbank.js +7 -1
- package/dist/cjs/src/pro/bitvavo.js +2 -1
- package/dist/cjs/src/pro/blofin.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/alpaca.d.ts +1 -0
- package/js/src/abstract/binance.d.ts +9 -0
- package/js/src/abstract/binancecoinm.d.ts +9 -0
- package/js/src/abstract/binanceus.d.ts +9 -0
- package/js/src/abstract/binanceusdm.d.ts +9 -0
- package/js/src/abstract/bybit.d.ts +0 -13
- package/js/src/alpaca.d.ts +2 -0
- package/js/src/alpaca.js +59 -7
- package/js/src/base/Exchange.d.ts +1 -0
- package/js/src/base/Exchange.js +3 -0
- package/js/src/binance.js +9 -0
- package/js/src/bitbns.js +12 -12
- package/js/src/bitfinex.js +9 -9
- 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/bitmart.js +53 -53
- 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/deribit.js +7 -3
- package/js/src/hyperliquid.d.ts +3 -1
- package/js/src/hyperliquid.js +108 -4
- package/js/src/lbank.js +7 -1
- package/js/src/pro/bitvavo.js +2 -1
- package/js/src/pro/blofin.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/js/src/bitopro.js
CHANGED
|
@@ -229,7 +229,7 @@ export default class bitopro extends Exchange {
|
|
|
229
229
|
* @returns {object} an associative dictionary of currencies
|
|
230
230
|
*/
|
|
231
231
|
const response = await this.publicGetProvisioningCurrencies(params);
|
|
232
|
-
const currencies = this.
|
|
232
|
+
const currencies = this.safeList(response, 'data', []);
|
|
233
233
|
//
|
|
234
234
|
// {
|
|
235
235
|
// "data":[
|
|
@@ -251,8 +251,8 @@ export default class bitopro extends Exchange {
|
|
|
251
251
|
const currency = currencies[i];
|
|
252
252
|
const currencyId = this.safeString(currency, 'currency');
|
|
253
253
|
const code = this.safeCurrencyCode(currencyId);
|
|
254
|
-
const deposit = this.
|
|
255
|
-
const withdraw = this.
|
|
254
|
+
const deposit = this.safeBool(currency, 'deposit');
|
|
255
|
+
const withdraw = this.safeBool(currency, 'withdraw');
|
|
256
256
|
const fee = this.safeNumber(currency, 'withdrawFee');
|
|
257
257
|
const withdrawMin = this.safeNumber(currency, 'minWithdraw');
|
|
258
258
|
const withdrawMax = this.safeNumber(currency, 'maxWithdraw');
|
|
@@ -292,7 +292,7 @@ export default class bitopro extends Exchange {
|
|
|
292
292
|
* @returns {object[]} an array of objects representing market data
|
|
293
293
|
*/
|
|
294
294
|
const response = await this.publicGetProvisioningTradingPairs();
|
|
295
|
-
const markets = this.
|
|
295
|
+
const markets = this.safeList(response, 'data', []);
|
|
296
296
|
//
|
|
297
297
|
// {
|
|
298
298
|
// "data":[
|
|
@@ -316,7 +316,7 @@ export default class bitopro extends Exchange {
|
|
|
316
316
|
return this.parseMarkets(markets);
|
|
317
317
|
}
|
|
318
318
|
parseMarket(market) {
|
|
319
|
-
const active = !this.
|
|
319
|
+
const active = !this.safeBool(market, 'maintain');
|
|
320
320
|
const id = this.safeString(market, 'pair');
|
|
321
321
|
const uppercaseId = id.toUpperCase();
|
|
322
322
|
const baseId = this.safeString(market, 'base');
|
|
@@ -430,7 +430,7 @@ export default class bitopro extends Exchange {
|
|
|
430
430
|
'pair': market['id'],
|
|
431
431
|
};
|
|
432
432
|
const response = await this.publicGetTickersPair(this.extend(request, params));
|
|
433
|
-
const ticker = this.
|
|
433
|
+
const ticker = this.safeDict(response, 'data', {});
|
|
434
434
|
//
|
|
435
435
|
// {
|
|
436
436
|
// "data":{
|
|
@@ -458,7 +458,7 @@ export default class bitopro extends Exchange {
|
|
|
458
458
|
*/
|
|
459
459
|
await this.loadMarkets();
|
|
460
460
|
const response = await this.publicGetTickers();
|
|
461
|
-
const tickers = this.
|
|
461
|
+
const tickers = this.safeList(response, 'data', []);
|
|
462
462
|
//
|
|
463
463
|
// {
|
|
464
464
|
// "data":[
|
|
@@ -559,7 +559,7 @@ export default class bitopro extends Exchange {
|
|
|
559
559
|
const type = this.safeStringLower(trade, 'type');
|
|
560
560
|
let side = this.safeStringLower(trade, 'action');
|
|
561
561
|
if (side === undefined) {
|
|
562
|
-
const isBuyer = this.
|
|
562
|
+
const isBuyer = this.safeBool(trade, 'isBuyer');
|
|
563
563
|
if (isBuyer) {
|
|
564
564
|
side = 'buy';
|
|
565
565
|
}
|
|
@@ -581,7 +581,7 @@ export default class bitopro extends Exchange {
|
|
|
581
581
|
'rate': undefined,
|
|
582
582
|
};
|
|
583
583
|
}
|
|
584
|
-
const isTaker = this.
|
|
584
|
+
const isTaker = this.safeBool(trade, 'isTaker');
|
|
585
585
|
let takerOrMaker = undefined;
|
|
586
586
|
if (isTaker !== undefined) {
|
|
587
587
|
if (isTaker) {
|
|
@@ -625,7 +625,7 @@ export default class bitopro extends Exchange {
|
|
|
625
625
|
'pair': market['id'],
|
|
626
626
|
};
|
|
627
627
|
const response = await this.publicGetTradesPair(this.extend(request, params));
|
|
628
|
-
const trades = this.
|
|
628
|
+
const trades = this.safeList(response, 'data', []);
|
|
629
629
|
//
|
|
630
630
|
// {
|
|
631
631
|
// "data":[
|
|
@@ -651,7 +651,7 @@ export default class bitopro extends Exchange {
|
|
|
651
651
|
*/
|
|
652
652
|
await this.loadMarkets();
|
|
653
653
|
const response = await this.publicGetProvisioningLimitationsAndFees(params);
|
|
654
|
-
const tradingFeeRate = this.
|
|
654
|
+
const tradingFeeRate = this.safeDict(response, 'tradingFeeRate', {});
|
|
655
655
|
const first = this.safeValue(tradingFeeRate, 0);
|
|
656
656
|
//
|
|
657
657
|
// {
|
|
@@ -780,7 +780,7 @@ export default class bitopro extends Exchange {
|
|
|
780
780
|
request['to'] = this.sum(request['from'], limit * timeframeInSeconds);
|
|
781
781
|
}
|
|
782
782
|
const response = await this.publicGetTradingHistoryPair(this.extend(request, params));
|
|
783
|
-
const data = this.
|
|
783
|
+
const data = this.safeList(response, 'data', []);
|
|
784
784
|
//
|
|
785
785
|
// {
|
|
786
786
|
// "data":[
|
|
@@ -877,7 +877,7 @@ export default class bitopro extends Exchange {
|
|
|
877
877
|
*/
|
|
878
878
|
await this.loadMarkets();
|
|
879
879
|
const response = await this.privateGetAccountsBalance(params);
|
|
880
|
-
const balances = this.
|
|
880
|
+
const balances = this.safeList(response, 'data', []);
|
|
881
881
|
//
|
|
882
882
|
// {
|
|
883
883
|
// "data":[
|
|
@@ -1160,7 +1160,7 @@ export default class bitopro extends Exchange {
|
|
|
1160
1160
|
else {
|
|
1161
1161
|
response = await this.privateDeleteOrdersAll(this.extend(request, params));
|
|
1162
1162
|
}
|
|
1163
|
-
const data = this.
|
|
1163
|
+
const data = this.safeDict(response, 'data', {});
|
|
1164
1164
|
//
|
|
1165
1165
|
// {
|
|
1166
1166
|
// "data":{
|
|
@@ -1250,7 +1250,7 @@ export default class bitopro extends Exchange {
|
|
|
1250
1250
|
request['limit'] = limit;
|
|
1251
1251
|
}
|
|
1252
1252
|
const response = await this.privateGetOrdersAllPair(this.extend(request, params));
|
|
1253
|
-
let orders = this.
|
|
1253
|
+
let orders = this.safeList(response, 'data', []);
|
|
1254
1254
|
if (orders === undefined) {
|
|
1255
1255
|
orders = [];
|
|
1256
1256
|
}
|
|
@@ -1326,7 +1326,7 @@ export default class bitopro extends Exchange {
|
|
|
1326
1326
|
'pair': market['id'],
|
|
1327
1327
|
};
|
|
1328
1328
|
const response = await this.privateGetOrdersTradesPair(this.extend(request, params));
|
|
1329
|
-
const trades = this.
|
|
1329
|
+
const trades = this.safeList(response, 'data', []);
|
|
1330
1330
|
//
|
|
1331
1331
|
// {
|
|
1332
1332
|
// "data":[
|
|
@@ -1474,7 +1474,7 @@ export default class bitopro extends Exchange {
|
|
|
1474
1474
|
request['limit'] = limit;
|
|
1475
1475
|
}
|
|
1476
1476
|
const response = await this.privateGetWalletDepositHistoryCurrency(this.extend(request, params));
|
|
1477
|
-
const result = this.
|
|
1477
|
+
const result = this.safeList(response, 'data', []);
|
|
1478
1478
|
//
|
|
1479
1479
|
// {
|
|
1480
1480
|
// "data":[
|
|
@@ -1526,7 +1526,7 @@ export default class bitopro extends Exchange {
|
|
|
1526
1526
|
request['limit'] = limit;
|
|
1527
1527
|
}
|
|
1528
1528
|
const response = await this.privateGetWalletWithdrawHistoryCurrency(this.extend(request, params));
|
|
1529
|
-
const result = this.
|
|
1529
|
+
const result = this.safeList(response, 'data', []);
|
|
1530
1530
|
//
|
|
1531
1531
|
// {
|
|
1532
1532
|
// "data":[
|
|
@@ -1568,7 +1568,7 @@ export default class bitopro extends Exchange {
|
|
|
1568
1568
|
'currency': currency['id'],
|
|
1569
1569
|
};
|
|
1570
1570
|
const response = await this.privateGetWalletWithdrawCurrencySerial(this.extend(request, params));
|
|
1571
|
-
const result = this.
|
|
1571
|
+
const result = this.safeDict(response, 'data', {});
|
|
1572
1572
|
//
|
|
1573
1573
|
// {
|
|
1574
1574
|
// "data":{
|
|
@@ -1610,7 +1610,7 @@ export default class bitopro extends Exchange {
|
|
|
1610
1610
|
'address': address,
|
|
1611
1611
|
};
|
|
1612
1612
|
if ('network' in params) {
|
|
1613
|
-
const networks = this.
|
|
1613
|
+
const networks = this.safeDict(this.options, 'networks', {});
|
|
1614
1614
|
const requestedNetwork = this.safeStringUpper(params, 'network');
|
|
1615
1615
|
params = this.omit(params, ['network']);
|
|
1616
1616
|
const networkId = this.safeString(networks, requestedNetwork);
|
|
@@ -1623,7 +1623,7 @@ export default class bitopro extends Exchange {
|
|
|
1623
1623
|
request['message'] = tag;
|
|
1624
1624
|
}
|
|
1625
1625
|
const response = await this.privatePostWalletWithdrawCurrency(this.extend(request, params));
|
|
1626
|
-
const result = this.
|
|
1626
|
+
const result = this.safeDict(response, 'data', {});
|
|
1627
1627
|
//
|
|
1628
1628
|
// {
|
|
1629
1629
|
// "data":{
|
package/js/src/bitrue.js
CHANGED
|
@@ -622,7 +622,7 @@ export default class bitrue extends Exchange {
|
|
|
622
622
|
// }
|
|
623
623
|
//
|
|
624
624
|
const result = {};
|
|
625
|
-
const coins = this.
|
|
625
|
+
const coins = this.safeList(response, 'coins', []);
|
|
626
626
|
for (let i = 0; i < coins.length; i++) {
|
|
627
627
|
const currency = coins[i];
|
|
628
628
|
const id = this.safeString(currency, 'coin');
|
|
@@ -633,15 +633,15 @@ export default class bitrue extends Exchange {
|
|
|
633
633
|
let minWithdrawString = undefined;
|
|
634
634
|
let maxWithdrawString = undefined;
|
|
635
635
|
let minWithdrawFeeString = undefined;
|
|
636
|
-
const networkDetails = this.
|
|
636
|
+
const networkDetails = this.safeList(currency, 'chainDetail', []);
|
|
637
637
|
const networks = {};
|
|
638
638
|
for (let j = 0; j < networkDetails.length; j++) {
|
|
639
639
|
const entry = networkDetails[j];
|
|
640
640
|
const networkId = this.safeString(entry, 'chain');
|
|
641
641
|
const network = this.networkIdToCode(networkId, code);
|
|
642
|
-
const enableDeposit = this.
|
|
642
|
+
const enableDeposit = this.safeBool(entry, 'enableDeposit');
|
|
643
643
|
deposit = (enableDeposit) ? enableDeposit : deposit;
|
|
644
|
-
const enableWithdraw = this.
|
|
644
|
+
const enableWithdraw = this.safeBool(entry, 'enableWithdraw');
|
|
645
645
|
withdraw = (enableWithdraw) ? enableWithdraw : withdraw;
|
|
646
646
|
const networkWithdrawFeeString = this.safeString(entry, 'withdrawFee');
|
|
647
647
|
if (networkWithdrawFeeString !== undefined) {
|
|
@@ -836,11 +836,11 @@ export default class bitrue extends Exchange {
|
|
|
836
836
|
if (settle !== undefined) {
|
|
837
837
|
symbol += ':' + settle;
|
|
838
838
|
}
|
|
839
|
-
const filters = this.
|
|
839
|
+
const filters = this.safeList(market, 'filters', []);
|
|
840
840
|
const filtersByType = this.indexBy(filters, 'filterType');
|
|
841
841
|
const status = this.safeString(market, 'status');
|
|
842
|
-
const priceFilter = this.
|
|
843
|
-
const amountFilter = this.
|
|
842
|
+
const priceFilter = this.safeDict(filtersByType, 'PRICE_FILTER', {});
|
|
843
|
+
const amountFilter = this.safeDict(filtersByType, 'LOT_SIZE', {});
|
|
844
844
|
const defaultPricePrecision = this.safeString(market, 'pricePrecision');
|
|
845
845
|
const defaultAmountPrecision = this.safeString(market, 'quantityPrecision');
|
|
846
846
|
const pricePrecision = this.safeString(priceFilter, 'priceScale', defaultPricePrecision);
|
|
@@ -993,7 +993,7 @@ export default class bitrue extends Exchange {
|
|
|
993
993
|
if (type === 'swap') {
|
|
994
994
|
if (subType !== undefined && subType === 'inverse') {
|
|
995
995
|
response = await this.dapiV2PrivateGetAccount(params);
|
|
996
|
-
result = this.
|
|
996
|
+
result = this.safeDict(response, 'data', {});
|
|
997
997
|
//
|
|
998
998
|
// {
|
|
999
999
|
// "code":"0",
|
|
@@ -1027,7 +1027,7 @@ export default class bitrue extends Exchange {
|
|
|
1027
1027
|
}
|
|
1028
1028
|
else {
|
|
1029
1029
|
response = await this.fapiV2PrivateGetAccount(params);
|
|
1030
|
-
result = this.
|
|
1030
|
+
result = this.safeDict(response, 'data', {});
|
|
1031
1031
|
//
|
|
1032
1032
|
// {
|
|
1033
1033
|
// "code":"0",
|
|
@@ -1263,7 +1263,7 @@ export default class bitrue extends Exchange {
|
|
|
1263
1263
|
'symbol': market['id'],
|
|
1264
1264
|
};
|
|
1265
1265
|
response = await this.spotV1PublicGetTicker24hr(this.extend(request, params));
|
|
1266
|
-
data = this.
|
|
1266
|
+
data = this.safeDict(response, 0, {});
|
|
1267
1267
|
}
|
|
1268
1268
|
else {
|
|
1269
1269
|
throw new NotSupported(this.id + ' fetchTicker only support spot & swap markets');
|
|
@@ -1325,11 +1325,11 @@ export default class bitrue extends Exchange {
|
|
|
1325
1325
|
*/
|
|
1326
1326
|
await this.loadMarkets();
|
|
1327
1327
|
const market = this.market(symbol);
|
|
1328
|
-
const timeframes = this.
|
|
1328
|
+
const timeframes = this.safeDict(this.options, 'timeframes', {});
|
|
1329
1329
|
let response = undefined;
|
|
1330
1330
|
let data = undefined;
|
|
1331
1331
|
if (market['swap']) {
|
|
1332
|
-
const timeframesFuture = this.
|
|
1332
|
+
const timeframesFuture = this.safeDict(timeframes, 'future', {});
|
|
1333
1333
|
const request = {
|
|
1334
1334
|
'contractName': market['id'],
|
|
1335
1335
|
// 1min / 5min / 15min / 30min / 1h / 1day / 1week / 1month
|
|
@@ -1347,7 +1347,7 @@ export default class bitrue extends Exchange {
|
|
|
1347
1347
|
data = response;
|
|
1348
1348
|
}
|
|
1349
1349
|
else if (market['spot']) {
|
|
1350
|
-
const timeframesSpot = this.
|
|
1350
|
+
const timeframesSpot = this.safeDict(timeframes, 'spot', {});
|
|
1351
1351
|
const request = {
|
|
1352
1352
|
'symbol': market['id'],
|
|
1353
1353
|
// 1m / 5m / 15m / 30m / 1H / 2H / 4H / 12H / 1D / 1W
|
|
@@ -1360,7 +1360,7 @@ export default class bitrue extends Exchange {
|
|
|
1360
1360
|
request['fromIdx'] = since;
|
|
1361
1361
|
}
|
|
1362
1362
|
response = await this.spotV1PublicGetMarketKline(this.extend(request, params));
|
|
1363
|
-
data = this.
|
|
1363
|
+
data = this.safeList(response, 'data', []);
|
|
1364
1364
|
}
|
|
1365
1365
|
else {
|
|
1366
1366
|
throw new NotSupported(this.id + ' fetchOHLCV only support spot & swap markets');
|
|
@@ -1585,7 +1585,7 @@ export default class bitrue extends Exchange {
|
|
|
1585
1585
|
// https://github.com/ccxt/ccxt/issues/13856
|
|
1586
1586
|
const tickers = {};
|
|
1587
1587
|
for (let i = 0; i < data.length; i++) {
|
|
1588
|
-
const ticker = this.
|
|
1588
|
+
const ticker = this.safeDict(data, i, {});
|
|
1589
1589
|
const market = this.market(this.safeValue(ticker, 'symbol'));
|
|
1590
1590
|
tickers[market['id']] = ticker;
|
|
1591
1591
|
}
|
|
@@ -1648,8 +1648,8 @@ export default class bitrue extends Exchange {
|
|
|
1648
1648
|
const orderId = this.safeString(trade, 'orderId');
|
|
1649
1649
|
const id = this.safeString2(trade, 'id', 'tradeId');
|
|
1650
1650
|
let side = undefined;
|
|
1651
|
-
const buyerMaker = this.
|
|
1652
|
-
const isBuyer = this.
|
|
1651
|
+
const buyerMaker = this.safeBool(trade, 'isBuyerMaker'); // ignore "m" until Bitrue fixes api
|
|
1652
|
+
const isBuyer = this.safeBool(trade, 'isBuyer');
|
|
1653
1653
|
if (buyerMaker !== undefined) {
|
|
1654
1654
|
side = buyerMaker ? 'sell' : 'buy';
|
|
1655
1655
|
}
|
|
@@ -1664,7 +1664,7 @@ export default class bitrue extends Exchange {
|
|
|
1664
1664
|
};
|
|
1665
1665
|
}
|
|
1666
1666
|
let takerOrMaker = undefined;
|
|
1667
|
-
const isMaker = this.
|
|
1667
|
+
const isMaker = this.safeBool(trade, 'isMaker');
|
|
1668
1668
|
if (isMaker !== undefined) {
|
|
1669
1669
|
takerOrMaker = isMaker ? 'maker' : 'taker';
|
|
1670
1670
|
}
|
|
@@ -1829,7 +1829,7 @@ export default class bitrue extends Exchange {
|
|
|
1829
1829
|
const id = this.safeString(order, 'orderId');
|
|
1830
1830
|
let type = this.safeStringLower(order, 'type');
|
|
1831
1831
|
const side = this.safeStringLower(order, 'side');
|
|
1832
|
-
const fills = this.
|
|
1832
|
+
const fills = this.safeList(order, 'fills', []);
|
|
1833
1833
|
const clientOrderId = this.safeString(order, 'clientOrderId');
|
|
1834
1834
|
const timeInForce = this.safeString(order, 'timeInForce');
|
|
1835
1835
|
const postOnly = (type === 'limit_maker') || (timeInForce === 'GTX') || (type === 'post_only');
|
|
@@ -1976,7 +1976,7 @@ export default class bitrue extends Exchange {
|
|
|
1976
1976
|
else if (market['inverse']) {
|
|
1977
1977
|
response = await this.dapiV2PrivatePostOrder(this.extend(request, params));
|
|
1978
1978
|
}
|
|
1979
|
-
data = this.
|
|
1979
|
+
data = this.safeDict(response, 'data', {});
|
|
1980
1980
|
}
|
|
1981
1981
|
else if (market['spot']) {
|
|
1982
1982
|
request['symbol'] = market['id'];
|
|
@@ -2066,7 +2066,7 @@ export default class bitrue extends Exchange {
|
|
|
2066
2066
|
else if (market['inverse']) {
|
|
2067
2067
|
response = await this.dapiV2PrivateGetOrder(this.extend(request, params));
|
|
2068
2068
|
}
|
|
2069
|
-
data = this.
|
|
2069
|
+
data = this.safeDict(response, 'data', {});
|
|
2070
2070
|
}
|
|
2071
2071
|
else if (market['spot']) {
|
|
2072
2072
|
request['orderId'] = id; // spot market id is mandatory
|
|
@@ -2210,7 +2210,7 @@ export default class bitrue extends Exchange {
|
|
|
2210
2210
|
else if (market['inverse']) {
|
|
2211
2211
|
response = await this.dapiV2PrivateGetOpenOrders(this.extend(request, params));
|
|
2212
2212
|
}
|
|
2213
|
-
data = this.
|
|
2213
|
+
data = this.safeList(response, 'data', []);
|
|
2214
2214
|
}
|
|
2215
2215
|
else if (market['spot']) {
|
|
2216
2216
|
request['symbol'] = market['id'];
|
|
@@ -2310,7 +2310,7 @@ export default class bitrue extends Exchange {
|
|
|
2310
2310
|
else if (market['inverse']) {
|
|
2311
2311
|
response = await this.dapiV2PrivatePostCancel(this.extend(request, params));
|
|
2312
2312
|
}
|
|
2313
|
-
data = this.
|
|
2313
|
+
data = this.safeDict(response, 'data', {});
|
|
2314
2314
|
}
|
|
2315
2315
|
else if (market['spot']) {
|
|
2316
2316
|
request['symbol'] = market['id'];
|
|
@@ -2368,7 +2368,7 @@ export default class bitrue extends Exchange {
|
|
|
2368
2368
|
else if (market['inverse']) {
|
|
2369
2369
|
response = await this.dapiV2PrivatePostAllOpenOrders(this.extend(request, params));
|
|
2370
2370
|
}
|
|
2371
|
-
data = this.
|
|
2371
|
+
data = this.safeList(response, 'data', []);
|
|
2372
2372
|
}
|
|
2373
2373
|
else {
|
|
2374
2374
|
throw new NotSupported(this.id + ' cancelAllOrders only support future markets');
|
|
@@ -2423,7 +2423,7 @@ export default class bitrue extends Exchange {
|
|
|
2423
2423
|
else if (market['inverse']) {
|
|
2424
2424
|
response = await this.dapiV2PrivateGetMyTrades(this.extend(request, params));
|
|
2425
2425
|
}
|
|
2426
|
-
data = this.
|
|
2426
|
+
data = this.safeList(response, 'data', []);
|
|
2427
2427
|
}
|
|
2428
2428
|
else if (market['spot']) {
|
|
2429
2429
|
request['symbol'] = market['id'];
|
|
@@ -2623,7 +2623,7 @@ export default class bitrue extends Exchange {
|
|
|
2623
2623
|
'6': 'canceled',
|
|
2624
2624
|
},
|
|
2625
2625
|
};
|
|
2626
|
-
const statuses = this.
|
|
2626
|
+
const statuses = this.safeDict(statusesByType, type, {});
|
|
2627
2627
|
return this.safeString(statuses, status, status);
|
|
2628
2628
|
}
|
|
2629
2629
|
parseTransaction(transaction, currency = undefined) {
|
|
@@ -2814,7 +2814,7 @@ export default class bitrue extends Exchange {
|
|
|
2814
2814
|
// "chainDetail": [ [Object] ]
|
|
2815
2815
|
// }
|
|
2816
2816
|
//
|
|
2817
|
-
const chainDetails = this.
|
|
2817
|
+
const chainDetails = this.safeList(fee, 'chainDetail', []);
|
|
2818
2818
|
const chainDetailLength = chainDetails.length;
|
|
2819
2819
|
const result = {
|
|
2820
2820
|
'info': fee,
|
|
@@ -2970,7 +2970,7 @@ export default class bitrue extends Exchange {
|
|
|
2970
2970
|
*/
|
|
2971
2971
|
await this.loadMarkets();
|
|
2972
2972
|
const currency = this.currency(code);
|
|
2973
|
-
const accountTypes = this.
|
|
2973
|
+
const accountTypes = this.safeDict(this.options, 'accountsByType', {});
|
|
2974
2974
|
const fromId = this.safeString(accountTypes, fromAccount, fromAccount);
|
|
2975
2975
|
const toId = this.safeString(accountTypes, toAccount, toAccount);
|
|
2976
2976
|
const request = {
|
package/js/src/bitvavo.js
CHANGED
|
@@ -1117,6 +1117,10 @@ export default class bitvavo extends Exchange {
|
|
|
1117
1117
|
if (postOnly) {
|
|
1118
1118
|
request['postOnly'] = true;
|
|
1119
1119
|
}
|
|
1120
|
+
const clientOrderId = this.safeString(params, 'clientOrderId');
|
|
1121
|
+
if (clientOrderId === undefined) {
|
|
1122
|
+
request['clientOrderId'] = this.uuid22();
|
|
1123
|
+
}
|
|
1120
1124
|
return this.extend(request, params);
|
|
1121
1125
|
}
|
|
1122
1126
|
async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
|
package/js/src/bybit.d.ts
CHANGED
|
@@ -44,19 +44,14 @@ export default class bybit extends Exchange {
|
|
|
44
44
|
createOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): Promise<Order>;
|
|
45
45
|
createOrderRequest(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}, isUTA?: boolean): any;
|
|
46
46
|
createOrders(orders: OrderRequest[], params?: {}): Promise<Order[]>;
|
|
47
|
-
createUsdcOrder(symbol: string, type: OrderType, side: OrderSide, amount: number, price?: Num, params?: {}): Promise<Order>;
|
|
48
|
-
editUsdcOrder(id: any, symbol: any, type: any, side: any, amount?: any, price?: any, params?: {}): Promise<Order>;
|
|
49
47
|
editOrderRequest(id: string, symbol: string, type: OrderType, side: OrderSide, amount?: Num, price?: Num, params?: {}): Dict;
|
|
50
48
|
editOrder(id: string, symbol: string, type: OrderType, side: OrderSide, amount?: Num, price?: Num, params?: {}): Promise<Order>;
|
|
51
|
-
cancelUsdcOrder(id: any, symbol?: Str, params?: {}): Promise<Order>;
|
|
52
49
|
cancelOrderRequest(id: string, symbol?: Str, params?: {}): any;
|
|
53
50
|
cancelOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
|
|
54
51
|
cancelOrders(ids: any, symbol?: Str, params?: {}): Promise<Order[]>;
|
|
55
52
|
cancelAllOrdersAfter(timeout: Int, params?: {}): Promise<any>;
|
|
56
53
|
cancelOrdersForSymbols(orders: CancellationRequest[], params?: {}): Promise<Order[]>;
|
|
57
|
-
cancelAllUsdcOrders(symbol?: Str, params?: {}): Promise<any>;
|
|
58
54
|
cancelAllOrders(symbol?: Str, params?: {}): Promise<any>;
|
|
59
|
-
fetchUsdcOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
60
55
|
fetchOrderClassic(id: string, symbol?: Str, params?: {}): Promise<Order>;
|
|
61
56
|
fetchOrder(id: string, symbol?: Str, params?: {}): Promise<Order>;
|
|
62
57
|
fetchOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
@@ -66,10 +61,8 @@ export default class bybit extends Exchange {
|
|
|
66
61
|
fetchCanceledAndClosedOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
67
62
|
fetchClosedOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
68
63
|
fetchCanceledOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
69
|
-
fetchUsdcOpenOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
70
64
|
fetchOpenOrders(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Order[]>;
|
|
71
65
|
fetchOrderTrades(id: string, symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
|
|
72
|
-
fetchMyUsdcTrades(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
|
|
73
66
|
fetchMyTrades(symbol?: Str, since?: Int, limit?: Int, params?: {}): Promise<Trade[]>;
|
|
74
67
|
parseDepositAddress(depositAddress: any, currency?: Currency): DepositAddress;
|
|
75
68
|
fetchDepositAddressesByNetwork(code: string, params?: {}): Promise<DepositAddress[]>;
|
|
@@ -83,7 +76,6 @@ export default class bybit extends Exchange {
|
|
|
83
76
|
parseLedgerEntryType(type: any): string;
|
|
84
77
|
withdraw(code: string, amount: number, address: string, tag?: any, params?: {}): Promise<Transaction>;
|
|
85
78
|
fetchPosition(symbol: string, params?: {}): Promise<Position>;
|
|
86
|
-
fetchUsdcPositions(symbols?: Strings, params?: {}): Promise<Position[]>;
|
|
87
79
|
fetchPositions(symbols?: Strings, params?: {}): Promise<Position[]>;
|
|
88
80
|
parsePosition(position: Dict, market?: Market): Position;
|
|
89
81
|
fetchLeverage(symbol: string, params?: {}): Promise<Leverage>;
|