ccxt 4.4.30 → 4.4.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -3
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/ace.js +123 -123
- package/dist/cjs/src/alpaca.js +237 -237
- package/dist/cjs/src/ascendex.js +342 -341
- package/dist/cjs/src/bigone.js +242 -242
- package/dist/cjs/src/binance.js +1339 -1291
- package/dist/cjs/src/bingx.js +639 -639
- package/dist/cjs/src/bit2c.js +111 -111
- package/dist/cjs/src/bitbank.js +142 -142
- package/dist/cjs/src/bitbns.js +140 -140
- package/dist/cjs/src/bitfinex.js +231 -231
- package/dist/cjs/src/bitfinex2.js +403 -403
- package/dist/cjs/src/bitflyer.js +184 -184
- package/dist/cjs/src/bitget.js +848 -846
- package/dist/cjs/src/bithumb.js +125 -124
- package/dist/cjs/src/bitmart.js +525 -525
- package/dist/cjs/src/bitmex.js +317 -317
- package/dist/cjs/src/bitopro.js +221 -221
- package/dist/cjs/src/bitrue.js +315 -315
- package/dist/cjs/src/bitso.js +220 -220
- package/dist/cjs/src/bitstamp.js +251 -251
- package/dist/cjs/src/bitteam.js +183 -183
- package/dist/cjs/src/bitvavo.js +247 -251
- package/dist/cjs/src/bl3p.js +82 -82
- package/dist/cjs/src/blockchaincom.js +211 -211
- package/dist/cjs/src/blofin.js +332 -331
- package/dist/cjs/src/btcalpha.js +166 -166
- package/dist/cjs/src/btcbox.js +108 -108
- package/dist/cjs/src/btcmarkets.js +198 -198
- package/dist/cjs/src/btcturk.js +124 -124
- package/dist/cjs/src/bybit.js +906 -900
- package/dist/cjs/src/cex.js +227 -226
- package/dist/cjs/src/coinbase.js +481 -481
- package/dist/cjs/src/coinbaseexchange.js +274 -274
- package/dist/cjs/src/coinbaseinternational.js +304 -304
- package/dist/cjs/src/coincatch.js +650 -650
- package/dist/cjs/src/coincheck.js +113 -113
- package/dist/cjs/src/coinex.js +611 -601
- package/dist/cjs/src/coinlist.js +304 -303
- package/dist/cjs/src/coinmate.js +162 -161
- package/dist/cjs/src/coinmetro.js +187 -187
- package/dist/cjs/src/coinone.js +124 -123
- package/dist/cjs/src/coinsph.js +237 -237
- package/dist/cjs/src/coinspot.js +82 -82
- package/dist/cjs/src/cryptocom.js +342 -341
- package/dist/cjs/src/currencycom.js +225 -224
- package/dist/cjs/src/delta.js +320 -320
- package/dist/cjs/src/deribit.js +411 -408
- package/dist/cjs/src/digifinex.js +432 -431
- package/dist/cjs/src/exmo.js +328 -327
- package/dist/cjs/src/gate.js +830 -791
- package/dist/cjs/src/gemini.js +199 -198
- package/dist/cjs/src/hashkey.js +520 -517
- package/dist/cjs/src/hitbtc.js +465 -462
- package/dist/cjs/src/hollaex.js +253 -252
- package/dist/cjs/src/htx.js +791 -848
- package/dist/cjs/src/huobijp.js +219 -218
- package/dist/cjs/src/hyperliquid.js +421 -417
- package/dist/cjs/src/idex.js +238 -237
- package/dist/cjs/src/independentreserve.js +133 -132
- package/dist/cjs/src/indodax.js +177 -171
- package/dist/cjs/src/kraken.js +381 -377
- package/dist/cjs/src/krakenfutures.js +285 -279
- package/dist/cjs/src/kucoin.js +632 -622
- package/dist/cjs/src/kucoinfutures.js +533 -457
- package/dist/cjs/src/kuna.js +283 -282
- package/dist/cjs/src/latoken.js +211 -210
- package/dist/cjs/src/lbank.js +268 -267
- package/dist/cjs/src/luno.js +174 -173
- package/dist/cjs/src/lykke.js +172 -171
- package/dist/cjs/src/mercado.js +123 -122
- package/dist/cjs/src/mexc.js +650 -646
- package/dist/cjs/src/ndax.js +229 -228
- package/dist/cjs/src/novadax.js +230 -229
- package/dist/cjs/src/oceanex.js +187 -186
- package/dist/cjs/src/okcoin.js +286 -285
- package/dist/cjs/src/okx.js +909 -904
- package/dist/cjs/src/onetrading.js +218 -218
- package/dist/cjs/src/oxfun.js +335 -334
- package/dist/cjs/src/p2b.js +154 -154
- package/dist/cjs/src/paradex.js +249 -244
- package/dist/cjs/src/paymium.js +101 -101
- package/dist/cjs/src/phemex.js +388 -390
- package/dist/cjs/src/poloniex.js +270 -270
- package/dist/cjs/src/poloniexfutures.js +250 -250
- package/dist/cjs/src/pro/alpaca.js +64 -64
- package/dist/cjs/src/pro/ascendex.js +64 -64
- package/dist/cjs/src/pro/binance.js +546 -543
- package/dist/cjs/src/pro/bingx.js +116 -116
- package/dist/cjs/src/pro/bitfinex.js +42 -42
- package/dist/cjs/src/pro/bitfinex2.js +66 -66
- package/dist/cjs/src/pro/bitget.js +188 -181
- package/dist/cjs/src/pro/bithumb.js +40 -40
- package/dist/cjs/src/pro/bitmart.js +121 -119
- package/dist/cjs/src/pro/bitmex.js +135 -133
- package/dist/cjs/src/pro/bitopro.js +49 -49
- package/dist/cjs/src/pro/bitrue.js +19 -19
- package/dist/cjs/src/pro/bitstamp.js +29 -29
- package/dist/cjs/src/pro/bitvavo.js +299 -301
- package/dist/cjs/src/pro/blockchaincom.js +62 -62
- package/dist/cjs/src/pro/blofin.js +132 -130
- package/dist/cjs/src/pro/bybit.js +317 -313
- package/dist/cjs/src/pro/cex.js +168 -168
- package/dist/cjs/src/pro/coinbase.js +93 -91
- package/dist/cjs/src/pro/coinbaseexchange.js +95 -95
- package/dist/cjs/src/pro/coinbaseinternational.js +111 -111
- package/dist/cjs/src/pro/coincatch.js +150 -143
- package/dist/cjs/src/pro/coincheck.js +21 -21
- package/dist/cjs/src/pro/coinex.js +110 -110
- package/dist/cjs/src/pro/coinone.js +30 -30
- package/dist/cjs/src/pro/cryptocom.js +227 -227
- package/dist/cjs/src/pro/currencycom.js +45 -45
- package/dist/cjs/src/pro/deribit.js +127 -127
- package/dist/cjs/src/pro/exmo.js +66 -66
- package/dist/cjs/src/pro/gate.js +287 -283
- package/dist/cjs/src/pro/gemini.js +74 -74
- package/dist/cjs/src/pro/hashkey.js +87 -85
- package/dist/cjs/src/pro/hitbtc.js +190 -190
- package/dist/cjs/src/pro/hollaex.js +51 -51
- package/dist/cjs/src/pro/htx.js +96 -94
- package/dist/cjs/src/pro/huobijp.js +38 -38
- package/dist/cjs/src/pro/hyperliquid.js +151 -150
- package/dist/cjs/src/pro/idex.js +48 -48
- package/dist/cjs/src/pro/independentreserve.js +19 -19
- package/dist/cjs/src/pro/kraken.js +167 -167
- package/dist/cjs/src/pro/krakenfutures.js +137 -138
- package/dist/cjs/src/pro/kucoin.js +167 -168
- package/dist/cjs/src/pro/kucoinfutures.js +147 -147
- package/dist/cjs/src/pro/lbank.js +95 -95
- package/dist/cjs/src/pro/luno.js +21 -21
- package/dist/cjs/src/pro/mexc.js +102 -103
- package/dist/cjs/src/pro/ndax.js +42 -42
- package/dist/cjs/src/pro/okcoin.js +61 -61
- package/dist/cjs/src/pro/okx.js +332 -330
- package/dist/cjs/src/pro/onetrading.js +71 -71
- package/dist/cjs/src/pro/oxfun.js +193 -191
- package/dist/cjs/src/pro/p2b.js +77 -77
- package/dist/cjs/src/pro/paradex.js +39 -39
- package/dist/cjs/src/pro/phemex.js +94 -94
- package/dist/cjs/src/pro/poloniex.js +171 -171
- package/dist/cjs/src/pro/poloniexfutures.js +62 -62
- package/dist/cjs/src/pro/probit.js +63 -63
- package/dist/cjs/src/pro/upbit.js +80 -80
- package/dist/cjs/src/pro/vertex.js +65 -63
- package/dist/cjs/src/pro/wazirx.js +70 -70
- package/dist/cjs/src/pro/whitebit.js +83 -83
- package/dist/cjs/src/pro/woo.js +106 -104
- package/dist/cjs/src/pro/woofipro.js +105 -103
- package/dist/cjs/src/pro/xt.js +119 -119
- package/dist/cjs/src/probit.js +229 -229
- package/dist/cjs/src/timex.js +198 -197
- package/dist/cjs/src/tokocrypto.js +214 -213
- package/dist/cjs/src/tradeogre.js +92 -91
- package/dist/cjs/src/upbit.js +243 -242
- package/dist/cjs/src/vertex.js +258 -258
- package/dist/cjs/src/wavesexchange.js +176 -172
- package/dist/cjs/src/wazirx.js +168 -168
- package/dist/cjs/src/whitebit.js +361 -361
- package/dist/cjs/src/woo.js +571 -572
- package/dist/cjs/src/woofipro.js +392 -391
- package/dist/cjs/src/xt.js +436 -435
- package/dist/cjs/src/yobit.js +159 -158
- package/dist/cjs/src/zaif.js +103 -103
- package/dist/cjs/src/zonda.js +168 -168
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/ace.d.ts +123 -0
- package/js/src/ace.js +123 -123
- package/js/src/alpaca.d.ts +237 -0
- package/js/src/alpaca.js +237 -237
- package/js/src/ascendex.d.ts +339 -0
- package/js/src/ascendex.js +342 -341
- package/js/src/base/types.d.ts +1 -0
- package/js/src/bigone.d.ts +242 -0
- package/js/src/bigone.js +242 -242
- package/js/src/binance.d.ts +1306 -0
- package/js/src/binance.js +1339 -1291
- package/js/src/bingx.d.ts +639 -0
- package/js/src/bingx.js +639 -639
- package/js/src/bit2c.d.ts +111 -0
- package/js/src/bit2c.js +111 -111
- package/js/src/bitbank.d.ts +142 -0
- package/js/src/bitbank.js +142 -142
- package/js/src/bitbns.d.ts +140 -0
- package/js/src/bitbns.js +140 -140
- package/js/src/bitfinex.d.ts +231 -0
- package/js/src/bitfinex.js +231 -231
- package/js/src/bitfinex2.d.ts +403 -0
- package/js/src/bitfinex2.js +403 -403
- package/js/src/bitflyer.d.ts +184 -0
- package/js/src/bitflyer.js +184 -184
- package/js/src/bitget.d.ts +846 -0
- package/js/src/bitget.js +848 -846
- package/js/src/bithumb.d.ts +125 -0
- package/js/src/bithumb.js +125 -124
- package/js/src/bitmart.d.ts +525 -0
- package/js/src/bitmart.js +525 -525
- package/js/src/bitmex.d.ts +317 -0
- package/js/src/bitmex.js +317 -317
- package/js/src/bitopro.d.ts +221 -0
- package/js/src/bitopro.js +221 -221
- package/js/src/bitrue.d.ts +315 -0
- package/js/src/bitrue.js +315 -315
- package/js/src/bitso.d.ts +220 -0
- package/js/src/bitso.js +220 -220
- package/js/src/bitstamp.d.ts +251 -0
- package/js/src/bitstamp.js +251 -251
- package/js/src/bitteam.d.ts +183 -0
- package/js/src/bitteam.js +183 -183
- package/js/src/bitvavo.d.ts +247 -0
- package/js/src/bitvavo.js +247 -251
- package/js/src/bl3p.d.ts +82 -0
- package/js/src/bl3p.js +82 -82
- package/js/src/blockchaincom.d.ts +211 -0
- package/js/src/blockchaincom.js +211 -211
- package/js/src/blofin.d.ts +332 -0
- package/js/src/blofin.js +332 -331
- package/js/src/btcalpha.d.ts +166 -0
- package/js/src/btcalpha.js +166 -166
- package/js/src/btcbox.d.ts +108 -0
- package/js/src/btcbox.js +108 -108
- package/js/src/btcmarkets.d.ts +198 -0
- package/js/src/btcmarkets.js +198 -198
- package/js/src/btcturk.d.ts +124 -0
- package/js/src/btcturk.js +124 -124
- package/js/src/bybit.d.ts +906 -1
- package/js/src/bybit.js +906 -900
- package/js/src/cex.d.ts +227 -0
- package/js/src/cex.js +227 -226
- package/js/src/coinbase.d.ts +481 -0
- package/js/src/coinbase.js +481 -481
- package/js/src/coinbaseexchange.d.ts +274 -0
- package/js/src/coinbaseexchange.js +274 -274
- package/js/src/coinbaseinternational.d.ts +304 -0
- package/js/src/coinbaseinternational.js +304 -304
- package/js/src/coincatch.d.ts +646 -0
- package/js/src/coincatch.js +650 -650
- package/js/src/coincheck.d.ts +113 -0
- package/js/src/coincheck.js +113 -113
- package/js/src/coinex.d.ts +603 -0
- package/js/src/coinex.js +611 -601
- package/js/src/coinlist.d.ts +304 -0
- package/js/src/coinlist.js +304 -303
- package/js/src/coinmate.d.ts +162 -0
- package/js/src/coinmate.js +162 -161
- package/js/src/coinmetro.d.ts +187 -0
- package/js/src/coinmetro.js +187 -187
- package/js/src/coinone.d.ts +124 -0
- package/js/src/coinone.js +124 -123
- package/js/src/coinsph.d.ts +237 -0
- package/js/src/coinsph.js +237 -237
- package/js/src/coinspot.d.ts +82 -0
- package/js/src/coinspot.js +82 -82
- package/js/src/cryptocom.d.ts +342 -0
- package/js/src/cryptocom.js +342 -341
- package/js/src/currencycom.d.ts +225 -0
- package/js/src/currencycom.js +225 -224
- package/js/src/delta.d.ts +320 -0
- package/js/src/delta.js +320 -320
- package/js/src/deribit.d.ts +411 -0
- package/js/src/deribit.js +411 -408
- package/js/src/digifinex.d.ts +430 -0
- package/js/src/digifinex.js +432 -431
- package/js/src/exmo.d.ts +328 -0
- package/js/src/exmo.js +328 -327
- package/js/src/gate.d.ts +803 -1
- package/js/src/gate.js +830 -791
- package/js/src/gemini.d.ts +199 -0
- package/js/src/gemini.js +199 -198
- package/js/src/hashkey.d.ts +516 -0
- package/js/src/hashkey.js +520 -517
- package/js/src/hitbtc.d.ts +465 -0
- package/js/src/hitbtc.js +465 -462
- package/js/src/hollaex.d.ts +253 -0
- package/js/src/hollaex.js +253 -252
- package/js/src/htx.d.ts +765 -2
- package/js/src/htx.js +791 -848
- package/js/src/huobijp.d.ts +219 -0
- package/js/src/huobijp.js +219 -218
- package/js/src/hyperliquid.d.ts +419 -0
- package/js/src/hyperliquid.js +421 -417
- package/js/src/idex.d.ts +238 -0
- package/js/src/idex.js +238 -237
- package/js/src/independentreserve.d.ts +133 -0
- package/js/src/independentreserve.js +133 -132
- package/js/src/indodax.d.ts +171 -0
- package/js/src/indodax.js +177 -171
- package/js/src/kraken.d.ts +381 -0
- package/js/src/kraken.js +381 -377
- package/js/src/krakenfutures.d.ts +282 -0
- package/js/src/krakenfutures.js +285 -279
- package/js/src/kucoin.d.ts +613 -0
- package/js/src/kucoin.js +632 -622
- package/js/src/kucoinfutures.d.ts +441 -0
- package/js/src/kucoinfutures.js +533 -457
- package/js/src/kuna.d.ts +283 -0
- package/js/src/kuna.js +283 -282
- package/js/src/latoken.d.ts +211 -0
- package/js/src/latoken.js +211 -210
- package/js/src/lbank.d.ts +268 -0
- package/js/src/lbank.js +268 -267
- package/js/src/luno.d.ts +174 -0
- package/js/src/luno.js +174 -173
- package/js/src/lykke.d.ts +172 -0
- package/js/src/lykke.js +172 -171
- package/js/src/mercado.d.ts +123 -0
- package/js/src/mercado.js +123 -122
- package/js/src/mexc.d.ts +647 -0
- package/js/src/mexc.js +650 -646
- package/js/src/ndax.d.ts +229 -0
- package/js/src/ndax.js +229 -228
- package/js/src/novadax.d.ts +230 -0
- package/js/src/novadax.js +230 -229
- package/js/src/oceanex.d.ts +187 -0
- package/js/src/oceanex.js +187 -186
- package/js/src/okcoin.d.ts +286 -0
- package/js/src/okcoin.js +286 -285
- package/js/src/okx.d.ts +907 -0
- package/js/src/okx.js +909 -904
- package/js/src/onetrading.d.ts +218 -0
- package/js/src/onetrading.js +218 -218
- package/js/src/oxfun.d.ts +336 -3
- package/js/src/oxfun.js +335 -334
- package/js/src/p2b.d.ts +154 -0
- package/js/src/p2b.js +154 -154
- package/js/src/paradex.d.ts +241 -0
- package/js/src/paradex.js +249 -244
- package/js/src/paymium.d.ts +101 -0
- package/js/src/paymium.js +101 -101
- package/js/src/phemex.d.ts +366 -0
- package/js/src/phemex.js +388 -390
- package/js/src/poloniex.d.ts +270 -0
- package/js/src/poloniex.js +270 -270
- package/js/src/poloniexfutures.d.ts +250 -0
- package/js/src/poloniexfutures.js +250 -250
- package/js/src/pro/alpaca.d.ts +64 -0
- package/js/src/pro/alpaca.js +64 -64
- package/js/src/pro/ascendex.d.ts +64 -0
- package/js/src/pro/ascendex.js +64 -64
- package/js/src/pro/binance.d.ts +546 -0
- package/js/src/pro/binance.js +546 -543
- package/js/src/pro/bingx.d.ts +116 -0
- package/js/src/pro/bingx.js +116 -116
- package/js/src/pro/bitfinex.d.ts +42 -0
- package/js/src/pro/bitfinex.js +42 -42
- package/js/src/pro/bitfinex2.d.ts +66 -0
- package/js/src/pro/bitfinex2.js +66 -66
- package/js/src/pro/bitget.d.ts +187 -0
- package/js/src/pro/bitget.js +188 -181
- package/js/src/pro/bithumb.d.ts +40 -0
- package/js/src/pro/bithumb.js +40 -40
- package/js/src/pro/bitmart.d.ts +121 -0
- package/js/src/pro/bitmart.js +121 -119
- package/js/src/pro/bitmex.d.ts +135 -0
- package/js/src/pro/bitmex.js +135 -133
- package/js/src/pro/bitopro.d.ts +49 -0
- package/js/src/pro/bitopro.js +49 -49
- package/js/src/pro/bitrue.d.ts +19 -0
- package/js/src/pro/bitrue.js +19 -19
- package/js/src/pro/bitstamp.d.ts +29 -0
- package/js/src/pro/bitstamp.js +29 -29
- package/js/src/pro/bitvavo.d.ts +254 -1
- package/js/src/pro/bitvavo.js +299 -301
- package/js/src/pro/blockchaincom.d.ts +62 -0
- package/js/src/pro/blockchaincom.js +62 -62
- package/js/src/pro/blofin.d.ts +132 -0
- package/js/src/pro/blofin.js +132 -130
- package/js/src/pro/bybit.d.ts +317 -0
- package/js/src/pro/bybit.js +317 -313
- package/js/src/pro/cex.d.ts +168 -0
- package/js/src/pro/cex.js +168 -168
- package/js/src/pro/coinbase.d.ts +93 -0
- package/js/src/pro/coinbase.js +93 -91
- package/js/src/pro/coinbaseexchange.d.ts +95 -0
- package/js/src/pro/coinbaseexchange.js +95 -95
- package/js/src/pro/coinbaseinternational.d.ts +111 -0
- package/js/src/pro/coinbaseinternational.js +111 -111
- package/js/src/pro/coincatch.d.ts +150 -0
- package/js/src/pro/coincatch.js +150 -143
- package/js/src/pro/coincheck.d.ts +21 -0
- package/js/src/pro/coincheck.js +21 -21
- package/js/src/pro/coinex.d.ts +110 -0
- package/js/src/pro/coinex.js +110 -110
- package/js/src/pro/coinone.d.ts +30 -0
- package/js/src/pro/coinone.js +30 -30
- package/js/src/pro/cryptocom.d.ts +227 -0
- package/js/src/pro/cryptocom.js +227 -227
- package/js/src/pro/currencycom.d.ts +45 -0
- package/js/src/pro/currencycom.js +45 -45
- package/js/src/pro/deribit.d.ts +127 -0
- package/js/src/pro/deribit.js +127 -127
- package/js/src/pro/exmo.d.ts +66 -0
- package/js/src/pro/exmo.js +66 -66
- package/js/src/pro/gate.d.ts +287 -0
- package/js/src/pro/gate.js +287 -283
- package/js/src/pro/gemini.d.ts +74 -0
- package/js/src/pro/gemini.js +74 -74
- package/js/src/pro/hashkey.d.ts +87 -0
- package/js/src/pro/hashkey.js +87 -85
- package/js/src/pro/hitbtc.d.ts +190 -0
- package/js/src/pro/hitbtc.js +190 -190
- package/js/src/pro/hollaex.d.ts +51 -0
- package/js/src/pro/hollaex.js +51 -51
- package/js/src/pro/htx.d.ts +96 -0
- package/js/src/pro/htx.js +96 -94
- package/js/src/pro/huobijp.d.ts +38 -0
- package/js/src/pro/huobijp.js +38 -38
- package/js/src/pro/hyperliquid.d.ts +151 -0
- package/js/src/pro/hyperliquid.js +151 -150
- package/js/src/pro/idex.d.ts +48 -0
- package/js/src/pro/idex.js +48 -48
- package/js/src/pro/independentreserve.d.ts +19 -0
- package/js/src/pro/independentreserve.js +19 -19
- package/js/src/pro/kraken.d.ts +167 -0
- package/js/src/pro/kraken.js +167 -167
- package/js/src/pro/krakenfutures.d.ts +137 -0
- package/js/src/pro/krakenfutures.js +137 -138
- package/js/src/pro/kucoin.d.ts +167 -0
- package/js/src/pro/kucoin.js +167 -168
- package/js/src/pro/kucoinfutures.d.ts +147 -0
- package/js/src/pro/kucoinfutures.js +147 -147
- package/js/src/pro/lbank.d.ts +95 -0
- package/js/src/pro/lbank.js +95 -95
- package/js/src/pro/luno.d.ts +21 -0
- package/js/src/pro/luno.js +21 -21
- package/js/src/pro/mexc.d.ts +101 -0
- package/js/src/pro/mexc.js +102 -103
- package/js/src/pro/ndax.d.ts +42 -0
- package/js/src/pro/ndax.js +42 -42
- package/js/src/pro/okcoin.d.ts +61 -0
- package/js/src/pro/okcoin.js +61 -61
- package/js/src/pro/okx.d.ts +332 -0
- package/js/src/pro/okx.js +332 -330
- package/js/src/pro/onetrading.d.ts +71 -0
- package/js/src/pro/onetrading.js +71 -71
- package/js/src/pro/oxfun.d.ts +193 -0
- package/js/src/pro/oxfun.js +193 -191
- package/js/src/pro/p2b.d.ts +77 -0
- package/js/src/pro/p2b.js +77 -77
- package/js/src/pro/paradex.d.ts +39 -0
- package/js/src/pro/paradex.js +39 -39
- package/js/src/pro/phemex.d.ts +94 -0
- package/js/src/pro/phemex.js +94 -94
- package/js/src/pro/poloniex.d.ts +171 -0
- package/js/src/pro/poloniex.js +171 -171
- package/js/src/pro/poloniexfutures.d.ts +62 -0
- package/js/src/pro/poloniexfutures.js +62 -62
- package/js/src/pro/probit.d.ts +63 -0
- package/js/src/pro/probit.js +63 -63
- package/js/src/pro/upbit.d.ts +80 -0
- package/js/src/pro/upbit.js +80 -80
- package/js/src/pro/vertex.d.ts +65 -0
- package/js/src/pro/vertex.js +65 -63
- package/js/src/pro/wazirx.d.ts +70 -0
- package/js/src/pro/wazirx.js +70 -70
- package/js/src/pro/whitebit.d.ts +83 -0
- package/js/src/pro/whitebit.js +83 -83
- package/js/src/pro/woo.d.ts +106 -0
- package/js/src/pro/woo.js +106 -104
- package/js/src/pro/woofipro.d.ts +105 -0
- package/js/src/pro/woofipro.js +105 -103
- package/js/src/pro/xt.d.ts +119 -0
- package/js/src/pro/xt.js +119 -119
- package/js/src/probit.d.ts +229 -0
- package/js/src/probit.js +229 -229
- package/js/src/timex.d.ts +198 -0
- package/js/src/timex.js +198 -197
- package/js/src/tokocrypto.d.ts +214 -0
- package/js/src/tokocrypto.js +214 -213
- package/js/src/tradeogre.d.ts +92 -0
- package/js/src/tradeogre.js +92 -91
- package/js/src/upbit.d.ts +243 -0
- package/js/src/upbit.js +243 -242
- package/js/src/vertex.d.ts +258 -0
- package/js/src/vertex.js +258 -258
- package/js/src/wavesexchange.d.ts +176 -0
- package/js/src/wavesexchange.js +176 -172
- package/js/src/wazirx.d.ts +168 -0
- package/js/src/wazirx.js +168 -168
- package/js/src/whitebit.d.ts +361 -0
- package/js/src/whitebit.js +361 -361
- package/js/src/woo.d.ts +571 -0
- package/js/src/woo.js +571 -572
- package/js/src/woofipro.d.ts +392 -0
- package/js/src/woofipro.js +392 -391
- package/js/src/xt.d.ts +439 -4
- package/js/src/xt.js +436 -435
- package/js/src/yobit.d.ts +159 -0
- package/js/src/yobit.js +159 -158
- package/js/src/zaif.d.ts +103 -0
- package/js/src/zaif.js +103 -103
- package/js/src/zonda.d.ts +168 -0
- package/js/src/zonda.js +168 -168
- package/package.json +1 -1
package/dist/cjs/src/bybit.js
CHANGED
|
@@ -1110,14 +1110,16 @@ class bybit extends bybit$1 {
|
|
|
1110
1110
|
}
|
|
1111
1111
|
return data;
|
|
1112
1112
|
}
|
|
1113
|
+
/**
|
|
1114
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1115
|
+
* @method
|
|
1116
|
+
* @name bybit#isUnifiedEnabled
|
|
1117
|
+
* @see https://bybit-exchange.github.io/docs/v5/user/apikey-info#http-request
|
|
1118
|
+
* @see https://bybit-exchange.github.io/docs/v5/account/account-info
|
|
1119
|
+
* @description returns [enableUnifiedMargin, enableUnifiedAccount] so the user can check if unified account is enabled
|
|
1120
|
+
* @returns {any} [enableUnifiedMargin, enableUnifiedAccount]
|
|
1121
|
+
*/
|
|
1113
1122
|
async isUnifiedEnabled(params = {}) {
|
|
1114
|
-
/**
|
|
1115
|
-
* @method
|
|
1116
|
-
* @name bybit#isUnifiedEnabled
|
|
1117
|
-
* @see https://bybit-exchange.github.io/docs/v5/user/apikey-info#http-request
|
|
1118
|
-
* @see https://bybit-exchange.github.io/docs/v5/account/account-info
|
|
1119
|
-
* @description returns [enableUnifiedMargin, enableUnifiedAccount] so the user can check if unified account is enabled
|
|
1120
|
-
*/
|
|
1121
1123
|
// The API key of user id must own one of permissions will be allowed to call following API endpoints.
|
|
1122
1124
|
// SUB UID: "Account Transfer"
|
|
1123
1125
|
// MASTER UID: "Account Transfer", "Subaccount Transfer", "Withdrawal"
|
|
@@ -1199,13 +1201,15 @@ class bybit extends bybit$1 {
|
|
|
1199
1201
|
}
|
|
1200
1202
|
return [this.options['enableUnifiedMargin'], this.options['enableUnifiedAccount']];
|
|
1201
1203
|
}
|
|
1204
|
+
/**
|
|
1205
|
+
* @method
|
|
1206
|
+
* @name bybit#upgradeUnifiedTradeAccount
|
|
1207
|
+
* @description upgrades the account to unified trade account *warning* this is irreversible
|
|
1208
|
+
* @see https://bybit-exchange.github.io/docs/v5/account/upgrade-unified-account
|
|
1209
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1210
|
+
* @returns {any} nothing
|
|
1211
|
+
*/
|
|
1202
1212
|
async upgradeUnifiedTradeAccount(params = {}) {
|
|
1203
|
-
/**
|
|
1204
|
-
* @method
|
|
1205
|
-
* @name bybit#upgradeUnifiedTradeAccount
|
|
1206
|
-
* @see https://bybit-exchange.github.io/docs/v5/account/upgrade-unified-account
|
|
1207
|
-
* @description upgrades the account to unified trade account *warning* this is irreversible
|
|
1208
|
-
*/
|
|
1209
1213
|
return await this.privatePostV5AccountUpgradeToUta(params);
|
|
1210
1214
|
}
|
|
1211
1215
|
createExpiredOptionMarket(symbol) {
|
|
@@ -1333,15 +1337,15 @@ class bybit extends bybit$1 {
|
|
|
1333
1337
|
}
|
|
1334
1338
|
return cost;
|
|
1335
1339
|
}
|
|
1340
|
+
/**
|
|
1341
|
+
* @method
|
|
1342
|
+
* @name bybit#fetchTime
|
|
1343
|
+
* @description fetches the current integer timestamp in milliseconds from the exchange server
|
|
1344
|
+
* @see https://bybit-exchange.github.io/docs/v5/market/time
|
|
1345
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1346
|
+
* @returns {int} the current integer timestamp in milliseconds from the exchange server
|
|
1347
|
+
*/
|
|
1336
1348
|
async fetchTime(params = {}) {
|
|
1337
|
-
/**
|
|
1338
|
-
* @method
|
|
1339
|
-
* @name bybit#fetchTime
|
|
1340
|
-
* @description fetches the current integer timestamp in milliseconds from the exchange server
|
|
1341
|
-
* @see https://bybit-exchange.github.io/docs/v5/market/time
|
|
1342
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1343
|
-
* @returns {int} the current integer timestamp in milliseconds from the exchange server
|
|
1344
|
-
*/
|
|
1345
1349
|
const response = await this.publicGetV5MarketTime(params);
|
|
1346
1350
|
//
|
|
1347
1351
|
// {
|
|
@@ -1357,15 +1361,15 @@ class bybit extends bybit$1 {
|
|
|
1357
1361
|
//
|
|
1358
1362
|
return this.safeInteger(response, 'time');
|
|
1359
1363
|
}
|
|
1364
|
+
/**
|
|
1365
|
+
* @method
|
|
1366
|
+
* @name bybit#fetchCurrencies
|
|
1367
|
+
* @description fetches all available currencies on an exchange
|
|
1368
|
+
* @see https://bybit-exchange.github.io/docs/v5/asset/coin-info
|
|
1369
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1370
|
+
* @returns {object} an associative dictionary of currencies
|
|
1371
|
+
*/
|
|
1360
1372
|
async fetchCurrencies(params = {}) {
|
|
1361
|
-
/**
|
|
1362
|
-
* @method
|
|
1363
|
-
* @name bybit#fetchCurrencies
|
|
1364
|
-
* @description fetches all available currencies on an exchange
|
|
1365
|
-
* @see https://bybit-exchange.github.io/docs/v5/asset/coin-info
|
|
1366
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1367
|
-
* @returns {object} an associative dictionary of currencies
|
|
1368
|
-
*/
|
|
1369
1373
|
if (!this.checkRequiredCredentials(false)) {
|
|
1370
1374
|
return undefined;
|
|
1371
1375
|
}
|
|
@@ -1491,15 +1495,15 @@ class bybit extends bybit$1 {
|
|
|
1491
1495
|
}
|
|
1492
1496
|
return result;
|
|
1493
1497
|
}
|
|
1498
|
+
/**
|
|
1499
|
+
* @method
|
|
1500
|
+
* @name bybit#fetchMarkets
|
|
1501
|
+
* @description retrieves data on all markets for bybit
|
|
1502
|
+
* @see https://bybit-exchange.github.io/docs/v5/market/instrument
|
|
1503
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1504
|
+
* @returns {object[]} an array of objects representing market data
|
|
1505
|
+
*/
|
|
1494
1506
|
async fetchMarkets(params = {}) {
|
|
1495
|
-
/**
|
|
1496
|
-
* @method
|
|
1497
|
-
* @name bybit#fetchMarkets
|
|
1498
|
-
* @description retrieves data on all markets for bybit
|
|
1499
|
-
* @see https://bybit-exchange.github.io/docs/v5/market/instrument
|
|
1500
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1501
|
-
* @returns {object[]} an array of objects representing market data
|
|
1502
|
-
*/
|
|
1503
1507
|
if (this.options['adjustForTimeDifference']) {
|
|
1504
1508
|
await this.loadTimeDifference();
|
|
1505
1509
|
}
|
|
@@ -2120,16 +2124,16 @@ class bybit extends bybit$1 {
|
|
|
2120
2124
|
'info': ticker,
|
|
2121
2125
|
}, market);
|
|
2122
2126
|
}
|
|
2127
|
+
/**
|
|
2128
|
+
* @method
|
|
2129
|
+
* @name bybit#fetchTicker
|
|
2130
|
+
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
2131
|
+
* @see https://bybit-exchange.github.io/docs/v5/market/tickers
|
|
2132
|
+
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
2133
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2134
|
+
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
2135
|
+
*/
|
|
2123
2136
|
async fetchTicker(symbol, params = {}) {
|
|
2124
|
-
/**
|
|
2125
|
-
* @method
|
|
2126
|
-
* @name bybit#fetchTicker
|
|
2127
|
-
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
2128
|
-
* @see https://bybit-exchange.github.io/docs/v5/market/tickers
|
|
2129
|
-
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
2130
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2131
|
-
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
2132
|
-
*/
|
|
2133
2137
|
if (symbol === undefined) {
|
|
2134
2138
|
throw new errors.ArgumentsRequired(this.id + ' fetchTicker() requires a symbol argument');
|
|
2135
2139
|
}
|
|
@@ -2198,17 +2202,17 @@ class bybit extends bybit$1 {
|
|
|
2198
2202
|
const rawTicker = this.safeDict(tickers, 0);
|
|
2199
2203
|
return this.parseTicker(rawTicker, market);
|
|
2200
2204
|
}
|
|
2205
|
+
/**
|
|
2206
|
+
* @method
|
|
2207
|
+
* @name bybit#fetchTickers
|
|
2208
|
+
* @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
|
2209
|
+
* @see https://bybit-exchange.github.io/docs/v5/market/tickers
|
|
2210
|
+
* @param {string[]} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
2211
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2212
|
+
* @param {string} [params.subType] *contract only* 'linear', 'inverse'
|
|
2213
|
+
* @returns {object} an array of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
2214
|
+
*/
|
|
2201
2215
|
async fetchTickers(symbols = undefined, params = {}) {
|
|
2202
|
-
/**
|
|
2203
|
-
* @method
|
|
2204
|
-
* @name bybit#fetchTickers
|
|
2205
|
-
* @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
|
2206
|
-
* @see https://bybit-exchange.github.io/docs/v5/market/tickers
|
|
2207
|
-
* @param {string[]} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
2208
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2209
|
-
* @param {string} [params.subType] *contract only* 'linear', 'inverse'
|
|
2210
|
-
* @returns {object} an array of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
2211
|
-
*/
|
|
2212
2216
|
await this.loadMarkets();
|
|
2213
2217
|
let market = undefined;
|
|
2214
2218
|
let parsedSymbols = undefined;
|
|
@@ -2326,24 +2330,24 @@ class bybit extends bybit$1 {
|
|
|
2326
2330
|
this.safeNumber(ohlcv, volumeIndex),
|
|
2327
2331
|
];
|
|
2328
2332
|
}
|
|
2333
|
+
/**
|
|
2334
|
+
* @method
|
|
2335
|
+
* @name bybit#fetchOHLCV
|
|
2336
|
+
* @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
2337
|
+
* @see https://bybit-exchange.github.io/docs/v5/market/kline
|
|
2338
|
+
* @see https://bybit-exchange.github.io/docs/v5/market/mark-kline
|
|
2339
|
+
* @see https://bybit-exchange.github.io/docs/v5/market/index-kline
|
|
2340
|
+
* @see https://bybit-exchange.github.io/docs/v5/market/preimum-index-kline
|
|
2341
|
+
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
2342
|
+
* @param {string} timeframe the length of time each candle represents
|
|
2343
|
+
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
2344
|
+
* @param {int} [limit] the maximum amount of candles to fetch
|
|
2345
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2346
|
+
* @param {int} [params.until] the latest time in ms to fetch orders for
|
|
2347
|
+
* @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)
|
|
2348
|
+
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
2349
|
+
*/
|
|
2329
2350
|
async fetchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
|
|
2330
|
-
/**
|
|
2331
|
-
* @method
|
|
2332
|
-
* @name bybit#fetchOHLCV
|
|
2333
|
-
* @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
2334
|
-
* @see https://bybit-exchange.github.io/docs/v5/market/kline
|
|
2335
|
-
* @see https://bybit-exchange.github.io/docs/v5/market/mark-kline
|
|
2336
|
-
* @see https://bybit-exchange.github.io/docs/v5/market/index-kline
|
|
2337
|
-
* @see https://bybit-exchange.github.io/docs/v5/market/preimum-index-kline
|
|
2338
|
-
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
2339
|
-
* @param {string} timeframe the length of time each candle represents
|
|
2340
|
-
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
2341
|
-
* @param {int} [limit] the maximum amount of candles to fetch
|
|
2342
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2343
|
-
* @param {int} [params.until] the latest time in ms to fetch orders for
|
|
2344
|
-
* @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)
|
|
2345
|
-
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
2346
|
-
*/
|
|
2347
2351
|
if (symbol === undefined) {
|
|
2348
2352
|
throw new errors.ArgumentsRequired(this.id + ' fetchOHLCV() requires a symbol argument');
|
|
2349
2353
|
}
|
|
@@ -2505,16 +2509,16 @@ class bybit extends bybit$1 {
|
|
|
2505
2509
|
'interval': intervalString,
|
|
2506
2510
|
};
|
|
2507
2511
|
}
|
|
2512
|
+
/**
|
|
2513
|
+
* @method
|
|
2514
|
+
* @name bybit#fetchFundingRates
|
|
2515
|
+
* @description fetches funding rates for multiple markets
|
|
2516
|
+
* @see https://bybit-exchange.github.io/docs/v5/market/tickers
|
|
2517
|
+
* @param {string[]} symbols unified symbols of the markets to fetch the funding rates for, all market funding rates are returned if not assigned
|
|
2518
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2519
|
+
* @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
|
|
2520
|
+
*/
|
|
2508
2521
|
async fetchFundingRates(symbols = undefined, params = {}) {
|
|
2509
|
-
/**
|
|
2510
|
-
* @method
|
|
2511
|
-
* @name bybit#fetchFundingRates
|
|
2512
|
-
* @description fetches funding rates for multiple markets
|
|
2513
|
-
* @see https://bybit-exchange.github.io/docs/v5/market/tickers
|
|
2514
|
-
* @param {string[]} symbols unified symbols of the markets to fetch the funding rates for, all market funding rates are returned if not assigned
|
|
2515
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2516
|
-
* @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
|
|
2517
|
-
*/
|
|
2518
2522
|
await this.loadMarkets();
|
|
2519
2523
|
let market = undefined;
|
|
2520
2524
|
const request = {};
|
|
@@ -2582,20 +2586,20 @@ class bybit extends bybit$1 {
|
|
|
2582
2586
|
const result = this.parseFundingRates(tickerList);
|
|
2583
2587
|
return this.filterByArray(result, 'symbol', symbols);
|
|
2584
2588
|
}
|
|
2589
|
+
/**
|
|
2590
|
+
* @method
|
|
2591
|
+
* @name bybit#fetchFundingRateHistory
|
|
2592
|
+
* @description fetches historical funding rate prices
|
|
2593
|
+
* @see https://bybit-exchange.github.io/docs/v5/market/history-fund-rate
|
|
2594
|
+
* @param {string} symbol unified symbol of the market to fetch the funding rate history for
|
|
2595
|
+
* @param {int} [since] timestamp in ms of the earliest funding rate to fetch
|
|
2596
|
+
* @param {int} [limit] the maximum amount of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure} to fetch
|
|
2597
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2598
|
+
* @param {int} [params.until] timestamp in ms of the latest funding rate
|
|
2599
|
+
* @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)
|
|
2600
|
+
* @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure}
|
|
2601
|
+
*/
|
|
2585
2602
|
async fetchFundingRateHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
2586
|
-
/**
|
|
2587
|
-
* @method
|
|
2588
|
-
* @name bybit#fetchFundingRateHistory
|
|
2589
|
-
* @description fetches historical funding rate prices
|
|
2590
|
-
* @see https://bybit-exchange.github.io/docs/v5/market/history-fund-rate
|
|
2591
|
-
* @param {string} symbol unified symbol of the market to fetch the funding rate history for
|
|
2592
|
-
* @param {int} [since] timestamp in ms of the earliest funding rate to fetch
|
|
2593
|
-
* @param {int} [limit] the maximum amount of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure} to fetch
|
|
2594
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2595
|
-
* @param {int} [params.until] timestamp in ms of the latest funding rate
|
|
2596
|
-
* @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)
|
|
2597
|
-
* @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure}
|
|
2598
|
-
*/
|
|
2599
2603
|
if (symbol === undefined) {
|
|
2600
2604
|
throw new errors.ArgumentsRequired(this.id + ' fetchFundingRateHistory() requires a symbol argument');
|
|
2601
2605
|
}
|
|
@@ -2866,20 +2870,20 @@ class bybit extends bybit$1 {
|
|
|
2866
2870
|
'fee': fee,
|
|
2867
2871
|
}, market);
|
|
2868
2872
|
}
|
|
2873
|
+
/**
|
|
2874
|
+
* @method
|
|
2875
|
+
* @name bybit#fetchTrades
|
|
2876
|
+
* @description get the list of most recent trades for a particular symbol
|
|
2877
|
+
* @see https://bybit-exchange.github.io/docs/v5/market/recent-trade
|
|
2878
|
+
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
2879
|
+
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
2880
|
+
* @param {int} [limit] the maximum amount of trades to fetch
|
|
2881
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2882
|
+
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
2883
|
+
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
2884
|
+
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
|
|
2885
|
+
*/
|
|
2869
2886
|
async fetchTrades(symbol, since = undefined, limit = undefined, params = {}) {
|
|
2870
|
-
/**
|
|
2871
|
-
* @method
|
|
2872
|
-
* @name bybit#fetchTrades
|
|
2873
|
-
* @description get the list of most recent trades for a particular symbol
|
|
2874
|
-
* @see https://bybit-exchange.github.io/docs/v5/market/recent-trade
|
|
2875
|
-
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
2876
|
-
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
2877
|
-
* @param {int} [limit] the maximum amount of trades to fetch
|
|
2878
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2879
|
-
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
2880
|
-
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
2881
|
-
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
|
|
2882
|
-
*/
|
|
2883
2887
|
if (symbol === undefined) {
|
|
2884
2888
|
throw new errors.ArgumentsRequired(this.id + ' fetchTrades() requires a symbol argument');
|
|
2885
2889
|
}
|
|
@@ -2925,17 +2929,17 @@ class bybit extends bybit$1 {
|
|
|
2925
2929
|
const trades = this.safeList(result, 'list', []);
|
|
2926
2930
|
return this.parseTrades(trades, market, since, limit);
|
|
2927
2931
|
}
|
|
2932
|
+
/**
|
|
2933
|
+
* @method
|
|
2934
|
+
* @name bybit#fetchOrderBook
|
|
2935
|
+
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
2936
|
+
* @see https://bybit-exchange.github.io/docs/v5/market/orderbook
|
|
2937
|
+
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
2938
|
+
* @param {int} [limit] the maximum amount of order book entries to return
|
|
2939
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2940
|
+
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
2941
|
+
*/
|
|
2928
2942
|
async fetchOrderBook(symbol, limit = undefined, params = {}) {
|
|
2929
|
-
/**
|
|
2930
|
-
* @method
|
|
2931
|
-
* @name bybit#fetchOrderBook
|
|
2932
|
-
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
2933
|
-
* @see https://bybit-exchange.github.io/docs/v5/market/orderbook
|
|
2934
|
-
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
2935
|
-
* @param {int} [limit] the maximum amount of order book entries to return
|
|
2936
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2937
|
-
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
2938
|
-
*/
|
|
2939
2943
|
if (symbol === undefined) {
|
|
2940
2944
|
throw new errors.ArgumentsRequired(this.id + ' fetchOrderBook() requires a symbol argument');
|
|
2941
2945
|
}
|
|
@@ -3154,18 +3158,18 @@ class bybit extends bybit$1 {
|
|
|
3154
3158
|
}
|
|
3155
3159
|
return this.safeBalance(result);
|
|
3156
3160
|
}
|
|
3161
|
+
/**
|
|
3162
|
+
* @method
|
|
3163
|
+
* @name bybit#fetchBalance
|
|
3164
|
+
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
3165
|
+
* @see https://bybit-exchange.github.io/docs/v5/spot-margin-normal/account-info
|
|
3166
|
+
* @see https://bybit-exchange.github.io/docs/v5/asset/all-balance
|
|
3167
|
+
* @see https://bybit-exchange.github.io/docs/v5/account/wallet-balance
|
|
3168
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3169
|
+
* @param {string} [params.type] wallet type, ['spot', 'swap', 'funding']
|
|
3170
|
+
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
3171
|
+
*/
|
|
3157
3172
|
async fetchBalance(params = {}) {
|
|
3158
|
-
/**
|
|
3159
|
-
* @method
|
|
3160
|
-
* @name bybit#fetchBalance
|
|
3161
|
-
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
3162
|
-
* @see https://bybit-exchange.github.io/docs/v5/spot-margin-normal/account-info
|
|
3163
|
-
* @see https://bybit-exchange.github.io/docs/v5/asset/all-balance
|
|
3164
|
-
* @see https://bybit-exchange.github.io/docs/v5/account/wallet-balance
|
|
3165
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3166
|
-
* @param {string} [params.type] wallet type, ['spot', 'swap', 'funding']
|
|
3167
|
-
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
3168
|
-
*/
|
|
3169
3173
|
await this.loadMarkets();
|
|
3170
3174
|
const request = {};
|
|
3171
3175
|
const [enableUnifiedMargin, enableUnifiedAccount] = await this.isUnifiedEnabled();
|
|
@@ -3588,17 +3592,17 @@ class bybit extends bybit$1 {
|
|
|
3588
3592
|
'trades': undefined,
|
|
3589
3593
|
}, market);
|
|
3590
3594
|
}
|
|
3595
|
+
/**
|
|
3596
|
+
* @method
|
|
3597
|
+
* @name bybit#createMarketBuyOrderWithCost
|
|
3598
|
+
* @description create a market buy order by providing the symbol and cost
|
|
3599
|
+
* @see https://bybit-exchange.github.io/docs/v5/order/create-order
|
|
3600
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
3601
|
+
* @param {float} cost how much you want to trade in units of the quote currency
|
|
3602
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3603
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
3604
|
+
*/
|
|
3591
3605
|
async createMarketBuyOrderWithCost(symbol, cost, params = {}) {
|
|
3592
|
-
/**
|
|
3593
|
-
* @method
|
|
3594
|
-
* @name bybit#createMarketBuyOrderWithCost
|
|
3595
|
-
* @see https://bybit-exchange.github.io/docs/v5/order/create-order
|
|
3596
|
-
* @description create a market buy order by providing the symbol and cost
|
|
3597
|
-
* @param {string} symbol unified symbol of the market to create an order in
|
|
3598
|
-
* @param {float} cost how much you want to trade in units of the quote currency
|
|
3599
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3600
|
-
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
3601
|
-
*/
|
|
3602
3606
|
await this.loadMarkets();
|
|
3603
3607
|
const market = this.market(symbol);
|
|
3604
3608
|
if (!market['spot']) {
|
|
@@ -3606,17 +3610,17 @@ class bybit extends bybit$1 {
|
|
|
3606
3610
|
}
|
|
3607
3611
|
return await this.createOrder(symbol, 'market', 'buy', cost, 1, params);
|
|
3608
3612
|
}
|
|
3613
|
+
/**
|
|
3614
|
+
* @method
|
|
3615
|
+
* @name bybit#createMarkeSellOrderWithCost
|
|
3616
|
+
* @description create a market sell order by providing the symbol and cost
|
|
3617
|
+
* @see https://bybit-exchange.github.io/docs/v5/order/create-order
|
|
3618
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
3619
|
+
* @param {float} cost how much you want to trade in units of the quote currency
|
|
3620
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3621
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
3622
|
+
*/
|
|
3609
3623
|
async createMarketSellOrderWithCost(symbol, cost, params = {}) {
|
|
3610
|
-
/**
|
|
3611
|
-
* @method
|
|
3612
|
-
* @name bybit#createMarkeSellOrderWithCost
|
|
3613
|
-
* @see https://bybit-exchange.github.io/docs/v5/order/create-order
|
|
3614
|
-
* @description create a market sell order by providing the symbol and cost
|
|
3615
|
-
* @param {string} symbol unified symbol of the market to create an order in
|
|
3616
|
-
* @param {float} cost how much you want to trade in units of the quote currency
|
|
3617
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3618
|
-
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
3619
|
-
*/
|
|
3620
3624
|
await this.loadMarkets();
|
|
3621
3625
|
const types = await this.isUnifiedEnabled();
|
|
3622
3626
|
const enableUnifiedAccount = types[1];
|
|
@@ -3629,39 +3633,39 @@ class bybit extends bybit$1 {
|
|
|
3629
3633
|
}
|
|
3630
3634
|
return await this.createOrder(symbol, 'market', 'sell', cost, 1, params);
|
|
3631
3635
|
}
|
|
3636
|
+
/**
|
|
3637
|
+
* @method
|
|
3638
|
+
* @name bybit#createOrder
|
|
3639
|
+
* @description create a trade order
|
|
3640
|
+
* @see https://bybit-exchange.github.io/docs/v5/order/create-order
|
|
3641
|
+
* @see https://bybit-exchange.github.io/docs/v5/position/trading-stop
|
|
3642
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
3643
|
+
* @param {string} type 'market' or 'limit'
|
|
3644
|
+
* @param {string} side 'buy' or 'sell'
|
|
3645
|
+
* @param {float} amount how much of currency you want to trade in units of base currency
|
|
3646
|
+
* @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
3647
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3648
|
+
* @param {string} [params.timeInForce] "GTC", "IOC", "FOK"
|
|
3649
|
+
* @param {bool} [params.postOnly] true or false whether the order is post-only
|
|
3650
|
+
* @param {bool} [params.reduceOnly] true or false whether the order is reduce-only
|
|
3651
|
+
* @param {string} [params.positionIdx] *contracts only* 0 for one-way mode, 1 buy side of hedged mode, 2 sell side of hedged mode
|
|
3652
|
+
* @param {bool} [params.hedged] *contracts only* true for hedged mode, false for one way mode, default is false
|
|
3653
|
+
* @param {boolean} [params.isLeverage] *unified spot only* false then spot trading true then margin trading
|
|
3654
|
+
* @param {string} [params.tpslMode] *contract only* 'full' or 'partial'
|
|
3655
|
+
* @param {string} [params.mmp] *option only* market maker protection
|
|
3656
|
+
* @param {string} [params.triggerDirection] *contract only* the direction for trigger orders, 'above' or 'below'
|
|
3657
|
+
* @param {float} [params.triggerPrice] The price at which a trigger order is triggered at
|
|
3658
|
+
* @param {float} [params.stopLossPrice] The price at which a stop loss order is triggered at
|
|
3659
|
+
* @param {float} [params.takeProfitPrice] The price at which a take profit order is triggered at
|
|
3660
|
+
* @param {object} [params.takeProfit] *takeProfit object in params* containing the triggerPrice at which the attached take profit order will be triggered
|
|
3661
|
+
* @param {float} [params.takeProfit.triggerPrice] take profit trigger price
|
|
3662
|
+
* @param {object} [params.stopLoss] *stopLoss object in params* containing the triggerPrice at which the attached stop loss order will be triggered
|
|
3663
|
+
* @param {float} [params.stopLoss.triggerPrice] stop loss trigger price
|
|
3664
|
+
* @param {string} [params.trailingAmount] the quote amount to trail away from the current market price
|
|
3665
|
+
* @param {string} [params.trailingTriggerPrice] the price to trigger a trailing order, default uses the price argument
|
|
3666
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
3667
|
+
*/
|
|
3632
3668
|
async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
|
|
3633
|
-
/**
|
|
3634
|
-
* @method
|
|
3635
|
-
* @name bybit#createOrder
|
|
3636
|
-
* @description create a trade order
|
|
3637
|
-
* @see https://bybit-exchange.github.io/docs/v5/order/create-order
|
|
3638
|
-
* @see https://bybit-exchange.github.io/docs/v5/position/trading-stop
|
|
3639
|
-
* @param {string} symbol unified symbol of the market to create an order in
|
|
3640
|
-
* @param {string} type 'market' or 'limit'
|
|
3641
|
-
* @param {string} side 'buy' or 'sell'
|
|
3642
|
-
* @param {float} amount how much of currency you want to trade in units of base currency
|
|
3643
|
-
* @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
3644
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3645
|
-
* @param {string} [params.timeInForce] "GTC", "IOC", "FOK"
|
|
3646
|
-
* @param {bool} [params.postOnly] true or false whether the order is post-only
|
|
3647
|
-
* @param {bool} [params.reduceOnly] true or false whether the order is reduce-only
|
|
3648
|
-
* @param {string} [params.positionIdx] *contracts only* 0 for one-way mode, 1 buy side of hedged mode, 2 sell side of hedged mode
|
|
3649
|
-
* @param {bool} [params.hedged] *contracts only* true for hedged mode, false for one way mode, default is false
|
|
3650
|
-
* @param {boolean} [params.isLeverage] *unified spot only* false then spot trading true then margin trading
|
|
3651
|
-
* @param {string} [params.tpslMode] *contract only* 'full' or 'partial'
|
|
3652
|
-
* @param {string} [params.mmp] *option only* market maker protection
|
|
3653
|
-
* @param {string} [params.triggerDirection] *contract only* the direction for trigger orders, 'above' or 'below'
|
|
3654
|
-
* @param {float} [params.triggerPrice] The price at which a trigger order is triggered at
|
|
3655
|
-
* @param {float} [params.stopLossPrice] The price at which a stop loss order is triggered at
|
|
3656
|
-
* @param {float} [params.takeProfitPrice] The price at which a take profit order is triggered at
|
|
3657
|
-
* @param {object} [params.takeProfit] *takeProfit object in params* containing the triggerPrice at which the attached take profit order will be triggered
|
|
3658
|
-
* @param {float} [params.takeProfit.triggerPrice] take profit trigger price
|
|
3659
|
-
* @param {object} [params.stopLoss] *stopLoss object in params* containing the triggerPrice at which the attached stop loss order will be triggered
|
|
3660
|
-
* @param {float} [params.stopLoss.triggerPrice] stop loss trigger price
|
|
3661
|
-
* @param {string} [params.trailingAmount] the quote amount to trail away from the current market price
|
|
3662
|
-
* @param {string} [params.trailingTriggerPrice] the price to trigger a trailing order, default uses the price argument
|
|
3663
|
-
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
3664
|
-
*/
|
|
3665
3669
|
await this.loadMarkets();
|
|
3666
3670
|
const market = this.market(symbol);
|
|
3667
3671
|
const parts = await this.isUnifiedEnabled();
|
|
@@ -3937,15 +3941,16 @@ class bybit extends bybit$1 {
|
|
|
3937
3941
|
params = this.omit(params, ['stopPrice', 'timeInForce', 'stopLossPrice', 'takeProfitPrice', 'postOnly', 'clientOrderId', 'triggerPrice', 'stopLoss', 'takeProfit', 'trailingAmount', 'trailingTriggerPrice', 'hedged']);
|
|
3938
3942
|
return this.extend(request, params);
|
|
3939
3943
|
}
|
|
3944
|
+
/**
|
|
3945
|
+
* @method
|
|
3946
|
+
* @name bybit#createOrders
|
|
3947
|
+
* @description create a list of trade orders
|
|
3948
|
+
* @see https://bybit-exchange.github.io/docs/v5/order/batch-place
|
|
3949
|
+
* @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
|
|
3950
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3951
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
3952
|
+
*/
|
|
3940
3953
|
async createOrders(orders, params = {}) {
|
|
3941
|
-
/**
|
|
3942
|
-
* @method
|
|
3943
|
-
* @name bybit#createOrders
|
|
3944
|
-
* @description create a list of trade orders
|
|
3945
|
-
* @see https://bybit-exchange.github.io/docs/v5/order/batch-place
|
|
3946
|
-
* @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
|
|
3947
|
-
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
3948
|
-
*/
|
|
3949
3954
|
await this.loadMarkets();
|
|
3950
3955
|
const accounts = await this.isUnifiedEnabled();
|
|
3951
3956
|
const isUta = accounts[1];
|
|
@@ -4100,33 +4105,33 @@ class bybit extends bybit$1 {
|
|
|
4100
4105
|
params = this.omit(params, ['stopPrice', 'stopLossPrice', 'takeProfitPrice', 'triggerPrice', 'clientOrderId', 'stopLoss', 'takeProfit']);
|
|
4101
4106
|
return request;
|
|
4102
4107
|
}
|
|
4108
|
+
/**
|
|
4109
|
+
* @method
|
|
4110
|
+
* @name bybit#editOrder
|
|
4111
|
+
* @description edit a trade order
|
|
4112
|
+
* @see https://bybit-exchange.github.io/docs/v5/order/amend-order
|
|
4113
|
+
* @see https://bybit-exchange.github.io/docs/derivatives/unified/replace-order
|
|
4114
|
+
* @see https://bybit-exchange.github.io/docs/api-explorer/derivatives/trade/contract/replace-order
|
|
4115
|
+
* @param {string} id cancel order id
|
|
4116
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
4117
|
+
* @param {string} type 'market' or 'limit'
|
|
4118
|
+
* @param {string} side 'buy' or 'sell'
|
|
4119
|
+
* @param {float} amount how much of currency you want to trade in units of base currency
|
|
4120
|
+
* @param {float} price the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
4121
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4122
|
+
* @param {float} [params.triggerPrice] The price that a trigger order is triggered at
|
|
4123
|
+
* @param {float} [params.stopLossPrice] The price that a stop loss order is triggered at
|
|
4124
|
+
* @param {float} [params.takeProfitPrice] The price that a take profit order is triggered at
|
|
4125
|
+
* @param {object} [params.takeProfit] *takeProfit object in params* containing the triggerPrice that the attached take profit order will be triggered
|
|
4126
|
+
* @param {float} [params.takeProfit.triggerPrice] take profit trigger price
|
|
4127
|
+
* @param {object} [params.stopLoss] *stopLoss object in params* containing the triggerPrice that the attached stop loss order will be triggered
|
|
4128
|
+
* @param {float} [params.stopLoss.triggerPrice] stop loss trigger price
|
|
4129
|
+
* @param {string} [params.triggerBy] 'IndexPrice', 'MarkPrice' or 'LastPrice', default is 'LastPrice', required if no initial value for triggerPrice
|
|
4130
|
+
* @param {string} [params.slTriggerBy] 'IndexPrice', 'MarkPrice' or 'LastPrice', default is 'LastPrice', required if no initial value for stopLoss
|
|
4131
|
+
* @param {string} [params.tpTriggerby] 'IndexPrice', 'MarkPrice' or 'LastPrice', default is 'LastPrice', required if no initial value for takeProfit
|
|
4132
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4133
|
+
*/
|
|
4103
4134
|
async editOrder(id, symbol, type, side, amount = undefined, price = undefined, params = {}) {
|
|
4104
|
-
/**
|
|
4105
|
-
* @method
|
|
4106
|
-
* @name bybit#editOrder
|
|
4107
|
-
* @description edit a trade order
|
|
4108
|
-
* @see https://bybit-exchange.github.io/docs/v5/order/amend-order
|
|
4109
|
-
* @see https://bybit-exchange.github.io/docs/derivatives/unified/replace-order
|
|
4110
|
-
* @see https://bybit-exchange.github.io/docs/api-explorer/derivatives/trade/contract/replace-order
|
|
4111
|
-
* @param {string} id cancel order id
|
|
4112
|
-
* @param {string} symbol unified symbol of the market to create an order in
|
|
4113
|
-
* @param {string} type 'market' or 'limit'
|
|
4114
|
-
* @param {string} side 'buy' or 'sell'
|
|
4115
|
-
* @param {float} amount how much of currency you want to trade in units of base currency
|
|
4116
|
-
* @param {float} price the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
4117
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4118
|
-
* @param {float} [params.triggerPrice] The price that a trigger order is triggered at
|
|
4119
|
-
* @param {float} [params.stopLossPrice] The price that a stop loss order is triggered at
|
|
4120
|
-
* @param {float} [params.takeProfitPrice] The price that a take profit order is triggered at
|
|
4121
|
-
* @param {object} [params.takeProfit] *takeProfit object in params* containing the triggerPrice that the attached take profit order will be triggered
|
|
4122
|
-
* @param {float} [params.takeProfit.triggerPrice] take profit trigger price
|
|
4123
|
-
* @param {object} [params.stopLoss] *stopLoss object in params* containing the triggerPrice that the attached stop loss order will be triggered
|
|
4124
|
-
* @param {float} [params.stopLoss.triggerPrice] stop loss trigger price
|
|
4125
|
-
* @param {string} [params.triggerBy] 'IndexPrice', 'MarkPrice' or 'LastPrice', default is 'LastPrice', required if no initial value for triggerPrice
|
|
4126
|
-
* @param {string} [params.slTriggerBy] 'IndexPrice', 'MarkPrice' or 'LastPrice', default is 'LastPrice', required if no initial value for stopLoss
|
|
4127
|
-
* @param {string} [params.tpTriggerby] 'IndexPrice', 'MarkPrice' or 'LastPrice', default is 'LastPrice', required if no initial value for takeProfit
|
|
4128
|
-
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4129
|
-
*/
|
|
4130
4135
|
await this.loadMarkets();
|
|
4131
4136
|
if (symbol === undefined) {
|
|
4132
4137
|
throw new errors.ArgumentsRequired(this.id + ' editOrder() requires a symbol argument');
|
|
@@ -4183,20 +4188,20 @@ class bybit extends bybit$1 {
|
|
|
4183
4188
|
}
|
|
4184
4189
|
return this.extend(request, params);
|
|
4185
4190
|
}
|
|
4191
|
+
/**
|
|
4192
|
+
* @method
|
|
4193
|
+
* @name bybit#cancelOrder
|
|
4194
|
+
* @description cancels an open order
|
|
4195
|
+
* @see https://bybit-exchange.github.io/docs/v5/order/cancel-order
|
|
4196
|
+
* @param {string} id order id
|
|
4197
|
+
* @param {string} symbol unified symbol of the market the order was made in
|
|
4198
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4199
|
+
* @param {boolean} [params.trigger] *spot only* whether the order is a trigger order
|
|
4200
|
+
* @param {boolean} [params.stop] alias for trigger
|
|
4201
|
+
* @param {string} [params.orderFilter] *spot only* 'Order' or 'StopOrder' or 'tpslOrder'
|
|
4202
|
+
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4203
|
+
*/
|
|
4186
4204
|
async cancelOrder(id, symbol = undefined, params = {}) {
|
|
4187
|
-
/**
|
|
4188
|
-
* @method
|
|
4189
|
-
* @name bybit#cancelOrder
|
|
4190
|
-
* @description cancels an open order
|
|
4191
|
-
* @see https://bybit-exchange.github.io/docs/v5/order/cancel-order
|
|
4192
|
-
* @param {string} id order id
|
|
4193
|
-
* @param {string} symbol unified symbol of the market the order was made in
|
|
4194
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4195
|
-
* @param {boolean} [params.trigger] *spot only* whether the order is a trigger order
|
|
4196
|
-
* @param {boolean} [params.stop] alias for trigger
|
|
4197
|
-
* @param {string} [params.orderFilter] *spot only* 'Order' or 'StopOrder' or 'tpslOrder'
|
|
4198
|
-
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4199
|
-
*/
|
|
4200
4205
|
if (symbol === undefined) {
|
|
4201
4206
|
throw new errors.ArgumentsRequired(this.id + ' cancelOrder() requires a symbol argument');
|
|
4202
4207
|
}
|
|
@@ -4219,18 +4224,18 @@ class bybit extends bybit$1 {
|
|
|
4219
4224
|
const result = this.safeDict(response, 'result', {});
|
|
4220
4225
|
return this.parseOrder(result, market);
|
|
4221
4226
|
}
|
|
4227
|
+
/**
|
|
4228
|
+
* @method
|
|
4229
|
+
* @name bybit#cancelOrders
|
|
4230
|
+
* @description cancel multiple orders
|
|
4231
|
+
* @see https://bybit-exchange.github.io/docs/v5/order/batch-cancel
|
|
4232
|
+
* @param {string[]} ids order ids
|
|
4233
|
+
* @param {string} symbol unified symbol of the market the order was made in
|
|
4234
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4235
|
+
* @param {string[]} [params.clientOrderIds] client order ids
|
|
4236
|
+
* @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4237
|
+
*/
|
|
4222
4238
|
async cancelOrders(ids, symbol = undefined, params = {}) {
|
|
4223
|
-
/**
|
|
4224
|
-
* @method
|
|
4225
|
-
* @name bybit#cancelOrders
|
|
4226
|
-
* @description cancel multiple orders
|
|
4227
|
-
* @see https://bybit-exchange.github.io/docs/v5/order/batch-cancel
|
|
4228
|
-
* @param {string[]} ids order ids
|
|
4229
|
-
* @param {string} symbol unified symbol of the market the order was made in
|
|
4230
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4231
|
-
* @param {string[]} [params.clientOrderIds] client order ids
|
|
4232
|
-
* @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4233
|
-
*/
|
|
4234
4239
|
if (symbol === undefined) {
|
|
4235
4240
|
throw new errors.ArgumentsRequired(this.id + ' cancelOrders() requires a symbol argument');
|
|
4236
4241
|
}
|
|
@@ -4305,17 +4310,17 @@ class bybit extends bybit$1 {
|
|
|
4305
4310
|
const row = this.safeList(result, 'list', []);
|
|
4306
4311
|
return this.parseOrders(row, market);
|
|
4307
4312
|
}
|
|
4313
|
+
/**
|
|
4314
|
+
* @method
|
|
4315
|
+
* @name bybit#cancelAllOrdersAfter
|
|
4316
|
+
* @description dead man's switch, cancel all orders after the given timeout
|
|
4317
|
+
* @see https://bybit-exchange.github.io/docs/v5/order/dcp
|
|
4318
|
+
* @param {number} timeout time in milliseconds
|
|
4319
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4320
|
+
* @param {string} [params.product] OPTIONS, DERIVATIVES, SPOT, default is 'DERIVATIVES'
|
|
4321
|
+
* @returns {object} the api result
|
|
4322
|
+
*/
|
|
4308
4323
|
async cancelAllOrdersAfter(timeout, params = {}) {
|
|
4309
|
-
/**
|
|
4310
|
-
* @method
|
|
4311
|
-
* @name bybit#cancelAllOrdersAfter
|
|
4312
|
-
* @description dead man's switch, cancel all orders after the given timeout
|
|
4313
|
-
* @see https://bybit-exchange.github.io/docs/v5/order/dcp
|
|
4314
|
-
* @param {number} timeout time in milliseconds
|
|
4315
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4316
|
-
* @param {string} [params.product] OPTIONS, DERIVATIVES, SPOT, default is 'DERIVATIVES'
|
|
4317
|
-
* @returns {object} the api result
|
|
4318
|
-
*/
|
|
4319
4324
|
await this.loadMarkets();
|
|
4320
4325
|
const request = {
|
|
4321
4326
|
'timeWindow': this.parseToInt(timeout / 1000),
|
|
@@ -4338,16 +4343,16 @@ class bybit extends bybit$1 {
|
|
|
4338
4343
|
//
|
|
4339
4344
|
return response;
|
|
4340
4345
|
}
|
|
4346
|
+
/**
|
|
4347
|
+
* @method
|
|
4348
|
+
* @name bybit#cancelOrdersForSymbols
|
|
4349
|
+
* @description cancel multiple orders for multiple symbols
|
|
4350
|
+
* @see https://bybit-exchange.github.io/docs/v5/order/batch-cancel
|
|
4351
|
+
* @param {CancellationRequest[]} orders list of order ids with symbol, example [{"id": "a", "symbol": "BTC/USDT"}, {"id": "b", "symbol": "ETH/USDT"}]
|
|
4352
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4353
|
+
* @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4354
|
+
*/
|
|
4341
4355
|
async cancelOrdersForSymbols(orders, params = {}) {
|
|
4342
|
-
/**
|
|
4343
|
-
* @method
|
|
4344
|
-
* @name bybit#cancelOrdersForSymbols
|
|
4345
|
-
* @description cancel multiple orders for multiple symbols
|
|
4346
|
-
* @see https://bybit-exchange.github.io/docs/v5/order/batch-cancel
|
|
4347
|
-
* @param {CancellationRequest[]} orders list of order ids with symbol, example [{"id": "a", "symbol": "BTC/USDT"}, {"id": "b", "symbol": "ETH/USDT"}]
|
|
4348
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4349
|
-
* @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4350
|
-
*/
|
|
4351
4356
|
await this.loadMarkets();
|
|
4352
4357
|
const types = await this.isUnifiedEnabled();
|
|
4353
4358
|
const enableUnifiedAccount = types[1];
|
|
@@ -4425,22 +4430,22 @@ class bybit extends bybit$1 {
|
|
|
4425
4430
|
const row = this.safeList(result, 'list', []);
|
|
4426
4431
|
return this.parseOrders(row, undefined);
|
|
4427
4432
|
}
|
|
4433
|
+
/**
|
|
4434
|
+
* @method
|
|
4435
|
+
* @name bybit#cancelAllOrders
|
|
4436
|
+
* @description cancel all open orders
|
|
4437
|
+
* @see https://bybit-exchange.github.io/docs/v5/order/cancel-all
|
|
4438
|
+
* @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
|
|
4439
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4440
|
+
* @param {boolean} [params.trigger] true if trigger order
|
|
4441
|
+
* @param {boolean} [params.stop] alias for trigger
|
|
4442
|
+
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
4443
|
+
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
4444
|
+
* @param {string} [params.baseCoin] Base coin. Supports linear, inverse & option
|
|
4445
|
+
* @param {string} [params.settleCoin] Settle coin. Supports linear, inverse & option
|
|
4446
|
+
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4447
|
+
*/
|
|
4428
4448
|
async cancelAllOrders(symbol = undefined, params = {}) {
|
|
4429
|
-
/**
|
|
4430
|
-
* @method
|
|
4431
|
-
* @name bybit#cancelAllOrders
|
|
4432
|
-
* @description cancel all open orders
|
|
4433
|
-
* @see https://bybit-exchange.github.io/docs/v5/order/cancel-all
|
|
4434
|
-
* @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
|
|
4435
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4436
|
-
* @param {boolean} [params.trigger] true if trigger order
|
|
4437
|
-
* @param {boolean} [params.stop] alias for trigger
|
|
4438
|
-
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
4439
|
-
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
4440
|
-
* @param {string} [params.baseCoin] Base coin. Supports linear, inverse & option
|
|
4441
|
-
* @param {string} [params.settleCoin] Settle coin. Supports linear, inverse & option
|
|
4442
|
-
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4443
|
-
*/
|
|
4444
4449
|
await this.loadMarkets();
|
|
4445
4450
|
const [enableUnifiedMargin, enableUnifiedAccount] = await this.isUnifiedEnabled();
|
|
4446
4451
|
const isUnifiedAccount = (enableUnifiedMargin || enableUnifiedAccount);
|
|
@@ -4504,17 +4509,17 @@ class bybit extends bybit$1 {
|
|
|
4504
4509
|
}
|
|
4505
4510
|
return this.parseOrders(orders, market);
|
|
4506
4511
|
}
|
|
4512
|
+
/**
|
|
4513
|
+
* @method
|
|
4514
|
+
* @name bybit#fetchOrderClassic
|
|
4515
|
+
* @description fetches information on an order made by the user *classic accounts only*
|
|
4516
|
+
* @see https://bybit-exchange.github.io/docs/v5/order/order-list
|
|
4517
|
+
* @param {string} id the order id
|
|
4518
|
+
* @param {string} symbol unified symbol of the market the order was made in
|
|
4519
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4520
|
+
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4521
|
+
*/
|
|
4507
4522
|
async fetchOrderClassic(id, symbol = undefined, params = {}) {
|
|
4508
|
-
/**
|
|
4509
|
-
* @method
|
|
4510
|
-
* @name bybit#fetchOrderClassic
|
|
4511
|
-
* @description fetches information on an order made by the user *classic accounts only*
|
|
4512
|
-
* @see https://bybit-exchange.github.io/docs/v5/order/order-list
|
|
4513
|
-
* @param {string} id the order id
|
|
4514
|
-
* @param {string} symbol unified symbol of the market the order was made in
|
|
4515
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4516
|
-
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4517
|
-
*/
|
|
4518
4523
|
if (symbol === undefined) {
|
|
4519
4524
|
throw new errors.ArgumentsRequired(this.id + ' fetchOrder() requires a symbol argument');
|
|
4520
4525
|
}
|
|
@@ -4538,18 +4543,18 @@ class bybit extends bybit$1 {
|
|
|
4538
4543
|
}
|
|
4539
4544
|
return this.safeValue(result, 0);
|
|
4540
4545
|
}
|
|
4546
|
+
/**
|
|
4547
|
+
* @method
|
|
4548
|
+
* @name bybit#fetchOrderClassic
|
|
4549
|
+
* @description *classic accounts only/ spot not supported* fetches information on an order made by the user *classic accounts only*
|
|
4550
|
+
* @see https://bybit-exchange.github.io/docs/v5/order/order-list
|
|
4551
|
+
* @param {string} id the order id
|
|
4552
|
+
* @param {string} symbol unified symbol of the market the order was made in
|
|
4553
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4554
|
+
* @param {object} [params.acknowledged] to suppress the warning, set to true
|
|
4555
|
+
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4556
|
+
*/
|
|
4541
4557
|
async fetchOrder(id, symbol = undefined, params = {}) {
|
|
4542
|
-
/**
|
|
4543
|
-
* @method
|
|
4544
|
-
* @name bybit#fetchOrderClassic
|
|
4545
|
-
* @description *classic accounts only/ spot not supported* fetches information on an order made by the user *classic accounts only*
|
|
4546
|
-
* @see https://bybit-exchange.github.io/docs/v5/order/order-list
|
|
4547
|
-
* @param {string} id the order id
|
|
4548
|
-
* @param {string} symbol unified symbol of the market the order was made in
|
|
4549
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4550
|
-
* @param {object} [params.acknowledged] to suppress the warning, set to true
|
|
4551
|
-
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4552
|
-
*/
|
|
4553
4558
|
await this.loadMarkets();
|
|
4554
4559
|
const [enableUnifiedMargin, enableUnifiedAccount] = await this.isUnifiedEnabled();
|
|
4555
4560
|
const isUnifiedAccount = (enableUnifiedMargin || enableUnifiedAccount);
|
|
@@ -4659,25 +4664,25 @@ class bybit extends bybit$1 {
|
|
|
4659
4664
|
}
|
|
4660
4665
|
return await this.fetchOrdersClassic(symbol, since, limit, params);
|
|
4661
4666
|
}
|
|
4667
|
+
/**
|
|
4668
|
+
* @method
|
|
4669
|
+
* @name bybit#fetchOrders
|
|
4670
|
+
* @description fetches information on multiple orders made by the user *classic accounts only*
|
|
4671
|
+
* @see https://bybit-exchange.github.io/docs/v5/order/order-list
|
|
4672
|
+
* @param {string} symbol unified market symbol of the market orders were made in
|
|
4673
|
+
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
4674
|
+
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
4675
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4676
|
+
* @param {boolean} [params.trigger] true if trigger order
|
|
4677
|
+
* @param {boolean} [params.stop] alias for trigger
|
|
4678
|
+
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
4679
|
+
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
4680
|
+
* @param {string} [params.orderFilter] 'Order' or 'StopOrder' or 'tpslOrder'
|
|
4681
|
+
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
4682
|
+
* @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)
|
|
4683
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4684
|
+
*/
|
|
4662
4685
|
async fetchOrdersClassic(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
4663
|
-
/**
|
|
4664
|
-
* @method
|
|
4665
|
-
* @name bybit#fetchOrders
|
|
4666
|
-
* @description fetches information on multiple orders made by the user *classic accounts only*
|
|
4667
|
-
* @see https://bybit-exchange.github.io/docs/v5/order/order-list
|
|
4668
|
-
* @param {string} symbol unified market symbol of the market orders were made in
|
|
4669
|
-
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
4670
|
-
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
4671
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4672
|
-
* @param {boolean} [params.trigger] true if trigger order
|
|
4673
|
-
* @param {boolean} [params.stop] alias for trigger
|
|
4674
|
-
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
4675
|
-
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
4676
|
-
* @param {string} [params.orderFilter] 'Order' or 'StopOrder' or 'tpslOrder'
|
|
4677
|
-
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
4678
|
-
* @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)
|
|
4679
|
-
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4680
|
-
*/
|
|
4681
4686
|
await this.loadMarkets();
|
|
4682
4687
|
let paginate = false;
|
|
4683
4688
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchOrders', 'paginate');
|
|
@@ -4767,22 +4772,22 @@ class bybit extends bybit$1 {
|
|
|
4767
4772
|
const data = this.addPaginationCursorToResult(response);
|
|
4768
4773
|
return this.parseOrders(data, market, since, limit);
|
|
4769
4774
|
}
|
|
4775
|
+
/**
|
|
4776
|
+
* @method
|
|
4777
|
+
* @name bybit#fetchClosedOrder
|
|
4778
|
+
* @description fetches information on a closed order made by the user
|
|
4779
|
+
* @see https://bybit-exchange.github.io/docs/v5/order/order-list
|
|
4780
|
+
* @param {string} id order id
|
|
4781
|
+
* @param {string} [symbol] unified symbol of the market the order was made in
|
|
4782
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4783
|
+
* @param {boolean} [params.trigger] set to true for fetching a closed trigger order
|
|
4784
|
+
* @param {boolean} [params.stop] alias for trigger
|
|
4785
|
+
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
4786
|
+
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
4787
|
+
* @param {string} [params.orderFilter] 'Order' or 'StopOrder' or 'tpslOrder'
|
|
4788
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4789
|
+
*/
|
|
4770
4790
|
async fetchClosedOrder(id, symbol = undefined, params = {}) {
|
|
4771
|
-
/**
|
|
4772
|
-
* @method
|
|
4773
|
-
* @name bybit#fetchClosedOrder
|
|
4774
|
-
* @description fetches information on a closed order made by the user
|
|
4775
|
-
* @see https://bybit-exchange.github.io/docs/v5/order/order-list
|
|
4776
|
-
* @param {string} id order id
|
|
4777
|
-
* @param {string} [symbol] unified symbol of the market the order was made in
|
|
4778
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4779
|
-
* @param {boolean} [params.trigger] set to true for fetching a closed trigger order
|
|
4780
|
-
* @param {boolean} [params.stop] alias for trigger
|
|
4781
|
-
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
4782
|
-
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
4783
|
-
* @param {string} [params.orderFilter] 'Order' or 'StopOrder' or 'tpslOrder'
|
|
4784
|
-
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4785
|
-
*/
|
|
4786
4791
|
await this.loadMarkets();
|
|
4787
4792
|
const request = {
|
|
4788
4793
|
'orderId': id,
|
|
@@ -4799,24 +4804,24 @@ class bybit extends bybit$1 {
|
|
|
4799
4804
|
}
|
|
4800
4805
|
return this.safeValue(result, 0);
|
|
4801
4806
|
}
|
|
4807
|
+
/**
|
|
4808
|
+
* @method
|
|
4809
|
+
* @name bybit#fetchOpenOrder
|
|
4810
|
+
* @description fetches information on an open order made by the user
|
|
4811
|
+
* @see https://bybit-exchange.github.io/docs/v5/order/open-order
|
|
4812
|
+
* @param {string} id order id
|
|
4813
|
+
* @param {string} [symbol] unified symbol of the market the order was made in
|
|
4814
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4815
|
+
* @param {boolean} [params.trigger] set to true for fetching an open trigger order
|
|
4816
|
+
* @param {boolean} [params.stop] alias for trigger
|
|
4817
|
+
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
4818
|
+
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
4819
|
+
* @param {string} [params.baseCoin] Base coin. Supports linear, inverse & option
|
|
4820
|
+
* @param {string} [params.settleCoin] Settle coin. Supports linear, inverse & option
|
|
4821
|
+
* @param {string} [params.orderFilter] 'Order' or 'StopOrder' or 'tpslOrder'
|
|
4822
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4823
|
+
*/
|
|
4802
4824
|
async fetchOpenOrder(id, symbol = undefined, params = {}) {
|
|
4803
|
-
/**
|
|
4804
|
-
* @method
|
|
4805
|
-
* @name bybit#fetchOpenOrder
|
|
4806
|
-
* @description fetches information on an open order made by the user
|
|
4807
|
-
* @see https://bybit-exchange.github.io/docs/v5/order/open-order
|
|
4808
|
-
* @param {string} id order id
|
|
4809
|
-
* @param {string} [symbol] unified symbol of the market the order was made in
|
|
4810
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4811
|
-
* @param {boolean} [params.trigger] set to true for fetching an open trigger order
|
|
4812
|
-
* @param {boolean} [params.stop] alias for trigger
|
|
4813
|
-
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
4814
|
-
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
4815
|
-
* @param {string} [params.baseCoin] Base coin. Supports linear, inverse & option
|
|
4816
|
-
* @param {string} [params.settleCoin] Settle coin. Supports linear, inverse & option
|
|
4817
|
-
* @param {string} [params.orderFilter] 'Order' or 'StopOrder' or 'tpslOrder'
|
|
4818
|
-
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4819
|
-
*/
|
|
4820
4825
|
await this.loadMarkets();
|
|
4821
4826
|
const request = {
|
|
4822
4827
|
'orderId': id,
|
|
@@ -4833,25 +4838,25 @@ class bybit extends bybit$1 {
|
|
|
4833
4838
|
}
|
|
4834
4839
|
return this.safeValue(result, 0);
|
|
4835
4840
|
}
|
|
4841
|
+
/**
|
|
4842
|
+
* @method
|
|
4843
|
+
* @name bybit#fetchCanceledAndClosedOrders
|
|
4844
|
+
* @description fetches information on multiple canceled and closed orders made by the user
|
|
4845
|
+
* @see https://bybit-exchange.github.io/docs/v5/order/order-list
|
|
4846
|
+
* @param {string} [symbol] unified market symbol of the market orders were made in
|
|
4847
|
+
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
4848
|
+
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
4849
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4850
|
+
* @param {boolean} [params.trigger] set to true for fetching trigger orders
|
|
4851
|
+
* @param {boolean} [params.stop] alias for trigger
|
|
4852
|
+
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
4853
|
+
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
4854
|
+
* @param {string} [params.orderFilter] 'Order' or 'StopOrder' or 'tpslOrder'
|
|
4855
|
+
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
4856
|
+
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
4857
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4858
|
+
*/
|
|
4836
4859
|
async fetchCanceledAndClosedOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
4837
|
-
/**
|
|
4838
|
-
* @method
|
|
4839
|
-
* @name bybit#fetchCanceledAndClosedOrders
|
|
4840
|
-
* @description fetches information on multiple canceled and closed orders made by the user
|
|
4841
|
-
* @see https://bybit-exchange.github.io/docs/v5/order/order-list
|
|
4842
|
-
* @param {string} [symbol] unified market symbol of the market orders were made in
|
|
4843
|
-
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
4844
|
-
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
4845
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4846
|
-
* @param {boolean} [params.trigger] set to true for fetching trigger orders
|
|
4847
|
-
* @param {boolean} [params.stop] alias for trigger
|
|
4848
|
-
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
4849
|
-
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
4850
|
-
* @param {string} [params.orderFilter] 'Order' or 'StopOrder' or 'tpslOrder'
|
|
4851
|
-
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
4852
|
-
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
4853
|
-
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4854
|
-
*/
|
|
4855
4860
|
await this.loadMarkets();
|
|
4856
4861
|
let paginate = false;
|
|
4857
4862
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchCanceledAndClosedOrders', 'paginate');
|
|
@@ -4938,76 +4943,76 @@ class bybit extends bybit$1 {
|
|
|
4938
4943
|
const data = this.addPaginationCursorToResult(response);
|
|
4939
4944
|
return this.parseOrders(data, market, since, limit);
|
|
4940
4945
|
}
|
|
4946
|
+
/**
|
|
4947
|
+
* @method
|
|
4948
|
+
* @name bybit#fetchClosedOrders
|
|
4949
|
+
* @description fetches information on multiple closed orders made by the user
|
|
4950
|
+
* @see https://bybit-exchange.github.io/docs/v5/order/order-list
|
|
4951
|
+
* @param {string} [symbol] unified market symbol of the market orders were made in
|
|
4952
|
+
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
4953
|
+
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
4954
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4955
|
+
* @param {boolean} [params.trigger] set to true for fetching closed trigger orders
|
|
4956
|
+
* @param {boolean} [params.stop] alias for trigger
|
|
4957
|
+
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
4958
|
+
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
4959
|
+
* @param {string} [params.orderFilter] 'Order' or 'StopOrder' or 'tpslOrder'
|
|
4960
|
+
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
4961
|
+
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
4962
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4963
|
+
*/
|
|
4941
4964
|
async fetchClosedOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
4942
|
-
/**
|
|
4943
|
-
* @method
|
|
4944
|
-
* @name bybit#fetchClosedOrders
|
|
4945
|
-
* @description fetches information on multiple closed orders made by the user
|
|
4946
|
-
* @see https://bybit-exchange.github.io/docs/v5/order/order-list
|
|
4947
|
-
* @param {string} [symbol] unified market symbol of the market orders were made in
|
|
4948
|
-
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
4949
|
-
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
4950
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4951
|
-
* @param {boolean} [params.trigger] set to true for fetching closed trigger orders
|
|
4952
|
-
* @param {boolean} [params.stop] alias for trigger
|
|
4953
|
-
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
4954
|
-
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
4955
|
-
* @param {string} [params.orderFilter] 'Order' or 'StopOrder' or 'tpslOrder'
|
|
4956
|
-
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
4957
|
-
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
4958
|
-
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4959
|
-
*/
|
|
4960
4965
|
await this.loadMarkets();
|
|
4961
4966
|
const request = {
|
|
4962
4967
|
'orderStatus': 'Filled',
|
|
4963
4968
|
};
|
|
4964
4969
|
return await this.fetchCanceledAndClosedOrders(symbol, since, limit, this.extend(request, params));
|
|
4965
4970
|
}
|
|
4971
|
+
/**
|
|
4972
|
+
* @method
|
|
4973
|
+
* @name bybit#fetchCanceledOrders
|
|
4974
|
+
* @description fetches information on multiple canceled orders made by the user
|
|
4975
|
+
* @see https://bybit-exchange.github.io/docs/v5/order/order-list
|
|
4976
|
+
* @param {string} [symbol] unified market symbol of the market orders were made in
|
|
4977
|
+
* @param {int} [since] timestamp in ms of the earliest order, default is undefined
|
|
4978
|
+
* @param {int} [limit] max number of orders to return, default is undefined
|
|
4979
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4980
|
+
* @param {boolean} [params.trigger] true if trigger order
|
|
4981
|
+
* @param {boolean} [params.stop] alias for trigger
|
|
4982
|
+
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
4983
|
+
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
4984
|
+
* @param {string} [params.orderFilter] 'Order' or 'StopOrder' or 'tpslOrder'
|
|
4985
|
+
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
4986
|
+
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
4987
|
+
* @returns {object} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4988
|
+
*/
|
|
4966
4989
|
async fetchCanceledOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
4967
|
-
/**
|
|
4968
|
-
* @method
|
|
4969
|
-
* @name bybit#fetchCanceledOrders
|
|
4970
|
-
* @description fetches information on multiple canceled orders made by the user
|
|
4971
|
-
* @see https://bybit-exchange.github.io/docs/v5/order/order-list
|
|
4972
|
-
* @param {string} [symbol] unified market symbol of the market orders were made in
|
|
4973
|
-
* @param {int} [since] timestamp in ms of the earliest order, default is undefined
|
|
4974
|
-
* @param {int} [limit] max number of orders to return, default is undefined
|
|
4975
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4976
|
-
* @param {boolean} [params.trigger] true if trigger order
|
|
4977
|
-
* @param {boolean} [params.stop] alias for trigger
|
|
4978
|
-
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
4979
|
-
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
4980
|
-
* @param {string} [params.orderFilter] 'Order' or 'StopOrder' or 'tpslOrder'
|
|
4981
|
-
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
4982
|
-
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
4983
|
-
* @returns {object} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4984
|
-
*/
|
|
4985
4990
|
await this.loadMarkets();
|
|
4986
4991
|
const request = {
|
|
4987
4992
|
'orderStatus': 'Cancelled',
|
|
4988
4993
|
};
|
|
4989
4994
|
return await this.fetchCanceledAndClosedOrders(symbol, since, limit, this.extend(request, params));
|
|
4990
4995
|
}
|
|
4996
|
+
/**
|
|
4997
|
+
* @method
|
|
4998
|
+
* @name bybit#fetchOpenOrders
|
|
4999
|
+
* @description fetch all unfilled currently open orders
|
|
5000
|
+
* @see https://bybit-exchange.github.io/docs/v5/order/open-order
|
|
5001
|
+
* @param {string} symbol unified market symbol
|
|
5002
|
+
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
5003
|
+
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
5004
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5005
|
+
* @param {boolean} [params.trigger] set to true for fetching open trigger orders
|
|
5006
|
+
* @param {boolean} [params.stop] alias for trigger
|
|
5007
|
+
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
5008
|
+
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
5009
|
+
* @param {string} [params.baseCoin] Base coin. Supports linear, inverse & option
|
|
5010
|
+
* @param {string} [params.settleCoin] Settle coin. Supports linear, inverse & option
|
|
5011
|
+
* @param {string} [params.orderFilter] 'Order' or 'StopOrder' or 'tpslOrder'
|
|
5012
|
+
* @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)
|
|
5013
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
5014
|
+
*/
|
|
4991
5015
|
async fetchOpenOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
4992
|
-
/**
|
|
4993
|
-
* @method
|
|
4994
|
-
* @name bybit#fetchOpenOrders
|
|
4995
|
-
* @description fetch all unfilled currently open orders
|
|
4996
|
-
* @see https://bybit-exchange.github.io/docs/v5/order/open-order
|
|
4997
|
-
* @param {string} symbol unified market symbol
|
|
4998
|
-
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
4999
|
-
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
5000
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5001
|
-
* @param {boolean} [params.trigger] set to true for fetching open trigger orders
|
|
5002
|
-
* @param {boolean} [params.stop] alias for trigger
|
|
5003
|
-
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
5004
|
-
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
5005
|
-
* @param {string} [params.baseCoin] Base coin. Supports linear, inverse & option
|
|
5006
|
-
* @param {string} [params.settleCoin] Settle coin. Supports linear, inverse & option
|
|
5007
|
-
* @param {string} [params.orderFilter] 'Order' or 'StopOrder' or 'tpslOrder'
|
|
5008
|
-
* @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)
|
|
5009
|
-
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
5010
|
-
*/
|
|
5011
5016
|
await this.loadMarkets();
|
|
5012
5017
|
let paginate = false;
|
|
5013
5018
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchOpenOrders', 'paginate');
|
|
@@ -5092,19 +5097,19 @@ class bybit extends bybit$1 {
|
|
|
5092
5097
|
const data = this.addPaginationCursorToResult(response);
|
|
5093
5098
|
return this.parseOrders(data, market, since, limit);
|
|
5094
5099
|
}
|
|
5100
|
+
/**
|
|
5101
|
+
* @method
|
|
5102
|
+
* @name bybit#fetchOrderTrades
|
|
5103
|
+
* @description fetch all the trades made from a single order
|
|
5104
|
+
* @see https://bybit-exchange.github.io/docs/v5/position/execution
|
|
5105
|
+
* @param {string} id order id
|
|
5106
|
+
* @param {string} symbol unified market symbol
|
|
5107
|
+
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
5108
|
+
* @param {int} [limit] the maximum number of trades to retrieve
|
|
5109
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5110
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
5111
|
+
*/
|
|
5095
5112
|
async fetchOrderTrades(id, symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
5096
|
-
/**
|
|
5097
|
-
* @method
|
|
5098
|
-
* @name bybit#fetchOrderTrades
|
|
5099
|
-
* @description fetch all the trades made from a single order
|
|
5100
|
-
* @see https://bybit-exchange.github.io/docs/v5/position/execution
|
|
5101
|
-
* @param {string} id order id
|
|
5102
|
-
* @param {string} symbol unified market symbol
|
|
5103
|
-
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
5104
|
-
* @param {int} [limit] the maximum number of trades to retrieve
|
|
5105
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5106
|
-
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
5107
|
-
*/
|
|
5108
5113
|
const request = {};
|
|
5109
5114
|
const clientOrderId = this.safeString2(params, 'clientOrderId', 'orderLinkId');
|
|
5110
5115
|
if (clientOrderId !== undefined) {
|
|
@@ -5116,21 +5121,21 @@ class bybit extends bybit$1 {
|
|
|
5116
5121
|
params = this.omit(params, ['clientOrderId', 'orderLinkId']);
|
|
5117
5122
|
return await this.fetchMyTrades(symbol, since, limit, this.extend(request, params));
|
|
5118
5123
|
}
|
|
5124
|
+
/**
|
|
5125
|
+
* @method
|
|
5126
|
+
* @name bybit#fetchMyTrades
|
|
5127
|
+
* @description fetch all trades made by the user
|
|
5128
|
+
* @see https://bybit-exchange.github.io/docs/api-explorer/v5/position/execution
|
|
5129
|
+
* @param {string} symbol unified market symbol
|
|
5130
|
+
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
5131
|
+
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
5132
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5133
|
+
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
5134
|
+
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
5135
|
+
* @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)
|
|
5136
|
+
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
5137
|
+
*/
|
|
5119
5138
|
async fetchMyTrades(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
5120
|
-
/**
|
|
5121
|
-
* @method
|
|
5122
|
-
* @name bybit#fetchMyTrades
|
|
5123
|
-
* @description fetch all trades made by the user
|
|
5124
|
-
* @see https://bybit-exchange.github.io/docs/api-explorer/v5/position/execution
|
|
5125
|
-
* @param {string} symbol unified market symbol
|
|
5126
|
-
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
5127
|
-
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
5128
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5129
|
-
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
5130
|
-
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
5131
|
-
* @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)
|
|
5132
|
-
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
5133
|
-
*/
|
|
5134
5139
|
await this.loadMarkets();
|
|
5135
5140
|
let paginate = false;
|
|
5136
5141
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchMyTrades', 'paginate');
|
|
@@ -5221,16 +5226,16 @@ class bybit extends bybit$1 {
|
|
|
5221
5226
|
'tag': tag,
|
|
5222
5227
|
};
|
|
5223
5228
|
}
|
|
5229
|
+
/**
|
|
5230
|
+
* @method
|
|
5231
|
+
* @name bybit#fetchDepositAddressesByNetwork
|
|
5232
|
+
* @description fetch a dictionary of addresses for a currency, indexed by network
|
|
5233
|
+
* @see https://bybit-exchange.github.io/docs/v5/asset/master-deposit-addr
|
|
5234
|
+
* @param {string} code unified currency code of the currency for the deposit address
|
|
5235
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5236
|
+
* @returns {object} a dictionary of [address structures]{@link https://docs.ccxt.com/#/?id=address-structure} indexed by the network
|
|
5237
|
+
*/
|
|
5224
5238
|
async fetchDepositAddressesByNetwork(code, params = {}) {
|
|
5225
|
-
/**
|
|
5226
|
-
* @method
|
|
5227
|
-
* @name bybit#fetchDepositAddressesByNetwork
|
|
5228
|
-
* @description fetch a dictionary of addresses for a currency, indexed by network
|
|
5229
|
-
* @see https://bybit-exchange.github.io/docs/v5/asset/master-deposit-addr
|
|
5230
|
-
* @param {string} code unified currency code of the currency for the deposit address
|
|
5231
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5232
|
-
* @returns {object} a dictionary of [address structures]{@link https://docs.ccxt.com/#/?id=address-structure} indexed by the network
|
|
5233
|
-
*/
|
|
5234
5239
|
await this.loadMarkets();
|
|
5235
5240
|
let currency = this.currency(code);
|
|
5236
5241
|
const request = {
|
|
@@ -5265,16 +5270,16 @@ class bybit extends bybit$1 {
|
|
|
5265
5270
|
});
|
|
5266
5271
|
return this.indexBy(parsed, 'network');
|
|
5267
5272
|
}
|
|
5273
|
+
/**
|
|
5274
|
+
* @method
|
|
5275
|
+
* @name bybit#fetchDepositAddress
|
|
5276
|
+
* @description fetch the deposit address for a currency associated with this account
|
|
5277
|
+
* @see https://bybit-exchange.github.io/docs/v5/asset/master-deposit-addr
|
|
5278
|
+
* @param {string} code unified currency code
|
|
5279
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5280
|
+
* @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
|
|
5281
|
+
*/
|
|
5268
5282
|
async fetchDepositAddress(code, params = {}) {
|
|
5269
|
-
/**
|
|
5270
|
-
* @method
|
|
5271
|
-
* @name bybit#fetchDepositAddress
|
|
5272
|
-
* @description fetch the deposit address for a currency associated with this account
|
|
5273
|
-
* @see https://bybit-exchange.github.io/docs/v5/asset/master-deposit-addr
|
|
5274
|
-
* @param {string} code unified currency code
|
|
5275
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5276
|
-
* @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
|
|
5277
|
-
*/
|
|
5278
5283
|
await this.loadMarkets();
|
|
5279
5284
|
const [networkCode, query] = this.handleNetworkCodeAndParams(params);
|
|
5280
5285
|
const networkId = this.networkCodeToId(networkCode);
|
|
@@ -5312,22 +5317,22 @@ class bybit extends bybit$1 {
|
|
|
5312
5317
|
const addressObject = this.safeDict(chainsIndexedById, selectedNetworkId, {});
|
|
5313
5318
|
return this.parseDepositAddress(addressObject, currency);
|
|
5314
5319
|
}
|
|
5320
|
+
/**
|
|
5321
|
+
* @method
|
|
5322
|
+
* @name bybit#fetchDeposits
|
|
5323
|
+
* @description fetch all deposits made to an account
|
|
5324
|
+
* @see https://bybit-exchange.github.io/docs/v5/asset/deposit-record
|
|
5325
|
+
* @param {string} code unified currency code
|
|
5326
|
+
* @param {int} [since] the earliest time in ms to fetch deposits for, default = 30 days before the current time
|
|
5327
|
+
* @param {int} [limit] the maximum number of deposits structures to retrieve, default = 50, max = 50
|
|
5328
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5329
|
+
* @param {int} [params.until] the latest time in ms to fetch deposits for, default = 30 days after since
|
|
5330
|
+
* EXCHANGE SPECIFIC PARAMETERS
|
|
5331
|
+
* @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)
|
|
5332
|
+
* @param {string} [params.cursor] used for pagination
|
|
5333
|
+
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
5334
|
+
*/
|
|
5315
5335
|
async fetchDeposits(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
5316
|
-
/**
|
|
5317
|
-
* @method
|
|
5318
|
-
* @name bybit#fetchDeposits
|
|
5319
|
-
* @description fetch all deposits made to an account
|
|
5320
|
-
* @see https://bybit-exchange.github.io/docs/v5/asset/deposit-record
|
|
5321
|
-
* @param {string} code unified currency code
|
|
5322
|
-
* @param {int} [since] the earliest time in ms to fetch deposits for, default = 30 days before the current time
|
|
5323
|
-
* @param {int} [limit] the maximum number of deposits structures to retrieve, default = 50, max = 50
|
|
5324
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5325
|
-
* @param {int} [params.until] the latest time in ms to fetch deposits for, default = 30 days after since
|
|
5326
|
-
* EXCHANGE SPECIFIC PARAMETERS
|
|
5327
|
-
* @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)
|
|
5328
|
-
* @param {string} [params.cursor] used for pagination
|
|
5329
|
-
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
5330
|
-
*/
|
|
5331
5336
|
await this.loadMarkets();
|
|
5332
5337
|
let paginate = false;
|
|
5333
5338
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchDeposits', 'paginate');
|
|
@@ -5382,20 +5387,20 @@ class bybit extends bybit$1 {
|
|
|
5382
5387
|
const data = this.addPaginationCursorToResult(response);
|
|
5383
5388
|
return this.parseTransactions(data, currency, since, limit);
|
|
5384
5389
|
}
|
|
5390
|
+
/**
|
|
5391
|
+
* @method
|
|
5392
|
+
* @name bybit#fetchWithdrawals
|
|
5393
|
+
* @description fetch all withdrawals made from an account
|
|
5394
|
+
* @see https://bybit-exchange.github.io/docs/v5/asset/withdraw-record
|
|
5395
|
+
* @param {string} code unified currency code
|
|
5396
|
+
* @param {int} [since] the earliest time in ms to fetch withdrawals for
|
|
5397
|
+
* @param {int} [limit] the maximum number of withdrawals structures to retrieve
|
|
5398
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5399
|
+
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
5400
|
+
* @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)
|
|
5401
|
+
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
5402
|
+
*/
|
|
5385
5403
|
async fetchWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
5386
|
-
/**
|
|
5387
|
-
* @method
|
|
5388
|
-
* @name bybit#fetchWithdrawals
|
|
5389
|
-
* @description fetch all withdrawals made from an account
|
|
5390
|
-
* @see https://bybit-exchange.github.io/docs/v5/asset/withdraw-record
|
|
5391
|
-
* @param {string} code unified currency code
|
|
5392
|
-
* @param {int} [since] the earliest time in ms to fetch withdrawals for
|
|
5393
|
-
* @param {int} [limit] the maximum number of withdrawals structures to retrieve
|
|
5394
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5395
|
-
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
5396
|
-
* @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)
|
|
5397
|
-
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
5398
|
-
*/
|
|
5399
5404
|
await this.loadMarkets();
|
|
5400
5405
|
let paginate = false;
|
|
5401
5406
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchWithdrawals', 'paginate');
|
|
@@ -5562,21 +5567,21 @@ class bybit extends bybit$1 {
|
|
|
5562
5567
|
'comment': undefined,
|
|
5563
5568
|
};
|
|
5564
5569
|
}
|
|
5570
|
+
/**
|
|
5571
|
+
* @method
|
|
5572
|
+
* @name bybit#fetchLedger
|
|
5573
|
+
* @description fetch the history of changes, actions done by the user or operations that altered the balance of the user
|
|
5574
|
+
* @see https://bybit-exchange.github.io/docs/v5/account/transaction-log
|
|
5575
|
+
* @see https://bybit-exchange.github.io/docs/v5/account/contract-transaction-log
|
|
5576
|
+
* @param {string} [code] unified currency code, default is undefined
|
|
5577
|
+
* @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
|
|
5578
|
+
* @param {int} [limit] max number of ledger entries to return, default is undefined
|
|
5579
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5580
|
+
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
5581
|
+
* @param {string} [params.subType] if inverse will use v5/account/contract-transaction-log
|
|
5582
|
+
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
|
|
5583
|
+
*/
|
|
5565
5584
|
async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
5566
|
-
/**
|
|
5567
|
-
* @method
|
|
5568
|
-
* @name bybit#fetchLedger
|
|
5569
|
-
* @description fetch the history of changes, actions done by the user or operations that altered the balance of the user
|
|
5570
|
-
* @see https://bybit-exchange.github.io/docs/v5/account/transaction-log
|
|
5571
|
-
* @see https://bybit-exchange.github.io/docs/v5/account/contract-transaction-log
|
|
5572
|
-
* @param {string} [code] unified currency code, default is undefined
|
|
5573
|
-
* @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
|
|
5574
|
-
* @param {int} [limit] max number of ledger entries to return, default is undefined
|
|
5575
|
-
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
5576
|
-
* @param {string} [params.subType] if inverse will use v5/account/contract-transaction-log
|
|
5577
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5578
|
-
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
|
|
5579
|
-
*/
|
|
5580
5585
|
await this.loadMarkets();
|
|
5581
5586
|
let paginate = false;
|
|
5582
5587
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchLedger', 'paginate');
|
|
@@ -5845,19 +5850,19 @@ class bybit extends bybit$1 {
|
|
|
5845
5850
|
};
|
|
5846
5851
|
return this.safeString(types, type, type);
|
|
5847
5852
|
}
|
|
5853
|
+
/**
|
|
5854
|
+
* @method
|
|
5855
|
+
* @name bybit#withdraw
|
|
5856
|
+
* @description make a withdrawal
|
|
5857
|
+
* @see https://bybit-exchange.github.io/docs/v5/asset/withdraw
|
|
5858
|
+
* @param {string} code unified currency code
|
|
5859
|
+
* @param {float} amount the amount to withdraw
|
|
5860
|
+
* @param {string} address the address to withdraw to
|
|
5861
|
+
* @param {string} tag
|
|
5862
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5863
|
+
* @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
5864
|
+
*/
|
|
5848
5865
|
async withdraw(code, amount, address, tag = undefined, params = {}) {
|
|
5849
|
-
/**
|
|
5850
|
-
* @method
|
|
5851
|
-
* @name bybit#withdraw
|
|
5852
|
-
* @description make a withdrawal
|
|
5853
|
-
* @see https://bybit-exchange.github.io/docs/v5/asset/withdraw
|
|
5854
|
-
* @param {string} code unified currency code
|
|
5855
|
-
* @param {float} amount the amount to withdraw
|
|
5856
|
-
* @param {string} address the address to withdraw to
|
|
5857
|
-
* @param {string} tag
|
|
5858
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5859
|
-
* @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
5860
|
-
*/
|
|
5861
5866
|
[tag, params] = this.handleWithdrawTagAndParams(tag, params);
|
|
5862
5867
|
let accountType = undefined;
|
|
5863
5868
|
[accountType, params] = this.handleOptionAndParams(params, 'withdraw', 'accountType', 'SPOT');
|
|
@@ -5894,16 +5899,16 @@ class bybit extends bybit$1 {
|
|
|
5894
5899
|
const result = this.safeDict(response, 'result', {});
|
|
5895
5900
|
return this.parseTransaction(result, currency);
|
|
5896
5901
|
}
|
|
5902
|
+
/**
|
|
5903
|
+
* @method
|
|
5904
|
+
* @name bybit#fetchPosition
|
|
5905
|
+
* @description fetch data on a single open contract trade position
|
|
5906
|
+
* @see https://bybit-exchange.github.io/docs/v5/position
|
|
5907
|
+
* @param {string} symbol unified market symbol of the market the position is held in, default is undefined
|
|
5908
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5909
|
+
* @returns {object} a [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
5910
|
+
*/
|
|
5897
5911
|
async fetchPosition(symbol, params = {}) {
|
|
5898
|
-
/**
|
|
5899
|
-
* @method
|
|
5900
|
-
* @name bybit#fetchPosition
|
|
5901
|
-
* @description fetch data on a single open contract trade position
|
|
5902
|
-
* @see https://bybit-exchange.github.io/docs/v5/position
|
|
5903
|
-
* @param {string} symbol unified market symbol of the market the position is held in, default is undefined
|
|
5904
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5905
|
-
* @returns {object} a [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
5906
|
-
*/
|
|
5907
5912
|
if (symbol === undefined) {
|
|
5908
5913
|
throw new errors.ArgumentsRequired(this.id + ' fetchPosition() requires a symbol argument');
|
|
5909
5914
|
}
|
|
@@ -5966,20 +5971,20 @@ class bybit extends bybit$1 {
|
|
|
5966
5971
|
position['datetime'] = this.iso8601(timestamp);
|
|
5967
5972
|
return position;
|
|
5968
5973
|
}
|
|
5974
|
+
/**
|
|
5975
|
+
* @method
|
|
5976
|
+
* @name bybit#fetchPositions
|
|
5977
|
+
* @description fetch all open positions
|
|
5978
|
+
* @see https://bybit-exchange.github.io/docs/v5/position
|
|
5979
|
+
* @param {string[]} symbols list of unified market symbols
|
|
5980
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5981
|
+
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
5982
|
+
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
5983
|
+
* @param {string} [params.baseCoin] Base coin. Supports linear, inverse & option
|
|
5984
|
+
* @param {string} [params.settleCoin] Settle coin. Supports linear, inverse & option
|
|
5985
|
+
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
5986
|
+
*/
|
|
5969
5987
|
async fetchPositions(symbols = undefined, params = {}) {
|
|
5970
|
-
/**
|
|
5971
|
-
* @method
|
|
5972
|
-
* @name bybit#fetchPositions
|
|
5973
|
-
* @description fetch all open positions
|
|
5974
|
-
* @see https://bybit-exchange.github.io/docs/v5/position
|
|
5975
|
-
* @param {string[]} symbols list of unified market symbols
|
|
5976
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5977
|
-
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
5978
|
-
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
5979
|
-
* @param {string} [params.baseCoin] Base coin. Supports linear, inverse & option
|
|
5980
|
-
* @param {string} [params.settleCoin] Settle coin. Supports linear, inverse & option
|
|
5981
|
-
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
5982
|
-
*/
|
|
5983
5988
|
await this.loadMarkets();
|
|
5984
5989
|
let symbol = undefined;
|
|
5985
5990
|
if ((symbols !== undefined) && Array.isArray(symbols)) {
|
|
@@ -6315,16 +6320,16 @@ class bybit extends bybit$1 {
|
|
|
6315
6320
|
'hedged': hedged,
|
|
6316
6321
|
});
|
|
6317
6322
|
}
|
|
6323
|
+
/**
|
|
6324
|
+
* @method
|
|
6325
|
+
* @name bybit#fetchLeverage
|
|
6326
|
+
* @description fetch the set leverage for a market
|
|
6327
|
+
* @see https://bybit-exchange.github.io/docs/v5/position
|
|
6328
|
+
* @param {string} symbol unified market symbol
|
|
6329
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6330
|
+
* @returns {object} a [leverage structure]{@link https://docs.ccxt.com/#/?id=leverage-structure}
|
|
6331
|
+
*/
|
|
6318
6332
|
async fetchLeverage(symbol, params = {}) {
|
|
6319
|
-
/**
|
|
6320
|
-
* @method
|
|
6321
|
-
* @name bybit#fetchLeverage
|
|
6322
|
-
* @description fetch the set leverage for a market
|
|
6323
|
-
* @see https://bybit-exchange.github.io/docs/v5/position
|
|
6324
|
-
* @param {string} symbol unified market symbol
|
|
6325
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6326
|
-
* @returns {object} a [leverage structure]{@link https://docs.ccxt.com/#/?id=leverage-structure}
|
|
6327
|
-
*/
|
|
6328
6333
|
await this.loadMarkets();
|
|
6329
6334
|
const market = this.market(symbol);
|
|
6330
6335
|
const position = await this.fetchPosition(symbol, params);
|
|
@@ -6341,19 +6346,19 @@ class bybit extends bybit$1 {
|
|
|
6341
6346
|
'shortLeverage': leverageValue,
|
|
6342
6347
|
};
|
|
6343
6348
|
}
|
|
6349
|
+
/**
|
|
6350
|
+
* @method
|
|
6351
|
+
* @name bybit#setMarginMode
|
|
6352
|
+
* @description set margin mode (account) or trade mode (symbol)
|
|
6353
|
+
* @see https://bybit-exchange.github.io/docs/v5/account/set-margin-mode
|
|
6354
|
+
* @see https://bybit-exchange.github.io/docs/v5/position/cross-isolate
|
|
6355
|
+
* @param {string} marginMode account mode must be either [isolated, cross, portfolio], trade mode must be either [isolated, cross]
|
|
6356
|
+
* @param {string} symbol unified market symbol of the market the position is held in, default is undefined
|
|
6357
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6358
|
+
* @param {string} [params.leverage] the rate of leverage, is required if setting trade mode (symbol)
|
|
6359
|
+
* @returns {object} response from the exchange
|
|
6360
|
+
*/
|
|
6344
6361
|
async setMarginMode(marginMode, symbol = undefined, params = {}) {
|
|
6345
|
-
/**
|
|
6346
|
-
* @method
|
|
6347
|
-
* @name bybit#setMarginMode
|
|
6348
|
-
* @description set margin mode (account) or trade mode (symbol)
|
|
6349
|
-
* @see https://bybit-exchange.github.io/docs/v5/account/set-margin-mode
|
|
6350
|
-
* @see https://bybit-exchange.github.io/docs/v5/position/cross-isolate
|
|
6351
|
-
* @param {string} marginMode account mode must be either [isolated, cross, portfolio], trade mode must be either [isolated, cross]
|
|
6352
|
-
* @param {string} symbol unified market symbol of the market the position is held in, default is undefined
|
|
6353
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6354
|
-
* @param {string} [params.leverage] the rate of leverage, is required if setting trade mode (symbol)
|
|
6355
|
-
* @returns {object} response from the exchange
|
|
6356
|
-
*/
|
|
6357
6362
|
await this.loadMarkets();
|
|
6358
6363
|
const [enableUnifiedMargin, enableUnifiedAccount] = await this.isUnifiedEnabled();
|
|
6359
6364
|
const isUnifiedAccount = (enableUnifiedMargin || enableUnifiedAccount);
|
|
@@ -6445,19 +6450,19 @@ class bybit extends bybit$1 {
|
|
|
6445
6450
|
}
|
|
6446
6451
|
return response;
|
|
6447
6452
|
}
|
|
6453
|
+
/**
|
|
6454
|
+
* @method
|
|
6455
|
+
* @name bybit#setLeverage
|
|
6456
|
+
* @description set the level of leverage for a market
|
|
6457
|
+
* @see https://bybit-exchange.github.io/docs/v5/position/leverage
|
|
6458
|
+
* @param {float} leverage the rate of leverage
|
|
6459
|
+
* @param {string} symbol unified market symbol
|
|
6460
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6461
|
+
* @param {string} [params.buyLeverage] leverage for buy side
|
|
6462
|
+
* @param {string} [params.sellLeverage] leverage for sell side
|
|
6463
|
+
* @returns {object} response from the exchange
|
|
6464
|
+
*/
|
|
6448
6465
|
async setLeverage(leverage, symbol = undefined, params = {}) {
|
|
6449
|
-
/**
|
|
6450
|
-
* @method
|
|
6451
|
-
* @name bybit#setLeverage
|
|
6452
|
-
* @description set the level of leverage for a market
|
|
6453
|
-
* @see https://bybit-exchange.github.io/docs/v5/position/leverage
|
|
6454
|
-
* @param {float} leverage the rate of leverage
|
|
6455
|
-
* @param {string} symbol unified market symbol
|
|
6456
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6457
|
-
* @param {string} [params.buyLeverage] leverage for buy side
|
|
6458
|
-
* @param {string} [params.sellLeverage] leverage for sell side
|
|
6459
|
-
* @returns {object} response from the exchange
|
|
6460
|
-
*/
|
|
6461
6466
|
if (symbol === undefined) {
|
|
6462
6467
|
throw new errors.ArgumentsRequired(this.id + ' setLeverage() requires a symbol argument');
|
|
6463
6468
|
}
|
|
@@ -6487,17 +6492,17 @@ class bybit extends bybit$1 {
|
|
|
6487
6492
|
const response = await this.privatePostV5PositionSetLeverage(this.extend(request, params));
|
|
6488
6493
|
return response;
|
|
6489
6494
|
}
|
|
6495
|
+
/**
|
|
6496
|
+
* @method
|
|
6497
|
+
* @name bybit#setPositionMode
|
|
6498
|
+
* @description set hedged to true or false for a market
|
|
6499
|
+
* @see https://bybit-exchange.github.io/docs/v5/position/position-mode
|
|
6500
|
+
* @param {bool} hedged
|
|
6501
|
+
* @param {string} symbol used for unified account with inverse market
|
|
6502
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6503
|
+
* @returns {object} response from the exchange
|
|
6504
|
+
*/
|
|
6490
6505
|
async setPositionMode(hedged, symbol = undefined, params = {}) {
|
|
6491
|
-
/**
|
|
6492
|
-
* @method
|
|
6493
|
-
* @name bybit#setPositionMode
|
|
6494
|
-
* @description set hedged to true or false for a market
|
|
6495
|
-
* @see https://bybit-exchange.github.io/docs/v5/position/position-mode
|
|
6496
|
-
* @param {bool} hedged
|
|
6497
|
-
* @param {string} symbol used for unified account with inverse market
|
|
6498
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6499
|
-
* @returns {object} response from the exchange
|
|
6500
|
-
*/
|
|
6501
6506
|
await this.loadMarkets();
|
|
6502
6507
|
let market = undefined;
|
|
6503
6508
|
if (symbol !== undefined) {
|
|
@@ -6596,18 +6601,18 @@ class bybit extends bybit$1 {
|
|
|
6596
6601
|
market = this.safeMarket(id, market, undefined, 'contract');
|
|
6597
6602
|
return this.parseOpenInterests(data, market, since, limit);
|
|
6598
6603
|
}
|
|
6604
|
+
/**
|
|
6605
|
+
* @method
|
|
6606
|
+
* @name bybit#fetchOpenInterest
|
|
6607
|
+
* @description Retrieves the open interest of a derivative trading pair
|
|
6608
|
+
* @see https://bybit-exchange.github.io/docs/v5/market/open-interest
|
|
6609
|
+
* @param {string} symbol Unified CCXT market symbol
|
|
6610
|
+
* @param {object} [params] exchange specific parameters
|
|
6611
|
+
* @param {string} [params.interval] 5m, 15m, 30m, 1h, 4h, 1d
|
|
6612
|
+
* @param {string} [params.category] "linear" or "inverse"
|
|
6613
|
+
* @returns {object} an open interest structure{@link https://docs.ccxt.com/#/?id=open-interest-structure}
|
|
6614
|
+
*/
|
|
6599
6615
|
async fetchOpenInterest(symbol, params = {}) {
|
|
6600
|
-
/**
|
|
6601
|
-
* @method
|
|
6602
|
-
* @name bybit#fetchOpenInterest
|
|
6603
|
-
* @description Retrieves the open interest of a derivative trading pair
|
|
6604
|
-
* @see https://bybit-exchange.github.io/docs/v5/market/open-interest
|
|
6605
|
-
* @param {string} symbol Unified CCXT market symbol
|
|
6606
|
-
* @param {object} [params] exchange specific parameters
|
|
6607
|
-
* @param {string} [params.interval] 5m, 15m, 30m, 1h, 4h, 1d
|
|
6608
|
-
* @param {string} [params.category] "linear" or "inverse"
|
|
6609
|
-
* @returns {object} an open interest structure{@link https://docs.ccxt.com/#/?id=open-interest-structure}
|
|
6610
|
-
*/
|
|
6611
6616
|
await this.loadMarkets();
|
|
6612
6617
|
let market = this.market(symbol);
|
|
6613
6618
|
if (!market['contract']) {
|
|
@@ -6656,20 +6661,20 @@ class bybit extends bybit$1 {
|
|
|
6656
6661
|
const data = this.addPaginationCursorToResult(response);
|
|
6657
6662
|
return this.parseOpenInterest(data[0], market);
|
|
6658
6663
|
}
|
|
6664
|
+
/**
|
|
6665
|
+
* @method
|
|
6666
|
+
* @name bybit#fetchOpenInterestHistory
|
|
6667
|
+
* @description Gets the total amount of unsettled contracts. In other words, the total number of contracts held in open positions
|
|
6668
|
+
* @see https://bybit-exchange.github.io/docs/v5/market/open-interest
|
|
6669
|
+
* @param {string} symbol Unified market symbol
|
|
6670
|
+
* @param {string} timeframe "5m", 15m, 30m, 1h, 4h, 1d
|
|
6671
|
+
* @param {int} [since] Not used by Bybit
|
|
6672
|
+
* @param {int} [limit] The number of open interest structures to return. Max 200, default 50
|
|
6673
|
+
* @param {object} [params] Exchange specific parameters
|
|
6674
|
+
* @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)
|
|
6675
|
+
* @returns An array of open interest structures
|
|
6676
|
+
*/
|
|
6659
6677
|
async fetchOpenInterestHistory(symbol, timeframe = '1h', since = undefined, limit = undefined, params = {}) {
|
|
6660
|
-
/**
|
|
6661
|
-
* @method
|
|
6662
|
-
* @name bybit#fetchOpenInterestHistory
|
|
6663
|
-
* @description Gets the total amount of unsettled contracts. In other words, the total number of contracts held in open positions
|
|
6664
|
-
* @see https://bybit-exchange.github.io/docs/v5/market/open-interest
|
|
6665
|
-
* @param {string} symbol Unified market symbol
|
|
6666
|
-
* @param {string} timeframe "5m", 15m, 30m, 1h, 4h, 1d
|
|
6667
|
-
* @param {int} [since] Not used by Bybit
|
|
6668
|
-
* @param {int} [limit] The number of open interest structures to return. Max 200, default 50
|
|
6669
|
-
* @param {object} [params] Exchange specific parameters
|
|
6670
|
-
* @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)
|
|
6671
|
-
* @returns An array of open interest structures
|
|
6672
|
-
*/
|
|
6673
6678
|
if (timeframe === '1m') {
|
|
6674
6679
|
throw new errors.BadRequest(this.id + 'fetchOpenInterestHistory cannot use the 1m timeframe');
|
|
6675
6680
|
}
|
|
@@ -6707,16 +6712,16 @@ class bybit extends bybit$1 {
|
|
|
6707
6712
|
'info': interest,
|
|
6708
6713
|
}, market);
|
|
6709
6714
|
}
|
|
6715
|
+
/**
|
|
6716
|
+
* @method
|
|
6717
|
+
* @name bybit#fetchCrossBorrowRate
|
|
6718
|
+
* @description fetch the rate of interest to borrow a currency for margin trading
|
|
6719
|
+
* @see https://bybit-exchange.github.io/docs/zh-TW/v5/spot-margin-normal/interest-quota
|
|
6720
|
+
* @param {string} code unified currency code
|
|
6721
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6722
|
+
* @returns {object} a [borrow rate structure]{@link https://docs.ccxt.com/#/?id=borrow-rate-structure}
|
|
6723
|
+
*/
|
|
6710
6724
|
async fetchCrossBorrowRate(code, params = {}) {
|
|
6711
|
-
/**
|
|
6712
|
-
* @method
|
|
6713
|
-
* @name bybit#fetchCrossBorrowRate
|
|
6714
|
-
* @description fetch the rate of interest to borrow a currency for margin trading
|
|
6715
|
-
* @see https://bybit-exchange.github.io/docs/zh-TW/v5/spot-margin-normal/interest-quota
|
|
6716
|
-
* @param {string} code unified currency code
|
|
6717
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6718
|
-
* @returns {object} a [borrow rate structure]{@link https://docs.ccxt.com/#/?id=borrow-rate-structure}
|
|
6719
|
-
*/
|
|
6720
6725
|
await this.loadMarkets();
|
|
6721
6726
|
const currency = this.currency(code);
|
|
6722
6727
|
const request = {
|
|
@@ -6773,19 +6778,19 @@ class bybit extends bybit$1 {
|
|
|
6773
6778
|
'info': info,
|
|
6774
6779
|
};
|
|
6775
6780
|
}
|
|
6781
|
+
/**
|
|
6782
|
+
* @method
|
|
6783
|
+
* @name bybit#fetchBorrowInterest
|
|
6784
|
+
* @description fetch the interest owed by the user for borrowing currency for margin trading
|
|
6785
|
+
* @see https://bybit-exchange.github.io/docs/zh-TW/v5/spot-margin-normal/account-info
|
|
6786
|
+
* @param {string} code unified currency code
|
|
6787
|
+
* @param {string} symbol unified market symbol when fetch interest in isolated markets
|
|
6788
|
+
* @param {number} [since] the earliest time in ms to fetch borrrow interest for
|
|
6789
|
+
* @param {number} [limit] the maximum number of structures to retrieve
|
|
6790
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6791
|
+
* @returns {object[]} a list of [borrow interest structures]{@link https://docs.ccxt.com/#/?id=borrow-interest-structure}
|
|
6792
|
+
*/
|
|
6776
6793
|
async fetchBorrowInterest(code = undefined, symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
6777
|
-
/**
|
|
6778
|
-
* @method
|
|
6779
|
-
* @name bybit#fetchBorrowInterest
|
|
6780
|
-
* @description fetch the interest owed by the user for borrowing currency for margin trading
|
|
6781
|
-
* @see https://bybit-exchange.github.io/docs/zh-TW/v5/spot-margin-normal/account-info
|
|
6782
|
-
* @param {string} code unified currency code
|
|
6783
|
-
* @param {string} symbol unified market symbol when fetch interest in isolated markets
|
|
6784
|
-
* @param {number} [since] the earliest time in ms to fetch borrrow interest for
|
|
6785
|
-
* @param {number} [limit] the maximum number of structures to retrieve
|
|
6786
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6787
|
-
* @returns {object[]} a list of [borrow interest structures]{@link https://docs.ccxt.com/#/?id=borrow-interest-structure}
|
|
6788
|
-
*/
|
|
6789
6794
|
await this.loadMarkets();
|
|
6790
6795
|
const request = {};
|
|
6791
6796
|
const response = await this.privateGetV5SpotCrossMarginTradeAccount(this.extend(request, params));
|
|
@@ -6819,19 +6824,19 @@ class bybit extends bybit$1 {
|
|
|
6819
6824
|
const interest = this.parseBorrowInterests(rows, undefined);
|
|
6820
6825
|
return this.filterByCurrencySinceLimit(interest, code, since, limit);
|
|
6821
6826
|
}
|
|
6827
|
+
/**
|
|
6828
|
+
* @method
|
|
6829
|
+
* @name bybit#fetchBorrowRateHistory
|
|
6830
|
+
* @description retrieves a history of a currencies borrow interest rate at specific time slots
|
|
6831
|
+
* @see https://bybit-exchange.github.io/docs/v5/spot-margin-uta/historical-interest
|
|
6832
|
+
* @param {string} code unified currency code
|
|
6833
|
+
* @param {int} [since] timestamp for the earliest borrow rate
|
|
6834
|
+
* @param {int} [limit] the maximum number of [borrow rate structures]{@link https://docs.ccxt.com/#/?id=borrow-rate-structure} to retrieve
|
|
6835
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6836
|
+
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
6837
|
+
* @returns {object[]} an array of [borrow rate structures]{@link https://docs.ccxt.com/#/?id=borrow-rate-structure}
|
|
6838
|
+
*/
|
|
6822
6839
|
async fetchBorrowRateHistory(code, since = undefined, limit = undefined, params = {}) {
|
|
6823
|
-
/**
|
|
6824
|
-
* @method
|
|
6825
|
-
* @name bybit#fetchBorrowRateHistory
|
|
6826
|
-
* @description retrieves a history of a currencies borrow interest rate at specific time slots
|
|
6827
|
-
* @see https://bybit-exchange.github.io/docs/v5/spot-margin-uta/historical-interest
|
|
6828
|
-
* @param {string} code unified currency code
|
|
6829
|
-
* @param {int} [since] timestamp for the earliest borrow rate
|
|
6830
|
-
* @param {int} [limit] the maximum number of [borrow rate structures]{@link https://docs.ccxt.com/#/?id=borrow-rate-structure} to retrieve
|
|
6831
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6832
|
-
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
6833
|
-
* @returns {object[]} an array of [borrow rate structures]{@link https://docs.ccxt.com/#/?id=borrow-rate-structure}
|
|
6834
|
-
*/
|
|
6835
6840
|
await this.loadMarkets();
|
|
6836
6841
|
const currency = this.currency(code);
|
|
6837
6842
|
const request = {
|
|
@@ -6893,20 +6898,20 @@ class bybit extends bybit$1 {
|
|
|
6893
6898
|
'datetime': undefined,
|
|
6894
6899
|
};
|
|
6895
6900
|
}
|
|
6901
|
+
/**
|
|
6902
|
+
* @method
|
|
6903
|
+
* @name bybit#transfer
|
|
6904
|
+
* @description transfer currency internally between wallets on the same account
|
|
6905
|
+
* @see https://bybit-exchange.github.io/docs/v5/asset/create-inter-transfer
|
|
6906
|
+
* @param {string} code unified currency code
|
|
6907
|
+
* @param {float} amount amount to transfer
|
|
6908
|
+
* @param {string} fromAccount account to transfer from
|
|
6909
|
+
* @param {string} toAccount account to transfer to
|
|
6910
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6911
|
+
* @param {string} [params.transferId] UUID, which is unique across the platform
|
|
6912
|
+
* @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
6913
|
+
*/
|
|
6896
6914
|
async transfer(code, amount, fromAccount, toAccount, params = {}) {
|
|
6897
|
-
/**
|
|
6898
|
-
* @method
|
|
6899
|
-
* @name bybit#transfer
|
|
6900
|
-
* @description transfer currency internally between wallets on the same account
|
|
6901
|
-
* @see https://bybit-exchange.github.io/docs/v5/asset/create-inter-transfer
|
|
6902
|
-
* @param {string} code unified currency code
|
|
6903
|
-
* @param {float} amount amount to transfer
|
|
6904
|
-
* @param {string} fromAccount account to transfer from
|
|
6905
|
-
* @param {string} toAccount account to transfer to
|
|
6906
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6907
|
-
* @param {string} [params.transferId] UUID, which is unique across the platform
|
|
6908
|
-
* @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
6909
|
-
*/
|
|
6910
6915
|
await this.loadMarkets();
|
|
6911
6916
|
const transferId = this.safeString(params, 'transferId', this.uuid());
|
|
6912
6917
|
const accountTypes = this.safeDict(this.options, 'accountsByType', {});
|
|
@@ -6946,20 +6951,20 @@ class bybit extends bybit$1 {
|
|
|
6946
6951
|
'status': status,
|
|
6947
6952
|
});
|
|
6948
6953
|
}
|
|
6954
|
+
/**
|
|
6955
|
+
* @method
|
|
6956
|
+
* @name bybit#fetchTransfers
|
|
6957
|
+
* @description fetch a history of internal transfers made on an account
|
|
6958
|
+
* @see https://bybit-exchange.github.io/docs/v5/asset/inter-transfer-list
|
|
6959
|
+
* @param {string} code unified currency code of the currency transferred
|
|
6960
|
+
* @param {int} [since] the earliest time in ms to fetch transfers for
|
|
6961
|
+
* @param {int} [limit] the maximum number of transfer structures to retrieve
|
|
6962
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6963
|
+
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
6964
|
+
* @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)
|
|
6965
|
+
* @returns {object[]} a list of [transfer structures]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
6966
|
+
*/
|
|
6949
6967
|
async fetchTransfers(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
6950
|
-
/**
|
|
6951
|
-
* @method
|
|
6952
|
-
* @name bybit#fetchTransfers
|
|
6953
|
-
* @description fetch a history of internal transfers made on an account
|
|
6954
|
-
* @see https://bybit-exchange.github.io/docs/v5/asset/inter-transfer-list
|
|
6955
|
-
* @param {string} code unified currency code of the currency transferred
|
|
6956
|
-
* @param {int} [since] the earliest time in ms to fetch transfers for
|
|
6957
|
-
* @param {int} [limit] the maximum number of transfer structures to retrieve
|
|
6958
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6959
|
-
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
6960
|
-
* @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)
|
|
6961
|
-
* @returns {object[]} a list of [transfer structures]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
6962
|
-
*/
|
|
6963
6968
|
await this.loadMarkets();
|
|
6964
6969
|
let paginate = false;
|
|
6965
6970
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchTransfers', 'paginate');
|
|
@@ -7005,17 +7010,17 @@ class bybit extends bybit$1 {
|
|
|
7005
7010
|
const data = this.addPaginationCursorToResult(response);
|
|
7006
7011
|
return this.parseTransfers(data, currency, since, limit);
|
|
7007
7012
|
}
|
|
7013
|
+
/**
|
|
7014
|
+
* @method
|
|
7015
|
+
* @name bybit#borrowCrossMargin
|
|
7016
|
+
* @description create a loan to borrow margin
|
|
7017
|
+
* @see https://bybit-exchange.github.io/docs/v5/spot-margin-normal/borrow
|
|
7018
|
+
* @param {string} code unified currency code of the currency to borrow
|
|
7019
|
+
* @param {float} amount the amount to borrow
|
|
7020
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7021
|
+
* @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
|
|
7022
|
+
*/
|
|
7008
7023
|
async borrowCrossMargin(code, amount, params = {}) {
|
|
7009
|
-
/**
|
|
7010
|
-
* @method
|
|
7011
|
-
* @name bybit#borrowCrossMargin
|
|
7012
|
-
* @description create a loan to borrow margin
|
|
7013
|
-
* @see https://bybit-exchange.github.io/docs/v5/spot-margin-normal/borrow
|
|
7014
|
-
* @param {string} code unified currency code of the currency to borrow
|
|
7015
|
-
* @param {float} amount the amount to borrow
|
|
7016
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7017
|
-
* @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
|
|
7018
|
-
*/
|
|
7019
7024
|
await this.loadMarkets();
|
|
7020
7025
|
const currency = this.currency(code);
|
|
7021
7026
|
const request = {
|
|
@@ -7041,17 +7046,17 @@ class bybit extends bybit$1 {
|
|
|
7041
7046
|
'amount': amount,
|
|
7042
7047
|
});
|
|
7043
7048
|
}
|
|
7049
|
+
/**
|
|
7050
|
+
* @method
|
|
7051
|
+
* @name bybit#repayCrossMargin
|
|
7052
|
+
* @description repay borrowed margin and interest
|
|
7053
|
+
* @see https://bybit-exchange.github.io/docs/v5/spot-margin-normal/repay
|
|
7054
|
+
* @param {string} code unified currency code of the currency to repay
|
|
7055
|
+
* @param {float} amount the amount to repay
|
|
7056
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7057
|
+
* @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
|
|
7058
|
+
*/
|
|
7044
7059
|
async repayCrossMargin(code, amount, params = {}) {
|
|
7045
|
-
/**
|
|
7046
|
-
* @method
|
|
7047
|
-
* @name bybit#repayCrossMargin
|
|
7048
|
-
* @description repay borrowed margin and interest
|
|
7049
|
-
* @see https://bybit-exchange.github.io/docs/v5/spot-margin-normal/repay
|
|
7050
|
-
* @param {string} code unified currency code of the currency to repay
|
|
7051
|
-
* @param {float} amount the amount to repay
|
|
7052
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7053
|
-
* @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
|
|
7054
|
-
*/
|
|
7055
7060
|
await this.loadMarkets();
|
|
7056
7061
|
const currency = this.currency(code);
|
|
7057
7062
|
const request = {
|
|
@@ -7188,16 +7193,16 @@ class bybit extends bybit$1 {
|
|
|
7188
7193
|
const tiers = this.safeList(result, 'list');
|
|
7189
7194
|
return this.parseMarketLeverageTiers(tiers, market);
|
|
7190
7195
|
}
|
|
7196
|
+
/**
|
|
7197
|
+
* @method
|
|
7198
|
+
* @name bybit#fetchMarketLeverageTiers
|
|
7199
|
+
* @description retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes for a single market
|
|
7200
|
+
* @see https://bybit-exchange.github.io/docs/v5/market/risk-limit
|
|
7201
|
+
* @param {string} symbol unified market symbol
|
|
7202
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7203
|
+
* @returns {object} a [leverage tiers structure]{@link https://docs.ccxt.com/#/?id=leverage-tiers-structure}
|
|
7204
|
+
*/
|
|
7191
7205
|
async fetchMarketLeverageTiers(symbol, params = {}) {
|
|
7192
|
-
/**
|
|
7193
|
-
* @method
|
|
7194
|
-
* @name bybit#fetchMarketLeverageTiers
|
|
7195
|
-
* @description retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes for a single market
|
|
7196
|
-
* @see https://bybit-exchange.github.io/docs/v5/market/risk-limit
|
|
7197
|
-
* @param {string} symbol unified market symbol
|
|
7198
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7199
|
-
* @returns {object} a [leverage tiers structure]{@link https://docs.ccxt.com/#/?id=leverage-tiers-structure}
|
|
7200
|
-
*/
|
|
7201
7206
|
await this.loadMarkets();
|
|
7202
7207
|
let market = undefined;
|
|
7203
7208
|
market = this.market(symbol);
|
|
@@ -7227,16 +7232,16 @@ class bybit extends bybit$1 {
|
|
|
7227
7232
|
'tierBased': undefined,
|
|
7228
7233
|
};
|
|
7229
7234
|
}
|
|
7235
|
+
/**
|
|
7236
|
+
* @method
|
|
7237
|
+
* @name bybit#fetchTradingFee
|
|
7238
|
+
* @description fetch the trading fees for a market
|
|
7239
|
+
* @see https://bybit-exchange.github.io/docs/v5/account/fee-rate
|
|
7240
|
+
* @param {string} symbol unified market symbol
|
|
7241
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7242
|
+
* @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
7243
|
+
*/
|
|
7230
7244
|
async fetchTradingFee(symbol, params = {}) {
|
|
7231
|
-
/**
|
|
7232
|
-
* @method
|
|
7233
|
-
* @name bybit#fetchTradingFee
|
|
7234
|
-
* @description fetch the trading fees for a market
|
|
7235
|
-
* @see https://bybit-exchange.github.io/docs/v5/account/fee-rate
|
|
7236
|
-
* @param {string} symbol unified market symbol
|
|
7237
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7238
|
-
* @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
7239
|
-
*/
|
|
7240
7245
|
await this.loadMarkets();
|
|
7241
7246
|
const market = this.market(symbol);
|
|
7242
7247
|
const request = {
|
|
@@ -7279,16 +7284,16 @@ class bybit extends bybit$1 {
|
|
|
7279
7284
|
const first = this.safeDict(fees, 0, {});
|
|
7280
7285
|
return this.parseTradingFee(first, market);
|
|
7281
7286
|
}
|
|
7287
|
+
/**
|
|
7288
|
+
* @method
|
|
7289
|
+
* @name bybit#fetchTradingFees
|
|
7290
|
+
* @description fetch the trading fees for multiple markets
|
|
7291
|
+
* @see https://bybit-exchange.github.io/docs/v5/account/fee-rate
|
|
7292
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7293
|
+
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
7294
|
+
* @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
|
|
7295
|
+
*/
|
|
7282
7296
|
async fetchTradingFees(params = {}) {
|
|
7283
|
-
/**
|
|
7284
|
-
* @method
|
|
7285
|
-
* @name bybit#fetchTradingFees
|
|
7286
|
-
* @description fetch the trading fees for multiple markets
|
|
7287
|
-
* @see https://bybit-exchange.github.io/docs/v5/account/fee-rate
|
|
7288
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7289
|
-
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
7290
|
-
* @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
|
|
7291
|
-
*/
|
|
7292
7297
|
await this.loadMarkets();
|
|
7293
7298
|
let type = undefined;
|
|
7294
7299
|
[type, params] = this.handleOptionAndParams(params, 'fetchTradingFees', 'type', 'future');
|
|
@@ -7376,16 +7381,16 @@ class bybit extends bybit$1 {
|
|
|
7376
7381
|
}
|
|
7377
7382
|
return result;
|
|
7378
7383
|
}
|
|
7384
|
+
/**
|
|
7385
|
+
* @method
|
|
7386
|
+
* @name bybit#fetchDepositWithdrawFees
|
|
7387
|
+
* @description fetch deposit and withdraw fees
|
|
7388
|
+
* @see https://bybit-exchange.github.io/docs/v5/asset/coin-info
|
|
7389
|
+
* @param {string[]} codes list of unified currency codes
|
|
7390
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7391
|
+
* @returns {object} a list of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
7392
|
+
*/
|
|
7379
7393
|
async fetchDepositWithdrawFees(codes = undefined, params = {}) {
|
|
7380
|
-
/**
|
|
7381
|
-
* @method
|
|
7382
|
-
* @name bybit#fetchDepositWithdrawFees
|
|
7383
|
-
* @description fetch deposit and withdraw fees
|
|
7384
|
-
* @see https://bybit-exchange.github.io/docs/v5/asset/coin-info
|
|
7385
|
-
* @param {string[]} codes list of unified currency codes
|
|
7386
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7387
|
-
* @returns {object} a list of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
7388
|
-
*/
|
|
7389
7394
|
this.checkRequiredCredentials();
|
|
7390
7395
|
await this.loadMarkets();
|
|
7391
7396
|
const response = await this.privateGetV5AssetCoinQueryInfo(params);
|
|
@@ -7423,20 +7428,20 @@ class bybit extends bybit$1 {
|
|
|
7423
7428
|
const rows = this.safeList(data, 'rows', []);
|
|
7424
7429
|
return this.parseDepositWithdrawFees(rows, codes, 'coin');
|
|
7425
7430
|
}
|
|
7431
|
+
/**
|
|
7432
|
+
* @method
|
|
7433
|
+
* @name bybit#fetchSettlementHistory
|
|
7434
|
+
* @description fetches historical settlement records
|
|
7435
|
+
* @see https://bybit-exchange.github.io/docs/v5/market/delivery-price
|
|
7436
|
+
* @param {string} symbol unified market symbol of the settlement history
|
|
7437
|
+
* @param {int} [since] timestamp in ms
|
|
7438
|
+
* @param {int} [limit] number of records
|
|
7439
|
+
* @param {object} [params] exchange specific params
|
|
7440
|
+
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
7441
|
+
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
7442
|
+
* @returns {object[]} a list of [settlement history objects]
|
|
7443
|
+
*/
|
|
7426
7444
|
async fetchSettlementHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
7427
|
-
/**
|
|
7428
|
-
* @method
|
|
7429
|
-
* @name bybit#fetchSettlementHistory
|
|
7430
|
-
* @description fetches historical settlement records
|
|
7431
|
-
* @see https://bybit-exchange.github.io/docs/v5/market/delivery-price
|
|
7432
|
-
* @param {string} symbol unified market symbol of the settlement history
|
|
7433
|
-
* @param {int} [since] timestamp in ms
|
|
7434
|
-
* @param {int} [limit] number of records
|
|
7435
|
-
* @param {object} [params] exchange specific params
|
|
7436
|
-
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
7437
|
-
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
7438
|
-
* @returns {object[]} a list of [settlement history objects]
|
|
7439
|
-
*/
|
|
7440
7445
|
await this.loadMarkets();
|
|
7441
7446
|
const request = {};
|
|
7442
7447
|
let market = undefined;
|
|
@@ -7479,20 +7484,20 @@ class bybit extends bybit$1 {
|
|
|
7479
7484
|
const sorted = this.sortBy(settlements, 'timestamp');
|
|
7480
7485
|
return this.filterBySymbolSinceLimit(sorted, market['symbol'], since, limit);
|
|
7481
7486
|
}
|
|
7487
|
+
/**
|
|
7488
|
+
* @method
|
|
7489
|
+
* @name bybit#fetchMySettlementHistory
|
|
7490
|
+
* @description fetches historical settlement records of the user
|
|
7491
|
+
* @see https://bybit-exchange.github.io/docs/v5/asset/delivery
|
|
7492
|
+
* @param {string} symbol unified market symbol of the settlement history
|
|
7493
|
+
* @param {int} [since] timestamp in ms
|
|
7494
|
+
* @param {int} [limit] number of records
|
|
7495
|
+
* @param {object} [params] exchange specific params
|
|
7496
|
+
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
7497
|
+
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
7498
|
+
* @returns {object[]} a list of [settlement history objects]
|
|
7499
|
+
*/
|
|
7482
7500
|
async fetchMySettlementHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
7483
|
-
/**
|
|
7484
|
-
* @method
|
|
7485
|
-
* @name bybit#fetchMySettlementHistory
|
|
7486
|
-
* @description fetches historical settlement records of the user
|
|
7487
|
-
* @see https://bybit-exchange.github.io/docs/v5/asset/delivery
|
|
7488
|
-
* @param {string} symbol unified market symbol of the settlement history
|
|
7489
|
-
* @param {int} [since] timestamp in ms
|
|
7490
|
-
* @param {int} [limit] number of records
|
|
7491
|
-
* @param {object} [params] exchange specific params
|
|
7492
|
-
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
7493
|
-
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
7494
|
-
* @returns {object[]} a list of [settlement history objects]
|
|
7495
|
-
*/
|
|
7496
7501
|
await this.loadMarkets();
|
|
7497
7502
|
const request = {};
|
|
7498
7503
|
let market = undefined;
|
|
@@ -7606,17 +7611,17 @@ class bybit extends bybit$1 {
|
|
|
7606
7611
|
}
|
|
7607
7612
|
return result;
|
|
7608
7613
|
}
|
|
7614
|
+
/**
|
|
7615
|
+
* @method
|
|
7616
|
+
* @name bybit#fetchVolatilityHistory
|
|
7617
|
+
* @description fetch the historical volatility of an option market based on an underlying asset
|
|
7618
|
+
* @see https://bybit-exchange.github.io/docs/v5/market/iv
|
|
7619
|
+
* @param {string} code unified currency code
|
|
7620
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7621
|
+
* @param {int} [params.period] the period in days to fetch the volatility for: 7,14,21,30,60,90,180,270
|
|
7622
|
+
* @returns {object[]} a list of [volatility history objects]{@link https://docs.ccxt.com/#/?id=volatility-structure}
|
|
7623
|
+
*/
|
|
7609
7624
|
async fetchVolatilityHistory(code, params = {}) {
|
|
7610
|
-
/**
|
|
7611
|
-
* @method
|
|
7612
|
-
* @name bybit#fetchVolatilityHistory
|
|
7613
|
-
* @description fetch the historical volatility of an option market based on an underlying asset
|
|
7614
|
-
* @see https://bybit-exchange.github.io/docs/v5/market/iv
|
|
7615
|
-
* @param {string} code unified currency code
|
|
7616
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7617
|
-
* @param {int} [params.period] the period in days to fetch the volatility for: 7,14,21,30,60,90,180,270
|
|
7618
|
-
* @returns {object[]} a list of [volatility history objects]{@link https://docs.ccxt.com/#/?id=volatility-structure}
|
|
7619
|
-
*/
|
|
7620
7625
|
await this.loadMarkets();
|
|
7621
7626
|
const currency = this.currency(code);
|
|
7622
7627
|
const request = {
|
|
@@ -7662,16 +7667,16 @@ class bybit extends bybit$1 {
|
|
|
7662
7667
|
}
|
|
7663
7668
|
return result;
|
|
7664
7669
|
}
|
|
7670
|
+
/**
|
|
7671
|
+
* @method
|
|
7672
|
+
* @name bybit#fetchGreeks
|
|
7673
|
+
* @description fetches an option contracts greeks, financial metrics used to measure the factors that affect the price of an options contract
|
|
7674
|
+
* @see https://bybit-exchange.github.io/docs/api-explorer/v5/market/tickers
|
|
7675
|
+
* @param {string} symbol unified symbol of the market to fetch greeks for
|
|
7676
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7677
|
+
* @returns {object} a [greeks structure]{@link https://docs.ccxt.com/#/?id=greeks-structure}
|
|
7678
|
+
*/
|
|
7665
7679
|
async fetchGreeks(symbol, params = {}) {
|
|
7666
|
-
/**
|
|
7667
|
-
* @method
|
|
7668
|
-
* @name bybit#fetchGreeks
|
|
7669
|
-
* @description fetches an option contracts greeks, financial metrics used to measure the factors that affect the price of an options contract
|
|
7670
|
-
* @see https://bybit-exchange.github.io/docs/api-explorer/v5/market/tickers
|
|
7671
|
-
* @param {string} symbol unified symbol of the market to fetch greeks for
|
|
7672
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7673
|
-
* @returns {object} a [greeks structure]{@link https://docs.ccxt.com/#/?id=greeks-structure}
|
|
7674
|
-
*/
|
|
7675
7680
|
await this.loadMarkets();
|
|
7676
7681
|
const market = this.market(symbol);
|
|
7677
7682
|
const request = {
|
|
@@ -7782,21 +7787,21 @@ class bybit extends bybit$1 {
|
|
|
7782
7787
|
'info': greeks,
|
|
7783
7788
|
};
|
|
7784
7789
|
}
|
|
7790
|
+
/**
|
|
7791
|
+
* @method
|
|
7792
|
+
* @name bybit#fetchMyLiquidations
|
|
7793
|
+
* @description retrieves the users liquidated positions
|
|
7794
|
+
* @see https://bybit-exchange.github.io/docs/api-explorer/v5/position/execution
|
|
7795
|
+
* @param {string} [symbol] unified CCXT market symbol
|
|
7796
|
+
* @param {int} [since] the earliest time in ms to fetch liquidations for
|
|
7797
|
+
* @param {int} [limit] the maximum number of liquidation structures to retrieve
|
|
7798
|
+
* @param {object} [params] exchange specific parameters for the exchange API endpoint
|
|
7799
|
+
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
7800
|
+
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
7801
|
+
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
7802
|
+
* @returns {object} an array of [liquidation structures]{@link https://docs.ccxt.com/#/?id=liquidation-structure}
|
|
7803
|
+
*/
|
|
7785
7804
|
async fetchMyLiquidations(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
7786
|
-
/**
|
|
7787
|
-
* @method
|
|
7788
|
-
* @name bybit#fetchMyLiquidations
|
|
7789
|
-
* @description retrieves the users liquidated positions
|
|
7790
|
-
* @see https://bybit-exchange.github.io/docs/api-explorer/v5/position/execution
|
|
7791
|
-
* @param {string} [symbol] unified CCXT market symbol
|
|
7792
|
-
* @param {int} [since] the earliest time in ms to fetch liquidations for
|
|
7793
|
-
* @param {int} [limit] the maximum number of liquidation structures to retrieve
|
|
7794
|
-
* @param {object} [params] exchange specific parameters for the exchange API endpoint
|
|
7795
|
-
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
7796
|
-
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
7797
|
-
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
7798
|
-
* @returns {object} an array of [liquidation structures]{@link https://docs.ccxt.com/#/?id=liquidation-structure}
|
|
7799
|
-
*/
|
|
7800
7805
|
await this.loadMarkets();
|
|
7801
7806
|
let paginate = false;
|
|
7802
7807
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchMyLiquidations', 'paginate');
|
|
@@ -7942,18 +7947,18 @@ class bybit extends bybit$1 {
|
|
|
7942
7947
|
result[lastIndex] = last;
|
|
7943
7948
|
return result;
|
|
7944
7949
|
}
|
|
7950
|
+
/**
|
|
7951
|
+
* @method
|
|
7952
|
+
* @name bybit#fetchLeverageTiers
|
|
7953
|
+
* @description retrieve information on the maximum leverage, for different trade sizes
|
|
7954
|
+
* @see https://bybit-exchange.github.io/docs/v5/market/risk-limit
|
|
7955
|
+
* @param {string[]} [symbols] a list of unified market symbols
|
|
7956
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7957
|
+
* @param {string} [params.subType] market subType, ['linear', 'inverse'], default is 'linear'
|
|
7958
|
+
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
7959
|
+
* @returns {object} a dictionary of [leverage tiers structures]{@link https://docs.ccxt.com/#/?id=leverage-tiers-structure}, indexed by market symbols
|
|
7960
|
+
*/
|
|
7945
7961
|
async fetchLeverageTiers(symbols = undefined, params = {}) {
|
|
7946
|
-
/**
|
|
7947
|
-
* @method
|
|
7948
|
-
* @name bybit#fetchLeverageTiers
|
|
7949
|
-
* @see https://bybit-exchange.github.io/docs/v5/market/risk-limit
|
|
7950
|
-
* @description retrieve information on the maximum leverage, for different trade sizes
|
|
7951
|
-
* @param {string[]} [symbols] a list of unified market symbols
|
|
7952
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7953
|
-
* @param {string} [params.subType] market subType, ['linear', 'inverse'], default is 'linear'
|
|
7954
|
-
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
7955
|
-
* @returns {object} a dictionary of [leverage tiers structures]{@link https://docs.ccxt.com/#/?id=leverage-tiers-structure}, indexed by market symbols
|
|
7956
|
-
*/
|
|
7957
7962
|
await this.loadMarkets();
|
|
7958
7963
|
let market = undefined;
|
|
7959
7964
|
let symbol = undefined;
|
|
@@ -8025,6 +8030,7 @@ class bybit extends bybit$1 {
|
|
|
8025
8030
|
}
|
|
8026
8031
|
tiers.push({
|
|
8027
8032
|
'tier': this.safeInteger(tier, 'id'),
|
|
8033
|
+
'symbol': this.safeSymbol(marketId, market),
|
|
8028
8034
|
'currency': market['settle'],
|
|
8029
8035
|
'minNotional': minNotional,
|
|
8030
8036
|
'maxNotional': this.safeNumber(tier, 'riskLimitValue'),
|
|
@@ -8035,19 +8041,19 @@ class bybit extends bybit$1 {
|
|
|
8035
8041
|
}
|
|
8036
8042
|
return tiers;
|
|
8037
8043
|
}
|
|
8044
|
+
/**
|
|
8045
|
+
* @method
|
|
8046
|
+
* @name bybit#fetchFundingHistory
|
|
8047
|
+
* @description fetch the history of funding payments paid and received on this account
|
|
8048
|
+
* @see https://bybit-exchange.github.io/docs/api-explorer/v5/position/execution
|
|
8049
|
+
* @param {string} [symbol] unified market symbol
|
|
8050
|
+
* @param {int} [since] the earliest time in ms to fetch funding history for
|
|
8051
|
+
* @param {int} [limit] the maximum number of funding history structures to retrieve
|
|
8052
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8053
|
+
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
8054
|
+
* @returns {object} a [funding history structure]{@link https://docs.ccxt.com/#/?id=funding-history-structure}
|
|
8055
|
+
*/
|
|
8038
8056
|
async fetchFundingHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
8039
|
-
/**
|
|
8040
|
-
* @method
|
|
8041
|
-
* @name bybit#fetchFundingHistory
|
|
8042
|
-
* @description fetch the history of funding payments paid and received on this account
|
|
8043
|
-
* @see https://bybit-exchange.github.io/docs/api-explorer/v5/position/execution
|
|
8044
|
-
* @param {string} [symbol] unified market symbol
|
|
8045
|
-
* @param {int} [since] the earliest time in ms to fetch funding history for
|
|
8046
|
-
* @param {int} [limit] the maximum number of funding history structures to retrieve
|
|
8047
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8048
|
-
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
8049
|
-
* @returns {object} a [funding history structure]{@link https://docs.ccxt.com/#/?id=funding-history-structure}
|
|
8050
|
-
*/
|
|
8051
8057
|
await this.loadMarkets();
|
|
8052
8058
|
let paginate = false;
|
|
8053
8059
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchFundingHistory', 'paginate');
|
|
@@ -8135,16 +8141,16 @@ class bybit extends bybit$1 {
|
|
|
8135
8141
|
'rate': this.safeNumber(income, 'feeRate'),
|
|
8136
8142
|
};
|
|
8137
8143
|
}
|
|
8144
|
+
/**
|
|
8145
|
+
* @method
|
|
8146
|
+
* @name bybit#fetchOption
|
|
8147
|
+
* @description fetches option data that is commonly found in an option chain
|
|
8148
|
+
* @see https://bybit-exchange.github.io/docs/v5/market/tickers
|
|
8149
|
+
* @param {string} symbol unified market symbol
|
|
8150
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8151
|
+
* @returns {object} an [option chain structure]{@link https://docs.ccxt.com/#/?id=option-chain-structure}
|
|
8152
|
+
*/
|
|
8138
8153
|
async fetchOption(symbol, params = {}) {
|
|
8139
|
-
/**
|
|
8140
|
-
* @method
|
|
8141
|
-
* @name bybit#fetchOption
|
|
8142
|
-
* @description fetches option data that is commonly found in an option chain
|
|
8143
|
-
* @see https://bybit-exchange.github.io/docs/v5/market/tickers
|
|
8144
|
-
* @param {string} symbol unified market symbol
|
|
8145
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8146
|
-
* @returns {object} an [option chain structure]{@link https://docs.ccxt.com/#/?id=option-chain-structure}
|
|
8147
|
-
*/
|
|
8148
8154
|
await this.loadMarkets();
|
|
8149
8155
|
const market = this.market(symbol);
|
|
8150
8156
|
const request = {
|
|
@@ -8197,16 +8203,16 @@ class bybit extends bybit$1 {
|
|
|
8197
8203
|
const chain = this.safeDict(resultList, 0, {});
|
|
8198
8204
|
return this.parseOption(chain, undefined, market);
|
|
8199
8205
|
}
|
|
8206
|
+
/**
|
|
8207
|
+
* @method
|
|
8208
|
+
* @name bybit#fetchOptionChain
|
|
8209
|
+
* @description fetches data for an underlying asset that is commonly found in an option chain
|
|
8210
|
+
* @see https://bybit-exchange.github.io/docs/v5/market/tickers
|
|
8211
|
+
* @param {string} code base currency to fetch an option chain for
|
|
8212
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8213
|
+
* @returns {object} a list of [option chain structures]{@link https://docs.ccxt.com/#/?id=option-chain-structure}
|
|
8214
|
+
*/
|
|
8200
8215
|
async fetchOptionChain(code, params = {}) {
|
|
8201
|
-
/**
|
|
8202
|
-
* @method
|
|
8203
|
-
* @name bybit#fetchOptionChain
|
|
8204
|
-
* @description fetches data for an underlying asset that is commonly found in an option chain
|
|
8205
|
-
* @see https://bybit-exchange.github.io/docs/v5/market/tickers
|
|
8206
|
-
* @param {string} currency base currency to fetch an option chain for
|
|
8207
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8208
|
-
* @returns {object} a list of [option chain structures]{@link https://docs.ccxt.com/#/?id=option-chain-structure}
|
|
8209
|
-
*/
|
|
8210
8216
|
await this.loadMarkets();
|
|
8211
8217
|
const currency = this.currency(code);
|
|
8212
8218
|
const request = {
|
|
@@ -8310,20 +8316,20 @@ class bybit extends bybit$1 {
|
|
|
8310
8316
|
'quoteVolume': undefined,
|
|
8311
8317
|
};
|
|
8312
8318
|
}
|
|
8319
|
+
/**
|
|
8320
|
+
* @method
|
|
8321
|
+
* @name bybit#fetchPositionsHistory
|
|
8322
|
+
* @description fetches historical positions
|
|
8323
|
+
* @see https://bybit-exchange.github.io/docs/v5/position/close-pnl
|
|
8324
|
+
* @param {string[]} symbols a list of unified market symbols
|
|
8325
|
+
* @param {int} [since] timestamp in ms of the earliest position to fetch, params["until"] - since <= 7 days
|
|
8326
|
+
* @param {int} [limit] the maximum amount of records to fetch, default=50, max=100
|
|
8327
|
+
* @param {object} params extra parameters specific to the exchange api endpoint
|
|
8328
|
+
* @param {int} [params.until] timestamp in ms of the latest position to fetch, params["until"] - since <= 7 days
|
|
8329
|
+
* @param {string} [params.subType] 'linear' or 'inverse'
|
|
8330
|
+
* @returns {object[]} a list of [position structures]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
8331
|
+
*/
|
|
8313
8332
|
async fetchPositionsHistory(symbols = undefined, since = undefined, limit = undefined, params = {}) {
|
|
8314
|
-
/**
|
|
8315
|
-
* @method
|
|
8316
|
-
* @name bybit#fetchPositionsHistory
|
|
8317
|
-
* @description fetches historical positions
|
|
8318
|
-
* @see https://bybit-exchange.github.io/docs/v5/position/close-pnl
|
|
8319
|
-
* @param {string} [symbol] unified market symbols, symbols must have the same subType (must all be linear or all be inverse)
|
|
8320
|
-
* @param {int} [since] timestamp in ms of the earliest position to fetch, params["until"] - since <= 7 days
|
|
8321
|
-
* @param {int} [limit] the maximum amount of records to fetch, default=50, max=100
|
|
8322
|
-
* @param {object} params extra parameters specific to the exchange api endpoint
|
|
8323
|
-
* @param {int} [params.until] timestamp in ms of the latest position to fetch, params["until"] - since <= 7 days
|
|
8324
|
-
* @param {string} [params.subType] 'linear' or 'inverse'
|
|
8325
|
-
* @returns {object[]} a list of [position structures]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
8326
|
-
*/
|
|
8327
8333
|
await this.loadMarkets();
|
|
8328
8334
|
let market = undefined;
|
|
8329
8335
|
let subType = undefined;
|
|
@@ -8391,16 +8397,16 @@ class bybit extends bybit$1 {
|
|
|
8391
8397
|
const positions = this.parsePositions(rawPositions, symbols, params);
|
|
8392
8398
|
return this.filterBySinceLimit(positions, since, limit);
|
|
8393
8399
|
}
|
|
8400
|
+
/**
|
|
8401
|
+
* @method
|
|
8402
|
+
* @name bybit#fetchConvertCurrencies
|
|
8403
|
+
* @description fetches all available currencies that can be converted
|
|
8404
|
+
* @see https://bybit-exchange.github.io/docs/v5/asset/convert/convert-coin-list
|
|
8405
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8406
|
+
* @param {string} [params.accountType] eb_convert_uta, eb_convert_spot, eb_convert_funding, eb_convert_inverse, or eb_convert_contract
|
|
8407
|
+
* @returns {object} an associative dictionary of currencies
|
|
8408
|
+
*/
|
|
8394
8409
|
async fetchConvertCurrencies(params = {}) {
|
|
8395
|
-
/**
|
|
8396
|
-
* @method
|
|
8397
|
-
* @name bybit#fetchConvertCurrencies
|
|
8398
|
-
* @description fetches all available currencies that can be converted
|
|
8399
|
-
* @see https://bybit-exchange.github.io/docs/v5/asset/convert/convert-coin-list
|
|
8400
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8401
|
-
* @param {string} [params.accountType] eb_convert_uta, eb_convert_spot, eb_convert_funding, eb_convert_inverse, or eb_convert_contract
|
|
8402
|
-
* @returns {object} an associative dictionary of currencies
|
|
8403
|
-
*/
|
|
8404
8410
|
await this.loadMarkets();
|
|
8405
8411
|
let accountType = undefined;
|
|
8406
8412
|
const [enableUnifiedMargin, enableUnifiedAccount] = await this.isUnifiedEnabled();
|
|
@@ -8485,19 +8491,19 @@ class bybit extends bybit$1 {
|
|
|
8485
8491
|
}
|
|
8486
8492
|
return result;
|
|
8487
8493
|
}
|
|
8494
|
+
/**
|
|
8495
|
+
* @method
|
|
8496
|
+
* @name bybit#fetchConvertQuote
|
|
8497
|
+
* @description fetch a quote for converting from one currency to another
|
|
8498
|
+
* @see https://bybit-exchange.github.io/docs/v5/asset/convert/apply-quote
|
|
8499
|
+
* @param {string} fromCode the currency that you want to sell and convert from
|
|
8500
|
+
* @param {string} toCode the currency that you want to buy and convert into
|
|
8501
|
+
* @param {float} [amount] how much you want to trade in units of the from currency
|
|
8502
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8503
|
+
* @param {string} [params.accountType] eb_convert_uta, eb_convert_spot, eb_convert_funding, eb_convert_inverse, or eb_convert_contract
|
|
8504
|
+
* @returns {object} a [conversion structure]{@link https://docs.ccxt.com/#/?id=conversion-structure}
|
|
8505
|
+
*/
|
|
8488
8506
|
async fetchConvertQuote(fromCode, toCode, amount = undefined, params = {}) {
|
|
8489
|
-
/**
|
|
8490
|
-
* @method
|
|
8491
|
-
* @name bybit#fetchConvertQuote
|
|
8492
|
-
* @description fetch a quote for converting from one currency to another
|
|
8493
|
-
* @see https://bybit-exchange.github.io/docs/v5/asset/convert/apply-quote
|
|
8494
|
-
* @param {string} fromCode the currency that you want to sell and convert from
|
|
8495
|
-
* @param {string} toCode the currency that you want to buy and convert into
|
|
8496
|
-
* @param {float} [amount] how much you want to trade in units of the from currency
|
|
8497
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8498
|
-
* @param {string} [params.accountType] eb_convert_uta, eb_convert_spot, eb_convert_funding, eb_convert_inverse, or eb_convert_contract
|
|
8499
|
-
* @returns {object} a [conversion structure]{@link https://docs.ccxt.com/#/?id=conversion-structure}
|
|
8500
|
-
*/
|
|
8501
8507
|
await this.loadMarkets();
|
|
8502
8508
|
let accountType = undefined;
|
|
8503
8509
|
const [enableUnifiedMargin, enableUnifiedAccount] = await this.isUnifiedEnabled();
|
|
@@ -8539,19 +8545,19 @@ class bybit extends bybit$1 {
|
|
|
8539
8545
|
const toCurrency = this.currency(toCurrencyId);
|
|
8540
8546
|
return this.parseConversion(data, fromCurrency, toCurrency);
|
|
8541
8547
|
}
|
|
8548
|
+
/**
|
|
8549
|
+
* @method
|
|
8550
|
+
* @name bybit#createConvertTrade
|
|
8551
|
+
* @description convert from one currency to another
|
|
8552
|
+
* @see https://bybit-exchange.github.io/docs/v5/asset/convert/confirm-quote
|
|
8553
|
+
* @param {string} id the id of the trade that you want to make
|
|
8554
|
+
* @param {string} fromCode the currency that you want to sell and convert from
|
|
8555
|
+
* @param {string} toCode the currency that you want to buy and convert into
|
|
8556
|
+
* @param {float} amount how much you want to trade in units of the from currency
|
|
8557
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8558
|
+
* @returns {object} a [conversion structure]{@link https://docs.ccxt.com/#/?id=conversion-structure}
|
|
8559
|
+
*/
|
|
8542
8560
|
async createConvertTrade(id, fromCode, toCode, amount = undefined, params = {}) {
|
|
8543
|
-
/**
|
|
8544
|
-
* @method
|
|
8545
|
-
* @name bybit#createConvertTrade
|
|
8546
|
-
* @description convert from one currency to another
|
|
8547
|
-
* @see https://bybit-exchange.github.io/docs/v5/asset/convert/confirm-quote
|
|
8548
|
-
* @param {string} id the id of the trade that you want to make
|
|
8549
|
-
* @param {string} fromCode the currency that you want to sell and convert from
|
|
8550
|
-
* @param {string} toCode the currency that you want to buy and convert into
|
|
8551
|
-
* @param {float} amount how much you want to trade in units of the from currency
|
|
8552
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8553
|
-
* @returns {object} a [conversion structure]{@link https://docs.ccxt.com/#/?id=conversion-structure}
|
|
8554
|
-
*/
|
|
8555
8561
|
await this.loadMarkets();
|
|
8556
8562
|
const request = {
|
|
8557
8563
|
'quoteTxId': id,
|
|
@@ -8572,18 +8578,18 @@ class bybit extends bybit$1 {
|
|
|
8572
8578
|
const data = this.safeDict(response, 'result', {});
|
|
8573
8579
|
return this.parseConversion(data);
|
|
8574
8580
|
}
|
|
8581
|
+
/**
|
|
8582
|
+
* @method
|
|
8583
|
+
* @name bybit#fetchConvertTrade
|
|
8584
|
+
* @description fetch the data for a conversion trade
|
|
8585
|
+
* @see https://bybit-exchange.github.io/docs/v5/asset/convert/get-convert-result
|
|
8586
|
+
* @param {string} id the id of the trade that you want to fetch
|
|
8587
|
+
* @param {string} [code] the unified currency code of the conversion trade
|
|
8588
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8589
|
+
* @param {string} [params.accountType] eb_convert_uta, eb_convert_spot, eb_convert_funding, eb_convert_inverse, or eb_convert_contract
|
|
8590
|
+
* @returns {object} a [conversion structure]{@link https://docs.ccxt.com/#/?id=conversion-structure}
|
|
8591
|
+
*/
|
|
8575
8592
|
async fetchConvertTrade(id, code = undefined, params = {}) {
|
|
8576
|
-
/**
|
|
8577
|
-
* @method
|
|
8578
|
-
* @name bybit#fetchConvertTrade
|
|
8579
|
-
* @description fetch the data for a conversion trade
|
|
8580
|
-
* @see https://bybit-exchange.github.io/docs/v5/asset/convert/get-convert-result
|
|
8581
|
-
* @param {string} id the id of the trade that you want to fetch
|
|
8582
|
-
* @param {string} [code] the unified currency code of the conversion trade
|
|
8583
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8584
|
-
* @param {string} [params.accountType] eb_convert_uta, eb_convert_spot, eb_convert_funding, eb_convert_inverse, or eb_convert_contract
|
|
8585
|
-
* @returns {object} a [conversion structure]{@link https://docs.ccxt.com/#/?id=conversion-structure}
|
|
8586
|
-
*/
|
|
8587
8593
|
await this.loadMarkets();
|
|
8588
8594
|
let accountType = undefined;
|
|
8589
8595
|
const [enableUnifiedMargin, enableUnifiedAccount] = await this.isUnifiedEnabled();
|
|
@@ -8634,19 +8640,19 @@ class bybit extends bybit$1 {
|
|
|
8634
8640
|
}
|
|
8635
8641
|
return this.parseConversion(result, fromCurrency, toCurrency);
|
|
8636
8642
|
}
|
|
8643
|
+
/**
|
|
8644
|
+
* @method
|
|
8645
|
+
* @name bybit#fetchConvertTradeHistory
|
|
8646
|
+
* @description fetch the users history of conversion trades
|
|
8647
|
+
* @see https://bybit-exchange.github.io/docs/v5/asset/convert/get-convert-history
|
|
8648
|
+
* @param {string} [code] the unified currency code
|
|
8649
|
+
* @param {int} [since] the earliest time in ms to fetch conversions for
|
|
8650
|
+
* @param {int} [limit] the maximum number of conversion structures to retrieve
|
|
8651
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8652
|
+
* @param {string} [params.accountType] eb_convert_uta, eb_convert_spot, eb_convert_funding, eb_convert_inverse, or eb_convert_contract
|
|
8653
|
+
* @returns {object[]} a list of [conversion structures]{@link https://docs.ccxt.com/#/?id=conversion-structure}
|
|
8654
|
+
*/
|
|
8637
8655
|
async fetchConvertTradeHistory(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
8638
|
-
/**
|
|
8639
|
-
* @method
|
|
8640
|
-
* @name bybit#fetchConvertTradeHistory
|
|
8641
|
-
* @description fetch the users history of conversion trades
|
|
8642
|
-
* @see https://bybit-exchange.github.io/docs/v5/asset/convert/get-convert-history
|
|
8643
|
-
* @param {string} [code] the unified currency code
|
|
8644
|
-
* @param {int} [since] the earliest time in ms to fetch conversions for
|
|
8645
|
-
* @param {int} [limit] the maximum number of conversion structures to retrieve
|
|
8646
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8647
|
-
* @param {string} [params.accountType] eb_convert_uta, eb_convert_spot, eb_convert_funding, eb_convert_inverse, or eb_convert_contract
|
|
8648
|
-
* @returns {object[]} a list of [conversion structures]{@link https://docs.ccxt.com/#/?id=conversion-structure}
|
|
8649
|
-
*/
|
|
8650
8656
|
await this.loadMarkets();
|
|
8651
8657
|
const request = {};
|
|
8652
8658
|
if (limit !== undefined) {
|
|
@@ -8744,19 +8750,19 @@ class bybit extends bybit$1 {
|
|
|
8744
8750
|
'fee': undefined,
|
|
8745
8751
|
};
|
|
8746
8752
|
}
|
|
8753
|
+
/**
|
|
8754
|
+
* @method
|
|
8755
|
+
* @name bybit#fetchLongShortRatioHistory
|
|
8756
|
+
* @description fetches the long short ratio history for a unified market symbol
|
|
8757
|
+
* @see https://bybit-exchange.github.io/docs/v5/market/long-short-ratio
|
|
8758
|
+
* @param {string} symbol unified symbol of the market to fetch the long short ratio for
|
|
8759
|
+
* @param {string} [timeframe] the period for the ratio, default is 24 hours
|
|
8760
|
+
* @param {int} [since] the earliest time in ms to fetch ratios for
|
|
8761
|
+
* @param {int} [limit] the maximum number of long short ratio structures to retrieve
|
|
8762
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8763
|
+
* @returns {object[]} an array of [long short ratio structures]{@link https://docs.ccxt.com/#/?id=long-short-ratio-structure}
|
|
8764
|
+
*/
|
|
8747
8765
|
async fetchLongShortRatioHistory(symbol = undefined, timeframe = undefined, since = undefined, limit = undefined, params = {}) {
|
|
8748
|
-
/**
|
|
8749
|
-
* @method
|
|
8750
|
-
* @name bybit#fetchLongShortRatioHistory
|
|
8751
|
-
* @description fetches the long short ratio history for a unified market symbol
|
|
8752
|
-
* @see https://bybit-exchange.github.io/docs/v5/market/long-short-ratio
|
|
8753
|
-
* @param {string} symbol unified symbol of the market to fetch the long short ratio for
|
|
8754
|
-
* @param {string} [timeframe] the period for the ratio, default is 24 hours
|
|
8755
|
-
* @param {int} [since] the earliest time in ms to fetch ratios for
|
|
8756
|
-
* @param {int} [limit] the maximum number of long short ratio structures to retrieve
|
|
8757
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8758
|
-
* @returns {object[]} an array of [long short ratio structures]{@link https://docs.ccxt.com/#/?id=long-short-ratio-structure}
|
|
8759
|
-
*/
|
|
8760
8766
|
await this.loadMarkets();
|
|
8761
8767
|
const market = this.market(symbol);
|
|
8762
8768
|
let type = undefined;
|