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/dist/cjs/src/mexc.js
CHANGED
|
@@ -814,16 +814,16 @@ class mexc extends mexc$1 {
|
|
|
814
814
|
},
|
|
815
815
|
});
|
|
816
816
|
}
|
|
817
|
+
/**
|
|
818
|
+
* @method
|
|
819
|
+
* @name mexc#fetchStatus
|
|
820
|
+
* @description the latest known information on the availability of the exchange API
|
|
821
|
+
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#test-connectivity
|
|
822
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-the-server-time
|
|
823
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
824
|
+
* @returns {object} a [status structure]{@link https://docs.ccxt.com/#/?id=exchange-status-structure}
|
|
825
|
+
*/
|
|
817
826
|
async fetchStatus(params = {}) {
|
|
818
|
-
/**
|
|
819
|
-
* @method
|
|
820
|
-
* @name mexc#fetchStatus
|
|
821
|
-
* @description the latest known information on the availability of the exchange API
|
|
822
|
-
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#test-connectivity
|
|
823
|
-
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-the-server-time
|
|
824
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
825
|
-
* @returns {object} a [status structure]{@link https://docs.ccxt.com/#/?id=exchange-status-structure}
|
|
826
|
-
*/
|
|
827
827
|
const [marketType, query] = this.handleMarketTypeAndParams('fetchStatus', undefined, params);
|
|
828
828
|
let response = undefined;
|
|
829
829
|
let status = undefined;
|
|
@@ -853,16 +853,16 @@ class mexc extends mexc$1 {
|
|
|
853
853
|
'info': response,
|
|
854
854
|
};
|
|
855
855
|
}
|
|
856
|
+
/**
|
|
857
|
+
* @method
|
|
858
|
+
* @name mexc#fetchTime
|
|
859
|
+
* @description fetches the current integer timestamp in milliseconds from the exchange server
|
|
860
|
+
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#check-server-time
|
|
861
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-the-server-time
|
|
862
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
863
|
+
* @returns {int} the current integer timestamp in milliseconds from the exchange server
|
|
864
|
+
*/
|
|
856
865
|
async fetchTime(params = {}) {
|
|
857
|
-
/**
|
|
858
|
-
* @method
|
|
859
|
-
* @name mexc#fetchTime
|
|
860
|
-
* @description fetches the current integer timestamp in milliseconds from the exchange server
|
|
861
|
-
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#check-server-time
|
|
862
|
-
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-the-server-time
|
|
863
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
864
|
-
* @returns {int} the current integer timestamp in milliseconds from the exchange server
|
|
865
|
-
*/
|
|
866
866
|
const [marketType, query] = this.handleMarketTypeAndParams('fetchTime', undefined, params);
|
|
867
867
|
let response = undefined;
|
|
868
868
|
if (marketType === 'spot') {
|
|
@@ -881,15 +881,15 @@ class mexc extends mexc$1 {
|
|
|
881
881
|
}
|
|
882
882
|
return undefined;
|
|
883
883
|
}
|
|
884
|
+
/**
|
|
885
|
+
* @method
|
|
886
|
+
* @name mexc#fetchCurrencies
|
|
887
|
+
* @description fetches all available currencies on an exchange
|
|
888
|
+
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#query-the-currency-information
|
|
889
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
890
|
+
* @returns {object} an associative dictionary of currencies
|
|
891
|
+
*/
|
|
884
892
|
async fetchCurrencies(params = {}) {
|
|
885
|
-
/**
|
|
886
|
-
* @method
|
|
887
|
-
* @name mexc#fetchCurrencies
|
|
888
|
-
* @description fetches all available currencies on an exchange
|
|
889
|
-
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#query-the-currency-information
|
|
890
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
891
|
-
* @returns {object} an associative dictionary of currencies
|
|
892
|
-
*/
|
|
893
893
|
// this endpoint requires authentication
|
|
894
894
|
// while fetchCurrencies is a public API method by design
|
|
895
895
|
// therefore we check the keys here
|
|
@@ -1026,16 +1026,16 @@ class mexc extends mexc$1 {
|
|
|
1026
1026
|
}
|
|
1027
1027
|
return result;
|
|
1028
1028
|
}
|
|
1029
|
+
/**
|
|
1030
|
+
* @method
|
|
1031
|
+
* @name mexc#fetchMarkets
|
|
1032
|
+
* @description retrieves data on all markets for mexc
|
|
1033
|
+
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#exchange-information
|
|
1034
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-the-contract-information
|
|
1035
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1036
|
+
* @returns {object[]} an array of objects representing market data
|
|
1037
|
+
*/
|
|
1029
1038
|
async fetchMarkets(params = {}) {
|
|
1030
|
-
/**
|
|
1031
|
-
* @method
|
|
1032
|
-
* @name mexc#fetchMarkets
|
|
1033
|
-
* @description retrieves data on all markets for mexc
|
|
1034
|
-
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#exchange-information
|
|
1035
|
-
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-the-contract-information
|
|
1036
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1037
|
-
* @returns {object[]} an array of objects representing market data
|
|
1038
|
-
*/
|
|
1039
1039
|
if (this.options['adjustForTimeDifference']) {
|
|
1040
1040
|
await this.loadTimeDifference();
|
|
1041
1041
|
}
|
|
@@ -1044,16 +1044,16 @@ class mexc extends mexc$1 {
|
|
|
1044
1044
|
const [spotMarket, swapMarket] = await Promise.all([spotMarketPromise, swapMarketPromise]);
|
|
1045
1045
|
return this.arrayConcat(spotMarket, swapMarket);
|
|
1046
1046
|
}
|
|
1047
|
+
/**
|
|
1048
|
+
* @ignore
|
|
1049
|
+
* @method
|
|
1050
|
+
* @name mexc#fetchMarkets
|
|
1051
|
+
* @description retrieves data on all spot markets for mexc
|
|
1052
|
+
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#exchange-information
|
|
1053
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1054
|
+
* @returns {object[]} an array of objects representing market data
|
|
1055
|
+
*/
|
|
1047
1056
|
async fetchSpotMarkets(params = {}) {
|
|
1048
|
-
/**
|
|
1049
|
-
* @ignore
|
|
1050
|
-
* @method
|
|
1051
|
-
* @name mexc#fetchMarkets
|
|
1052
|
-
* @description retrieves data on all spot markets for mexc
|
|
1053
|
-
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#exchange-information
|
|
1054
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1055
|
-
* @returns {object[]} an array of objects representing market data
|
|
1056
|
-
*/
|
|
1057
1057
|
const response = await this.spotPublicGetExchangeInfo(params);
|
|
1058
1058
|
//
|
|
1059
1059
|
// {
|
|
@@ -1170,16 +1170,16 @@ class mexc extends mexc$1 {
|
|
|
1170
1170
|
}
|
|
1171
1171
|
return result;
|
|
1172
1172
|
}
|
|
1173
|
+
/**
|
|
1174
|
+
* @ignore
|
|
1175
|
+
* @method
|
|
1176
|
+
* @name mexc#fetchMarkets
|
|
1177
|
+
* @description retrieves data on all swap markets for mexc
|
|
1178
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-the-contract-information
|
|
1179
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1180
|
+
* @returns {object[]} an array of objects representing market data
|
|
1181
|
+
*/
|
|
1173
1182
|
async fetchSwapMarkets(params = {}) {
|
|
1174
|
-
/**
|
|
1175
|
-
* @ignore
|
|
1176
|
-
* @method
|
|
1177
|
-
* @name mexc#fetchMarkets
|
|
1178
|
-
* @description retrieves data on all swap markets for mexc
|
|
1179
|
-
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-the-contract-information
|
|
1180
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1181
|
-
* @returns {object[]} an array of objects representing market data
|
|
1182
|
-
*/
|
|
1183
1183
|
const currentRl = this.rateLimit;
|
|
1184
1184
|
this.setProperty(this, 'rateLimit', 10); // see comment: https://github.com/ccxt/ccxt/pull/23698
|
|
1185
1185
|
const response = await this.contractPublicGetDetail(params);
|
|
@@ -1294,18 +1294,18 @@ class mexc extends mexc$1 {
|
|
|
1294
1294
|
}
|
|
1295
1295
|
return result;
|
|
1296
1296
|
}
|
|
1297
|
+
/**
|
|
1298
|
+
* @method
|
|
1299
|
+
* @name mexc#fetchOrderBook
|
|
1300
|
+
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#order-book
|
|
1301
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-the-contract-s-depth-information
|
|
1302
|
+
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
1303
|
+
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
1304
|
+
* @param {int} [limit] the maximum amount of order book entries to return
|
|
1305
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1306
|
+
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
1307
|
+
*/
|
|
1297
1308
|
async fetchOrderBook(symbol, limit = undefined, params = {}) {
|
|
1298
|
-
/**
|
|
1299
|
-
* @method
|
|
1300
|
-
* @name mexc#fetchOrderBook
|
|
1301
|
-
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#order-book
|
|
1302
|
-
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-the-contract-s-depth-information
|
|
1303
|
-
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
1304
|
-
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
1305
|
-
* @param {int} [limit] the maximum amount of order book entries to return
|
|
1306
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1307
|
-
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
1308
|
-
*/
|
|
1309
1309
|
await this.loadMarkets();
|
|
1310
1310
|
const market = this.market(symbol);
|
|
1311
1311
|
const request = {
|
|
@@ -1371,21 +1371,21 @@ class mexc extends mexc$1 {
|
|
|
1371
1371
|
}
|
|
1372
1372
|
return [price, amount];
|
|
1373
1373
|
}
|
|
1374
|
+
/**
|
|
1375
|
+
* @method
|
|
1376
|
+
* @name mexc#fetchTrades
|
|
1377
|
+
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#recent-trades-list
|
|
1378
|
+
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#compressed-aggregate-trades-list
|
|
1379
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-contract-transaction-data
|
|
1380
|
+
* @description get the list of most recent trades for a particular symbol
|
|
1381
|
+
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
1382
|
+
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
1383
|
+
* @param {int} [limit] the maximum amount of trades to fetch
|
|
1384
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1385
|
+
* @param {int} [params.until] *spot only* *since must be defined* the latest time in ms to fetch entries for
|
|
1386
|
+
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
|
|
1387
|
+
*/
|
|
1374
1388
|
async fetchTrades(symbol, since = undefined, limit = undefined, params = {}) {
|
|
1375
|
-
/**
|
|
1376
|
-
* @method
|
|
1377
|
-
* @name mexc#fetchTrades
|
|
1378
|
-
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#recent-trades-list
|
|
1379
|
-
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#compressed-aggregate-trades-list
|
|
1380
|
-
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-contract-transaction-data
|
|
1381
|
-
* @description get the list of most recent trades for a particular symbol
|
|
1382
|
-
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
1383
|
-
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
1384
|
-
* @param {int} [limit] the maximum amount of trades to fetch
|
|
1385
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1386
|
-
* @param {int} [params.until] *spot only* *since must be defined* the latest time in ms to fetch entries for
|
|
1387
|
-
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
|
|
1388
|
-
*/
|
|
1389
1389
|
await this.loadMarkets();
|
|
1390
1390
|
const market = this.market(symbol);
|
|
1391
1391
|
const request = {
|
|
@@ -1647,22 +1647,22 @@ class mexc extends mexc$1 {
|
|
|
1647
1647
|
}
|
|
1648
1648
|
return id;
|
|
1649
1649
|
}
|
|
1650
|
+
/**
|
|
1651
|
+
* @method
|
|
1652
|
+
* @name mexc#fetchOHLCV
|
|
1653
|
+
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#kline-candlestick-data
|
|
1654
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#k-line-data
|
|
1655
|
+
* @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
1656
|
+
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
1657
|
+
* @param {string} timeframe the length of time each candle represents
|
|
1658
|
+
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
1659
|
+
* @param {int} [limit] the maximum amount of candles to fetch
|
|
1660
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1661
|
+
* @param {int} [params.until] timestamp in ms of the latest candle to fetch
|
|
1662
|
+
* @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)
|
|
1663
|
+
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
1664
|
+
*/
|
|
1650
1665
|
async fetchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
|
|
1651
|
-
/**
|
|
1652
|
-
* @method
|
|
1653
|
-
* @name mexc#fetchOHLCV
|
|
1654
|
-
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#kline-candlestick-data
|
|
1655
|
-
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#k-line-data
|
|
1656
|
-
* @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
1657
|
-
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
1658
|
-
* @param {string} timeframe the length of time each candle represents
|
|
1659
|
-
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
1660
|
-
* @param {int} [limit] the maximum amount of candles to fetch
|
|
1661
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1662
|
-
* @param {int} [params.until] timestamp in ms of the latest candle to fetch
|
|
1663
|
-
* @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)
|
|
1664
|
-
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
1665
|
-
*/
|
|
1666
1666
|
await this.loadMarkets();
|
|
1667
1667
|
const market = this.market(symbol);
|
|
1668
1668
|
const maxLimit = (market['spot']) ? 1000 : 2000;
|
|
@@ -1769,17 +1769,17 @@ class mexc extends mexc$1 {
|
|
|
1769
1769
|
this.safeNumber(ohlcv, 5),
|
|
1770
1770
|
];
|
|
1771
1771
|
}
|
|
1772
|
+
/**
|
|
1773
|
+
* @method
|
|
1774
|
+
* @name mexc#fetchTickers
|
|
1775
|
+
* @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
|
1776
|
+
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#24hr-ticker-price-change-statistics
|
|
1777
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-contract-trend-data
|
|
1778
|
+
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
1779
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1780
|
+
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
1781
|
+
*/
|
|
1772
1782
|
async fetchTickers(symbols = undefined, params = {}) {
|
|
1773
|
-
/**
|
|
1774
|
-
* @method
|
|
1775
|
-
* @name mexc#fetchTickers
|
|
1776
|
-
* @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
|
1777
|
-
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#24hr-ticker-price-change-statistics
|
|
1778
|
-
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-contract-trend-data
|
|
1779
|
-
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
1780
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1781
|
-
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
1782
|
-
*/
|
|
1783
1783
|
await this.loadMarkets();
|
|
1784
1784
|
const request = {};
|
|
1785
1785
|
let market = undefined;
|
|
@@ -1859,17 +1859,17 @@ class mexc extends mexc$1 {
|
|
|
1859
1859
|
}
|
|
1860
1860
|
return this.parseTickers(tickers, symbols);
|
|
1861
1861
|
}
|
|
1862
|
+
/**
|
|
1863
|
+
* @method
|
|
1864
|
+
* @name mexc#fetchTicker
|
|
1865
|
+
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
1866
|
+
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#24hr-ticker-price-change-statistics
|
|
1867
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-contract-trend-data
|
|
1868
|
+
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
1869
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1870
|
+
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
1871
|
+
*/
|
|
1862
1872
|
async fetchTicker(symbol, params = {}) {
|
|
1863
|
-
/**
|
|
1864
|
-
* @method
|
|
1865
|
-
* @name mexc#fetchTicker
|
|
1866
|
-
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
1867
|
-
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#24hr-ticker-price-change-statistics
|
|
1868
|
-
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-contract-trend-data
|
|
1869
|
-
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
1870
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1871
|
-
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
1872
|
-
*/
|
|
1873
1873
|
await this.loadMarkets();
|
|
1874
1874
|
const market = this.market(symbol);
|
|
1875
1875
|
const [marketType, query] = this.handleMarketTypeAndParams('fetchTicker', market, params);
|
|
@@ -2051,16 +2051,16 @@ class mexc extends mexc$1 {
|
|
|
2051
2051
|
'info': ticker,
|
|
2052
2052
|
}, market);
|
|
2053
2053
|
}
|
|
2054
|
+
/**
|
|
2055
|
+
* @method
|
|
2056
|
+
* @name mexc#fetchBidsAsks
|
|
2057
|
+
* @description fetches the bid and ask price and volume for multiple markets
|
|
2058
|
+
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#symbol-order-book-ticker
|
|
2059
|
+
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the bids and asks for, all markets are returned if not assigned
|
|
2060
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2061
|
+
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
2062
|
+
*/
|
|
2054
2063
|
async fetchBidsAsks(symbols = undefined, params = {}) {
|
|
2055
|
-
/**
|
|
2056
|
-
* @method
|
|
2057
|
-
* @name mexc#fetchBidsAsks
|
|
2058
|
-
* @description fetches the bid and ask price and volume for multiple markets
|
|
2059
|
-
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#symbol-order-book-ticker
|
|
2060
|
-
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the bids and asks for, all markets are returned if not assigned
|
|
2061
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2062
|
-
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
2063
|
-
*/
|
|
2064
2064
|
await this.loadMarkets();
|
|
2065
2065
|
let market = undefined;
|
|
2066
2066
|
let isSingularMarket = false;
|
|
@@ -2094,17 +2094,17 @@ class mexc extends mexc$1 {
|
|
|
2094
2094
|
}
|
|
2095
2095
|
return this.parseTickers(tickers, symbols);
|
|
2096
2096
|
}
|
|
2097
|
+
/**
|
|
2098
|
+
* @method
|
|
2099
|
+
* @name mexc#createMarketBuyOrderWithCost
|
|
2100
|
+
* @description create a market buy order by providing the symbol and cost
|
|
2101
|
+
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#new-order
|
|
2102
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
2103
|
+
* @param {float} cost how much you want to trade in units of the quote currency
|
|
2104
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2105
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2106
|
+
*/
|
|
2097
2107
|
async createMarketBuyOrderWithCost(symbol, cost, params = {}) {
|
|
2098
|
-
/**
|
|
2099
|
-
* @method
|
|
2100
|
-
* @name mexc#createMarketBuyOrderWithCost
|
|
2101
|
-
* @description create a market buy order by providing the symbol and cost
|
|
2102
|
-
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#new-order
|
|
2103
|
-
* @param {string} symbol unified symbol of the market to create an order in
|
|
2104
|
-
* @param {float} cost how much you want to trade in units of the quote currency
|
|
2105
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2106
|
-
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2107
|
-
*/
|
|
2108
2108
|
await this.loadMarkets();
|
|
2109
2109
|
const market = this.market(symbol);
|
|
2110
2110
|
if (!market['spot']) {
|
|
@@ -2113,17 +2113,17 @@ class mexc extends mexc$1 {
|
|
|
2113
2113
|
params['cost'] = cost;
|
|
2114
2114
|
return await this.createOrder(symbol, 'market', 'buy', 0, undefined, params);
|
|
2115
2115
|
}
|
|
2116
|
+
/**
|
|
2117
|
+
* @method
|
|
2118
|
+
* @name mexc#createMarketSellOrderWithCost
|
|
2119
|
+
* @description create a market sell order by providing the symbol and cost
|
|
2120
|
+
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#new-order
|
|
2121
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
2122
|
+
* @param {float} cost how much you want to trade in units of the quote currency
|
|
2123
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2124
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2125
|
+
*/
|
|
2116
2126
|
async createMarketSellOrderWithCost(symbol, cost, params = {}) {
|
|
2117
|
-
/**
|
|
2118
|
-
* @method
|
|
2119
|
-
* @name mexc#createMarketSellOrderWithCost
|
|
2120
|
-
* @description create a market sell order by providing the symbol and cost
|
|
2121
|
-
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#new-order
|
|
2122
|
-
* @param {string} symbol unified symbol of the market to create an order in
|
|
2123
|
-
* @param {float} cost how much you want to trade in units of the quote currency
|
|
2124
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2125
|
-
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2126
|
-
*/
|
|
2127
2127
|
await this.loadMarkets();
|
|
2128
2128
|
const market = this.market(symbol);
|
|
2129
2129
|
if (!market['spot']) {
|
|
@@ -2132,34 +2132,34 @@ class mexc extends mexc$1 {
|
|
|
2132
2132
|
params['cost'] = cost;
|
|
2133
2133
|
return await this.createOrder(symbol, 'market', 'sell', 0, undefined, params);
|
|
2134
2134
|
}
|
|
2135
|
+
/**
|
|
2136
|
+
* @method
|
|
2137
|
+
* @name mexc#createOrder
|
|
2138
|
+
* @description create a trade order
|
|
2139
|
+
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#new-order
|
|
2140
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#order-under-maintenance
|
|
2141
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#trigger-order-under-maintenance
|
|
2142
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
2143
|
+
* @param {string} type 'market' or 'limit'
|
|
2144
|
+
* @param {string} side 'buy' or 'sell'
|
|
2145
|
+
* @param {float} amount how much of currency you want to trade in units of base currency
|
|
2146
|
+
* @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
2147
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2148
|
+
* @param {string} [params.marginMode] only 'isolated' is supported for spot-margin trading
|
|
2149
|
+
* @param {float} [params.triggerPrice] The price at which a trigger order is triggered at
|
|
2150
|
+
* @param {bool} [params.postOnly] if true, the order will only be posted if it will be a maker order
|
|
2151
|
+
* @param {bool} [params.reduceOnly] *contract only* indicates if this order is to reduce the size of a position
|
|
2152
|
+
* @param {bool} [params.hedged] *swap only* true for hedged mode, false for one way mode, default is false
|
|
2153
|
+
*
|
|
2154
|
+
* EXCHANGE SPECIFIC PARAMETERS
|
|
2155
|
+
* @param {int} [params.leverage] *contract only* leverage is necessary on isolated margin
|
|
2156
|
+
* @param {long} [params.positionId] *contract only* it is recommended to fill in this parameter when closing a position
|
|
2157
|
+
* @param {string} [params.externalOid] *contract only* external order ID
|
|
2158
|
+
* @param {int} [params.positionMode] *contract only* 1:hedge, 2:one-way, default: the user's current config
|
|
2159
|
+
* @param {boolean} [params.test] *spot only* whether to use the test endpoint or not, default is false
|
|
2160
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2161
|
+
*/
|
|
2135
2162
|
async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
|
|
2136
|
-
/**
|
|
2137
|
-
* @method
|
|
2138
|
-
* @name mexc#createOrder
|
|
2139
|
-
* @description create a trade order
|
|
2140
|
-
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#new-order
|
|
2141
|
-
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#order-under-maintenance
|
|
2142
|
-
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#trigger-order-under-maintenance
|
|
2143
|
-
* @param {string} symbol unified symbol of the market to create an order in
|
|
2144
|
-
* @param {string} type 'market' or 'limit'
|
|
2145
|
-
* @param {string} side 'buy' or 'sell'
|
|
2146
|
-
* @param {float} amount how much of currency you want to trade in units of base currency
|
|
2147
|
-
* @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
2148
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2149
|
-
* @param {string} [params.marginMode] only 'isolated' is supported for spot-margin trading
|
|
2150
|
-
* @param {float} [params.triggerPrice] The price at which a trigger order is triggered at
|
|
2151
|
-
* @param {bool} [params.postOnly] if true, the order will only be posted if it will be a maker order
|
|
2152
|
-
* @param {bool} [params.reduceOnly] *contract only* indicates if this order is to reduce the size of a position
|
|
2153
|
-
* @param {bool} [params.hedged] *swap only* true for hedged mode, false for one way mode, default is false
|
|
2154
|
-
*
|
|
2155
|
-
* EXCHANGE SPECIFIC PARAMETERS
|
|
2156
|
-
* @param {int} [params.leverage] *contract only* leverage is necessary on isolated margin
|
|
2157
|
-
* @param {long} [params.positionId] *contract only* it is recommended to fill in this parameter when closing a position
|
|
2158
|
-
* @param {string} [params.externalOid] *contract only* external order ID
|
|
2159
|
-
* @param {int} [params.positionMode] *contract only* 1:hedge, 2:one-way, default: the user's current config
|
|
2160
|
-
* @param {boolean} [params.test] *spot only* whether to use the test endpoint or not, default is false
|
|
2161
|
-
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2162
|
-
*/
|
|
2163
2163
|
await this.loadMarkets();
|
|
2164
2164
|
const market = this.market(symbol);
|
|
2165
2165
|
const [marginMode, query] = this.handleMarginModeAndParams('createOrder', params);
|
|
@@ -2221,24 +2221,24 @@ class mexc extends mexc$1 {
|
|
|
2221
2221
|
}
|
|
2222
2222
|
return this.extend(request, params);
|
|
2223
2223
|
}
|
|
2224
|
+
/**
|
|
2225
|
+
* @ignore
|
|
2226
|
+
* @method
|
|
2227
|
+
* @name mexc#createSpotOrder
|
|
2228
|
+
* @description create a trade order
|
|
2229
|
+
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#new-order
|
|
2230
|
+
* @param {string} market unified symbol of the market to create an order in
|
|
2231
|
+
* @param {string} type 'market' or 'limit'
|
|
2232
|
+
* @param {string} side 'buy' or 'sell'
|
|
2233
|
+
* @param {float} amount how much of currency you want to trade in units of base currency
|
|
2234
|
+
* @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
2235
|
+
* @param {string} [marginMode] only 'isolated' is supported for spot-margin trading
|
|
2236
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2237
|
+
* @param {float} [params.triggerPrice] The price at which a trigger order is triggered at
|
|
2238
|
+
* @param {bool} [params.postOnly] if true, the order will only be posted if it will be a maker order
|
|
2239
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2240
|
+
*/
|
|
2224
2241
|
async createSpotOrder(market, type, side, amount, price = undefined, marginMode = undefined, params = {}) {
|
|
2225
|
-
/**
|
|
2226
|
-
* @ignore
|
|
2227
|
-
* @method
|
|
2228
|
-
* @name mexc#createSpotOrder
|
|
2229
|
-
* @description create a trade order
|
|
2230
|
-
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#new-order
|
|
2231
|
-
* @param {string} symbol unified symbol of the market to create an order in
|
|
2232
|
-
* @param {string} type 'market' or 'limit'
|
|
2233
|
-
* @param {string} side 'buy' or 'sell'
|
|
2234
|
-
* @param {float} amount how much of currency you want to trade in units of base currency
|
|
2235
|
-
* @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
2236
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2237
|
-
* @param {string} [params.marginMode] only 'isolated' is supported for spot-margin trading
|
|
2238
|
-
* @param {float} [params.triggerPrice] The price at which a trigger order is triggered at
|
|
2239
|
-
* @param {bool} [params.postOnly] if true, the order will only be posted if it will be a maker order
|
|
2240
|
-
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2241
|
-
*/
|
|
2242
2242
|
await this.loadMarkets();
|
|
2243
2243
|
const test = this.safeBool(params, 'test', false);
|
|
2244
2244
|
params = this.omit(params, 'test');
|
|
@@ -2280,34 +2280,34 @@ class mexc extends mexc$1 {
|
|
|
2280
2280
|
}
|
|
2281
2281
|
return order;
|
|
2282
2282
|
}
|
|
2283
|
+
/**
|
|
2284
|
+
* @ignore
|
|
2285
|
+
* @method
|
|
2286
|
+
* @name mexc#createOrder
|
|
2287
|
+
* @description create a trade order
|
|
2288
|
+
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#new-order
|
|
2289
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#order-under-maintenance
|
|
2290
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#trigger-order-under-maintenance
|
|
2291
|
+
* @param {string} market unified symbol of the market to create an order in
|
|
2292
|
+
* @param {string} type 'market' or 'limit'
|
|
2293
|
+
* @param {string} side 'buy' or 'sell'
|
|
2294
|
+
* @param {float} amount how much of currency you want to trade in units of base currency
|
|
2295
|
+
* @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
2296
|
+
* @param {string} [marginMode] only 'isolated' is supported for spot-margin trading
|
|
2297
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2298
|
+
* @param {float} [params.triggerPrice] The price at which a trigger order is triggered at
|
|
2299
|
+
* @param {bool} [params.postOnly] if true, the order will only be posted if it will be a maker order
|
|
2300
|
+
* @param {bool} [params.reduceOnly] indicates if this order is to reduce the size of a position
|
|
2301
|
+
* @param {bool} [params.hedged] *swap only* true for hedged mode, false for one way mode, default is false
|
|
2302
|
+
*
|
|
2303
|
+
* EXCHANGE SPECIFIC PARAMETERS
|
|
2304
|
+
* @param {int} [params.leverage] leverage is necessary on isolated margin
|
|
2305
|
+
* @param {long} [params.positionId] it is recommended to fill in this parameter when closing a position
|
|
2306
|
+
* @param {string} [params.externalOid] external order ID
|
|
2307
|
+
* @param {int} [params.positionMode] 1:hedge, 2:one-way, default: the user's current config
|
|
2308
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2309
|
+
*/
|
|
2283
2310
|
async createSwapOrder(market, type, side, amount, price = undefined, marginMode = undefined, params = {}) {
|
|
2284
|
-
/**
|
|
2285
|
-
* @ignore
|
|
2286
|
-
* @method
|
|
2287
|
-
* @name mexc#createOrder
|
|
2288
|
-
* @description create a trade order
|
|
2289
|
-
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#new-order
|
|
2290
|
-
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#order-under-maintenance
|
|
2291
|
-
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#trigger-order-under-maintenance
|
|
2292
|
-
* @param {string} symbol unified symbol of the market to create an order in
|
|
2293
|
-
* @param {string} type 'market' or 'limit'
|
|
2294
|
-
* @param {string} side 'buy' or 'sell'
|
|
2295
|
-
* @param {float} amount how much of currency you want to trade in units of base currency
|
|
2296
|
-
* @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
2297
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2298
|
-
* @param {string} [params.marginMode] only 'isolated' is supported for spot-margin trading
|
|
2299
|
-
* @param {float} [params.triggerPrice] The price at which a trigger order is triggered at
|
|
2300
|
-
* @param {bool} [params.postOnly] if true, the order will only be posted if it will be a maker order
|
|
2301
|
-
* @param {bool} [params.reduceOnly] indicates if this order is to reduce the size of a position
|
|
2302
|
-
* @param {bool} [params.hedged] *swap only* true for hedged mode, false for one way mode, default is false
|
|
2303
|
-
*
|
|
2304
|
-
* EXCHANGE SPECIFIC PARAMETERS
|
|
2305
|
-
* @param {int} [params.leverage] leverage is necessary on isolated margin
|
|
2306
|
-
* @param {long} [params.positionId] it is recommended to fill in this parameter when closing a position
|
|
2307
|
-
* @param {string} [params.externalOid] external order ID
|
|
2308
|
-
* @param {int} [params.positionMode] 1:hedge, 2:one-way, default: the user's current config
|
|
2309
|
-
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2310
|
-
*/
|
|
2311
2311
|
await this.loadMarkets();
|
|
2312
2312
|
const symbol = market['symbol'];
|
|
2313
2313
|
const unavailableContracts = this.safeValue(this.options, 'unavailableContracts', {});
|
|
@@ -2427,16 +2427,16 @@ class mexc extends mexc$1 {
|
|
|
2427
2427
|
const data = this.safeString(response, 'data');
|
|
2428
2428
|
return this.safeOrder({ 'id': data }, market);
|
|
2429
2429
|
}
|
|
2430
|
+
/**
|
|
2431
|
+
* @method
|
|
2432
|
+
* @name mexc#createOrders
|
|
2433
|
+
* @description *spot only* *all orders must have the same symbol* create a list of trade orders
|
|
2434
|
+
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#batch-orders
|
|
2435
|
+
* @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
|
|
2436
|
+
* @param {object} [params] extra parameters specific to api endpoint
|
|
2437
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2438
|
+
*/
|
|
2430
2439
|
async createOrders(orders, params = {}) {
|
|
2431
|
-
/**
|
|
2432
|
-
* @method
|
|
2433
|
-
* @name mexc#createOrders
|
|
2434
|
-
* @description *spot only* *all orders must have the same symbol* create a list of trade orders
|
|
2435
|
-
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#batch-orders
|
|
2436
|
-
* @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
|
|
2437
|
-
* @param {object} [params] extra parameters specific to api endpoint
|
|
2438
|
-
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2439
|
-
*/
|
|
2440
2440
|
await this.loadMarkets();
|
|
2441
2441
|
const ordersRequests = [];
|
|
2442
2442
|
let symbol = undefined;
|
|
@@ -2491,18 +2491,19 @@ class mexc extends mexc$1 {
|
|
|
2491
2491
|
//
|
|
2492
2492
|
return this.parseOrders(response);
|
|
2493
2493
|
}
|
|
2494
|
+
/**
|
|
2495
|
+
* @method
|
|
2496
|
+
* @name mexc#fetchOrder
|
|
2497
|
+
* @description fetches information on an order made by the user
|
|
2498
|
+
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#query-order
|
|
2499
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#query-the-order-based-on-the-order-number
|
|
2500
|
+
* @param {string} id order id
|
|
2501
|
+
* @param {string} symbol unified symbol of the market the order was made in
|
|
2502
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2503
|
+
* @param {string} [params.marginMode] only 'isolated' is supported, for spot-margin trading
|
|
2504
|
+
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2505
|
+
*/
|
|
2494
2506
|
async fetchOrder(id, symbol = undefined, params = {}) {
|
|
2495
|
-
/**
|
|
2496
|
-
* @method
|
|
2497
|
-
* @name mexc#fetchOrder
|
|
2498
|
-
* @description fetches information on an order made by the user
|
|
2499
|
-
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#query-order
|
|
2500
|
-
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#query-the-order-based-on-the-order-number
|
|
2501
|
-
* @param {string} symbol unified symbol of the market the order was made in
|
|
2502
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2503
|
-
* @param {string} [params.marginMode] only 'isolated' is supported, for spot-margin trading
|
|
2504
|
-
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2505
|
-
*/
|
|
2506
2507
|
if (symbol === undefined) {
|
|
2507
2508
|
throw new errors.ArgumentsRequired(this.id + ' fetchOrder() requires a symbol argument');
|
|
2508
2509
|
}
|
|
@@ -2615,22 +2616,22 @@ class mexc extends mexc$1 {
|
|
|
2615
2616
|
}
|
|
2616
2617
|
return this.parseOrder(data, market);
|
|
2617
2618
|
}
|
|
2619
|
+
/**
|
|
2620
|
+
* @method
|
|
2621
|
+
* @name mexc#fetchOrders
|
|
2622
|
+
* @description fetches information on multiple orders made by the user
|
|
2623
|
+
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#all-orders
|
|
2624
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-all-of-the-user-39-s-historical-orders
|
|
2625
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#gets-the-trigger-order-list
|
|
2626
|
+
* @param {string} symbol unified market symbol of the market orders were made in
|
|
2627
|
+
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
2628
|
+
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
2629
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2630
|
+
* @param {int} [params.until] the latest time in ms to fetch orders for
|
|
2631
|
+
* @param {string} [params.marginMode] only 'isolated' is supported, for spot-margin trading
|
|
2632
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2633
|
+
*/
|
|
2618
2634
|
async fetchOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
2619
|
-
/**
|
|
2620
|
-
* @method
|
|
2621
|
-
* @name mexc#fetchOrders
|
|
2622
|
-
* @description fetches information on multiple orders made by the user
|
|
2623
|
-
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#all-orders
|
|
2624
|
-
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-all-of-the-user-39-s-historical-orders
|
|
2625
|
-
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#gets-the-trigger-order-list
|
|
2626
|
-
* @param {string} symbol unified market symbol of the market orders were made in
|
|
2627
|
-
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
2628
|
-
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
2629
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2630
|
-
* @param {int} [params.until] the latest time in ms to fetch orders for
|
|
2631
|
-
* @param {string} [params.marginMode] only 'isolated' is supported, for spot-margin trading
|
|
2632
|
-
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2633
|
-
*/
|
|
2634
2635
|
await this.loadMarkets();
|
|
2635
2636
|
const request = {};
|
|
2636
2637
|
let market = undefined;
|
|
@@ -2868,21 +2869,21 @@ class mexc extends mexc$1 {
|
|
|
2868
2869
|
return this.parseOrders(data, market);
|
|
2869
2870
|
}
|
|
2870
2871
|
}
|
|
2872
|
+
/**
|
|
2873
|
+
* @method
|
|
2874
|
+
* @name mexc#fetchOpenOrders
|
|
2875
|
+
* @description fetch all unfilled currently open orders
|
|
2876
|
+
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#current-open-orders
|
|
2877
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-all-of-the-user-39-s-historical-orders
|
|
2878
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#gets-the-trigger-order-list
|
|
2879
|
+
* @param {string} symbol unified market symbol
|
|
2880
|
+
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
2881
|
+
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
2882
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2883
|
+
* @param {string} [params.marginMode] only 'isolated' is supported, for spot-margin trading
|
|
2884
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2885
|
+
*/
|
|
2871
2886
|
async fetchOpenOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
2872
|
-
/**
|
|
2873
|
-
* @method
|
|
2874
|
-
* @name mexc#fetchOpenOrders
|
|
2875
|
-
* @description fetch all unfilled currently open orders
|
|
2876
|
-
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#current-open-orders
|
|
2877
|
-
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-all-of-the-user-39-s-historical-orders
|
|
2878
|
-
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#gets-the-trigger-order-list
|
|
2879
|
-
* @param {string} symbol unified market symbol
|
|
2880
|
-
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
2881
|
-
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
2882
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2883
|
-
* @param {string} [params.marginMode] only 'isolated' is supported, for spot-margin trading
|
|
2884
|
-
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2885
|
-
*/
|
|
2886
2887
|
await this.loadMarkets();
|
|
2887
2888
|
const request = {};
|
|
2888
2889
|
let market = undefined;
|
|
@@ -2962,36 +2963,36 @@ class mexc extends mexc$1 {
|
|
|
2962
2963
|
return await this.fetchOrdersByState(2, symbol, since, limit, params);
|
|
2963
2964
|
}
|
|
2964
2965
|
}
|
|
2966
|
+
/**
|
|
2967
|
+
* @method
|
|
2968
|
+
* @name mexc#fetchClosedOrders
|
|
2969
|
+
* @description fetches information on multiple closed orders made by the user
|
|
2970
|
+
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#all-orders
|
|
2971
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-all-of-the-user-39-s-historical-orders
|
|
2972
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#gets-the-trigger-order-list
|
|
2973
|
+
* @param {string} symbol unified market symbol of the market orders were made in
|
|
2974
|
+
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
2975
|
+
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
2976
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2977
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2978
|
+
*/
|
|
2965
2979
|
async fetchClosedOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
2966
|
-
/**
|
|
2967
|
-
* @method
|
|
2968
|
-
* @name mexc#fetchClosedOrders
|
|
2969
|
-
* @description fetches information on multiple closed orders made by the user
|
|
2970
|
-
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#all-orders
|
|
2971
|
-
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-all-of-the-user-39-s-historical-orders
|
|
2972
|
-
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#gets-the-trigger-order-list
|
|
2973
|
-
* @param {string} symbol unified market symbol of the market orders were made in
|
|
2974
|
-
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
2975
|
-
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
2976
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2977
|
-
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2978
|
-
*/
|
|
2979
2980
|
return await this.fetchOrdersByState(3, symbol, since, limit, params);
|
|
2980
2981
|
}
|
|
2982
|
+
/**
|
|
2983
|
+
* @method
|
|
2984
|
+
* @name mexc#fetchCanceledOrders
|
|
2985
|
+
* @description fetches information on multiple canceled orders made by the user
|
|
2986
|
+
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#all-orders
|
|
2987
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-all-of-the-user-39-s-historical-orders
|
|
2988
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#gets-the-trigger-order-list
|
|
2989
|
+
* @param {string} symbol unified market symbol of the market orders were made in
|
|
2990
|
+
* @param {int} [since] timestamp in ms of the earliest order, default is undefined
|
|
2991
|
+
* @param {int} [limit] max number of orders to return, default is undefined
|
|
2992
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2993
|
+
* @returns {object} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2994
|
+
*/
|
|
2981
2995
|
async fetchCanceledOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
2982
|
-
/**
|
|
2983
|
-
* @method
|
|
2984
|
-
* @name mexc#fetchCanceledOrders
|
|
2985
|
-
* @description fetches information on multiple canceled orders made by the user
|
|
2986
|
-
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#all-orders
|
|
2987
|
-
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-all-of-the-user-39-s-historical-orders
|
|
2988
|
-
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#gets-the-trigger-order-list
|
|
2989
|
-
* @param {string} symbol unified market symbol of the market orders were made in
|
|
2990
|
-
* @param {int} [since] timestamp in ms of the earliest order, default is undefined
|
|
2991
|
-
* @param {int} [limit] max number of orders to return, default is undefined
|
|
2992
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2993
|
-
* @returns {object} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
2994
|
-
*/
|
|
2995
2996
|
return await this.fetchOrdersByState(4, symbol, since, limit, params);
|
|
2996
2997
|
}
|
|
2997
2998
|
async fetchOrdersByState(state, symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
@@ -3010,20 +3011,20 @@ class mexc extends mexc$1 {
|
|
|
3010
3011
|
return await this.fetchOrders(symbol, since, limit, this.extend(request, params));
|
|
3011
3012
|
}
|
|
3012
3013
|
}
|
|
3014
|
+
/**
|
|
3015
|
+
* @method
|
|
3016
|
+
* @name mexc#cancelOrder
|
|
3017
|
+
* @description cancels an open order
|
|
3018
|
+
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#cancel-order
|
|
3019
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#cancel-the-order-under-maintenance
|
|
3020
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#cancel-the-stop-limit-trigger-order-under-maintenance
|
|
3021
|
+
* @param {string} id order id
|
|
3022
|
+
* @param {string} symbol unified symbol of the market the order was made in
|
|
3023
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3024
|
+
* @param {string} [params.marginMode] only 'isolated' is supported for spot-margin trading
|
|
3025
|
+
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
3026
|
+
*/
|
|
3013
3027
|
async cancelOrder(id, symbol = undefined, params = {}) {
|
|
3014
|
-
/**
|
|
3015
|
-
* @method
|
|
3016
|
-
* @name mexc#cancelOrder
|
|
3017
|
-
* @description cancels an open order
|
|
3018
|
-
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#cancel-order
|
|
3019
|
-
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#cancel-the-order-under-maintenance
|
|
3020
|
-
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#cancel-the-stop-limit-trigger-order-under-maintenance
|
|
3021
|
-
* @param {string} id order id
|
|
3022
|
-
* @param {string} symbol unified symbol of the market the order was made in
|
|
3023
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3024
|
-
* @param {string} [params.marginMode] only 'isolated' is supported for spot-margin trading
|
|
3025
|
-
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
3026
|
-
*/
|
|
3027
3028
|
await this.loadMarkets();
|
|
3028
3029
|
let market = undefined;
|
|
3029
3030
|
if (symbol !== undefined) {
|
|
@@ -3129,17 +3130,17 @@ class mexc extends mexc$1 {
|
|
|
3129
3130
|
}
|
|
3130
3131
|
return this.parseOrder(data, market);
|
|
3131
3132
|
}
|
|
3133
|
+
/**
|
|
3134
|
+
* @method
|
|
3135
|
+
* @name mexc#cancelOrders
|
|
3136
|
+
* @description cancel multiple orders
|
|
3137
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#cancel-the-order-under-maintenance
|
|
3138
|
+
* @param {string[]} ids order ids
|
|
3139
|
+
* @param {string} symbol unified market symbol, default is undefined
|
|
3140
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3141
|
+
* @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
3142
|
+
*/
|
|
3132
3143
|
async cancelOrders(ids, symbol = undefined, params = {}) {
|
|
3133
|
-
/**
|
|
3134
|
-
* @method
|
|
3135
|
-
* @name mexc#cancelOrders
|
|
3136
|
-
* @description cancel multiple orders
|
|
3137
|
-
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#cancel-the-order-under-maintenance
|
|
3138
|
-
* @param {string[]} ids order ids
|
|
3139
|
-
* @param {string} symbol unified market symbol, default is undefined
|
|
3140
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3141
|
-
* @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
3142
|
-
*/
|
|
3143
3144
|
await this.loadMarkets();
|
|
3144
3145
|
const market = (symbol !== undefined) ? this.market(symbol) : undefined;
|
|
3145
3146
|
const [marketType] = this.handleMarketTypeAndParams('cancelOrders', market, params);
|
|
@@ -3165,19 +3166,19 @@ class mexc extends mexc$1 {
|
|
|
3165
3166
|
return this.parseOrders(data, market);
|
|
3166
3167
|
}
|
|
3167
3168
|
}
|
|
3169
|
+
/**
|
|
3170
|
+
* @method
|
|
3171
|
+
* @name mexc#cancelAllOrders
|
|
3172
|
+
* @description cancel all open orders
|
|
3173
|
+
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#cancel-all-open-orders-on-a-symbol
|
|
3174
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#cancel-all-orders-under-a-contract-under-maintenance
|
|
3175
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#cancel-all-trigger-orders-under-maintenance
|
|
3176
|
+
* @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
|
|
3177
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3178
|
+
* @param {string} [params.marginMode] only 'isolated' is supported for spot-margin trading
|
|
3179
|
+
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
3180
|
+
*/
|
|
3168
3181
|
async cancelAllOrders(symbol = undefined, params = {}) {
|
|
3169
|
-
/**
|
|
3170
|
-
* @method
|
|
3171
|
-
* @name mexc#cancelAllOrders
|
|
3172
|
-
* @description cancel all open orders
|
|
3173
|
-
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#cancel-all-open-orders-on-a-symbol
|
|
3174
|
-
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#cancel-all-orders-under-a-contract-under-maintenance
|
|
3175
|
-
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#cancel-all-trigger-orders-under-maintenance
|
|
3176
|
-
* @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
|
|
3177
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3178
|
-
* @param {string} [params.marginMode] only 'isolated' is supported for spot-margin trading
|
|
3179
|
-
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
3180
|
-
*/
|
|
3181
3182
|
await this.loadMarkets();
|
|
3182
3183
|
const market = (symbol !== undefined) ? this.market(symbol) : undefined;
|
|
3183
3184
|
const request = {};
|
|
@@ -3571,16 +3572,16 @@ class mexc extends mexc$1 {
|
|
|
3571
3572
|
}
|
|
3572
3573
|
return undefined;
|
|
3573
3574
|
}
|
|
3575
|
+
/**
|
|
3576
|
+
* @method
|
|
3577
|
+
* @name mexc#fetchAccounts
|
|
3578
|
+
* @description fetch all the accounts associated with a profile
|
|
3579
|
+
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#account-information
|
|
3580
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-all-informations-of-user-39-s-asset
|
|
3581
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3582
|
+
* @returns {object} a dictionary of [account structures]{@link https://docs.ccxt.com/#/?id=account-structure} indexed by the account type
|
|
3583
|
+
*/
|
|
3574
3584
|
async fetchAccounts(params = {}) {
|
|
3575
|
-
/**
|
|
3576
|
-
* @method
|
|
3577
|
-
* @name mexc#fetchAccounts
|
|
3578
|
-
* @description fetch all the accounts associated with a profile
|
|
3579
|
-
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#account-information
|
|
3580
|
-
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-all-informations-of-user-39-s-asset
|
|
3581
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3582
|
-
* @returns {object} a dictionary of [account structures]{@link https://docs.ccxt.com/#/?id=account-structure} indexed by the account type
|
|
3583
|
-
*/
|
|
3584
3585
|
// TODO: is the below endpoints suitable for fetchAccounts?
|
|
3585
3586
|
const [marketType, query] = this.handleMarketTypeAndParams('fetchAccounts', undefined, params);
|
|
3586
3587
|
await this.loadMarkets();
|
|
@@ -3600,16 +3601,16 @@ class mexc extends mexc$1 {
|
|
|
3600
3601
|
}
|
|
3601
3602
|
return result;
|
|
3602
3603
|
}
|
|
3604
|
+
/**
|
|
3605
|
+
* @method
|
|
3606
|
+
* @name mexc#fetchTradingFees
|
|
3607
|
+
* @description fetch the trading fees for multiple markets
|
|
3608
|
+
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#account-information
|
|
3609
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-all-informations-of-user-39-s-asset
|
|
3610
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3611
|
+
* @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
|
|
3612
|
+
*/
|
|
3603
3613
|
async fetchTradingFees(params = {}) {
|
|
3604
|
-
/**
|
|
3605
|
-
* @method
|
|
3606
|
-
* @name mexc#fetchTradingFees
|
|
3607
|
-
* @description fetch the trading fees for multiple markets
|
|
3608
|
-
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#account-information
|
|
3609
|
-
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-all-informations-of-user-39-s-asset
|
|
3610
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3611
|
-
* @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
|
|
3612
|
-
*/
|
|
3613
3614
|
await this.loadMarkets();
|
|
3614
3615
|
const response = await this.fetchAccountHelper('spot', params);
|
|
3615
3616
|
let makerFee = this.safeString(response, 'makerCommission');
|
|
@@ -3753,18 +3754,18 @@ class mexc extends mexc$1 {
|
|
|
3753
3754
|
account['debt'] = Precise["default"].stringAdd(debt, interest);
|
|
3754
3755
|
return account;
|
|
3755
3756
|
}
|
|
3757
|
+
/**
|
|
3758
|
+
* @method
|
|
3759
|
+
* @name mexc#fetchBalance
|
|
3760
|
+
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
3761
|
+
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#account-information
|
|
3762
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-all-informations-of-user-39-s-asset
|
|
3763
|
+
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#isolated-account
|
|
3764
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3765
|
+
* @param {string} [params.symbols] // required for margin, market id's separated by commas
|
|
3766
|
+
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
3767
|
+
*/
|
|
3756
3768
|
async fetchBalance(params = {}) {
|
|
3757
|
-
/**
|
|
3758
|
-
* @method
|
|
3759
|
-
* @name mexc#fetchBalance
|
|
3760
|
-
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
3761
|
-
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#account-information
|
|
3762
|
-
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-all-informations-of-user-39-s-asset
|
|
3763
|
-
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#isolated-account
|
|
3764
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3765
|
-
* @param {string} [params.symbols] // required for margin, market id's separated by commas
|
|
3766
|
-
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
3767
|
-
*/
|
|
3768
3769
|
await this.loadMarkets();
|
|
3769
3770
|
let marketType = undefined;
|
|
3770
3771
|
const request = {};
|
|
@@ -3887,20 +3888,20 @@ class mexc extends mexc$1 {
|
|
|
3887
3888
|
//
|
|
3888
3889
|
return this.customParseBalance(response, marketType);
|
|
3889
3890
|
}
|
|
3891
|
+
/**
|
|
3892
|
+
* @method
|
|
3893
|
+
* @name mexc#fetchMyTrades
|
|
3894
|
+
* @description fetch all trades made by the user
|
|
3895
|
+
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#account-trade-list
|
|
3896
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-all-transaction-details-of-the-user-s-order
|
|
3897
|
+
* @param {string} symbol unified market symbol
|
|
3898
|
+
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
3899
|
+
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
3900
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3901
|
+
* @param {int} [params.until] the latest time in ms to fetch trades for
|
|
3902
|
+
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
3903
|
+
*/
|
|
3890
3904
|
async fetchMyTrades(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
3891
|
-
/**
|
|
3892
|
-
* @method
|
|
3893
|
-
* @name mexc#fetchMyTrades
|
|
3894
|
-
* @description fetch all trades made by the user
|
|
3895
|
-
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#account-trade-list
|
|
3896
|
-
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-all-transaction-details-of-the-user-s-order
|
|
3897
|
-
* @param {string} symbol unified market symbol
|
|
3898
|
-
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
3899
|
-
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
3900
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3901
|
-
* @param {int} [params.until] the latest time in ms to fetch trades for
|
|
3902
|
-
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
3903
|
-
*/
|
|
3904
3905
|
if (symbol === undefined) {
|
|
3905
3906
|
throw new errors.ArgumentsRequired(this.id + ' fetchMyTrades() requires a symbol argument');
|
|
3906
3907
|
}
|
|
@@ -3986,20 +3987,20 @@ class mexc extends mexc$1 {
|
|
|
3986
3987
|
}
|
|
3987
3988
|
return this.parseTrades(trades, market, since, limit);
|
|
3988
3989
|
}
|
|
3990
|
+
/**
|
|
3991
|
+
* @method
|
|
3992
|
+
* @name mexc#fetchOrderTrades
|
|
3993
|
+
* @description fetch all the trades made from a single order
|
|
3994
|
+
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#account-trade-list
|
|
3995
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#query-the-order-based-on-the-order-number
|
|
3996
|
+
* @param {string} id order id
|
|
3997
|
+
* @param {string} symbol unified market symbol
|
|
3998
|
+
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
3999
|
+
* @param {int} [limit] the maximum number of trades to retrieve
|
|
4000
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4001
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
4002
|
+
*/
|
|
3989
4003
|
async fetchOrderTrades(id, symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
3990
|
-
/**
|
|
3991
|
-
* @method
|
|
3992
|
-
* @name mexc#fetchOrderTrades
|
|
3993
|
-
* @description fetch all the trades made from a single order
|
|
3994
|
-
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#account-trade-list
|
|
3995
|
-
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#query-the-order-based-on-the-order-number
|
|
3996
|
-
* @param {string} id order id
|
|
3997
|
-
* @param {string} symbol unified market symbol
|
|
3998
|
-
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
3999
|
-
* @param {int} [limit] the maximum number of trades to retrieve
|
|
4000
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4001
|
-
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
4002
|
-
*/
|
|
4003
4004
|
await this.loadMarkets();
|
|
4004
4005
|
const request = {};
|
|
4005
4006
|
let market = undefined;
|
|
@@ -4086,43 +4087,43 @@ class mexc extends mexc$1 {
|
|
|
4086
4087
|
// }
|
|
4087
4088
|
return response;
|
|
4088
4089
|
}
|
|
4090
|
+
/**
|
|
4091
|
+
* @method
|
|
4092
|
+
* @name mexc#reduceMargin
|
|
4093
|
+
* @description remove margin from a position
|
|
4094
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#increase-or-decrease-margin
|
|
4095
|
+
* @param {string} symbol unified market symbol
|
|
4096
|
+
* @param {float} amount the amount of margin to remove
|
|
4097
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4098
|
+
* @returns {object} a [margin structure]{@link https://docs.ccxt.com/#/?id=reduce-margin-structure}
|
|
4099
|
+
*/
|
|
4089
4100
|
async reduceMargin(symbol, amount, params = {}) {
|
|
4090
|
-
/**
|
|
4091
|
-
* @method
|
|
4092
|
-
* @name mexc#reduceMargin
|
|
4093
|
-
* @description remove margin from a position
|
|
4094
|
-
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#increase-or-decrease-margin
|
|
4095
|
-
* @param {string} symbol unified market symbol
|
|
4096
|
-
* @param {float} amount the amount of margin to remove
|
|
4097
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4098
|
-
* @returns {object} a [margin structure]{@link https://docs.ccxt.com/#/?id=reduce-margin-structure}
|
|
4099
|
-
*/
|
|
4100
4101
|
return await this.modifyMarginHelper(symbol, amount, 'SUB', params);
|
|
4101
4102
|
}
|
|
4103
|
+
/**
|
|
4104
|
+
* @method
|
|
4105
|
+
* @name mexc#addMargin
|
|
4106
|
+
* @description add margin
|
|
4107
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#increase-or-decrease-margin
|
|
4108
|
+
* @param {string} symbol unified market symbol
|
|
4109
|
+
* @param {float} amount amount of margin to add
|
|
4110
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4111
|
+
* @returns {object} a [margin structure]{@link https://docs.ccxt.com/#/?id=add-margin-structure}
|
|
4112
|
+
*/
|
|
4102
4113
|
async addMargin(symbol, amount, params = {}) {
|
|
4103
|
-
/**
|
|
4104
|
-
* @method
|
|
4105
|
-
* @name mexc#addMargin
|
|
4106
|
-
* @description add margin
|
|
4107
|
-
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#increase-or-decrease-margin
|
|
4108
|
-
* @param {string} symbol unified market symbol
|
|
4109
|
-
* @param {float} amount amount of margin to add
|
|
4110
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4111
|
-
* @returns {object} a [margin structure]{@link https://docs.ccxt.com/#/?id=add-margin-structure}
|
|
4112
|
-
*/
|
|
4113
4114
|
return await this.modifyMarginHelper(symbol, amount, 'ADD', params);
|
|
4114
4115
|
}
|
|
4116
|
+
/**
|
|
4117
|
+
* @method
|
|
4118
|
+
* @name mexc#setLeverage
|
|
4119
|
+
* @description set the level of leverage for a market
|
|
4120
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#switch-leverage
|
|
4121
|
+
* @param {float} leverage the rate of leverage
|
|
4122
|
+
* @param {string} symbol unified market symbol
|
|
4123
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4124
|
+
* @returns {object} response from the exchange
|
|
4125
|
+
*/
|
|
4115
4126
|
async setLeverage(leverage, symbol = undefined, params = {}) {
|
|
4116
|
-
/**
|
|
4117
|
-
* @method
|
|
4118
|
-
* @name mexc#setLeverage
|
|
4119
|
-
* @description set the level of leverage for a market
|
|
4120
|
-
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#switch-leverage
|
|
4121
|
-
* @param {float} leverage the rate of leverage
|
|
4122
|
-
* @param {string} symbol unified market symbol
|
|
4123
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4124
|
-
* @returns {object} response from the exchange
|
|
4125
|
-
*/
|
|
4126
4127
|
await this.loadMarkets();
|
|
4127
4128
|
const request = {
|
|
4128
4129
|
'leverage': leverage,
|
|
@@ -4146,18 +4147,18 @@ class mexc extends mexc$1 {
|
|
|
4146
4147
|
}
|
|
4147
4148
|
return await this.contractPrivatePostPositionChangeLeverage(this.extend(request, params));
|
|
4148
4149
|
}
|
|
4150
|
+
/**
|
|
4151
|
+
* @method
|
|
4152
|
+
* @name mexc#fetchFundingHistory
|
|
4153
|
+
* @description fetch the history of funding payments paid and received on this account
|
|
4154
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-details-of-user-s-funding-rate
|
|
4155
|
+
* @param {string} symbol unified market symbol
|
|
4156
|
+
* @param {int} [since] the earliest time in ms to fetch funding history for
|
|
4157
|
+
* @param {int} [limit] the maximum number of funding history structures to retrieve
|
|
4158
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4159
|
+
* @returns {object} a [funding history structure]{@link https://docs.ccxt.com/#/?id=funding-history-structure}
|
|
4160
|
+
*/
|
|
4149
4161
|
async fetchFundingHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
4150
|
-
/**
|
|
4151
|
-
* @method
|
|
4152
|
-
* @name mexc#fetchFundingHistory
|
|
4153
|
-
* @description fetch the history of funding payments paid and received on this account
|
|
4154
|
-
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-details-of-user-s-funding-rate
|
|
4155
|
-
* @param {string} symbol unified market symbol
|
|
4156
|
-
* @param {int} [since] the earliest time in ms to fetch funding history for
|
|
4157
|
-
* @param {int} [limit] the maximum number of funding history structures to retrieve
|
|
4158
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4159
|
-
* @returns {object} a [funding history structure]{@link https://docs.ccxt.com/#/?id=funding-history-structure}
|
|
4160
|
-
*/
|
|
4161
4162
|
await this.loadMarkets();
|
|
4162
4163
|
let market = undefined;
|
|
4163
4164
|
const request = {
|
|
@@ -4267,28 +4268,28 @@ class mexc extends mexc$1 {
|
|
|
4267
4268
|
'interval': intervalString,
|
|
4268
4269
|
};
|
|
4269
4270
|
}
|
|
4271
|
+
/**
|
|
4272
|
+
* @method
|
|
4273
|
+
* @name mexc#fetchFundingInterval
|
|
4274
|
+
* @description fetch the current funding rate interval
|
|
4275
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-contract-funding-rate
|
|
4276
|
+
* @param {string} symbol unified market symbol
|
|
4277
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4278
|
+
* @returns {object} a [funding rate structure]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
|
|
4279
|
+
*/
|
|
4270
4280
|
async fetchFundingInterval(symbol, params = {}) {
|
|
4271
|
-
/**
|
|
4272
|
-
* @method
|
|
4273
|
-
* @name mexc#fetchFundingInterval
|
|
4274
|
-
* @description fetch the current funding rate interval
|
|
4275
|
-
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-contract-funding-rate
|
|
4276
|
-
* @param {string} symbol unified market symbol
|
|
4277
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4278
|
-
* @returns {object} a [funding rate structure]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
|
|
4279
|
-
*/
|
|
4280
4281
|
return await this.fetchFundingRate(symbol, params);
|
|
4281
4282
|
}
|
|
4283
|
+
/**
|
|
4284
|
+
* @method
|
|
4285
|
+
* @name mexc#fetchFundingRate
|
|
4286
|
+
* @description fetch the current funding rate
|
|
4287
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-contract-funding-rate
|
|
4288
|
+
* @param {string} symbol unified market symbol
|
|
4289
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4290
|
+
* @returns {object} a [funding rate structure]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
|
|
4291
|
+
*/
|
|
4282
4292
|
async fetchFundingRate(symbol, params = {}) {
|
|
4283
|
-
/**
|
|
4284
|
-
* @method
|
|
4285
|
-
* @name mexc#fetchFundingRate
|
|
4286
|
-
* @description fetch the current funding rate
|
|
4287
|
-
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-contract-funding-rate
|
|
4288
|
-
* @param {string} symbol unified market symbol
|
|
4289
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4290
|
-
* @returns {object} a [funding rate structure]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
|
|
4291
|
-
*/
|
|
4292
4293
|
await this.loadMarkets();
|
|
4293
4294
|
const market = this.market(symbol);
|
|
4294
4295
|
const request = {
|
|
@@ -4313,18 +4314,18 @@ class mexc extends mexc$1 {
|
|
|
4313
4314
|
const result = this.safeValue(response, 'data', {});
|
|
4314
4315
|
return this.parseFundingRate(result, market);
|
|
4315
4316
|
}
|
|
4317
|
+
/**
|
|
4318
|
+
* @method
|
|
4319
|
+
* @name mexc#fetchFundingRateHistory
|
|
4320
|
+
* @description fetches historical funding rate prices
|
|
4321
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-contract-funding-rate-history
|
|
4322
|
+
* @param {string} symbol unified symbol of the market to fetch the funding rate history for
|
|
4323
|
+
* @param {int} [since] not used by mexc, but filtered internally by ccxt
|
|
4324
|
+
* @param {int} [limit] mexc limit is page_size default 20, maximum is 100
|
|
4325
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4326
|
+
* @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure}
|
|
4327
|
+
*/
|
|
4316
4328
|
async fetchFundingRateHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
4317
|
-
/**
|
|
4318
|
-
* @method
|
|
4319
|
-
* @name mexc#fetchFundingRateHistory
|
|
4320
|
-
* @description fetches historical funding rate prices
|
|
4321
|
-
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-contract-funding-rate-history
|
|
4322
|
-
* @param {string} symbol unified symbol of the market to fetch the funding rate history for
|
|
4323
|
-
* @param {int} [since] not used by mexc, but filtered internally by ccxt
|
|
4324
|
-
* @param {int} [limit] mexc limit is page_size default 20, maximum is 100
|
|
4325
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4326
|
-
* @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure}
|
|
4327
|
-
*/
|
|
4328
4329
|
if (symbol === undefined) {
|
|
4329
4330
|
throw new errors.ArgumentsRequired(this.id + ' fetchFundingRateHistory() requires a symbol argument');
|
|
4330
4331
|
}
|
|
@@ -4382,16 +4383,16 @@ class mexc extends mexc$1 {
|
|
|
4382
4383
|
const sorted = this.sortBy(rates, 'timestamp');
|
|
4383
4384
|
return this.filterBySymbolSinceLimit(sorted, market['symbol'], since, limit);
|
|
4384
4385
|
}
|
|
4386
|
+
/**
|
|
4387
|
+
* @method
|
|
4388
|
+
* @name mexc#fetchLeverageTiers
|
|
4389
|
+
* @description retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes, if a market has a leverage tier of 0, then the leverage tiers cannot be obtained for this market
|
|
4390
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-the-contract-information
|
|
4391
|
+
* @param {string[]} [symbols] list of unified market symbols
|
|
4392
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4393
|
+
* @returns {object} a dictionary of [leverage tiers structures]{@link https://docs.ccxt.com/#/?id=leverage-tiers-structure}, indexed by market symbols
|
|
4394
|
+
*/
|
|
4385
4395
|
async fetchLeverageTiers(symbols = undefined, params = {}) {
|
|
4386
|
-
/**
|
|
4387
|
-
* @method
|
|
4388
|
-
* @name mexc#fetchLeverageTiers
|
|
4389
|
-
* @description retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes, if a market has a leverage tier of 0, then the leverage tiers cannot be obtained for this market
|
|
4390
|
-
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-the-contract-information
|
|
4391
|
-
* @param {string[]} [symbols] list of unified market symbols
|
|
4392
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4393
|
-
* @returns {object} a dictionary of [leverage tiers structures]{@link https://docs.ccxt.com/#/?id=leverage-tiers-structure}, indexed by market symbols
|
|
4394
|
-
*/
|
|
4395
4396
|
await this.loadMarkets();
|
|
4396
4397
|
symbols = this.marketSymbols(symbols, 'swap', true, true);
|
|
4397
4398
|
const response = await this.contractPublicGetDetail(params);
|
|
@@ -4482,6 +4483,7 @@ class mexc extends mexc$1 {
|
|
|
4482
4483
|
// "isHidden": false
|
|
4483
4484
|
// }
|
|
4484
4485
|
//
|
|
4486
|
+
const marketId = this.safeString(info, 'symbol');
|
|
4485
4487
|
let maintenanceMarginRate = this.safeString(info, 'maintenanceMarginRate');
|
|
4486
4488
|
let initialMarginRate = this.safeString(info, 'initialMarginRate');
|
|
4487
4489
|
const maxVol = this.safeString(info, 'maxVol');
|
|
@@ -4495,6 +4497,7 @@ class mexc extends mexc$1 {
|
|
|
4495
4497
|
return [
|
|
4496
4498
|
{
|
|
4497
4499
|
'tier': 0,
|
|
4500
|
+
'symbol': this.safeSymbol(marketId, market, undefined, 'contract'),
|
|
4498
4501
|
'currency': this.safeCurrencyCode(quoteId),
|
|
4499
4502
|
'minNotional': undefined,
|
|
4500
4503
|
'maxNotional': undefined,
|
|
@@ -4508,6 +4511,7 @@ class mexc extends mexc$1 {
|
|
|
4508
4511
|
const cap = Precise["default"].stringAdd(floor, riskIncrVol);
|
|
4509
4512
|
tiers.push({
|
|
4510
4513
|
'tier': this.parseNumber(Precise["default"].stringDiv(cap, riskIncrVol)),
|
|
4514
|
+
'symbol': this.safeSymbol(marketId, market, undefined, 'contract'),
|
|
4511
4515
|
'currency': this.safeCurrencyCode(quoteId),
|
|
4512
4516
|
'minNotional': this.parseNumber(floor),
|
|
4513
4517
|
'maxNotional': this.parseNumber(cap),
|
|
@@ -4542,16 +4546,16 @@ class mexc extends mexc$1 {
|
|
|
4542
4546
|
'tag': this.safeString(depositAddress, 'memo'),
|
|
4543
4547
|
};
|
|
4544
4548
|
}
|
|
4549
|
+
/**
|
|
4550
|
+
* @method
|
|
4551
|
+
* @name mexc#fetchDepositAddressesByNetwork
|
|
4552
|
+
* @description fetch a dictionary of addresses for a currency, indexed by network
|
|
4553
|
+
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#deposit-address-supporting-network
|
|
4554
|
+
* @param {string} code unified currency code of the currency for the deposit address
|
|
4555
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4556
|
+
* @returns {object} a dictionary of [address structures]{@link https://docs.ccxt.com/#/?id=address-structure} indexed by the network
|
|
4557
|
+
*/
|
|
4545
4558
|
async fetchDepositAddressesByNetwork(code, params = {}) {
|
|
4546
|
-
/**
|
|
4547
|
-
* @method
|
|
4548
|
-
* @name mexc#fetchDepositAddressesByNetwork
|
|
4549
|
-
* @description fetch a dictionary of addresses for a currency, indexed by network
|
|
4550
|
-
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#deposit-address-supporting-network
|
|
4551
|
-
* @param {string} code unified currency code of the currency for the deposit address
|
|
4552
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4553
|
-
* @returns {object} a dictionary of [address structures]{@link https://docs.ccxt.com/#/?id=address-structure} indexed by the network
|
|
4554
|
-
*/
|
|
4555
4559
|
await this.loadMarkets();
|
|
4556
4560
|
const currency = this.currency(code);
|
|
4557
4561
|
const request = {
|
|
@@ -4591,17 +4595,17 @@ class mexc extends mexc$1 {
|
|
|
4591
4595
|
const addressStructures = this.parseDepositAddresses(response, undefined, false);
|
|
4592
4596
|
return this.indexBy(addressStructures, 'network');
|
|
4593
4597
|
}
|
|
4598
|
+
/**
|
|
4599
|
+
* @method
|
|
4600
|
+
* @name mexc#createDepositAddress
|
|
4601
|
+
* @description create a currency deposit address
|
|
4602
|
+
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#generate-deposit-address-supporting-network
|
|
4603
|
+
* @param {string} code unified currency code of the currency for the deposit address
|
|
4604
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4605
|
+
* @param {string} [params.network] the blockchain network name
|
|
4606
|
+
* @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
|
|
4607
|
+
*/
|
|
4594
4608
|
async createDepositAddress(code, params = {}) {
|
|
4595
|
-
/**
|
|
4596
|
-
* @method
|
|
4597
|
-
* @name mexc#createDepositAddress
|
|
4598
|
-
* @description create a currency deposit address
|
|
4599
|
-
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#generate-deposit-address-supporting-network
|
|
4600
|
-
* @param {string} code unified currency code of the currency for the deposit address
|
|
4601
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4602
|
-
* @param {string} [params.network] the blockchain network name
|
|
4603
|
-
* @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
|
|
4604
|
-
*/
|
|
4605
4609
|
await this.loadMarkets();
|
|
4606
4610
|
const currency = this.currency(code);
|
|
4607
4611
|
const request = {
|
|
@@ -4636,17 +4640,17 @@ class mexc extends mexc$1 {
|
|
|
4636
4640
|
// }
|
|
4637
4641
|
return this.parseDepositAddress(response, currency);
|
|
4638
4642
|
}
|
|
4643
|
+
/**
|
|
4644
|
+
* @method
|
|
4645
|
+
* @name mexc#fetchDepositAddress
|
|
4646
|
+
* @description fetch the deposit address for a currency associated with this account
|
|
4647
|
+
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#deposit-address-supporting-network
|
|
4648
|
+
* @param {string} code unified currency code
|
|
4649
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4650
|
+
* @param {string} [params.network] the chain of currency, this only apply for multi-chain currency, and there is no need for single chain currency
|
|
4651
|
+
* @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
|
|
4652
|
+
*/
|
|
4639
4653
|
async fetchDepositAddress(code, params = {}) {
|
|
4640
|
-
/**
|
|
4641
|
-
* @method
|
|
4642
|
-
* @name mexc#fetchDepositAddress
|
|
4643
|
-
* @description fetch the deposit address for a currency associated with this account
|
|
4644
|
-
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#deposit-address-supporting-network
|
|
4645
|
-
* @param {string} code unified currency code
|
|
4646
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4647
|
-
* @param {string} [params.network] the chain of currency, this only apply for multi-chain currency, and there is no need for single chain currency
|
|
4648
|
-
* @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
|
|
4649
|
-
*/
|
|
4650
4654
|
const network = this.safeString(params, 'network');
|
|
4651
4655
|
const addressStructures = await this.fetchDepositAddressesByNetwork(code, params);
|
|
4652
4656
|
let result = undefined;
|
|
@@ -4670,18 +4674,18 @@ class mexc extends mexc$1 {
|
|
|
4670
4674
|
}
|
|
4671
4675
|
return result;
|
|
4672
4676
|
}
|
|
4677
|
+
/**
|
|
4678
|
+
* @method
|
|
4679
|
+
* @name mexc#fetchDeposits
|
|
4680
|
+
* @description fetch all deposits made to an account
|
|
4681
|
+
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#deposit-history-supporting-network
|
|
4682
|
+
* @param {string} code unified currency code
|
|
4683
|
+
* @param {int} [since] the earliest time in ms to fetch deposits for
|
|
4684
|
+
* @param {int} [limit] the maximum number of deposits structures to retrieve
|
|
4685
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4686
|
+
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
4687
|
+
*/
|
|
4673
4688
|
async fetchDeposits(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
4674
|
-
/**
|
|
4675
|
-
* @method
|
|
4676
|
-
* @name mexc#fetchDeposits
|
|
4677
|
-
* @description fetch all deposits made to an account
|
|
4678
|
-
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#deposit-history-supporting-network
|
|
4679
|
-
* @param {string} code unified currency code
|
|
4680
|
-
* @param {int} [since] the earliest time in ms to fetch deposits for
|
|
4681
|
-
* @param {int} [limit] the maximum number of deposits structures to retrieve
|
|
4682
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4683
|
-
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
4684
|
-
*/
|
|
4685
4689
|
await this.loadMarkets();
|
|
4686
4690
|
const request = {
|
|
4687
4691
|
// 'coin': currency['id'] + network example: USDT-TRX,
|
|
@@ -4730,18 +4734,18 @@ class mexc extends mexc$1 {
|
|
|
4730
4734
|
//
|
|
4731
4735
|
return this.parseTransactions(response, currency, since, limit);
|
|
4732
4736
|
}
|
|
4737
|
+
/**
|
|
4738
|
+
* @method
|
|
4739
|
+
* @name mexc#fetchWithdrawals
|
|
4740
|
+
* @description fetch all withdrawals made from an account
|
|
4741
|
+
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#withdraw-history-supporting-network
|
|
4742
|
+
* @param {string} code unified currency code
|
|
4743
|
+
* @param {int} [since] the earliest time in ms to fetch withdrawals for
|
|
4744
|
+
* @param {int} [limit] the maximum number of withdrawals structures to retrieve
|
|
4745
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4746
|
+
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
4747
|
+
*/
|
|
4733
4748
|
async fetchWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
4734
|
-
/**
|
|
4735
|
-
* @method
|
|
4736
|
-
* @name mexc#fetchWithdrawals
|
|
4737
|
-
* @description fetch all withdrawals made from an account
|
|
4738
|
-
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#withdraw-history-supporting-network
|
|
4739
|
-
* @param {string} code unified currency code
|
|
4740
|
-
* @param {int} [since] the earliest time in ms to fetch withdrawals for
|
|
4741
|
-
* @param {int} [limit] the maximum number of withdrawals structures to retrieve
|
|
4742
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4743
|
-
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
4744
|
-
*/
|
|
4745
4749
|
await this.loadMarkets();
|
|
4746
4750
|
const request = {
|
|
4747
4751
|
// 'coin': currency['id'],
|
|
@@ -4907,16 +4911,16 @@ class mexc extends mexc$1 {
|
|
|
4907
4911
|
const statuses = this.safeValue(statusesByType, type, {});
|
|
4908
4912
|
return this.safeString(statuses, status, status);
|
|
4909
4913
|
}
|
|
4914
|
+
/**
|
|
4915
|
+
* @method
|
|
4916
|
+
* @name mexc#fetchPosition
|
|
4917
|
+
* @description fetch data on a single open contract trade position
|
|
4918
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-the-user-s-history-position-information
|
|
4919
|
+
* @param {string} symbol unified market symbol of the market the position is held in, default is undefined
|
|
4920
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4921
|
+
* @returns {object} a [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
4922
|
+
*/
|
|
4910
4923
|
async fetchPosition(symbol, params = {}) {
|
|
4911
|
-
/**
|
|
4912
|
-
* @method
|
|
4913
|
-
* @name mexc#fetchPosition
|
|
4914
|
-
* @description fetch data on a single open contract trade position
|
|
4915
|
-
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-the-user-s-history-position-information
|
|
4916
|
-
* @param {string} symbol unified market symbol of the market the position is held in, default is undefined
|
|
4917
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4918
|
-
* @returns {object} a [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
4919
|
-
*/
|
|
4920
4924
|
await this.loadMarkets();
|
|
4921
4925
|
const market = this.market(symbol);
|
|
4922
4926
|
const request = {
|
|
@@ -4925,16 +4929,16 @@ class mexc extends mexc$1 {
|
|
|
4925
4929
|
const response = await this.fetchPositions(undefined, this.extend(request, params));
|
|
4926
4930
|
return this.safeValue(response, 0);
|
|
4927
4931
|
}
|
|
4932
|
+
/**
|
|
4933
|
+
* @method
|
|
4934
|
+
* @name mexc#fetchPositions
|
|
4935
|
+
* @description fetch all open positions
|
|
4936
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-the-user-s-history-position-information
|
|
4937
|
+
* @param {string[]|undefined} symbols list of unified market symbols
|
|
4938
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4939
|
+
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
4940
|
+
*/
|
|
4928
4941
|
async fetchPositions(symbols = undefined, params = {}) {
|
|
4929
|
-
/**
|
|
4930
|
-
* @method
|
|
4931
|
-
* @name mexc#fetchPositions
|
|
4932
|
-
* @description fetch all open positions
|
|
4933
|
-
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-the-user-s-history-position-information
|
|
4934
|
-
* @param {string[]|undefined} symbols list of unified market symbols
|
|
4935
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4936
|
-
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
4937
|
-
*/
|
|
4938
4942
|
await this.loadMarkets();
|
|
4939
4943
|
const response = await this.contractPrivateGetPositionOpenPositions(params);
|
|
4940
4944
|
//
|
|
@@ -5073,17 +5077,17 @@ class mexc extends mexc$1 {
|
|
|
5073
5077
|
'lastUpdateTimestamp': undefined,
|
|
5074
5078
|
});
|
|
5075
5079
|
}
|
|
5080
|
+
/**
|
|
5081
|
+
* @method
|
|
5082
|
+
* @name mexc#fetchTransfer
|
|
5083
|
+
* @description fetches a transfer
|
|
5084
|
+
* @see https://mexcdevelop.github.io/apidocs/spot_v2_en/#internal-assets-transfer-order-inquiry
|
|
5085
|
+
* @param {string} id transfer id
|
|
5086
|
+
* @param {string} [code] not used by mexc fetchTransfer
|
|
5087
|
+
* @param {object} params extra parameters specific to the exchange api endpoint
|
|
5088
|
+
* @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
5089
|
+
*/
|
|
5076
5090
|
async fetchTransfer(id, code = undefined, params = {}) {
|
|
5077
|
-
/**
|
|
5078
|
-
* @method
|
|
5079
|
-
* @name mexc#fetchTransfer
|
|
5080
|
-
* @description fetches a transfer
|
|
5081
|
-
* @see https://mexcdevelop.github.io/apidocs/spot_v2_en/#internal-assets-transfer-order-inquiry
|
|
5082
|
-
* @param {string} id transfer id
|
|
5083
|
-
* @param {string} [code] not used by mexc fetchTransfer
|
|
5084
|
-
* @param {object} params extra parameters specific to the exchange api endpoint
|
|
5085
|
-
* @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
5086
|
-
*/
|
|
5087
5091
|
const [marketType, query] = this.handleMarketTypeAndParams('fetchTransfer', undefined, params);
|
|
5088
5092
|
await this.loadMarkets();
|
|
5089
5093
|
if (marketType === 'spot') {
|
|
@@ -5112,19 +5116,19 @@ class mexc extends mexc$1 {
|
|
|
5112
5116
|
}
|
|
5113
5117
|
return undefined;
|
|
5114
5118
|
}
|
|
5119
|
+
/**
|
|
5120
|
+
* @method
|
|
5121
|
+
* @name mexc#fetchTransfers
|
|
5122
|
+
* @description fetch a history of internal transfers made on an account
|
|
5123
|
+
* @see https://mexcdevelop.github.io/apidocs/spot_v2_en/#get-internal-assets-transfer-records
|
|
5124
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-the-user-39-s-asset-transfer-records
|
|
5125
|
+
* @param {string} code unified currency code of the currency transferred
|
|
5126
|
+
* @param {int} [since] the earliest time in ms to fetch transfers for
|
|
5127
|
+
* @param {int} [limit] the maximum number of transfers structures to retrieve
|
|
5128
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5129
|
+
* @returns {object[]} a list of [transfer structures]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
5130
|
+
*/
|
|
5115
5131
|
async fetchTransfers(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
5116
|
-
/**
|
|
5117
|
-
* @method
|
|
5118
|
-
* @name mexc#fetchTransfers
|
|
5119
|
-
* @description fetch a history of internal transfers made on an account
|
|
5120
|
-
* @see https://mexcdevelop.github.io/apidocs/spot_v2_en/#get-internal-assets-transfer-records
|
|
5121
|
-
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-the-user-39-s-asset-transfer-records
|
|
5122
|
-
* @param {string} code unified currency code of the currency transferred
|
|
5123
|
-
* @param {int} [since] the earliest time in ms to fetch transfers for
|
|
5124
|
-
* @param {int} [limit] the maximum number of transfers structures to retrieve
|
|
5125
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5126
|
-
* @returns {object[]} a list of [transfer structures]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
5127
|
-
*/
|
|
5128
5132
|
const [marketType, query] = this.handleMarketTypeAndParams('fetchTransfers', undefined, params);
|
|
5129
5133
|
await this.loadMarkets();
|
|
5130
5134
|
const request = {};
|
|
@@ -5201,20 +5205,20 @@ class mexc extends mexc$1 {
|
|
|
5201
5205
|
}
|
|
5202
5206
|
return this.parseTransfers(resultList, currency, since, limit);
|
|
5203
5207
|
}
|
|
5208
|
+
/**
|
|
5209
|
+
* @method
|
|
5210
|
+
* @name mexc#transfer
|
|
5211
|
+
* @description transfer currency internally between wallets on the same account
|
|
5212
|
+
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#user-universal-transfer
|
|
5213
|
+
* @param {string} code unified currency code
|
|
5214
|
+
* @param {float} amount amount to transfer
|
|
5215
|
+
* @param {string} fromAccount account to transfer from
|
|
5216
|
+
* @param {string} toAccount account to transfer to
|
|
5217
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5218
|
+
* @param {string} [params.symbol] market symbol required for margin account transfers eg:BTCUSDT
|
|
5219
|
+
* @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
5220
|
+
*/
|
|
5204
5221
|
async transfer(code, amount, fromAccount, toAccount, params = {}) {
|
|
5205
|
-
/**
|
|
5206
|
-
* @method
|
|
5207
|
-
* @name mexc#transfer
|
|
5208
|
-
* @description transfer currency internally between wallets on the same account
|
|
5209
|
-
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#user-universal-transfer
|
|
5210
|
-
* @param {string} code unified currency code
|
|
5211
|
-
* @param {float} amount amount to transfer
|
|
5212
|
-
* @param {string} fromAccount account to transfer from
|
|
5213
|
-
* @param {string} toAccount account to transfer to
|
|
5214
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5215
|
-
* @param {string} [params.symbol] market symbol required for margin account transfers eg:BTCUSDT
|
|
5216
|
-
* @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
5217
|
-
*/
|
|
5218
5222
|
await this.loadMarkets();
|
|
5219
5223
|
const currency = this.currency(code);
|
|
5220
5224
|
const accounts = {
|
|
@@ -5334,19 +5338,19 @@ class mexc extends mexc$1 {
|
|
|
5334
5338
|
};
|
|
5335
5339
|
return this.safeString(statuses, status, status);
|
|
5336
5340
|
}
|
|
5341
|
+
/**
|
|
5342
|
+
* @method
|
|
5343
|
+
* @name mexc#withdraw
|
|
5344
|
+
* @description make a withdrawal
|
|
5345
|
+
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#withdraw-new
|
|
5346
|
+
* @param {string} code unified currency code
|
|
5347
|
+
* @param {float} amount the amount to withdraw
|
|
5348
|
+
* @param {string} address the address to withdraw to
|
|
5349
|
+
* @param {string} tag
|
|
5350
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5351
|
+
* @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
5352
|
+
*/
|
|
5337
5353
|
async withdraw(code, amount, address, tag = undefined, params = {}) {
|
|
5338
|
-
/**
|
|
5339
|
-
* @method
|
|
5340
|
-
* @name mexc#withdraw
|
|
5341
|
-
* @description make a withdrawal
|
|
5342
|
-
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#withdraw-new
|
|
5343
|
-
* @param {string} code unified currency code
|
|
5344
|
-
* @param {float} amount the amount to withdraw
|
|
5345
|
-
* @param {string} address the address to withdraw to
|
|
5346
|
-
* @param {string} tag
|
|
5347
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5348
|
-
* @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
5349
|
-
*/
|
|
5350
5354
|
await this.loadMarkets();
|
|
5351
5355
|
const currency = this.currency(code);
|
|
5352
5356
|
[tag, params] = this.handleWithdrawTagAndParams(tag, params);
|
|
@@ -5375,17 +5379,17 @@ class mexc extends mexc$1 {
|
|
|
5375
5379
|
//
|
|
5376
5380
|
return this.parseTransaction(response, currency);
|
|
5377
5381
|
}
|
|
5382
|
+
/**
|
|
5383
|
+
* @method
|
|
5384
|
+
* @name mexc#setPositionMode
|
|
5385
|
+
* @description set hedged to true or false for a market
|
|
5386
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#change-position-mode
|
|
5387
|
+
* @param {bool} hedged set to true to use dualSidePosition
|
|
5388
|
+
* @param {string} symbol not used by mexc setPositionMode ()
|
|
5389
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5390
|
+
* @returns {object} response from the exchange
|
|
5391
|
+
*/
|
|
5378
5392
|
async setPositionMode(hedged, symbol = undefined, params = {}) {
|
|
5379
|
-
/**
|
|
5380
|
-
* @method
|
|
5381
|
-
* @name mexc#setPositionMode
|
|
5382
|
-
* @description set hedged to true or false for a market
|
|
5383
|
-
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#change-position-mode
|
|
5384
|
-
* @param {bool} hedged set to true to use dualSidePosition
|
|
5385
|
-
* @param {string} symbol not used by mexc setPositionMode ()
|
|
5386
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5387
|
-
* @returns {object} response from the exchange
|
|
5388
|
-
*/
|
|
5389
5393
|
const request = {
|
|
5390
5394
|
'positionMode': hedged ? 1 : 2, // 1 Hedge, 2 One-way, before changing position mode make sure that there are no active orders, planned orders, or open positions, the risk limit level will be reset to 1
|
|
5391
5395
|
};
|
|
@@ -5398,16 +5402,16 @@ class mexc extends mexc$1 {
|
|
|
5398
5402
|
//
|
|
5399
5403
|
return response;
|
|
5400
5404
|
}
|
|
5405
|
+
/**
|
|
5406
|
+
* @method
|
|
5407
|
+
* @name mexc#fetchPositionMode
|
|
5408
|
+
* @description fetchs the position mode, hedged or one way, hedged for binance is set identically for all linear markets or all inverse markets
|
|
5409
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-position-mode
|
|
5410
|
+
* @param {string} symbol not used by mexc fetchPositionMode
|
|
5411
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5412
|
+
* @returns {object} an object detailing whether the market is in hedged or one-way mode
|
|
5413
|
+
*/
|
|
5401
5414
|
async fetchPositionMode(symbol = undefined, params = {}) {
|
|
5402
|
-
/**
|
|
5403
|
-
* @method
|
|
5404
|
-
* @name mexc#fetchPositionMode
|
|
5405
|
-
* @description fetchs the position mode, hedged or one way, hedged for binance is set identically for all linear markets or all inverse markets
|
|
5406
|
-
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-position-mode
|
|
5407
|
-
* @param {string} symbol not used by mexc fetchPositionMode
|
|
5408
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5409
|
-
* @returns {object} an object detailing whether the market is in hedged or one-way mode
|
|
5410
|
-
*/
|
|
5411
5415
|
const response = await this.contractPrivateGetPositionPositionMode(params);
|
|
5412
5416
|
//
|
|
5413
5417
|
// {
|
|
@@ -5422,16 +5426,16 @@ class mexc extends mexc$1 {
|
|
|
5422
5426
|
'hedged': (positionMode === 1),
|
|
5423
5427
|
};
|
|
5424
5428
|
}
|
|
5429
|
+
/**
|
|
5430
|
+
* @method
|
|
5431
|
+
* @name mexc#fetchTransactionFees
|
|
5432
|
+
* @description fetch deposit and withdrawal fees
|
|
5433
|
+
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#query-the-currency-information
|
|
5434
|
+
* @param {string[]|undefined} codes returns fees for all currencies if undefined
|
|
5435
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5436
|
+
* @returns {object[]} a list of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
5437
|
+
*/
|
|
5425
5438
|
async fetchTransactionFees(codes = undefined, params = {}) {
|
|
5426
|
-
/**
|
|
5427
|
-
* @method
|
|
5428
|
-
* @name mexc#fetchTransactionFees
|
|
5429
|
-
* @description fetch deposit and withdrawal fees
|
|
5430
|
-
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#query-the-currency-information
|
|
5431
|
-
* @param {string[]|undefined} codes returns fees for all currencies if undefined
|
|
5432
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5433
|
-
* @returns {object[]} a list of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
5434
|
-
*/
|
|
5435
5439
|
await this.loadMarkets();
|
|
5436
5440
|
const response = await this.spotPrivateGetCapitalConfigGetall(params);
|
|
5437
5441
|
//
|
|
@@ -5520,16 +5524,16 @@ class mexc extends mexc$1 {
|
|
|
5520
5524
|
}
|
|
5521
5525
|
return result;
|
|
5522
5526
|
}
|
|
5527
|
+
/**
|
|
5528
|
+
* @method
|
|
5529
|
+
* @name mexc#fetchDepositWithdrawFees
|
|
5530
|
+
* @description fetch deposit and withdrawal fees
|
|
5531
|
+
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#query-the-currency-information
|
|
5532
|
+
* @param {string[]|undefined} codes returns fees for all currencies if undefined
|
|
5533
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5534
|
+
* @returns {object[]} a list of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
5535
|
+
*/
|
|
5523
5536
|
async fetchDepositWithdrawFees(codes = undefined, params = {}) {
|
|
5524
|
-
/**
|
|
5525
|
-
* @method
|
|
5526
|
-
* @name mexc#fetchDepositWithdrawFees
|
|
5527
|
-
* @description fetch deposit and withdrawal fees
|
|
5528
|
-
* @see https://mexcdevelop.github.io/apidocs/spot_v3_en/#query-the-currency-information
|
|
5529
|
-
* @param {string[]|undefined} codes returns fees for all currencies if undefined
|
|
5530
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5531
|
-
* @returns {object[]} a list of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
5532
|
-
*/
|
|
5533
5537
|
await this.loadMarkets();
|
|
5534
5538
|
const response = await this.spotPrivateGetCapitalConfigGetall(params);
|
|
5535
5539
|
//
|
|
@@ -5609,16 +5613,16 @@ class mexc extends mexc$1 {
|
|
|
5609
5613
|
}
|
|
5610
5614
|
return this.assignDefaultDepositWithdrawFees(result);
|
|
5611
5615
|
}
|
|
5616
|
+
/**
|
|
5617
|
+
* @method
|
|
5618
|
+
* @name mexc#fetchLeverage
|
|
5619
|
+
* @description fetch the set leverage for a market
|
|
5620
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-leverage
|
|
5621
|
+
* @param {string} symbol unified market symbol
|
|
5622
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5623
|
+
* @returns {object} a [leverage structure]{@link https://docs.ccxt.com/#/?id=leverage-structure}
|
|
5624
|
+
*/
|
|
5612
5625
|
async fetchLeverage(symbol, params = {}) {
|
|
5613
|
-
/**
|
|
5614
|
-
* @method
|
|
5615
|
-
* @name mexc#fetchLeverage
|
|
5616
|
-
* @description fetch the set leverage for a market
|
|
5617
|
-
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-leverage
|
|
5618
|
-
* @param {string} symbol unified market symbol
|
|
5619
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5620
|
-
* @returns {object} a [leverage structure]{@link https://docs.ccxt.com/#/?id=leverage-structure}
|
|
5621
|
-
*/
|
|
5622
5626
|
await this.loadMarkets();
|
|
5623
5627
|
const market = this.market(symbol);
|
|
5624
5628
|
const request = {
|
|
@@ -5700,22 +5704,22 @@ class mexc extends mexc$1 {
|
|
|
5700
5704
|
}
|
|
5701
5705
|
return [marginMode, params];
|
|
5702
5706
|
}
|
|
5707
|
+
/**
|
|
5708
|
+
* @method
|
|
5709
|
+
* @name mexc#fetchPositionsHistory
|
|
5710
|
+
* @description fetches historical positions
|
|
5711
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-the-user-s-history-position-information
|
|
5712
|
+
* @param {string[]} [symbols] unified contract symbols
|
|
5713
|
+
* @param {int} [since] not used by mexc fetchPositionsHistory
|
|
5714
|
+
* @param {int} [limit] the maximum amount of candles to fetch, default=1000
|
|
5715
|
+
* @param {object} [params] extra parameters specific to the exchange api endpoint
|
|
5716
|
+
*
|
|
5717
|
+
* EXCHANGE SPECIFIC PARAMETERS
|
|
5718
|
+
* @param {int} [params.type] position type,1: long, 2: short
|
|
5719
|
+
* @param {int} [params.page_num] current page number, default is 1
|
|
5720
|
+
* @returns {object[]} a list of [position structures]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
5721
|
+
*/
|
|
5703
5722
|
async fetchPositionsHistory(symbols = undefined, since = undefined, limit = undefined, params = {}) {
|
|
5704
|
-
/**
|
|
5705
|
-
* @method
|
|
5706
|
-
* @name mexc#fetchPositionsHistory
|
|
5707
|
-
* @description fetches historical positions
|
|
5708
|
-
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#get-the-user-s-history-position-information
|
|
5709
|
-
* @param {string[]} [symbols] unified contract symbols
|
|
5710
|
-
* @param {int} [since] not used by mexc fetchPositionsHistory
|
|
5711
|
-
* @param {int} [limit] the maximum amount of candles to fetch, default=1000
|
|
5712
|
-
* @param {object} params extra parameters specific to the exchange api endpoint
|
|
5713
|
-
*
|
|
5714
|
-
* EXCHANGE SPECIFIC PARAMETERS
|
|
5715
|
-
* @param {int} type position type,1: long, 2: short
|
|
5716
|
-
* @param {int} page_num current page number, default is 1
|
|
5717
|
-
* @returns {object[]} a list of [position structures]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
5718
|
-
*/
|
|
5719
5723
|
await this.loadMarkets();
|
|
5720
5724
|
const request = {};
|
|
5721
5725
|
if (symbols !== undefined) {
|
|
@@ -5773,19 +5777,19 @@ class mexc extends mexc$1 {
|
|
|
5773
5777
|
const positions = this.parsePositions(data, symbols, params);
|
|
5774
5778
|
return this.filterBySinceLimit(positions, since, limit);
|
|
5775
5779
|
}
|
|
5780
|
+
/**
|
|
5781
|
+
* @method
|
|
5782
|
+
* @name mexc#setMarginMode
|
|
5783
|
+
* @description set margin mode to 'cross' or 'isolated'
|
|
5784
|
+
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#switch-leverage
|
|
5785
|
+
* @param {string} marginMode 'cross' or 'isolated'
|
|
5786
|
+
* @param {string} [symbol] required when there is no position, else provide params["positionId"]
|
|
5787
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5788
|
+
* @param {string} [params.positionId] required when a position is set
|
|
5789
|
+
* @param {string} [params.direction] "long" or "short" required when there is no position
|
|
5790
|
+
* @returns {object} response from the exchange
|
|
5791
|
+
*/
|
|
5776
5792
|
async setMarginMode(marginMode, symbol = undefined, params = {}) {
|
|
5777
|
-
/**
|
|
5778
|
-
* @method
|
|
5779
|
-
* @name mexc#setMarginMode
|
|
5780
|
-
* @description set margin mode to 'cross' or 'isolated'
|
|
5781
|
-
* @see https://mexcdevelop.github.io/apidocs/contract_v1_en/#switch-leverage
|
|
5782
|
-
* @param {string} marginMode 'cross' or 'isolated'
|
|
5783
|
-
* @param {string} [symbol] required when there is no position, else provide params["positionId"]
|
|
5784
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5785
|
-
* @param {string} [params.positionId] required when a position is set
|
|
5786
|
-
* @param {string} [params.direction] "long" or "short" required when there is no position
|
|
5787
|
-
* @returns {object} response from the exchange
|
|
5788
|
-
*/
|
|
5789
5793
|
await this.loadMarkets();
|
|
5790
5794
|
const market = this.market(symbol);
|
|
5791
5795
|
if (market['spot']) {
|