ccxt 4.1.56 → 4.1.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/.git-templates/hooks/pre-push +2 -2
- package/README.md +3 -3
- package/build.sh +30 -18
- package/dist/ccxt.browser.js +3872 -3202
- 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/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 +106 -85
- 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 +6 -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/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 +106 -85
- 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 +6 -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/js/src/btcturk.js
CHANGED
|
@@ -35,16 +35,17 @@ export default class btcturk extends Exchange {
|
|
|
35
35
|
'createOrder': true,
|
|
36
36
|
'createReduceOnlyOrder': false,
|
|
37
37
|
'fetchBalance': true,
|
|
38
|
-
'fetchBorrowRate': false,
|
|
39
38
|
'fetchBorrowRateHistories': false,
|
|
40
39
|
'fetchBorrowRateHistory': false,
|
|
41
|
-
'
|
|
42
|
-
'
|
|
40
|
+
'fetchCrossBorrowRate': false,
|
|
41
|
+
'fetchCrossBorrowRates': false,
|
|
43
42
|
'fetchFundingHistory': false,
|
|
44
43
|
'fetchFundingRate': false,
|
|
45
44
|
'fetchFundingRateHistory': false,
|
|
46
45
|
'fetchFundingRates': false,
|
|
47
46
|
'fetchIndexOHLCV': false,
|
|
47
|
+
'fetchIsolatedBorrowRate': false,
|
|
48
|
+
'fetchIsolatedBorrowRates': false,
|
|
48
49
|
'fetchLeverage': false,
|
|
49
50
|
'fetchMarginMode': false,
|
|
50
51
|
'fetchMarkets': true,
|
|
@@ -294,7 +295,7 @@ export default class btcturk extends Exchange {
|
|
|
294
295
|
* @name btcturk#fetchBalance
|
|
295
296
|
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
296
297
|
* @param {object} [params] extra parameters specific to the btcturk api endpoint
|
|
297
|
-
* @returns {object} a [balance structure]{@link https://
|
|
298
|
+
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
298
299
|
*/
|
|
299
300
|
await this.loadMarkets();
|
|
300
301
|
const response = await this.privateGetUsersBalances(params);
|
|
@@ -324,7 +325,7 @@ export default class btcturk extends Exchange {
|
|
|
324
325
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
325
326
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
326
327
|
* @param {object} [params] extra parameters specific to the btcturk api endpoint
|
|
327
|
-
* @returns {object} A dictionary of [order book structures]{@link https://
|
|
328
|
+
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
328
329
|
*/
|
|
329
330
|
await this.loadMarkets();
|
|
330
331
|
const market = this.market(symbol);
|
|
@@ -403,7 +404,7 @@ export default class btcturk extends Exchange {
|
|
|
403
404
|
* @description fetches price tickers for multiple markets, statistical calculations with the information calculated over the past 24 hours each market
|
|
404
405
|
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
405
406
|
* @param {object} [params] extra parameters specific to the btcturk api endpoint
|
|
406
|
-
* @returns {object} a dictionary of [ticker structures]{@link https://
|
|
407
|
+
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
407
408
|
*/
|
|
408
409
|
await this.loadMarkets();
|
|
409
410
|
const response = await this.publicGetTicker(params);
|
|
@@ -417,7 +418,7 @@ export default class btcturk extends Exchange {
|
|
|
417
418
|
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
418
419
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
419
420
|
* @param {object} [params] extra parameters specific to the btcturk api endpoint
|
|
420
|
-
* @returns {object} a [ticker structure]{@link https://
|
|
421
|
+
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
421
422
|
*/
|
|
422
423
|
await this.loadMarkets();
|
|
423
424
|
const tickers = await this.fetchTickers([symbol], params);
|
|
@@ -494,7 +495,7 @@ export default class btcturk extends Exchange {
|
|
|
494
495
|
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
495
496
|
* @param {int} [limit] the maximum amount of trades to fetch
|
|
496
497
|
* @param {object} [params] extra parameters specific to the btcturk api endpoint
|
|
497
|
-
* @returns {Trade[]} a list of [trade structures]{@link https://
|
|
498
|
+
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
|
|
498
499
|
*/
|
|
499
500
|
await this.loadMarkets();
|
|
500
501
|
const market = this.market(symbol);
|
|
@@ -659,7 +660,7 @@ export default class btcturk extends Exchange {
|
|
|
659
660
|
* @param {float} amount how much of currency you want to trade in units of base currency
|
|
660
661
|
* @param {float} [price] the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
|
|
661
662
|
* @param {object} [params] extra parameters specific to the btcturk api endpoint
|
|
662
|
-
* @returns {object} an [order structure]{@link https://
|
|
663
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
663
664
|
*/
|
|
664
665
|
await this.loadMarkets();
|
|
665
666
|
const market = this.market(symbol);
|
|
@@ -690,7 +691,7 @@ export default class btcturk extends Exchange {
|
|
|
690
691
|
* @param {string} id order id
|
|
691
692
|
* @param {string} symbol not used by btcturk cancelOrder ()
|
|
692
693
|
* @param {object} [params] extra parameters specific to the btcturk api endpoint
|
|
693
|
-
* @returns {object} An [order structure]{@link https://
|
|
694
|
+
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
694
695
|
*/
|
|
695
696
|
const request = {
|
|
696
697
|
'id': id,
|
|
@@ -706,7 +707,7 @@ export default class btcturk extends Exchange {
|
|
|
706
707
|
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
707
708
|
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
708
709
|
* @param {object} [params] extra parameters specific to the btcturk api endpoint
|
|
709
|
-
* @returns {Order[]} a list of [order structures]{@link https://
|
|
710
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
710
711
|
*/
|
|
711
712
|
await this.loadMarkets();
|
|
712
713
|
const request = {};
|
|
@@ -730,7 +731,7 @@ export default class btcturk extends Exchange {
|
|
|
730
731
|
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
731
732
|
* @param {int} [limit] the maximum number of orde structures to retrieve
|
|
732
733
|
* @param {object} [params] extra parameters specific to the btcturk api endpoint
|
|
733
|
-
* @returns {Order[]} a list of [order structures]{@link https://
|
|
734
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
734
735
|
*/
|
|
735
736
|
await this.loadMarkets();
|
|
736
737
|
const market = this.market(symbol);
|
|
@@ -852,7 +853,7 @@ export default class btcturk extends Exchange {
|
|
|
852
853
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
853
854
|
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
854
855
|
* @param {object} [params] extra parameters specific to the btcturk api endpoint
|
|
855
|
-
* @returns {Trade[]} a list of [trade structures]{@link https://
|
|
856
|
+
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
856
857
|
*/
|
|
857
858
|
await this.loadMarkets();
|
|
858
859
|
let market = undefined;
|
package/js/src/bybit.d.ts
CHANGED
|
@@ -127,7 +127,7 @@ export default class bybit extends Exchange {
|
|
|
127
127
|
fetchOpenInterest(symbol: string, params?: {}): Promise<OpenInterest>;
|
|
128
128
|
fetchOpenInterestHistory(symbol: string, timeframe?: string, since?: Int, limit?: Int, params?: {}): Promise<OpenInterest[]>;
|
|
129
129
|
parseOpenInterest(interest: any, market?: Market): OpenInterest;
|
|
130
|
-
|
|
130
|
+
fetchCrossBorrowRate(code: string, params?: {}): Promise<{
|
|
131
131
|
currency: string;
|
|
132
132
|
rate: number;
|
|
133
133
|
period: number;
|
package/js/src/bybit.js
CHANGED
|
@@ -47,12 +47,12 @@ export default class bybit extends Exchange {
|
|
|
47
47
|
'editOrder': true,
|
|
48
48
|
'fetchBalance': true,
|
|
49
49
|
'fetchBorrowInterest': false,
|
|
50
|
-
'fetchBorrowRate': true,
|
|
51
50
|
'fetchBorrowRateHistories': false,
|
|
52
51
|
'fetchBorrowRateHistory': false,
|
|
53
|
-
'fetchBorrowRates': false,
|
|
54
52
|
'fetchCanceledOrders': true,
|
|
55
53
|
'fetchClosedOrders': true,
|
|
54
|
+
'fetchCrossBorrowRate': true,
|
|
55
|
+
'fetchCrossBorrowRates': false,
|
|
56
56
|
'fetchCurrencies': true,
|
|
57
57
|
'fetchDeposit': false,
|
|
58
58
|
'fetchDepositAddress': true,
|
|
@@ -66,6 +66,8 @@ export default class bybit extends Exchange {
|
|
|
66
66
|
'fetchFundingRates': true,
|
|
67
67
|
'fetchGreeks': true,
|
|
68
68
|
'fetchIndexOHLCV': true,
|
|
69
|
+
'fetchIsolatedBorrowRate': false,
|
|
70
|
+
'fetchIsolatedBorrowRates': false,
|
|
69
71
|
'fetchLedger': true,
|
|
70
72
|
'fetchMarketLeverageTiers': true,
|
|
71
73
|
'fetchMarkets': true,
|
|
@@ -440,6 +442,7 @@ export default class bybit extends Exchange {
|
|
|
440
442
|
// account
|
|
441
443
|
'v5/account/upgrade-to-uta': 5,
|
|
442
444
|
'v5/account/set-margin-mode': 5,
|
|
445
|
+
'v5/account/set-hedging-mode': 5,
|
|
443
446
|
'v5/account/mmp-modify': 5,
|
|
444
447
|
'v5/account/mmp-reset': 5,
|
|
445
448
|
// asset
|
|
@@ -2003,9 +2006,11 @@ export default class bybit extends Exchange {
|
|
|
2003
2006
|
* @see https://bybit-exchange.github.io/docs/v5/market/tickers
|
|
2004
2007
|
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
2005
2008
|
* @param {object} [params] extra parameters specific to the bybit api endpoint
|
|
2006
|
-
* @returns {object} a [ticker structure]{@link https://
|
|
2009
|
+
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
2007
2010
|
*/
|
|
2008
|
-
|
|
2011
|
+
if (symbol === undefined) {
|
|
2012
|
+
throw new ArgumentsRequired(this.id + ' fetchTicker() requires a symbol argument');
|
|
2013
|
+
}
|
|
2009
2014
|
await this.loadMarkets();
|
|
2010
2015
|
const market = this.market(symbol);
|
|
2011
2016
|
const request = {
|
|
@@ -2079,7 +2084,7 @@ export default class bybit extends Exchange {
|
|
|
2079
2084
|
* @see https://bybit-exchange.github.io/docs/v5/market/tickers
|
|
2080
2085
|
* @param {string[]} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
2081
2086
|
* @param {object} [params] extra parameters specific to the bybit api endpoint
|
|
2082
|
-
* @returns {object} an array of [ticker structures]{@link https://
|
|
2087
|
+
* @returns {object} an array of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
2083
2088
|
*/
|
|
2084
2089
|
await this.loadMarkets();
|
|
2085
2090
|
let market = undefined;
|
|
@@ -2205,7 +2210,9 @@ export default class bybit extends Exchange {
|
|
|
2205
2210
|
* @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)
|
|
2206
2211
|
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
2207
2212
|
*/
|
|
2208
|
-
|
|
2213
|
+
if (symbol === undefined) {
|
|
2214
|
+
throw new ArgumentsRequired(this.id + ' fetchOHLCV() requires a symbol argument');
|
|
2215
|
+
}
|
|
2209
2216
|
await this.loadMarkets();
|
|
2210
2217
|
let paginate = false;
|
|
2211
2218
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchOHLCV', 'paginate');
|
|
@@ -2362,7 +2369,7 @@ export default class bybit extends Exchange {
|
|
|
2362
2369
|
* @see https://bybit-exchange.github.io/docs/v5/market/tickers
|
|
2363
2370
|
* @param {string[]} symbols unified symbols of the markets to fetch the funding rates for, all market funding rates are returned if not assigned
|
|
2364
2371
|
* @param {object} [params] extra parameters specific to the bybit api endpoint
|
|
2365
|
-
* @returns {object} an array of [funding rate structures]{@link https://
|
|
2372
|
+
* @returns {object} an array of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
|
|
2366
2373
|
*/
|
|
2367
2374
|
await this.loadMarkets();
|
|
2368
2375
|
let market = undefined;
|
|
@@ -2443,13 +2450,15 @@ export default class bybit extends Exchange {
|
|
|
2443
2450
|
* @see https://bybit-exchange.github.io/docs/v5/market/history-fund-rate
|
|
2444
2451
|
* @param {string} symbol unified symbol of the market to fetch the funding rate history for
|
|
2445
2452
|
* @param {int} [since] timestamp in ms of the earliest funding rate to fetch
|
|
2446
|
-
* @param {int} [limit] the maximum amount of [funding rate structures]{@link https://
|
|
2453
|
+
* @param {int} [limit] the maximum amount of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure} to fetch
|
|
2447
2454
|
* @param {object} [params] extra parameters specific to the bybit api endpoint
|
|
2448
2455
|
* @param {int} [params.until] timestamp in ms of the latest funding rate
|
|
2449
2456
|
* @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)
|
|
2450
|
-
* @returns {object[]} a list of [funding rate structures]{@link https://
|
|
2457
|
+
* @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure}
|
|
2451
2458
|
*/
|
|
2452
|
-
|
|
2459
|
+
if (symbol === undefined) {
|
|
2460
|
+
throw new ArgumentsRequired(this.id + ' fetchFundingRateHistory() requires a symbol argument');
|
|
2461
|
+
}
|
|
2453
2462
|
await this.loadMarkets();
|
|
2454
2463
|
if (limit === undefined) {
|
|
2455
2464
|
limit = 200;
|
|
@@ -2729,9 +2738,11 @@ export default class bybit extends Exchange {
|
|
|
2729
2738
|
* @param {object} [params] extra parameters specific to the bybit api endpoint
|
|
2730
2739
|
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
2731
2740
|
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
2732
|
-
* @returns {Trade[]} a list of [trade structures]{@link https://
|
|
2741
|
+
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
|
|
2733
2742
|
*/
|
|
2734
|
-
|
|
2743
|
+
if (symbol === undefined) {
|
|
2744
|
+
throw new ArgumentsRequired(this.id + ' fetchTrades() requires a symbol argument');
|
|
2745
|
+
}
|
|
2735
2746
|
await this.loadMarkets();
|
|
2736
2747
|
const market = this.market(symbol);
|
|
2737
2748
|
const request = {
|
|
@@ -2783,9 +2794,11 @@ export default class bybit extends Exchange {
|
|
|
2783
2794
|
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
2784
2795
|
* @param {int} [limit] the maximum amount of order book entries to return
|
|
2785
2796
|
* @param {object} [params] extra parameters specific to the bybit api endpoint
|
|
2786
|
-
* @returns {object} A dictionary of [order book structures]{@link https://
|
|
2797
|
+
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
2787
2798
|
*/
|
|
2788
|
-
|
|
2799
|
+
if (symbol === undefined) {
|
|
2800
|
+
throw new ArgumentsRequired(this.id + ' fetchOrderBook() requires a symbol argument');
|
|
2801
|
+
}
|
|
2789
2802
|
await this.loadMarkets();
|
|
2790
2803
|
const market = this.market(symbol);
|
|
2791
2804
|
const request = {
|
|
@@ -3409,10 +3422,12 @@ export default class bybit extends Exchange {
|
|
|
3409
3422
|
* @see https://bybit-exchange.github.io/docs/v5/order/order-list
|
|
3410
3423
|
* @param {string} symbol unified symbol of the market the order was made in
|
|
3411
3424
|
* @param {object} [params] extra parameters specific to the bybit api endpoint
|
|
3412
|
-
* @returns {object} An [order structure]{@link https://
|
|
3425
|
+
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
3413
3426
|
*/
|
|
3427
|
+
if (symbol === undefined) {
|
|
3428
|
+
throw new ArgumentsRequired(this.id + ' fetchOrder() requires a symbol argument');
|
|
3429
|
+
}
|
|
3414
3430
|
await this.loadMarkets();
|
|
3415
|
-
this.checkRequiredSymbol('fetchOrder', symbol);
|
|
3416
3431
|
const request = {
|
|
3417
3432
|
'orderId': id,
|
|
3418
3433
|
};
|
|
@@ -3453,7 +3468,7 @@ export default class bybit extends Exchange {
|
|
|
3453
3468
|
* @param {float} [params.takeProfit.triggerPrice] take profit trigger price
|
|
3454
3469
|
* @param {object} [params.stopLoss] *stopLoss object in params* containing the triggerPrice at which the attached stop loss order will be triggered
|
|
3455
3470
|
* @param {float} [params.stopLoss.triggerPrice] stop loss trigger price
|
|
3456
|
-
* @returns {object} an [order structure]{@link https://
|
|
3471
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
3457
3472
|
*/
|
|
3458
3473
|
await this.loadMarkets();
|
|
3459
3474
|
const market = this.market(symbol);
|
|
@@ -3633,7 +3648,7 @@ export default class bybit extends Exchange {
|
|
|
3633
3648
|
* @description create a list of trade orders
|
|
3634
3649
|
* @see https://bybit-exchange.github.io/docs/v5/order/batch-place
|
|
3635
3650
|
* @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
|
|
3636
|
-
* @returns {object} an [order structure]{@link https://
|
|
3651
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
3637
3652
|
*/
|
|
3638
3653
|
await this.loadMarkets();
|
|
3639
3654
|
const ordersRequests = [];
|
|
@@ -3924,7 +3939,9 @@ export default class bybit extends Exchange {
|
|
|
3924
3939
|
* @param {string} [params.tpTriggerby] 'IndexPrice', 'MarkPrice' or 'LastPrice', default is 'LastPrice', required if no initial value for takeProfit
|
|
3925
3940
|
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
3926
3941
|
*/
|
|
3927
|
-
|
|
3942
|
+
if (symbol === undefined) {
|
|
3943
|
+
throw new ArgumentsRequired(this.id + ' editOrder() requires a symbol argument');
|
|
3944
|
+
}
|
|
3928
3945
|
await this.loadMarkets();
|
|
3929
3946
|
const market = this.market(symbol);
|
|
3930
3947
|
const [enableUnifiedMargin, enableUnifiedAccount] = await this.isUnifiedEnabled();
|
|
@@ -4026,7 +4043,9 @@ export default class bybit extends Exchange {
|
|
|
4026
4043
|
});
|
|
4027
4044
|
}
|
|
4028
4045
|
async cancelUsdcOrder(id, symbol = undefined, params = {}) {
|
|
4029
|
-
|
|
4046
|
+
if (symbol === undefined) {
|
|
4047
|
+
throw new ArgumentsRequired(this.id + ' cancelUsdcOrder() requires a symbol argument');
|
|
4048
|
+
}
|
|
4030
4049
|
await this.loadMarkets();
|
|
4031
4050
|
const market = this.market(symbol);
|
|
4032
4051
|
const request = {
|
|
@@ -4074,9 +4093,11 @@ export default class bybit extends Exchange {
|
|
|
4074
4093
|
* @param {object} [params] extra parameters specific to the bybit api endpoint
|
|
4075
4094
|
* @param {boolean} [params.stop] *spot only* whether the order is a stop order
|
|
4076
4095
|
* @param {string} [params.orderFilter] *spot only* 'Order' or 'StopOrder' or 'tpslOrder'
|
|
4077
|
-
* @returns {object} An [order structure]{@link https://
|
|
4096
|
+
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4078
4097
|
*/
|
|
4079
|
-
|
|
4098
|
+
if (symbol === undefined) {
|
|
4099
|
+
throw new ArgumentsRequired(this.id + ' cancelOrder() requires a symbol argument');
|
|
4100
|
+
}
|
|
4080
4101
|
await this.loadMarkets();
|
|
4081
4102
|
const market = this.market(symbol);
|
|
4082
4103
|
const [enableUnifiedMargin, enableUnifiedAccount] = await this.isUnifiedEnabled();
|
|
@@ -4130,7 +4151,9 @@ export default class bybit extends Exchange {
|
|
|
4130
4151
|
return this.parseOrder(result, market);
|
|
4131
4152
|
}
|
|
4132
4153
|
async cancelAllUsdcOrders(symbol = undefined, params = {}) {
|
|
4133
|
-
|
|
4154
|
+
if (symbol === undefined) {
|
|
4155
|
+
throw new ArgumentsRequired(this.id + ' cancelAllUsdcOrders() requires a symbol argument');
|
|
4156
|
+
}
|
|
4134
4157
|
await this.loadMarkets();
|
|
4135
4158
|
const market = this.market(symbol);
|
|
4136
4159
|
const request = {
|
|
@@ -4187,7 +4210,7 @@ export default class bybit extends Exchange {
|
|
|
4187
4210
|
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
4188
4211
|
* @param {string} [params.baseCoin] Base coin. Supports linear, inverse & option
|
|
4189
4212
|
* @param {string} [params.settleCoin] Settle coin. Supports linear, inverse & option
|
|
4190
|
-
* @returns {object[]} a list of [order structures]{@link https://
|
|
4213
|
+
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4191
4214
|
*/
|
|
4192
4215
|
await this.loadMarkets();
|
|
4193
4216
|
const [enableUnifiedMargin, enableUnifiedAccount] = await this.isUnifiedEnabled();
|
|
@@ -4359,7 +4382,7 @@ export default class bybit extends Exchange {
|
|
|
4359
4382
|
* @param {string} [params.orderFilter] 'Order' or 'StopOrder' or 'tpslOrder'
|
|
4360
4383
|
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
4361
4384
|
* @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)
|
|
4362
|
-
* @returns {Order[]} a list of [order structures]{@link https://
|
|
4385
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4363
4386
|
*/
|
|
4364
4387
|
await this.loadMarkets();
|
|
4365
4388
|
let paginate = false;
|
|
@@ -4556,7 +4579,7 @@ export default class bybit extends Exchange {
|
|
|
4556
4579
|
* @param {string} [params.baseCoin] Base coin. Supports linear, inverse & option
|
|
4557
4580
|
* @param {string} [params.settleCoin] Settle coin. Supports linear, inverse & option
|
|
4558
4581
|
* @param {string} [params.orderFilter] 'Order' or 'StopOrder' or 'tpslOrder'
|
|
4559
|
-
* @returns {Order[]} a list of [order structures]{@link https://
|
|
4582
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4560
4583
|
*/
|
|
4561
4584
|
await this.loadMarkets();
|
|
4562
4585
|
const [enableUnifiedMargin, enableUnifiedAccount] = await this.isUnifiedEnabled();
|
|
@@ -4661,7 +4684,7 @@ export default class bybit extends Exchange {
|
|
|
4661
4684
|
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
4662
4685
|
* @param {int} [limit] the maximum number of trades to retrieve
|
|
4663
4686
|
* @param {object} [params] extra parameters specific to the bybit api endpoint
|
|
4664
|
-
* @returns {object[]} a list of [trade structures]{@link https://
|
|
4687
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
4665
4688
|
*
|
|
4666
4689
|
*/
|
|
4667
4690
|
const request = {};
|
|
@@ -4734,7 +4757,7 @@ export default class bybit extends Exchange {
|
|
|
4734
4757
|
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
4735
4758
|
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
4736
4759
|
* @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)
|
|
4737
|
-
* @returns {Trade[]} a list of [trade structures]{@link https://
|
|
4760
|
+
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
4738
4761
|
*/
|
|
4739
4762
|
await this.loadMarkets();
|
|
4740
4763
|
let paginate = false;
|
|
@@ -4854,7 +4877,7 @@ export default class bybit extends Exchange {
|
|
|
4854
4877
|
* @see https://bybit-exchange.github.io/docs/v5/asset/master-deposit-addr
|
|
4855
4878
|
* @param {string} code unified currency code of the currency for the deposit address
|
|
4856
4879
|
* @param {object} [params] extra parameters specific to the bybit api endpoint
|
|
4857
|
-
* @returns {object} a dictionary of [address structures]{@link https://
|
|
4880
|
+
* @returns {object} a dictionary of [address structures]{@link https://docs.ccxt.com/#/?id=address-structure} indexed by the network
|
|
4858
4881
|
*/
|
|
4859
4882
|
await this.loadMarkets();
|
|
4860
4883
|
let currency = this.currency(code);
|
|
@@ -4898,7 +4921,7 @@ export default class bybit extends Exchange {
|
|
|
4898
4921
|
* @see https://bybit-exchange.github.io/docs/v5/asset/master-deposit-addr
|
|
4899
4922
|
* @param {string} code unified currency code
|
|
4900
4923
|
* @param {object} [params] extra parameters specific to the bybit api endpoint
|
|
4901
|
-
* @returns {object} an [address structure]{@link https://
|
|
4924
|
+
* @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
|
|
4902
4925
|
*/
|
|
4903
4926
|
await this.loadMarkets();
|
|
4904
4927
|
const [networkCode, query] = this.handleNetworkCodeAndParams(params);
|
|
@@ -4952,7 +4975,7 @@ export default class bybit extends Exchange {
|
|
|
4952
4975
|
* EXCHANGE SPECIFIC PARAMETERS
|
|
4953
4976
|
* @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)
|
|
4954
4977
|
* @param {string} [params.cursor] used for pagination
|
|
4955
|
-
* @returns {object[]} a list of [transaction structures]{@link https://
|
|
4978
|
+
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
4956
4979
|
*/
|
|
4957
4980
|
await this.loadMarkets();
|
|
4958
4981
|
let paginate = false;
|
|
@@ -5020,7 +5043,7 @@ export default class bybit extends Exchange {
|
|
|
5020
5043
|
* @param {object} [params] extra parameters specific to the bybit api endpoint
|
|
5021
5044
|
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
5022
5045
|
* @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)
|
|
5023
|
-
* @returns {object[]} a list of [transaction structures]{@link https://
|
|
5046
|
+
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
5024
5047
|
*/
|
|
5025
5048
|
await this.loadMarkets();
|
|
5026
5049
|
let paginate = false;
|
|
@@ -5198,7 +5221,7 @@ export default class bybit extends Exchange {
|
|
|
5198
5221
|
* @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
|
|
5199
5222
|
* @param {int} [limit] max number of ledger entrys to return, default is undefined
|
|
5200
5223
|
* @param {object} [params] extra parameters specific to the bybit api endpoint
|
|
5201
|
-
* @returns {object} a [ledger structure]{@link https://
|
|
5224
|
+
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
|
|
5202
5225
|
*/
|
|
5203
5226
|
await this.loadMarkets();
|
|
5204
5227
|
const request = {
|
|
@@ -5462,7 +5485,7 @@ export default class bybit extends Exchange {
|
|
|
5462
5485
|
* @param {string} address the address to withdraw to
|
|
5463
5486
|
* @param {string} tag
|
|
5464
5487
|
* @param {object} [params] extra parameters specific to the bybit api endpoint
|
|
5465
|
-
* @returns {object} a [transaction structure]{@link https://
|
|
5488
|
+
* @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
5466
5489
|
*/
|
|
5467
5490
|
[tag, params] = this.handleWithdrawTagAndParams(tag, params);
|
|
5468
5491
|
await this.loadMarkets();
|
|
@@ -5505,9 +5528,11 @@ export default class bybit extends Exchange {
|
|
|
5505
5528
|
* @see https://bybit-exchange.github.io/docs/v5/position
|
|
5506
5529
|
* @param {string} symbol unified market symbol of the market the position is held in, default is undefined
|
|
5507
5530
|
* @param {object} [params] extra parameters specific to the bybit api endpoint
|
|
5508
|
-
* @returns {object} a [position structure]{@link https://
|
|
5531
|
+
* @returns {object} a [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
5509
5532
|
*/
|
|
5510
|
-
|
|
5533
|
+
if (symbol === undefined) {
|
|
5534
|
+
throw new ArgumentsRequired(this.id + ' fetchPosition() requires a symbol argument');
|
|
5535
|
+
}
|
|
5511
5536
|
await this.loadMarkets();
|
|
5512
5537
|
const market = this.market(symbol);
|
|
5513
5538
|
const request = {
|
|
@@ -6091,7 +6116,9 @@ export default class bybit extends Exchange {
|
|
|
6091
6116
|
* @param {string} [params.sellLeverage] leverage for sell side
|
|
6092
6117
|
* @returns {object} response from the exchange
|
|
6093
6118
|
*/
|
|
6094
|
-
|
|
6119
|
+
if (symbol === undefined) {
|
|
6120
|
+
throw new ArgumentsRequired(this.id + ' setLeverage() requires a symbol argument');
|
|
6121
|
+
}
|
|
6095
6122
|
await this.loadMarkets();
|
|
6096
6123
|
const market = this.market(symbol);
|
|
6097
6124
|
// WARNING: THIS WILL INCREASE LIQUIDATION PRICE FOR OPEN ISOLATED LONG POSITIONS
|
|
@@ -6247,7 +6274,7 @@ export default class bybit extends Exchange {
|
|
|
6247
6274
|
* @param {object} [params] exchange specific parameters
|
|
6248
6275
|
* @param {string} [params.interval] 5m, 15m, 30m, 1h, 4h, 1d
|
|
6249
6276
|
* @param {string} [params.category] "linear" or "inverse"
|
|
6250
|
-
* @returns {object} an open interest structure{@link https://
|
|
6277
|
+
* @returns {object} an open interest structure{@link https://docs.ccxt.com/#/?id=open-interest-structure}
|
|
6251
6278
|
*/
|
|
6252
6279
|
await this.loadMarkets();
|
|
6253
6280
|
let market = this.market(symbol);
|
|
@@ -6349,15 +6376,15 @@ export default class bybit extends Exchange {
|
|
|
6349
6376
|
'info': interest,
|
|
6350
6377
|
}, market);
|
|
6351
6378
|
}
|
|
6352
|
-
async
|
|
6379
|
+
async fetchCrossBorrowRate(code, params = {}) {
|
|
6353
6380
|
/**
|
|
6354
6381
|
* @method
|
|
6355
|
-
* @name bybit#
|
|
6382
|
+
* @name bybit#fetchCrossBorrowRate
|
|
6356
6383
|
* @description fetch the rate of interest to borrow a currency for margin trading
|
|
6357
6384
|
* @see https://bybit-exchange.github.io/docs/zh-TW/v5/spot-margin-normal/interest-quota
|
|
6358
6385
|
* @param {string} code unified currency code
|
|
6359
6386
|
* @param {object} [params] extra parameters specific to the bybit api endpoint
|
|
6360
|
-
* @returns {object} a [borrow rate structure]{@link https://
|
|
6387
|
+
* @returns {object} a [borrow rate structure]{@link https://docs.ccxt.com/#/?id=borrow-rate-structure}
|
|
6361
6388
|
*/
|
|
6362
6389
|
await this.loadMarkets();
|
|
6363
6390
|
const currency = this.currency(code);
|
|
@@ -6379,7 +6406,9 @@ export default class bybit extends Exchange {
|
|
|
6379
6406
|
// "time": "1666734490778"
|
|
6380
6407
|
// }
|
|
6381
6408
|
//
|
|
6409
|
+
const timestamp = this.safeInteger(response, 'time');
|
|
6382
6410
|
const data = this.safeValue(response, 'result', {});
|
|
6411
|
+
data['timestamp'] = timestamp;
|
|
6383
6412
|
return this.parseBorrowRate(data, currency);
|
|
6384
6413
|
}
|
|
6385
6414
|
parseBorrowRate(info, currency = undefined) {
|
|
@@ -6388,10 +6417,11 @@ export default class bybit extends Exchange {
|
|
|
6388
6417
|
// "coin": "USDT",
|
|
6389
6418
|
// "interestRate": "0.000107000000",
|
|
6390
6419
|
// "loanAbleAmount": "",
|
|
6391
|
-
// "maxLoanAmount": "79999.999"
|
|
6420
|
+
// "maxLoanAmount": "79999.999",
|
|
6421
|
+
// "timestamp": 1666734490778
|
|
6392
6422
|
// }
|
|
6393
6423
|
//
|
|
6394
|
-
const timestamp = this.
|
|
6424
|
+
const timestamp = this.safeInteger(info, 'timestamp');
|
|
6395
6425
|
const currencyId = this.safeString(info, 'coin');
|
|
6396
6426
|
return {
|
|
6397
6427
|
'currency': this.safeCurrencyCode(currencyId, currency),
|
|
@@ -6413,7 +6443,7 @@ export default class bybit extends Exchange {
|
|
|
6413
6443
|
* @param {number} [since] the earliest time in ms to fetch borrrow interest for
|
|
6414
6444
|
* @param {number} [limit] the maximum number of structures to retrieve
|
|
6415
6445
|
* @param {object} [params] extra parameters specific to the bybit api endpoint
|
|
6416
|
-
* @returns {object[]} a list of [borrow interest structures]{@link https://
|
|
6446
|
+
* @returns {object[]} a list of [borrow interest structures]{@link https://docs.ccxt.com/#/?id=borrow-interest-structure}
|
|
6417
6447
|
*/
|
|
6418
6448
|
await this.loadMarkets();
|
|
6419
6449
|
const request = {};
|
|
@@ -6483,7 +6513,7 @@ export default class bybit extends Exchange {
|
|
|
6483
6513
|
* @param {string} toAccount account to transfer to
|
|
6484
6514
|
* @param {object} [params] extra parameters specific to the bybit api endpoint
|
|
6485
6515
|
* @param {string} [params.transferId] UUID, which is unique across the platform
|
|
6486
|
-
* @returns {object} a [transfer structure]{@link https://
|
|
6516
|
+
* @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
6487
6517
|
*/
|
|
6488
6518
|
await this.loadMarkets();
|
|
6489
6519
|
const transferId = this.safeString(params, 'transferId', this.uuid());
|
|
@@ -6536,7 +6566,7 @@ export default class bybit extends Exchange {
|
|
|
6536
6566
|
* @param {object} [params] extra parameters specific to the bybit api endpoint
|
|
6537
6567
|
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
6538
6568
|
* @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)
|
|
6539
|
-
* @returns {object[]} a list of [transfer structures]{@link https://
|
|
6569
|
+
* @returns {object[]} a list of [transfer structures]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
6540
6570
|
*/
|
|
6541
6571
|
await this.loadMarkets();
|
|
6542
6572
|
let paginate = false;
|
|
@@ -6593,7 +6623,7 @@ export default class bybit extends Exchange {
|
|
|
6593
6623
|
* @param {float} amount the amount to borrow
|
|
6594
6624
|
* @param {string} symbol not used by bybit.borrowMargin ()
|
|
6595
6625
|
* @param {object} [params] extra parameters specific to the bybit api endpoint
|
|
6596
|
-
* @returns {object} a [margin loan structure]{@link https://
|
|
6626
|
+
* @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
|
|
6597
6627
|
*/
|
|
6598
6628
|
await this.loadMarkets();
|
|
6599
6629
|
const currency = this.currency(code);
|
|
@@ -6634,7 +6664,7 @@ export default class bybit extends Exchange {
|
|
|
6634
6664
|
* @param {float} amount the amount to repay
|
|
6635
6665
|
* @param {string} symbol not used by bybit.repayMargin ()
|
|
6636
6666
|
* @param {object} [params] extra parameters specific to the bybit api endpoint
|
|
6637
|
-
* @returns {object} a [margin loan structure]{@link https://
|
|
6667
|
+
* @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
|
|
6638
6668
|
*/
|
|
6639
6669
|
await this.loadMarkets();
|
|
6640
6670
|
const currency = this.currency(code);
|
|
@@ -6784,7 +6814,7 @@ export default class bybit extends Exchange {
|
|
|
6784
6814
|
* @see https://bybit-exchange.github.io/docs/v5/market/risk-limit
|
|
6785
6815
|
* @param {string} symbol unified market symbol
|
|
6786
6816
|
* @param {object} [params] extra parameters specific to the bybit api endpoint
|
|
6787
|
-
* @returns {object} a [leverage tiers structure]{@link https://
|
|
6817
|
+
* @returns {object} a [leverage tiers structure]{@link https://docs.ccxt.com/#/?id=leverage-tiers-structure}
|
|
6788
6818
|
*/
|
|
6789
6819
|
await this.loadMarkets();
|
|
6790
6820
|
const request = {};
|
|
@@ -6851,7 +6881,7 @@ export default class bybit extends Exchange {
|
|
|
6851
6881
|
* @see https://bybit-exchange.github.io/docs/v5/account/fee-rate
|
|
6852
6882
|
* @param {string} symbol unified market symbol
|
|
6853
6883
|
* @param {object} [params] extra parameters specific to the bybit api endpoint
|
|
6854
|
-
* @returns {object} a [fee structure]{@link https://
|
|
6884
|
+
* @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
6855
6885
|
*/
|
|
6856
6886
|
await this.loadMarkets();
|
|
6857
6887
|
const market = this.market(symbol);
|
|
@@ -6892,7 +6922,7 @@ export default class bybit extends Exchange {
|
|
|
6892
6922
|
* @see https://bybit-exchange.github.io/docs/v5/account/fee-rate
|
|
6893
6923
|
* @param {object} [params] extra parameters specific to the bybit api endpoint
|
|
6894
6924
|
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
6895
|
-
* @returns {object} a dictionary of [fee structures]{@link https://
|
|
6925
|
+
* @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
|
|
6896
6926
|
*/
|
|
6897
6927
|
await this.loadMarkets();
|
|
6898
6928
|
let type = undefined;
|
|
@@ -6989,7 +7019,7 @@ export default class bybit extends Exchange {
|
|
|
6989
7019
|
* @see https://bybit-exchange.github.io/docs/v5/asset/coin-info
|
|
6990
7020
|
* @param {string[]} codes list of unified currency codes
|
|
6991
7021
|
* @param {object} [params] extra parameters specific to the bybit api endpoint
|
|
6992
|
-
* @returns {object} a list of [fee structures]{@link https://
|
|
7022
|
+
* @returns {object} a list of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
6993
7023
|
*/
|
|
6994
7024
|
this.checkRequiredCredentials();
|
|
6995
7025
|
await this.loadMarkets();
|
|
@@ -7220,7 +7250,7 @@ export default class bybit extends Exchange {
|
|
|
7220
7250
|
* @param {string} code unified currency code
|
|
7221
7251
|
* @param {object} [params] extra parameters specific to the bybit api endpoint
|
|
7222
7252
|
* @param {int} [params.period] the period in days to fetch the volatility for: 7,14,21,30,60,90,180,270
|
|
7223
|
-
* @returns {object[]} a list of [volatility history objects]{@link https://
|
|
7253
|
+
* @returns {object[]} a list of [volatility history objects]{@link https://docs.ccxt.com/#/?id=volatility-structure}
|
|
7224
7254
|
*/
|
|
7225
7255
|
await this.loadMarkets();
|
|
7226
7256
|
const currency = this.currency(code);
|
|
@@ -7275,7 +7305,7 @@ export default class bybit extends Exchange {
|
|
|
7275
7305
|
* @see https://bybit-exchange.github.io/docs/api-explorer/v5/market/tickers
|
|
7276
7306
|
* @param {string} symbol unified symbol of the market to fetch greeks for
|
|
7277
7307
|
* @param {object} [params] extra parameters specific to the bybit api endpoint
|
|
7278
|
-
* @returns {object} a [greeks structure]{@link https://
|
|
7308
|
+
* @returns {object} a [greeks structure]{@link https://docs.ccxt.com/#/?id=greeks-structure}
|
|
7279
7309
|
*/
|
|
7280
7310
|
await this.loadMarkets();
|
|
7281
7311
|
const market = this.market(symbol);
|