ccxt 4.5.55 → 4.5.57
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 +215 -10
- package/dist/ccxt.browser.min.js +10 -10
- package/dist/cjs/ccxt.js +6 -11
- package/dist/cjs/src/aftermath.js +10 -5
- package/dist/cjs/src/alpaca.js +2 -2
- package/dist/cjs/src/apex.js +26 -17
- package/dist/cjs/src/arkham.js +10 -7
- package/dist/cjs/src/ascendex.js +8 -5
- package/dist/cjs/src/aster.js +7 -4
- package/dist/cjs/src/backpack.js +4 -4
- package/dist/cjs/src/base/Exchange.js +72 -35
- package/dist/cjs/src/base/functions/io.js +25 -0
- package/dist/cjs/src/base/functions.js +1 -0
- package/dist/cjs/src/bigone.js +10 -7
- package/dist/cjs/src/binance.js +196 -198
- package/dist/cjs/src/bingx.js +7 -7
- package/dist/cjs/src/bitfinex.js +71 -58
- package/dist/cjs/src/bitflyer.js +2 -1
- package/dist/cjs/src/bitget.js +16 -5
- package/dist/cjs/src/bitmart.js +18 -10
- package/dist/cjs/src/bitmex.js +8 -5
- package/dist/cjs/src/bitopro.js +2 -2
- package/dist/cjs/src/bitrue.js +4 -3
- package/dist/cjs/src/bitso.js +7 -4
- package/dist/cjs/src/bitstamp.js +7 -4
- package/dist/cjs/src/bitteam.js +1 -1
- package/dist/cjs/src/bittrade.js +2 -2
- package/dist/cjs/src/bitvavo.js +457 -34
- package/dist/cjs/src/blofin.js +28 -4
- package/dist/cjs/src/bullish.js +6 -5
- package/dist/cjs/src/bybit.js +19 -17
- package/dist/cjs/src/bybiteu.js +1 -0
- package/dist/cjs/src/bydfi.js +1 -1
- package/dist/cjs/src/cex.js +3 -3
- package/dist/cjs/src/coinbase.js +75 -65
- package/dist/cjs/src/coinbaseexchange.js +4 -3
- package/dist/cjs/src/coinbaseinternational.js +17 -10
- package/dist/cjs/src/coinex.js +79 -77
- package/dist/cjs/src/coinmetro.js +1 -1
- package/dist/cjs/src/coinsph.js +5 -5
- package/dist/cjs/src/cryptocom.js +52 -54
- package/dist/cjs/src/cryptomus.js +43 -39
- package/dist/cjs/src/deepcoin.js +9 -5
- package/dist/cjs/src/delta.js +53 -53
- package/dist/cjs/src/deribit.js +35 -35
- package/dist/cjs/src/derive.js +31 -31
- package/dist/cjs/src/digifinex.js +45 -45
- package/dist/cjs/src/exmo.js +104 -122
- package/dist/cjs/src/extended.js +3497 -0
- package/dist/cjs/src/foxbit.js +72 -76
- package/dist/cjs/src/gate.js +53 -53
- package/dist/cjs/src/gemini.js +45 -45
- package/dist/cjs/src/grvt.js +17 -11
- package/dist/cjs/src/hashkey.js +56 -58
- package/dist/cjs/src/hibachi.js +1 -1
- package/dist/cjs/src/hitbtc.js +5 -14
- package/dist/cjs/src/hollaex.js +51 -54
- package/dist/cjs/src/htx.js +84 -72
- package/dist/cjs/src/hyperliquid.js +60 -55
- package/dist/cjs/src/indodax.js +4 -3
- package/dist/cjs/src/kraken.js +71 -71
- package/dist/cjs/src/krakenfutures.js +2 -1
- package/dist/cjs/src/kucoin.js +3 -2
- package/dist/cjs/src/latoken.js +30 -32
- package/dist/cjs/src/lbank.js +64 -60
- package/dist/cjs/src/lighter.js +36 -38
- package/dist/cjs/src/luno.js +36 -44
- package/dist/cjs/src/mercado.js +2 -1
- package/dist/cjs/src/mexc.js +72 -63
- package/dist/cjs/src/modetrade.js +51 -53
- package/dist/cjs/src/ndax.js +35 -37
- package/dist/cjs/src/okx.js +23 -5
- package/dist/cjs/src/onetrading.js +21 -23
- package/dist/cjs/src/p2b.js +8 -4
- package/dist/cjs/src/paradex.js +3 -2
- package/dist/cjs/src/phemex.js +47 -47
- package/dist/cjs/src/poloniex.js +19 -13
- package/dist/cjs/src/pro/alpaca.js +1 -1
- package/dist/cjs/src/pro/apex.js +11 -2
- package/dist/cjs/src/pro/arkham.js +1 -1
- package/dist/cjs/src/pro/aster.js +10 -9
- package/dist/cjs/src/pro/backpack.js +1 -1
- package/dist/cjs/src/pro/binance.js +6 -6
- package/dist/cjs/src/pro/bingx.js +7 -2
- package/dist/cjs/src/pro/bitget.js +1 -1
- package/dist/cjs/src/pro/bithumb.js +1 -1
- package/dist/cjs/src/pro/bitmart.js +10 -0
- package/dist/cjs/src/pro/bitmex.js +1 -1
- package/dist/cjs/src/pro/bitstamp.js +1 -1
- package/dist/cjs/src/pro/blockchaincom.js +1 -1
- package/dist/cjs/src/pro/bybit.js +1 -1
- package/dist/cjs/src/pro/cex.js +1 -1
- package/dist/cjs/src/pro/coinex.js +1 -1
- package/dist/cjs/src/pro/coinone.js +1 -1
- package/dist/cjs/src/pro/cryptocom.js +3 -1
- package/dist/cjs/src/pro/dydx.js +1 -1
- package/dist/cjs/src/pro/exmo.js +1 -1
- package/dist/cjs/src/pro/extended.js +865 -0
- package/dist/cjs/src/pro/gate.js +1 -1
- package/dist/cjs/src/pro/grvt.js +8 -0
- package/dist/cjs/src/pro/htx.js +4 -4
- package/dist/cjs/src/pro/independentreserve.js +1 -1
- package/dist/cjs/src/pro/krakenfutures.js +16 -4
- package/dist/cjs/src/pro/kucoin.js +1 -1
- package/dist/cjs/src/pro/luno.js +3 -3
- package/dist/cjs/src/pro/modetrade.js +3 -3
- package/dist/cjs/src/pro/okx.js +4 -4
- package/dist/cjs/src/pro/onetrading.js +1 -1
- package/dist/cjs/src/pro/toobit.js +1 -1
- package/dist/cjs/src/pro/weex.js +1 -1
- package/dist/cjs/src/pro/woo.js +4 -4
- package/dist/cjs/src/pro/woofipro.js +3 -3
- package/dist/cjs/src/pro/xt.js +1 -1
- package/dist/cjs/src/static_dependencies/starknet/utils/hash/classHash.js +7 -7
- package/dist/cjs/src/tokocrypto.js +1 -1
- package/dist/cjs/src/toobit.js +3 -3
- package/dist/cjs/src/upbit.js +3 -3
- package/dist/cjs/src/weex.js +57 -62
- package/dist/cjs/src/whitebit.js +61 -63
- package/dist/cjs/src/woo.js +66 -55
- package/dist/cjs/src/woofipro.js +54 -48
- package/dist/cjs/src/xt.js +3 -2
- package/dist/cjs/src/yobit.js +4 -2
- package/dist/cjs/src/zebpay.js +73 -75
- package/js/ccxt.d.ts +8 -14
- package/js/ccxt.js +6 -10
- package/js/src/abstract/bitvavo.d.ts +15 -7
- package/js/src/abstract/extended.d.ts +58 -0
- package/js/src/abstract/mexc.d.ts +1 -0
- package/js/src/aftermath.js +10 -5
- package/js/src/alpaca.js +2 -2
- package/js/src/apex.d.ts +1 -1
- package/js/src/apex.js +26 -17
- package/js/src/arkham.js +10 -7
- package/js/src/ascendex.js +8 -5
- package/js/src/aster.js +7 -4
- package/js/src/backpack.js +4 -4
- package/js/src/base/Exchange.d.ts +10 -6
- package/js/src/base/Exchange.js +72 -35
- package/js/src/base/functions/io.d.ts +7 -0
- package/js/src/base/functions/io.js +24 -0
- package/js/src/bigone.js +10 -7
- package/js/src/binance.d.ts +2 -0
- package/js/src/binance.js +200 -202
- package/js/src/bingx.js +7 -7
- package/js/src/bitfinex.d.ts +2 -0
- package/js/src/bitfinex.js +71 -58
- package/js/src/bitflyer.js +2 -1
- package/js/src/bitget.js +16 -5
- package/js/src/bitmart.js +18 -10
- package/js/src/bitmex.js +8 -5
- package/js/src/bitopro.js +2 -2
- package/js/src/bitrue.js +4 -3
- package/js/src/bitso.js +7 -4
- package/js/src/bitstamp.js +7 -4
- package/js/src/bitteam.js +1 -1
- package/js/src/bittrade.js +2 -2
- package/js/src/bitvavo.d.ts +114 -21
- package/js/src/bitvavo.js +457 -34
- package/js/src/blofin.d.ts +1 -0
- package/js/src/blofin.js +28 -4
- package/js/src/bullish.js +6 -5
- package/js/src/bybit.d.ts +1 -1
- package/js/src/bybit.js +19 -17
- package/js/src/bybiteu.js +1 -0
- package/js/src/bydfi.js +1 -1
- package/js/src/cex.js +3 -3
- package/js/src/coinbase.d.ts +63 -56
- package/js/src/coinbase.js +75 -65
- package/js/src/coinbaseexchange.js +4 -3
- package/js/src/coinbaseinternational.d.ts +1 -1
- package/js/src/coinbaseinternational.js +17 -10
- package/js/src/coinex.d.ts +2 -1
- package/js/src/coinex.js +79 -77
- package/js/src/coinmetro.d.ts +1 -1
- package/js/src/coinmetro.js +1 -1
- package/js/src/coinsph.js +5 -5
- package/js/src/cryptocom.d.ts +1 -0
- package/js/src/cryptocom.js +52 -54
- package/js/src/cryptomus.d.ts +2 -1
- package/js/src/cryptomus.js +43 -39
- package/js/src/deepcoin.js +9 -5
- package/js/src/delta.d.ts +1 -0
- package/js/src/delta.js +53 -53
- package/js/src/deribit.d.ts +1 -0
- package/js/src/deribit.js +35 -35
- package/js/src/derive.d.ts +1 -0
- package/js/src/derive.js +31 -31
- package/js/src/digifinex.d.ts +1 -0
- package/js/src/digifinex.js +45 -45
- package/js/src/exmo.d.ts +1 -0
- package/js/src/exmo.js +104 -122
- package/js/src/extended.d.ts +554 -0
- package/js/src/extended.js +3490 -0
- package/js/src/foxbit.d.ts +1 -0
- package/js/src/foxbit.js +72 -76
- package/js/src/gate.d.ts +1 -0
- package/js/src/gate.js +53 -53
- package/js/src/gemini.d.ts +2 -1
- package/js/src/gemini.js +45 -45
- package/js/src/grvt.d.ts +1 -1
- package/js/src/grvt.js +17 -11
- package/js/src/hashkey.d.ts +1 -0
- package/js/src/hashkey.js +56 -58
- package/js/src/hibachi.d.ts +1 -1
- package/js/src/hibachi.js +1 -1
- package/js/src/hitbtc.d.ts +0 -1
- package/js/src/hitbtc.js +5 -14
- package/js/src/hollaex.d.ts +1 -0
- package/js/src/hollaex.js +51 -54
- package/js/src/htx.d.ts +1 -0
- package/js/src/htx.js +84 -72
- package/js/src/hyperliquid.d.ts +5 -4
- package/js/src/hyperliquid.js +60 -55
- package/js/src/indodax.js +4 -3
- package/js/src/kraken.d.ts +2 -1
- package/js/src/kraken.js +71 -71
- package/js/src/krakenfutures.js +2 -1
- package/js/src/kucoin.js +3 -2
- package/js/src/latoken.d.ts +1 -0
- package/js/src/latoken.js +30 -32
- package/js/src/lbank.d.ts +1 -0
- package/js/src/lbank.js +64 -60
- package/js/src/lighter.d.ts +2 -1
- package/js/src/lighter.js +36 -38
- package/js/src/luno.d.ts +1 -0
- package/js/src/luno.js +36 -44
- package/js/src/mercado.js +2 -1
- package/js/src/mexc.d.ts +4 -3
- package/js/src/mexc.js +72 -63
- package/js/src/modetrade.d.ts +1 -0
- package/js/src/modetrade.js +51 -53
- package/js/src/ndax.d.ts +1 -0
- package/js/src/ndax.js +35 -37
- package/js/src/okx.js +23 -5
- package/js/src/onetrading.d.ts +2 -1
- package/js/src/onetrading.js +21 -23
- package/js/src/p2b.js +8 -4
- package/js/src/paradex.js +3 -2
- package/js/src/phemex.d.ts +1 -0
- package/js/src/phemex.js +47 -47
- package/js/src/poloniex.js +19 -13
- package/js/src/pro/alpaca.js +1 -1
- package/js/src/pro/apex.js +11 -2
- package/js/src/pro/arkham.js +1 -1
- package/js/src/pro/aster.js +10 -9
- package/js/src/pro/backpack.js +1 -1
- package/js/src/pro/binance.d.ts +1 -1
- package/js/src/pro/binance.js +6 -6
- package/js/src/pro/bingx.js +7 -2
- package/js/src/pro/bitget.js +1 -1
- package/js/src/pro/bithumb.js +1 -1
- package/js/src/pro/bitmart.js +10 -0
- package/js/src/pro/bitmex.js +1 -1
- package/js/src/pro/bitstamp.js +1 -1
- package/js/src/pro/blockchaincom.js +1 -1
- package/js/src/pro/bybit.js +1 -1
- package/js/src/pro/cex.js +1 -1
- package/js/src/pro/coinex.js +1 -1
- package/js/src/pro/coinone.js +1 -1
- package/js/src/pro/cryptocom.js +3 -1
- package/js/src/pro/dydx.js +1 -1
- package/js/src/pro/exmo.js +1 -1
- package/js/src/pro/extended.d.ts +126 -0
- package/js/src/pro/extended.js +858 -0
- package/js/src/pro/gate.js +1 -1
- package/js/src/pro/grvt.js +8 -0
- package/js/src/pro/htx.d.ts +4 -4
- package/js/src/pro/htx.js +4 -4
- package/js/src/pro/independentreserve.js +1 -1
- package/js/src/pro/krakenfutures.d.ts +4 -4
- package/js/src/pro/krakenfutures.js +16 -4
- package/js/src/pro/kucoin.js +1 -1
- package/js/src/pro/luno.d.ts +1 -1
- package/js/src/pro/luno.js +3 -3
- package/js/src/pro/modetrade.d.ts +3 -3
- package/js/src/pro/modetrade.js +3 -3
- package/js/src/pro/okx.d.ts +4 -4
- package/js/src/pro/okx.js +4 -4
- package/js/src/pro/onetrading.js +1 -1
- package/js/src/pro/toobit.js +1 -1
- package/js/src/pro/weex.js +1 -1
- package/js/src/pro/woo.d.ts +4 -4
- package/js/src/pro/woo.js +4 -4
- package/js/src/pro/woofipro.d.ts +3 -3
- package/js/src/pro/woofipro.js +3 -3
- package/js/src/pro/xt.js +1 -1
- package/js/src/tokocrypto.js +1 -1
- package/js/src/toobit.d.ts +1 -1
- package/js/src/toobit.js +3 -3
- package/js/src/upbit.js +3 -3
- package/js/src/weex.d.ts +1 -0
- package/js/src/weex.js +57 -62
- package/js/src/whitebit.d.ts +1 -0
- package/js/src/whitebit.js +61 -63
- package/js/src/woo.d.ts +1 -0
- package/js/src/woo.js +66 -55
- package/js/src/woofipro.d.ts +1 -0
- package/js/src/woofipro.js +54 -48
- package/js/src/xt.js +3 -2
- package/js/src/yobit.js +4 -2
- package/js/src/zebpay.d.ts +2 -1
- package/js/src/zebpay.js +73 -75
- package/package.json +25 -11
- package/dist/cjs/src/gateio.js +0 -18
- package/dist/cjs/src/oxfun.js +0 -2931
- package/dist/cjs/src/pro/gateio.js +0 -18
- package/dist/cjs/src/pro/oxfun.js +0 -1113
- package/js/src/abstract/gateio.d.ts +0 -346
- package/js/src/abstract/gateio.js +0 -5
- package/js/src/abstract/oxfun.d.ts +0 -37
- package/js/src/gateio.d.ts +0 -4
- package/js/src/gateio.js +0 -11
- package/js/src/oxfun.d.ts +0 -442
- package/js/src/oxfun.js +0 -2924
- package/js/src/pro/gateio.d.ts +0 -4
- package/js/src/pro/gateio.js +0 -11
- package/js/src/pro/oxfun.d.ts +0 -234
- package/js/src/pro/oxfun.js +0 -1106
- /package/dist/cjs/src/abstract/{oxfun.js → extended.js} +0 -0
- /package/js/src/abstract/{oxfun.js → extended.js} +0 -0
package/dist/cjs/src/blofin.js
CHANGED
|
@@ -551,6 +551,7 @@ class blofin extends blofin$1["default"] {
|
|
|
551
551
|
let maxLeverage = this.safeString(market, 'maxLeverage', '100');
|
|
552
552
|
maxLeverage = Precise["default"].stringMax(maxLeverage, '1');
|
|
553
553
|
const isActive = (this.safeString(market, 'state') === 'live');
|
|
554
|
+
const isMargin = spot && (Precise["default"].stringGt(maxLeverage, '1'));
|
|
554
555
|
return this.safeMarketStructure({
|
|
555
556
|
'id': id,
|
|
556
557
|
'symbol': symbol,
|
|
@@ -563,7 +564,7 @@ class blofin extends blofin$1["default"] {
|
|
|
563
564
|
'type': type,
|
|
564
565
|
'spot': spot,
|
|
565
566
|
'option': option,
|
|
566
|
-
'margin':
|
|
567
|
+
'margin': isMargin,
|
|
567
568
|
'swap': swap,
|
|
568
569
|
'future': future,
|
|
569
570
|
'active': isActive,
|
|
@@ -1463,6 +1464,7 @@ class blofin extends blofin$1["default"] {
|
|
|
1463
1464
|
* @param {object} [params.stopLoss] *stopLoss object in params* containing the triggerPrice at which the attached stop loss order will be triggered
|
|
1464
1465
|
* @param {float} [params.stopLoss.triggerPrice] stop loss trigger price
|
|
1465
1466
|
* @param {float} [params.stopLoss.price] stop loss order price (if not provided the order will be a market order)
|
|
1467
|
+
* @param {float} [params.tpsl] whether to force to send the order to the combined TPSL oco order endpoint
|
|
1466
1468
|
* @returns {object} an [order structure]{@link https://docs.ccxt.com/?id=order-structure}
|
|
1467
1469
|
*/
|
|
1468
1470
|
async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
|
|
@@ -1471,7 +1473,9 @@ class blofin extends blofin$1["default"] {
|
|
|
1471
1473
|
const isStopLossPriceDefined = this.safeString(params, 'stopLossPrice') !== undefined;
|
|
1472
1474
|
const isTakeProfitPriceDefined = this.safeString(params, 'takeProfitPrice') !== undefined;
|
|
1473
1475
|
const isTriggerOrder = this.safeString(params, 'triggerPrice') !== undefined;
|
|
1474
|
-
|
|
1476
|
+
let isTpslEndpoint = false;
|
|
1477
|
+
[isTpslEndpoint, params] = this.handleOptionAndParams(params, 'createOrder', 'tpsl', false);
|
|
1478
|
+
const isCombinedSlTp = (isStopLossPriceDefined && isTakeProfitPriceDefined) || isTpslEndpoint;
|
|
1475
1479
|
const isSlOrTp = isStopLossPriceDefined || isTakeProfitPriceDefined;
|
|
1476
1480
|
let response = undefined;
|
|
1477
1481
|
const reduceOnly = this.safeBool(params, 'reduceOnly');
|
|
@@ -1526,11 +1530,31 @@ class blofin extends blofin$1["default"] {
|
|
|
1526
1530
|
const takeProfitPrice = this.safeString(params, 'takeProfitPrice');
|
|
1527
1531
|
if (stopLossPrice !== undefined) {
|
|
1528
1532
|
request['slTriggerPrice'] = this.priceToPrecision(symbol, stopLossPrice);
|
|
1529
|
-
|
|
1533
|
+
if (type === 'market') {
|
|
1534
|
+
request['slOrderPrice'] = '-1';
|
|
1535
|
+
}
|
|
1536
|
+
else {
|
|
1537
|
+
const slLimitPrice = this.safeString(params, 'stopLossLimitPrice');
|
|
1538
|
+
if (slLimitPrice === undefined) {
|
|
1539
|
+
throw new errors.ArgumentsRequired(this.id + ' createTpslOrder() requires a "stopLossLimitPrice" parameter (instead of "price" argument) for stop loss orders when the order type is not market');
|
|
1540
|
+
}
|
|
1541
|
+
request['slOrderPrice'] = this.priceToPrecision(symbol, slLimitPrice);
|
|
1542
|
+
params = this.omit(params, 'stopLossLimitPrice');
|
|
1543
|
+
}
|
|
1530
1544
|
}
|
|
1531
1545
|
if (takeProfitPrice !== undefined) {
|
|
1532
1546
|
request['tpTriggerPrice'] = this.priceToPrecision(symbol, takeProfitPrice);
|
|
1533
|
-
|
|
1547
|
+
if (type === 'market') {
|
|
1548
|
+
request['tpOrderPrice'] = '-1';
|
|
1549
|
+
}
|
|
1550
|
+
else {
|
|
1551
|
+
const tpLimitPrice = this.safeString(params, 'takeProfitLimitPrice');
|
|
1552
|
+
if (tpLimitPrice === undefined) {
|
|
1553
|
+
throw new errors.ArgumentsRequired(this.id + ' createTpslOrder() requires a "takeProfitLimitPrice" parameter (instead of "price" argument) for take profit orders when the order type is not market');
|
|
1554
|
+
}
|
|
1555
|
+
request['tpOrderPrice'] = this.priceToPrecision(symbol, tpLimitPrice);
|
|
1556
|
+
params = this.omit(params, 'takeProfitLimitPrice');
|
|
1557
|
+
}
|
|
1534
1558
|
}
|
|
1535
1559
|
request['marginMode'] = marginMode;
|
|
1536
1560
|
params = this.omit(params, ['stopLossPrice', 'takeProfitPrice', 'reduceOnly', 'hedged']);
|
package/dist/cjs/src/bullish.js
CHANGED
|
@@ -2099,7 +2099,7 @@ class bullish extends bullish$1["default"] {
|
|
|
2099
2099
|
let networkCode = undefined;
|
|
2100
2100
|
[networkCode, params] = this.handleNetworkCodeAndParams(params);
|
|
2101
2101
|
if (networkCode !== undefined) {
|
|
2102
|
-
request['network'] = this.networkCodeToId(networkCode);
|
|
2102
|
+
request['network'] = this.networkCodeToId(networkCode, code);
|
|
2103
2103
|
}
|
|
2104
2104
|
else {
|
|
2105
2105
|
throw new errors.ArgumentsRequired(this.id + ' withdraw() requires a network parameter');
|
|
@@ -2173,7 +2173,7 @@ class bullish extends bullish$1["default"] {
|
|
|
2173
2173
|
'txid': txid,
|
|
2174
2174
|
'timestamp': timestamp,
|
|
2175
2175
|
'datetime': this.iso8601(timestamp),
|
|
2176
|
-
'network': this.networkIdToCode(network),
|
|
2176
|
+
'network': this.networkIdToCode(network, code),
|
|
2177
2177
|
'addressFrom': sourceAddress,
|
|
2178
2178
|
'address': address,
|
|
2179
2179
|
'addressTo': address,
|
|
@@ -2370,7 +2370,7 @@ class bullish extends bullish$1["default"] {
|
|
|
2370
2370
|
for (let i = 0; i < safeResponse.length; i++) {
|
|
2371
2371
|
const entry = this.safeDict(safeResponse, i, {});
|
|
2372
2372
|
const networkId = this.safeString(entry, 'network');
|
|
2373
|
-
const networkCode = this.networkIdToCode(networkId);
|
|
2373
|
+
const networkCode = this.networkIdToCode(networkId, code);
|
|
2374
2374
|
if (network === networkCode) {
|
|
2375
2375
|
data = entry;
|
|
2376
2376
|
break;
|
|
@@ -2386,10 +2386,11 @@ class bullish extends bullish$1["default"] {
|
|
|
2386
2386
|
parseDepositAddress(depositAddress, currency = undefined) {
|
|
2387
2387
|
const id = this.safeString(depositAddress, 'symbol');
|
|
2388
2388
|
const network = this.safeString(depositAddress, 'network');
|
|
2389
|
+
const code = this.safeCurrencyCode(id, currency);
|
|
2389
2390
|
return {
|
|
2390
2391
|
'info': depositAddress,
|
|
2391
|
-
'currency':
|
|
2392
|
-
'network': this.networkIdToCode(network),
|
|
2392
|
+
'currency': code,
|
|
2393
|
+
'network': this.networkIdToCode(network, code),
|
|
2393
2394
|
'address': this.safeString(depositAddress, 'address'),
|
|
2394
2395
|
'tag': undefined,
|
|
2395
2396
|
};
|
package/dist/cjs/src/bybit.js
CHANGED
|
@@ -1546,8 +1546,9 @@ class bybit extends bybit$1["default"] {
|
|
|
1546
1546
|
amountPrecision = this.parseNumber('1');
|
|
1547
1547
|
pricePrecision = this.parseNumber('0.01');
|
|
1548
1548
|
}
|
|
1549
|
+
const convertedExpireDate = this.convertExpireDateToMarketIdDate(expiry);
|
|
1549
1550
|
return {
|
|
1550
|
-
'id': base + '-' +
|
|
1551
|
+
'id': base + '-' + convertedExpireDate + '-' + strike + '-' + optionType,
|
|
1551
1552
|
'symbol': base + '/' + quote + ':' + settle + '-' + expiry + '-' + strike + '-' + optionType,
|
|
1552
1553
|
'base': base,
|
|
1553
1554
|
'quote': quote,
|
|
@@ -1954,8 +1955,8 @@ class bybit extends bybit$1["default"] {
|
|
|
1954
1955
|
}
|
|
1955
1956
|
return result;
|
|
1956
1957
|
}
|
|
1957
|
-
async fetchFutureMarkets(params) {
|
|
1958
|
-
params = this.extend(params);
|
|
1958
|
+
async fetchFutureMarkets(params = {}) {
|
|
1959
|
+
params = this.extend(params, {});
|
|
1959
1960
|
params['limit'] = 1000; // minimize number of requests
|
|
1960
1961
|
let preLaunchMarkets = [];
|
|
1961
1962
|
const usePrivateInstrumentsInfo = this.safeBool(this.options, 'usePrivateInstrumentsInfo', false);
|
|
@@ -2098,7 +2099,7 @@ class bybit extends bybit$1["default"] {
|
|
|
2098
2099
|
symbol = symbol + '-' + this.yymmdd(expiry);
|
|
2099
2100
|
}
|
|
2100
2101
|
const contractSize = inverse ? this.safeNumber2(lotSizeFilter, 'minTradingQty', 'minOrderQty') : this.parseNumber('1');
|
|
2101
|
-
|
|
2102
|
+
const parsedMarket = this.safeMarketStructure({
|
|
2102
2103
|
'id': id,
|
|
2103
2104
|
'symbol': symbol,
|
|
2104
2105
|
'base': base,
|
|
@@ -2148,7 +2149,8 @@ class bybit extends bybit$1["default"] {
|
|
|
2148
2149
|
},
|
|
2149
2150
|
'created': this.safeInteger(market, 'launchTime'),
|
|
2150
2151
|
'info': market,
|
|
2151
|
-
})
|
|
2152
|
+
});
|
|
2153
|
+
result.push(parsedMarket);
|
|
2152
2154
|
}
|
|
2153
2155
|
return result;
|
|
2154
2156
|
}
|
|
@@ -4954,7 +4956,7 @@ class bybit extends bybit$1["default"] {
|
|
|
4954
4956
|
//
|
|
4955
4957
|
const result = this.safeDict(response, 'result', {});
|
|
4956
4958
|
const row = this.safeList(result, 'list', []);
|
|
4957
|
-
return this.parseOrders(row
|
|
4959
|
+
return this.parseOrders(row);
|
|
4958
4960
|
}
|
|
4959
4961
|
/**
|
|
4960
4962
|
* @method
|
|
@@ -5791,7 +5793,7 @@ class bybit extends bybit$1["default"] {
|
|
|
5791
5793
|
*/
|
|
5792
5794
|
async fetchDepositAddressesByNetwork(code, params = {}) {
|
|
5793
5795
|
await this.loadMarkets();
|
|
5794
|
-
|
|
5796
|
+
const currency = this.currency(code);
|
|
5795
5797
|
const request = {
|
|
5796
5798
|
'coin': currency['id'],
|
|
5797
5799
|
};
|
|
@@ -5823,9 +5825,9 @@ class bybit extends bybit$1["default"] {
|
|
|
5823
5825
|
const result = this.safeDict(response, 'result', {});
|
|
5824
5826
|
const chains = this.safeList(result, 'chains', []);
|
|
5825
5827
|
const coin = this.safeString(result, 'coin');
|
|
5826
|
-
|
|
5827
|
-
const parsed = this.parseDepositAddresses(chains, [
|
|
5828
|
-
'currency':
|
|
5828
|
+
const currencyFromResponse = this.currency(coin);
|
|
5829
|
+
const parsed = this.parseDepositAddresses(chains, [currencyFromResponse['code']], false, {
|
|
5830
|
+
'currency': currencyFromResponse['code'],
|
|
5829
5831
|
});
|
|
5830
5832
|
return this.indexBy(parsed, 'network');
|
|
5831
5833
|
}
|
|
@@ -7099,7 +7101,7 @@ class bybit extends bybit$1["default"] {
|
|
|
7099
7101
|
}
|
|
7100
7102
|
async fetchDerivativesOpenInterestHistory(symbol, timeframe = '1h', since = undefined, limit = undefined, params = {}) {
|
|
7101
7103
|
await this.loadMarkets();
|
|
7102
|
-
|
|
7104
|
+
const market = this.market(symbol);
|
|
7103
7105
|
const subType = market['linear'] ? 'linear' : 'inverse';
|
|
7104
7106
|
const category = this.safeString(params, 'category', subType);
|
|
7105
7107
|
const intervals = this.safeDict(this.options, 'intervals');
|
|
@@ -7150,8 +7152,8 @@ class bybit extends bybit$1["default"] {
|
|
|
7150
7152
|
const result = this.safeDict(response, 'result', {});
|
|
7151
7153
|
const data = this.addPaginationCursorToResult(response);
|
|
7152
7154
|
const id = this.safeString(result, 'symbol');
|
|
7153
|
-
|
|
7154
|
-
return this.parseOpenInterestsHistory(data,
|
|
7155
|
+
const safeMarketObj = this.safeMarket(id, market, undefined, 'contract');
|
|
7156
|
+
return this.parseOpenInterestsHistory(data, safeMarketObj, since, limit);
|
|
7155
7157
|
}
|
|
7156
7158
|
/**
|
|
7157
7159
|
* @method
|
|
@@ -7166,7 +7168,7 @@ class bybit extends bybit$1["default"] {
|
|
|
7166
7168
|
*/
|
|
7167
7169
|
async fetchOpenInterest(symbol, params = {}) {
|
|
7168
7170
|
await this.loadMarkets();
|
|
7169
|
-
|
|
7171
|
+
const market = this.market(symbol);
|
|
7170
7172
|
if (!market['contract']) {
|
|
7171
7173
|
throw new errors.BadRequest(this.id + ' fetchOpenInterest() supports contract markets only');
|
|
7172
7174
|
}
|
|
@@ -7209,9 +7211,9 @@ class bybit extends bybit$1["default"] {
|
|
|
7209
7211
|
//
|
|
7210
7212
|
const result = this.safeDict(response, 'result', {});
|
|
7211
7213
|
const id = this.safeString(result, 'symbol');
|
|
7212
|
-
|
|
7214
|
+
const safeMarketObj = this.safeMarket(id, market, undefined, 'contract');
|
|
7213
7215
|
const data = this.addPaginationCursorToResult(response);
|
|
7214
|
-
return this.parseOpenInterest(data[0],
|
|
7216
|
+
return this.parseOpenInterest(data[0], safeMarketObj);
|
|
7215
7217
|
}
|
|
7216
7218
|
/**
|
|
7217
7219
|
* @method
|
|
@@ -7376,7 +7378,7 @@ class bybit extends bybit$1["default"] {
|
|
|
7376
7378
|
//
|
|
7377
7379
|
const data = this.safeDict(response, 'result', {});
|
|
7378
7380
|
const rows = this.safeList(data, 'loanAccountList', []);
|
|
7379
|
-
const interest = this.parseBorrowInterests(rows
|
|
7381
|
+
const interest = this.parseBorrowInterests(rows);
|
|
7380
7382
|
return this.filterByCurrencySinceLimit(interest, code, since, limit);
|
|
7381
7383
|
}
|
|
7382
7384
|
/**
|
package/dist/cjs/src/bybiteu.js
CHANGED
package/dist/cjs/src/bydfi.js
CHANGED
|
@@ -2819,7 +2819,7 @@ class bydfi extends bydfi$1["default"] {
|
|
|
2819
2819
|
'txid': this.safeString(transaction, 'txId'),
|
|
2820
2820
|
'type': undefined,
|
|
2821
2821
|
'currency': code,
|
|
2822
|
-
'network': this.networkIdToCode(this.safeString(transaction, 'network')),
|
|
2822
|
+
'network': this.networkIdToCode(this.safeString(transaction, 'network'), code),
|
|
2823
2823
|
'amount': this.safeNumber(transaction, 'amount'),
|
|
2824
2824
|
'status': this.parseTransactionStatus(rawStatus),
|
|
2825
2825
|
'timestamp': timestamp,
|
package/dist/cjs/src/cex.js
CHANGED
|
@@ -373,7 +373,7 @@ class cex extends cex$1["default"] {
|
|
|
373
373
|
for (let j = 0; j < keys.length; j++) {
|
|
374
374
|
const networkId = keys[j];
|
|
375
375
|
const rawNetwork = rawNetworks[networkId];
|
|
376
|
-
const networkCode = this.networkIdToCode(networkId);
|
|
376
|
+
const networkCode = this.networkIdToCode(networkId, code);
|
|
377
377
|
const deposit = this.safeString(rawNetwork, 'deposit') === 'enabled';
|
|
378
378
|
const withdraw = this.safeString(rawNetwork, 'withdrawal') === 'enabled';
|
|
379
379
|
networks[networkCode] = {
|
|
@@ -1701,7 +1701,7 @@ class cex extends cex$1["default"] {
|
|
|
1701
1701
|
const request = {
|
|
1702
1702
|
'accountId': accountId,
|
|
1703
1703
|
'currency': currency['id'],
|
|
1704
|
-
'blockchain': this.networkCodeToId(networkCode),
|
|
1704
|
+
'blockchain': this.networkCodeToId(networkCode, currency['code']),
|
|
1705
1705
|
};
|
|
1706
1706
|
const response = await this.privatePostGetDepositAddress(this.extend(request, params));
|
|
1707
1707
|
//
|
|
@@ -1726,7 +1726,7 @@ class cex extends cex$1["default"] {
|
|
|
1726
1726
|
return {
|
|
1727
1727
|
'info': depositAddress,
|
|
1728
1728
|
'currency': currency['code'],
|
|
1729
|
-
'network': this.networkIdToCode(this.safeString(depositAddress, 'blockchain')),
|
|
1729
|
+
'network': this.networkIdToCode(this.safeString(depositAddress, 'blockchain'), currency['code']),
|
|
1730
1730
|
'address': address,
|
|
1731
1731
|
'tag': undefined,
|
|
1732
1732
|
};
|