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/binance.js
CHANGED
|
@@ -111,7 +111,7 @@ export default class binance extends Exchange {
|
|
|
111
111
|
'fetchLongShortRatio': false,
|
|
112
112
|
'fetchLongShortRatioHistory': true,
|
|
113
113
|
'fetchMarginAdjustmentHistory': true,
|
|
114
|
-
'fetchMarginMode':
|
|
114
|
+
'fetchMarginMode': true,
|
|
115
115
|
'fetchMarginModes': true,
|
|
116
116
|
'fetchMarketLeverageTiers': 'emulated',
|
|
117
117
|
'fetchMarkets': true,
|
|
@@ -2668,18 +2668,18 @@ export default class binance extends Exchange {
|
|
|
2668
2668
|
nonce() {
|
|
2669
2669
|
return this.milliseconds() - this.options['timeDifference'];
|
|
2670
2670
|
}
|
|
2671
|
+
/**
|
|
2672
|
+
* @method
|
|
2673
|
+
* @name binance#fetchTime
|
|
2674
|
+
* @description fetches the current integer timestamp in milliseconds from the exchange server
|
|
2675
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#check-server-time // spot
|
|
2676
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Check-Server-Time // swap
|
|
2677
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Check-Server-time // future
|
|
2678
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2679
|
+
* @param {string} [params.subType] "linear" or "inverse"
|
|
2680
|
+
* @returns {int} the current integer timestamp in milliseconds from the exchange server
|
|
2681
|
+
*/
|
|
2671
2682
|
async fetchTime(params = {}) {
|
|
2672
|
-
/**
|
|
2673
|
-
* @method
|
|
2674
|
-
* @name binance#fetchTime
|
|
2675
|
-
* @description fetches the current integer timestamp in milliseconds from the exchange server
|
|
2676
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#check-server-time // spot
|
|
2677
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Check-Server-Time // swap
|
|
2678
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Check-Server-time // future
|
|
2679
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2680
|
-
* @param {string} [params.subType] "linear" or "inverse"
|
|
2681
|
-
* @returns {int} the current integer timestamp in milliseconds from the exchange server
|
|
2682
|
-
*/
|
|
2683
2683
|
const defaultType = this.safeString2(this.options, 'fetchTime', 'defaultType', 'spot');
|
|
2684
2684
|
const type = this.safeString(params, 'type', defaultType);
|
|
2685
2685
|
const query = this.omit(params, 'type');
|
|
@@ -2697,16 +2697,16 @@ export default class binance extends Exchange {
|
|
|
2697
2697
|
}
|
|
2698
2698
|
return this.safeInteger(response, 'serverTime');
|
|
2699
2699
|
}
|
|
2700
|
+
/**
|
|
2701
|
+
* @method
|
|
2702
|
+
* @name binance#fetchCurrencies
|
|
2703
|
+
* @description fetches all available currencies on an exchange
|
|
2704
|
+
* @see https://developers.binance.com/docs/wallet/capital/all-coins-info
|
|
2705
|
+
* @see https://developers.binance.com/docs/margin_trading/market-data/Get-All-Margin-Assets
|
|
2706
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2707
|
+
* @returns {object} an associative dictionary of currencies
|
|
2708
|
+
*/
|
|
2700
2709
|
async fetchCurrencies(params = {}) {
|
|
2701
|
-
/**
|
|
2702
|
-
* @method
|
|
2703
|
-
* @name binance#fetchCurrencies
|
|
2704
|
-
* @description fetches all available currencies on an exchange
|
|
2705
|
-
* @see https://developers.binance.com/docs/wallet/capital/all-coins-info
|
|
2706
|
-
* @see https://developers.binance.com/docs/margin_trading/market-data/Get-All-Margin-Assets
|
|
2707
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2708
|
-
* @returns {object} an associative dictionary of currencies
|
|
2709
|
-
*/
|
|
2710
2710
|
const fetchCurrenciesEnabled = this.safeBool(this.options, 'fetchCurrencies');
|
|
2711
2711
|
if (!fetchCurrenciesEnabled) {
|
|
2712
2712
|
return undefined;
|
|
@@ -2916,20 +2916,20 @@ export default class binance extends Exchange {
|
|
|
2916
2916
|
}
|
|
2917
2917
|
return result;
|
|
2918
2918
|
}
|
|
2919
|
+
/**
|
|
2920
|
+
* @method
|
|
2921
|
+
* @name binance#fetchMarkets
|
|
2922
|
+
* @description retrieves data on all markets for binance
|
|
2923
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#exchange-information // spot
|
|
2924
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Exchange-Information // swap
|
|
2925
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Exchange-Information // future
|
|
2926
|
+
* @see https://developers.binance.com/docs/derivatives/option/market-data/Exchange-Information // option
|
|
2927
|
+
* @see https://developers.binance.com/docs/margin_trading/market-data/Get-All-Cross-Margin-Pairs // cross margin
|
|
2928
|
+
* @see https://developers.binance.com/docs/margin_trading/market-data/Get-All-Isolated-Margin-Symbol // isolated margin
|
|
2929
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2930
|
+
* @returns {object[]} an array of objects representing market data
|
|
2931
|
+
*/
|
|
2919
2932
|
async fetchMarkets(params = {}) {
|
|
2920
|
-
/**
|
|
2921
|
-
* @method
|
|
2922
|
-
* @name binance#fetchMarkets
|
|
2923
|
-
* @description retrieves data on all markets for binance
|
|
2924
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#exchange-information // spot
|
|
2925
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Exchange-Information // swap
|
|
2926
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Exchange-Information // future
|
|
2927
|
-
* @see https://developers.binance.com/docs/derivatives/option/market-data/Exchange-Information // option
|
|
2928
|
-
* @see https://developers.binance.com/docs/margin_trading/market-data/Get-All-Cross-Margin-Pairs // cross margin
|
|
2929
|
-
* @see https://developers.binance.com/docs/margin_trading/market-data/Get-All-Isolated-Margin-Symbol // isolated margin
|
|
2930
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2931
|
-
* @returns {object[]} an array of objects representing market data
|
|
2932
|
-
*/
|
|
2933
2933
|
const promisesRaw = [];
|
|
2934
2934
|
const rawFetchMarkets = this.safeList(this.options, 'fetchMarkets', ['spot', 'linear', 'inverse']);
|
|
2935
2935
|
const sandboxMode = this.safeBool(this.options, 'sandboxMode', false);
|
|
@@ -3526,27 +3526,27 @@ export default class binance extends Exchange {
|
|
|
3526
3526
|
result['datetime'] = this.iso8601(timestamp);
|
|
3527
3527
|
return isolated ? result : this.safeBalance(result);
|
|
3528
3528
|
}
|
|
3529
|
+
/**
|
|
3530
|
+
* @method
|
|
3531
|
+
* @name binance#fetchBalance
|
|
3532
|
+
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
3533
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#account-information-user_data // spot
|
|
3534
|
+
* @see https://developers.binance.com/docs/margin_trading/account/Query-Cross-Margin-Account-Details // cross margin
|
|
3535
|
+
* @see https://developers.binance.com/docs/margin_trading/account/Query-Isolated-Margin-Account-Info // isolated margin
|
|
3536
|
+
* @see https://developers.binance.com/docs/wallet/asset/funding-wallet // funding
|
|
3537
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Futures-Account-Balance-V2 // swap
|
|
3538
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Futures-Account-Balance // future
|
|
3539
|
+
* @see https://developers.binance.com/docs/derivatives/option/account/Option-Account-Information // option
|
|
3540
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/account/Account-Balance // portfolio margin
|
|
3541
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3542
|
+
* @param {string} [params.type] 'future', 'delivery', 'savings', 'funding', or 'spot' or 'papi'
|
|
3543
|
+
* @param {string} [params.marginMode] 'cross' or 'isolated', for margin trading, uses this.options.defaultMarginMode if not passed, defaults to undefined/None/null
|
|
3544
|
+
* @param {string[]|undefined} [params.symbols] unified market symbols, only used in isolated margin mode
|
|
3545
|
+
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch the balance for a portfolio margin account
|
|
3546
|
+
* @param {string} [params.subType] 'linear' or 'inverse'
|
|
3547
|
+
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
3548
|
+
*/
|
|
3529
3549
|
async fetchBalance(params = {}) {
|
|
3530
|
-
/**
|
|
3531
|
-
* @method
|
|
3532
|
-
* @name binance#fetchBalance
|
|
3533
|
-
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
3534
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#account-information-user_data // spot
|
|
3535
|
-
* @see https://developers.binance.com/docs/margin_trading/account/Query-Cross-Margin-Account-Details // cross margin
|
|
3536
|
-
* @see https://developers.binance.com/docs/margin_trading/account/Query-Isolated-Margin-Account-Info // isolated margin
|
|
3537
|
-
* @see https://developers.binance.com/docs/wallet/asset/funding-wallet // funding
|
|
3538
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Futures-Account-Balance-V2 // swap
|
|
3539
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Futures-Account-Balance // future
|
|
3540
|
-
* @see https://developers.binance.com/docs/derivatives/option/account/Option-Account-Information // option
|
|
3541
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/account/Account-Balance // portfolio margin
|
|
3542
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3543
|
-
* @param {string} [params.type] 'future', 'delivery', 'savings', 'funding', or 'spot' or 'papi'
|
|
3544
|
-
* @param {string} [params.marginMode] 'cross' or 'isolated', for margin trading, uses this.options.defaultMarginMode if not passed, defaults to undefined/None/null
|
|
3545
|
-
* @param {string[]|undefined} [params.symbols] unified market symbols, only used in isolated margin mode
|
|
3546
|
-
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch the balance for a portfolio margin account
|
|
3547
|
-
* @param {string} [params.subType] 'linear' or 'inverse'
|
|
3548
|
-
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
3549
|
-
*/
|
|
3550
3550
|
await this.loadMarkets();
|
|
3551
3551
|
const defaultType = this.safeString2(this.options, 'fetchBalance', 'defaultType', 'spot');
|
|
3552
3552
|
let type = this.safeString(params, 'type', defaultType);
|
|
@@ -3800,20 +3800,20 @@ export default class binance extends Exchange {
|
|
|
3800
3800
|
//
|
|
3801
3801
|
return this.parseBalanceCustom(response, type, marginMode, isPortfolioMargin);
|
|
3802
3802
|
}
|
|
3803
|
+
/**
|
|
3804
|
+
* @method
|
|
3805
|
+
* @name binance#fetchOrderBook
|
|
3806
|
+
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
3807
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#order-book // spot
|
|
3808
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Order-Book // swap
|
|
3809
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Order-Book // future
|
|
3810
|
+
* @see https://developers.binance.com/docs/derivatives/option/market-data/Order-Book // option
|
|
3811
|
+
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
3812
|
+
* @param {int} [limit] the maximum amount of order book entries to return
|
|
3813
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3814
|
+
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
3815
|
+
*/
|
|
3803
3816
|
async fetchOrderBook(symbol, limit = undefined, params = {}) {
|
|
3804
|
-
/**
|
|
3805
|
-
* @method
|
|
3806
|
-
* @name binance#fetchOrderBook
|
|
3807
|
-
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
3808
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#order-book // spot
|
|
3809
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Order-Book // swap
|
|
3810
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Order-Book // future
|
|
3811
|
-
* @see https://developers.binance.com/docs/derivatives/option/market-data/Order-Book // option
|
|
3812
|
-
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
3813
|
-
* @param {int} [limit] the maximum amount of order book entries to return
|
|
3814
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3815
|
-
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
3816
|
-
*/
|
|
3817
3817
|
await this.loadMarkets();
|
|
3818
3818
|
const market = this.market(symbol);
|
|
3819
3819
|
const request = {
|
|
@@ -4041,15 +4041,15 @@ export default class binance extends Exchange {
|
|
|
4041
4041
|
'info': ticker,
|
|
4042
4042
|
}, market);
|
|
4043
4043
|
}
|
|
4044
|
+
/**
|
|
4045
|
+
* @method
|
|
4046
|
+
* @name binance#fetchStatus
|
|
4047
|
+
* @description the latest known information on the availability of the exchange API
|
|
4048
|
+
* @see https://developers.binance.com/docs/wallet/others/system-status
|
|
4049
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4050
|
+
* @returns {object} a [status structure]{@link https://docs.ccxt.com/#/?id=exchange-status-structure}
|
|
4051
|
+
*/
|
|
4044
4052
|
async fetchStatus(params = {}) {
|
|
4045
|
-
/**
|
|
4046
|
-
* @method
|
|
4047
|
-
* @name binance#fetchStatus
|
|
4048
|
-
* @description the latest known information on the availability of the exchange API
|
|
4049
|
-
* @see https://developers.binance.com/docs/wallet/others/system-status
|
|
4050
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4051
|
-
* @returns {object} a [status structure]{@link https://docs.ccxt.com/#/?id=exchange-status-structure}
|
|
4052
|
-
*/
|
|
4053
4053
|
const response = await this.sapiGetSystemStatus(params);
|
|
4054
4054
|
//
|
|
4055
4055
|
// {
|
|
@@ -4066,21 +4066,21 @@ export default class binance extends Exchange {
|
|
|
4066
4066
|
'info': response,
|
|
4067
4067
|
};
|
|
4068
4068
|
}
|
|
4069
|
+
/**
|
|
4070
|
+
* @method
|
|
4071
|
+
* @name binance#fetchTicker
|
|
4072
|
+
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
4073
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#24hr-ticker-price-change-statistics // spot
|
|
4074
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#rolling-window-price-change-statistics // spot
|
|
4075
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/24hr-Ticker-Price-Change-Statistics // swap
|
|
4076
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/24hr-Ticker-Price-Change-Statistics // future
|
|
4077
|
+
* @see https://developers.binance.com/docs/derivatives/option/market-data/24hr-Ticker-Price-Change-Statistics // option
|
|
4078
|
+
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
4079
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4080
|
+
* @param {boolean} [params.rolling] (spot only) default false, if true, uses the rolling 24 hour ticker endpoint /api/v3/ticker
|
|
4081
|
+
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
4082
|
+
*/
|
|
4069
4083
|
async fetchTicker(symbol, params = {}) {
|
|
4070
|
-
/**
|
|
4071
|
-
* @method
|
|
4072
|
-
* @name binance#fetchTicker
|
|
4073
|
-
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
4074
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#24hr-ticker-price-change-statistics // spot
|
|
4075
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#rolling-window-price-change-statistics // spot
|
|
4076
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/24hr-Ticker-Price-Change-Statistics // swap
|
|
4077
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/24hr-Ticker-Price-Change-Statistics // future
|
|
4078
|
-
* @see https://developers.binance.com/docs/derivatives/option/market-data/24hr-Ticker-Price-Change-Statistics // option
|
|
4079
|
-
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
4080
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4081
|
-
* @param {boolean} [params.rolling] (spot only) default false, if true, uses the rolling 24 hour ticker endpoint /api/v3/ticker
|
|
4082
|
-
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
4083
|
-
*/
|
|
4084
4084
|
await this.loadMarkets();
|
|
4085
4085
|
const market = this.market(symbol);
|
|
4086
4086
|
const request = {
|
|
@@ -4112,19 +4112,19 @@ export default class binance extends Exchange {
|
|
|
4112
4112
|
}
|
|
4113
4113
|
return this.parseTicker(response, market);
|
|
4114
4114
|
}
|
|
4115
|
+
/**
|
|
4116
|
+
* @method
|
|
4117
|
+
* @name binance#fetchBidsAsks
|
|
4118
|
+
* @description fetches the bid and ask price and volume for multiple markets
|
|
4119
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#symbol-order-book-ticker // spot
|
|
4120
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Symbol-Order-Book-Ticker // swap
|
|
4121
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Symbol-Order-Book-Ticker // future
|
|
4122
|
+
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the bids and asks for, all markets are returned if not assigned
|
|
4123
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4124
|
+
* @param {string} [params.subType] "linear" or "inverse"
|
|
4125
|
+
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
4126
|
+
*/
|
|
4115
4127
|
async fetchBidsAsks(symbols = undefined, params = {}) {
|
|
4116
|
-
/**
|
|
4117
|
-
* @method
|
|
4118
|
-
* @name binance#fetchBidsAsks
|
|
4119
|
-
* @description fetches the bid and ask price and volume for multiple markets
|
|
4120
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#symbol-order-book-ticker // spot
|
|
4121
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Symbol-Order-Book-Ticker // swap
|
|
4122
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Symbol-Order-Book-Ticker // future
|
|
4123
|
-
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the bids and asks for, all markets are returned if not assigned
|
|
4124
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4125
|
-
* @param {string} [params.subType] "linear" or "inverse"
|
|
4126
|
-
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
4127
|
-
*/
|
|
4128
4128
|
await this.loadMarkets();
|
|
4129
4129
|
symbols = this.marketSymbols(symbols, undefined, true, true, true);
|
|
4130
4130
|
const market = this.getMarketFromSymbols(symbols);
|
|
@@ -4151,19 +4151,19 @@ export default class binance extends Exchange {
|
|
|
4151
4151
|
}
|
|
4152
4152
|
return this.parseTickers(response, symbols);
|
|
4153
4153
|
}
|
|
4154
|
+
/**
|
|
4155
|
+
* @method
|
|
4156
|
+
* @name binance#fetchLastPrices
|
|
4157
|
+
* @description fetches the last price for multiple markets
|
|
4158
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#symbol-price-ticker // spot
|
|
4159
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Symbol-Price-Ticker // swap
|
|
4160
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Symbol-Price-Ticker // future
|
|
4161
|
+
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the last prices
|
|
4162
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4163
|
+
* @param {string} [params.subType] "linear" or "inverse"
|
|
4164
|
+
* @returns {object} a dictionary of lastprices structures
|
|
4165
|
+
*/
|
|
4154
4166
|
async fetchLastPrices(symbols = undefined, params = {}) {
|
|
4155
|
-
/**
|
|
4156
|
-
* @method
|
|
4157
|
-
* @name binance#fetchLastPrices
|
|
4158
|
-
* @description fetches the last price for multiple markets
|
|
4159
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#symbol-price-ticker // spot
|
|
4160
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Symbol-Price-Ticker // swap
|
|
4161
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Symbol-Price-Ticker // future
|
|
4162
|
-
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the last prices
|
|
4163
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4164
|
-
* @param {string} [params.subType] "linear" or "inverse"
|
|
4165
|
-
* @returns {object} a dictionary of lastprices structures
|
|
4166
|
-
*/
|
|
4167
4167
|
await this.loadMarkets();
|
|
4168
4168
|
symbols = this.marketSymbols(symbols, undefined, true, true, true);
|
|
4169
4169
|
const market = this.getMarketFromSymbols(symbols);
|
|
@@ -4256,21 +4256,21 @@ export default class binance extends Exchange {
|
|
|
4256
4256
|
'info': entry,
|
|
4257
4257
|
};
|
|
4258
4258
|
}
|
|
4259
|
+
/**
|
|
4260
|
+
* @method
|
|
4261
|
+
* @name binance#fetchTickers
|
|
4262
|
+
* @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
|
4263
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#24hr-ticker-price-change-statistics // spot
|
|
4264
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/24hr-Ticker-Price-Change-Statistics // swap
|
|
4265
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/24hr-Ticker-Price-Change-Statistics // future
|
|
4266
|
+
* @see https://developers.binance.com/docs/derivatives/option/market-data/24hr-Ticker-Price-Change-Statistics // option
|
|
4267
|
+
* @param {string[]} [symbols] unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
4268
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4269
|
+
* @param {string} [params.subType] "linear" or "inverse"
|
|
4270
|
+
* @param {string} [params.type] 'spot', 'option', use params["subType"] for swap and future markets
|
|
4271
|
+
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
4272
|
+
*/
|
|
4259
4273
|
async fetchTickers(symbols = undefined, params = {}) {
|
|
4260
|
-
/**
|
|
4261
|
-
* @method
|
|
4262
|
-
* @name binance#fetchTickers
|
|
4263
|
-
* @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
|
4264
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#24hr-ticker-price-change-statistics // spot
|
|
4265
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/24hr-Ticker-Price-Change-Statistics // swap
|
|
4266
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/24hr-Ticker-Price-Change-Statistics // future
|
|
4267
|
-
* @see https://developers.binance.com/docs/derivatives/option/market-data/24hr-Ticker-Price-Change-Statistics // option
|
|
4268
|
-
* @param {string[]} [symbols] unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
4269
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4270
|
-
* @param {string} [params.subType] "linear" or "inverse"
|
|
4271
|
-
* @param {string} [params.type] 'spot', 'option', use params["subType"] for swap and future markets
|
|
4272
|
-
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
4273
|
-
*/
|
|
4274
4274
|
await this.loadMarkets();
|
|
4275
4275
|
symbols = this.marketSymbols(symbols, undefined, true, true, true);
|
|
4276
4276
|
const market = this.getMarketFromSymbols(symbols);
|
|
@@ -4300,18 +4300,18 @@ export default class binance extends Exchange {
|
|
|
4300
4300
|
}
|
|
4301
4301
|
return this.parseTickers(response, symbols);
|
|
4302
4302
|
}
|
|
4303
|
+
/**
|
|
4304
|
+
* @method
|
|
4305
|
+
* @name binance#fetchMarkPrice
|
|
4306
|
+
* @description fetches mark price for the market
|
|
4307
|
+
* @see https://binance-docs.github.io/apidocs/futures/en/#mark-price
|
|
4308
|
+
* @see https://binance-docs.github.io/apidocs/delivery/en/#index-price-and-mark-price
|
|
4309
|
+
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
4310
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4311
|
+
* @param {string} [params.subType] "linear" or "inverse"
|
|
4312
|
+
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
4313
|
+
*/
|
|
4303
4314
|
async fetchMarkPrice(symbol, params = {}) {
|
|
4304
|
-
/**
|
|
4305
|
-
* @method
|
|
4306
|
-
* @name binance#fetchMarkPrice
|
|
4307
|
-
* @description fetches mark price for the market
|
|
4308
|
-
* @see https://binance-docs.github.io/apidocs/futures/en/#mark-price
|
|
4309
|
-
* @see https://binance-docs.github.io/apidocs/delivery/en/#index-price-and-mark-price
|
|
4310
|
-
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
4311
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4312
|
-
* @param {string} [params.subType] "linear" or "inverse"
|
|
4313
|
-
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
4314
|
-
*/
|
|
4315
4315
|
await this.loadMarkets();
|
|
4316
4316
|
const market = this.market(symbol);
|
|
4317
4317
|
let type = undefined;
|
|
@@ -4336,18 +4336,18 @@ export default class binance extends Exchange {
|
|
|
4336
4336
|
}
|
|
4337
4337
|
return this.parseTicker(response, market);
|
|
4338
4338
|
}
|
|
4339
|
+
/**
|
|
4340
|
+
* @method
|
|
4341
|
+
* @name binance#fetchMarkPrices
|
|
4342
|
+
* @description fetches mark prices for multiple markets
|
|
4343
|
+
* @see https://binance-docs.github.io/apidocs/futures/en/#mark-price
|
|
4344
|
+
* @see https://binance-docs.github.io/apidocs/delivery/en/#index-price-and-mark-price
|
|
4345
|
+
* @param {string[]} [symbols] unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
4346
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4347
|
+
* @param {string} [params.subType] "linear" or "inverse"
|
|
4348
|
+
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
4349
|
+
*/
|
|
4339
4350
|
async fetchMarkPrices(symbols = undefined, params = {}) {
|
|
4340
|
-
/**
|
|
4341
|
-
* @method
|
|
4342
|
-
* @name binance#fetchMarkPrices
|
|
4343
|
-
* @description fetches mark prices for multiple markets
|
|
4344
|
-
* @see https://binance-docs.github.io/apidocs/futures/en/#mark-price
|
|
4345
|
-
* @see https://binance-docs.github.io/apidocs/delivery/en/#index-price-and-mark-price
|
|
4346
|
-
* @param {string[]} [symbols] unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
4347
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4348
|
-
* @param {string} [params.subType] "linear" or "inverse"
|
|
4349
|
-
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
4350
|
-
*/
|
|
4351
4351
|
await this.loadMarkets();
|
|
4352
4352
|
symbols = this.marketSymbols(symbols, undefined, true, true, true);
|
|
4353
4353
|
const market = this.getMarketFromSymbols(symbols);
|
|
@@ -4430,31 +4430,31 @@ export default class binance extends Exchange {
|
|
|
4430
4430
|
this.safeNumber2(ohlcv, volumeIndex, 'volume'),
|
|
4431
4431
|
];
|
|
4432
4432
|
}
|
|
4433
|
+
/**
|
|
4434
|
+
* @method
|
|
4435
|
+
* @name binance#fetchOHLCV
|
|
4436
|
+
* @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
4437
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#klinecandlestick-data
|
|
4438
|
+
* @see https://developers.binance.com/docs/derivatives/option/market-data/Kline-Candlestick-Data
|
|
4439
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Kline-Candlestick-Data
|
|
4440
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Index-Price-Kline-Candlestick-Data
|
|
4441
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Mark-Price-Kline-Candlestick-Data
|
|
4442
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Premium-Index-Kline-Data
|
|
4443
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Kline-Candlestick-Data
|
|
4444
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Index-Price-Kline-Candlestick-Data
|
|
4445
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Mark-Price-Kline-Candlestick-Data
|
|
4446
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Premium-Index-Kline-Data
|
|
4447
|
+
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
4448
|
+
* @param {string} timeframe the length of time each candle represents
|
|
4449
|
+
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
4450
|
+
* @param {int} [limit] the maximum amount of candles to fetch
|
|
4451
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4452
|
+
* @param {string} [params.price] "mark" or "index" for mark price and index price candles
|
|
4453
|
+
* @param {int} [params.until] timestamp in ms of the latest candle to fetch
|
|
4454
|
+
* @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)
|
|
4455
|
+
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
4456
|
+
*/
|
|
4433
4457
|
async fetchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
|
|
4434
|
-
/**
|
|
4435
|
-
* @method
|
|
4436
|
-
* @name binance#fetchOHLCV
|
|
4437
|
-
* @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
4438
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#klinecandlestick-data
|
|
4439
|
-
* @see https://developers.binance.com/docs/derivatives/option/market-data/Kline-Candlestick-Data
|
|
4440
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Kline-Candlestick-Data
|
|
4441
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Index-Price-Kline-Candlestick-Data
|
|
4442
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Mark-Price-Kline-Candlestick-Data
|
|
4443
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Premium-Index-Kline-Data
|
|
4444
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Kline-Candlestick-Data
|
|
4445
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Index-Price-Kline-Candlestick-Data
|
|
4446
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Mark-Price-Kline-Candlestick-Data
|
|
4447
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Premium-Index-Kline-Data
|
|
4448
|
-
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
4449
|
-
* @param {string} timeframe the length of time each candle represents
|
|
4450
|
-
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
4451
|
-
* @param {int} [limit] the maximum amount of candles to fetch
|
|
4452
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4453
|
-
* @param {string} [params.price] "mark" or "index" for mark price and index price candles
|
|
4454
|
-
* @param {int} [params.until] timestamp in ms of the latest candle to fetch
|
|
4455
|
-
* @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)
|
|
4456
|
-
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
4457
|
-
*/
|
|
4458
4458
|
await this.loadMarkets();
|
|
4459
4459
|
let paginate = false;
|
|
4460
4460
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchOHLCV', 'paginate', false);
|
|
@@ -4839,36 +4839,36 @@ export default class binance extends Exchange {
|
|
|
4839
4839
|
'fee': fee,
|
|
4840
4840
|
}, market);
|
|
4841
4841
|
}
|
|
4842
|
+
/**
|
|
4843
|
+
* @method
|
|
4844
|
+
* @name binance#fetchTrades
|
|
4845
|
+
* @description get the list of most recent trades for a particular symbol
|
|
4846
|
+
* Default fetchTradesMethod
|
|
4847
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#compressedaggregate-trades-list // publicGetAggTrades (spot)
|
|
4848
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Compressed-Aggregate-Trades-List // fapiPublicGetAggTrades (swap)
|
|
4849
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Compressed-Aggregate-Trades-List // dapiPublicGetAggTrades (future)
|
|
4850
|
+
* @see https://developers.binance.com/docs/derivatives/option/market-data/Recent-Trades-List // eapiPublicGetTrades (option)
|
|
4851
|
+
* Other fetchTradesMethod
|
|
4852
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#recent-trades-list // publicGetTrades (spot)
|
|
4853
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Recent-Trades-List // fapiPublicGetTrades (swap)
|
|
4854
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Recent-Trades-List // dapiPublicGetTrades (future)
|
|
4855
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#old-trade-lookup // publicGetHistoricalTrades (spot)
|
|
4856
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Old-Trades-Lookup // fapiPublicGetHistoricalTrades (swap)
|
|
4857
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Old-Trades-Lookup // dapiPublicGetHistoricalTrades (future)
|
|
4858
|
+
* @see https://developers.binance.com/docs/derivatives/option/market-data/Old-Trades-Lookup // eapiPublicGetHistoricalTrades (option)
|
|
4859
|
+
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
4860
|
+
* @param {int} [since] only used when fetchTradesMethod is 'publicGetAggTrades', 'fapiPublicGetAggTrades', or 'dapiPublicGetAggTrades'
|
|
4861
|
+
* @param {int} [limit] default 500, max 1000
|
|
4862
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4863
|
+
* @param {int} [params.until] only used when fetchTradesMethod is 'publicGetAggTrades', 'fapiPublicGetAggTrades', or 'dapiPublicGetAggTrades'
|
|
4864
|
+
* @param {int} [params.fetchTradesMethod] 'publicGetAggTrades' (spot default), 'fapiPublicGetAggTrades' (swap default), 'dapiPublicGetAggTrades' (future default), 'eapiPublicGetTrades' (option default), 'publicGetTrades', 'fapiPublicGetTrades', 'dapiPublicGetTrades', 'publicGetHistoricalTrades', 'fapiPublicGetHistoricalTrades', 'dapiPublicGetHistoricalTrades', 'eapiPublicGetHistoricalTrades'
|
|
4865
|
+
* @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)
|
|
4866
|
+
*
|
|
4867
|
+
* EXCHANGE SPECIFIC PARAMETERS
|
|
4868
|
+
* @param {int} [params.fromId] trade id to fetch from, default gets most recent trades, not used when fetchTradesMethod is 'publicGetTrades', 'fapiPublicGetTrades', 'dapiPublicGetTrades', or 'eapiPublicGetTrades'
|
|
4869
|
+
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
|
|
4870
|
+
*/
|
|
4842
4871
|
async fetchTrades(symbol, since = undefined, limit = undefined, params = {}) {
|
|
4843
|
-
/**
|
|
4844
|
-
* @method
|
|
4845
|
-
* @name binance#fetchTrades
|
|
4846
|
-
* @description get the list of most recent trades for a particular symbol
|
|
4847
|
-
* Default fetchTradesMethod
|
|
4848
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#compressedaggregate-trades-list // publicGetAggTrades (spot)
|
|
4849
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Compressed-Aggregate-Trades-List // fapiPublicGetAggTrades (swap)
|
|
4850
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Compressed-Aggregate-Trades-List // dapiPublicGetAggTrades (future)
|
|
4851
|
-
* @see https://developers.binance.com/docs/derivatives/option/market-data/Recent-Trades-List // eapiPublicGetTrades (option)
|
|
4852
|
-
* Other fetchTradesMethod
|
|
4853
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#recent-trades-list // publicGetTrades (spot)
|
|
4854
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Recent-Trades-List // fapiPublicGetTrades (swap)
|
|
4855
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Recent-Trades-List // dapiPublicGetTrades (future)
|
|
4856
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#old-trade-lookup // publicGetHistoricalTrades (spot)
|
|
4857
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Old-Trades-Lookup // fapiPublicGetHistoricalTrades (swap)
|
|
4858
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Old-Trades-Lookup // dapiPublicGetHistoricalTrades (future)
|
|
4859
|
-
* @see https://developers.binance.com/docs/derivatives/option/market-data/Old-Trades-Lookup // eapiPublicGetHistoricalTrades (option)
|
|
4860
|
-
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
4861
|
-
* @param {int} [since] only used when fetchTradesMethod is 'publicGetAggTrades', 'fapiPublicGetAggTrades', or 'dapiPublicGetAggTrades'
|
|
4862
|
-
* @param {int} [limit] default 500, max 1000
|
|
4863
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4864
|
-
* @param {int} [params.until] only used when fetchTradesMethod is 'publicGetAggTrades', 'fapiPublicGetAggTrades', or 'dapiPublicGetAggTrades'
|
|
4865
|
-
* @param {int} [params.fetchTradesMethod] 'publicGetAggTrades' (spot default), 'fapiPublicGetAggTrades' (swap default), 'dapiPublicGetAggTrades' (future default), 'eapiPublicGetTrades' (option default), 'publicGetTrades', 'fapiPublicGetTrades', 'dapiPublicGetTrades', 'publicGetHistoricalTrades', 'fapiPublicGetHistoricalTrades', 'dapiPublicGetHistoricalTrades', 'eapiPublicGetHistoricalTrades'
|
|
4866
|
-
* @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)
|
|
4867
|
-
*
|
|
4868
|
-
* EXCHANGE SPECIFIC PARAMETERS
|
|
4869
|
-
* @param {int} [params.fromId] trade id to fetch from, default gets most recent trades, not used when fetchTradesMethod is 'publicGetTrades', 'fapiPublicGetTrades', 'dapiPublicGetTrades', or 'eapiPublicGetTrades'
|
|
4870
|
-
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
|
|
4871
|
-
*/
|
|
4872
4872
|
await this.loadMarkets();
|
|
4873
4873
|
let paginate = false;
|
|
4874
4874
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchTrades', 'paginate');
|
|
@@ -4983,23 +4983,23 @@ export default class binance extends Exchange {
|
|
|
4983
4983
|
//
|
|
4984
4984
|
return this.parseTrades(response, market, since, limit);
|
|
4985
4985
|
}
|
|
4986
|
+
/**
|
|
4987
|
+
* @method
|
|
4988
|
+
* @name binance#editSpotOrder
|
|
4989
|
+
* @ignore
|
|
4990
|
+
* @description edit a trade order
|
|
4991
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#cancel-an-existing-order-and-send-a-new-order-trade
|
|
4992
|
+
* @param {string} id cancel order id
|
|
4993
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
4994
|
+
* @param {string} type 'market' or 'limit' or 'STOP_LOSS' or 'STOP_LOSS_LIMIT' or 'TAKE_PROFIT' or 'TAKE_PROFIT_LIMIT' or 'STOP'
|
|
4995
|
+
* @param {string} side 'buy' or 'sell'
|
|
4996
|
+
* @param {float} amount how much of currency you want to trade in units of base currency
|
|
4997
|
+
* @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
4998
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4999
|
+
* @param {string} [params.marginMode] 'cross' or 'isolated', for spot margin trading
|
|
5000
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
5001
|
+
*/
|
|
4986
5002
|
async editSpotOrder(id, symbol, type, side, amount, price = undefined, params = {}) {
|
|
4987
|
-
/**
|
|
4988
|
-
* @method
|
|
4989
|
-
* @name binance#editSpotOrder
|
|
4990
|
-
* @ignore
|
|
4991
|
-
* @description edit a trade order
|
|
4992
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#cancel-an-existing-order-and-send-a-new-order-trade
|
|
4993
|
-
* @param {string} id cancel order id
|
|
4994
|
-
* @param {string} symbol unified symbol of the market to create an order in
|
|
4995
|
-
* @param {string} type 'market' or 'limit' or 'STOP_LOSS' or 'STOP_LOSS_LIMIT' or 'TAKE_PROFIT' or 'TAKE_PROFIT_LIMIT' or 'STOP'
|
|
4996
|
-
* @param {string} side 'buy' or 'sell'
|
|
4997
|
-
* @param {float} amount how much of currency you want to trade in units of base currency
|
|
4998
|
-
* @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
4999
|
-
* @param {string} [params.marginMode] 'cross' or 'isolated', for spot margin trading
|
|
5000
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5001
|
-
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
5002
|
-
*/
|
|
5003
5003
|
await this.loadMarkets();
|
|
5004
5004
|
const market = this.market(symbol);
|
|
5005
5005
|
if (!market['spot']) {
|
|
@@ -5207,22 +5207,22 @@ export default class binance extends Exchange {
|
|
|
5207
5207
|
params = this.omit(params, ['clientOrderId', 'newClientOrderId']);
|
|
5208
5208
|
return request;
|
|
5209
5209
|
}
|
|
5210
|
+
/**
|
|
5211
|
+
* @method
|
|
5212
|
+
* @name binance#editContractOrder
|
|
5213
|
+
* @description edit a trade order
|
|
5214
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Order
|
|
5215
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Modify-Order
|
|
5216
|
+
* @param {string} id cancel order id
|
|
5217
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
5218
|
+
* @param {string} type 'market' or 'limit'
|
|
5219
|
+
* @param {string} side 'buy' or 'sell'
|
|
5220
|
+
* @param {float} amount how much of currency you want to trade in units of base currency
|
|
5221
|
+
* @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
5222
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5223
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
5224
|
+
*/
|
|
5210
5225
|
async editContractOrder(id, symbol, type, side, amount, price = undefined, params = {}) {
|
|
5211
|
-
/**
|
|
5212
|
-
* @method
|
|
5213
|
-
* @name binance#editContractOrder
|
|
5214
|
-
* @description edit a trade order
|
|
5215
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Order
|
|
5216
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Modify-Order
|
|
5217
|
-
* @param {string} id cancel order id
|
|
5218
|
-
* @param {string} symbol unified symbol of the market to create an order in
|
|
5219
|
-
* @param {string} type 'market' or 'limit'
|
|
5220
|
-
* @param {string} side 'buy' or 'sell'
|
|
5221
|
-
* @param {float} amount how much of currency you want to trade in units of base currency
|
|
5222
|
-
* @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
5223
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5224
|
-
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
5225
|
-
*/
|
|
5226
5226
|
await this.loadMarkets();
|
|
5227
5227
|
const market = this.market(symbol);
|
|
5228
5228
|
const request = this.editContractOrderRequest(id, symbol, type, side, amount, price, params);
|
|
@@ -5262,23 +5262,23 @@ export default class binance extends Exchange {
|
|
|
5262
5262
|
//
|
|
5263
5263
|
return this.parseOrder(response, market);
|
|
5264
5264
|
}
|
|
5265
|
+
/**
|
|
5266
|
+
* @method
|
|
5267
|
+
* @name binance#editOrder
|
|
5268
|
+
* @description edit a trade order
|
|
5269
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#cancel-an-existing-order-and-send-a-new-order-trade
|
|
5270
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Order
|
|
5271
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Modify-Order
|
|
5272
|
+
* @param {string} id cancel order id
|
|
5273
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
5274
|
+
* @param {string} type 'market' or 'limit'
|
|
5275
|
+
* @param {string} side 'buy' or 'sell'
|
|
5276
|
+
* @param {float} amount how much of currency you want to trade in units of base currency
|
|
5277
|
+
* @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
5278
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5279
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
5280
|
+
*/
|
|
5265
5281
|
async editOrder(id, symbol, type, side, amount = undefined, price = undefined, params = {}) {
|
|
5266
|
-
/**
|
|
5267
|
-
* @method
|
|
5268
|
-
* @name binance#editOrder
|
|
5269
|
-
* @description edit a trade order
|
|
5270
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#cancel-an-existing-order-and-send-a-new-order-trade
|
|
5271
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Order
|
|
5272
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Modify-Order
|
|
5273
|
-
* @param {string} id cancel order id
|
|
5274
|
-
* @param {string} symbol unified symbol of the market to create an order in
|
|
5275
|
-
* @param {string} type 'market' or 'limit'
|
|
5276
|
-
* @param {string} side 'buy' or 'sell'
|
|
5277
|
-
* @param {float} amount how much of currency you want to trade in units of base currency
|
|
5278
|
-
* @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
5279
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5280
|
-
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
5281
|
-
*/
|
|
5282
5282
|
await this.loadMarkets();
|
|
5283
5283
|
const market = this.market(symbol);
|
|
5284
5284
|
if (market['option']) {
|
|
@@ -5871,17 +5871,18 @@ export default class binance extends Exchange {
|
|
|
5871
5871
|
'trades': fills,
|
|
5872
5872
|
}, market);
|
|
5873
5873
|
}
|
|
5874
|
+
/**
|
|
5875
|
+
* @method
|
|
5876
|
+
* @name binance#createOrders
|
|
5877
|
+
* @description *contract only* create a list of trade orders
|
|
5878
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Place-Multiple-Orders
|
|
5879
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Place-Multiple-Orders
|
|
5880
|
+
* @see https://developers.binance.com/docs/derivatives/option/trade/Place-Multiple-Orders
|
|
5881
|
+
* @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
|
|
5882
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5883
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
5884
|
+
*/
|
|
5874
5885
|
async createOrders(orders, params = {}) {
|
|
5875
|
-
/**
|
|
5876
|
-
* @method
|
|
5877
|
-
* @name binance#createOrders
|
|
5878
|
-
* @description *contract only* create a list of trade orders
|
|
5879
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Place-Multiple-Orders
|
|
5880
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Place-Multiple-Orders
|
|
5881
|
-
* @see https://developers.binance.com/docs/derivatives/option/trade/Place-Multiple-Orders
|
|
5882
|
-
* @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
|
|
5883
|
-
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
5884
|
-
*/
|
|
5885
5886
|
await this.loadMarkets();
|
|
5886
5887
|
const ordersRequests = [];
|
|
5887
5888
|
let orderSymbols = [];
|
|
@@ -5952,44 +5953,44 @@ export default class binance extends Exchange {
|
|
|
5952
5953
|
//
|
|
5953
5954
|
return this.parseOrders(response);
|
|
5954
5955
|
}
|
|
5956
|
+
/**
|
|
5957
|
+
* @method
|
|
5958
|
+
* @name binance#createOrder
|
|
5959
|
+
* @description create a trade order
|
|
5960
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#new-order-trade
|
|
5961
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#test-new-order-trade
|
|
5962
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/New-Order
|
|
5963
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/New-Order
|
|
5964
|
+
* @see https://developers.binance.com/docs/derivatives/option/trade/New-Order
|
|
5965
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#sor
|
|
5966
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#test-new-order-using-sor-trade
|
|
5967
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-UM-Order
|
|
5968
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-CM-Order
|
|
5969
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-Margin-Order
|
|
5970
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-UM-Conditional-Order
|
|
5971
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-CM-Conditional-Order
|
|
5972
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
5973
|
+
* @param {string} type 'market' or 'limit' or 'STOP_LOSS' or 'STOP_LOSS_LIMIT' or 'TAKE_PROFIT' or 'TAKE_PROFIT_LIMIT' or 'STOP'
|
|
5974
|
+
* @param {string} side 'buy' or 'sell'
|
|
5975
|
+
* @param {float} amount how much of you want to trade in units of the base currency
|
|
5976
|
+
* @param {float} [price] the price that the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
5977
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5978
|
+
* @param {string} [params.reduceOnly] for swap and future reduceOnly is a string 'true' or 'false' that cant be sent with close position set to true or in hedge mode. For spot margin and option reduceOnly is a boolean.
|
|
5979
|
+
* @param {string} [params.marginMode] 'cross' or 'isolated', for spot margin trading
|
|
5980
|
+
* @param {boolean} [params.sor] *spot only* whether to use SOR (Smart Order Routing) or not, default is false
|
|
5981
|
+
* @param {boolean} [params.test] *spot only* whether to use the test endpoint or not, default is false
|
|
5982
|
+
* @param {float} [params.trailingPercent] the percent to trail away from the current market price
|
|
5983
|
+
* @param {float} [params.trailingTriggerPrice] the price to trigger a trailing order, default uses the price argument
|
|
5984
|
+
* @param {float} [params.triggerPrice] the price that a trigger order is triggered at
|
|
5985
|
+
* @param {float} [params.stopLossPrice] the price that a stop loss order is triggered at
|
|
5986
|
+
* @param {float} [params.takeProfitPrice] the price that a take profit order is triggered at
|
|
5987
|
+
* @param {boolean} [params.portfolioMargin] set to true if you would like to create an order in a portfolio margin account
|
|
5988
|
+
* @param {string} [params.stopLossOrTakeProfit] 'stopLoss' or 'takeProfit', required for spot trailing orders
|
|
5989
|
+
* @param {string} [params.positionSide] *swap and portfolio margin only* "BOTH" for one-way mode, "LONG" for buy side of hedged mode, "SHORT" for sell side of hedged mode
|
|
5990
|
+
* @param {bool} [params.hedged] *swap and portfolio margin only* true for hedged mode, false for one way mode, default is false
|
|
5991
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
5992
|
+
*/
|
|
5955
5993
|
async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
|
|
5956
|
-
/**
|
|
5957
|
-
* @method
|
|
5958
|
-
* @name binance#createOrder
|
|
5959
|
-
* @description create a trade order
|
|
5960
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#new-order-trade
|
|
5961
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#test-new-order-trade
|
|
5962
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/New-Order
|
|
5963
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/New-Order
|
|
5964
|
-
* @see https://developers.binance.com/docs/derivatives/option/trade/New-Order
|
|
5965
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#sor
|
|
5966
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#test-new-order-using-sor-trade
|
|
5967
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-UM-Order
|
|
5968
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-CM-Order
|
|
5969
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-Margin-Order
|
|
5970
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-UM-Conditional-Order
|
|
5971
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-CM-Conditional-Order
|
|
5972
|
-
* @param {string} symbol unified symbol of the market to create an order in
|
|
5973
|
-
* @param {string} type 'market' or 'limit' or 'STOP_LOSS' or 'STOP_LOSS_LIMIT' or 'TAKE_PROFIT' or 'TAKE_PROFIT_LIMIT' or 'STOP'
|
|
5974
|
-
* @param {string} side 'buy' or 'sell'
|
|
5975
|
-
* @param {float} amount how much of you want to trade in units of the base currency
|
|
5976
|
-
* @param {float} [price] the price that the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
5977
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5978
|
-
* @param {string} [params.reduceOnly] for swap and future reduceOnly is a string 'true' or 'false' that cant be sent with close position set to true or in hedge mode. For spot margin and option reduceOnly is a boolean.
|
|
5979
|
-
* @param {string} [params.marginMode] 'cross' or 'isolated', for spot margin trading
|
|
5980
|
-
* @param {boolean} [params.sor] *spot only* whether to use SOR (Smart Order Routing) or not, default is false
|
|
5981
|
-
* @param {boolean} [params.test] *spot only* whether to use the test endpoint or not, default is false
|
|
5982
|
-
* @param {float} [params.trailingPercent] the percent to trail away from the current market price
|
|
5983
|
-
* @param {float} [params.trailingTriggerPrice] the price to trigger a trailing order, default uses the price argument
|
|
5984
|
-
* @param {float} [params.triggerPrice] the price that a trigger order is triggered at
|
|
5985
|
-
* @param {float} [params.stopLossPrice] the price that a stop loss order is triggered at
|
|
5986
|
-
* @param {float} [params.takeProfitPrice] the price that a take profit order is triggered at
|
|
5987
|
-
* @param {boolean} [params.portfolioMargin] set to true if you would like to create an order in a portfolio margin account
|
|
5988
|
-
* @param {string} [params.stopLossOrTakeProfit] 'stopLoss' or 'takeProfit', required for spot trailing orders
|
|
5989
|
-
* @param {string} [params.positionSide] *swap and portfolio margin only* "BOTH" for one-way mode, "LONG" for buy side of hedged mode, "SHORT" for sell side of hedged mode
|
|
5990
|
-
* @param {bool} [params.hedged] *swap and portfolio margin only* true for hedged mode, false for one way mode, default is false
|
|
5991
|
-
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
5992
|
-
*/
|
|
5993
5994
|
await this.loadMarkets();
|
|
5994
5995
|
const market = this.market(symbol);
|
|
5995
5996
|
const marketType = this.safeString(params, 'type', market['type']);
|
|
@@ -6393,18 +6394,18 @@ export default class binance extends Exchange {
|
|
|
6393
6394
|
const requestParams = this.omit(params, ['type', 'newClientOrderId', 'clientOrderId', 'postOnly', 'stopLossPrice', 'takeProfitPrice', 'stopPrice', 'triggerPrice', 'trailingTriggerPrice', 'trailingPercent', 'quoteOrderQty', 'cost', 'test', 'hedged']);
|
|
6394
6395
|
return this.extend(request, requestParams);
|
|
6395
6396
|
}
|
|
6397
|
+
/**
|
|
6398
|
+
* @method
|
|
6399
|
+
* @name binance#createMarketOrderWithCost
|
|
6400
|
+
* @description create a market order by providing the symbol, side and cost
|
|
6401
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#new-order-trade
|
|
6402
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
6403
|
+
* @param {string} side 'buy' or 'sell'
|
|
6404
|
+
* @param {float} cost how much you want to trade in units of the quote currency
|
|
6405
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6406
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
6407
|
+
*/
|
|
6396
6408
|
async createMarketOrderWithCost(symbol, side, cost, params = {}) {
|
|
6397
|
-
/**
|
|
6398
|
-
* @method
|
|
6399
|
-
* @name binance#createMarketOrderWithCost
|
|
6400
|
-
* @description create a market order by providing the symbol, side and cost
|
|
6401
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#new-order-trade
|
|
6402
|
-
* @param {string} symbol unified symbol of the market to create an order in
|
|
6403
|
-
* @param {string} side 'buy' or 'sell'
|
|
6404
|
-
* @param {float} cost how much you want to trade in units of the quote currency
|
|
6405
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6406
|
-
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
6407
|
-
*/
|
|
6408
6409
|
await this.loadMarkets();
|
|
6409
6410
|
const market = this.market(symbol);
|
|
6410
6411
|
if (!market['spot']) {
|
|
@@ -6413,17 +6414,17 @@ export default class binance extends Exchange {
|
|
|
6413
6414
|
params['cost'] = cost;
|
|
6414
6415
|
return await this.createOrder(symbol, 'market', side, cost, undefined, params);
|
|
6415
6416
|
}
|
|
6417
|
+
/**
|
|
6418
|
+
* @method
|
|
6419
|
+
* @name binance#createMarketBuyOrderWithCost
|
|
6420
|
+
* @description create a market buy order by providing the symbol and cost
|
|
6421
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#new-order-trade
|
|
6422
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
6423
|
+
* @param {float} cost how much you want to trade in units of the quote currency
|
|
6424
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6425
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
6426
|
+
*/
|
|
6416
6427
|
async createMarketBuyOrderWithCost(symbol, cost, params = {}) {
|
|
6417
|
-
/**
|
|
6418
|
-
* @method
|
|
6419
|
-
* @name binance#createMarketBuyOrderWithCost
|
|
6420
|
-
* @description create a market buy order by providing the symbol and cost
|
|
6421
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#new-order-trade
|
|
6422
|
-
* @param {string} symbol unified symbol of the market to create an order in
|
|
6423
|
-
* @param {float} cost how much you want to trade in units of the quote currency
|
|
6424
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6425
|
-
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
6426
|
-
*/
|
|
6427
6428
|
await this.loadMarkets();
|
|
6428
6429
|
const market = this.market(symbol);
|
|
6429
6430
|
if (!market['spot']) {
|
|
@@ -6432,17 +6433,17 @@ export default class binance extends Exchange {
|
|
|
6432
6433
|
params['cost'] = cost;
|
|
6433
6434
|
return await this.createOrder(symbol, 'market', 'buy', cost, undefined, params);
|
|
6434
6435
|
}
|
|
6436
|
+
/**
|
|
6437
|
+
* @method
|
|
6438
|
+
* @name binance#createMarketSellOrderWithCost
|
|
6439
|
+
* @description create a market sell order by providing the symbol and cost
|
|
6440
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#new-order-trade
|
|
6441
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
6442
|
+
* @param {float} cost how much you want to trade in units of the quote currency
|
|
6443
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6444
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
6445
|
+
*/
|
|
6435
6446
|
async createMarketSellOrderWithCost(symbol, cost, params = {}) {
|
|
6436
|
-
/**
|
|
6437
|
-
* @method
|
|
6438
|
-
* @name binance#createMarketSellOrderWithCost
|
|
6439
|
-
* @description create a market sell order by providing the symbol and cost
|
|
6440
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#new-order-trade
|
|
6441
|
-
* @param {string} symbol unified symbol of the market to create an order in
|
|
6442
|
-
* @param {float} cost how much you want to trade in units of the quote currency
|
|
6443
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6444
|
-
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
6445
|
-
*/
|
|
6446
6447
|
await this.loadMarkets();
|
|
6447
6448
|
const market = this.market(symbol);
|
|
6448
6449
|
if (!market['spot']) {
|
|
@@ -6451,25 +6452,25 @@ export default class binance extends Exchange {
|
|
|
6451
6452
|
params['quoteOrderQty'] = cost;
|
|
6452
6453
|
return await this.createOrder(symbol, 'market', 'sell', cost, undefined, params);
|
|
6453
6454
|
}
|
|
6455
|
+
/**
|
|
6456
|
+
* @method
|
|
6457
|
+
* @name binance#fetchOrder
|
|
6458
|
+
* @description fetches information on an order made by the user
|
|
6459
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#query-order-user_data
|
|
6460
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-Order
|
|
6461
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Query-Order
|
|
6462
|
+
* @see https://developers.binance.com/docs/derivatives/option/trade/Query-Single-Order
|
|
6463
|
+
* @see https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-Order
|
|
6464
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-UM-Order
|
|
6465
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-CM-Order
|
|
6466
|
+
* @param {string} id the order id
|
|
6467
|
+
* @param {string} symbol unified symbol of the market the order was made in
|
|
6468
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6469
|
+
* @param {string} [params.marginMode] 'cross' or 'isolated', for spot margin trading
|
|
6470
|
+
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch an order in a portfolio margin account
|
|
6471
|
+
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
6472
|
+
*/
|
|
6454
6473
|
async fetchOrder(id, symbol = undefined, params = {}) {
|
|
6455
|
-
/**
|
|
6456
|
-
* @method
|
|
6457
|
-
* @name binance#fetchOrder
|
|
6458
|
-
* @description fetches information on an order made by the user
|
|
6459
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#query-order-user_data
|
|
6460
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-Order
|
|
6461
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Query-Order
|
|
6462
|
-
* @see https://developers.binance.com/docs/derivatives/option/trade/Query-Single-Order
|
|
6463
|
-
* @see https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-Order
|
|
6464
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-UM-Order
|
|
6465
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-CM-Order
|
|
6466
|
-
* @param {string} id the order id
|
|
6467
|
-
* @param {string} symbol unified symbol of the market the order was made in
|
|
6468
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6469
|
-
* @param {string} [params.marginMode] 'cross' or 'isolated', for spot margin trading
|
|
6470
|
-
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch an order in a portfolio margin account
|
|
6471
|
-
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
6472
|
-
*/
|
|
6473
6474
|
if (symbol === undefined) {
|
|
6474
6475
|
throw new ArgumentsRequired(this.id + ' fetchOrder() requires a symbol argument');
|
|
6475
6476
|
}
|
|
@@ -6533,31 +6534,31 @@ export default class binance extends Exchange {
|
|
|
6533
6534
|
}
|
|
6534
6535
|
return this.parseOrder(response, market);
|
|
6535
6536
|
}
|
|
6537
|
+
/**
|
|
6538
|
+
* @method
|
|
6539
|
+
* @name binance#fetchOrders
|
|
6540
|
+
* @description fetches information on multiple orders made by the user
|
|
6541
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#all-orders-user_data
|
|
6542
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders
|
|
6543
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/All-Orders
|
|
6544
|
+
* @see https://developers.binance.com/docs/derivatives/option/trade/Query-Option-Order-History
|
|
6545
|
+
* @see https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-All-Orders
|
|
6546
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Orders
|
|
6547
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Orders
|
|
6548
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Conditional-Orders
|
|
6549
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Conditional-Orders
|
|
6550
|
+
* @param {string} symbol unified market symbol of the market orders were made in
|
|
6551
|
+
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
6552
|
+
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
6553
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6554
|
+
* @param {string} [params.marginMode] 'cross' or 'isolated', for spot margin trading
|
|
6555
|
+
* @param {int} [params.until] the latest time in ms to fetch orders for
|
|
6556
|
+
* @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)
|
|
6557
|
+
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch orders in a portfolio margin account
|
|
6558
|
+
* @param {boolean} [params.stop] set to true if you would like to fetch portfolio margin account stop or conditional orders
|
|
6559
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
6560
|
+
*/
|
|
6536
6561
|
async fetchOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
6537
|
-
/**
|
|
6538
|
-
* @method
|
|
6539
|
-
* @name binance#fetchOrders
|
|
6540
|
-
* @description fetches information on multiple orders made by the user
|
|
6541
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#all-orders-user_data
|
|
6542
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders
|
|
6543
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/All-Orders
|
|
6544
|
-
* @see https://developers.binance.com/docs/derivatives/option/trade/Query-Option-Order-History
|
|
6545
|
-
* @see https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-All-Orders
|
|
6546
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Orders
|
|
6547
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Orders
|
|
6548
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Conditional-Orders
|
|
6549
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Conditional-Orders
|
|
6550
|
-
* @param {string} symbol unified market symbol of the market orders were made in
|
|
6551
|
-
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
6552
|
-
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
6553
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6554
|
-
* @param {string} [params.marginMode] 'cross' or 'isolated', for spot margin trading
|
|
6555
|
-
* @param {int} [params.until] the latest time in ms to fetch orders for
|
|
6556
|
-
* @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)
|
|
6557
|
-
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch orders in a portfolio margin account
|
|
6558
|
-
* @param {boolean} [params.stop] set to true if you would like to fetch portfolio margin account stop or conditional orders
|
|
6559
|
-
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
6560
|
-
*/
|
|
6561
6562
|
if (symbol === undefined) {
|
|
6562
6563
|
throw new ArgumentsRequired(this.id + ' fetchOrders() requires a symbol argument');
|
|
6563
6564
|
}
|
|
@@ -6812,30 +6813,30 @@ export default class binance extends Exchange {
|
|
|
6812
6813
|
//
|
|
6813
6814
|
return this.parseOrders(response, market, since, limit);
|
|
6814
6815
|
}
|
|
6816
|
+
/**
|
|
6817
|
+
* @method
|
|
6818
|
+
* @name binance#fetchOpenOrders
|
|
6819
|
+
* @description fetch all unfilled currently open orders
|
|
6820
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#current-open-orders-user_data
|
|
6821
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Current-All-Open-Orders
|
|
6822
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Current-All-Open-Orders
|
|
6823
|
+
* @see https://developers.binance.com/docs/derivatives/option/trade/Query-Current-Open-Option-Orders
|
|
6824
|
+
* @see https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-Open-Orders
|
|
6825
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-UM-Open-Orders
|
|
6826
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-UM-Open-Conditional-Orders
|
|
6827
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-CM-Open-Orders
|
|
6828
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-CM-Open-Conditional-Orders
|
|
6829
|
+
* @param {string} symbol unified market symbol
|
|
6830
|
+
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
6831
|
+
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
6832
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6833
|
+
* @param {string} [params.marginMode] 'cross' or 'isolated', for spot margin trading
|
|
6834
|
+
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch open orders in the portfolio margin account
|
|
6835
|
+
* @param {boolean} [params.stop] set to true if you would like to fetch portfolio margin account conditional orders
|
|
6836
|
+
* @param {string} [params.subType] "linear" or "inverse"
|
|
6837
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
6838
|
+
*/
|
|
6815
6839
|
async fetchOpenOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
6816
|
-
/**
|
|
6817
|
-
* @method
|
|
6818
|
-
* @name binance#fetchOpenOrders
|
|
6819
|
-
* @description fetch all unfilled currently open orders
|
|
6820
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#current-open-orders-user_data
|
|
6821
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Current-All-Open-Orders
|
|
6822
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Current-All-Open-Orders
|
|
6823
|
-
* @see https://developers.binance.com/docs/derivatives/option/trade/Query-Current-Open-Option-Orders
|
|
6824
|
-
* @see https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-Open-Orders
|
|
6825
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-UM-Open-Orders
|
|
6826
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-UM-Open-Conditional-Orders
|
|
6827
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-CM-Open-Orders
|
|
6828
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-CM-Open-Conditional-Orders
|
|
6829
|
-
* @param {string} symbol unified market symbol
|
|
6830
|
-
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
6831
|
-
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
6832
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6833
|
-
* @param {string} [params.marginMode] 'cross' or 'isolated', for spot margin trading
|
|
6834
|
-
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch open orders in the portfolio margin account
|
|
6835
|
-
* @param {boolean} [params.stop] set to true if you would like to fetch portfolio margin account conditional orders
|
|
6836
|
-
* @param {string} [params.subType] "linear" or "inverse"
|
|
6837
|
-
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
6838
|
-
*/
|
|
6839
6840
|
await this.loadMarkets();
|
|
6840
6841
|
let market = undefined;
|
|
6841
6842
|
let type = undefined;
|
|
@@ -6917,23 +6918,23 @@ export default class binance extends Exchange {
|
|
|
6917
6918
|
}
|
|
6918
6919
|
return this.parseOrders(response, market, since, limit);
|
|
6919
6920
|
}
|
|
6921
|
+
/**
|
|
6922
|
+
* @method
|
|
6923
|
+
* @name binance#fetchOpenOrder
|
|
6924
|
+
* @description fetch an open order by the id
|
|
6925
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-Current-Open-Order
|
|
6926
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Query-Current-Open-Order
|
|
6927
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-UM-Open-Order
|
|
6928
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-UM-Open-Conditional-Order
|
|
6929
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-CM-Open-Order
|
|
6930
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-CM-Open-Conditional-Order
|
|
6931
|
+
* @param {string} id order id
|
|
6932
|
+
* @param {string} symbol unified market symbol
|
|
6933
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6934
|
+
* @param {string} [params.trigger] set to true if you would like to fetch portfolio margin account stop or conditional orders
|
|
6935
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
6936
|
+
*/
|
|
6920
6937
|
async fetchOpenOrder(id, symbol = undefined, params = {}) {
|
|
6921
|
-
/**
|
|
6922
|
-
* @method
|
|
6923
|
-
* @name binance#fetchOpenOrder
|
|
6924
|
-
* @description fetch an open order by the id
|
|
6925
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-Current-Open-Order
|
|
6926
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Query-Current-Open-Order
|
|
6927
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-UM-Open-Order
|
|
6928
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-UM-Open-Conditional-Order
|
|
6929
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-CM-Open-Order
|
|
6930
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-CM-Open-Conditional-Order
|
|
6931
|
-
* @param {string} id order id
|
|
6932
|
-
* @param {string} symbol unified market symbol
|
|
6933
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6934
|
-
* @param {string} [params.trigger] set to true if you would like to fetch portfolio margin account stop or conditional orders
|
|
6935
|
-
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
6936
|
-
*/
|
|
6937
6938
|
if (symbol === undefined) {
|
|
6938
6939
|
throw new ArgumentsRequired(this.id + ' fetchOpenOrder() requires a symbol argument');
|
|
6939
6940
|
}
|
|
@@ -7134,29 +7135,29 @@ export default class binance extends Exchange {
|
|
|
7134
7135
|
//
|
|
7135
7136
|
return this.parseOrder(response, market);
|
|
7136
7137
|
}
|
|
7138
|
+
/**
|
|
7139
|
+
* @method
|
|
7140
|
+
* @name binance#fetchClosedOrders
|
|
7141
|
+
* @description fetches information on multiple closed orders made by the user
|
|
7142
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#all-orders-user_data
|
|
7143
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders
|
|
7144
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/All-Orders
|
|
7145
|
+
* @see https://developers.binance.com/docs/derivatives/option/trade/Query-Option-Order-History
|
|
7146
|
+
* @see https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-All-Orders
|
|
7147
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Orders
|
|
7148
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Orders
|
|
7149
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Conditional-Orders
|
|
7150
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Conditional-Orders
|
|
7151
|
+
* @param {string} symbol unified market symbol of the market orders were made in
|
|
7152
|
+
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
7153
|
+
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
7154
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7155
|
+
* @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)
|
|
7156
|
+
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch orders in a portfolio margin account
|
|
7157
|
+
* @param {boolean} [params.stop] set to true if you would like to fetch portfolio margin account stop or conditional orders
|
|
7158
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
7159
|
+
*/
|
|
7137
7160
|
async fetchClosedOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
7138
|
-
/**
|
|
7139
|
-
* @method
|
|
7140
|
-
* @name binance#fetchClosedOrders
|
|
7141
|
-
* @description fetches information on multiple closed orders made by the user
|
|
7142
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#all-orders-user_data
|
|
7143
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders
|
|
7144
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/All-Orders
|
|
7145
|
-
* @see https://developers.binance.com/docs/derivatives/option/trade/Query-Option-Order-History
|
|
7146
|
-
* @see https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-All-Orders
|
|
7147
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Orders
|
|
7148
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Orders
|
|
7149
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Conditional-Orders
|
|
7150
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Conditional-Orders
|
|
7151
|
-
* @param {string} symbol unified market symbol of the market orders were made in
|
|
7152
|
-
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
7153
|
-
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
7154
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7155
|
-
* @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)
|
|
7156
|
-
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch orders in a portfolio margin account
|
|
7157
|
-
* @param {boolean} [params.stop] set to true if you would like to fetch portfolio margin account stop or conditional orders
|
|
7158
|
-
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
7159
|
-
*/
|
|
7160
7161
|
if (symbol === undefined) {
|
|
7161
7162
|
throw new ArgumentsRequired(this.id + ' fetchClosedOrders() requires a symbol argument');
|
|
7162
7163
|
}
|
|
@@ -7164,29 +7165,29 @@ export default class binance extends Exchange {
|
|
|
7164
7165
|
const filteredOrders = this.filterBy(orders, 'status', 'closed');
|
|
7165
7166
|
return this.filterBySinceLimit(filteredOrders, since, limit);
|
|
7166
7167
|
}
|
|
7168
|
+
/**
|
|
7169
|
+
* @method
|
|
7170
|
+
* @name binance#fetchCanceledOrders
|
|
7171
|
+
* @description fetches information on multiple canceled orders made by the user
|
|
7172
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#all-orders-user_data
|
|
7173
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders
|
|
7174
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/All-Orders
|
|
7175
|
+
* @see https://developers.binance.com/docs/derivatives/option/trade/Query-Option-Order-History
|
|
7176
|
+
* @see https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-All-Orders
|
|
7177
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Orders
|
|
7178
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Orders
|
|
7179
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Conditional-Orders
|
|
7180
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Conditional-Orders
|
|
7181
|
+
* @param {string} symbol unified market symbol of the market the orders were made in
|
|
7182
|
+
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
7183
|
+
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
7184
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7185
|
+
* @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)
|
|
7186
|
+
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch orders in a portfolio margin account
|
|
7187
|
+
* @param {boolean} [params.stop] set to true if you would like to fetch portfolio margin account stop or conditional orders
|
|
7188
|
+
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
7189
|
+
*/
|
|
7167
7190
|
async fetchCanceledOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
7168
|
-
/**
|
|
7169
|
-
* @method
|
|
7170
|
-
* @name binance#fetchCanceledOrders
|
|
7171
|
-
* @description fetches information on multiple canceled orders made by the user
|
|
7172
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#all-orders-user_data
|
|
7173
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders
|
|
7174
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/All-Orders
|
|
7175
|
-
* @see https://developers.binance.com/docs/derivatives/option/trade/Query-Option-Order-History
|
|
7176
|
-
* @see https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-All-Orders
|
|
7177
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Orders
|
|
7178
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Orders
|
|
7179
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Conditional-Orders
|
|
7180
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Conditional-Orders
|
|
7181
|
-
* @param {string} symbol unified market symbol of the market the orders were made in
|
|
7182
|
-
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
7183
|
-
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
7184
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7185
|
-
* @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)
|
|
7186
|
-
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch orders in a portfolio margin account
|
|
7187
|
-
* @param {boolean} [params.stop] set to true if you would like to fetch portfolio margin account stop or conditional orders
|
|
7188
|
-
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
7189
|
-
*/
|
|
7190
7191
|
if (symbol === undefined) {
|
|
7191
7192
|
throw new ArgumentsRequired(this.id + ' fetchCanceledOrders() requires a symbol argument');
|
|
7192
7193
|
}
|
|
@@ -7194,29 +7195,29 @@ export default class binance extends Exchange {
|
|
|
7194
7195
|
const filteredOrders = this.filterBy(orders, 'status', 'canceled');
|
|
7195
7196
|
return this.filterBySinceLimit(filteredOrders, since, limit);
|
|
7196
7197
|
}
|
|
7198
|
+
/**
|
|
7199
|
+
* @method
|
|
7200
|
+
* @name binance#fetchCanceledAndClosedOrders
|
|
7201
|
+
* @description fetches information on multiple canceled orders made by the user
|
|
7202
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#all-orders-user_data
|
|
7203
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders
|
|
7204
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/All-Orders
|
|
7205
|
+
* @see https://developers.binance.com/docs/derivatives/option/trade/Query-Option-Order-History
|
|
7206
|
+
* @see https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-All-Orders
|
|
7207
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Orders
|
|
7208
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Orders
|
|
7209
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Conditional-Orders
|
|
7210
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Conditional-Orders
|
|
7211
|
+
* @param {string} symbol unified market symbol of the market the orders were made in
|
|
7212
|
+
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
7213
|
+
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
7214
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7215
|
+
* @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)
|
|
7216
|
+
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch orders in a portfolio margin account
|
|
7217
|
+
* @param {boolean} [params.stop] set to true if you would like to fetch portfolio margin account stop or conditional orders
|
|
7218
|
+
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
7219
|
+
*/
|
|
7197
7220
|
async fetchCanceledAndClosedOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
7198
|
-
/**
|
|
7199
|
-
* @method
|
|
7200
|
-
* @name binance#fetchCanceledAndClosedOrders
|
|
7201
|
-
* @description fetches information on multiple canceled orders made by the user
|
|
7202
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#all-orders-user_data
|
|
7203
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders
|
|
7204
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/All-Orders
|
|
7205
|
-
* @see https://developers.binance.com/docs/derivatives/option/trade/Query-Option-Order-History
|
|
7206
|
-
* @see https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-All-Orders
|
|
7207
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Orders
|
|
7208
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Orders
|
|
7209
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Conditional-Orders
|
|
7210
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Conditional-Orders
|
|
7211
|
-
* @param {string} symbol unified market symbol of the market the orders were made in
|
|
7212
|
-
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
7213
|
-
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
7214
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7215
|
-
* @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)
|
|
7216
|
-
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch orders in a portfolio margin account
|
|
7217
|
-
* @param {boolean} [params.stop] set to true if you would like to fetch portfolio margin account stop or conditional orders
|
|
7218
|
-
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
7219
|
-
*/
|
|
7220
7221
|
if (symbol === undefined) {
|
|
7221
7222
|
throw new ArgumentsRequired(this.id + ' fetchCanceledAndClosedOrders() requires a symbol argument');
|
|
7222
7223
|
}
|
|
@@ -7227,28 +7228,28 @@ export default class binance extends Exchange {
|
|
|
7227
7228
|
const sortedOrders = this.sortBy(filteredOrders, 'timestamp');
|
|
7228
7229
|
return this.filterBySinceLimit(sortedOrders, since, limit);
|
|
7229
7230
|
}
|
|
7231
|
+
/**
|
|
7232
|
+
* @method
|
|
7233
|
+
* @name binance#cancelOrder
|
|
7234
|
+
* @description cancels an open order
|
|
7235
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#cancel-order-trade
|
|
7236
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-Order
|
|
7237
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Cancel-Order
|
|
7238
|
+
* @see https://developers.binance.com/docs/derivatives/option/trade/Cancel-Option-Order
|
|
7239
|
+
* @see https://developers.binance.com/docs/margin_trading/trade/Margin-Account-Cancel-Order
|
|
7240
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-UM-Order
|
|
7241
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-CM-Order
|
|
7242
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-UM-Conditional-Order
|
|
7243
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-CM-Conditional-Order
|
|
7244
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-Margin-Account-Order
|
|
7245
|
+
* @param {string} id order id
|
|
7246
|
+
* @param {string} symbol unified symbol of the market the order was made in
|
|
7247
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7248
|
+
* @param {boolean} [params.portfolioMargin] set to true if you would like to cancel an order in a portfolio margin account
|
|
7249
|
+
* @param {boolean} [params.stop] set to true if you would like to cancel a portfolio margin account conditional order
|
|
7250
|
+
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
7251
|
+
*/
|
|
7230
7252
|
async cancelOrder(id, symbol = undefined, params = {}) {
|
|
7231
|
-
/**
|
|
7232
|
-
* @method
|
|
7233
|
-
* @name binance#cancelOrder
|
|
7234
|
-
* @description cancels an open order
|
|
7235
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#cancel-order-trade
|
|
7236
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-Order
|
|
7237
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Cancel-Order
|
|
7238
|
-
* @see https://developers.binance.com/docs/derivatives/option/trade/Cancel-Option-Order
|
|
7239
|
-
* @see https://developers.binance.com/docs/margin_trading/trade/Margin-Account-Cancel-Order
|
|
7240
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-UM-Order
|
|
7241
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-CM-Order
|
|
7242
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-UM-Conditional-Order
|
|
7243
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-CM-Conditional-Order
|
|
7244
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-Margin-Account-Order
|
|
7245
|
-
* @param {string} id order id
|
|
7246
|
-
* @param {string} symbol unified symbol of the market the order was made in
|
|
7247
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7248
|
-
* @param {boolean} [params.portfolioMargin] set to true if you would like to cancel an order in a portfolio margin account
|
|
7249
|
-
* @param {boolean} [params.stop] set to true if you would like to cancel a portfolio margin account conditional order
|
|
7250
|
-
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
7251
|
-
*/
|
|
7252
7253
|
if (symbol === undefined) {
|
|
7253
7254
|
throw new ArgumentsRequired(this.id + ' cancelOrder() requires a symbol argument');
|
|
7254
7255
|
}
|
|
@@ -7333,27 +7334,27 @@ export default class binance extends Exchange {
|
|
|
7333
7334
|
}
|
|
7334
7335
|
return this.parseOrder(response, market);
|
|
7335
7336
|
}
|
|
7337
|
+
/**
|
|
7338
|
+
* @method
|
|
7339
|
+
* @name binance#cancelAllOrders
|
|
7340
|
+
* @description cancel all open orders in a market
|
|
7341
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#cancel-all-open-orders-on-a-symbol-trade
|
|
7342
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-All-Open-Orders
|
|
7343
|
+
* @see https://developers.binance.com/docs/derivatives/option/trade/Cancel-all-Option-orders-on-specific-symbol
|
|
7344
|
+
* @see https://developers.binance.com/docs/margin_trading/trade/Margin-Account-Cancel-All-Open-Orders
|
|
7345
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-UM-Open-Orders
|
|
7346
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-UM-Open-Conditional-Orders
|
|
7347
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-CM-Open-Orders
|
|
7348
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-CM-Open-Conditional-Orders
|
|
7349
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-Margin-Account-All-Open-Orders-on-a-Symbol
|
|
7350
|
+
* @param {string} symbol unified market symbol of the market to cancel orders in
|
|
7351
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7352
|
+
* @param {string} [params.marginMode] 'cross' or 'isolated', for spot margin trading
|
|
7353
|
+
* @param {boolean} [params.portfolioMargin] set to true if you would like to cancel orders in a portfolio margin account
|
|
7354
|
+
* @param {boolean} [params.stop] set to true if you would like to cancel portfolio margin account conditional orders
|
|
7355
|
+
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
7356
|
+
*/
|
|
7336
7357
|
async cancelAllOrders(symbol = undefined, params = {}) {
|
|
7337
|
-
/**
|
|
7338
|
-
* @method
|
|
7339
|
-
* @name binance#cancelAllOrders
|
|
7340
|
-
* @description cancel all open orders in a market
|
|
7341
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#cancel-all-open-orders-on-a-symbol-trade
|
|
7342
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-All-Open-Orders
|
|
7343
|
-
* @see https://developers.binance.com/docs/derivatives/option/trade/Cancel-all-Option-orders-on-specific-symbol
|
|
7344
|
-
* @see https://developers.binance.com/docs/margin_trading/trade/Margin-Account-Cancel-All-Open-Orders
|
|
7345
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-UM-Open-Orders
|
|
7346
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-UM-Open-Conditional-Orders
|
|
7347
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-CM-Open-Orders
|
|
7348
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-CM-Open-Conditional-Orders
|
|
7349
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-Margin-Account-All-Open-Orders-on-a-Symbol
|
|
7350
|
-
* @param {string} symbol unified market symbol of the market to cancel orders in
|
|
7351
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7352
|
-
* @param {string} [params.marginMode] 'cross' or 'isolated', for spot margin trading
|
|
7353
|
-
* @param {boolean} [params.portfolioMargin] set to true if you would like to cancel orders in a portfolio margin account
|
|
7354
|
-
* @param {boolean} [params.stop] set to true if you would like to cancel portfolio margin account conditional orders
|
|
7355
|
-
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
7356
|
-
*/
|
|
7357
7358
|
if (symbol === undefined) {
|
|
7358
7359
|
throw new ArgumentsRequired(this.id + ' cancelAllOrders() requires a symbol argument');
|
|
7359
7360
|
}
|
|
@@ -7509,22 +7510,22 @@ export default class binance extends Exchange {
|
|
|
7509
7510
|
];
|
|
7510
7511
|
}
|
|
7511
7512
|
}
|
|
7513
|
+
/**
|
|
7514
|
+
* @method
|
|
7515
|
+
* @name binance#cancelOrders
|
|
7516
|
+
* @description cancel multiple orders
|
|
7517
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-Multiple-Orders
|
|
7518
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Cancel-Multiple-Orders
|
|
7519
|
+
* @param {string[]} ids order ids
|
|
7520
|
+
* @param {string} [symbol] unified market symbol
|
|
7521
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7522
|
+
*
|
|
7523
|
+
* EXCHANGE SPECIFIC PARAMETERS
|
|
7524
|
+
* @param {string[]} [params.origClientOrderIdList] max length 10 e.g. ["my_id_1","my_id_2"], encode the double quotes. No space after comma
|
|
7525
|
+
* @param {int[]} [params.recvWindow]
|
|
7526
|
+
* @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
7527
|
+
*/
|
|
7512
7528
|
async cancelOrders(ids, symbol = undefined, params = {}) {
|
|
7513
|
-
/**
|
|
7514
|
-
* @method
|
|
7515
|
-
* @name binance#cancelOrders
|
|
7516
|
-
* @description cancel multiple orders
|
|
7517
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-Multiple-Orders
|
|
7518
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Cancel-Multiple-Orders
|
|
7519
|
-
* @param {string[]} ids order ids
|
|
7520
|
-
* @param {string} [symbol] unified market symbol
|
|
7521
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7522
|
-
*
|
|
7523
|
-
* EXCHANGE SPECIFIC PARAMETERS
|
|
7524
|
-
* @param {string[]} [params.origClientOrderIdList] max length 10 e.g. ["my_id_1","my_id_2"], encode the double quotes. No space after comma
|
|
7525
|
-
* @param {int[]} [params.recvWindow]
|
|
7526
|
-
* @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
7527
|
-
*/
|
|
7528
7529
|
if (symbol === undefined) {
|
|
7529
7530
|
throw new ArgumentsRequired(this.id + ' cancelOrders() requires a symbol argument');
|
|
7530
7531
|
}
|
|
@@ -7581,22 +7582,22 @@ export default class binance extends Exchange {
|
|
|
7581
7582
|
//
|
|
7582
7583
|
return this.parseOrders(response, market);
|
|
7583
7584
|
}
|
|
7585
|
+
/**
|
|
7586
|
+
* @method
|
|
7587
|
+
* @name binance#fetchOrderTrades
|
|
7588
|
+
* @description fetch all the trades made from a single order
|
|
7589
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#account-trade-list-user_data
|
|
7590
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Account-Trade-List
|
|
7591
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Account-Trade-List
|
|
7592
|
+
* @see https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-Trade-List
|
|
7593
|
+
* @param {string} id order id
|
|
7594
|
+
* @param {string} symbol unified market symbol
|
|
7595
|
+
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
7596
|
+
* @param {int} [limit] the maximum number of trades to retrieve
|
|
7597
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7598
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
7599
|
+
*/
|
|
7584
7600
|
async fetchOrderTrades(id, symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
7585
|
-
/**
|
|
7586
|
-
* @method
|
|
7587
|
-
* @name binance#fetchOrderTrades
|
|
7588
|
-
* @description fetch all the trades made from a single order
|
|
7589
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#account-trade-list-user_data
|
|
7590
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Account-Trade-List
|
|
7591
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Account-Trade-List
|
|
7592
|
-
* @see https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-Trade-List
|
|
7593
|
-
* @param {string} id order id
|
|
7594
|
-
* @param {string} symbol unified market symbol
|
|
7595
|
-
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
7596
|
-
* @param {int} [limit] the maximum number of trades to retrieve
|
|
7597
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7598
|
-
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
7599
|
-
*/
|
|
7600
7601
|
if (symbol === undefined) {
|
|
7601
7602
|
throw new ArgumentsRequired(this.id + ' fetchOrderTrades() requires a symbol argument');
|
|
7602
7603
|
}
|
|
@@ -7612,27 +7613,27 @@ export default class binance extends Exchange {
|
|
|
7612
7613
|
};
|
|
7613
7614
|
return await this.fetchMyTrades(symbol, since, limit, this.extend(request, params));
|
|
7614
7615
|
}
|
|
7616
|
+
/**
|
|
7617
|
+
* @method
|
|
7618
|
+
* @name binance#fetchMyTrades
|
|
7619
|
+
* @description fetch all trades made by the user
|
|
7620
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#account-trade-list-user_data
|
|
7621
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Account-Trade-List
|
|
7622
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Account-Trade-List
|
|
7623
|
+
* @see https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-Trade-List
|
|
7624
|
+
* @see https://developers.binance.com/docs/derivatives/option/trade/Account-Trade-List
|
|
7625
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/UM-Account-Trade-List
|
|
7626
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/CM-Account-Trade-List
|
|
7627
|
+
* @param {string} symbol unified market symbol
|
|
7628
|
+
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
7629
|
+
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
7630
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7631
|
+
* @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)
|
|
7632
|
+
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
7633
|
+
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch trades for a portfolio margin account
|
|
7634
|
+
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
7635
|
+
*/
|
|
7615
7636
|
async fetchMyTrades(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
7616
|
-
/**
|
|
7617
|
-
* @method
|
|
7618
|
-
* @name binance#fetchMyTrades
|
|
7619
|
-
* @description fetch all trades made by the user
|
|
7620
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#account-trade-list-user_data
|
|
7621
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Account-Trade-List
|
|
7622
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Account-Trade-List
|
|
7623
|
-
* @see https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-Trade-List
|
|
7624
|
-
* @see https://developers.binance.com/docs/derivatives/option/trade/Account-Trade-List
|
|
7625
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/UM-Account-Trade-List
|
|
7626
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/CM-Account-Trade-List
|
|
7627
|
-
* @param {string} symbol unified market symbol
|
|
7628
|
-
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
7629
|
-
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
7630
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7631
|
-
* @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)
|
|
7632
|
-
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
7633
|
-
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch trades for a portfolio margin account
|
|
7634
|
-
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
7635
|
-
*/
|
|
7636
7637
|
await this.loadMarkets();
|
|
7637
7638
|
let paginate = false;
|
|
7638
7639
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchMyTrades', 'paginate');
|
|
@@ -7847,19 +7848,19 @@ export default class binance extends Exchange {
|
|
|
7847
7848
|
//
|
|
7848
7849
|
return this.parseTrades(response, market, since, limit);
|
|
7849
7850
|
}
|
|
7851
|
+
/**
|
|
7852
|
+
* @method
|
|
7853
|
+
* @name binance#fetchMyDustTrades
|
|
7854
|
+
* @description fetch all dust trades made by the user
|
|
7855
|
+
* @see https://developers.binance.com/docs/wallet/asset/dust-log
|
|
7856
|
+
* @param {string} symbol not used by binance fetchMyDustTrades ()
|
|
7857
|
+
* @param {int} [since] the earliest time in ms to fetch my dust trades for
|
|
7858
|
+
* @param {int} [limit] the maximum number of dust trades to retrieve
|
|
7859
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7860
|
+
* @param {string} [params.type] 'spot' or 'margin', default spot
|
|
7861
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
7862
|
+
*/
|
|
7850
7863
|
async fetchMyDustTrades(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
7851
|
-
/**
|
|
7852
|
-
* @method
|
|
7853
|
-
* @name binance#fetchMyDustTrades
|
|
7854
|
-
* @description fetch all dust trades made by the user
|
|
7855
|
-
* @see https://developers.binance.com/docs/wallet/asset/dust-log
|
|
7856
|
-
* @param {string} symbol not used by binance fetchMyDustTrades ()
|
|
7857
|
-
* @param {int} [since] the earliest time in ms to fetch my dust trades for
|
|
7858
|
-
* @param {int} [limit] the maximum number of dust trades to retrieve
|
|
7859
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7860
|
-
* @param {string} [params.type] 'spot' or 'margin', default spot
|
|
7861
|
-
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
7862
|
-
*/
|
|
7863
7864
|
//
|
|
7864
7865
|
// Binance provides an opportunity to trade insignificant (i.e. non-tradable and non-withdrawable)
|
|
7865
7866
|
// token leftovers (of any asset) into `BNB` coin which in turn can be used to pay trading fees with it.
|
|
@@ -7992,22 +7993,22 @@ export default class binance extends Exchange {
|
|
|
7992
7993
|
'info': trade,
|
|
7993
7994
|
};
|
|
7994
7995
|
}
|
|
7996
|
+
/**
|
|
7997
|
+
* @method
|
|
7998
|
+
* @name binance#fetchDeposits
|
|
7999
|
+
* @description fetch all deposits made to an account
|
|
8000
|
+
* @see https://developers.binance.com/docs/wallet/capital/deposite-history
|
|
8001
|
+
* @see https://developers.binance.com/docs/fiat/rest-api/Get-Fiat-Deposit-Withdraw-History
|
|
8002
|
+
* @param {string} code unified currency code
|
|
8003
|
+
* @param {int} [since] the earliest time in ms to fetch deposits for
|
|
8004
|
+
* @param {int} [limit] the maximum number of deposits structures to retrieve
|
|
8005
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8006
|
+
* @param {bool} [params.fiat] if true, only fiat deposits will be returned
|
|
8007
|
+
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
8008
|
+
* @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)
|
|
8009
|
+
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
8010
|
+
*/
|
|
7995
8011
|
async fetchDeposits(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
7996
|
-
/**
|
|
7997
|
-
* @method
|
|
7998
|
-
* @name binance#fetchDeposits
|
|
7999
|
-
* @description fetch all deposits made to an account
|
|
8000
|
-
* @see https://developers.binance.com/docs/wallet/capital/deposite-history
|
|
8001
|
-
* @see https://developers.binance.com/docs/fiat/rest-api/Get-Fiat-Deposit-Withdraw-History
|
|
8002
|
-
* @param {string} code unified currency code
|
|
8003
|
-
* @param {int} [since] the earliest time in ms to fetch deposits for
|
|
8004
|
-
* @param {int} [limit] the maximum number of deposits structures to retrieve
|
|
8005
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8006
|
-
* @param {bool} [params.fiat] if true, only fiat deposits will be returned
|
|
8007
|
-
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
8008
|
-
* @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)
|
|
8009
|
-
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
8010
|
-
*/
|
|
8011
8012
|
await this.loadMarkets();
|
|
8012
8013
|
let paginate = false;
|
|
8013
8014
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchDeposits', 'paginate');
|
|
@@ -8105,22 +8106,22 @@ export default class binance extends Exchange {
|
|
|
8105
8106
|
}
|
|
8106
8107
|
return this.parseTransactions(response, currency, since, limit);
|
|
8107
8108
|
}
|
|
8109
|
+
/**
|
|
8110
|
+
* @method
|
|
8111
|
+
* @name binance#fetchWithdrawals
|
|
8112
|
+
* @description fetch all withdrawals made from an account
|
|
8113
|
+
* @see https://developers.binance.com/docs/wallet/capital/withdraw-history
|
|
8114
|
+
* @see https://developers.binance.com/docs/fiat/rest-api/Get-Fiat-Deposit-Withdraw-History
|
|
8115
|
+
* @param {string} code unified currency code
|
|
8116
|
+
* @param {int} [since] the earliest time in ms to fetch withdrawals for
|
|
8117
|
+
* @param {int} [limit] the maximum number of withdrawals structures to retrieve
|
|
8118
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8119
|
+
* @param {bool} [params.fiat] if true, only fiat withdrawals will be returned
|
|
8120
|
+
* @param {int} [params.until] the latest time in ms to fetch withdrawals for
|
|
8121
|
+
* @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)
|
|
8122
|
+
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
8123
|
+
*/
|
|
8108
8124
|
async fetchWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
8109
|
-
/**
|
|
8110
|
-
* @method
|
|
8111
|
-
* @name binance#fetchWithdrawals
|
|
8112
|
-
* @description fetch all withdrawals made from an account
|
|
8113
|
-
* @see https://developers.binance.com/docs/wallet/capital/withdraw-history
|
|
8114
|
-
* @see https://developers.binance.com/docs/fiat/rest-api/Get-Fiat-Deposit-Withdraw-History
|
|
8115
|
-
* @param {string} code unified currency code
|
|
8116
|
-
* @param {int} [since] the earliest time in ms to fetch withdrawals for
|
|
8117
|
-
* @param {int} [limit] the maximum number of withdrawals structures to retrieve
|
|
8118
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8119
|
-
* @param {bool} [params.fiat] if true, only fiat withdrawals will be returned
|
|
8120
|
-
* @param {int} [params.until] the latest time in ms to fetch withdrawals for
|
|
8121
|
-
* @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)
|
|
8122
|
-
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
8123
|
-
*/
|
|
8124
8125
|
await this.loadMarkets();
|
|
8125
8126
|
let paginate = false;
|
|
8126
8127
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchWithdrawals', 'paginate');
|
|
@@ -8542,21 +8543,21 @@ export default class binance extends Exchange {
|
|
|
8542
8543
|
'amount': this.safeNumber(income, 'income'),
|
|
8543
8544
|
};
|
|
8544
8545
|
}
|
|
8546
|
+
/**
|
|
8547
|
+
* @method
|
|
8548
|
+
* @name binance#transfer
|
|
8549
|
+
* @description transfer currency internally between wallets on the same account
|
|
8550
|
+
* @see https://developers.binance.com/docs/wallet/asset/user-universal-transfer
|
|
8551
|
+
* @param {string} code unified currency code
|
|
8552
|
+
* @param {float} amount amount to transfer
|
|
8553
|
+
* @param {string} fromAccount account to transfer from
|
|
8554
|
+
* @param {string} toAccount account to transfer to
|
|
8555
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8556
|
+
* @param {string} [params.type] exchange specific transfer type
|
|
8557
|
+
* @param {string} [params.symbol] the unified symbol, required for isolated margin transfers
|
|
8558
|
+
* @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
8559
|
+
*/
|
|
8545
8560
|
async transfer(code, amount, fromAccount, toAccount, params = {}) {
|
|
8546
|
-
/**
|
|
8547
|
-
* @method
|
|
8548
|
-
* @name binance#transfer
|
|
8549
|
-
* @description transfer currency internally between wallets on the same account
|
|
8550
|
-
* @see https://developers.binance.com/docs/wallet/asset/user-universal-transfer
|
|
8551
|
-
* @param {string} code unified currency code
|
|
8552
|
-
* @param {float} amount amount to transfer
|
|
8553
|
-
* @param {string} fromAccount account to transfer from
|
|
8554
|
-
* @param {string} toAccount account to transfer to
|
|
8555
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8556
|
-
* @param {string} [params.type] exchange specific transfer type
|
|
8557
|
-
* @param {string} [params.symbol] the unified symbol, required for isolated margin transfers
|
|
8558
|
-
* @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
8559
|
-
*/
|
|
8560
8561
|
await this.loadMarkets();
|
|
8561
8562
|
const currency = this.currency(code);
|
|
8562
8563
|
const request = {
|
|
@@ -8648,21 +8649,21 @@ export default class binance extends Exchange {
|
|
|
8648
8649
|
//
|
|
8649
8650
|
return this.parseTransfer(response, currency);
|
|
8650
8651
|
}
|
|
8652
|
+
/**
|
|
8653
|
+
* @method
|
|
8654
|
+
* @name binance#fetchTransfers
|
|
8655
|
+
* @description fetch a history of internal transfers made on an account
|
|
8656
|
+
* @see https://developers.binance.com/docs/wallet/asset/query-user-universal-transfer
|
|
8657
|
+
* @param {string} code unified currency code of the currency transferred
|
|
8658
|
+
* @param {int} [since] the earliest time in ms to fetch transfers for
|
|
8659
|
+
* @param {int} [limit] the maximum number of transfers structures to retrieve
|
|
8660
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8661
|
+
* @param {int} [params.until] the latest time in ms to fetch transfers for
|
|
8662
|
+
* @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)
|
|
8663
|
+
* @param {boolean} [params.internal] default false, when true will fetch pay trade history
|
|
8664
|
+
* @returns {object[]} a list of [transfer structures]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
8665
|
+
*/
|
|
8651
8666
|
async fetchTransfers(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
8652
|
-
/**
|
|
8653
|
-
* @method
|
|
8654
|
-
* @name binance#fetchTransfers
|
|
8655
|
-
* @description fetch a history of internal transfers made on an account
|
|
8656
|
-
* @see https://developers.binance.com/docs/wallet/asset/query-user-universal-transfer
|
|
8657
|
-
* @param {string} code unified currency code of the currency transferred
|
|
8658
|
-
* @param {int} [since] the earliest time in ms to fetch transfers for
|
|
8659
|
-
* @param {int} [limit] the maximum number of transfers structures to retrieve
|
|
8660
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8661
|
-
* @param {int} [params.until] the latest time in ms to fetch transfers for
|
|
8662
|
-
* @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)
|
|
8663
|
-
* @param {boolean} [params.internal] default false, when true will fetch pay trade history
|
|
8664
|
-
* @returns {object[]} a list of [transfer structures]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
8665
|
-
*/
|
|
8666
8667
|
await this.loadMarkets();
|
|
8667
8668
|
const internal = this.safeBool(params, 'internal');
|
|
8668
8669
|
params = this.omit(params, 'internal');
|
|
@@ -8793,16 +8794,17 @@ export default class binance extends Exchange {
|
|
|
8793
8794
|
const rows = this.safeList2(response, 'rows', 'data', []);
|
|
8794
8795
|
return this.parseTransfers(rows, currency, since, limit);
|
|
8795
8796
|
}
|
|
8797
|
+
/**
|
|
8798
|
+
* @method
|
|
8799
|
+
* @name binance#fetchDepositAddress
|
|
8800
|
+
* @description fetch the deposit address for a currency associated with this account
|
|
8801
|
+
* @see https://developers.binance.com/docs/wallet/capital/deposite-address
|
|
8802
|
+
* @param {string} code unified currency code
|
|
8803
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8804
|
+
* @param {string} [params.network] network for fetch deposit address
|
|
8805
|
+
* @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
|
|
8806
|
+
*/
|
|
8796
8807
|
async fetchDepositAddress(code, params = {}) {
|
|
8797
|
-
/**
|
|
8798
|
-
* @method
|
|
8799
|
-
* @name binance#fetchDepositAddress
|
|
8800
|
-
* @description fetch the deposit address for a currency associated with this account
|
|
8801
|
-
* @see https://developers.binance.com/docs/wallet/capital/deposite-address
|
|
8802
|
-
* @param {string} code unified currency code
|
|
8803
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8804
|
-
* @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
|
|
8805
|
-
*/
|
|
8806
8808
|
await this.loadMarkets();
|
|
8807
8809
|
const currency = this.currency(code);
|
|
8808
8810
|
const request = {
|
|
@@ -8886,17 +8888,17 @@ export default class binance extends Exchange {
|
|
|
8886
8888
|
'tag': tag,
|
|
8887
8889
|
};
|
|
8888
8890
|
}
|
|
8891
|
+
/**
|
|
8892
|
+
* @method
|
|
8893
|
+
* @name binance#fetchTransactionFees
|
|
8894
|
+
* @deprecated
|
|
8895
|
+
* @description please use fetchDepositWithdrawFees instead
|
|
8896
|
+
* @see https://developers.binance.com/docs/wallet/capital/all-coins-info
|
|
8897
|
+
* @param {string[]|undefined} codes not used by binance fetchTransactionFees ()
|
|
8898
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8899
|
+
* @returns {object[]} a list of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
8900
|
+
*/
|
|
8889
8901
|
async fetchTransactionFees(codes = undefined, params = {}) {
|
|
8890
|
-
/**
|
|
8891
|
-
* @method
|
|
8892
|
-
* @name binance#fetchTransactionFees
|
|
8893
|
-
* @deprecated
|
|
8894
|
-
* @description please use fetchDepositWithdrawFees instead
|
|
8895
|
-
* @see https://developers.binance.com/docs/wallet/capital/all-coins-info
|
|
8896
|
-
* @param {string[]|undefined} codes not used by binance fetchTransactionFees ()
|
|
8897
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8898
|
-
* @returns {object[]} a list of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
8899
|
-
*/
|
|
8900
8902
|
await this.loadMarkets();
|
|
8901
8903
|
const response = await this.sapiGetCapitalConfigGetall(params);
|
|
8902
8904
|
//
|
|
@@ -9001,16 +9003,16 @@ export default class binance extends Exchange {
|
|
|
9001
9003
|
'info': response,
|
|
9002
9004
|
};
|
|
9003
9005
|
}
|
|
9006
|
+
/**
|
|
9007
|
+
* @method
|
|
9008
|
+
* @name binance#fetchDepositWithdrawFees
|
|
9009
|
+
* @description fetch deposit and withdraw fees
|
|
9010
|
+
* @see https://developers.binance.com/docs/wallet/capital/all-coins-info
|
|
9011
|
+
* @param {string[]|undefined} codes not used by binance fetchDepositWithdrawFees ()
|
|
9012
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
9013
|
+
* @returns {object[]} a list of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
9014
|
+
*/
|
|
9004
9015
|
async fetchDepositWithdrawFees(codes = undefined, params = {}) {
|
|
9005
|
-
/**
|
|
9006
|
-
* @method
|
|
9007
|
-
* @name binance#fetchDepositWithdrawFees
|
|
9008
|
-
* @description fetch deposit and withdraw fees
|
|
9009
|
-
* @see https://developers.binance.com/docs/wallet/capital/all-coins-info
|
|
9010
|
-
* @param {string[]|undefined} codes not used by binance fetchDepositWithdrawFees ()
|
|
9011
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
9012
|
-
* @returns {object[]} a list of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
9013
|
-
*/
|
|
9014
9016
|
await this.loadMarkets();
|
|
9015
9017
|
const response = await this.sapiGetCapitalConfigGetall(params);
|
|
9016
9018
|
//
|
|
@@ -9125,19 +9127,19 @@ export default class binance extends Exchange {
|
|
|
9125
9127
|
}
|
|
9126
9128
|
return result;
|
|
9127
9129
|
}
|
|
9130
|
+
/**
|
|
9131
|
+
* @method
|
|
9132
|
+
* @name binance#withdraw
|
|
9133
|
+
* @description make a withdrawal
|
|
9134
|
+
* @see https://developers.binance.com/docs/wallet/capital/withdraw
|
|
9135
|
+
* @param {string} code unified currency code
|
|
9136
|
+
* @param {float} amount the amount to withdraw
|
|
9137
|
+
* @param {string} address the address to withdraw to
|
|
9138
|
+
* @param {string} tag
|
|
9139
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
9140
|
+
* @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
9141
|
+
*/
|
|
9128
9142
|
async withdraw(code, amount, address, tag = undefined, params = {}) {
|
|
9129
|
-
/**
|
|
9130
|
-
* @method
|
|
9131
|
-
* @name binance#withdraw
|
|
9132
|
-
* @description make a withdrawal
|
|
9133
|
-
* @see https://developers.binance.com/docs/wallet/capital/withdraw
|
|
9134
|
-
* @param {string} code unified currency code
|
|
9135
|
-
* @param {float} amount the amount to withdraw
|
|
9136
|
-
* @param {string} address the address to withdraw to
|
|
9137
|
-
* @param {string} tag
|
|
9138
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
9139
|
-
* @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
9140
|
-
*/
|
|
9141
9143
|
[tag, params] = this.handleWithdrawTagAndParams(tag, params);
|
|
9142
9144
|
this.checkAddress(address);
|
|
9143
9145
|
await this.loadMarkets();
|
|
@@ -9192,22 +9194,22 @@ export default class binance extends Exchange {
|
|
|
9192
9194
|
'tierBased': undefined,
|
|
9193
9195
|
};
|
|
9194
9196
|
}
|
|
9197
|
+
/**
|
|
9198
|
+
* @method
|
|
9199
|
+
* @name binance#fetchTradingFee
|
|
9200
|
+
* @description fetch the trading fees for a market
|
|
9201
|
+
* @see https://developers.binance.com/docs/wallet/asset/trade-fee
|
|
9202
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/User-Commission-Rate
|
|
9203
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/account/User-Commission-Rate
|
|
9204
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-User-Commission-Rate-for-UM
|
|
9205
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-User-Commission-Rate-for-CM
|
|
9206
|
+
* @param {string} symbol unified market symbol
|
|
9207
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
9208
|
+
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch trading fees in a portfolio margin account
|
|
9209
|
+
* @param {string} [params.subType] "linear" or "inverse"
|
|
9210
|
+
* @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
9211
|
+
*/
|
|
9195
9212
|
async fetchTradingFee(symbol, params = {}) {
|
|
9196
|
-
/**
|
|
9197
|
-
* @method
|
|
9198
|
-
* @name binance#fetchTradingFee
|
|
9199
|
-
* @description fetch the trading fees for a market
|
|
9200
|
-
* @see https://developers.binance.com/docs/wallet/asset/trade-fee
|
|
9201
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/User-Commission-Rate
|
|
9202
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/account/User-Commission-Rate
|
|
9203
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-User-Commission-Rate-for-UM
|
|
9204
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-User-Commission-Rate-for-CM
|
|
9205
|
-
* @param {string} symbol unified market symbol
|
|
9206
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
9207
|
-
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch trading fees in a portfolio margin account
|
|
9208
|
-
* @param {string} [params.subType] "linear" or "inverse"
|
|
9209
|
-
* @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
9210
|
-
*/
|
|
9211
9213
|
await this.loadMarkets();
|
|
9212
9214
|
const market = this.market(symbol);
|
|
9213
9215
|
const type = market['type'];
|
|
@@ -9265,19 +9267,19 @@ export default class binance extends Exchange {
|
|
|
9265
9267
|
}
|
|
9266
9268
|
return this.parseTradingFee(data, market);
|
|
9267
9269
|
}
|
|
9270
|
+
/**
|
|
9271
|
+
* @method
|
|
9272
|
+
* @name binance#fetchTradingFees
|
|
9273
|
+
* @description fetch the trading fees for multiple markets
|
|
9274
|
+
* @see https://developers.binance.com/docs/wallet/asset/trade-fee
|
|
9275
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Information-V2
|
|
9276
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Account-Information
|
|
9277
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Config
|
|
9278
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
9279
|
+
* @param {string} [params.subType] "linear" or "inverse"
|
|
9280
|
+
* @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
|
|
9281
|
+
*/
|
|
9268
9282
|
async fetchTradingFees(params = {}) {
|
|
9269
|
-
/**
|
|
9270
|
-
* @method
|
|
9271
|
-
* @name binance#fetchTradingFees
|
|
9272
|
-
* @description fetch the trading fees for multiple markets
|
|
9273
|
-
* @see https://developers.binance.com/docs/wallet/asset/trade-fee
|
|
9274
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Information-V2
|
|
9275
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Account-Information
|
|
9276
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Config
|
|
9277
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
9278
|
-
* @param {string} [params.subType] "linear" or "inverse"
|
|
9279
|
-
* @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
|
|
9280
|
-
*/
|
|
9281
9283
|
await this.loadMarkets();
|
|
9282
9284
|
let type = undefined;
|
|
9283
9285
|
[type, params] = this.handleMarketTypeAndParams('fetchTradingFees', undefined, params);
|
|
@@ -9445,20 +9447,20 @@ export default class binance extends Exchange {
|
|
|
9445
9447
|
}
|
|
9446
9448
|
return undefined;
|
|
9447
9449
|
}
|
|
9450
|
+
/**
|
|
9451
|
+
* @method
|
|
9452
|
+
* @name binance#futuresTransfer
|
|
9453
|
+
* @ignore
|
|
9454
|
+
* @description transfer between futures account
|
|
9455
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/New-Future-Account-Transfer
|
|
9456
|
+
* @param {string} code unified currency code
|
|
9457
|
+
* @param {float} amount the amount to transfer
|
|
9458
|
+
* @param {string} type 1 - transfer from spot account to USDT-Ⓜ futures account, 2 - transfer from USDT-Ⓜ futures account to spot account, 3 - transfer from spot account to COIN-Ⓜ futures account, 4 - transfer from COIN-Ⓜ futures account to spot account
|
|
9459
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
9460
|
+
* @param {float} params.recvWindow
|
|
9461
|
+
* @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=futures-transfer-structure}
|
|
9462
|
+
*/
|
|
9448
9463
|
async futuresTransfer(code, amount, type, params = {}) {
|
|
9449
|
-
/**
|
|
9450
|
-
* @method
|
|
9451
|
-
* @name binance#futuresTransfer
|
|
9452
|
-
* @ignore
|
|
9453
|
-
* @description transfer between futures account
|
|
9454
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/New-Future-Account-Transfer
|
|
9455
|
-
* @param {string} code unified currency code
|
|
9456
|
-
* @param {float} amount the amount to transfer
|
|
9457
|
-
* @param {string} type 1 - transfer from spot account to USDT-Ⓜ futures account, 2 - transfer from USDT-Ⓜ futures account to spot account, 3 - transfer from spot account to COIN-Ⓜ futures account, 4 - transfer from COIN-Ⓜ futures account to spot account
|
|
9458
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
9459
|
-
* @param {float} params.recvWindow
|
|
9460
|
-
* @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=futures-transfer-structure}
|
|
9461
|
-
*/
|
|
9462
9464
|
if ((type < 1) || (type > 4)) {
|
|
9463
9465
|
throw new ArgumentsRequired(this.id + ' type must be between 1 and 4');
|
|
9464
9466
|
}
|
|
@@ -9477,17 +9479,17 @@ export default class binance extends Exchange {
|
|
|
9477
9479
|
//
|
|
9478
9480
|
return this.parseTransfer(response, currency);
|
|
9479
9481
|
}
|
|
9482
|
+
/**
|
|
9483
|
+
* @method
|
|
9484
|
+
* @name binance#fetchFundingRate
|
|
9485
|
+
* @description fetch the current funding rate
|
|
9486
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Mark-Price
|
|
9487
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Index-Price-and-Mark-Price
|
|
9488
|
+
* @param {string} symbol unified market symbol
|
|
9489
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
9490
|
+
* @returns {object} a [funding rate structure]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
|
|
9491
|
+
*/
|
|
9480
9492
|
async fetchFundingRate(symbol, params = {}) {
|
|
9481
|
-
/**
|
|
9482
|
-
* @method
|
|
9483
|
-
* @name binance#fetchFundingRate
|
|
9484
|
-
* @description fetch the current funding rate
|
|
9485
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Mark-Price
|
|
9486
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Index-Price-and-Mark-Price
|
|
9487
|
-
* @param {string} symbol unified market symbol
|
|
9488
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
9489
|
-
* @returns {object} a [funding rate structure]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
|
|
9490
|
-
*/
|
|
9491
9493
|
await this.loadMarkets();
|
|
9492
9494
|
const market = this.market(symbol);
|
|
9493
9495
|
const request = {
|
|
@@ -9520,22 +9522,22 @@ export default class binance extends Exchange {
|
|
|
9520
9522
|
//
|
|
9521
9523
|
return this.parseFundingRate(response, market);
|
|
9522
9524
|
}
|
|
9525
|
+
/**
|
|
9526
|
+
* @method
|
|
9527
|
+
* @name binance#fetchFundingRateHistory
|
|
9528
|
+
* @description fetches historical funding rate prices
|
|
9529
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Get-Funding-Rate-History
|
|
9530
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Get-Funding-Rate-History-of-Perpetual-Futures
|
|
9531
|
+
* @param {string} symbol unified symbol of the market to fetch the funding rate history for
|
|
9532
|
+
* @param {int} [since] timestamp in ms of the earliest funding rate to fetch
|
|
9533
|
+
* @param {int} [limit] the maximum amount of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure} to fetch
|
|
9534
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
9535
|
+
* @param {int} [params.until] timestamp in ms of the latest funding rate
|
|
9536
|
+
* @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)
|
|
9537
|
+
* @param {string} [params.subType] "linear" or "inverse"
|
|
9538
|
+
* @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure}
|
|
9539
|
+
*/
|
|
9523
9540
|
async fetchFundingRateHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
9524
|
-
/**
|
|
9525
|
-
* @method
|
|
9526
|
-
* @name binance#fetchFundingRateHistory
|
|
9527
|
-
* @description fetches historical funding rate prices
|
|
9528
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Get-Funding-Rate-History
|
|
9529
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Get-Funding-Rate-History-of-Perpetual-Futures
|
|
9530
|
-
* @param {string} symbol unified symbol of the market to fetch the funding rate history for
|
|
9531
|
-
* @param {int} [since] timestamp in ms of the earliest funding rate to fetch
|
|
9532
|
-
* @param {int} [limit] the maximum amount of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure} to fetch
|
|
9533
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
9534
|
-
* @param {int} [params.until] timestamp in ms of the latest funding rate
|
|
9535
|
-
* @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)
|
|
9536
|
-
* @param {string} [params.subType] "linear" or "inverse"
|
|
9537
|
-
* @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure}
|
|
9538
|
-
*/
|
|
9539
9541
|
await this.loadMarkets();
|
|
9540
9542
|
const request = {};
|
|
9541
9543
|
let paginate = false;
|
|
@@ -9598,18 +9600,18 @@ export default class binance extends Exchange {
|
|
|
9598
9600
|
const sorted = this.sortBy(rates, 'timestamp');
|
|
9599
9601
|
return this.filterBySymbolSinceLimit(sorted, symbol, since, limit);
|
|
9600
9602
|
}
|
|
9603
|
+
/**
|
|
9604
|
+
* @method
|
|
9605
|
+
* @name binance#fetchFundingRates
|
|
9606
|
+
* @description fetch the funding rate for multiple markets
|
|
9607
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Mark-Price
|
|
9608
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Index-Price-and-Mark-Price
|
|
9609
|
+
* @param {string[]|undefined} symbols list of unified market symbols
|
|
9610
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
9611
|
+
* @param {string} [params.subType] "linear" or "inverse"
|
|
9612
|
+
* @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rates-structure}, indexed by market symbols
|
|
9613
|
+
*/
|
|
9601
9614
|
async fetchFundingRates(symbols = undefined, params = {}) {
|
|
9602
|
-
/**
|
|
9603
|
-
* @method
|
|
9604
|
-
* @name binance#fetchFundingRates
|
|
9605
|
-
* @description fetch the funding rate for multiple markets
|
|
9606
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Mark-Price
|
|
9607
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Index-Price-and-Mark-Price
|
|
9608
|
-
* @param {string[]|undefined} symbols list of unified market symbols
|
|
9609
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
9610
|
-
* @param {string} [params.subType] "linear" or "inverse"
|
|
9611
|
-
* @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rates-structure}, indexed by market symbols
|
|
9612
|
-
*/
|
|
9613
9615
|
await this.loadMarkets();
|
|
9614
9616
|
symbols = this.marketSymbols(symbols);
|
|
9615
9617
|
const defaultType = this.safeString2(this.options, 'fetchFundingRates', 'defaultType', 'future');
|
|
@@ -10277,21 +10279,21 @@ export default class binance extends Exchange {
|
|
|
10277
10279
|
}
|
|
10278
10280
|
return this.options['leverageBrackets'];
|
|
10279
10281
|
}
|
|
10282
|
+
/**
|
|
10283
|
+
* @method
|
|
10284
|
+
* @name binance#fetchLeverageTiers
|
|
10285
|
+
* @description retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes
|
|
10286
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Notional-and-Leverage-Brackets
|
|
10287
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Notional-Bracket-for-Symbol
|
|
10288
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/account/UM-Notional-and-Leverage-Brackets
|
|
10289
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/account/CM-Notional-and-Leverage-Brackets
|
|
10290
|
+
* @param {string[]|undefined} symbols list of unified market symbols
|
|
10291
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
10292
|
+
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch the leverage tiers for a portfolio margin account
|
|
10293
|
+
* @param {string} [params.subType] "linear" or "inverse"
|
|
10294
|
+
* @returns {object} a dictionary of [leverage tiers structures]{@link https://docs.ccxt.com/#/?id=leverage-tiers-structure}, indexed by market symbols
|
|
10295
|
+
*/
|
|
10280
10296
|
async fetchLeverageTiers(symbols = undefined, params = {}) {
|
|
10281
|
-
/**
|
|
10282
|
-
* @method
|
|
10283
|
-
* @name binance#fetchLeverageTiers
|
|
10284
|
-
* @description retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes
|
|
10285
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Notional-and-Leverage-Brackets
|
|
10286
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Notional-Bracket-for-Symbol
|
|
10287
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/account/UM-Notional-and-Leverage-Brackets
|
|
10288
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/account/CM-Notional-and-Leverage-Brackets
|
|
10289
|
-
* @param {string[]|undefined} symbols list of unified market symbols
|
|
10290
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
10291
|
-
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch the leverage tiers for a portfolio margin account
|
|
10292
|
-
* @param {string} [params.subType] "linear" or "inverse"
|
|
10293
|
-
* @returns {object} a dictionary of [leverage tiers structures]{@link https://docs.ccxt.com/#/?id=leverage-tiers-structure}, indexed by market symbols
|
|
10294
|
-
*/
|
|
10295
10297
|
await this.loadMarkets();
|
|
10296
10298
|
let type = undefined;
|
|
10297
10299
|
[type, params] = this.handleMarketTypeAndParams('fetchLeverageTiers', undefined, params);
|
|
@@ -10390,6 +10392,7 @@ export default class binance extends Exchange {
|
|
|
10390
10392
|
const bracket = brackets[j];
|
|
10391
10393
|
tiers.push({
|
|
10392
10394
|
'tier': this.safeNumber(bracket, 'bracket'),
|
|
10395
|
+
'symbol': this.safeSymbol(marketId, market),
|
|
10393
10396
|
'currency': market['quote'],
|
|
10394
10397
|
'minNotional': this.safeNumber2(bracket, 'notionalFloor', 'qtyFloor'),
|
|
10395
10398
|
'maxNotional': this.safeNumber2(bracket, 'notionalCap', 'qtyCap'),
|
|
@@ -10400,16 +10403,16 @@ export default class binance extends Exchange {
|
|
|
10400
10403
|
}
|
|
10401
10404
|
return tiers;
|
|
10402
10405
|
}
|
|
10406
|
+
/**
|
|
10407
|
+
* @method
|
|
10408
|
+
* @name binance#fetchPosition
|
|
10409
|
+
* @description fetch data on an open position
|
|
10410
|
+
* @see https://developers.binance.com/docs/derivatives/option/trade/Option-Position-Information
|
|
10411
|
+
* @param {string} symbol unified market symbol of the market the position is held in
|
|
10412
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
10413
|
+
* @returns {object} a [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
10414
|
+
*/
|
|
10403
10415
|
async fetchPosition(symbol, params = {}) {
|
|
10404
|
-
/**
|
|
10405
|
-
* @method
|
|
10406
|
-
* @name binance#fetchPosition
|
|
10407
|
-
* @description fetch data on an open position
|
|
10408
|
-
* @see https://developers.binance.com/docs/derivatives/option/trade/Option-Position-Information
|
|
10409
|
-
* @param {string} symbol unified market symbol of the market the position is held in
|
|
10410
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
10411
|
-
* @returns {object} a [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
10412
|
-
*/
|
|
10413
10416
|
await this.loadMarkets();
|
|
10414
10417
|
const market = this.market(symbol);
|
|
10415
10418
|
if (!market['option']) {
|
|
@@ -10444,16 +10447,16 @@ export default class binance extends Exchange {
|
|
|
10444
10447
|
//
|
|
10445
10448
|
return this.parsePosition(response[0], market);
|
|
10446
10449
|
}
|
|
10450
|
+
/**
|
|
10451
|
+
* @method
|
|
10452
|
+
* @name binance#fetchOptionPositions
|
|
10453
|
+
* @description fetch data on open options positions
|
|
10454
|
+
* @see https://developers.binance.com/docs/derivatives/option/trade/Option-Position-Information
|
|
10455
|
+
* @param {string[]|undefined} symbols list of unified market symbols
|
|
10456
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
10457
|
+
* @returns {object[]} a list of [position structures]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
10458
|
+
*/
|
|
10447
10459
|
async fetchOptionPositions(symbols = undefined, params = {}) {
|
|
10448
|
-
/**
|
|
10449
|
-
* @method
|
|
10450
|
-
* @name binance#fetchOptionPositions
|
|
10451
|
-
* @description fetch data on open options positions
|
|
10452
|
-
* @see https://developers.binance.com/docs/derivatives/option/trade/Option-Position-Information
|
|
10453
|
-
* @param {string[]|undefined} symbols list of unified market symbols
|
|
10454
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
10455
|
-
* @returns {object[]} a list of [position structures]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
10456
|
-
*/
|
|
10457
10460
|
await this.loadMarkets();
|
|
10458
10461
|
symbols = this.marketSymbols(symbols);
|
|
10459
10462
|
const request = {};
|
|
@@ -10560,22 +10563,23 @@ export default class binance extends Exchange {
|
|
|
10560
10563
|
'percentage': undefined,
|
|
10561
10564
|
});
|
|
10562
10565
|
}
|
|
10566
|
+
/**
|
|
10567
|
+
* @method
|
|
10568
|
+
* @name binance#fetchPositions
|
|
10569
|
+
* @description fetch all open positions
|
|
10570
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Information-V2
|
|
10571
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Account-Information
|
|
10572
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Position-Information-V2
|
|
10573
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Position-Information
|
|
10574
|
+
* @see https://developers.binance.com/docs/derivatives/option/trade/Option-Position-Information
|
|
10575
|
+
* @param {string[]} [symbols] list of unified market symbols
|
|
10576
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
10577
|
+
* @param {object} [params.params] extra parameters specific to the exchange API endpoint
|
|
10578
|
+
* @param {string} [params.method] method name to call, "positionRisk", "account" or "option", default is "positionRisk"
|
|
10579
|
+
* @param {bool} [params.useV2] set to true if you want to use the obsolete endpoint, where some more additional fields were provided
|
|
10580
|
+
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
10581
|
+
*/
|
|
10563
10582
|
async fetchPositions(symbols = undefined, params = {}) {
|
|
10564
|
-
/**
|
|
10565
|
-
* @method
|
|
10566
|
-
* @name binance#fetchPositions
|
|
10567
|
-
* @description fetch all open positions
|
|
10568
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Information-V2
|
|
10569
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Account-Information
|
|
10570
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Position-Information-V2
|
|
10571
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Position-Information
|
|
10572
|
-
* @see https://developers.binance.com/docs/derivatives/option/trade/Option-Position-Information
|
|
10573
|
-
* @param {string[]} [symbols] list of unified market symbols
|
|
10574
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
10575
|
-
* @param {string} [method] method name to call, "positionRisk", "account" or "option", default is "positionRisk"
|
|
10576
|
-
* @param {bool} [params.useV2] set to true if you want to use the obsolete endpoint, where some more additional fields were provided
|
|
10577
|
-
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
10578
|
-
*/
|
|
10579
10583
|
let defaultMethod = undefined;
|
|
10580
10584
|
[defaultMethod, params] = this.handleOptionAndParams(params, 'fetchPositions', 'method');
|
|
10581
10585
|
if (defaultMethod === undefined) {
|
|
@@ -10600,25 +10604,25 @@ export default class binance extends Exchange {
|
|
|
10600
10604
|
throw new NotSupported(this.id + '.options["fetchPositions"]["method"] or params["method"] = "' + defaultMethod + '" is invalid, please choose between "account", "positionRisk" and "option"');
|
|
10601
10605
|
}
|
|
10602
10606
|
}
|
|
10607
|
+
/**
|
|
10608
|
+
* @method
|
|
10609
|
+
* @name binance#fetchAccountPositions
|
|
10610
|
+
* @ignore
|
|
10611
|
+
* @description fetch account positions
|
|
10612
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Information-V2
|
|
10613
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Account-Information
|
|
10614
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Position-Information-V2
|
|
10615
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Position-Information
|
|
10616
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Information-V3
|
|
10617
|
+
* @param {string[]} [symbols] list of unified market symbols
|
|
10618
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
10619
|
+
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch positions in a portfolio margin account
|
|
10620
|
+
* @param {string} [params.subType] "linear" or "inverse"
|
|
10621
|
+
* @param {boolean} [params.filterClosed] set to true if you would like to filter out closed positions, default is false
|
|
10622
|
+
* @param {boolean} [params.useV2] set to true if you want to use obsolete endpoint, where some more additional fields were provided
|
|
10623
|
+
* @returns {object} data on account positions
|
|
10624
|
+
*/
|
|
10603
10625
|
async fetchAccountPositions(symbols = undefined, params = {}) {
|
|
10604
|
-
/**
|
|
10605
|
-
* @method
|
|
10606
|
-
* @name binance#fetchAccountPositions
|
|
10607
|
-
* @ignore
|
|
10608
|
-
* @description fetch account positions
|
|
10609
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Information-V2
|
|
10610
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Account-Information
|
|
10611
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Position-Information-V2
|
|
10612
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Position-Information
|
|
10613
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Information-V3
|
|
10614
|
-
* @param {string[]} [symbols] list of unified market symbols
|
|
10615
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
10616
|
-
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch positions in a portfolio margin account
|
|
10617
|
-
* @param {string} [params.subType] "linear" or "inverse"
|
|
10618
|
-
* @param {boolean} [params.filterClosed] set to true if you would like to filter out closed positions, default is false
|
|
10619
|
-
* @param {boolean} [params.useV2] set to true if you want to use obsolete endpoint, where some more additional fields were provided
|
|
10620
|
-
* @returns {object} data on account positions
|
|
10621
|
-
*/
|
|
10622
10626
|
if (symbols !== undefined) {
|
|
10623
10627
|
if (!Array.isArray(symbols)) {
|
|
10624
10628
|
throw new ArgumentsRequired(this.id + ' fetchPositions() requires an array argument for symbols');
|
|
@@ -10732,24 +10736,24 @@ export default class binance extends Exchange {
|
|
|
10732
10736
|
symbols = this.marketSymbols(symbols);
|
|
10733
10737
|
return this.filterByArrayPositions(result, 'symbol', symbols, false);
|
|
10734
10738
|
}
|
|
10739
|
+
/**
|
|
10740
|
+
* @method
|
|
10741
|
+
* @name binance#fetchPositionsRisk
|
|
10742
|
+
* @ignore
|
|
10743
|
+
* @description fetch positions risk
|
|
10744
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Position-Information-V2
|
|
10745
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Position-Information
|
|
10746
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-UM-Position-Information
|
|
10747
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-CM-Position-Information
|
|
10748
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Position-Information-V3
|
|
10749
|
+
* @param {string[]|undefined} symbols list of unified market symbols
|
|
10750
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
10751
|
+
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch positions for a portfolio margin account
|
|
10752
|
+
* @param {string} [params.subType] "linear" or "inverse"
|
|
10753
|
+
* @param {bool} [params.useV2] set to true if you want to use the obsolete endpoint, where some more additional fields were provided
|
|
10754
|
+
* @returns {object} data on the positions risk
|
|
10755
|
+
*/
|
|
10735
10756
|
async fetchPositionsRisk(symbols = undefined, params = {}) {
|
|
10736
|
-
/**
|
|
10737
|
-
* @method
|
|
10738
|
-
* @name binance#fetchPositionsRisk
|
|
10739
|
-
* @ignore
|
|
10740
|
-
* @description fetch positions risk
|
|
10741
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Position-Information-V2
|
|
10742
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Position-Information
|
|
10743
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-UM-Position-Information
|
|
10744
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-CM-Position-Information
|
|
10745
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Position-Information-V3
|
|
10746
|
-
* @param {string[]|undefined} symbols list of unified market symbols
|
|
10747
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
10748
|
-
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch positions for a portfolio margin account
|
|
10749
|
-
* @param {string} [params.subType] "linear" or "inverse"
|
|
10750
|
-
* @param {bool} [params.useV2] set to true if you want to use the obsolete endpoint, where some more additional fields were provided
|
|
10751
|
-
* @returns {object} data on the positions risk
|
|
10752
|
-
*/
|
|
10753
10757
|
if (symbols !== undefined) {
|
|
10754
10758
|
if (!Array.isArray(symbols)) {
|
|
10755
10759
|
throw new ArgumentsRequired(this.id + ' fetchPositionsRisk() requires an array argument for symbols');
|
|
@@ -10912,24 +10916,24 @@ export default class binance extends Exchange {
|
|
|
10912
10916
|
symbols = this.marketSymbols(symbols);
|
|
10913
10917
|
return this.filterByArrayPositions(result, 'symbol', symbols, false);
|
|
10914
10918
|
}
|
|
10919
|
+
/**
|
|
10920
|
+
* @method
|
|
10921
|
+
* @name binance#fetchFundingHistory
|
|
10922
|
+
* @description fetch the history of funding payments paid and received on this account
|
|
10923
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Income-History
|
|
10924
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Get-Income-History
|
|
10925
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Income-History
|
|
10926
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-CM-Income-History
|
|
10927
|
+
* @param {string} symbol unified market symbol
|
|
10928
|
+
* @param {int} [since] the earliest time in ms to fetch funding history for
|
|
10929
|
+
* @param {int} [limit] the maximum number of funding history structures to retrieve
|
|
10930
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
10931
|
+
* @param {int} [params.until] timestamp in ms of the latest funding history entry
|
|
10932
|
+
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch the funding history for a portfolio margin account
|
|
10933
|
+
* @param {string} [params.subType] "linear" or "inverse"
|
|
10934
|
+
* @returns {object} a [funding history structure]{@link https://docs.ccxt.com/#/?id=funding-history-structure}
|
|
10935
|
+
*/
|
|
10915
10936
|
async fetchFundingHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
10916
|
-
/**
|
|
10917
|
-
* @method
|
|
10918
|
-
* @name binance#fetchFundingHistory
|
|
10919
|
-
* @description fetch the history of funding payments paid and received on this account
|
|
10920
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Income-History
|
|
10921
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Get-Income-History
|
|
10922
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Income-History
|
|
10923
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-CM-Income-History
|
|
10924
|
-
* @param {string} symbol unified market symbol
|
|
10925
|
-
* @param {int} [since] the earliest time in ms to fetch funding history for
|
|
10926
|
-
* @param {int} [limit] the maximum number of funding history structures to retrieve
|
|
10927
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
10928
|
-
* @param {int} [params.until] timestamp in ms of the latest funding history entry
|
|
10929
|
-
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch the funding history for a portfolio margin account
|
|
10930
|
-
* @param {string} [params.subType] "linear" or "inverse"
|
|
10931
|
-
* @returns {object} a [funding history structure]{@link https://docs.ccxt.com/#/?id=funding-history-structure}
|
|
10932
|
-
*/
|
|
10933
10937
|
await this.loadMarkets();
|
|
10934
10938
|
let market = undefined;
|
|
10935
10939
|
let request = {
|
|
@@ -10978,21 +10982,21 @@ export default class binance extends Exchange {
|
|
|
10978
10982
|
}
|
|
10979
10983
|
return this.parseIncomes(response, market, since, limit);
|
|
10980
10984
|
}
|
|
10985
|
+
/**
|
|
10986
|
+
* @method
|
|
10987
|
+
* @name binance#setLeverage
|
|
10988
|
+
* @description set the level of leverage for a market
|
|
10989
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Change-Initial-Leverage
|
|
10990
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Change-Initial-Leverage
|
|
10991
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-UM-Initial-Leverage
|
|
10992
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-CM-Initial-Leverage
|
|
10993
|
+
* @param {float} leverage the rate of leverage
|
|
10994
|
+
* @param {string} symbol unified market symbol
|
|
10995
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
10996
|
+
* @param {boolean} [params.portfolioMargin] set to true if you would like to set the leverage for a trading pair in a portfolio margin account
|
|
10997
|
+
* @returns {object} response from the exchange
|
|
10998
|
+
*/
|
|
10981
10999
|
async setLeverage(leverage, symbol = undefined, params = {}) {
|
|
10982
|
-
/**
|
|
10983
|
-
* @method
|
|
10984
|
-
* @name binance#setLeverage
|
|
10985
|
-
* @description set the level of leverage for a market
|
|
10986
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Change-Initial-Leverage
|
|
10987
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Change-Initial-Leverage
|
|
10988
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-UM-Initial-Leverage
|
|
10989
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-CM-Initial-Leverage
|
|
10990
|
-
* @param {float} leverage the rate of leverage
|
|
10991
|
-
* @param {string} symbol unified market symbol
|
|
10992
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
10993
|
-
* @param {boolean} [params.portfolioMargin] set to true if you would like to set the leverage for a trading pair in a portfolio margin account
|
|
10994
|
-
* @returns {object} response from the exchange
|
|
10995
|
-
*/
|
|
10996
11000
|
if (symbol === undefined) {
|
|
10997
11001
|
throw new ArgumentsRequired(this.id + ' setLeverage() requires a symbol argument');
|
|
10998
11002
|
}
|
|
@@ -11031,18 +11035,18 @@ export default class binance extends Exchange {
|
|
|
11031
11035
|
}
|
|
11032
11036
|
return response;
|
|
11033
11037
|
}
|
|
11038
|
+
/**
|
|
11039
|
+
* @method
|
|
11040
|
+
* @name binance#setMarginMode
|
|
11041
|
+
* @description set margin mode to 'cross' or 'isolated'
|
|
11042
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Change-Margin-Type
|
|
11043
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Change-Margin-Type
|
|
11044
|
+
* @param {string} marginMode 'cross' or 'isolated'
|
|
11045
|
+
* @param {string} symbol unified market symbol
|
|
11046
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
11047
|
+
* @returns {object} response from the exchange
|
|
11048
|
+
*/
|
|
11034
11049
|
async setMarginMode(marginMode, symbol = undefined, params = {}) {
|
|
11035
|
-
/**
|
|
11036
|
-
* @method
|
|
11037
|
-
* @name binance#setMarginMode
|
|
11038
|
-
* @description set margin mode to 'cross' or 'isolated'
|
|
11039
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Change-Margin-Type
|
|
11040
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Change-Margin-Type
|
|
11041
|
-
* @param {string} marginMode 'cross' or 'isolated'
|
|
11042
|
-
* @param {string} symbol unified market symbol
|
|
11043
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
11044
|
-
* @returns {object} response from the exchange
|
|
11045
|
-
*/
|
|
11046
11050
|
if (symbol === undefined) {
|
|
11047
11051
|
throw new ArgumentsRequired(this.id + ' setMarginMode() requires a symbol argument');
|
|
11048
11052
|
}
|
|
@@ -11099,22 +11103,22 @@ export default class binance extends Exchange {
|
|
|
11099
11103
|
}
|
|
11100
11104
|
return response;
|
|
11101
11105
|
}
|
|
11106
|
+
/**
|
|
11107
|
+
* @method
|
|
11108
|
+
* @name binance#setPositionMode
|
|
11109
|
+
* @description set hedged to true or false for a market
|
|
11110
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Change-Position-Mode
|
|
11111
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Change-Position-Mode
|
|
11112
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Current-Position-Mode
|
|
11113
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-CM-Current-Position-Mode
|
|
11114
|
+
* @param {bool} hedged set to true to use dualSidePosition
|
|
11115
|
+
* @param {string} symbol not used by binance setPositionMode ()
|
|
11116
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
11117
|
+
* @param {boolean} [params.portfolioMargin] set to true if you would like to set the position mode for a portfolio margin account
|
|
11118
|
+
* @param {string} [params.subType] "linear" or "inverse"
|
|
11119
|
+
* @returns {object} response from the exchange
|
|
11120
|
+
*/
|
|
11102
11121
|
async setPositionMode(hedged, symbol = undefined, params = {}) {
|
|
11103
|
-
/**
|
|
11104
|
-
* @method
|
|
11105
|
-
* @name binance#setPositionMode
|
|
11106
|
-
* @description set hedged to true or false for a market
|
|
11107
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Change-Position-Mode
|
|
11108
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Change-Position-Mode
|
|
11109
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Current-Position-Mode
|
|
11110
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-CM-Current-Position-Mode
|
|
11111
|
-
* @param {bool} hedged set to true to use dualSidePosition
|
|
11112
|
-
* @param {string} symbol not used by binance setPositionMode ()
|
|
11113
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
11114
|
-
* @param {boolean} [params.portfolioMargin] set to true if you would like to set the position mode for a portfolio margin account
|
|
11115
|
-
* @param {string} [params.subType] "linear" or "inverse"
|
|
11116
|
-
* @returns {object} response from the exchange
|
|
11117
|
-
*/
|
|
11118
11122
|
const defaultType = this.safeString(this.options, 'defaultType', 'future');
|
|
11119
11123
|
const type = this.safeString(params, 'type', defaultType);
|
|
11120
11124
|
params = this.omit(params, ['type']);
|
|
@@ -11160,21 +11164,21 @@ export default class binance extends Exchange {
|
|
|
11160
11164
|
//
|
|
11161
11165
|
return response;
|
|
11162
11166
|
}
|
|
11167
|
+
/**
|
|
11168
|
+
* @method
|
|
11169
|
+
* @name binance#fetchLeverages
|
|
11170
|
+
* @description fetch the set leverage for all markets
|
|
11171
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Information-V2
|
|
11172
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Account-Information
|
|
11173
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Account-Detail
|
|
11174
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-CM-Account-Detail
|
|
11175
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Symbol-Config
|
|
11176
|
+
* @param {string[]} [symbols] a list of unified market symbols
|
|
11177
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
11178
|
+
* @param {string} [params.subType] "linear" or "inverse"
|
|
11179
|
+
* @returns {object} a list of [leverage structures]{@link https://docs.ccxt.com/#/?id=leverage-structure}
|
|
11180
|
+
*/
|
|
11163
11181
|
async fetchLeverages(symbols = undefined, params = {}) {
|
|
11164
|
-
/**
|
|
11165
|
-
* @method
|
|
11166
|
-
* @name binance#fetchLeverages
|
|
11167
|
-
* @description fetch the set leverage for all markets
|
|
11168
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Information-V2
|
|
11169
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Account-Information
|
|
11170
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Account-Detail
|
|
11171
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-CM-Account-Detail
|
|
11172
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Symbol-Config
|
|
11173
|
-
* @param {string[]} [symbols] a list of unified market symbols
|
|
11174
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
11175
|
-
* @param {string} [params.subType] "linear" or "inverse"
|
|
11176
|
-
* @returns {object} a list of [leverage structures]{@link https://docs.ccxt.com/#/?id=leverage-structure}
|
|
11177
|
-
*/
|
|
11178
11182
|
await this.loadMarkets();
|
|
11179
11183
|
await this.loadLeverageBrackets(false, params);
|
|
11180
11184
|
let type = undefined;
|
|
@@ -11242,18 +11246,18 @@ export default class binance extends Exchange {
|
|
|
11242
11246
|
'shortLeverage': shortLeverage,
|
|
11243
11247
|
};
|
|
11244
11248
|
}
|
|
11249
|
+
/**
|
|
11250
|
+
* @method
|
|
11251
|
+
* @name binance#fetchSettlementHistory
|
|
11252
|
+
* @description fetches historical settlement records
|
|
11253
|
+
* @see https://developers.binance.com/docs/derivatives/option/market-data/Historical-Exercise-Records
|
|
11254
|
+
* @param {string} symbol unified market symbol of the settlement history
|
|
11255
|
+
* @param {int} [since] timestamp in ms
|
|
11256
|
+
* @param {int} [limit] number of records, default 100, max 100
|
|
11257
|
+
* @param {object} [params] exchange specific params
|
|
11258
|
+
* @returns {object[]} a list of [settlement history objects]{@link https://docs.ccxt.com/#/?id=settlement-history-structure}
|
|
11259
|
+
*/
|
|
11245
11260
|
async fetchSettlementHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
11246
|
-
/**
|
|
11247
|
-
* @method
|
|
11248
|
-
* @name binance#fetchSettlementHistory
|
|
11249
|
-
* @description fetches historical settlement records
|
|
11250
|
-
* @see https://developers.binance.com/docs/derivatives/option/market-data/Historical-Exercise-Records
|
|
11251
|
-
* @param {string} symbol unified market symbol of the settlement history
|
|
11252
|
-
* @param {int} [since] timestamp in ms
|
|
11253
|
-
* @param {int} [limit] number of records, default 100, max 100
|
|
11254
|
-
* @param {object} [params] exchange specific params
|
|
11255
|
-
* @returns {object[]} a list of [settlement history objects]{@link https://docs.ccxt.com/#/?id=settlement-history-structure}
|
|
11256
|
-
*/
|
|
11257
11261
|
await this.loadMarkets();
|
|
11258
11262
|
const market = (symbol === undefined) ? undefined : this.market(symbol);
|
|
11259
11263
|
let type = undefined;
|
|
@@ -11288,18 +11292,18 @@ export default class binance extends Exchange {
|
|
|
11288
11292
|
const sorted = this.sortBy(settlements, 'timestamp');
|
|
11289
11293
|
return this.filterBySymbolSinceLimit(sorted, symbol, since, limit);
|
|
11290
11294
|
}
|
|
11295
|
+
/**
|
|
11296
|
+
* @method
|
|
11297
|
+
* @name binance#fetchMySettlementHistory
|
|
11298
|
+
* @description fetches historical settlement records of the user
|
|
11299
|
+
* @see https://developers.binance.com/docs/derivatives/option/trade/User-Exercise-Record
|
|
11300
|
+
* @param {string} symbol unified market symbol of the settlement history
|
|
11301
|
+
* @param {int} [since] timestamp in ms
|
|
11302
|
+
* @param {int} [limit] number of records
|
|
11303
|
+
* @param {object} [params] exchange specific params
|
|
11304
|
+
* @returns {object[]} a list of [settlement history objects]
|
|
11305
|
+
*/
|
|
11291
11306
|
async fetchMySettlementHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
11292
|
-
/**
|
|
11293
|
-
* @method
|
|
11294
|
-
* @name binance#fetchMySettlementHistory
|
|
11295
|
-
* @description fetches historical settlement records of the user
|
|
11296
|
-
* @see https://developers.binance.com/docs/derivatives/option/trade/User-Exercise-Record
|
|
11297
|
-
* @param {string} symbol unified market symbol of the settlement history
|
|
11298
|
-
* @param {int} [since] timestamp in ms
|
|
11299
|
-
* @param {int} [limit] number of records
|
|
11300
|
-
* @param {object} [params] exchange specific params
|
|
11301
|
-
* @returns {object[]} a list of [settlement history objects]
|
|
11302
|
-
*/
|
|
11303
11307
|
await this.loadMarkets();
|
|
11304
11308
|
const market = (symbol === undefined) ? undefined : this.market(symbol);
|
|
11305
11309
|
let type = undefined;
|
|
@@ -11424,17 +11428,17 @@ export default class binance extends Exchange {
|
|
|
11424
11428
|
}
|
|
11425
11429
|
return result;
|
|
11426
11430
|
}
|
|
11431
|
+
/**
|
|
11432
|
+
* @method
|
|
11433
|
+
* @name binance#fetchLedgerEntry
|
|
11434
|
+
* @description fetch the history of changes, actions done by the user or operations that altered the balance of the user
|
|
11435
|
+
* @see https://developers.binance.com/docs/derivatives/option/account/Account-Funding-Flow
|
|
11436
|
+
* @param {string} id the identification number of the ledger entry
|
|
11437
|
+
* @param {string} code unified currency code
|
|
11438
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
11439
|
+
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
|
|
11440
|
+
*/
|
|
11427
11441
|
async fetchLedgerEntry(id, code = undefined, params = {}) {
|
|
11428
|
-
/**
|
|
11429
|
-
* @method
|
|
11430
|
-
* @name binance#fetchLedgerEntry
|
|
11431
|
-
* @description fetch the history of changes, actions done by the user or operations that altered the balance of the user
|
|
11432
|
-
* @see https://developers.binance.com/docs/derivatives/option/account/Account-Funding-Flow
|
|
11433
|
-
* @param {string} id the identification number of the ledger entry
|
|
11434
|
-
* @param {string} code unified currency code
|
|
11435
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
11436
|
-
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
|
|
11437
|
-
*/
|
|
11438
11442
|
await this.loadMarkets();
|
|
11439
11443
|
let type = undefined;
|
|
11440
11444
|
[type, params] = this.handleMarketTypeAndParams('fetchLedgerEntry', undefined, params);
|
|
@@ -11462,26 +11466,26 @@ export default class binance extends Exchange {
|
|
|
11462
11466
|
const first = this.safeDict(response, 0, response);
|
|
11463
11467
|
return this.parseLedgerEntry(first, currency);
|
|
11464
11468
|
}
|
|
11469
|
+
/**
|
|
11470
|
+
* @method
|
|
11471
|
+
* @name binance#fetchLedger
|
|
11472
|
+
* @description fetch the history of changes, actions done by the user or operations that altered the balance of the user
|
|
11473
|
+
* @see https://developers.binance.com/docs/derivatives/option/account/Account-Funding-Flow
|
|
11474
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Income-History
|
|
11475
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Get-Income-History
|
|
11476
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Income-History
|
|
11477
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-CM-Income-History
|
|
11478
|
+
* @param {string} [code] unified currency code
|
|
11479
|
+
* @param {int} [since] timestamp in ms of the earliest ledger entry
|
|
11480
|
+
* @param {int} [limit] max number of ledger entries to return
|
|
11481
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
11482
|
+
* @param {int} [params.until] timestamp in ms of the latest ledger entry
|
|
11483
|
+
* @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)
|
|
11484
|
+
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch the ledger for a portfolio margin account
|
|
11485
|
+
* @param {string} [params.subType] "linear" or "inverse"
|
|
11486
|
+
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
|
|
11487
|
+
*/
|
|
11465
11488
|
async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
11466
|
-
/**
|
|
11467
|
-
* @method
|
|
11468
|
-
* @name binance#fetchLedger
|
|
11469
|
-
* @description fetch the history of changes, actions done by the user or operations that altered the balance of the user
|
|
11470
|
-
* @see https://developers.binance.com/docs/derivatives/option/account/Account-Funding-Flow
|
|
11471
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Income-History
|
|
11472
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Get-Income-History
|
|
11473
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Income-History
|
|
11474
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-CM-Income-History
|
|
11475
|
-
* @param {string} [code] unified currency code
|
|
11476
|
-
* @param {int} [since] timestamp in ms of the earliest ledger entry
|
|
11477
|
-
* @param {int} [limit] max number of ledger entries to return
|
|
11478
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
11479
|
-
* @param {int} [params.until] timestamp in ms of the latest ledger entry
|
|
11480
|
-
* @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)
|
|
11481
|
-
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch the ledger for a portfolio margin account
|
|
11482
|
-
* @param {string} [params.subType] "linear" or "inverse"
|
|
11483
|
-
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
|
|
11484
|
-
*/
|
|
11485
11489
|
await this.loadMarkets();
|
|
11486
11490
|
let paginate = false;
|
|
11487
11491
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchLedger', 'paginate');
|
|
@@ -11995,44 +11999,44 @@ export default class binance extends Exchange {
|
|
|
11995
11999
|
'datetime': this.iso8601(timestamp),
|
|
11996
12000
|
};
|
|
11997
12001
|
}
|
|
12002
|
+
/**
|
|
12003
|
+
* @method
|
|
12004
|
+
* @name binance#reduceMargin
|
|
12005
|
+
* @description remove margin from a position
|
|
12006
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Isolated-Position-Margin
|
|
12007
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Modify-Isolated-Position-Margin
|
|
12008
|
+
* @param {string} symbol unified market symbol
|
|
12009
|
+
* @param {float} amount the amount of margin to remove
|
|
12010
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
12011
|
+
* @returns {object} a [margin structure]{@link https://docs.ccxt.com/#/?id=reduce-margin-structure}
|
|
12012
|
+
*/
|
|
11998
12013
|
async reduceMargin(symbol, amount, params = {}) {
|
|
11999
|
-
/**
|
|
12000
|
-
* @method
|
|
12001
|
-
* @name binance#reduceMargin
|
|
12002
|
-
* @description remove margin from a position
|
|
12003
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Isolated-Position-Margin
|
|
12004
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Modify-Isolated-Position-Margin
|
|
12005
|
-
* @param {string} symbol unified market symbol
|
|
12006
|
-
* @param {float} amount the amount of margin to remove
|
|
12007
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
12008
|
-
* @returns {object} a [margin structure]{@link https://docs.ccxt.com/#/?id=reduce-margin-structure}
|
|
12009
|
-
*/
|
|
12010
12014
|
return await this.modifyMarginHelper(symbol, amount, 2, params);
|
|
12011
12015
|
}
|
|
12016
|
+
/**
|
|
12017
|
+
* @method
|
|
12018
|
+
* @name binance#addMargin
|
|
12019
|
+
* @description add margin
|
|
12020
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Isolated-Position-Margin
|
|
12021
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Modify-Isolated-Position-Margin
|
|
12022
|
+
* @param {string} symbol unified market symbol
|
|
12023
|
+
* @param {float} amount amount of margin to add
|
|
12024
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
12025
|
+
* @returns {object} a [margin structure]{@link https://docs.ccxt.com/#/?id=add-margin-structure}
|
|
12026
|
+
*/
|
|
12012
12027
|
async addMargin(symbol, amount, params = {}) {
|
|
12013
|
-
/**
|
|
12014
|
-
* @method
|
|
12015
|
-
* @name binance#addMargin
|
|
12016
|
-
* @description add margin
|
|
12017
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Isolated-Position-Margin
|
|
12018
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Modify-Isolated-Position-Margin
|
|
12019
|
-
* @param {string} symbol unified market symbol
|
|
12020
|
-
* @param {float} amount amount of margin to add
|
|
12021
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
12022
|
-
* @returns {object} a [margin structure]{@link https://docs.ccxt.com/#/?id=add-margin-structure}
|
|
12023
|
-
*/
|
|
12024
12028
|
return await this.modifyMarginHelper(symbol, amount, 1, params);
|
|
12025
12029
|
}
|
|
12030
|
+
/**
|
|
12031
|
+
* @method
|
|
12032
|
+
* @name binance#fetchCrossBorrowRate
|
|
12033
|
+
* @description fetch the rate of interest to borrow a currency for margin trading
|
|
12034
|
+
* @see https://developers.binance.com/docs/margin_trading/borrow-and-repay/Query-Margin-Interest-Rate-History
|
|
12035
|
+
* @param {string} code unified currency code
|
|
12036
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
12037
|
+
* @returns {object} a [borrow rate structure]{@link https://docs.ccxt.com/#/?id=borrow-rate-structure}
|
|
12038
|
+
*/
|
|
12026
12039
|
async fetchCrossBorrowRate(code, params = {}) {
|
|
12027
|
-
/**
|
|
12028
|
-
* @method
|
|
12029
|
-
* @name binance#fetchCrossBorrowRate
|
|
12030
|
-
* @description fetch the rate of interest to borrow a currency for margin trading
|
|
12031
|
-
* @see https://developers.binance.com/docs/margin_trading/borrow-and-repay/Query-Margin-Interest-Rate-History
|
|
12032
|
-
* @param {string} code unified currency code
|
|
12033
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
12034
|
-
* @returns {object} a [borrow rate structure]{@link https://docs.ccxt.com/#/?id=borrow-rate-structure}
|
|
12035
|
-
*/
|
|
12036
12040
|
await this.loadMarkets();
|
|
12037
12041
|
const currency = this.currency(code);
|
|
12038
12042
|
const request = {
|
|
@@ -12053,38 +12057,38 @@ export default class binance extends Exchange {
|
|
|
12053
12057
|
const rate = this.safeDict(response, 0);
|
|
12054
12058
|
return this.parseBorrowRate(rate);
|
|
12055
12059
|
}
|
|
12060
|
+
/**
|
|
12061
|
+
* @method
|
|
12062
|
+
* @name binance#fetchIsolatedBorrowRate
|
|
12063
|
+
* @description fetch the rate of interest to borrow a currency for margin trading
|
|
12064
|
+
* @see https://developers.binance.com/docs/margin_trading/account/Query-Isolated-Margin-Fee-Data
|
|
12065
|
+
* @param {string} symbol unified market symbol
|
|
12066
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
12067
|
+
*
|
|
12068
|
+
* EXCHANGE SPECIFIC PARAMETERS
|
|
12069
|
+
* @param {object} [params.vipLevel] user's current specific margin data will be returned if viplevel is omitted
|
|
12070
|
+
* @returns {object} an [isolated borrow rate structure]{@link https://docs.ccxt.com/#/?id=isolated-borrow-rate-structure}
|
|
12071
|
+
*/
|
|
12056
12072
|
async fetchIsolatedBorrowRate(symbol, params = {}) {
|
|
12057
|
-
/**
|
|
12058
|
-
* @method
|
|
12059
|
-
* @name binance#fetchIsolatedBorrowRate
|
|
12060
|
-
* @description fetch the rate of interest to borrow a currency for margin trading
|
|
12061
|
-
* @see https://developers.binance.com/docs/margin_trading/account/Query-Isolated-Margin-Fee-Data
|
|
12062
|
-
* @param {string} symbol unified market symbol
|
|
12063
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
12064
|
-
*
|
|
12065
|
-
* EXCHANGE SPECIFIC PARAMETERS
|
|
12066
|
-
* @param {object} [params.vipLevel] user's current specific margin data will be returned if viplevel is omitted
|
|
12067
|
-
* @returns {object} an [isolated borrow rate structure]{@link https://docs.ccxt.com/#/?id=isolated-borrow-rate-structure}
|
|
12068
|
-
*/
|
|
12069
12073
|
const request = {
|
|
12070
12074
|
'symbol': symbol,
|
|
12071
12075
|
};
|
|
12072
12076
|
const borrowRates = await this.fetchIsolatedBorrowRates(this.extend(request, params));
|
|
12073
12077
|
return this.safeDict(borrowRates, symbol);
|
|
12074
12078
|
}
|
|
12079
|
+
/**
|
|
12080
|
+
* @method
|
|
12081
|
+
* @name binance#fetchIsolatedBorrowRates
|
|
12082
|
+
* @description fetch the borrow interest rates of all currencies
|
|
12083
|
+
* @see https://developers.binance.com/docs/margin_trading/account/Query-Isolated-Margin-Fee-Data
|
|
12084
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
12085
|
+
* @param {object} [params.symbol] unified market symbol
|
|
12086
|
+
*
|
|
12087
|
+
* EXCHANGE SPECIFIC PARAMETERS
|
|
12088
|
+
* @param {object} [params.vipLevel] user's current specific margin data will be returned if viplevel is omitted
|
|
12089
|
+
* @returns {object} a [borrow rate structure]{@link https://docs.ccxt.com/#/?id=borrow-rate-structure}
|
|
12090
|
+
*/
|
|
12075
12091
|
async fetchIsolatedBorrowRates(params = {}) {
|
|
12076
|
-
/**
|
|
12077
|
-
* @method
|
|
12078
|
-
* @name binance#fetchIsolatedBorrowRates
|
|
12079
|
-
* @description fetch the borrow interest rates of all currencies
|
|
12080
|
-
* @see https://developers.binance.com/docs/margin_trading/account/Query-Isolated-Margin-Fee-Data
|
|
12081
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
12082
|
-
* @param {object} [params.symbol] unified market symbol
|
|
12083
|
-
*
|
|
12084
|
-
* EXCHANGE SPECIFIC PARAMETERS
|
|
12085
|
-
* @param {object} [params.vipLevel] user's current specific margin data will be returned if viplevel is omitted
|
|
12086
|
-
* @returns {object} a [borrow rate structure]{@link https://docs.ccxt.com/#/?id=borrow-rate-structure}
|
|
12087
|
-
*/
|
|
12088
12092
|
await this.loadMarkets();
|
|
12089
12093
|
const request = {};
|
|
12090
12094
|
const symbol = this.safeString(params, 'symbol');
|
|
@@ -12117,18 +12121,18 @@ export default class binance extends Exchange {
|
|
|
12117
12121
|
//
|
|
12118
12122
|
return this.parseIsolatedBorrowRates(response);
|
|
12119
12123
|
}
|
|
12124
|
+
/**
|
|
12125
|
+
* @method
|
|
12126
|
+
* @name binance#fetchBorrowRateHistory
|
|
12127
|
+
* @description retrieves a history of a currencies borrow interest rate at specific time slots
|
|
12128
|
+
* @see https://developers.binance.com/docs/margin_trading/borrow-and-repay/Query-Margin-Interest-Rate-History
|
|
12129
|
+
* @param {string} code unified currency code
|
|
12130
|
+
* @param {int} [since] timestamp for the earliest borrow rate
|
|
12131
|
+
* @param {int} [limit] the maximum number of [borrow rate structures]{@link https://docs.ccxt.com/#/?id=borrow-rate-structure} to retrieve
|
|
12132
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
12133
|
+
* @returns {object[]} an array of [borrow rate structures]{@link https://docs.ccxt.com/#/?id=borrow-rate-structure}
|
|
12134
|
+
*/
|
|
12120
12135
|
async fetchBorrowRateHistory(code, since = undefined, limit = undefined, params = {}) {
|
|
12121
|
-
/**
|
|
12122
|
-
* @method
|
|
12123
|
-
* @name binance#fetchBorrowRateHistory
|
|
12124
|
-
* @description retrieves a history of a currencies borrow interest rate at specific time slots
|
|
12125
|
-
* @see https://developers.binance.com/docs/margin_trading/borrow-and-repay/Query-Margin-Interest-Rate-History
|
|
12126
|
-
* @param {string} code unified currency code
|
|
12127
|
-
* @param {int} [since] timestamp for the earliest borrow rate
|
|
12128
|
-
* @param {int} [limit] the maximum number of [borrow rate structures]{@link https://docs.ccxt.com/#/?id=borrow-rate-structure} to retrieve
|
|
12129
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
12130
|
-
* @returns {object[]} an array of [borrow rate structures]{@link https://docs.ccxt.com/#/?id=borrow-rate-structure}
|
|
12131
|
-
*/
|
|
12132
12136
|
await this.loadMarkets();
|
|
12133
12137
|
if (limit === undefined) {
|
|
12134
12138
|
limit = 93;
|
|
@@ -12218,17 +12222,17 @@ export default class binance extends Exchange {
|
|
|
12218
12222
|
'datetime': undefined,
|
|
12219
12223
|
};
|
|
12220
12224
|
}
|
|
12225
|
+
/**
|
|
12226
|
+
* @method
|
|
12227
|
+
* @name binance#createGiftCode
|
|
12228
|
+
* @description create gift code
|
|
12229
|
+
* @see https://developers.binance.com/docs/gift_card/market-data/Create-a-single-token-gift-card
|
|
12230
|
+
* @param {string} code gift code
|
|
12231
|
+
* @param {float} amount amount of currency for the gift
|
|
12232
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
12233
|
+
* @returns {object} The gift code id, code, currency and amount
|
|
12234
|
+
*/
|
|
12221
12235
|
async createGiftCode(code, amount, params = {}) {
|
|
12222
|
-
/**
|
|
12223
|
-
* @method
|
|
12224
|
-
* @name binance#createGiftCode
|
|
12225
|
-
* @description create gift code
|
|
12226
|
-
* @see https://developers.binance.com/docs/gift_card/market-data/Create-a-single-token-gift-card
|
|
12227
|
-
* @param {string} code gift code
|
|
12228
|
-
* @param {float} amount amount of currency for the gift
|
|
12229
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
12230
|
-
* @returns {object} The gift code id, code, currency and amount
|
|
12231
|
-
*/
|
|
12232
12236
|
await this.loadMarkets();
|
|
12233
12237
|
const currency = this.currency(code);
|
|
12234
12238
|
// ensure you have enough token in your funding account before calling this code
|
|
@@ -12256,16 +12260,16 @@ export default class binance extends Exchange {
|
|
|
12256
12260
|
'amount': amount,
|
|
12257
12261
|
};
|
|
12258
12262
|
}
|
|
12263
|
+
/**
|
|
12264
|
+
* @method
|
|
12265
|
+
* @name binance#redeemGiftCode
|
|
12266
|
+
* @description redeem gift code
|
|
12267
|
+
* @see https://developers.binance.com/docs/gift_card/market-data/Redeem-a-Binance-Gift-Card
|
|
12268
|
+
* @param {string} giftcardCode
|
|
12269
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
12270
|
+
* @returns {object} response from the exchange
|
|
12271
|
+
*/
|
|
12259
12272
|
async redeemGiftCode(giftcardCode, params = {}) {
|
|
12260
|
-
/**
|
|
12261
|
-
* @method
|
|
12262
|
-
* @name binance#redeemGiftCode
|
|
12263
|
-
* @description redeem gift code
|
|
12264
|
-
* @see https://developers.binance.com/docs/gift_card/market-data/Redeem-a-Binance-Gift-Card
|
|
12265
|
-
* @param {string} giftcardCode
|
|
12266
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
12267
|
-
* @returns {object} response from the exchange
|
|
12268
|
-
*/
|
|
12269
12273
|
const request = {
|
|
12270
12274
|
'code': giftcardCode,
|
|
12271
12275
|
};
|
|
@@ -12283,16 +12287,16 @@ export default class binance extends Exchange {
|
|
|
12283
12287
|
//
|
|
12284
12288
|
return response;
|
|
12285
12289
|
}
|
|
12290
|
+
/**
|
|
12291
|
+
* @method
|
|
12292
|
+
* @name binance#verifyGiftCode
|
|
12293
|
+
* @description verify gift code
|
|
12294
|
+
* @see https://developers.binance.com/docs/gift_card/market-data/Verify-Binance-Gift-Card-by-Gift-Card-Number
|
|
12295
|
+
* @param {string} id reference number id
|
|
12296
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
12297
|
+
* @returns {object} response from the exchange
|
|
12298
|
+
*/
|
|
12286
12299
|
async verifyGiftCode(id, params = {}) {
|
|
12287
|
-
/**
|
|
12288
|
-
* @method
|
|
12289
|
-
* @name binance#verifyGiftCode
|
|
12290
|
-
* @description verify gift code
|
|
12291
|
-
* @see https://developers.binance.com/docs/gift_card/market-data/Verify-Binance-Gift-Card-by-Gift-Card-Number
|
|
12292
|
-
* @param {string} id reference number id
|
|
12293
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
12294
|
-
* @returns {object} response from the exchange
|
|
12295
|
-
*/
|
|
12296
12300
|
const request = {
|
|
12297
12301
|
'referenceNo': id,
|
|
12298
12302
|
};
|
|
@@ -12307,21 +12311,21 @@ export default class binance extends Exchange {
|
|
|
12307
12311
|
//
|
|
12308
12312
|
return response;
|
|
12309
12313
|
}
|
|
12314
|
+
/**
|
|
12315
|
+
* @method
|
|
12316
|
+
* @name binance#fetchBorrowInterest
|
|
12317
|
+
* @description fetch the interest owed by the user for borrowing currency for margin trading
|
|
12318
|
+
* @see https://developers.binance.com/docs/margin_trading/borrow-and-repay/Get-Interest-History
|
|
12319
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-Margin-BorrowLoan-Interest-History
|
|
12320
|
+
* @param {string} [code] unified currency code
|
|
12321
|
+
* @param {string} [symbol] unified market symbol when fetch interest in isolated markets
|
|
12322
|
+
* @param {int} [since] the earliest time in ms to fetch borrrow interest for
|
|
12323
|
+
* @param {int} [limit] the maximum number of structures to retrieve
|
|
12324
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
12325
|
+
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch the borrow interest in a portfolio margin account
|
|
12326
|
+
* @returns {object[]} a list of [borrow interest structures]{@link https://docs.ccxt.com/#/?id=borrow-interest-structure}
|
|
12327
|
+
*/
|
|
12310
12328
|
async fetchBorrowInterest(code = undefined, symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
12311
|
-
/**
|
|
12312
|
-
* @method
|
|
12313
|
-
* @name binance#fetchBorrowInterest
|
|
12314
|
-
* @description fetch the interest owed by the user for borrowing currency for margin trading
|
|
12315
|
-
* @see https://developers.binance.com/docs/margin_trading/borrow-and-repay/Get-Interest-History
|
|
12316
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-Margin-BorrowLoan-Interest-History
|
|
12317
|
-
* @param {string} [code] unified currency code
|
|
12318
|
-
* @param {string} [symbol] unified market symbol when fetch interest in isolated markets
|
|
12319
|
-
* @param {int} [since] the earliest time in ms to fetch borrrow interest for
|
|
12320
|
-
* @param {int} [limit] the maximum number of structures to retrieve
|
|
12321
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
12322
|
-
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch the borrow interest in a portfolio margin account
|
|
12323
|
-
* @returns {object[]} a list of [borrow interest structures]{@link https://docs.ccxt.com/#/?id=borrow-interest-structure}
|
|
12324
|
-
*/
|
|
12325
12329
|
await this.loadMarkets();
|
|
12326
12330
|
let isPortfolioMargin = undefined;
|
|
12327
12331
|
[isPortfolioMargin, params] = this.handleOptionAndParams2(params, 'fetchBorrowInterest', 'papi', 'portfolioMargin', false);
|
|
@@ -12405,22 +12409,22 @@ export default class binance extends Exchange {
|
|
|
12405
12409
|
'datetime': this.iso8601(timestamp),
|
|
12406
12410
|
};
|
|
12407
12411
|
}
|
|
12412
|
+
/**
|
|
12413
|
+
* @method
|
|
12414
|
+
* @name binance#repayCrossMargin
|
|
12415
|
+
* @description repay borrowed margin and interest
|
|
12416
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-Repay
|
|
12417
|
+
* @see https://developers.binance.com/docs/margin_trading/borrow-and-repay/Margin-Account-Borrow-Repay
|
|
12418
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-Repay-Debt
|
|
12419
|
+
* @param {string} code unified currency code of the currency to repay
|
|
12420
|
+
* @param {float} amount the amount to repay
|
|
12421
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
12422
|
+
* @param {boolean} [params.portfolioMargin] set to true if you would like to repay margin in a portfolio margin account
|
|
12423
|
+
* @param {string} [params.repayCrossMarginMethod] *portfolio margin only* 'papiPostRepayLoan' (default), 'papiPostMarginRepayDebt' (alternative)
|
|
12424
|
+
* @param {string} [params.specifyRepayAssets] *portfolio margin papiPostMarginRepayDebt only* specific asset list to repay debt
|
|
12425
|
+
* @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
|
|
12426
|
+
*/
|
|
12408
12427
|
async repayCrossMargin(code, amount, params = {}) {
|
|
12409
|
-
/**
|
|
12410
|
-
* @method
|
|
12411
|
-
* @name binance#repayCrossMargin
|
|
12412
|
-
* @description repay borrowed margin and interest
|
|
12413
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-Repay
|
|
12414
|
-
* @see https://developers.binance.com/docs/margin_trading/borrow-and-repay/Margin-Account-Borrow-Repay
|
|
12415
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-Repay-Debt
|
|
12416
|
-
* @param {string} code unified currency code of the currency to repay
|
|
12417
|
-
* @param {float} amount the amount to repay
|
|
12418
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
12419
|
-
* @param {boolean} [params.portfolioMargin] set to true if you would like to repay margin in a portfolio margin account
|
|
12420
|
-
* @param {string} [params.repayCrossMarginMethod] *portfolio margin only* 'papiPostRepayLoan' (default), 'papiPostMarginRepayDebt' (alternative)
|
|
12421
|
-
* @param {string} [params.specifyRepayAssets] *portfolio margin papiPostMarginRepayDebt only* specific asset list to repay debt
|
|
12422
|
-
* @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
|
|
12423
|
-
*/
|
|
12424
12428
|
await this.loadMarkets();
|
|
12425
12429
|
const currency = this.currency(code);
|
|
12426
12430
|
const request = {
|
|
@@ -12468,18 +12472,18 @@ export default class binance extends Exchange {
|
|
|
12468
12472
|
}
|
|
12469
12473
|
return this.parseMarginLoan(response, currency);
|
|
12470
12474
|
}
|
|
12475
|
+
/**
|
|
12476
|
+
* @method
|
|
12477
|
+
* @name binance#repayIsolatedMargin
|
|
12478
|
+
* @description repay borrowed margin and interest
|
|
12479
|
+
* @see https://developers.binance.com/docs/margin_trading/borrow-and-repay/Margin-Account-Borrow-Repay
|
|
12480
|
+
* @param {string} symbol unified market symbol, required for isolated margin
|
|
12481
|
+
* @param {string} code unified currency code of the currency to repay
|
|
12482
|
+
* @param {float} amount the amount to repay
|
|
12483
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
12484
|
+
* @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
|
|
12485
|
+
*/
|
|
12471
12486
|
async repayIsolatedMargin(symbol, code, amount, params = {}) {
|
|
12472
|
-
/**
|
|
12473
|
-
* @method
|
|
12474
|
-
* @name binance#repayIsolatedMargin
|
|
12475
|
-
* @description repay borrowed margin and interest
|
|
12476
|
-
* @see https://developers.binance.com/docs/margin_trading/borrow-and-repay/Margin-Account-Borrow-Repay
|
|
12477
|
-
* @param {string} symbol unified market symbol, required for isolated margin
|
|
12478
|
-
* @param {string} code unified currency code of the currency to repay
|
|
12479
|
-
* @param {float} amount the amount to repay
|
|
12480
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
12481
|
-
* @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
|
|
12482
|
-
*/
|
|
12483
12487
|
await this.loadMarkets();
|
|
12484
12488
|
const currency = this.currency(code);
|
|
12485
12489
|
const market = this.market(symbol);
|
|
@@ -12499,19 +12503,19 @@ export default class binance extends Exchange {
|
|
|
12499
12503
|
//
|
|
12500
12504
|
return this.parseMarginLoan(response, currency);
|
|
12501
12505
|
}
|
|
12506
|
+
/**
|
|
12507
|
+
* @method
|
|
12508
|
+
* @name binance#borrowCrossMargin
|
|
12509
|
+
* @description create a loan to borrow margin
|
|
12510
|
+
* @see https://developers.binance.com/docs/margin_trading/borrow-and-repay/Margin-Account-Borrow-Repay
|
|
12511
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-Borrow
|
|
12512
|
+
* @param {string} code unified currency code of the currency to borrow
|
|
12513
|
+
* @param {float} amount the amount to borrow
|
|
12514
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
12515
|
+
* @param {boolean} [params.portfolioMargin] set to true if you would like to borrow margin in a portfolio margin account
|
|
12516
|
+
* @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
|
|
12517
|
+
*/
|
|
12502
12518
|
async borrowCrossMargin(code, amount, params = {}) {
|
|
12503
|
-
/**
|
|
12504
|
-
* @method
|
|
12505
|
-
* @name binance#borrowCrossMargin
|
|
12506
|
-
* @description create a loan to borrow margin
|
|
12507
|
-
* @see https://developers.binance.com/docs/margin_trading/borrow-and-repay/Margin-Account-Borrow-Repay
|
|
12508
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-Borrow
|
|
12509
|
-
* @param {string} code unified currency code of the currency to borrow
|
|
12510
|
-
* @param {float} amount the amount to borrow
|
|
12511
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
12512
|
-
* @param {boolean} [params.portfolioMargin] set to true if you would like to borrow margin in a portfolio margin account
|
|
12513
|
-
* @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
|
|
12514
|
-
*/
|
|
12515
12519
|
await this.loadMarkets();
|
|
12516
12520
|
const currency = this.currency(code);
|
|
12517
12521
|
const request = {
|
|
@@ -12537,18 +12541,18 @@ export default class binance extends Exchange {
|
|
|
12537
12541
|
//
|
|
12538
12542
|
return this.parseMarginLoan(response, currency);
|
|
12539
12543
|
}
|
|
12544
|
+
/**
|
|
12545
|
+
* @method
|
|
12546
|
+
* @name binance#borrowIsolatedMargin
|
|
12547
|
+
* @description create a loan to borrow margin
|
|
12548
|
+
* @see https://developers.binance.com/docs/margin_trading/borrow-and-repay/Margin-Account-Borrow-Repay
|
|
12549
|
+
* @param {string} symbol unified market symbol, required for isolated margin
|
|
12550
|
+
* @param {string} code unified currency code of the currency to borrow
|
|
12551
|
+
* @param {float} amount the amount to borrow
|
|
12552
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
12553
|
+
* @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
|
|
12554
|
+
*/
|
|
12540
12555
|
async borrowIsolatedMargin(symbol, code, amount, params = {}) {
|
|
12541
|
-
/**
|
|
12542
|
-
* @method
|
|
12543
|
-
* @name binance#borrowIsolatedMargin
|
|
12544
|
-
* @description create a loan to borrow margin
|
|
12545
|
-
* @see https://developers.binance.com/docs/margin_trading/borrow-and-repay/Margin-Account-Borrow-Repay
|
|
12546
|
-
* @param {string} symbol unified market symbol, required for isolated margin
|
|
12547
|
-
* @param {string} code unified currency code of the currency to borrow
|
|
12548
|
-
* @param {float} amount the amount to borrow
|
|
12549
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
12550
|
-
* @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
|
|
12551
|
-
*/
|
|
12552
12556
|
await this.loadMarkets();
|
|
12553
12557
|
const currency = this.currency(code);
|
|
12554
12558
|
const market = this.market(symbol);
|
|
@@ -12597,22 +12601,22 @@ export default class binance extends Exchange {
|
|
|
12597
12601
|
'info': info,
|
|
12598
12602
|
};
|
|
12599
12603
|
}
|
|
12604
|
+
/**
|
|
12605
|
+
* @method
|
|
12606
|
+
* @name binance#fetchOpenInterestHistory
|
|
12607
|
+
* @description Retrieves the open interest history of a currency
|
|
12608
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Open-Interest-Statistics
|
|
12609
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Open-Interest-Statistics
|
|
12610
|
+
* @param {string} symbol Unified CCXT market symbol
|
|
12611
|
+
* @param {string} timeframe "5m","15m","30m","1h","2h","4h","6h","12h", or "1d"
|
|
12612
|
+
* @param {int} [since] the time(ms) of the earliest record to retrieve as a unix timestamp
|
|
12613
|
+
* @param {int} [limit] default 30, max 500
|
|
12614
|
+
* @param {object} [params] exchange specific parameters
|
|
12615
|
+
* @param {int} [params.until] the time(ms) of the latest record to retrieve as a unix timestamp
|
|
12616
|
+
* @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)
|
|
12617
|
+
* @returns {object} an array of [open interest structure]{@link https://docs.ccxt.com/#/?id=open-interest-structure}
|
|
12618
|
+
*/
|
|
12600
12619
|
async fetchOpenInterestHistory(symbol, timeframe = '5m', since = undefined, limit = undefined, params = {}) {
|
|
12601
|
-
/**
|
|
12602
|
-
* @method
|
|
12603
|
-
* @name binance#fetchOpenInterestHistory
|
|
12604
|
-
* @description Retrieves the open interest history of a currency
|
|
12605
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Open-Interest-Statistics
|
|
12606
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Open-Interest-Statistics
|
|
12607
|
-
* @param {string} symbol Unified CCXT market symbol
|
|
12608
|
-
* @param {string} timeframe "5m","15m","30m","1h","2h","4h","6h","12h", or "1d"
|
|
12609
|
-
* @param {int} [since] the time(ms) of the earliest record to retrieve as a unix timestamp
|
|
12610
|
-
* @param {int} [limit] default 30, max 500
|
|
12611
|
-
* @param {object} [params] exchange specific parameters
|
|
12612
|
-
* @param {int} [params.until] the time(ms) of the latest record to retrieve as a unix timestamp
|
|
12613
|
-
* @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)
|
|
12614
|
-
* @returns {object} an array of [open interest structure]{@link https://docs.ccxt.com/#/?id=open-interest-structure}
|
|
12615
|
-
*/
|
|
12616
12620
|
if (timeframe === '1m') {
|
|
12617
12621
|
throw new BadRequest(this.id + 'fetchOpenInterestHistory cannot use the 1m timeframe');
|
|
12618
12622
|
}
|
|
@@ -12670,18 +12674,18 @@ export default class binance extends Exchange {
|
|
|
12670
12674
|
//
|
|
12671
12675
|
return this.parseOpenInterests(response, market, since, limit);
|
|
12672
12676
|
}
|
|
12677
|
+
/**
|
|
12678
|
+
* @method
|
|
12679
|
+
* @name binance#fetchOpenInterest
|
|
12680
|
+
* @description retrieves the open interest of a contract trading pair
|
|
12681
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Open-Interest
|
|
12682
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Open-Interest
|
|
12683
|
+
* @see https://developers.binance.com/docs/derivatives/option/market-data/Open-Interest
|
|
12684
|
+
* @param {string} symbol unified CCXT market symbol
|
|
12685
|
+
* @param {object} [params] exchange specific parameters
|
|
12686
|
+
* @returns {object} an open interest structure{@link https://docs.ccxt.com/#/?id=open-interest-structure}
|
|
12687
|
+
*/
|
|
12673
12688
|
async fetchOpenInterest(symbol, params = {}) {
|
|
12674
|
-
/**
|
|
12675
|
-
* @method
|
|
12676
|
-
* @name binance#fetchOpenInterest
|
|
12677
|
-
* @description retrieves the open interest of a contract trading pair
|
|
12678
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Open-Interest
|
|
12679
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Open-Interest
|
|
12680
|
-
* @see https://developers.binance.com/docs/derivatives/option/market-data/Open-Interest
|
|
12681
|
-
* @param {string} symbol unified CCXT market symbol
|
|
12682
|
-
* @param {object} [params] exchange specific parameters
|
|
12683
|
-
* @returns {object} an open interest structure{@link https://docs.ccxt.com/#/?id=open-interest-structure}
|
|
12684
|
-
*/
|
|
12685
12689
|
await this.loadMarkets();
|
|
12686
12690
|
const market = this.market(symbol);
|
|
12687
12691
|
const request = {};
|
|
@@ -12768,27 +12772,27 @@ export default class binance extends Exchange {
|
|
|
12768
12772
|
'info': interest,
|
|
12769
12773
|
}, market);
|
|
12770
12774
|
}
|
|
12775
|
+
/**
|
|
12776
|
+
* @method
|
|
12777
|
+
* @name binance#fetchMyLiquidations
|
|
12778
|
+
* @description retrieves the users liquidated positions
|
|
12779
|
+
* @see https://developers.binance.com/docs/margin_trading/trade/Get-Force-Liquidation-Record
|
|
12780
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Users-Force-Orders
|
|
12781
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Users-Force-Orders
|
|
12782
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Users-UM-Force-Orders
|
|
12783
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Users-CM-Force-Orders
|
|
12784
|
+
* @param {string} [symbol] unified CCXT market symbol
|
|
12785
|
+
* @param {int} [since] the earliest time in ms to fetch liquidations for
|
|
12786
|
+
* @param {int} [limit] the maximum number of liquidation structures to retrieve
|
|
12787
|
+
* @param {object} [params] exchange specific parameters for the binance api endpoint
|
|
12788
|
+
* @param {int} [params.until] timestamp in ms of the latest liquidation
|
|
12789
|
+
* @param {boolean} [params.paginate] *spot only* 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)
|
|
12790
|
+
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch liquidations in a portfolio margin account
|
|
12791
|
+
* @param {string} [params.type] "spot"
|
|
12792
|
+
* @param {string} [params.subType] "linear" or "inverse"
|
|
12793
|
+
* @returns {object} an array of [liquidation structures]{@link https://docs.ccxt.com/#/?id=liquidation-structure}
|
|
12794
|
+
*/
|
|
12771
12795
|
async fetchMyLiquidations(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
12772
|
-
/**
|
|
12773
|
-
* @method
|
|
12774
|
-
* @name binance#fetchMyLiquidations
|
|
12775
|
-
* @description retrieves the users liquidated positions
|
|
12776
|
-
* @see https://developers.binance.com/docs/margin_trading/trade/Get-Force-Liquidation-Record
|
|
12777
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Users-Force-Orders
|
|
12778
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Users-Force-Orders
|
|
12779
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Users-UM-Force-Orders
|
|
12780
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Users-CM-Force-Orders
|
|
12781
|
-
* @param {string} [symbol] unified CCXT market symbol
|
|
12782
|
-
* @param {int} [since] the earliest time in ms to fetch liquidations for
|
|
12783
|
-
* @param {int} [limit] the maximum number of liquidation structures to retrieve
|
|
12784
|
-
* @param {object} [params] exchange specific parameters for the binance api endpoint
|
|
12785
|
-
* @param {int} [params.until] timestamp in ms of the latest liquidation
|
|
12786
|
-
* @param {boolean} [params.paginate] *spot only* 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)
|
|
12787
|
-
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch liquidations in a portfolio margin account
|
|
12788
|
-
* @param {string} [params.type] "spot"
|
|
12789
|
-
* @param {string} [params.subType] "linear" or "inverse"
|
|
12790
|
-
* @returns {object} an array of [liquidation structures]{@link https://docs.ccxt.com/#/?id=liquidation-structure}
|
|
12791
|
-
*/
|
|
12792
12796
|
await this.loadMarkets();
|
|
12793
12797
|
let paginate = false;
|
|
12794
12798
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchMyLiquidations', 'paginate');
|
|
@@ -13018,16 +13022,16 @@ export default class binance extends Exchange {
|
|
|
13018
13022
|
'datetime': this.iso8601(timestamp),
|
|
13019
13023
|
});
|
|
13020
13024
|
}
|
|
13025
|
+
/**
|
|
13026
|
+
* @method
|
|
13027
|
+
* @name binance#fetchGreeks
|
|
13028
|
+
* @description fetches an option contracts greeks, financial metrics used to measure the factors that affect the price of an options contract
|
|
13029
|
+
* @see https://developers.binance.com/docs/derivatives/option/market-data/Option-Mark-Price
|
|
13030
|
+
* @param {string} symbol unified symbol of the market to fetch greeks for
|
|
13031
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
13032
|
+
* @returns {object} a [greeks structure]{@link https://docs.ccxt.com/#/?id=greeks-structure}
|
|
13033
|
+
*/
|
|
13021
13034
|
async fetchGreeks(symbol, params = {}) {
|
|
13022
|
-
/**
|
|
13023
|
-
* @method
|
|
13024
|
-
* @name binance#fetchGreeks
|
|
13025
|
-
* @description fetches an option contracts greeks, financial metrics used to measure the factors that affect the price of an options contract
|
|
13026
|
-
* @see https://developers.binance.com/docs/derivatives/option/market-data/Option-Mark-Price
|
|
13027
|
-
* @param {string} symbol unified symbol of the market to fetch greeks for
|
|
13028
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
13029
|
-
* @returns {object} a [greeks structure]{@link https://docs.ccxt.com/#/?id=greeks-structure}
|
|
13030
|
-
*/
|
|
13031
13035
|
await this.loadMarkets();
|
|
13032
13036
|
const market = this.market(symbol);
|
|
13033
13037
|
const request = {
|
|
@@ -13106,18 +13110,18 @@ export default class binance extends Exchange {
|
|
|
13106
13110
|
}
|
|
13107
13111
|
return tradingLimits;
|
|
13108
13112
|
}
|
|
13113
|
+
/**
|
|
13114
|
+
* @method
|
|
13115
|
+
* @name binance#fetchPositionMode
|
|
13116
|
+
* @description fetchs the position mode, hedged or one way, hedged for binance is set identically for all linear markets or all inverse markets
|
|
13117
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Current-Position-Mode
|
|
13118
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Get-Current-Position-Mode
|
|
13119
|
+
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
13120
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
13121
|
+
* @param {string} [params.subType] "linear" or "inverse"
|
|
13122
|
+
* @returns {object} an object detailing whether the market is in hedged or one-way mode
|
|
13123
|
+
*/
|
|
13109
13124
|
async fetchPositionMode(symbol = undefined, params = {}) {
|
|
13110
|
-
/**
|
|
13111
|
-
* @method
|
|
13112
|
-
* @name binance#fetchPositionMode
|
|
13113
|
-
* @description fetchs the position mode, hedged or one way, hedged for binance is set identically for all linear markets or all inverse markets
|
|
13114
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Current-Position-Mode
|
|
13115
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Get-Current-Position-Mode
|
|
13116
|
-
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
13117
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
13118
|
-
* @param {string} [params.subType] "linear" or "inverse"
|
|
13119
|
-
* @returns {object} an object detailing whether the market is in hedged or one-way mode
|
|
13120
|
-
*/
|
|
13121
13125
|
let market = undefined;
|
|
13122
13126
|
if (symbol !== undefined) {
|
|
13123
13127
|
market = this.market(symbol);
|
|
@@ -13145,19 +13149,19 @@ export default class binance extends Exchange {
|
|
|
13145
13149
|
'hedged': dualSidePosition,
|
|
13146
13150
|
};
|
|
13147
13151
|
}
|
|
13152
|
+
/**
|
|
13153
|
+
* @method
|
|
13154
|
+
* @name binance#fetchMarginModes
|
|
13155
|
+
* @description fetches margin modes ("isolated" or "cross") that the market for the symbol in in, with symbol=undefined all markets for a subType (linear/inverse) are returned
|
|
13156
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Account-Information
|
|
13157
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Information-V2
|
|
13158
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Symbol-Config
|
|
13159
|
+
* @param {string[]} symbols unified market symbols
|
|
13160
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
13161
|
+
* @param {string} [params.subType] "linear" or "inverse"
|
|
13162
|
+
* @returns {object} a list of [margin mode structures]{@link https://docs.ccxt.com/#/?id=margin-mode-structure}
|
|
13163
|
+
*/
|
|
13148
13164
|
async fetchMarginModes(symbols = undefined, params = {}) {
|
|
13149
|
-
/**
|
|
13150
|
-
* @method
|
|
13151
|
-
* @name binance#fetchMarginModes
|
|
13152
|
-
* @description fetches margin modes ("isolated" or "cross") that the market for the symbol in in, with symbol=undefined all markets for a subType (linear/inverse) are returned
|
|
13153
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Account-Information
|
|
13154
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Information-V2
|
|
13155
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Symbol-Config
|
|
13156
|
-
* @param {string} symbol unified symbol of the market the order was made in
|
|
13157
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
13158
|
-
* @param {string} [params.subType] "linear" or "inverse"
|
|
13159
|
-
* @returns {object} a list of [margin mode structures]{@link https://docs.ccxt.com/#/?id=margin-mode-structure}
|
|
13160
|
-
*/
|
|
13161
13165
|
await this.loadMarkets();
|
|
13162
13166
|
let market = undefined;
|
|
13163
13167
|
if (symbols !== undefined) {
|
|
@@ -13241,6 +13245,49 @@ export default class binance extends Exchange {
|
|
|
13241
13245
|
}
|
|
13242
13246
|
return this.parseMarginModes(assets, symbols, 'symbol', 'swap');
|
|
13243
13247
|
}
|
|
13248
|
+
/**
|
|
13249
|
+
* @method
|
|
13250
|
+
* @name binance#fetchMarginMode
|
|
13251
|
+
* @description fetches the margin mode of a specific symbol
|
|
13252
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Symbol-Config
|
|
13253
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Account-Information
|
|
13254
|
+
* @param {string} symbol unified symbol of the market the order was made in
|
|
13255
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
13256
|
+
* @param {string} [params.subType] "linear" or "inverse"
|
|
13257
|
+
* @returns {object} a [margin mode structure]{@link https://docs.ccxt.com/#/?id=margin-mode-structure}
|
|
13258
|
+
*/
|
|
13259
|
+
async fetchMarginMode(symbol, params = {}) {
|
|
13260
|
+
await this.loadMarkets();
|
|
13261
|
+
const market = this.market(symbol);
|
|
13262
|
+
let subType = undefined;
|
|
13263
|
+
[subType, params] = this.handleSubTypeAndParams('fetchMarginMode', market, params);
|
|
13264
|
+
let response = undefined;
|
|
13265
|
+
if (subType === 'linear') {
|
|
13266
|
+
const request = {
|
|
13267
|
+
'symbol': market['id'],
|
|
13268
|
+
};
|
|
13269
|
+
response = await this.fapiPrivateGetSymbolConfig(this.extend(request, params));
|
|
13270
|
+
//
|
|
13271
|
+
// [
|
|
13272
|
+
// {
|
|
13273
|
+
// "symbol": "BTCUSDT",
|
|
13274
|
+
// "marginType": "CROSSED",
|
|
13275
|
+
// "isAutoAddMargin": "false",
|
|
13276
|
+
// "leverage": 21,
|
|
13277
|
+
// "maxNotionalValue": "1000000",
|
|
13278
|
+
// }
|
|
13279
|
+
// ]
|
|
13280
|
+
//
|
|
13281
|
+
}
|
|
13282
|
+
else if (subType === 'inverse') {
|
|
13283
|
+
const fetchMarginModesResponse = await this.fetchMarginModes([symbol], params);
|
|
13284
|
+
return fetchMarginModesResponse[symbol];
|
|
13285
|
+
}
|
|
13286
|
+
else {
|
|
13287
|
+
throw new BadRequest(this.id + ' fetchMarginMode () supports linear and inverse subTypes only');
|
|
13288
|
+
}
|
|
13289
|
+
return this.parseMarginMode(response[0], market);
|
|
13290
|
+
}
|
|
13244
13291
|
parseMarginMode(marginMode, market = undefined) {
|
|
13245
13292
|
const marketId = this.safeString(marginMode, 'symbol');
|
|
13246
13293
|
market = this.safeMarket(marketId, market);
|
|
@@ -13259,16 +13306,16 @@ export default class binance extends Exchange {
|
|
|
13259
13306
|
'marginMode': reMarginMode,
|
|
13260
13307
|
};
|
|
13261
13308
|
}
|
|
13309
|
+
/**
|
|
13310
|
+
* @method
|
|
13311
|
+
* @name binance#fetchOption
|
|
13312
|
+
* @description fetches option data that is commonly found in an option chain
|
|
13313
|
+
* @see https://developers.binance.com/docs/derivatives/option/market-data/24hr-Ticker-Price-Change-Statistics
|
|
13314
|
+
* @param {string} symbol unified market symbol
|
|
13315
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
13316
|
+
* @returns {object} an [option chain structure]{@link https://docs.ccxt.com/#/?id=option-chain-structure}
|
|
13317
|
+
*/
|
|
13262
13318
|
async fetchOption(symbol, params = {}) {
|
|
13263
|
-
/**
|
|
13264
|
-
* @method
|
|
13265
|
-
* @name binance#fetchOption
|
|
13266
|
-
* @description fetches option data that is commonly found in an option chain
|
|
13267
|
-
* @see https://developers.binance.com/docs/derivatives/option/market-data/24hr-Ticker-Price-Change-Statistics
|
|
13268
|
-
* @param {string} symbol unified market symbol
|
|
13269
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
13270
|
-
* @returns {object} an [option chain structure]{@link https://docs.ccxt.com/#/?id=option-chain-structure}
|
|
13271
|
-
*/
|
|
13272
13319
|
await this.loadMarkets();
|
|
13273
13320
|
const market = this.market(symbol);
|
|
13274
13321
|
const request = {
|
|
@@ -13347,20 +13394,21 @@ export default class binance extends Exchange {
|
|
|
13347
13394
|
'quoteVolume': undefined,
|
|
13348
13395
|
};
|
|
13349
13396
|
}
|
|
13397
|
+
/**
|
|
13398
|
+
* @method
|
|
13399
|
+
* @name binance#fetchMarginAdjustmentHistory
|
|
13400
|
+
* @description fetches the history of margin added or reduced from contract isolated positions
|
|
13401
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Get-Position-Margin-Change-History
|
|
13402
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Get-Position-Margin-Change-History
|
|
13403
|
+
* @param {string} symbol unified market symbol
|
|
13404
|
+
* @param {string} [type] "add" or "reduce"
|
|
13405
|
+
* @param {int} [since] timestamp in ms of the earliest change to fetch
|
|
13406
|
+
* @param {int} [limit] the maximum amount of changes to fetch
|
|
13407
|
+
* @param {object} params extra parameters specific to the exchange api endpoint
|
|
13408
|
+
* @param {int} [params.until] timestamp in ms of the latest change to fetch
|
|
13409
|
+
* @returns {object[]} a list of [margin structures]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
|
|
13410
|
+
*/
|
|
13350
13411
|
async fetchMarginAdjustmentHistory(symbol = undefined, type = undefined, since = undefined, limit = undefined, params = {}) {
|
|
13351
|
-
/**
|
|
13352
|
-
* @method
|
|
13353
|
-
* @description fetches the history of margin added or reduced from contract isolated positions
|
|
13354
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Get-Position-Margin-Change-History
|
|
13355
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Get-Position-Margin-Change-History
|
|
13356
|
-
* @param {string} symbol unified market symbol
|
|
13357
|
-
* @param {string} [type] "add" or "reduce"
|
|
13358
|
-
* @param {int} [since] timestamp in ms of the earliest change to fetch
|
|
13359
|
-
* @param {int} [limit] the maximum amount of changes to fetch
|
|
13360
|
-
* @param {object} params extra parameters specific to the exchange api endpoint
|
|
13361
|
-
* @param {int} [params.until] timestamp in ms of the latest change to fetch
|
|
13362
|
-
* @returns {object[]} a list of [margin structures]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
|
|
13363
|
-
*/
|
|
13364
13412
|
await this.loadMarkets();
|
|
13365
13413
|
if (symbol === undefined) {
|
|
13366
13414
|
throw new ArgumentsRequired(this.id + ' fetchMarginAdjustmentHistory () requires a symbol argument');
|
|
@@ -13411,15 +13459,15 @@ export default class binance extends Exchange {
|
|
|
13411
13459
|
const modifications = this.parseMarginModifications(response);
|
|
13412
13460
|
return this.filterBySymbolSinceLimit(modifications, symbol, since, limit);
|
|
13413
13461
|
}
|
|
13462
|
+
/**
|
|
13463
|
+
* @method
|
|
13464
|
+
* @name binance#fetchConvertCurrencies
|
|
13465
|
+
* @description fetches all available currencies that can be converted
|
|
13466
|
+
* @see https://developers.binance.com/docs/convert/market-data/Query-order-quantity-precision-per-asset
|
|
13467
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
13468
|
+
* @returns {object} an associative dictionary of currencies
|
|
13469
|
+
*/
|
|
13414
13470
|
async fetchConvertCurrencies(params = {}) {
|
|
13415
|
-
/**
|
|
13416
|
-
* @method
|
|
13417
|
-
* @name binance#fetchConvertCurrencies
|
|
13418
|
-
* @description fetches all available currencies that can be converted
|
|
13419
|
-
* @see https://developers.binance.com/docs/convert/market-data/Query-order-quantity-precision-per-asset
|
|
13420
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
13421
|
-
* @returns {object} an associative dictionary of currencies
|
|
13422
|
-
*/
|
|
13423
13471
|
await this.loadMarkets();
|
|
13424
13472
|
const response = await this.sapiGetConvertAssetInfo(params);
|
|
13425
13473
|
//
|
|
@@ -13466,19 +13514,19 @@ export default class binance extends Exchange {
|
|
|
13466
13514
|
}
|
|
13467
13515
|
return result;
|
|
13468
13516
|
}
|
|
13517
|
+
/**
|
|
13518
|
+
* @method
|
|
13519
|
+
* @name binance#fetchConvertQuote
|
|
13520
|
+
* @description fetch a quote for converting from one currency to another
|
|
13521
|
+
* @see https://developers.binance.com/docs/convert/trade/Send-quote-request
|
|
13522
|
+
* @param {string} fromCode the currency that you want to sell and convert from
|
|
13523
|
+
* @param {string} toCode the currency that you want to buy and convert into
|
|
13524
|
+
* @param {float} amount how much you want to trade in units of the from currency
|
|
13525
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
13526
|
+
* @param {string} [params.walletType] either 'SPOT' or 'FUNDING', the default is 'SPOT'
|
|
13527
|
+
* @returns {object} a [conversion structure]{@link https://docs.ccxt.com/#/?id=conversion-structure}
|
|
13528
|
+
*/
|
|
13469
13529
|
async fetchConvertQuote(fromCode, toCode, amount = undefined, params = {}) {
|
|
13470
|
-
/**
|
|
13471
|
-
* @method
|
|
13472
|
-
* @name binance#fetchConvertQuote
|
|
13473
|
-
* @description fetch a quote for converting from one currency to another
|
|
13474
|
-
* @see https://developers.binance.com/docs/convert/trade/Send-quote-request
|
|
13475
|
-
* @param {string} fromCode the currency that you want to sell and convert from
|
|
13476
|
-
* @param {string} toCode the currency that you want to buy and convert into
|
|
13477
|
-
* @param {float} amount how much you want to trade in units of the from currency
|
|
13478
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
13479
|
-
* @param {string} [params.walletType] either 'SPOT' or 'FUNDING', the default is 'SPOT'
|
|
13480
|
-
* @returns {object} a [conversion structure]{@link https://docs.ccxt.com/#/?id=conversion-structure}
|
|
13481
|
-
*/
|
|
13482
13530
|
if (amount === undefined) {
|
|
13483
13531
|
throw new ArgumentsRequired(this.id + ' fetchConvertQuote() requires an amount argument');
|
|
13484
13532
|
}
|
|
@@ -13503,19 +13551,19 @@ export default class binance extends Exchange {
|
|
|
13503
13551
|
const toCurrency = this.currency(toCode);
|
|
13504
13552
|
return this.parseConversion(response, fromCurrency, toCurrency);
|
|
13505
13553
|
}
|
|
13554
|
+
/**
|
|
13555
|
+
* @method
|
|
13556
|
+
* @name binance#createConvertTrade
|
|
13557
|
+
* @description convert from one currency to another
|
|
13558
|
+
* @see https://developers.binance.com/docs/convert/trade/Accept-Quote
|
|
13559
|
+
* @param {string} id the id of the trade that you want to make
|
|
13560
|
+
* @param {string} fromCode the currency that you want to sell and convert from
|
|
13561
|
+
* @param {string} toCode the currency that you want to buy and convert into
|
|
13562
|
+
* @param {float} [amount] how much you want to trade in units of the from currency
|
|
13563
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
13564
|
+
* @returns {object} a [conversion structure]{@link https://docs.ccxt.com/#/?id=conversion-structure}
|
|
13565
|
+
*/
|
|
13506
13566
|
async createConvertTrade(id, fromCode, toCode, amount = undefined, params = {}) {
|
|
13507
|
-
/**
|
|
13508
|
-
* @method
|
|
13509
|
-
* @name binance#createConvertTrade
|
|
13510
|
-
* @description convert from one currency to another
|
|
13511
|
-
* @see https://developers.binance.com/docs/convert/trade/Accept-Quote
|
|
13512
|
-
* @param {string} id the id of the trade that you want to make
|
|
13513
|
-
* @param {string} fromCode the currency that you want to sell and convert from
|
|
13514
|
-
* @param {string} toCode the currency that you want to buy and convert into
|
|
13515
|
-
* @param {float} [amount] how much you want to trade in units of the from currency
|
|
13516
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
13517
|
-
* @returns {object} a [conversion structure]{@link https://docs.ccxt.com/#/?id=conversion-structure}
|
|
13518
|
-
*/
|
|
13519
13567
|
await this.loadMarkets();
|
|
13520
13568
|
const request = {};
|
|
13521
13569
|
let response = undefined;
|
|
@@ -13550,17 +13598,17 @@ export default class binance extends Exchange {
|
|
|
13550
13598
|
const toCurrency = this.currency(toCode);
|
|
13551
13599
|
return this.parseConversion(response, fromCurrency, toCurrency);
|
|
13552
13600
|
}
|
|
13601
|
+
/**
|
|
13602
|
+
* @method
|
|
13603
|
+
* @name binance#fetchConvertTrade
|
|
13604
|
+
* @description fetch the data for a conversion trade
|
|
13605
|
+
* @see https://developers.binance.com/docs/convert/trade/Order-Status
|
|
13606
|
+
* @param {string} id the id of the trade that you want to fetch
|
|
13607
|
+
* @param {string} [code] the unified currency code of the conversion trade
|
|
13608
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
13609
|
+
* @returns {object} a [conversion structure]{@link https://docs.ccxt.com/#/?id=conversion-structure}
|
|
13610
|
+
*/
|
|
13553
13611
|
async fetchConvertTrade(id, code = undefined, params = {}) {
|
|
13554
|
-
/**
|
|
13555
|
-
* @method
|
|
13556
|
-
* @name binance#fetchConvertTrade
|
|
13557
|
-
* @description fetch the data for a conversion trade
|
|
13558
|
-
* @see https://developers.binance.com/docs/convert/trade/Order-Status
|
|
13559
|
-
* @param {string} id the id of the trade that you want to fetch
|
|
13560
|
-
* @param {string} [code] the unified currency code of the conversion trade
|
|
13561
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
13562
|
-
* @returns {object} a [conversion structure]{@link https://docs.ccxt.com/#/?id=conversion-structure}
|
|
13563
|
-
*/
|
|
13564
13612
|
await this.loadMarkets();
|
|
13565
13613
|
const request = {};
|
|
13566
13614
|
let response = undefined;
|
|
@@ -13628,19 +13676,19 @@ export default class binance extends Exchange {
|
|
|
13628
13676
|
}
|
|
13629
13677
|
return this.parseConversion(data, fromCurrency, toCurrency);
|
|
13630
13678
|
}
|
|
13679
|
+
/**
|
|
13680
|
+
* @method
|
|
13681
|
+
* @name binance#fetchConvertTradeHistory
|
|
13682
|
+
* @description fetch the users history of conversion trades
|
|
13683
|
+
* @see https://developers.binance.com/docs/convert/trade/Get-Convert-Trade-History
|
|
13684
|
+
* @param {string} [code] the unified currency code
|
|
13685
|
+
* @param {int} [since] the earliest time in ms to fetch conversions for
|
|
13686
|
+
* @param {int} [limit] the maximum number of conversion structures to retrieve
|
|
13687
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
13688
|
+
* @param {int} [params.until] timestamp in ms of the latest conversion to fetch
|
|
13689
|
+
* @returns {object[]} a list of [conversion structures]{@link https://docs.ccxt.com/#/?id=conversion-structure}
|
|
13690
|
+
*/
|
|
13631
13691
|
async fetchConvertTradeHistory(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
13632
|
-
/**
|
|
13633
|
-
* @method
|
|
13634
|
-
* @name binance#fetchConvertTradeHistory
|
|
13635
|
-
* @description fetch the users history of conversion trades
|
|
13636
|
-
* @see https://developers.binance.com/docs/convert/trade/Get-Convert-Trade-History
|
|
13637
|
-
* @param {string} [code] the unified currency code
|
|
13638
|
-
* @param {int} [since] the earliest time in ms to fetch conversions for
|
|
13639
|
-
* @param {int} [limit] the maximum number of conversion structures to retrieve
|
|
13640
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
13641
|
-
* @param {int} [params.until] timestamp in ms of the latest conversion to fetch
|
|
13642
|
-
* @returns {object[]} a list of [conversion structures]{@link https://docs.ccxt.com/#/?id=conversion-structure}
|
|
13643
|
-
*/
|
|
13644
13692
|
await this.loadMarkets();
|
|
13645
13693
|
const request = {};
|
|
13646
13694
|
const msInThirtyDays = 2592000000;
|
|
@@ -13818,18 +13866,18 @@ export default class binance extends Exchange {
|
|
|
13818
13866
|
'fee': undefined,
|
|
13819
13867
|
};
|
|
13820
13868
|
}
|
|
13869
|
+
/**
|
|
13870
|
+
* @method
|
|
13871
|
+
* @name binance#fetchFundingIntervals
|
|
13872
|
+
* @description fetch the funding rate interval for multiple markets
|
|
13873
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Get-Funding-Info
|
|
13874
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Get-Funding-Info
|
|
13875
|
+
* @param {string[]} [symbols] list of unified market symbols
|
|
13876
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
13877
|
+
* @param {string} [params.subType] "linear" or "inverse"
|
|
13878
|
+
* @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
|
|
13879
|
+
*/
|
|
13821
13880
|
async fetchFundingIntervals(symbols = undefined, params = {}) {
|
|
13822
|
-
/**
|
|
13823
|
-
* @method
|
|
13824
|
-
* @name binance#fetchFundingIntervals
|
|
13825
|
-
* @description fetch the funding rate interval for multiple markets
|
|
13826
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Get-Funding-Info
|
|
13827
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Get-Funding-Info
|
|
13828
|
-
* @param {string[]} [symbols] list of unified market symbols
|
|
13829
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
13830
|
-
* @param {string} [params.subType] "linear" or "inverse"
|
|
13831
|
-
* @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
|
|
13832
|
-
*/
|
|
13833
13881
|
await this.loadMarkets();
|
|
13834
13882
|
let market = undefined;
|
|
13835
13883
|
if (symbols !== undefined) {
|
|
@@ -13863,21 +13911,21 @@ export default class binance extends Exchange {
|
|
|
13863
13911
|
const result = this.parseFundingRates(response, market);
|
|
13864
13912
|
return this.filterByArray(result, 'symbol', symbols);
|
|
13865
13913
|
}
|
|
13914
|
+
/**
|
|
13915
|
+
* @method
|
|
13916
|
+
* @name binance#fetchLongShortRatioHistory
|
|
13917
|
+
* @description fetches the long short ratio history for a unified market symbol
|
|
13918
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Long-Short-Ratio
|
|
13919
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Long-Short-Ratio
|
|
13920
|
+
* @param {string} symbol unified symbol of the market to fetch the long short ratio for
|
|
13921
|
+
* @param {string} [timeframe] the period for the ratio, default is 24 hours
|
|
13922
|
+
* @param {int} [since] the earliest time in ms to fetch ratios for
|
|
13923
|
+
* @param {int} [limit] the maximum number of long short ratio structures to retrieve
|
|
13924
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
13925
|
+
* @param {int} [params.until] timestamp in ms of the latest ratio to fetch
|
|
13926
|
+
* @returns {object[]} an array of [long short ratio structures]{@link https://docs.ccxt.com/#/?id=long-short-ratio-structure}
|
|
13927
|
+
*/
|
|
13866
13928
|
async fetchLongShortRatioHistory(symbol = undefined, timeframe = undefined, since = undefined, limit = undefined, params = {}) {
|
|
13867
|
-
/**
|
|
13868
|
-
* @method
|
|
13869
|
-
* @name binance#fetchLongShortRatioHistory
|
|
13870
|
-
* @description fetches the long short ratio history for a unified market symbol
|
|
13871
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Long-Short-Ratio
|
|
13872
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Long-Short-Ratio
|
|
13873
|
-
* @param {string} symbol unified symbol of the market to fetch the long short ratio for
|
|
13874
|
-
* @param {string} [timeframe] the period for the ratio, default is 24 hours
|
|
13875
|
-
* @param {int} [since] the earliest time in ms to fetch ratios for
|
|
13876
|
-
* @param {int} [limit] the maximum number of long short ratio structures to retrieve
|
|
13877
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
13878
|
-
* @param {int} [params.until] timestamp in ms of the latest ratio to fetch
|
|
13879
|
-
* @returns {object[]} an array of [long short ratio structures]{@link https://docs.ccxt.com/#/?id=long-short-ratio-structure}
|
|
13880
|
-
*/
|
|
13881
13929
|
await this.loadMarkets();
|
|
13882
13930
|
const market = this.market(symbol);
|
|
13883
13931
|
if (timeframe === undefined) {
|