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/js/src/bybit.js
CHANGED
|
@@ -1113,14 +1113,16 @@ export default class bybit extends Exchange {
|
|
|
1113
1113
|
}
|
|
1114
1114
|
return data;
|
|
1115
1115
|
}
|
|
1116
|
+
/**
|
|
1117
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1118
|
+
* @method
|
|
1119
|
+
* @name bybit#isUnifiedEnabled
|
|
1120
|
+
* @see https://bybit-exchange.github.io/docs/v5/user/apikey-info#http-request
|
|
1121
|
+
* @see https://bybit-exchange.github.io/docs/v5/account/account-info
|
|
1122
|
+
* @description returns [enableUnifiedMargin, enableUnifiedAccount] so the user can check if unified account is enabled
|
|
1123
|
+
* @returns {any} [enableUnifiedMargin, enableUnifiedAccount]
|
|
1124
|
+
*/
|
|
1116
1125
|
async isUnifiedEnabled(params = {}) {
|
|
1117
|
-
/**
|
|
1118
|
-
* @method
|
|
1119
|
-
* @name bybit#isUnifiedEnabled
|
|
1120
|
-
* @see https://bybit-exchange.github.io/docs/v5/user/apikey-info#http-request
|
|
1121
|
-
* @see https://bybit-exchange.github.io/docs/v5/account/account-info
|
|
1122
|
-
* @description returns [enableUnifiedMargin, enableUnifiedAccount] so the user can check if unified account is enabled
|
|
1123
|
-
*/
|
|
1124
1126
|
// The API key of user id must own one of permissions will be allowed to call following API endpoints.
|
|
1125
1127
|
// SUB UID: "Account Transfer"
|
|
1126
1128
|
// MASTER UID: "Account Transfer", "Subaccount Transfer", "Withdrawal"
|
|
@@ -1202,13 +1204,15 @@ export default class bybit extends Exchange {
|
|
|
1202
1204
|
}
|
|
1203
1205
|
return [this.options['enableUnifiedMargin'], this.options['enableUnifiedAccount']];
|
|
1204
1206
|
}
|
|
1207
|
+
/**
|
|
1208
|
+
* @method
|
|
1209
|
+
* @name bybit#upgradeUnifiedTradeAccount
|
|
1210
|
+
* @description upgrades the account to unified trade account *warning* this is irreversible
|
|
1211
|
+
* @see https://bybit-exchange.github.io/docs/v5/account/upgrade-unified-account
|
|
1212
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1213
|
+
* @returns {any} nothing
|
|
1214
|
+
*/
|
|
1205
1215
|
async upgradeUnifiedTradeAccount(params = {}) {
|
|
1206
|
-
/**
|
|
1207
|
-
* @method
|
|
1208
|
-
* @name bybit#upgradeUnifiedTradeAccount
|
|
1209
|
-
* @see https://bybit-exchange.github.io/docs/v5/account/upgrade-unified-account
|
|
1210
|
-
* @description upgrades the account to unified trade account *warning* this is irreversible
|
|
1211
|
-
*/
|
|
1212
1216
|
return await this.privatePostV5AccountUpgradeToUta(params);
|
|
1213
1217
|
}
|
|
1214
1218
|
createExpiredOptionMarket(symbol) {
|
|
@@ -1336,15 +1340,15 @@ export default class bybit extends Exchange {
|
|
|
1336
1340
|
}
|
|
1337
1341
|
return cost;
|
|
1338
1342
|
}
|
|
1343
|
+
/**
|
|
1344
|
+
* @method
|
|
1345
|
+
* @name bybit#fetchTime
|
|
1346
|
+
* @description fetches the current integer timestamp in milliseconds from the exchange server
|
|
1347
|
+
* @see https://bybit-exchange.github.io/docs/v5/market/time
|
|
1348
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1349
|
+
* @returns {int} the current integer timestamp in milliseconds from the exchange server
|
|
1350
|
+
*/
|
|
1339
1351
|
async fetchTime(params = {}) {
|
|
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
|
-
*/
|
|
1348
1352
|
const response = await this.publicGetV5MarketTime(params);
|
|
1349
1353
|
//
|
|
1350
1354
|
// {
|
|
@@ -1360,15 +1364,15 @@ export default class bybit extends Exchange {
|
|
|
1360
1364
|
//
|
|
1361
1365
|
return this.safeInteger(response, 'time');
|
|
1362
1366
|
}
|
|
1367
|
+
/**
|
|
1368
|
+
* @method
|
|
1369
|
+
* @name bybit#fetchCurrencies
|
|
1370
|
+
* @description fetches all available currencies on an exchange
|
|
1371
|
+
* @see https://bybit-exchange.github.io/docs/v5/asset/coin-info
|
|
1372
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1373
|
+
* @returns {object} an associative dictionary of currencies
|
|
1374
|
+
*/
|
|
1363
1375
|
async fetchCurrencies(params = {}) {
|
|
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
|
-
*/
|
|
1372
1376
|
if (!this.checkRequiredCredentials(false)) {
|
|
1373
1377
|
return undefined;
|
|
1374
1378
|
}
|
|
@@ -1494,15 +1498,15 @@ export default class bybit extends Exchange {
|
|
|
1494
1498
|
}
|
|
1495
1499
|
return result;
|
|
1496
1500
|
}
|
|
1501
|
+
/**
|
|
1502
|
+
* @method
|
|
1503
|
+
* @name bybit#fetchMarkets
|
|
1504
|
+
* @description retrieves data on all markets for bybit
|
|
1505
|
+
* @see https://bybit-exchange.github.io/docs/v5/market/instrument
|
|
1506
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1507
|
+
* @returns {object[]} an array of objects representing market data
|
|
1508
|
+
*/
|
|
1497
1509
|
async fetchMarkets(params = {}) {
|
|
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
|
-
*/
|
|
1506
1510
|
if (this.options['adjustForTimeDifference']) {
|
|
1507
1511
|
await this.loadTimeDifference();
|
|
1508
1512
|
}
|
|
@@ -2123,16 +2127,16 @@ export default class bybit extends Exchange {
|
|
|
2123
2127
|
'info': ticker,
|
|
2124
2128
|
}, market);
|
|
2125
2129
|
}
|
|
2130
|
+
/**
|
|
2131
|
+
* @method
|
|
2132
|
+
* @name bybit#fetchTicker
|
|
2133
|
+
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
2134
|
+
* @see https://bybit-exchange.github.io/docs/v5/market/tickers
|
|
2135
|
+
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
2136
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2137
|
+
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
2138
|
+
*/
|
|
2126
2139
|
async fetchTicker(symbol, params = {}) {
|
|
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
|
-
*/
|
|
2136
2140
|
if (symbol === undefined) {
|
|
2137
2141
|
throw new ArgumentsRequired(this.id + ' fetchTicker() requires a symbol argument');
|
|
2138
2142
|
}
|
|
@@ -2201,17 +2205,17 @@ export default class bybit extends Exchange {
|
|
|
2201
2205
|
const rawTicker = this.safeDict(tickers, 0);
|
|
2202
2206
|
return this.parseTicker(rawTicker, market);
|
|
2203
2207
|
}
|
|
2208
|
+
/**
|
|
2209
|
+
* @method
|
|
2210
|
+
* @name bybit#fetchTickers
|
|
2211
|
+
* @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
|
2212
|
+
* @see https://bybit-exchange.github.io/docs/v5/market/tickers
|
|
2213
|
+
* @param {string[]} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
2214
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2215
|
+
* @param {string} [params.subType] *contract only* 'linear', 'inverse'
|
|
2216
|
+
* @returns {object} an array of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
2217
|
+
*/
|
|
2204
2218
|
async fetchTickers(symbols = undefined, params = {}) {
|
|
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
|
-
*/
|
|
2215
2219
|
await this.loadMarkets();
|
|
2216
2220
|
let market = undefined;
|
|
2217
2221
|
let parsedSymbols = undefined;
|
|
@@ -2329,24 +2333,24 @@ export default class bybit extends Exchange {
|
|
|
2329
2333
|
this.safeNumber(ohlcv, volumeIndex),
|
|
2330
2334
|
];
|
|
2331
2335
|
}
|
|
2336
|
+
/**
|
|
2337
|
+
* @method
|
|
2338
|
+
* @name bybit#fetchOHLCV
|
|
2339
|
+
* @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
2340
|
+
* @see https://bybit-exchange.github.io/docs/v5/market/kline
|
|
2341
|
+
* @see https://bybit-exchange.github.io/docs/v5/market/mark-kline
|
|
2342
|
+
* @see https://bybit-exchange.github.io/docs/v5/market/index-kline
|
|
2343
|
+
* @see https://bybit-exchange.github.io/docs/v5/market/preimum-index-kline
|
|
2344
|
+
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
2345
|
+
* @param {string} timeframe the length of time each candle represents
|
|
2346
|
+
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
2347
|
+
* @param {int} [limit] the maximum amount of candles to fetch
|
|
2348
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2349
|
+
* @param {int} [params.until] the latest time in ms to fetch orders for
|
|
2350
|
+
* @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)
|
|
2351
|
+
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
2352
|
+
*/
|
|
2332
2353
|
async fetchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
|
|
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
|
-
*/
|
|
2350
2354
|
if (symbol === undefined) {
|
|
2351
2355
|
throw new ArgumentsRequired(this.id + ' fetchOHLCV() requires a symbol argument');
|
|
2352
2356
|
}
|
|
@@ -2508,16 +2512,16 @@ export default class bybit extends Exchange {
|
|
|
2508
2512
|
'interval': intervalString,
|
|
2509
2513
|
};
|
|
2510
2514
|
}
|
|
2515
|
+
/**
|
|
2516
|
+
* @method
|
|
2517
|
+
* @name bybit#fetchFundingRates
|
|
2518
|
+
* @description fetches funding rates for multiple markets
|
|
2519
|
+
* @see https://bybit-exchange.github.io/docs/v5/market/tickers
|
|
2520
|
+
* @param {string[]} symbols unified symbols of the markets to fetch the funding rates for, all market funding rates are returned if not assigned
|
|
2521
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2522
|
+
* @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
|
|
2523
|
+
*/
|
|
2511
2524
|
async fetchFundingRates(symbols = undefined, params = {}) {
|
|
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
|
-
*/
|
|
2521
2525
|
await this.loadMarkets();
|
|
2522
2526
|
let market = undefined;
|
|
2523
2527
|
const request = {};
|
|
@@ -2585,20 +2589,20 @@ export default class bybit extends Exchange {
|
|
|
2585
2589
|
const result = this.parseFundingRates(tickerList);
|
|
2586
2590
|
return this.filterByArray(result, 'symbol', symbols);
|
|
2587
2591
|
}
|
|
2592
|
+
/**
|
|
2593
|
+
* @method
|
|
2594
|
+
* @name bybit#fetchFundingRateHistory
|
|
2595
|
+
* @description fetches historical funding rate prices
|
|
2596
|
+
* @see https://bybit-exchange.github.io/docs/v5/market/history-fund-rate
|
|
2597
|
+
* @param {string} symbol unified symbol of the market to fetch the funding rate history for
|
|
2598
|
+
* @param {int} [since] timestamp in ms of the earliest funding rate to fetch
|
|
2599
|
+
* @param {int} [limit] the maximum amount of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure} to fetch
|
|
2600
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2601
|
+
* @param {int} [params.until] timestamp in ms of the latest funding rate
|
|
2602
|
+
* @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)
|
|
2603
|
+
* @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure}
|
|
2604
|
+
*/
|
|
2588
2605
|
async fetchFundingRateHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
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
|
-
*/
|
|
2602
2606
|
if (symbol === undefined) {
|
|
2603
2607
|
throw new ArgumentsRequired(this.id + ' fetchFundingRateHistory() requires a symbol argument');
|
|
2604
2608
|
}
|
|
@@ -2869,20 +2873,20 @@ export default class bybit extends Exchange {
|
|
|
2869
2873
|
'fee': fee,
|
|
2870
2874
|
}, market);
|
|
2871
2875
|
}
|
|
2876
|
+
/**
|
|
2877
|
+
* @method
|
|
2878
|
+
* @name bybit#fetchTrades
|
|
2879
|
+
* @description get the list of most recent trades for a particular symbol
|
|
2880
|
+
* @see https://bybit-exchange.github.io/docs/v5/market/recent-trade
|
|
2881
|
+
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
2882
|
+
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
2883
|
+
* @param {int} [limit] the maximum amount of trades to fetch
|
|
2884
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2885
|
+
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
2886
|
+
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
2887
|
+
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
|
|
2888
|
+
*/
|
|
2872
2889
|
async fetchTrades(symbol, since = undefined, limit = undefined, params = {}) {
|
|
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
|
-
*/
|
|
2886
2890
|
if (symbol === undefined) {
|
|
2887
2891
|
throw new ArgumentsRequired(this.id + ' fetchTrades() requires a symbol argument');
|
|
2888
2892
|
}
|
|
@@ -2928,17 +2932,17 @@ export default class bybit extends Exchange {
|
|
|
2928
2932
|
const trades = this.safeList(result, 'list', []);
|
|
2929
2933
|
return this.parseTrades(trades, market, since, limit);
|
|
2930
2934
|
}
|
|
2935
|
+
/**
|
|
2936
|
+
* @method
|
|
2937
|
+
* @name bybit#fetchOrderBook
|
|
2938
|
+
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
2939
|
+
* @see https://bybit-exchange.github.io/docs/v5/market/orderbook
|
|
2940
|
+
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
2941
|
+
* @param {int} [limit] the maximum amount of order book entries to return
|
|
2942
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2943
|
+
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
2944
|
+
*/
|
|
2931
2945
|
async fetchOrderBook(symbol, limit = undefined, params = {}) {
|
|
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
|
-
*/
|
|
2942
2946
|
if (symbol === undefined) {
|
|
2943
2947
|
throw new ArgumentsRequired(this.id + ' fetchOrderBook() requires a symbol argument');
|
|
2944
2948
|
}
|
|
@@ -3157,18 +3161,18 @@ export default class bybit extends Exchange {
|
|
|
3157
3161
|
}
|
|
3158
3162
|
return this.safeBalance(result);
|
|
3159
3163
|
}
|
|
3164
|
+
/**
|
|
3165
|
+
* @method
|
|
3166
|
+
* @name bybit#fetchBalance
|
|
3167
|
+
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
3168
|
+
* @see https://bybit-exchange.github.io/docs/v5/spot-margin-normal/account-info
|
|
3169
|
+
* @see https://bybit-exchange.github.io/docs/v5/asset/all-balance
|
|
3170
|
+
* @see https://bybit-exchange.github.io/docs/v5/account/wallet-balance
|
|
3171
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3172
|
+
* @param {string} [params.type] wallet type, ['spot', 'swap', 'funding']
|
|
3173
|
+
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
3174
|
+
*/
|
|
3160
3175
|
async fetchBalance(params = {}) {
|
|
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
|
-
*/
|
|
3172
3176
|
await this.loadMarkets();
|
|
3173
3177
|
const request = {};
|
|
3174
3178
|
const [enableUnifiedMargin, enableUnifiedAccount] = await this.isUnifiedEnabled();
|
|
@@ -3591,17 +3595,17 @@ export default class bybit extends Exchange {
|
|
|
3591
3595
|
'trades': undefined,
|
|
3592
3596
|
}, market);
|
|
3593
3597
|
}
|
|
3598
|
+
/**
|
|
3599
|
+
* @method
|
|
3600
|
+
* @name bybit#createMarketBuyOrderWithCost
|
|
3601
|
+
* @description create a market buy order by providing the symbol and cost
|
|
3602
|
+
* @see https://bybit-exchange.github.io/docs/v5/order/create-order
|
|
3603
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
3604
|
+
* @param {float} cost how much you want to trade in units of the quote currency
|
|
3605
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3606
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
3607
|
+
*/
|
|
3594
3608
|
async createMarketBuyOrderWithCost(symbol, cost, params = {}) {
|
|
3595
|
-
/**
|
|
3596
|
-
* @method
|
|
3597
|
-
* @name bybit#createMarketBuyOrderWithCost
|
|
3598
|
-
* @see https://bybit-exchange.github.io/docs/v5/order/create-order
|
|
3599
|
-
* @description create a market buy order by providing the symbol and cost
|
|
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
|
-
*/
|
|
3605
3609
|
await this.loadMarkets();
|
|
3606
3610
|
const market = this.market(symbol);
|
|
3607
3611
|
if (!market['spot']) {
|
|
@@ -3609,17 +3613,17 @@ export default class bybit extends Exchange {
|
|
|
3609
3613
|
}
|
|
3610
3614
|
return await this.createOrder(symbol, 'market', 'buy', cost, 1, params);
|
|
3611
3615
|
}
|
|
3616
|
+
/**
|
|
3617
|
+
* @method
|
|
3618
|
+
* @name bybit#createMarkeSellOrderWithCost
|
|
3619
|
+
* @description create a market sell order by providing the symbol and cost
|
|
3620
|
+
* @see https://bybit-exchange.github.io/docs/v5/order/create-order
|
|
3621
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
3622
|
+
* @param {float} cost how much you want to trade in units of the quote currency
|
|
3623
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3624
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
3625
|
+
*/
|
|
3612
3626
|
async createMarketSellOrderWithCost(symbol, cost, params = {}) {
|
|
3613
|
-
/**
|
|
3614
|
-
* @method
|
|
3615
|
-
* @name bybit#createMarkeSellOrderWithCost
|
|
3616
|
-
* @see https://bybit-exchange.github.io/docs/v5/order/create-order
|
|
3617
|
-
* @description create a market sell order by providing the symbol and cost
|
|
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
|
-
*/
|
|
3623
3627
|
await this.loadMarkets();
|
|
3624
3628
|
const types = await this.isUnifiedEnabled();
|
|
3625
3629
|
const enableUnifiedAccount = types[1];
|
|
@@ -3632,39 +3636,39 @@ export default class bybit extends Exchange {
|
|
|
3632
3636
|
}
|
|
3633
3637
|
return await this.createOrder(symbol, 'market', 'sell', cost, 1, params);
|
|
3634
3638
|
}
|
|
3639
|
+
/**
|
|
3640
|
+
* @method
|
|
3641
|
+
* @name bybit#createOrder
|
|
3642
|
+
* @description create a trade order
|
|
3643
|
+
* @see https://bybit-exchange.github.io/docs/v5/order/create-order
|
|
3644
|
+
* @see https://bybit-exchange.github.io/docs/v5/position/trading-stop
|
|
3645
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
3646
|
+
* @param {string} type 'market' or 'limit'
|
|
3647
|
+
* @param {string} side 'buy' or 'sell'
|
|
3648
|
+
* @param {float} amount how much of currency you want to trade in units of base currency
|
|
3649
|
+
* @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
3650
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3651
|
+
* @param {string} [params.timeInForce] "GTC", "IOC", "FOK"
|
|
3652
|
+
* @param {bool} [params.postOnly] true or false whether the order is post-only
|
|
3653
|
+
* @param {bool} [params.reduceOnly] true or false whether the order is reduce-only
|
|
3654
|
+
* @param {string} [params.positionIdx] *contracts only* 0 for one-way mode, 1 buy side of hedged mode, 2 sell side of hedged mode
|
|
3655
|
+
* @param {bool} [params.hedged] *contracts only* true for hedged mode, false for one way mode, default is false
|
|
3656
|
+
* @param {boolean} [params.isLeverage] *unified spot only* false then spot trading true then margin trading
|
|
3657
|
+
* @param {string} [params.tpslMode] *contract only* 'full' or 'partial'
|
|
3658
|
+
* @param {string} [params.mmp] *option only* market maker protection
|
|
3659
|
+
* @param {string} [params.triggerDirection] *contract only* the direction for trigger orders, 'above' or 'below'
|
|
3660
|
+
* @param {float} [params.triggerPrice] The price at which a trigger order is triggered at
|
|
3661
|
+
* @param {float} [params.stopLossPrice] The price at which a stop loss order is triggered at
|
|
3662
|
+
* @param {float} [params.takeProfitPrice] The price at which a take profit order is triggered at
|
|
3663
|
+
* @param {object} [params.takeProfit] *takeProfit object in params* containing the triggerPrice at which the attached take profit order will be triggered
|
|
3664
|
+
* @param {float} [params.takeProfit.triggerPrice] take profit trigger price
|
|
3665
|
+
* @param {object} [params.stopLoss] *stopLoss object in params* containing the triggerPrice at which the attached stop loss order will be triggered
|
|
3666
|
+
* @param {float} [params.stopLoss.triggerPrice] stop loss trigger price
|
|
3667
|
+
* @param {string} [params.trailingAmount] the quote amount to trail away from the current market price
|
|
3668
|
+
* @param {string} [params.trailingTriggerPrice] the price to trigger a trailing order, default uses the price argument
|
|
3669
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
3670
|
+
*/
|
|
3635
3671
|
async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
|
|
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
|
-
*/
|
|
3668
3672
|
await this.loadMarkets();
|
|
3669
3673
|
const market = this.market(symbol);
|
|
3670
3674
|
const parts = await this.isUnifiedEnabled();
|
|
@@ -3940,15 +3944,16 @@ export default class bybit extends Exchange {
|
|
|
3940
3944
|
params = this.omit(params, ['stopPrice', 'timeInForce', 'stopLossPrice', 'takeProfitPrice', 'postOnly', 'clientOrderId', 'triggerPrice', 'stopLoss', 'takeProfit', 'trailingAmount', 'trailingTriggerPrice', 'hedged']);
|
|
3941
3945
|
return this.extend(request, params);
|
|
3942
3946
|
}
|
|
3947
|
+
/**
|
|
3948
|
+
* @method
|
|
3949
|
+
* @name bybit#createOrders
|
|
3950
|
+
* @description create a list of trade orders
|
|
3951
|
+
* @see https://bybit-exchange.github.io/docs/v5/order/batch-place
|
|
3952
|
+
* @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
|
|
3953
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3954
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
3955
|
+
*/
|
|
3943
3956
|
async createOrders(orders, params = {}) {
|
|
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
|
-
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
3951
|
-
*/
|
|
3952
3957
|
await this.loadMarkets();
|
|
3953
3958
|
const accounts = await this.isUnifiedEnabled();
|
|
3954
3959
|
const isUta = accounts[1];
|
|
@@ -4103,33 +4108,33 @@ export default class bybit extends Exchange {
|
|
|
4103
4108
|
params = this.omit(params, ['stopPrice', 'stopLossPrice', 'takeProfitPrice', 'triggerPrice', 'clientOrderId', 'stopLoss', 'takeProfit']);
|
|
4104
4109
|
return request;
|
|
4105
4110
|
}
|
|
4111
|
+
/**
|
|
4112
|
+
* @method
|
|
4113
|
+
* @name bybit#editOrder
|
|
4114
|
+
* @description edit a trade order
|
|
4115
|
+
* @see https://bybit-exchange.github.io/docs/v5/order/amend-order
|
|
4116
|
+
* @see https://bybit-exchange.github.io/docs/derivatives/unified/replace-order
|
|
4117
|
+
* @see https://bybit-exchange.github.io/docs/api-explorer/derivatives/trade/contract/replace-order
|
|
4118
|
+
* @param {string} id cancel order id
|
|
4119
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
4120
|
+
* @param {string} type 'market' or 'limit'
|
|
4121
|
+
* @param {string} side 'buy' or 'sell'
|
|
4122
|
+
* @param {float} amount how much of currency you want to trade in units of base currency
|
|
4123
|
+
* @param {float} price the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
4124
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4125
|
+
* @param {float} [params.triggerPrice] The price that a trigger order is triggered at
|
|
4126
|
+
* @param {float} [params.stopLossPrice] The price that a stop loss order is triggered at
|
|
4127
|
+
* @param {float} [params.takeProfitPrice] The price that a take profit order is triggered at
|
|
4128
|
+
* @param {object} [params.takeProfit] *takeProfit object in params* containing the triggerPrice that the attached take profit order will be triggered
|
|
4129
|
+
* @param {float} [params.takeProfit.triggerPrice] take profit trigger price
|
|
4130
|
+
* @param {object} [params.stopLoss] *stopLoss object in params* containing the triggerPrice that the attached stop loss order will be triggered
|
|
4131
|
+
* @param {float} [params.stopLoss.triggerPrice] stop loss trigger price
|
|
4132
|
+
* @param {string} [params.triggerBy] 'IndexPrice', 'MarkPrice' or 'LastPrice', default is 'LastPrice', required if no initial value for triggerPrice
|
|
4133
|
+
* @param {string} [params.slTriggerBy] 'IndexPrice', 'MarkPrice' or 'LastPrice', default is 'LastPrice', required if no initial value for stopLoss
|
|
4134
|
+
* @param {string} [params.tpTriggerby] 'IndexPrice', 'MarkPrice' or 'LastPrice', default is 'LastPrice', required if no initial value for takeProfit
|
|
4135
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4136
|
+
*/
|
|
4106
4137
|
async editOrder(id, symbol, type, side, amount = undefined, price = undefined, params = {}) {
|
|
4107
|
-
/**
|
|
4108
|
-
* @method
|
|
4109
|
-
* @name bybit#editOrder
|
|
4110
|
-
* @description edit a trade order
|
|
4111
|
-
* @see https://bybit-exchange.github.io/docs/v5/order/amend-order
|
|
4112
|
-
* @see https://bybit-exchange.github.io/docs/derivatives/unified/replace-order
|
|
4113
|
-
* @see https://bybit-exchange.github.io/docs/api-explorer/derivatives/trade/contract/replace-order
|
|
4114
|
-
* @param {string} id cancel order id
|
|
4115
|
-
* @param {string} symbol unified symbol of the market to create an order in
|
|
4116
|
-
* @param {string} type 'market' or 'limit'
|
|
4117
|
-
* @param {string} side 'buy' or 'sell'
|
|
4118
|
-
* @param {float} amount how much of currency you want to trade in units of base currency
|
|
4119
|
-
* @param {float} price the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
4120
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4121
|
-
* @param {float} [params.triggerPrice] The price that a trigger order is triggered at
|
|
4122
|
-
* @param {float} [params.stopLossPrice] The price that a stop loss order is triggered at
|
|
4123
|
-
* @param {float} [params.takeProfitPrice] The price that a take profit order is triggered at
|
|
4124
|
-
* @param {object} [params.takeProfit] *takeProfit object in params* containing the triggerPrice that the attached take profit order will be triggered
|
|
4125
|
-
* @param {float} [params.takeProfit.triggerPrice] take profit trigger price
|
|
4126
|
-
* @param {object} [params.stopLoss] *stopLoss object in params* containing the triggerPrice that the attached stop loss order will be triggered
|
|
4127
|
-
* @param {float} [params.stopLoss.triggerPrice] stop loss trigger price
|
|
4128
|
-
* @param {string} [params.triggerBy] 'IndexPrice', 'MarkPrice' or 'LastPrice', default is 'LastPrice', required if no initial value for triggerPrice
|
|
4129
|
-
* @param {string} [params.slTriggerBy] 'IndexPrice', 'MarkPrice' or 'LastPrice', default is 'LastPrice', required if no initial value for stopLoss
|
|
4130
|
-
* @param {string} [params.tpTriggerby] 'IndexPrice', 'MarkPrice' or 'LastPrice', default is 'LastPrice', required if no initial value for takeProfit
|
|
4131
|
-
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4132
|
-
*/
|
|
4133
4138
|
await this.loadMarkets();
|
|
4134
4139
|
if (symbol === undefined) {
|
|
4135
4140
|
throw new ArgumentsRequired(this.id + ' editOrder() requires a symbol argument');
|
|
@@ -4186,20 +4191,20 @@ export default class bybit extends Exchange {
|
|
|
4186
4191
|
}
|
|
4187
4192
|
return this.extend(request, params);
|
|
4188
4193
|
}
|
|
4194
|
+
/**
|
|
4195
|
+
* @method
|
|
4196
|
+
* @name bybit#cancelOrder
|
|
4197
|
+
* @description cancels an open order
|
|
4198
|
+
* @see https://bybit-exchange.github.io/docs/v5/order/cancel-order
|
|
4199
|
+
* @param {string} id order id
|
|
4200
|
+
* @param {string} symbol unified symbol of the market the order was made in
|
|
4201
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4202
|
+
* @param {boolean} [params.trigger] *spot only* whether the order is a trigger order
|
|
4203
|
+
* @param {boolean} [params.stop] alias for trigger
|
|
4204
|
+
* @param {string} [params.orderFilter] *spot only* 'Order' or 'StopOrder' or 'tpslOrder'
|
|
4205
|
+
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4206
|
+
*/
|
|
4189
4207
|
async cancelOrder(id, symbol = undefined, params = {}) {
|
|
4190
|
-
/**
|
|
4191
|
-
* @method
|
|
4192
|
-
* @name bybit#cancelOrder
|
|
4193
|
-
* @description cancels an open order
|
|
4194
|
-
* @see https://bybit-exchange.github.io/docs/v5/order/cancel-order
|
|
4195
|
-
* @param {string} id order id
|
|
4196
|
-
* @param {string} symbol unified symbol of the market the order was made in
|
|
4197
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4198
|
-
* @param {boolean} [params.trigger] *spot only* whether the order is a trigger order
|
|
4199
|
-
* @param {boolean} [params.stop] alias for trigger
|
|
4200
|
-
* @param {string} [params.orderFilter] *spot only* 'Order' or 'StopOrder' or 'tpslOrder'
|
|
4201
|
-
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4202
|
-
*/
|
|
4203
4208
|
if (symbol === undefined) {
|
|
4204
4209
|
throw new ArgumentsRequired(this.id + ' cancelOrder() requires a symbol argument');
|
|
4205
4210
|
}
|
|
@@ -4222,18 +4227,18 @@ export default class bybit extends Exchange {
|
|
|
4222
4227
|
const result = this.safeDict(response, 'result', {});
|
|
4223
4228
|
return this.parseOrder(result, market);
|
|
4224
4229
|
}
|
|
4230
|
+
/**
|
|
4231
|
+
* @method
|
|
4232
|
+
* @name bybit#cancelOrders
|
|
4233
|
+
* @description cancel multiple orders
|
|
4234
|
+
* @see https://bybit-exchange.github.io/docs/v5/order/batch-cancel
|
|
4235
|
+
* @param {string[]} ids order ids
|
|
4236
|
+
* @param {string} symbol unified symbol of the market the order was made in
|
|
4237
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4238
|
+
* @param {string[]} [params.clientOrderIds] client order ids
|
|
4239
|
+
* @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4240
|
+
*/
|
|
4225
4241
|
async cancelOrders(ids, symbol = undefined, params = {}) {
|
|
4226
|
-
/**
|
|
4227
|
-
* @method
|
|
4228
|
-
* @name bybit#cancelOrders
|
|
4229
|
-
* @description cancel multiple orders
|
|
4230
|
-
* @see https://bybit-exchange.github.io/docs/v5/order/batch-cancel
|
|
4231
|
-
* @param {string[]} ids order ids
|
|
4232
|
-
* @param {string} symbol unified symbol of the market the order was made in
|
|
4233
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4234
|
-
* @param {string[]} [params.clientOrderIds] client order ids
|
|
4235
|
-
* @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4236
|
-
*/
|
|
4237
4242
|
if (symbol === undefined) {
|
|
4238
4243
|
throw new ArgumentsRequired(this.id + ' cancelOrders() requires a symbol argument');
|
|
4239
4244
|
}
|
|
@@ -4308,17 +4313,17 @@ export default class bybit extends Exchange {
|
|
|
4308
4313
|
const row = this.safeList(result, 'list', []);
|
|
4309
4314
|
return this.parseOrders(row, market);
|
|
4310
4315
|
}
|
|
4316
|
+
/**
|
|
4317
|
+
* @method
|
|
4318
|
+
* @name bybit#cancelAllOrdersAfter
|
|
4319
|
+
* @description dead man's switch, cancel all orders after the given timeout
|
|
4320
|
+
* @see https://bybit-exchange.github.io/docs/v5/order/dcp
|
|
4321
|
+
* @param {number} timeout time in milliseconds
|
|
4322
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4323
|
+
* @param {string} [params.product] OPTIONS, DERIVATIVES, SPOT, default is 'DERIVATIVES'
|
|
4324
|
+
* @returns {object} the api result
|
|
4325
|
+
*/
|
|
4311
4326
|
async cancelAllOrdersAfter(timeout, params = {}) {
|
|
4312
|
-
/**
|
|
4313
|
-
* @method
|
|
4314
|
-
* @name bybit#cancelAllOrdersAfter
|
|
4315
|
-
* @description dead man's switch, cancel all orders after the given timeout
|
|
4316
|
-
* @see https://bybit-exchange.github.io/docs/v5/order/dcp
|
|
4317
|
-
* @param {number} timeout time in milliseconds
|
|
4318
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4319
|
-
* @param {string} [params.product] OPTIONS, DERIVATIVES, SPOT, default is 'DERIVATIVES'
|
|
4320
|
-
* @returns {object} the api result
|
|
4321
|
-
*/
|
|
4322
4327
|
await this.loadMarkets();
|
|
4323
4328
|
const request = {
|
|
4324
4329
|
'timeWindow': this.parseToInt(timeout / 1000),
|
|
@@ -4341,16 +4346,16 @@ export default class bybit extends Exchange {
|
|
|
4341
4346
|
//
|
|
4342
4347
|
return response;
|
|
4343
4348
|
}
|
|
4349
|
+
/**
|
|
4350
|
+
* @method
|
|
4351
|
+
* @name bybit#cancelOrdersForSymbols
|
|
4352
|
+
* @description cancel multiple orders for multiple symbols
|
|
4353
|
+
* @see https://bybit-exchange.github.io/docs/v5/order/batch-cancel
|
|
4354
|
+
* @param {CancellationRequest[]} orders list of order ids with symbol, example [{"id": "a", "symbol": "BTC/USDT"}, {"id": "b", "symbol": "ETH/USDT"}]
|
|
4355
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4356
|
+
* @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4357
|
+
*/
|
|
4344
4358
|
async cancelOrdersForSymbols(orders, params = {}) {
|
|
4345
|
-
/**
|
|
4346
|
-
* @method
|
|
4347
|
-
* @name bybit#cancelOrdersForSymbols
|
|
4348
|
-
* @description cancel multiple orders for multiple symbols
|
|
4349
|
-
* @see https://bybit-exchange.github.io/docs/v5/order/batch-cancel
|
|
4350
|
-
* @param {CancellationRequest[]} orders list of order ids with symbol, example [{"id": "a", "symbol": "BTC/USDT"}, {"id": "b", "symbol": "ETH/USDT"}]
|
|
4351
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4352
|
-
* @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4353
|
-
*/
|
|
4354
4359
|
await this.loadMarkets();
|
|
4355
4360
|
const types = await this.isUnifiedEnabled();
|
|
4356
4361
|
const enableUnifiedAccount = types[1];
|
|
@@ -4428,22 +4433,22 @@ export default class bybit extends Exchange {
|
|
|
4428
4433
|
const row = this.safeList(result, 'list', []);
|
|
4429
4434
|
return this.parseOrders(row, undefined);
|
|
4430
4435
|
}
|
|
4436
|
+
/**
|
|
4437
|
+
* @method
|
|
4438
|
+
* @name bybit#cancelAllOrders
|
|
4439
|
+
* @description cancel all open orders
|
|
4440
|
+
* @see https://bybit-exchange.github.io/docs/v5/order/cancel-all
|
|
4441
|
+
* @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
|
|
4442
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4443
|
+
* @param {boolean} [params.trigger] true if trigger order
|
|
4444
|
+
* @param {boolean} [params.stop] alias for trigger
|
|
4445
|
+
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
4446
|
+
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
4447
|
+
* @param {string} [params.baseCoin] Base coin. Supports linear, inverse & option
|
|
4448
|
+
* @param {string} [params.settleCoin] Settle coin. Supports linear, inverse & option
|
|
4449
|
+
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4450
|
+
*/
|
|
4431
4451
|
async cancelAllOrders(symbol = undefined, params = {}) {
|
|
4432
|
-
/**
|
|
4433
|
-
* @method
|
|
4434
|
-
* @name bybit#cancelAllOrders
|
|
4435
|
-
* @description cancel all open orders
|
|
4436
|
-
* @see https://bybit-exchange.github.io/docs/v5/order/cancel-all
|
|
4437
|
-
* @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
|
|
4438
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4439
|
-
* @param {boolean} [params.trigger] true if trigger order
|
|
4440
|
-
* @param {boolean} [params.stop] alias for trigger
|
|
4441
|
-
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
4442
|
-
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
4443
|
-
* @param {string} [params.baseCoin] Base coin. Supports linear, inverse & option
|
|
4444
|
-
* @param {string} [params.settleCoin] Settle coin. Supports linear, inverse & option
|
|
4445
|
-
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4446
|
-
*/
|
|
4447
4452
|
await this.loadMarkets();
|
|
4448
4453
|
const [enableUnifiedMargin, enableUnifiedAccount] = await this.isUnifiedEnabled();
|
|
4449
4454
|
const isUnifiedAccount = (enableUnifiedMargin || enableUnifiedAccount);
|
|
@@ -4507,17 +4512,17 @@ export default class bybit extends Exchange {
|
|
|
4507
4512
|
}
|
|
4508
4513
|
return this.parseOrders(orders, market);
|
|
4509
4514
|
}
|
|
4515
|
+
/**
|
|
4516
|
+
* @method
|
|
4517
|
+
* @name bybit#fetchOrderClassic
|
|
4518
|
+
* @description fetches information on an order made by the user *classic accounts only*
|
|
4519
|
+
* @see https://bybit-exchange.github.io/docs/v5/order/order-list
|
|
4520
|
+
* @param {string} id the order id
|
|
4521
|
+
* @param {string} symbol unified symbol of the market the order was made in
|
|
4522
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4523
|
+
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4524
|
+
*/
|
|
4510
4525
|
async fetchOrderClassic(id, symbol = undefined, params = {}) {
|
|
4511
|
-
/**
|
|
4512
|
-
* @method
|
|
4513
|
-
* @name bybit#fetchOrderClassic
|
|
4514
|
-
* @description fetches information on an order made by the user *classic accounts only*
|
|
4515
|
-
* @see https://bybit-exchange.github.io/docs/v5/order/order-list
|
|
4516
|
-
* @param {string} id the order id
|
|
4517
|
-
* @param {string} symbol unified symbol of the market the order was made in
|
|
4518
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4519
|
-
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4520
|
-
*/
|
|
4521
4526
|
if (symbol === undefined) {
|
|
4522
4527
|
throw new ArgumentsRequired(this.id + ' fetchOrder() requires a symbol argument');
|
|
4523
4528
|
}
|
|
@@ -4541,18 +4546,18 @@ export default class bybit extends Exchange {
|
|
|
4541
4546
|
}
|
|
4542
4547
|
return this.safeValue(result, 0);
|
|
4543
4548
|
}
|
|
4549
|
+
/**
|
|
4550
|
+
* @method
|
|
4551
|
+
* @name bybit#fetchOrderClassic
|
|
4552
|
+
* @description *classic accounts only/ spot not supported* fetches information on an order made by the user *classic accounts only*
|
|
4553
|
+
* @see https://bybit-exchange.github.io/docs/v5/order/order-list
|
|
4554
|
+
* @param {string} id the order id
|
|
4555
|
+
* @param {string} symbol unified symbol of the market the order was made in
|
|
4556
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4557
|
+
* @param {object} [params.acknowledged] to suppress the warning, set to true
|
|
4558
|
+
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4559
|
+
*/
|
|
4544
4560
|
async fetchOrder(id, symbol = undefined, params = {}) {
|
|
4545
|
-
/**
|
|
4546
|
-
* @method
|
|
4547
|
-
* @name bybit#fetchOrderClassic
|
|
4548
|
-
* @description *classic accounts only/ spot not supported* fetches information on an order made by the user *classic accounts only*
|
|
4549
|
-
* @see https://bybit-exchange.github.io/docs/v5/order/order-list
|
|
4550
|
-
* @param {string} id the order id
|
|
4551
|
-
* @param {string} symbol unified symbol of the market the order was made in
|
|
4552
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4553
|
-
* @param {object} [params.acknowledged] to suppress the warning, set to true
|
|
4554
|
-
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4555
|
-
*/
|
|
4556
4561
|
await this.loadMarkets();
|
|
4557
4562
|
const [enableUnifiedMargin, enableUnifiedAccount] = await this.isUnifiedEnabled();
|
|
4558
4563
|
const isUnifiedAccount = (enableUnifiedMargin || enableUnifiedAccount);
|
|
@@ -4662,25 +4667,25 @@ export default class bybit extends Exchange {
|
|
|
4662
4667
|
}
|
|
4663
4668
|
return await this.fetchOrdersClassic(symbol, since, limit, params);
|
|
4664
4669
|
}
|
|
4670
|
+
/**
|
|
4671
|
+
* @method
|
|
4672
|
+
* @name bybit#fetchOrders
|
|
4673
|
+
* @description fetches information on multiple orders made by the user *classic accounts only*
|
|
4674
|
+
* @see https://bybit-exchange.github.io/docs/v5/order/order-list
|
|
4675
|
+
* @param {string} symbol unified market symbol of the market orders were made in
|
|
4676
|
+
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
4677
|
+
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
4678
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4679
|
+
* @param {boolean} [params.trigger] true if trigger order
|
|
4680
|
+
* @param {boolean} [params.stop] alias for trigger
|
|
4681
|
+
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
4682
|
+
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
4683
|
+
* @param {string} [params.orderFilter] 'Order' or 'StopOrder' or 'tpslOrder'
|
|
4684
|
+
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
4685
|
+
* @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)
|
|
4686
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4687
|
+
*/
|
|
4665
4688
|
async fetchOrdersClassic(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
4666
|
-
/**
|
|
4667
|
-
* @method
|
|
4668
|
-
* @name bybit#fetchOrders
|
|
4669
|
-
* @description fetches information on multiple orders made by the user *classic accounts only*
|
|
4670
|
-
* @see https://bybit-exchange.github.io/docs/v5/order/order-list
|
|
4671
|
-
* @param {string} symbol unified market symbol of the market orders were made in
|
|
4672
|
-
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
4673
|
-
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
4674
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4675
|
-
* @param {boolean} [params.trigger] true if trigger order
|
|
4676
|
-
* @param {boolean} [params.stop] alias for trigger
|
|
4677
|
-
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
4678
|
-
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
4679
|
-
* @param {string} [params.orderFilter] 'Order' or 'StopOrder' or 'tpslOrder'
|
|
4680
|
-
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
4681
|
-
* @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)
|
|
4682
|
-
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4683
|
-
*/
|
|
4684
4689
|
await this.loadMarkets();
|
|
4685
4690
|
let paginate = false;
|
|
4686
4691
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchOrders', 'paginate');
|
|
@@ -4770,22 +4775,22 @@ export default class bybit extends Exchange {
|
|
|
4770
4775
|
const data = this.addPaginationCursorToResult(response);
|
|
4771
4776
|
return this.parseOrders(data, market, since, limit);
|
|
4772
4777
|
}
|
|
4778
|
+
/**
|
|
4779
|
+
* @method
|
|
4780
|
+
* @name bybit#fetchClosedOrder
|
|
4781
|
+
* @description fetches information on a closed order made by the user
|
|
4782
|
+
* @see https://bybit-exchange.github.io/docs/v5/order/order-list
|
|
4783
|
+
* @param {string} id order id
|
|
4784
|
+
* @param {string} [symbol] unified symbol of the market the order was made in
|
|
4785
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4786
|
+
* @param {boolean} [params.trigger] set to true for fetching a closed trigger order
|
|
4787
|
+
* @param {boolean} [params.stop] alias for trigger
|
|
4788
|
+
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
4789
|
+
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
4790
|
+
* @param {string} [params.orderFilter] 'Order' or 'StopOrder' or 'tpslOrder'
|
|
4791
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4792
|
+
*/
|
|
4773
4793
|
async fetchClosedOrder(id, symbol = undefined, params = {}) {
|
|
4774
|
-
/**
|
|
4775
|
-
* @method
|
|
4776
|
-
* @name bybit#fetchClosedOrder
|
|
4777
|
-
* @description fetches information on a closed order made by the user
|
|
4778
|
-
* @see https://bybit-exchange.github.io/docs/v5/order/order-list
|
|
4779
|
-
* @param {string} id order id
|
|
4780
|
-
* @param {string} [symbol] unified symbol of the market the order was made in
|
|
4781
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4782
|
-
* @param {boolean} [params.trigger] set to true for fetching a closed trigger order
|
|
4783
|
-
* @param {boolean} [params.stop] alias for trigger
|
|
4784
|
-
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
4785
|
-
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
4786
|
-
* @param {string} [params.orderFilter] 'Order' or 'StopOrder' or 'tpslOrder'
|
|
4787
|
-
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4788
|
-
*/
|
|
4789
4794
|
await this.loadMarkets();
|
|
4790
4795
|
const request = {
|
|
4791
4796
|
'orderId': id,
|
|
@@ -4802,24 +4807,24 @@ export default class bybit extends Exchange {
|
|
|
4802
4807
|
}
|
|
4803
4808
|
return this.safeValue(result, 0);
|
|
4804
4809
|
}
|
|
4810
|
+
/**
|
|
4811
|
+
* @method
|
|
4812
|
+
* @name bybit#fetchOpenOrder
|
|
4813
|
+
* @description fetches information on an open order made by the user
|
|
4814
|
+
* @see https://bybit-exchange.github.io/docs/v5/order/open-order
|
|
4815
|
+
* @param {string} id order id
|
|
4816
|
+
* @param {string} [symbol] unified symbol of the market the order was made in
|
|
4817
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4818
|
+
* @param {boolean} [params.trigger] set to true for fetching an open trigger order
|
|
4819
|
+
* @param {boolean} [params.stop] alias for trigger
|
|
4820
|
+
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
4821
|
+
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
4822
|
+
* @param {string} [params.baseCoin] Base coin. Supports linear, inverse & option
|
|
4823
|
+
* @param {string} [params.settleCoin] Settle coin. Supports linear, inverse & option
|
|
4824
|
+
* @param {string} [params.orderFilter] 'Order' or 'StopOrder' or 'tpslOrder'
|
|
4825
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4826
|
+
*/
|
|
4805
4827
|
async fetchOpenOrder(id, symbol = undefined, params = {}) {
|
|
4806
|
-
/**
|
|
4807
|
-
* @method
|
|
4808
|
-
* @name bybit#fetchOpenOrder
|
|
4809
|
-
* @description fetches information on an open order made by the user
|
|
4810
|
-
* @see https://bybit-exchange.github.io/docs/v5/order/open-order
|
|
4811
|
-
* @param {string} id order id
|
|
4812
|
-
* @param {string} [symbol] unified symbol of the market the order was made in
|
|
4813
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4814
|
-
* @param {boolean} [params.trigger] set to true for fetching an open trigger order
|
|
4815
|
-
* @param {boolean} [params.stop] alias for trigger
|
|
4816
|
-
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
4817
|
-
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
4818
|
-
* @param {string} [params.baseCoin] Base coin. Supports linear, inverse & option
|
|
4819
|
-
* @param {string} [params.settleCoin] Settle coin. Supports linear, inverse & option
|
|
4820
|
-
* @param {string} [params.orderFilter] 'Order' or 'StopOrder' or 'tpslOrder'
|
|
4821
|
-
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4822
|
-
*/
|
|
4823
4828
|
await this.loadMarkets();
|
|
4824
4829
|
const request = {
|
|
4825
4830
|
'orderId': id,
|
|
@@ -4836,25 +4841,25 @@ export default class bybit extends Exchange {
|
|
|
4836
4841
|
}
|
|
4837
4842
|
return this.safeValue(result, 0);
|
|
4838
4843
|
}
|
|
4844
|
+
/**
|
|
4845
|
+
* @method
|
|
4846
|
+
* @name bybit#fetchCanceledAndClosedOrders
|
|
4847
|
+
* @description fetches information on multiple canceled and closed orders made by the user
|
|
4848
|
+
* @see https://bybit-exchange.github.io/docs/v5/order/order-list
|
|
4849
|
+
* @param {string} [symbol] unified market symbol of the market orders were made in
|
|
4850
|
+
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
4851
|
+
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
4852
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4853
|
+
* @param {boolean} [params.trigger] set to true for fetching trigger orders
|
|
4854
|
+
* @param {boolean} [params.stop] alias for trigger
|
|
4855
|
+
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
4856
|
+
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
4857
|
+
* @param {string} [params.orderFilter] 'Order' or 'StopOrder' or 'tpslOrder'
|
|
4858
|
+
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
4859
|
+
* @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)
|
|
4860
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4861
|
+
*/
|
|
4839
4862
|
async fetchCanceledAndClosedOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
4840
|
-
/**
|
|
4841
|
-
* @method
|
|
4842
|
-
* @name bybit#fetchCanceledAndClosedOrders
|
|
4843
|
-
* @description fetches information on multiple canceled and closed orders made by the user
|
|
4844
|
-
* @see https://bybit-exchange.github.io/docs/v5/order/order-list
|
|
4845
|
-
* @param {string} [symbol] unified market symbol of the market orders were made in
|
|
4846
|
-
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
4847
|
-
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
4848
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4849
|
-
* @param {boolean} [params.trigger] set to true for fetching trigger orders
|
|
4850
|
-
* @param {boolean} [params.stop] alias for trigger
|
|
4851
|
-
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
4852
|
-
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
4853
|
-
* @param {string} [params.orderFilter] 'Order' or 'StopOrder' or 'tpslOrder'
|
|
4854
|
-
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
4855
|
-
* @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)
|
|
4856
|
-
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4857
|
-
*/
|
|
4858
4863
|
await this.loadMarkets();
|
|
4859
4864
|
let paginate = false;
|
|
4860
4865
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchCanceledAndClosedOrders', 'paginate');
|
|
@@ -4941,76 +4946,76 @@ export default class bybit extends Exchange {
|
|
|
4941
4946
|
const data = this.addPaginationCursorToResult(response);
|
|
4942
4947
|
return this.parseOrders(data, market, since, limit);
|
|
4943
4948
|
}
|
|
4949
|
+
/**
|
|
4950
|
+
* @method
|
|
4951
|
+
* @name bybit#fetchClosedOrders
|
|
4952
|
+
* @description fetches information on multiple closed orders made by the user
|
|
4953
|
+
* @see https://bybit-exchange.github.io/docs/v5/order/order-list
|
|
4954
|
+
* @param {string} [symbol] unified market symbol of the market orders were made in
|
|
4955
|
+
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
4956
|
+
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
4957
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4958
|
+
* @param {boolean} [params.trigger] set to true for fetching closed trigger orders
|
|
4959
|
+
* @param {boolean} [params.stop] alias for trigger
|
|
4960
|
+
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
4961
|
+
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
4962
|
+
* @param {string} [params.orderFilter] 'Order' or 'StopOrder' or 'tpslOrder'
|
|
4963
|
+
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
4964
|
+
* @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)
|
|
4965
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4966
|
+
*/
|
|
4944
4967
|
async fetchClosedOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
4945
|
-
/**
|
|
4946
|
-
* @method
|
|
4947
|
-
* @name bybit#fetchClosedOrders
|
|
4948
|
-
* @description fetches information on multiple closed orders made by the user
|
|
4949
|
-
* @see https://bybit-exchange.github.io/docs/v5/order/order-list
|
|
4950
|
-
* @param {string} [symbol] unified market symbol of the market orders were made in
|
|
4951
|
-
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
4952
|
-
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
4953
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4954
|
-
* @param {boolean} [params.trigger] set to true for fetching closed trigger orders
|
|
4955
|
-
* @param {boolean} [params.stop] alias for trigger
|
|
4956
|
-
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
4957
|
-
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
4958
|
-
* @param {string} [params.orderFilter] 'Order' or 'StopOrder' or 'tpslOrder'
|
|
4959
|
-
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
4960
|
-
* @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)
|
|
4961
|
-
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4962
|
-
*/
|
|
4963
4968
|
await this.loadMarkets();
|
|
4964
4969
|
const request = {
|
|
4965
4970
|
'orderStatus': 'Filled',
|
|
4966
4971
|
};
|
|
4967
4972
|
return await this.fetchCanceledAndClosedOrders(symbol, since, limit, this.extend(request, params));
|
|
4968
4973
|
}
|
|
4974
|
+
/**
|
|
4975
|
+
* @method
|
|
4976
|
+
* @name bybit#fetchCanceledOrders
|
|
4977
|
+
* @description fetches information on multiple canceled orders made by the user
|
|
4978
|
+
* @see https://bybit-exchange.github.io/docs/v5/order/order-list
|
|
4979
|
+
* @param {string} [symbol] unified market symbol of the market orders were made in
|
|
4980
|
+
* @param {int} [since] timestamp in ms of the earliest order, default is undefined
|
|
4981
|
+
* @param {int} [limit] max number of orders to return, default is undefined
|
|
4982
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4983
|
+
* @param {boolean} [params.trigger] true if trigger order
|
|
4984
|
+
* @param {boolean} [params.stop] alias for trigger
|
|
4985
|
+
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
4986
|
+
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
4987
|
+
* @param {string} [params.orderFilter] 'Order' or 'StopOrder' or 'tpslOrder'
|
|
4988
|
+
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
4989
|
+
* @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)
|
|
4990
|
+
* @returns {object} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4991
|
+
*/
|
|
4969
4992
|
async fetchCanceledOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
4970
|
-
/**
|
|
4971
|
-
* @method
|
|
4972
|
-
* @name bybit#fetchCanceledOrders
|
|
4973
|
-
* @description fetches information on multiple canceled orders made by the user
|
|
4974
|
-
* @see https://bybit-exchange.github.io/docs/v5/order/order-list
|
|
4975
|
-
* @param {string} [symbol] unified market symbol of the market orders were made in
|
|
4976
|
-
* @param {int} [since] timestamp in ms of the earliest order, default is undefined
|
|
4977
|
-
* @param {int} [limit] max number of orders to return, default is undefined
|
|
4978
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4979
|
-
* @param {boolean} [params.trigger] true if trigger order
|
|
4980
|
-
* @param {boolean} [params.stop] alias for trigger
|
|
4981
|
-
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
4982
|
-
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
4983
|
-
* @param {string} [params.orderFilter] 'Order' or 'StopOrder' or 'tpslOrder'
|
|
4984
|
-
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
4985
|
-
* @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)
|
|
4986
|
-
* @returns {object} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4987
|
-
*/
|
|
4988
4993
|
await this.loadMarkets();
|
|
4989
4994
|
const request = {
|
|
4990
4995
|
'orderStatus': 'Cancelled',
|
|
4991
4996
|
};
|
|
4992
4997
|
return await this.fetchCanceledAndClosedOrders(symbol, since, limit, this.extend(request, params));
|
|
4993
4998
|
}
|
|
4999
|
+
/**
|
|
5000
|
+
* @method
|
|
5001
|
+
* @name bybit#fetchOpenOrders
|
|
5002
|
+
* @description fetch all unfilled currently open orders
|
|
5003
|
+
* @see https://bybit-exchange.github.io/docs/v5/order/open-order
|
|
5004
|
+
* @param {string} symbol unified market symbol
|
|
5005
|
+
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
5006
|
+
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
5007
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5008
|
+
* @param {boolean} [params.trigger] set to true for fetching open trigger orders
|
|
5009
|
+
* @param {boolean} [params.stop] alias for trigger
|
|
5010
|
+
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
5011
|
+
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
5012
|
+
* @param {string} [params.baseCoin] Base coin. Supports linear, inverse & option
|
|
5013
|
+
* @param {string} [params.settleCoin] Settle coin. Supports linear, inverse & option
|
|
5014
|
+
* @param {string} [params.orderFilter] 'Order' or 'StopOrder' or 'tpslOrder'
|
|
5015
|
+
* @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)
|
|
5016
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
5017
|
+
*/
|
|
4994
5018
|
async fetchOpenOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
4995
|
-
/**
|
|
4996
|
-
* @method
|
|
4997
|
-
* @name bybit#fetchOpenOrders
|
|
4998
|
-
* @description fetch all unfilled currently open orders
|
|
4999
|
-
* @see https://bybit-exchange.github.io/docs/v5/order/open-order
|
|
5000
|
-
* @param {string} symbol unified market symbol
|
|
5001
|
-
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
5002
|
-
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
5003
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5004
|
-
* @param {boolean} [params.trigger] set to true for fetching open trigger orders
|
|
5005
|
-
* @param {boolean} [params.stop] alias for trigger
|
|
5006
|
-
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
5007
|
-
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
5008
|
-
* @param {string} [params.baseCoin] Base coin. Supports linear, inverse & option
|
|
5009
|
-
* @param {string} [params.settleCoin] Settle coin. Supports linear, inverse & option
|
|
5010
|
-
* @param {string} [params.orderFilter] 'Order' or 'StopOrder' or 'tpslOrder'
|
|
5011
|
-
* @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)
|
|
5012
|
-
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
5013
|
-
*/
|
|
5014
5019
|
await this.loadMarkets();
|
|
5015
5020
|
let paginate = false;
|
|
5016
5021
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchOpenOrders', 'paginate');
|
|
@@ -5095,19 +5100,19 @@ export default class bybit extends Exchange {
|
|
|
5095
5100
|
const data = this.addPaginationCursorToResult(response);
|
|
5096
5101
|
return this.parseOrders(data, market, since, limit);
|
|
5097
5102
|
}
|
|
5103
|
+
/**
|
|
5104
|
+
* @method
|
|
5105
|
+
* @name bybit#fetchOrderTrades
|
|
5106
|
+
* @description fetch all the trades made from a single order
|
|
5107
|
+
* @see https://bybit-exchange.github.io/docs/v5/position/execution
|
|
5108
|
+
* @param {string} id order id
|
|
5109
|
+
* @param {string} symbol unified market symbol
|
|
5110
|
+
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
5111
|
+
* @param {int} [limit] the maximum number of trades to retrieve
|
|
5112
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5113
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
5114
|
+
*/
|
|
5098
5115
|
async fetchOrderTrades(id, symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
5099
|
-
/**
|
|
5100
|
-
* @method
|
|
5101
|
-
* @name bybit#fetchOrderTrades
|
|
5102
|
-
* @description fetch all the trades made from a single order
|
|
5103
|
-
* @see https://bybit-exchange.github.io/docs/v5/position/execution
|
|
5104
|
-
* @param {string} id order id
|
|
5105
|
-
* @param {string} symbol unified market symbol
|
|
5106
|
-
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
5107
|
-
* @param {int} [limit] the maximum number of trades to retrieve
|
|
5108
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5109
|
-
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
5110
|
-
*/
|
|
5111
5116
|
const request = {};
|
|
5112
5117
|
const clientOrderId = this.safeString2(params, 'clientOrderId', 'orderLinkId');
|
|
5113
5118
|
if (clientOrderId !== undefined) {
|
|
@@ -5119,21 +5124,21 @@ export default class bybit extends Exchange {
|
|
|
5119
5124
|
params = this.omit(params, ['clientOrderId', 'orderLinkId']);
|
|
5120
5125
|
return await this.fetchMyTrades(symbol, since, limit, this.extend(request, params));
|
|
5121
5126
|
}
|
|
5127
|
+
/**
|
|
5128
|
+
* @method
|
|
5129
|
+
* @name bybit#fetchMyTrades
|
|
5130
|
+
* @description fetch all trades made by the user
|
|
5131
|
+
* @see https://bybit-exchange.github.io/docs/api-explorer/v5/position/execution
|
|
5132
|
+
* @param {string} symbol unified market symbol
|
|
5133
|
+
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
5134
|
+
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
5135
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5136
|
+
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
5137
|
+
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
5138
|
+
* @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)
|
|
5139
|
+
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
5140
|
+
*/
|
|
5122
5141
|
async fetchMyTrades(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
5123
|
-
/**
|
|
5124
|
-
* @method
|
|
5125
|
-
* @name bybit#fetchMyTrades
|
|
5126
|
-
* @description fetch all trades made by the user
|
|
5127
|
-
* @see https://bybit-exchange.github.io/docs/api-explorer/v5/position/execution
|
|
5128
|
-
* @param {string} symbol unified market symbol
|
|
5129
|
-
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
5130
|
-
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
5131
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5132
|
-
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
5133
|
-
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
5134
|
-
* @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)
|
|
5135
|
-
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
5136
|
-
*/
|
|
5137
5142
|
await this.loadMarkets();
|
|
5138
5143
|
let paginate = false;
|
|
5139
5144
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchMyTrades', 'paginate');
|
|
@@ -5224,16 +5229,16 @@ export default class bybit extends Exchange {
|
|
|
5224
5229
|
'tag': tag,
|
|
5225
5230
|
};
|
|
5226
5231
|
}
|
|
5232
|
+
/**
|
|
5233
|
+
* @method
|
|
5234
|
+
* @name bybit#fetchDepositAddressesByNetwork
|
|
5235
|
+
* @description fetch a dictionary of addresses for a currency, indexed by network
|
|
5236
|
+
* @see https://bybit-exchange.github.io/docs/v5/asset/master-deposit-addr
|
|
5237
|
+
* @param {string} code unified currency code of the currency for the deposit address
|
|
5238
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5239
|
+
* @returns {object} a dictionary of [address structures]{@link https://docs.ccxt.com/#/?id=address-structure} indexed by the network
|
|
5240
|
+
*/
|
|
5227
5241
|
async fetchDepositAddressesByNetwork(code, params = {}) {
|
|
5228
|
-
/**
|
|
5229
|
-
* @method
|
|
5230
|
-
* @name bybit#fetchDepositAddressesByNetwork
|
|
5231
|
-
* @description fetch a dictionary of addresses for a currency, indexed by network
|
|
5232
|
-
* @see https://bybit-exchange.github.io/docs/v5/asset/master-deposit-addr
|
|
5233
|
-
* @param {string} code unified currency code of the currency for the deposit address
|
|
5234
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5235
|
-
* @returns {object} a dictionary of [address structures]{@link https://docs.ccxt.com/#/?id=address-structure} indexed by the network
|
|
5236
|
-
*/
|
|
5237
5242
|
await this.loadMarkets();
|
|
5238
5243
|
let currency = this.currency(code);
|
|
5239
5244
|
const request = {
|
|
@@ -5268,16 +5273,16 @@ export default class bybit extends Exchange {
|
|
|
5268
5273
|
});
|
|
5269
5274
|
return this.indexBy(parsed, 'network');
|
|
5270
5275
|
}
|
|
5276
|
+
/**
|
|
5277
|
+
* @method
|
|
5278
|
+
* @name bybit#fetchDepositAddress
|
|
5279
|
+
* @description fetch the deposit address for a currency associated with this account
|
|
5280
|
+
* @see https://bybit-exchange.github.io/docs/v5/asset/master-deposit-addr
|
|
5281
|
+
* @param {string} code unified currency code
|
|
5282
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5283
|
+
* @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
|
|
5284
|
+
*/
|
|
5271
5285
|
async fetchDepositAddress(code, params = {}) {
|
|
5272
|
-
/**
|
|
5273
|
-
* @method
|
|
5274
|
-
* @name bybit#fetchDepositAddress
|
|
5275
|
-
* @description fetch the deposit address for a currency associated with this account
|
|
5276
|
-
* @see https://bybit-exchange.github.io/docs/v5/asset/master-deposit-addr
|
|
5277
|
-
* @param {string} code unified currency code
|
|
5278
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5279
|
-
* @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
|
|
5280
|
-
*/
|
|
5281
5286
|
await this.loadMarkets();
|
|
5282
5287
|
const [networkCode, query] = this.handleNetworkCodeAndParams(params);
|
|
5283
5288
|
const networkId = this.networkCodeToId(networkCode);
|
|
@@ -5315,22 +5320,22 @@ export default class bybit extends Exchange {
|
|
|
5315
5320
|
const addressObject = this.safeDict(chainsIndexedById, selectedNetworkId, {});
|
|
5316
5321
|
return this.parseDepositAddress(addressObject, currency);
|
|
5317
5322
|
}
|
|
5323
|
+
/**
|
|
5324
|
+
* @method
|
|
5325
|
+
* @name bybit#fetchDeposits
|
|
5326
|
+
* @description fetch all deposits made to an account
|
|
5327
|
+
* @see https://bybit-exchange.github.io/docs/v5/asset/deposit-record
|
|
5328
|
+
* @param {string} code unified currency code
|
|
5329
|
+
* @param {int} [since] the earliest time in ms to fetch deposits for, default = 30 days before the current time
|
|
5330
|
+
* @param {int} [limit] the maximum number of deposits structures to retrieve, default = 50, max = 50
|
|
5331
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5332
|
+
* @param {int} [params.until] the latest time in ms to fetch deposits for, default = 30 days after since
|
|
5333
|
+
* EXCHANGE SPECIFIC PARAMETERS
|
|
5334
|
+
* @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)
|
|
5335
|
+
* @param {string} [params.cursor] used for pagination
|
|
5336
|
+
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
5337
|
+
*/
|
|
5318
5338
|
async fetchDeposits(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
5319
|
-
/**
|
|
5320
|
-
* @method
|
|
5321
|
-
* @name bybit#fetchDeposits
|
|
5322
|
-
* @description fetch all deposits made to an account
|
|
5323
|
-
* @see https://bybit-exchange.github.io/docs/v5/asset/deposit-record
|
|
5324
|
-
* @param {string} code unified currency code
|
|
5325
|
-
* @param {int} [since] the earliest time in ms to fetch deposits for, default = 30 days before the current time
|
|
5326
|
-
* @param {int} [limit] the maximum number of deposits structures to retrieve, default = 50, max = 50
|
|
5327
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5328
|
-
* @param {int} [params.until] the latest time in ms to fetch deposits for, default = 30 days after since
|
|
5329
|
-
* EXCHANGE SPECIFIC PARAMETERS
|
|
5330
|
-
* @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)
|
|
5331
|
-
* @param {string} [params.cursor] used for pagination
|
|
5332
|
-
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
5333
|
-
*/
|
|
5334
5339
|
await this.loadMarkets();
|
|
5335
5340
|
let paginate = false;
|
|
5336
5341
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchDeposits', 'paginate');
|
|
@@ -5385,20 +5390,20 @@ export default class bybit extends Exchange {
|
|
|
5385
5390
|
const data = this.addPaginationCursorToResult(response);
|
|
5386
5391
|
return this.parseTransactions(data, currency, since, limit);
|
|
5387
5392
|
}
|
|
5393
|
+
/**
|
|
5394
|
+
* @method
|
|
5395
|
+
* @name bybit#fetchWithdrawals
|
|
5396
|
+
* @description fetch all withdrawals made from an account
|
|
5397
|
+
* @see https://bybit-exchange.github.io/docs/v5/asset/withdraw-record
|
|
5398
|
+
* @param {string} code unified currency code
|
|
5399
|
+
* @param {int} [since] the earliest time in ms to fetch withdrawals for
|
|
5400
|
+
* @param {int} [limit] the maximum number of withdrawals structures to retrieve
|
|
5401
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5402
|
+
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
5403
|
+
* @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)
|
|
5404
|
+
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
5405
|
+
*/
|
|
5388
5406
|
async fetchWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
5389
|
-
/**
|
|
5390
|
-
* @method
|
|
5391
|
-
* @name bybit#fetchWithdrawals
|
|
5392
|
-
* @description fetch all withdrawals made from an account
|
|
5393
|
-
* @see https://bybit-exchange.github.io/docs/v5/asset/withdraw-record
|
|
5394
|
-
* @param {string} code unified currency code
|
|
5395
|
-
* @param {int} [since] the earliest time in ms to fetch withdrawals for
|
|
5396
|
-
* @param {int} [limit] the maximum number of withdrawals structures to retrieve
|
|
5397
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5398
|
-
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
5399
|
-
* @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)
|
|
5400
|
-
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
5401
|
-
*/
|
|
5402
5407
|
await this.loadMarkets();
|
|
5403
5408
|
let paginate = false;
|
|
5404
5409
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchWithdrawals', 'paginate');
|
|
@@ -5565,21 +5570,21 @@ export default class bybit extends Exchange {
|
|
|
5565
5570
|
'comment': undefined,
|
|
5566
5571
|
};
|
|
5567
5572
|
}
|
|
5573
|
+
/**
|
|
5574
|
+
* @method
|
|
5575
|
+
* @name bybit#fetchLedger
|
|
5576
|
+
* @description fetch the history of changes, actions done by the user or operations that altered the balance of the user
|
|
5577
|
+
* @see https://bybit-exchange.github.io/docs/v5/account/transaction-log
|
|
5578
|
+
* @see https://bybit-exchange.github.io/docs/v5/account/contract-transaction-log
|
|
5579
|
+
* @param {string} [code] unified currency code, default is undefined
|
|
5580
|
+
* @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
|
|
5581
|
+
* @param {int} [limit] max number of ledger entries to return, default is undefined
|
|
5582
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5583
|
+
* @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)
|
|
5584
|
+
* @param {string} [params.subType] if inverse will use v5/account/contract-transaction-log
|
|
5585
|
+
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
|
|
5586
|
+
*/
|
|
5568
5587
|
async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
5569
|
-
/**
|
|
5570
|
-
* @method
|
|
5571
|
-
* @name bybit#fetchLedger
|
|
5572
|
-
* @description fetch the history of changes, actions done by the user or operations that altered the balance of the user
|
|
5573
|
-
* @see https://bybit-exchange.github.io/docs/v5/account/transaction-log
|
|
5574
|
-
* @see https://bybit-exchange.github.io/docs/v5/account/contract-transaction-log
|
|
5575
|
-
* @param {string} [code] unified currency code, default is undefined
|
|
5576
|
-
* @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
|
|
5577
|
-
* @param {int} [limit] max number of ledger entries to return, default is undefined
|
|
5578
|
-
* @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)
|
|
5579
|
-
* @param {string} [params.subType] if inverse will use v5/account/contract-transaction-log
|
|
5580
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5581
|
-
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
|
|
5582
|
-
*/
|
|
5583
5588
|
await this.loadMarkets();
|
|
5584
5589
|
let paginate = false;
|
|
5585
5590
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchLedger', 'paginate');
|
|
@@ -5848,19 +5853,19 @@ export default class bybit extends Exchange {
|
|
|
5848
5853
|
};
|
|
5849
5854
|
return this.safeString(types, type, type);
|
|
5850
5855
|
}
|
|
5856
|
+
/**
|
|
5857
|
+
* @method
|
|
5858
|
+
* @name bybit#withdraw
|
|
5859
|
+
* @description make a withdrawal
|
|
5860
|
+
* @see https://bybit-exchange.github.io/docs/v5/asset/withdraw
|
|
5861
|
+
* @param {string} code unified currency code
|
|
5862
|
+
* @param {float} amount the amount to withdraw
|
|
5863
|
+
* @param {string} address the address to withdraw to
|
|
5864
|
+
* @param {string} tag
|
|
5865
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5866
|
+
* @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
5867
|
+
*/
|
|
5851
5868
|
async withdraw(code, amount, address, tag = undefined, params = {}) {
|
|
5852
|
-
/**
|
|
5853
|
-
* @method
|
|
5854
|
-
* @name bybit#withdraw
|
|
5855
|
-
* @description make a withdrawal
|
|
5856
|
-
* @see https://bybit-exchange.github.io/docs/v5/asset/withdraw
|
|
5857
|
-
* @param {string} code unified currency code
|
|
5858
|
-
* @param {float} amount the amount to withdraw
|
|
5859
|
-
* @param {string} address the address to withdraw to
|
|
5860
|
-
* @param {string} tag
|
|
5861
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5862
|
-
* @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
5863
|
-
*/
|
|
5864
5869
|
[tag, params] = this.handleWithdrawTagAndParams(tag, params);
|
|
5865
5870
|
let accountType = undefined;
|
|
5866
5871
|
[accountType, params] = this.handleOptionAndParams(params, 'withdraw', 'accountType', 'SPOT');
|
|
@@ -5897,16 +5902,16 @@ export default class bybit extends Exchange {
|
|
|
5897
5902
|
const result = this.safeDict(response, 'result', {});
|
|
5898
5903
|
return this.parseTransaction(result, currency);
|
|
5899
5904
|
}
|
|
5905
|
+
/**
|
|
5906
|
+
* @method
|
|
5907
|
+
* @name bybit#fetchPosition
|
|
5908
|
+
* @description fetch data on a single open contract trade position
|
|
5909
|
+
* @see https://bybit-exchange.github.io/docs/v5/position
|
|
5910
|
+
* @param {string} symbol unified market symbol of the market the position is held in, default is undefined
|
|
5911
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5912
|
+
* @returns {object} a [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
5913
|
+
*/
|
|
5900
5914
|
async fetchPosition(symbol, params = {}) {
|
|
5901
|
-
/**
|
|
5902
|
-
* @method
|
|
5903
|
-
* @name bybit#fetchPosition
|
|
5904
|
-
* @description fetch data on a single open contract trade position
|
|
5905
|
-
* @see https://bybit-exchange.github.io/docs/v5/position
|
|
5906
|
-
* @param {string} symbol unified market symbol of the market the position is held in, default is undefined
|
|
5907
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5908
|
-
* @returns {object} a [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
5909
|
-
*/
|
|
5910
5915
|
if (symbol === undefined) {
|
|
5911
5916
|
throw new ArgumentsRequired(this.id + ' fetchPosition() requires a symbol argument');
|
|
5912
5917
|
}
|
|
@@ -5969,20 +5974,20 @@ export default class bybit extends Exchange {
|
|
|
5969
5974
|
position['datetime'] = this.iso8601(timestamp);
|
|
5970
5975
|
return position;
|
|
5971
5976
|
}
|
|
5977
|
+
/**
|
|
5978
|
+
* @method
|
|
5979
|
+
* @name bybit#fetchPositions
|
|
5980
|
+
* @description fetch all open positions
|
|
5981
|
+
* @see https://bybit-exchange.github.io/docs/v5/position
|
|
5982
|
+
* @param {string[]} symbols list of unified market symbols
|
|
5983
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5984
|
+
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
5985
|
+
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
5986
|
+
* @param {string} [params.baseCoin] Base coin. Supports linear, inverse & option
|
|
5987
|
+
* @param {string} [params.settleCoin] Settle coin. Supports linear, inverse & option
|
|
5988
|
+
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
5989
|
+
*/
|
|
5972
5990
|
async fetchPositions(symbols = undefined, params = {}) {
|
|
5973
|
-
/**
|
|
5974
|
-
* @method
|
|
5975
|
-
* @name bybit#fetchPositions
|
|
5976
|
-
* @description fetch all open positions
|
|
5977
|
-
* @see https://bybit-exchange.github.io/docs/v5/position
|
|
5978
|
-
* @param {string[]} symbols list of unified market symbols
|
|
5979
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5980
|
-
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
5981
|
-
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
5982
|
-
* @param {string} [params.baseCoin] Base coin. Supports linear, inverse & option
|
|
5983
|
-
* @param {string} [params.settleCoin] Settle coin. Supports linear, inverse & option
|
|
5984
|
-
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
5985
|
-
*/
|
|
5986
5991
|
await this.loadMarkets();
|
|
5987
5992
|
let symbol = undefined;
|
|
5988
5993
|
if ((symbols !== undefined) && Array.isArray(symbols)) {
|
|
@@ -6318,16 +6323,16 @@ export default class bybit extends Exchange {
|
|
|
6318
6323
|
'hedged': hedged,
|
|
6319
6324
|
});
|
|
6320
6325
|
}
|
|
6326
|
+
/**
|
|
6327
|
+
* @method
|
|
6328
|
+
* @name bybit#fetchLeverage
|
|
6329
|
+
* @description fetch the set leverage for a market
|
|
6330
|
+
* @see https://bybit-exchange.github.io/docs/v5/position
|
|
6331
|
+
* @param {string} symbol unified market symbol
|
|
6332
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6333
|
+
* @returns {object} a [leverage structure]{@link https://docs.ccxt.com/#/?id=leverage-structure}
|
|
6334
|
+
*/
|
|
6321
6335
|
async fetchLeverage(symbol, params = {}) {
|
|
6322
|
-
/**
|
|
6323
|
-
* @method
|
|
6324
|
-
* @name bybit#fetchLeverage
|
|
6325
|
-
* @description fetch the set leverage for a market
|
|
6326
|
-
* @see https://bybit-exchange.github.io/docs/v5/position
|
|
6327
|
-
* @param {string} symbol unified market symbol
|
|
6328
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6329
|
-
* @returns {object} a [leverage structure]{@link https://docs.ccxt.com/#/?id=leverage-structure}
|
|
6330
|
-
*/
|
|
6331
6336
|
await this.loadMarkets();
|
|
6332
6337
|
const market = this.market(symbol);
|
|
6333
6338
|
const position = await this.fetchPosition(symbol, params);
|
|
@@ -6344,19 +6349,19 @@ export default class bybit extends Exchange {
|
|
|
6344
6349
|
'shortLeverage': leverageValue,
|
|
6345
6350
|
};
|
|
6346
6351
|
}
|
|
6352
|
+
/**
|
|
6353
|
+
* @method
|
|
6354
|
+
* @name bybit#setMarginMode
|
|
6355
|
+
* @description set margin mode (account) or trade mode (symbol)
|
|
6356
|
+
* @see https://bybit-exchange.github.io/docs/v5/account/set-margin-mode
|
|
6357
|
+
* @see https://bybit-exchange.github.io/docs/v5/position/cross-isolate
|
|
6358
|
+
* @param {string} marginMode account mode must be either [isolated, cross, portfolio], trade mode must be either [isolated, cross]
|
|
6359
|
+
* @param {string} symbol unified market symbol of the market the position is held in, default is undefined
|
|
6360
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6361
|
+
* @param {string} [params.leverage] the rate of leverage, is required if setting trade mode (symbol)
|
|
6362
|
+
* @returns {object} response from the exchange
|
|
6363
|
+
*/
|
|
6347
6364
|
async setMarginMode(marginMode, symbol = undefined, params = {}) {
|
|
6348
|
-
/**
|
|
6349
|
-
* @method
|
|
6350
|
-
* @name bybit#setMarginMode
|
|
6351
|
-
* @description set margin mode (account) or trade mode (symbol)
|
|
6352
|
-
* @see https://bybit-exchange.github.io/docs/v5/account/set-margin-mode
|
|
6353
|
-
* @see https://bybit-exchange.github.io/docs/v5/position/cross-isolate
|
|
6354
|
-
* @param {string} marginMode account mode must be either [isolated, cross, portfolio], trade mode must be either [isolated, cross]
|
|
6355
|
-
* @param {string} symbol unified market symbol of the market the position is held in, default is undefined
|
|
6356
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6357
|
-
* @param {string} [params.leverage] the rate of leverage, is required if setting trade mode (symbol)
|
|
6358
|
-
* @returns {object} response from the exchange
|
|
6359
|
-
*/
|
|
6360
6365
|
await this.loadMarkets();
|
|
6361
6366
|
const [enableUnifiedMargin, enableUnifiedAccount] = await this.isUnifiedEnabled();
|
|
6362
6367
|
const isUnifiedAccount = (enableUnifiedMargin || enableUnifiedAccount);
|
|
@@ -6448,19 +6453,19 @@ export default class bybit extends Exchange {
|
|
|
6448
6453
|
}
|
|
6449
6454
|
return response;
|
|
6450
6455
|
}
|
|
6456
|
+
/**
|
|
6457
|
+
* @method
|
|
6458
|
+
* @name bybit#setLeverage
|
|
6459
|
+
* @description set the level of leverage for a market
|
|
6460
|
+
* @see https://bybit-exchange.github.io/docs/v5/position/leverage
|
|
6461
|
+
* @param {float} leverage the rate of leverage
|
|
6462
|
+
* @param {string} symbol unified market symbol
|
|
6463
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6464
|
+
* @param {string} [params.buyLeverage] leverage for buy side
|
|
6465
|
+
* @param {string} [params.sellLeverage] leverage for sell side
|
|
6466
|
+
* @returns {object} response from the exchange
|
|
6467
|
+
*/
|
|
6451
6468
|
async setLeverage(leverage, symbol = undefined, params = {}) {
|
|
6452
|
-
/**
|
|
6453
|
-
* @method
|
|
6454
|
-
* @name bybit#setLeverage
|
|
6455
|
-
* @description set the level of leverage for a market
|
|
6456
|
-
* @see https://bybit-exchange.github.io/docs/v5/position/leverage
|
|
6457
|
-
* @param {float} leverage the rate of leverage
|
|
6458
|
-
* @param {string} symbol unified market symbol
|
|
6459
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6460
|
-
* @param {string} [params.buyLeverage] leverage for buy side
|
|
6461
|
-
* @param {string} [params.sellLeverage] leverage for sell side
|
|
6462
|
-
* @returns {object} response from the exchange
|
|
6463
|
-
*/
|
|
6464
6469
|
if (symbol === undefined) {
|
|
6465
6470
|
throw new ArgumentsRequired(this.id + ' setLeverage() requires a symbol argument');
|
|
6466
6471
|
}
|
|
@@ -6490,17 +6495,17 @@ export default class bybit extends Exchange {
|
|
|
6490
6495
|
const response = await this.privatePostV5PositionSetLeverage(this.extend(request, params));
|
|
6491
6496
|
return response;
|
|
6492
6497
|
}
|
|
6498
|
+
/**
|
|
6499
|
+
* @method
|
|
6500
|
+
* @name bybit#setPositionMode
|
|
6501
|
+
* @description set hedged to true or false for a market
|
|
6502
|
+
* @see https://bybit-exchange.github.io/docs/v5/position/position-mode
|
|
6503
|
+
* @param {bool} hedged
|
|
6504
|
+
* @param {string} symbol used for unified account with inverse market
|
|
6505
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6506
|
+
* @returns {object} response from the exchange
|
|
6507
|
+
*/
|
|
6493
6508
|
async setPositionMode(hedged, symbol = undefined, params = {}) {
|
|
6494
|
-
/**
|
|
6495
|
-
* @method
|
|
6496
|
-
* @name bybit#setPositionMode
|
|
6497
|
-
* @description set hedged to true or false for a market
|
|
6498
|
-
* @see https://bybit-exchange.github.io/docs/v5/position/position-mode
|
|
6499
|
-
* @param {bool} hedged
|
|
6500
|
-
* @param {string} symbol used for unified account with inverse market
|
|
6501
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6502
|
-
* @returns {object} response from the exchange
|
|
6503
|
-
*/
|
|
6504
6509
|
await this.loadMarkets();
|
|
6505
6510
|
let market = undefined;
|
|
6506
6511
|
if (symbol !== undefined) {
|
|
@@ -6599,18 +6604,18 @@ export default class bybit extends Exchange {
|
|
|
6599
6604
|
market = this.safeMarket(id, market, undefined, 'contract');
|
|
6600
6605
|
return this.parseOpenInterests(data, market, since, limit);
|
|
6601
6606
|
}
|
|
6607
|
+
/**
|
|
6608
|
+
* @method
|
|
6609
|
+
* @name bybit#fetchOpenInterest
|
|
6610
|
+
* @description Retrieves the open interest of a derivative trading pair
|
|
6611
|
+
* @see https://bybit-exchange.github.io/docs/v5/market/open-interest
|
|
6612
|
+
* @param {string} symbol Unified CCXT market symbol
|
|
6613
|
+
* @param {object} [params] exchange specific parameters
|
|
6614
|
+
* @param {string} [params.interval] 5m, 15m, 30m, 1h, 4h, 1d
|
|
6615
|
+
* @param {string} [params.category] "linear" or "inverse"
|
|
6616
|
+
* @returns {object} an open interest structure{@link https://docs.ccxt.com/#/?id=open-interest-structure}
|
|
6617
|
+
*/
|
|
6602
6618
|
async fetchOpenInterest(symbol, params = {}) {
|
|
6603
|
-
/**
|
|
6604
|
-
* @method
|
|
6605
|
-
* @name bybit#fetchOpenInterest
|
|
6606
|
-
* @description Retrieves the open interest of a derivative trading pair
|
|
6607
|
-
* @see https://bybit-exchange.github.io/docs/v5/market/open-interest
|
|
6608
|
-
* @param {string} symbol Unified CCXT market symbol
|
|
6609
|
-
* @param {object} [params] exchange specific parameters
|
|
6610
|
-
* @param {string} [params.interval] 5m, 15m, 30m, 1h, 4h, 1d
|
|
6611
|
-
* @param {string} [params.category] "linear" or "inverse"
|
|
6612
|
-
* @returns {object} an open interest structure{@link https://docs.ccxt.com/#/?id=open-interest-structure}
|
|
6613
|
-
*/
|
|
6614
6619
|
await this.loadMarkets();
|
|
6615
6620
|
let market = this.market(symbol);
|
|
6616
6621
|
if (!market['contract']) {
|
|
@@ -6659,20 +6664,20 @@ export default class bybit extends Exchange {
|
|
|
6659
6664
|
const data = this.addPaginationCursorToResult(response);
|
|
6660
6665
|
return this.parseOpenInterest(data[0], market);
|
|
6661
6666
|
}
|
|
6667
|
+
/**
|
|
6668
|
+
* @method
|
|
6669
|
+
* @name bybit#fetchOpenInterestHistory
|
|
6670
|
+
* @description Gets the total amount of unsettled contracts. In other words, the total number of contracts held in open positions
|
|
6671
|
+
* @see https://bybit-exchange.github.io/docs/v5/market/open-interest
|
|
6672
|
+
* @param {string} symbol Unified market symbol
|
|
6673
|
+
* @param {string} timeframe "5m", 15m, 30m, 1h, 4h, 1d
|
|
6674
|
+
* @param {int} [since] Not used by Bybit
|
|
6675
|
+
* @param {int} [limit] The number of open interest structures to return. Max 200, default 50
|
|
6676
|
+
* @param {object} [params] Exchange specific parameters
|
|
6677
|
+
* @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)
|
|
6678
|
+
* @returns An array of open interest structures
|
|
6679
|
+
*/
|
|
6662
6680
|
async fetchOpenInterestHistory(symbol, timeframe = '1h', since = undefined, limit = undefined, params = {}) {
|
|
6663
|
-
/**
|
|
6664
|
-
* @method
|
|
6665
|
-
* @name bybit#fetchOpenInterestHistory
|
|
6666
|
-
* @description Gets the total amount of unsettled contracts. In other words, the total number of contracts held in open positions
|
|
6667
|
-
* @see https://bybit-exchange.github.io/docs/v5/market/open-interest
|
|
6668
|
-
* @param {string} symbol Unified market symbol
|
|
6669
|
-
* @param {string} timeframe "5m", 15m, 30m, 1h, 4h, 1d
|
|
6670
|
-
* @param {int} [since] Not used by Bybit
|
|
6671
|
-
* @param {int} [limit] The number of open interest structures to return. Max 200, default 50
|
|
6672
|
-
* @param {object} [params] Exchange specific parameters
|
|
6673
|
-
* @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)
|
|
6674
|
-
* @returns An array of open interest structures
|
|
6675
|
-
*/
|
|
6676
6681
|
if (timeframe === '1m') {
|
|
6677
6682
|
throw new BadRequest(this.id + 'fetchOpenInterestHistory cannot use the 1m timeframe');
|
|
6678
6683
|
}
|
|
@@ -6713,16 +6718,16 @@ export default class bybit extends Exchange {
|
|
|
6713
6718
|
'info': interest,
|
|
6714
6719
|
}, market);
|
|
6715
6720
|
}
|
|
6721
|
+
/**
|
|
6722
|
+
* @method
|
|
6723
|
+
* @name bybit#fetchCrossBorrowRate
|
|
6724
|
+
* @description fetch the rate of interest to borrow a currency for margin trading
|
|
6725
|
+
* @see https://bybit-exchange.github.io/docs/zh-TW/v5/spot-margin-normal/interest-quota
|
|
6726
|
+
* @param {string} code unified currency code
|
|
6727
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6728
|
+
* @returns {object} a [borrow rate structure]{@link https://docs.ccxt.com/#/?id=borrow-rate-structure}
|
|
6729
|
+
*/
|
|
6716
6730
|
async fetchCrossBorrowRate(code, params = {}) {
|
|
6717
|
-
/**
|
|
6718
|
-
* @method
|
|
6719
|
-
* @name bybit#fetchCrossBorrowRate
|
|
6720
|
-
* @description fetch the rate of interest to borrow a currency for margin trading
|
|
6721
|
-
* @see https://bybit-exchange.github.io/docs/zh-TW/v5/spot-margin-normal/interest-quota
|
|
6722
|
-
* @param {string} code unified currency code
|
|
6723
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6724
|
-
* @returns {object} a [borrow rate structure]{@link https://docs.ccxt.com/#/?id=borrow-rate-structure}
|
|
6725
|
-
*/
|
|
6726
6731
|
await this.loadMarkets();
|
|
6727
6732
|
const currency = this.currency(code);
|
|
6728
6733
|
const request = {
|
|
@@ -6779,19 +6784,19 @@ export default class bybit extends Exchange {
|
|
|
6779
6784
|
'info': info,
|
|
6780
6785
|
};
|
|
6781
6786
|
}
|
|
6787
|
+
/**
|
|
6788
|
+
* @method
|
|
6789
|
+
* @name bybit#fetchBorrowInterest
|
|
6790
|
+
* @description fetch the interest owed by the user for borrowing currency for margin trading
|
|
6791
|
+
* @see https://bybit-exchange.github.io/docs/zh-TW/v5/spot-margin-normal/account-info
|
|
6792
|
+
* @param {string} code unified currency code
|
|
6793
|
+
* @param {string} symbol unified market symbol when fetch interest in isolated markets
|
|
6794
|
+
* @param {number} [since] the earliest time in ms to fetch borrrow interest for
|
|
6795
|
+
* @param {number} [limit] the maximum number of structures to retrieve
|
|
6796
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6797
|
+
* @returns {object[]} a list of [borrow interest structures]{@link https://docs.ccxt.com/#/?id=borrow-interest-structure}
|
|
6798
|
+
*/
|
|
6782
6799
|
async fetchBorrowInterest(code = undefined, symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
6783
|
-
/**
|
|
6784
|
-
* @method
|
|
6785
|
-
* @name bybit#fetchBorrowInterest
|
|
6786
|
-
* @description fetch the interest owed by the user for borrowing currency for margin trading
|
|
6787
|
-
* @see https://bybit-exchange.github.io/docs/zh-TW/v5/spot-margin-normal/account-info
|
|
6788
|
-
* @param {string} code unified currency code
|
|
6789
|
-
* @param {string} symbol unified market symbol when fetch interest in isolated markets
|
|
6790
|
-
* @param {number} [since] the earliest time in ms to fetch borrrow interest for
|
|
6791
|
-
* @param {number} [limit] the maximum number of structures to retrieve
|
|
6792
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6793
|
-
* @returns {object[]} a list of [borrow interest structures]{@link https://docs.ccxt.com/#/?id=borrow-interest-structure}
|
|
6794
|
-
*/
|
|
6795
6800
|
await this.loadMarkets();
|
|
6796
6801
|
const request = {};
|
|
6797
6802
|
const response = await this.privateGetV5SpotCrossMarginTradeAccount(this.extend(request, params));
|
|
@@ -6825,19 +6830,19 @@ export default class bybit extends Exchange {
|
|
|
6825
6830
|
const interest = this.parseBorrowInterests(rows, undefined);
|
|
6826
6831
|
return this.filterByCurrencySinceLimit(interest, code, since, limit);
|
|
6827
6832
|
}
|
|
6833
|
+
/**
|
|
6834
|
+
* @method
|
|
6835
|
+
* @name bybit#fetchBorrowRateHistory
|
|
6836
|
+
* @description retrieves a history of a currencies borrow interest rate at specific time slots
|
|
6837
|
+
* @see https://bybit-exchange.github.io/docs/v5/spot-margin-uta/historical-interest
|
|
6838
|
+
* @param {string} code unified currency code
|
|
6839
|
+
* @param {int} [since] timestamp for the earliest borrow rate
|
|
6840
|
+
* @param {int} [limit] the maximum number of [borrow rate structures]{@link https://docs.ccxt.com/#/?id=borrow-rate-structure} to retrieve
|
|
6841
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6842
|
+
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
6843
|
+
* @returns {object[]} an array of [borrow rate structures]{@link https://docs.ccxt.com/#/?id=borrow-rate-structure}
|
|
6844
|
+
*/
|
|
6828
6845
|
async fetchBorrowRateHistory(code, since = undefined, limit = undefined, params = {}) {
|
|
6829
|
-
/**
|
|
6830
|
-
* @method
|
|
6831
|
-
* @name bybit#fetchBorrowRateHistory
|
|
6832
|
-
* @description retrieves a history of a currencies borrow interest rate at specific time slots
|
|
6833
|
-
* @see https://bybit-exchange.github.io/docs/v5/spot-margin-uta/historical-interest
|
|
6834
|
-
* @param {string} code unified currency code
|
|
6835
|
-
* @param {int} [since] timestamp for the earliest borrow rate
|
|
6836
|
-
* @param {int} [limit] the maximum number of [borrow rate structures]{@link https://docs.ccxt.com/#/?id=borrow-rate-structure} to retrieve
|
|
6837
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6838
|
-
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
6839
|
-
* @returns {object[]} an array of [borrow rate structures]{@link https://docs.ccxt.com/#/?id=borrow-rate-structure}
|
|
6840
|
-
*/
|
|
6841
6846
|
await this.loadMarkets();
|
|
6842
6847
|
const currency = this.currency(code);
|
|
6843
6848
|
const request = {
|
|
@@ -6899,20 +6904,20 @@ export default class bybit extends Exchange {
|
|
|
6899
6904
|
'datetime': undefined,
|
|
6900
6905
|
};
|
|
6901
6906
|
}
|
|
6907
|
+
/**
|
|
6908
|
+
* @method
|
|
6909
|
+
* @name bybit#transfer
|
|
6910
|
+
* @description transfer currency internally between wallets on the same account
|
|
6911
|
+
* @see https://bybit-exchange.github.io/docs/v5/asset/create-inter-transfer
|
|
6912
|
+
* @param {string} code unified currency code
|
|
6913
|
+
* @param {float} amount amount to transfer
|
|
6914
|
+
* @param {string} fromAccount account to transfer from
|
|
6915
|
+
* @param {string} toAccount account to transfer to
|
|
6916
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6917
|
+
* @param {string} [params.transferId] UUID, which is unique across the platform
|
|
6918
|
+
* @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
6919
|
+
*/
|
|
6902
6920
|
async transfer(code, amount, fromAccount, toAccount, params = {}) {
|
|
6903
|
-
/**
|
|
6904
|
-
* @method
|
|
6905
|
-
* @name bybit#transfer
|
|
6906
|
-
* @description transfer currency internally between wallets on the same account
|
|
6907
|
-
* @see https://bybit-exchange.github.io/docs/v5/asset/create-inter-transfer
|
|
6908
|
-
* @param {string} code unified currency code
|
|
6909
|
-
* @param {float} amount amount to transfer
|
|
6910
|
-
* @param {string} fromAccount account to transfer from
|
|
6911
|
-
* @param {string} toAccount account to transfer to
|
|
6912
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6913
|
-
* @param {string} [params.transferId] UUID, which is unique across the platform
|
|
6914
|
-
* @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
6915
|
-
*/
|
|
6916
6921
|
await this.loadMarkets();
|
|
6917
6922
|
const transferId = this.safeString(params, 'transferId', this.uuid());
|
|
6918
6923
|
const accountTypes = this.safeDict(this.options, 'accountsByType', {});
|
|
@@ -6952,20 +6957,20 @@ export default class bybit extends Exchange {
|
|
|
6952
6957
|
'status': status,
|
|
6953
6958
|
});
|
|
6954
6959
|
}
|
|
6960
|
+
/**
|
|
6961
|
+
* @method
|
|
6962
|
+
* @name bybit#fetchTransfers
|
|
6963
|
+
* @description fetch a history of internal transfers made on an account
|
|
6964
|
+
* @see https://bybit-exchange.github.io/docs/v5/asset/inter-transfer-list
|
|
6965
|
+
* @param {string} code unified currency code of the currency transferred
|
|
6966
|
+
* @param {int} [since] the earliest time in ms to fetch transfers for
|
|
6967
|
+
* @param {int} [limit] the maximum number of transfer structures to retrieve
|
|
6968
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6969
|
+
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
6970
|
+
* @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)
|
|
6971
|
+
* @returns {object[]} a list of [transfer structures]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
6972
|
+
*/
|
|
6955
6973
|
async fetchTransfers(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
6956
|
-
/**
|
|
6957
|
-
* @method
|
|
6958
|
-
* @name bybit#fetchTransfers
|
|
6959
|
-
* @description fetch a history of internal transfers made on an account
|
|
6960
|
-
* @see https://bybit-exchange.github.io/docs/v5/asset/inter-transfer-list
|
|
6961
|
-
* @param {string} code unified currency code of the currency transferred
|
|
6962
|
-
* @param {int} [since] the earliest time in ms to fetch transfers for
|
|
6963
|
-
* @param {int} [limit] the maximum number of transfer structures to retrieve
|
|
6964
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6965
|
-
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
6966
|
-
* @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)
|
|
6967
|
-
* @returns {object[]} a list of [transfer structures]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
6968
|
-
*/
|
|
6969
6974
|
await this.loadMarkets();
|
|
6970
6975
|
let paginate = false;
|
|
6971
6976
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchTransfers', 'paginate');
|
|
@@ -7011,17 +7016,17 @@ export default class bybit extends Exchange {
|
|
|
7011
7016
|
const data = this.addPaginationCursorToResult(response);
|
|
7012
7017
|
return this.parseTransfers(data, currency, since, limit);
|
|
7013
7018
|
}
|
|
7019
|
+
/**
|
|
7020
|
+
* @method
|
|
7021
|
+
* @name bybit#borrowCrossMargin
|
|
7022
|
+
* @description create a loan to borrow margin
|
|
7023
|
+
* @see https://bybit-exchange.github.io/docs/v5/spot-margin-normal/borrow
|
|
7024
|
+
* @param {string} code unified currency code of the currency to borrow
|
|
7025
|
+
* @param {float} amount the amount to borrow
|
|
7026
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7027
|
+
* @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
|
|
7028
|
+
*/
|
|
7014
7029
|
async borrowCrossMargin(code, amount, params = {}) {
|
|
7015
|
-
/**
|
|
7016
|
-
* @method
|
|
7017
|
-
* @name bybit#borrowCrossMargin
|
|
7018
|
-
* @description create a loan to borrow margin
|
|
7019
|
-
* @see https://bybit-exchange.github.io/docs/v5/spot-margin-normal/borrow
|
|
7020
|
-
* @param {string} code unified currency code of the currency to borrow
|
|
7021
|
-
* @param {float} amount the amount to borrow
|
|
7022
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7023
|
-
* @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
|
|
7024
|
-
*/
|
|
7025
7030
|
await this.loadMarkets();
|
|
7026
7031
|
const currency = this.currency(code);
|
|
7027
7032
|
const request = {
|
|
@@ -7047,17 +7052,17 @@ export default class bybit extends Exchange {
|
|
|
7047
7052
|
'amount': amount,
|
|
7048
7053
|
});
|
|
7049
7054
|
}
|
|
7055
|
+
/**
|
|
7056
|
+
* @method
|
|
7057
|
+
* @name bybit#repayCrossMargin
|
|
7058
|
+
* @description repay borrowed margin and interest
|
|
7059
|
+
* @see https://bybit-exchange.github.io/docs/v5/spot-margin-normal/repay
|
|
7060
|
+
* @param {string} code unified currency code of the currency to repay
|
|
7061
|
+
* @param {float} amount the amount to repay
|
|
7062
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7063
|
+
* @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
|
|
7064
|
+
*/
|
|
7050
7065
|
async repayCrossMargin(code, amount, params = {}) {
|
|
7051
|
-
/**
|
|
7052
|
-
* @method
|
|
7053
|
-
* @name bybit#repayCrossMargin
|
|
7054
|
-
* @description repay borrowed margin and interest
|
|
7055
|
-
* @see https://bybit-exchange.github.io/docs/v5/spot-margin-normal/repay
|
|
7056
|
-
* @param {string} code unified currency code of the currency to repay
|
|
7057
|
-
* @param {float} amount the amount to repay
|
|
7058
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7059
|
-
* @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
|
|
7060
|
-
*/
|
|
7061
7066
|
await this.loadMarkets();
|
|
7062
7067
|
const currency = this.currency(code);
|
|
7063
7068
|
const request = {
|
|
@@ -7194,16 +7199,16 @@ export default class bybit extends Exchange {
|
|
|
7194
7199
|
const tiers = this.safeList(result, 'list');
|
|
7195
7200
|
return this.parseMarketLeverageTiers(tiers, market);
|
|
7196
7201
|
}
|
|
7202
|
+
/**
|
|
7203
|
+
* @method
|
|
7204
|
+
* @name bybit#fetchMarketLeverageTiers
|
|
7205
|
+
* @description retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes for a single market
|
|
7206
|
+
* @see https://bybit-exchange.github.io/docs/v5/market/risk-limit
|
|
7207
|
+
* @param {string} symbol unified market symbol
|
|
7208
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7209
|
+
* @returns {object} a [leverage tiers structure]{@link https://docs.ccxt.com/#/?id=leverage-tiers-structure}
|
|
7210
|
+
*/
|
|
7197
7211
|
async fetchMarketLeverageTiers(symbol, params = {}) {
|
|
7198
|
-
/**
|
|
7199
|
-
* @method
|
|
7200
|
-
* @name bybit#fetchMarketLeverageTiers
|
|
7201
|
-
* @description retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes for a single market
|
|
7202
|
-
* @see https://bybit-exchange.github.io/docs/v5/market/risk-limit
|
|
7203
|
-
* @param {string} symbol unified market symbol
|
|
7204
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7205
|
-
* @returns {object} a [leverage tiers structure]{@link https://docs.ccxt.com/#/?id=leverage-tiers-structure}
|
|
7206
|
-
*/
|
|
7207
7212
|
await this.loadMarkets();
|
|
7208
7213
|
const request = {};
|
|
7209
7214
|
let market = undefined;
|
|
@@ -7234,16 +7239,16 @@ export default class bybit extends Exchange {
|
|
|
7234
7239
|
'tierBased': undefined,
|
|
7235
7240
|
};
|
|
7236
7241
|
}
|
|
7242
|
+
/**
|
|
7243
|
+
* @method
|
|
7244
|
+
* @name bybit#fetchTradingFee
|
|
7245
|
+
* @description fetch the trading fees for a market
|
|
7246
|
+
* @see https://bybit-exchange.github.io/docs/v5/account/fee-rate
|
|
7247
|
+
* @param {string} symbol unified market symbol
|
|
7248
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7249
|
+
* @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
7250
|
+
*/
|
|
7237
7251
|
async fetchTradingFee(symbol, params = {}) {
|
|
7238
|
-
/**
|
|
7239
|
-
* @method
|
|
7240
|
-
* @name bybit#fetchTradingFee
|
|
7241
|
-
* @description fetch the trading fees for a market
|
|
7242
|
-
* @see https://bybit-exchange.github.io/docs/v5/account/fee-rate
|
|
7243
|
-
* @param {string} symbol unified market symbol
|
|
7244
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7245
|
-
* @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
7246
|
-
*/
|
|
7247
7252
|
await this.loadMarkets();
|
|
7248
7253
|
const market = this.market(symbol);
|
|
7249
7254
|
const request = {
|
|
@@ -7286,16 +7291,16 @@ export default class bybit extends Exchange {
|
|
|
7286
7291
|
const first = this.safeDict(fees, 0, {});
|
|
7287
7292
|
return this.parseTradingFee(first, market);
|
|
7288
7293
|
}
|
|
7294
|
+
/**
|
|
7295
|
+
* @method
|
|
7296
|
+
* @name bybit#fetchTradingFees
|
|
7297
|
+
* @description fetch the trading fees for multiple markets
|
|
7298
|
+
* @see https://bybit-exchange.github.io/docs/v5/account/fee-rate
|
|
7299
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7300
|
+
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
7301
|
+
* @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
|
|
7302
|
+
*/
|
|
7289
7303
|
async fetchTradingFees(params = {}) {
|
|
7290
|
-
/**
|
|
7291
|
-
* @method
|
|
7292
|
-
* @name bybit#fetchTradingFees
|
|
7293
|
-
* @description fetch the trading fees for multiple markets
|
|
7294
|
-
* @see https://bybit-exchange.github.io/docs/v5/account/fee-rate
|
|
7295
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7296
|
-
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
7297
|
-
* @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
|
|
7298
|
-
*/
|
|
7299
7304
|
await this.loadMarkets();
|
|
7300
7305
|
let type = undefined;
|
|
7301
7306
|
[type, params] = this.handleOptionAndParams(params, 'fetchTradingFees', 'type', 'future');
|
|
@@ -7383,16 +7388,16 @@ export default class bybit extends Exchange {
|
|
|
7383
7388
|
}
|
|
7384
7389
|
return result;
|
|
7385
7390
|
}
|
|
7391
|
+
/**
|
|
7392
|
+
* @method
|
|
7393
|
+
* @name bybit#fetchDepositWithdrawFees
|
|
7394
|
+
* @description fetch deposit and withdraw fees
|
|
7395
|
+
* @see https://bybit-exchange.github.io/docs/v5/asset/coin-info
|
|
7396
|
+
* @param {string[]} codes list of unified currency codes
|
|
7397
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7398
|
+
* @returns {object} a list of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
7399
|
+
*/
|
|
7386
7400
|
async fetchDepositWithdrawFees(codes = undefined, params = {}) {
|
|
7387
|
-
/**
|
|
7388
|
-
* @method
|
|
7389
|
-
* @name bybit#fetchDepositWithdrawFees
|
|
7390
|
-
* @description fetch deposit and withdraw fees
|
|
7391
|
-
* @see https://bybit-exchange.github.io/docs/v5/asset/coin-info
|
|
7392
|
-
* @param {string[]} codes list of unified currency codes
|
|
7393
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7394
|
-
* @returns {object} a list of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
7395
|
-
*/
|
|
7396
7401
|
this.checkRequiredCredentials();
|
|
7397
7402
|
await this.loadMarkets();
|
|
7398
7403
|
const response = await this.privateGetV5AssetCoinQueryInfo(params);
|
|
@@ -7430,20 +7435,20 @@ export default class bybit extends Exchange {
|
|
|
7430
7435
|
const rows = this.safeList(data, 'rows', []);
|
|
7431
7436
|
return this.parseDepositWithdrawFees(rows, codes, 'coin');
|
|
7432
7437
|
}
|
|
7438
|
+
/**
|
|
7439
|
+
* @method
|
|
7440
|
+
* @name bybit#fetchSettlementHistory
|
|
7441
|
+
* @description fetches historical settlement records
|
|
7442
|
+
* @see https://bybit-exchange.github.io/docs/v5/market/delivery-price
|
|
7443
|
+
* @param {string} symbol unified market symbol of the settlement history
|
|
7444
|
+
* @param {int} [since] timestamp in ms
|
|
7445
|
+
* @param {int} [limit] number of records
|
|
7446
|
+
* @param {object} [params] exchange specific params
|
|
7447
|
+
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
7448
|
+
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
7449
|
+
* @returns {object[]} a list of [settlement history objects]
|
|
7450
|
+
*/
|
|
7433
7451
|
async fetchSettlementHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
7434
|
-
/**
|
|
7435
|
-
* @method
|
|
7436
|
-
* @name bybit#fetchSettlementHistory
|
|
7437
|
-
* @description fetches historical settlement records
|
|
7438
|
-
* @see https://bybit-exchange.github.io/docs/v5/market/delivery-price
|
|
7439
|
-
* @param {string} symbol unified market symbol of the settlement history
|
|
7440
|
-
* @param {int} [since] timestamp in ms
|
|
7441
|
-
* @param {int} [limit] number of records
|
|
7442
|
-
* @param {object} [params] exchange specific params
|
|
7443
|
-
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
7444
|
-
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
7445
|
-
* @returns {object[]} a list of [settlement history objects]
|
|
7446
|
-
*/
|
|
7447
7452
|
await this.loadMarkets();
|
|
7448
7453
|
const request = {};
|
|
7449
7454
|
let market = undefined;
|
|
@@ -7486,20 +7491,20 @@ export default class bybit extends Exchange {
|
|
|
7486
7491
|
const sorted = this.sortBy(settlements, 'timestamp');
|
|
7487
7492
|
return this.filterBySymbolSinceLimit(sorted, market['symbol'], since, limit);
|
|
7488
7493
|
}
|
|
7494
|
+
/**
|
|
7495
|
+
* @method
|
|
7496
|
+
* @name bybit#fetchMySettlementHistory
|
|
7497
|
+
* @description fetches historical settlement records of the user
|
|
7498
|
+
* @see https://bybit-exchange.github.io/docs/v5/asset/delivery
|
|
7499
|
+
* @param {string} symbol unified market symbol of the settlement history
|
|
7500
|
+
* @param {int} [since] timestamp in ms
|
|
7501
|
+
* @param {int} [limit] number of records
|
|
7502
|
+
* @param {object} [params] exchange specific params
|
|
7503
|
+
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
7504
|
+
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
7505
|
+
* @returns {object[]} a list of [settlement history objects]
|
|
7506
|
+
*/
|
|
7489
7507
|
async fetchMySettlementHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
7490
|
-
/**
|
|
7491
|
-
* @method
|
|
7492
|
-
* @name bybit#fetchMySettlementHistory
|
|
7493
|
-
* @description fetches historical settlement records of the user
|
|
7494
|
-
* @see https://bybit-exchange.github.io/docs/v5/asset/delivery
|
|
7495
|
-
* @param {string} symbol unified market symbol of the settlement history
|
|
7496
|
-
* @param {int} [since] timestamp in ms
|
|
7497
|
-
* @param {int} [limit] number of records
|
|
7498
|
-
* @param {object} [params] exchange specific params
|
|
7499
|
-
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
7500
|
-
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
7501
|
-
* @returns {object[]} a list of [settlement history objects]
|
|
7502
|
-
*/
|
|
7503
7508
|
await this.loadMarkets();
|
|
7504
7509
|
const request = {};
|
|
7505
7510
|
let market = undefined;
|
|
@@ -7613,17 +7618,17 @@ export default class bybit extends Exchange {
|
|
|
7613
7618
|
}
|
|
7614
7619
|
return result;
|
|
7615
7620
|
}
|
|
7621
|
+
/**
|
|
7622
|
+
* @method
|
|
7623
|
+
* @name bybit#fetchVolatilityHistory
|
|
7624
|
+
* @description fetch the historical volatility of an option market based on an underlying asset
|
|
7625
|
+
* @see https://bybit-exchange.github.io/docs/v5/market/iv
|
|
7626
|
+
* @param {string} code unified currency code
|
|
7627
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7628
|
+
* @param {int} [params.period] the period in days to fetch the volatility for: 7,14,21,30,60,90,180,270
|
|
7629
|
+
* @returns {object[]} a list of [volatility history objects]{@link https://docs.ccxt.com/#/?id=volatility-structure}
|
|
7630
|
+
*/
|
|
7616
7631
|
async fetchVolatilityHistory(code, params = {}) {
|
|
7617
|
-
/**
|
|
7618
|
-
* @method
|
|
7619
|
-
* @name bybit#fetchVolatilityHistory
|
|
7620
|
-
* @description fetch the historical volatility of an option market based on an underlying asset
|
|
7621
|
-
* @see https://bybit-exchange.github.io/docs/v5/market/iv
|
|
7622
|
-
* @param {string} code unified currency code
|
|
7623
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7624
|
-
* @param {int} [params.period] the period in days to fetch the volatility for: 7,14,21,30,60,90,180,270
|
|
7625
|
-
* @returns {object[]} a list of [volatility history objects]{@link https://docs.ccxt.com/#/?id=volatility-structure}
|
|
7626
|
-
*/
|
|
7627
7632
|
await this.loadMarkets();
|
|
7628
7633
|
const currency = this.currency(code);
|
|
7629
7634
|
const request = {
|
|
@@ -7669,16 +7674,16 @@ export default class bybit extends Exchange {
|
|
|
7669
7674
|
}
|
|
7670
7675
|
return result;
|
|
7671
7676
|
}
|
|
7677
|
+
/**
|
|
7678
|
+
* @method
|
|
7679
|
+
* @name bybit#fetchGreeks
|
|
7680
|
+
* @description fetches an option contracts greeks, financial metrics used to measure the factors that affect the price of an options contract
|
|
7681
|
+
* @see https://bybit-exchange.github.io/docs/api-explorer/v5/market/tickers
|
|
7682
|
+
* @param {string} symbol unified symbol of the market to fetch greeks for
|
|
7683
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7684
|
+
* @returns {object} a [greeks structure]{@link https://docs.ccxt.com/#/?id=greeks-structure}
|
|
7685
|
+
*/
|
|
7672
7686
|
async fetchGreeks(symbol, params = {}) {
|
|
7673
|
-
/**
|
|
7674
|
-
* @method
|
|
7675
|
-
* @name bybit#fetchGreeks
|
|
7676
|
-
* @description fetches an option contracts greeks, financial metrics used to measure the factors that affect the price of an options contract
|
|
7677
|
-
* @see https://bybit-exchange.github.io/docs/api-explorer/v5/market/tickers
|
|
7678
|
-
* @param {string} symbol unified symbol of the market to fetch greeks for
|
|
7679
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7680
|
-
* @returns {object} a [greeks structure]{@link https://docs.ccxt.com/#/?id=greeks-structure}
|
|
7681
|
-
*/
|
|
7682
7687
|
await this.loadMarkets();
|
|
7683
7688
|
const market = this.market(symbol);
|
|
7684
7689
|
const request = {
|
|
@@ -7789,21 +7794,21 @@ export default class bybit extends Exchange {
|
|
|
7789
7794
|
'info': greeks,
|
|
7790
7795
|
};
|
|
7791
7796
|
}
|
|
7797
|
+
/**
|
|
7798
|
+
* @method
|
|
7799
|
+
* @name bybit#fetchMyLiquidations
|
|
7800
|
+
* @description retrieves the users liquidated positions
|
|
7801
|
+
* @see https://bybit-exchange.github.io/docs/api-explorer/v5/position/execution
|
|
7802
|
+
* @param {string} [symbol] unified CCXT market symbol
|
|
7803
|
+
* @param {int} [since] the earliest time in ms to fetch liquidations for
|
|
7804
|
+
* @param {int} [limit] the maximum number of liquidation structures to retrieve
|
|
7805
|
+
* @param {object} [params] exchange specific parameters for the exchange API endpoint
|
|
7806
|
+
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
7807
|
+
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
7808
|
+
* @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)
|
|
7809
|
+
* @returns {object} an array of [liquidation structures]{@link https://docs.ccxt.com/#/?id=liquidation-structure}
|
|
7810
|
+
*/
|
|
7792
7811
|
async fetchMyLiquidations(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
7793
|
-
/**
|
|
7794
|
-
* @method
|
|
7795
|
-
* @name bybit#fetchMyLiquidations
|
|
7796
|
-
* @description retrieves the users liquidated positions
|
|
7797
|
-
* @see https://bybit-exchange.github.io/docs/api-explorer/v5/position/execution
|
|
7798
|
-
* @param {string} [symbol] unified CCXT market symbol
|
|
7799
|
-
* @param {int} [since] the earliest time in ms to fetch liquidations for
|
|
7800
|
-
* @param {int} [limit] the maximum number of liquidation structures to retrieve
|
|
7801
|
-
* @param {object} [params] exchange specific parameters for the exchange API endpoint
|
|
7802
|
-
* @param {string} [params.type] market type, ['swap', 'option', 'spot']
|
|
7803
|
-
* @param {string} [params.subType] market subType, ['linear', 'inverse']
|
|
7804
|
-
* @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)
|
|
7805
|
-
* @returns {object} an array of [liquidation structures]{@link https://docs.ccxt.com/#/?id=liquidation-structure}
|
|
7806
|
-
*/
|
|
7807
7812
|
await this.loadMarkets();
|
|
7808
7813
|
let paginate = false;
|
|
7809
7814
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchMyLiquidations', 'paginate');
|
|
@@ -7949,18 +7954,18 @@ export default class bybit extends Exchange {
|
|
|
7949
7954
|
result[lastIndex] = last;
|
|
7950
7955
|
return result;
|
|
7951
7956
|
}
|
|
7957
|
+
/**
|
|
7958
|
+
* @method
|
|
7959
|
+
* @name bybit#fetchLeverageTiers
|
|
7960
|
+
* @description retrieve information on the maximum leverage, for different trade sizes
|
|
7961
|
+
* @see https://bybit-exchange.github.io/docs/v5/market/risk-limit
|
|
7962
|
+
* @param {string[]} [symbols] a list of unified market symbols
|
|
7963
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7964
|
+
* @param {string} [params.subType] market subType, ['linear', 'inverse'], default is 'linear'
|
|
7965
|
+
* @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)
|
|
7966
|
+
* @returns {object} a dictionary of [leverage tiers structures]{@link https://docs.ccxt.com/#/?id=leverage-tiers-structure}, indexed by market symbols
|
|
7967
|
+
*/
|
|
7952
7968
|
async fetchLeverageTiers(symbols = undefined, params = {}) {
|
|
7953
|
-
/**
|
|
7954
|
-
* @method
|
|
7955
|
-
* @name bybit#fetchLeverageTiers
|
|
7956
|
-
* @see https://bybit-exchange.github.io/docs/v5/market/risk-limit
|
|
7957
|
-
* @description retrieve information on the maximum leverage, for different trade sizes
|
|
7958
|
-
* @param {string[]} [symbols] a list of unified market symbols
|
|
7959
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7960
|
-
* @param {string} [params.subType] market subType, ['linear', 'inverse'], default is 'linear'
|
|
7961
|
-
* @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)
|
|
7962
|
-
* @returns {object} a dictionary of [leverage tiers structures]{@link https://docs.ccxt.com/#/?id=leverage-tiers-structure}, indexed by market symbols
|
|
7963
|
-
*/
|
|
7964
7969
|
await this.loadMarkets();
|
|
7965
7970
|
let market = undefined;
|
|
7966
7971
|
let symbol = undefined;
|
|
@@ -8032,6 +8037,7 @@ export default class bybit extends Exchange {
|
|
|
8032
8037
|
}
|
|
8033
8038
|
tiers.push({
|
|
8034
8039
|
'tier': this.safeInteger(tier, 'id'),
|
|
8040
|
+
'symbol': this.safeSymbol(marketId, market),
|
|
8035
8041
|
'currency': market['settle'],
|
|
8036
8042
|
'minNotional': minNotional,
|
|
8037
8043
|
'maxNotional': this.safeNumber(tier, 'riskLimitValue'),
|
|
@@ -8042,19 +8048,19 @@ export default class bybit extends Exchange {
|
|
|
8042
8048
|
}
|
|
8043
8049
|
return tiers;
|
|
8044
8050
|
}
|
|
8051
|
+
/**
|
|
8052
|
+
* @method
|
|
8053
|
+
* @name bybit#fetchFundingHistory
|
|
8054
|
+
* @description fetch the history of funding payments paid and received on this account
|
|
8055
|
+
* @see https://bybit-exchange.github.io/docs/api-explorer/v5/position/execution
|
|
8056
|
+
* @param {string} [symbol] unified market symbol
|
|
8057
|
+
* @param {int} [since] the earliest time in ms to fetch funding history for
|
|
8058
|
+
* @param {int} [limit] the maximum number of funding history structures to retrieve
|
|
8059
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8060
|
+
* @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)
|
|
8061
|
+
* @returns {object} a [funding history structure]{@link https://docs.ccxt.com/#/?id=funding-history-structure}
|
|
8062
|
+
*/
|
|
8045
8063
|
async fetchFundingHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
8046
|
-
/**
|
|
8047
|
-
* @method
|
|
8048
|
-
* @name bybit#fetchFundingHistory
|
|
8049
|
-
* @description fetch the history of funding payments paid and received on this account
|
|
8050
|
-
* @see https://bybit-exchange.github.io/docs/api-explorer/v5/position/execution
|
|
8051
|
-
* @param {string} [symbol] unified market symbol
|
|
8052
|
-
* @param {int} [since] the earliest time in ms to fetch funding history for
|
|
8053
|
-
* @param {int} [limit] the maximum number of funding history structures to retrieve
|
|
8054
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8055
|
-
* @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)
|
|
8056
|
-
* @returns {object} a [funding history structure]{@link https://docs.ccxt.com/#/?id=funding-history-structure}
|
|
8057
|
-
*/
|
|
8058
8064
|
await this.loadMarkets();
|
|
8059
8065
|
let paginate = false;
|
|
8060
8066
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchFundingHistory', 'paginate');
|
|
@@ -8142,16 +8148,16 @@ export default class bybit extends Exchange {
|
|
|
8142
8148
|
'rate': this.safeNumber(income, 'feeRate'),
|
|
8143
8149
|
};
|
|
8144
8150
|
}
|
|
8151
|
+
/**
|
|
8152
|
+
* @method
|
|
8153
|
+
* @name bybit#fetchOption
|
|
8154
|
+
* @description fetches option data that is commonly found in an option chain
|
|
8155
|
+
* @see https://bybit-exchange.github.io/docs/v5/market/tickers
|
|
8156
|
+
* @param {string} symbol unified market symbol
|
|
8157
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8158
|
+
* @returns {object} an [option chain structure]{@link https://docs.ccxt.com/#/?id=option-chain-structure}
|
|
8159
|
+
*/
|
|
8145
8160
|
async fetchOption(symbol, params = {}) {
|
|
8146
|
-
/**
|
|
8147
|
-
* @method
|
|
8148
|
-
* @name bybit#fetchOption
|
|
8149
|
-
* @description fetches option data that is commonly found in an option chain
|
|
8150
|
-
* @see https://bybit-exchange.github.io/docs/v5/market/tickers
|
|
8151
|
-
* @param {string} symbol unified market symbol
|
|
8152
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8153
|
-
* @returns {object} an [option chain structure]{@link https://docs.ccxt.com/#/?id=option-chain-structure}
|
|
8154
|
-
*/
|
|
8155
8161
|
await this.loadMarkets();
|
|
8156
8162
|
const market = this.market(symbol);
|
|
8157
8163
|
const request = {
|
|
@@ -8204,16 +8210,16 @@ export default class bybit extends Exchange {
|
|
|
8204
8210
|
const chain = this.safeDict(resultList, 0, {});
|
|
8205
8211
|
return this.parseOption(chain, undefined, market);
|
|
8206
8212
|
}
|
|
8213
|
+
/**
|
|
8214
|
+
* @method
|
|
8215
|
+
* @name bybit#fetchOptionChain
|
|
8216
|
+
* @description fetches data for an underlying asset that is commonly found in an option chain
|
|
8217
|
+
* @see https://bybit-exchange.github.io/docs/v5/market/tickers
|
|
8218
|
+
* @param {string} code base currency to fetch an option chain for
|
|
8219
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8220
|
+
* @returns {object} a list of [option chain structures]{@link https://docs.ccxt.com/#/?id=option-chain-structure}
|
|
8221
|
+
*/
|
|
8207
8222
|
async fetchOptionChain(code, params = {}) {
|
|
8208
|
-
/**
|
|
8209
|
-
* @method
|
|
8210
|
-
* @name bybit#fetchOptionChain
|
|
8211
|
-
* @description fetches data for an underlying asset that is commonly found in an option chain
|
|
8212
|
-
* @see https://bybit-exchange.github.io/docs/v5/market/tickers
|
|
8213
|
-
* @param {string} currency base currency to fetch an option chain for
|
|
8214
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8215
|
-
* @returns {object} a list of [option chain structures]{@link https://docs.ccxt.com/#/?id=option-chain-structure}
|
|
8216
|
-
*/
|
|
8217
8223
|
await this.loadMarkets();
|
|
8218
8224
|
const currency = this.currency(code);
|
|
8219
8225
|
const request = {
|
|
@@ -8317,20 +8323,20 @@ export default class bybit extends Exchange {
|
|
|
8317
8323
|
'quoteVolume': undefined,
|
|
8318
8324
|
};
|
|
8319
8325
|
}
|
|
8326
|
+
/**
|
|
8327
|
+
* @method
|
|
8328
|
+
* @name bybit#fetchPositionsHistory
|
|
8329
|
+
* @description fetches historical positions
|
|
8330
|
+
* @see https://bybit-exchange.github.io/docs/v5/position/close-pnl
|
|
8331
|
+
* @param {string[]} symbols a list of unified market symbols
|
|
8332
|
+
* @param {int} [since] timestamp in ms of the earliest position to fetch, params["until"] - since <= 7 days
|
|
8333
|
+
* @param {int} [limit] the maximum amount of records to fetch, default=50, max=100
|
|
8334
|
+
* @param {object} params extra parameters specific to the exchange api endpoint
|
|
8335
|
+
* @param {int} [params.until] timestamp in ms of the latest position to fetch, params["until"] - since <= 7 days
|
|
8336
|
+
* @param {string} [params.subType] 'linear' or 'inverse'
|
|
8337
|
+
* @returns {object[]} a list of [position structures]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
8338
|
+
*/
|
|
8320
8339
|
async fetchPositionsHistory(symbols = undefined, since = undefined, limit = undefined, params = {}) {
|
|
8321
|
-
/**
|
|
8322
|
-
* @method
|
|
8323
|
-
* @name bybit#fetchPositionsHistory
|
|
8324
|
-
* @description fetches historical positions
|
|
8325
|
-
* @see https://bybit-exchange.github.io/docs/v5/position/close-pnl
|
|
8326
|
-
* @param {string} [symbol] unified market symbols, symbols must have the same subType (must all be linear or all be inverse)
|
|
8327
|
-
* @param {int} [since] timestamp in ms of the earliest position to fetch, params["until"] - since <= 7 days
|
|
8328
|
-
* @param {int} [limit] the maximum amount of records to fetch, default=50, max=100
|
|
8329
|
-
* @param {object} params extra parameters specific to the exchange api endpoint
|
|
8330
|
-
* @param {int} [params.until] timestamp in ms of the latest position to fetch, params["until"] - since <= 7 days
|
|
8331
|
-
* @param {string} [params.subType] 'linear' or 'inverse'
|
|
8332
|
-
* @returns {object[]} a list of [position structures]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
8333
|
-
*/
|
|
8334
8340
|
await this.loadMarkets();
|
|
8335
8341
|
let market = undefined;
|
|
8336
8342
|
let subType = undefined;
|
|
@@ -8398,16 +8404,16 @@ export default class bybit extends Exchange {
|
|
|
8398
8404
|
const positions = this.parsePositions(rawPositions, symbols, params);
|
|
8399
8405
|
return this.filterBySinceLimit(positions, since, limit);
|
|
8400
8406
|
}
|
|
8407
|
+
/**
|
|
8408
|
+
* @method
|
|
8409
|
+
* @name bybit#fetchConvertCurrencies
|
|
8410
|
+
* @description fetches all available currencies that can be converted
|
|
8411
|
+
* @see https://bybit-exchange.github.io/docs/v5/asset/convert/convert-coin-list
|
|
8412
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8413
|
+
* @param {string} [params.accountType] eb_convert_uta, eb_convert_spot, eb_convert_funding, eb_convert_inverse, or eb_convert_contract
|
|
8414
|
+
* @returns {object} an associative dictionary of currencies
|
|
8415
|
+
*/
|
|
8401
8416
|
async fetchConvertCurrencies(params = {}) {
|
|
8402
|
-
/**
|
|
8403
|
-
* @method
|
|
8404
|
-
* @name bybit#fetchConvertCurrencies
|
|
8405
|
-
* @description fetches all available currencies that can be converted
|
|
8406
|
-
* @see https://bybit-exchange.github.io/docs/v5/asset/convert/convert-coin-list
|
|
8407
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8408
|
-
* @param {string} [params.accountType] eb_convert_uta, eb_convert_spot, eb_convert_funding, eb_convert_inverse, or eb_convert_contract
|
|
8409
|
-
* @returns {object} an associative dictionary of currencies
|
|
8410
|
-
*/
|
|
8411
8417
|
await this.loadMarkets();
|
|
8412
8418
|
let accountType = undefined;
|
|
8413
8419
|
const [enableUnifiedMargin, enableUnifiedAccount] = await this.isUnifiedEnabled();
|
|
@@ -8492,19 +8498,19 @@ export default class bybit extends Exchange {
|
|
|
8492
8498
|
}
|
|
8493
8499
|
return result;
|
|
8494
8500
|
}
|
|
8501
|
+
/**
|
|
8502
|
+
* @method
|
|
8503
|
+
* @name bybit#fetchConvertQuote
|
|
8504
|
+
* @description fetch a quote for converting from one currency to another
|
|
8505
|
+
* @see https://bybit-exchange.github.io/docs/v5/asset/convert/apply-quote
|
|
8506
|
+
* @param {string} fromCode the currency that you want to sell and convert from
|
|
8507
|
+
* @param {string} toCode the currency that you want to buy and convert into
|
|
8508
|
+
* @param {float} [amount] how much you want to trade in units of the from currency
|
|
8509
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8510
|
+
* @param {string} [params.accountType] eb_convert_uta, eb_convert_spot, eb_convert_funding, eb_convert_inverse, or eb_convert_contract
|
|
8511
|
+
* @returns {object} a [conversion structure]{@link https://docs.ccxt.com/#/?id=conversion-structure}
|
|
8512
|
+
*/
|
|
8495
8513
|
async fetchConvertQuote(fromCode, toCode, amount = undefined, params = {}) {
|
|
8496
|
-
/**
|
|
8497
|
-
* @method
|
|
8498
|
-
* @name bybit#fetchConvertQuote
|
|
8499
|
-
* @description fetch a quote for converting from one currency to another
|
|
8500
|
-
* @see https://bybit-exchange.github.io/docs/v5/asset/convert/apply-quote
|
|
8501
|
-
* @param {string} fromCode the currency that you want to sell and convert from
|
|
8502
|
-
* @param {string} toCode the currency that you want to buy and convert into
|
|
8503
|
-
* @param {float} [amount] how much you want to trade in units of the from currency
|
|
8504
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8505
|
-
* @param {string} [params.accountType] eb_convert_uta, eb_convert_spot, eb_convert_funding, eb_convert_inverse, or eb_convert_contract
|
|
8506
|
-
* @returns {object} a [conversion structure]{@link https://docs.ccxt.com/#/?id=conversion-structure}
|
|
8507
|
-
*/
|
|
8508
8514
|
await this.loadMarkets();
|
|
8509
8515
|
let accountType = undefined;
|
|
8510
8516
|
const [enableUnifiedMargin, enableUnifiedAccount] = await this.isUnifiedEnabled();
|
|
@@ -8546,19 +8552,19 @@ export default class bybit extends Exchange {
|
|
|
8546
8552
|
const toCurrency = this.currency(toCurrencyId);
|
|
8547
8553
|
return this.parseConversion(data, fromCurrency, toCurrency);
|
|
8548
8554
|
}
|
|
8555
|
+
/**
|
|
8556
|
+
* @method
|
|
8557
|
+
* @name bybit#createConvertTrade
|
|
8558
|
+
* @description convert from one currency to another
|
|
8559
|
+
* @see https://bybit-exchange.github.io/docs/v5/asset/convert/confirm-quote
|
|
8560
|
+
* @param {string} id the id of the trade that you want to make
|
|
8561
|
+
* @param {string} fromCode the currency that you want to sell and convert from
|
|
8562
|
+
* @param {string} toCode the currency that you want to buy and convert into
|
|
8563
|
+
* @param {float} amount how much you want to trade in units of the from currency
|
|
8564
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8565
|
+
* @returns {object} a [conversion structure]{@link https://docs.ccxt.com/#/?id=conversion-structure}
|
|
8566
|
+
*/
|
|
8549
8567
|
async createConvertTrade(id, fromCode, toCode, amount = undefined, params = {}) {
|
|
8550
|
-
/**
|
|
8551
|
-
* @method
|
|
8552
|
-
* @name bybit#createConvertTrade
|
|
8553
|
-
* @description convert from one currency to another
|
|
8554
|
-
* @see https://bybit-exchange.github.io/docs/v5/asset/convert/confirm-quote
|
|
8555
|
-
* @param {string} id the id of the trade that you want to make
|
|
8556
|
-
* @param {string} fromCode the currency that you want to sell and convert from
|
|
8557
|
-
* @param {string} toCode the currency that you want to buy and convert into
|
|
8558
|
-
* @param {float} amount how much you want to trade in units of the from currency
|
|
8559
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8560
|
-
* @returns {object} a [conversion structure]{@link https://docs.ccxt.com/#/?id=conversion-structure}
|
|
8561
|
-
*/
|
|
8562
8568
|
await this.loadMarkets();
|
|
8563
8569
|
const request = {
|
|
8564
8570
|
'quoteTxId': id,
|
|
@@ -8579,18 +8585,18 @@ export default class bybit extends Exchange {
|
|
|
8579
8585
|
const data = this.safeDict(response, 'result', {});
|
|
8580
8586
|
return this.parseConversion(data);
|
|
8581
8587
|
}
|
|
8588
|
+
/**
|
|
8589
|
+
* @method
|
|
8590
|
+
* @name bybit#fetchConvertTrade
|
|
8591
|
+
* @description fetch the data for a conversion trade
|
|
8592
|
+
* @see https://bybit-exchange.github.io/docs/v5/asset/convert/get-convert-result
|
|
8593
|
+
* @param {string} id the id of the trade that you want to fetch
|
|
8594
|
+
* @param {string} [code] the unified currency code of the conversion trade
|
|
8595
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8596
|
+
* @param {string} [params.accountType] eb_convert_uta, eb_convert_spot, eb_convert_funding, eb_convert_inverse, or eb_convert_contract
|
|
8597
|
+
* @returns {object} a [conversion structure]{@link https://docs.ccxt.com/#/?id=conversion-structure}
|
|
8598
|
+
*/
|
|
8582
8599
|
async fetchConvertTrade(id, code = undefined, params = {}) {
|
|
8583
|
-
/**
|
|
8584
|
-
* @method
|
|
8585
|
-
* @name bybit#fetchConvertTrade
|
|
8586
|
-
* @description fetch the data for a conversion trade
|
|
8587
|
-
* @see https://bybit-exchange.github.io/docs/v5/asset/convert/get-convert-result
|
|
8588
|
-
* @param {string} id the id of the trade that you want to fetch
|
|
8589
|
-
* @param {string} [code] the unified currency code of the conversion trade
|
|
8590
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8591
|
-
* @param {string} [params.accountType] eb_convert_uta, eb_convert_spot, eb_convert_funding, eb_convert_inverse, or eb_convert_contract
|
|
8592
|
-
* @returns {object} a [conversion structure]{@link https://docs.ccxt.com/#/?id=conversion-structure}
|
|
8593
|
-
*/
|
|
8594
8600
|
await this.loadMarkets();
|
|
8595
8601
|
let accountType = undefined;
|
|
8596
8602
|
const [enableUnifiedMargin, enableUnifiedAccount] = await this.isUnifiedEnabled();
|
|
@@ -8641,19 +8647,19 @@ export default class bybit extends Exchange {
|
|
|
8641
8647
|
}
|
|
8642
8648
|
return this.parseConversion(result, fromCurrency, toCurrency);
|
|
8643
8649
|
}
|
|
8650
|
+
/**
|
|
8651
|
+
* @method
|
|
8652
|
+
* @name bybit#fetchConvertTradeHistory
|
|
8653
|
+
* @description fetch the users history of conversion trades
|
|
8654
|
+
* @see https://bybit-exchange.github.io/docs/v5/asset/convert/get-convert-history
|
|
8655
|
+
* @param {string} [code] the unified currency code
|
|
8656
|
+
* @param {int} [since] the earliest time in ms to fetch conversions for
|
|
8657
|
+
* @param {int} [limit] the maximum number of conversion structures to retrieve
|
|
8658
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8659
|
+
* @param {string} [params.accountType] eb_convert_uta, eb_convert_spot, eb_convert_funding, eb_convert_inverse, or eb_convert_contract
|
|
8660
|
+
* @returns {object[]} a list of [conversion structures]{@link https://docs.ccxt.com/#/?id=conversion-structure}
|
|
8661
|
+
*/
|
|
8644
8662
|
async fetchConvertTradeHistory(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
8645
|
-
/**
|
|
8646
|
-
* @method
|
|
8647
|
-
* @name bybit#fetchConvertTradeHistory
|
|
8648
|
-
* @description fetch the users history of conversion trades
|
|
8649
|
-
* @see https://bybit-exchange.github.io/docs/v5/asset/convert/get-convert-history
|
|
8650
|
-
* @param {string} [code] the unified currency code
|
|
8651
|
-
* @param {int} [since] the earliest time in ms to fetch conversions for
|
|
8652
|
-
* @param {int} [limit] the maximum number of conversion structures to retrieve
|
|
8653
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8654
|
-
* @param {string} [params.accountType] eb_convert_uta, eb_convert_spot, eb_convert_funding, eb_convert_inverse, or eb_convert_contract
|
|
8655
|
-
* @returns {object[]} a list of [conversion structures]{@link https://docs.ccxt.com/#/?id=conversion-structure}
|
|
8656
|
-
*/
|
|
8657
8663
|
await this.loadMarkets();
|
|
8658
8664
|
const request = {};
|
|
8659
8665
|
if (limit !== undefined) {
|
|
@@ -8751,19 +8757,19 @@ export default class bybit extends Exchange {
|
|
|
8751
8757
|
'fee': undefined,
|
|
8752
8758
|
};
|
|
8753
8759
|
}
|
|
8760
|
+
/**
|
|
8761
|
+
* @method
|
|
8762
|
+
* @name bybit#fetchLongShortRatioHistory
|
|
8763
|
+
* @description fetches the long short ratio history for a unified market symbol
|
|
8764
|
+
* @see https://bybit-exchange.github.io/docs/v5/market/long-short-ratio
|
|
8765
|
+
* @param {string} symbol unified symbol of the market to fetch the long short ratio for
|
|
8766
|
+
* @param {string} [timeframe] the period for the ratio, default is 24 hours
|
|
8767
|
+
* @param {int} [since] the earliest time in ms to fetch ratios for
|
|
8768
|
+
* @param {int} [limit] the maximum number of long short ratio structures to retrieve
|
|
8769
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8770
|
+
* @returns {object[]} an array of [long short ratio structures]{@link https://docs.ccxt.com/#/?id=long-short-ratio-structure}
|
|
8771
|
+
*/
|
|
8754
8772
|
async fetchLongShortRatioHistory(symbol = undefined, timeframe = undefined, since = undefined, limit = undefined, params = {}) {
|
|
8755
|
-
/**
|
|
8756
|
-
* @method
|
|
8757
|
-
* @name bybit#fetchLongShortRatioHistory
|
|
8758
|
-
* @description fetches the long short ratio history for a unified market symbol
|
|
8759
|
-
* @see https://bybit-exchange.github.io/docs/v5/market/long-short-ratio
|
|
8760
|
-
* @param {string} symbol unified symbol of the market to fetch the long short ratio for
|
|
8761
|
-
* @param {string} [timeframe] the period for the ratio, default is 24 hours
|
|
8762
|
-
* @param {int} [since] the earliest time in ms to fetch ratios for
|
|
8763
|
-
* @param {int} [limit] the maximum number of long short ratio structures to retrieve
|
|
8764
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8765
|
-
* @returns {object[]} an array of [long short ratio structures]{@link https://docs.ccxt.com/#/?id=long-short-ratio-structure}
|
|
8766
|
-
*/
|
|
8767
8773
|
await this.loadMarkets();
|
|
8768
8774
|
const market = this.market(symbol);
|
|
8769
8775
|
let type = undefined;
|