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/bingx.js
CHANGED
|
@@ -502,15 +502,15 @@ export default class bingx extends Exchange {
|
|
|
502
502
|
},
|
|
503
503
|
});
|
|
504
504
|
}
|
|
505
|
+
/**
|
|
506
|
+
* @method
|
|
507
|
+
* @name bingx#fetchTime
|
|
508
|
+
* @description fetches the current integer timestamp in milliseconds from the bingx server
|
|
509
|
+
* @see https://bingx-api.github.io/docs/#/swapV2/base-info.html#Get%20Server%20Time
|
|
510
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
511
|
+
* @returns {int} the current integer timestamp in milliseconds from the bingx server
|
|
512
|
+
*/
|
|
505
513
|
async fetchTime(params = {}) {
|
|
506
|
-
/**
|
|
507
|
-
* @method
|
|
508
|
-
* @name bingx#fetchTime
|
|
509
|
-
* @description fetches the current integer timestamp in milliseconds from the bingx server
|
|
510
|
-
* @see https://bingx-api.github.io/docs/#/swapV2/base-info.html#Get%20Server%20Time
|
|
511
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
512
|
-
* @returns {int} the current integer timestamp in milliseconds from the bingx server
|
|
513
|
-
*/
|
|
514
514
|
const response = await this.swapV2PublicGetServerTime(params);
|
|
515
515
|
//
|
|
516
516
|
// {
|
|
@@ -524,15 +524,15 @@ export default class bingx extends Exchange {
|
|
|
524
524
|
const data = this.safeDict(response, 'data');
|
|
525
525
|
return this.safeInteger(data, 'serverTime');
|
|
526
526
|
}
|
|
527
|
+
/**
|
|
528
|
+
* @method
|
|
529
|
+
* @name bingx#fetchCurrencies
|
|
530
|
+
* @description fetches all available currencies on an exchange
|
|
531
|
+
* @see https://bingx-api.github.io/docs/#/common/account-api.html#All%20Coins
|
|
532
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
533
|
+
* @returns {object} an associative dictionary of currencies
|
|
534
|
+
*/
|
|
527
535
|
async fetchCurrencies(params = {}) {
|
|
528
|
-
/**
|
|
529
|
-
* @method
|
|
530
|
-
* @name bingx#fetchCurrencies
|
|
531
|
-
* @description fetches all available currencies on an exchange
|
|
532
|
-
* @see https://bingx-api.github.io/docs/#/common/account-api.html#All%20Coins
|
|
533
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
534
|
-
* @returns {object} an associative dictionary of currencies
|
|
535
|
-
*/
|
|
536
536
|
if (!this.checkRequiredCredentials(false)) {
|
|
537
537
|
return undefined;
|
|
538
538
|
}
|
|
@@ -839,17 +839,17 @@ export default class bingx extends Exchange {
|
|
|
839
839
|
'info': market,
|
|
840
840
|
});
|
|
841
841
|
}
|
|
842
|
+
/**
|
|
843
|
+
* @method
|
|
844
|
+
* @name bingx#fetchMarkets
|
|
845
|
+
* @description retrieves data on all markets for bingx
|
|
846
|
+
* @see https://bingx-api.github.io/docs/#/spot/market-api.html#Query%20Symbols
|
|
847
|
+
* @see https://bingx-api.github.io/docs/#/swapV2/market-api.html#Contract%20Information
|
|
848
|
+
* @see https://bingx-api.github.io/docs/#/en-us/cswap/market-api.html#Contract%20Information
|
|
849
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
850
|
+
* @returns {object[]} an array of objects representing market data
|
|
851
|
+
*/
|
|
842
852
|
async fetchMarkets(params = {}) {
|
|
843
|
-
/**
|
|
844
|
-
* @method
|
|
845
|
-
* @name bingx#fetchMarkets
|
|
846
|
-
* @description retrieves data on all markets for bingx
|
|
847
|
-
* @see https://bingx-api.github.io/docs/#/spot/market-api.html#Query%20Symbols
|
|
848
|
-
* @see https://bingx-api.github.io/docs/#/swapV2/market-api.html#Contract%20Information
|
|
849
|
-
* @see https://bingx-api.github.io/docs/#/en-us/cswap/market-api.html#Contract%20Information
|
|
850
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
851
|
-
* @returns {object[]} an array of objects representing market data
|
|
852
|
-
*/
|
|
853
853
|
const requests = [this.fetchSwapMarkets(params)];
|
|
854
854
|
const isSandbox = this.safeBool(this.options, 'sandboxMode', false);
|
|
855
855
|
if (!isSandbox) {
|
|
@@ -863,25 +863,25 @@ export default class bingx extends Exchange {
|
|
|
863
863
|
const swapMarkets = this.arrayConcat(linearSwapMarkets, inverseSwapMarkets);
|
|
864
864
|
return this.arrayConcat(spotMarkets, swapMarkets);
|
|
865
865
|
}
|
|
866
|
+
/**
|
|
867
|
+
* @method
|
|
868
|
+
* @name bingx#fetchOHLCV
|
|
869
|
+
* @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
870
|
+
* @see https://bingx-api.github.io/docs/#/swapV2/market-api.html#K-Line%20Data
|
|
871
|
+
* @see https://bingx-api.github.io/docs/#/spot/market-api.html#Candlestick%20chart%20data
|
|
872
|
+
* @see https://bingx-api.github.io/docs/#/swapV2/market-api.html#%20K-Line%20Data
|
|
873
|
+
* @see https://bingx-api.github.io/docs/#/en-us/swapV2/market-api.html#K-Line%20Data%20-%20Mark%20Price
|
|
874
|
+
* @see https://bingx-api.github.io/docs/#/en-us/cswap/market-api.html#Get%20K-line%20Data
|
|
875
|
+
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
876
|
+
* @param {string} timeframe the length of time each candle represents
|
|
877
|
+
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
878
|
+
* @param {int} [limit] the maximum amount of candles to fetch
|
|
879
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
880
|
+
* @param {int} [params.until] timestamp in ms of the latest candle to fetch
|
|
881
|
+
* @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)
|
|
882
|
+
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
883
|
+
*/
|
|
866
884
|
async fetchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
|
|
867
|
-
/**
|
|
868
|
-
* @method
|
|
869
|
-
* @name bingx#fetchOHLCV
|
|
870
|
-
* @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
871
|
-
* @see https://bingx-api.github.io/docs/#/swapV2/market-api.html#K-Line%20Data
|
|
872
|
-
* @see https://bingx-api.github.io/docs/#/spot/market-api.html#Candlestick%20chart%20data
|
|
873
|
-
* @see https://bingx-api.github.io/docs/#/swapV2/market-api.html#%20K-Line%20Data
|
|
874
|
-
* @see https://bingx-api.github.io/docs/#/en-us/swapV2/market-api.html#K-Line%20Data%20-%20Mark%20Price
|
|
875
|
-
* @see https://bingx-api.github.io/docs/#/en-us/cswap/market-api.html#Get%20K-line%20Data
|
|
876
|
-
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
877
|
-
* @param {string} timeframe the length of time each candle represents
|
|
878
|
-
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
879
|
-
* @param {int} [limit] the maximum amount of candles to fetch
|
|
880
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
881
|
-
* @param {int} [params.until] timestamp in ms of the latest candle to fetch
|
|
882
|
-
* @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)
|
|
883
|
-
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
884
|
-
*/
|
|
885
885
|
await this.loadMarkets();
|
|
886
886
|
let paginate = false;
|
|
887
887
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchOHLCV', 'paginate', false);
|
|
@@ -1017,19 +1017,19 @@ export default class bingx extends Exchange {
|
|
|
1017
1017
|
this.safeNumber(ohlcv, 'volume'),
|
|
1018
1018
|
];
|
|
1019
1019
|
}
|
|
1020
|
+
/**
|
|
1021
|
+
* @method
|
|
1022
|
+
* @name bingx#fetchTrades
|
|
1023
|
+
* @description get the list of most recent trades for a particular symbol
|
|
1024
|
+
* @see https://bingx-api.github.io/docs/#/spot/market-api.html#Query%20transaction%20records
|
|
1025
|
+
* @see https://bingx-api.github.io/docs/#/swapV2/market-api.html#The%20latest%20Trade%20of%20a%20Trading%20Pair
|
|
1026
|
+
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
1027
|
+
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
1028
|
+
* @param {int} [limit] the maximum amount of trades to fetch
|
|
1029
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1030
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
|
|
1031
|
+
*/
|
|
1020
1032
|
async fetchTrades(symbol, since = undefined, limit = undefined, params = {}) {
|
|
1021
|
-
/**
|
|
1022
|
-
* @method
|
|
1023
|
-
* @name bingx#fetchTrades
|
|
1024
|
-
* @description get the list of most recent trades for a particular symbol
|
|
1025
|
-
* @see https://bingx-api.github.io/docs/#/spot/market-api.html#Query%20transaction%20records
|
|
1026
|
-
* @see https://bingx-api.github.io/docs/#/swapV2/market-api.html#The%20latest%20Trade%20of%20a%20Trading%20Pair
|
|
1027
|
-
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
1028
|
-
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
1029
|
-
* @param {int} [limit] the maximum amount of trades to fetch
|
|
1030
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1031
|
-
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
|
|
1032
|
-
*/
|
|
1033
1033
|
await this.loadMarkets();
|
|
1034
1034
|
const market = this.market(symbol);
|
|
1035
1035
|
const request = {
|
|
@@ -1251,19 +1251,19 @@ export default class bingx extends Exchange {
|
|
|
1251
1251
|
},
|
|
1252
1252
|
}, market);
|
|
1253
1253
|
}
|
|
1254
|
+
/**
|
|
1255
|
+
* @method
|
|
1256
|
+
* @name bingx#fetchOrderBook
|
|
1257
|
+
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
1258
|
+
* @see https://bingx-api.github.io/docs/#/spot/market-api.html#Query%20depth%20information
|
|
1259
|
+
* @see https://bingx-api.github.io/docs/#/swapV2/market-api.html#Get%20Market%20Depth
|
|
1260
|
+
* @see https://bingx-api.github.io/docs/#/en-us/cswap/market-api.html#Query%20Depth%20Data
|
|
1261
|
+
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
1262
|
+
* @param {int} [limit] the maximum amount of order book entries to return
|
|
1263
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1264
|
+
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
1265
|
+
*/
|
|
1254
1266
|
async fetchOrderBook(symbol, limit = undefined, params = {}) {
|
|
1255
|
-
/**
|
|
1256
|
-
* @method
|
|
1257
|
-
* @name bingx#fetchOrderBook
|
|
1258
|
-
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
1259
|
-
* @see https://bingx-api.github.io/docs/#/spot/market-api.html#Query%20depth%20information
|
|
1260
|
-
* @see https://bingx-api.github.io/docs/#/swapV2/market-api.html#Get%20Market%20Depth
|
|
1261
|
-
* @see https://bingx-api.github.io/docs/#/en-us/cswap/market-api.html#Query%20Depth%20Data
|
|
1262
|
-
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
1263
|
-
* @param {int} [limit] the maximum amount of order book entries to return
|
|
1264
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1265
|
-
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
1266
|
-
*/
|
|
1267
1267
|
await this.loadMarkets();
|
|
1268
1268
|
const market = this.market(symbol);
|
|
1269
1269
|
const request = {
|
|
@@ -1347,17 +1347,17 @@ export default class bingx extends Exchange {
|
|
|
1347
1347
|
const timestamp = this.safeInteger2(orderbook, 'T', 'ts');
|
|
1348
1348
|
return this.parseOrderBook(orderbook, market['symbol'], timestamp, 'bids', 'asks', 0, 1);
|
|
1349
1349
|
}
|
|
1350
|
+
/**
|
|
1351
|
+
* @method
|
|
1352
|
+
* @name bingx#fetchFundingRate
|
|
1353
|
+
* @description fetch the current funding rate
|
|
1354
|
+
* @see https://bingx-api.github.io/docs/#/swapV2/market-api.html#Current%20Funding%20Rate
|
|
1355
|
+
* @see https://bingx-api.github.io/docs/#/en-us/cswap/market-api.html#Price%20&%20Current%20Funding%20Rate
|
|
1356
|
+
* @param {string} symbol unified market symbol
|
|
1357
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1358
|
+
* @returns {object} a [funding rate structure]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
|
|
1359
|
+
*/
|
|
1350
1360
|
async fetchFundingRate(symbol, params = {}) {
|
|
1351
|
-
/**
|
|
1352
|
-
* @method
|
|
1353
|
-
* @name bingx#fetchFundingRate
|
|
1354
|
-
* @description fetch the current funding rate
|
|
1355
|
-
* @see https://bingx-api.github.io/docs/#/swapV2/market-api.html#Current%20Funding%20Rate
|
|
1356
|
-
* @see https://bingx-api.github.io/docs/#/en-us/cswap/market-api.html#Price%20&%20Current%20Funding%20Rate
|
|
1357
|
-
* @param {string} symbol unified market symbol
|
|
1358
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1359
|
-
* @returns {object} a [funding rate structure]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
|
|
1360
|
-
*/
|
|
1361
1361
|
await this.loadMarkets();
|
|
1362
1362
|
const market = this.market(symbol);
|
|
1363
1363
|
const request = {
|
|
@@ -1389,16 +1389,16 @@ export default class bingx extends Exchange {
|
|
|
1389
1389
|
const data = this.safeList(response, 'data', []);
|
|
1390
1390
|
return this.parseFundingRate(data, market);
|
|
1391
1391
|
}
|
|
1392
|
+
/**
|
|
1393
|
+
* @method
|
|
1394
|
+
* @name bingx#fetchFundingRates
|
|
1395
|
+
* @description fetch the current funding rate for multiple symbols
|
|
1396
|
+
* @see https://bingx-api.github.io/docs/#/swapV2/market-api.html#Current%20Funding%20Rate
|
|
1397
|
+
* @param {string[]} [symbols] list of unified market symbols
|
|
1398
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1399
|
+
* @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
|
|
1400
|
+
*/
|
|
1392
1401
|
async fetchFundingRates(symbols = undefined, params = {}) {
|
|
1393
|
-
/**
|
|
1394
|
-
* @method
|
|
1395
|
-
* @name bingx#fetchFundingRates
|
|
1396
|
-
* @description fetch the current funding rate for multiple symbols
|
|
1397
|
-
* @see https://bingx-api.github.io/docs/#/swapV2/market-api.html#Current%20Funding%20Rate
|
|
1398
|
-
* @param {string[]} [symbols] list of unified market symbols
|
|
1399
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1400
|
-
* @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
|
|
1401
|
-
*/
|
|
1402
1402
|
await this.loadMarkets();
|
|
1403
1403
|
symbols = this.marketSymbols(symbols, 'swap', true);
|
|
1404
1404
|
const response = await this.swapV2PublicGetQuotePremiumIndex(this.extend(params));
|
|
@@ -1439,20 +1439,20 @@ export default class bingx extends Exchange {
|
|
|
1439
1439
|
'interval': undefined,
|
|
1440
1440
|
};
|
|
1441
1441
|
}
|
|
1442
|
+
/**
|
|
1443
|
+
* @method
|
|
1444
|
+
* @name bingx#fetchFundingRateHistory
|
|
1445
|
+
* @description fetches historical funding rate prices
|
|
1446
|
+
* @see https://bingx-api.github.io/docs/#/swapV2/market-api.html#Funding%20Rate%20History
|
|
1447
|
+
* @param {string} symbol unified symbol of the market to fetch the funding rate history for
|
|
1448
|
+
* @param {int} [since] timestamp in ms of the earliest funding rate to fetch
|
|
1449
|
+
* @param {int} [limit] the maximum amount of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure} to fetch
|
|
1450
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1451
|
+
* @param {int} [params.until] timestamp in ms of the latest funding rate to fetch
|
|
1452
|
+
* @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)
|
|
1453
|
+
* @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure}
|
|
1454
|
+
*/
|
|
1442
1455
|
async fetchFundingRateHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
1443
|
-
/**
|
|
1444
|
-
* @method
|
|
1445
|
-
* @name bingx#fetchFundingRateHistory
|
|
1446
|
-
* @description fetches historical funding rate prices
|
|
1447
|
-
* @see https://bingx-api.github.io/docs/#/swapV2/market-api.html#Funding%20Rate%20History
|
|
1448
|
-
* @param {string} symbol unified symbol of the market to fetch the funding rate history for
|
|
1449
|
-
* @param {int} [since] timestamp in ms of the earliest funding rate to fetch
|
|
1450
|
-
* @param {int} [limit] the maximum amount of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure} to fetch
|
|
1451
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1452
|
-
* @param {int} [params.until] timestamp in ms of the latest funding rate to fetch
|
|
1453
|
-
* @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)
|
|
1454
|
-
* @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure}
|
|
1455
|
-
*/
|
|
1456
1456
|
if (symbol === undefined) {
|
|
1457
1457
|
throw new ArgumentsRequired(this.id + ' fetchFundingRateHistory() requires a symbol argument');
|
|
1458
1458
|
}
|
|
@@ -1510,17 +1510,17 @@ export default class bingx extends Exchange {
|
|
|
1510
1510
|
const sorted = this.sortBy(rates, 'timestamp');
|
|
1511
1511
|
return this.filterBySymbolSinceLimit(sorted, market['symbol'], since, limit);
|
|
1512
1512
|
}
|
|
1513
|
+
/**
|
|
1514
|
+
* @method
|
|
1515
|
+
* @name bingx#fetchOpenInterest
|
|
1516
|
+
* @description retrieves the open interest of a trading pair
|
|
1517
|
+
* @see https://bingx-api.github.io/docs/#/swapV2/market-api.html#Get%20Swap%20Open%20Positions
|
|
1518
|
+
* @see https://bingx-api.github.io/docs/#/en-us/cswap/market-api.html#Get%20Swap%20Open%20Positions
|
|
1519
|
+
* @param {string} symbol unified CCXT market symbol
|
|
1520
|
+
* @param {object} [params] exchange specific parameters
|
|
1521
|
+
* @returns {object} an open interest structure{@link https://docs.ccxt.com/#/?id=open-interest-structure}
|
|
1522
|
+
*/
|
|
1513
1523
|
async fetchOpenInterest(symbol, params = {}) {
|
|
1514
|
-
/**
|
|
1515
|
-
* @method
|
|
1516
|
-
* @name bingx#fetchOpenInterest
|
|
1517
|
-
* @description retrieves the open interest of a trading pair
|
|
1518
|
-
* @see https://bingx-api.github.io/docs/#/swapV2/market-api.html#Get%20Swap%20Open%20Positions
|
|
1519
|
-
* @see https://bingx-api.github.io/docs/#/en-us/cswap/market-api.html#Get%20Swap%20Open%20Positions
|
|
1520
|
-
* @param {string} symbol unified CCXT market symbol
|
|
1521
|
-
* @param {object} [params] exchange specific parameters
|
|
1522
|
-
* @returns {object} an open interest structure{@link https://docs.ccxt.com/#/?id=open-interest-structure}
|
|
1523
|
-
*/
|
|
1524
1524
|
await this.loadMarkets();
|
|
1525
1525
|
const market = this.market(symbol);
|
|
1526
1526
|
const request = {
|
|
@@ -1604,18 +1604,18 @@ export default class bingx extends Exchange {
|
|
|
1604
1604
|
'info': interest,
|
|
1605
1605
|
}, market);
|
|
1606
1606
|
}
|
|
1607
|
+
/**
|
|
1608
|
+
* @method
|
|
1609
|
+
* @name bingx#fetchTicker
|
|
1610
|
+
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
1611
|
+
* @see https://bingx-api.github.io/docs/#/en-us/swapV2/market-api.html#Get%20Ticker
|
|
1612
|
+
* @see https://bingx-api.github.io/docs/#/en-us/spot/market-api.html#24-hour%20price%20changes
|
|
1613
|
+
* @see https://bingx-api.github.io/docs/#/en-us/cswap/market-api.html#Query%2024-Hour%20Price%20Change
|
|
1614
|
+
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
1615
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1616
|
+
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
1617
|
+
*/
|
|
1607
1618
|
async fetchTicker(symbol, params = {}) {
|
|
1608
|
-
/**
|
|
1609
|
-
* @method
|
|
1610
|
-
* @name bingx#fetchTicker
|
|
1611
|
-
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
1612
|
-
* @see https://bingx-api.github.io/docs/#/en-us/swapV2/market-api.html#Get%20Ticker
|
|
1613
|
-
* @see https://bingx-api.github.io/docs/#/en-us/spot/market-api.html#24-hour%20price%20changes
|
|
1614
|
-
* @see https://bingx-api.github.io/docs/#/en-us/cswap/market-api.html#Query%2024-Hour%20Price%20Change
|
|
1615
|
-
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
1616
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1617
|
-
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
1618
|
-
*/
|
|
1619
1619
|
await this.loadMarkets();
|
|
1620
1620
|
const market = this.market(symbol);
|
|
1621
1621
|
const request = {
|
|
@@ -1669,18 +1669,18 @@ export default class bingx extends Exchange {
|
|
|
1669
1669
|
const dataDict = this.safeDict(response, 'data', {});
|
|
1670
1670
|
return this.parseTicker(dataDict, market);
|
|
1671
1671
|
}
|
|
1672
|
+
/**
|
|
1673
|
+
* @method
|
|
1674
|
+
* @name bingx#fetchTickers
|
|
1675
|
+
* @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
|
1676
|
+
* @see https://bingx-api.github.io/docs/#/en-us/swapV2/market-api.html#Get%20Ticker
|
|
1677
|
+
* @see https://bingx-api.github.io/docs/#/en-us/spot/market-api.html#24-hour%20price%20changes
|
|
1678
|
+
* @see https://bingx-api.github.io/docs/#/en-us/cswap/market-api.html#Query%2024-Hour%20Price%20Change
|
|
1679
|
+
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
1680
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1681
|
+
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
1682
|
+
*/
|
|
1672
1683
|
async fetchTickers(symbols = undefined, params = {}) {
|
|
1673
|
-
/**
|
|
1674
|
-
* @method
|
|
1675
|
-
* @name bingx#fetchTickers
|
|
1676
|
-
* @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
|
1677
|
-
* @see https://bingx-api.github.io/docs/#/en-us/swapV2/market-api.html#Get%20Ticker
|
|
1678
|
-
* @see https://bingx-api.github.io/docs/#/en-us/spot/market-api.html#24-hour%20price%20changes
|
|
1679
|
-
* @see https://bingx-api.github.io/docs/#/en-us/cswap/market-api.html#Query%2024-Hour%20Price%20Change
|
|
1680
|
-
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
1681
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1682
|
-
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
1683
|
-
*/
|
|
1684
1684
|
await this.loadMarkets();
|
|
1685
1685
|
let market = undefined;
|
|
1686
1686
|
if (symbols !== undefined) {
|
|
@@ -1738,16 +1738,16 @@ export default class bingx extends Exchange {
|
|
|
1738
1738
|
const tickers = this.safeList(response, 'data');
|
|
1739
1739
|
return this.parseTickers(tickers, symbols);
|
|
1740
1740
|
}
|
|
1741
|
+
/**
|
|
1742
|
+
* @method
|
|
1743
|
+
* @name bingx#fetchMarkPrice
|
|
1744
|
+
* @description fetches mark prices for the market
|
|
1745
|
+
* @see https://bingx-api.github.io/docs/#/en-us/swapV2/market-api.html#Mark%20Price%20and%20Funding%20Rate
|
|
1746
|
+
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
1747
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1748
|
+
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
1749
|
+
*/
|
|
1741
1750
|
async fetchMarkPrice(symbol, params = {}) {
|
|
1742
|
-
/**
|
|
1743
|
-
* @method
|
|
1744
|
-
* @name bingx#fetchMarkPrice
|
|
1745
|
-
* @description fetches mark prices for the market
|
|
1746
|
-
* @see https://bingx-api.github.io/docs/#/en-us/swapV2/market-api.html#Mark%20Price%20and%20Funding%20Rate
|
|
1747
|
-
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
1748
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1749
|
-
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
1750
|
-
*/
|
|
1751
1751
|
await this.loadMarkets();
|
|
1752
1752
|
const market = this.market(symbol);
|
|
1753
1753
|
let subType = undefined;
|
|
@@ -1796,16 +1796,16 @@ export default class bingx extends Exchange {
|
|
|
1796
1796
|
}
|
|
1797
1797
|
return this.parseTicker(response['data'], market);
|
|
1798
1798
|
}
|
|
1799
|
+
/**
|
|
1800
|
+
* @method
|
|
1801
|
+
* @name bingx#fetchMarkPrices
|
|
1802
|
+
* @description fetches mark prices for multiple markets
|
|
1803
|
+
* @see https://bingx-api.github.io/docs/#/en-us/swapV2/market-api.html#Mark%20Price%20and%20Funding%20Rate
|
|
1804
|
+
* @param {string[]} [symbols] unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
1805
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1806
|
+
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
1807
|
+
*/
|
|
1799
1808
|
async fetchMarkPrices(symbols = undefined, params = {}) {
|
|
1800
|
-
/**
|
|
1801
|
-
* @method
|
|
1802
|
-
* @name bingx#fetchMarkPrices
|
|
1803
|
-
* @description fetches mark prices for multiple markets
|
|
1804
|
-
* @see https://bingx-api.github.io/docs/#/en-us/swapV2/market-api.html#Mark%20Price%20and%20Funding%20Rate
|
|
1805
|
-
* @param {string[]} [symbols] unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
1806
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1807
|
-
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
1808
|
-
*/
|
|
1809
1809
|
await this.loadMarkets();
|
|
1810
1810
|
let market = undefined;
|
|
1811
1811
|
if (symbols !== undefined) {
|
|
@@ -1958,19 +1958,19 @@ export default class bingx extends Exchange {
|
|
|
1958
1958
|
'info': ticker,
|
|
1959
1959
|
}, market);
|
|
1960
1960
|
}
|
|
1961
|
+
/**
|
|
1962
|
+
* @method
|
|
1963
|
+
* @name bingx#fetchBalance
|
|
1964
|
+
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
1965
|
+
* @see https://bingx-api.github.io/docs/#/spot/trade-api.html#Query%20Assets
|
|
1966
|
+
* @see https://bingx-api.github.io/docs/#/swapV2/account-api.html#Get%20Perpetual%20Swap%20Account%20Asset%20Information
|
|
1967
|
+
* @see https://bingx-api.github.io/docs/#/standard/contract-interface.html#Query%20standard%20contract%20balance
|
|
1968
|
+
* @see https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#Query%20Account%20Assets
|
|
1969
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1970
|
+
* @param {boolean} [params.standard] whether to fetch standard contract balances
|
|
1971
|
+
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
1972
|
+
*/
|
|
1961
1973
|
async fetchBalance(params = {}) {
|
|
1962
|
-
/**
|
|
1963
|
-
* @method
|
|
1964
|
-
* @name bingx#fetchBalance
|
|
1965
|
-
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
1966
|
-
* @see https://bingx-api.github.io/docs/#/spot/trade-api.html#Query%20Assets
|
|
1967
|
-
* @see https://bingx-api.github.io/docs/#/swapV2/account-api.html#Get%20Perpetual%20Swap%20Account%20Asset%20Information
|
|
1968
|
-
* @see https://bingx-api.github.io/docs/#/standard/contract-interface.html#Query%20standard%20contract%20balance
|
|
1969
|
-
* @see https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#Query%20Account%20Assets
|
|
1970
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1971
|
-
* @param {boolean} [params.standard] whether to fetch standard contract balances
|
|
1972
|
-
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
1973
|
-
*/
|
|
1974
1974
|
await this.loadMarkets();
|
|
1975
1975
|
let response = undefined;
|
|
1976
1976
|
let standard = undefined;
|
|
@@ -2189,19 +2189,19 @@ export default class bingx extends Exchange {
|
|
|
2189
2189
|
}
|
|
2190
2190
|
return this.safeBalance(result);
|
|
2191
2191
|
}
|
|
2192
|
+
/**
|
|
2193
|
+
* @method
|
|
2194
|
+
* @name bingx#fetchPositions
|
|
2195
|
+
* @description fetch all open positions
|
|
2196
|
+
* @see https://bingx-api.github.io/docs/#/en-us/swapV2/account-api.html#Query%20position%20data
|
|
2197
|
+
* @see https://bingx-api.github.io/docs/#/en-us/standard/contract-interface.html#position
|
|
2198
|
+
* @see https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#Query%20warehouse
|
|
2199
|
+
* @param {string[]|undefined} symbols list of unified market symbols
|
|
2200
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2201
|
+
* @param {boolean} [params.standard] whether to fetch standard contract positions
|
|
2202
|
+
* @returns {object[]} a list of [position structures]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
2203
|
+
*/
|
|
2192
2204
|
async fetchPositions(symbols = undefined, params = {}) {
|
|
2193
|
-
/**
|
|
2194
|
-
* @method
|
|
2195
|
-
* @name bingx#fetchPositions
|
|
2196
|
-
* @description fetch all open positions
|
|
2197
|
-
* @see https://bingx-api.github.io/docs/#/en-us/swapV2/account-api.html#Query%20position%20data
|
|
2198
|
-
* @see https://bingx-api.github.io/docs/#/en-us/standard/contract-interface.html#position
|
|
2199
|
-
* @see https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#Query%20warehouse
|
|
2200
|
-
* @param {string[]|undefined} symbols list of unified market symbols
|
|
2201
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2202
|
-
* @param {boolean} [params.standard] whether to fetch standard contract positions
|
|
2203
|
-
* @returns {object[]} a list of [position structures]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
2204
|
-
*/
|
|
2205
2205
|
await this.loadMarkets();
|
|
2206
2206
|
symbols = this.marketSymbols(symbols);
|
|
2207
2207
|
let standard = undefined;
|
|
@@ -2288,17 +2288,17 @@ export default class bingx extends Exchange {
|
|
|
2288
2288
|
const positions = this.safeList(response, 'data', []);
|
|
2289
2289
|
return this.parsePositions(positions, symbols);
|
|
2290
2290
|
}
|
|
2291
|
+
/**
|
|
2292
|
+
* @method
|
|
2293
|
+
* @name bingx#fetchPosition
|
|
2294
|
+
* @description fetch data on a single open contract trade position
|
|
2295
|
+
* @see https://bingx-api.github.io/docs/#/en-us/swapV2/account-api.html#Query%20position%20data
|
|
2296
|
+
* @see https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#Query%20warehouse
|
|
2297
|
+
* @param {string} symbol unified market symbol of the market the position is held in
|
|
2298
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2299
|
+
* @returns {object} a [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
2300
|
+
*/
|
|
2291
2301
|
async fetchPosition(symbol, params = {}) {
|
|
2292
|
-
/**
|
|
2293
|
-
* @method
|
|
2294
|
-
* @name bingx#fetchPosition
|
|
2295
|
-
* @description fetch data on a single open contract trade position
|
|
2296
|
-
* @see https://bingx-api.github.io/docs/#/en-us/swapV2/account-api.html#Query%20position%20data
|
|
2297
|
-
* @see https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#Query%20warehouse
|
|
2298
|
-
* @param {string} symbol unified market symbol of the market the position is held in
|
|
2299
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2300
|
-
* @returns {object} a [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
2301
|
-
*/
|
|
2302
2302
|
await this.loadMarkets();
|
|
2303
2303
|
const market = this.market(symbol);
|
|
2304
2304
|
if (!market['swap']) {
|
|
@@ -2475,43 +2475,43 @@ export default class bingx extends Exchange {
|
|
|
2475
2475
|
'takeProfitPrice': undefined,
|
|
2476
2476
|
});
|
|
2477
2477
|
}
|
|
2478
|
+
/**
|
|
2479
|
+
* @method
|
|
2480
|
+
* @name bingx#createMarketOrderWithCost
|
|
2481
|
+
* @description create a market order by providing the symbol, side and cost
|
|
2482
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
2483
|
+
* @param {string} side 'buy' or 'sell'
|
|
2484
|
+
* @param {float} cost how much you want to trade in units of the quote currency
|
|
2485
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2486
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2487
|
+
*/
|
|
2478
2488
|
async createMarketOrderWithCost(symbol, side, cost, params = {}) {
|
|
2479
|
-
/**
|
|
2480
|
-
* @method
|
|
2481
|
-
* @name bingx#createMarketOrderWithCost
|
|
2482
|
-
* @description create a market order by providing the symbol, side and cost
|
|
2483
|
-
* @param {string} symbol unified symbol of the market to create an order in
|
|
2484
|
-
* @param {string} side 'buy' or 'sell'
|
|
2485
|
-
* @param {float} cost how much you want to trade in units of the quote currency
|
|
2486
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2487
|
-
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2488
|
-
*/
|
|
2489
2489
|
params['quoteOrderQty'] = cost;
|
|
2490
2490
|
return await this.createOrder(symbol, 'market', side, cost, undefined, params);
|
|
2491
2491
|
}
|
|
2492
|
+
/**
|
|
2493
|
+
* @method
|
|
2494
|
+
* @name bingx#createMarketBuyOrderWithCost
|
|
2495
|
+
* @description create a market buy order by providing the symbol and cost
|
|
2496
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
2497
|
+
* @param {float} cost how much you want to trade in units of the quote currency
|
|
2498
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2499
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2500
|
+
*/
|
|
2492
2501
|
async createMarketBuyOrderWithCost(symbol, cost, params = {}) {
|
|
2493
|
-
/**
|
|
2494
|
-
* @method
|
|
2495
|
-
* @name bingx#createMarketBuyOrderWithCost
|
|
2496
|
-
* @description create a market buy order by providing the symbol and cost
|
|
2497
|
-
* @param {string} symbol unified symbol of the market to create an order in
|
|
2498
|
-
* @param {float} cost how much you want to trade in units of the quote currency
|
|
2499
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2500
|
-
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2501
|
-
*/
|
|
2502
2502
|
params['quoteOrderQty'] = cost;
|
|
2503
2503
|
return await this.createOrder(symbol, 'market', 'buy', cost, undefined, params);
|
|
2504
2504
|
}
|
|
2505
|
+
/**
|
|
2506
|
+
* @method
|
|
2507
|
+
* @name bingx#createMarketSellOrderWithCost
|
|
2508
|
+
* @description create a market sell order by providing the symbol and cost
|
|
2509
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
2510
|
+
* @param {float} cost how much you want to trade in units of the quote currency
|
|
2511
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2512
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2513
|
+
*/
|
|
2505
2514
|
async createMarketSellOrderWithCost(symbol, cost, params = {}) {
|
|
2506
|
-
/**
|
|
2507
|
-
* @method
|
|
2508
|
-
* @name bingx#createMarketSellOrderWithCost
|
|
2509
|
-
* @description create a market sell order by providing the symbol and cost
|
|
2510
|
-
* @param {string} symbol unified symbol of the market to create an order in
|
|
2511
|
-
* @param {float} cost how much you want to trade in units of the quote currency
|
|
2512
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2513
|
-
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2514
|
-
*/
|
|
2515
2515
|
params['quoteOrderQty'] = cost;
|
|
2516
2516
|
return await this.createOrder(symbol, 'market', 'sell', cost, undefined, params);
|
|
2517
2517
|
}
|
|
@@ -2721,39 +2721,39 @@ export default class bingx extends Exchange {
|
|
|
2721
2721
|
params = this.omit(params, ['hedged', 'triggerPrice', 'stopLossPrice', 'takeProfitPrice', 'trailingAmount', 'trailingPercent', 'trailingType', 'takeProfit', 'stopLoss', 'clientOrderId']);
|
|
2722
2722
|
return this.extend(request, params);
|
|
2723
2723
|
}
|
|
2724
|
+
/**
|
|
2725
|
+
* @method
|
|
2726
|
+
* @name bingx#createOrder
|
|
2727
|
+
* @description create a trade order
|
|
2728
|
+
* @see https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Trade%20order
|
|
2729
|
+
* @see https://bingx-api.github.io/docs/#/en-us/spot/trade-api.html#Create%20an%20Order
|
|
2730
|
+
* @see https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#Trade%20order
|
|
2731
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
2732
|
+
* @param {string} type 'market' or 'limit'
|
|
2733
|
+
* @param {string} side 'buy' or 'sell'
|
|
2734
|
+
* @param {float} amount how much you want to trade in units of the base currency
|
|
2735
|
+
* @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
2736
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2737
|
+
* @param {string} [params.clientOrderId] a unique id for the order
|
|
2738
|
+
* @param {bool} [params.postOnly] true to place a post only order
|
|
2739
|
+
* @param {string} [params.timeInForce] spot supports 'PO', 'GTC' and 'IOC', swap supports 'PO', 'GTC', 'IOC' and 'FOK'
|
|
2740
|
+
* @param {bool} [params.reduceOnly] *swap only* true or false whether the order is reduce only
|
|
2741
|
+
* @param {float} [params.triggerPrice] triggerPrice at which the attached take profit / stop loss order will be triggered
|
|
2742
|
+
* @param {float} [params.stopLossPrice] stop loss trigger price
|
|
2743
|
+
* @param {float} [params.takeProfitPrice] take profit trigger price
|
|
2744
|
+
* @param {float} [params.cost] the quote quantity that can be used as an alternative for the amount
|
|
2745
|
+
* @param {float} [params.trailingAmount] *swap only* the quote amount to trail away from the current market price
|
|
2746
|
+
* @param {float} [params.trailingPercent] *swap only* the percent to trail away from the current market price
|
|
2747
|
+
* @param {object} [params.takeProfit] *takeProfit object in params* containing the triggerPrice at which the attached take profit order will be triggered
|
|
2748
|
+
* @param {float} [params.takeProfit.triggerPrice] take profit trigger price
|
|
2749
|
+
* @param {object} [params.stopLoss] *stopLoss object in params* containing the triggerPrice at which the attached stop loss order will be triggered
|
|
2750
|
+
* @param {float} [params.stopLoss.triggerPrice] stop loss trigger price
|
|
2751
|
+
* @param {boolean} [params.test] *swap only* whether to use the test endpoint or not, default is false
|
|
2752
|
+
* @param {string} [params.positionSide] *contracts only* "BOTH" for one way mode, "LONG" for buy side of hedged mode, "SHORT" for sell side of hedged mode
|
|
2753
|
+
* @param {boolean} [params.hedged] *swap only* whether the order is in hedged mode or one way mode
|
|
2754
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2755
|
+
*/
|
|
2724
2756
|
async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
|
|
2725
|
-
/**
|
|
2726
|
-
* @method
|
|
2727
|
-
* @name bingx#createOrder
|
|
2728
|
-
* @description create a trade order
|
|
2729
|
-
* @see https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Trade%20order
|
|
2730
|
-
* @see https://bingx-api.github.io/docs/#/en-us/spot/trade-api.html#Create%20an%20Order
|
|
2731
|
-
* @see https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#Trade%20order
|
|
2732
|
-
* @param {string} symbol unified symbol of the market to create an order in
|
|
2733
|
-
* @param {string} type 'market' or 'limit'
|
|
2734
|
-
* @param {string} side 'buy' or 'sell'
|
|
2735
|
-
* @param {float} amount how much you want to trade in units of the base currency
|
|
2736
|
-
* @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
2737
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2738
|
-
* @param {string} [params.clientOrderId] a unique id for the order
|
|
2739
|
-
* @param {bool} [params.postOnly] true to place a post only order
|
|
2740
|
-
* @param {string} [params.timeInForce] spot supports 'PO', 'GTC' and 'IOC', swap supports 'PO', 'GTC', 'IOC' and 'FOK'
|
|
2741
|
-
* @param {bool} [params.reduceOnly] *swap only* true or false whether the order is reduce only
|
|
2742
|
-
* @param {float} [params.triggerPrice] triggerPrice at which the attached take profit / stop loss order will be triggered
|
|
2743
|
-
* @param {float} [params.stopLossPrice] stop loss trigger price
|
|
2744
|
-
* @param {float} [params.takeProfitPrice] take profit trigger price
|
|
2745
|
-
* @param {float} [params.cost] the quote quantity that can be used as an alternative for the amount
|
|
2746
|
-
* @param {float} [params.trailingAmount] *swap only* the quote amount to trail away from the current market price
|
|
2747
|
-
* @param {float} [params.trailingPercent] *swap only* the percent to trail away from the current market price
|
|
2748
|
-
* @param {object} [params.takeProfit] *takeProfit object in params* containing the triggerPrice at which the attached take profit order will be triggered
|
|
2749
|
-
* @param {float} [params.takeProfit.triggerPrice] take profit trigger price
|
|
2750
|
-
* @param {object} [params.stopLoss] *stopLoss object in params* containing the triggerPrice at which the attached stop loss order will be triggered
|
|
2751
|
-
* @param {float} [params.stopLoss.triggerPrice] stop loss trigger price
|
|
2752
|
-
* @param {boolean} [params.test] *swap only* whether to use the test endpoint or not, default is false
|
|
2753
|
-
* @param {string} [params.positionSide] *contracts only* "BOTH" for one way mode, "LONG" for buy side of hedged mode, "SHORT" for sell side of hedged mode
|
|
2754
|
-
* @param {boolean} [params.hedged] *swap only* whether the order is in hedged mode or one way mode
|
|
2755
|
-
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2756
|
-
*/
|
|
2757
2757
|
await this.loadMarkets();
|
|
2758
2758
|
const market = this.market(symbol);
|
|
2759
2759
|
const test = this.safeBool(params, 'test', false);
|
|
@@ -2849,18 +2849,18 @@ export default class bingx extends Exchange {
|
|
|
2849
2849
|
}
|
|
2850
2850
|
return this.parseOrder(result, market);
|
|
2851
2851
|
}
|
|
2852
|
+
/**
|
|
2853
|
+
* @method
|
|
2854
|
+
* @name bingx#createOrders
|
|
2855
|
+
* @description create a list of trade orders
|
|
2856
|
+
* @see https://bingx-api.github.io/docs/#/spot/trade-api.html#Batch%20Placing%20Orders
|
|
2857
|
+
* @see https://bingx-api.github.io/docs/#/swapV2/trade-api.html#Bulk%20order
|
|
2858
|
+
* @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
|
|
2859
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2860
|
+
* @param {boolean} [params.sync] *spot only* if true, multiple orders are ordered serially and all orders do not require the same symbol/side/type
|
|
2861
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2862
|
+
*/
|
|
2852
2863
|
async createOrders(orders, params = {}) {
|
|
2853
|
-
/**
|
|
2854
|
-
* @method
|
|
2855
|
-
* @name bingx#createOrders
|
|
2856
|
-
* @description create a list of trade orders
|
|
2857
|
-
* @see https://bingx-api.github.io/docs/#/spot/trade-api.html#Batch%20Placing%20Orders
|
|
2858
|
-
* @see https://bingx-api.github.io/docs/#/swapV2/trade-api.html#Bulk%20order
|
|
2859
|
-
* @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
|
|
2860
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2861
|
-
* @param {boolean} [params.sync] *spot only* if true, multiple orders are ordered serially and all orders do not require the same symbol/side/type
|
|
2862
|
-
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2863
|
-
*/
|
|
2864
2864
|
await this.loadMarkets();
|
|
2865
2865
|
const ordersRequests = [];
|
|
2866
2866
|
const marketIds = [];
|
|
@@ -3368,20 +3368,20 @@ export default class bingx extends Exchange {
|
|
|
3368
3368
|
};
|
|
3369
3369
|
return this.safeString(statuses, status, status);
|
|
3370
3370
|
}
|
|
3371
|
+
/**
|
|
3372
|
+
* @method
|
|
3373
|
+
* @name bingx#cancelOrder
|
|
3374
|
+
* @description cancels an open order
|
|
3375
|
+
* @see https://bingx-api.github.io/docs/#/en-us/spot/trade-api.html#Cancel%20Order
|
|
3376
|
+
* @see https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Cancel%20Order
|
|
3377
|
+
* @see https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#Cancel%20an%20Order
|
|
3378
|
+
* @param {string} id order id
|
|
3379
|
+
* @param {string} symbol unified symbol of the market the order was made in
|
|
3380
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3381
|
+
* @param {string} [params.clientOrderId] a unique id for the order
|
|
3382
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
3383
|
+
*/
|
|
3371
3384
|
async cancelOrder(id, symbol = undefined, params = {}) {
|
|
3372
|
-
/**
|
|
3373
|
-
* @method
|
|
3374
|
-
* @name bingx#cancelOrder
|
|
3375
|
-
* @description cancels an open order
|
|
3376
|
-
* @see https://bingx-api.github.io/docs/#/en-us/spot/trade-api.html#Cancel%20Order
|
|
3377
|
-
* @see https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Cancel%20Order
|
|
3378
|
-
* @see https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#Cancel%20an%20Order
|
|
3379
|
-
* @param {string} id order id
|
|
3380
|
-
* @param {string} symbol unified symbol of the market the order was made in
|
|
3381
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3382
|
-
* @param {string} [params.clientOrderId] a unique id for the order
|
|
3383
|
-
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
3384
|
-
*/
|
|
3385
3385
|
if (symbol === undefined) {
|
|
3386
3386
|
throw new ArgumentsRequired(this.id + ' cancelOrder() requires a symbol argument');
|
|
3387
3387
|
}
|
|
@@ -3516,18 +3516,18 @@ export default class bingx extends Exchange {
|
|
|
3516
3516
|
const order = this.safeDict(data, 'order', data);
|
|
3517
3517
|
return this.parseOrder(order, market);
|
|
3518
3518
|
}
|
|
3519
|
+
/**
|
|
3520
|
+
* @method
|
|
3521
|
+
* @name bingx#cancelAllOrders
|
|
3522
|
+
* @description cancel all open orders
|
|
3523
|
+
* @see https://bingx-api.github.io/docs/#/en-us/spot/trade-api.html#Cancel%20orders%20by%20symbol
|
|
3524
|
+
* @see https://bingx-api.github.io/docs/#/swapV2/trade-api.html#Cancel%20All%20Orders
|
|
3525
|
+
* @see https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#Cancel%20all%20orders
|
|
3526
|
+
* @param {string} [symbol] unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
|
|
3527
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3528
|
+
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
3529
|
+
*/
|
|
3519
3530
|
async cancelAllOrders(symbol = undefined, params = {}) {
|
|
3520
|
-
/**
|
|
3521
|
-
* @method
|
|
3522
|
-
* @name bingx#cancelAllOrders
|
|
3523
|
-
* @description cancel all open orders
|
|
3524
|
-
* @see https://bingx-api.github.io/docs/#/en-us/spot/trade-api.html#Cancel%20orders%20by%20symbol
|
|
3525
|
-
* @see https://bingx-api.github.io/docs/#/swapV2/trade-api.html#Cancel%20All%20Orders
|
|
3526
|
-
* @see https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#Cancel%20all%20orders
|
|
3527
|
-
* @param {string} [symbol] unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
|
|
3528
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3529
|
-
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
3530
|
-
*/
|
|
3531
3531
|
if (symbol === undefined) {
|
|
3532
3532
|
throw new ArgumentsRequired(this.id + ' cancelAllOrders() requires a symbol argument');
|
|
3533
3533
|
}
|
|
@@ -3661,19 +3661,19 @@ export default class bingx extends Exchange {
|
|
|
3661
3661
|
const orders = this.safeList2(data, 'success', 'orders', []);
|
|
3662
3662
|
return this.parseOrders(orders);
|
|
3663
3663
|
}
|
|
3664
|
+
/**
|
|
3665
|
+
* @method
|
|
3666
|
+
* @name bingx#cancelOrders
|
|
3667
|
+
* @description cancel multiple orders
|
|
3668
|
+
* @see https://bingx-api.github.io/docs/#/swapV2/trade-api.html#Cancel%20a%20Batch%20of%20Orders
|
|
3669
|
+
* @see https://bingx-api.github.io/docs/#/spot/trade-api.html#Cancel%20a%20Batch%20of%20Orders
|
|
3670
|
+
* @param {string[]} ids order ids
|
|
3671
|
+
* @param {string} symbol unified market symbol, default is undefined
|
|
3672
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3673
|
+
* @param {string[]} [params.clientOrderIds] client order ids
|
|
3674
|
+
* @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
3675
|
+
*/
|
|
3664
3676
|
async cancelOrders(ids, symbol = undefined, params = {}) {
|
|
3665
|
-
/**
|
|
3666
|
-
* @method
|
|
3667
|
-
* @name bingx#cancelOrders
|
|
3668
|
-
* @description cancel multiple orders
|
|
3669
|
-
* @see https://bingx-api.github.io/docs/#/swapV2/trade-api.html#Cancel%20a%20Batch%20of%20Orders
|
|
3670
|
-
* @see https://bingx-api.github.io/docs/#/spot/trade-api.html#Cancel%20a%20Batch%20of%20Orders
|
|
3671
|
-
* @param {string[]} ids order ids
|
|
3672
|
-
* @param {string} symbol unified market symbol, default is undefined
|
|
3673
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3674
|
-
* @param {string[]} [params.clientOrderIds] client order ids
|
|
3675
|
-
* @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
3676
|
-
*/
|
|
3677
3677
|
if (symbol === undefined) {
|
|
3678
3678
|
throw new ArgumentsRequired(this.id + ' cancelOrders() requires a symbol argument');
|
|
3679
3679
|
}
|
|
@@ -3769,18 +3769,18 @@ export default class bingx extends Exchange {
|
|
|
3769
3769
|
const success = this.safeList2(data, 'success', 'orders', []);
|
|
3770
3770
|
return this.parseOrders(success);
|
|
3771
3771
|
}
|
|
3772
|
+
/**
|
|
3773
|
+
* @method
|
|
3774
|
+
* @name bingx#cancelAllOrdersAfter
|
|
3775
|
+
* @description dead man's switch, cancel all orders after the given timeout
|
|
3776
|
+
* @see https://bingx-api.github.io/docs/#/en-us/spot/trade-api.html#Cancel%20all%20orders%20in%20countdown
|
|
3777
|
+
* @see https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Cancel%20all%20orders%20in%20countdown
|
|
3778
|
+
* @param {number} timeout time in milliseconds, 0 represents cancel the timer
|
|
3779
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3780
|
+
* @param {string} [params.type] spot or swap market
|
|
3781
|
+
* @returns {object} the api result
|
|
3782
|
+
*/
|
|
3772
3783
|
async cancelAllOrdersAfter(timeout, params = {}) {
|
|
3773
|
-
/**
|
|
3774
|
-
* @method
|
|
3775
|
-
* @name bingx#cancelAllOrdersAfter
|
|
3776
|
-
* @description dead man's switch, cancel all orders after the given timeout
|
|
3777
|
-
* @see https://bingx-api.github.io/docs/#/en-us/spot/trade-api.html#Cancel%20all%20orders%20in%20countdown
|
|
3778
|
-
* @see https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Cancel%20all%20orders%20in%20countdown
|
|
3779
|
-
* @param {number} timeout time in milliseconds, 0 represents cancel the timer
|
|
3780
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3781
|
-
* @param {string} [params.type] spot or swap market
|
|
3782
|
-
* @returns {object} the api result
|
|
3783
|
-
*/
|
|
3784
3784
|
await this.loadMarkets();
|
|
3785
3785
|
const isActive = (timeout > 0);
|
|
3786
3786
|
const request = {
|
|
@@ -3812,19 +3812,19 @@ export default class bingx extends Exchange {
|
|
|
3812
3812
|
//
|
|
3813
3813
|
return response;
|
|
3814
3814
|
}
|
|
3815
|
+
/**
|
|
3816
|
+
* @method
|
|
3817
|
+
* @name bingx#fetchOrder
|
|
3818
|
+
* @description fetches information on an order made by the user
|
|
3819
|
+
* @see https://bingx-api.github.io/docs/#/en-us/spot/trade-api.html#Query%20Order%20details
|
|
3820
|
+
* @see https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Query%20Order%20details
|
|
3821
|
+
* @see https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#Query%20Order
|
|
3822
|
+
* @param {string} id the order id
|
|
3823
|
+
* @param {string} symbol unified symbol of the market the order was made in
|
|
3824
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3825
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
3826
|
+
*/
|
|
3815
3827
|
async fetchOrder(id, symbol = undefined, params = {}) {
|
|
3816
|
-
/**
|
|
3817
|
-
* @method
|
|
3818
|
-
* @name bingx#fetchOrder
|
|
3819
|
-
* @description fetches information on an order made by the user
|
|
3820
|
-
* @see https://bingx-api.github.io/docs/#/en-us/spot/trade-api.html#Query%20Order%20details
|
|
3821
|
-
* @see https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Query%20Order%20details
|
|
3822
|
-
* @see https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#Query%20Order
|
|
3823
|
-
* @param {string} id the order id
|
|
3824
|
-
* @param {string} symbol unified symbol of the market the order was made in
|
|
3825
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3826
|
-
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
3827
|
-
*/
|
|
3828
3828
|
if (symbol === undefined) {
|
|
3829
3829
|
throw new ArgumentsRequired(this.id + ' fetchOrder() requires a symbol argument');
|
|
3830
3830
|
}
|
|
@@ -3953,20 +3953,20 @@ export default class bingx extends Exchange {
|
|
|
3953
3953
|
const order = this.safeDict(data, 'order', data);
|
|
3954
3954
|
return this.parseOrder(order, market);
|
|
3955
3955
|
}
|
|
3956
|
+
/**
|
|
3957
|
+
* @method
|
|
3958
|
+
* @name bingx#fetchOrders
|
|
3959
|
+
* @description fetches information on multiple orders made by the user
|
|
3960
|
+
* @see https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#User's%20All%20Orders
|
|
3961
|
+
* @param {string} symbol unified market symbol of the market orders were made in
|
|
3962
|
+
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
3963
|
+
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
3964
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3965
|
+
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
3966
|
+
* @param {int} [params.orderId] Only return subsequent orders, and return the latest order by default
|
|
3967
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
3968
|
+
*/
|
|
3956
3969
|
async fetchOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
3957
|
-
/**
|
|
3958
|
-
* @method
|
|
3959
|
-
* @name bingx#fetchOrders
|
|
3960
|
-
* @description fetches information on multiple orders made by the user
|
|
3961
|
-
* @see https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#User's%20All%20Orders
|
|
3962
|
-
* @param {string} symbol unified market symbol of the market orders were made in
|
|
3963
|
-
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
3964
|
-
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
3965
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3966
|
-
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
3967
|
-
* @param {int} [params.orderId] Only return subsequent orders, and return the latest order by default
|
|
3968
|
-
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
3969
|
-
*/
|
|
3970
3970
|
await this.loadMarkets();
|
|
3971
3971
|
const request = {};
|
|
3972
3972
|
let market = undefined;
|
|
@@ -4048,20 +4048,20 @@ export default class bingx extends Exchange {
|
|
|
4048
4048
|
const orders = this.safeList(data, 'orders', []);
|
|
4049
4049
|
return this.parseOrders(orders, market, since, limit);
|
|
4050
4050
|
}
|
|
4051
|
+
/**
|
|
4052
|
+
* @method
|
|
4053
|
+
* @name bingx#fetchOpenOrders
|
|
4054
|
+
* @description fetch all unfilled currently open orders
|
|
4055
|
+
* @see https://bingx-api.github.io/docs/#/en-us/spot/trade-api.html#Current%20Open%20Orders
|
|
4056
|
+
* @see https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Current%20All%20Open%20Orders
|
|
4057
|
+
* @see https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#Query%20all%20current%20pending%20orders
|
|
4058
|
+
* @param {string} symbol unified market symbol
|
|
4059
|
+
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
4060
|
+
* @param {int} [limit] the maximum number of open order structures to retrieve
|
|
4061
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4062
|
+
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4063
|
+
*/
|
|
4051
4064
|
async fetchOpenOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
4052
|
-
/**
|
|
4053
|
-
* @method
|
|
4054
|
-
* @name bingx#fetchOpenOrders
|
|
4055
|
-
* @description fetch all unfilled currently open orders
|
|
4056
|
-
* @see https://bingx-api.github.io/docs/#/en-us/spot/trade-api.html#Current%20Open%20Orders
|
|
4057
|
-
* @see https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Current%20All%20Open%20Orders
|
|
4058
|
-
* @see https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#Query%20all%20current%20pending%20orders
|
|
4059
|
-
* @param {string} symbol unified market symbol
|
|
4060
|
-
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
4061
|
-
* @param {int} [limit] the maximum number of open order structures to retrieve
|
|
4062
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4063
|
-
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4064
|
-
*/
|
|
4065
4065
|
await this.loadMarkets();
|
|
4066
4066
|
let market = undefined;
|
|
4067
4067
|
const request = {};
|
|
@@ -4198,65 +4198,65 @@ export default class bingx extends Exchange {
|
|
|
4198
4198
|
const orders = this.safeList(data, 'orders', []);
|
|
4199
4199
|
return this.parseOrders(orders, market, since, limit);
|
|
4200
4200
|
}
|
|
4201
|
+
/**
|
|
4202
|
+
* @method
|
|
4203
|
+
* @name bingx#fetchClosedOrders
|
|
4204
|
+
* @description fetches information on multiple closed orders made by the user
|
|
4205
|
+
* @see https://bingx-api.github.io/docs/#/en-us/spot/trade-api.html#Query%20Order%20history
|
|
4206
|
+
* @see https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Query%20Order%20history
|
|
4207
|
+
* @see https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#User's%20History%20Orders
|
|
4208
|
+
* @see https://bingx-api.github.io/docs/#/standard/contract-interface.html#Historical%20order
|
|
4209
|
+
* @param {string} symbol unified market symbol of the closed orders
|
|
4210
|
+
* @param {int} [since] timestamp in ms of the earliest order
|
|
4211
|
+
* @param {int} [limit] the max number of closed orders to return
|
|
4212
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4213
|
+
* @param {int} [params.until] the latest time in ms to fetch orders for
|
|
4214
|
+
* @param {boolean} [params.standard] whether to fetch standard contract orders
|
|
4215
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4216
|
+
*/
|
|
4201
4217
|
async fetchClosedOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
4202
|
-
/**
|
|
4203
|
-
* @method
|
|
4204
|
-
* @name bingx#fetchClosedOrders
|
|
4205
|
-
* @description fetches information on multiple closed orders made by the user
|
|
4206
|
-
* @see https://bingx-api.github.io/docs/#/en-us/spot/trade-api.html#Query%20Order%20history
|
|
4207
|
-
* @see https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Query%20Order%20history
|
|
4208
|
-
* @see https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#User's%20History%20Orders
|
|
4209
|
-
* @see https://bingx-api.github.io/docs/#/standard/contract-interface.html#Historical%20order
|
|
4210
|
-
* @param {string} symbol unified market symbol of the closed orders
|
|
4211
|
-
* @param {int} [since] timestamp in ms of the earliest order
|
|
4212
|
-
* @param {int} [limit] the max number of closed orders to return
|
|
4213
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4214
|
-
* @param {int} [params.until] the latest time in ms to fetch orders for
|
|
4215
|
-
* @param {boolean} [params.standard] whether to fetch standard contract orders
|
|
4216
|
-
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4217
|
-
*/
|
|
4218
4218
|
await this.loadMarkets();
|
|
4219
4219
|
const orders = await this.fetchCanceledAndClosedOrders(symbol, since, limit, params);
|
|
4220
4220
|
return this.filterBy(orders, 'status', 'closed');
|
|
4221
4221
|
}
|
|
4222
|
+
/**
|
|
4223
|
+
* @method
|
|
4224
|
+
* @name bingx#fetchCanceledOrders
|
|
4225
|
+
* @description fetches information on multiple canceled orders made by the user
|
|
4226
|
+
* @see https://bingx-api.github.io/docs/#/en-us/spot/trade-api.html#Query%20Order%20history
|
|
4227
|
+
* @see https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Query%20Order%20history
|
|
4228
|
+
* @see https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#User's%20History%20Orders
|
|
4229
|
+
* @see https://bingx-api.github.io/docs/#/standard/contract-interface.html#Historical%20order
|
|
4230
|
+
* @param {string} symbol unified market symbol of the canceled orders
|
|
4231
|
+
* @param {int} [since] timestamp in ms of the earliest order
|
|
4232
|
+
* @param {int} [limit] the max number of canceled orders to return
|
|
4233
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4234
|
+
* @param {int} [params.until] the latest time in ms to fetch orders for
|
|
4235
|
+
* @param {boolean} [params.standard] whether to fetch standard contract orders
|
|
4236
|
+
* @returns {object} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4237
|
+
*/
|
|
4222
4238
|
async fetchCanceledOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
4223
|
-
/**
|
|
4224
|
-
* @method
|
|
4225
|
-
* @name bingx#fetchCanceledOrders
|
|
4226
|
-
* @description fetches information on multiple canceled orders made by the user
|
|
4227
|
-
* @see https://bingx-api.github.io/docs/#/en-us/spot/trade-api.html#Query%20Order%20history
|
|
4228
|
-
* @see https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Query%20Order%20history
|
|
4229
|
-
* @see https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#User's%20History%20Orders
|
|
4230
|
-
* @see https://bingx-api.github.io/docs/#/standard/contract-interface.html#Historical%20order
|
|
4231
|
-
* @param {string} symbol unified market symbol of the canceled orders
|
|
4232
|
-
* @param {int} [since] timestamp in ms of the earliest order
|
|
4233
|
-
* @param {int} [limit] the max number of canceled orders to return
|
|
4234
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4235
|
-
* @param {int} [params.until] the latest time in ms to fetch orders for
|
|
4236
|
-
* @param {boolean} [params.standard] whether to fetch standard contract orders
|
|
4237
|
-
* @returns {object} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4238
|
-
*/
|
|
4239
4239
|
await this.loadMarkets();
|
|
4240
4240
|
const orders = await this.fetchCanceledAndClosedOrders(symbol, since, limit, params);
|
|
4241
4241
|
return this.filterBy(orders, 'status', 'canceled');
|
|
4242
4242
|
}
|
|
4243
|
+
/**
|
|
4244
|
+
* @method
|
|
4245
|
+
* @name bingx#fetchCanceledAndClosedOrders
|
|
4246
|
+
* @description fetches information on multiple closed orders made by the user
|
|
4247
|
+
* @see https://bingx-api.github.io/docs/#/en-us/spot/trade-api.html#Query%20Order%20history
|
|
4248
|
+
* @see https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Query%20Order%20history
|
|
4249
|
+
* @see https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#User's%20History%20Orders
|
|
4250
|
+
* @see https://bingx-api.github.io/docs/#/standard/contract-interface.html#Historical%20order
|
|
4251
|
+
* @param {string} [symbol] unified market symbol of the market orders were made in
|
|
4252
|
+
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
4253
|
+
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
4254
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4255
|
+
* @param {int} [params.until] the latest time in ms to fetch orders for
|
|
4256
|
+
* @param {boolean} [params.standard] whether to fetch standard contract orders
|
|
4257
|
+
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4258
|
+
*/
|
|
4243
4259
|
async fetchCanceledAndClosedOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
4244
|
-
/**
|
|
4245
|
-
* @method
|
|
4246
|
-
* @name bingx#fetchCanceledAndClosedOrders
|
|
4247
|
-
* @description fetches information on multiple closed orders made by the user
|
|
4248
|
-
* @see https://bingx-api.github.io/docs/#/en-us/spot/trade-api.html#Query%20Order%20history
|
|
4249
|
-
* @see https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Query%20Order%20history
|
|
4250
|
-
* @see https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#User's%20History%20Orders
|
|
4251
|
-
* @see https://bingx-api.github.io/docs/#/standard/contract-interface.html#Historical%20order
|
|
4252
|
-
* @param {string} [symbol] unified market symbol of the market orders were made in
|
|
4253
|
-
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
4254
|
-
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
4255
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4256
|
-
* @param {int} [params.until] the latest time in ms to fetch orders for
|
|
4257
|
-
* @param {boolean} [params.standard] whether to fetch standard contract orders
|
|
4258
|
-
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4259
|
-
*/
|
|
4260
4260
|
if (symbol === undefined) {
|
|
4261
4261
|
throw new ArgumentsRequired(this.id + ' fetchClosedOrders() requires a symbol argument');
|
|
4262
4262
|
}
|
|
@@ -4395,19 +4395,19 @@ export default class bingx extends Exchange {
|
|
|
4395
4395
|
const orders = this.safeList(data, 'orders', []);
|
|
4396
4396
|
return this.parseOrders(orders, market, since, limit);
|
|
4397
4397
|
}
|
|
4398
|
+
/**
|
|
4399
|
+
* @method
|
|
4400
|
+
* @name bingx#transfer
|
|
4401
|
+
* @description transfer currency internally between wallets on the same account
|
|
4402
|
+
* @see https://bingx-api.github.io/docs/#/spot/account-api.html#User%20Universal%20Transfer
|
|
4403
|
+
* @param {string} code unified currency code
|
|
4404
|
+
* @param {float} amount amount to transfer
|
|
4405
|
+
* @param {string} fromAccount account to transfer from
|
|
4406
|
+
* @param {string} toAccount account to transfer to
|
|
4407
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4408
|
+
* @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
4409
|
+
*/
|
|
4398
4410
|
async transfer(code, amount, fromAccount, toAccount, params = {}) {
|
|
4399
|
-
/**
|
|
4400
|
-
* @method
|
|
4401
|
-
* @name bingx#transfer
|
|
4402
|
-
* @description transfer currency internally between wallets on the same account
|
|
4403
|
-
* @see https://bingx-api.github.io/docs/#/spot/account-api.html#User%20Universal%20Transfer
|
|
4404
|
-
* @param {string} code unified currency code
|
|
4405
|
-
* @param {float} amount amount to transfer
|
|
4406
|
-
* @param {string} fromAccount account to transfer from
|
|
4407
|
-
* @param {string} toAccount account to transfer to
|
|
4408
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4409
|
-
* @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
4410
|
-
*/
|
|
4411
4411
|
await this.loadMarkets();
|
|
4412
4412
|
const currency = this.currency(code);
|
|
4413
4413
|
const accountsByType = this.safeDict(this.options, 'accountsByType', {});
|
|
@@ -4436,18 +4436,18 @@ export default class bingx extends Exchange {
|
|
|
4436
4436
|
'status': undefined,
|
|
4437
4437
|
};
|
|
4438
4438
|
}
|
|
4439
|
+
/**
|
|
4440
|
+
* @method
|
|
4441
|
+
* @name bingx#fetchTransfers
|
|
4442
|
+
* @description fetch a history of internal transfers made on an account
|
|
4443
|
+
* @see https://bingx-api.github.io/docs/#/spot/account-api.html#Query%20User%20Universal%20Transfer%20History%20(USER_DATA)
|
|
4444
|
+
* @param {string} [code] unified currency code of the currency transferred
|
|
4445
|
+
* @param {int} [since] the earliest time in ms to fetch transfers for
|
|
4446
|
+
* @param {int} [limit] the maximum number of transfers structures to retrieve
|
|
4447
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4448
|
+
* @returns {object[]} a list of [transfer structures]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
4449
|
+
*/
|
|
4439
4450
|
async fetchTransfers(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
4440
|
-
/**
|
|
4441
|
-
* @method
|
|
4442
|
-
* @name bingx#fetchTransfers
|
|
4443
|
-
* @description fetch a history of internal transfers made on an account
|
|
4444
|
-
* @see https://bingx-api.github.io/docs/#/spot/account-api.html#Query%20User%20Universal%20Transfer%20History%20(USER_DATA)
|
|
4445
|
-
* @param {string} [code] unified currency code of the currency transferred
|
|
4446
|
-
* @param {int} [since] the earliest time in ms to fetch transfers for
|
|
4447
|
-
* @param {int} [limit] the maximum number of transfers structures to retrieve
|
|
4448
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4449
|
-
* @returns {object[]} a list of [transfer structures]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
4450
|
-
*/
|
|
4451
4451
|
await this.loadMarkets();
|
|
4452
4452
|
let currency = undefined;
|
|
4453
4453
|
if (code !== undefined) {
|
|
@@ -4513,16 +4513,16 @@ export default class bingx extends Exchange {
|
|
|
4513
4513
|
'status': status,
|
|
4514
4514
|
};
|
|
4515
4515
|
}
|
|
4516
|
+
/**
|
|
4517
|
+
* @method
|
|
4518
|
+
* @name bingx#fetchDepositAddressesByNetwork
|
|
4519
|
+
* @description fetch the deposit addresses for a currency associated with this account
|
|
4520
|
+
* @see https://bingx-api.github.io/docs/#/en-us/common/wallet-api.html#Query%20Main%20Account%20Deposit%20Address
|
|
4521
|
+
* @param {string} code unified currency code
|
|
4522
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4523
|
+
* @returns {object} a dictionary [address structures]{@link https://docs.ccxt.com/#/?id=address-structure}, indexed by the network
|
|
4524
|
+
*/
|
|
4516
4525
|
async fetchDepositAddressesByNetwork(code, params = {}) {
|
|
4517
|
-
/**
|
|
4518
|
-
* @method
|
|
4519
|
-
* @name bingx#fetchDepositAddressesByNetwork
|
|
4520
|
-
* @description fetch the deposit addresses for a currency associated with this account
|
|
4521
|
-
* @see https://bingx-api.github.io/docs/#/en-us/common/wallet-api.html#Query%20Main%20Account%20Deposit%20Address
|
|
4522
|
-
* @param {string} code unified currency code
|
|
4523
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4524
|
-
* @returns {object} a dictionary [address structures]{@link https://docs.ccxt.com/#/?id=address-structure}, indexed by the network
|
|
4525
|
-
*/
|
|
4526
4526
|
await this.loadMarkets();
|
|
4527
4527
|
const currency = this.currency(code);
|
|
4528
4528
|
const defaultRecvWindow = this.safeInteger(this.options, 'recvWindow');
|
|
@@ -4556,17 +4556,17 @@ export default class bingx extends Exchange {
|
|
|
4556
4556
|
const parsed = this.parseDepositAddresses(data, [currency['code']], false);
|
|
4557
4557
|
return this.indexBy(parsed, 'network');
|
|
4558
4558
|
}
|
|
4559
|
+
/**
|
|
4560
|
+
* @method
|
|
4561
|
+
* @name bingx#fetchDepositAddress
|
|
4562
|
+
* @description fetch the deposit address for a currency associated with this account
|
|
4563
|
+
* @see https://bingx-api.github.io/docs/#/en-us/common/wallet-api.html#Query%20Main%20Account%20Deposit%20Address
|
|
4564
|
+
* @param {string} code unified currency code
|
|
4565
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4566
|
+
* @param {string} [params.network] The chain of currency. This only apply for multi-chain currency, and there is no need for single chain currency
|
|
4567
|
+
* @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
|
|
4568
|
+
*/
|
|
4559
4569
|
async fetchDepositAddress(code, params = {}) {
|
|
4560
|
-
/**
|
|
4561
|
-
* @method
|
|
4562
|
-
* @name bingx#fetchDepositAddress
|
|
4563
|
-
* @description fetch the deposit address for a currency associated with this account
|
|
4564
|
-
* @see https://bingx-api.github.io/docs/#/en-us/common/wallet-api.html#Query%20Main%20Account%20Deposit%20Address
|
|
4565
|
-
* @param {string} code unified currency code
|
|
4566
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4567
|
-
* @param {string} [params.network] The chain of currency. This only apply for multi-chain currency, and there is no need for single chain currency
|
|
4568
|
-
* @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
|
|
4569
|
-
*/
|
|
4570
4570
|
const network = this.safeString(params, 'network');
|
|
4571
4571
|
params = this.omit(params, ['network']);
|
|
4572
4572
|
const addressStructures = await this.fetchDepositAddressesByNetwork(code, params);
|
|
@@ -4612,18 +4612,18 @@ export default class bingx extends Exchange {
|
|
|
4612
4612
|
'tag': tag,
|
|
4613
4613
|
};
|
|
4614
4614
|
}
|
|
4615
|
+
/**
|
|
4616
|
+
* @method
|
|
4617
|
+
* @name bingx#fetchDeposits
|
|
4618
|
+
* @description fetch all deposits made to an account
|
|
4619
|
+
* @see https://bingx-api.github.io/docs/#/spot/account-api.html#Deposit%20History(supporting%20network)
|
|
4620
|
+
* @param {string} [code] unified currency code
|
|
4621
|
+
* @param {int} [since] the earliest time in ms to fetch deposits for
|
|
4622
|
+
* @param {int} [limit] the maximum number of deposits structures to retrieve
|
|
4623
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4624
|
+
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
4625
|
+
*/
|
|
4615
4626
|
async fetchDeposits(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
4616
|
-
/**
|
|
4617
|
-
* @method
|
|
4618
|
-
* @name bingx#fetchDeposits
|
|
4619
|
-
* @description fetch all deposits made to an account
|
|
4620
|
-
* @see https://bingx-api.github.io/docs/#/spot/account-api.html#Deposit%20History(supporting%20network)
|
|
4621
|
-
* @param {string} [code] unified currency code
|
|
4622
|
-
* @param {int} [since] the earliest time in ms to fetch deposits for
|
|
4623
|
-
* @param {int} [limit] the maximum number of deposits structures to retrieve
|
|
4624
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4625
|
-
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
4626
|
-
*/
|
|
4627
4627
|
await this.loadMarkets();
|
|
4628
4628
|
const request = {};
|
|
4629
4629
|
let currency = undefined;
|
|
@@ -4657,18 +4657,18 @@ export default class bingx extends Exchange {
|
|
|
4657
4657
|
//
|
|
4658
4658
|
return this.parseTransactions(response, currency, since, limit);
|
|
4659
4659
|
}
|
|
4660
|
+
/**
|
|
4661
|
+
* @method
|
|
4662
|
+
* @name bingx#fetchWithdrawals
|
|
4663
|
+
* @description fetch all withdrawals made from an account
|
|
4664
|
+
* @see https://bingx-api.github.io/docs/#/spot/account-api.html#Withdraw%20History%20(supporting%20network)
|
|
4665
|
+
* @param {string} [code] unified currency code
|
|
4666
|
+
* @param {int} [since] the earliest time in ms to fetch withdrawals for
|
|
4667
|
+
* @param {int} [limit] the maximum number of withdrawals structures to retrieve
|
|
4668
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4669
|
+
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
4670
|
+
*/
|
|
4660
4671
|
async fetchWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
4661
|
-
/**
|
|
4662
|
-
* @method
|
|
4663
|
-
* @name bingx#fetchWithdrawals
|
|
4664
|
-
* @description fetch all withdrawals made from an account
|
|
4665
|
-
* @see https://bingx-api.github.io/docs/#/spot/account-api.html#Withdraw%20History%20(supporting%20network)
|
|
4666
|
-
* @param {string} [code] unified currency code
|
|
4667
|
-
* @param {int} [since] the earliest time in ms to fetch withdrawals for
|
|
4668
|
-
* @param {int} [limit] the maximum number of withdrawals structures to retrieve
|
|
4669
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4670
|
-
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
4671
|
-
*/
|
|
4672
4672
|
await this.loadMarkets();
|
|
4673
4673
|
const request = {};
|
|
4674
4674
|
let currency = undefined;
|
|
@@ -4819,18 +4819,18 @@ export default class bingx extends Exchange {
|
|
|
4819
4819
|
};
|
|
4820
4820
|
return this.safeString(statuses, status, status);
|
|
4821
4821
|
}
|
|
4822
|
+
/**
|
|
4823
|
+
* @method
|
|
4824
|
+
* @name bingx#setMarginMode
|
|
4825
|
+
* @description set margin mode to 'cross' or 'isolated'
|
|
4826
|
+
* @see https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Change%20Margin%20Type
|
|
4827
|
+
* @see https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#Set%20Margin%20Type
|
|
4828
|
+
* @param {string} marginMode 'cross' or 'isolated'
|
|
4829
|
+
* @param {string} symbol unified market symbol
|
|
4830
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4831
|
+
* @returns {object} response from the exchange
|
|
4832
|
+
*/
|
|
4822
4833
|
async setMarginMode(marginMode, symbol = undefined, params = {}) {
|
|
4823
|
-
/**
|
|
4824
|
-
* @method
|
|
4825
|
-
* @name bingx#setMarginMode
|
|
4826
|
-
* @description set margin mode to 'cross' or 'isolated'
|
|
4827
|
-
* @see https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Change%20Margin%20Type
|
|
4828
|
-
* @see https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#Set%20Margin%20Type
|
|
4829
|
-
* @param {string} marginMode 'cross' or 'isolated'
|
|
4830
|
-
* @param {string} symbol unified market symbol
|
|
4831
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4832
|
-
* @returns {object} response from the exchange
|
|
4833
|
-
*/
|
|
4834
4834
|
if (symbol === undefined) {
|
|
4835
4835
|
throw new ArgumentsRequired(this.id + ' setMarginMode() requires a symbol argument');
|
|
4836
4836
|
}
|
|
@@ -4871,17 +4871,17 @@ export default class bingx extends Exchange {
|
|
|
4871
4871
|
};
|
|
4872
4872
|
return await this.setMargin(symbol, amount, this.extend(request, params));
|
|
4873
4873
|
}
|
|
4874
|
+
/**
|
|
4875
|
+
* @method
|
|
4876
|
+
* @name bingx#setMargin
|
|
4877
|
+
* @description Either adds or reduces margin in an isolated position in order to set the margin to a specific value
|
|
4878
|
+
* @see https://bingx-api.github.io/docs/#/swapV2/trade-api.html#Adjust%20isolated%20margin
|
|
4879
|
+
* @param {string} symbol unified market symbol of the market to set margin in
|
|
4880
|
+
* @param {float} amount the amount to set the margin to
|
|
4881
|
+
* @param {object} [params] parameters specific to the bingx api endpoint
|
|
4882
|
+
* @returns {object} A [margin structure]{@link https://docs.ccxt.com/#/?id=add-margin-structure}
|
|
4883
|
+
*/
|
|
4874
4884
|
async setMargin(symbol, amount, params = {}) {
|
|
4875
|
-
/**
|
|
4876
|
-
* @method
|
|
4877
|
-
* @name bingx#setMargin
|
|
4878
|
-
* @description Either adds or reduces margin in an isolated position in order to set the margin to a specific value
|
|
4879
|
-
* @see https://bingx-api.github.io/docs/#/swapV2/trade-api.html#Adjust%20isolated%20margin
|
|
4880
|
-
* @param {string} symbol unified market symbol of the market to set margin in
|
|
4881
|
-
* @param {float} amount the amount to set the margin to
|
|
4882
|
-
* @param {object} [params] parameters specific to the bingx api endpoint
|
|
4883
|
-
* @returns {object} A [margin structure]{@link https://docs.ccxt.com/#/?id=add-margin-structure}
|
|
4884
|
-
*/
|
|
4885
4885
|
const type = this.safeInteger(params, 'type'); // 1 increase margin 2 decrease margin
|
|
4886
4886
|
if (type === undefined) {
|
|
4887
4887
|
throw new ArgumentsRequired(this.id + ' setMargin() requires a type parameter either 1 (increase margin) or 2 (decrease margin)');
|
|
@@ -4930,17 +4930,17 @@ export default class bingx extends Exchange {
|
|
|
4930
4930
|
'datetime': undefined,
|
|
4931
4931
|
};
|
|
4932
4932
|
}
|
|
4933
|
+
/**
|
|
4934
|
+
* @method
|
|
4935
|
+
* @name bingx#fetchLeverage
|
|
4936
|
+
* @description fetch the set leverage for a market
|
|
4937
|
+
* @see https://bingx-api.github.io/docs/#/swapV2/trade-api.html#Query%20Leverage
|
|
4938
|
+
* @see https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#Query%20Leverage
|
|
4939
|
+
* @param {string} symbol unified market symbol
|
|
4940
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4941
|
+
* @returns {object} a [leverage structure]{@link https://docs.ccxt.com/#/?id=leverage-structure}
|
|
4942
|
+
*/
|
|
4933
4943
|
async fetchLeverage(symbol, params = {}) {
|
|
4934
|
-
/**
|
|
4935
|
-
* @method
|
|
4936
|
-
* @name bingx#fetchLeverage
|
|
4937
|
-
* @description fetch the set leverage for a market
|
|
4938
|
-
* @see https://bingx-api.github.io/docs/#/swapV2/trade-api.html#Query%20Leverage
|
|
4939
|
-
* @see https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#Query%20Leverage
|
|
4940
|
-
* @param {string} symbol unified market symbol
|
|
4941
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4942
|
-
* @returns {object} a [leverage structure]{@link https://docs.ccxt.com/#/?id=leverage-structure}
|
|
4943
|
-
*/
|
|
4944
4944
|
await this.loadMarkets();
|
|
4945
4945
|
const market = this.market(symbol);
|
|
4946
4946
|
const request = {
|
|
@@ -5028,19 +5028,19 @@ export default class bingx extends Exchange {
|
|
|
5028
5028
|
'shortLeverage': this.safeInteger(leverage, 'shortLeverage'),
|
|
5029
5029
|
};
|
|
5030
5030
|
}
|
|
5031
|
+
/**
|
|
5032
|
+
* @method
|
|
5033
|
+
* @name bingx#setLeverage
|
|
5034
|
+
* @description set the level of leverage for a market
|
|
5035
|
+
* @see https://bingx-api.github.io/docs/#/swapV2/trade-api.html#Switch%20Leverage
|
|
5036
|
+
* @see https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#Modify%20Leverage
|
|
5037
|
+
* @param {float} leverage the rate of leverage
|
|
5038
|
+
* @param {string} symbol unified market symbol
|
|
5039
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5040
|
+
* @param {string} [params.side] hedged: ['long' or 'short']. one way: ['both']
|
|
5041
|
+
* @returns {object} response from the exchange
|
|
5042
|
+
*/
|
|
5031
5043
|
async setLeverage(leverage, symbol = undefined, params = {}) {
|
|
5032
|
-
/**
|
|
5033
|
-
* @method
|
|
5034
|
-
* @name bingx#setLeverage
|
|
5035
|
-
* @description set the level of leverage for a market
|
|
5036
|
-
* @see https://bingx-api.github.io/docs/#/swapV2/trade-api.html#Switch%20Leverage
|
|
5037
|
-
* @see https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#Modify%20Leverage
|
|
5038
|
-
* @param {float} leverage the rate of leverage
|
|
5039
|
-
* @param {string} symbol unified market symbol
|
|
5040
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5041
|
-
* @param {string} [params.side] hedged: ['long' or 'short']. one way: ['both']
|
|
5042
|
-
* @returns {object} response from the exchange
|
|
5043
|
-
*/
|
|
5044
5044
|
if (symbol === undefined) {
|
|
5045
5045
|
throw new ArgumentsRequired(this.id + ' setLeverage() requires a symbol argument');
|
|
5046
5046
|
}
|
|
@@ -5092,23 +5092,23 @@ export default class bingx extends Exchange {
|
|
|
5092
5092
|
//
|
|
5093
5093
|
}
|
|
5094
5094
|
}
|
|
5095
|
+
/**
|
|
5096
|
+
* @method
|
|
5097
|
+
* @name bingx#fetchMyTrades
|
|
5098
|
+
* @description fetch all trades made by the user
|
|
5099
|
+
* @see https://bingx-api.github.io/docs/#/en-us/spot/trade-api.html#Query%20transaction%20details
|
|
5100
|
+
* @see https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Query%20historical%20transaction%20orders
|
|
5101
|
+
* @see https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#Query%20Order%20Trade%20Detail
|
|
5102
|
+
* @param {string} [symbol] unified market symbol
|
|
5103
|
+
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
5104
|
+
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
5105
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5106
|
+
* @param {int} [params.until] timestamp in ms for the ending date filter, default is undefined
|
|
5107
|
+
* @param {string} params.trandingUnit COIN (directly represent assets such as BTC and ETH) or CONT (represents the number of contract sheets)
|
|
5108
|
+
* @param {string} params.orderId the order id required for inverse swap
|
|
5109
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
5110
|
+
*/
|
|
5095
5111
|
async fetchMyTrades(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
5096
|
-
/**
|
|
5097
|
-
* @method
|
|
5098
|
-
* @name bingx#fetchMyTrades
|
|
5099
|
-
* @description fetch all trades made by the user
|
|
5100
|
-
* @see https://bingx-api.github.io/docs/#/en-us/spot/trade-api.html#Query%20transaction%20details
|
|
5101
|
-
* @see https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Query%20historical%20transaction%20orders
|
|
5102
|
-
* @see https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#Query%20Order%20Trade%20Detail
|
|
5103
|
-
* @param {string} [symbol] unified market symbol
|
|
5104
|
-
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
5105
|
-
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
5106
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5107
|
-
* @param {int} [params.until] timestamp in ms for the ending date filter, default is undefined
|
|
5108
|
-
* @param {string} params.trandingUnit COIN (directly represent assets such as BTC and ETH) or CONT (represents the number of contract sheets)
|
|
5109
|
-
* @param {string} params.orderId the order id required for inverse swap
|
|
5110
|
-
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
5111
|
-
*/
|
|
5112
5112
|
if (symbol === undefined) {
|
|
5113
5113
|
throw new ArgumentsRequired(this.id + ' fetchMyTrades() requires a symbol argument');
|
|
5114
5114
|
}
|
|
@@ -5294,35 +5294,35 @@ export default class bingx extends Exchange {
|
|
|
5294
5294
|
}
|
|
5295
5295
|
return result;
|
|
5296
5296
|
}
|
|
5297
|
+
/**
|
|
5298
|
+
* @method
|
|
5299
|
+
* @name bingx#fetchDepositWithdrawFees
|
|
5300
|
+
* @description fetch deposit and withdraw fees
|
|
5301
|
+
* @see https://bingx-api.github.io/docs/#/common/account-api.html#All%20Coins'%20Information
|
|
5302
|
+
* @param {string[]|undefined} codes list of unified currency codes
|
|
5303
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5304
|
+
* @returns {object} a list of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
5305
|
+
*/
|
|
5297
5306
|
async fetchDepositWithdrawFees(codes = undefined, params = {}) {
|
|
5298
|
-
/**
|
|
5299
|
-
* @method
|
|
5300
|
-
* @name bingx#fetchDepositWithdrawFees
|
|
5301
|
-
* @description fetch deposit and withdraw fees
|
|
5302
|
-
* @see https://bingx-api.github.io/docs/#/common/account-api.html#All%20Coins'%20Information
|
|
5303
|
-
* @param {string[]|undefined} codes list of unified currency codes
|
|
5304
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5305
|
-
* @returns {object} a list of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
5306
|
-
*/
|
|
5307
5307
|
await this.loadMarkets();
|
|
5308
5308
|
const response = await this.walletsV1PrivateGetCapitalConfigGetall(params);
|
|
5309
5309
|
const coins = this.safeList(response, 'data');
|
|
5310
5310
|
return this.parseDepositWithdrawFees(coins, codes, 'coin');
|
|
5311
5311
|
}
|
|
5312
|
+
/**
|
|
5313
|
+
* @method
|
|
5314
|
+
* @name bingx#withdraw
|
|
5315
|
+
* @description make a withdrawal
|
|
5316
|
+
* @see https://bingx-api.github.io/docs/#/en-us/spot/wallet-api.html#Withdraw
|
|
5317
|
+
* @param {string} code unified currency code
|
|
5318
|
+
* @param {float} amount the amount to withdraw
|
|
5319
|
+
* @param {string} address the address to withdraw to
|
|
5320
|
+
* @param {string} [tag]
|
|
5321
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5322
|
+
* @param {int} [params.walletType] 1 fund account, 2 standard account, 3 perpetual account
|
|
5323
|
+
* @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
5324
|
+
*/
|
|
5312
5325
|
async withdraw(code, amount, address, tag = undefined, params = {}) {
|
|
5313
|
-
/**
|
|
5314
|
-
* @method
|
|
5315
|
-
* @name bingx#withdraw
|
|
5316
|
-
* @description make a withdrawal
|
|
5317
|
-
* @see https://bingx-api.github.io/docs/#/en-us/spot/wallet-api.html#Withdraw
|
|
5318
|
-
* @param {string} code unified currency code
|
|
5319
|
-
* @param {float} amount the amount to withdraw
|
|
5320
|
-
* @param {string} address the address to withdraw to
|
|
5321
|
-
* @param {string} [tag]
|
|
5322
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5323
|
-
* @param {int} [params.walletType] 1 fund account, 2 standard account, 3 perpetual account
|
|
5324
|
-
* @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
5325
|
-
*/
|
|
5326
5326
|
[tag, params] = this.handleWithdrawTagAndParams(tag, params);
|
|
5327
5327
|
this.checkAddress(address);
|
|
5328
5328
|
await this.loadMarkets();
|
|
@@ -5380,20 +5380,20 @@ export default class bingx extends Exchange {
|
|
|
5380
5380
|
}
|
|
5381
5381
|
return sortedParams;
|
|
5382
5382
|
}
|
|
5383
|
+
/**
|
|
5384
|
+
* @method
|
|
5385
|
+
* @name bingx#fetchMyLiquidations
|
|
5386
|
+
* @description retrieves the users liquidated positions
|
|
5387
|
+
* @see https://bingx-api.github.io/docs/#/swapV2/trade-api.html#User's%20Force%20Orders
|
|
5388
|
+
* @see https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#Query%20force%20orders
|
|
5389
|
+
* @param {string} [symbol] unified CCXT market symbol
|
|
5390
|
+
* @param {int} [since] the earliest time in ms to fetch liquidations for
|
|
5391
|
+
* @param {int} [limit] the maximum number of liquidation structures to retrieve
|
|
5392
|
+
* @param {object} [params] exchange specific parameters for the bingx api endpoint
|
|
5393
|
+
* @param {int} [params.until] timestamp in ms of the latest liquidation
|
|
5394
|
+
* @returns {object} an array of [liquidation structures]{@link https://docs.ccxt.com/#/?id=liquidation-structure}
|
|
5395
|
+
*/
|
|
5383
5396
|
async fetchMyLiquidations(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
5384
|
-
/**
|
|
5385
|
-
* @method
|
|
5386
|
-
* @name bingx#fetchMyLiquidations
|
|
5387
|
-
* @description retrieves the users liquidated positions
|
|
5388
|
-
* @see https://bingx-api.github.io/docs/#/swapV2/trade-api.html#User's%20Force%20Orders
|
|
5389
|
-
* @see https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#Query%20force%20orders
|
|
5390
|
-
* @param {string} [symbol] unified CCXT market symbol
|
|
5391
|
-
* @param {int} [since] the earliest time in ms to fetch liquidations for
|
|
5392
|
-
* @param {int} [limit] the maximum number of liquidation structures to retrieve
|
|
5393
|
-
* @param {object} [params] exchange specific parameters for the bingx api endpoint
|
|
5394
|
-
* @param {int} [params.until] timestamp in ms of the latest liquidation
|
|
5395
|
-
* @returns {object} an array of [liquidation structures]{@link https://docs.ccxt.com/#/?id=liquidation-structure}
|
|
5396
|
-
*/
|
|
5397
5397
|
await this.loadMarkets();
|
|
5398
5398
|
let request = {
|
|
5399
5399
|
'autoCloseType': 'LIQUIDATION',
|
|
@@ -5522,19 +5522,19 @@ export default class bingx extends Exchange {
|
|
|
5522
5522
|
'datetime': this.iso8601(timestamp),
|
|
5523
5523
|
});
|
|
5524
5524
|
}
|
|
5525
|
+
/**
|
|
5526
|
+
* @method
|
|
5527
|
+
* @name bingx#closePosition
|
|
5528
|
+
* @description closes open positions for a market
|
|
5529
|
+
* @see https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#One-Click%20Close%20All%20Positions
|
|
5530
|
+
* @see https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#Close%20all%20positions%20in%20bulk
|
|
5531
|
+
* @param {string} symbol Unified CCXT market symbol
|
|
5532
|
+
* @param {string} [side] not used by bingx
|
|
5533
|
+
* @param {object} [params] extra parameters specific to the bingx api endpoint
|
|
5534
|
+
* @param {string|undefined} [params.positionId] the id of the position you would like to close
|
|
5535
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
5536
|
+
*/
|
|
5525
5537
|
async closePosition(symbol, side = undefined, params = {}) {
|
|
5526
|
-
/**
|
|
5527
|
-
* @method
|
|
5528
|
-
* @name bingx#closePosition
|
|
5529
|
-
* @description closes open positions for a market
|
|
5530
|
-
* @see https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#One-Click%20Close%20All%20Positions
|
|
5531
|
-
* @see https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#Close%20all%20positions%20in%20bulk
|
|
5532
|
-
* @param {string} symbol Unified CCXT market symbol
|
|
5533
|
-
* @param {string} [side] not used by bingx
|
|
5534
|
-
* @param {object} [params] extra parameters specific to the bingx api endpoint
|
|
5535
|
-
* @param {string|undefined} [params.positionId] the id of the position you would like to close
|
|
5536
|
-
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
5537
|
-
*/
|
|
5538
5538
|
await this.loadMarkets();
|
|
5539
5539
|
const market = this.market(symbol);
|
|
5540
5540
|
const positionId = this.safeString(params, 'positionId');
|
|
@@ -5594,17 +5594,17 @@ export default class bingx extends Exchange {
|
|
|
5594
5594
|
const data = this.safeDict(response, 'data');
|
|
5595
5595
|
return this.parseOrder(data, market);
|
|
5596
5596
|
}
|
|
5597
|
+
/**
|
|
5598
|
+
* @method
|
|
5599
|
+
* @name bitget#closePositions
|
|
5600
|
+
* @description closes open positions for a market
|
|
5601
|
+
* @see https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#One-Click%20Close%20All%20Positions
|
|
5602
|
+
* @see https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#Close%20all%20positions%20in%20bulk
|
|
5603
|
+
* @param {object} [params] extra parameters specific to the bingx api endpoint
|
|
5604
|
+
* @param {string} [params.recvWindow] request valid time window value
|
|
5605
|
+
* @returns {object[]} [a list of position structures]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
5606
|
+
*/
|
|
5597
5607
|
async closeAllPositions(params = {}) {
|
|
5598
|
-
/**
|
|
5599
|
-
* @method
|
|
5600
|
-
* @name bitget#closePositions
|
|
5601
|
-
* @description closes open positions for a market
|
|
5602
|
-
* @see https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#One-Click%20Close%20All%20Positions
|
|
5603
|
-
* @see https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#Close%20all%20positions%20in%20bulk
|
|
5604
|
-
* @param {object} [params] extra parameters specific to the bingx api endpoint
|
|
5605
|
-
* @param {string} [params.recvWindow] request valid time window value
|
|
5606
|
-
* @returns {object[]} [a list of position structures]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
5607
|
-
*/
|
|
5608
5608
|
await this.loadMarkets();
|
|
5609
5609
|
const defaultRecvWindow = this.safeInteger(this.options, 'recvWindow');
|
|
5610
5610
|
const recvWindow = this.safeInteger(this.parseParams, 'recvWindow', defaultRecvWindow);
|
|
@@ -5658,16 +5658,16 @@ export default class bingx extends Exchange {
|
|
|
5658
5658
|
}
|
|
5659
5659
|
return positions;
|
|
5660
5660
|
}
|
|
5661
|
+
/**
|
|
5662
|
+
* @method
|
|
5663
|
+
* @name bingx#fetchPositionMode
|
|
5664
|
+
* @description fetchs the position mode, hedged or one way, hedged for binance is set identically for all linear markets or all inverse markets
|
|
5665
|
+
* @see https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Get%20Position%20Mode
|
|
5666
|
+
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
5667
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5668
|
+
* @returns {object} an object detailing whether the market is in hedged or one-way mode
|
|
5669
|
+
*/
|
|
5661
5670
|
async fetchPositionMode(symbol = undefined, params = {}) {
|
|
5662
|
-
/**
|
|
5663
|
-
* @method
|
|
5664
|
-
* @name bingx#fetchPositionMode
|
|
5665
|
-
* @description fetchs the position mode, hedged or one way, hedged for binance is set identically for all linear markets or all inverse markets
|
|
5666
|
-
* @see https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Get%20Position%20Mode
|
|
5667
|
-
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
5668
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5669
|
-
* @returns {object} an object detailing whether the market is in hedged or one-way mode
|
|
5670
|
-
*/
|
|
5671
5671
|
const response = await this.swapV1PrivateGetPositionSideDual(params);
|
|
5672
5672
|
//
|
|
5673
5673
|
// {
|
|
@@ -5686,17 +5686,17 @@ export default class bingx extends Exchange {
|
|
|
5686
5686
|
'hedged': (dualSidePosition === 'true'),
|
|
5687
5687
|
};
|
|
5688
5688
|
}
|
|
5689
|
+
/**
|
|
5690
|
+
* @method
|
|
5691
|
+
* @name bingx#setPositionMode
|
|
5692
|
+
* @description set hedged to true or false for a market
|
|
5693
|
+
* @see https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Set%20Position%20Mode
|
|
5694
|
+
* @param {bool} hedged set to true to use dualSidePosition
|
|
5695
|
+
* @param {string} symbol not used by bingx setPositionMode ()
|
|
5696
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5697
|
+
* @returns {object} response from the exchange
|
|
5698
|
+
*/
|
|
5689
5699
|
async setPositionMode(hedged, symbol = undefined, params = {}) {
|
|
5690
|
-
/**
|
|
5691
|
-
* @method
|
|
5692
|
-
* @name bingx#setPositionMode
|
|
5693
|
-
* @description set hedged to true or false for a market
|
|
5694
|
-
* @see https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Set%20Position%20Mode
|
|
5695
|
-
* @param {bool} hedged set to true to use dualSidePosition
|
|
5696
|
-
* @param {string} symbol not used by bingx setPositionMode ()
|
|
5697
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5698
|
-
* @returns {object} response from the exchange
|
|
5699
|
-
*/
|
|
5700
5700
|
let dualSidePosition = undefined;
|
|
5701
5701
|
if (hedged) {
|
|
5702
5702
|
dualSidePosition = 'true';
|
|
@@ -5717,38 +5717,38 @@ export default class bingx extends Exchange {
|
|
|
5717
5717
|
//
|
|
5718
5718
|
return await this.swapV1PrivatePostPositionSideDual(this.extend(request, params));
|
|
5719
5719
|
}
|
|
5720
|
+
/**
|
|
5721
|
+
* @method
|
|
5722
|
+
* @name bingx#editOrder
|
|
5723
|
+
* @description cancels an order and places a new order
|
|
5724
|
+
* @see https://bingx-api.github.io/docs/#/en-us/spot/trade-api.html#Cancel%20order%20and%20place%20a%20new%20order // spot
|
|
5725
|
+
* @see https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Cancel%20an%20order%20and%20then%20Place%20a%20new%20order // swap
|
|
5726
|
+
* @param {string} id order id
|
|
5727
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
5728
|
+
* @param {string} type 'market' or 'limit'
|
|
5729
|
+
* @param {string} side 'buy' or 'sell'
|
|
5730
|
+
* @param {float} amount how much of the currency you want to trade in units of the base currency
|
|
5731
|
+
* @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
5732
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5733
|
+
* @param {string} [params.stopPrice] Trigger price used for TAKE_STOP_LIMIT, TAKE_STOP_MARKET, TRIGGER_LIMIT, TRIGGER_MARKET order types.
|
|
5734
|
+
* @param {object} [params.takeProfit] *takeProfit object in params* containing the triggerPrice at which the attached take profit order will be triggered
|
|
5735
|
+
* @param {float} [params.takeProfit.triggerPrice] take profit trigger price
|
|
5736
|
+
* @param {object} [params.stopLoss] *stopLoss object in params* containing the triggerPrice at which the attached stop loss order will be triggered
|
|
5737
|
+
* @param {float} [params.stopLoss.triggerPrice] stop loss trigger price
|
|
5738
|
+
*
|
|
5739
|
+
* EXCHANGE SPECIFIC PARAMETERS
|
|
5740
|
+
* @param {string} [params.cancelClientOrderID] the user-defined id of the order to be canceled, 1-40 characters, different orders cannot use the same clientOrderID, only supports a query range of 2 hours
|
|
5741
|
+
* @param {string} [params.cancelRestrictions] cancel orders with specified status, NEW: New order, PENDING: Pending order, PARTIALLY_FILLED: Partially filled
|
|
5742
|
+
* @param {string} [params.cancelReplaceMode] STOP_ON_FAILURE - if the cancel order fails, it will not continue to place a new order, ALLOW_FAILURE - regardless of whether the cancel order succeeds or fails, it will continue to place a new order
|
|
5743
|
+
* @param {float} [params.quoteOrderQty] order amount
|
|
5744
|
+
* @param {string} [params.newClientOrderId] custom order id consisting of letters, numbers, and _, 1-40 characters, different orders cannot use the same newClientOrderId.
|
|
5745
|
+
* @param {string} [params.positionSide] *contract only* position direction, required for single position as BOTH, for both long and short positions only LONG or SHORT can be chosen, defaults to LONG if empty
|
|
5746
|
+
* @param {string} [params.reduceOnly] *contract only* true or false, default=false for single position mode. this parameter is not accepted for both long and short positions mode
|
|
5747
|
+
* @param {float} [params.priceRate] *contract only* for type TRAILING_STOP_Market or TRAILING_TP_SL, Max = 1
|
|
5748
|
+
* @param {string} [params.workingType] *contract only* StopPrice trigger price types, MARK_PRICE (default), CONTRACT_PRICE, or INDEX_PRICE
|
|
5749
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
5750
|
+
*/
|
|
5720
5751
|
async editOrder(id, symbol, type, side, amount = undefined, price = undefined, params = {}) {
|
|
5721
|
-
/**
|
|
5722
|
-
* @method
|
|
5723
|
-
* @name bingx#editOrder
|
|
5724
|
-
* @description cancels an order and places a new order
|
|
5725
|
-
* @see https://bingx-api.github.io/docs/#/en-us/spot/trade-api.html#Cancel%20order%20and%20place%20a%20new%20order // spot
|
|
5726
|
-
* @see https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Cancel%20an%20order%20and%20then%20Place%20a%20new%20order // swap
|
|
5727
|
-
* @param {string} id order id
|
|
5728
|
-
* @param {string} symbol unified symbol of the market to create an order in
|
|
5729
|
-
* @param {string} type 'market' or 'limit'
|
|
5730
|
-
* @param {string} side 'buy' or 'sell'
|
|
5731
|
-
* @param {float} amount how much of the currency you want to trade in units of the base currency
|
|
5732
|
-
* @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
5733
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5734
|
-
* @param {string} [params.stopPrice] Trigger price used for TAKE_STOP_LIMIT, TAKE_STOP_MARKET, TRIGGER_LIMIT, TRIGGER_MARKET order types.
|
|
5735
|
-
* @param {object} [params.takeProfit] *takeProfit object in params* containing the triggerPrice at which the attached take profit order will be triggered
|
|
5736
|
-
* @param {float} [params.takeProfit.triggerPrice] take profit trigger price
|
|
5737
|
-
* @param {object} [params.stopLoss] *stopLoss object in params* containing the triggerPrice at which the attached stop loss order will be triggered
|
|
5738
|
-
* @param {float} [params.stopLoss.triggerPrice] stop loss trigger price
|
|
5739
|
-
*
|
|
5740
|
-
* EXCHANGE SPECIFIC PARAMETERS
|
|
5741
|
-
* @param {string} [params.cancelClientOrderID] the user-defined id of the order to be canceled, 1-40 characters, different orders cannot use the same clientOrderID, only supports a query range of 2 hours
|
|
5742
|
-
* @param {string} [params.cancelRestrictions] cancel orders with specified status, NEW: New order, PENDING: Pending order, PARTIALLY_FILLED: Partially filled
|
|
5743
|
-
* @param {string} [params.cancelReplaceMode] STOP_ON_FAILURE - if the cancel order fails, it will not continue to place a new order, ALLOW_FAILURE - regardless of whether the cancel order succeeds or fails, it will continue to place a new order
|
|
5744
|
-
* @param {float} [params.quoteOrderQty] order amount
|
|
5745
|
-
* @param {string} [params.newClientOrderId] custom order id consisting of letters, numbers, and _, 1-40 characters, different orders cannot use the same newClientOrderId.
|
|
5746
|
-
* @param {string} [params.positionSide] *contract only* position direction, required for single position as BOTH, for both long and short positions only LONG or SHORT can be chosen, defaults to LONG if empty
|
|
5747
|
-
* @param {string} [params.reduceOnly] *contract only* true or false, default=false for single position mode. this parameter is not accepted for both long and short positions mode
|
|
5748
|
-
* @param {float} [params.priceRate] *contract only* for type TRAILING_STOP_Market or TRAILING_TP_SL, Max = 1
|
|
5749
|
-
* @param {string} [params.workingType] *contract only* StopPrice trigger price types, MARK_PRICE (default), CONTRACT_PRICE, or INDEX_PRICE
|
|
5750
|
-
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
5751
|
-
*/
|
|
5752
5752
|
await this.loadMarkets();
|
|
5753
5753
|
const market = this.market(symbol);
|
|
5754
5754
|
const request = this.createOrderRequest(symbol, type, side, amount, price, params);
|
|
@@ -5855,17 +5855,17 @@ export default class bingx extends Exchange {
|
|
|
5855
5855
|
const data = this.safeDict(response, 'data');
|
|
5856
5856
|
return this.parseOrder(data, market);
|
|
5857
5857
|
}
|
|
5858
|
+
/**
|
|
5859
|
+
* @method
|
|
5860
|
+
* @name bingx#fetchMarginMode
|
|
5861
|
+
* @description fetches the margin mode of the trading pair
|
|
5862
|
+
* @see https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Query%20Margin%20Type
|
|
5863
|
+
* @see https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#Query%20Margin%20Type
|
|
5864
|
+
* @param {string} symbol unified symbol of the market to fetch the margin mode for
|
|
5865
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5866
|
+
* @returns {object} a [margin mode structure]{@link https://docs.ccxt.com/#/?id=margin-mode-structure}
|
|
5867
|
+
*/
|
|
5858
5868
|
async fetchMarginMode(symbol, params = {}) {
|
|
5859
|
-
/**
|
|
5860
|
-
* @method
|
|
5861
|
-
* @name bingx#fetchMarginMode
|
|
5862
|
-
* @description fetches the margin mode of the trading pair
|
|
5863
|
-
* @see https://bingx-api.github.io/docs/#/en-us/swapV2/trade-api.html#Query%20Margin%20Type
|
|
5864
|
-
* @see https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#Query%20Margin%20Type
|
|
5865
|
-
* @param {string} symbol unified symbol of the market to fetch the margin mode for
|
|
5866
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5867
|
-
* @returns {object} a [margin mode structure]{@link https://docs.ccxt.com/#/?id=margin-mode-structure}
|
|
5868
|
-
*/
|
|
5869
5869
|
await this.loadMarkets();
|
|
5870
5870
|
const market = this.market(symbol);
|
|
5871
5871
|
const request = {
|
|
@@ -5913,18 +5913,18 @@ export default class bingx extends Exchange {
|
|
|
5913
5913
|
'marginMode': marginType,
|
|
5914
5914
|
};
|
|
5915
5915
|
}
|
|
5916
|
+
/**
|
|
5917
|
+
* @method
|
|
5918
|
+
* @name bingx#fetchTradingFee
|
|
5919
|
+
* @description fetch the trading fees for a market
|
|
5920
|
+
* @see https://bingx-api.github.io/docs/#/en-us/spot/trade-api.html#Query%20Trading%20Commission%20Rate
|
|
5921
|
+
* @see https://bingx-api.github.io/docs/#/en-us/swapV2/account-api.html#Query%20Trading%20Commission%20Rate
|
|
5922
|
+
* @see https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#Query%20Trade%20Commission%20Rate
|
|
5923
|
+
* @param {string} symbol unified market symbol
|
|
5924
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5925
|
+
* @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
5926
|
+
*/
|
|
5916
5927
|
async fetchTradingFee(symbol, params = {}) {
|
|
5917
|
-
/**
|
|
5918
|
-
* @method
|
|
5919
|
-
* @name bingx#fetchTradingFee
|
|
5920
|
-
* @description fetch the trading fees for a market
|
|
5921
|
-
* @see https://bingx-api.github.io/docs/#/en-us/spot/trade-api.html#Query%20Trading%20Commission%20Rate
|
|
5922
|
-
* @see https://bingx-api.github.io/docs/#/en-us/swapV2/account-api.html#Query%20Trading%20Commission%20Rate
|
|
5923
|
-
* @see https://bingx-api.github.io/docs/#/en-us/cswap/trade-api.html#Query%20Trade%20Commission%20Rate
|
|
5924
|
-
* @param {string} symbol unified market symbol
|
|
5925
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5926
|
-
* @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
5927
|
-
*/
|
|
5928
5928
|
await this.loadMarkets();
|
|
5929
5929
|
const market = this.market(symbol);
|
|
5930
5930
|
const request = {
|