ccxt 4.1.44 → 4.1.46
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.js +2132 -768
- package/dist/ccxt.browser.min.js +9 -9
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/ace.js +1 -3
- package/dist/cjs/src/ascendex.js +1 -3
- package/dist/cjs/src/base/Exchange.js +11 -3
- package/dist/cjs/src/base/ws/Cache.js +50 -0
- package/dist/cjs/src/bigone.js +2 -6
- package/dist/cjs/src/binance.js +16 -12
- package/dist/cjs/src/bit2c.js +2 -4
- package/dist/cjs/src/bitbns.js +5 -15
- package/dist/cjs/src/bitfinex.js +1 -3
- package/dist/cjs/src/bitfinex2.js +1 -3
- package/dist/cjs/src/bitflyer.js +4 -12
- package/dist/cjs/src/bitforex.js +4 -8
- package/dist/cjs/src/bithumb.js +4 -10
- package/dist/cjs/src/bitmart.js +64 -59
- package/dist/cjs/src/bitmex.js +2 -6
- package/dist/cjs/src/bitopro.js +6 -16
- package/dist/cjs/src/bitrue.js +6 -14
- package/dist/cjs/src/bitvavo.js +9 -14
- package/dist/cjs/src/btctradeua.js +2 -4
- package/dist/cjs/src/bybit.js +88 -132
- package/dist/cjs/src/cex.js +2 -4
- package/dist/cjs/src/coinbasepro.js +2 -2
- package/dist/cjs/src/coinex.js +7 -24
- package/dist/cjs/src/coinfalcon.js +1 -3
- package/dist/cjs/src/coinmate.js +2 -4
- package/dist/cjs/src/coinone.js +2 -6
- package/dist/cjs/src/coinsph.js +5 -13
- package/dist/cjs/src/cryptocom.js +1 -1
- package/dist/cjs/src/currencycom.js +2 -6
- package/dist/cjs/src/gate.js +5 -7
- package/dist/cjs/src/gemini.js +1 -3
- package/dist/cjs/src/hitbtc.js +290 -100
- package/dist/cjs/src/hollaex.js +1 -3
- package/dist/cjs/src/huobi.js +4 -14
- package/dist/cjs/src/huobijp.js +1 -3
- package/dist/cjs/src/indodax.js +4 -10
- package/dist/cjs/src/kucoinfutures.js +2 -7
- package/dist/cjs/src/kuna.js +1 -0
- package/dist/cjs/src/luno.js +1 -3
- package/dist/cjs/src/mercado.js +7 -17
- package/dist/cjs/src/mexc.js +5 -15
- package/dist/cjs/src/oceanex.js +2 -4
- package/dist/cjs/src/okx.js +33 -21
- package/dist/cjs/src/phemex.js +12 -33
- package/dist/cjs/src/poloniexfutures.js +2 -6
- package/dist/cjs/src/pro/binance.js +203 -1
- package/dist/cjs/src/pro/bitget.js +181 -0
- package/dist/cjs/src/pro/bitmart.js +2 -4
- package/dist/cjs/src/pro/bitrue.js +0 -4
- package/dist/cjs/src/pro/bitstamp.js +2 -4
- package/dist/cjs/src/pro/bitvavo.js +3 -7
- package/dist/cjs/src/pro/bybit.js +154 -10
- package/dist/cjs/src/pro/cex.js +2 -6
- package/dist/cjs/src/pro/cryptocom.js +131 -1
- package/dist/cjs/src/pro/gate.js +161 -0
- package/dist/cjs/src/pro/huobi.js +128 -4
- package/dist/cjs/src/pro/krakenfutures.js +129 -0
- package/dist/cjs/src/pro/kucoinfutures.js +182 -0
- package/dist/cjs/src/pro/okx.js +121 -0
- package/dist/cjs/src/pro/whitebit.js +3 -7
- package/dist/cjs/src/probit.js +2 -6
- package/dist/cjs/src/tokocrypto.js +3 -7
- package/dist/cjs/src/wavesexchange.js +2 -4
- package/dist/cjs/src/wazirx.js +4 -10
- package/dist/cjs/src/whitebit.js +3 -7
- package/dist/cjs/src/woo.js +0 -3
- package/dist/cjs/src/yobit.js +3 -7
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/bequant.d.ts +37 -7
- package/js/src/abstract/binance.d.ts +1 -0
- package/js/src/abstract/binancecoinm.d.ts +1 -0
- package/js/src/abstract/binanceus.d.ts +1 -0
- package/js/src/abstract/binanceusdm.d.ts +1 -0
- package/js/src/abstract/bitcoincom.d.ts +37 -7
- package/js/src/abstract/bybit.d.ts +3 -0
- package/js/src/abstract/fmfwio.d.ts +37 -7
- package/js/src/abstract/hitbtc.d.ts +37 -7
- package/js/src/abstract/hitbtc3.d.ts +37 -7
- package/js/src/abstract/okex.d.ts +6 -1
- package/js/src/abstract/okex5.d.ts +6 -1
- package/js/src/abstract/okx.d.ts +6 -1
- package/js/src/ace.d.ts +2 -2
- package/js/src/ace.js +2 -4
- package/js/src/alpaca.d.ts +2 -2
- package/js/src/ascendex.d.ts +2 -2
- package/js/src/ascendex.js +1 -3
- package/js/src/base/Exchange.d.ts +4 -1
- package/js/src/base/Exchange.js +11 -3
- package/js/src/base/ws/Cache.d.ts +5 -1
- package/js/src/base/ws/Cache.js +50 -1
- package/js/src/bigone.d.ts +2 -2
- package/js/src/bigone.js +3 -7
- package/js/src/binance.d.ts +2 -2
- package/js/src/binance.js +16 -12
- package/js/src/bingx.d.ts +2 -2
- package/js/src/bit2c.d.ts +2 -2
- package/js/src/bit2c.js +3 -5
- package/js/src/bitbank.d.ts +2 -2
- package/js/src/bitbns.d.ts +2 -2
- package/js/src/bitbns.js +5 -15
- package/js/src/bitfinex.d.ts +2 -2
- package/js/src/bitfinex.js +1 -3
- package/js/src/bitfinex2.js +1 -3
- package/js/src/bitflyer.d.ts +2 -2
- package/js/src/bitflyer.js +4 -12
- package/js/src/bitforex.d.ts +2 -2
- package/js/src/bitforex.js +5 -9
- package/js/src/bitget.d.ts +2 -2
- package/js/src/bithumb.d.ts +2 -2
- package/js/src/bithumb.js +4 -10
- package/js/src/bitmart.d.ts +2 -2
- package/js/src/bitmart.js +64 -59
- package/js/src/bitmex.js +2 -6
- package/js/src/bitopro.d.ts +2 -2
- package/js/src/bitopro.js +6 -16
- package/js/src/bitpanda.d.ts +2 -2
- package/js/src/bitrue.d.ts +2 -2
- package/js/src/bitrue.js +6 -14
- package/js/src/bitso.d.ts +2 -2
- package/js/src/bitstamp.d.ts +2 -2
- package/js/src/bitstamp1.d.ts +2 -2
- package/js/src/bittrex.d.ts +2 -2
- package/js/src/bitvavo.d.ts +2 -2
- package/js/src/bitvavo.js +9 -14
- package/js/src/bl3p.d.ts +2 -2
- package/js/src/blockchaincom.d.ts +4 -4
- package/js/src/btcalpha.d.ts +2 -2
- package/js/src/btcbox.d.ts +2 -2
- package/js/src/btcmarkets.d.ts +2 -2
- package/js/src/btctradeua.d.ts +2 -2
- package/js/src/btctradeua.js +3 -5
- package/js/src/btcturk.d.ts +2 -2
- package/js/src/bybit.d.ts +2 -4
- package/js/src/bybit.js +88 -132
- package/js/src/cex.d.ts +2 -2
- package/js/src/cex.js +2 -4
- package/js/src/coinbase.d.ts +2 -2
- package/js/src/coinbasepro.d.ts +2 -2
- package/js/src/coinbasepro.js +2 -2
- package/js/src/coincheck.d.ts +2 -2
- package/js/src/coinex.js +7 -24
- package/js/src/coinfalcon.d.ts +2 -2
- package/js/src/coinfalcon.js +2 -4
- package/js/src/coinlist.d.ts +12 -12
- package/js/src/coinmate.d.ts +3 -3
- package/js/src/coinmate.js +3 -5
- package/js/src/coinone.d.ts +2 -2
- package/js/src/coinone.js +2 -6
- package/js/src/coinsph.d.ts +2 -2
- package/js/src/coinsph.js +5 -13
- package/js/src/coinspot.d.ts +2 -2
- package/js/src/cryptocom.d.ts +2 -2
- package/js/src/cryptocom.js +1 -1
- package/js/src/currencycom.d.ts +2 -2
- package/js/src/currencycom.js +2 -6
- package/js/src/delta.d.ts +2 -2
- package/js/src/deribit.d.ts +3 -3
- package/js/src/digifinex.d.ts +2 -2
- package/js/src/gate.d.ts +2 -2
- package/js/src/gate.js +5 -7
- package/js/src/gemini.d.ts +3 -3
- package/js/src/gemini.js +1 -3
- package/js/src/hitbtc.d.ts +3 -0
- package/js/src/hitbtc.js +291 -101
- package/js/src/hollaex.js +1 -3
- package/js/src/huobi.d.ts +2 -2
- package/js/src/huobi.js +4 -14
- package/js/src/huobijp.d.ts +2 -2
- package/js/src/huobijp.js +2 -4
- package/js/src/independentreserve.d.ts +2 -2
- package/js/src/indodax.d.ts +2 -2
- package/js/src/indodax.js +4 -10
- package/js/src/kraken.d.ts +2 -2
- package/js/src/krakenfutures.d.ts +2 -2
- package/js/src/kucoin.d.ts +2 -2
- package/js/src/kucoinfutures.d.ts +2 -2
- package/js/src/kucoinfutures.js +2 -7
- package/js/src/kuna.d.ts +3 -3
- package/js/src/kuna.js +1 -0
- package/js/src/latoken.d.ts +2 -2
- package/js/src/lbank2.d.ts +2 -2
- package/js/src/luno.d.ts +2 -2
- package/js/src/luno.js +1 -3
- package/js/src/lykke.d.ts +2 -2
- package/js/src/mercado.d.ts +2 -2
- package/js/src/mercado.js +7 -17
- package/js/src/mexc.js +5 -15
- package/js/src/novadax.d.ts +2 -2
- package/js/src/oceanex.d.ts +4 -4
- package/js/src/oceanex.js +2 -4
- package/js/src/okcoin.d.ts +2 -2
- package/js/src/okx.d.ts +2 -2
- package/js/src/okx.js +33 -21
- package/js/src/paymium.d.ts +2 -2
- package/js/src/phemex.js +12 -33
- package/js/src/poloniexfutures.d.ts +2 -2
- package/js/src/poloniexfutures.js +2 -6
- package/js/src/pro/binance.d.ts +6 -0
- package/js/src/pro/binance.js +204 -2
- package/js/src/pro/bitget.d.ts +3 -0
- package/js/src/pro/bitget.js +182 -1
- package/js/src/pro/bitmart.js +2 -4
- package/js/src/pro/bitrue.js +0 -4
- package/js/src/pro/bitstamp.js +3 -5
- package/js/src/pro/bitvavo.js +4 -8
- package/js/src/pro/bybit.d.ts +5 -1
- package/js/src/pro/bybit.js +156 -12
- package/js/src/pro/cex.js +3 -7
- package/js/src/pro/cryptocom.d.ts +4 -0
- package/js/src/pro/cryptocom.js +132 -2
- package/js/src/pro/gate.d.ts +5 -0
- package/js/src/pro/gate.js +162 -1
- package/js/src/pro/huobi.d.ts +2 -0
- package/js/src/pro/huobi.js +129 -5
- package/js/src/pro/krakenfutures.d.ts +3 -0
- package/js/src/pro/krakenfutures.js +129 -0
- package/js/src/pro/kucoinfutures.d.ts +5 -0
- package/js/src/pro/kucoinfutures.js +182 -0
- package/js/src/pro/okx.d.ts +2 -0
- package/js/src/pro/okx.js +123 -2
- package/js/src/pro/whitebit.js +4 -8
- package/js/src/probit.d.ts +2 -2
- package/js/src/probit.js +3 -7
- package/js/src/timex.d.ts +2 -2
- package/js/src/tokocrypto.d.ts +2 -2
- package/js/src/tokocrypto.js +4 -8
- package/js/src/wavesexchange.js +3 -5
- package/js/src/wazirx.d.ts +2 -2
- package/js/src/wazirx.js +5 -11
- package/js/src/whitebit.d.ts +2 -2
- package/js/src/whitebit.js +3 -7
- package/js/src/woo.d.ts +2 -2
- package/js/src/woo.js +1 -4
- package/js/src/yobit.js +3 -7
- package/js/src/zaif.d.ts +2 -2
- package/package.json +1 -1
- package/skip-tests.json +3 -1
package/dist/cjs/src/bitmart.js
CHANGED
|
@@ -1451,15 +1451,15 @@ class bitmart extends bitmart$1 {
|
|
|
1451
1451
|
//
|
|
1452
1452
|
// spot
|
|
1453
1453
|
//
|
|
1454
|
-
//
|
|
1455
|
-
// "
|
|
1456
|
-
// "
|
|
1457
|
-
// "
|
|
1458
|
-
// "
|
|
1459
|
-
// "
|
|
1460
|
-
// "
|
|
1461
|
-
// "
|
|
1462
|
-
//
|
|
1454
|
+
// [
|
|
1455
|
+
// "1699512060", // timestamp
|
|
1456
|
+
// "36746.49", // open
|
|
1457
|
+
// "36758.71", // high
|
|
1458
|
+
// "36736.13", // low
|
|
1459
|
+
// "36755.99", // close
|
|
1460
|
+
// "2.83965", // base volume
|
|
1461
|
+
// "104353.57" // quote volume
|
|
1462
|
+
// ]
|
|
1463
1463
|
//
|
|
1464
1464
|
// swap
|
|
1465
1465
|
//
|
|
@@ -1476,7 +1476,7 @@ class bitmart extends bitmart$1 {
|
|
|
1476
1476
|
//
|
|
1477
1477
|
// [
|
|
1478
1478
|
// 1631056350, // timestamp
|
|
1479
|
-
// "46532.83", //
|
|
1479
|
+
// "46532.83", // open
|
|
1480
1480
|
// "46555.71", // high
|
|
1481
1481
|
// "46511.41", // low
|
|
1482
1482
|
// "46555.71", // close
|
|
@@ -1496,10 +1496,10 @@ class bitmart extends bitmart$1 {
|
|
|
1496
1496
|
else {
|
|
1497
1497
|
return [
|
|
1498
1498
|
this.safeTimestamp(ohlcv, 'timestamp'),
|
|
1499
|
-
this.
|
|
1500
|
-
this.
|
|
1501
|
-
this.
|
|
1502
|
-
this.
|
|
1499
|
+
this.safeNumber(ohlcv, 'open_price'),
|
|
1500
|
+
this.safeNumber(ohlcv, 'high_price'),
|
|
1501
|
+
this.safeNumber(ohlcv, 'low_price'),
|
|
1502
|
+
this.safeNumber(ohlcv, 'close_price'),
|
|
1503
1503
|
this.safeNumber(ohlcv, 'volume'),
|
|
1504
1504
|
];
|
|
1505
1505
|
}
|
|
@@ -1509,21 +1509,27 @@ class bitmart extends bitmart$1 {
|
|
|
1509
1509
|
* @method
|
|
1510
1510
|
* @name bitmart#fetchOHLCV
|
|
1511
1511
|
* @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
1512
|
-
* @see https://developer-pro.bitmart.com/en/spot/#get-k-line
|
|
1512
|
+
* @see https://developer-pro.bitmart.com/en/spot/#get-latest-k-line-v3
|
|
1513
1513
|
* @see https://developer-pro.bitmart.com/en/futures/#get-k-line
|
|
1514
1514
|
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
1515
1515
|
* @param {string} timeframe the length of time each candle represents
|
|
1516
1516
|
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
1517
1517
|
* @param {int} [limit] the maximum amount of candles to fetch
|
|
1518
1518
|
* @param {object} [params] extra parameters specific to the bitmart api endpoint
|
|
1519
|
+
* @param {int} [params.until] timestamp of the latest candle in ms
|
|
1520
|
+
* @param {boolean} [params.paginate] *spot only* default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
1519
1521
|
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
1520
1522
|
*/
|
|
1521
1523
|
await this.loadMarkets();
|
|
1524
|
+
let paginate = false;
|
|
1525
|
+
[paginate, params] = this.handleOptionAndParams(params, 'fetchOHLCV', 'paginate', false);
|
|
1526
|
+
if (paginate) {
|
|
1527
|
+
return await this.fetchPaginatedCallDeterministic('fetchOHLCV', symbol, since, limit, timeframe, params, 200);
|
|
1528
|
+
}
|
|
1522
1529
|
const market = this.market(symbol);
|
|
1523
|
-
const type = market['type'];
|
|
1524
1530
|
const duration = this.parseTimeframe(timeframe);
|
|
1525
1531
|
const parsedTimeframe = this.safeInteger(this.timeframes, timeframe);
|
|
1526
|
-
|
|
1532
|
+
let request = {
|
|
1527
1533
|
'symbol': market['id'],
|
|
1528
1534
|
};
|
|
1529
1535
|
if (parsedTimeframe !== undefined) {
|
|
@@ -1532,46 +1538,54 @@ class bitmart extends bitmart$1 {
|
|
|
1532
1538
|
else {
|
|
1533
1539
|
request['step'] = timeframe;
|
|
1534
1540
|
}
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
limit
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
if (since === undefined) {
|
|
1544
|
-
const start = now - limit * duration;
|
|
1545
|
-
request[fromRequest] = start;
|
|
1546
|
-
request[toRequest] = now;
|
|
1541
|
+
if (market['spot']) {
|
|
1542
|
+
[request, params] = this.handleUntilOption('before', request, params, 0.001);
|
|
1543
|
+
if (limit !== undefined) {
|
|
1544
|
+
request['limit'] = limit;
|
|
1545
|
+
}
|
|
1546
|
+
if (since !== undefined) {
|
|
1547
|
+
request['after'] = this.parseToInt((since / 1000)) - 1;
|
|
1548
|
+
}
|
|
1547
1549
|
}
|
|
1548
1550
|
else {
|
|
1549
|
-
const
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1551
|
+
const maxLimit = 1200;
|
|
1552
|
+
if (limit === undefined) {
|
|
1553
|
+
limit = maxLimit;
|
|
1554
|
+
}
|
|
1555
|
+
limit = Math.min(maxLimit, limit);
|
|
1556
|
+
const now = this.parseToInt(this.milliseconds() / 1000);
|
|
1557
|
+
if (since === undefined) {
|
|
1558
|
+
const start = now - limit * duration;
|
|
1559
|
+
request['start_time'] = start;
|
|
1560
|
+
request['end_time'] = now;
|
|
1561
|
+
}
|
|
1562
|
+
else {
|
|
1563
|
+
const start = this.parseToInt((since / 1000)) - 1;
|
|
1564
|
+
const end = this.sum(start, limit * duration);
|
|
1565
|
+
request['start_time'] = start;
|
|
1566
|
+
request['end_time'] = Math.min(end, now);
|
|
1567
|
+
}
|
|
1568
|
+
[request, params] = this.handleUntilOption('end_time', request, params, 0.001);
|
|
1553
1569
|
}
|
|
1554
1570
|
let response = undefined;
|
|
1555
|
-
if (
|
|
1571
|
+
if (market['swap']) {
|
|
1556
1572
|
response = await this.publicGetContractPublicKline(this.extend(request, params));
|
|
1557
1573
|
}
|
|
1558
1574
|
else {
|
|
1559
|
-
response = await this.
|
|
1575
|
+
response = await this.publicGetSpotQuotationV3LiteKlines(this.extend(request, params));
|
|
1560
1576
|
}
|
|
1561
1577
|
//
|
|
1562
1578
|
// spot
|
|
1563
1579
|
//
|
|
1564
1580
|
// {
|
|
1565
|
-
// "
|
|
1566
|
-
// "
|
|
1567
|
-
// "
|
|
1568
|
-
//
|
|
1569
|
-
// "
|
|
1570
|
-
//
|
|
1571
|
-
//
|
|
1572
|
-
//
|
|
1573
|
-
// ]
|
|
1574
|
-
// }
|
|
1581
|
+
// "code": 1000,
|
|
1582
|
+
// "message": "success",
|
|
1583
|
+
// "data": [
|
|
1584
|
+
// ["1699512060","36746.49","36758.71","36736.13","36755.99","2.83965","104353.57"],
|
|
1585
|
+
// ["1699512120","36756.00","36758.70","36737.14","36737.63","1.96070","72047.10"],
|
|
1586
|
+
// ["1699512180","36737.63","36740.45","36737.62","36740.44","0.63194","23217.62"]
|
|
1587
|
+
// ],
|
|
1588
|
+
// "trace": "6591fc7b508845359d5fa442e3b3a4fb.72.16995122398750695"
|
|
1575
1589
|
// }
|
|
1576
1590
|
//
|
|
1577
1591
|
// swap
|
|
@@ -1593,8 +1607,7 @@ class bitmart extends bitmart$1 {
|
|
|
1593
1607
|
// "trace": "96c989db-e0f5-46f5-bba6-60cfcbde699b"
|
|
1594
1608
|
// }
|
|
1595
1609
|
//
|
|
1596
|
-
const
|
|
1597
|
-
const ohlcv = this.safeValue(data, 'klines', data);
|
|
1610
|
+
const ohlcv = this.safeValue(response, 'data', []);
|
|
1598
1611
|
return this.parseOHLCVs(ohlcv, market, timeframe, since, limit);
|
|
1599
1612
|
}
|
|
1600
1613
|
async fetchMyTrades(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
@@ -2353,9 +2366,7 @@ class bitmart extends bitmart$1 {
|
|
|
2353
2366
|
return response;
|
|
2354
2367
|
}
|
|
2355
2368
|
async fetchOrdersByStatus(status, symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
2356
|
-
|
|
2357
|
-
throw new errors.ArgumentsRequired(this.id + ' fetchOrdersByStatus() requires a symbol argument');
|
|
2358
|
-
}
|
|
2369
|
+
this.checkRequiredSymbol('fetchOrdersByStatus', symbol);
|
|
2359
2370
|
await this.loadMarkets();
|
|
2360
2371
|
const market = this.market(symbol);
|
|
2361
2372
|
if (!market['spot']) {
|
|
@@ -3043,10 +3054,8 @@ class bitmart extends bitmart$1 {
|
|
|
3043
3054
|
* @param {string} [params.marginMode] 'isolated' is the default and 'cross' is unavailable
|
|
3044
3055
|
* @returns {object} a [margin loan structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#margin-loan-structure}
|
|
3045
3056
|
*/
|
|
3057
|
+
this.checkRequiredSymbol('repayMargin', symbol);
|
|
3046
3058
|
await this.loadMarkets();
|
|
3047
|
-
if (symbol === undefined) {
|
|
3048
|
-
throw new errors.ArgumentsRequired(this.id + ' repayMargin() requires a symbol argument');
|
|
3049
|
-
}
|
|
3050
3059
|
const market = this.market(symbol);
|
|
3051
3060
|
const currency = this.currency(code);
|
|
3052
3061
|
const request = {
|
|
@@ -3086,10 +3095,8 @@ class bitmart extends bitmart$1 {
|
|
|
3086
3095
|
* @param {string} [params.marginMode] 'isolated' is the default and 'cross' is unavailable
|
|
3087
3096
|
* @returns {object} a [margin loan structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#margin-loan-structure}
|
|
3088
3097
|
*/
|
|
3098
|
+
this.checkRequiredSymbol('borrowMargin', symbol);
|
|
3089
3099
|
await this.loadMarkets();
|
|
3090
|
-
if (symbol === undefined) {
|
|
3091
|
-
throw new errors.ArgumentsRequired(this.id + ' borrowMargin() requires a symbol argument');
|
|
3092
|
-
}
|
|
3093
3100
|
const market = this.market(symbol);
|
|
3094
3101
|
const currency = this.currency(code);
|
|
3095
3102
|
const request = {
|
|
@@ -3545,9 +3552,7 @@ class bitmart extends bitmart$1 {
|
|
|
3545
3552
|
* @param {object} [params] extra parameters specific to the bitmart api endpoint
|
|
3546
3553
|
* @returns {object[]} a list of [borrow interest structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#borrow-interest-structure}
|
|
3547
3554
|
*/
|
|
3548
|
-
|
|
3549
|
-
throw new errors.ArgumentsRequired(this.id + ' fetchBorrowInterest() requires a symbol argument');
|
|
3550
|
-
}
|
|
3555
|
+
this.checkRequiredSymbol('fetchBorrowInterest', symbol);
|
|
3551
3556
|
await this.loadMarkets();
|
|
3552
3557
|
const market = this.market(symbol);
|
|
3553
3558
|
const request = {
|
package/dist/cjs/src/bitmex.js
CHANGED
|
@@ -2444,9 +2444,7 @@ class bitmex extends bitmex$1 {
|
|
|
2444
2444
|
* @param {object} [params] extra parameters specific to the bitmex api endpoint
|
|
2445
2445
|
* @returns {object} response from the exchange
|
|
2446
2446
|
*/
|
|
2447
|
-
|
|
2448
|
-
throw new errors.ArgumentsRequired(this.id + ' setLeverage() requires a symbol argument');
|
|
2449
|
-
}
|
|
2447
|
+
this.checkRequiredSymbol('setLeverage', symbol);
|
|
2450
2448
|
if ((leverage < 0.01) || (leverage > 100)) {
|
|
2451
2449
|
throw new errors.BadRequest(this.id + ' leverage should be between 0.01 and 100');
|
|
2452
2450
|
}
|
|
@@ -2471,9 +2469,7 @@ class bitmex extends bitmex$1 {
|
|
|
2471
2469
|
* @param {object} [params] extra parameters specific to the bitmex api endpoint
|
|
2472
2470
|
* @returns {object} response from the exchange
|
|
2473
2471
|
*/
|
|
2474
|
-
|
|
2475
|
-
throw new errors.ArgumentsRequired(this.id + ' setMarginMode() requires a symbol argument');
|
|
2476
|
-
}
|
|
2472
|
+
this.checkRequiredSymbol('setMarginMode', symbol);
|
|
2477
2473
|
marginMode = marginMode.toLowerCase();
|
|
2478
2474
|
if (marginMode !== 'isolated' && marginMode !== 'cross') {
|
|
2479
2475
|
throw new errors.BadRequest(this.id + ' setMarginMode() marginMode argument should be isolated or cross');
|
package/dist/cjs/src/bitopro.js
CHANGED
|
@@ -1055,9 +1055,7 @@ class bitopro extends bitopro$1 {
|
|
|
1055
1055
|
* @param {object} [params] extra parameters specific to the bitopro api endpoint
|
|
1056
1056
|
* @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
|
|
1057
1057
|
*/
|
|
1058
|
-
|
|
1059
|
-
throw new errors.ArgumentsRequired(this.id + ' cancelOrder() requires the symbol argument');
|
|
1060
|
-
}
|
|
1058
|
+
this.checkRequiredSymbol('cancelOrder', symbol);
|
|
1061
1059
|
await this.loadMarkets();
|
|
1062
1060
|
const market = this.market(symbol);
|
|
1063
1061
|
const request = {
|
|
@@ -1087,9 +1085,7 @@ class bitopro extends bitopro$1 {
|
|
|
1087
1085
|
* @param {object} [params] extra parameters specific to the bitopro api endpoint
|
|
1088
1086
|
* @returns {object} an list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
|
|
1089
1087
|
*/
|
|
1090
|
-
|
|
1091
|
-
throw new errors.ArgumentsRequired(this.id + ' cancelOrders() requires a symbol argument');
|
|
1092
|
-
}
|
|
1088
|
+
this.checkRequiredSymbol('cancelOrders', symbol);
|
|
1093
1089
|
await this.loadMarkets();
|
|
1094
1090
|
const market = this.market(symbol);
|
|
1095
1091
|
const id = market['uppercaseId'];
|
|
@@ -1154,9 +1150,7 @@ class bitopro extends bitopro$1 {
|
|
|
1154
1150
|
* @param {object} [params] extra parameters specific to the bitopro api endpoint
|
|
1155
1151
|
* @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
|
|
1156
1152
|
*/
|
|
1157
|
-
|
|
1158
|
-
throw new errors.ArgumentsRequired(this.id + ' fetchOrder() requires the symbol argument');
|
|
1159
|
-
}
|
|
1153
|
+
this.checkRequiredSymbol('fetchOrder', symbol);
|
|
1160
1154
|
await this.loadMarkets();
|
|
1161
1155
|
const market = this.market(symbol);
|
|
1162
1156
|
const request = {
|
|
@@ -1197,13 +1191,11 @@ class bitopro extends bitopro$1 {
|
|
|
1197
1191
|
* @see https://github.com/bitoex/bitopro-offical-api-docs/blob/master/api/v3/private/get_orders_data.md
|
|
1198
1192
|
* @param {string} symbol unified market symbol of the market orders were made in
|
|
1199
1193
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
1200
|
-
* @param {int} [limit] the maximum number of
|
|
1194
|
+
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
1201
1195
|
* @param {object} [params] extra parameters specific to the bitopro api endpoint
|
|
1202
1196
|
* @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
|
|
1203
1197
|
*/
|
|
1204
|
-
|
|
1205
|
-
throw new errors.ArgumentsRequired(this.id + ' fetchOrders() requires the symbol argument');
|
|
1206
|
-
}
|
|
1198
|
+
this.checkRequiredSymbol('fetchOrders', symbol);
|
|
1207
1199
|
await this.loadMarkets();
|
|
1208
1200
|
const market = this.market(symbol);
|
|
1209
1201
|
const request = {
|
|
@@ -1287,9 +1279,7 @@ class bitopro extends bitopro$1 {
|
|
|
1287
1279
|
* @param {object} [params] extra parameters specific to the bitopro api endpoint
|
|
1288
1280
|
* @returns {Trade[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure}
|
|
1289
1281
|
*/
|
|
1290
|
-
|
|
1291
|
-
throw new errors.ArgumentsRequired(this.id + ' fetchMyTrades() requires the symbol argument');
|
|
1292
|
-
}
|
|
1282
|
+
this.checkRequiredSymbol('fetchMyTrades', symbol);
|
|
1293
1283
|
await this.loadMarkets();
|
|
1294
1284
|
const market = this.market(symbol);
|
|
1295
1285
|
const request = {
|
package/dist/cjs/src/bitrue.js
CHANGED
|
@@ -1369,9 +1369,7 @@ class bitrue extends bitrue$1 {
|
|
|
1369
1369
|
* @param {object} [params] extra parameters specific to the bitrue api endpoint
|
|
1370
1370
|
* @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
|
|
1371
1371
|
*/
|
|
1372
|
-
|
|
1373
|
-
throw new errors.ArgumentsRequired(this.id + ' fetchOrder() requires a symbol argument');
|
|
1374
|
-
}
|
|
1372
|
+
this.checkRequiredSymbol('fetchOrder', symbol);
|
|
1375
1373
|
await this.loadMarkets();
|
|
1376
1374
|
const market = this.market(symbol);
|
|
1377
1375
|
const request = {
|
|
@@ -1395,13 +1393,11 @@ class bitrue extends bitrue$1 {
|
|
|
1395
1393
|
* @description fetches information on multiple closed orders made by the user
|
|
1396
1394
|
* @param {string} symbol unified market symbol of the market orders were made in
|
|
1397
1395
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
1398
|
-
* @param {int} [limit] the maximum number of
|
|
1396
|
+
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
1399
1397
|
* @param {object} [params] extra parameters specific to the bitrue api endpoint
|
|
1400
1398
|
* @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
|
|
1401
1399
|
*/
|
|
1402
|
-
|
|
1403
|
-
throw new errors.ArgumentsRequired(this.id + ' fetchClosedOrders() requires a symbol argument');
|
|
1404
|
-
}
|
|
1400
|
+
this.checkRequiredSymbol('fetchClosedOrders', symbol);
|
|
1405
1401
|
await this.loadMarkets();
|
|
1406
1402
|
const market = this.market(symbol);
|
|
1407
1403
|
const request = {
|
|
@@ -1449,13 +1445,11 @@ class bitrue extends bitrue$1 {
|
|
|
1449
1445
|
* @description fetch all unfilled currently open orders
|
|
1450
1446
|
* @param {string} symbol unified market symbol
|
|
1451
1447
|
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
1452
|
-
* @param {int} [limit] the maximum number of
|
|
1448
|
+
* @param {int} [limit] the maximum number of open order structures to retrieve
|
|
1453
1449
|
* @param {object} [params] extra parameters specific to the bitrue api endpoint
|
|
1454
1450
|
* @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
|
|
1455
1451
|
*/
|
|
1456
|
-
|
|
1457
|
-
throw new errors.ArgumentsRequired(this.id + ' fetchOpenOrders() requires a symbol argument');
|
|
1458
|
-
}
|
|
1452
|
+
this.checkRequiredSymbol('fetchOpenOrders', symbol);
|
|
1459
1453
|
await this.loadMarkets();
|
|
1460
1454
|
const market = this.market(symbol);
|
|
1461
1455
|
const request = {
|
|
@@ -1496,9 +1490,7 @@ class bitrue extends bitrue$1 {
|
|
|
1496
1490
|
* @param {object} [params] extra parameters specific to the bitrue api endpoint
|
|
1497
1491
|
* @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
|
|
1498
1492
|
*/
|
|
1499
|
-
|
|
1500
|
-
throw new errors.ArgumentsRequired(this.id + ' cancelOrder() requires a symbol argument');
|
|
1501
|
-
}
|
|
1493
|
+
this.checkRequiredSymbol('cancelOrder', symbol);
|
|
1502
1494
|
await this.loadMarkets();
|
|
1503
1495
|
const market = this.market(symbol);
|
|
1504
1496
|
const origClientOrderId = this.safeValue2(params, 'origClientOrderId', 'clientOrderId');
|
package/dist/cjs/src/bitvavo.js
CHANGED
|
@@ -312,8 +312,8 @@ class bitvavo extends bitvavo$1 {
|
|
|
312
312
|
* @returns {object[]} an array of objects representing market data
|
|
313
313
|
*/
|
|
314
314
|
const response = await this.publicGetMarkets(params);
|
|
315
|
-
const currencies = this.
|
|
316
|
-
const currenciesById = this.indexBy(currencies, '
|
|
315
|
+
const currencies = await this.fetchCurrencies();
|
|
316
|
+
const currenciesById = this.indexBy(currencies, 'id');
|
|
317
317
|
//
|
|
318
318
|
// [
|
|
319
319
|
// {
|
|
@@ -338,7 +338,8 @@ class bitvavo extends bitvavo$1 {
|
|
|
338
338
|
const quote = this.safeCurrencyCode(quoteId);
|
|
339
339
|
const status = this.safeString(market, 'status');
|
|
340
340
|
const baseCurrency = this.safeValue(currenciesById, baseId);
|
|
341
|
-
|
|
341
|
+
const basePrecision = this.safeInteger(baseCurrency, 'precision');
|
|
342
|
+
result.push(this.safeMarketStructure({
|
|
342
343
|
'id': id,
|
|
343
344
|
'symbol': base + '/' + quote,
|
|
344
345
|
'base': base,
|
|
@@ -363,7 +364,7 @@ class bitvavo extends bitvavo$1 {
|
|
|
363
364
|
'strike': undefined,
|
|
364
365
|
'optionType': undefined,
|
|
365
366
|
'precision': {
|
|
366
|
-
'amount': this.safeInteger(baseCurrency, 'decimals',
|
|
367
|
+
'amount': this.safeInteger(baseCurrency, 'decimals', basePrecision),
|
|
367
368
|
'price': this.safeInteger(market, 'pricePrecision'),
|
|
368
369
|
},
|
|
369
370
|
'limits': {
|
|
@@ -386,7 +387,7 @@ class bitvavo extends bitvavo$1 {
|
|
|
386
387
|
},
|
|
387
388
|
'created': undefined,
|
|
388
389
|
'info': market,
|
|
389
|
-
});
|
|
390
|
+
}));
|
|
390
391
|
}
|
|
391
392
|
return result;
|
|
392
393
|
}
|
|
@@ -1143,9 +1144,7 @@ class bitvavo extends bitvavo$1 {
|
|
|
1143
1144
|
* @param {object} [params] extra parameters specific to the bitvavo api endpoint
|
|
1144
1145
|
* @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
|
|
1145
1146
|
*/
|
|
1146
|
-
|
|
1147
|
-
throw new errors.ArgumentsRequired(this.id + ' cancelOrder() requires a symbol argument');
|
|
1148
|
-
}
|
|
1147
|
+
this.checkRequiredSymbol('cancelOrder', symbol);
|
|
1149
1148
|
await this.loadMarkets();
|
|
1150
1149
|
const market = this.market(symbol);
|
|
1151
1150
|
const request = {
|
|
@@ -1195,9 +1194,7 @@ class bitvavo extends bitvavo$1 {
|
|
|
1195
1194
|
* @param {object} [params] extra parameters specific to the bitvavo api endpoint
|
|
1196
1195
|
* @returns {object} An [order structure]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
|
|
1197
1196
|
*/
|
|
1198
|
-
|
|
1199
|
-
throw new errors.ArgumentsRequired(this.id + ' fetchOrder() requires a symbol argument');
|
|
1200
|
-
}
|
|
1197
|
+
this.checkRequiredSymbol('fetchOrder', symbol);
|
|
1201
1198
|
await this.loadMarkets();
|
|
1202
1199
|
const market = this.market(symbol);
|
|
1203
1200
|
const request = {
|
|
@@ -1512,9 +1509,7 @@ class bitvavo extends bitvavo$1 {
|
|
|
1512
1509
|
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
1513
1510
|
* @returns {Trade[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure}
|
|
1514
1511
|
*/
|
|
1515
|
-
|
|
1516
|
-
throw new errors.ArgumentsRequired(this.id + ' fetchMyTrades() requires a symbol argument');
|
|
1517
|
-
}
|
|
1512
|
+
this.checkRequiredSymbol('fetchMyTrades', symbol);
|
|
1518
1513
|
await this.loadMarkets();
|
|
1519
1514
|
let paginate = false;
|
|
1520
1515
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchMyTrades', 'paginate');
|
|
@@ -525,13 +525,11 @@ class btctradeua extends btctradeua$1 {
|
|
|
525
525
|
* @description fetch all unfilled currently open orders
|
|
526
526
|
* @param {string} symbol unified market symbol
|
|
527
527
|
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
528
|
-
* @param {int} [limit] the maximum number of
|
|
528
|
+
* @param {int} [limit] the maximum number of open order structures to retrieve
|
|
529
529
|
* @param {object} [params] extra parameters specific to the btctradeua api endpoint
|
|
530
530
|
* @returns {Order[]} a list of [order structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#order-structure}
|
|
531
531
|
*/
|
|
532
|
-
|
|
533
|
-
throw new errors.ArgumentsRequired(this.id + ' fetchOpenOrders() requires a symbol argument');
|
|
534
|
-
}
|
|
532
|
+
this.checkRequiredSymbol('fetchOpenOrders', symbol);
|
|
535
533
|
await this.loadMarkets();
|
|
536
534
|
const market = this.market(symbol);
|
|
537
535
|
const request = {
|