ccxt 4.1.56 → 4.1.58
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/.git-templates/hooks/pre-push +2 -2
- package/README.md +3 -3
- package/build.sh +30 -18
- package/dist/ccxt.browser.js +3893 -3214
- package/dist/ccxt.browser.min.js +10 -10
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/ace.js +17 -13
- package/dist/cjs/src/alpaca.js +6 -6
- package/dist/cjs/src/ascendex.js +35 -29
- package/dist/cjs/src/base/Exchange.js +39 -26
- package/dist/cjs/src/base/Precise.js +1 -3
- package/dist/cjs/src/base/ws/Client.js +1 -1
- package/dist/cjs/src/bigone.js +24 -20
- package/dist/cjs/src/binance.js +97 -76
- package/dist/cjs/src/bingx.js +63 -44
- package/dist/cjs/src/bit2c.js +18 -15
- package/dist/cjs/src/bitbank.js +16 -15
- package/dist/cjs/src/bitbns.js +28 -18
- package/dist/cjs/src/bitfinex.js +23 -21
- package/dist/cjs/src/bitfinex2.js +32 -28
- package/dist/cjs/src/bitflyer.js +28 -20
- package/dist/cjs/src/bitforex.js +25 -18
- package/dist/cjs/src/bitget.js +184 -147
- package/dist/cjs/src/bithumb.js +23 -16
- package/dist/cjs/src/bitmart.js +110 -89
- package/dist/cjs/src/bitmex.js +104 -64
- package/dist/cjs/src/bitopro.js +38 -26
- package/dist/cjs/src/bitpanda.js +24 -23
- package/dist/cjs/src/bitrue.js +33 -24
- package/dist/cjs/src/bitso.js +24 -23
- package/dist/cjs/src/bitstamp.js +24 -23
- package/dist/cjs/src/bittrex.js +30 -29
- package/dist/cjs/src/bitvavo.js +38 -30
- package/dist/cjs/src/bl3p.js +11 -10
- package/dist/cjs/src/blockchaincom.js +20 -20
- package/dist/cjs/src/btcalpha.js +18 -17
- package/dist/cjs/src/btcbox.js +13 -12
- package/dist/cjs/src/btcmarkets.js +20 -19
- package/dist/cjs/src/btcturk.js +14 -13
- package/dist/cjs/src/bybit.js +84 -54
- package/dist/cjs/src/cex.js +16 -14
- package/dist/cjs/src/coinbase.js +29 -27
- package/dist/cjs/src/coinbasepro.js +27 -25
- package/dist/cjs/src/coincheck.js +15 -14
- package/dist/cjs/src/coinex.js +100 -77
- package/dist/cjs/src/coinlist.js +28 -27
- package/dist/cjs/src/coinmate.js +20 -17
- package/dist/cjs/src/coinone.js +21 -16
- package/dist/cjs/src/coinsph.js +37 -28
- package/dist/cjs/src/coinspot.js +12 -11
- package/dist/cjs/src/cryptocom.js +40 -202
- package/dist/cjs/src/currencycom.js +32 -25
- package/dist/cjs/src/delta.js +34 -28
- package/dist/cjs/src/deribit.js +39 -36
- package/dist/cjs/src/digifinex.js +64 -44
- package/dist/cjs/src/exmo.js +29 -27
- package/dist/cjs/src/gate.js +67 -53
- package/dist/cjs/src/gemini.js +23 -20
- package/dist/cjs/src/hitbtc.js +65 -56
- package/dist/cjs/src/hollaex.js +30 -27
- package/dist/cjs/src/htx.js +132 -143
- package/dist/cjs/src/huobijp.js +22 -20
- package/dist/cjs/src/idex.js +22 -21
- package/dist/cjs/src/independentreserve.js +15 -14
- package/dist/cjs/src/indodax.js +30 -26
- package/dist/cjs/src/kraken.js +29 -27
- package/dist/cjs/src/krakenfutures.js +29 -22
- package/dist/cjs/src/kucoin.js +48 -43
- package/dist/cjs/src/kucoinfutures.js +33 -28
- package/dist/cjs/src/kuna.js +25 -24
- package/dist/cjs/src/latoken.js +24 -22
- package/dist/cjs/src/lbank.js +45 -30
- package/dist/cjs/src/luno.js +22 -19
- package/dist/cjs/src/lykke.js +19 -17
- package/dist/cjs/src/mercado.js +30 -19
- package/dist/cjs/src/mexc.js +60 -49
- package/dist/cjs/src/ndax.js +23 -22
- package/dist/cjs/src/novadax.js +23 -22
- package/dist/cjs/src/oceanex.js +22 -19
- package/dist/cjs/src/okcoin.js +29 -23
- package/dist/cjs/src/okx.js +87 -82
- package/dist/cjs/src/p2b.js +79 -82
- package/dist/cjs/src/paymium.js +10 -10
- package/dist/cjs/src/phemex.js +63 -40
- package/dist/cjs/src/poloniex.js +22 -22
- package/dist/cjs/src/poloniexfutures.js +23 -19
- package/dist/cjs/src/pro/alpaca.js +5 -5
- package/dist/cjs/src/pro/ascendex.js +4 -4
- package/dist/cjs/src/pro/binance.js +16 -16
- package/dist/cjs/src/pro/bingx.js +1 -1
- package/dist/cjs/src/pro/bitfinex.js +4 -4
- package/dist/cjs/src/pro/bitfinex2.js +6 -6
- package/dist/cjs/src/pro/bitget.js +7 -7
- package/dist/cjs/src/pro/bitmart.js +7 -5
- package/dist/cjs/src/pro/bitmex.js +6 -6
- package/dist/cjs/src/pro/bitopro.js +4 -4
- package/dist/cjs/src/pro/bitpanda.js +6 -6
- package/dist/cjs/src/pro/bitrue.js +2 -2
- package/dist/cjs/src/pro/bitstamp.js +6 -4
- package/dist/cjs/src/pro/bittrex.js +15 -6
- package/dist/cjs/src/pro/bitvavo.js +11 -7
- package/dist/cjs/src/pro/blockchaincom.js +8 -8
- package/dist/cjs/src/pro/bybit.js +7 -7
- package/dist/cjs/src/pro/cex.js +13 -9
- package/dist/cjs/src/pro/coinbase.js +5 -5
- package/dist/cjs/src/pro/coinbasepro.js +11 -10
- package/dist/cjs/src/pro/coinex.js +7 -9
- package/dist/cjs/src/pro/cryptocom.js +9 -9
- package/dist/cjs/src/pro/currencycom.js +4 -4
- package/dist/cjs/src/pro/deribit.js +6 -6
- package/dist/cjs/src/pro/exmo.js +12 -14
- package/dist/cjs/src/pro/gate.js +7 -7
- package/dist/cjs/src/pro/gemini.js +3 -3
- package/dist/cjs/src/pro/hitbtc.js +263 -4
- package/dist/cjs/src/pro/hollaex.js +5 -5
- package/dist/cjs/src/pro/htx.js +6 -6
- package/dist/cjs/src/pro/huobijp.js +3 -3
- package/dist/cjs/src/pro/idex.js +4 -4
- package/dist/cjs/src/pro/independentreserve.js +2 -2
- package/dist/cjs/src/pro/kraken.js +10 -10
- package/dist/cjs/src/pro/krakenfutures.js +41 -17
- package/dist/cjs/src/pro/kucoin.js +7 -7
- package/dist/cjs/src/pro/kucoinfutures.js +8 -6
- package/dist/cjs/src/pro/luno.js +2 -2
- package/dist/cjs/src/pro/mexc.js +6 -6
- package/dist/cjs/src/pro/ndax.js +3 -3
- package/dist/cjs/src/pro/okcoin.js +5 -5
- package/dist/cjs/src/pro/okx.js +12 -12
- package/dist/cjs/src/pro/phemex.js +6 -6
- package/dist/cjs/src/pro/poloniex.js +7 -7
- package/dist/cjs/src/pro/poloniexfutures.js +5 -5
- package/dist/cjs/src/pro/probit.js +6 -6
- package/dist/cjs/src/pro/upbit.js +3 -3
- package/dist/cjs/src/pro/wazirx.js +8 -8
- package/dist/cjs/src/pro/whitebit.js +12 -8
- package/dist/cjs/src/pro/woo.js +1 -1
- package/dist/cjs/src/probit.js +28 -23
- package/dist/cjs/src/tidex.js +16 -15
- package/dist/cjs/src/timex.js +19 -18
- package/dist/cjs/src/tokocrypto.js +27 -22
- package/dist/cjs/src/upbit.js +19 -19
- package/dist/cjs/src/wavesexchange.js +22 -19
- package/dist/cjs/src/wazirx.js +24 -17
- package/dist/cjs/src/whitebit.js +33 -27
- package/dist/cjs/src/woo.js +44 -34
- package/dist/cjs/src/yobit.js +25 -20
- package/dist/cjs/src/zaif.js +9 -9
- package/dist/cjs/src/zonda.js +18 -17
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/abstract/bybit.d.ts +1 -0
- package/js/src/abstract/cryptocom.d.ts +0 -20
- package/js/src/ace.js +18 -14
- package/js/src/alpaca.js +6 -6
- package/js/src/ascendex.js +35 -29
- package/js/src/base/Exchange.d.ts +37 -34
- package/js/src/base/Exchange.js +39 -26
- package/js/src/base/Precise.d.ts +4 -4
- package/js/src/base/Precise.js +1 -3
- package/js/src/base/functions/type.d.ts +25 -25
- package/js/src/base/types.d.ts +21 -14
- package/js/src/base/ws/Client.js +1 -1
- package/js/src/bigone.js +25 -21
- package/js/src/binance.d.ts +2 -2
- package/js/src/binance.js +97 -76
- package/js/src/bingx.js +63 -44
- package/js/src/bit2c.js +19 -16
- package/js/src/bitbank.js +16 -15
- package/js/src/bitbns.js +28 -18
- package/js/src/bitfinex.js +23 -21
- package/js/src/bitfinex2.js +32 -28
- package/js/src/bitflyer.js +28 -20
- package/js/src/bitforex.js +26 -19
- package/js/src/bitget.d.ts +25 -3
- package/js/src/bitget.js +184 -147
- package/js/src/bithumb.js +23 -16
- package/js/src/bitmart.d.ts +1 -1
- package/js/src/bitmart.js +110 -89
- package/js/src/bitmex.d.ts +2 -2
- package/js/src/bitmex.js +104 -64
- package/js/src/bitopro.js +38 -26
- package/js/src/bitpanda.js +24 -23
- package/js/src/bitrue.js +33 -24
- package/js/src/bitso.js +24 -23
- package/js/src/bitstamp.d.ts +2 -2
- package/js/src/bitstamp.js +24 -23
- package/js/src/bittrex.js +30 -29
- package/js/src/bitvavo.js +38 -30
- package/js/src/bl3p.js +11 -10
- package/js/src/blockchaincom.js +20 -20
- package/js/src/btcalpha.js +18 -17
- package/js/src/btcbox.js +13 -12
- package/js/src/btcmarkets.js +20 -19
- package/js/src/btcturk.js +14 -13
- package/js/src/bybit.d.ts +1 -1
- package/js/src/bybit.js +84 -54
- package/js/src/cex.js +16 -14
- package/js/src/coinbase.js +29 -27
- package/js/src/coinbasepro.js +27 -25
- package/js/src/coincheck.js +15 -14
- package/js/src/coinex.d.ts +1 -1
- package/js/src/coinex.js +100 -77
- package/js/src/coinlist.js +28 -27
- package/js/src/coinmate.js +21 -18
- package/js/src/coinone.js +21 -16
- package/js/src/coinsph.js +37 -28
- package/js/src/coinspot.js +12 -11
- package/js/src/cryptocom.d.ts +0 -23
- package/js/src/cryptocom.js +40 -202
- package/js/src/currencycom.js +32 -25
- package/js/src/delta.js +35 -29
- package/js/src/deribit.js +39 -36
- package/js/src/digifinex.d.ts +2 -2
- package/js/src/digifinex.js +65 -45
- package/js/src/exmo.js +29 -27
- package/js/src/gate.d.ts +1 -1
- package/js/src/gate.js +67 -53
- package/js/src/gemini.js +23 -20
- package/js/src/hitbtc.d.ts +1 -0
- package/js/src/hitbtc.js +65 -56
- package/js/src/hollaex.js +30 -27
- package/js/src/htx.d.ts +11 -3
- package/js/src/htx.js +132 -143
- package/js/src/huobijp.js +23 -21
- package/js/src/idex.js +22 -21
- package/js/src/independentreserve.js +15 -14
- package/js/src/indodax.js +30 -26
- package/js/src/kraken.js +29 -27
- package/js/src/krakenfutures.js +29 -22
- package/js/src/kucoin.d.ts +1 -1
- package/js/src/kucoin.js +48 -43
- package/js/src/kucoinfutures.js +33 -28
- package/js/src/kuna.js +25 -24
- package/js/src/latoken.js +25 -23
- package/js/src/lbank.js +46 -31
- package/js/src/luno.js +22 -19
- package/js/src/lykke.js +19 -17
- package/js/src/mercado.js +30 -19
- package/js/src/mexc.d.ts +1 -1
- package/js/src/mexc.js +60 -49
- package/js/src/ndax.js +23 -22
- package/js/src/novadax.js +23 -22
- package/js/src/oceanex.js +22 -19
- package/js/src/okcoin.js +29 -23
- package/js/src/okx.d.ts +2 -2
- package/js/src/okx.js +87 -82
- package/js/src/p2b.d.ts +8 -7
- package/js/src/p2b.js +79 -81
- package/js/src/paymium.js +10 -10
- package/js/src/phemex.js +63 -40
- package/js/src/poloniex.js +22 -22
- package/js/src/poloniexfutures.js +23 -19
- package/js/src/pro/alpaca.js +5 -5
- package/js/src/pro/ascendex.js +4 -4
- package/js/src/pro/binance.js +16 -16
- package/js/src/pro/bingx.js +1 -1
- package/js/src/pro/bitfinex.js +4 -4
- package/js/src/pro/bitfinex2.d.ts +1 -1
- package/js/src/pro/bitfinex2.js +6 -6
- package/js/src/pro/bitget.js +7 -7
- package/js/src/pro/bitmart.js +7 -5
- package/js/src/pro/bitmex.js +6 -6
- package/js/src/pro/bitopro.js +4 -4
- package/js/src/pro/bitpanda.js +6 -6
- package/js/src/pro/bitrue.js +2 -2
- package/js/src/pro/bitstamp.js +7 -5
- package/js/src/pro/bittrex.js +15 -6
- package/js/src/pro/bitvavo.js +12 -8
- package/js/src/pro/blockchaincom.js +8 -8
- package/js/src/pro/bybit.js +7 -7
- package/js/src/pro/cex.js +14 -10
- package/js/src/pro/coinbase.js +5 -5
- package/js/src/pro/coinbasepro.js +12 -11
- package/js/src/pro/coinex.js +7 -9
- package/js/src/pro/cryptocom.js +9 -9
- package/js/src/pro/currencycom.js +4 -4
- package/js/src/pro/deribit.js +6 -6
- package/js/src/pro/exmo.js +12 -14
- package/js/src/pro/gate.js +7 -7
- package/js/src/pro/gemini.js +3 -3
- package/js/src/pro/hitbtc.d.ts +8 -1
- package/js/src/pro/hitbtc.js +264 -5
- package/js/src/pro/hollaex.js +5 -5
- package/js/src/pro/htx.js +6 -6
- package/js/src/pro/huobijp.js +3 -3
- package/js/src/pro/idex.js +4 -4
- package/js/src/pro/independentreserve.js +2 -2
- package/js/src/pro/kraken.js +10 -10
- package/js/src/pro/krakenfutures.d.ts +1 -0
- package/js/src/pro/krakenfutures.js +42 -18
- package/js/src/pro/kucoin.js +7 -7
- package/js/src/pro/kucoinfutures.js +8 -6
- package/js/src/pro/luno.js +2 -2
- package/js/src/pro/mexc.js +6 -6
- package/js/src/pro/ndax.js +3 -3
- package/js/src/pro/okcoin.js +5 -5
- package/js/src/pro/okx.js +12 -12
- package/js/src/pro/phemex.js +6 -6
- package/js/src/pro/poloniex.js +7 -7
- package/js/src/pro/poloniexfutures.js +5 -5
- package/js/src/pro/probit.js +6 -6
- package/js/src/pro/upbit.js +3 -3
- package/js/src/pro/wazirx.js +8 -8
- package/js/src/pro/whitebit.js +13 -9
- package/js/src/pro/woo.js +1 -1
- package/js/src/probit.js +29 -24
- package/js/src/tidex.js +16 -15
- package/js/src/timex.js +19 -18
- package/js/src/tokocrypto.js +28 -23
- package/js/src/upbit.js +19 -19
- package/js/src/wavesexchange.js +23 -20
- package/js/src/wazirx.js +25 -18
- package/js/src/whitebit.js +33 -27
- package/js/src/woo.js +45 -35
- package/js/src/yobit.js +25 -20
- package/js/src/zaif.js +9 -9
- package/js/src/zonda.js +18 -17
- package/package.json +1 -1
package/dist/cjs/src/btcturk.js
CHANGED
|
@@ -32,16 +32,17 @@ class btcturk extends btcturk$1 {
|
|
|
32
32
|
'createOrder': true,
|
|
33
33
|
'createReduceOnlyOrder': false,
|
|
34
34
|
'fetchBalance': true,
|
|
35
|
-
'fetchBorrowRate': false,
|
|
36
35
|
'fetchBorrowRateHistories': false,
|
|
37
36
|
'fetchBorrowRateHistory': false,
|
|
38
|
-
'
|
|
39
|
-
'
|
|
37
|
+
'fetchCrossBorrowRate': false,
|
|
38
|
+
'fetchCrossBorrowRates': false,
|
|
40
39
|
'fetchFundingHistory': false,
|
|
41
40
|
'fetchFundingRate': false,
|
|
42
41
|
'fetchFundingRateHistory': false,
|
|
43
42
|
'fetchFundingRates': false,
|
|
44
43
|
'fetchIndexOHLCV': false,
|
|
44
|
+
'fetchIsolatedBorrowRate': false,
|
|
45
|
+
'fetchIsolatedBorrowRates': false,
|
|
45
46
|
'fetchLeverage': false,
|
|
46
47
|
'fetchMarginMode': false,
|
|
47
48
|
'fetchMarkets': true,
|
|
@@ -291,7 +292,7 @@ class btcturk extends btcturk$1 {
|
|
|
291
292
|
* @name btcturk#fetchBalance
|
|
292
293
|
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
293
294
|
* @param {object} [params] extra parameters specific to the btcturk api endpoint
|
|
294
|
-
* @returns {object} a [balance structure]{@link https://
|
|
295
|
+
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
295
296
|
*/
|
|
296
297
|
await this.loadMarkets();
|
|
297
298
|
const response = await this.privateGetUsersBalances(params);
|
|
@@ -321,7 +322,7 @@ class btcturk extends btcturk$1 {
|
|
|
321
322
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
322
323
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
323
324
|
* @param {object} [params] extra parameters specific to the btcturk api endpoint
|
|
324
|
-
* @returns {object} A dictionary of [order book structures]{@link https://
|
|
325
|
+
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
325
326
|
*/
|
|
326
327
|
await this.loadMarkets();
|
|
327
328
|
const market = this.market(symbol);
|
|
@@ -400,7 +401,7 @@ class btcturk extends btcturk$1 {
|
|
|
400
401
|
* @description fetches price tickers for multiple markets, statistical calculations with the information calculated over the past 24 hours each market
|
|
401
402
|
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
402
403
|
* @param {object} [params] extra parameters specific to the btcturk api endpoint
|
|
403
|
-
* @returns {object} a dictionary of [ticker structures]{@link https://
|
|
404
|
+
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
404
405
|
*/
|
|
405
406
|
await this.loadMarkets();
|
|
406
407
|
const response = await this.publicGetTicker(params);
|
|
@@ -414,7 +415,7 @@ class btcturk extends btcturk$1 {
|
|
|
414
415
|
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
415
416
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
416
417
|
* @param {object} [params] extra parameters specific to the btcturk api endpoint
|
|
417
|
-
* @returns {object} a [ticker structure]{@link https://
|
|
418
|
+
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
418
419
|
*/
|
|
419
420
|
await this.loadMarkets();
|
|
420
421
|
const tickers = await this.fetchTickers([symbol], params);
|
|
@@ -491,7 +492,7 @@ class btcturk extends btcturk$1 {
|
|
|
491
492
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
492
493
|
* @param {int} [limit] the maximum amount of trades to fetch
|
|
493
494
|
* @param {object} [params] extra parameters specific to the btcturk api endpoint
|
|
494
|
-
* @returns {Trade[]} a list of [trade structures]{@link https://
|
|
495
|
+
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
|
|
495
496
|
*/
|
|
496
497
|
await this.loadMarkets();
|
|
497
498
|
const market = this.market(symbol);
|
|
@@ -656,7 +657,7 @@ class btcturk extends btcturk$1 {
|
|
|
656
657
|
* @param {float} amount how much of currency you want to trade in units of base currency
|
|
657
658
|
* @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
|
|
658
659
|
* @param {object} [params] extra parameters specific to the btcturk api endpoint
|
|
659
|
-
* @returns {object} an [order structure]{@link https://
|
|
660
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
660
661
|
*/
|
|
661
662
|
await this.loadMarkets();
|
|
662
663
|
const market = this.market(symbol);
|
|
@@ -687,7 +688,7 @@ class btcturk extends btcturk$1 {
|
|
|
687
688
|
* @param {string} id order id
|
|
688
689
|
* @param {string} symbol not used by btcturk cancelOrder ()
|
|
689
690
|
* @param {object} [params] extra parameters specific to the btcturk api endpoint
|
|
690
|
-
* @returns {object} An [order structure]{@link https://
|
|
691
|
+
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
691
692
|
*/
|
|
692
693
|
const request = {
|
|
693
694
|
'id': id,
|
|
@@ -703,7 +704,7 @@ class btcturk extends btcturk$1 {
|
|
|
703
704
|
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
704
705
|
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
705
706
|
* @param {object} [params] extra parameters specific to the btcturk api endpoint
|
|
706
|
-
* @returns {Order[]} a list of [order structures]{@link https://
|
|
707
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
707
708
|
*/
|
|
708
709
|
await this.loadMarkets();
|
|
709
710
|
const request = {};
|
|
@@ -727,7 +728,7 @@ class btcturk extends btcturk$1 {
|
|
|
727
728
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
728
729
|
* @param {int} [limit] the maximum number of orde structures to retrieve
|
|
729
730
|
* @param {object} [params] extra parameters specific to the btcturk api endpoint
|
|
730
|
-
* @returns {Order[]} a list of [order structures]{@link https://
|
|
731
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
731
732
|
*/
|
|
732
733
|
await this.loadMarkets();
|
|
733
734
|
const market = this.market(symbol);
|
|
@@ -849,7 +850,7 @@ class btcturk extends btcturk$1 {
|
|
|
849
850
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
850
851
|
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
851
852
|
* @param {object} [params] extra parameters specific to the btcturk api endpoint
|
|
852
|
-
* @returns {Trade[]} a list of [trade structures]{@link https://
|
|
853
|
+
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
853
854
|
*/
|
|
854
855
|
await this.loadMarkets();
|
|
855
856
|
let market = undefined;
|
package/dist/cjs/src/bybit.js
CHANGED
|
@@ -44,12 +44,12 @@ class bybit extends bybit$1 {
|
|
|
44
44
|
'editOrder': true,
|
|
45
45
|
'fetchBalance': true,
|
|
46
46
|
'fetchBorrowInterest': false,
|
|
47
|
-
'fetchBorrowRate': true,
|
|
48
47
|
'fetchBorrowRateHistories': false,
|
|
49
48
|
'fetchBorrowRateHistory': false,
|
|
50
|
-
'fetchBorrowRates': false,
|
|
51
49
|
'fetchCanceledOrders': true,
|
|
52
50
|
'fetchClosedOrders': true,
|
|
51
|
+
'fetchCrossBorrowRate': true,
|
|
52
|
+
'fetchCrossBorrowRates': false,
|
|
53
53
|
'fetchCurrencies': true,
|
|
54
54
|
'fetchDeposit': false,
|
|
55
55
|
'fetchDepositAddress': true,
|
|
@@ -63,6 +63,8 @@ class bybit extends bybit$1 {
|
|
|
63
63
|
'fetchFundingRates': true,
|
|
64
64
|
'fetchGreeks': true,
|
|
65
65
|
'fetchIndexOHLCV': true,
|
|
66
|
+
'fetchIsolatedBorrowRate': false,
|
|
67
|
+
'fetchIsolatedBorrowRates': false,
|
|
66
68
|
'fetchLedger': true,
|
|
67
69
|
'fetchMarketLeverageTiers': true,
|
|
68
70
|
'fetchMarkets': true,
|
|
@@ -437,6 +439,7 @@ class bybit extends bybit$1 {
|
|
|
437
439
|
// account
|
|
438
440
|
'v5/account/upgrade-to-uta': 5,
|
|
439
441
|
'v5/account/set-margin-mode': 5,
|
|
442
|
+
'v5/account/set-hedging-mode': 5,
|
|
440
443
|
'v5/account/mmp-modify': 5,
|
|
441
444
|
'v5/account/mmp-reset': 5,
|
|
442
445
|
// asset
|
|
@@ -2000,9 +2003,11 @@ class bybit extends bybit$1 {
|
|
|
2000
2003
|
* @see https://bybit-exchange.github.io/docs/v5/market/tickers
|
|
2001
2004
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
2002
2005
|
* @param {object} [params] extra parameters specific to the bybit api endpoint
|
|
2003
|
-
* @returns {object} a [ticker structure]{@link https://
|
|
2006
|
+
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
2004
2007
|
*/
|
|
2005
|
-
|
|
2008
|
+
if (symbol === undefined) {
|
|
2009
|
+
throw new errors.ArgumentsRequired(this.id + ' fetchTicker() requires a symbol argument');
|
|
2010
|
+
}
|
|
2006
2011
|
await this.loadMarkets();
|
|
2007
2012
|
const market = this.market(symbol);
|
|
2008
2013
|
const request = {
|
|
@@ -2076,7 +2081,7 @@ class bybit extends bybit$1 {
|
|
|
2076
2081
|
* @see https://bybit-exchange.github.io/docs/v5/market/tickers
|
|
2077
2082
|
* @param {string[]} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
2078
2083
|
* @param {object} [params] extra parameters specific to the bybit api endpoint
|
|
2079
|
-
* @returns {object} an array of [ticker structures]{@link https://
|
|
2084
|
+
* @returns {object} an array of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
2080
2085
|
*/
|
|
2081
2086
|
await this.loadMarkets();
|
|
2082
2087
|
let market = undefined;
|
|
@@ -2202,7 +2207,9 @@ class bybit extends bybit$1 {
|
|
|
2202
2207
|
* @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)
|
|
2203
2208
|
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
2204
2209
|
*/
|
|
2205
|
-
|
|
2210
|
+
if (symbol === undefined) {
|
|
2211
|
+
throw new errors.ArgumentsRequired(this.id + ' fetchOHLCV() requires a symbol argument');
|
|
2212
|
+
}
|
|
2206
2213
|
await this.loadMarkets();
|
|
2207
2214
|
let paginate = false;
|
|
2208
2215
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchOHLCV', 'paginate');
|
|
@@ -2359,7 +2366,7 @@ class bybit extends bybit$1 {
|
|
|
2359
2366
|
* @see https://bybit-exchange.github.io/docs/v5/market/tickers
|
|
2360
2367
|
* @param {string[]} symbols unified symbols of the markets to fetch the funding rates for, all market funding rates are returned if not assigned
|
|
2361
2368
|
* @param {object} [params] extra parameters specific to the bybit api endpoint
|
|
2362
|
-
* @returns {object} an array of [funding rate structures]{@link https://
|
|
2369
|
+
* @returns {object} an array of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
|
|
2363
2370
|
*/
|
|
2364
2371
|
await this.loadMarkets();
|
|
2365
2372
|
let market = undefined;
|
|
@@ -2440,13 +2447,15 @@ class bybit extends bybit$1 {
|
|
|
2440
2447
|
* @see https://bybit-exchange.github.io/docs/v5/market/history-fund-rate
|
|
2441
2448
|
* @param {string} symbol unified symbol of the market to fetch the funding rate history for
|
|
2442
2449
|
* @param {int} [since] timestamp in ms of the earliest funding rate to fetch
|
|
2443
|
-
* @param {int} [limit] the maximum amount of [funding rate structures]{@link https://
|
|
2450
|
+
* @param {int} [limit] the maximum amount of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure} to fetch
|
|
2444
2451
|
* @param {object} [params] extra parameters specific to the bybit api endpoint
|
|
2445
2452
|
* @param {int} [params.until] timestamp in ms of the latest funding rate
|
|
2446
2453
|
* @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)
|
|
2447
|
-
* @returns {object[]} a list of [funding rate structures]{@link https://
|
|
2454
|
+
* @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure}
|
|
2448
2455
|
*/
|
|
2449
|
-
|
|
2456
|
+
if (symbol === undefined) {
|
|
2457
|
+
throw new errors.ArgumentsRequired(this.id + ' fetchFundingRateHistory() requires a symbol argument');
|
|
2458
|
+
}
|
|
2450
2459
|
await this.loadMarkets();
|
|
2451
2460
|
if (limit === undefined) {
|
|
2452
2461
|
limit = 200;
|
|
@@ -2726,9 +2735,11 @@ class bybit extends bybit$1 {
|
|
|
2726
2735
|
* @param {object} [params] extra parameters specific to the bybit api endpoint
|
|
2727
2736
|
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
2728
2737
|
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
2729
|
-
* @returns {Trade[]} a list of [trade structures]{@link https://
|
|
2738
|
+
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
|
|
2730
2739
|
*/
|
|
2731
|
-
|
|
2740
|
+
if (symbol === undefined) {
|
|
2741
|
+
throw new errors.ArgumentsRequired(this.id + ' fetchTrades() requires a symbol argument');
|
|
2742
|
+
}
|
|
2732
2743
|
await this.loadMarkets();
|
|
2733
2744
|
const market = this.market(symbol);
|
|
2734
2745
|
const request = {
|
|
@@ -2780,9 +2791,11 @@ class bybit extends bybit$1 {
|
|
|
2780
2791
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
2781
2792
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
2782
2793
|
* @param {object} [params] extra parameters specific to the bybit api endpoint
|
|
2783
|
-
* @returns {object} A dictionary of [order book structures]{@link https://
|
|
2794
|
+
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
2784
2795
|
*/
|
|
2785
|
-
|
|
2796
|
+
if (symbol === undefined) {
|
|
2797
|
+
throw new errors.ArgumentsRequired(this.id + ' fetchOrderBook() requires a symbol argument');
|
|
2798
|
+
}
|
|
2786
2799
|
await this.loadMarkets();
|
|
2787
2800
|
const market = this.market(symbol);
|
|
2788
2801
|
const request = {
|
|
@@ -3406,10 +3419,12 @@ class bybit extends bybit$1 {
|
|
|
3406
3419
|
* @see https://bybit-exchange.github.io/docs/v5/order/order-list
|
|
3407
3420
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
3408
3421
|
* @param {object} [params] extra parameters specific to the bybit api endpoint
|
|
3409
|
-
* @returns {object} An [order structure]{@link https://
|
|
3422
|
+
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
3410
3423
|
*/
|
|
3424
|
+
if (symbol === undefined) {
|
|
3425
|
+
throw new errors.ArgumentsRequired(this.id + ' fetchOrder() requires a symbol argument');
|
|
3426
|
+
}
|
|
3411
3427
|
await this.loadMarkets();
|
|
3412
|
-
this.checkRequiredSymbol('fetchOrder', symbol);
|
|
3413
3428
|
const request = {
|
|
3414
3429
|
'orderId': id,
|
|
3415
3430
|
};
|
|
@@ -3450,7 +3465,7 @@ class bybit extends bybit$1 {
|
|
|
3450
3465
|
* @param {float} [params.takeProfit.triggerPrice] take profit trigger price
|
|
3451
3466
|
* @param {object} [params.stopLoss] *stopLoss object in params* containing the triggerPrice at which the attached stop loss order will be triggered
|
|
3452
3467
|
* @param {float} [params.stopLoss.triggerPrice] stop loss trigger price
|
|
3453
|
-
* @returns {object} an [order structure]{@link https://
|
|
3468
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
3454
3469
|
*/
|
|
3455
3470
|
await this.loadMarkets();
|
|
3456
3471
|
const market = this.market(symbol);
|
|
@@ -3630,7 +3645,7 @@ class bybit extends bybit$1 {
|
|
|
3630
3645
|
* @description create a list of trade orders
|
|
3631
3646
|
* @see https://bybit-exchange.github.io/docs/v5/order/batch-place
|
|
3632
3647
|
* @param {array} orders list of orders to create, each object should contain the parameters required by createOrder, namely symbol, type, side, amount, price and params
|
|
3633
|
-
* @returns {object} an [order structure]{@link https://
|
|
3648
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
3634
3649
|
*/
|
|
3635
3650
|
await this.loadMarkets();
|
|
3636
3651
|
const ordersRequests = [];
|
|
@@ -3921,7 +3936,9 @@ class bybit extends bybit$1 {
|
|
|
3921
3936
|
* @param {string} [params.tpTriggerby] 'IndexPrice', 'MarkPrice' or 'LastPrice', default is 'LastPrice', required if no initial value for takeProfit
|
|
3922
3937
|
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
3923
3938
|
*/
|
|
3924
|
-
|
|
3939
|
+
if (symbol === undefined) {
|
|
3940
|
+
throw new errors.ArgumentsRequired(this.id + ' editOrder() requires a symbol argument');
|
|
3941
|
+
}
|
|
3925
3942
|
await this.loadMarkets();
|
|
3926
3943
|
const market = this.market(symbol);
|
|
3927
3944
|
const [enableUnifiedMargin, enableUnifiedAccount] = await this.isUnifiedEnabled();
|
|
@@ -4023,7 +4040,9 @@ class bybit extends bybit$1 {
|
|
|
4023
4040
|
});
|
|
4024
4041
|
}
|
|
4025
4042
|
async cancelUsdcOrder(id, symbol = undefined, params = {}) {
|
|
4026
|
-
|
|
4043
|
+
if (symbol === undefined) {
|
|
4044
|
+
throw new errors.ArgumentsRequired(this.id + ' cancelUsdcOrder() requires a symbol argument');
|
|
4045
|
+
}
|
|
4027
4046
|
await this.loadMarkets();
|
|
4028
4047
|
const market = this.market(symbol);
|
|
4029
4048
|
const request = {
|
|
@@ -4071,9 +4090,11 @@ class bybit extends bybit$1 {
|
|
|
4071
4090
|
* @param {object} [params] extra parameters specific to the bybit api endpoint
|
|
4072
4091
|
* @param {boolean} [params.stop] *spot only* whether the order is a stop order
|
|
4073
4092
|
* @param {string} [params.orderFilter] *spot only* 'Order' or 'StopOrder' or 'tpslOrder'
|
|
4074
|
-
* @returns {object} An [order structure]{@link https://
|
|
4093
|
+
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4075
4094
|
*/
|
|
4076
|
-
|
|
4095
|
+
if (symbol === undefined) {
|
|
4096
|
+
throw new errors.ArgumentsRequired(this.id + ' cancelOrder() requires a symbol argument');
|
|
4097
|
+
}
|
|
4077
4098
|
await this.loadMarkets();
|
|
4078
4099
|
const market = this.market(symbol);
|
|
4079
4100
|
const [enableUnifiedMargin, enableUnifiedAccount] = await this.isUnifiedEnabled();
|
|
@@ -4127,7 +4148,9 @@ class bybit extends bybit$1 {
|
|
|
4127
4148
|
return this.parseOrder(result, market);
|
|
4128
4149
|
}
|
|
4129
4150
|
async cancelAllUsdcOrders(symbol = undefined, params = {}) {
|
|
4130
|
-
|
|
4151
|
+
if (symbol === undefined) {
|
|
4152
|
+
throw new errors.ArgumentsRequired(this.id + ' cancelAllUsdcOrders() requires a symbol argument');
|
|
4153
|
+
}
|
|
4131
4154
|
await this.loadMarkets();
|
|
4132
4155
|
const market = this.market(symbol);
|
|
4133
4156
|
const request = {
|
|
@@ -4184,7 +4207,7 @@ class bybit extends bybit$1 {
|
|
|
4184
4207
|
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
4185
4208
|
* @param {string} [params.baseCoin] Base coin. Supports linear, inverse & option
|
|
4186
4209
|
* @param {string} [params.settleCoin] Settle coin. Supports linear, inverse & option
|
|
4187
|
-
* @returns {object[]} a list of [order structures]{@link https://
|
|
4210
|
+
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4188
4211
|
*/
|
|
4189
4212
|
await this.loadMarkets();
|
|
4190
4213
|
const [enableUnifiedMargin, enableUnifiedAccount] = await this.isUnifiedEnabled();
|
|
@@ -4356,7 +4379,7 @@ class bybit extends bybit$1 {
|
|
|
4356
4379
|
* @param {string} [params.orderFilter] 'Order' or 'StopOrder' or 'tpslOrder'
|
|
4357
4380
|
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
4358
4381
|
* @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)
|
|
4359
|
-
* @returns {Order[]} a list of [order structures]{@link https://
|
|
4382
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4360
4383
|
*/
|
|
4361
4384
|
await this.loadMarkets();
|
|
4362
4385
|
let paginate = false;
|
|
@@ -4553,7 +4576,7 @@ class bybit extends bybit$1 {
|
|
|
4553
4576
|
* @param {string} [params.baseCoin] Base coin. Supports linear, inverse & option
|
|
4554
4577
|
* @param {string} [params.settleCoin] Settle coin. Supports linear, inverse & option
|
|
4555
4578
|
* @param {string} [params.orderFilter] 'Order' or 'StopOrder' or 'tpslOrder'
|
|
4556
|
-
* @returns {Order[]} a list of [order structures]{@link https://
|
|
4579
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4557
4580
|
*/
|
|
4558
4581
|
await this.loadMarkets();
|
|
4559
4582
|
const [enableUnifiedMargin, enableUnifiedAccount] = await this.isUnifiedEnabled();
|
|
@@ -4658,7 +4681,7 @@ class bybit extends bybit$1 {
|
|
|
4658
4681
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
4659
4682
|
* @param {int} [limit] the maximum number of trades to retrieve
|
|
4660
4683
|
* @param {object} [params] extra parameters specific to the bybit api endpoint
|
|
4661
|
-
* @returns {object[]} a list of [trade structures]{@link https://
|
|
4684
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
4662
4685
|
*
|
|
4663
4686
|
*/
|
|
4664
4687
|
const request = {};
|
|
@@ -4731,7 +4754,7 @@ class bybit extends bybit$1 {
|
|
|
4731
4754
|
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
4732
4755
|
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
4733
4756
|
* @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)
|
|
4734
|
-
* @returns {Trade[]} a list of [trade structures]{@link https://
|
|
4757
|
+
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
4735
4758
|
*/
|
|
4736
4759
|
await this.loadMarkets();
|
|
4737
4760
|
let paginate = false;
|
|
@@ -4851,7 +4874,7 @@ class bybit extends bybit$1 {
|
|
|
4851
4874
|
* @see https://bybit-exchange.github.io/docs/v5/asset/master-deposit-addr
|
|
4852
4875
|
* @param {string} code unified currency code of the currency for the deposit address
|
|
4853
4876
|
* @param {object} [params] extra parameters specific to the bybit api endpoint
|
|
4854
|
-
* @returns {object} a dictionary of [address structures]{@link https://
|
|
4877
|
+
* @returns {object} a dictionary of [address structures]{@link https://docs.ccxt.com/#/?id=address-structure} indexed by the network
|
|
4855
4878
|
*/
|
|
4856
4879
|
await this.loadMarkets();
|
|
4857
4880
|
let currency = this.currency(code);
|
|
@@ -4895,7 +4918,7 @@ class bybit extends bybit$1 {
|
|
|
4895
4918
|
* @see https://bybit-exchange.github.io/docs/v5/asset/master-deposit-addr
|
|
4896
4919
|
* @param {string} code unified currency code
|
|
4897
4920
|
* @param {object} [params] extra parameters specific to the bybit api endpoint
|
|
4898
|
-
* @returns {object} an [address structure]{@link https://
|
|
4921
|
+
* @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
|
|
4899
4922
|
*/
|
|
4900
4923
|
await this.loadMarkets();
|
|
4901
4924
|
const [networkCode, query] = this.handleNetworkCodeAndParams(params);
|
|
@@ -4949,7 +4972,7 @@ class bybit extends bybit$1 {
|
|
|
4949
4972
|
* EXCHANGE SPECIFIC PARAMETERS
|
|
4950
4973
|
* @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)
|
|
4951
4974
|
* @param {string} [params.cursor] used for pagination
|
|
4952
|
-
* @returns {object[]} a list of [transaction structures]{@link https://
|
|
4975
|
+
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
4953
4976
|
*/
|
|
4954
4977
|
await this.loadMarkets();
|
|
4955
4978
|
let paginate = false;
|
|
@@ -5017,7 +5040,7 @@ class bybit extends bybit$1 {
|
|
|
5017
5040
|
* @param {object} [params] extra parameters specific to the bybit api endpoint
|
|
5018
5041
|
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
5019
5042
|
* @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)
|
|
5020
|
-
* @returns {object[]} a list of [transaction structures]{@link https://
|
|
5043
|
+
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
5021
5044
|
*/
|
|
5022
5045
|
await this.loadMarkets();
|
|
5023
5046
|
let paginate = false;
|
|
@@ -5195,7 +5218,7 @@ class bybit extends bybit$1 {
|
|
|
5195
5218
|
* @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
|
|
5196
5219
|
* @param {int} [limit] max number of ledger entrys to return, default is undefined
|
|
5197
5220
|
* @param {object} [params] extra parameters specific to the bybit api endpoint
|
|
5198
|
-
* @returns {object} a [ledger structure]{@link https://
|
|
5221
|
+
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
|
|
5199
5222
|
*/
|
|
5200
5223
|
await this.loadMarkets();
|
|
5201
5224
|
const request = {
|
|
@@ -5459,7 +5482,7 @@ class bybit extends bybit$1 {
|
|
|
5459
5482
|
* @param {string} address the address to withdraw to
|
|
5460
5483
|
* @param {string} tag
|
|
5461
5484
|
* @param {object} [params] extra parameters specific to the bybit api endpoint
|
|
5462
|
-
* @returns {object} a [transaction structure]{@link https://
|
|
5485
|
+
* @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
5463
5486
|
*/
|
|
5464
5487
|
[tag, params] = this.handleWithdrawTagAndParams(tag, params);
|
|
5465
5488
|
await this.loadMarkets();
|
|
@@ -5502,9 +5525,11 @@ class bybit extends bybit$1 {
|
|
|
5502
5525
|
* @see https://bybit-exchange.github.io/docs/v5/position
|
|
5503
5526
|
* @param {string} symbol unified market symbol of the market the position is held in, default is undefined
|
|
5504
5527
|
* @param {object} [params] extra parameters specific to the bybit api endpoint
|
|
5505
|
-
* @returns {object} a [position structure]{@link https://
|
|
5528
|
+
* @returns {object} a [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
5506
5529
|
*/
|
|
5507
|
-
|
|
5530
|
+
if (symbol === undefined) {
|
|
5531
|
+
throw new errors.ArgumentsRequired(this.id + ' fetchPosition() requires a symbol argument');
|
|
5532
|
+
}
|
|
5508
5533
|
await this.loadMarkets();
|
|
5509
5534
|
const market = this.market(symbol);
|
|
5510
5535
|
const request = {
|
|
@@ -6088,7 +6113,9 @@ class bybit extends bybit$1 {
|
|
|
6088
6113
|
* @param {string} [params.sellLeverage] leverage for sell side
|
|
6089
6114
|
* @returns {object} response from the exchange
|
|
6090
6115
|
*/
|
|
6091
|
-
|
|
6116
|
+
if (symbol === undefined) {
|
|
6117
|
+
throw new errors.ArgumentsRequired(this.id + ' setLeverage() requires a symbol argument');
|
|
6118
|
+
}
|
|
6092
6119
|
await this.loadMarkets();
|
|
6093
6120
|
const market = this.market(symbol);
|
|
6094
6121
|
// WARNING: THIS WILL INCREASE LIQUIDATION PRICE FOR OPEN ISOLATED LONG POSITIONS
|
|
@@ -6244,7 +6271,7 @@ class bybit extends bybit$1 {
|
|
|
6244
6271
|
* @param {object} [params] exchange specific parameters
|
|
6245
6272
|
* @param {string} [params.interval] 5m, 15m, 30m, 1h, 4h, 1d
|
|
6246
6273
|
* @param {string} [params.category] "linear" or "inverse"
|
|
6247
|
-
* @returns {object} an open interest structure{@link https://
|
|
6274
|
+
* @returns {object} an open interest structure{@link https://docs.ccxt.com/#/?id=open-interest-structure}
|
|
6248
6275
|
*/
|
|
6249
6276
|
await this.loadMarkets();
|
|
6250
6277
|
let market = this.market(symbol);
|
|
@@ -6343,15 +6370,15 @@ class bybit extends bybit$1 {
|
|
|
6343
6370
|
'info': interest,
|
|
6344
6371
|
}, market);
|
|
6345
6372
|
}
|
|
6346
|
-
async
|
|
6373
|
+
async fetchCrossBorrowRate(code, params = {}) {
|
|
6347
6374
|
/**
|
|
6348
6375
|
* @method
|
|
6349
|
-
* @name bybit#
|
|
6376
|
+
* @name bybit#fetchCrossBorrowRate
|
|
6350
6377
|
* @description fetch the rate of interest to borrow a currency for margin trading
|
|
6351
6378
|
* @see https://bybit-exchange.github.io/docs/zh-TW/v5/spot-margin-normal/interest-quota
|
|
6352
6379
|
* @param {string} code unified currency code
|
|
6353
6380
|
* @param {object} [params] extra parameters specific to the bybit api endpoint
|
|
6354
|
-
* @returns {object} a [borrow rate structure]{@link https://
|
|
6381
|
+
* @returns {object} a [borrow rate structure]{@link https://docs.ccxt.com/#/?id=borrow-rate-structure}
|
|
6355
6382
|
*/
|
|
6356
6383
|
await this.loadMarkets();
|
|
6357
6384
|
const currency = this.currency(code);
|
|
@@ -6373,7 +6400,9 @@ class bybit extends bybit$1 {
|
|
|
6373
6400
|
// "time": "1666734490778"
|
|
6374
6401
|
// }
|
|
6375
6402
|
//
|
|
6403
|
+
const timestamp = this.safeInteger(response, 'time');
|
|
6376
6404
|
const data = this.safeValue(response, 'result', {});
|
|
6405
|
+
data['timestamp'] = timestamp;
|
|
6377
6406
|
return this.parseBorrowRate(data, currency);
|
|
6378
6407
|
}
|
|
6379
6408
|
parseBorrowRate(info, currency = undefined) {
|
|
@@ -6382,10 +6411,11 @@ class bybit extends bybit$1 {
|
|
|
6382
6411
|
// "coin": "USDT",
|
|
6383
6412
|
// "interestRate": "0.000107000000",
|
|
6384
6413
|
// "loanAbleAmount": "",
|
|
6385
|
-
// "maxLoanAmount": "79999.999"
|
|
6414
|
+
// "maxLoanAmount": "79999.999",
|
|
6415
|
+
// "timestamp": 1666734490778
|
|
6386
6416
|
// }
|
|
6387
6417
|
//
|
|
6388
|
-
const timestamp = this.
|
|
6418
|
+
const timestamp = this.safeInteger(info, 'timestamp');
|
|
6389
6419
|
const currencyId = this.safeString(info, 'coin');
|
|
6390
6420
|
return {
|
|
6391
6421
|
'currency': this.safeCurrencyCode(currencyId, currency),
|
|
@@ -6407,7 +6437,7 @@ class bybit extends bybit$1 {
|
|
|
6407
6437
|
* @param {number} [since] the earliest time in ms to fetch borrrow interest for
|
|
6408
6438
|
* @param {number} [limit] the maximum number of structures to retrieve
|
|
6409
6439
|
* @param {object} [params] extra parameters specific to the bybit api endpoint
|
|
6410
|
-
* @returns {object[]} a list of [borrow interest structures]{@link https://
|
|
6440
|
+
* @returns {object[]} a list of [borrow interest structures]{@link https://docs.ccxt.com/#/?id=borrow-interest-structure}
|
|
6411
6441
|
*/
|
|
6412
6442
|
await this.loadMarkets();
|
|
6413
6443
|
const request = {};
|
|
@@ -6477,7 +6507,7 @@ class bybit extends bybit$1 {
|
|
|
6477
6507
|
* @param {string} toAccount account to transfer to
|
|
6478
6508
|
* @param {object} [params] extra parameters specific to the bybit api endpoint
|
|
6479
6509
|
* @param {string} [params.transferId] UUID, which is unique across the platform
|
|
6480
|
-
* @returns {object} a [transfer structure]{@link https://
|
|
6510
|
+
* @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
6481
6511
|
*/
|
|
6482
6512
|
await this.loadMarkets();
|
|
6483
6513
|
const transferId = this.safeString(params, 'transferId', this.uuid());
|
|
@@ -6530,7 +6560,7 @@ class bybit extends bybit$1 {
|
|
|
6530
6560
|
* @param {object} [params] extra parameters specific to the bybit api endpoint
|
|
6531
6561
|
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
6532
6562
|
* @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)
|
|
6533
|
-
* @returns {object[]} a list of [transfer structures]{@link https://
|
|
6563
|
+
* @returns {object[]} a list of [transfer structures]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
6534
6564
|
*/
|
|
6535
6565
|
await this.loadMarkets();
|
|
6536
6566
|
let paginate = false;
|
|
@@ -6587,7 +6617,7 @@ class bybit extends bybit$1 {
|
|
|
6587
6617
|
* @param {float} amount the amount to borrow
|
|
6588
6618
|
* @param {string} symbol not used by bybit.borrowMargin ()
|
|
6589
6619
|
* @param {object} [params] extra parameters specific to the bybit api endpoint
|
|
6590
|
-
* @returns {object} a [margin loan structure]{@link https://
|
|
6620
|
+
* @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
|
|
6591
6621
|
*/
|
|
6592
6622
|
await this.loadMarkets();
|
|
6593
6623
|
const currency = this.currency(code);
|
|
@@ -6628,7 +6658,7 @@ class bybit extends bybit$1 {
|
|
|
6628
6658
|
* @param {float} amount the amount to repay
|
|
6629
6659
|
* @param {string} symbol not used by bybit.repayMargin ()
|
|
6630
6660
|
* @param {object} [params] extra parameters specific to the bybit api endpoint
|
|
6631
|
-
* @returns {object} a [margin loan structure]{@link https://
|
|
6661
|
+
* @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
|
|
6632
6662
|
*/
|
|
6633
6663
|
await this.loadMarkets();
|
|
6634
6664
|
const currency = this.currency(code);
|
|
@@ -6778,7 +6808,7 @@ class bybit extends bybit$1 {
|
|
|
6778
6808
|
* @see https://bybit-exchange.github.io/docs/v5/market/risk-limit
|
|
6779
6809
|
* @param {string} symbol unified market symbol
|
|
6780
6810
|
* @param {object} [params] extra parameters specific to the bybit api endpoint
|
|
6781
|
-
* @returns {object} a [leverage tiers structure]{@link https://
|
|
6811
|
+
* @returns {object} a [leverage tiers structure]{@link https://docs.ccxt.com/#/?id=leverage-tiers-structure}
|
|
6782
6812
|
*/
|
|
6783
6813
|
await this.loadMarkets();
|
|
6784
6814
|
let market = undefined;
|
|
@@ -6844,7 +6874,7 @@ class bybit extends bybit$1 {
|
|
|
6844
6874
|
* @see https://bybit-exchange.github.io/docs/v5/account/fee-rate
|
|
6845
6875
|
* @param {string} symbol unified market symbol
|
|
6846
6876
|
* @param {object} [params] extra parameters specific to the bybit api endpoint
|
|
6847
|
-
* @returns {object} a [fee structure]{@link https://
|
|
6877
|
+
* @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
6848
6878
|
*/
|
|
6849
6879
|
await this.loadMarkets();
|
|
6850
6880
|
const market = this.market(symbol);
|
|
@@ -6885,7 +6915,7 @@ class bybit extends bybit$1 {
|
|
|
6885
6915
|
* @see https://bybit-exchange.github.io/docs/v5/account/fee-rate
|
|
6886
6916
|
* @param {object} [params] extra parameters specific to the bybit api endpoint
|
|
6887
6917
|
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
6888
|
-
* @returns {object} a dictionary of [fee structures]{@link https://
|
|
6918
|
+
* @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
|
|
6889
6919
|
*/
|
|
6890
6920
|
await this.loadMarkets();
|
|
6891
6921
|
let type = undefined;
|
|
@@ -6982,7 +7012,7 @@ class bybit extends bybit$1 {
|
|
|
6982
7012
|
* @see https://bybit-exchange.github.io/docs/v5/asset/coin-info
|
|
6983
7013
|
* @param {string[]} codes list of unified currency codes
|
|
6984
7014
|
* @param {object} [params] extra parameters specific to the bybit api endpoint
|
|
6985
|
-
* @returns {object} a list of [fee structures]{@link https://
|
|
7015
|
+
* @returns {object} a list of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
6986
7016
|
*/
|
|
6987
7017
|
this.checkRequiredCredentials();
|
|
6988
7018
|
await this.loadMarkets();
|
|
@@ -7213,7 +7243,7 @@ class bybit extends bybit$1 {
|
|
|
7213
7243
|
* @param {string} code unified currency code
|
|
7214
7244
|
* @param {object} [params] extra parameters specific to the bybit api endpoint
|
|
7215
7245
|
* @param {int} [params.period] the period in days to fetch the volatility for: 7,14,21,30,60,90,180,270
|
|
7216
|
-
* @returns {object[]} a list of [volatility history objects]{@link https://
|
|
7246
|
+
* @returns {object[]} a list of [volatility history objects]{@link https://docs.ccxt.com/#/?id=volatility-structure}
|
|
7217
7247
|
*/
|
|
7218
7248
|
await this.loadMarkets();
|
|
7219
7249
|
const currency = this.currency(code);
|
|
@@ -7268,7 +7298,7 @@ class bybit extends bybit$1 {
|
|
|
7268
7298
|
* @see https://bybit-exchange.github.io/docs/api-explorer/v5/market/tickers
|
|
7269
7299
|
* @param {string} symbol unified symbol of the market to fetch greeks for
|
|
7270
7300
|
* @param {object} [params] extra parameters specific to the bybit api endpoint
|
|
7271
|
-
* @returns {object} a [greeks structure]{@link https://
|
|
7301
|
+
* @returns {object} a [greeks structure]{@link https://docs.ccxt.com/#/?id=greeks-structure}
|
|
7272
7302
|
*/
|
|
7273
7303
|
await this.loadMarkets();
|
|
7274
7304
|
const market = this.market(symbol);
|