ccxt 4.4.30 → 4.4.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -3
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/ace.js +123 -123
- package/dist/cjs/src/alpaca.js +237 -237
- package/dist/cjs/src/ascendex.js +342 -341
- package/dist/cjs/src/bigone.js +242 -242
- package/dist/cjs/src/binance.js +1339 -1291
- package/dist/cjs/src/bingx.js +639 -639
- package/dist/cjs/src/bit2c.js +111 -111
- package/dist/cjs/src/bitbank.js +142 -142
- package/dist/cjs/src/bitbns.js +140 -140
- package/dist/cjs/src/bitfinex.js +231 -231
- package/dist/cjs/src/bitfinex2.js +403 -403
- package/dist/cjs/src/bitflyer.js +184 -184
- package/dist/cjs/src/bitget.js +848 -846
- package/dist/cjs/src/bithumb.js +125 -124
- package/dist/cjs/src/bitmart.js +525 -525
- package/dist/cjs/src/bitmex.js +317 -317
- package/dist/cjs/src/bitopro.js +221 -221
- package/dist/cjs/src/bitrue.js +315 -315
- package/dist/cjs/src/bitso.js +220 -220
- package/dist/cjs/src/bitstamp.js +251 -251
- package/dist/cjs/src/bitteam.js +183 -183
- package/dist/cjs/src/bitvavo.js +247 -251
- package/dist/cjs/src/bl3p.js +82 -82
- package/dist/cjs/src/blockchaincom.js +211 -211
- package/dist/cjs/src/blofin.js +332 -331
- package/dist/cjs/src/btcalpha.js +166 -166
- package/dist/cjs/src/btcbox.js +108 -108
- package/dist/cjs/src/btcmarkets.js +198 -198
- package/dist/cjs/src/btcturk.js +124 -124
- package/dist/cjs/src/bybit.js +906 -900
- package/dist/cjs/src/cex.js +227 -226
- package/dist/cjs/src/coinbase.js +481 -481
- package/dist/cjs/src/coinbaseexchange.js +274 -274
- package/dist/cjs/src/coinbaseinternational.js +304 -304
- package/dist/cjs/src/coincatch.js +650 -650
- package/dist/cjs/src/coincheck.js +113 -113
- package/dist/cjs/src/coinex.js +611 -601
- package/dist/cjs/src/coinlist.js +304 -303
- package/dist/cjs/src/coinmate.js +162 -161
- package/dist/cjs/src/coinmetro.js +187 -187
- package/dist/cjs/src/coinone.js +124 -123
- package/dist/cjs/src/coinsph.js +237 -237
- package/dist/cjs/src/coinspot.js +82 -82
- package/dist/cjs/src/cryptocom.js +342 -341
- package/dist/cjs/src/currencycom.js +225 -224
- package/dist/cjs/src/delta.js +320 -320
- package/dist/cjs/src/deribit.js +411 -408
- package/dist/cjs/src/digifinex.js +432 -431
- package/dist/cjs/src/exmo.js +328 -327
- package/dist/cjs/src/gate.js +830 -791
- package/dist/cjs/src/gemini.js +199 -198
- package/dist/cjs/src/hashkey.js +520 -517
- package/dist/cjs/src/hitbtc.js +465 -462
- package/dist/cjs/src/hollaex.js +253 -252
- package/dist/cjs/src/htx.js +791 -848
- package/dist/cjs/src/huobijp.js +219 -218
- package/dist/cjs/src/hyperliquid.js +421 -417
- package/dist/cjs/src/idex.js +238 -237
- package/dist/cjs/src/independentreserve.js +133 -132
- package/dist/cjs/src/indodax.js +177 -171
- package/dist/cjs/src/kraken.js +381 -377
- package/dist/cjs/src/krakenfutures.js +285 -279
- package/dist/cjs/src/kucoin.js +632 -622
- package/dist/cjs/src/kucoinfutures.js +533 -457
- package/dist/cjs/src/kuna.js +283 -282
- package/dist/cjs/src/latoken.js +211 -210
- package/dist/cjs/src/lbank.js +268 -267
- package/dist/cjs/src/luno.js +174 -173
- package/dist/cjs/src/lykke.js +172 -171
- package/dist/cjs/src/mercado.js +123 -122
- package/dist/cjs/src/mexc.js +650 -646
- package/dist/cjs/src/ndax.js +229 -228
- package/dist/cjs/src/novadax.js +230 -229
- package/dist/cjs/src/oceanex.js +187 -186
- package/dist/cjs/src/okcoin.js +286 -285
- package/dist/cjs/src/okx.js +909 -904
- package/dist/cjs/src/onetrading.js +218 -218
- package/dist/cjs/src/oxfun.js +335 -334
- package/dist/cjs/src/p2b.js +154 -154
- package/dist/cjs/src/paradex.js +249 -244
- package/dist/cjs/src/paymium.js +101 -101
- package/dist/cjs/src/phemex.js +388 -390
- package/dist/cjs/src/poloniex.js +270 -270
- package/dist/cjs/src/poloniexfutures.js +250 -250
- package/dist/cjs/src/pro/alpaca.js +64 -64
- package/dist/cjs/src/pro/ascendex.js +64 -64
- package/dist/cjs/src/pro/binance.js +546 -543
- package/dist/cjs/src/pro/bingx.js +116 -116
- package/dist/cjs/src/pro/bitfinex.js +42 -42
- package/dist/cjs/src/pro/bitfinex2.js +66 -66
- package/dist/cjs/src/pro/bitget.js +188 -181
- package/dist/cjs/src/pro/bithumb.js +40 -40
- package/dist/cjs/src/pro/bitmart.js +121 -119
- package/dist/cjs/src/pro/bitmex.js +135 -133
- package/dist/cjs/src/pro/bitopro.js +49 -49
- package/dist/cjs/src/pro/bitrue.js +19 -19
- package/dist/cjs/src/pro/bitstamp.js +29 -29
- package/dist/cjs/src/pro/bitvavo.js +299 -301
- package/dist/cjs/src/pro/blockchaincom.js +62 -62
- package/dist/cjs/src/pro/blofin.js +132 -130
- package/dist/cjs/src/pro/bybit.js +317 -313
- package/dist/cjs/src/pro/cex.js +168 -168
- package/dist/cjs/src/pro/coinbase.js +93 -91
- package/dist/cjs/src/pro/coinbaseexchange.js +95 -95
- package/dist/cjs/src/pro/coinbaseinternational.js +111 -111
- package/dist/cjs/src/pro/coincatch.js +150 -143
- package/dist/cjs/src/pro/coincheck.js +21 -21
- package/dist/cjs/src/pro/coinex.js +110 -110
- package/dist/cjs/src/pro/coinone.js +30 -30
- package/dist/cjs/src/pro/cryptocom.js +227 -227
- package/dist/cjs/src/pro/currencycom.js +45 -45
- package/dist/cjs/src/pro/deribit.js +127 -127
- package/dist/cjs/src/pro/exmo.js +66 -66
- package/dist/cjs/src/pro/gate.js +287 -283
- package/dist/cjs/src/pro/gemini.js +74 -74
- package/dist/cjs/src/pro/hashkey.js +87 -85
- package/dist/cjs/src/pro/hitbtc.js +190 -190
- package/dist/cjs/src/pro/hollaex.js +51 -51
- package/dist/cjs/src/pro/htx.js +96 -94
- package/dist/cjs/src/pro/huobijp.js +38 -38
- package/dist/cjs/src/pro/hyperliquid.js +151 -150
- package/dist/cjs/src/pro/idex.js +48 -48
- package/dist/cjs/src/pro/independentreserve.js +19 -19
- package/dist/cjs/src/pro/kraken.js +167 -167
- package/dist/cjs/src/pro/krakenfutures.js +137 -138
- package/dist/cjs/src/pro/kucoin.js +167 -168
- package/dist/cjs/src/pro/kucoinfutures.js +147 -147
- package/dist/cjs/src/pro/lbank.js +95 -95
- package/dist/cjs/src/pro/luno.js +21 -21
- package/dist/cjs/src/pro/mexc.js +102 -103
- package/dist/cjs/src/pro/ndax.js +42 -42
- package/dist/cjs/src/pro/okcoin.js +61 -61
- package/dist/cjs/src/pro/okx.js +332 -330
- package/dist/cjs/src/pro/onetrading.js +71 -71
- package/dist/cjs/src/pro/oxfun.js +193 -191
- package/dist/cjs/src/pro/p2b.js +77 -77
- package/dist/cjs/src/pro/paradex.js +39 -39
- package/dist/cjs/src/pro/phemex.js +94 -94
- package/dist/cjs/src/pro/poloniex.js +171 -171
- package/dist/cjs/src/pro/poloniexfutures.js +62 -62
- package/dist/cjs/src/pro/probit.js +63 -63
- package/dist/cjs/src/pro/upbit.js +80 -80
- package/dist/cjs/src/pro/vertex.js +65 -63
- package/dist/cjs/src/pro/wazirx.js +70 -70
- package/dist/cjs/src/pro/whitebit.js +83 -83
- package/dist/cjs/src/pro/woo.js +106 -104
- package/dist/cjs/src/pro/woofipro.js +105 -103
- package/dist/cjs/src/pro/xt.js +119 -119
- package/dist/cjs/src/probit.js +229 -229
- package/dist/cjs/src/timex.js +198 -197
- package/dist/cjs/src/tokocrypto.js +214 -213
- package/dist/cjs/src/tradeogre.js +92 -91
- package/dist/cjs/src/upbit.js +243 -242
- package/dist/cjs/src/vertex.js +258 -258
- package/dist/cjs/src/wavesexchange.js +176 -172
- package/dist/cjs/src/wazirx.js +168 -168
- package/dist/cjs/src/whitebit.js +361 -361
- package/dist/cjs/src/woo.js +571 -572
- package/dist/cjs/src/woofipro.js +392 -391
- package/dist/cjs/src/xt.js +436 -435
- package/dist/cjs/src/yobit.js +159 -158
- package/dist/cjs/src/zaif.js +103 -103
- package/dist/cjs/src/zonda.js +168 -168
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/ace.d.ts +123 -0
- package/js/src/ace.js +123 -123
- package/js/src/alpaca.d.ts +237 -0
- package/js/src/alpaca.js +237 -237
- package/js/src/ascendex.d.ts +339 -0
- package/js/src/ascendex.js +342 -341
- package/js/src/base/types.d.ts +1 -0
- package/js/src/bigone.d.ts +242 -0
- package/js/src/bigone.js +242 -242
- package/js/src/binance.d.ts +1306 -0
- package/js/src/binance.js +1339 -1291
- package/js/src/bingx.d.ts +639 -0
- package/js/src/bingx.js +639 -639
- package/js/src/bit2c.d.ts +111 -0
- package/js/src/bit2c.js +111 -111
- package/js/src/bitbank.d.ts +142 -0
- package/js/src/bitbank.js +142 -142
- package/js/src/bitbns.d.ts +140 -0
- package/js/src/bitbns.js +140 -140
- package/js/src/bitfinex.d.ts +231 -0
- package/js/src/bitfinex.js +231 -231
- package/js/src/bitfinex2.d.ts +403 -0
- package/js/src/bitfinex2.js +403 -403
- package/js/src/bitflyer.d.ts +184 -0
- package/js/src/bitflyer.js +184 -184
- package/js/src/bitget.d.ts +846 -0
- package/js/src/bitget.js +848 -846
- package/js/src/bithumb.d.ts +125 -0
- package/js/src/bithumb.js +125 -124
- package/js/src/bitmart.d.ts +525 -0
- package/js/src/bitmart.js +525 -525
- package/js/src/bitmex.d.ts +317 -0
- package/js/src/bitmex.js +317 -317
- package/js/src/bitopro.d.ts +221 -0
- package/js/src/bitopro.js +221 -221
- package/js/src/bitrue.d.ts +315 -0
- package/js/src/bitrue.js +315 -315
- package/js/src/bitso.d.ts +220 -0
- package/js/src/bitso.js +220 -220
- package/js/src/bitstamp.d.ts +251 -0
- package/js/src/bitstamp.js +251 -251
- package/js/src/bitteam.d.ts +183 -0
- package/js/src/bitteam.js +183 -183
- package/js/src/bitvavo.d.ts +247 -0
- package/js/src/bitvavo.js +247 -251
- package/js/src/bl3p.d.ts +82 -0
- package/js/src/bl3p.js +82 -82
- package/js/src/blockchaincom.d.ts +211 -0
- package/js/src/blockchaincom.js +211 -211
- package/js/src/blofin.d.ts +332 -0
- package/js/src/blofin.js +332 -331
- package/js/src/btcalpha.d.ts +166 -0
- package/js/src/btcalpha.js +166 -166
- package/js/src/btcbox.d.ts +108 -0
- package/js/src/btcbox.js +108 -108
- package/js/src/btcmarkets.d.ts +198 -0
- package/js/src/btcmarkets.js +198 -198
- package/js/src/btcturk.d.ts +124 -0
- package/js/src/btcturk.js +124 -124
- package/js/src/bybit.d.ts +906 -1
- package/js/src/bybit.js +906 -900
- package/js/src/cex.d.ts +227 -0
- package/js/src/cex.js +227 -226
- package/js/src/coinbase.d.ts +481 -0
- package/js/src/coinbase.js +481 -481
- package/js/src/coinbaseexchange.d.ts +274 -0
- package/js/src/coinbaseexchange.js +274 -274
- package/js/src/coinbaseinternational.d.ts +304 -0
- package/js/src/coinbaseinternational.js +304 -304
- package/js/src/coincatch.d.ts +646 -0
- package/js/src/coincatch.js +650 -650
- package/js/src/coincheck.d.ts +113 -0
- package/js/src/coincheck.js +113 -113
- package/js/src/coinex.d.ts +603 -0
- package/js/src/coinex.js +611 -601
- package/js/src/coinlist.d.ts +304 -0
- package/js/src/coinlist.js +304 -303
- package/js/src/coinmate.d.ts +162 -0
- package/js/src/coinmate.js +162 -161
- package/js/src/coinmetro.d.ts +187 -0
- package/js/src/coinmetro.js +187 -187
- package/js/src/coinone.d.ts +124 -0
- package/js/src/coinone.js +124 -123
- package/js/src/coinsph.d.ts +237 -0
- package/js/src/coinsph.js +237 -237
- package/js/src/coinspot.d.ts +82 -0
- package/js/src/coinspot.js +82 -82
- package/js/src/cryptocom.d.ts +342 -0
- package/js/src/cryptocom.js +342 -341
- package/js/src/currencycom.d.ts +225 -0
- package/js/src/currencycom.js +225 -224
- package/js/src/delta.d.ts +320 -0
- package/js/src/delta.js +320 -320
- package/js/src/deribit.d.ts +411 -0
- package/js/src/deribit.js +411 -408
- package/js/src/digifinex.d.ts +430 -0
- package/js/src/digifinex.js +432 -431
- package/js/src/exmo.d.ts +328 -0
- package/js/src/exmo.js +328 -327
- package/js/src/gate.d.ts +803 -1
- package/js/src/gate.js +830 -791
- package/js/src/gemini.d.ts +199 -0
- package/js/src/gemini.js +199 -198
- package/js/src/hashkey.d.ts +516 -0
- package/js/src/hashkey.js +520 -517
- package/js/src/hitbtc.d.ts +465 -0
- package/js/src/hitbtc.js +465 -462
- package/js/src/hollaex.d.ts +253 -0
- package/js/src/hollaex.js +253 -252
- package/js/src/htx.d.ts +765 -2
- package/js/src/htx.js +791 -848
- package/js/src/huobijp.d.ts +219 -0
- package/js/src/huobijp.js +219 -218
- package/js/src/hyperliquid.d.ts +419 -0
- package/js/src/hyperliquid.js +421 -417
- package/js/src/idex.d.ts +238 -0
- package/js/src/idex.js +238 -237
- package/js/src/independentreserve.d.ts +133 -0
- package/js/src/independentreserve.js +133 -132
- package/js/src/indodax.d.ts +171 -0
- package/js/src/indodax.js +177 -171
- package/js/src/kraken.d.ts +381 -0
- package/js/src/kraken.js +381 -377
- package/js/src/krakenfutures.d.ts +282 -0
- package/js/src/krakenfutures.js +285 -279
- package/js/src/kucoin.d.ts +613 -0
- package/js/src/kucoin.js +632 -622
- package/js/src/kucoinfutures.d.ts +441 -0
- package/js/src/kucoinfutures.js +533 -457
- package/js/src/kuna.d.ts +283 -0
- package/js/src/kuna.js +283 -282
- package/js/src/latoken.d.ts +211 -0
- package/js/src/latoken.js +211 -210
- package/js/src/lbank.d.ts +268 -0
- package/js/src/lbank.js +268 -267
- package/js/src/luno.d.ts +174 -0
- package/js/src/luno.js +174 -173
- package/js/src/lykke.d.ts +172 -0
- package/js/src/lykke.js +172 -171
- package/js/src/mercado.d.ts +123 -0
- package/js/src/mercado.js +123 -122
- package/js/src/mexc.d.ts +647 -0
- package/js/src/mexc.js +650 -646
- package/js/src/ndax.d.ts +229 -0
- package/js/src/ndax.js +229 -228
- package/js/src/novadax.d.ts +230 -0
- package/js/src/novadax.js +230 -229
- package/js/src/oceanex.d.ts +187 -0
- package/js/src/oceanex.js +187 -186
- package/js/src/okcoin.d.ts +286 -0
- package/js/src/okcoin.js +286 -285
- package/js/src/okx.d.ts +907 -0
- package/js/src/okx.js +909 -904
- package/js/src/onetrading.d.ts +218 -0
- package/js/src/onetrading.js +218 -218
- package/js/src/oxfun.d.ts +336 -3
- package/js/src/oxfun.js +335 -334
- package/js/src/p2b.d.ts +154 -0
- package/js/src/p2b.js +154 -154
- package/js/src/paradex.d.ts +241 -0
- package/js/src/paradex.js +249 -244
- package/js/src/paymium.d.ts +101 -0
- package/js/src/paymium.js +101 -101
- package/js/src/phemex.d.ts +366 -0
- package/js/src/phemex.js +388 -390
- package/js/src/poloniex.d.ts +270 -0
- package/js/src/poloniex.js +270 -270
- package/js/src/poloniexfutures.d.ts +250 -0
- package/js/src/poloniexfutures.js +250 -250
- package/js/src/pro/alpaca.d.ts +64 -0
- package/js/src/pro/alpaca.js +64 -64
- package/js/src/pro/ascendex.d.ts +64 -0
- package/js/src/pro/ascendex.js +64 -64
- package/js/src/pro/binance.d.ts +546 -0
- package/js/src/pro/binance.js +546 -543
- package/js/src/pro/bingx.d.ts +116 -0
- package/js/src/pro/bingx.js +116 -116
- package/js/src/pro/bitfinex.d.ts +42 -0
- package/js/src/pro/bitfinex.js +42 -42
- package/js/src/pro/bitfinex2.d.ts +66 -0
- package/js/src/pro/bitfinex2.js +66 -66
- package/js/src/pro/bitget.d.ts +187 -0
- package/js/src/pro/bitget.js +188 -181
- package/js/src/pro/bithumb.d.ts +40 -0
- package/js/src/pro/bithumb.js +40 -40
- package/js/src/pro/bitmart.d.ts +121 -0
- package/js/src/pro/bitmart.js +121 -119
- package/js/src/pro/bitmex.d.ts +135 -0
- package/js/src/pro/bitmex.js +135 -133
- package/js/src/pro/bitopro.d.ts +49 -0
- package/js/src/pro/bitopro.js +49 -49
- package/js/src/pro/bitrue.d.ts +19 -0
- package/js/src/pro/bitrue.js +19 -19
- package/js/src/pro/bitstamp.d.ts +29 -0
- package/js/src/pro/bitstamp.js +29 -29
- package/js/src/pro/bitvavo.d.ts +254 -1
- package/js/src/pro/bitvavo.js +299 -301
- package/js/src/pro/blockchaincom.d.ts +62 -0
- package/js/src/pro/blockchaincom.js +62 -62
- package/js/src/pro/blofin.d.ts +132 -0
- package/js/src/pro/blofin.js +132 -130
- package/js/src/pro/bybit.d.ts +317 -0
- package/js/src/pro/bybit.js +317 -313
- package/js/src/pro/cex.d.ts +168 -0
- package/js/src/pro/cex.js +168 -168
- package/js/src/pro/coinbase.d.ts +93 -0
- package/js/src/pro/coinbase.js +93 -91
- package/js/src/pro/coinbaseexchange.d.ts +95 -0
- package/js/src/pro/coinbaseexchange.js +95 -95
- package/js/src/pro/coinbaseinternational.d.ts +111 -0
- package/js/src/pro/coinbaseinternational.js +111 -111
- package/js/src/pro/coincatch.d.ts +150 -0
- package/js/src/pro/coincatch.js +150 -143
- package/js/src/pro/coincheck.d.ts +21 -0
- package/js/src/pro/coincheck.js +21 -21
- package/js/src/pro/coinex.d.ts +110 -0
- package/js/src/pro/coinex.js +110 -110
- package/js/src/pro/coinone.d.ts +30 -0
- package/js/src/pro/coinone.js +30 -30
- package/js/src/pro/cryptocom.d.ts +227 -0
- package/js/src/pro/cryptocom.js +227 -227
- package/js/src/pro/currencycom.d.ts +45 -0
- package/js/src/pro/currencycom.js +45 -45
- package/js/src/pro/deribit.d.ts +127 -0
- package/js/src/pro/deribit.js +127 -127
- package/js/src/pro/exmo.d.ts +66 -0
- package/js/src/pro/exmo.js +66 -66
- package/js/src/pro/gate.d.ts +287 -0
- package/js/src/pro/gate.js +287 -283
- package/js/src/pro/gemini.d.ts +74 -0
- package/js/src/pro/gemini.js +74 -74
- package/js/src/pro/hashkey.d.ts +87 -0
- package/js/src/pro/hashkey.js +87 -85
- package/js/src/pro/hitbtc.d.ts +190 -0
- package/js/src/pro/hitbtc.js +190 -190
- package/js/src/pro/hollaex.d.ts +51 -0
- package/js/src/pro/hollaex.js +51 -51
- package/js/src/pro/htx.d.ts +96 -0
- package/js/src/pro/htx.js +96 -94
- package/js/src/pro/huobijp.d.ts +38 -0
- package/js/src/pro/huobijp.js +38 -38
- package/js/src/pro/hyperliquid.d.ts +151 -0
- package/js/src/pro/hyperliquid.js +151 -150
- package/js/src/pro/idex.d.ts +48 -0
- package/js/src/pro/idex.js +48 -48
- package/js/src/pro/independentreserve.d.ts +19 -0
- package/js/src/pro/independentreserve.js +19 -19
- package/js/src/pro/kraken.d.ts +167 -0
- package/js/src/pro/kraken.js +167 -167
- package/js/src/pro/krakenfutures.d.ts +137 -0
- package/js/src/pro/krakenfutures.js +137 -138
- package/js/src/pro/kucoin.d.ts +167 -0
- package/js/src/pro/kucoin.js +167 -168
- package/js/src/pro/kucoinfutures.d.ts +147 -0
- package/js/src/pro/kucoinfutures.js +147 -147
- package/js/src/pro/lbank.d.ts +95 -0
- package/js/src/pro/lbank.js +95 -95
- package/js/src/pro/luno.d.ts +21 -0
- package/js/src/pro/luno.js +21 -21
- package/js/src/pro/mexc.d.ts +101 -0
- package/js/src/pro/mexc.js +102 -103
- package/js/src/pro/ndax.d.ts +42 -0
- package/js/src/pro/ndax.js +42 -42
- package/js/src/pro/okcoin.d.ts +61 -0
- package/js/src/pro/okcoin.js +61 -61
- package/js/src/pro/okx.d.ts +332 -0
- package/js/src/pro/okx.js +332 -330
- package/js/src/pro/onetrading.d.ts +71 -0
- package/js/src/pro/onetrading.js +71 -71
- package/js/src/pro/oxfun.d.ts +193 -0
- package/js/src/pro/oxfun.js +193 -191
- package/js/src/pro/p2b.d.ts +77 -0
- package/js/src/pro/p2b.js +77 -77
- package/js/src/pro/paradex.d.ts +39 -0
- package/js/src/pro/paradex.js +39 -39
- package/js/src/pro/phemex.d.ts +94 -0
- package/js/src/pro/phemex.js +94 -94
- package/js/src/pro/poloniex.d.ts +171 -0
- package/js/src/pro/poloniex.js +171 -171
- package/js/src/pro/poloniexfutures.d.ts +62 -0
- package/js/src/pro/poloniexfutures.js +62 -62
- package/js/src/pro/probit.d.ts +63 -0
- package/js/src/pro/probit.js +63 -63
- package/js/src/pro/upbit.d.ts +80 -0
- package/js/src/pro/upbit.js +80 -80
- package/js/src/pro/vertex.d.ts +65 -0
- package/js/src/pro/vertex.js +65 -63
- package/js/src/pro/wazirx.d.ts +70 -0
- package/js/src/pro/wazirx.js +70 -70
- package/js/src/pro/whitebit.d.ts +83 -0
- package/js/src/pro/whitebit.js +83 -83
- package/js/src/pro/woo.d.ts +106 -0
- package/js/src/pro/woo.js +106 -104
- package/js/src/pro/woofipro.d.ts +105 -0
- package/js/src/pro/woofipro.js +105 -103
- package/js/src/pro/xt.d.ts +119 -0
- package/js/src/pro/xt.js +119 -119
- package/js/src/probit.d.ts +229 -0
- package/js/src/probit.js +229 -229
- package/js/src/timex.d.ts +198 -0
- package/js/src/timex.js +198 -197
- package/js/src/tokocrypto.d.ts +214 -0
- package/js/src/tokocrypto.js +214 -213
- package/js/src/tradeogre.d.ts +92 -0
- package/js/src/tradeogre.js +92 -91
- package/js/src/upbit.d.ts +243 -0
- package/js/src/upbit.js +243 -242
- package/js/src/vertex.d.ts +258 -0
- package/js/src/vertex.js +258 -258
- package/js/src/wavesexchange.d.ts +176 -0
- package/js/src/wavesexchange.js +176 -172
- package/js/src/wazirx.d.ts +168 -0
- package/js/src/wazirx.js +168 -168
- package/js/src/whitebit.d.ts +361 -0
- package/js/src/whitebit.js +361 -361
- package/js/src/woo.d.ts +571 -0
- package/js/src/woo.js +571 -572
- package/js/src/woofipro.d.ts +392 -0
- package/js/src/woofipro.js +392 -391
- package/js/src/xt.d.ts +439 -4
- package/js/src/xt.js +436 -435
- package/js/src/yobit.d.ts +159 -0
- package/js/src/yobit.js +159 -158
- package/js/src/zaif.d.ts +103 -0
- package/js/src/zaif.js +103 -103
- package/js/src/zonda.d.ts +168 -0
- package/js/src/zonda.js +168 -168
- package/package.json +1 -1
package/js/src/gate.js
CHANGED
|
@@ -154,7 +154,7 @@ export default class gate extends Exchange {
|
|
|
154
154
|
'fetchSettlementHistory': true,
|
|
155
155
|
'fetchTicker': true,
|
|
156
156
|
'fetchTickers': true,
|
|
157
|
-
'fetchTime':
|
|
157
|
+
'fetchTime': true,
|
|
158
158
|
'fetchTrades': true,
|
|
159
159
|
'fetchTradingFee': true,
|
|
160
160
|
'fetchTradingFees': true,
|
|
@@ -899,14 +899,15 @@ export default class gate extends Exchange {
|
|
|
899
899
|
super.setSandboxMode(enable);
|
|
900
900
|
this.options['sandboxMode'] = enable;
|
|
901
901
|
}
|
|
902
|
+
/**
|
|
903
|
+
* @method
|
|
904
|
+
* @name gate#isUnifiedEnabled
|
|
905
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
906
|
+
* @description returns unifiedAccount so the user can check if the unified account is enabled
|
|
907
|
+
* @see https://www.gate.io/docs/developers/apiv4/#get-account-detail
|
|
908
|
+
* @returns {boolean} true or false if the enabled unified account is enabled or not and sets the unifiedAccount option if it is undefined
|
|
909
|
+
*/
|
|
902
910
|
async loadUnifiedStatus(params = {}) {
|
|
903
|
-
/**
|
|
904
|
-
* @method
|
|
905
|
-
* @name gate#isUnifiedEnabled
|
|
906
|
-
* @description returns unifiedAccount so the user can check if the unified account is enabled
|
|
907
|
-
* @see https://www.gate.io/docs/developers/apiv4/#get-account-detail
|
|
908
|
-
* @returns {boolean} true or false if the enabled unified account is enabled or not and sets the unifiedAccount option if it is undefined
|
|
909
|
-
*/
|
|
910
911
|
const unifiedAccount = this.safeBool(this.options, 'unifiedAccount');
|
|
911
912
|
if (unifiedAccount === undefined) {
|
|
912
913
|
try {
|
|
@@ -936,6 +937,23 @@ export default class gate extends Exchange {
|
|
|
936
937
|
async upgradeUnifiedTradeAccount(params = {}) {
|
|
937
938
|
return await this.privateUnifiedPutUnifiedMode(params);
|
|
938
939
|
}
|
|
940
|
+
/**
|
|
941
|
+
* @method
|
|
942
|
+
* @name gate#fetchTime
|
|
943
|
+
* @description fetches the current integer timestamp in milliseconds from the exchange server
|
|
944
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#get-server-current-time
|
|
945
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
946
|
+
* @returns {int} the current integer timestamp in milliseconds from the exchange server
|
|
947
|
+
*/
|
|
948
|
+
async fetchTime(params = {}) {
|
|
949
|
+
const response = await this.publicSpotGetTime(params);
|
|
950
|
+
//
|
|
951
|
+
// {
|
|
952
|
+
// "server_time": 1731447921098
|
|
953
|
+
// }
|
|
954
|
+
//
|
|
955
|
+
return this.safeInteger(response, 'server_time');
|
|
956
|
+
}
|
|
939
957
|
createExpiredOptionMarket(symbol) {
|
|
940
958
|
// support expired option contracts
|
|
941
959
|
const quote = 'USDT';
|
|
@@ -1009,19 +1027,19 @@ export default class gate extends Exchange {
|
|
|
1009
1027
|
}
|
|
1010
1028
|
return super.safeMarket(marketId, market, delimiter, marketType);
|
|
1011
1029
|
}
|
|
1030
|
+
/**
|
|
1031
|
+
* @method
|
|
1032
|
+
* @name gate#fetchMarkets
|
|
1033
|
+
* @description retrieves data on all markets for gate
|
|
1034
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#list-all-currency-pairs-supported // spot
|
|
1035
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#list-all-supported-currency-pairs-supported-in-margin-trading // margin
|
|
1036
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#list-all-futures-contracts // swap
|
|
1037
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#list-all-futures-contracts-2 // future
|
|
1038
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#list-all-the-contracts-with-specified-underlying-and-expiration-time // option
|
|
1039
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1040
|
+
* @returns {object[]} an array of objects representing market data
|
|
1041
|
+
*/
|
|
1012
1042
|
async fetchMarkets(params = {}) {
|
|
1013
|
-
/**
|
|
1014
|
-
* @method
|
|
1015
|
-
* @name gate#fetchMarkets
|
|
1016
|
-
* @description retrieves data on all markets for gate
|
|
1017
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#list-all-currency-pairs-supported // spot
|
|
1018
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#list-all-supported-currency-pairs-supported-in-margin-trading // margin
|
|
1019
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#list-all-futures-contracts // swap
|
|
1020
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#list-all-futures-contracts-2 // future
|
|
1021
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#list-all-the-contracts-with-specified-underlying-and-expiration-time // option
|
|
1022
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1023
|
-
* @returns {object[]} an array of objects representing market data
|
|
1024
|
-
*/
|
|
1025
1043
|
const sandboxMode = this.safeBool(this.options, 'sandboxMode', false);
|
|
1026
1044
|
let rawPromises = [
|
|
1027
1045
|
this.fetchContractMarkets(params),
|
|
@@ -1616,15 +1634,15 @@ export default class gate extends Exchange {
|
|
|
1616
1634
|
const defaultSettle = (type === 'swap') ? ['usdt'] : ['btc'];
|
|
1617
1635
|
return this.safeValue(fetchMarketsContractOptions, 'settlementCurrencies', defaultSettle);
|
|
1618
1636
|
}
|
|
1637
|
+
/**
|
|
1638
|
+
* @method
|
|
1639
|
+
* @name gate#fetchCurrencies
|
|
1640
|
+
* @description fetches all available currencies on an exchange
|
|
1641
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#list-all-currencies-details
|
|
1642
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1643
|
+
* @returns {object} an associative dictionary of currencies
|
|
1644
|
+
*/
|
|
1619
1645
|
async fetchCurrencies(params = {}) {
|
|
1620
|
-
/**
|
|
1621
|
-
* @method
|
|
1622
|
-
* @name gate#fetchCurrencies
|
|
1623
|
-
* @description fetches all available currencies on an exchange
|
|
1624
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#list-all-currencies-details
|
|
1625
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1626
|
-
* @returns {object} an associative dictionary of currencies
|
|
1627
|
-
*/
|
|
1628
1646
|
// sandbox/testnet only supports future markets
|
|
1629
1647
|
const apiBackup = this.safeValue(this.urls, 'apiBackup');
|
|
1630
1648
|
if (apiBackup !== undefined) {
|
|
@@ -1735,16 +1753,16 @@ export default class gate extends Exchange {
|
|
|
1735
1753
|
}
|
|
1736
1754
|
return result;
|
|
1737
1755
|
}
|
|
1756
|
+
/**
|
|
1757
|
+
* @method
|
|
1758
|
+
* @name gate#fetchFundingRate
|
|
1759
|
+
* @description fetch the current funding rate
|
|
1760
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#get-a-single-contract
|
|
1761
|
+
* @param {string} symbol unified market symbol
|
|
1762
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1763
|
+
* @returns {object} a [funding rate structure]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
|
|
1764
|
+
*/
|
|
1738
1765
|
async fetchFundingRate(symbol, params = {}) {
|
|
1739
|
-
/**
|
|
1740
|
-
* @method
|
|
1741
|
-
* @name gate#fetchFundingRate
|
|
1742
|
-
* @description fetch the current funding rate
|
|
1743
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#get-a-single-contract
|
|
1744
|
-
* @param {string} symbol unified market symbol
|
|
1745
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1746
|
-
* @returns {object} a [funding rate structure]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
|
|
1747
|
-
*/
|
|
1748
1766
|
await this.loadMarkets();
|
|
1749
1767
|
const market = this.market(symbol);
|
|
1750
1768
|
if (!market['swap']) {
|
|
@@ -1798,16 +1816,16 @@ export default class gate extends Exchange {
|
|
|
1798
1816
|
//
|
|
1799
1817
|
return this.parseFundingRate(response);
|
|
1800
1818
|
}
|
|
1819
|
+
/**
|
|
1820
|
+
* @method
|
|
1821
|
+
* @name gate#fetchFundingRates
|
|
1822
|
+
* @description fetch the funding rate for multiple markets
|
|
1823
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#list-all-futures-contracts
|
|
1824
|
+
* @param {string[]|undefined} symbols list of unified market symbols
|
|
1825
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1826
|
+
* @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rates-structure}, indexed by market symbols
|
|
1827
|
+
*/
|
|
1801
1828
|
async fetchFundingRates(symbols = undefined, params = {}) {
|
|
1802
|
-
/**
|
|
1803
|
-
* @method
|
|
1804
|
-
* @name gate#fetchFundingRates
|
|
1805
|
-
* @description fetch the funding rate for multiple markets
|
|
1806
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#list-all-futures-contracts
|
|
1807
|
-
* @param {string[]|undefined} symbols list of unified market symbols
|
|
1808
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1809
|
-
* @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rates-structure}, indexed by market symbols
|
|
1810
|
-
*/
|
|
1811
1829
|
await this.loadMarkets();
|
|
1812
1830
|
symbols = this.marketSymbols(symbols);
|
|
1813
1831
|
const [request, query] = this.prepareRequest(undefined, 'swap', params);
|
|
@@ -1981,17 +1999,17 @@ export default class gate extends Exchange {
|
|
|
1981
1999
|
}
|
|
1982
2000
|
return result;
|
|
1983
2001
|
}
|
|
2002
|
+
/**
|
|
2003
|
+
* @method
|
|
2004
|
+
* @name gate#fetchDepositAddress
|
|
2005
|
+
* @description fetch the deposit address for a currency associated with this account
|
|
2006
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#generate-currency-deposit-address
|
|
2007
|
+
* @param {string} code unified currency code
|
|
2008
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2009
|
+
* @param {string} [params.network] unified network code (not used directly by gate.io but used by ccxt to filter the response)
|
|
2010
|
+
* @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
|
|
2011
|
+
*/
|
|
1984
2012
|
async fetchDepositAddress(code, params = {}) {
|
|
1985
|
-
/**
|
|
1986
|
-
* @method
|
|
1987
|
-
* @name gate#fetchDepositAddress
|
|
1988
|
-
* @description fetch the deposit address for a currency associated with this account
|
|
1989
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#generate-currency-deposit-address
|
|
1990
|
-
* @param {string} code unified currency code
|
|
1991
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
1992
|
-
* @param {string} [params.network] unified network code (not used directly by gate.io but used by ccxt to filter the response)
|
|
1993
|
-
* @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
|
|
1994
|
-
*/
|
|
1995
2013
|
await this.loadMarkets();
|
|
1996
2014
|
const currency = this.currency(code);
|
|
1997
2015
|
const rawNetwork = this.safeStringUpper(params, 'network');
|
|
@@ -2063,16 +2081,16 @@ export default class gate extends Exchange {
|
|
|
2063
2081
|
'tag': tag,
|
|
2064
2082
|
};
|
|
2065
2083
|
}
|
|
2084
|
+
/**
|
|
2085
|
+
* @method
|
|
2086
|
+
* @name gate#fetchTradingFee
|
|
2087
|
+
* @description fetch the trading fees for a market
|
|
2088
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#retrieve-personal-trading-fee
|
|
2089
|
+
* @param {string} symbol unified market symbol
|
|
2090
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2091
|
+
* @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
2092
|
+
*/
|
|
2066
2093
|
async fetchTradingFee(symbol, params = {}) {
|
|
2067
|
-
/**
|
|
2068
|
-
* @method
|
|
2069
|
-
* @name gate#fetchTradingFee
|
|
2070
|
-
* @description fetch the trading fees for a market
|
|
2071
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#retrieve-personal-trading-fee
|
|
2072
|
-
* @param {string} symbol unified market symbol
|
|
2073
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2074
|
-
* @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
2075
|
-
*/
|
|
2076
2094
|
await this.loadMarkets();
|
|
2077
2095
|
const market = this.market(symbol);
|
|
2078
2096
|
const request = {
|
|
@@ -2095,15 +2113,15 @@ export default class gate extends Exchange {
|
|
|
2095
2113
|
//
|
|
2096
2114
|
return this.parseTradingFee(response, market);
|
|
2097
2115
|
}
|
|
2116
|
+
/**
|
|
2117
|
+
* @method
|
|
2118
|
+
* @name gate#fetchTradingFees
|
|
2119
|
+
* @description fetch the trading fees for multiple markets
|
|
2120
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#retrieve-personal-trading-fee
|
|
2121
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2122
|
+
* @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
|
|
2123
|
+
*/
|
|
2098
2124
|
async fetchTradingFees(params = {}) {
|
|
2099
|
-
/**
|
|
2100
|
-
* @method
|
|
2101
|
-
* @name gate#fetchTradingFees
|
|
2102
|
-
* @description fetch the trading fees for multiple markets
|
|
2103
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#retrieve-personal-trading-fee
|
|
2104
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2105
|
-
* @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
|
|
2106
|
-
*/
|
|
2107
2125
|
await this.loadMarkets();
|
|
2108
2126
|
const response = await this.privateWalletGetFee(params);
|
|
2109
2127
|
//
|
|
@@ -2161,17 +2179,17 @@ export default class gate extends Exchange {
|
|
|
2161
2179
|
'tierBased': undefined,
|
|
2162
2180
|
};
|
|
2163
2181
|
}
|
|
2182
|
+
/**
|
|
2183
|
+
* @method
|
|
2184
|
+
* @name gate#fetchTransactionFees
|
|
2185
|
+
* @deprecated
|
|
2186
|
+
* @description please use fetchDepositWithdrawFees instead
|
|
2187
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#retrieve-withdrawal-status
|
|
2188
|
+
* @param {string[]|undefined} codes list of unified currency codes
|
|
2189
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2190
|
+
* @returns {object} a list of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
2191
|
+
*/
|
|
2164
2192
|
async fetchTransactionFees(codes = undefined, params = {}) {
|
|
2165
|
-
/**
|
|
2166
|
-
* @method
|
|
2167
|
-
* @name gate#fetchTransactionFees
|
|
2168
|
-
* @deprecated
|
|
2169
|
-
* @description please use fetchDepositWithdrawFees instead
|
|
2170
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#retrieve-withdrawal-status
|
|
2171
|
-
* @param {string[]|undefined} codes list of unified currency codes
|
|
2172
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2173
|
-
* @returns {object} a list of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
2174
|
-
*/
|
|
2175
2193
|
await this.loadMarkets();
|
|
2176
2194
|
const response = await this.privateWalletGetWithdrawStatus(params);
|
|
2177
2195
|
//
|
|
@@ -2220,16 +2238,16 @@ export default class gate extends Exchange {
|
|
|
2220
2238
|
}
|
|
2221
2239
|
return result;
|
|
2222
2240
|
}
|
|
2241
|
+
/**
|
|
2242
|
+
* @method
|
|
2243
|
+
* @name gate#fetchDepositWithdrawFees
|
|
2244
|
+
* @description fetch deposit and withdraw fees
|
|
2245
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#retrieve-withdrawal-status
|
|
2246
|
+
* @param {string[]|undefined} codes list of unified currency codes
|
|
2247
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2248
|
+
* @returns {object} a list of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
2249
|
+
*/
|
|
2223
2250
|
async fetchDepositWithdrawFees(codes = undefined, params = {}) {
|
|
2224
|
-
/**
|
|
2225
|
-
* @method
|
|
2226
|
-
* @name gate#fetchDepositWithdrawFees
|
|
2227
|
-
* @description fetch deposit and withdraw fees
|
|
2228
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#retrieve-withdrawal-status
|
|
2229
|
-
* @param {string[]|undefined} codes list of unified currency codes
|
|
2230
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2231
|
-
* @returns {object} a list of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
2232
|
-
*/
|
|
2233
2251
|
await this.loadMarkets();
|
|
2234
2252
|
const response = await this.privateWalletGetWithdrawStatus(params);
|
|
2235
2253
|
//
|
|
@@ -2302,19 +2320,19 @@ export default class gate extends Exchange {
|
|
|
2302
2320
|
}
|
|
2303
2321
|
return result;
|
|
2304
2322
|
}
|
|
2323
|
+
/**
|
|
2324
|
+
* @method
|
|
2325
|
+
* @name gate#fetchFundingHistory
|
|
2326
|
+
* @description fetch the history of funding payments paid and received on this account
|
|
2327
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#query-account-book-2
|
|
2328
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#query-account-book-3
|
|
2329
|
+
* @param {string} symbol unified market symbol
|
|
2330
|
+
* @param {int} [since] the earliest time in ms to fetch funding history for
|
|
2331
|
+
* @param {int} [limit] the maximum number of funding history structures to retrieve
|
|
2332
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2333
|
+
* @returns {object} a [funding history structure]{@link https://docs.ccxt.com/#/?id=funding-history-structure}
|
|
2334
|
+
*/
|
|
2305
2335
|
async fetchFundingHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
2306
|
-
/**
|
|
2307
|
-
* @method
|
|
2308
|
-
* @name gate#fetchFundingHistory
|
|
2309
|
-
* @description fetch the history of funding payments paid and received on this account
|
|
2310
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#query-account-book-2
|
|
2311
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#query-account-book-3
|
|
2312
|
-
* @param {string} symbol unified market symbol
|
|
2313
|
-
* @param {int} [since] the earliest time in ms to fetch funding history for
|
|
2314
|
-
* @param {int} [limit] the maximum number of funding history structures to retrieve
|
|
2315
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2316
|
-
* @returns {object} a [funding history structure]{@link https://docs.ccxt.com/#/?id=funding-history-structure}
|
|
2317
|
-
*/
|
|
2318
2336
|
await this.loadMarkets();
|
|
2319
2337
|
// let defaultType = 'future';
|
|
2320
2338
|
let market = undefined;
|
|
@@ -2389,20 +2407,20 @@ export default class gate extends Exchange {
|
|
|
2389
2407
|
'amount': this.safeNumber(info, 'change'),
|
|
2390
2408
|
};
|
|
2391
2409
|
}
|
|
2410
|
+
/**
|
|
2411
|
+
* @method
|
|
2412
|
+
* @name gate#fetchOrderBook
|
|
2413
|
+
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
2414
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#retrieve-order-book
|
|
2415
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#futures-order-book
|
|
2416
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#futures-order-book-2
|
|
2417
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#options-order-book
|
|
2418
|
+
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
2419
|
+
* @param {int} [limit] the maximum amount of order book entries to return
|
|
2420
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2421
|
+
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
2422
|
+
*/
|
|
2392
2423
|
async fetchOrderBook(symbol, limit = undefined, params = {}) {
|
|
2393
|
-
/**
|
|
2394
|
-
* @method
|
|
2395
|
-
* @name gate#fetchOrderBook
|
|
2396
|
-
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
2397
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#retrieve-order-book
|
|
2398
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#futures-order-book
|
|
2399
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#futures-order-book-2
|
|
2400
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#options-order-book
|
|
2401
|
-
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
2402
|
-
* @param {int} [limit] the maximum amount of order book entries to return
|
|
2403
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2404
|
-
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
2405
|
-
*/
|
|
2406
2424
|
await this.loadMarkets();
|
|
2407
2425
|
const market = this.market(symbol);
|
|
2408
2426
|
//
|
|
@@ -2509,19 +2527,19 @@ export default class gate extends Exchange {
|
|
|
2509
2527
|
result['nonce'] = nonce;
|
|
2510
2528
|
return result;
|
|
2511
2529
|
}
|
|
2530
|
+
/**
|
|
2531
|
+
* @method
|
|
2532
|
+
* @name gate#fetchTicker
|
|
2533
|
+
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
2534
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#get-details-of-a-specifc-order
|
|
2535
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#list-futures-tickers
|
|
2536
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#list-futures-tickers-2
|
|
2537
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#list-tickers-of-options-contracts
|
|
2538
|
+
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
2539
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2540
|
+
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
2541
|
+
*/
|
|
2512
2542
|
async fetchTicker(symbol, params = {}) {
|
|
2513
|
-
/**
|
|
2514
|
-
* @method
|
|
2515
|
-
* @name gate#fetchTicker
|
|
2516
|
-
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
2517
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#get-details-of-a-specifc-order
|
|
2518
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#list-futures-tickers
|
|
2519
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#list-futures-tickers-2
|
|
2520
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#list-tickers-of-options-contracts
|
|
2521
|
-
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
2522
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2523
|
-
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
2524
|
-
*/
|
|
2525
2543
|
await this.loadMarkets();
|
|
2526
2544
|
const market = this.market(symbol);
|
|
2527
2545
|
const [request, query] = this.prepareRequest(market, undefined, params);
|
|
@@ -2673,19 +2691,19 @@ export default class gate extends Exchange {
|
|
|
2673
2691
|
'info': ticker,
|
|
2674
2692
|
}, market);
|
|
2675
2693
|
}
|
|
2694
|
+
/**
|
|
2695
|
+
* @method
|
|
2696
|
+
* @name gate#fetchTickers
|
|
2697
|
+
* @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
|
2698
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#get-details-of-a-specifc-order
|
|
2699
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#list-futures-tickers
|
|
2700
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#list-futures-tickers-2
|
|
2701
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#list-tickers-of-options-contracts
|
|
2702
|
+
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
2703
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2704
|
+
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
2705
|
+
*/
|
|
2676
2706
|
async fetchTickers(symbols = undefined, params = {}) {
|
|
2677
|
-
/**
|
|
2678
|
-
* @method
|
|
2679
|
-
* @name gate#fetchTickers
|
|
2680
|
-
* @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
|
2681
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#get-details-of-a-specifc-order
|
|
2682
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#list-futures-tickers
|
|
2683
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#list-futures-tickers-2
|
|
2684
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#list-tickers-of-options-contracts
|
|
2685
|
-
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
2686
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2687
|
-
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
2688
|
-
*/
|
|
2689
2707
|
await this.loadMarkets();
|
|
2690
2708
|
symbols = this.marketSymbols(symbols);
|
|
2691
2709
|
const first = this.safeString(symbols, 0);
|
|
@@ -2728,15 +2746,18 @@ export default class gate extends Exchange {
|
|
|
2728
2746
|
}
|
|
2729
2747
|
return account;
|
|
2730
2748
|
}
|
|
2749
|
+
/**
|
|
2750
|
+
* @method
|
|
2751
|
+
* @name gate#fetchBalance
|
|
2752
|
+
* @param {object} [params] exchange specific parameters
|
|
2753
|
+
* @param {string} [params.type] spot, margin, swap or future, if not provided this.options['defaultType'] is used
|
|
2754
|
+
* @param {string} [params.settle] 'btc' or 'usdt' - settle currency for perpetual swap and future - default="usdt" for swap and "btc" for future
|
|
2755
|
+
* @param {string} [params.marginMode] 'cross' or 'isolated' - marginMode for margin trading if not provided this.options['defaultMarginMode'] is used
|
|
2756
|
+
* @param {string} [params.symbol] margin only - unified ccxt symbol
|
|
2757
|
+
* @param {boolean} [params.unifiedAccount] default false, set to true for fetching the unified account balance
|
|
2758
|
+
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
2759
|
+
*/
|
|
2731
2760
|
async fetchBalance(params = {}) {
|
|
2732
|
-
/**
|
|
2733
|
-
* @param {object} [params] exchange specific parameters
|
|
2734
|
-
* @param {string} [params.type] spot, margin, swap or future, if not provided this.options['defaultType'] is used
|
|
2735
|
-
* @param {string} [params.settle] 'btc' or 'usdt' - settle currency for perpetual swap and future - default="usdt" for swap and "btc" for future
|
|
2736
|
-
* @param {string} [params.marginMode] 'cross' or 'isolated' - marginMode for margin trading if not provided this.options['defaultMarginMode'] is used
|
|
2737
|
-
* @param {string} [params.symbol] margin only - unified ccxt symbol
|
|
2738
|
-
* @param {boolean} [params.unifiedAccount] default false, set to true for fetching the unified account balance
|
|
2739
|
-
*/
|
|
2740
2761
|
await this.loadMarkets();
|
|
2741
2762
|
await this.loadUnifiedStatus();
|
|
2742
2763
|
const symbol = this.safeString(params, 'symbol');
|
|
@@ -3020,25 +3041,25 @@ export default class gate extends Exchange {
|
|
|
3020
3041
|
const returnResult = isolated ? result : this.safeBalance(result);
|
|
3021
3042
|
return returnResult;
|
|
3022
3043
|
}
|
|
3044
|
+
/**
|
|
3045
|
+
* @method
|
|
3046
|
+
* @name gateio#fetchOHLCV
|
|
3047
|
+
* @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
3048
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#market-candlesticks // spot
|
|
3049
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#get-futures-candlesticks // swap
|
|
3050
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#market-candlesticks // future
|
|
3051
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#get-options-candlesticks // option
|
|
3052
|
+
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
3053
|
+
* @param {string} timeframe the length of time each candle represents
|
|
3054
|
+
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
3055
|
+
* @param {int} [limit] the maximum amount of candles to fetch, limit is conflicted with since and params["until"], If either since and params["until"] is specified, request will be rejected
|
|
3056
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3057
|
+
* @param {string} [params.price] "mark" or "index" for mark price and index price candles
|
|
3058
|
+
* @param {int} [params.until] timestamp in ms of the latest candle to fetch
|
|
3059
|
+
* @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)
|
|
3060
|
+
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume (units in quote currency)
|
|
3061
|
+
*/
|
|
3023
3062
|
async fetchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
|
|
3024
|
-
/**
|
|
3025
|
-
* @method
|
|
3026
|
-
* @name gateio#fetchOHLCV
|
|
3027
|
-
* @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
3028
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#market-candlesticks // spot
|
|
3029
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#get-futures-candlesticks // swap
|
|
3030
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#market-candlesticks // future
|
|
3031
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#get-options-candlesticks // option
|
|
3032
|
-
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
3033
|
-
* @param {string} timeframe the length of time each candle represents
|
|
3034
|
-
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
3035
|
-
* @param {int} [limit] the maximum amount of candles to fetch, limit is conflicted with since and params["until"], If either since and params["until"] is specified, request will be rejected
|
|
3036
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3037
|
-
* @param {string} [params.price] "mark" or "index" for mark price and index price candles
|
|
3038
|
-
* @param {int} [params.until] timestamp in ms of the latest candle to fetch
|
|
3039
|
-
* @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)
|
|
3040
|
-
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume (units in quote currency)
|
|
3041
|
-
*/
|
|
3042
3063
|
await this.loadMarkets();
|
|
3043
3064
|
const market = this.market(symbol);
|
|
3044
3065
|
let paginate = false;
|
|
@@ -3111,31 +3132,47 @@ export default class gate extends Exchange {
|
|
|
3111
3132
|
const response = await this.publicOptionsGetCandlesticks(this.extend(request, params));
|
|
3112
3133
|
return this.parseOHLCVs(response, market, timeframe, since, limit);
|
|
3113
3134
|
}
|
|
3135
|
+
/**
|
|
3136
|
+
* @method
|
|
3137
|
+
* @name gate#fetchFundingRateHistory
|
|
3138
|
+
* @description fetches historical funding rate prices
|
|
3139
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#funding-rate-history
|
|
3140
|
+
* @param {string} symbol unified symbol of the market to fetch the funding rate history for
|
|
3141
|
+
* @param {int} [since] timestamp in ms of the earliest funding rate to fetch
|
|
3142
|
+
* @param {int} [limit] the maximum amount of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure} to fetch
|
|
3143
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3144
|
+
* @param {int} [params.until] timestamp in ms of the latest funding rate to fetch
|
|
3145
|
+
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
3146
|
+
* @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure}
|
|
3147
|
+
*/
|
|
3114
3148
|
async fetchFundingRateHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
3115
|
-
/**
|
|
3116
|
-
* @method
|
|
3117
|
-
* @name gate#fetchFundingRateHistory
|
|
3118
|
-
* @description fetches historical funding rate prices
|
|
3119
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#funding-rate-history
|
|
3120
|
-
* @param {string} symbol unified symbol of the market to fetch the funding rate history for
|
|
3121
|
-
* @param {int} [since] timestamp in ms of the earliest funding rate to fetch
|
|
3122
|
-
* @param {int} [limit] the maximum amount of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure} to fetch
|
|
3123
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3124
|
-
* @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure}
|
|
3125
|
-
*/
|
|
3126
3149
|
if (symbol === undefined) {
|
|
3127
3150
|
throw new ArgumentsRequired(this.id + ' fetchFundingRateHistory() requires a symbol argument');
|
|
3128
3151
|
}
|
|
3129
3152
|
await this.loadMarkets();
|
|
3153
|
+
let paginate = false;
|
|
3154
|
+
[paginate, params] = this.handleOptionAndParams(params, 'fetchFundingRateHistory', 'paginate');
|
|
3155
|
+
if (paginate) {
|
|
3156
|
+
return await this.fetchPaginatedCallDeterministic('fetchFundingRateHistory', symbol, since, limit, '8h', params);
|
|
3157
|
+
}
|
|
3130
3158
|
const market = this.market(symbol);
|
|
3131
3159
|
if (!market['swap']) {
|
|
3132
3160
|
throw new BadSymbol(this.id + ' fetchFundingRateHistory() supports swap contracts only');
|
|
3133
3161
|
}
|
|
3134
|
-
|
|
3162
|
+
let request = {};
|
|
3163
|
+
[request, params] = this.prepareRequest(market, undefined, params);
|
|
3135
3164
|
if (limit !== undefined) {
|
|
3136
3165
|
request['limit'] = limit;
|
|
3137
3166
|
}
|
|
3138
|
-
|
|
3167
|
+
if (since !== undefined) {
|
|
3168
|
+
request['from'] = this.parseToInt(since / 1000);
|
|
3169
|
+
}
|
|
3170
|
+
const until = this.safeInteger(params, 'until');
|
|
3171
|
+
if (until !== undefined) {
|
|
3172
|
+
params = this.omit(params, 'until');
|
|
3173
|
+
request['to'] = this.parseToInt(until / 1000);
|
|
3174
|
+
}
|
|
3175
|
+
const response = await this.publicFuturesGetSettleFundingRate(this.extend(request, params));
|
|
3139
3176
|
//
|
|
3140
3177
|
// {
|
|
3141
3178
|
// "r": "0.00063521",
|
|
@@ -3204,23 +3241,23 @@ export default class gate extends Exchange {
|
|
|
3204
3241
|
];
|
|
3205
3242
|
}
|
|
3206
3243
|
}
|
|
3244
|
+
/**
|
|
3245
|
+
* @method
|
|
3246
|
+
* @name gate#fetchTrades
|
|
3247
|
+
* @description get the list of most recent trades for a particular symbol
|
|
3248
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#retrieve-market-trades
|
|
3249
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#futures-trading-history
|
|
3250
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#futures-trading-history-2
|
|
3251
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#options-trade-history
|
|
3252
|
+
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
3253
|
+
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
3254
|
+
* @param {int} [limit] the maximum amount of trades to fetch
|
|
3255
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3256
|
+
* @param {int} [params.until] timestamp in ms of the latest trade to fetch
|
|
3257
|
+
* @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)
|
|
3258
|
+
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
|
|
3259
|
+
*/
|
|
3207
3260
|
async fetchTrades(symbol, since = undefined, limit = undefined, params = {}) {
|
|
3208
|
-
/**
|
|
3209
|
-
* @method
|
|
3210
|
-
* @name gate#fetchTrades
|
|
3211
|
-
* @description get the list of most recent trades for a particular symbol
|
|
3212
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#retrieve-market-trades
|
|
3213
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#futures-trading-history
|
|
3214
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#futures-trading-history-2
|
|
3215
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#options-trade-history
|
|
3216
|
-
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
3217
|
-
* @param {int} [since] timestamp in ms of the earliest trade to fetch
|
|
3218
|
-
* @param {int} [limit] the maximum amount of trades to fetch
|
|
3219
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3220
|
-
* @param {int} [params.until] timestamp in ms of the latest trade to fetch
|
|
3221
|
-
* @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)
|
|
3222
|
-
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
|
|
3223
|
-
*/
|
|
3224
3261
|
await this.loadMarkets();
|
|
3225
3262
|
let paginate = false;
|
|
3226
3263
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchTrades', 'paginate');
|
|
@@ -3319,22 +3356,22 @@ export default class gate extends Exchange {
|
|
|
3319
3356
|
//
|
|
3320
3357
|
return this.parseTrades(response, market, since, limit);
|
|
3321
3358
|
}
|
|
3359
|
+
/**
|
|
3360
|
+
* @method
|
|
3361
|
+
* @name gate#fetchOrderTrades
|
|
3362
|
+
* @description fetch all the trades made from a single order
|
|
3363
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#list-personal-trading-history
|
|
3364
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#list-personal-trading-history-2
|
|
3365
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#list-personal-trading-history-3
|
|
3366
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#list-personal-trading-history-4
|
|
3367
|
+
* @param {string} id order id
|
|
3368
|
+
* @param {string} symbol unified market symbol
|
|
3369
|
+
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
3370
|
+
* @param {int} [limit] the maximum number of trades to retrieve
|
|
3371
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3372
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
3373
|
+
*/
|
|
3322
3374
|
async fetchOrderTrades(id, symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
3323
|
-
/**
|
|
3324
|
-
* @method
|
|
3325
|
-
* @name gate#fetchOrderTrades
|
|
3326
|
-
* @description fetch all the trades made from a single order
|
|
3327
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#list-personal-trading-history
|
|
3328
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#list-personal-trading-history-2
|
|
3329
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#list-personal-trading-history-3
|
|
3330
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#list-personal-trading-history-4
|
|
3331
|
-
* @param {string} id order id
|
|
3332
|
-
* @param {string} symbol unified market symbol
|
|
3333
|
-
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
3334
|
-
* @param {int} [limit] the maximum number of trades to retrieve
|
|
3335
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3336
|
-
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
3337
|
-
*/
|
|
3338
3375
|
if (symbol === undefined) {
|
|
3339
3376
|
throw new ArgumentsRequired(this.id + ' fetchOrderTrades() requires a symbol argument');
|
|
3340
3377
|
}
|
|
@@ -3361,32 +3398,32 @@ export default class gate extends Exchange {
|
|
|
3361
3398
|
const response = await this.fetchMyTrades(symbol, since, limit, { 'order_id': id });
|
|
3362
3399
|
return response;
|
|
3363
3400
|
}
|
|
3401
|
+
/**
|
|
3402
|
+
* @method
|
|
3403
|
+
* @name gate#fetchMyTrades
|
|
3404
|
+
* @description Fetch personal trading history
|
|
3405
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#list-personal-trading-history
|
|
3406
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#list-personal-trading-history-2
|
|
3407
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#list-personal-trading-history-3
|
|
3408
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#list-personal-trading-history-4
|
|
3409
|
+
* @param {string} symbol unified market symbol
|
|
3410
|
+
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
3411
|
+
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
3412
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3413
|
+
* @param {string} [params.marginMode] 'cross' or 'isolated' - marginMode for margin trading if not provided this.options['defaultMarginMode'] is used
|
|
3414
|
+
* @param {string} [params.type] 'spot', 'swap', or 'future', if not provided this.options['defaultMarginMode'] is used
|
|
3415
|
+
* @param {int} [params.until] The latest timestamp, in ms, that fetched trades were made
|
|
3416
|
+
* @param {int} [params.page] *spot only* Page number
|
|
3417
|
+
* @param {string} [params.order_id] *spot only* Filter trades with specified order ID. symbol is also required if this field is present
|
|
3418
|
+
* @param {string} [params.order] *contract only* Futures order ID, return related data only if specified
|
|
3419
|
+
* @param {int} [params.offset] *contract only* list offset, starting from 0
|
|
3420
|
+
* @param {string} [params.last_id] *contract only* specify list staring point using the id of last record in previous list-query results
|
|
3421
|
+
* @param {int} [params.count_total] *contract only* whether to return total number matched, default to 0(no return)
|
|
3422
|
+
* @param {bool} [params.unifiedAccount] set to true for fetching trades in a unified account
|
|
3423
|
+
* @param {bool} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
3424
|
+
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
3425
|
+
*/
|
|
3364
3426
|
async fetchMyTrades(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
3365
|
-
/**
|
|
3366
|
-
* @method
|
|
3367
|
-
* @name gate#fetchMyTrades
|
|
3368
|
-
* @description Fetch personal trading history
|
|
3369
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#list-personal-trading-history
|
|
3370
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#list-personal-trading-history-2
|
|
3371
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#list-personal-trading-history-3
|
|
3372
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#list-personal-trading-history-4
|
|
3373
|
-
* @param {string} symbol unified market symbol
|
|
3374
|
-
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
3375
|
-
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
3376
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3377
|
-
* @param {string} [params.marginMode] 'cross' or 'isolated' - marginMode for margin trading if not provided this.options['defaultMarginMode'] is used
|
|
3378
|
-
* @param {string} [params.type] 'spot', 'swap', or 'future', if not provided this.options['defaultMarginMode'] is used
|
|
3379
|
-
* @param {int} [params.until] The latest timestamp, in ms, that fetched trades were made
|
|
3380
|
-
* @param {int} [params.page] *spot only* Page number
|
|
3381
|
-
* @param {string} [params.order_id] *spot only* Filter trades with specified order ID. symbol is also required if this field is present
|
|
3382
|
-
* @param {string} [params.order] *contract only* Futures order ID, return related data only if specified
|
|
3383
|
-
* @param {int} [params.offset] *contract only* list offset, starting from 0
|
|
3384
|
-
* @param {string} [params.last_id] *contract only* specify list staring point using the id of last record in previous list-query results
|
|
3385
|
-
* @param {int} [params.count_total] *contract only* whether to return total number matched, default to 0(no return)
|
|
3386
|
-
* @param {bool} [params.unifiedAccount] set to true for fetching trades in a unified account
|
|
3387
|
-
* @param {bool} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
3388
|
-
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
3389
|
-
*/
|
|
3390
3427
|
await this.loadMarkets();
|
|
3391
3428
|
await this.loadUnifiedStatus();
|
|
3392
3429
|
let paginate = false;
|
|
@@ -3652,20 +3689,20 @@ export default class gate extends Exchange {
|
|
|
3652
3689
|
'fees': fees,
|
|
3653
3690
|
}, market);
|
|
3654
3691
|
}
|
|
3692
|
+
/**
|
|
3693
|
+
* @method
|
|
3694
|
+
* @name gate#fetchDeposits
|
|
3695
|
+
* @description fetch all deposits made to an account
|
|
3696
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#retrieve-deposit-records
|
|
3697
|
+
* @param {string} code unified currency code
|
|
3698
|
+
* @param {int} [since] the earliest time in ms to fetch deposits for
|
|
3699
|
+
* @param {int} [limit] the maximum number of deposits structures to retrieve
|
|
3700
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3701
|
+
* @param {int} [params.until] end time in ms
|
|
3702
|
+
* @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)
|
|
3703
|
+
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
3704
|
+
*/
|
|
3655
3705
|
async fetchDeposits(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
3656
|
-
/**
|
|
3657
|
-
* @method
|
|
3658
|
-
* @name gate#fetchDeposits
|
|
3659
|
-
* @description fetch all deposits made to an account
|
|
3660
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#retrieve-deposit-records
|
|
3661
|
-
* @param {string} code unified currency code
|
|
3662
|
-
* @param {int} [since] the earliest time in ms to fetch deposits for
|
|
3663
|
-
* @param {int} [limit] the maximum number of deposits structures to retrieve
|
|
3664
|
-
* @param {int} [params.until] end time in ms
|
|
3665
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3666
|
-
* @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)
|
|
3667
|
-
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
3668
|
-
*/
|
|
3669
3706
|
await this.loadMarkets();
|
|
3670
3707
|
let paginate = false;
|
|
3671
3708
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchDeposits', 'paginate');
|
|
@@ -3690,20 +3727,20 @@ export default class gate extends Exchange {
|
|
|
3690
3727
|
const response = await this.privateWalletGetDeposits(this.extend(request, params));
|
|
3691
3728
|
return this.parseTransactions(response, currency);
|
|
3692
3729
|
}
|
|
3730
|
+
/**
|
|
3731
|
+
* @method
|
|
3732
|
+
* @name gate#fetchWithdrawals
|
|
3733
|
+
* @description fetch all withdrawals made from an account
|
|
3734
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#retrieve-withdrawal-records
|
|
3735
|
+
* @param {string} code unified currency code
|
|
3736
|
+
* @param {int} [since] the earliest time in ms to fetch withdrawals for
|
|
3737
|
+
* @param {int} [limit] the maximum number of withdrawals structures to retrieve
|
|
3738
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3739
|
+
* @param {int} [params.until] end time in ms
|
|
3740
|
+
* @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)
|
|
3741
|
+
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
3742
|
+
*/
|
|
3693
3743
|
async fetchWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
3694
|
-
/**
|
|
3695
|
-
* @method
|
|
3696
|
-
* @name gate#fetchWithdrawals
|
|
3697
|
-
* @description fetch all withdrawals made from an account
|
|
3698
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#retrieve-withdrawal-records
|
|
3699
|
-
* @param {string} code unified currency code
|
|
3700
|
-
* @param {int} [since] the earliest time in ms to fetch withdrawals for
|
|
3701
|
-
* @param {int} [limit] the maximum number of withdrawals structures to retrieve
|
|
3702
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3703
|
-
* @param {int} [params.until] end time in ms
|
|
3704
|
-
* @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)
|
|
3705
|
-
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
3706
|
-
*/
|
|
3707
3744
|
await this.loadMarkets();
|
|
3708
3745
|
let paginate = false;
|
|
3709
3746
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchWithdrawals', 'paginate');
|
|
@@ -3728,19 +3765,19 @@ export default class gate extends Exchange {
|
|
|
3728
3765
|
const response = await this.privateWalletGetWithdrawals(this.extend(request, params));
|
|
3729
3766
|
return this.parseTransactions(response, currency);
|
|
3730
3767
|
}
|
|
3768
|
+
/**
|
|
3769
|
+
* @method
|
|
3770
|
+
* @name gate#withdraw
|
|
3771
|
+
* @description make a withdrawal
|
|
3772
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#withdraw
|
|
3773
|
+
* @param {string} code unified currency code
|
|
3774
|
+
* @param {float} amount the amount to withdraw
|
|
3775
|
+
* @param {string} address the address to withdraw to
|
|
3776
|
+
* @param {string} tag
|
|
3777
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3778
|
+
* @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
3779
|
+
*/
|
|
3731
3780
|
async withdraw(code, amount, address, tag = undefined, params = {}) {
|
|
3732
|
-
/**
|
|
3733
|
-
* @method
|
|
3734
|
-
* @name gate#withdraw
|
|
3735
|
-
* @description make a withdrawal
|
|
3736
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#withdraw
|
|
3737
|
-
* @param {string} code unified currency code
|
|
3738
|
-
* @param {float} amount the amount to withdraw
|
|
3739
|
-
* @param {string} address the address to withdraw to
|
|
3740
|
-
* @param {string} tag
|
|
3741
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3742
|
-
* @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
3743
|
-
*/
|
|
3744
3781
|
[tag, params] = this.handleWithdrawTagAndParams(tag, params);
|
|
3745
3782
|
this.checkAddress(address);
|
|
3746
3783
|
await this.loadMarkets();
|
|
@@ -3913,42 +3950,42 @@ export default class gate extends Exchange {
|
|
|
3913
3950
|
},
|
|
3914
3951
|
};
|
|
3915
3952
|
}
|
|
3953
|
+
/**
|
|
3954
|
+
* @method
|
|
3955
|
+
* @name gate#createOrder
|
|
3956
|
+
* @description Create an order on the exchange
|
|
3957
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#create-an-order
|
|
3958
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#create-a-price-triggered-order
|
|
3959
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#create-a-futures-order
|
|
3960
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#create-a-price-triggered-order-2
|
|
3961
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#create-a-futures-order-2
|
|
3962
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#create-a-price-triggered-order-3
|
|
3963
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#create-an-options-order
|
|
3964
|
+
* @param {string} symbol Unified CCXT market symbol
|
|
3965
|
+
* @param {string} type 'limit' or 'market' *"market" is contract only*
|
|
3966
|
+
* @param {string} side 'buy' or 'sell'
|
|
3967
|
+
* @param {float} amount the amount of currency to trade
|
|
3968
|
+
* @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
3969
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3970
|
+
* @param {float} [params.stopPrice] The price at which a trigger order is triggered at
|
|
3971
|
+
* @param {string} [params.timeInForce] "GTC", "IOC", or "PO"
|
|
3972
|
+
* @param {float} [params.stopLossPrice] The price at which a stop loss order is triggered at
|
|
3973
|
+
* @param {float} [params.takeProfitPrice] The price at which a take profit order is triggered at
|
|
3974
|
+
* @param {string} [params.marginMode] 'cross' or 'isolated' - marginMode for margin trading if not provided this.options['defaultMarginMode'] is used
|
|
3975
|
+
* @param {int} [params.iceberg] Amount to display for the iceberg order, Null or 0 for normal orders, Set to -1 to hide the order completely
|
|
3976
|
+
* @param {string} [params.text] User defined information
|
|
3977
|
+
* @param {string} [params.account] *spot and margin only* "spot", "margin" or "cross_margin"
|
|
3978
|
+
* @param {bool} [params.auto_borrow] *margin only* Used in margin or cross margin trading to allow automatic loan of insufficient amount if balance is not enough
|
|
3979
|
+
* @param {string} [params.settle] *contract only* Unified Currency Code for settle currency
|
|
3980
|
+
* @param {bool} [params.reduceOnly] *contract only* Indicates if this order is to reduce the size of a position
|
|
3981
|
+
* @param {bool} [params.close] *contract only* Set as true to close the position, with size set to 0
|
|
3982
|
+
* @param {bool} [params.auto_size] *contract only* Set side to close dual-mode position, close_long closes the long side, while close_short the short one, size also needs to be set to 0
|
|
3983
|
+
* @param {int} [params.price_type] *contract only* 0 latest deal price, 1 mark price, 2 index price
|
|
3984
|
+
* @param {float} [params.cost] *spot market buy only* the quote quantity that can be used as an alternative for the amount
|
|
3985
|
+
* @param {bool} [params.unifiedAccount] set to true for creating an order in the unified account
|
|
3986
|
+
* @returns {object|undefined} [An order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
3987
|
+
*/
|
|
3916
3988
|
async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
|
|
3917
|
-
/**
|
|
3918
|
-
* @method
|
|
3919
|
-
* @name gate#createOrder
|
|
3920
|
-
* @description Create an order on the exchange
|
|
3921
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#create-an-order
|
|
3922
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#create-a-price-triggered-order
|
|
3923
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#create-a-futures-order
|
|
3924
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#create-a-price-triggered-order-2
|
|
3925
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#create-a-futures-order-2
|
|
3926
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#create-a-price-triggered-order-3
|
|
3927
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#create-an-options-order
|
|
3928
|
-
* @param {string} symbol Unified CCXT market symbol
|
|
3929
|
-
* @param {string} type 'limit' or 'market' *"market" is contract only*
|
|
3930
|
-
* @param {string} side 'buy' or 'sell'
|
|
3931
|
-
* @param {float} amount the amount of currency to trade
|
|
3932
|
-
* @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
3933
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3934
|
-
* @param {float} [params.stopPrice] The price at which a trigger order is triggered at
|
|
3935
|
-
* @param {string} [params.timeInForce] "GTC", "IOC", or "PO"
|
|
3936
|
-
* @param {float} [params.stopLossPrice] The price at which a stop loss order is triggered at
|
|
3937
|
-
* @param {float} [params.takeProfitPrice] The price at which a take profit order is triggered at
|
|
3938
|
-
* @param {string} [params.marginMode] 'cross' or 'isolated' - marginMode for margin trading if not provided this.options['defaultMarginMode'] is used
|
|
3939
|
-
* @param {int} [params.iceberg] Amount to display for the iceberg order, Null or 0 for normal orders, Set to -1 to hide the order completely
|
|
3940
|
-
* @param {string} [params.text] User defined information
|
|
3941
|
-
* @param {string} [params.account] *spot and margin only* "spot", "margin" or "cross_margin"
|
|
3942
|
-
* @param {bool} [params.auto_borrow] *margin only* Used in margin or cross margin trading to allow automatic loan of insufficient amount if balance is not enough
|
|
3943
|
-
* @param {string} [params.settle] *contract only* Unified Currency Code for settle currency
|
|
3944
|
-
* @param {bool} [params.reduceOnly] *contract only* Indicates if this order is to reduce the size of a position
|
|
3945
|
-
* @param {bool} [params.close] *contract only* Set as true to close the position, with size set to 0
|
|
3946
|
-
* @param {bool} [params.auto_size] *contract only* Set side to close dual-mode position, close_long closes the long side, while close_short the short one, size also needs to be set to 0
|
|
3947
|
-
* @param {int} [params.price_type] *contract only* 0 latest deal price, 1 mark price, 2 index price
|
|
3948
|
-
* @param {float} [params.cost] *spot market buy only* the quote quantity that can be used as an alternative for the amount
|
|
3949
|
-
* @param {bool} [params.unifiedAccount] set to true for creating an order in the unified account
|
|
3950
|
-
* @returns {object|undefined} [An order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
3951
|
-
*/
|
|
3952
3989
|
await this.loadMarkets();
|
|
3953
3990
|
await this.loadUnifiedStatus();
|
|
3954
3991
|
const market = this.market(symbol);
|
|
@@ -4090,17 +4127,18 @@ export default class gate extends Exchange {
|
|
|
4090
4127
|
}
|
|
4091
4128
|
return ordersRequests;
|
|
4092
4129
|
}
|
|
4130
|
+
/**
|
|
4131
|
+
* @method
|
|
4132
|
+
* @name gate#createOrders
|
|
4133
|
+
* @description create a list of trade orders
|
|
4134
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#get-a-single-order-2
|
|
4135
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#create-a-batch-of-orders
|
|
4136
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#create-a-batch-of-futures-orders
|
|
4137
|
+
* @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
|
|
4138
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4139
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4140
|
+
*/
|
|
4093
4141
|
async createOrders(orders, params = {}) {
|
|
4094
|
-
/**
|
|
4095
|
-
* @method
|
|
4096
|
-
* @name gate#createOrders
|
|
4097
|
-
* @description create a list of trade orders
|
|
4098
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#get-a-single-order-2
|
|
4099
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#create-a-batch-of-orders
|
|
4100
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#create-a-batch-of-futures-orders
|
|
4101
|
-
* @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
|
|
4102
|
-
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4103
|
-
*/
|
|
4104
4142
|
await this.loadMarkets();
|
|
4105
4143
|
await this.loadUnifiedStatus();
|
|
4106
4144
|
const ordersRequests = this.createOrdersRequest(orders, params);
|
|
@@ -4375,18 +4413,18 @@ export default class gate extends Exchange {
|
|
|
4375
4413
|
}
|
|
4376
4414
|
return this.extend(request, params);
|
|
4377
4415
|
}
|
|
4416
|
+
/**
|
|
4417
|
+
* @method
|
|
4418
|
+
* @name gate#createMarketBuyOrderWithCost
|
|
4419
|
+
* @description create a market buy order by providing the symbol and cost
|
|
4420
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#create-an-order
|
|
4421
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
4422
|
+
* @param {float} cost how much you want to trade in units of the quote currency
|
|
4423
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4424
|
+
* @param {bool} [params.unifiedAccount] set to true for creating a unified account order
|
|
4425
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4426
|
+
*/
|
|
4378
4427
|
async createMarketBuyOrderWithCost(symbol, cost, params = {}) {
|
|
4379
|
-
/**
|
|
4380
|
-
* @method
|
|
4381
|
-
* @name gate#createMarketBuyOrderWithCost
|
|
4382
|
-
* @description create a market buy order by providing the symbol and cost
|
|
4383
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#create-an-order
|
|
4384
|
-
* @param {string} symbol unified symbol of the market to create an order in
|
|
4385
|
-
* @param {float} cost how much you want to trade in units of the quote currency
|
|
4386
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4387
|
-
* @param {bool} [params.unifiedAccount] set to true for creating a unified account order
|
|
4388
|
-
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4389
|
-
*/
|
|
4390
4428
|
await this.loadMarkets();
|
|
4391
4429
|
await this.loadUnifiedStatus();
|
|
4392
4430
|
const market = this.market(symbol);
|
|
@@ -4439,23 +4477,23 @@ export default class gate extends Exchange {
|
|
|
4439
4477
|
}
|
|
4440
4478
|
return this.extend(request, params);
|
|
4441
4479
|
}
|
|
4480
|
+
/**
|
|
4481
|
+
* @method
|
|
4482
|
+
* @name gate#editOrder
|
|
4483
|
+
* @description edit a trade order, gate currently only supports the modification of the price or amount fields
|
|
4484
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#amend-an-order
|
|
4485
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#amend-an-order-2
|
|
4486
|
+
* @param {string} id order id
|
|
4487
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
4488
|
+
* @param {string} type 'market' or 'limit'
|
|
4489
|
+
* @param {string} side 'buy' or 'sell'
|
|
4490
|
+
* @param {float} amount how much of the currency you want to trade in units of the base currency
|
|
4491
|
+
* @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
4492
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4493
|
+
* @param {bool} [params.unifiedAccount] set to true for editing an order in a unified account
|
|
4494
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4495
|
+
*/
|
|
4442
4496
|
async editOrder(id, symbol, type, side, amount = undefined, price = undefined, params = {}) {
|
|
4443
|
-
/**
|
|
4444
|
-
* @method
|
|
4445
|
-
* @name gate#editOrder
|
|
4446
|
-
* @description edit a trade order, gate currently only supports the modification of the price or amount fields
|
|
4447
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#amend-an-order
|
|
4448
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#amend-an-order-2
|
|
4449
|
-
* @param {string} id order id
|
|
4450
|
-
* @param {string} symbol unified symbol of the market to create an order in
|
|
4451
|
-
* @param {string} type 'market' or 'limit'
|
|
4452
|
-
* @param {string} side 'buy' or 'sell'
|
|
4453
|
-
* @param {float} amount how much of the currency you want to trade in units of the base currency
|
|
4454
|
-
* @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
4455
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4456
|
-
* @param {bool} [params.unifiedAccount] set to true for editing an order in a unified account
|
|
4457
|
-
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4458
|
-
*/
|
|
4459
4497
|
await this.loadMarkets();
|
|
4460
4498
|
await this.loadUnifiedStatus();
|
|
4461
4499
|
const market = this.market(symbol);
|
|
@@ -4801,25 +4839,25 @@ export default class gate extends Exchange {
|
|
|
4801
4839
|
request['order_id'] = orderId.toString();
|
|
4802
4840
|
return [request, requestParams];
|
|
4803
4841
|
}
|
|
4842
|
+
/**
|
|
4843
|
+
* @method
|
|
4844
|
+
* @name gate#fetchOrder
|
|
4845
|
+
* @description Retrieves information on an order
|
|
4846
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#get-a-single-order
|
|
4847
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#get-a-single-order-2
|
|
4848
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#get-a-single-order-3
|
|
4849
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#get-a-single-order-4
|
|
4850
|
+
* @param {string} id Order id
|
|
4851
|
+
* @param {string} symbol Unified market symbol, *required for spot and margin*
|
|
4852
|
+
* @param {object} [params] Parameters specified by the exchange api
|
|
4853
|
+
* @param {bool} [params.trigger] True if the order being fetched is a trigger order
|
|
4854
|
+
* @param {string} [params.marginMode] 'cross' or 'isolated' - marginMode for margin trading if not provided this.options['defaultMarginMode'] is used
|
|
4855
|
+
* @param {string} [params.type] 'spot', 'swap', or 'future', if not provided this.options['defaultMarginMode'] is used
|
|
4856
|
+
* @param {string} [params.settle] 'btc' or 'usdt' - settle currency for perpetual swap and future - market settle currency is used if symbol !== undefined, default="usdt" for swap and "btc" for future
|
|
4857
|
+
* @param {bool} [params.unifiedAccount] set to true for fetching a unified account order
|
|
4858
|
+
* @returns An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4859
|
+
*/
|
|
4804
4860
|
async fetchOrder(id, symbol = undefined, params = {}) {
|
|
4805
|
-
/**
|
|
4806
|
-
* @method
|
|
4807
|
-
* @name gate#fetchOrder
|
|
4808
|
-
* @description Retrieves information on an order
|
|
4809
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#get-a-single-order
|
|
4810
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#get-a-single-order-2
|
|
4811
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#get-a-single-order-3
|
|
4812
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#get-a-single-order-4
|
|
4813
|
-
* @param {string} id Order id
|
|
4814
|
-
* @param {string} symbol Unified market symbol, *required for spot and margin*
|
|
4815
|
-
* @param {object} [params] Parameters specified by the exchange api
|
|
4816
|
-
* @param {bool} [params.trigger] True if the order being fetched is a trigger order
|
|
4817
|
-
* @param {string} [params.marginMode] 'cross' or 'isolated' - marginMode for margin trading if not provided this.options['defaultMarginMode'] is used
|
|
4818
|
-
* @param {string} [params.type] 'spot', 'swap', or 'future', if not provided this.options['defaultMarginMode'] is used
|
|
4819
|
-
* @param {string} [params.settle] 'btc' or 'usdt' - settle currency for perpetual swap and future - market settle currency is used if symbol !== undefined, default="usdt" for swap and "btc" for future
|
|
4820
|
-
* @param {bool} [params.unifiedAccount] set to true for fetching a unified account order
|
|
4821
|
-
* @returns An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4822
|
-
*/
|
|
4823
4861
|
await this.loadMarkets();
|
|
4824
4862
|
await this.loadUnifiedStatus();
|
|
4825
4863
|
const market = (symbol === undefined) ? undefined : this.market(symbol);
|
|
@@ -4860,49 +4898,49 @@ export default class gate extends Exchange {
|
|
|
4860
4898
|
}
|
|
4861
4899
|
return this.parseOrder(response, market);
|
|
4862
4900
|
}
|
|
4901
|
+
/**
|
|
4902
|
+
* @method
|
|
4903
|
+
* @name gate#fetchOpenOrders
|
|
4904
|
+
* @description fetch all unfilled currently open orders
|
|
4905
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#list-all-open-orders
|
|
4906
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#retrieve-running-auto-order-list
|
|
4907
|
+
* @param {string} symbol unified market symbol
|
|
4908
|
+
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
4909
|
+
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
4910
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4911
|
+
* @param {bool} [params.stop] true for fetching stop orders
|
|
4912
|
+
* @param {string} [params.type] spot, margin, swap or future, if not provided this.options['defaultType'] is used
|
|
4913
|
+
* @param {string} [params.marginMode] 'cross' or 'isolated' - marginMode for type='margin', if not provided this.options['defaultMarginMode'] is used
|
|
4914
|
+
* @param {bool} [params.unifiedAccount] set to true for fetching unified account orders
|
|
4915
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4916
|
+
*/
|
|
4863
4917
|
async fetchOpenOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
4864
|
-
/**
|
|
4865
|
-
* @method
|
|
4866
|
-
* @name gate#fetchOpenOrders
|
|
4867
|
-
* @description fetch all unfilled currently open orders
|
|
4868
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#list-all-open-orders
|
|
4869
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#retrieve-running-auto-order-list
|
|
4870
|
-
* @param {string} symbol unified market symbol
|
|
4871
|
-
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
4872
|
-
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
4873
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4874
|
-
* @param {bool} [params.stop] true for fetching stop orders
|
|
4875
|
-
* @param {string} [params.type] spot, margin, swap or future, if not provided this.options['defaultType'] is used
|
|
4876
|
-
* @param {string} [params.marginMode] 'cross' or 'isolated' - marginMode for type='margin', if not provided this.options['defaultMarginMode'] is used
|
|
4877
|
-
* @param {bool} [params.unifiedAccount] set to true for fetching unified account orders
|
|
4878
|
-
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4879
|
-
*/
|
|
4880
4918
|
return await this.fetchOrdersByStatus('open', symbol, since, limit, params);
|
|
4881
4919
|
}
|
|
4920
|
+
/**
|
|
4921
|
+
* @method
|
|
4922
|
+
* @name gate#fetchClosedOrders
|
|
4923
|
+
* @description fetches information on multiple closed orders made by the user
|
|
4924
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#list-orders
|
|
4925
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#retrieve-running-auto-order-list
|
|
4926
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#list-futures-orders
|
|
4927
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#list-all-auto-orders
|
|
4928
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#list-futures-orders-2
|
|
4929
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#list-all-auto-orders-2
|
|
4930
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#list-options-orders
|
|
4931
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#list-futures-orders-by-time-range
|
|
4932
|
+
* @param {string} symbol unified market symbol of the market orders were made in
|
|
4933
|
+
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
4934
|
+
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
4935
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4936
|
+
* @param {bool} [params.stop] true for fetching stop orders
|
|
4937
|
+
* @param {string} [params.type] spot, swap or future, if not provided this.options['defaultType'] is used
|
|
4938
|
+
* @param {string} [params.marginMode] 'cross' or 'isolated' - marginMode for margin trading if not provided this.options['defaultMarginMode'] is used
|
|
4939
|
+
* @param {boolean} [params.historical] *swap only* true for using historical endpoint
|
|
4940
|
+
* @param {bool} [params.unifiedAccount] set to true for fetching unified account orders
|
|
4941
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4942
|
+
*/
|
|
4882
4943
|
async fetchClosedOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
4883
|
-
/**
|
|
4884
|
-
* @method
|
|
4885
|
-
* @name gate#fetchClosedOrders
|
|
4886
|
-
* @description fetches information on multiple closed orders made by the user
|
|
4887
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#list-orders
|
|
4888
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#retrieve-running-auto-order-list
|
|
4889
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#list-futures-orders
|
|
4890
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#list-all-auto-orders
|
|
4891
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#list-futures-orders-2
|
|
4892
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#list-all-auto-orders-2
|
|
4893
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#list-options-orders
|
|
4894
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#list-futures-orders-by-time-range
|
|
4895
|
-
* @param {string} symbol unified market symbol of the market orders were made in
|
|
4896
|
-
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
4897
|
-
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
4898
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4899
|
-
* @param {bool} [params.stop] true for fetching stop orders
|
|
4900
|
-
* @param {string} [params.type] spot, swap or future, if not provided this.options['defaultType'] is used
|
|
4901
|
-
* @param {string} [params.marginMode] 'cross' or 'isolated' - marginMode for margin trading if not provided this.options['defaultMarginMode'] is used
|
|
4902
|
-
* @param {boolean} [params.historical] *swap only* true for using historical endpoint
|
|
4903
|
-
* @param {bool} [params.unifiedAccount] set to true for fetching unified account orders
|
|
4904
|
-
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4905
|
-
*/
|
|
4906
4944
|
await this.loadMarkets();
|
|
4907
4945
|
await this.loadUnifiedStatus();
|
|
4908
4946
|
const until = this.safeInteger(params, 'until');
|
|
@@ -5182,22 +5220,22 @@ export default class gate extends Exchange {
|
|
|
5182
5220
|
const orders = this.parseOrders(result, market, since, limit);
|
|
5183
5221
|
return this.filterBySymbolSinceLimit(orders, symbol, since, limit);
|
|
5184
5222
|
}
|
|
5223
|
+
/**
|
|
5224
|
+
* @method
|
|
5225
|
+
* @name gate#cancelOrder
|
|
5226
|
+
* @description Cancels an open order
|
|
5227
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#cancel-a-single-order
|
|
5228
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#cancel-a-single-order-2
|
|
5229
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#cancel-a-single-order-3
|
|
5230
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#cancel-a-single-order-4
|
|
5231
|
+
* @param {string} id Order id
|
|
5232
|
+
* @param {string} symbol Unified market symbol
|
|
5233
|
+
* @param {object} [params] Parameters specified by the exchange api
|
|
5234
|
+
* @param {bool} [params.stop] True if the order to be cancelled is a trigger order
|
|
5235
|
+
* @param {bool} [params.unifiedAccount] set to true for canceling unified account orders
|
|
5236
|
+
* @returns An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
5237
|
+
*/
|
|
5185
5238
|
async cancelOrder(id, symbol = undefined, params = {}) {
|
|
5186
|
-
/**
|
|
5187
|
-
* @method
|
|
5188
|
-
* @name gate#cancelOrder
|
|
5189
|
-
* @description Cancels an open order
|
|
5190
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#cancel-a-single-order
|
|
5191
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#cancel-a-single-order-2
|
|
5192
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#cancel-a-single-order-3
|
|
5193
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#cancel-a-single-order-4
|
|
5194
|
-
* @param {string} id Order id
|
|
5195
|
-
* @param {string} symbol Unified market symbol
|
|
5196
|
-
* @param {object} [params] Parameters specified by the exchange api
|
|
5197
|
-
* @param {bool} [params.stop] True if the order to be cancelled is a trigger order
|
|
5198
|
-
* @param {bool} [params.unifiedAccount] set to true for canceling unified account orders
|
|
5199
|
-
* @returns An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
5200
|
-
*/
|
|
5201
5239
|
await this.loadMarkets();
|
|
5202
5240
|
await this.loadUnifiedStatus();
|
|
5203
5241
|
const market = (symbol === undefined) ? undefined : this.market(symbol);
|
|
@@ -5320,19 +5358,19 @@ export default class gate extends Exchange {
|
|
|
5320
5358
|
//
|
|
5321
5359
|
return this.parseOrder(response, market);
|
|
5322
5360
|
}
|
|
5361
|
+
/**
|
|
5362
|
+
* @method
|
|
5363
|
+
* @name gate#cancelOrders
|
|
5364
|
+
* @description cancel multiple orders
|
|
5365
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#cancel-a-batch-of-orders-with-an-id-list
|
|
5366
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#cancel-a-batch-of-orders-with-an-id-list-2
|
|
5367
|
+
* @param {string[]} ids order ids
|
|
5368
|
+
* @param {string} symbol unified symbol of the market the order was made in
|
|
5369
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5370
|
+
* @param {bool} [params.unifiedAccount] set to true for canceling unified account orders
|
|
5371
|
+
* @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
5372
|
+
*/
|
|
5323
5373
|
async cancelOrders(ids, symbol = undefined, params = {}) {
|
|
5324
|
-
/**
|
|
5325
|
-
* @method
|
|
5326
|
-
* @name gate#cancelOrders
|
|
5327
|
-
* @description cancel multiple orders
|
|
5328
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#cancel-a-batch-of-orders-with-an-id-list
|
|
5329
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#cancel-a-batch-of-orders-with-an-id-list-2
|
|
5330
|
-
* @param {string[]} ids order ids
|
|
5331
|
-
* @param {string} symbol unified symbol of the market the order was made in
|
|
5332
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5333
|
-
* @param {bool} [params.unifiedAccount] set to true for canceling unified account orders
|
|
5334
|
-
* @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
5335
|
-
*/
|
|
5336
5374
|
await this.loadMarkets();
|
|
5337
5375
|
await this.loadUnifiedStatus();
|
|
5338
5376
|
let market = undefined;
|
|
@@ -5369,18 +5407,18 @@ export default class gate extends Exchange {
|
|
|
5369
5407
|
const response = await this.privateFuturesPostSettleBatchCancelOrders(finalList);
|
|
5370
5408
|
return this.parseOrders(response);
|
|
5371
5409
|
}
|
|
5410
|
+
/**
|
|
5411
|
+
* @method
|
|
5412
|
+
* @name gate#cancelOrdersForSymbols
|
|
5413
|
+
* @description cancel multiple orders for multiple symbols
|
|
5414
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#cancel-a-batch-of-orders-with-an-id-list
|
|
5415
|
+
* @param {CancellationRequest[]} orders list of order ids with symbol, example [{"id": "a", "symbol": "BTC/USDT"}, {"id": "b", "symbol": "ETH/USDT"}]
|
|
5416
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5417
|
+
* @param {string[]} [params.clientOrderIds] client order ids
|
|
5418
|
+
* @param {bool} [params.unifiedAccount] set to true for canceling unified account orders
|
|
5419
|
+
* @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
5420
|
+
*/
|
|
5372
5421
|
async cancelOrdersForSymbols(orders, params = {}) {
|
|
5373
|
-
/**
|
|
5374
|
-
* @method
|
|
5375
|
-
* @name gate#cancelOrdersForSymbols
|
|
5376
|
-
* @description cancel multiple orders for multiple symbols
|
|
5377
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#cancel-a-batch-of-orders-with-an-id-list
|
|
5378
|
-
* @param {CancellationRequest[]} orders list of order ids with symbol, example [{"id": "a", "symbol": "BTC/USDT"}, {"id": "b", "symbol": "ETH/USDT"}]
|
|
5379
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5380
|
-
* @param {string[]} [params.clientOrderIds] client order ids
|
|
5381
|
-
* @param {bool} [params.unifiedAccount] set to true for canceling unified account orders
|
|
5382
|
-
* @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
5383
|
-
*/
|
|
5384
5422
|
await this.loadMarkets();
|
|
5385
5423
|
await this.loadUnifiedStatus();
|
|
5386
5424
|
const ordersRequests = [];
|
|
@@ -5409,20 +5447,20 @@ export default class gate extends Exchange {
|
|
|
5409
5447
|
//
|
|
5410
5448
|
return this.parseOrders(response);
|
|
5411
5449
|
}
|
|
5450
|
+
/**
|
|
5451
|
+
* @method
|
|
5452
|
+
* @name gate#cancelAllOrders
|
|
5453
|
+
* @description cancel all open orders
|
|
5454
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#cancel-all-open-orders-in-specified-currency-pair
|
|
5455
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#cancel-all-open-orders-matched
|
|
5456
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#cancel-all-open-orders-matched-2
|
|
5457
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#cancel-all-open-orders-matched-3
|
|
5458
|
+
* @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
|
|
5459
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5460
|
+
* @param {bool} [params.unifiedAccount] set to true for canceling unified account orders
|
|
5461
|
+
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
5462
|
+
*/
|
|
5412
5463
|
async cancelAllOrders(symbol = undefined, params = {}) {
|
|
5413
|
-
/**
|
|
5414
|
-
* @method
|
|
5415
|
-
* @name gate#cancelAllOrders
|
|
5416
|
-
* @description cancel all open orders
|
|
5417
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#cancel-all-open-orders-in-specified-currency-pair
|
|
5418
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#cancel-all-open-orders-matched
|
|
5419
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#cancel-all-open-orders-matched-2
|
|
5420
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#cancel-all-open-orders-matched-3
|
|
5421
|
-
* @param {string} symbol unified market symbol, only orders in the market of this symbol are cancelled when symbol is not undefined
|
|
5422
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5423
|
-
* @param {bool} [params.unifiedAccount] set to true for canceling unified account orders
|
|
5424
|
-
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
5425
|
-
*/
|
|
5426
5464
|
await this.loadMarkets();
|
|
5427
5465
|
await this.loadUnifiedStatus();
|
|
5428
5466
|
const market = (symbol === undefined) ? undefined : this.market(symbol);
|
|
@@ -5491,20 +5529,20 @@ export default class gate extends Exchange {
|
|
|
5491
5529
|
//
|
|
5492
5530
|
return this.parseOrders(response, market);
|
|
5493
5531
|
}
|
|
5532
|
+
/**
|
|
5533
|
+
* @method
|
|
5534
|
+
* @name gate#transfer
|
|
5535
|
+
* @description transfer currency internally between wallets on the same account
|
|
5536
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#transfer-between-trading-accounts
|
|
5537
|
+
* @param {string} code unified currency code for currency being transferred
|
|
5538
|
+
* @param {float} amount the amount of currency to transfer
|
|
5539
|
+
* @param {string} fromAccount the account to transfer currency from
|
|
5540
|
+
* @param {string} toAccount the account to transfer currency to
|
|
5541
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5542
|
+
* @param {string} [params.symbol] Unified market symbol *required for type == margin*
|
|
5543
|
+
* @returns A [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
5544
|
+
*/
|
|
5494
5545
|
async transfer(code, amount, fromAccount, toAccount, params = {}) {
|
|
5495
|
-
/**
|
|
5496
|
-
* @method
|
|
5497
|
-
* @name gate#transfer
|
|
5498
|
-
* @description transfer currency internally between wallets on the same account
|
|
5499
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#transfer-between-trading-accounts
|
|
5500
|
-
* @param {string} code unified currency code for currency being transferred
|
|
5501
|
-
* @param {float} amount the amount of currency to transfer
|
|
5502
|
-
* @param {string} fromAccount the account to transfer currency from
|
|
5503
|
-
* @param {string} toAccount the account to transfer currency to
|
|
5504
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5505
|
-
* @param {string} [params.symbol] Unified market symbol *required for type == margin*
|
|
5506
|
-
* @returns A [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
5507
|
-
*/
|
|
5508
5546
|
await this.loadMarkets();
|
|
5509
5547
|
const currency = this.currency(code);
|
|
5510
5548
|
const fromId = this.convertTypeToAccount(fromAccount);
|
|
@@ -5576,18 +5614,18 @@ export default class gate extends Exchange {
|
|
|
5576
5614
|
'info': transfer,
|
|
5577
5615
|
};
|
|
5578
5616
|
}
|
|
5617
|
+
/**
|
|
5618
|
+
* @method
|
|
5619
|
+
* @name gate#setLeverage
|
|
5620
|
+
* @description set the level of leverage for a market
|
|
5621
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#update-position-leverage
|
|
5622
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#update-position-leverage-2
|
|
5623
|
+
* @param {float} leverage the rate of leverage
|
|
5624
|
+
* @param {string} symbol unified market symbol
|
|
5625
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5626
|
+
* @returns {object} response from the exchange
|
|
5627
|
+
*/
|
|
5579
5628
|
async setLeverage(leverage, symbol = undefined, params = {}) {
|
|
5580
|
-
/**
|
|
5581
|
-
* @method
|
|
5582
|
-
* @name gate#setLeverage
|
|
5583
|
-
* @description set the level of leverage for a market
|
|
5584
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#update-position-leverage
|
|
5585
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#update-position-leverage-2
|
|
5586
|
-
* @param {float} leverage the rate of leverage
|
|
5587
|
-
* @param {string} symbol unified market symbol
|
|
5588
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5589
|
-
* @returns {object} response from the exchange
|
|
5590
|
-
*/
|
|
5591
5629
|
if (symbol === undefined) {
|
|
5592
5630
|
throw new ArgumentsRequired(this.id + ' setLeverage() requires a symbol argument');
|
|
5593
5631
|
}
|
|
@@ -5796,18 +5834,18 @@ export default class gate extends Exchange {
|
|
|
5796
5834
|
'takeProfitPrice': undefined,
|
|
5797
5835
|
});
|
|
5798
5836
|
}
|
|
5837
|
+
/**
|
|
5838
|
+
* @method
|
|
5839
|
+
* @name gate#fetchPosition
|
|
5840
|
+
* @description fetch data on an open contract position
|
|
5841
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#get-single-position
|
|
5842
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#get-single-position-2
|
|
5843
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#get-specified-contract-position
|
|
5844
|
+
* @param {string} symbol unified market symbol of the market the position is held in
|
|
5845
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5846
|
+
* @returns {object} a [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
5847
|
+
*/
|
|
5799
5848
|
async fetchPosition(symbol, params = {}) {
|
|
5800
|
-
/**
|
|
5801
|
-
* @method
|
|
5802
|
-
* @name gate#fetchPosition
|
|
5803
|
-
* @description fetch data on an open contract position
|
|
5804
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#get-single-position
|
|
5805
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#get-single-position-2
|
|
5806
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#get-specified-contract-position
|
|
5807
|
-
* @param {string} symbol unified market symbol of the market the position is held in
|
|
5808
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5809
|
-
* @returns {object} a [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
5810
|
-
*/
|
|
5811
5849
|
await this.loadMarkets();
|
|
5812
5850
|
const market = this.market(symbol);
|
|
5813
5851
|
if (!market['contract']) {
|
|
@@ -5884,20 +5922,20 @@ export default class gate extends Exchange {
|
|
|
5884
5922
|
//
|
|
5885
5923
|
return this.parsePosition(response, market);
|
|
5886
5924
|
}
|
|
5925
|
+
/**
|
|
5926
|
+
* @method
|
|
5927
|
+
* @name gate#fetchPositions
|
|
5928
|
+
* @description fetch all open positions
|
|
5929
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#list-all-positions-of-a-user
|
|
5930
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#list-all-positions-of-a-user-2
|
|
5931
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#list-user-s-positions-of-specified-underlying
|
|
5932
|
+
* @param {string[]|undefined} symbols Not used by gate, but parsed internally by CCXT
|
|
5933
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5934
|
+
* @param {string} [params.settle] 'btc' or 'usdt' - settle currency for perpetual swap and future - default="usdt" for swap and "btc" for future
|
|
5935
|
+
* @param {string} [params.type] swap, future or option, if not provided this.options['defaultType'] is used
|
|
5936
|
+
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
5937
|
+
*/
|
|
5887
5938
|
async fetchPositions(symbols = undefined, params = {}) {
|
|
5888
|
-
/**
|
|
5889
|
-
* @method
|
|
5890
|
-
* @name gate#fetchPositions
|
|
5891
|
-
* @description fetch all open positions
|
|
5892
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#list-all-positions-of-a-user
|
|
5893
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#list-all-positions-of-a-user-2
|
|
5894
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#list-user-s-positions-of-specified-underlying
|
|
5895
|
-
* @param {string[]|undefined} symbols Not used by gate, but parsed internally by CCXT
|
|
5896
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5897
|
-
* @param {string} [params.settle] 'btc' or 'usdt' - settle currency for perpetual swap and future - default="usdt" for swap and "btc" for future
|
|
5898
|
-
* @param {string} [params.type] swap, future or option, if not provided this.options['defaultType'] is used
|
|
5899
|
-
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
5900
|
-
*/
|
|
5901
5939
|
await this.loadMarkets();
|
|
5902
5940
|
let market = undefined;
|
|
5903
5941
|
symbols = this.marketSymbols(symbols, undefined, true, true, true);
|
|
@@ -5995,17 +6033,17 @@ export default class gate extends Exchange {
|
|
|
5995
6033
|
//
|
|
5996
6034
|
return this.parsePositions(response, symbols);
|
|
5997
6035
|
}
|
|
6036
|
+
/**
|
|
6037
|
+
* @method
|
|
6038
|
+
* @name gate#fetchLeverageTiers
|
|
6039
|
+
* @description retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes
|
|
6040
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#list-all-futures-contracts
|
|
6041
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#list-all-futures-contracts-2
|
|
6042
|
+
* @param {string[]} [symbols] list of unified market symbols
|
|
6043
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6044
|
+
* @returns {object} a dictionary of [leverage tiers structures]{@link https://docs.ccxt.com/#/?id=leverage-tiers-structure}, indexed by market symbols
|
|
6045
|
+
*/
|
|
5998
6046
|
async fetchLeverageTiers(symbols = undefined, params = {}) {
|
|
5999
|
-
/**
|
|
6000
|
-
* @method
|
|
6001
|
-
* @name gate#fetchLeverageTiers
|
|
6002
|
-
* @description retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes
|
|
6003
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#list-all-futures-contracts
|
|
6004
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#list-all-futures-contracts-2
|
|
6005
|
-
* @param {string[]} [symbols] list of unified market symbols
|
|
6006
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6007
|
-
* @returns {object} a dictionary of [leverage tiers structures]{@link https://docs.ccxt.com/#/?id=leverage-tiers-structure}, indexed by market symbols
|
|
6008
|
-
*/
|
|
6009
6047
|
await this.loadMarkets();
|
|
6010
6048
|
const [type, query] = this.handleMarketTypeAndParams('fetchLeverageTiers', undefined, params);
|
|
6011
6049
|
const [request, requestParams] = this.prepareRequest(undefined, type, query);
|
|
@@ -6116,16 +6154,16 @@ export default class gate extends Exchange {
|
|
|
6116
6154
|
//
|
|
6117
6155
|
return this.parseLeverageTiers(response, symbols, 'name');
|
|
6118
6156
|
}
|
|
6157
|
+
/**
|
|
6158
|
+
* @method
|
|
6159
|
+
* @name gate#fetchMarketLeverageTiers
|
|
6160
|
+
* @description retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes for a single market
|
|
6161
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#list-risk-limit-tiers
|
|
6162
|
+
* @param {string} symbol unified market symbol
|
|
6163
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6164
|
+
* @returns {object} a [leverage tiers structure]{@link https://docs.ccxt.com/#/?id=leverage-tiers-structure}
|
|
6165
|
+
*/
|
|
6119
6166
|
async fetchMarketLeverageTiers(symbol, params = {}) {
|
|
6120
|
-
/**
|
|
6121
|
-
* @method
|
|
6122
|
-
* @name gate#fetchMarketLeverageTiers
|
|
6123
|
-
* @description retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes for a single market
|
|
6124
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#list-risk-limit-tiers
|
|
6125
|
-
* @param {string} symbol unified market symbol
|
|
6126
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6127
|
-
* @returns {object} a [leverage tiers structure]{@link https://docs.ccxt.com/#/?id=leverage-tiers-structure}
|
|
6128
|
-
*/
|
|
6129
6167
|
await this.loadMarkets();
|
|
6130
6168
|
const market = this.market(symbol);
|
|
6131
6169
|
const [type, query] = this.handleMarketTypeAndParams('fetchMarketLeverageTiers', market, params);
|
|
@@ -6148,6 +6186,7 @@ export default class gate extends Exchange {
|
|
|
6148
6186
|
return this.parseMarketLeverageTiers(response, market);
|
|
6149
6187
|
}
|
|
6150
6188
|
parseEmulatedLeverageTiers(info, market = undefined) {
|
|
6189
|
+
const marketId = this.safeString(info, 'name');
|
|
6151
6190
|
const maintenanceMarginUnit = this.safeString(info, 'maintenance_rate'); // '0.005',
|
|
6152
6191
|
const leverageMax = this.safeString(info, 'leverage_max'); // '100',
|
|
6153
6192
|
const riskLimitStep = this.safeString(info, 'risk_limit_step'); // '1000000',
|
|
@@ -6161,6 +6200,7 @@ export default class gate extends Exchange {
|
|
|
6161
6200
|
const cap = Precise.stringAdd(floor, riskLimitStep);
|
|
6162
6201
|
tiers.push({
|
|
6163
6202
|
'tier': this.parseNumber(Precise.stringDiv(cap, riskLimitStep)),
|
|
6203
|
+
'symbol': this.safeSymbol(marketId, market, undefined, 'contract'),
|
|
6164
6204
|
'currency': this.safeString(market, 'settle'),
|
|
6165
6205
|
'minNotional': this.parseNumber(floor),
|
|
6166
6206
|
'maxNotional': this.parseNumber(cap),
|
|
@@ -6196,6 +6236,7 @@ export default class gate extends Exchange {
|
|
|
6196
6236
|
const maxNotional = this.safeNumber(item, 'risk_limit');
|
|
6197
6237
|
tiers.push({
|
|
6198
6238
|
'tier': this.sum(i, 1),
|
|
6239
|
+
'symbol': market['symbol'],
|
|
6199
6240
|
'currency': market['base'],
|
|
6200
6241
|
'minNotional': minNotional,
|
|
6201
6242
|
'maxNotional': maxNotional,
|
|
@@ -6207,20 +6248,20 @@ export default class gate extends Exchange {
|
|
|
6207
6248
|
}
|
|
6208
6249
|
return tiers;
|
|
6209
6250
|
}
|
|
6251
|
+
/**
|
|
6252
|
+
* @method
|
|
6253
|
+
* @name gate#repayMargin
|
|
6254
|
+
* @description repay borrowed margin and interest
|
|
6255
|
+
* @see https://www.gate.io/docs/apiv4/en/#repay-a-loan
|
|
6256
|
+
* @param {string} symbol unified market symbol
|
|
6257
|
+
* @param {string} code unified currency code of the currency to repay
|
|
6258
|
+
* @param {float} amount the amount to repay
|
|
6259
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6260
|
+
* @param {string} [params.mode] 'all' or 'partial' payment mode, extra parameter required for isolated margin
|
|
6261
|
+
* @param {string} [params.id] '34267567' loan id, extra parameter required for isolated margin
|
|
6262
|
+
* @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
|
|
6263
|
+
*/
|
|
6210
6264
|
async repayIsolatedMargin(symbol, code, amount, params = {}) {
|
|
6211
|
-
/**
|
|
6212
|
-
* @method
|
|
6213
|
-
* @name gate#repayMargin
|
|
6214
|
-
* @description repay borrowed margin and interest
|
|
6215
|
-
* @see https://www.gate.io/docs/apiv4/en/#repay-a-loan
|
|
6216
|
-
* @param {string} symbol unified market symbol
|
|
6217
|
-
* @param {string} code unified currency code of the currency to repay
|
|
6218
|
-
* @param {float} amount the amount to repay
|
|
6219
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6220
|
-
* @param {string} [params.mode] 'all' or 'partial' payment mode, extra parameter required for isolated margin
|
|
6221
|
-
* @param {string} [params.id] '34267567' loan id, extra parameter required for isolated margin
|
|
6222
|
-
* @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
|
|
6223
|
-
*/
|
|
6224
6265
|
await this.loadMarkets();
|
|
6225
6266
|
const currency = this.currency(code);
|
|
6226
6267
|
const request = {
|
|
@@ -6236,22 +6277,21 @@ export default class gate extends Exchange {
|
|
|
6236
6277
|
//
|
|
6237
6278
|
return this.parseMarginLoan(response, currency);
|
|
6238
6279
|
}
|
|
6280
|
+
/**
|
|
6281
|
+
* @method
|
|
6282
|
+
* @name gate#repayCrossMargin
|
|
6283
|
+
* @description repay cross margin borrowed margin and interest
|
|
6284
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#cross-margin-repayments
|
|
6285
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#borrow-or-repay
|
|
6286
|
+
* @param {string} code unified currency code of the currency to repay
|
|
6287
|
+
* @param {float} amount the amount to repay
|
|
6288
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6289
|
+
* @param {string} [params.mode] 'all' or 'partial' payment mode, extra parameter required for isolated margin
|
|
6290
|
+
* @param {string} [params.id] '34267567' loan id, extra parameter required for isolated margin
|
|
6291
|
+
* @param {boolean} [params.unifiedAccount] set to true for repaying in the unified account
|
|
6292
|
+
* @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
|
|
6293
|
+
*/
|
|
6239
6294
|
async repayCrossMargin(code, amount, params = {}) {
|
|
6240
|
-
/**
|
|
6241
|
-
* @method
|
|
6242
|
-
* @name gate#repayCrossMargin
|
|
6243
|
-
* @description repay cross margin borrowed margin and interest
|
|
6244
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#cross-margin-repayments
|
|
6245
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#borrow-or-repay
|
|
6246
|
-
* @param {string} code unified currency code of the currency to repay
|
|
6247
|
-
* @param {float} amount the amount to repay
|
|
6248
|
-
* @param {string} symbol unified market symbol, required for isolated margin
|
|
6249
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6250
|
-
* @param {string} [params.mode] 'all' or 'partial' payment mode, extra parameter required for isolated margin
|
|
6251
|
-
* @param {string} [params.id] '34267567' loan id, extra parameter required for isolated margin
|
|
6252
|
-
* @param {boolean} [params.unifiedAccount] set to true for repaying in the unified account
|
|
6253
|
-
* @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
|
|
6254
|
-
*/
|
|
6255
6295
|
await this.loadMarkets();
|
|
6256
6296
|
await this.loadUnifiedStatus();
|
|
6257
6297
|
const currency = this.currency(code);
|
|
@@ -6288,19 +6328,19 @@ export default class gate extends Exchange {
|
|
|
6288
6328
|
}
|
|
6289
6329
|
return this.parseMarginLoan(response, currency);
|
|
6290
6330
|
}
|
|
6331
|
+
/**
|
|
6332
|
+
* @method
|
|
6333
|
+
* @name gate#borrowMargin
|
|
6334
|
+
* @description create a loan to borrow margin
|
|
6335
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#marginuni
|
|
6336
|
+
* @param {string} symbol unified market symbol, required for isolated margin
|
|
6337
|
+
* @param {string} code unified currency code of the currency to borrow
|
|
6338
|
+
* @param {float} amount the amount to borrow
|
|
6339
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6340
|
+
* @param {string} [params.rate] '0.0002' or '0.002' extra parameter required for isolated margin
|
|
6341
|
+
* @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
|
|
6342
|
+
*/
|
|
6291
6343
|
async borrowIsolatedMargin(symbol, code, amount, params = {}) {
|
|
6292
|
-
/**
|
|
6293
|
-
* @method
|
|
6294
|
-
* @name gate#borrowMargin
|
|
6295
|
-
* @description create a loan to borrow margin
|
|
6296
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#marginuni
|
|
6297
|
-
* @param {string} code unified currency code of the currency to borrow
|
|
6298
|
-
* @param {float} amount the amount to borrow
|
|
6299
|
-
* @param {string} symbol unified market symbol, required for isolated margin
|
|
6300
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6301
|
-
* @param {string} [params.rate] '0.0002' or '0.002' extra parameter required for isolated margin
|
|
6302
|
-
* @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
|
|
6303
|
-
*/
|
|
6304
6344
|
await this.loadMarkets();
|
|
6305
6345
|
const currency = this.currency(code);
|
|
6306
6346
|
const request = {
|
|
@@ -6333,21 +6373,20 @@ export default class gate extends Exchange {
|
|
|
6333
6373
|
//
|
|
6334
6374
|
return this.parseMarginLoan(response, currency);
|
|
6335
6375
|
}
|
|
6376
|
+
/**
|
|
6377
|
+
* @method
|
|
6378
|
+
* @name gate#borrowMargin
|
|
6379
|
+
* @description create a loan to borrow margin
|
|
6380
|
+
* @see https://www.gate.io/docs/apiv4/en/#create-a-cross-margin-borrow-loan
|
|
6381
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#borrow-or-repay
|
|
6382
|
+
* @param {string} code unified currency code of the currency to borrow
|
|
6383
|
+
* @param {float} amount the amount to borrow
|
|
6384
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6385
|
+
* @param {string} [params.rate] '0.0002' or '0.002' extra parameter required for isolated margin
|
|
6386
|
+
* @param {boolean} [params.unifiedAccount] set to true for borrowing in the unified account
|
|
6387
|
+
* @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
|
|
6388
|
+
*/
|
|
6336
6389
|
async borrowCrossMargin(code, amount, params = {}) {
|
|
6337
|
-
/**
|
|
6338
|
-
* @method
|
|
6339
|
-
* @name gate#borrowMargin
|
|
6340
|
-
* @description create a loan to borrow margin
|
|
6341
|
-
* @see https://www.gate.io/docs/apiv4/en/#create-a-cross-margin-borrow-loan
|
|
6342
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#borrow-or-repay
|
|
6343
|
-
* @param {string} code unified currency code of the currency to borrow
|
|
6344
|
-
* @param {float} amount the amount to borrow
|
|
6345
|
-
* @param {string} symbol unified market symbol, required for isolated margin
|
|
6346
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6347
|
-
* @param {string} [params.rate] '0.0002' or '0.002' extra parameter required for isolated margin
|
|
6348
|
-
* @param {boolean} [params.unifiedAccount] set to true for borrowing in the unified account
|
|
6349
|
-
* @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
|
|
6350
|
-
*/
|
|
6351
6390
|
await this.loadMarkets();
|
|
6352
6391
|
await this.loadUnifiedStatus();
|
|
6353
6392
|
const currency = this.currency(code);
|
|
@@ -6435,22 +6474,22 @@ export default class gate extends Exchange {
|
|
|
6435
6474
|
'info': info,
|
|
6436
6475
|
};
|
|
6437
6476
|
}
|
|
6477
|
+
/**
|
|
6478
|
+
* @method
|
|
6479
|
+
* @name gate#fetchBorrowInterest
|
|
6480
|
+
* @description fetch the interest owed by the user for borrowing currency for margin trading
|
|
6481
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#list-interest-records
|
|
6482
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#interest-records-for-the-cross-margin-account
|
|
6483
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#list-interest-records-2
|
|
6484
|
+
* @param {string} [code] unified currency code
|
|
6485
|
+
* @param {string} [symbol] unified market symbol when fetching interest in isolated markets
|
|
6486
|
+
* @param {int} [since] the earliest time in ms to fetch borrow interest for
|
|
6487
|
+
* @param {int} [limit] the maximum number of structures to retrieve
|
|
6488
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6489
|
+
* @param {boolean} [params.unifiedAccount] set to true for fetching borrow interest in the unified account
|
|
6490
|
+
* @returns {object[]} a list of [borrow interest structures]{@link https://docs.ccxt.com/#/?id=borrow-interest-structure}
|
|
6491
|
+
*/
|
|
6438
6492
|
async fetchBorrowInterest(code = undefined, symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
6439
|
-
/**
|
|
6440
|
-
* @method
|
|
6441
|
-
* @name gate#fetchBorrowInterest
|
|
6442
|
-
* @description fetch the interest owed by the user for borrowing currency for margin trading
|
|
6443
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#list-interest-records
|
|
6444
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#interest-records-for-the-cross-margin-account
|
|
6445
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#list-interest-records-2
|
|
6446
|
-
* @param {string} [code] unified currency code
|
|
6447
|
-
* @param {string} [symbol] unified market symbol when fetching interest in isolated markets
|
|
6448
|
-
* @param {int} [since] the earliest time in ms to fetch borrow interest for
|
|
6449
|
-
* @param {int} [limit] the maximum number of structures to retrieve
|
|
6450
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6451
|
-
* @param {boolean} [params.unifiedAccount] set to true for fetching borrow interest in the unified account
|
|
6452
|
-
* @returns {object[]} a list of [borrow interest structures]{@link https://docs.ccxt.com/#/?id=borrow-interest-structure}
|
|
6453
|
-
*/
|
|
6454
6493
|
await this.loadMarkets();
|
|
6455
6494
|
await this.loadUnifiedStatus();
|
|
6456
6495
|
let isUnifiedAccount = false;
|
|
@@ -6657,48 +6696,48 @@ export default class gate extends Exchange {
|
|
|
6657
6696
|
'datetime': undefined,
|
|
6658
6697
|
};
|
|
6659
6698
|
}
|
|
6699
|
+
/**
|
|
6700
|
+
* @method
|
|
6701
|
+
* @name gate#reduceMargin
|
|
6702
|
+
* @description remove margin from a position
|
|
6703
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#update-position-margin
|
|
6704
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#update-position-margin-2
|
|
6705
|
+
* @param {string} symbol unified market symbol
|
|
6706
|
+
* @param {float} amount the amount of margin to remove
|
|
6707
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6708
|
+
* @returns {object} a [margin structure]{@link https://docs.ccxt.com/#/?id=reduce-margin-structure}
|
|
6709
|
+
*/
|
|
6660
6710
|
async reduceMargin(symbol, amount, params = {}) {
|
|
6661
|
-
/**
|
|
6662
|
-
* @method
|
|
6663
|
-
* @name gate#reduceMargin
|
|
6664
|
-
* @description remove margin from a position
|
|
6665
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#update-position-margin
|
|
6666
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#update-position-margin-2
|
|
6667
|
-
* @param {string} symbol unified market symbol
|
|
6668
|
-
* @param {float} amount the amount of margin to remove
|
|
6669
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6670
|
-
* @returns {object} a [margin structure]{@link https://docs.ccxt.com/#/?id=reduce-margin-structure}
|
|
6671
|
-
*/
|
|
6672
6711
|
return await this.modifyMarginHelper(symbol, -amount, params);
|
|
6673
6712
|
}
|
|
6713
|
+
/**
|
|
6714
|
+
* @method
|
|
6715
|
+
* @name gate#addMargin
|
|
6716
|
+
* @description add margin
|
|
6717
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#update-position-margin
|
|
6718
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#update-position-margin-2
|
|
6719
|
+
* @param {string} symbol unified market symbol
|
|
6720
|
+
* @param {float} amount amount of margin to add
|
|
6721
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6722
|
+
* @returns {object} a [margin structure]{@link https://docs.ccxt.com/#/?id=add-margin-structure}
|
|
6723
|
+
*/
|
|
6674
6724
|
async addMargin(symbol, amount, params = {}) {
|
|
6675
|
-
/**
|
|
6676
|
-
* @method
|
|
6677
|
-
* @name gate#addMargin
|
|
6678
|
-
* @description add margin
|
|
6679
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#update-position-margin
|
|
6680
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#update-position-margin-2
|
|
6681
|
-
* @param {string} symbol unified market symbol
|
|
6682
|
-
* @param {float} amount amount of margin to add
|
|
6683
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6684
|
-
* @returns {object} a [margin structure]{@link https://docs.ccxt.com/#/?id=add-margin-structure}
|
|
6685
|
-
*/
|
|
6686
6725
|
return await this.modifyMarginHelper(symbol, amount, params);
|
|
6687
6726
|
}
|
|
6727
|
+
/**
|
|
6728
|
+
* @method
|
|
6729
|
+
* @name gate#fetchOpenInterest
|
|
6730
|
+
* @description Retrieves the open interest of a currency
|
|
6731
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#futures-stats
|
|
6732
|
+
* @param {string} symbol Unified CCXT market symbol
|
|
6733
|
+
* @param {string} timeframe "5m", "15m", "30m", "1h", "4h", "1d"
|
|
6734
|
+
* @param {int} [since] the time(ms) of the earliest record to retrieve as a unix timestamp
|
|
6735
|
+
* @param {int} [limit] default 30
|
|
6736
|
+
* @param {object} [params] exchange specific parameters
|
|
6737
|
+
* @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)
|
|
6738
|
+
* @returns {object} an open interest structure{@link https://docs.ccxt.com/#/?id=open-interest-structure}
|
|
6739
|
+
*/
|
|
6688
6740
|
async fetchOpenInterestHistory(symbol, timeframe = '5m', since = undefined, limit = undefined, params = {}) {
|
|
6689
|
-
/**
|
|
6690
|
-
* @method
|
|
6691
|
-
* @name gate#fetchOpenInterest
|
|
6692
|
-
* @description Retrieves the open interest of a currency
|
|
6693
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#futures-stats
|
|
6694
|
-
* @param {string} symbol Unified CCXT market symbol
|
|
6695
|
-
* @param {string} timeframe "5m", "15m", "30m", "1h", "4h", "1d"
|
|
6696
|
-
* @param {int} [since] the time(ms) of the earliest record to retrieve as a unix timestamp
|
|
6697
|
-
* @param {int} [limit] default 30
|
|
6698
|
-
* @param {object} [params] exchange specific parameters
|
|
6699
|
-
* @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)
|
|
6700
|
-
* @returns {object} an open interest structure{@link https://docs.ccxt.com/#/?id=open-interest-structure}
|
|
6701
|
-
*/
|
|
6702
6741
|
await this.loadMarkets();
|
|
6703
6742
|
let paginate = false;
|
|
6704
6743
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchOpenInterestHistory', 'paginate', false);
|
|
@@ -6773,18 +6812,18 @@ export default class gate extends Exchange {
|
|
|
6773
6812
|
'info': interest,
|
|
6774
6813
|
};
|
|
6775
6814
|
}
|
|
6815
|
+
/**
|
|
6816
|
+
* @method
|
|
6817
|
+
* @name gate#fetchSettlementHistory
|
|
6818
|
+
* @description fetches historical settlement records
|
|
6819
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#list-settlement-history-2
|
|
6820
|
+
* @param {string} symbol unified market symbol of the settlement history, required on gate
|
|
6821
|
+
* @param {int} [since] timestamp in ms
|
|
6822
|
+
* @param {int} [limit] number of records
|
|
6823
|
+
* @param {object} [params] exchange specific params
|
|
6824
|
+
* @returns {object[]} a list of [settlement history objects]{@link https://docs.ccxt.com/#/?id=settlement-history-structure}
|
|
6825
|
+
*/
|
|
6776
6826
|
async fetchSettlementHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
6777
|
-
/**
|
|
6778
|
-
* @method
|
|
6779
|
-
* @name gate#fetchSettlementHistory
|
|
6780
|
-
* @description fetches historical settlement records
|
|
6781
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#list-settlement-history-2
|
|
6782
|
-
* @param {string} symbol unified market symbol of the settlement history, required on gate
|
|
6783
|
-
* @param {int} [since] timestamp in ms
|
|
6784
|
-
* @param {int} [limit] number of records
|
|
6785
|
-
* @param {object} [params] exchange specific params
|
|
6786
|
-
* @returns {object[]} a list of [settlement history objects]{@link https://docs.ccxt.com/#/?id=settlement-history-structure}
|
|
6787
|
-
*/
|
|
6788
6827
|
if (symbol === undefined) {
|
|
6789
6828
|
throw new ArgumentsRequired(this.id + ' fetchSettlementHistory() requires a symbol argument');
|
|
6790
6829
|
}
|
|
@@ -6823,18 +6862,18 @@ export default class gate extends Exchange {
|
|
|
6823
6862
|
const sorted = this.sortBy(settlements, 'timestamp');
|
|
6824
6863
|
return this.filterBySymbolSinceLimit(sorted, symbol, since, limit);
|
|
6825
6864
|
}
|
|
6865
|
+
/**
|
|
6866
|
+
* @method
|
|
6867
|
+
* @name gate#fetchMySettlementHistory
|
|
6868
|
+
* @description fetches historical settlement records of the user
|
|
6869
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#list-my-options-settlements
|
|
6870
|
+
* @param {string} symbol unified market symbol of the settlement history
|
|
6871
|
+
* @param {int} [since] timestamp in ms
|
|
6872
|
+
* @param {int} [limit] number of records
|
|
6873
|
+
* @param {object} [params] exchange specific params
|
|
6874
|
+
* @returns {object[]} a list of [settlement history objects]
|
|
6875
|
+
*/
|
|
6826
6876
|
async fetchMySettlementHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
6827
|
-
/**
|
|
6828
|
-
* @method
|
|
6829
|
-
* @name gate#fetchMySettlementHistory
|
|
6830
|
-
* @description fetches historical settlement records of the user
|
|
6831
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#list-my-options-settlements
|
|
6832
|
-
* @param {string} symbol unified market symbol of the settlement history
|
|
6833
|
-
* @param {int} [since] timestamp in ms
|
|
6834
|
-
* @param {int} [limit] number of records
|
|
6835
|
-
* @param {object} [params] exchange specific params
|
|
6836
|
-
* @returns {object[]} a list of [settlement history objects]
|
|
6837
|
-
*/
|
|
6838
6877
|
if (symbol === undefined) {
|
|
6839
6878
|
throw new ArgumentsRequired(this.id + ' fetchMySettlementHistory() requires a symbol argument');
|
|
6840
6879
|
}
|
|
@@ -6953,24 +6992,24 @@ export default class gate extends Exchange {
|
|
|
6953
6992
|
}
|
|
6954
6993
|
return result;
|
|
6955
6994
|
}
|
|
6995
|
+
/**
|
|
6996
|
+
* @method
|
|
6997
|
+
* @name gate#fetchLedger
|
|
6998
|
+
* @description fetch the history of changes, actions done by the user or operations that altered the balance of the user
|
|
6999
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#query-account-book
|
|
7000
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#list-margin-account-balance-change-history
|
|
7001
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#query-account-book-2
|
|
7002
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#query-account-book-3
|
|
7003
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#list-account-changing-history
|
|
7004
|
+
* @param {string} [code] unified currency code
|
|
7005
|
+
* @param {int} [since] timestamp in ms of the earliest ledger entry
|
|
7006
|
+
* @param {int} [limit] max number of ledger entries to return
|
|
7007
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7008
|
+
* @param {int} [params.until] end time in ms
|
|
7009
|
+
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
7010
|
+
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
|
|
7011
|
+
*/
|
|
6956
7012
|
async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
6957
|
-
/**
|
|
6958
|
-
* @method
|
|
6959
|
-
* @name gate#fetchLedger
|
|
6960
|
-
* @description fetch the history of changes, actions done by the user or operations that altered the balance of the user
|
|
6961
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#query-account-book
|
|
6962
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#list-margin-account-balance-change-history
|
|
6963
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#query-account-book-2
|
|
6964
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#query-account-book-3
|
|
6965
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#list-account-changing-history
|
|
6966
|
-
* @param {string} [code] unified currency code
|
|
6967
|
-
* @param {int} [since] timestamp in ms of the earliest ledger entry
|
|
6968
|
-
* @param {int} [limit] max number of ledger entries to return
|
|
6969
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6970
|
-
* @param {int} [params.until] end time in ms
|
|
6971
|
-
* @param {boolean} [params.paginate] default false, when true will automatically paginate by calling this endpoint multiple times. See in the docs all the [available parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
|
|
6972
|
-
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
|
|
6973
|
-
*/
|
|
6974
7013
|
await this.loadMarkets();
|
|
6975
7014
|
let paginate = false;
|
|
6976
7015
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchLedger', 'paginate');
|
|
@@ -7199,33 +7238,33 @@ export default class gate extends Exchange {
|
|
|
7199
7238
|
};
|
|
7200
7239
|
return this.safeString(ledgerType, type, type);
|
|
7201
7240
|
}
|
|
7241
|
+
/**
|
|
7242
|
+
* @method
|
|
7243
|
+
* @name gate#setPositionMode
|
|
7244
|
+
* @description set dual/hedged mode to true or false for a swap market, make sure all positions are closed and no orders are open before setting dual mode
|
|
7245
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#enable-or-disable-dual-mode
|
|
7246
|
+
* @param {bool} hedged set to true to enable dual mode
|
|
7247
|
+
* @param {string|undefined} symbol if passed, dual mode is set for all markets with the same settle currency
|
|
7248
|
+
* @param {object} params extra parameters specific to the exchange API endpoint
|
|
7249
|
+
* @param {string} params.settle settle currency
|
|
7250
|
+
* @returns {object} response from the exchange
|
|
7251
|
+
*/
|
|
7202
7252
|
async setPositionMode(hedged, symbol = undefined, params = {}) {
|
|
7203
|
-
/**
|
|
7204
|
-
* @method
|
|
7205
|
-
* @name gate#setPositionMode
|
|
7206
|
-
* @description set dual/hedged mode to true or false for a swap market, make sure all positions are closed and no orders are open before setting dual mode
|
|
7207
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#enable-or-disable-dual-mode
|
|
7208
|
-
* @param {bool} hedged set to true to enable dual mode
|
|
7209
|
-
* @param {string|undefined} symbol if passed, dual mode is set for all markets with the same settle currency
|
|
7210
|
-
* @param {object} params extra parameters specific to the exchange API endpoint
|
|
7211
|
-
* @param {string} params.settle settle currency
|
|
7212
|
-
* @returns {object} response from the exchange
|
|
7213
|
-
*/
|
|
7214
7253
|
const market = (symbol !== undefined) ? this.market(symbol) : undefined;
|
|
7215
7254
|
const [request, query] = this.prepareRequest(market, 'swap', params);
|
|
7216
7255
|
request['dual_mode'] = hedged;
|
|
7217
7256
|
return await this.privateFuturesPostSettleDualMode(this.extend(request, query));
|
|
7218
7257
|
}
|
|
7258
|
+
/**
|
|
7259
|
+
* @method
|
|
7260
|
+
* @name gate#fetchUnderlyingAssets
|
|
7261
|
+
* @description fetches the market ids of underlying assets for a specific contract market type
|
|
7262
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#list-all-underlyings
|
|
7263
|
+
* @param {object} [params] exchange specific params
|
|
7264
|
+
* @param {string} [params.type] the contract market type, 'option', 'swap' or 'future', the default is 'option'
|
|
7265
|
+
* @returns {object[]} a list of [underlying assets]{@link https://docs.ccxt.com/#/?id=underlying-assets-structure}
|
|
7266
|
+
*/
|
|
7219
7267
|
async fetchUnderlyingAssets(params = {}) {
|
|
7220
|
-
/**
|
|
7221
|
-
* @method
|
|
7222
|
-
* @name gate#fetchUnderlyingAssets
|
|
7223
|
-
* @description fetches the market ids of underlying assets for a specific contract market type
|
|
7224
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#list-all-underlyings
|
|
7225
|
-
* @param {object} [params] exchange specific params
|
|
7226
|
-
* @param {string} [params.type] the contract market type, 'option', 'swap' or 'future', the default is 'option'
|
|
7227
|
-
* @returns {object[]} a list of [underlying assets]{@link https://docs.ccxt.com/#/?id=underlying-assets-structure}
|
|
7228
|
-
*/
|
|
7229
7268
|
await this.loadMarkets();
|
|
7230
7269
|
let marketType = undefined;
|
|
7231
7270
|
[marketType, params] = this.handleMarketTypeAndParams('fetchUnderlyingAssets', undefined, params);
|
|
@@ -7255,19 +7294,19 @@ export default class gate extends Exchange {
|
|
|
7255
7294
|
}
|
|
7256
7295
|
return underlyings;
|
|
7257
7296
|
}
|
|
7297
|
+
/**
|
|
7298
|
+
* @method
|
|
7299
|
+
* @name gate#fetchLiquidations
|
|
7300
|
+
* @description retrieves the public liquidations of a trading pair
|
|
7301
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#retrieve-liquidation-history
|
|
7302
|
+
* @param {string} symbol unified CCXT market symbol
|
|
7303
|
+
* @param {int} [since] the earliest time in ms to fetch liquidations for
|
|
7304
|
+
* @param {int} [limit] the maximum number of liquidation structures to retrieve
|
|
7305
|
+
* @param {object} [params] exchange specific parameters for the exchange API endpoint
|
|
7306
|
+
* @param {int} [params.until] timestamp in ms of the latest liquidation
|
|
7307
|
+
* @returns {object} an array of [liquidation structures]{@link https://docs.ccxt.com/#/?id=liquidation-structure}
|
|
7308
|
+
*/
|
|
7258
7309
|
async fetchLiquidations(symbol, since = undefined, limit = undefined, params = {}) {
|
|
7259
|
-
/**
|
|
7260
|
-
* @method
|
|
7261
|
-
* @name gate#fetchLiquidations
|
|
7262
|
-
* @description retrieves the public liquidations of a trading pair
|
|
7263
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#retrieve-liquidation-history
|
|
7264
|
-
* @param {string} symbol unified CCXT market symbol
|
|
7265
|
-
* @param {int} [since] the earliest time in ms to fetch liquidations for
|
|
7266
|
-
* @param {int} [limit] the maximum number of liquidation structures to retrieve
|
|
7267
|
-
* @param {object} [params] exchange specific parameters for the exchange API endpoint
|
|
7268
|
-
* @param {int} [params.until] timestamp in ms of the latest liquidation
|
|
7269
|
-
* @returns {object} an array of [liquidation structures]{@link https://docs.ccxt.com/#/?id=liquidation-structure}
|
|
7270
|
-
*/
|
|
7271
7310
|
await this.loadMarkets();
|
|
7272
7311
|
const market = this.market(symbol);
|
|
7273
7312
|
if (!market['swap']) {
|
|
@@ -7299,20 +7338,20 @@ export default class gate extends Exchange {
|
|
|
7299
7338
|
//
|
|
7300
7339
|
return this.parseLiquidations(response, market, since, limit);
|
|
7301
7340
|
}
|
|
7341
|
+
/**
|
|
7342
|
+
* @method
|
|
7343
|
+
* @name gate#fetchMyLiquidations
|
|
7344
|
+
* @description retrieves the users liquidated positions
|
|
7345
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#list-liquidation-history
|
|
7346
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#list-liquidation-history-2
|
|
7347
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#list-user-s-liquidation-history-of-specified-underlying
|
|
7348
|
+
* @param {string} symbol unified CCXT market symbol
|
|
7349
|
+
* @param {int} [since] the earliest time in ms to fetch liquidations for
|
|
7350
|
+
* @param {int} [limit] the maximum number of liquidation structures to retrieve
|
|
7351
|
+
* @param {object} [params] exchange specific parameters for the exchange API endpoint
|
|
7352
|
+
* @returns {object} an array of [liquidation structures]{@link https://docs.ccxt.com/#/?id=liquidation-structure}
|
|
7353
|
+
*/
|
|
7302
7354
|
async fetchMyLiquidations(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
7303
|
-
/**
|
|
7304
|
-
* @method
|
|
7305
|
-
* @name gate#fetchMyLiquidations
|
|
7306
|
-
* @description retrieves the users liquidated positions
|
|
7307
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#list-liquidation-history
|
|
7308
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#list-liquidation-history-2
|
|
7309
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#list-user-s-liquidation-history-of-specified-underlying
|
|
7310
|
-
* @param {string} symbol unified CCXT market symbol
|
|
7311
|
-
* @param {int} [since] the earliest time in ms to fetch liquidations for
|
|
7312
|
-
* @param {int} [limit] the maximum number of liquidation structures to retrieve
|
|
7313
|
-
* @param {object} [params] exchange specific parameters for the exchange API endpoint
|
|
7314
|
-
* @returns {object} an array of [liquidation structures]{@link https://docs.ccxt.com/#/?id=liquidation-structure}
|
|
7315
|
-
*/
|
|
7316
7355
|
if (symbol === undefined) {
|
|
7317
7356
|
throw new ArgumentsRequired(this.id + ' fetchMyLiquidations() requires a symbol argument');
|
|
7318
7357
|
}
|
|
@@ -7445,16 +7484,16 @@ export default class gate extends Exchange {
|
|
|
7445
7484
|
'datetime': this.iso8601(timestamp),
|
|
7446
7485
|
});
|
|
7447
7486
|
}
|
|
7487
|
+
/**
|
|
7488
|
+
* @method
|
|
7489
|
+
* @name gate#fetchGreeks
|
|
7490
|
+
* @description fetches an option contracts greeks, financial metrics used to measure the factors that affect the price of an options contract
|
|
7491
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#list-tickers-of-options-contracts
|
|
7492
|
+
* @param {string} symbol unified symbol of the market to fetch greeks for
|
|
7493
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7494
|
+
* @returns {object} a [greeks structure]{@link https://docs.ccxt.com/#/?id=greeks-structure}
|
|
7495
|
+
*/
|
|
7448
7496
|
async fetchGreeks(symbol, params = {}) {
|
|
7449
|
-
/**
|
|
7450
|
-
* @method
|
|
7451
|
-
* @name gate#fetchGreeks
|
|
7452
|
-
* @description fetches an option contracts greeks, financial metrics used to measure the factors that affect the price of an options contract
|
|
7453
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#list-tickers-of-options-contracts
|
|
7454
|
-
* @param {string} symbol unified symbol of the market to fetch greeks for
|
|
7455
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7456
|
-
* @returns {object} a [greeks structure]{@link https://docs.ccxt.com/#/?id=greeks-structure}
|
|
7457
|
-
*/
|
|
7458
7497
|
await this.loadMarkets();
|
|
7459
7498
|
const market = this.market(symbol);
|
|
7460
7499
|
const request = {
|
|
@@ -7538,19 +7577,19 @@ export default class gate extends Exchange {
|
|
|
7538
7577
|
'info': greeks,
|
|
7539
7578
|
};
|
|
7540
7579
|
}
|
|
7580
|
+
/**
|
|
7581
|
+
* @method
|
|
7582
|
+
* @name gate#closePosition
|
|
7583
|
+
* @description closes open positions for a market
|
|
7584
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#create-a-futures-order
|
|
7585
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#create-a-futures-order-2
|
|
7586
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#create-an-options-order
|
|
7587
|
+
* @param {string} symbol Unified CCXT market symbol
|
|
7588
|
+
* @param {string} side 'buy' or 'sell'
|
|
7589
|
+
* @param {object} [params] extra parameters specific to the okx api endpoint
|
|
7590
|
+
* @returns {object[]} [A list of position structures]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
7591
|
+
*/
|
|
7541
7592
|
async closePosition(symbol, side = undefined, params = {}) {
|
|
7542
|
-
/**
|
|
7543
|
-
* @method
|
|
7544
|
-
* @name gate#closePosition
|
|
7545
|
-
* @description closes open positions for a market
|
|
7546
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#create-a-futures-order
|
|
7547
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#create-a-futures-order-2
|
|
7548
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#create-an-options-order
|
|
7549
|
-
* @param {string} symbol Unified CCXT market symbol
|
|
7550
|
-
* @param {string} side 'buy' or 'sell'
|
|
7551
|
-
* @param {object} [params] extra parameters specific to the okx api endpoint
|
|
7552
|
-
* @returns {object[]} [A list of position structures]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
7553
|
-
*/
|
|
7554
7593
|
const request = {
|
|
7555
7594
|
'close': true,
|
|
7556
7595
|
};
|
|
@@ -7560,19 +7599,19 @@ export default class gate extends Exchange {
|
|
|
7560
7599
|
}
|
|
7561
7600
|
return await this.createOrder(symbol, 'market', side, 0, undefined, params);
|
|
7562
7601
|
}
|
|
7602
|
+
/**
|
|
7603
|
+
* @method
|
|
7604
|
+
* @name gate#fetchLeverage
|
|
7605
|
+
* @description fetch the set leverage for a market
|
|
7606
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#get-unified-account-information
|
|
7607
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#get-detail-of-lending-market
|
|
7608
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#query-one-single-margin-currency-pair-deprecated
|
|
7609
|
+
* @param {string} symbol unified market symbol
|
|
7610
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7611
|
+
* @param {boolean} [params.unified] default false, set to true for fetching the unified accounts leverage
|
|
7612
|
+
* @returns {object} a [leverage structure]{@link https://docs.ccxt.com/#/?id=leverage-structure}
|
|
7613
|
+
*/
|
|
7563
7614
|
async fetchLeverage(symbol, params = {}) {
|
|
7564
|
-
/**
|
|
7565
|
-
* @method
|
|
7566
|
-
* @name gate#fetchLeverage
|
|
7567
|
-
* @description fetch the set leverage for a market
|
|
7568
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#get-unified-account-information
|
|
7569
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#get-detail-of-lending-market
|
|
7570
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#query-one-single-margin-currency-pair-deprecated
|
|
7571
|
-
* @param {string} symbol unified market symbol
|
|
7572
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7573
|
-
* @param {boolean} [params.unified] default false, set to true for fetching the unified accounts leverage
|
|
7574
|
-
* @returns {object} a [leverage structure]{@link https://docs.ccxt.com/#/?id=leverage-structure}
|
|
7575
|
-
*/
|
|
7576
7615
|
await this.loadMarkets();
|
|
7577
7616
|
let market = undefined;
|
|
7578
7617
|
if (symbol !== undefined) {
|
|
@@ -7670,18 +7709,18 @@ export default class gate extends Exchange {
|
|
|
7670
7709
|
}
|
|
7671
7710
|
return this.parseLeverage(response, market);
|
|
7672
7711
|
}
|
|
7712
|
+
/**
|
|
7713
|
+
* @method
|
|
7714
|
+
* @name gate#fetchLeverages
|
|
7715
|
+
* @description fetch the set leverage for all leverage markets, only spot margin is supported on gate
|
|
7716
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#list-lending-markets
|
|
7717
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#list-all-supported-currency-pairs-supported-in-margin-trading-deprecated
|
|
7718
|
+
* @param {string[]} symbols a list of unified market symbols
|
|
7719
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7720
|
+
* @param {boolean} [params.unified] default false, set to true for fetching unified account leverages
|
|
7721
|
+
* @returns {object} a list of [leverage structures]{@link https://docs.ccxt.com/#/?id=leverage-structure}
|
|
7722
|
+
*/
|
|
7673
7723
|
async fetchLeverages(symbols = undefined, params = {}) {
|
|
7674
|
-
/**
|
|
7675
|
-
* @method
|
|
7676
|
-
* @name gate#fetchLeverages
|
|
7677
|
-
* @description fetch the set leverage for all leverage markets, only spot margin is supported on gate
|
|
7678
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#list-lending-markets
|
|
7679
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#list-all-supported-currency-pairs-supported-in-margin-trading-deprecated
|
|
7680
|
-
* @param {string[]} symbols a list of unified market symbols
|
|
7681
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7682
|
-
* @param {boolean} [params.unified] default false, set to true for fetching unified account leverages
|
|
7683
|
-
* @returns {object} a list of [leverage structures]{@link https://docs.ccxt.com/#/?id=leverage-structure}
|
|
7684
|
-
*/
|
|
7685
7724
|
await this.loadMarkets();
|
|
7686
7725
|
symbols = this.marketSymbols(symbols);
|
|
7687
7726
|
let response = undefined;
|
|
@@ -7732,16 +7771,16 @@ export default class gate extends Exchange {
|
|
|
7732
7771
|
'shortLeverage': leverageValue,
|
|
7733
7772
|
};
|
|
7734
7773
|
}
|
|
7774
|
+
/**
|
|
7775
|
+
* @method
|
|
7776
|
+
* @name gate#fetchOption
|
|
7777
|
+
* @description fetches option data that is commonly found in an option chain
|
|
7778
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#query-specified-contract-detail
|
|
7779
|
+
* @param {string} symbol unified market symbol
|
|
7780
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7781
|
+
* @returns {object} an [option chain structure]{@link https://docs.ccxt.com/#/?id=option-chain-structure}
|
|
7782
|
+
*/
|
|
7735
7783
|
async fetchOption(symbol, params = {}) {
|
|
7736
|
-
/**
|
|
7737
|
-
* @method
|
|
7738
|
-
* @name gate#fetchOption
|
|
7739
|
-
* @description fetches option data that is commonly found in an option chain
|
|
7740
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#query-specified-contract-detail
|
|
7741
|
-
* @param {string} symbol unified market symbol
|
|
7742
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7743
|
-
* @returns {object} an [option chain structure]{@link https://docs.ccxt.com/#/?id=option-chain-structure}
|
|
7744
|
-
*/
|
|
7745
7784
|
await this.loadMarkets();
|
|
7746
7785
|
const market = this.market(symbol);
|
|
7747
7786
|
const request = {
|
|
@@ -7790,18 +7829,18 @@ export default class gate extends Exchange {
|
|
|
7790
7829
|
//
|
|
7791
7830
|
return this.parseOption(response, undefined, market);
|
|
7792
7831
|
}
|
|
7832
|
+
/**
|
|
7833
|
+
* @method
|
|
7834
|
+
* @name gate#fetchOptionChain
|
|
7835
|
+
* @description fetches data for an underlying asset that is commonly found in an option chain
|
|
7836
|
+
* @see https://www.gate.io/docs/developers/apiv4/en/#list-all-the-contracts-with-specified-underlying-and-expiration-time
|
|
7837
|
+
* @param {string} code base currency to fetch an option chain for
|
|
7838
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7839
|
+
* @param {string} [params.underlying] the underlying asset, can be obtained from fetchUnderlyingAssets ()
|
|
7840
|
+
* @param {int} [params.expiration] unix timestamp of the expiration time
|
|
7841
|
+
* @returns {object} a list of [option chain structures]{@link https://docs.ccxt.com/#/?id=option-chain-structure}
|
|
7842
|
+
*/
|
|
7793
7843
|
async fetchOptionChain(code, params = {}) {
|
|
7794
|
-
/**
|
|
7795
|
-
* @method
|
|
7796
|
-
* @name gate#fetchOptionChain
|
|
7797
|
-
* @description fetches data for an underlying asset that is commonly found in an option chain
|
|
7798
|
-
* @see https://www.gate.io/docs/developers/apiv4/en/#list-all-the-contracts-with-specified-underlying-and-expiration-time
|
|
7799
|
-
* @param {string} currency base currency to fetch an option chain for
|
|
7800
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7801
|
-
* @param {string} [params.underlying] the underlying asset, can be obtained from fetchUnderlyingAssets ()
|
|
7802
|
-
* @param {int} [params.expiration] unix timestamp of the expiration time
|
|
7803
|
-
* @returns {object} a list of [option chain structures]{@link https://docs.ccxt.com/#/?id=option-chain-structure}
|
|
7804
|
-
*/
|
|
7805
7844
|
await this.loadMarkets();
|
|
7806
7845
|
const currency = this.currency(code);
|
|
7807
7846
|
const request = {
|
|
@@ -7916,25 +7955,25 @@ export default class gate extends Exchange {
|
|
|
7916
7955
|
'quoteVolume': undefined,
|
|
7917
7956
|
};
|
|
7918
7957
|
}
|
|
7958
|
+
/**
|
|
7959
|
+
* @method
|
|
7960
|
+
* @name gate#fetchPositionsHistory
|
|
7961
|
+
* @description fetches historical positions
|
|
7962
|
+
* @see https://www.gate.io/docs/developers/apiv4/#list-position-close-history
|
|
7963
|
+
* @see https://www.gate.io/docs/developers/apiv4/#list-position-close-history-2
|
|
7964
|
+
* @param {string[]} symbols unified conract symbols, must all have the same settle currency and the same market type
|
|
7965
|
+
* @param {int} [since] the earliest time in ms to fetch positions for
|
|
7966
|
+
* @param {int} [limit] the maximum amount of records to fetch, default=1000
|
|
7967
|
+
* @param {object} params extra parameters specific to the exchange api endpoint
|
|
7968
|
+
* @param {int} [params.until] the latest time in ms to fetch positions for
|
|
7969
|
+
*
|
|
7970
|
+
* EXCHANGE SPECIFIC PARAMETERS
|
|
7971
|
+
* @param {int} [params.offset] list offset, starting from 0
|
|
7972
|
+
* @param {string} [params.side] long or short
|
|
7973
|
+
* @param {string} [params.pnl] query profit or loss
|
|
7974
|
+
* @returns {object[]} a list of [position structures]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
7975
|
+
*/
|
|
7919
7976
|
async fetchPositionsHistory(symbols = undefined, since = undefined, limit = undefined, params = {}) {
|
|
7920
|
-
/**
|
|
7921
|
-
* @method
|
|
7922
|
-
* @name gate#fetchPositionsHistory
|
|
7923
|
-
* @description fetches historical positions
|
|
7924
|
-
* @see https://www.gate.io/docs/developers/apiv4/#list-position-close-history
|
|
7925
|
-
* @see https://www.gate.io/docs/developers/apiv4/#list-position-close-history-2
|
|
7926
|
-
* @param {string[]} symbols unified conract symbols, must all have the same settle currency and the same market type
|
|
7927
|
-
* @param {int} [since] the earliest time in ms to fetch positions for
|
|
7928
|
-
* @param {int} [limit] the maximum amount of records to fetch, default=1000
|
|
7929
|
-
* @param {object} params extra parameters specific to the exchange api endpoint
|
|
7930
|
-
* @param {int} [params.until] the latest time in ms to fetch positions for
|
|
7931
|
-
*
|
|
7932
|
-
* EXCHANGE SPECIFIC PARAMETERS
|
|
7933
|
-
* @param {int} offset list offset, starting from 0
|
|
7934
|
-
* @param {string} side long or short
|
|
7935
|
-
* @param {string} pnl query profit or loss
|
|
7936
|
-
* @returns {object[]} a list of [position structures]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
7937
|
-
*/
|
|
7938
7977
|
await this.loadMarkets();
|
|
7939
7978
|
let market = undefined;
|
|
7940
7979
|
if (symbols !== undefined) {
|