ccxt 4.4.30 → 4.4.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -3
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/ace.js +123 -123
- package/dist/cjs/src/alpaca.js +237 -237
- package/dist/cjs/src/ascendex.js +342 -341
- package/dist/cjs/src/bigone.js +242 -242
- package/dist/cjs/src/binance.js +1339 -1291
- package/dist/cjs/src/bingx.js +639 -639
- package/dist/cjs/src/bit2c.js +111 -111
- package/dist/cjs/src/bitbank.js +142 -142
- package/dist/cjs/src/bitbns.js +140 -140
- package/dist/cjs/src/bitfinex.js +231 -231
- package/dist/cjs/src/bitfinex2.js +403 -403
- package/dist/cjs/src/bitflyer.js +184 -184
- package/dist/cjs/src/bitget.js +848 -846
- package/dist/cjs/src/bithumb.js +125 -124
- package/dist/cjs/src/bitmart.js +525 -525
- package/dist/cjs/src/bitmex.js +317 -317
- package/dist/cjs/src/bitopro.js +221 -221
- package/dist/cjs/src/bitrue.js +315 -315
- package/dist/cjs/src/bitso.js +220 -220
- package/dist/cjs/src/bitstamp.js +251 -251
- package/dist/cjs/src/bitteam.js +183 -183
- package/dist/cjs/src/bitvavo.js +247 -251
- package/dist/cjs/src/bl3p.js +82 -82
- package/dist/cjs/src/blockchaincom.js +211 -211
- package/dist/cjs/src/blofin.js +332 -331
- package/dist/cjs/src/btcalpha.js +166 -166
- package/dist/cjs/src/btcbox.js +108 -108
- package/dist/cjs/src/btcmarkets.js +198 -198
- package/dist/cjs/src/btcturk.js +124 -124
- package/dist/cjs/src/bybit.js +906 -900
- package/dist/cjs/src/cex.js +227 -226
- package/dist/cjs/src/coinbase.js +481 -481
- package/dist/cjs/src/coinbaseexchange.js +274 -274
- package/dist/cjs/src/coinbaseinternational.js +304 -304
- package/dist/cjs/src/coincatch.js +650 -650
- package/dist/cjs/src/coincheck.js +113 -113
- package/dist/cjs/src/coinex.js +611 -601
- package/dist/cjs/src/coinlist.js +304 -303
- package/dist/cjs/src/coinmate.js +162 -161
- package/dist/cjs/src/coinmetro.js +187 -187
- package/dist/cjs/src/coinone.js +124 -123
- package/dist/cjs/src/coinsph.js +237 -237
- package/dist/cjs/src/coinspot.js +82 -82
- package/dist/cjs/src/cryptocom.js +342 -341
- package/dist/cjs/src/currencycom.js +225 -224
- package/dist/cjs/src/delta.js +320 -320
- package/dist/cjs/src/deribit.js +411 -408
- package/dist/cjs/src/digifinex.js +432 -431
- package/dist/cjs/src/exmo.js +328 -327
- package/dist/cjs/src/gate.js +830 -791
- package/dist/cjs/src/gemini.js +199 -198
- package/dist/cjs/src/hashkey.js +520 -517
- package/dist/cjs/src/hitbtc.js +465 -462
- package/dist/cjs/src/hollaex.js +253 -252
- package/dist/cjs/src/htx.js +791 -848
- package/dist/cjs/src/huobijp.js +219 -218
- package/dist/cjs/src/hyperliquid.js +421 -417
- package/dist/cjs/src/idex.js +238 -237
- package/dist/cjs/src/independentreserve.js +133 -132
- package/dist/cjs/src/indodax.js +177 -171
- package/dist/cjs/src/kraken.js +381 -377
- package/dist/cjs/src/krakenfutures.js +285 -279
- package/dist/cjs/src/kucoin.js +632 -622
- package/dist/cjs/src/kucoinfutures.js +533 -457
- package/dist/cjs/src/kuna.js +283 -282
- package/dist/cjs/src/latoken.js +211 -210
- package/dist/cjs/src/lbank.js +268 -267
- package/dist/cjs/src/luno.js +174 -173
- package/dist/cjs/src/lykke.js +172 -171
- package/dist/cjs/src/mercado.js +123 -122
- package/dist/cjs/src/mexc.js +650 -646
- package/dist/cjs/src/ndax.js +229 -228
- package/dist/cjs/src/novadax.js +230 -229
- package/dist/cjs/src/oceanex.js +187 -186
- package/dist/cjs/src/okcoin.js +286 -285
- package/dist/cjs/src/okx.js +909 -904
- package/dist/cjs/src/onetrading.js +218 -218
- package/dist/cjs/src/oxfun.js +335 -334
- package/dist/cjs/src/p2b.js +154 -154
- package/dist/cjs/src/paradex.js +249 -244
- package/dist/cjs/src/paymium.js +101 -101
- package/dist/cjs/src/phemex.js +388 -390
- package/dist/cjs/src/poloniex.js +270 -270
- package/dist/cjs/src/poloniexfutures.js +250 -250
- package/dist/cjs/src/pro/alpaca.js +64 -64
- package/dist/cjs/src/pro/ascendex.js +64 -64
- package/dist/cjs/src/pro/binance.js +546 -543
- package/dist/cjs/src/pro/bingx.js +116 -116
- package/dist/cjs/src/pro/bitfinex.js +42 -42
- package/dist/cjs/src/pro/bitfinex2.js +66 -66
- package/dist/cjs/src/pro/bitget.js +188 -181
- package/dist/cjs/src/pro/bithumb.js +40 -40
- package/dist/cjs/src/pro/bitmart.js +121 -119
- package/dist/cjs/src/pro/bitmex.js +135 -133
- package/dist/cjs/src/pro/bitopro.js +49 -49
- package/dist/cjs/src/pro/bitrue.js +19 -19
- package/dist/cjs/src/pro/bitstamp.js +29 -29
- package/dist/cjs/src/pro/bitvavo.js +299 -301
- package/dist/cjs/src/pro/blockchaincom.js +62 -62
- package/dist/cjs/src/pro/blofin.js +132 -130
- package/dist/cjs/src/pro/bybit.js +317 -313
- package/dist/cjs/src/pro/cex.js +168 -168
- package/dist/cjs/src/pro/coinbase.js +93 -91
- package/dist/cjs/src/pro/coinbaseexchange.js +95 -95
- package/dist/cjs/src/pro/coinbaseinternational.js +111 -111
- package/dist/cjs/src/pro/coincatch.js +150 -143
- package/dist/cjs/src/pro/coincheck.js +21 -21
- package/dist/cjs/src/pro/coinex.js +110 -110
- package/dist/cjs/src/pro/coinone.js +30 -30
- package/dist/cjs/src/pro/cryptocom.js +227 -227
- package/dist/cjs/src/pro/currencycom.js +45 -45
- package/dist/cjs/src/pro/deribit.js +127 -127
- package/dist/cjs/src/pro/exmo.js +66 -66
- package/dist/cjs/src/pro/gate.js +287 -283
- package/dist/cjs/src/pro/gemini.js +74 -74
- package/dist/cjs/src/pro/hashkey.js +87 -85
- package/dist/cjs/src/pro/hitbtc.js +190 -190
- package/dist/cjs/src/pro/hollaex.js +51 -51
- package/dist/cjs/src/pro/htx.js +96 -94
- package/dist/cjs/src/pro/huobijp.js +38 -38
- package/dist/cjs/src/pro/hyperliquid.js +151 -150
- package/dist/cjs/src/pro/idex.js +48 -48
- package/dist/cjs/src/pro/independentreserve.js +19 -19
- package/dist/cjs/src/pro/kraken.js +167 -167
- package/dist/cjs/src/pro/krakenfutures.js +137 -138
- package/dist/cjs/src/pro/kucoin.js +167 -168
- package/dist/cjs/src/pro/kucoinfutures.js +147 -147
- package/dist/cjs/src/pro/lbank.js +95 -95
- package/dist/cjs/src/pro/luno.js +21 -21
- package/dist/cjs/src/pro/mexc.js +102 -103
- package/dist/cjs/src/pro/ndax.js +42 -42
- package/dist/cjs/src/pro/okcoin.js +61 -61
- package/dist/cjs/src/pro/okx.js +332 -330
- package/dist/cjs/src/pro/onetrading.js +71 -71
- package/dist/cjs/src/pro/oxfun.js +193 -191
- package/dist/cjs/src/pro/p2b.js +77 -77
- package/dist/cjs/src/pro/paradex.js +39 -39
- package/dist/cjs/src/pro/phemex.js +94 -94
- package/dist/cjs/src/pro/poloniex.js +171 -171
- package/dist/cjs/src/pro/poloniexfutures.js +62 -62
- package/dist/cjs/src/pro/probit.js +63 -63
- package/dist/cjs/src/pro/upbit.js +80 -80
- package/dist/cjs/src/pro/vertex.js +65 -63
- package/dist/cjs/src/pro/wazirx.js +70 -70
- package/dist/cjs/src/pro/whitebit.js +83 -83
- package/dist/cjs/src/pro/woo.js +106 -104
- package/dist/cjs/src/pro/woofipro.js +105 -103
- package/dist/cjs/src/pro/xt.js +119 -119
- package/dist/cjs/src/probit.js +229 -229
- package/dist/cjs/src/timex.js +198 -197
- package/dist/cjs/src/tokocrypto.js +214 -213
- package/dist/cjs/src/tradeogre.js +92 -91
- package/dist/cjs/src/upbit.js +243 -242
- package/dist/cjs/src/vertex.js +258 -258
- package/dist/cjs/src/wavesexchange.js +176 -172
- package/dist/cjs/src/wazirx.js +168 -168
- package/dist/cjs/src/whitebit.js +361 -361
- package/dist/cjs/src/woo.js +571 -572
- package/dist/cjs/src/woofipro.js +392 -391
- package/dist/cjs/src/xt.js +436 -435
- package/dist/cjs/src/yobit.js +159 -158
- package/dist/cjs/src/zaif.js +103 -103
- package/dist/cjs/src/zonda.js +168 -168
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/ace.d.ts +123 -0
- package/js/src/ace.js +123 -123
- package/js/src/alpaca.d.ts +237 -0
- package/js/src/alpaca.js +237 -237
- package/js/src/ascendex.d.ts +339 -0
- package/js/src/ascendex.js +342 -341
- package/js/src/base/types.d.ts +1 -0
- package/js/src/bigone.d.ts +242 -0
- package/js/src/bigone.js +242 -242
- package/js/src/binance.d.ts +1306 -0
- package/js/src/binance.js +1339 -1291
- package/js/src/bingx.d.ts +639 -0
- package/js/src/bingx.js +639 -639
- package/js/src/bit2c.d.ts +111 -0
- package/js/src/bit2c.js +111 -111
- package/js/src/bitbank.d.ts +142 -0
- package/js/src/bitbank.js +142 -142
- package/js/src/bitbns.d.ts +140 -0
- package/js/src/bitbns.js +140 -140
- package/js/src/bitfinex.d.ts +231 -0
- package/js/src/bitfinex.js +231 -231
- package/js/src/bitfinex2.d.ts +403 -0
- package/js/src/bitfinex2.js +403 -403
- package/js/src/bitflyer.d.ts +184 -0
- package/js/src/bitflyer.js +184 -184
- package/js/src/bitget.d.ts +846 -0
- package/js/src/bitget.js +848 -846
- package/js/src/bithumb.d.ts +125 -0
- package/js/src/bithumb.js +125 -124
- package/js/src/bitmart.d.ts +525 -0
- package/js/src/bitmart.js +525 -525
- package/js/src/bitmex.d.ts +317 -0
- package/js/src/bitmex.js +317 -317
- package/js/src/bitopro.d.ts +221 -0
- package/js/src/bitopro.js +221 -221
- package/js/src/bitrue.d.ts +315 -0
- package/js/src/bitrue.js +315 -315
- package/js/src/bitso.d.ts +220 -0
- package/js/src/bitso.js +220 -220
- package/js/src/bitstamp.d.ts +251 -0
- package/js/src/bitstamp.js +251 -251
- package/js/src/bitteam.d.ts +183 -0
- package/js/src/bitteam.js +183 -183
- package/js/src/bitvavo.d.ts +247 -0
- package/js/src/bitvavo.js +247 -251
- package/js/src/bl3p.d.ts +82 -0
- package/js/src/bl3p.js +82 -82
- package/js/src/blockchaincom.d.ts +211 -0
- package/js/src/blockchaincom.js +211 -211
- package/js/src/blofin.d.ts +332 -0
- package/js/src/blofin.js +332 -331
- package/js/src/btcalpha.d.ts +166 -0
- package/js/src/btcalpha.js +166 -166
- package/js/src/btcbox.d.ts +108 -0
- package/js/src/btcbox.js +108 -108
- package/js/src/btcmarkets.d.ts +198 -0
- package/js/src/btcmarkets.js +198 -198
- package/js/src/btcturk.d.ts +124 -0
- package/js/src/btcturk.js +124 -124
- package/js/src/bybit.d.ts +906 -1
- package/js/src/bybit.js +906 -900
- package/js/src/cex.d.ts +227 -0
- package/js/src/cex.js +227 -226
- package/js/src/coinbase.d.ts +481 -0
- package/js/src/coinbase.js +481 -481
- package/js/src/coinbaseexchange.d.ts +274 -0
- package/js/src/coinbaseexchange.js +274 -274
- package/js/src/coinbaseinternational.d.ts +304 -0
- package/js/src/coinbaseinternational.js +304 -304
- package/js/src/coincatch.d.ts +646 -0
- package/js/src/coincatch.js +650 -650
- package/js/src/coincheck.d.ts +113 -0
- package/js/src/coincheck.js +113 -113
- package/js/src/coinex.d.ts +603 -0
- package/js/src/coinex.js +611 -601
- package/js/src/coinlist.d.ts +304 -0
- package/js/src/coinlist.js +304 -303
- package/js/src/coinmate.d.ts +162 -0
- package/js/src/coinmate.js +162 -161
- package/js/src/coinmetro.d.ts +187 -0
- package/js/src/coinmetro.js +187 -187
- package/js/src/coinone.d.ts +124 -0
- package/js/src/coinone.js +124 -123
- package/js/src/coinsph.d.ts +237 -0
- package/js/src/coinsph.js +237 -237
- package/js/src/coinspot.d.ts +82 -0
- package/js/src/coinspot.js +82 -82
- package/js/src/cryptocom.d.ts +342 -0
- package/js/src/cryptocom.js +342 -341
- package/js/src/currencycom.d.ts +225 -0
- package/js/src/currencycom.js +225 -224
- package/js/src/delta.d.ts +320 -0
- package/js/src/delta.js +320 -320
- package/js/src/deribit.d.ts +411 -0
- package/js/src/deribit.js +411 -408
- package/js/src/digifinex.d.ts +430 -0
- package/js/src/digifinex.js +432 -431
- package/js/src/exmo.d.ts +328 -0
- package/js/src/exmo.js +328 -327
- package/js/src/gate.d.ts +803 -1
- package/js/src/gate.js +830 -791
- package/js/src/gemini.d.ts +199 -0
- package/js/src/gemini.js +199 -198
- package/js/src/hashkey.d.ts +516 -0
- package/js/src/hashkey.js +520 -517
- package/js/src/hitbtc.d.ts +465 -0
- package/js/src/hitbtc.js +465 -462
- package/js/src/hollaex.d.ts +253 -0
- package/js/src/hollaex.js +253 -252
- package/js/src/htx.d.ts +765 -2
- package/js/src/htx.js +791 -848
- package/js/src/huobijp.d.ts +219 -0
- package/js/src/huobijp.js +219 -218
- package/js/src/hyperliquid.d.ts +419 -0
- package/js/src/hyperliquid.js +421 -417
- package/js/src/idex.d.ts +238 -0
- package/js/src/idex.js +238 -237
- package/js/src/independentreserve.d.ts +133 -0
- package/js/src/independentreserve.js +133 -132
- package/js/src/indodax.d.ts +171 -0
- package/js/src/indodax.js +177 -171
- package/js/src/kraken.d.ts +381 -0
- package/js/src/kraken.js +381 -377
- package/js/src/krakenfutures.d.ts +282 -0
- package/js/src/krakenfutures.js +285 -279
- package/js/src/kucoin.d.ts +613 -0
- package/js/src/kucoin.js +632 -622
- package/js/src/kucoinfutures.d.ts +441 -0
- package/js/src/kucoinfutures.js +533 -457
- package/js/src/kuna.d.ts +283 -0
- package/js/src/kuna.js +283 -282
- package/js/src/latoken.d.ts +211 -0
- package/js/src/latoken.js +211 -210
- package/js/src/lbank.d.ts +268 -0
- package/js/src/lbank.js +268 -267
- package/js/src/luno.d.ts +174 -0
- package/js/src/luno.js +174 -173
- package/js/src/lykke.d.ts +172 -0
- package/js/src/lykke.js +172 -171
- package/js/src/mercado.d.ts +123 -0
- package/js/src/mercado.js +123 -122
- package/js/src/mexc.d.ts +647 -0
- package/js/src/mexc.js +650 -646
- package/js/src/ndax.d.ts +229 -0
- package/js/src/ndax.js +229 -228
- package/js/src/novadax.d.ts +230 -0
- package/js/src/novadax.js +230 -229
- package/js/src/oceanex.d.ts +187 -0
- package/js/src/oceanex.js +187 -186
- package/js/src/okcoin.d.ts +286 -0
- package/js/src/okcoin.js +286 -285
- package/js/src/okx.d.ts +907 -0
- package/js/src/okx.js +909 -904
- package/js/src/onetrading.d.ts +218 -0
- package/js/src/onetrading.js +218 -218
- package/js/src/oxfun.d.ts +336 -3
- package/js/src/oxfun.js +335 -334
- package/js/src/p2b.d.ts +154 -0
- package/js/src/p2b.js +154 -154
- package/js/src/paradex.d.ts +241 -0
- package/js/src/paradex.js +249 -244
- package/js/src/paymium.d.ts +101 -0
- package/js/src/paymium.js +101 -101
- package/js/src/phemex.d.ts +366 -0
- package/js/src/phemex.js +388 -390
- package/js/src/poloniex.d.ts +270 -0
- package/js/src/poloniex.js +270 -270
- package/js/src/poloniexfutures.d.ts +250 -0
- package/js/src/poloniexfutures.js +250 -250
- package/js/src/pro/alpaca.d.ts +64 -0
- package/js/src/pro/alpaca.js +64 -64
- package/js/src/pro/ascendex.d.ts +64 -0
- package/js/src/pro/ascendex.js +64 -64
- package/js/src/pro/binance.d.ts +546 -0
- package/js/src/pro/binance.js +546 -543
- package/js/src/pro/bingx.d.ts +116 -0
- package/js/src/pro/bingx.js +116 -116
- package/js/src/pro/bitfinex.d.ts +42 -0
- package/js/src/pro/bitfinex.js +42 -42
- package/js/src/pro/bitfinex2.d.ts +66 -0
- package/js/src/pro/bitfinex2.js +66 -66
- package/js/src/pro/bitget.d.ts +187 -0
- package/js/src/pro/bitget.js +188 -181
- package/js/src/pro/bithumb.d.ts +40 -0
- package/js/src/pro/bithumb.js +40 -40
- package/js/src/pro/bitmart.d.ts +121 -0
- package/js/src/pro/bitmart.js +121 -119
- package/js/src/pro/bitmex.d.ts +135 -0
- package/js/src/pro/bitmex.js +135 -133
- package/js/src/pro/bitopro.d.ts +49 -0
- package/js/src/pro/bitopro.js +49 -49
- package/js/src/pro/bitrue.d.ts +19 -0
- package/js/src/pro/bitrue.js +19 -19
- package/js/src/pro/bitstamp.d.ts +29 -0
- package/js/src/pro/bitstamp.js +29 -29
- package/js/src/pro/bitvavo.d.ts +254 -1
- package/js/src/pro/bitvavo.js +299 -301
- package/js/src/pro/blockchaincom.d.ts +62 -0
- package/js/src/pro/blockchaincom.js +62 -62
- package/js/src/pro/blofin.d.ts +132 -0
- package/js/src/pro/blofin.js +132 -130
- package/js/src/pro/bybit.d.ts +317 -0
- package/js/src/pro/bybit.js +317 -313
- package/js/src/pro/cex.d.ts +168 -0
- package/js/src/pro/cex.js +168 -168
- package/js/src/pro/coinbase.d.ts +93 -0
- package/js/src/pro/coinbase.js +93 -91
- package/js/src/pro/coinbaseexchange.d.ts +95 -0
- package/js/src/pro/coinbaseexchange.js +95 -95
- package/js/src/pro/coinbaseinternational.d.ts +111 -0
- package/js/src/pro/coinbaseinternational.js +111 -111
- package/js/src/pro/coincatch.d.ts +150 -0
- package/js/src/pro/coincatch.js +150 -143
- package/js/src/pro/coincheck.d.ts +21 -0
- package/js/src/pro/coincheck.js +21 -21
- package/js/src/pro/coinex.d.ts +110 -0
- package/js/src/pro/coinex.js +110 -110
- package/js/src/pro/coinone.d.ts +30 -0
- package/js/src/pro/coinone.js +30 -30
- package/js/src/pro/cryptocom.d.ts +227 -0
- package/js/src/pro/cryptocom.js +227 -227
- package/js/src/pro/currencycom.d.ts +45 -0
- package/js/src/pro/currencycom.js +45 -45
- package/js/src/pro/deribit.d.ts +127 -0
- package/js/src/pro/deribit.js +127 -127
- package/js/src/pro/exmo.d.ts +66 -0
- package/js/src/pro/exmo.js +66 -66
- package/js/src/pro/gate.d.ts +287 -0
- package/js/src/pro/gate.js +287 -283
- package/js/src/pro/gemini.d.ts +74 -0
- package/js/src/pro/gemini.js +74 -74
- package/js/src/pro/hashkey.d.ts +87 -0
- package/js/src/pro/hashkey.js +87 -85
- package/js/src/pro/hitbtc.d.ts +190 -0
- package/js/src/pro/hitbtc.js +190 -190
- package/js/src/pro/hollaex.d.ts +51 -0
- package/js/src/pro/hollaex.js +51 -51
- package/js/src/pro/htx.d.ts +96 -0
- package/js/src/pro/htx.js +96 -94
- package/js/src/pro/huobijp.d.ts +38 -0
- package/js/src/pro/huobijp.js +38 -38
- package/js/src/pro/hyperliquid.d.ts +151 -0
- package/js/src/pro/hyperliquid.js +151 -150
- package/js/src/pro/idex.d.ts +48 -0
- package/js/src/pro/idex.js +48 -48
- package/js/src/pro/independentreserve.d.ts +19 -0
- package/js/src/pro/independentreserve.js +19 -19
- package/js/src/pro/kraken.d.ts +167 -0
- package/js/src/pro/kraken.js +167 -167
- package/js/src/pro/krakenfutures.d.ts +137 -0
- package/js/src/pro/krakenfutures.js +137 -138
- package/js/src/pro/kucoin.d.ts +167 -0
- package/js/src/pro/kucoin.js +167 -168
- package/js/src/pro/kucoinfutures.d.ts +147 -0
- package/js/src/pro/kucoinfutures.js +147 -147
- package/js/src/pro/lbank.d.ts +95 -0
- package/js/src/pro/lbank.js +95 -95
- package/js/src/pro/luno.d.ts +21 -0
- package/js/src/pro/luno.js +21 -21
- package/js/src/pro/mexc.d.ts +101 -0
- package/js/src/pro/mexc.js +102 -103
- package/js/src/pro/ndax.d.ts +42 -0
- package/js/src/pro/ndax.js +42 -42
- package/js/src/pro/okcoin.d.ts +61 -0
- package/js/src/pro/okcoin.js +61 -61
- package/js/src/pro/okx.d.ts +332 -0
- package/js/src/pro/okx.js +332 -330
- package/js/src/pro/onetrading.d.ts +71 -0
- package/js/src/pro/onetrading.js +71 -71
- package/js/src/pro/oxfun.d.ts +193 -0
- package/js/src/pro/oxfun.js +193 -191
- package/js/src/pro/p2b.d.ts +77 -0
- package/js/src/pro/p2b.js +77 -77
- package/js/src/pro/paradex.d.ts +39 -0
- package/js/src/pro/paradex.js +39 -39
- package/js/src/pro/phemex.d.ts +94 -0
- package/js/src/pro/phemex.js +94 -94
- package/js/src/pro/poloniex.d.ts +171 -0
- package/js/src/pro/poloniex.js +171 -171
- package/js/src/pro/poloniexfutures.d.ts +62 -0
- package/js/src/pro/poloniexfutures.js +62 -62
- package/js/src/pro/probit.d.ts +63 -0
- package/js/src/pro/probit.js +63 -63
- package/js/src/pro/upbit.d.ts +80 -0
- package/js/src/pro/upbit.js +80 -80
- package/js/src/pro/vertex.d.ts +65 -0
- package/js/src/pro/vertex.js +65 -63
- package/js/src/pro/wazirx.d.ts +70 -0
- package/js/src/pro/wazirx.js +70 -70
- package/js/src/pro/whitebit.d.ts +83 -0
- package/js/src/pro/whitebit.js +83 -83
- package/js/src/pro/woo.d.ts +106 -0
- package/js/src/pro/woo.js +106 -104
- package/js/src/pro/woofipro.d.ts +105 -0
- package/js/src/pro/woofipro.js +105 -103
- package/js/src/pro/xt.d.ts +119 -0
- package/js/src/pro/xt.js +119 -119
- package/js/src/probit.d.ts +229 -0
- package/js/src/probit.js +229 -229
- package/js/src/timex.d.ts +198 -0
- package/js/src/timex.js +198 -197
- package/js/src/tokocrypto.d.ts +214 -0
- package/js/src/tokocrypto.js +214 -213
- package/js/src/tradeogre.d.ts +92 -0
- package/js/src/tradeogre.js +92 -91
- package/js/src/upbit.d.ts +243 -0
- package/js/src/upbit.js +243 -242
- package/js/src/vertex.d.ts +258 -0
- package/js/src/vertex.js +258 -258
- package/js/src/wavesexchange.d.ts +176 -0
- package/js/src/wavesexchange.js +176 -172
- package/js/src/wazirx.d.ts +168 -0
- package/js/src/wazirx.js +168 -168
- package/js/src/whitebit.d.ts +361 -0
- package/js/src/whitebit.js +361 -361
- package/js/src/woo.d.ts +571 -0
- package/js/src/woo.js +571 -572
- package/js/src/woofipro.d.ts +392 -0
- package/js/src/woofipro.js +392 -391
- package/js/src/xt.d.ts +439 -4
- package/js/src/xt.js +436 -435
- package/js/src/yobit.d.ts +159 -0
- package/js/src/yobit.js +159 -158
- package/js/src/zaif.d.ts +103 -0
- package/js/src/zaif.js +103 -103
- package/js/src/zonda.d.ts +168 -0
- package/js/src/zonda.js +168 -168
- package/package.json +1 -1
package/js/src/hyperliquid.js
CHANGED
|
@@ -219,15 +219,15 @@ export default class hyperliquid extends Exchange {
|
|
|
219
219
|
super.setSandboxMode(enabled);
|
|
220
220
|
this.options['sandboxMode'] = enabled;
|
|
221
221
|
}
|
|
222
|
+
/**
|
|
223
|
+
* @method
|
|
224
|
+
* @name hyperliquid#fetchCurrencies
|
|
225
|
+
* @description fetches all available currencies on an exchange
|
|
226
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-perpetuals-metadata
|
|
227
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
228
|
+
* @returns {object} an associative dictionary of currencies
|
|
229
|
+
*/
|
|
222
230
|
async fetchCurrencies(params = {}) {
|
|
223
|
-
/**
|
|
224
|
-
* @method
|
|
225
|
-
* @name hyperliquid#fetchCurrencies
|
|
226
|
-
* @description fetches all available currencies on an exchange
|
|
227
|
-
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-perpetuals-metadata
|
|
228
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
229
|
-
* @returns {object} an associative dictionary of currencies
|
|
230
|
-
*/
|
|
231
231
|
const request = {
|
|
232
232
|
'type': 'meta',
|
|
233
233
|
};
|
|
@@ -278,16 +278,16 @@ export default class hyperliquid extends Exchange {
|
|
|
278
278
|
}
|
|
279
279
|
return result;
|
|
280
280
|
}
|
|
281
|
+
/**
|
|
282
|
+
* @method
|
|
283
|
+
* @name hyperliquid#fetchMarkets
|
|
284
|
+
* @description retrieves data on all markets for hyperliquid
|
|
285
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-perpetuals-asset-contexts-includes-mark-price-current-funding-open-interest-etc
|
|
286
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/spot#retrieve-spot-asset-contexts
|
|
287
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
288
|
+
* @returns {object[]} an array of objects representing market data
|
|
289
|
+
*/
|
|
281
290
|
async fetchMarkets(params = {}) {
|
|
282
|
-
/**
|
|
283
|
-
* @method
|
|
284
|
-
* @name hyperliquid#fetchMarkets
|
|
285
|
-
* @description retrieves data on all markets for hyperliquid
|
|
286
|
-
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-perpetuals-asset-contexts-includes-mark-price-current-funding-open-interest-etc
|
|
287
|
-
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/spot#retrieve-spot-asset-contexts
|
|
288
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
289
|
-
* @returns {object[]} an array of objects representing market data
|
|
290
|
-
*/
|
|
291
291
|
const rawPromises = [
|
|
292
292
|
this.fetchSwapMarkets(params),
|
|
293
293
|
this.fetchSpotMarkets(params),
|
|
@@ -297,15 +297,15 @@ export default class hyperliquid extends Exchange {
|
|
|
297
297
|
const spotMarkets = promises[1];
|
|
298
298
|
return this.arrayConcat(swapMarkets, spotMarkets);
|
|
299
299
|
}
|
|
300
|
+
/**
|
|
301
|
+
* @method
|
|
302
|
+
* @name hyperliquid#fetchMarkets
|
|
303
|
+
* @description retrieves data on all swap markets for hyperliquid
|
|
304
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-perpetuals-asset-contexts-includes-mark-price-current-funding-open-interest-etc
|
|
305
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
306
|
+
* @returns {object[]} an array of objects representing market data
|
|
307
|
+
*/
|
|
300
308
|
async fetchSwapMarkets(params = {}) {
|
|
301
|
-
/**
|
|
302
|
-
* @method
|
|
303
|
-
* @name hyperliquid#fetchMarkets
|
|
304
|
-
* @description retrieves data on all swap markets for hyperliquid
|
|
305
|
-
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-perpetuals-asset-contexts-includes-mark-price-current-funding-open-interest-etc
|
|
306
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
307
|
-
* @returns {object[]} an array of objects representing market data
|
|
308
|
-
*/
|
|
309
309
|
const request = {
|
|
310
310
|
'type': 'metaAndAssetCtxs',
|
|
311
311
|
};
|
|
@@ -352,15 +352,15 @@ export default class hyperliquid extends Exchange {
|
|
|
352
352
|
}
|
|
353
353
|
return this.parseMarkets(result);
|
|
354
354
|
}
|
|
355
|
+
/**
|
|
356
|
+
* @method
|
|
357
|
+
* @name hyperliquid#fetchMarkets
|
|
358
|
+
* @description retrieves data on all spot markets for hyperliquid
|
|
359
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/spot#retrieve-spot-asset-contexts
|
|
360
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
361
|
+
* @returns {object[]} an array of objects representing market data
|
|
362
|
+
*/
|
|
355
363
|
async fetchSpotMarkets(params = {}) {
|
|
356
|
-
/**
|
|
357
|
-
* @method
|
|
358
|
-
* @name hyperliquid#fetchMarkets
|
|
359
|
-
* @description retrieves data on all spot markets for hyperliquid
|
|
360
|
-
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/spot#retrieve-spot-asset-contexts
|
|
361
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
362
|
-
* @returns {object[]} an array of objects representing market data
|
|
363
|
-
*/
|
|
364
364
|
const request = {
|
|
365
365
|
'type': 'spotMetaAndAssetCtxs',
|
|
366
366
|
};
|
|
@@ -416,7 +416,8 @@ export default class hyperliquid extends Exchange {
|
|
|
416
416
|
const markets = [];
|
|
417
417
|
for (let i = 0; i < meta.length; i++) {
|
|
418
418
|
const market = this.safeDict(meta, i, {});
|
|
419
|
-
const
|
|
419
|
+
const index = this.safeInteger(market, 'index');
|
|
420
|
+
const extraData = this.safeDict(second, index, {});
|
|
420
421
|
const marketName = this.safeString(market, 'name');
|
|
421
422
|
// if (marketName.indexOf ('/') < 0) {
|
|
422
423
|
// // there are some weird spot markets in testnet, eg @2
|
|
@@ -589,18 +590,18 @@ export default class hyperliquid extends Exchange {
|
|
|
589
590
|
'info': market,
|
|
590
591
|
});
|
|
591
592
|
}
|
|
593
|
+
/**
|
|
594
|
+
* @method
|
|
595
|
+
* @name hyperliquid#fetchBalance
|
|
596
|
+
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
597
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/spot#retrieve-a-users-token-balances
|
|
598
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-users-perpetuals-account-summary
|
|
599
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
600
|
+
* @param {string} [params.user] user address, will default to this.walletAddress if not provided
|
|
601
|
+
* @param {string} [params.type] wallet type, ['spot', 'swap'], defaults to swap
|
|
602
|
+
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
603
|
+
*/
|
|
592
604
|
async fetchBalance(params = {}) {
|
|
593
|
-
/**
|
|
594
|
-
* @method
|
|
595
|
-
* @name hyperliquid#fetchBalance
|
|
596
|
-
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
597
|
-
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/spot#retrieve-a-users-token-balances
|
|
598
|
-
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-users-perpetuals-account-summary
|
|
599
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
600
|
-
* @param {string} [params.user] user address, will default to this.walletAddress if not provided
|
|
601
|
-
* @param {string} [params.type] wallet type, ['spot', 'swap'], defaults to swap
|
|
602
|
-
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
603
|
-
*/
|
|
604
605
|
let userAddress = undefined;
|
|
605
606
|
[userAddress, params] = this.handlePublicAddress('fetchBalance', params);
|
|
606
607
|
let type = undefined;
|
|
@@ -675,17 +676,17 @@ export default class hyperliquid extends Exchange {
|
|
|
675
676
|
result['datetime'] = this.iso8601(timestamp);
|
|
676
677
|
return this.safeBalance(result);
|
|
677
678
|
}
|
|
679
|
+
/**
|
|
680
|
+
* @method
|
|
681
|
+
* @name hyperliquid#fetchOrderBook
|
|
682
|
+
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
683
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#l2-book-snapshot
|
|
684
|
+
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
685
|
+
* @param {int} [limit] the maximum amount of order book entries to return
|
|
686
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
687
|
+
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
688
|
+
*/
|
|
678
689
|
async fetchOrderBook(symbol, limit = undefined, params = {}) {
|
|
679
|
-
/**
|
|
680
|
-
* @method
|
|
681
|
-
* @name hyperliquid#fetchOrderBook
|
|
682
|
-
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
683
|
-
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#l2-book-snapshot
|
|
684
|
-
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
685
|
-
* @param {int} [limit] the maximum amount of order book entries to return
|
|
686
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
687
|
-
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
688
|
-
*/
|
|
689
690
|
await this.loadMarkets();
|
|
690
691
|
const market = this.market(symbol);
|
|
691
692
|
const request = {
|
|
@@ -723,17 +724,17 @@ export default class hyperliquid extends Exchange {
|
|
|
723
724
|
const timestamp = this.safeInteger(response, 'time');
|
|
724
725
|
return this.parseOrderBook(result, market['symbol'], timestamp, 'bids', 'asks', 'px', 'sz');
|
|
725
726
|
}
|
|
727
|
+
/**
|
|
728
|
+
* @method
|
|
729
|
+
* @name hyperliquid#fetchTickers
|
|
730
|
+
* @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
|
731
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-perpetuals-asset-contexts-includes-mark-price-current-funding-open-interest-etc
|
|
732
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/spot#retrieve-spot-asset-contexts
|
|
733
|
+
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
734
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
735
|
+
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
736
|
+
*/
|
|
726
737
|
async fetchTickers(symbols = undefined, params = {}) {
|
|
727
|
-
/**
|
|
728
|
-
* @method
|
|
729
|
-
* @name hyperliquid#fetchTickers
|
|
730
|
-
* @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
|
731
|
-
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-perpetuals-asset-contexts-includes-mark-price-current-funding-open-interest-etc
|
|
732
|
-
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/spot#retrieve-spot-asset-contexts
|
|
733
|
-
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
734
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
735
|
-
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
736
|
-
*/
|
|
737
738
|
await this.loadMarkets();
|
|
738
739
|
symbols = this.marketSymbols(symbols);
|
|
739
740
|
// at this stage, to get tickers data, we use fetchMarkets endpoints
|
|
@@ -749,15 +750,16 @@ export default class hyperliquid extends Exchange {
|
|
|
749
750
|
}
|
|
750
751
|
return this.filterByArrayTickers(result, 'symbol', symbols);
|
|
751
752
|
}
|
|
753
|
+
/**
|
|
754
|
+
* @method
|
|
755
|
+
* @name hyperliquid#fetchFundingRates
|
|
756
|
+
* @description retrieves data on all swap markets for hyperliquid
|
|
757
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-perpetuals-asset-contexts-includes-mark-price-current-funding-open-interest-etc
|
|
758
|
+
* @param {string[]} [symbols] list of unified market symbols
|
|
759
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
760
|
+
* @returns {object[]} an array of objects representing market data
|
|
761
|
+
*/
|
|
752
762
|
async fetchFundingRates(symbols = undefined, params = {}) {
|
|
753
|
-
/**
|
|
754
|
-
* @method
|
|
755
|
-
* @name hyperliquid#fetchFundingRates
|
|
756
|
-
* @description retrieves data on all swap markets for hyperliquid
|
|
757
|
-
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-perpetuals-asset-contexts-includes-mark-price-current-funding-open-interest-etc
|
|
758
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
759
|
-
* @returns {object[]} an array of objects representing market data
|
|
760
|
-
*/
|
|
761
763
|
const request = {
|
|
762
764
|
'type': 'metaAndAssetCtxs',
|
|
763
765
|
};
|
|
@@ -882,20 +884,20 @@ export default class hyperliquid extends Exchange {
|
|
|
882
884
|
'info': ticker,
|
|
883
885
|
}, market);
|
|
884
886
|
}
|
|
887
|
+
/**
|
|
888
|
+
* @method
|
|
889
|
+
* @name hyperliquid#fetchOHLCV
|
|
890
|
+
* @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
891
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#candle-snapshot
|
|
892
|
+
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
893
|
+
* @param {string} timeframe the length of time each candle represents, support '1m', '15m', '1h', '1d'
|
|
894
|
+
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
895
|
+
* @param {int} [limit] the maximum amount of candles to fetch
|
|
896
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
897
|
+
* @param {int} [params.until] timestamp in ms of the latest candle to fetch
|
|
898
|
+
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
899
|
+
*/
|
|
885
900
|
async fetchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
|
|
886
|
-
/**
|
|
887
|
-
* @method
|
|
888
|
-
* @name hyperliquid#fetchOHLCV
|
|
889
|
-
* @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
890
|
-
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#candle-snapshot
|
|
891
|
-
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
892
|
-
* @param {string} timeframe the length of time each candle represents, support '1m', '15m', '1h', '1d'
|
|
893
|
-
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
894
|
-
* @param {int} [limit] the maximum amount of candles to fetch
|
|
895
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
896
|
-
* @param {int} [params.until] timestamp in ms of the latest candle to fetch
|
|
897
|
-
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
898
|
-
*/
|
|
899
901
|
await this.loadMarkets();
|
|
900
902
|
const market = this.market(symbol);
|
|
901
903
|
const until = this.safeInteger(params, 'until', this.milliseconds());
|
|
@@ -965,22 +967,22 @@ export default class hyperliquid extends Exchange {
|
|
|
965
967
|
this.safeNumber(ohlcv, 'v'),
|
|
966
968
|
];
|
|
967
969
|
}
|
|
970
|
+
/**
|
|
971
|
+
* @method
|
|
972
|
+
* @name hyperliquid#fetchTrades
|
|
973
|
+
* @description get the list of most recent trades for a particular symbol
|
|
974
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-a-users-fills
|
|
975
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-a-users-fills-by-time
|
|
976
|
+
* @param {string} symbol unified market symbol
|
|
977
|
+
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
978
|
+
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
979
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
980
|
+
* @param {int} [params.until] timestamp in ms of the latest trade
|
|
981
|
+
* @param {string} [params.address] wallet address that made trades
|
|
982
|
+
* @param {string} [params.user] wallet address that made trades
|
|
983
|
+
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
984
|
+
*/
|
|
968
985
|
async fetchTrades(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
969
|
-
/**
|
|
970
|
-
* @method
|
|
971
|
-
* @name hyperliquid#fetchTrades
|
|
972
|
-
* @description get the list of most recent trades for a particular symbol
|
|
973
|
-
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-a-users-fills
|
|
974
|
-
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-a-users-fills-by-time
|
|
975
|
-
* @param {string} symbol unified market symbol
|
|
976
|
-
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
977
|
-
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
978
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
979
|
-
* @param {int} [params.until] timestamp in ms of the latest trade
|
|
980
|
-
* @param {string} [params.address] wallet address that made trades
|
|
981
|
-
* @param {string} [params.user] wallet address that made trades
|
|
982
|
-
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
983
|
-
*/
|
|
984
986
|
let userAddress = undefined;
|
|
985
987
|
[userAddress, params] = this.handlePublicAddress('fetchTrades', params);
|
|
986
988
|
await this.loadMarkets();
|
|
@@ -1148,41 +1150,42 @@ export default class hyperliquid extends Exchange {
|
|
|
1148
1150
|
};
|
|
1149
1151
|
return this.signUserSignedAction(messageTypes, message);
|
|
1150
1152
|
}
|
|
1153
|
+
/**
|
|
1154
|
+
* @method
|
|
1155
|
+
* @name hyperliquid#createOrder
|
|
1156
|
+
* @description create a trade order
|
|
1157
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#place-an-order
|
|
1158
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
1159
|
+
* @param {string} type 'market' or 'limit'
|
|
1160
|
+
* @param {string} side 'buy' or 'sell'
|
|
1161
|
+
* @param {float} amount how much of currency you want to trade in units of base currency
|
|
1162
|
+
* @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
1163
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1164
|
+
* @param {string} [params.timeInForce] 'Gtc', 'Ioc', 'Alo'
|
|
1165
|
+
* @param {bool} [params.postOnly] true or false whether the order is post-only
|
|
1166
|
+
* @param {bool} [params.reduceOnly] true or false whether the order is reduce-only
|
|
1167
|
+
* @param {float} [params.triggerPrice] The price at which a trigger order is triggered at
|
|
1168
|
+
* @param {string} [params.clientOrderId] client order id, (optional 128 bit hex string e.g. 0x1234567890abcdef1234567890abcdef)
|
|
1169
|
+
* @param {string} [params.slippage] the slippage for market order
|
|
1170
|
+
* @param {string} [params.vaultAddress] the vault address for order
|
|
1171
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1172
|
+
*/
|
|
1151
1173
|
async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
|
|
1152
|
-
/**
|
|
1153
|
-
* @method
|
|
1154
|
-
* @name hyperliquid#createOrder
|
|
1155
|
-
* @description create a trade order
|
|
1156
|
-
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#place-an-order
|
|
1157
|
-
* @param {string} symbol unified symbol of the market to create an order in
|
|
1158
|
-
* @param {string} type 'market' or 'limit'
|
|
1159
|
-
* @param {string} side 'buy' or 'sell'
|
|
1160
|
-
* @param {float} amount how much of currency you want to trade in units of base currency
|
|
1161
|
-
* @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
1162
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1163
|
-
* @param {string} [params.timeInForce] 'Gtc', 'Ioc', 'Alo'
|
|
1164
|
-
* @param {bool} [params.postOnly] true or false whether the order is post-only
|
|
1165
|
-
* @param {bool} [params.reduceOnly] true or false whether the order is reduce-only
|
|
1166
|
-
* @param {float} [params.triggerPrice] The price at which a trigger order is triggered at
|
|
1167
|
-
* @param {string} [params.clientOrderId] client order id, (optional 128 bit hex string e.g. 0x1234567890abcdef1234567890abcdef)
|
|
1168
|
-
* @param {string} [params.slippage] the slippage for market order
|
|
1169
|
-
* @param {string} [params.vaultAddress] the vault address for order
|
|
1170
|
-
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1171
|
-
*/
|
|
1172
1174
|
await this.loadMarkets();
|
|
1173
1175
|
const [order, globalParams] = this.parseCreateOrderArgs(symbol, type, side, amount, price, params);
|
|
1174
1176
|
const orders = await this.createOrders([order], globalParams);
|
|
1175
1177
|
return orders[0];
|
|
1176
1178
|
}
|
|
1179
|
+
/**
|
|
1180
|
+
* @method
|
|
1181
|
+
* @name hyperliquid#createOrders
|
|
1182
|
+
* @description create a list of trade orders
|
|
1183
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#place-an-order
|
|
1184
|
+
* @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
|
|
1185
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1186
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1187
|
+
*/
|
|
1177
1188
|
async createOrders(orders, params = {}) {
|
|
1178
|
-
/**
|
|
1179
|
-
* @method
|
|
1180
|
-
* @name hyperliquid#createOrders
|
|
1181
|
-
* @description create a list of trade orders
|
|
1182
|
-
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#place-an-order
|
|
1183
|
-
* @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
|
|
1184
|
-
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1185
|
-
*/
|
|
1186
1189
|
await this.loadMarkets();
|
|
1187
1190
|
const request = this.createOrdersRequest(orders, params);
|
|
1188
1191
|
const response = await this.privatePostExchange(request);
|
|
@@ -1339,37 +1342,37 @@ export default class hyperliquid extends Exchange {
|
|
|
1339
1342
|
}
|
|
1340
1343
|
return request;
|
|
1341
1344
|
}
|
|
1345
|
+
/**
|
|
1346
|
+
* @method
|
|
1347
|
+
* @name hyperliquid#cancelOrder
|
|
1348
|
+
* @description cancels an open order
|
|
1349
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#cancel-order-s
|
|
1350
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#cancel-order-s-by-cloid
|
|
1351
|
+
* @param {string} id order id
|
|
1352
|
+
* @param {string} symbol unified symbol of the market the order was made in
|
|
1353
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1354
|
+
* @param {string} [params.clientOrderId] client order id, (optional 128 bit hex string e.g. 0x1234567890abcdef1234567890abcdef)
|
|
1355
|
+
* @param {string} [params.vaultAddress] the vault address for order
|
|
1356
|
+
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1357
|
+
*/
|
|
1342
1358
|
async cancelOrder(id, symbol = undefined, params = {}) {
|
|
1343
|
-
/**
|
|
1344
|
-
* @method
|
|
1345
|
-
* @name hyperliquid#cancelOrder
|
|
1346
|
-
* @description cancels an open order
|
|
1347
|
-
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#cancel-order-s
|
|
1348
|
-
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#cancel-order-s-by-cloid
|
|
1349
|
-
* @param {string} id order id
|
|
1350
|
-
* @param {string} symbol unified symbol of the market the order was made in
|
|
1351
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1352
|
-
* @param {string} [params.clientOrderId] client order id, (optional 128 bit hex string e.g. 0x1234567890abcdef1234567890abcdef)
|
|
1353
|
-
* @param {string} [params.vaultAddress] the vault address for order
|
|
1354
|
-
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1355
|
-
*/
|
|
1356
1359
|
const orders = await this.cancelOrders([id], symbol, params);
|
|
1357
1360
|
return this.safeDict(orders, 0);
|
|
1358
1361
|
}
|
|
1362
|
+
/**
|
|
1363
|
+
* @method
|
|
1364
|
+
* @name hyperliquid#cancelOrders
|
|
1365
|
+
* @description cancel multiple orders
|
|
1366
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#cancel-order-s
|
|
1367
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#cancel-order-s-by-cloid
|
|
1368
|
+
* @param {string[]} ids order ids
|
|
1369
|
+
* @param {string} [symbol] unified market symbol
|
|
1370
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1371
|
+
* @param {string|string[]} [params.clientOrderId] client order ids, (optional 128 bit hex string e.g. 0x1234567890abcdef1234567890abcdef)
|
|
1372
|
+
* @param {string} [params.vaultAddress] the vault address
|
|
1373
|
+
* @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1374
|
+
*/
|
|
1359
1375
|
async cancelOrders(ids, symbol = undefined, params = {}) {
|
|
1360
|
-
/**
|
|
1361
|
-
* @method
|
|
1362
|
-
* @name hyperliquid#cancelOrders
|
|
1363
|
-
* @description cancel multiple orders
|
|
1364
|
-
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#cancel-order-s
|
|
1365
|
-
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#cancel-order-s-by-cloid
|
|
1366
|
-
* @param {string[]} ids order ids
|
|
1367
|
-
* @param {string} [symbol] unified market symbol
|
|
1368
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1369
|
-
* @param {string|string[]} [params.clientOrderId] client order ids, (optional 128 bit hex string e.g. 0x1234567890abcdef1234567890abcdef)
|
|
1370
|
-
* @param {string} [params.vaultAddress] the vault address
|
|
1371
|
-
* @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1372
|
-
*/
|
|
1373
1376
|
this.checkRequiredCredentials();
|
|
1374
1377
|
if (symbol === undefined) {
|
|
1375
1378
|
throw new ArgumentsRequired(this.id + ' cancelOrders() requires a symbol argument');
|
|
@@ -1446,18 +1449,18 @@ export default class hyperliquid extends Exchange {
|
|
|
1446
1449
|
}
|
|
1447
1450
|
return orders;
|
|
1448
1451
|
}
|
|
1452
|
+
/**
|
|
1453
|
+
* @method
|
|
1454
|
+
* @name hyperliquid#cancelOrdersForSymbols
|
|
1455
|
+
* @description cancel multiple orders for multiple symbols
|
|
1456
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#cancel-order-s
|
|
1457
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#cancel-order-s-by-cloid
|
|
1458
|
+
* @param {CancellationRequest[]} orders each order should contain the parameters required by cancelOrder namely id and symbol, example [{"id": "a", "symbol": "BTC/USDT"}, {"id": "b", "symbol": "ETH/USDT"}]
|
|
1459
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1460
|
+
* @param {string} [params.vaultAddress] the vault address
|
|
1461
|
+
* @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1462
|
+
*/
|
|
1449
1463
|
async cancelOrdersForSymbols(orders, params = {}) {
|
|
1450
|
-
/**
|
|
1451
|
-
* @method
|
|
1452
|
-
* @name hyperliquid#cancelOrdersForSymbols
|
|
1453
|
-
* @description cancel multiple orders for multiple symbols
|
|
1454
|
-
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#cancel-order-s
|
|
1455
|
-
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#cancel-order-s-by-cloid
|
|
1456
|
-
* @param {CancellationRequest[]} orders each order should contain the parameters required by cancelOrder namely id and symbol, example [{"id": "a", "symbol": "BTC/USDT"}, {"id": "b", "symbol": "ETH/USDT"}]
|
|
1457
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1458
|
-
* @param {string} [params.vaultAddress] the vault address
|
|
1459
|
-
* @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1460
|
-
*/
|
|
1461
1464
|
this.checkRequiredCredentials();
|
|
1462
1465
|
await this.loadMarkets();
|
|
1463
1466
|
const nonce = this.milliseconds();
|
|
@@ -1519,16 +1522,16 @@ export default class hyperliquid extends Exchange {
|
|
|
1519
1522
|
//
|
|
1520
1523
|
return response;
|
|
1521
1524
|
}
|
|
1525
|
+
/**
|
|
1526
|
+
* @method
|
|
1527
|
+
* @name hyperliquid#cancelAllOrdersAfter
|
|
1528
|
+
* @description dead man's switch, cancel all orders after the given timeout
|
|
1529
|
+
* @param {number} timeout time in milliseconds, 0 represents cancel the timer
|
|
1530
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1531
|
+
* @param {string} [params.vaultAddress] the vault address
|
|
1532
|
+
* @returns {object} the api result
|
|
1533
|
+
*/
|
|
1522
1534
|
async cancelAllOrdersAfter(timeout, params = {}) {
|
|
1523
|
-
/**
|
|
1524
|
-
* @method
|
|
1525
|
-
* @name hyperliquid#cancelAllOrdersAfter
|
|
1526
|
-
* @description dead man's switch, cancel all orders after the given timeout
|
|
1527
|
-
* @param {number} timeout time in milliseconds, 0 represents cancel the timer
|
|
1528
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1529
|
-
* @param {string} [params.vaultAddress] the vault address
|
|
1530
|
-
* @returns {object} the api result
|
|
1531
|
-
*/
|
|
1532
1535
|
this.checkRequiredCredentials();
|
|
1533
1536
|
await this.loadMarkets();
|
|
1534
1537
|
params = this.omit(params, ['clientOrderId', 'client_id']);
|
|
@@ -1651,28 +1654,28 @@ export default class hyperliquid extends Exchange {
|
|
|
1651
1654
|
}
|
|
1652
1655
|
return request;
|
|
1653
1656
|
}
|
|
1657
|
+
/**
|
|
1658
|
+
* @method
|
|
1659
|
+
* @name hyperliquid#editOrder
|
|
1660
|
+
* @description edit a trade order
|
|
1661
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#modify-an-order
|
|
1662
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#modify-multiple-orders
|
|
1663
|
+
* @param {string} id cancel order id
|
|
1664
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
1665
|
+
* @param {string} type 'market' or 'limit'
|
|
1666
|
+
* @param {string} side 'buy' or 'sell'
|
|
1667
|
+
* @param {float} amount how much of currency you want to trade in units of base currency
|
|
1668
|
+
* @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
1669
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1670
|
+
* @param {string} [params.timeInForce] 'Gtc', 'Ioc', 'Alo'
|
|
1671
|
+
* @param {bool} [params.postOnly] true or false whether the order is post-only
|
|
1672
|
+
* @param {bool} [params.reduceOnly] true or false whether the order is reduce-only
|
|
1673
|
+
* @param {float} [params.triggerPrice] The price at which a trigger order is triggered at
|
|
1674
|
+
* @param {string} [params.clientOrderId] client order id, (optional 128 bit hex string e.g. 0x1234567890abcdef1234567890abcdef)
|
|
1675
|
+
* @param {string} [params.vaultAddress] the vault address for order
|
|
1676
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1677
|
+
*/
|
|
1654
1678
|
async editOrder(id, symbol, type, side, amount = undefined, price = undefined, params = {}) {
|
|
1655
|
-
/**
|
|
1656
|
-
* @method
|
|
1657
|
-
* @name hyperliquid#editOrder
|
|
1658
|
-
* @description edit a trade order
|
|
1659
|
-
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#modify-an-order
|
|
1660
|
-
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#modify-multiple-orders
|
|
1661
|
-
* @param {string} id cancel order id
|
|
1662
|
-
* @param {string} symbol unified symbol of the market to create an order in
|
|
1663
|
-
* @param {string} type 'market' or 'limit'
|
|
1664
|
-
* @param {string} side 'buy' or 'sell'
|
|
1665
|
-
* @param {float} amount how much of currency you want to trade in units of base currency
|
|
1666
|
-
* @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
1667
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1668
|
-
* @param {string} [params.timeInForce] 'Gtc', 'Ioc', 'Alo'
|
|
1669
|
-
* @param {bool} [params.postOnly] true or false whether the order is post-only
|
|
1670
|
-
* @param {bool} [params.reduceOnly] true or false whether the order is reduce-only
|
|
1671
|
-
* @param {float} [params.triggerPrice] The price at which a trigger order is triggered at
|
|
1672
|
-
* @param {string} [params.clientOrderId] client order id, (optional 128 bit hex string e.g. 0x1234567890abcdef1234567890abcdef)
|
|
1673
|
-
* @param {string} [params.vaultAddress] the vault address for order
|
|
1674
|
-
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1675
|
-
*/
|
|
1676
1679
|
await this.loadMarkets();
|
|
1677
1680
|
const market = this.market(symbol);
|
|
1678
1681
|
const request = this.editOrderRequest(id, symbol, type, side, amount, price, params);
|
|
@@ -1718,19 +1721,19 @@ export default class hyperliquid extends Exchange {
|
|
|
1718
1721
|
const first = this.safeDict(statuses, 0, {});
|
|
1719
1722
|
return this.parseOrder(first, market);
|
|
1720
1723
|
}
|
|
1724
|
+
/**
|
|
1725
|
+
* @method
|
|
1726
|
+
* @name hyperliquid#fetchFundingRateHistory
|
|
1727
|
+
* @description fetches historical funding rate prices
|
|
1728
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-historical-funding-rates
|
|
1729
|
+
* @param {string} symbol unified symbol of the market to fetch the funding rate history for
|
|
1730
|
+
* @param {int} [since] timestamp in ms of the earliest funding rate to fetch
|
|
1731
|
+
* @param {int} [limit] the maximum amount of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure} to fetch
|
|
1732
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1733
|
+
* @param {int} [params.until] timestamp in ms of the latest funding rate
|
|
1734
|
+
* @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure}
|
|
1735
|
+
*/
|
|
1721
1736
|
async fetchFundingRateHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
1722
|
-
/**
|
|
1723
|
-
* @method
|
|
1724
|
-
* @name hyperliquid#fetchFundingRateHistory
|
|
1725
|
-
* @description fetches historical funding rate prices
|
|
1726
|
-
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-historical-funding-rates
|
|
1727
|
-
* @param {string} symbol unified symbol of the market to fetch the funding rate history for
|
|
1728
|
-
* @param {int} [since] timestamp in ms of the earliest funding rate to fetch
|
|
1729
|
-
* @param {int} [limit] the maximum amount of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure} to fetch
|
|
1730
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1731
|
-
* @param {int} [params.until] timestamp in ms of the latest funding rate
|
|
1732
|
-
* @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure}
|
|
1733
|
-
*/
|
|
1734
1737
|
await this.loadMarkets();
|
|
1735
1738
|
const market = this.market(symbol);
|
|
1736
1739
|
const request = {
|
|
@@ -1775,20 +1778,20 @@ export default class hyperliquid extends Exchange {
|
|
|
1775
1778
|
const sorted = this.sortBy(result, 'timestamp');
|
|
1776
1779
|
return this.filterBySymbolSinceLimit(sorted, symbol, since, limit);
|
|
1777
1780
|
}
|
|
1781
|
+
/**
|
|
1782
|
+
* @method
|
|
1783
|
+
* @name hyperliquid#fetchOpenOrders
|
|
1784
|
+
* @description fetch all unfilled currently open orders
|
|
1785
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-a-users-open-orders
|
|
1786
|
+
* @param {string} symbol unified market symbol
|
|
1787
|
+
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
1788
|
+
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
1789
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1790
|
+
* @param {string} [params.user] user address, will default to this.walletAddress if not provided
|
|
1791
|
+
* @param {string} [params.method] 'openOrders' or 'frontendOpenOrders' default is 'frontendOpenOrders'
|
|
1792
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1793
|
+
*/
|
|
1778
1794
|
async fetchOpenOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
1779
|
-
/**
|
|
1780
|
-
* @method
|
|
1781
|
-
* @name hyperliquid#fetchOpenOrders
|
|
1782
|
-
* @description fetch all unfilled currently open orders
|
|
1783
|
-
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-a-users-open-orders
|
|
1784
|
-
* @param {string} symbol unified market symbol
|
|
1785
|
-
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
1786
|
-
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
1787
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1788
|
-
* @param {string} [params.user] user address, will default to this.walletAddress if not provided
|
|
1789
|
-
* @param {string} [params.method] 'openOrders' or 'frontendOpenOrders' default is 'frontendOpenOrders'
|
|
1790
|
-
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1791
|
-
*/
|
|
1792
1795
|
let userAddress = undefined;
|
|
1793
1796
|
[userAddress, params] = this.handlePublicAddress('fetchOpenOrders', params);
|
|
1794
1797
|
let method = undefined;
|
|
@@ -1824,69 +1827,69 @@ export default class hyperliquid extends Exchange {
|
|
|
1824
1827
|
}
|
|
1825
1828
|
return this.parseOrders(orderWithStatus, market, since, limit);
|
|
1826
1829
|
}
|
|
1830
|
+
/**
|
|
1831
|
+
* @method
|
|
1832
|
+
* @name hyperliquid#fetchClosedOrders
|
|
1833
|
+
* @description fetch all unfilled currently closed orders
|
|
1834
|
+
* @param {string} symbol unified market symbol
|
|
1835
|
+
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
1836
|
+
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
1837
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1838
|
+
* @param {string} [params.user] user address, will default to this.walletAddress if not provided
|
|
1839
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1840
|
+
*/
|
|
1827
1841
|
async fetchClosedOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
1828
|
-
/**
|
|
1829
|
-
* @method
|
|
1830
|
-
* @name hyperliquid#fetchClosedOrders
|
|
1831
|
-
* @description fetch all unfilled currently closed orders
|
|
1832
|
-
* @param {string} symbol unified market symbol
|
|
1833
|
-
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
1834
|
-
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
1835
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1836
|
-
* @param {string} [params.user] user address, will default to this.walletAddress if not provided
|
|
1837
|
-
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1838
|
-
*/
|
|
1839
1842
|
await this.loadMarkets();
|
|
1840
1843
|
const orders = await this.fetchOrders(symbol, undefined, undefined, params); // don't filter here because we don't want to catch open orders
|
|
1841
1844
|
const closedOrders = this.filterByArray(orders, 'status', ['closed'], false);
|
|
1842
1845
|
return this.filterBySymbolSinceLimit(closedOrders, symbol, since, limit);
|
|
1843
1846
|
}
|
|
1847
|
+
/**
|
|
1848
|
+
* @method
|
|
1849
|
+
* @name hyperliquid#fetchCanceledOrders
|
|
1850
|
+
* @description fetch all canceled orders
|
|
1851
|
+
* @param {string} symbol unified market symbol
|
|
1852
|
+
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
1853
|
+
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
1854
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1855
|
+
* @param {string} [params.user] user address, will default to this.walletAddress if not provided
|
|
1856
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1857
|
+
*/
|
|
1844
1858
|
async fetchCanceledOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
1845
|
-
/**
|
|
1846
|
-
* @method
|
|
1847
|
-
* @name hyperliquid#fetchCanceledOrders
|
|
1848
|
-
* @description fetch all canceled orders
|
|
1849
|
-
* @param {string} symbol unified market symbol
|
|
1850
|
-
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
1851
|
-
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
1852
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1853
|
-
* @param {string} [params.user] user address, will default to this.walletAddress if not provided
|
|
1854
|
-
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1855
|
-
*/
|
|
1856
1859
|
await this.loadMarkets();
|
|
1857
1860
|
const orders = await this.fetchOrders(symbol, undefined, undefined, params); // don't filter here because we don't want to catch open orders
|
|
1858
1861
|
const closedOrders = this.filterByArray(orders, 'status', ['canceled'], false);
|
|
1859
1862
|
return this.filterBySymbolSinceLimit(closedOrders, symbol, since, limit);
|
|
1860
1863
|
}
|
|
1864
|
+
/**
|
|
1865
|
+
* @method
|
|
1866
|
+
* @name hyperliquid#fetchCanceledAndClosedOrders
|
|
1867
|
+
* @description fetch all closed and canceled orders
|
|
1868
|
+
* @param {string} symbol unified market symbol
|
|
1869
|
+
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
1870
|
+
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
1871
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1872
|
+
* @param {string} [params.user] user address, will default to this.walletAddress if not provided
|
|
1873
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1874
|
+
*/
|
|
1861
1875
|
async fetchCanceledAndClosedOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
1862
|
-
/**
|
|
1863
|
-
* @method
|
|
1864
|
-
* @name hyperliquid#fetchCanceledAndClosedOrders
|
|
1865
|
-
* @description fetch all closed and canceled orders
|
|
1866
|
-
* @param {string} symbol unified market symbol
|
|
1867
|
-
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
1868
|
-
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
1869
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1870
|
-
* @param {string} [params.user] user address, will default to this.walletAddress if not provided
|
|
1871
|
-
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1872
|
-
*/
|
|
1873
1876
|
await this.loadMarkets();
|
|
1874
1877
|
const orders = await this.fetchOrders(symbol, undefined, undefined, params); // don't filter here because we don't want to catch open orders
|
|
1875
1878
|
const closedOrders = this.filterByArray(orders, 'status', ['canceled', 'closed', 'rejected'], false);
|
|
1876
1879
|
return this.filterBySymbolSinceLimit(closedOrders, symbol, since, limit);
|
|
1877
1880
|
}
|
|
1881
|
+
/**
|
|
1882
|
+
* @method
|
|
1883
|
+
* @name hyperliquid#fetchOrders
|
|
1884
|
+
* @description fetch all orders
|
|
1885
|
+
* @param {string} symbol unified market symbol
|
|
1886
|
+
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
1887
|
+
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
1888
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1889
|
+
* @param {string} [params.user] user address, will default to this.walletAddress if not provided
|
|
1890
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1891
|
+
*/
|
|
1878
1892
|
async fetchOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
1879
|
-
/**
|
|
1880
|
-
* @method
|
|
1881
|
-
* @name hyperliquid#fetchOrders
|
|
1882
|
-
* @description fetch all orders
|
|
1883
|
-
* @param {string} symbol unified market symbol
|
|
1884
|
-
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
1885
|
-
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
1886
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1887
|
-
* @param {string} [params.user] user address, will default to this.walletAddress if not provided
|
|
1888
|
-
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1889
|
-
*/
|
|
1890
1893
|
let userAddress = undefined;
|
|
1891
1894
|
[userAddress, params] = this.handlePublicAddress('fetchOrders', params);
|
|
1892
1895
|
await this.loadMarkets();
|
|
@@ -1911,17 +1914,18 @@ export default class hyperliquid extends Exchange {
|
|
|
1911
1914
|
//
|
|
1912
1915
|
return this.parseOrders(response, market, since, limit);
|
|
1913
1916
|
}
|
|
1917
|
+
/**
|
|
1918
|
+
* @method
|
|
1919
|
+
* @name hyperliquid#fetchOrder
|
|
1920
|
+
* @description fetches information on an order made by the user
|
|
1921
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#query-order-status-by-oid-or-cloid
|
|
1922
|
+
* @param {string} id order id
|
|
1923
|
+
* @param {string} symbol unified symbol of the market the order was made in
|
|
1924
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1925
|
+
* @param {string} [params.user] user address, will default to this.walletAddress if not provided
|
|
1926
|
+
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1927
|
+
*/
|
|
1914
1928
|
async fetchOrder(id, symbol = undefined, params = {}) {
|
|
1915
|
-
/**
|
|
1916
|
-
* @method
|
|
1917
|
-
* @name hyperliquid#fetchOrder
|
|
1918
|
-
* @description fetches information on an order made by the user
|
|
1919
|
-
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#query-order-status-by-oid-or-cloid
|
|
1920
|
-
* @param {string} symbol unified symbol of the market the order was made in
|
|
1921
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1922
|
-
* @param {string} [params.user] user address, will default to this.walletAddress if not provided
|
|
1923
|
-
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
1924
|
-
*/
|
|
1925
1929
|
let userAddress = undefined;
|
|
1926
1930
|
[userAddress, params] = this.handlePublicAddress('fetchOrder', params);
|
|
1927
1931
|
await this.loadMarkets();
|
|
@@ -2124,20 +2128,20 @@ export default class hyperliquid extends Exchange {
|
|
|
2124
2128
|
};
|
|
2125
2129
|
return this.safeString(statuses, status, status);
|
|
2126
2130
|
}
|
|
2131
|
+
/**
|
|
2132
|
+
* @method
|
|
2133
|
+
* @name hyperliquid#fetchMyTrades
|
|
2134
|
+
* @description fetch all trades made by the user
|
|
2135
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-a-users-fills
|
|
2136
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-a-users-fills-by-time
|
|
2137
|
+
* @param {string} symbol unified market symbol
|
|
2138
|
+
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
2139
|
+
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
2140
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2141
|
+
* @param {int} [params.until] timestamp in ms of the latest trade
|
|
2142
|
+
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
2143
|
+
*/
|
|
2127
2144
|
async fetchMyTrades(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
2128
|
-
/**
|
|
2129
|
-
* @method
|
|
2130
|
-
* @name hyperliquid#fetchMyTrades
|
|
2131
|
-
* @description fetch all trades made by the user
|
|
2132
|
-
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-a-users-fills
|
|
2133
|
-
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint#retrieve-a-users-fills-by-time
|
|
2134
|
-
* @param {string} symbol unified market symbol
|
|
2135
|
-
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
2136
|
-
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
2137
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2138
|
-
* @param {int} [params.until] timestamp in ms of the latest trade
|
|
2139
|
-
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
2140
|
-
*/
|
|
2141
2145
|
let userAddress = undefined;
|
|
2142
2146
|
[userAddress, params] = this.handlePublicAddress('fetchMyTrades', params);
|
|
2143
2147
|
await this.loadMarkets();
|
|
@@ -2233,31 +2237,31 @@ export default class hyperliquid extends Exchange {
|
|
|
2233
2237
|
},
|
|
2234
2238
|
}, market);
|
|
2235
2239
|
}
|
|
2240
|
+
/**
|
|
2241
|
+
* @method
|
|
2242
|
+
* @name hyperliquid#fetchPosition
|
|
2243
|
+
* @description fetch data on an open position
|
|
2244
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-users-perpetuals-account-summary
|
|
2245
|
+
* @param {string} symbol unified market symbol of the market the position is held in
|
|
2246
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2247
|
+
* @param {string} [params.user] user address, will default to this.walletAddress if not provided
|
|
2248
|
+
* @returns {object} a [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
2249
|
+
*/
|
|
2236
2250
|
async fetchPosition(symbol, params = {}) {
|
|
2237
|
-
/**
|
|
2238
|
-
* @method
|
|
2239
|
-
* @name hyperliquid#fetchPosition
|
|
2240
|
-
* @description fetch data on an open position
|
|
2241
|
-
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-users-perpetuals-account-summary
|
|
2242
|
-
* @param {string} symbol unified market symbol of the market the position is held in
|
|
2243
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2244
|
-
* @param {string} [params.user] user address, will default to this.walletAddress if not provided
|
|
2245
|
-
* @returns {object} a [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
2246
|
-
*/
|
|
2247
2251
|
const positions = await this.fetchPositions([symbol], params);
|
|
2248
2252
|
return this.safeDict(positions, 0, {});
|
|
2249
2253
|
}
|
|
2254
|
+
/**
|
|
2255
|
+
* @method
|
|
2256
|
+
* @name hyperliquid#fetchPositions
|
|
2257
|
+
* @description fetch all open positions
|
|
2258
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-users-perpetuals-account-summary
|
|
2259
|
+
* @param {string[]} [symbols] list of unified market symbols
|
|
2260
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2261
|
+
* @param {string} [params.user] user address, will default to this.walletAddress if not provided
|
|
2262
|
+
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
2263
|
+
*/
|
|
2250
2264
|
async fetchPositions(symbols = undefined, params = {}) {
|
|
2251
|
-
/**
|
|
2252
|
-
* @method
|
|
2253
|
-
* @name hyperliquid#fetchPositions
|
|
2254
|
-
* @description fetch all open positions
|
|
2255
|
-
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/info-endpoint/perpetuals#retrieve-users-perpetuals-account-summary
|
|
2256
|
-
* @param {string[]} [symbols] list of unified market symbols
|
|
2257
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2258
|
-
* @param {string} [params.user] user address, will default to this.walletAddress if not provided
|
|
2259
|
-
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
2260
|
-
*/
|
|
2261
2265
|
await this.loadMarkets();
|
|
2262
2266
|
let userAddress = undefined;
|
|
2263
2267
|
[userAddress, params] = this.handlePublicAddress('fetchPositions', params);
|
|
@@ -2391,17 +2395,17 @@ export default class hyperliquid extends Exchange {
|
|
|
2391
2395
|
'percentage': this.parseNumber(percentage),
|
|
2392
2396
|
});
|
|
2393
2397
|
}
|
|
2398
|
+
/**
|
|
2399
|
+
* @method
|
|
2400
|
+
* @name hyperliquid#setMarginMode
|
|
2401
|
+
* @description set margin mode (symbol)
|
|
2402
|
+
* @param {string} marginMode margin mode must be either [isolated, cross]
|
|
2403
|
+
* @param {string} symbol unified market symbol of the market the position is held in, default is undefined
|
|
2404
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2405
|
+
* @param {string} [params.leverage] the rate of leverage, is required if setting trade mode (symbol)
|
|
2406
|
+
* @returns {object} response from the exchange
|
|
2407
|
+
*/
|
|
2394
2408
|
async setMarginMode(marginMode, symbol = undefined, params = {}) {
|
|
2395
|
-
/**
|
|
2396
|
-
* @method
|
|
2397
|
-
* @name hyperliquid#setMarginMode
|
|
2398
|
-
* @description set margin mode (symbol)
|
|
2399
|
-
* @param {string} marginMode margin mode must be either [isolated, cross]
|
|
2400
|
-
* @param {string} symbol unified market symbol of the market the position is held in, default is undefined
|
|
2401
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2402
|
-
* @param {string} [params.leverage] the rate of leverage, is required if setting trade mode (symbol)
|
|
2403
|
-
* @returns {object} response from the exchange
|
|
2404
|
-
*/
|
|
2405
2409
|
if (symbol === undefined) {
|
|
2406
2410
|
throw new ArgumentsRequired(this.id + ' setMarginMode() requires a symbol argument');
|
|
2407
2411
|
}
|
|
@@ -2449,17 +2453,17 @@ export default class hyperliquid extends Exchange {
|
|
|
2449
2453
|
//
|
|
2450
2454
|
return response;
|
|
2451
2455
|
}
|
|
2456
|
+
/**
|
|
2457
|
+
* @method
|
|
2458
|
+
* @name hyperliquid#setLeverage
|
|
2459
|
+
* @description set the level of leverage for a market
|
|
2460
|
+
* @param {float} leverage the rate of leverage
|
|
2461
|
+
* @param {string} symbol unified market symbol
|
|
2462
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2463
|
+
* @param {string} [params.marginMode] margin mode must be either [isolated, cross], default is cross
|
|
2464
|
+
* @returns {object} response from the exchange
|
|
2465
|
+
*/
|
|
2452
2466
|
async setLeverage(leverage, symbol = undefined, params = {}) {
|
|
2453
|
-
/**
|
|
2454
|
-
* @method
|
|
2455
|
-
* @name hyperliquid#setLeverage
|
|
2456
|
-
* @description set the level of leverage for a market
|
|
2457
|
-
* @param {float} leverage the rate of leverage
|
|
2458
|
-
* @param {string} symbol unified market symbol
|
|
2459
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2460
|
-
* @param {string} [params.marginMode] margin mode must be either [isolated, cross], default is cross
|
|
2461
|
-
* @returns {object} response from the exchange
|
|
2462
|
-
*/
|
|
2463
2467
|
if (symbol === undefined) {
|
|
2464
2468
|
throw new ArgumentsRequired(this.id + ' setLeverage() requires a symbol argument');
|
|
2465
2469
|
}
|
|
@@ -2499,30 +2503,30 @@ export default class hyperliquid extends Exchange {
|
|
|
2499
2503
|
//
|
|
2500
2504
|
return response;
|
|
2501
2505
|
}
|
|
2506
|
+
/**
|
|
2507
|
+
* @method
|
|
2508
|
+
* @name hyperliquid#addMargin
|
|
2509
|
+
* @description add margin
|
|
2510
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#update-isolated-margin
|
|
2511
|
+
* @param {string} symbol unified market symbol
|
|
2512
|
+
* @param {float} amount amount of margin to add
|
|
2513
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2514
|
+
* @returns {object} a [margin structure]{@link https://docs.ccxt.com/#/?id=add-margin-structure}
|
|
2515
|
+
*/
|
|
2502
2516
|
async addMargin(symbol, amount, params = {}) {
|
|
2503
|
-
/**
|
|
2504
|
-
* @method
|
|
2505
|
-
* @name hyperliquid#addMargin
|
|
2506
|
-
* @description add margin
|
|
2507
|
-
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#update-isolated-margin
|
|
2508
|
-
* @param {string} symbol unified market symbol
|
|
2509
|
-
* @param {float} amount amount of margin to add
|
|
2510
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2511
|
-
* @returns {object} a [margin structure]{@link https://docs.ccxt.com/#/?id=add-margin-structure}
|
|
2512
|
-
*/
|
|
2513
2517
|
return await this.modifyMarginHelper(symbol, amount, 'add', params);
|
|
2514
2518
|
}
|
|
2519
|
+
/**
|
|
2520
|
+
* @method
|
|
2521
|
+
* @name hyperliquid#reduceMargin
|
|
2522
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#update-isolated-margin
|
|
2523
|
+
* @description remove margin from a position
|
|
2524
|
+
* @param {string} symbol unified market symbol
|
|
2525
|
+
* @param {float} amount the amount of margin to remove
|
|
2526
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2527
|
+
* @returns {object} a [margin structure]{@link https://docs.ccxt.com/#/?id=reduce-margin-structure}
|
|
2528
|
+
*/
|
|
2515
2529
|
async reduceMargin(symbol, amount, params = {}) {
|
|
2516
|
-
/**
|
|
2517
|
-
* @method
|
|
2518
|
-
* @name hyperliquid#reduceMargin
|
|
2519
|
-
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#update-isolated-margin
|
|
2520
|
-
* @description remove margin from a position
|
|
2521
|
-
* @param {string} symbol unified market symbol
|
|
2522
|
-
* @param {float} amount the amount of margin to remove
|
|
2523
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2524
|
-
* @returns {object} a [margin structure]{@link https://docs.ccxt.com/#/?id=reduce-margin-structure}
|
|
2525
|
-
*/
|
|
2526
2530
|
return await this.modifyMarginHelper(symbol, amount, 'reduce', params);
|
|
2527
2531
|
}
|
|
2528
2532
|
async modifyMarginHelper(symbol, amount, type, params = {}) {
|
|
@@ -2584,20 +2588,20 @@ export default class hyperliquid extends Exchange {
|
|
|
2584
2588
|
'datetime': undefined,
|
|
2585
2589
|
};
|
|
2586
2590
|
}
|
|
2591
|
+
/**
|
|
2592
|
+
* @method
|
|
2593
|
+
* @name hyperliquid#transfer
|
|
2594
|
+
* @description transfer currency internally between wallets on the same account
|
|
2595
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#l1-usdc-transfer
|
|
2596
|
+
* @param {string} code unified currency code
|
|
2597
|
+
* @param {float} amount amount to transfer
|
|
2598
|
+
* @param {string} fromAccount account to transfer from *spot, swap*
|
|
2599
|
+
* @param {string} toAccount account to transfer to *swap, spot or address*
|
|
2600
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2601
|
+
* @param {string} [params.vaultAddress] the vault address for order
|
|
2602
|
+
* @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
2603
|
+
*/
|
|
2587
2604
|
async transfer(code, amount, fromAccount, toAccount, params = {}) {
|
|
2588
|
-
/**
|
|
2589
|
-
* @method
|
|
2590
|
-
* @name hyperliquid#transfer
|
|
2591
|
-
* @description transfer currency internally between wallets on the same account
|
|
2592
|
-
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#l1-usdc-transfer
|
|
2593
|
-
* @param {string} code unified currency code
|
|
2594
|
-
* @param {float} amount amount to transfer
|
|
2595
|
-
* @param {string} fromAccount account to transfer from *spot, swap*
|
|
2596
|
-
* @param {string} toAccount account to transfer to *swap, spot or address*
|
|
2597
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2598
|
-
* @param {string} [params.vaultAddress] the vault address for order
|
|
2599
|
-
* @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
2600
|
-
*/
|
|
2601
2605
|
this.checkRequiredCredentials();
|
|
2602
2606
|
await this.loadMarkets();
|
|
2603
2607
|
const isSandboxMode = this.safeBool(this.options, 'sandboxMode');
|
|
@@ -2659,21 +2663,21 @@ export default class hyperliquid extends Exchange {
|
|
|
2659
2663
|
const response = await this.privatePostExchange(request);
|
|
2660
2664
|
return response;
|
|
2661
2665
|
}
|
|
2666
|
+
/**
|
|
2667
|
+
* @method
|
|
2668
|
+
* @name hyperliquid#withdraw
|
|
2669
|
+
* @description make a withdrawal (only support USDC)
|
|
2670
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#initiate-a-withdrawal-request
|
|
2671
|
+
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#deposit-or-withdraw-from-a-vault
|
|
2672
|
+
* @param {string} code unified currency code
|
|
2673
|
+
* @param {float} amount the amount to withdraw
|
|
2674
|
+
* @param {string} address the address to withdraw to
|
|
2675
|
+
* @param {string} tag
|
|
2676
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2677
|
+
* @param {string} [params.vaultAddress] vault address withdraw from
|
|
2678
|
+
* @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
2679
|
+
*/
|
|
2662
2680
|
async withdraw(code, amount, address, tag = undefined, params = {}) {
|
|
2663
|
-
/**
|
|
2664
|
-
* @method
|
|
2665
|
-
* @name hyperliquid#withdraw
|
|
2666
|
-
* @description make a withdrawal (only support USDC)
|
|
2667
|
-
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#initiate-a-withdrawal-request
|
|
2668
|
-
* @see https://hyperliquid.gitbook.io/hyperliquid-docs/for-developers/api/exchange-endpoint#deposit-or-withdraw-from-a-vault
|
|
2669
|
-
* @param {string} code unified currency code
|
|
2670
|
-
* @param {float} amount the amount to withdraw
|
|
2671
|
-
* @param {string} address the address to withdraw to
|
|
2672
|
-
* @param {string} tag
|
|
2673
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2674
|
-
* @param {string} [params.vaultAddress] vault address withdraw from
|
|
2675
|
-
* @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
2676
|
-
*/
|
|
2677
2681
|
this.checkRequiredCredentials();
|
|
2678
2682
|
await this.loadMarkets();
|
|
2679
2683
|
this.checkAddress(address);
|
|
@@ -2776,16 +2780,16 @@ export default class hyperliquid extends Exchange {
|
|
|
2776
2780
|
'fee': fee,
|
|
2777
2781
|
};
|
|
2778
2782
|
}
|
|
2783
|
+
/**
|
|
2784
|
+
* @method
|
|
2785
|
+
* @name hyperliquid#fetchTradingFee
|
|
2786
|
+
* @description fetch the trading fees for a market
|
|
2787
|
+
* @param {string} symbol unified market symbol
|
|
2788
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2789
|
+
* @param {string} [params.user] user address, will default to this.walletAddress if not provided
|
|
2790
|
+
* @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
2791
|
+
*/
|
|
2779
2792
|
async fetchTradingFee(symbol, params = {}) {
|
|
2780
|
-
/**
|
|
2781
|
-
* @method
|
|
2782
|
-
* @name hyperliquid#fetchTradingFee
|
|
2783
|
-
* @description fetch the trading fees for a market
|
|
2784
|
-
* @param {string} symbol unified market symbol
|
|
2785
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2786
|
-
* @param {string} [params.user] user address, will default to this.walletAddress if not provided
|
|
2787
|
-
* @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
2788
|
-
*/
|
|
2789
2793
|
await this.loadMarkets();
|
|
2790
2794
|
let userAddress = undefined;
|
|
2791
2795
|
[userAddress, params] = this.handlePublicAddress('fetchTradingFee', params);
|
|
@@ -2882,18 +2886,18 @@ export default class hyperliquid extends Exchange {
|
|
|
2882
2886
|
'tierBased': undefined,
|
|
2883
2887
|
};
|
|
2884
2888
|
}
|
|
2889
|
+
/**
|
|
2890
|
+
* @method
|
|
2891
|
+
* @name hyperliquid#fetchLedger
|
|
2892
|
+
* @description fetch the history of changes, actions done by the user or operations that altered the balance of the user
|
|
2893
|
+
* @param {string} [code] unified currency code
|
|
2894
|
+
* @param {int} [since] timestamp in ms of the earliest ledger entry
|
|
2895
|
+
* @param {int} [limit] max number of ledger entries to return
|
|
2896
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2897
|
+
* @param {int} [params.until] timestamp in ms of the latest ledger entry
|
|
2898
|
+
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
|
|
2899
|
+
*/
|
|
2885
2900
|
async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
2886
|
-
/**
|
|
2887
|
-
* @method
|
|
2888
|
-
* @name hyperliquid#fetchLedger
|
|
2889
|
-
* @description fetch the history of changes, actions done by the user or operations that altered the balance of the user
|
|
2890
|
-
* @param {string} [code] unified currency code
|
|
2891
|
-
* @param {int} [since] timestamp in ms of the earliest ledger entry
|
|
2892
|
-
* @param {int} [limit] max number of ledger entries to return
|
|
2893
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2894
|
-
* @param {int} [params.until] timestamp in ms of the latest ledger entry
|
|
2895
|
-
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
|
|
2896
|
-
*/
|
|
2897
2901
|
await this.loadMarkets();
|
|
2898
2902
|
let userAddress = undefined;
|
|
2899
2903
|
[userAddress, params] = this.handlePublicAddress('fetchLedger', params);
|
|
@@ -2974,18 +2978,18 @@ export default class hyperliquid extends Exchange {
|
|
|
2974
2978
|
};
|
|
2975
2979
|
return this.safeString(ledgerType, type, type);
|
|
2976
2980
|
}
|
|
2981
|
+
/**
|
|
2982
|
+
* @method
|
|
2983
|
+
* @name hyperliquid#fetchDeposits
|
|
2984
|
+
* @description fetch all deposits made to an account
|
|
2985
|
+
* @param {string} code unified currency code
|
|
2986
|
+
* @param {int} [since] the earliest time in ms to fetch deposits for
|
|
2987
|
+
* @param {int} [limit] the maximum number of deposits structures to retrieve
|
|
2988
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2989
|
+
* @param {int} [params.until] the latest time in ms to fetch withdrawals for
|
|
2990
|
+
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
2991
|
+
*/
|
|
2977
2992
|
async fetchDeposits(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
2978
|
-
/**
|
|
2979
|
-
* @method
|
|
2980
|
-
* @name hyperliquid#fetchDeposits
|
|
2981
|
-
* @description fetch all deposits made to an account
|
|
2982
|
-
* @param {string} code unified currency code
|
|
2983
|
-
* @param {int} [since] the earliest time in ms to fetch deposits for
|
|
2984
|
-
* @param {int} [limit] the maximum number of deposits structures to retrieve
|
|
2985
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2986
|
-
* @param {int} [params.until] the latest time in ms to fetch withdrawals for
|
|
2987
|
-
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
2988
|
-
*/
|
|
2989
2993
|
await this.loadMarkets();
|
|
2990
2994
|
let userAddress = undefined;
|
|
2991
2995
|
[userAddress, params] = this.handlePublicAddress('fetchDepositsWithdrawals', params);
|
|
@@ -3019,18 +3023,18 @@ export default class hyperliquid extends Exchange {
|
|
|
3019
3023
|
const deposits = this.filterByArray(records, 'type', ['deposit'], false);
|
|
3020
3024
|
return this.parseTransactions(deposits, undefined, since, limit);
|
|
3021
3025
|
}
|
|
3026
|
+
/**
|
|
3027
|
+
* @method
|
|
3028
|
+
* @name hyperliquid#fetchWithdrawals
|
|
3029
|
+
* @description fetch all withdrawals made from an account
|
|
3030
|
+
* @param {string} code unified currency code
|
|
3031
|
+
* @param {int} [since] the earliest time in ms to fetch withdrawals for
|
|
3032
|
+
* @param {int} [limit] the maximum number of withdrawals structures to retrieve
|
|
3033
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3034
|
+
* @param {int} [params.until] the latest time in ms to fetch withdrawals for
|
|
3035
|
+
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
3036
|
+
*/
|
|
3022
3037
|
async fetchWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
3023
|
-
/**
|
|
3024
|
-
* @method
|
|
3025
|
-
* @name hyperliquid#fetchWithdrawals
|
|
3026
|
-
* @description fetch all withdrawals made from an account
|
|
3027
|
-
* @param {string} code unified currency code
|
|
3028
|
-
* @param {int} [since] the earliest time in ms to fetch withdrawals for
|
|
3029
|
-
* @param {int} [limit] the maximum number of withdrawals structures to retrieve
|
|
3030
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3031
|
-
* @param {int} [params.until] the latest time in ms to fetch withdrawals for
|
|
3032
|
-
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
3033
|
-
*/
|
|
3034
3038
|
await this.loadMarkets();
|
|
3035
3039
|
let userAddress = undefined;
|
|
3036
3040
|
[userAddress, params] = this.handlePublicAddress('fetchDepositsWithdrawals', params);
|