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
|
@@ -359,15 +359,15 @@ class kucoinfutures extends kucoinfutures$1 {
|
|
|
359
359
|
},
|
|
360
360
|
});
|
|
361
361
|
}
|
|
362
|
+
/**
|
|
363
|
+
* @method
|
|
364
|
+
* @name kucoinfutures#fetchStatus
|
|
365
|
+
* @description the latest known information on the availability of the exchange API
|
|
366
|
+
* @see https://www.kucoin.com/docs/rest/futures-trading/market-data/get-service-status
|
|
367
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
368
|
+
* @returns {object} a [status structure]{@link https://docs.ccxt.com/#/?id=exchange-status-structure}
|
|
369
|
+
*/
|
|
362
370
|
async fetchStatus(params = {}) {
|
|
363
|
-
/**
|
|
364
|
-
* @method
|
|
365
|
-
* @name kucoinfutures#fetchStatus
|
|
366
|
-
* @description the latest known information on the availability of the exchange API
|
|
367
|
-
* @see https://www.kucoin.com/docs/rest/futures-trading/market-data/get-service-status
|
|
368
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
369
|
-
* @returns {object} a [status structure]{@link https://docs.ccxt.com/#/?id=exchange-status-structure}
|
|
370
|
-
*/
|
|
371
371
|
const response = await this.futuresPublicGetStatus(params);
|
|
372
372
|
//
|
|
373
373
|
// {
|
|
@@ -388,15 +388,15 @@ class kucoinfutures extends kucoinfutures$1 {
|
|
|
388
388
|
'info': response,
|
|
389
389
|
};
|
|
390
390
|
}
|
|
391
|
+
/**
|
|
392
|
+
* @method
|
|
393
|
+
* @name kucoinfutures#fetchMarkets
|
|
394
|
+
* @description retrieves data on all markets for kucoinfutures
|
|
395
|
+
* @see https://www.kucoin.com/docs/rest/futures-trading/market-data/get-symbols-list
|
|
396
|
+
* @param {object} [params] extra parameters specific to the exchange api endpoint
|
|
397
|
+
* @returns {object[]} an array of objects representing market data
|
|
398
|
+
*/
|
|
391
399
|
async fetchMarkets(params = {}) {
|
|
392
|
-
/**
|
|
393
|
-
* @method
|
|
394
|
-
* @name kucoinfutures#fetchMarkets
|
|
395
|
-
* @description retrieves data on all markets for kucoinfutures
|
|
396
|
-
* @see https://www.kucoin.com/docs/rest/futures-trading/market-data/get-symbols-list
|
|
397
|
-
* @param {object} [params] extra parameters specific to the exchange api endpoint
|
|
398
|
-
* @returns {object[]} an array of objects representing market data
|
|
399
|
-
*/
|
|
400
400
|
const response = await this.futuresPublicGetContractsActive(params);
|
|
401
401
|
//
|
|
402
402
|
// {
|
|
@@ -553,15 +553,15 @@ class kucoinfutures extends kucoinfutures$1 {
|
|
|
553
553
|
}
|
|
554
554
|
return result;
|
|
555
555
|
}
|
|
556
|
+
/**
|
|
557
|
+
* @method
|
|
558
|
+
* @name kucoinfutures#fetchTime
|
|
559
|
+
* @description fetches the current integer timestamp in milliseconds from the exchange server
|
|
560
|
+
* @see https://www.kucoin.com/docs/rest/futures-trading/market-data/get-server-time
|
|
561
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
562
|
+
* @returns {int} the current integer timestamp in milliseconds from the exchange server
|
|
563
|
+
*/
|
|
556
564
|
async fetchTime(params = {}) {
|
|
557
|
-
/**
|
|
558
|
-
* @method
|
|
559
|
-
* @name kucoinfutures#fetchTime
|
|
560
|
-
* @description fetches the current integer timestamp in milliseconds from the exchange server
|
|
561
|
-
* @see https://www.kucoin.com/docs/rest/futures-trading/market-data/get-server-time
|
|
562
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
563
|
-
* @returns {int} the current integer timestamp in milliseconds from the exchange server
|
|
564
|
-
*/
|
|
565
565
|
const response = await this.futuresPublicGetTimestamp(params);
|
|
566
566
|
//
|
|
567
567
|
// {
|
|
@@ -571,20 +571,20 @@ class kucoinfutures extends kucoinfutures$1 {
|
|
|
571
571
|
//
|
|
572
572
|
return this.safeInteger(response, 'data');
|
|
573
573
|
}
|
|
574
|
+
/**
|
|
575
|
+
* @method
|
|
576
|
+
* @name kucoinfutures#fetchOHLCV
|
|
577
|
+
* @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
578
|
+
* @see https://www.kucoin.com/docs/rest/futures-trading/market-data/get-klines
|
|
579
|
+
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
580
|
+
* @param {string} timeframe the length of time each candle represents
|
|
581
|
+
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
582
|
+
* @param {int} [limit] the maximum amount of candles to fetch
|
|
583
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
584
|
+
* @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)
|
|
585
|
+
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
586
|
+
*/
|
|
574
587
|
async fetchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
|
|
575
|
-
/**
|
|
576
|
-
* @method
|
|
577
|
-
* @name kucoinfutures#fetchOHLCV
|
|
578
|
-
* @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
579
|
-
* @see https://www.kucoin.com/docs/rest/futures-trading/market-data/get-klines
|
|
580
|
-
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
581
|
-
* @param {string} timeframe the length of time each candle represents
|
|
582
|
-
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
583
|
-
* @param {int} [limit] the maximum amount of candles to fetch
|
|
584
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
585
|
-
* @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)
|
|
586
|
-
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
587
|
-
*/
|
|
588
588
|
await this.loadMarkets();
|
|
589
589
|
let paginate = false;
|
|
590
590
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchOHLCV', 'paginate');
|
|
@@ -652,16 +652,16 @@ class kucoinfutures extends kucoinfutures$1 {
|
|
|
652
652
|
this.safeNumber(ohlcv, 5),
|
|
653
653
|
];
|
|
654
654
|
}
|
|
655
|
+
/**
|
|
656
|
+
* @method
|
|
657
|
+
* @name kucoinfutures#fetchDepositAddress
|
|
658
|
+
* @description fetch the deposit address for a currency associated with this account
|
|
659
|
+
* @see https://www.kucoin.com/docs/rest/funding/deposit/get-deposit-address
|
|
660
|
+
* @param {string} code unified currency code
|
|
661
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
662
|
+
* @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
|
|
663
|
+
*/
|
|
655
664
|
async fetchDepositAddress(code, params = {}) {
|
|
656
|
-
/**
|
|
657
|
-
* @method
|
|
658
|
-
* @name kucoinfutures#fetchDepositAddress
|
|
659
|
-
* @description fetch the deposit address for a currency associated with this account
|
|
660
|
-
* @see https://www.kucoin.com/docs/rest/funding/deposit/get-deposit-address
|
|
661
|
-
* @param {string} code unified currency code
|
|
662
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
663
|
-
* @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
|
|
664
|
-
*/
|
|
665
665
|
await this.loadMarkets();
|
|
666
666
|
const currency = this.currency(code);
|
|
667
667
|
const currencyId = currency['id'];
|
|
@@ -692,17 +692,17 @@ class kucoinfutures extends kucoinfutures$1 {
|
|
|
692
692
|
'tag': this.safeString(data, 'memo'),
|
|
693
693
|
};
|
|
694
694
|
}
|
|
695
|
+
/**
|
|
696
|
+
* @method
|
|
697
|
+
* @name kucoinfutures#fetchOrderBook
|
|
698
|
+
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
699
|
+
* @see https://www.kucoin.com/docs/rest/futures-trading/market-data/get-part-order-book-level-2
|
|
700
|
+
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
701
|
+
* @param {int} [limit] the maximum amount of order book entries to return
|
|
702
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
703
|
+
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
704
|
+
*/
|
|
695
705
|
async fetchOrderBook(symbol, limit = undefined, params = {}) {
|
|
696
|
-
/**
|
|
697
|
-
* @method
|
|
698
|
-
* @name kucoinfutures#fetchOrderBook
|
|
699
|
-
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
700
|
-
* @see https://www.kucoin.com/docs/rest/futures-trading/market-data/get-part-order-book-level-2
|
|
701
|
-
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
702
|
-
* @param {int} [limit] the maximum amount of order book entries to return
|
|
703
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
704
|
-
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
705
|
-
*/
|
|
706
706
|
await this.loadMarkets();
|
|
707
707
|
const level = this.safeNumber(params, 'level');
|
|
708
708
|
if (level !== 2 && level !== undefined) {
|
|
@@ -748,16 +748,16 @@ class kucoinfutures extends kucoinfutures$1 {
|
|
|
748
748
|
orderbook['nonce'] = this.safeInteger(data, 'sequence');
|
|
749
749
|
return orderbook;
|
|
750
750
|
}
|
|
751
|
+
/**
|
|
752
|
+
* @method
|
|
753
|
+
* @name kucoinfutures#fetchTicker
|
|
754
|
+
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
755
|
+
* @see https://www.kucoin.com/docs/rest/futures-trading/market-data/get-ticker
|
|
756
|
+
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
757
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
758
|
+
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
759
|
+
*/
|
|
751
760
|
async fetchTicker(symbol, params = {}) {
|
|
752
|
-
/**
|
|
753
|
-
* @method
|
|
754
|
-
* @name kucoinfutures#fetchTicker
|
|
755
|
-
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
756
|
-
* @see https://www.kucoin.com/docs/rest/futures-trading/market-data/get-ticker
|
|
757
|
-
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
758
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
759
|
-
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
760
|
-
*/
|
|
761
761
|
await this.loadMarkets();
|
|
762
762
|
const market = this.market(symbol);
|
|
763
763
|
const request = {
|
|
@@ -784,16 +784,16 @@ class kucoinfutures extends kucoinfutures$1 {
|
|
|
784
784
|
//
|
|
785
785
|
return this.parseTicker(response['data'], market);
|
|
786
786
|
}
|
|
787
|
+
/**
|
|
788
|
+
* @method
|
|
789
|
+
* @name kucoinfutures#fetchMarkPrice
|
|
790
|
+
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
791
|
+
* @see https://www.kucoin.com/docs/rest/futures-trading/market-data/get-current-mark-price
|
|
792
|
+
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
793
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
794
|
+
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
795
|
+
*/
|
|
787
796
|
async fetchMarkPrice(symbol, params = {}) {
|
|
788
|
-
/**
|
|
789
|
-
* @method
|
|
790
|
-
* @name kucoinfutures#fetchMarkPrice
|
|
791
|
-
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
792
|
-
* @see https://www.kucoin.com/docs/rest/futures-trading/market-data/get-current-mark-price
|
|
793
|
-
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
794
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
795
|
-
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
796
|
-
*/
|
|
797
797
|
await this.loadMarkets();
|
|
798
798
|
const market = this.market(symbol);
|
|
799
799
|
const request = {
|
|
@@ -803,17 +803,17 @@ class kucoinfutures extends kucoinfutures$1 {
|
|
|
803
803
|
//
|
|
804
804
|
return this.parseTicker(response['data'], market);
|
|
805
805
|
}
|
|
806
|
+
/**
|
|
807
|
+
* @method
|
|
808
|
+
* @name kucoinfutures#fetchTickers
|
|
809
|
+
* @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
|
810
|
+
* @see https://www.kucoin.com/docs/rest/futures-trading/market-data/get-symbols-list
|
|
811
|
+
* @param {string[]} [symbols] unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
812
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
813
|
+
* @param {string} [params.method] the method to use, futuresPublicGetAllTickers or futuresPublicGetContractsActive
|
|
814
|
+
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
815
|
+
*/
|
|
806
816
|
async fetchTickers(symbols = undefined, params = {}) {
|
|
807
|
-
/**
|
|
808
|
-
* @method
|
|
809
|
-
* @name kucoinfutures#fetchTickers
|
|
810
|
-
* @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
|
811
|
-
* @see https://www.kucoin.com/docs/rest/futures-trading/market-data/get-symbols-list
|
|
812
|
-
* @param {string[]} [symbols] unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
813
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
814
|
-
* @param {string} [params.method] the method to use, futuresPublicGetAllTickers or futuresPublicGetContractsActive
|
|
815
|
-
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
816
|
-
*/
|
|
817
817
|
await this.loadMarkets();
|
|
818
818
|
symbols = this.marketSymbols(symbols);
|
|
819
819
|
let method = undefined;
|
|
@@ -1007,32 +1007,32 @@ class kucoinfutures extends kucoinfutures$1 {
|
|
|
1007
1007
|
'info': ticker,
|
|
1008
1008
|
}, market);
|
|
1009
1009
|
}
|
|
1010
|
+
/**
|
|
1011
|
+
* @method
|
|
1012
|
+
* @name kucoinfutures#fetchBidsAsks
|
|
1013
|
+
* @description fetches the bid and ask price and volume for multiple markets
|
|
1014
|
+
* @param {string[]} [symbols] unified symbols of the markets to fetch the bids and asks for, all markets are returned if not assigned
|
|
1015
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1016
|
+
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
1017
|
+
*/
|
|
1010
1018
|
async fetchBidsAsks(symbols = undefined, params = {}) {
|
|
1011
|
-
/**
|
|
1012
|
-
* @method
|
|
1013
|
-
* @name kucoinfutures#fetchBidsAsks
|
|
1014
|
-
* @description fetches the bid and ask price and volume for multiple markets
|
|
1015
|
-
* @param {string[]} [symbols] unified symbols of the markets to fetch the bids and asks for, all markets are returned if not assigned
|
|
1016
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1017
|
-
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
1018
|
-
*/
|
|
1019
1019
|
const request = {
|
|
1020
1020
|
'method': 'futuresPublicGetAllTickers',
|
|
1021
1021
|
};
|
|
1022
1022
|
return await this.fetchTickers(symbols, this.extend(request, params));
|
|
1023
1023
|
}
|
|
1024
|
+
/**
|
|
1025
|
+
* @method
|
|
1026
|
+
* @name kucoinfutures#fetchFundingHistory
|
|
1027
|
+
* @description fetch the history of funding payments paid and received on this account
|
|
1028
|
+
* @see https://www.kucoin.com/docs/rest/futures-trading/funding-fees/get-funding-history
|
|
1029
|
+
* @param {string} symbol unified market symbol
|
|
1030
|
+
* @param {int} [since] the earliest time in ms to fetch funding history for
|
|
1031
|
+
* @param {int} [limit] the maximum number of funding history structures to retrieve
|
|
1032
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1033
|
+
* @returns {object} a [funding history structure]{@link https://docs.ccxt.com/#/?id=funding-history-structure}
|
|
1034
|
+
*/
|
|
1024
1035
|
async fetchFundingHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
1025
|
-
/**
|
|
1026
|
-
* @method
|
|
1027
|
-
* @name kucoinfutures#fetchFundingHistory
|
|
1028
|
-
* @description fetch the history of funding payments paid and received on this account
|
|
1029
|
-
* @see https://www.kucoin.com/docs/rest/futures-trading/funding-fees/get-funding-history
|
|
1030
|
-
* @param {string} symbol unified market symbol
|
|
1031
|
-
* @param {int} [since] the earliest time in ms to fetch funding history for
|
|
1032
|
-
* @param {int} [limit] the maximum number of funding history structures to retrieve
|
|
1033
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1034
|
-
* @returns {object} a [funding history structure]{@link https://docs.ccxt.com/#/?id=funding-history-structure}
|
|
1035
|
-
*/
|
|
1036
1036
|
if (symbol === undefined) {
|
|
1037
1037
|
throw new errors.ArgumentsRequired(this.id + ' fetchFundingHistory() requires a symbol argument');
|
|
1038
1038
|
}
|
|
@@ -1093,16 +1093,16 @@ class kucoinfutures extends kucoinfutures$1 {
|
|
|
1093
1093
|
}
|
|
1094
1094
|
return fees;
|
|
1095
1095
|
}
|
|
1096
|
+
/**
|
|
1097
|
+
* @method
|
|
1098
|
+
* @name kucoinfutures#fetchPosition
|
|
1099
|
+
* @see https://docs.kucoin.com/futures/#get-position-details
|
|
1100
|
+
* @description fetch data on an open position
|
|
1101
|
+
* @param {string} symbol unified market symbol of the market the position is held in
|
|
1102
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1103
|
+
* @returns {object} a [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
1104
|
+
*/
|
|
1096
1105
|
async fetchPosition(symbol, params = {}) {
|
|
1097
|
-
/**
|
|
1098
|
-
* @method
|
|
1099
|
-
* @name kucoinfutures#fetchPosition
|
|
1100
|
-
* @see https://docs.kucoin.com/futures/#get-position-details
|
|
1101
|
-
* @description fetch data on an open position
|
|
1102
|
-
* @param {string} symbol unified market symbol of the market the position is held in
|
|
1103
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1104
|
-
* @returns {object} a [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
1105
|
-
*/
|
|
1106
1106
|
await this.loadMarkets();
|
|
1107
1107
|
const market = this.market(symbol);
|
|
1108
1108
|
const request = {
|
|
@@ -1156,16 +1156,16 @@ class kucoinfutures extends kucoinfutures$1 {
|
|
|
1156
1156
|
const data = this.safeDict(response, 'data', {});
|
|
1157
1157
|
return this.parsePosition(data, market);
|
|
1158
1158
|
}
|
|
1159
|
+
/**
|
|
1160
|
+
* @method
|
|
1161
|
+
* @name kucoinfutures#fetchPositions
|
|
1162
|
+
* @description fetch all open positions
|
|
1163
|
+
* @see https://docs.kucoin.com/futures/#get-position-list
|
|
1164
|
+
* @param {string[]|undefined} symbols list of unified market symbols
|
|
1165
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1166
|
+
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
1167
|
+
*/
|
|
1159
1168
|
async fetchPositions(symbols = undefined, params = {}) {
|
|
1160
|
-
/**
|
|
1161
|
-
* @method
|
|
1162
|
-
* @name kucoinfutures#fetchPositions
|
|
1163
|
-
* @description fetch all open positions
|
|
1164
|
-
* @see https://docs.kucoin.com/futures/#get-position-list
|
|
1165
|
-
* @param {string[]|undefined} symbols list of unified market symbols
|
|
1166
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1167
|
-
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
1168
|
-
*/
|
|
1169
1169
|
await this.loadMarkets();
|
|
1170
1170
|
const response = await this.futuresPrivateGetPositions(params);
|
|
1171
1171
|
//
|
|
@@ -1217,18 +1217,20 @@ class kucoinfutures extends kucoinfutures$1 {
|
|
|
1217
1217
|
const data = this.safeList(response, 'data');
|
|
1218
1218
|
return this.parsePositions(data, symbols);
|
|
1219
1219
|
}
|
|
1220
|
+
/**
|
|
1221
|
+
* @method
|
|
1222
|
+
* @name kucoinfutures#fetchPositionsHistory
|
|
1223
|
+
* @description fetches historical positions
|
|
1224
|
+
* @see https://www.kucoin.com/docs/rest/futures-trading/positions/get-positions-history
|
|
1225
|
+
* @param {string[]} [symbols] list of unified market symbols
|
|
1226
|
+
* @param {int} [since] the earliest time in ms to fetch position history for
|
|
1227
|
+
* @param {int} [limit] the maximum number of entries to retrieve
|
|
1228
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1229
|
+
* @param {int} [params.until] closing end time
|
|
1230
|
+
* @param {int} [params.pageId] page id
|
|
1231
|
+
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
1232
|
+
*/
|
|
1220
1233
|
async fetchPositionsHistory(symbols = undefined, since = undefined, limit = undefined, params = {}) {
|
|
1221
|
-
/**
|
|
1222
|
-
* @method
|
|
1223
|
-
* @name kucoinfutures#fetchPositionsHistory
|
|
1224
|
-
* @description fetches historical positions
|
|
1225
|
-
* @see https://www.kucoin.com/docs/rest/futures-trading/positions/get-positions-history
|
|
1226
|
-
* @param {string[]} [symbols] list of unified market symbols
|
|
1227
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1228
|
-
* @param {int} [params.until] closing end time
|
|
1229
|
-
* @param {int} [params.pageId] page id
|
|
1230
|
-
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
1231
|
-
*/
|
|
1232
1234
|
await this.loadMarkets();
|
|
1233
1235
|
if (limit === undefined) {
|
|
1234
1236
|
limit = 200;
|
|
@@ -1420,38 +1422,39 @@ class kucoinfutures extends kucoinfutures$1 {
|
|
|
1420
1422
|
'takeProfitPrice': undefined,
|
|
1421
1423
|
});
|
|
1422
1424
|
}
|
|
1425
|
+
/**
|
|
1426
|
+
* @method
|
|
1427
|
+
* @name kucoinfutures#createOrder
|
|
1428
|
+
* @description Create an order on the exchange
|
|
1429
|
+
* @see https://www.kucoin.com/docs/rest/futures-trading/orders/place-order
|
|
1430
|
+
* @see https://www.kucoin.com/docs/rest/futures-trading/orders/place-take-profit-and-stop-loss-order#http-request
|
|
1431
|
+
* @param {string} symbol Unified CCXT market symbol
|
|
1432
|
+
* @param {string} type 'limit' or 'market'
|
|
1433
|
+
* @param {string} side 'buy' or 'sell'
|
|
1434
|
+
* @param {float} amount the amount of currency to trade
|
|
1435
|
+
* @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
1436
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1437
|
+
* @param {object} [params.takeProfit] *takeProfit object in params* containing the triggerPrice at which the attached take profit order will be triggered
|
|
1438
|
+
* @param {object} [params.stopLoss] *stopLoss object in params* containing the triggerPrice at which the attached stop loss order will be triggered
|
|
1439
|
+
* @param {float} [params.triggerPrice] The price a trigger order is triggered at
|
|
1440
|
+
* @param {float} [params.stopLossPrice] price to trigger stop-loss orders
|
|
1441
|
+
* @param {float} [params.takeProfitPrice] price to trigger take-profit orders
|
|
1442
|
+
* @param {bool} [params.reduceOnly] A mark to reduce the position size only. Set to false by default. Need to set the position size when reduceOnly is true.
|
|
1443
|
+
* @param {string} [params.timeInForce] GTC, GTT, IOC, or FOK, default is GTC, limit orders only
|
|
1444
|
+
* @param {string} [params.postOnly] Post only flag, invalid when timeInForce is IOC or FOK
|
|
1445
|
+
* @param {float} [params.cost] the cost of the order in units of USDT
|
|
1446
|
+
* ----------------- Exchange Specific Parameters -----------------
|
|
1447
|
+
* @param {float} [params.leverage] Leverage size of the order
|
|
1448
|
+
* @param {string} [params.clientOid] client order id, defaults to uuid if not passed
|
|
1449
|
+
* @param {string} [params.remark] remark for the order, length cannot exceed 100 utf8 characters
|
|
1450
|
+
* @param {string} [params.stop] 'up' or 'down', the direction the stopPrice is triggered from, requires stopPrice. down: Triggers when the price reaches or goes below the stopPrice. up: Triggers when the price reaches or goes above the stopPrice.
|
|
1451
|
+
* @param {string} [params.stopPriceType] TP, IP or MP, defaults to MP: Mark Price
|
|
1452
|
+
* @param {bool} [params.closeOrder] set to true to close position
|
|
1453
|
+
* @param {bool} [params.test] set to true to use the test order endpoint (does not submit order, use to validate params)
|
|
1454
|
+
* @param {bool} [params.forceHold] A mark to forcely hold the funds for an order, even though it's an order to reduce the position size. This helps the order stay on the order book and not get canceled when the position size changes. Set to false by default.
|
|
1455
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1456
|
+
*/
|
|
1423
1457
|
async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
|
|
1424
|
-
/**
|
|
1425
|
-
* @method
|
|
1426
|
-
* @name kucoinfutures#createOrder
|
|
1427
|
-
* @description Create an order on the exchange
|
|
1428
|
-
* @see https://docs.kucoin.com/futures/#place-an-order
|
|
1429
|
-
* @see https://www.kucoin.com/docs/rest/futures-trading/orders/place-take-profit-and-stop-loss-order#http-request
|
|
1430
|
-
* @param {string} symbol Unified CCXT market symbol
|
|
1431
|
-
* @param {string} type 'limit' or 'market'
|
|
1432
|
-
* @param {string} side 'buy' or 'sell'
|
|
1433
|
-
* @param {float} amount the amount of currency to trade
|
|
1434
|
-
* @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
1435
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1436
|
-
* @param {object} [params.takeProfit] *takeProfit object in params* containing the triggerPrice at which the attached take profit order will be triggered
|
|
1437
|
-
* @param {object} [params.stopLoss] *stopLoss object in params* containing the triggerPrice at which the attached stop loss order will be triggered
|
|
1438
|
-
* @param {float} [params.triggerPrice] The price a trigger order is triggered at
|
|
1439
|
-
* @param {float} [params.stopLossPrice] price to trigger stop-loss orders
|
|
1440
|
-
* @param {float} [params.takeProfitPrice] price to trigger take-profit orders
|
|
1441
|
-
* @param {bool} [params.reduceOnly] A mark to reduce the position size only. Set to false by default. Need to set the position size when reduceOnly is true.
|
|
1442
|
-
* @param {string} [params.timeInForce] GTC, GTT, IOC, or FOK, default is GTC, limit orders only
|
|
1443
|
-
* @param {string} [params.postOnly] Post only flag, invalid when timeInForce is IOC or FOK
|
|
1444
|
-
* ----------------- Exchange Specific Parameters -----------------
|
|
1445
|
-
* @param {float} [params.leverage] Leverage size of the order
|
|
1446
|
-
* @param {string} [params.clientOid] client order id, defaults to uuid if not passed
|
|
1447
|
-
* @param {string} [params.remark] remark for the order, length cannot exceed 100 utf8 characters
|
|
1448
|
-
* @param {string} [params.stop] 'up' or 'down', the direction the stopPrice is triggered from, requires stopPrice. down: Triggers when the price reaches or goes below the stopPrice. up: Triggers when the price reaches or goes above the stopPrice.
|
|
1449
|
-
* @param {string} [params.stopPriceType] TP, IP or MP, defaults to MP: Mark Price
|
|
1450
|
-
* @param {bool} [params.closeOrder] set to true to close position
|
|
1451
|
-
* @param {bool} [params.test] set to true to use the test order endpoint (does not submit order, use to validate params)
|
|
1452
|
-
* @param {bool} [params.forceHold] A mark to forcely hold the funds for an order, even though it's an order to reduce the position size. This helps the order stay on the order book and not get canceled when the position size changes. Set to false by default.
|
|
1453
|
-
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1454
|
-
*/
|
|
1455
1458
|
await this.loadMarkets();
|
|
1456
1459
|
const market = this.market(symbol);
|
|
1457
1460
|
const testOrder = this.safeBool(params, 'test', false);
|
|
@@ -1481,16 +1484,16 @@ class kucoinfutures extends kucoinfutures$1 {
|
|
|
1481
1484
|
const data = this.safeDict(response, 'data', {});
|
|
1482
1485
|
return this.parseOrder(data, market);
|
|
1483
1486
|
}
|
|
1487
|
+
/**
|
|
1488
|
+
* @method
|
|
1489
|
+
* @name kucoinfutures#createOrders
|
|
1490
|
+
* @description create a list of trade orders
|
|
1491
|
+
* @see https://www.kucoin.com/docs/rest/futures-trading/orders/place-multiple-orders
|
|
1492
|
+
* @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
|
|
1493
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1494
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1495
|
+
*/
|
|
1484
1496
|
async createOrders(orders, params = {}) {
|
|
1485
|
-
/**
|
|
1486
|
-
* @method
|
|
1487
|
-
* @name kucoinfutures#createOrders
|
|
1488
|
-
* @description create a list of trade orders
|
|
1489
|
-
* @see https://www.kucoin.com/docs/rest/futures-trading/orders/place-multiple-orders
|
|
1490
|
-
* @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
|
|
1491
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1492
|
-
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1493
|
-
*/
|
|
1494
1497
|
await this.loadMarkets();
|
|
1495
1498
|
const ordersRequests = [];
|
|
1496
1499
|
for (let i = 0; i < orders.length; i++) {
|
|
@@ -1535,18 +1538,24 @@ class kucoinfutures extends kucoinfutures$1 {
|
|
|
1535
1538
|
// required param, cannot be used twice
|
|
1536
1539
|
const clientOrderId = this.safeString2(params, 'clientOid', 'clientOrderId', this.uuid());
|
|
1537
1540
|
params = this.omit(params, ['clientOid', 'clientOrderId']);
|
|
1538
|
-
if (amount < 1) {
|
|
1539
|
-
throw new errors.InvalidOrder(this.id + ' createOrder() minimum contract order amount is 1');
|
|
1540
|
-
}
|
|
1541
|
-
const preciseAmount = parseInt(this.amountToPrecision(symbol, amount));
|
|
1542
1541
|
const request = {
|
|
1543
1542
|
'clientOid': clientOrderId,
|
|
1544
1543
|
'side': side,
|
|
1545
1544
|
'symbol': market['id'],
|
|
1546
1545
|
'type': type,
|
|
1547
|
-
'size': preciseAmount,
|
|
1548
1546
|
'leverage': 1,
|
|
1549
1547
|
};
|
|
1548
|
+
const cost = this.safeString(params, 'cost');
|
|
1549
|
+
params = this.omit(params, 'cost');
|
|
1550
|
+
if (cost !== undefined) {
|
|
1551
|
+
request['valueQty'] = this.costToPrecision(symbol, cost);
|
|
1552
|
+
}
|
|
1553
|
+
else {
|
|
1554
|
+
if (amount < 1) {
|
|
1555
|
+
throw new errors.InvalidOrder(this.id + ' createOrder() minimum contract order amount is 1');
|
|
1556
|
+
}
|
|
1557
|
+
request['size'] = parseInt(this.amountToPrecision(symbol, amount));
|
|
1558
|
+
}
|
|
1550
1559
|
const [triggerPrice, stopLossPrice, takeProfitPrice] = this.handleTriggerPrices(params);
|
|
1551
1560
|
const stopLoss = this.safeDict(params, 'stopLoss');
|
|
1552
1561
|
const takeProfit = this.safeDict(params, 'takeProfit');
|
|
@@ -1622,18 +1631,18 @@ class kucoinfutures extends kucoinfutures$1 {
|
|
|
1622
1631
|
params = this.omit(params, ['timeInForce', 'stopPrice', 'triggerPrice', 'stopLossPrice', 'takeProfitPrice']); // Time in force only valid for limit orders, exchange error when gtc for market orders
|
|
1623
1632
|
return this.extend(request, params);
|
|
1624
1633
|
}
|
|
1634
|
+
/**
|
|
1635
|
+
* @method
|
|
1636
|
+
* @name kucoinfutures#cancelOrder
|
|
1637
|
+
* @description cancels an open order
|
|
1638
|
+
* @see https://www.kucoin.com/docs/rest/futures-trading/orders/cancel-futures-order-by-orderid
|
|
1639
|
+
* @param {string} id order id
|
|
1640
|
+
* @param {string} symbol unified symbol of the market the order was made in
|
|
1641
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1642
|
+
* @param {string} [params.clientOrderId] cancel order by client order id
|
|
1643
|
+
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1644
|
+
*/
|
|
1625
1645
|
async cancelOrder(id, symbol = undefined, params = {}) {
|
|
1626
|
-
/**
|
|
1627
|
-
* @method
|
|
1628
|
-
* @name kucoinfutures#cancelOrder
|
|
1629
|
-
* @description cancels an open order
|
|
1630
|
-
* @see https://www.kucoin.com/docs/rest/futures-trading/orders/cancel-futures-order-by-orderid
|
|
1631
|
-
* @param {string} id order id
|
|
1632
|
-
* @param {string} symbol unified symbol of the market the order was made in
|
|
1633
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1634
|
-
* @param {string} [params.clientOrderId] cancel order by client order id
|
|
1635
|
-
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1636
|
-
*/
|
|
1637
1646
|
await this.loadMarkets();
|
|
1638
1647
|
const clientOrderId = this.safeString2(params, 'clientOid', 'clientOrderId');
|
|
1639
1648
|
params = this.omit(params, ['clientOrderId']);
|
|
@@ -1664,18 +1673,18 @@ class kucoinfutures extends kucoinfutures$1 {
|
|
|
1664
1673
|
//
|
|
1665
1674
|
return this.safeValue(response, 'data');
|
|
1666
1675
|
}
|
|
1676
|
+
/**
|
|
1677
|
+
* @method
|
|
1678
|
+
* @name kucoinfutures#cancelOrders
|
|
1679
|
+
* @description cancel multiple orders
|
|
1680
|
+
* @see https://www.kucoin.com/docs/rest/futures-trading/orders/batch-cancel-orders
|
|
1681
|
+
* @param {string[]} ids order ids
|
|
1682
|
+
* @param {string} symbol unified symbol of the market the order was made in
|
|
1683
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1684
|
+
* @param {string[]} [params.clientOrderIds] client order ids
|
|
1685
|
+
* @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1686
|
+
*/
|
|
1667
1687
|
async cancelOrders(ids, symbol = undefined, params = {}) {
|
|
1668
|
-
/**
|
|
1669
|
-
* @method
|
|
1670
|
-
* @name kucoinfutures#cancelOrders
|
|
1671
|
-
* @description cancel multiple orders
|
|
1672
|
-
* @see https://www.kucoin.com/docs/rest/futures-trading/orders/batch-cancel-orders
|
|
1673
|
-
* @param {string[]} ids order ids
|
|
1674
|
-
* @param {string} symbol unified symbol of the market the order was made in
|
|
1675
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1676
|
-
* @param {string[]} [params.clientOrderIds] client order ids
|
|
1677
|
-
* @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1678
|
-
*/
|
|
1679
1688
|
await this.loadMarkets();
|
|
1680
1689
|
let market = undefined;
|
|
1681
1690
|
if (symbol !== undefined) {
|
|
@@ -1725,18 +1734,18 @@ class kucoinfutures extends kucoinfutures$1 {
|
|
|
1725
1734
|
const orders = this.safeList(response, 'data', []);
|
|
1726
1735
|
return this.parseOrders(orders, market);
|
|
1727
1736
|
}
|
|
1737
|
+
/**
|
|
1738
|
+
* @method
|
|
1739
|
+
* @name kucoinfutures#cancelAllOrders
|
|
1740
|
+
* @description cancel all open orders
|
|
1741
|
+
* @see https://www.kucoin.com/docs/rest/futures-trading/orders/cancel-multiple-futures-limit-orders
|
|
1742
|
+
* @see https://www.kucoin.com/docs/rest/futures-trading/orders/cancel-multiple-futures-stop-orders
|
|
1743
|
+
* @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
|
|
1744
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1745
|
+
* @param {object} [params.trigger] When true, all the trigger orders will be cancelled
|
|
1746
|
+
* @returns Response from the exchange
|
|
1747
|
+
*/
|
|
1728
1748
|
async cancelAllOrders(symbol = undefined, params = {}) {
|
|
1729
|
-
/**
|
|
1730
|
-
* @method
|
|
1731
|
-
* @name kucoinfutures#cancelAllOrders
|
|
1732
|
-
* @description cancel all open orders
|
|
1733
|
-
* @see https://www.kucoin.com/docs/rest/futures-trading/orders/cancel-multiple-futures-limit-orders
|
|
1734
|
-
* @see https://www.kucoin.com/docs/rest/futures-trading/orders/cancel-multiple-futures-stop-orders
|
|
1735
|
-
* @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
|
|
1736
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1737
|
-
* @param {object} [params.trigger] When true, all the trigger orders will be cancelled
|
|
1738
|
-
* @returns Response from the exchange
|
|
1739
|
-
*/
|
|
1740
1749
|
await this.loadMarkets();
|
|
1741
1750
|
const request = {};
|
|
1742
1751
|
if (symbol !== undefined) {
|
|
@@ -1763,17 +1772,17 @@ class kucoinfutures extends kucoinfutures$1 {
|
|
|
1763
1772
|
//
|
|
1764
1773
|
return this.safeValue(response, 'data');
|
|
1765
1774
|
}
|
|
1775
|
+
/**
|
|
1776
|
+
* @method
|
|
1777
|
+
* @name kucoinfutures#addMargin
|
|
1778
|
+
* @description add margin
|
|
1779
|
+
* @see https://www.kucoin.com/docs/rest/futures-trading/positions/add-margin-manually
|
|
1780
|
+
* @param {string} symbol unified market symbol
|
|
1781
|
+
* @param {float} amount amount of margin to add
|
|
1782
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1783
|
+
* @returns {object} a [margin structure]{@link https://docs.ccxt.com/#/?id=add-margin-structure}
|
|
1784
|
+
*/
|
|
1766
1785
|
async addMargin(symbol, amount, params = {}) {
|
|
1767
|
-
/**
|
|
1768
|
-
* @method
|
|
1769
|
-
* @name kucoinfutures#addMargin
|
|
1770
|
-
* @description add margin
|
|
1771
|
-
* @see https://www.kucoin.com/docs/rest/futures-trading/positions/add-margin-manually
|
|
1772
|
-
* @param {string} symbol unified market symbol
|
|
1773
|
-
* @param {float} amount amount of margin to add
|
|
1774
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1775
|
-
* @returns {object} a [margin structure]{@link https://docs.ccxt.com/#/?id=add-margin-structure}
|
|
1776
|
-
*/
|
|
1777
1786
|
await this.loadMarkets();
|
|
1778
1787
|
const market = this.market(symbol);
|
|
1779
1788
|
const uuid = this.uuid();
|
|
@@ -1904,25 +1913,25 @@ class kucoinfutures extends kucoinfutures$1 {
|
|
|
1904
1913
|
'datetime': this.iso8601(timestamp),
|
|
1905
1914
|
};
|
|
1906
1915
|
}
|
|
1916
|
+
/**
|
|
1917
|
+
* @method
|
|
1918
|
+
* @name kucoinfutures#fetchOrdersByStatus
|
|
1919
|
+
* @description fetches a list of orders placed on the exchange
|
|
1920
|
+
* @see https://docs.kucoin.com/futures/#get-order-list
|
|
1921
|
+
* @see https://docs.kucoin.com/futures/#get-untriggered-stop-order-list
|
|
1922
|
+
* @param {string} status 'active' or 'closed', only 'active' is valid for stop orders
|
|
1923
|
+
* @param {string} symbol unified symbol for the market to retrieve orders from
|
|
1924
|
+
* @param {int} [since] timestamp in ms of the earliest order to retrieve
|
|
1925
|
+
* @param {int} [limit] The maximum number of orders to retrieve
|
|
1926
|
+
* @param {object} [params] exchange specific parameters
|
|
1927
|
+
* @param {bool} [params.trigger] set to true to retrieve untriggered stop orders
|
|
1928
|
+
* @param {int} [params.until] End time in ms
|
|
1929
|
+
* @param {string} [params.side] buy or sell
|
|
1930
|
+
* @param {string} [params.type] limit or market
|
|
1931
|
+
* @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)
|
|
1932
|
+
* @returns An [array of order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1933
|
+
*/
|
|
1907
1934
|
async fetchOrdersByStatus(status, symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
1908
|
-
/**
|
|
1909
|
-
* @method
|
|
1910
|
-
* @name kucoinfutures#fetchOrdersByStatus
|
|
1911
|
-
* @description fetches a list of orders placed on the exchange
|
|
1912
|
-
* @see https://docs.kucoin.com/futures/#get-order-list
|
|
1913
|
-
* @see https://docs.kucoin.com/futures/#get-untriggered-stop-order-list
|
|
1914
|
-
* @param {string} status 'active' or 'closed', only 'active' is valid for stop orders
|
|
1915
|
-
* @param {string} symbol unified symbol for the market to retrieve orders from
|
|
1916
|
-
* @param {int} [since] timestamp in ms of the earliest order to retrieve
|
|
1917
|
-
* @param {int} [limit] The maximum number of orders to retrieve
|
|
1918
|
-
* @param {object} [params] exchange specific parameters
|
|
1919
|
-
* @param {bool} [params.trigger] set to true to retrieve untriggered stop orders
|
|
1920
|
-
* @param {int} [params.until] End time in ms
|
|
1921
|
-
* @param {string} [params.side] buy or sell
|
|
1922
|
-
* @param {string} [params.type] limit or market
|
|
1923
|
-
* @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)
|
|
1924
|
-
* @returns An [array of order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1925
|
-
*/
|
|
1926
1935
|
await this.loadMarkets();
|
|
1927
1936
|
let paginate = false;
|
|
1928
1937
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchOrdersByStatus', 'paginate');
|
|
@@ -2018,22 +2027,22 @@ class kucoinfutures extends kucoinfutures$1 {
|
|
|
2018
2027
|
const orders = this.safeList(responseData, 'items', []);
|
|
2019
2028
|
return this.parseOrders(orders, market, since, limit);
|
|
2020
2029
|
}
|
|
2030
|
+
/**
|
|
2031
|
+
* @method
|
|
2032
|
+
* @name kucoinfutures#fetchClosedOrders
|
|
2033
|
+
* @description fetches information on multiple closed orders made by the user
|
|
2034
|
+
* @see https://docs.kucoin.com/futures/#get-order-list
|
|
2035
|
+
* @param {string} symbol unified market symbol of the market orders were made in
|
|
2036
|
+
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
2037
|
+
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
2038
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2039
|
+
* @param {int} [params.until] end time in ms
|
|
2040
|
+
* @param {string} [params.side] buy or sell
|
|
2041
|
+
* @param {string} [params.type] limit, or market
|
|
2042
|
+
* @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)
|
|
2043
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2044
|
+
*/
|
|
2021
2045
|
async fetchClosedOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
2022
|
-
/**
|
|
2023
|
-
* @method
|
|
2024
|
-
* @name kucoinfutures#fetchClosedOrders
|
|
2025
|
-
* @description fetches information on multiple closed orders made by the user
|
|
2026
|
-
* @see https://docs.kucoin.com/futures/#get-order-list
|
|
2027
|
-
* @param {string} symbol unified market symbol of the market orders were made in
|
|
2028
|
-
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
2029
|
-
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
2030
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2031
|
-
* @param {int} [params.until] end time in ms
|
|
2032
|
-
* @param {string} [params.side] buy or sell
|
|
2033
|
-
* @param {string} [params.type] limit, or market
|
|
2034
|
-
* @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)
|
|
2035
|
-
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2036
|
-
*/
|
|
2037
2046
|
await this.loadMarkets();
|
|
2038
2047
|
let paginate = false;
|
|
2039
2048
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchClosedOrders', 'paginate');
|
|
@@ -2042,24 +2051,24 @@ class kucoinfutures extends kucoinfutures$1 {
|
|
|
2042
2051
|
}
|
|
2043
2052
|
return await this.fetchOrdersByStatus('done', symbol, since, limit, params);
|
|
2044
2053
|
}
|
|
2054
|
+
/**
|
|
2055
|
+
* @method
|
|
2056
|
+
* @name kucoinfutures#fetchOpenOrders
|
|
2057
|
+
* @description fetches information on multiple open orders made by the user
|
|
2058
|
+
* @see https://docs.kucoin.com/futures/#get-order-list
|
|
2059
|
+
* @see https://docs.kucoin.com/futures/#get-untriggered-stop-order-list
|
|
2060
|
+
* @param {string} symbol unified market symbol of the market orders were made in
|
|
2061
|
+
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
2062
|
+
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
2063
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2064
|
+
* @param {int} [params.until] end time in ms
|
|
2065
|
+
* @param {string} [params.side] buy or sell
|
|
2066
|
+
* @param {string} [params.type] limit, or market
|
|
2067
|
+
* @param {boolean} [params.trigger] set to true to retrieve untriggered stop orders
|
|
2068
|
+
* @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)
|
|
2069
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2070
|
+
*/
|
|
2045
2071
|
async fetchOpenOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
2046
|
-
/**
|
|
2047
|
-
* @method
|
|
2048
|
-
* @name kucoinfutures#fetchOpenOrders
|
|
2049
|
-
* @description fetches information on multiple open orders made by the user
|
|
2050
|
-
* @see https://docs.kucoin.com/futures/#get-order-list
|
|
2051
|
-
* @see https://docs.kucoin.com/futures/#get-untriggered-stop-order-list
|
|
2052
|
-
* @param {string} symbol unified market symbol of the market orders were made in
|
|
2053
|
-
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
2054
|
-
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
2055
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2056
|
-
* @param {int} [params.until] end time in ms
|
|
2057
|
-
* @param {string} [params.side] buy or sell
|
|
2058
|
-
* @param {string} [params.type] limit, or market
|
|
2059
|
-
* @param {boolean} [params.trigger] set to true to retrieve untriggered stop orders
|
|
2060
|
-
* @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)
|
|
2061
|
-
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2062
|
-
*/
|
|
2063
2072
|
await this.loadMarkets();
|
|
2064
2073
|
let paginate = false;
|
|
2065
2074
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchOpenOrders', 'paginate');
|
|
@@ -2068,16 +2077,17 @@ class kucoinfutures extends kucoinfutures$1 {
|
|
|
2068
2077
|
}
|
|
2069
2078
|
return await this.fetchOrdersByStatus('open', symbol, since, limit, params);
|
|
2070
2079
|
}
|
|
2080
|
+
/**
|
|
2081
|
+
* @method
|
|
2082
|
+
* @name kucoinfutures#fetchOrder
|
|
2083
|
+
* @description fetches information on an order made by the user
|
|
2084
|
+
* @see https://docs.kucoin.com/futures/#get-details-of-a-single-order
|
|
2085
|
+
* @param {string} id order id
|
|
2086
|
+
* @param {string} symbol unified symbol of the market the order was made in
|
|
2087
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2088
|
+
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2089
|
+
*/
|
|
2071
2090
|
async fetchOrder(id = undefined, symbol = undefined, params = {}) {
|
|
2072
|
-
/**
|
|
2073
|
-
* @method
|
|
2074
|
-
* @name kucoinfutures#fetchOrder
|
|
2075
|
-
* @description fetches information on an order made by the user
|
|
2076
|
-
* @see https://docs.kucoin.com/futures/#get-details-of-a-single-order
|
|
2077
|
-
* @param {string} symbol unified symbol of the market the order was made in
|
|
2078
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2079
|
-
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2080
|
-
*/
|
|
2081
2091
|
await this.loadMarkets();
|
|
2082
2092
|
const request = {};
|
|
2083
2093
|
let response = undefined;
|
|
@@ -2277,16 +2287,16 @@ class kucoinfutures extends kucoinfutures$1 {
|
|
|
2277
2287
|
'trades': undefined,
|
|
2278
2288
|
}, market);
|
|
2279
2289
|
}
|
|
2290
|
+
/**
|
|
2291
|
+
* @method
|
|
2292
|
+
* @name kucoinfutures#fetchFundingRate
|
|
2293
|
+
* @description fetch the current funding rate
|
|
2294
|
+
* @see https://www.kucoin.com/docs/rest/futures-trading/funding-fees/get-current-funding-rate
|
|
2295
|
+
* @param {string} symbol unified market symbol
|
|
2296
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2297
|
+
* @returns {object} a [funding rate structure]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
|
|
2298
|
+
*/
|
|
2280
2299
|
async fetchFundingRate(symbol, params = {}) {
|
|
2281
|
-
/**
|
|
2282
|
-
* @method
|
|
2283
|
-
* @name kucoinfutures#fetchFundingRate
|
|
2284
|
-
* @description fetch the current funding rate
|
|
2285
|
-
* @see https://www.kucoin.com/docs/rest/futures-trading/funding-fees/get-current-funding-rate
|
|
2286
|
-
* @param {string} symbol unified market symbol
|
|
2287
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2288
|
-
* @returns {object} a [funding rate structure]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
|
|
2289
|
-
*/
|
|
2290
2300
|
await this.loadMarkets();
|
|
2291
2301
|
const market = this.market(symbol);
|
|
2292
2302
|
const request = {
|
|
@@ -2309,16 +2319,16 @@ class kucoinfutures extends kucoinfutures$1 {
|
|
|
2309
2319
|
// the website displayes the previous funding rate as "funding rate"
|
|
2310
2320
|
return this.parseFundingRate(data, market);
|
|
2311
2321
|
}
|
|
2322
|
+
/**
|
|
2323
|
+
* @method
|
|
2324
|
+
* @name kucoinfutures#fetchFundingInterval
|
|
2325
|
+
* @description fetch the current funding rate interval
|
|
2326
|
+
* @see https://www.kucoin.com/docs/rest/futures-trading/funding-fees/get-current-funding-rate
|
|
2327
|
+
* @param {string} symbol unified market symbol
|
|
2328
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2329
|
+
* @returns {object} a [funding rate structure]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
|
|
2330
|
+
*/
|
|
2312
2331
|
async fetchFundingInterval(symbol, params = {}) {
|
|
2313
|
-
/**
|
|
2314
|
-
* @method
|
|
2315
|
-
* @name kucoinfutures#fetchFundingInterval
|
|
2316
|
-
* @description fetch the current funding rate interval
|
|
2317
|
-
* @see https://www.kucoin.com/docs/rest/futures-trading/funding-fees/get-current-funding-rate
|
|
2318
|
-
* @param {string} symbol unified market symbol
|
|
2319
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2320
|
-
* @returns {object} a [funding rate structure]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
|
|
2321
|
-
*/
|
|
2322
2332
|
return await this.fetchFundingRate(symbol, params);
|
|
2323
2333
|
}
|
|
2324
2334
|
parseFundingRate(data, market = undefined) {
|
|
@@ -2379,15 +2389,15 @@ class kucoinfutures extends kucoinfutures$1 {
|
|
|
2379
2389
|
result[code] = account;
|
|
2380
2390
|
return this.safeBalance(result);
|
|
2381
2391
|
}
|
|
2392
|
+
/**
|
|
2393
|
+
* @method
|
|
2394
|
+
* @name kucoinfutures#fetchBalance
|
|
2395
|
+
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
2396
|
+
* @see https://www.kucoin.com/docs/rest/funding/funding-overview/get-account-detail-futures
|
|
2397
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2398
|
+
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
2399
|
+
*/
|
|
2382
2400
|
async fetchBalance(params = {}) {
|
|
2383
|
-
/**
|
|
2384
|
-
* @method
|
|
2385
|
-
* @name kucoinfutures#fetchBalance
|
|
2386
|
-
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
2387
|
-
* @see https://www.kucoin.com/docs/rest/funding/funding-overview/get-account-detail-futures
|
|
2388
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2389
|
-
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
2390
|
-
*/
|
|
2391
2401
|
await this.loadMarkets();
|
|
2392
2402
|
// only fetches one balance at a time
|
|
2393
2403
|
let defaultCode = this.safeString(this.options, 'code');
|
|
@@ -2416,21 +2426,20 @@ class kucoinfutures extends kucoinfutures$1 {
|
|
|
2416
2426
|
//
|
|
2417
2427
|
return this.parseBalance(response);
|
|
2418
2428
|
}
|
|
2429
|
+
/**
|
|
2430
|
+
* @method
|
|
2431
|
+
* @name kucoinfutures#transfer
|
|
2432
|
+
* @description transfer currency internally between wallets on the same account
|
|
2433
|
+
* @see https://www.kucoin.com/docs/rest/funding/transfer/transfer-to-main-or-trade-account
|
|
2434
|
+
* @see https://www.kucoin.com/docs/rest/funding/transfer/transfer-to-futures-account
|
|
2435
|
+
* @param {string} code unified currency code
|
|
2436
|
+
* @param {float} amount amount to transfer
|
|
2437
|
+
* @param {string} fromAccount account to transfer from
|
|
2438
|
+
* @param {string} toAccount account to transfer to
|
|
2439
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2440
|
+
* @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
2441
|
+
*/
|
|
2419
2442
|
async transfer(code, amount, fromAccount, toAccount, params = {}) {
|
|
2420
|
-
/**
|
|
2421
|
-
* @method
|
|
2422
|
-
* @name kucoinfutures#transfer
|
|
2423
|
-
* @description transfer currency internally between wallets on the same account
|
|
2424
|
-
* @param {string} code unified currency code
|
|
2425
|
-
* @param {float} amount amount to transfer
|
|
2426
|
-
* @param {string} fromAccount account to transfer from
|
|
2427
|
-
* @param {string} toAccount account to transfer to
|
|
2428
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2429
|
-
* @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
2430
|
-
*/
|
|
2431
|
-
if ((toAccount !== 'main' && toAccount !== 'funding') || (fromAccount !== 'futures' && fromAccount !== 'future' && fromAccount !== 'contract')) {
|
|
2432
|
-
throw new errors.BadRequest(this.id + ' transfer() only supports transfers from contract(future) account to main(funding) account');
|
|
2433
|
-
}
|
|
2434
2443
|
await this.loadMarkets();
|
|
2435
2444
|
const currency = this.currency(code);
|
|
2436
2445
|
const amountToPrecision = this.currencyToPrecision(code, amount);
|
|
@@ -2438,38 +2447,95 @@ class kucoinfutures extends kucoinfutures$1 {
|
|
|
2438
2447
|
'currency': this.safeString(currency, 'id'),
|
|
2439
2448
|
'amount': amountToPrecision,
|
|
2440
2449
|
};
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2450
|
+
const toAccountString = this.parseTransferType(toAccount);
|
|
2451
|
+
let response = undefined;
|
|
2452
|
+
if (toAccountString === 'TRADE' || toAccountString === 'MAIN') {
|
|
2453
|
+
request['recAccountType'] = toAccountString;
|
|
2454
|
+
response = await this.futuresPrivatePostTransferOut(this.extend(request, params));
|
|
2455
|
+
//
|
|
2456
|
+
// {
|
|
2457
|
+
// "code": "200000",
|
|
2458
|
+
// "data": {
|
|
2459
|
+
// "applyId": "6738754373ceee00011ec3f8",
|
|
2460
|
+
// "bizNo": "6738754373ceee00011ec3f7",
|
|
2461
|
+
// "payAccountType": "CONTRACT",
|
|
2462
|
+
// "payTag": "DEFAULT",
|
|
2463
|
+
// "remark": "",
|
|
2464
|
+
// "recAccountType": "MAIN",
|
|
2465
|
+
// "recTag": "DEFAULT",
|
|
2466
|
+
// "recRemark": "",
|
|
2467
|
+
// "recSystem": "KUCOIN",
|
|
2468
|
+
// "status": "PROCESSING",
|
|
2469
|
+
// "currency": "USDT",
|
|
2470
|
+
// "amount": "5",
|
|
2471
|
+
// "fee": "0",
|
|
2472
|
+
// "sn": 1519769124846692,
|
|
2473
|
+
// "reason": "",
|
|
2474
|
+
// "createdAt": 1731753283000,
|
|
2475
|
+
// "updatedAt": 1731753283000
|
|
2476
|
+
// }
|
|
2477
|
+
// }
|
|
2478
|
+
//
|
|
2479
|
+
}
|
|
2480
|
+
else if (toAccount === 'future' || toAccount === 'swap' || toAccount === 'contract') {
|
|
2481
|
+
request['payAccountType'] = this.parseTransferType(fromAccount);
|
|
2482
|
+
response = await this.futuresPrivatePostTransferIn(this.extend(request, params));
|
|
2483
|
+
//
|
|
2484
|
+
// {
|
|
2485
|
+
// "code": "200000",
|
|
2486
|
+
// "data": {
|
|
2487
|
+
// "applyId": "5bffb63303aa675e8bbe18f9" // Transfer-out request ID
|
|
2488
|
+
// }
|
|
2489
|
+
// }
|
|
2490
|
+
//
|
|
2491
|
+
}
|
|
2492
|
+
else {
|
|
2493
|
+
throw new errors.BadRequest(this.id + ' transfer() only supports transfers between future/swap, spot and funding accounts');
|
|
2494
|
+
}
|
|
2495
|
+
const data = this.safeDict(response, 'data', {});
|
|
2452
2496
|
return this.extend(this.parseTransfer(data, currency), {
|
|
2453
2497
|
'amount': this.parseNumber(amountToPrecision),
|
|
2454
|
-
'fromAccount':
|
|
2455
|
-
'toAccount':
|
|
2498
|
+
'fromAccount': fromAccount,
|
|
2499
|
+
'toAccount': toAccount,
|
|
2456
2500
|
});
|
|
2457
2501
|
}
|
|
2458
2502
|
parseTransfer(transfer, currency = undefined) {
|
|
2459
2503
|
//
|
|
2460
|
-
// transfer
|
|
2504
|
+
// transfer to spot or funding account
|
|
2461
2505
|
//
|
|
2462
2506
|
// {
|
|
2463
2507
|
// "applyId": "5bffb63303aa675e8bbe18f9" // Transfer-out request ID
|
|
2464
2508
|
// }
|
|
2465
2509
|
//
|
|
2510
|
+
// transfer to future account
|
|
2511
|
+
//
|
|
2512
|
+
// {
|
|
2513
|
+
// "applyId": "6738754373ceee00011ec3f8",
|
|
2514
|
+
// "bizNo": "6738754373ceee00011ec3f7",
|
|
2515
|
+
// "payAccountType": "CONTRACT",
|
|
2516
|
+
// "payTag": "DEFAULT",
|
|
2517
|
+
// "remark": "",
|
|
2518
|
+
// "recAccountType": "MAIN",
|
|
2519
|
+
// "recTag": "DEFAULT",
|
|
2520
|
+
// "recRemark": "",
|
|
2521
|
+
// "recSystem": "KUCOIN",
|
|
2522
|
+
// "status": "PROCESSING",
|
|
2523
|
+
// "currency": "USDT",
|
|
2524
|
+
// "amount": "5",
|
|
2525
|
+
// "fee": "0",
|
|
2526
|
+
// "sn": 1519769124846692,
|
|
2527
|
+
// "reason": "",
|
|
2528
|
+
// "createdAt": 1731753283000,
|
|
2529
|
+
// "updatedAt": 1731753283000
|
|
2530
|
+
// }
|
|
2531
|
+
//
|
|
2466
2532
|
const timestamp = this.safeInteger(transfer, 'updatedAt');
|
|
2467
2533
|
return {
|
|
2468
2534
|
'id': this.safeString(transfer, 'applyId'),
|
|
2469
2535
|
'timestamp': timestamp,
|
|
2470
2536
|
'datetime': this.iso8601(timestamp),
|
|
2471
2537
|
'currency': this.safeCurrencyCode(undefined, currency),
|
|
2472
|
-
'amount':
|
|
2538
|
+
'amount': this.safeNumber(transfer, 'amount'),
|
|
2473
2539
|
'fromAccount': undefined,
|
|
2474
2540
|
'toAccount': undefined,
|
|
2475
2541
|
'status': this.safeString(transfer, 'status'),
|
|
@@ -2482,20 +2548,27 @@ class kucoinfutures extends kucoinfutures$1 {
|
|
|
2482
2548
|
};
|
|
2483
2549
|
return this.safeString(statuses, status, status);
|
|
2484
2550
|
}
|
|
2551
|
+
parseTransferType(transferType) {
|
|
2552
|
+
const transferTypes = {
|
|
2553
|
+
'spot': 'TRADE',
|
|
2554
|
+
'funding': 'MAIN',
|
|
2555
|
+
};
|
|
2556
|
+
return this.safeStringUpper(transferTypes, transferType, transferType);
|
|
2557
|
+
}
|
|
2558
|
+
/**
|
|
2559
|
+
* @method
|
|
2560
|
+
* @name kucoinfutures#fetchMyTrades
|
|
2561
|
+
* @see https://docs.kucoin.com/futures/#get-fills
|
|
2562
|
+
* @description fetch all trades made by the user
|
|
2563
|
+
* @param {string} symbol unified market symbol
|
|
2564
|
+
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
2565
|
+
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
2566
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2567
|
+
* @param {int} [params.until] End time in ms
|
|
2568
|
+
* @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)
|
|
2569
|
+
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
2570
|
+
*/
|
|
2485
2571
|
async fetchMyTrades(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
2486
|
-
/**
|
|
2487
|
-
* @method
|
|
2488
|
-
* @name kucoinfutures#fetchMyTrades
|
|
2489
|
-
* @see https://docs.kucoin.com/futures/#get-fills
|
|
2490
|
-
* @description fetch all trades made by the user
|
|
2491
|
-
* @param {string} symbol unified market symbol
|
|
2492
|
-
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
2493
|
-
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
2494
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2495
|
-
* @param {int} [params.until] End time in ms
|
|
2496
|
-
* @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)
|
|
2497
|
-
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
2498
|
-
*/
|
|
2499
2572
|
await this.loadMarkets();
|
|
2500
2573
|
let paginate = false;
|
|
2501
2574
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchMyTrades', 'paginate');
|
|
@@ -2557,18 +2630,18 @@ class kucoinfutures extends kucoinfutures$1 {
|
|
|
2557
2630
|
const trades = this.safeList(data, 'items', []);
|
|
2558
2631
|
return this.parseTrades(trades, market, since, limit);
|
|
2559
2632
|
}
|
|
2633
|
+
/**
|
|
2634
|
+
* @method
|
|
2635
|
+
* @name kucoinfutures#fetchTrades
|
|
2636
|
+
* @description get the list of most recent trades for a particular symbol
|
|
2637
|
+
* @see https://www.kucoin.com/docs/rest/futures-trading/market-data/get-transaction-history
|
|
2638
|
+
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
2639
|
+
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
2640
|
+
* @param {int} [limit] the maximum amount of trades to fetch
|
|
2641
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2642
|
+
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
|
|
2643
|
+
*/
|
|
2560
2644
|
async fetchTrades(symbol, since = undefined, limit = undefined, params = {}) {
|
|
2561
|
-
/**
|
|
2562
|
-
* @method
|
|
2563
|
-
* @name kucoinfutures#fetchTrades
|
|
2564
|
-
* @description get the list of most recent trades for a particular symbol
|
|
2565
|
-
* @see https://www.kucoin.com/docs/rest/futures-trading/market-data/get-transaction-history
|
|
2566
|
-
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
2567
|
-
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
2568
|
-
* @param {int} [limit] the maximum amount of trades to fetch
|
|
2569
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2570
|
-
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
|
|
2571
|
-
*/
|
|
2572
2645
|
await this.loadMarkets();
|
|
2573
2646
|
const market = this.market(symbol);
|
|
2574
2647
|
const request = {
|
|
@@ -2730,17 +2803,17 @@ class kucoinfutures extends kucoinfutures$1 {
|
|
|
2730
2803
|
'fee': fee,
|
|
2731
2804
|
}, market);
|
|
2732
2805
|
}
|
|
2806
|
+
/**
|
|
2807
|
+
* @method
|
|
2808
|
+
* @name kucoinfutures#fetchDeposits
|
|
2809
|
+
* @description fetch all deposits made to an account
|
|
2810
|
+
* @param {string} code unified currency code
|
|
2811
|
+
* @param {int} [since] the earliest time in ms to fetch deposits for
|
|
2812
|
+
* @param {int} [limit] the maximum number of deposits structures to retrieve
|
|
2813
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2814
|
+
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
2815
|
+
*/
|
|
2733
2816
|
async fetchDeposits(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
2734
|
-
/**
|
|
2735
|
-
* @method
|
|
2736
|
-
* @name kucoinfutures#fetchDeposits
|
|
2737
|
-
* @description fetch all deposits made to an account
|
|
2738
|
-
* @param {string} code unified currency code
|
|
2739
|
-
* @param {int} [since] the earliest time in ms to fetch deposits for
|
|
2740
|
-
* @param {int} [limit] the maximum number of deposits structures to retrieve
|
|
2741
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2742
|
-
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
2743
|
-
*/
|
|
2744
2817
|
await this.loadMarkets();
|
|
2745
2818
|
const request = {};
|
|
2746
2819
|
let currency = undefined;
|
|
@@ -2785,17 +2858,17 @@ class kucoinfutures extends kucoinfutures$1 {
|
|
|
2785
2858
|
const responseData = response['data']['items'];
|
|
2786
2859
|
return this.parseTransactions(responseData, currency, since, limit, { 'type': 'deposit' });
|
|
2787
2860
|
}
|
|
2861
|
+
/**
|
|
2862
|
+
* @method
|
|
2863
|
+
* @name kucoinfutures#fetchWithdrawals
|
|
2864
|
+
* @description fetch all withdrawals made from an account
|
|
2865
|
+
* @param {string} code unified currency code
|
|
2866
|
+
* @param {int} [since] the earliest time in ms to fetch withdrawals for
|
|
2867
|
+
* @param {int} [limit] the maximum number of withdrawals structures to retrieve
|
|
2868
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2869
|
+
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
2870
|
+
*/
|
|
2788
2871
|
async fetchWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
2789
|
-
/**
|
|
2790
|
-
* @method
|
|
2791
|
-
* @name kucoinfutures#fetchWithdrawals
|
|
2792
|
-
* @description fetch all withdrawals made from an account
|
|
2793
|
-
* @param {string} code unified currency code
|
|
2794
|
-
* @param {int} [since] the earliest time in ms to fetch withdrawals for
|
|
2795
|
-
* @param {int} [limit] the maximum number of withdrawals structures to retrieve
|
|
2796
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2797
|
-
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
2798
|
-
*/
|
|
2799
2872
|
await this.loadMarkets();
|
|
2800
2873
|
const request = {};
|
|
2801
2874
|
let currency = undefined;
|
|
@@ -2840,16 +2913,16 @@ class kucoinfutures extends kucoinfutures$1 {
|
|
|
2840
2913
|
const responseData = response['data']['items'];
|
|
2841
2914
|
return this.parseTransactions(responseData, currency, since, limit, { 'type': 'withdrawal' });
|
|
2842
2915
|
}
|
|
2916
|
+
/**
|
|
2917
|
+
* @method
|
|
2918
|
+
* @name kucoinfutures#fetchMarketLeverageTiers
|
|
2919
|
+
* @description retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes for a single market
|
|
2920
|
+
* @see https://www.kucoin.com/docs/rest/futures-trading/risk-limit/get-futures-risk-limit-level
|
|
2921
|
+
* @param {string} symbol unified market symbol
|
|
2922
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2923
|
+
* @returns {object} a [leverage tiers structure]{@link https://docs.ccxt.com/#/?id=leverage-tiers-structure}
|
|
2924
|
+
*/
|
|
2843
2925
|
async fetchMarketLeverageTiers(symbol, params = {}) {
|
|
2844
|
-
/**
|
|
2845
|
-
* @method
|
|
2846
|
-
* @name kucoinfutures#fetchMarketLeverageTiers
|
|
2847
|
-
* @description retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes for a single market
|
|
2848
|
-
* @see https://www.kucoin.com/docs/rest/futures-trading/risk-limit/get-futures-risk-limit-level
|
|
2849
|
-
* @param {string} symbol unified market symbol
|
|
2850
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2851
|
-
* @returns {object} a [leverage tiers structure]{@link https://docs.ccxt.com/#/?id=leverage-tiers-structure}
|
|
2852
|
-
*/
|
|
2853
2926
|
await this.loadMarkets();
|
|
2854
2927
|
const market = this.market(symbol);
|
|
2855
2928
|
if (!market['contract']) {
|
|
@@ -2883,6 +2956,7 @@ class kucoinfutures extends kucoinfutures$1 {
|
|
|
2883
2956
|
/**
|
|
2884
2957
|
* @ignore
|
|
2885
2958
|
* @method
|
|
2959
|
+
* @name kucoinfutures#parseMarketLeverageTiers
|
|
2886
2960
|
* @param {object} info Exchange market response for 1 market
|
|
2887
2961
|
* @param {object} market CCXT market
|
|
2888
2962
|
*/
|
|
@@ -2900,8 +2974,10 @@ class kucoinfutures extends kucoinfutures$1 {
|
|
|
2900
2974
|
const tiers = [];
|
|
2901
2975
|
for (let i = 0; i < info.length; i++) {
|
|
2902
2976
|
const tier = info[i];
|
|
2977
|
+
const marketId = this.safeString(tier, 'symbol');
|
|
2903
2978
|
tiers.push({
|
|
2904
2979
|
'tier': this.safeNumber(tier, 'level'),
|
|
2980
|
+
'symbol': this.safeSymbol(marketId, market, undefined, 'contract'),
|
|
2905
2981
|
'currency': market['base'],
|
|
2906
2982
|
'minNotional': this.safeNumber(tier, 'minRiskLimit'),
|
|
2907
2983
|
'maxNotional': this.safeNumber(tier, 'maxRiskLimit'),
|
|
@@ -2912,19 +2988,19 @@ class kucoinfutures extends kucoinfutures$1 {
|
|
|
2912
2988
|
}
|
|
2913
2989
|
return tiers;
|
|
2914
2990
|
}
|
|
2991
|
+
/**
|
|
2992
|
+
* @method
|
|
2993
|
+
* @name kucoinfutures#fetchFundingRateHistory
|
|
2994
|
+
* @see https://www.kucoin.com/docs/rest/futures-trading/funding-fees/get-public-funding-history#request-url
|
|
2995
|
+
* @description fetches historical funding rate prices
|
|
2996
|
+
* @param {string} symbol unified symbol of the market to fetch the funding rate history for
|
|
2997
|
+
* @param {int} [since] not used by kucuoinfutures
|
|
2998
|
+
* @param {int} [limit] the maximum amount of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure} to fetch
|
|
2999
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3000
|
+
* @param {int} [params.until] end time in ms
|
|
3001
|
+
* @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure}
|
|
3002
|
+
*/
|
|
2915
3003
|
async fetchFundingRateHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
2916
|
-
/**
|
|
2917
|
-
* @method
|
|
2918
|
-
* @name kucoinfutures#fetchFundingRateHistory
|
|
2919
|
-
* @see https://www.kucoin.com/docs/rest/futures-trading/funding-fees/get-public-funding-history#request-url
|
|
2920
|
-
* @description fetches historical funding rate prices
|
|
2921
|
-
* @param {string} symbol unified symbol of the market to fetch the funding rate history for
|
|
2922
|
-
* @param {int} [since] not used by kucuoinfutures
|
|
2923
|
-
* @param {int} [limit] the maximum amount of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure} to fetch
|
|
2924
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2925
|
-
* @param {int} [params.until] end time in ms
|
|
2926
|
-
* @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure}
|
|
2927
|
-
*/
|
|
2928
3004
|
if (symbol === undefined) {
|
|
2929
3005
|
throw new errors.ArgumentsRequired(this.id + ' fetchFundingRateHistory() requires a symbol argument');
|
|
2930
3006
|
}
|
|
@@ -2976,18 +3052,18 @@ class kucoinfutures extends kucoinfutures$1 {
|
|
|
2976
3052
|
'datetime': this.iso8601(timestamp),
|
|
2977
3053
|
};
|
|
2978
3054
|
}
|
|
3055
|
+
/**
|
|
3056
|
+
* @method
|
|
3057
|
+
* @name kucoinfutures#closePosition
|
|
3058
|
+
* @description closes open positions for a market
|
|
3059
|
+
* @see https://www.kucoin.com/docs/rest/futures-trading/orders/place-order
|
|
3060
|
+
* @param {string} symbol Unified CCXT market symbol
|
|
3061
|
+
* @param {string} side not used by kucoinfutures closePositions
|
|
3062
|
+
* @param {object} [params] extra parameters specific to the okx api endpoint
|
|
3063
|
+
* @param {string} [params.clientOrderId] client order id of the order
|
|
3064
|
+
* @returns {object[]} [A list of position structures]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
3065
|
+
*/
|
|
2979
3066
|
async closePosition(symbol, side = undefined, params = {}) {
|
|
2980
|
-
/**
|
|
2981
|
-
* @method
|
|
2982
|
-
* @name kucoinfutures#closePosition
|
|
2983
|
-
* @description closes open positions for a market
|
|
2984
|
-
* @see https://www.kucoin.com/docs/rest/futures-trading/orders/place-order
|
|
2985
|
-
* @param {string} symbol Unified CCXT market symbol
|
|
2986
|
-
* @param {string} side not used by kucoinfutures closePositions
|
|
2987
|
-
* @param {object} [params] extra parameters specific to the okx api endpoint
|
|
2988
|
-
* @param {string} [params.clientOrderId] client order id of the order
|
|
2989
|
-
* @returns {object[]} [A list of position structures]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
2990
|
-
*/
|
|
2991
3067
|
await this.loadMarkets();
|
|
2992
3068
|
const market = this.market(symbol);
|
|
2993
3069
|
let clientOrderId = this.safeString(params, 'clientOrderId');
|
|
@@ -3011,16 +3087,16 @@ class kucoinfutures extends kucoinfutures$1 {
|
|
|
3011
3087
|
}
|
|
3012
3088
|
return this.parseOrder(response, market);
|
|
3013
3089
|
}
|
|
3090
|
+
/**
|
|
3091
|
+
* @method
|
|
3092
|
+
* @name kucoinfutures#fetchTradingFee
|
|
3093
|
+
* @description fetch the trading fees for a market
|
|
3094
|
+
* @see https://www.kucoin.com/docs/rest/funding/trade-fee/trading-pair-actual-fee-futures
|
|
3095
|
+
* @param {string} symbol unified market symbol
|
|
3096
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3097
|
+
* @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
3098
|
+
*/
|
|
3014
3099
|
async fetchTradingFee(symbol, params = {}) {
|
|
3015
|
-
/**
|
|
3016
|
-
* @method
|
|
3017
|
-
* @name kucoinfutures#fetchTradingFee
|
|
3018
|
-
* @description fetch the trading fees for a market
|
|
3019
|
-
* @see https://www.kucoin.com/docs/rest/funding/trade-fee/trading-pair-actual-fee-futures
|
|
3020
|
-
* @param {string} symbol unified market symbol
|
|
3021
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3022
|
-
* @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
3023
|
-
*/
|
|
3024
3100
|
await this.loadMarkets();
|
|
3025
3101
|
const market = this.market(symbol);
|
|
3026
3102
|
const request = {
|
|
@@ -3049,16 +3125,16 @@ class kucoinfutures extends kucoinfutures$1 {
|
|
|
3049
3125
|
'tierBased': true,
|
|
3050
3126
|
};
|
|
3051
3127
|
}
|
|
3128
|
+
/**
|
|
3129
|
+
* @method
|
|
3130
|
+
* @name kucoinfutures#fetchMarginMode
|
|
3131
|
+
* @description fetches the margin mode of a trading pair
|
|
3132
|
+
* @see https://www.kucoin.com/docs/rest/futures-trading/positions/get-margin-mode
|
|
3133
|
+
* @param {string} symbol unified symbol of the market to fetch the margin mode for
|
|
3134
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3135
|
+
* @returns {object} a [margin mode structure]{@link https://docs.ccxt.com/#/?id=margin-mode-structure}
|
|
3136
|
+
*/
|
|
3052
3137
|
async fetchMarginMode(symbol, params = {}) {
|
|
3053
|
-
/**
|
|
3054
|
-
* @method
|
|
3055
|
-
* @name kucoinfutures#fetchMarginMode
|
|
3056
|
-
* @description fetches the margin mode of a trading pair
|
|
3057
|
-
* @see https://www.kucoin.com/docs/rest/futures-trading/positions/get-margin-mode
|
|
3058
|
-
* @param {string} symbol unified symbol of the market to fetch the margin mode for
|
|
3059
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3060
|
-
* @returns {object} a [margin mode structure]{@link https://docs.ccxt.com/#/?id=margin-mode-structure}
|
|
3061
|
-
*/
|
|
3062
3138
|
await this.loadMarkets();
|
|
3063
3139
|
const market = this.market(symbol);
|
|
3064
3140
|
const request = {
|
|
@@ -3086,17 +3162,17 @@ class kucoinfutures extends kucoinfutures$1 {
|
|
|
3086
3162
|
'marginMode': marginType,
|
|
3087
3163
|
};
|
|
3088
3164
|
}
|
|
3165
|
+
/**
|
|
3166
|
+
* @method
|
|
3167
|
+
* @name kucoinfutures#setMarginMode
|
|
3168
|
+
* @description set margin mode to 'cross' or 'isolated'
|
|
3169
|
+
* @see https://www.kucoin.com/docs/rest/futures-trading/positions/modify-margin-mode
|
|
3170
|
+
* @param {string} marginMode 'cross' or 'isolated'
|
|
3171
|
+
* @param {string} symbol unified market symbol
|
|
3172
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3173
|
+
* @returns {object} response from the exchange
|
|
3174
|
+
*/
|
|
3089
3175
|
async setMarginMode(marginMode, symbol = undefined, params = {}) {
|
|
3090
|
-
/**
|
|
3091
|
-
* @method
|
|
3092
|
-
* @name kucoinfutures#setMarginMode
|
|
3093
|
-
* @description set margin mode to 'cross' or 'isolated'
|
|
3094
|
-
* @see https://www.kucoin.com/docs/rest/futures-trading/positions/modify-margin-mode
|
|
3095
|
-
* @param {string} marginMode 'cross' or 'isolated'
|
|
3096
|
-
* @param {string} symbol unified market symbol
|
|
3097
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3098
|
-
* @returns {object} response from the exchange
|
|
3099
|
-
*/
|
|
3100
3176
|
if (symbol === undefined) {
|
|
3101
3177
|
throw new errors.ArgumentsRequired(this.id + ' setMarginMode() requires a symbol argument');
|
|
3102
3178
|
}
|
|
@@ -3120,16 +3196,16 @@ class kucoinfutures extends kucoinfutures$1 {
|
|
|
3120
3196
|
const data = this.safeDict(response, 'data', {});
|
|
3121
3197
|
return this.parseMarginMode(data, market);
|
|
3122
3198
|
}
|
|
3199
|
+
/**
|
|
3200
|
+
* @method
|
|
3201
|
+
* @name kucoinfutures#fetchLeverage
|
|
3202
|
+
* @description fetch the set leverage for a market
|
|
3203
|
+
* @see https://www.kucoin.com/docs/rest/futures-trading/positions/get-cross-margin-leverage
|
|
3204
|
+
* @param {string} symbol unified market symbol
|
|
3205
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3206
|
+
* @returns {object} a [leverage structure]{@link https://docs.ccxt.com/#/?id=leverage-structure}
|
|
3207
|
+
*/
|
|
3123
3208
|
async fetchLeverage(symbol, params = {}) {
|
|
3124
|
-
/**
|
|
3125
|
-
* @method
|
|
3126
|
-
* @name kucoin#fetchLeverage
|
|
3127
|
-
* @description fetch the set leverage for a market
|
|
3128
|
-
* @see https://www.kucoin.com/docs/rest/futures-trading/positions/get-cross-margin-leverage
|
|
3129
|
-
* @param {string} symbol unified market symbol
|
|
3130
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3131
|
-
* @returns {object} a [leverage structure]{@link https://docs.ccxt.com/#/?id=leverage-structure}
|
|
3132
|
-
*/
|
|
3133
3209
|
let marginMode = undefined;
|
|
3134
3210
|
[marginMode, params] = this.handleMarginModeAndParams(symbol, params);
|
|
3135
3211
|
if (marginMode !== 'cross') {
|
|
@@ -3156,17 +3232,17 @@ class kucoinfutures extends kucoinfutures$1 {
|
|
|
3156
3232
|
'marginMode': marginMode,
|
|
3157
3233
|
});
|
|
3158
3234
|
}
|
|
3235
|
+
/**
|
|
3236
|
+
* @method
|
|
3237
|
+
* @name kucoinfutures#setLeverage
|
|
3238
|
+
* @description set the level of leverage for a market
|
|
3239
|
+
* @see https://www.kucoin.com/docs/rest/futures-trading/positions/modify-cross-margin-leverage
|
|
3240
|
+
* @param {float} leverage the rate of leverage
|
|
3241
|
+
* @param {string} symbol unified market symbol
|
|
3242
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3243
|
+
* @returns {object} response from the exchange
|
|
3244
|
+
*/
|
|
3159
3245
|
async setLeverage(leverage, symbol = undefined, params = {}) {
|
|
3160
|
-
/**
|
|
3161
|
-
* @method
|
|
3162
|
-
* @name kucoinfutures#setLeverage
|
|
3163
|
-
* @description set the level of leverage for a market
|
|
3164
|
-
* @see https://www.kucoin.com/docs/rest/futures-trading/positions/modify-cross-margin-leverage
|
|
3165
|
-
* @param {float} leverage the rate of leverage
|
|
3166
|
-
* @param {string} symbol unified market symbol
|
|
3167
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3168
|
-
* @returns {object} response from the exchange
|
|
3169
|
-
*/
|
|
3170
3246
|
let marginMode = undefined;
|
|
3171
3247
|
[marginMode, params] = this.handleMarginModeAndParams(symbol, params);
|
|
3172
3248
|
if (marginMode !== 'cross') {
|