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/hashkey.js
CHANGED
|
@@ -82,6 +82,7 @@ export default class hashkey extends Exchange {
|
|
|
82
82
|
'fetchLeverageTiers': true,
|
|
83
83
|
'fetchMarginAdjustmentHistory': false,
|
|
84
84
|
'fetchMarginMode': false,
|
|
85
|
+
'fetchMarketLeverageTiers': 'emulated',
|
|
85
86
|
'fetchMarkets': true,
|
|
86
87
|
'fetchMarkOHLCV': false,
|
|
87
88
|
'fetchMyTrades': true,
|
|
@@ -511,15 +512,15 @@ export default class hashkey extends Exchange {
|
|
|
511
512
|
'precisionMode': TICK_SIZE,
|
|
512
513
|
});
|
|
513
514
|
}
|
|
515
|
+
/**
|
|
516
|
+
* @method
|
|
517
|
+
* @name hashkey#fetchTime
|
|
518
|
+
* @description fetches the current integer timestamp in milliseconds from the exchange server
|
|
519
|
+
* @see https://hashkeyglobal-apidoc.readme.io/reference/check-server-time
|
|
520
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
521
|
+
* @returns {int} the current integer timestamp in milliseconds from the exchange server
|
|
522
|
+
*/
|
|
514
523
|
async fetchTime(params = {}) {
|
|
515
|
-
/**
|
|
516
|
-
* @method
|
|
517
|
-
* @name hashkey#fetchTime
|
|
518
|
-
* @description fetches the current integer timestamp in milliseconds from the exchange server
|
|
519
|
-
* @see https://hashkeyglobal-apidoc.readme.io/reference/check-server-time
|
|
520
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
521
|
-
* @returns {int} the current integer timestamp in milliseconds from the exchange server
|
|
522
|
-
*/
|
|
523
524
|
const response = await this.publicGetApiV1Time(params);
|
|
524
525
|
//
|
|
525
526
|
// {
|
|
@@ -528,15 +529,15 @@ export default class hashkey extends Exchange {
|
|
|
528
529
|
//
|
|
529
530
|
return this.safeInteger(response, 'serverTime');
|
|
530
531
|
}
|
|
532
|
+
/**
|
|
533
|
+
* @method
|
|
534
|
+
* @name hashkey#fetchStatus
|
|
535
|
+
* @description the latest known information on the availability of the exchange API
|
|
536
|
+
* @see https://hashkeyglobal-apidoc.readme.io/reference/test-connectivity
|
|
537
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
538
|
+
* @returns {object} a [status structure]{@link https://docs.ccxt.com/#/?id=exchange-status-structure}
|
|
539
|
+
*/
|
|
531
540
|
async fetchStatus(params = {}) {
|
|
532
|
-
/**
|
|
533
|
-
* @method
|
|
534
|
-
* @name hashkey#fetchStatus
|
|
535
|
-
* @description the latest known information on the availability of the exchange API
|
|
536
|
-
* @see https://hashkeyglobal-apidoc.readme.io/reference/test-connectivity
|
|
537
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
538
|
-
* @returns {object} a [status structure]{@link https://docs.ccxt.com/#/?id=exchange-status-structure}
|
|
539
|
-
*/
|
|
540
541
|
const response = await this.publicGetApiV1Ping(params);
|
|
541
542
|
//
|
|
542
543
|
// {}
|
|
@@ -549,16 +550,16 @@ export default class hashkey extends Exchange {
|
|
|
549
550
|
'info': response,
|
|
550
551
|
};
|
|
551
552
|
}
|
|
553
|
+
/**
|
|
554
|
+
* @method
|
|
555
|
+
* @name hashkey#fetchMarkets
|
|
556
|
+
* @description retrieves data on all markets for the exchange
|
|
557
|
+
* @see https://hashkeyglobal-apidoc.readme.io/reference/exchangeinfo
|
|
558
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
559
|
+
* @param {string} [params.symbol] the id of the market to fetch
|
|
560
|
+
* @returns {object[]} an array of objects representing market data
|
|
561
|
+
*/
|
|
552
562
|
async fetchMarkets(params = {}) {
|
|
553
|
-
/**
|
|
554
|
-
* @method
|
|
555
|
-
* @name hashkey#fetchMarkets
|
|
556
|
-
* @description retrieves data on all markets for the exchange
|
|
557
|
-
* @see https://hashkeyglobal-apidoc.readme.io/reference/exchangeinfo
|
|
558
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
559
|
-
* @param {string} [params.symbol] the id of the market to fetch
|
|
560
|
-
* @returns {object[]} an array of objects representing market data
|
|
561
|
-
*/
|
|
562
563
|
let symbol = undefined;
|
|
563
564
|
const request = {};
|
|
564
565
|
[symbol, params] = this.handleOptionAndParams(params, 'fetchMarkets', 'symbol');
|
|
@@ -1019,15 +1020,15 @@ export default class hashkey extends Exchange {
|
|
|
1019
1020
|
'info': market,
|
|
1020
1021
|
});
|
|
1021
1022
|
}
|
|
1023
|
+
/**
|
|
1024
|
+
* @method
|
|
1025
|
+
* @name hashkey#fetchCurrencies
|
|
1026
|
+
* @description fetches all available currencies on an exchange
|
|
1027
|
+
* @see https://hashkeyglobal-apidoc.readme.io/reference/exchangeinfo
|
|
1028
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1029
|
+
* @returns {object} an associative dictionary of currencies
|
|
1030
|
+
*/
|
|
1022
1031
|
async fetchCurrencies(params = {}) {
|
|
1023
|
-
/**
|
|
1024
|
-
* @method
|
|
1025
|
-
* @name hashkey#fetchCurrencies
|
|
1026
|
-
* @description fetches all available currencies on an exchange
|
|
1027
|
-
* @see https://hashkeyglobal-apidoc.readme.io/reference/exchangeinfo
|
|
1028
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1029
|
-
* @returns {object} an associative dictionary of currencies
|
|
1030
|
-
*/
|
|
1031
1032
|
const response = await this.publicGetApiV1ExchangeInfo(params);
|
|
1032
1033
|
const coins = this.safeList(response, 'coins');
|
|
1033
1034
|
//
|
|
@@ -1130,17 +1131,17 @@ export default class hashkey extends Exchange {
|
|
|
1130
1131
|
};
|
|
1131
1132
|
return this.safeString(types, type);
|
|
1132
1133
|
}
|
|
1134
|
+
/**
|
|
1135
|
+
* @method
|
|
1136
|
+
* @name hashkey#fetchOrderBook
|
|
1137
|
+
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
1138
|
+
* @see https://hashkeyglobal-apidoc.readme.io/reference/get-order-book
|
|
1139
|
+
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
1140
|
+
* @param {int} [limit] the maximum amount of order book entries to return (maximum value is 200)
|
|
1141
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1142
|
+
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
1143
|
+
*/
|
|
1133
1144
|
async fetchOrderBook(symbol, limit = undefined, params = {}) {
|
|
1134
|
-
/**
|
|
1135
|
-
* @method
|
|
1136
|
-
* @name hashkey#fetchOrderBook
|
|
1137
|
-
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
1138
|
-
* @see https://hashkeyglobal-apidoc.readme.io/reference/get-order-book
|
|
1139
|
-
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
1140
|
-
* @param {int} [limit] the maximum amount of order book entries to return (maximum value is 200)
|
|
1141
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1142
|
-
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
1143
|
-
*/
|
|
1144
1145
|
await this.loadMarkets();
|
|
1145
1146
|
const market = this.market(symbol);
|
|
1146
1147
|
const request = {
|
|
@@ -1168,18 +1169,18 @@ export default class hashkey extends Exchange {
|
|
|
1168
1169
|
const timestamp = this.safeInteger(response, 't');
|
|
1169
1170
|
return this.parseOrderBook(response, symbol, timestamp, 'b', 'a');
|
|
1170
1171
|
}
|
|
1172
|
+
/**
|
|
1173
|
+
* @method
|
|
1174
|
+
* @name hashkey#fetchTrades
|
|
1175
|
+
* @description get the list of most recent trades for a particular symbol
|
|
1176
|
+
* @see https://hashkeyglobal-apidoc.readme.io/reference/get-recent-trade-list
|
|
1177
|
+
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
1178
|
+
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
1179
|
+
* @param {int} [limit] the maximum amount of trades to fetch (maximum value is 100)
|
|
1180
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1181
|
+
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
|
|
1182
|
+
*/
|
|
1171
1183
|
async fetchTrades(symbol, since = undefined, limit = undefined, params = {}) {
|
|
1172
|
-
/**
|
|
1173
|
-
* @method
|
|
1174
|
-
* @name hashkey#fetchTrades
|
|
1175
|
-
* @description get the list of most recent trades for a particular symbol
|
|
1176
|
-
* @see https://hashkeyglobal-apidoc.readme.io/reference/get-recent-trade-list
|
|
1177
|
-
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
1178
|
-
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
1179
|
-
* @param {int} [limit] the maximum amount of trades to fetch (maximum value is 100)
|
|
1180
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1181
|
-
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
|
|
1182
|
-
*/
|
|
1183
1184
|
await this.loadMarkets();
|
|
1184
1185
|
const market = this.market(symbol);
|
|
1185
1186
|
const request = {
|
|
@@ -1202,26 +1203,26 @@ export default class hashkey extends Exchange {
|
|
|
1202
1203
|
//
|
|
1203
1204
|
return this.parseTrades(response, market, since, limit);
|
|
1204
1205
|
}
|
|
1206
|
+
/**
|
|
1207
|
+
* @method
|
|
1208
|
+
* @name hashkey#fetchMyTrades
|
|
1209
|
+
* @description fetch all trades made by the user
|
|
1210
|
+
* @see https://hashkeyglobal-apidoc.readme.io/reference/get-account-trade-list
|
|
1211
|
+
* @see https://hashkeyglobal-apidoc.readme.io/reference/query-futures-trades
|
|
1212
|
+
* @see https://hashkeyglobal-apidoc.readme.io/reference/get-sub-account-user
|
|
1213
|
+
* @param {string} symbol *is mandatory for swap markets* unified market symbol
|
|
1214
|
+
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
1215
|
+
* @param {int} [limit] the maximum amount of trades to fetch (default 200, max 500)
|
|
1216
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1217
|
+
* @param {string} [params.type] 'spot' or 'swap' - the type of the market to fetch trades for (default 'spot')
|
|
1218
|
+
* @param {int} [params.until] the latest time in ms to fetch trades for, only supports the last 30 days timeframe
|
|
1219
|
+
* @param {string} [params.fromId] srarting trade id
|
|
1220
|
+
* @param {string} [params.toId] ending trade id
|
|
1221
|
+
* @param {string} [params.clientOrderId] *spot markets only* filter trades by orderId
|
|
1222
|
+
* @param {string} [params.accountId] account id to fetch the orders from
|
|
1223
|
+
* @returns {Trade[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure}
|
|
1224
|
+
*/
|
|
1205
1225
|
async fetchMyTrades(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
1206
|
-
/**
|
|
1207
|
-
* @method
|
|
1208
|
-
* @name hashkey#fetchMyTrades
|
|
1209
|
-
* @description fetch all trades made by the user
|
|
1210
|
-
* @see https://hashkeyglobal-apidoc.readme.io/reference/get-account-trade-list
|
|
1211
|
-
* @see https://hashkeyglobal-apidoc.readme.io/reference/query-futures-trades
|
|
1212
|
-
* @see https://hashkeyglobal-apidoc.readme.io/reference/get-sub-account-user
|
|
1213
|
-
* @param {string} symbol *is mandatory for swap markets* unified market symbol
|
|
1214
|
-
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
1215
|
-
* @param {int} [limit] the maximum amount of trades to fetch (default 200, max 500)
|
|
1216
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1217
|
-
* @param {string} [params.type] 'spot' or 'swap' - the type of the market to fetch trades for (default 'spot')
|
|
1218
|
-
* @param {int} [params.until] the latest time in ms to fetch trades for, only supports the last 30 days timeframe
|
|
1219
|
-
* @param {string} [params.fromId] srarting trade id
|
|
1220
|
-
* @param {string} [params.toId] ending trade id
|
|
1221
|
-
* @param {string} [params.clientOrderId] *spot markets only* filter trades by orderId
|
|
1222
|
-
* @param {string} [params.accountId] account id to fetch the orders from
|
|
1223
|
-
* @returns {Trade[]} a list of [trade structures]{@link https://github.com/ccxt/ccxt/wiki/Manual#trade-structure}
|
|
1224
|
-
*/
|
|
1225
1226
|
const methodName = 'fetchMyTrades';
|
|
1226
1227
|
await this.loadMarkets();
|
|
1227
1228
|
const request = {};
|
|
@@ -1425,21 +1426,21 @@ export default class hashkey extends Exchange {
|
|
|
1425
1426
|
'info': trade,
|
|
1426
1427
|
}, market);
|
|
1427
1428
|
}
|
|
1429
|
+
/**
|
|
1430
|
+
* @method
|
|
1431
|
+
* @name hashkey#fetchOHLCV
|
|
1432
|
+
* @see https://hashkeyglobal-apidoc.readme.io/reference/get-kline
|
|
1433
|
+
* @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
1434
|
+
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
1435
|
+
* @param {string} timeframe the length of time each candle represents
|
|
1436
|
+
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
1437
|
+
* @param {int} [limit] the maximum amount of candles to fetch
|
|
1438
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1439
|
+
* @param {int} [params.until] timestamp in ms of the latest candle to fetch
|
|
1440
|
+
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
1441
|
+
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
1442
|
+
*/
|
|
1428
1443
|
async fetchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
|
|
1429
|
-
/**
|
|
1430
|
-
* @method
|
|
1431
|
-
* @name hashkey#fetchOHLCV
|
|
1432
|
-
* @see https://hashkeyglobal-apidoc.readme.io/reference/get-kline
|
|
1433
|
-
* @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
1434
|
-
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
1435
|
-
* @param {string} timeframe the length of time each candle represents
|
|
1436
|
-
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
1437
|
-
* @param {int} [limit] the maximum amount of candles to fetch
|
|
1438
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1439
|
-
* @param {int} [params.until] timestamp in ms of the latest candle to fetch
|
|
1440
|
-
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
1441
|
-
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
1442
|
-
*/
|
|
1443
1444
|
const methodName = 'fetchOHLCV';
|
|
1444
1445
|
await this.loadMarkets();
|
|
1445
1446
|
let paginate = false;
|
|
@@ -1506,16 +1507,16 @@ export default class hashkey extends Exchange {
|
|
|
1506
1507
|
this.safeNumber(ohlcv, 5),
|
|
1507
1508
|
];
|
|
1508
1509
|
}
|
|
1510
|
+
/**
|
|
1511
|
+
* @method
|
|
1512
|
+
* @name hashkey#fetchTicker
|
|
1513
|
+
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
1514
|
+
* @see https://hashkeyglobal-apidoc.readme.io/reference/get-24hr-ticker-price-change
|
|
1515
|
+
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
1516
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1517
|
+
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
1518
|
+
*/
|
|
1509
1519
|
async fetchTicker(symbol, params = {}) {
|
|
1510
|
-
/**
|
|
1511
|
-
* @method
|
|
1512
|
-
* @name hashkey#fetchTicker
|
|
1513
|
-
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
1514
|
-
* @see https://hashkeyglobal-apidoc.readme.io/reference/get-24hr-ticker-price-change
|
|
1515
|
-
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
1516
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1517
|
-
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
1518
|
-
*/
|
|
1519
1520
|
await this.loadMarkets();
|
|
1520
1521
|
const market = this.market(symbol);
|
|
1521
1522
|
const request = {
|
|
@@ -1541,16 +1542,16 @@ export default class hashkey extends Exchange {
|
|
|
1541
1542
|
const ticker = this.safeDict(response, 0, {});
|
|
1542
1543
|
return this.parseTicker(ticker, market);
|
|
1543
1544
|
}
|
|
1545
|
+
/**
|
|
1546
|
+
* @method
|
|
1547
|
+
* @name hashkey#fetchTickers
|
|
1548
|
+
* @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
|
1549
|
+
* @see https://hashkeyglobal-apidoc.readme.io/reference/get-24hr-ticker-price-change
|
|
1550
|
+
* @param {string[]} [symbols] unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
1551
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1552
|
+
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
1553
|
+
*/
|
|
1544
1554
|
async fetchTickers(symbols = undefined, params = {}) {
|
|
1545
|
-
/**
|
|
1546
|
-
* @method
|
|
1547
|
-
* @name hashkey#fetchTickers
|
|
1548
|
-
* @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
|
1549
|
-
* @see https://hashkeyglobal-apidoc.readme.io/reference/get-24hr-ticker-price-change
|
|
1550
|
-
* @param {string[]} [symbols] unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
1551
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1552
|
-
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
1553
|
-
*/
|
|
1554
1555
|
await this.loadMarkets();
|
|
1555
1556
|
symbols = this.marketSymbols(symbols);
|
|
1556
1557
|
const response = await this.publicGetQuoteV1Ticker24hr(params);
|
|
@@ -1599,17 +1600,17 @@ export default class hashkey extends Exchange {
|
|
|
1599
1600
|
'info': ticker,
|
|
1600
1601
|
}, market);
|
|
1601
1602
|
}
|
|
1603
|
+
/**
|
|
1604
|
+
* @method
|
|
1605
|
+
* @name hashkey#fetchLastPrices
|
|
1606
|
+
* @description fetches the last price for multiple markets
|
|
1607
|
+
* @see https://hashkeyglobal-apidoc.readme.io/reference/get-symbol-price-ticker
|
|
1608
|
+
* @param {string[]} [symbols] unified symbols of the markets to fetch the last prices
|
|
1609
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1610
|
+
* @param {string} [params.symbol] the id of the market to fetch last price for
|
|
1611
|
+
* @returns {object} a dictionary of lastprices structures
|
|
1612
|
+
*/
|
|
1602
1613
|
async fetchLastPrices(symbols = undefined, params = {}) {
|
|
1603
|
-
/**
|
|
1604
|
-
* @method
|
|
1605
|
-
* @name hashkey#fetchLastPrices
|
|
1606
|
-
* @description fetches the last price for multiple markets
|
|
1607
|
-
* @see https://hashkeyglobal-apidoc.readme.io/reference/get-symbol-price-ticker
|
|
1608
|
-
* @param {string[]} [symbols] unified symbols of the markets to fetch the last prices
|
|
1609
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1610
|
-
* @param {string} [params.symbol] the id of the market to fetch last price for
|
|
1611
|
-
* @returns {object} a dictionary of lastprices structures
|
|
1612
|
-
*/
|
|
1613
1614
|
await this.loadMarkets();
|
|
1614
1615
|
symbols = this.marketSymbols(symbols);
|
|
1615
1616
|
const request = {};
|
|
@@ -1642,17 +1643,17 @@ export default class hashkey extends Exchange {
|
|
|
1642
1643
|
'info': entry,
|
|
1643
1644
|
};
|
|
1644
1645
|
}
|
|
1646
|
+
/**
|
|
1647
|
+
* @method
|
|
1648
|
+
* @name hashkey#fetchBalance
|
|
1649
|
+
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
1650
|
+
* @see https://hashkeyglobal-apidoc.readme.io/reference/get-account-information
|
|
1651
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1652
|
+
* @param {string} [params.accountId] account ID, for Master Key only
|
|
1653
|
+
* @param {string} [params.type] 'spot' or 'swap' - the type of the market to fetch balance for (default 'spot')
|
|
1654
|
+
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
1655
|
+
*/
|
|
1645
1656
|
async fetchBalance(params = {}) {
|
|
1646
|
-
/**
|
|
1647
|
-
* @method
|
|
1648
|
-
* @name hashkey#fetchBalance
|
|
1649
|
-
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
1650
|
-
* @see https://hashkeyglobal-apidoc.readme.io/reference/get-account-information
|
|
1651
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1652
|
-
* @param {string} [params.accountId] account ID, for Master Key only
|
|
1653
|
-
* @param {string} [params.type] 'spot' or 'swap' - the type of the market to fetch balance for (default 'spot')
|
|
1654
|
-
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
1655
|
-
*/
|
|
1656
1657
|
await this.loadMarkets();
|
|
1657
1658
|
const request = {};
|
|
1658
1659
|
const methodName = 'fetchBalance';
|
|
@@ -1761,17 +1762,17 @@ export default class hashkey extends Exchange {
|
|
|
1761
1762
|
result[code] = account;
|
|
1762
1763
|
return this.safeBalance(result);
|
|
1763
1764
|
}
|
|
1765
|
+
/**
|
|
1766
|
+
* @method
|
|
1767
|
+
* @name hashkey#fetchDepositAddress
|
|
1768
|
+
* @description fetch the deposit address for a currency associated with this account
|
|
1769
|
+
* @see https://hashkeyglobal-apidoc.readme.io/reference/get-deposit-address
|
|
1770
|
+
* @param {string} code unified currency code (default is 'USDT')
|
|
1771
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1772
|
+
* @param {string} [params.network] network for fetch deposit address (default is 'ETH')
|
|
1773
|
+
* @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
|
|
1774
|
+
*/
|
|
1764
1775
|
async fetchDepositAddress(code, params = {}) {
|
|
1765
|
-
/**
|
|
1766
|
-
* @method
|
|
1767
|
-
* @name hashkey#fetchDepositAddress
|
|
1768
|
-
* @description fetch the deposit address for a currency associated with this account
|
|
1769
|
-
* @see https://hashkeyglobal-apidoc.readme.io/reference/get-deposit-address
|
|
1770
|
-
* @param {string} code unified currency code (default is 'USDT')
|
|
1771
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1772
|
-
* @param {string} [params.network] network for fetch deposit address (default is 'ETH')
|
|
1773
|
-
* @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
|
|
1774
|
-
*/
|
|
1775
1776
|
await this.loadMarkets();
|
|
1776
1777
|
const currency = this.currency(code);
|
|
1777
1778
|
const request = {
|
|
@@ -1827,20 +1828,20 @@ export default class hashkey extends Exchange {
|
|
|
1827
1828
|
'tag': tag,
|
|
1828
1829
|
};
|
|
1829
1830
|
}
|
|
1831
|
+
/**
|
|
1832
|
+
* @method
|
|
1833
|
+
* @name hashkey#fetchDeposits
|
|
1834
|
+
* @description fetch all deposits made to an account
|
|
1835
|
+
* @see https://hashkeyglobal-apidoc.readme.io/reference/get-deposit-history
|
|
1836
|
+
* @param {string} code unified currency code of the currency transferred
|
|
1837
|
+
* @param {int} [since] the earliest time in ms to fetch transfers for (default 24 hours ago)
|
|
1838
|
+
* @param {int} [limit] the maximum number of transfer structures to retrieve (default 50, max 200)
|
|
1839
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1840
|
+
* @param {int} [params.until] the latest time in ms to fetch transfers for (default time now)
|
|
1841
|
+
* @param {int} [params.fromId] starting ID (To be released)
|
|
1842
|
+
* @returns {object[]} a list of [transfer structures]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
1843
|
+
*/
|
|
1830
1844
|
async fetchDeposits(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
1831
|
-
/**
|
|
1832
|
-
* @method
|
|
1833
|
-
* @name hashkey#fetchDeposits
|
|
1834
|
-
* @description fetch all deposits made to an account
|
|
1835
|
-
* @see https://hashkeyglobal-apidoc.readme.io/reference/get-deposit-history
|
|
1836
|
-
* @param {string} code unified currency code of the currency transferred
|
|
1837
|
-
* @param {int} [since] the earliest time in ms to fetch transfers for (default 24 hours ago)
|
|
1838
|
-
* @param {int} [limit] the maximum number of transfer structures to retrieve (default 50, max 200)
|
|
1839
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1840
|
-
* @param {int} [params.until] the latest time in ms to fetch transfers for (default time now)
|
|
1841
|
-
* @param {int} [params.fromId] starting ID (To be released)
|
|
1842
|
-
* @returns {object[]} a list of [transfer structures]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
1843
|
-
*/
|
|
1844
1845
|
const methodName = 'fetchDeposits';
|
|
1845
1846
|
await this.loadMarkets();
|
|
1846
1847
|
const request = {};
|
|
@@ -1877,19 +1878,19 @@ export default class hashkey extends Exchange {
|
|
|
1877
1878
|
//
|
|
1878
1879
|
return this.parseTransactions(response, currency, since, limit, { 'type': 'deposit' });
|
|
1879
1880
|
}
|
|
1881
|
+
/**
|
|
1882
|
+
* @method
|
|
1883
|
+
* @name hashkey#fetchWithdrawals
|
|
1884
|
+
* @description fetch all withdrawals made from an account
|
|
1885
|
+
* @see https://hashkeyglobal-apidoc.readme.io/reference/withdrawal-records
|
|
1886
|
+
* @param {string} code unified currency code of the currency transferred
|
|
1887
|
+
* @param {int} [since] the earliest time in ms to fetch transfers for (default 24 hours ago)
|
|
1888
|
+
* @param {int} [limit] the maximum number of transfer structures to retrieve (default 50, max 200)
|
|
1889
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1890
|
+
* @param {int} [params.until] the latest time in ms to fetch transfers for (default time now)
|
|
1891
|
+
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
1892
|
+
*/
|
|
1880
1893
|
async fetchWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
1881
|
-
/**
|
|
1882
|
-
* @method
|
|
1883
|
-
* @name hashkey#fetchWithdrawals
|
|
1884
|
-
* @description fetch all withdrawals made from an account
|
|
1885
|
-
* @see https://hashkeyglobal-apidoc.readme.io/reference/withdrawal-records
|
|
1886
|
-
* @param {string} code unified currency code of the currency transferred
|
|
1887
|
-
* @param {int} [since] the earliest time in ms to fetch transfers for (default 24 hours ago)
|
|
1888
|
-
* @param {int} [limit] the maximum number of transfer structures to retrieve (default 50, max 200)
|
|
1889
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1890
|
-
* @param {int} [params.until] the latest time in ms to fetch transfers for (default time now)
|
|
1891
|
-
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
1892
|
-
*/
|
|
1893
1894
|
const methodName = 'fetchWithdrawals';
|
|
1894
1895
|
await this.loadMarkets();
|
|
1895
1896
|
const request = {};
|
|
@@ -1933,22 +1934,22 @@ export default class hashkey extends Exchange {
|
|
|
1933
1934
|
//
|
|
1934
1935
|
return this.parseTransactions(response, currency, since, limit, { 'type': 'withdrawal' });
|
|
1935
1936
|
}
|
|
1937
|
+
/**
|
|
1938
|
+
* @method
|
|
1939
|
+
* @name hashkey#withdraw
|
|
1940
|
+
* @description make a withdrawal
|
|
1941
|
+
* @see https://hashkeyglobal-apidoc.readme.io/reference/withdraw
|
|
1942
|
+
* @param {string} code unified currency code
|
|
1943
|
+
* @param {float} amount the amount to withdraw
|
|
1944
|
+
* @param {string} address the address to withdraw to
|
|
1945
|
+
* @param {string} tag
|
|
1946
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1947
|
+
* @param {string} [params.network] network for withdraw
|
|
1948
|
+
* @param {string} [params.clientOrderId] client order id
|
|
1949
|
+
* @param {string} [params.platform] the platform to withdraw to (hashkey, HashKey HK)
|
|
1950
|
+
* @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
1951
|
+
*/
|
|
1936
1952
|
async withdraw(code, amount, address, tag = undefined, params = {}) {
|
|
1937
|
-
/**
|
|
1938
|
-
* @method
|
|
1939
|
-
* @name hashkey#withdraw
|
|
1940
|
-
* @description make a withdrawal
|
|
1941
|
-
* @see https://hashkeyglobal-apidoc.readme.io/reference/withdraw
|
|
1942
|
-
* @param {string} code unified currency code
|
|
1943
|
-
* @param {float} amount the amount to withdraw
|
|
1944
|
-
* @param {string} address the address to withdraw to
|
|
1945
|
-
* @param {string} tag
|
|
1946
|
-
* @param {string} [params.network] network for withdraw
|
|
1947
|
-
* @param {string} [params.clientOrderId] client order id
|
|
1948
|
-
* @param {string} [params.platform] the platform to withdraw to (hashkey, HashKey HK)
|
|
1949
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1950
|
-
* @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
1951
|
-
*/
|
|
1952
1953
|
[tag, params] = this.handleWithdrawTagAndParams(tag, params);
|
|
1953
1954
|
await this.loadMarkets();
|
|
1954
1955
|
const currency = this.currency(code);
|
|
@@ -2095,21 +2096,21 @@ export default class hashkey extends Exchange {
|
|
|
2095
2096
|
};
|
|
2096
2097
|
return this.safeString(statuses, status, status);
|
|
2097
2098
|
}
|
|
2099
|
+
/**
|
|
2100
|
+
* @method
|
|
2101
|
+
* @name hashkey#transfer
|
|
2102
|
+
* @description transfer currency internally between wallets on the same account
|
|
2103
|
+
* @see https://hashkeyglobal-apidoc.readme.io/reference/new-account-transfer
|
|
2104
|
+
* @param {string} code unified currency code
|
|
2105
|
+
* @param {float} amount amount to transfer
|
|
2106
|
+
* @param {string} fromAccount account id to transfer from
|
|
2107
|
+
* @param {string} toAccount account id to transfer to
|
|
2108
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2109
|
+
* @param {string} [params.clientOrderId] a unique id for the transfer
|
|
2110
|
+
* @param {string} [params.remark] a note for the transfer
|
|
2111
|
+
* @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
2112
|
+
*/
|
|
2098
2113
|
async transfer(code, amount, fromAccount, toAccount, params = {}) {
|
|
2099
|
-
/**
|
|
2100
|
-
* @method
|
|
2101
|
-
* @name hashkey#transfer
|
|
2102
|
-
* @description transfer currency internally between wallets on the same account
|
|
2103
|
-
* @see https://hashkeyglobal-apidoc.readme.io/reference/new-account-transfer
|
|
2104
|
-
* @param {string} code unified currency code
|
|
2105
|
-
* @param {float} amount amount to transfer
|
|
2106
|
-
* @param {string} fromAccount account id to transfer from
|
|
2107
|
-
* @param {string} toAccount account id to transfer to
|
|
2108
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2109
|
-
* @param {string} [params.clientOrderId] a unique id for the transfer
|
|
2110
|
-
* @param {string} [params.remark] a note for the transfer
|
|
2111
|
-
* @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
2112
|
-
*/
|
|
2113
2114
|
await this.loadMarkets();
|
|
2114
2115
|
const currency = this.currency(code);
|
|
2115
2116
|
const request = {
|
|
@@ -2159,15 +2160,15 @@ export default class hashkey extends Exchange {
|
|
|
2159
2160
|
'info': transfer,
|
|
2160
2161
|
};
|
|
2161
2162
|
}
|
|
2163
|
+
/**
|
|
2164
|
+
* @method
|
|
2165
|
+
* @name hashkey#fetchAccounts
|
|
2166
|
+
* @description fetch all the accounts associated with a profile
|
|
2167
|
+
* @see https://hashkeyglobal-apidoc.readme.io/reference/query-sub-account
|
|
2168
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2169
|
+
* @returns {object} a dictionary of [account structures]{@link https://docs.ccxt.com/#/?id=account-structure} indexed by the account type
|
|
2170
|
+
*/
|
|
2162
2171
|
async fetchAccounts(params = {}) {
|
|
2163
|
-
/**
|
|
2164
|
-
* @method
|
|
2165
|
-
* @name hashkey#fetchAccounts
|
|
2166
|
-
* @description fetch all the accounts associated with a profile
|
|
2167
|
-
* @see https://hashkeyglobal-apidoc.readme.io/reference/query-sub-account
|
|
2168
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2169
|
-
* @returns {object} a dictionary of [account structures]{@link https://docs.ccxt.com/#/?id=account-structure} indexed by the account type
|
|
2170
|
-
*/
|
|
2171
2172
|
await this.loadMarkets();
|
|
2172
2173
|
const response = await this.privateGetApiV1AccountType(params);
|
|
2173
2174
|
//
|
|
@@ -2228,21 +2229,21 @@ export default class hashkey extends Exchange {
|
|
|
2228
2229
|
};
|
|
2229
2230
|
return this.safeInteger(types, type, type);
|
|
2230
2231
|
}
|
|
2232
|
+
/**
|
|
2233
|
+
* @method
|
|
2234
|
+
* @name hashkey#fetchLedger
|
|
2235
|
+
* @description fetch the history of changes, actions done by the user or operations that altered the balance of the user
|
|
2236
|
+
* @see https://hashkeyglobal-apidoc.readme.io/reference/get-account-transaction-list
|
|
2237
|
+
* @param {string} [code] unified currency code, default is undefined (not used)
|
|
2238
|
+
* @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
|
|
2239
|
+
* @param {int} [limit] max number of ledger entries to return, default is undefined
|
|
2240
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2241
|
+
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
2242
|
+
* @param {int} [params.flowType] trade, fee, transfer, deposit, withdrawal
|
|
2243
|
+
* @param {int} [params.accountType] spot, swap, custody
|
|
2244
|
+
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
|
|
2245
|
+
*/
|
|
2231
2246
|
async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
2232
|
-
/**
|
|
2233
|
-
* @method
|
|
2234
|
-
* @name hashkey#fetchLedger
|
|
2235
|
-
* @description fetch the history of changes, actions done by the user or operations that altered the balance of the user
|
|
2236
|
-
* @see https://hashkeyglobal-apidoc.readme.io/reference/get-account-transaction-list
|
|
2237
|
-
* @param {string} [code] unified currency code, default is undefined (not used)
|
|
2238
|
-
* @param {int} [since] timestamp in ms of the earliest ledger entry, default is undefined
|
|
2239
|
-
* @param {int} [limit] max number of ledger entries to return, default is undefined
|
|
2240
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2241
|
-
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
2242
|
-
* @param {int} [params.flowType] trade, fee, transfer, deposit, withdrawal
|
|
2243
|
-
* @param {int} [params.accountType] spot, swap, custody
|
|
2244
|
-
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
|
|
2245
|
-
*/
|
|
2246
2247
|
const methodName = 'fetchLedger';
|
|
2247
2248
|
if (since === undefined) {
|
|
2248
2249
|
throw new ArgumentsRequired(this.id + ' ' + methodName + '() requires a since argument');
|
|
@@ -2352,28 +2353,28 @@ export default class hashkey extends Exchange {
|
|
|
2352
2353
|
'fee': undefined,
|
|
2353
2354
|
}, currency);
|
|
2354
2355
|
}
|
|
2356
|
+
/**
|
|
2357
|
+
* @method
|
|
2358
|
+
* @name hashkey#createOrder
|
|
2359
|
+
* @description create a trade order
|
|
2360
|
+
* @see https://hashkeyglobal-apidoc.readme.io/reference/test-new-order
|
|
2361
|
+
* @see https://hashkeyglobal-apidoc.readme.io/reference/create-order
|
|
2362
|
+
* @see https://hashkeyglobal-apidoc.readme.io/reference/create-new-futures-order
|
|
2363
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
2364
|
+
* @param {string} type 'market' or 'limit' or 'LIMIT_MAKER' for spot, 'market' or 'limit' or 'STOP' for swap
|
|
2365
|
+
* @param {string} side 'buy' or 'sell'
|
|
2366
|
+
* @param {float} amount how much of you want to trade in units of the base currency
|
|
2367
|
+
* @param {float} [price] the price that the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
2368
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2369
|
+
* @param {float} [params.cost] *spot market buy only* the quote quantity that can be used as an alternative for the amount
|
|
2370
|
+
* @param {boolean} [params.test] *spot markets only* whether to use the test endpoint or not, default is false
|
|
2371
|
+
* @param {bool} [params.postOnly] if true, the order will only be posted to the order book and not executed immediately
|
|
2372
|
+
* @param {string} [params.timeInForce] "GTC" or "IOC" or "PO" for spot, 'GTC' or 'FOK' or 'IOC' or 'LIMIT_MAKER' or 'PO' for swap
|
|
2373
|
+
* @param {string} [params.clientOrderId] a unique id for the order - is mandatory for swap
|
|
2374
|
+
* @param {float} [params.triggerPrice] *swap markets only* The price at which a trigger order is triggered at
|
|
2375
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2376
|
+
*/
|
|
2355
2377
|
async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
|
|
2356
|
-
/**
|
|
2357
|
-
* @method
|
|
2358
|
-
* @name hashkey#createOrder
|
|
2359
|
-
* @description create a trade order
|
|
2360
|
-
* @see https://hashkeyglobal-apidoc.readme.io/reference/test-new-order
|
|
2361
|
-
* @see https://hashkeyglobal-apidoc.readme.io/reference/create-order
|
|
2362
|
-
* @see https://hashkeyglobal-apidoc.readme.io/reference/create-new-futures-order
|
|
2363
|
-
* @param {string} symbol unified symbol of the market to create an order in
|
|
2364
|
-
* @param {string} type 'market' or 'limit' or 'LIMIT_MAKER' for spot, 'market' or 'limit' or 'STOP' for swap
|
|
2365
|
-
* @param {string} side 'buy' or 'sell'
|
|
2366
|
-
* @param {float} amount how much of you want to trade in units of the base currency
|
|
2367
|
-
* @param {float} [price] the price that the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
2368
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2369
|
-
* @param {float} [params.cost] *spot market buy only* the quote quantity that can be used as an alternative for the amount
|
|
2370
|
-
* @param {boolean} [params.test] *spot markets only* whether to use the test endpoint or not, default is false
|
|
2371
|
-
* @param {bool} [params.postOnly] if true, the order will only be posted to the order book and not executed immediately
|
|
2372
|
-
* @param {string} [params.timeInForce] "GTC" or "IOC" or "PO" for spot, 'GTC' or 'FOK' or 'IOC' or 'LIMIT_MAKER' or 'PO' for swap
|
|
2373
|
-
* @param {string} [params.clientOrderId] a unique id for the order - is mandatory for swap
|
|
2374
|
-
* @param {float} [params.triggerPrice] *swap markets only* The price at which a trigger order is triggered at
|
|
2375
|
-
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2376
|
-
*/
|
|
2377
2378
|
await this.loadMarkets();
|
|
2378
2379
|
const market = this.market(symbol);
|
|
2379
2380
|
if (market['spot']) {
|
|
@@ -2386,16 +2387,16 @@ export default class hashkey extends Exchange {
|
|
|
2386
2387
|
throw new NotSupported(this.id + ' createOrder() is not supported for ' + market['type'] + ' type of markets');
|
|
2387
2388
|
}
|
|
2388
2389
|
}
|
|
2390
|
+
/**
|
|
2391
|
+
* @method
|
|
2392
|
+
* @name hashkey#createMarketBuyOrderWithCost
|
|
2393
|
+
* @description create a market buy order by providing the symbol and cost
|
|
2394
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
2395
|
+
* @param {float} cost how much you want to trade in units of the quote currency
|
|
2396
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2397
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2398
|
+
*/
|
|
2389
2399
|
async createMarketBuyOrderWithCost(symbol, cost, params = {}) {
|
|
2390
|
-
/**
|
|
2391
|
-
* @method
|
|
2392
|
-
* @name hashkey#createMarketBuyOrderWithCost
|
|
2393
|
-
* @description create a market buy order by providing the symbol and cost
|
|
2394
|
-
* @param {string} symbol unified symbol of the market to create an order in
|
|
2395
|
-
* @param {float} cost how much you want to trade in units of the quote currency
|
|
2396
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2397
|
-
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2398
|
-
*/
|
|
2399
2400
|
await this.loadMarkets();
|
|
2400
2401
|
const market = this.market(symbol);
|
|
2401
2402
|
if (!market['spot']) {
|
|
@@ -2404,26 +2405,26 @@ export default class hashkey extends Exchange {
|
|
|
2404
2405
|
params['cost'] = cost;
|
|
2405
2406
|
return await this.createOrder(symbol, 'market', 'buy', cost, undefined, params);
|
|
2406
2407
|
}
|
|
2408
|
+
/**
|
|
2409
|
+
* @method
|
|
2410
|
+
* @name hashkey#createSpotOrder
|
|
2411
|
+
* @description create a trade order on spot market
|
|
2412
|
+
* @see https://hashkeyglobal-apidoc.readme.io/reference/test-new-order
|
|
2413
|
+
* @see https://hashkeyglobal-apidoc.readme.io/reference/create-order
|
|
2414
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
2415
|
+
* @param {string} type 'market' or 'limit' or 'LIMIT_MAKER'
|
|
2416
|
+
* @param {string} side 'buy' or 'sell'
|
|
2417
|
+
* @param {float} amount how much of you want to trade in units of the base currency
|
|
2418
|
+
* @param {float} [price] the price that the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
2419
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2420
|
+
* @param {float} [params.cost] *market buy only* the quote quantity that can be used as an alternative for the amount
|
|
2421
|
+
* @param {bool} [params.test] whether to use the test endpoint or not, default is false
|
|
2422
|
+
* @param {bool} [params.postOnly] if true, the order will only be posted to the order book and not executed immediately
|
|
2423
|
+
* @param {string} [params.timeInForce] 'GTC', 'IOC', or 'PO'
|
|
2424
|
+
* @param {string} [params.clientOrderId] a unique id for the order
|
|
2425
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2426
|
+
*/
|
|
2407
2427
|
async createSpotOrder(symbol, type, side, amount, price = undefined, params = {}) {
|
|
2408
|
-
/**
|
|
2409
|
-
* @method
|
|
2410
|
-
* @name hashkey#createSpotOrder
|
|
2411
|
-
* @description create a trade order on spot market
|
|
2412
|
-
* @see https://hashkeyglobal-apidoc.readme.io/reference/test-new-order
|
|
2413
|
-
* @see https://hashkeyglobal-apidoc.readme.io/reference/create-order
|
|
2414
|
-
* @param {string} symbol unified symbol of the market to create an order in
|
|
2415
|
-
* @param {string} type 'market' or 'limit' or 'LIMIT_MAKER'
|
|
2416
|
-
* @param {string} side 'buy' or 'sell'
|
|
2417
|
-
* @param {float} amount how much of you want to trade in units of the base currency
|
|
2418
|
-
* @param {float} [price] the price that the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
2419
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2420
|
-
* @param {float} [params.cost] *market buy only* the quote quantity that can be used as an alternative for the amount
|
|
2421
|
-
* @param {bool} [params.test] whether to use the test endpoint or not, default is false
|
|
2422
|
-
* @param {bool} [params.postOnly] if true, the order will only be posted to the order book and not executed immediately
|
|
2423
|
-
* @param {string} [params.timeInForce] 'GTC', 'IOC', or 'PO'
|
|
2424
|
-
* @param {string} [params.clientOrderId] a unique id for the order
|
|
2425
|
-
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2426
|
-
*/
|
|
2427
2428
|
const triggerPrice = this.safeString2(params, 'stopPrice', 'triggerPrice');
|
|
2428
2429
|
if (triggerPrice !== undefined) {
|
|
2429
2430
|
throw new NotSupported(this.id + ' trigger orders are not supported for spot markets');
|
|
@@ -2650,25 +2651,25 @@ export default class hashkey extends Exchange {
|
|
|
2650
2651
|
}
|
|
2651
2652
|
return this.extend(request, params);
|
|
2652
2653
|
}
|
|
2654
|
+
/**
|
|
2655
|
+
* @method
|
|
2656
|
+
* @name hashkey#createSwapOrder
|
|
2657
|
+
* @description create a trade order on swap market
|
|
2658
|
+
* @see https://hashkeyglobal-apidoc.readme.io/reference/create-new-futures-order
|
|
2659
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
2660
|
+
* @param {string} type 'market' or 'limit' or 'STOP'
|
|
2661
|
+
* @param {string} side 'buy' or 'sell'
|
|
2662
|
+
* @param {float} amount how much of you want to trade in units of the base currency
|
|
2663
|
+
* @param {float} [price] the price that the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
2664
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2665
|
+
* @param {bool} [params.postOnly] if true, the order will only be posted to the order book and not executed immediately
|
|
2666
|
+
* @param {bool} [params.reduceOnly] true or false whether the order is reduce only
|
|
2667
|
+
* @param {float} [params.triggerPrice] The price at which a trigger order is triggered at
|
|
2668
|
+
* @param {string} [params.timeInForce] 'GTC', 'FOK', 'IOC', 'LIMIT_MAKER' or 'PO'
|
|
2669
|
+
* @param {string} [params.clientOrderId] a unique id for the order
|
|
2670
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2671
|
+
*/
|
|
2653
2672
|
async createSwapOrder(symbol, type, side, amount, price = undefined, params = {}) {
|
|
2654
|
-
/**
|
|
2655
|
-
* @method
|
|
2656
|
-
* @name hashkey#createSwapOrder
|
|
2657
|
-
* @description create a trade order on swap market
|
|
2658
|
-
* @see https://hashkeyglobal-apidoc.readme.io/reference/create-new-futures-order
|
|
2659
|
-
* @param {string} symbol unified symbol of the market to create an order in
|
|
2660
|
-
* @param {string} type 'market' or 'limit' or 'STOP'
|
|
2661
|
-
* @param {string} side 'buy' or 'sell'
|
|
2662
|
-
* @param {float} amount how much of you want to trade in units of the base currency
|
|
2663
|
-
* @param {float} [price] the price that the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
2664
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2665
|
-
* @param {bool} [params.postOnly] if true, the order will only be posted to the order book and not executed immediately
|
|
2666
|
-
* @param {bool} [params.reduceOnly] true or false whether the order is reduce only
|
|
2667
|
-
* @param {float} [params.triggerPrice] The price at which a trigger order is triggered at
|
|
2668
|
-
* @param {string} [params.timeInForce] 'GTC', 'FOK', 'IOC', 'LIMIT_MAKER' or 'PO'
|
|
2669
|
-
* @param {string} [params.clientOrderId] a unique id for the order
|
|
2670
|
-
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2671
|
-
*/
|
|
2672
2673
|
await this.loadMarkets();
|
|
2673
2674
|
const market = this.market(symbol);
|
|
2674
2675
|
const request = this.createSwapOrderRequest(symbol, type, side, amount, price, params);
|
|
@@ -2696,17 +2697,17 @@ export default class hashkey extends Exchange {
|
|
|
2696
2697
|
//
|
|
2697
2698
|
return this.parseOrder(response, market);
|
|
2698
2699
|
}
|
|
2700
|
+
/**
|
|
2701
|
+
* @method
|
|
2702
|
+
* @name hashkey#createOrders
|
|
2703
|
+
* @description create a list of trade orders (all orders should be of the same symbol)
|
|
2704
|
+
* @see https://hashkeyglobal-apidoc.readme.io/reference/create-multiple-orders
|
|
2705
|
+
* @see https://hashkeyglobal-apidoc.readme.io/reference/batch-create-new-futures-order
|
|
2706
|
+
* @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
|
|
2707
|
+
* @param {object} [params] extra parameters specific to the api endpoint
|
|
2708
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2709
|
+
*/
|
|
2699
2710
|
async createOrders(orders, params = {}) {
|
|
2700
|
-
/**
|
|
2701
|
-
* @method
|
|
2702
|
-
* @name hashkey#createOrders
|
|
2703
|
-
* @description create a list of trade orders (all orders should be of the same symbol)
|
|
2704
|
-
* @see https://hashkeyglobal-apidoc.readme.io/reference/create-multiple-orders
|
|
2705
|
-
* @see https://hashkeyglobal-apidoc.readme.io/reference/batch-create-new-futures-order
|
|
2706
|
-
* @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
|
|
2707
|
-
* @param {object} [params] extra parameters specific to the api endpoint
|
|
2708
|
-
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2709
|
-
*/
|
|
2710
2711
|
await this.loadMarkets();
|
|
2711
2712
|
const ordersRequests = [];
|
|
2712
2713
|
for (let i = 0; i < orders.length; i++) {
|
|
@@ -2811,22 +2812,22 @@ export default class hashkey extends Exchange {
|
|
|
2811
2812
|
}
|
|
2812
2813
|
return this.parseOrders(responseOrders);
|
|
2813
2814
|
}
|
|
2815
|
+
/**
|
|
2816
|
+
* @method
|
|
2817
|
+
* @name hashkey#cancelOrder
|
|
2818
|
+
* @description cancels an open order
|
|
2819
|
+
* @see https://hashkeyglobal-apidoc.readme.io/reference/cancel-order
|
|
2820
|
+
* @see https://hashkeyglobal-apidoc.readme.io/reference/cancel-futures-order
|
|
2821
|
+
* @param {string} id order id
|
|
2822
|
+
* @param {string} symbol unified symbol of the market the order was made in
|
|
2823
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2824
|
+
* @param {string} [params.type] 'spot' or 'swap' - the type of the market to fetch entry for (default 'spot')
|
|
2825
|
+
* @param {string} [params.clientOrderId] a unique id for the order that can be used as an alternative for the id
|
|
2826
|
+
* @param {bool} [params.trigger] *swap markets only* true for canceling a trigger order (default false)
|
|
2827
|
+
* @param {bool} [params.stop] *swap markets only* an alternative for trigger param
|
|
2828
|
+
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2829
|
+
*/
|
|
2814
2830
|
async cancelOrder(id, symbol = undefined, params = {}) {
|
|
2815
|
-
/**
|
|
2816
|
-
* @method
|
|
2817
|
-
* @name hashkey#cancelOrder
|
|
2818
|
-
* @description cancels an open order
|
|
2819
|
-
* @see https://hashkeyglobal-apidoc.readme.io/reference/cancel-order
|
|
2820
|
-
* @see https://hashkeyglobal-apidoc.readme.io/reference/cancel-futures-order
|
|
2821
|
-
* @param {string} id order id
|
|
2822
|
-
* @param {string} symbol unified symbol of the market the order was made in
|
|
2823
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2824
|
-
* @param {string} [params.type] 'spot' or 'swap' - the type of the market to fetch entry for (default 'spot')
|
|
2825
|
-
* @param {string} [params.clientOrderId] a unique id for the order that can be used as an alternative for the id
|
|
2826
|
-
* @param {bool} [params.trigger] *swap markets only* true for canceling a trigger order (default false)
|
|
2827
|
-
* @param {bool} [params.stop] *swap markets only* an alternative for trigger param
|
|
2828
|
-
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2829
|
-
*/
|
|
2830
2831
|
const methodName = 'cancelOrder';
|
|
2831
2832
|
this.checkTypeParam(methodName, params);
|
|
2832
2833
|
await this.loadMarkets();
|
|
@@ -2903,18 +2904,18 @@ export default class hashkey extends Exchange {
|
|
|
2903
2904
|
}
|
|
2904
2905
|
return this.parseOrder(response);
|
|
2905
2906
|
}
|
|
2907
|
+
/**
|
|
2908
|
+
* @method
|
|
2909
|
+
* @name hashkey#cancelAllOrders
|
|
2910
|
+
* @description cancel all open orders
|
|
2911
|
+
* @see https://hashkeyglobal-apidoc.readme.io/reference/cancel-all-open-orders
|
|
2912
|
+
* @see https://hashkeyglobal-apidoc.readme.io/reference/batch-cancel-futures-order
|
|
2913
|
+
* @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
|
|
2914
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2915
|
+
* @param {string} [params.side] 'buy' or 'sell'
|
|
2916
|
+
* @returns {object} response from exchange
|
|
2917
|
+
*/
|
|
2906
2918
|
async cancelAllOrders(symbol = undefined, params = {}) {
|
|
2907
|
-
/**
|
|
2908
|
-
* @method
|
|
2909
|
-
* @name hashkey#cancelAllOrders
|
|
2910
|
-
* @description cancel all open orders
|
|
2911
|
-
* @see https://hashkeyglobal-apidoc.readme.io/reference/cancel-all-open-orders
|
|
2912
|
-
* @see https://hashkeyglobal-apidoc.readme.io/reference/batch-cancel-futures-order
|
|
2913
|
-
* @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
|
|
2914
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2915
|
-
* @param {string} [params.side] 'buy' or 'sell'
|
|
2916
|
-
* @returns {object} response from exchange
|
|
2917
|
-
*/
|
|
2918
2919
|
// Does not cancel trigger orders. For canceling trigger order use cancelOrder() or cancelOrders()
|
|
2919
2920
|
const methodName = 'cancelAllOrders';
|
|
2920
2921
|
if (symbol === undefined) {
|
|
@@ -2949,18 +2950,19 @@ export default class hashkey extends Exchange {
|
|
|
2949
2950
|
order['info'] = response;
|
|
2950
2951
|
return [order];
|
|
2951
2952
|
}
|
|
2953
|
+
/**
|
|
2954
|
+
* @method
|
|
2955
|
+
* @name hashkey#cancelOrders
|
|
2956
|
+
* @description cancel multiple orders
|
|
2957
|
+
* @see https://hashkeyglobal-apidoc.readme.io/reference/cancel-multiple-orders
|
|
2958
|
+
* @see https://hashkeyglobal-apidoc.readme.io/reference/batch-cancel-futures-order-by-order-id
|
|
2959
|
+
* @param {string[]} ids order ids
|
|
2960
|
+
* @param {string} [symbol] unified market symbol (not used by hashkey)
|
|
2961
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2962
|
+
* @param {string} [params.type] 'spot' or 'swap' - the type of the market to fetch entry for (default 'spot')
|
|
2963
|
+
* @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2964
|
+
*/
|
|
2952
2965
|
async cancelOrders(ids, symbol = undefined, params = {}) {
|
|
2953
|
-
/**
|
|
2954
|
-
* @method
|
|
2955
|
-
* @name hashkey#cancelOrders
|
|
2956
|
-
* @description cancel multiple orders
|
|
2957
|
-
* @see https://hashkeyglobal-apidoc.readme.io/reference/cancel-multiple-orders
|
|
2958
|
-
* @see https://hashkeyglobal-apidoc.readme.io/reference/batch-cancel-futures-order-by-order-id
|
|
2959
|
-
* @param {string[]} ids order ids
|
|
2960
|
-
* @param {string} [symbol] unified market symbol (not used by hashkey)
|
|
2961
|
-
* @param {string} [params.type] 'spot' or 'swap' - the type of the market to fetch entry for (default 'spot')
|
|
2962
|
-
* @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2963
|
-
*/
|
|
2964
2966
|
const methodName = 'cancelOrders';
|
|
2965
2967
|
await this.loadMarkets();
|
|
2966
2968
|
const request = {};
|
|
@@ -2992,23 +2994,23 @@ export default class hashkey extends Exchange {
|
|
|
2992
2994
|
order['info'] = response;
|
|
2993
2995
|
return [order];
|
|
2994
2996
|
}
|
|
2997
|
+
/**
|
|
2998
|
+
* @method
|
|
2999
|
+
* @name hashkey#fetchOrder
|
|
3000
|
+
* @description fetches information on an order made by the user
|
|
3001
|
+
* @see https://hashkeyglobal-apidoc.readme.io/reference/query-order
|
|
3002
|
+
* @see https://hashkeyglobal-apidoc.readme.io/reference/get-futures-order
|
|
3003
|
+
* @param {string} id the order id
|
|
3004
|
+
* @param {string} symbol unified symbol of the market the order was made in
|
|
3005
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3006
|
+
* @param {string} [params.type] 'spot' or 'swap' - the type of the market to fetch entry for (default 'spot')
|
|
3007
|
+
* @param {string} [params.clientOrderId] a unique id for the order that can be used as an alternative for the id
|
|
3008
|
+
* @param {string} [params.accountId] *spot markets only* account id to fetch the order from
|
|
3009
|
+
* @param {bool} [params.trigger] *swap markets only* true for fetching a trigger order (default false)
|
|
3010
|
+
* @param {bool} [params.stop] *swap markets only* an alternative for trigger param
|
|
3011
|
+
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
3012
|
+
*/
|
|
2995
3013
|
async fetchOrder(id, symbol = undefined, params = {}) {
|
|
2996
|
-
/**
|
|
2997
|
-
* @method
|
|
2998
|
-
* @name hashkey#fetchOrder
|
|
2999
|
-
* @description fetches information on an order made by the user
|
|
3000
|
-
* @see https://hashkeyglobal-apidoc.readme.io/reference/query-order
|
|
3001
|
-
* @see https://hashkeyglobal-apidoc.readme.io/reference/get-futures-order
|
|
3002
|
-
* @param {string} id the order id
|
|
3003
|
-
* @param {string} symbol unified symbol of the market the order was made in
|
|
3004
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3005
|
-
* @param {string} [params.type] 'spot' or 'swap' - the type of the market to fetch entry for (default 'spot')
|
|
3006
|
-
* @param {string} [params.clientOrderId] a unique id for the order that can be used as an alternative for the id
|
|
3007
|
-
* @param {string} [params.accountId] *spot markets only* account id to fetch the order from
|
|
3008
|
-
* @param {bool} [params.trigger] *swap markets only* true for fetching a trigger order (default false)
|
|
3009
|
-
* @param {bool} [params.stop] *swap markets only* an alternative for trigger param
|
|
3010
|
-
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
3011
|
-
*/
|
|
3012
3014
|
const methodName = 'fetchOrder';
|
|
3013
3015
|
this.checkTypeParam(methodName, params);
|
|
3014
3016
|
await this.loadMarkets();
|
|
@@ -3101,28 +3103,28 @@ export default class hashkey extends Exchange {
|
|
|
3101
3103
|
}
|
|
3102
3104
|
return this.parseOrder(response);
|
|
3103
3105
|
}
|
|
3106
|
+
/**
|
|
3107
|
+
* @method
|
|
3108
|
+
* @name hashkey#fetchOpenOrders
|
|
3109
|
+
* @description fetch all unfilled currently open orders
|
|
3110
|
+
* @see https://hashkeyglobal-apidoc.readme.io/reference/get-current-open-orders
|
|
3111
|
+
* @see https://hashkeyglobal-apidoc.readme.io/reference/get-sub-account-open-orders
|
|
3112
|
+
* @see https://hashkeyglobal-apidoc.readme.io/reference/sub
|
|
3113
|
+
* @see https://hashkeyglobal-apidoc.readme.io/reference/query-open-futures-orders
|
|
3114
|
+
* @param {string} [symbol] unified market symbol of the market orders were made in - is mandatory for swap markets
|
|
3115
|
+
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
3116
|
+
* @param {int} [limit] the maximum number of order structures to retrieve - default 500, maximum 1000
|
|
3117
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3118
|
+
* @param {string} [params.type] 'spot' or 'swap' - the type of the market to fetch entries for (default 'spot')
|
|
3119
|
+
* @param {string} [params.orderId] *spot markets only* the id of the order to fetch
|
|
3120
|
+
* @param {string} [params.side] *spot markets only* 'buy' or 'sell' - the side of the orders to fetch
|
|
3121
|
+
* @param {string} [params.fromOrderId] *swap markets only* the id of the order to start from
|
|
3122
|
+
* @param {bool} [params.trigger] *swap markets only* true for fetching trigger orders (default false)
|
|
3123
|
+
* @param {bool} [params.stop] *swap markets only* an alternative for trigger param
|
|
3124
|
+
* @param {string} [params.accountId] account id to fetch the orders from
|
|
3125
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
3126
|
+
*/
|
|
3104
3127
|
async fetchOpenOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
3105
|
-
/**
|
|
3106
|
-
* @method
|
|
3107
|
-
* @name hashkey#fetchOpenOrders
|
|
3108
|
-
* @description fetch all unfilled currently open orders
|
|
3109
|
-
* @see https://hashkeyglobal-apidoc.readme.io/reference/get-current-open-orders
|
|
3110
|
-
* @see https://hashkeyglobal-apidoc.readme.io/reference/get-sub-account-open-orders
|
|
3111
|
-
* @see https://hashkeyglobal-apidoc.readme.io/reference/sub
|
|
3112
|
-
* @see https://hashkeyglobal-apidoc.readme.io/reference/query-open-futures-orders
|
|
3113
|
-
* @param {string} [symbol] unified market symbol of the market orders were made in - is mandatory for swap markets
|
|
3114
|
-
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
3115
|
-
* @param {int} [limit] the maximum number of order structures to retrieve - default 500, maximum 1000
|
|
3116
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3117
|
-
* @param {string} [params.type] 'spot' or 'swap' - the type of the market to fetch entries for (default 'spot')
|
|
3118
|
-
* @param {string} [params.orderId] *spot markets only* the id of the order to fetch
|
|
3119
|
-
* @param {string} [params.side] *spot markets only* 'buy' or 'sell' - the side of the orders to fetch
|
|
3120
|
-
* @param {string} [params.fromOrderId] *swap markets only* the id of the order to start from
|
|
3121
|
-
* @param {bool} [params.trigger] *swap markets only* true for fetching trigger orders (default false)
|
|
3122
|
-
* @param {bool} [params.stop] *swap markets only* an alternative for trigger param
|
|
3123
|
-
* @param {string} [params.accountId] account id to fetch the orders from
|
|
3124
|
-
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
3125
|
-
*/
|
|
3126
3128
|
const methodName = 'fetchOpenOrders';
|
|
3127
3129
|
this.checkTypeParam(methodName, params);
|
|
3128
3130
|
await this.loadMarkets();
|
|
@@ -3143,23 +3145,23 @@ export default class hashkey extends Exchange {
|
|
|
3143
3145
|
throw new NotSupported(this.id + ' ' + methodName + '() is not supported for ' + marketType + ' type of markets');
|
|
3144
3146
|
}
|
|
3145
3147
|
}
|
|
3148
|
+
/**
|
|
3149
|
+
* @method
|
|
3150
|
+
* @ignore
|
|
3151
|
+
* @name hashkey#fetchOpenSpotOrders
|
|
3152
|
+
* @description fetch all unfilled currently open orders for spot markets
|
|
3153
|
+
* @see https://hashkeyglobal-apidoc.readme.io/reference/get-current-open-orders
|
|
3154
|
+
* @see https://hashkeyglobal-apidoc.readme.io/reference/sub
|
|
3155
|
+
* @param {string} [symbol] unified market symbol of the market orders were made in
|
|
3156
|
+
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
3157
|
+
* @param {int} [limit] the maximum number of order structures to retrieve - default 500, maximum 1000
|
|
3158
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3159
|
+
* @param {string} [params.orderId] the id of the order to fetch
|
|
3160
|
+
* @param {string} [params.side] 'buy' or 'sell' - the side of the orders to fetch
|
|
3161
|
+
* @param {string} [params.accountId] account id to fetch the orders from
|
|
3162
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
3163
|
+
*/
|
|
3146
3164
|
async fetchOpenSpotOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
3147
|
-
/**
|
|
3148
|
-
* @method
|
|
3149
|
-
* @ignore
|
|
3150
|
-
* @name hashkey#fetchOpenSpotOrders
|
|
3151
|
-
* @description fetch all unfilled currently open orders for spot markets
|
|
3152
|
-
* @see https://hashkeyglobal-apidoc.readme.io/reference/get-current-open-orders
|
|
3153
|
-
* @see https://hashkeyglobal-apidoc.readme.io/reference/sub
|
|
3154
|
-
* @param {string} [symbol] unified market symbol of the market orders were made in
|
|
3155
|
-
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
3156
|
-
* @param {int} [limit] the maximum number of order structures to retrieve - default 500, maximum 1000
|
|
3157
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3158
|
-
* @param {string} [params.orderId] the id of the order to fetch
|
|
3159
|
-
* @param {string} [params.side] 'buy' or 'sell' - the side of the orders to fetch
|
|
3160
|
-
* @param {string} [params.accountId] account id to fetch the orders from
|
|
3161
|
-
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
3162
|
-
*/
|
|
3163
3165
|
await this.loadMarkets();
|
|
3164
3166
|
let methodName = 'fetchOpenSpotOrders';
|
|
3165
3167
|
[methodName, params] = this.handleParamString(params, 'methodName', methodName);
|
|
@@ -3222,24 +3224,24 @@ export default class hashkey extends Exchange {
|
|
|
3222
3224
|
}
|
|
3223
3225
|
return this.parseOrders(response, market, since, limit);
|
|
3224
3226
|
}
|
|
3227
|
+
/**
|
|
3228
|
+
* @method
|
|
3229
|
+
* @ignore
|
|
3230
|
+
* @name hashkey#fetchOpenSwapOrders
|
|
3231
|
+
* @description fetch all unfilled currently open orders for swap markets
|
|
3232
|
+
* @see https://hashkeyglobal-apidoc.readme.io/reference/query-open-futures-orders
|
|
3233
|
+
* @see https://hashkeyglobal-apidoc.readme.io/reference/get-sub-account-open-orders
|
|
3234
|
+
* @param {string} symbol *is mandatory* unified market symbol of the market orders were made in
|
|
3235
|
+
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
3236
|
+
* @param {int} [limit] the maximum number of order structures to retrieve - maximum 500
|
|
3237
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3238
|
+
* @param {string} [params.fromOrderId] the id of the order to start from
|
|
3239
|
+
* @param {bool} [params.trigger] true for fetching trigger orders (default false)
|
|
3240
|
+
* @param {bool} [params.stop] an alternative for trigger param
|
|
3241
|
+
* @param {string} [params.accountId] account id to fetch the orders from
|
|
3242
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
3243
|
+
*/
|
|
3225
3244
|
async fetchOpenSwapOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
3226
|
-
/**
|
|
3227
|
-
* @method
|
|
3228
|
-
* @ignore
|
|
3229
|
-
* @name hashkey#fetchOpenSwapOrders
|
|
3230
|
-
* @description fetch all unfilled currently open orders for swap markets
|
|
3231
|
-
* @see https://hashkeyglobal-apidoc.readme.io/reference/query-open-futures-orders
|
|
3232
|
-
* @see https://hashkeyglobal-apidoc.readme.io/reference/get-sub-account-open-orders
|
|
3233
|
-
* @param {string} symbol *is mandatory* unified market symbol of the market orders were made in
|
|
3234
|
-
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
3235
|
-
* @param {int} [limit] the maximum number of order structures to retrieve - maximum 500
|
|
3236
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3237
|
-
* @param {string} [params.fromOrderId] the id of the order to start from
|
|
3238
|
-
* @param {bool} [params.trigger] true for fetching trigger orders (default false)
|
|
3239
|
-
* @param {bool} [params.stop] an alternative for trigger param
|
|
3240
|
-
* @param {string} [params.accountId] account id to fetch the orders from
|
|
3241
|
-
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
3242
|
-
*/
|
|
3243
3245
|
let methodName = 'fetchOpenSwapOrders';
|
|
3244
3246
|
[methodName, params] = this.handleParamString(params, 'methodName', methodName);
|
|
3245
3247
|
if (symbol === undefined) {
|
|
@@ -3320,28 +3322,28 @@ export default class hashkey extends Exchange {
|
|
|
3320
3322
|
}
|
|
3321
3323
|
return this.parseOrders(response, market, since, limit);
|
|
3322
3324
|
}
|
|
3325
|
+
/**
|
|
3326
|
+
* @method
|
|
3327
|
+
* @name hashkey#fetchCanceledAndClosedOrders
|
|
3328
|
+
* @description fetches information on multiple canceled and closed orders made by the user
|
|
3329
|
+
* @see https://hashkeyglobal-apidoc.readme.io/reference/get-all-orders
|
|
3330
|
+
* @see https://hashkeyglobal-apidoc.readme.io/reference/query-futures-history-orders
|
|
3331
|
+
* @see https://hashkeyglobal-apidoc.readme.io/reference/get-sub-account-history-orders
|
|
3332
|
+
* @param {string} symbol *is mandatory for swap markets* unified market symbol of the market orders were made in
|
|
3333
|
+
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
3334
|
+
* @param {int} [limit] the maximum number of order structures to retrieve - default 500, maximum 1000
|
|
3335
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3336
|
+
* @param {int} [params.until] the latest time in ms to fetch entries for - only supports the last 90 days timeframe
|
|
3337
|
+
* @param {string} [params.type] 'spot' or 'swap' - the type of the market to fetch entries for (default 'spot')
|
|
3338
|
+
* @param {string} [params.orderId] *spot markets only* the id of the order to fetch
|
|
3339
|
+
* @param {string} [params.side] *spot markets only* 'buy' or 'sell' - the side of the orders to fetch
|
|
3340
|
+
* @param {string} [params.fromOrderId] *swap markets only* the id of the order to start from
|
|
3341
|
+
* @param {bool} [params.trigger] *swap markets only* the id of the order to start from true for fetching trigger orders (default false)
|
|
3342
|
+
* @param {bool} [params.stop] *swap markets only* the id of the order to start from an alternative for trigger param
|
|
3343
|
+
* @param {string} [params.accountId] account id to fetch the orders from
|
|
3344
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
3345
|
+
*/
|
|
3323
3346
|
async fetchCanceledAndClosedOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
3324
|
-
/**
|
|
3325
|
-
* @method
|
|
3326
|
-
* @name hashkey#fetchCanceledAndClosedOrders
|
|
3327
|
-
* @description fetches information on multiple canceled and closed orders made by the user
|
|
3328
|
-
* @see https://hashkeyglobal-apidoc.readme.io/reference/get-all-orders
|
|
3329
|
-
* @see https://hashkeyglobal-apidoc.readme.io/reference/query-futures-history-orders
|
|
3330
|
-
* @see https://hashkeyglobal-apidoc.readme.io/reference/get-sub-account-history-orders
|
|
3331
|
-
* @param {string} symbol *is mandatory for swap markets* unified market symbol of the market orders were made in
|
|
3332
|
-
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
3333
|
-
* @param {int} [limit] the maximum number of order structures to retrieve - default 500, maximum 1000
|
|
3334
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3335
|
-
* @param {int} [params.until] the latest time in ms to fetch entries for - only supports the last 90 days timeframe
|
|
3336
|
-
* @param {string} [params.type] 'spot' or 'swap' - the type of the market to fetch entries for (default 'spot')
|
|
3337
|
-
* @param {string} [params.orderId] *spot markets only* the id of the order to fetch
|
|
3338
|
-
* @param {string} [params.side] *spot markets only* 'buy' or 'sell' - the side of the orders to fetch
|
|
3339
|
-
* @param {string} [params.fromOrderId] *swap markets only* the id of the order to start from
|
|
3340
|
-
* @param {bool} [params.trigger] *swap markets only* the id of the order to start from true for fetching trigger orders (default false)
|
|
3341
|
-
* @param {bool} [params.stop] *swap markets only* the id of the order to start from an alternative for trigger param
|
|
3342
|
-
* @param {string} [params.accountId] account id to fetch the orders from
|
|
3343
|
-
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
3344
|
-
*/
|
|
3345
3347
|
const methodName = 'fetchCanceledAndClosedOrders';
|
|
3346
3348
|
this.checkTypeParam(methodName, params);
|
|
3347
3349
|
await this.loadMarkets();
|
|
@@ -3711,16 +3713,16 @@ export default class hashkey extends Exchange {
|
|
|
3711
3713
|
};
|
|
3712
3714
|
return this.safeString(types, type, type);
|
|
3713
3715
|
}
|
|
3716
|
+
/**
|
|
3717
|
+
* @method
|
|
3718
|
+
* @name hashkey#fetchFundingRate
|
|
3719
|
+
* @description fetch the current funding rate
|
|
3720
|
+
* @see https://hashkeyglobal-apidoc.readme.io/reference/get-futures-funding-rate
|
|
3721
|
+
* @param {string} symbol unified market symbol
|
|
3722
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3723
|
+
* @returns {object} a [funding rate structure]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
|
|
3724
|
+
*/
|
|
3714
3725
|
async fetchFundingRate(symbol, params = {}) {
|
|
3715
|
-
/**
|
|
3716
|
-
* @method
|
|
3717
|
-
* @name hashkey#fetchFundingRate
|
|
3718
|
-
* @description fetch the current funding rate
|
|
3719
|
-
* @see https://hashkeyglobal-apidoc.readme.io/reference/get-futures-funding-rate
|
|
3720
|
-
* @param {string} symbol unified market symbol
|
|
3721
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3722
|
-
* @returns {object} a [funding rate structure]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
|
|
3723
|
-
*/
|
|
3724
3726
|
await this.loadMarkets();
|
|
3725
3727
|
const market = this.market(symbol);
|
|
3726
3728
|
const request = {
|
|
@@ -3736,16 +3738,16 @@ export default class hashkey extends Exchange {
|
|
|
3736
3738
|
const rate = this.safeDict(response, 0, {});
|
|
3737
3739
|
return this.parseFundingRate(rate, market);
|
|
3738
3740
|
}
|
|
3741
|
+
/**
|
|
3742
|
+
* @method
|
|
3743
|
+
* @name hashkey#fetchFundingRates
|
|
3744
|
+
* @description fetch the funding rate for multiple markets
|
|
3745
|
+
* @see https://hashkeyglobal-apidoc.readme.io/reference/get-futures-funding-rate
|
|
3746
|
+
* @param {string[]|undefined} symbols list of unified market symbols
|
|
3747
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3748
|
+
* @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rates-structure}, indexed by market symbols
|
|
3749
|
+
*/
|
|
3739
3750
|
async fetchFundingRates(symbols = undefined, params = {}) {
|
|
3740
|
-
/**
|
|
3741
|
-
* @method
|
|
3742
|
-
* @name hashkey#fetchFundingRates
|
|
3743
|
-
* @description fetch the funding rate for multiple markets
|
|
3744
|
-
* @see https://hashkeyglobal-apidoc.readme.io/reference/get-futures-funding-rate
|
|
3745
|
-
* @param {string[]|undefined} symbols list of unified market symbols
|
|
3746
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3747
|
-
* @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rates-structure}, indexed by market symbols
|
|
3748
|
-
*/
|
|
3749
3751
|
await this.loadMarkets();
|
|
3750
3752
|
symbols = this.marketSymbols(symbols);
|
|
3751
3753
|
const request = {
|
|
@@ -3794,20 +3796,20 @@ export default class hashkey extends Exchange {
|
|
|
3794
3796
|
'interval': undefined,
|
|
3795
3797
|
};
|
|
3796
3798
|
}
|
|
3799
|
+
/**
|
|
3800
|
+
* @method
|
|
3801
|
+
* @name hashkey#fetchFundingRateHistory
|
|
3802
|
+
* @description fetches historical funding rate prices
|
|
3803
|
+
* @see https://hashkeyglobal-apidoc.readme.io/reference/get-futures-history-funding-rate
|
|
3804
|
+
* @param {string} symbol unified symbol of the market to fetch the funding rate history for
|
|
3805
|
+
* @param {int} [since] timestamp in ms of the earliest funding rate to fetch
|
|
3806
|
+
* @param {int} [limit] the maximum amount of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure} to fetch
|
|
3807
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3808
|
+
* @param {int} [params.fromId] the id of the entry to start from
|
|
3809
|
+
* @param {int} [params.endId] the id of the entry to end with
|
|
3810
|
+
* @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure}
|
|
3811
|
+
*/
|
|
3797
3812
|
async fetchFundingRateHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
3798
|
-
/**
|
|
3799
|
-
* @method
|
|
3800
|
-
* @name hashkey#fetchFundingRateHistory
|
|
3801
|
-
* @description fetches historical funding rate prices
|
|
3802
|
-
* @see https://hashkeyglobal-apidoc.readme.io/reference/get-futures-history-funding-rate
|
|
3803
|
-
* @param {string} symbol unified symbol of the market to fetch the funding rate history for
|
|
3804
|
-
* @param {int} [since] timestamp in ms of the earliest funding rate to fetch
|
|
3805
|
-
* @param {int} [limit] the maximum amount of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure} to fetch
|
|
3806
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3807
|
-
* @param {int} [params.fromId] the id of the entry to start from
|
|
3808
|
-
* @param {int} [params.endId] the id of the entry to end with
|
|
3809
|
-
* @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure}
|
|
3810
|
-
*/
|
|
3811
3813
|
await this.loadMarkets();
|
|
3812
3814
|
if (symbol === undefined) {
|
|
3813
3815
|
throw new ArgumentsRequired(this.id + ' fetchFundingRateHistory() requires a symbol argument');
|
|
@@ -3846,18 +3848,18 @@ export default class hashkey extends Exchange {
|
|
|
3846
3848
|
const sorted = this.sortBy(rates, 'timestamp');
|
|
3847
3849
|
return this.filterBySinceLimit(sorted, since, limit);
|
|
3848
3850
|
}
|
|
3851
|
+
/**
|
|
3852
|
+
* @method
|
|
3853
|
+
* @description fetch open positions for a market
|
|
3854
|
+
* @name hashkey#fetchPositions
|
|
3855
|
+
* @see https://hashkeyglobal-apidoc.readme.io/reference/get-futures-positions
|
|
3856
|
+
* @description fetch all open positions
|
|
3857
|
+
* @param {string[]|undefined} symbols list of unified market symbols
|
|
3858
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3859
|
+
* @param {string} [params.side] 'LONG' or 'SHORT' - the direction of the position (if not provided, positions for both sides will be returned)
|
|
3860
|
+
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
3861
|
+
*/
|
|
3849
3862
|
async fetchPositions(symbols = undefined, params = {}) {
|
|
3850
|
-
/**
|
|
3851
|
-
* @method
|
|
3852
|
-
* @description fetch open positions for a market
|
|
3853
|
-
* @name hashkey#fetchPositions
|
|
3854
|
-
* @see https://hashkeyglobal-apidoc.readme.io/reference/get-futures-positions
|
|
3855
|
-
* @description fetch all open positions
|
|
3856
|
-
* @param {string[]|undefined} symbols list of unified market symbols
|
|
3857
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3858
|
-
* @param {string} [params.side] 'LONG' or 'SHORT' - the direction of the position (if not provided, positions for both sides will be returned)
|
|
3859
|
-
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
3860
|
-
*/
|
|
3861
3863
|
const methodName = 'fetchPositions';
|
|
3862
3864
|
if ((symbols === undefined)) {
|
|
3863
3865
|
throw new ArgumentsRequired(this.id + ' ' + methodName + '() requires a symbol argument with one single market symbol');
|
|
@@ -3871,18 +3873,18 @@ export default class hashkey extends Exchange {
|
|
|
3871
3873
|
await this.loadMarkets();
|
|
3872
3874
|
return await this.fetchPositionsForSymbol(symbols[0], this.extend({ 'methodName': 'fetchPositions' }, params));
|
|
3873
3875
|
}
|
|
3876
|
+
/**
|
|
3877
|
+
* @method
|
|
3878
|
+
* @description fetch open positions for a single market
|
|
3879
|
+
* @name hashkey#fetchPositionsForSymbol
|
|
3880
|
+
* @see https://hashkeyglobal-apidoc.readme.io/reference/get-futures-positions
|
|
3881
|
+
* @description fetch all open positions for specific symbol
|
|
3882
|
+
* @param {string} symbol unified market symbol
|
|
3883
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3884
|
+
* @param {string} [params.side] 'LONG' or 'SHORT' - the direction of the position (if not provided, positions for both sides will be returned)
|
|
3885
|
+
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
3886
|
+
*/
|
|
3874
3887
|
async fetchPositionsForSymbol(symbol, params = {}) {
|
|
3875
|
-
/**
|
|
3876
|
-
* @method
|
|
3877
|
-
* @description fetch open positions for a single market
|
|
3878
|
-
* @name hashkey#fetchPositionsForSymbol
|
|
3879
|
-
* @see https://hashkeyglobal-apidoc.readme.io/reference/get-futures-positions
|
|
3880
|
-
* @description fetch all open positions for specific symbol
|
|
3881
|
-
* @param {string} symbol unified market symbol
|
|
3882
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3883
|
-
* @param {string} [params.side] 'LONG' or 'SHORT' - the direction of the position (if not provided, positions for both sides will be returned)
|
|
3884
|
-
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
3885
|
-
*/
|
|
3886
3888
|
await this.loadMarkets();
|
|
3887
3889
|
const market = this.market(symbol);
|
|
3888
3890
|
let methodName = 'fetchPosition';
|
|
@@ -3957,16 +3959,16 @@ export default class hashkey extends Exchange {
|
|
|
3957
3959
|
'info': position,
|
|
3958
3960
|
});
|
|
3959
3961
|
}
|
|
3962
|
+
/**
|
|
3963
|
+
* @method
|
|
3964
|
+
* @name hashkey#fetchLeverage
|
|
3965
|
+
* @description fetch the set leverage for a market
|
|
3966
|
+
* @see https://hashkeyglobal-apidoc.readme.io/reference/query-futures-leverage-trade
|
|
3967
|
+
* @param {string} symbol unified market symbol
|
|
3968
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3969
|
+
* @returns {object} a [leverage structure]{@link https://docs.ccxt.com/#/?id=leverage-structure}
|
|
3970
|
+
*/
|
|
3960
3971
|
async fetchLeverage(symbol, params = {}) {
|
|
3961
|
-
/**
|
|
3962
|
-
* @method
|
|
3963
|
-
* @name hashkey#fetchLeverage
|
|
3964
|
-
* @description fetch the set leverage for a market
|
|
3965
|
-
* @see https://hashkeyglobal-apidoc.readme.io/reference/query-futures-leverage-trade
|
|
3966
|
-
* @param {string} symbol unified market symbol
|
|
3967
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3968
|
-
* @returns {object} a [leverage structure]{@link https://docs.ccxt.com/#/?id=leverage-structure}
|
|
3969
|
-
*/
|
|
3970
3972
|
await this.loadMarkets();
|
|
3971
3973
|
const market = this.market(symbol);
|
|
3972
3974
|
const request = {
|
|
@@ -3996,17 +3998,17 @@ export default class hashkey extends Exchange {
|
|
|
3996
3998
|
'shortLeverage': leverageValue,
|
|
3997
3999
|
};
|
|
3998
4000
|
}
|
|
4001
|
+
/**
|
|
4002
|
+
* @method
|
|
4003
|
+
* @name hashkey#setLeverage
|
|
4004
|
+
* @description set the level of leverage for a market
|
|
4005
|
+
* @see https://hashkeyglobal-apidoc.readme.io/reference/change-futures-leverage-trade
|
|
4006
|
+
* @param {float} leverage the rate of leverage
|
|
4007
|
+
* @param {string} symbol unified market symbol
|
|
4008
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4009
|
+
* @returns {object} response from the exchange
|
|
4010
|
+
*/
|
|
3999
4011
|
async setLeverage(leverage, symbol = undefined, params = {}) {
|
|
4000
|
-
/**
|
|
4001
|
-
* @method
|
|
4002
|
-
* @name hashkey#setLeverage
|
|
4003
|
-
* @description set the level of leverage for a market
|
|
4004
|
-
* @see https://hashkeyglobal-apidoc.readme.io/reference/change-futures-leverage-trade
|
|
4005
|
-
* @param {float} leverage the rate of leverage
|
|
4006
|
-
* @param {string} symbol unified market symbol
|
|
4007
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4008
|
-
* @returns {object} response from the exchange
|
|
4009
|
-
*/
|
|
4010
4012
|
if (symbol === undefined) {
|
|
4011
4013
|
throw new ArgumentsRequired(this.id + ' setLeverage() requires a symbol argument');
|
|
4012
4014
|
}
|
|
@@ -4026,16 +4028,16 @@ export default class hashkey extends Exchange {
|
|
|
4026
4028
|
//
|
|
4027
4029
|
return this.parseLeverage(response, market);
|
|
4028
4030
|
}
|
|
4031
|
+
/**
|
|
4032
|
+
* @method
|
|
4033
|
+
* @name hashkey#fetchLeverageTiers
|
|
4034
|
+
* @description retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes
|
|
4035
|
+
* @see https://hashkeyglobal-apidoc.readme.io/reference/exchangeinfo
|
|
4036
|
+
* @param {string[]|undefined} symbols list of unified market symbols
|
|
4037
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4038
|
+
* @returns {object} a dictionary of [leverage tiers structures]{@link https://docs.ccxt.com/#/?id=leverage-tiers-structure}, indexed by market symbols
|
|
4039
|
+
*/
|
|
4029
4040
|
async fetchLeverageTiers(symbols = undefined, params = {}) {
|
|
4030
|
-
/**
|
|
4031
|
-
* @method
|
|
4032
|
-
* @name hashkey#fetchLeverageTiers
|
|
4033
|
-
* @see https://hashkeyglobal-apidoc.readme.io/reference/exchangeinfo
|
|
4034
|
-
* @description retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes
|
|
4035
|
-
* @param {string[]|undefined} symbols list of unified market symbols
|
|
4036
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4037
|
-
* @returns {object} a dictionary of [leverage tiers structures]{@link https://docs.ccxt.com/#/?id=leverage-tiers-structure}, indexed by market symbols
|
|
4038
|
-
*/
|
|
4039
4041
|
await this.loadMarkets();
|
|
4040
4042
|
const response = await this.publicGetApiV1ExchangeInfo(params);
|
|
4041
4043
|
// response is the same as in fetchMarkets()
|
|
@@ -4122,14 +4124,15 @@ export default class hashkey extends Exchange {
|
|
|
4122
4124
|
// }
|
|
4123
4125
|
//
|
|
4124
4126
|
const riskLimits = this.safeList(info, 'riskLimits', []);
|
|
4125
|
-
const
|
|
4126
|
-
market = this.safeMarket(
|
|
4127
|
+
const marketId = this.safeString(info, 'symbol');
|
|
4128
|
+
market = this.safeMarket(marketId, market);
|
|
4127
4129
|
const tiers = [];
|
|
4128
4130
|
for (let i = 0; i < riskLimits.length; i++) {
|
|
4129
4131
|
const tier = riskLimits[i];
|
|
4130
4132
|
const initialMarginRate = this.safeString(tier, 'initialMargin');
|
|
4131
4133
|
tiers.push({
|
|
4132
4134
|
'tier': this.sum(i, 1),
|
|
4135
|
+
'symbol': this.safeSymbol(marketId, market),
|
|
4133
4136
|
'currency': market['settle'],
|
|
4134
4137
|
'minNotional': undefined,
|
|
4135
4138
|
'maxNotional': this.safeNumber(tier, 'quantity'),
|
|
@@ -4140,17 +4143,17 @@ export default class hashkey extends Exchange {
|
|
|
4140
4143
|
}
|
|
4141
4144
|
return tiers;
|
|
4142
4145
|
}
|
|
4146
|
+
/**
|
|
4147
|
+
* @method
|
|
4148
|
+
* @name hashkey#fetchTradingFee
|
|
4149
|
+
* @description fetch the trading fees for a market
|
|
4150
|
+
* @see https://developers.binance.com/docs/wallet/asset/trade-fee // spot
|
|
4151
|
+
* @see https://hashkeyglobal-apidoc.readme.io/reference/get-futures-commission-rate-request-weight // swap
|
|
4152
|
+
* @param {string} symbol unified market symbol
|
|
4153
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4154
|
+
* @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
4155
|
+
*/
|
|
4143
4156
|
async fetchTradingFee(symbol, params = {}) {
|
|
4144
|
-
/**
|
|
4145
|
-
* @method
|
|
4146
|
-
* @name hashkey#fetchTradingFee
|
|
4147
|
-
* @description fetch the trading fees for a market
|
|
4148
|
-
* @see https://developers.binance.com/docs/wallet/asset/trade-fee // spot
|
|
4149
|
-
* @see https://hashkeyglobal-apidoc.readme.io/reference/get-futures-commission-rate-request-weight // swap
|
|
4150
|
-
* @param {string} symbol unified market symbol
|
|
4151
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4152
|
-
* @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
4153
|
-
*/
|
|
4154
4157
|
await this.loadMarkets();
|
|
4155
4158
|
const market = this.market(symbol);
|
|
4156
4159
|
const methodName = 'fetchTradingFee';
|
|
@@ -4175,15 +4178,15 @@ export default class hashkey extends Exchange {
|
|
|
4175
4178
|
throw new NotSupported(this.id + ' ' + methodName + '() is not supported for ' + market['type'] + ' type of markets');
|
|
4176
4179
|
}
|
|
4177
4180
|
}
|
|
4181
|
+
/**
|
|
4182
|
+
* @method
|
|
4183
|
+
* @name hashkey#fetchTradingFees
|
|
4184
|
+
* @description *for spot markets only* fetch the trading fees for multiple markets
|
|
4185
|
+
* @see https://developers.binance.com/docs/wallet/asset/trade-fee
|
|
4186
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4187
|
+
* @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
|
|
4188
|
+
*/
|
|
4178
4189
|
async fetchTradingFees(params = {}) {
|
|
4179
|
-
/**
|
|
4180
|
-
* @method
|
|
4181
|
-
* @name hashkey#fetchTradingFees
|
|
4182
|
-
* @description *for spot markets only* fetch the trading fees for multiple markets
|
|
4183
|
-
* @see https://developers.binance.com/docs/wallet/asset/trade-fee
|
|
4184
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4185
|
-
* @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
|
|
4186
|
-
*/
|
|
4187
4190
|
await this.loadMarkets();
|
|
4188
4191
|
const response = await this.privateGetApiV1AccountVipInfo(params);
|
|
4189
4192
|
//
|