ccxt 4.4.30 → 4.4.32
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -3
- package/dist/ccxt.browser.min.js +3 -3
- package/dist/cjs/ccxt.js +1 -1
- package/dist/cjs/src/ace.js +123 -123
- package/dist/cjs/src/alpaca.js +237 -237
- package/dist/cjs/src/ascendex.js +342 -341
- package/dist/cjs/src/bigone.js +242 -242
- package/dist/cjs/src/binance.js +1339 -1291
- package/dist/cjs/src/bingx.js +639 -639
- package/dist/cjs/src/bit2c.js +111 -111
- package/dist/cjs/src/bitbank.js +142 -142
- package/dist/cjs/src/bitbns.js +140 -140
- package/dist/cjs/src/bitfinex.js +231 -231
- package/dist/cjs/src/bitfinex2.js +403 -403
- package/dist/cjs/src/bitflyer.js +184 -184
- package/dist/cjs/src/bitget.js +848 -846
- package/dist/cjs/src/bithumb.js +125 -124
- package/dist/cjs/src/bitmart.js +525 -525
- package/dist/cjs/src/bitmex.js +317 -317
- package/dist/cjs/src/bitopro.js +221 -221
- package/dist/cjs/src/bitrue.js +315 -315
- package/dist/cjs/src/bitso.js +220 -220
- package/dist/cjs/src/bitstamp.js +251 -251
- package/dist/cjs/src/bitteam.js +183 -183
- package/dist/cjs/src/bitvavo.js +247 -251
- package/dist/cjs/src/bl3p.js +82 -82
- package/dist/cjs/src/blockchaincom.js +211 -211
- package/dist/cjs/src/blofin.js +332 -331
- package/dist/cjs/src/btcalpha.js +166 -166
- package/dist/cjs/src/btcbox.js +108 -108
- package/dist/cjs/src/btcmarkets.js +198 -198
- package/dist/cjs/src/btcturk.js +124 -124
- package/dist/cjs/src/bybit.js +906 -900
- package/dist/cjs/src/cex.js +227 -226
- package/dist/cjs/src/coinbase.js +481 -481
- package/dist/cjs/src/coinbaseexchange.js +274 -274
- package/dist/cjs/src/coinbaseinternational.js +304 -304
- package/dist/cjs/src/coincatch.js +650 -650
- package/dist/cjs/src/coincheck.js +113 -113
- package/dist/cjs/src/coinex.js +611 -601
- package/dist/cjs/src/coinlist.js +304 -303
- package/dist/cjs/src/coinmate.js +162 -161
- package/dist/cjs/src/coinmetro.js +187 -187
- package/dist/cjs/src/coinone.js +124 -123
- package/dist/cjs/src/coinsph.js +237 -237
- package/dist/cjs/src/coinspot.js +82 -82
- package/dist/cjs/src/cryptocom.js +342 -341
- package/dist/cjs/src/currencycom.js +225 -224
- package/dist/cjs/src/delta.js +320 -320
- package/dist/cjs/src/deribit.js +411 -408
- package/dist/cjs/src/digifinex.js +432 -431
- package/dist/cjs/src/exmo.js +328 -327
- package/dist/cjs/src/gate.js +830 -791
- package/dist/cjs/src/gemini.js +199 -198
- package/dist/cjs/src/hashkey.js +520 -517
- package/dist/cjs/src/hitbtc.js +465 -462
- package/dist/cjs/src/hollaex.js +253 -252
- package/dist/cjs/src/htx.js +791 -848
- package/dist/cjs/src/huobijp.js +219 -218
- package/dist/cjs/src/hyperliquid.js +421 -417
- package/dist/cjs/src/idex.js +238 -237
- package/dist/cjs/src/independentreserve.js +133 -132
- package/dist/cjs/src/indodax.js +177 -171
- package/dist/cjs/src/kraken.js +381 -377
- package/dist/cjs/src/krakenfutures.js +285 -279
- package/dist/cjs/src/kucoin.js +632 -622
- package/dist/cjs/src/kucoinfutures.js +533 -457
- package/dist/cjs/src/kuna.js +283 -282
- package/dist/cjs/src/latoken.js +211 -210
- package/dist/cjs/src/lbank.js +268 -267
- package/dist/cjs/src/luno.js +174 -173
- package/dist/cjs/src/lykke.js +172 -171
- package/dist/cjs/src/mercado.js +123 -122
- package/dist/cjs/src/mexc.js +650 -646
- package/dist/cjs/src/ndax.js +229 -228
- package/dist/cjs/src/novadax.js +230 -229
- package/dist/cjs/src/oceanex.js +187 -186
- package/dist/cjs/src/okcoin.js +286 -285
- package/dist/cjs/src/okx.js +909 -904
- package/dist/cjs/src/onetrading.js +218 -218
- package/dist/cjs/src/oxfun.js +335 -334
- package/dist/cjs/src/p2b.js +154 -154
- package/dist/cjs/src/paradex.js +249 -244
- package/dist/cjs/src/paymium.js +101 -101
- package/dist/cjs/src/phemex.js +388 -390
- package/dist/cjs/src/poloniex.js +270 -270
- package/dist/cjs/src/poloniexfutures.js +250 -250
- package/dist/cjs/src/pro/alpaca.js +64 -64
- package/dist/cjs/src/pro/ascendex.js +64 -64
- package/dist/cjs/src/pro/binance.js +546 -543
- package/dist/cjs/src/pro/bingx.js +116 -116
- package/dist/cjs/src/pro/bitfinex.js +42 -42
- package/dist/cjs/src/pro/bitfinex2.js +66 -66
- package/dist/cjs/src/pro/bitget.js +188 -181
- package/dist/cjs/src/pro/bithumb.js +40 -40
- package/dist/cjs/src/pro/bitmart.js +121 -119
- package/dist/cjs/src/pro/bitmex.js +135 -133
- package/dist/cjs/src/pro/bitopro.js +49 -49
- package/dist/cjs/src/pro/bitrue.js +19 -19
- package/dist/cjs/src/pro/bitstamp.js +29 -29
- package/dist/cjs/src/pro/bitvavo.js +299 -301
- package/dist/cjs/src/pro/blockchaincom.js +62 -62
- package/dist/cjs/src/pro/blofin.js +132 -130
- package/dist/cjs/src/pro/bybit.js +317 -313
- package/dist/cjs/src/pro/cex.js +168 -168
- package/dist/cjs/src/pro/coinbase.js +93 -91
- package/dist/cjs/src/pro/coinbaseexchange.js +95 -95
- package/dist/cjs/src/pro/coinbaseinternational.js +111 -111
- package/dist/cjs/src/pro/coincatch.js +150 -143
- package/dist/cjs/src/pro/coincheck.js +21 -21
- package/dist/cjs/src/pro/coinex.js +110 -110
- package/dist/cjs/src/pro/coinone.js +30 -30
- package/dist/cjs/src/pro/cryptocom.js +227 -227
- package/dist/cjs/src/pro/currencycom.js +45 -45
- package/dist/cjs/src/pro/deribit.js +127 -127
- package/dist/cjs/src/pro/exmo.js +66 -66
- package/dist/cjs/src/pro/gate.js +287 -283
- package/dist/cjs/src/pro/gemini.js +74 -74
- package/dist/cjs/src/pro/hashkey.js +87 -85
- package/dist/cjs/src/pro/hitbtc.js +190 -190
- package/dist/cjs/src/pro/hollaex.js +51 -51
- package/dist/cjs/src/pro/htx.js +96 -94
- package/dist/cjs/src/pro/huobijp.js +38 -38
- package/dist/cjs/src/pro/hyperliquid.js +151 -150
- package/dist/cjs/src/pro/idex.js +48 -48
- package/dist/cjs/src/pro/independentreserve.js +19 -19
- package/dist/cjs/src/pro/kraken.js +167 -167
- package/dist/cjs/src/pro/krakenfutures.js +137 -138
- package/dist/cjs/src/pro/kucoin.js +167 -168
- package/dist/cjs/src/pro/kucoinfutures.js +147 -147
- package/dist/cjs/src/pro/lbank.js +95 -95
- package/dist/cjs/src/pro/luno.js +21 -21
- package/dist/cjs/src/pro/mexc.js +102 -103
- package/dist/cjs/src/pro/ndax.js +42 -42
- package/dist/cjs/src/pro/okcoin.js +61 -61
- package/dist/cjs/src/pro/okx.js +332 -330
- package/dist/cjs/src/pro/onetrading.js +71 -71
- package/dist/cjs/src/pro/oxfun.js +193 -191
- package/dist/cjs/src/pro/p2b.js +77 -77
- package/dist/cjs/src/pro/paradex.js +39 -39
- package/dist/cjs/src/pro/phemex.js +94 -94
- package/dist/cjs/src/pro/poloniex.js +171 -171
- package/dist/cjs/src/pro/poloniexfutures.js +62 -62
- package/dist/cjs/src/pro/probit.js +63 -63
- package/dist/cjs/src/pro/upbit.js +80 -80
- package/dist/cjs/src/pro/vertex.js +65 -63
- package/dist/cjs/src/pro/wazirx.js +70 -70
- package/dist/cjs/src/pro/whitebit.js +83 -83
- package/dist/cjs/src/pro/woo.js +106 -104
- package/dist/cjs/src/pro/woofipro.js +105 -103
- package/dist/cjs/src/pro/xt.js +119 -119
- package/dist/cjs/src/probit.js +229 -229
- package/dist/cjs/src/timex.js +198 -197
- package/dist/cjs/src/tokocrypto.js +214 -213
- package/dist/cjs/src/tradeogre.js +92 -91
- package/dist/cjs/src/upbit.js +243 -242
- package/dist/cjs/src/vertex.js +258 -258
- package/dist/cjs/src/wavesexchange.js +176 -172
- package/dist/cjs/src/wazirx.js +168 -168
- package/dist/cjs/src/whitebit.js +361 -361
- package/dist/cjs/src/woo.js +571 -572
- package/dist/cjs/src/woofipro.js +392 -391
- package/dist/cjs/src/xt.js +436 -435
- package/dist/cjs/src/yobit.js +159 -158
- package/dist/cjs/src/zaif.js +103 -103
- package/dist/cjs/src/zonda.js +168 -168
- package/js/ccxt.d.ts +1 -1
- package/js/ccxt.js +1 -1
- package/js/src/ace.d.ts +123 -0
- package/js/src/ace.js +123 -123
- package/js/src/alpaca.d.ts +237 -0
- package/js/src/alpaca.js +237 -237
- package/js/src/ascendex.d.ts +339 -0
- package/js/src/ascendex.js +342 -341
- package/js/src/base/types.d.ts +1 -0
- package/js/src/bigone.d.ts +242 -0
- package/js/src/bigone.js +242 -242
- package/js/src/binance.d.ts +1306 -0
- package/js/src/binance.js +1339 -1291
- package/js/src/bingx.d.ts +639 -0
- package/js/src/bingx.js +639 -639
- package/js/src/bit2c.d.ts +111 -0
- package/js/src/bit2c.js +111 -111
- package/js/src/bitbank.d.ts +142 -0
- package/js/src/bitbank.js +142 -142
- package/js/src/bitbns.d.ts +140 -0
- package/js/src/bitbns.js +140 -140
- package/js/src/bitfinex.d.ts +231 -0
- package/js/src/bitfinex.js +231 -231
- package/js/src/bitfinex2.d.ts +403 -0
- package/js/src/bitfinex2.js +403 -403
- package/js/src/bitflyer.d.ts +184 -0
- package/js/src/bitflyer.js +184 -184
- package/js/src/bitget.d.ts +846 -0
- package/js/src/bitget.js +848 -846
- package/js/src/bithumb.d.ts +125 -0
- package/js/src/bithumb.js +125 -124
- package/js/src/bitmart.d.ts +525 -0
- package/js/src/bitmart.js +525 -525
- package/js/src/bitmex.d.ts +317 -0
- package/js/src/bitmex.js +317 -317
- package/js/src/bitopro.d.ts +221 -0
- package/js/src/bitopro.js +221 -221
- package/js/src/bitrue.d.ts +315 -0
- package/js/src/bitrue.js +315 -315
- package/js/src/bitso.d.ts +220 -0
- package/js/src/bitso.js +220 -220
- package/js/src/bitstamp.d.ts +251 -0
- package/js/src/bitstamp.js +251 -251
- package/js/src/bitteam.d.ts +183 -0
- package/js/src/bitteam.js +183 -183
- package/js/src/bitvavo.d.ts +247 -0
- package/js/src/bitvavo.js +247 -251
- package/js/src/bl3p.d.ts +82 -0
- package/js/src/bl3p.js +82 -82
- package/js/src/blockchaincom.d.ts +211 -0
- package/js/src/blockchaincom.js +211 -211
- package/js/src/blofin.d.ts +332 -0
- package/js/src/blofin.js +332 -331
- package/js/src/btcalpha.d.ts +166 -0
- package/js/src/btcalpha.js +166 -166
- package/js/src/btcbox.d.ts +108 -0
- package/js/src/btcbox.js +108 -108
- package/js/src/btcmarkets.d.ts +198 -0
- package/js/src/btcmarkets.js +198 -198
- package/js/src/btcturk.d.ts +124 -0
- package/js/src/btcturk.js +124 -124
- package/js/src/bybit.d.ts +906 -1
- package/js/src/bybit.js +906 -900
- package/js/src/cex.d.ts +227 -0
- package/js/src/cex.js +227 -226
- package/js/src/coinbase.d.ts +481 -0
- package/js/src/coinbase.js +481 -481
- package/js/src/coinbaseexchange.d.ts +274 -0
- package/js/src/coinbaseexchange.js +274 -274
- package/js/src/coinbaseinternational.d.ts +304 -0
- package/js/src/coinbaseinternational.js +304 -304
- package/js/src/coincatch.d.ts +646 -0
- package/js/src/coincatch.js +650 -650
- package/js/src/coincheck.d.ts +113 -0
- package/js/src/coincheck.js +113 -113
- package/js/src/coinex.d.ts +603 -0
- package/js/src/coinex.js +611 -601
- package/js/src/coinlist.d.ts +304 -0
- package/js/src/coinlist.js +304 -303
- package/js/src/coinmate.d.ts +162 -0
- package/js/src/coinmate.js +162 -161
- package/js/src/coinmetro.d.ts +187 -0
- package/js/src/coinmetro.js +187 -187
- package/js/src/coinone.d.ts +124 -0
- package/js/src/coinone.js +124 -123
- package/js/src/coinsph.d.ts +237 -0
- package/js/src/coinsph.js +237 -237
- package/js/src/coinspot.d.ts +82 -0
- package/js/src/coinspot.js +82 -82
- package/js/src/cryptocom.d.ts +342 -0
- package/js/src/cryptocom.js +342 -341
- package/js/src/currencycom.d.ts +225 -0
- package/js/src/currencycom.js +225 -224
- package/js/src/delta.d.ts +320 -0
- package/js/src/delta.js +320 -320
- package/js/src/deribit.d.ts +411 -0
- package/js/src/deribit.js +411 -408
- package/js/src/digifinex.d.ts +430 -0
- package/js/src/digifinex.js +432 -431
- package/js/src/exmo.d.ts +328 -0
- package/js/src/exmo.js +328 -327
- package/js/src/gate.d.ts +803 -1
- package/js/src/gate.js +830 -791
- package/js/src/gemini.d.ts +199 -0
- package/js/src/gemini.js +199 -198
- package/js/src/hashkey.d.ts +516 -0
- package/js/src/hashkey.js +520 -517
- package/js/src/hitbtc.d.ts +465 -0
- package/js/src/hitbtc.js +465 -462
- package/js/src/hollaex.d.ts +253 -0
- package/js/src/hollaex.js +253 -252
- package/js/src/htx.d.ts +765 -2
- package/js/src/htx.js +791 -848
- package/js/src/huobijp.d.ts +219 -0
- package/js/src/huobijp.js +219 -218
- package/js/src/hyperliquid.d.ts +419 -0
- package/js/src/hyperliquid.js +421 -417
- package/js/src/idex.d.ts +238 -0
- package/js/src/idex.js +238 -237
- package/js/src/independentreserve.d.ts +133 -0
- package/js/src/independentreserve.js +133 -132
- package/js/src/indodax.d.ts +171 -0
- package/js/src/indodax.js +177 -171
- package/js/src/kraken.d.ts +381 -0
- package/js/src/kraken.js +381 -377
- package/js/src/krakenfutures.d.ts +282 -0
- package/js/src/krakenfutures.js +285 -279
- package/js/src/kucoin.d.ts +613 -0
- package/js/src/kucoin.js +632 -622
- package/js/src/kucoinfutures.d.ts +441 -0
- package/js/src/kucoinfutures.js +533 -457
- package/js/src/kuna.d.ts +283 -0
- package/js/src/kuna.js +283 -282
- package/js/src/latoken.d.ts +211 -0
- package/js/src/latoken.js +211 -210
- package/js/src/lbank.d.ts +268 -0
- package/js/src/lbank.js +268 -267
- package/js/src/luno.d.ts +174 -0
- package/js/src/luno.js +174 -173
- package/js/src/lykke.d.ts +172 -0
- package/js/src/lykke.js +172 -171
- package/js/src/mercado.d.ts +123 -0
- package/js/src/mercado.js +123 -122
- package/js/src/mexc.d.ts +647 -0
- package/js/src/mexc.js +650 -646
- package/js/src/ndax.d.ts +229 -0
- package/js/src/ndax.js +229 -228
- package/js/src/novadax.d.ts +230 -0
- package/js/src/novadax.js +230 -229
- package/js/src/oceanex.d.ts +187 -0
- package/js/src/oceanex.js +187 -186
- package/js/src/okcoin.d.ts +286 -0
- package/js/src/okcoin.js +286 -285
- package/js/src/okx.d.ts +907 -0
- package/js/src/okx.js +909 -904
- package/js/src/onetrading.d.ts +218 -0
- package/js/src/onetrading.js +218 -218
- package/js/src/oxfun.d.ts +336 -3
- package/js/src/oxfun.js +335 -334
- package/js/src/p2b.d.ts +154 -0
- package/js/src/p2b.js +154 -154
- package/js/src/paradex.d.ts +241 -0
- package/js/src/paradex.js +249 -244
- package/js/src/paymium.d.ts +101 -0
- package/js/src/paymium.js +101 -101
- package/js/src/phemex.d.ts +366 -0
- package/js/src/phemex.js +388 -390
- package/js/src/poloniex.d.ts +270 -0
- package/js/src/poloniex.js +270 -270
- package/js/src/poloniexfutures.d.ts +250 -0
- package/js/src/poloniexfutures.js +250 -250
- package/js/src/pro/alpaca.d.ts +64 -0
- package/js/src/pro/alpaca.js +64 -64
- package/js/src/pro/ascendex.d.ts +64 -0
- package/js/src/pro/ascendex.js +64 -64
- package/js/src/pro/binance.d.ts +546 -0
- package/js/src/pro/binance.js +546 -543
- package/js/src/pro/bingx.d.ts +116 -0
- package/js/src/pro/bingx.js +116 -116
- package/js/src/pro/bitfinex.d.ts +42 -0
- package/js/src/pro/bitfinex.js +42 -42
- package/js/src/pro/bitfinex2.d.ts +66 -0
- package/js/src/pro/bitfinex2.js +66 -66
- package/js/src/pro/bitget.d.ts +187 -0
- package/js/src/pro/bitget.js +188 -181
- package/js/src/pro/bithumb.d.ts +40 -0
- package/js/src/pro/bithumb.js +40 -40
- package/js/src/pro/bitmart.d.ts +121 -0
- package/js/src/pro/bitmart.js +121 -119
- package/js/src/pro/bitmex.d.ts +135 -0
- package/js/src/pro/bitmex.js +135 -133
- package/js/src/pro/bitopro.d.ts +49 -0
- package/js/src/pro/bitopro.js +49 -49
- package/js/src/pro/bitrue.d.ts +19 -0
- package/js/src/pro/bitrue.js +19 -19
- package/js/src/pro/bitstamp.d.ts +29 -0
- package/js/src/pro/bitstamp.js +29 -29
- package/js/src/pro/bitvavo.d.ts +254 -1
- package/js/src/pro/bitvavo.js +299 -301
- package/js/src/pro/blockchaincom.d.ts +62 -0
- package/js/src/pro/blockchaincom.js +62 -62
- package/js/src/pro/blofin.d.ts +132 -0
- package/js/src/pro/blofin.js +132 -130
- package/js/src/pro/bybit.d.ts +317 -0
- package/js/src/pro/bybit.js +317 -313
- package/js/src/pro/cex.d.ts +168 -0
- package/js/src/pro/cex.js +168 -168
- package/js/src/pro/coinbase.d.ts +93 -0
- package/js/src/pro/coinbase.js +93 -91
- package/js/src/pro/coinbaseexchange.d.ts +95 -0
- package/js/src/pro/coinbaseexchange.js +95 -95
- package/js/src/pro/coinbaseinternational.d.ts +111 -0
- package/js/src/pro/coinbaseinternational.js +111 -111
- package/js/src/pro/coincatch.d.ts +150 -0
- package/js/src/pro/coincatch.js +150 -143
- package/js/src/pro/coincheck.d.ts +21 -0
- package/js/src/pro/coincheck.js +21 -21
- package/js/src/pro/coinex.d.ts +110 -0
- package/js/src/pro/coinex.js +110 -110
- package/js/src/pro/coinone.d.ts +30 -0
- package/js/src/pro/coinone.js +30 -30
- package/js/src/pro/cryptocom.d.ts +227 -0
- package/js/src/pro/cryptocom.js +227 -227
- package/js/src/pro/currencycom.d.ts +45 -0
- package/js/src/pro/currencycom.js +45 -45
- package/js/src/pro/deribit.d.ts +127 -0
- package/js/src/pro/deribit.js +127 -127
- package/js/src/pro/exmo.d.ts +66 -0
- package/js/src/pro/exmo.js +66 -66
- package/js/src/pro/gate.d.ts +287 -0
- package/js/src/pro/gate.js +287 -283
- package/js/src/pro/gemini.d.ts +74 -0
- package/js/src/pro/gemini.js +74 -74
- package/js/src/pro/hashkey.d.ts +87 -0
- package/js/src/pro/hashkey.js +87 -85
- package/js/src/pro/hitbtc.d.ts +190 -0
- package/js/src/pro/hitbtc.js +190 -190
- package/js/src/pro/hollaex.d.ts +51 -0
- package/js/src/pro/hollaex.js +51 -51
- package/js/src/pro/htx.d.ts +96 -0
- package/js/src/pro/htx.js +96 -94
- package/js/src/pro/huobijp.d.ts +38 -0
- package/js/src/pro/huobijp.js +38 -38
- package/js/src/pro/hyperliquid.d.ts +151 -0
- package/js/src/pro/hyperliquid.js +151 -150
- package/js/src/pro/idex.d.ts +48 -0
- package/js/src/pro/idex.js +48 -48
- package/js/src/pro/independentreserve.d.ts +19 -0
- package/js/src/pro/independentreserve.js +19 -19
- package/js/src/pro/kraken.d.ts +167 -0
- package/js/src/pro/kraken.js +167 -167
- package/js/src/pro/krakenfutures.d.ts +137 -0
- package/js/src/pro/krakenfutures.js +137 -138
- package/js/src/pro/kucoin.d.ts +167 -0
- package/js/src/pro/kucoin.js +167 -168
- package/js/src/pro/kucoinfutures.d.ts +147 -0
- package/js/src/pro/kucoinfutures.js +147 -147
- package/js/src/pro/lbank.d.ts +95 -0
- package/js/src/pro/lbank.js +95 -95
- package/js/src/pro/luno.d.ts +21 -0
- package/js/src/pro/luno.js +21 -21
- package/js/src/pro/mexc.d.ts +101 -0
- package/js/src/pro/mexc.js +102 -103
- package/js/src/pro/ndax.d.ts +42 -0
- package/js/src/pro/ndax.js +42 -42
- package/js/src/pro/okcoin.d.ts +61 -0
- package/js/src/pro/okcoin.js +61 -61
- package/js/src/pro/okx.d.ts +332 -0
- package/js/src/pro/okx.js +332 -330
- package/js/src/pro/onetrading.d.ts +71 -0
- package/js/src/pro/onetrading.js +71 -71
- package/js/src/pro/oxfun.d.ts +193 -0
- package/js/src/pro/oxfun.js +193 -191
- package/js/src/pro/p2b.d.ts +77 -0
- package/js/src/pro/p2b.js +77 -77
- package/js/src/pro/paradex.d.ts +39 -0
- package/js/src/pro/paradex.js +39 -39
- package/js/src/pro/phemex.d.ts +94 -0
- package/js/src/pro/phemex.js +94 -94
- package/js/src/pro/poloniex.d.ts +171 -0
- package/js/src/pro/poloniex.js +171 -171
- package/js/src/pro/poloniexfutures.d.ts +62 -0
- package/js/src/pro/poloniexfutures.js +62 -62
- package/js/src/pro/probit.d.ts +63 -0
- package/js/src/pro/probit.js +63 -63
- package/js/src/pro/upbit.d.ts +80 -0
- package/js/src/pro/upbit.js +80 -80
- package/js/src/pro/vertex.d.ts +65 -0
- package/js/src/pro/vertex.js +65 -63
- package/js/src/pro/wazirx.d.ts +70 -0
- package/js/src/pro/wazirx.js +70 -70
- package/js/src/pro/whitebit.d.ts +83 -0
- package/js/src/pro/whitebit.js +83 -83
- package/js/src/pro/woo.d.ts +106 -0
- package/js/src/pro/woo.js +106 -104
- package/js/src/pro/woofipro.d.ts +105 -0
- package/js/src/pro/woofipro.js +105 -103
- package/js/src/pro/xt.d.ts +119 -0
- package/js/src/pro/xt.js +119 -119
- package/js/src/probit.d.ts +229 -0
- package/js/src/probit.js +229 -229
- package/js/src/timex.d.ts +198 -0
- package/js/src/timex.js +198 -197
- package/js/src/tokocrypto.d.ts +214 -0
- package/js/src/tokocrypto.js +214 -213
- package/js/src/tradeogre.d.ts +92 -0
- package/js/src/tradeogre.js +92 -91
- package/js/src/upbit.d.ts +243 -0
- package/js/src/upbit.js +243 -242
- package/js/src/vertex.d.ts +258 -0
- package/js/src/vertex.js +258 -258
- package/js/src/wavesexchange.d.ts +176 -0
- package/js/src/wavesexchange.js +176 -172
- package/js/src/wazirx.d.ts +168 -0
- package/js/src/wazirx.js +168 -168
- package/js/src/whitebit.d.ts +361 -0
- package/js/src/whitebit.js +361 -361
- package/js/src/woo.d.ts +571 -0
- package/js/src/woo.js +571 -572
- package/js/src/woofipro.d.ts +392 -0
- package/js/src/woofipro.js +392 -391
- package/js/src/xt.d.ts +439 -4
- package/js/src/xt.js +436 -435
- package/js/src/yobit.d.ts +159 -0
- package/js/src/yobit.js +159 -158
- package/js/src/zaif.d.ts +103 -0
- package/js/src/zaif.js +103 -103
- package/js/src/zonda.d.ts +168 -0
- package/js/src/zonda.js +168 -168
- package/package.json +1 -1
package/dist/cjs/src/binance.js
CHANGED
|
@@ -108,7 +108,7 @@ class binance extends binance$1 {
|
|
|
108
108
|
'fetchLongShortRatio': false,
|
|
109
109
|
'fetchLongShortRatioHistory': true,
|
|
110
110
|
'fetchMarginAdjustmentHistory': true,
|
|
111
|
-
'fetchMarginMode':
|
|
111
|
+
'fetchMarginMode': true,
|
|
112
112
|
'fetchMarginModes': true,
|
|
113
113
|
'fetchMarketLeverageTiers': 'emulated',
|
|
114
114
|
'fetchMarkets': true,
|
|
@@ -2665,18 +2665,18 @@ class binance extends binance$1 {
|
|
|
2665
2665
|
nonce() {
|
|
2666
2666
|
return this.milliseconds() - this.options['timeDifference'];
|
|
2667
2667
|
}
|
|
2668
|
+
/**
|
|
2669
|
+
* @method
|
|
2670
|
+
* @name binance#fetchTime
|
|
2671
|
+
* @description fetches the current integer timestamp in milliseconds from the exchange server
|
|
2672
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#check-server-time // spot
|
|
2673
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Check-Server-Time // swap
|
|
2674
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Check-Server-time // future
|
|
2675
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2676
|
+
* @param {string} [params.subType] "linear" or "inverse"
|
|
2677
|
+
* @returns {int} the current integer timestamp in milliseconds from the exchange server
|
|
2678
|
+
*/
|
|
2668
2679
|
async fetchTime(params = {}) {
|
|
2669
|
-
/**
|
|
2670
|
-
* @method
|
|
2671
|
-
* @name binance#fetchTime
|
|
2672
|
-
* @description fetches the current integer timestamp in milliseconds from the exchange server
|
|
2673
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#check-server-time // spot
|
|
2674
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Check-Server-Time // swap
|
|
2675
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Check-Server-time // future
|
|
2676
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2677
|
-
* @param {string} [params.subType] "linear" or "inverse"
|
|
2678
|
-
* @returns {int} the current integer timestamp in milliseconds from the exchange server
|
|
2679
|
-
*/
|
|
2680
2680
|
const defaultType = this.safeString2(this.options, 'fetchTime', 'defaultType', 'spot');
|
|
2681
2681
|
const type = this.safeString(params, 'type', defaultType);
|
|
2682
2682
|
const query = this.omit(params, 'type');
|
|
@@ -2694,16 +2694,16 @@ class binance extends binance$1 {
|
|
|
2694
2694
|
}
|
|
2695
2695
|
return this.safeInteger(response, 'serverTime');
|
|
2696
2696
|
}
|
|
2697
|
+
/**
|
|
2698
|
+
* @method
|
|
2699
|
+
* @name binance#fetchCurrencies
|
|
2700
|
+
* @description fetches all available currencies on an exchange
|
|
2701
|
+
* @see https://developers.binance.com/docs/wallet/capital/all-coins-info
|
|
2702
|
+
* @see https://developers.binance.com/docs/margin_trading/market-data/Get-All-Margin-Assets
|
|
2703
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2704
|
+
* @returns {object} an associative dictionary of currencies
|
|
2705
|
+
*/
|
|
2697
2706
|
async fetchCurrencies(params = {}) {
|
|
2698
|
-
/**
|
|
2699
|
-
* @method
|
|
2700
|
-
* @name binance#fetchCurrencies
|
|
2701
|
-
* @description fetches all available currencies on an exchange
|
|
2702
|
-
* @see https://developers.binance.com/docs/wallet/capital/all-coins-info
|
|
2703
|
-
* @see https://developers.binance.com/docs/margin_trading/market-data/Get-All-Margin-Assets
|
|
2704
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2705
|
-
* @returns {object} an associative dictionary of currencies
|
|
2706
|
-
*/
|
|
2707
2707
|
const fetchCurrenciesEnabled = this.safeBool(this.options, 'fetchCurrencies');
|
|
2708
2708
|
if (!fetchCurrenciesEnabled) {
|
|
2709
2709
|
return undefined;
|
|
@@ -2913,20 +2913,20 @@ class binance extends binance$1 {
|
|
|
2913
2913
|
}
|
|
2914
2914
|
return result;
|
|
2915
2915
|
}
|
|
2916
|
+
/**
|
|
2917
|
+
* @method
|
|
2918
|
+
* @name binance#fetchMarkets
|
|
2919
|
+
* @description retrieves data on all markets for binance
|
|
2920
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#exchange-information // spot
|
|
2921
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Exchange-Information // swap
|
|
2922
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Exchange-Information // future
|
|
2923
|
+
* @see https://developers.binance.com/docs/derivatives/option/market-data/Exchange-Information // option
|
|
2924
|
+
* @see https://developers.binance.com/docs/margin_trading/market-data/Get-All-Cross-Margin-Pairs // cross margin
|
|
2925
|
+
* @see https://developers.binance.com/docs/margin_trading/market-data/Get-All-Isolated-Margin-Symbol // isolated margin
|
|
2926
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2927
|
+
* @returns {object[]} an array of objects representing market data
|
|
2928
|
+
*/
|
|
2916
2929
|
async fetchMarkets(params = {}) {
|
|
2917
|
-
/**
|
|
2918
|
-
* @method
|
|
2919
|
-
* @name binance#fetchMarkets
|
|
2920
|
-
* @description retrieves data on all markets for binance
|
|
2921
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#exchange-information // spot
|
|
2922
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Exchange-Information // swap
|
|
2923
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Exchange-Information // future
|
|
2924
|
-
* @see https://developers.binance.com/docs/derivatives/option/market-data/Exchange-Information // option
|
|
2925
|
-
* @see https://developers.binance.com/docs/margin_trading/market-data/Get-All-Cross-Margin-Pairs // cross margin
|
|
2926
|
-
* @see https://developers.binance.com/docs/margin_trading/market-data/Get-All-Isolated-Margin-Symbol // isolated margin
|
|
2927
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
2928
|
-
* @returns {object[]} an array of objects representing market data
|
|
2929
|
-
*/
|
|
2930
2930
|
const promisesRaw = [];
|
|
2931
2931
|
const rawFetchMarkets = this.safeList(this.options, 'fetchMarkets', ['spot', 'linear', 'inverse']);
|
|
2932
2932
|
const sandboxMode = this.safeBool(this.options, 'sandboxMode', false);
|
|
@@ -3523,27 +3523,27 @@ class binance extends binance$1 {
|
|
|
3523
3523
|
result['datetime'] = this.iso8601(timestamp);
|
|
3524
3524
|
return isolated ? result : this.safeBalance(result);
|
|
3525
3525
|
}
|
|
3526
|
+
/**
|
|
3527
|
+
* @method
|
|
3528
|
+
* @name binance#fetchBalance
|
|
3529
|
+
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
3530
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#account-information-user_data // spot
|
|
3531
|
+
* @see https://developers.binance.com/docs/margin_trading/account/Query-Cross-Margin-Account-Details // cross margin
|
|
3532
|
+
* @see https://developers.binance.com/docs/margin_trading/account/Query-Isolated-Margin-Account-Info // isolated margin
|
|
3533
|
+
* @see https://developers.binance.com/docs/wallet/asset/funding-wallet // funding
|
|
3534
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Futures-Account-Balance-V2 // swap
|
|
3535
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Futures-Account-Balance // future
|
|
3536
|
+
* @see https://developers.binance.com/docs/derivatives/option/account/Option-Account-Information // option
|
|
3537
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/account/Account-Balance // portfolio margin
|
|
3538
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3539
|
+
* @param {string} [params.type] 'future', 'delivery', 'savings', 'funding', or 'spot' or 'papi'
|
|
3540
|
+
* @param {string} [params.marginMode] 'cross' or 'isolated', for margin trading, uses this.options.defaultMarginMode if not passed, defaults to undefined/None/null
|
|
3541
|
+
* @param {string[]|undefined} [params.symbols] unified market symbols, only used in isolated margin mode
|
|
3542
|
+
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch the balance for a portfolio margin account
|
|
3543
|
+
* @param {string} [params.subType] 'linear' or 'inverse'
|
|
3544
|
+
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
3545
|
+
*/
|
|
3526
3546
|
async fetchBalance(params = {}) {
|
|
3527
|
-
/**
|
|
3528
|
-
* @method
|
|
3529
|
-
* @name binance#fetchBalance
|
|
3530
|
-
* @description query for balance and get the amount of funds available for trading or funds locked in orders
|
|
3531
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#account-information-user_data // spot
|
|
3532
|
-
* @see https://developers.binance.com/docs/margin_trading/account/Query-Cross-Margin-Account-Details // cross margin
|
|
3533
|
-
* @see https://developers.binance.com/docs/margin_trading/account/Query-Isolated-Margin-Account-Info // isolated margin
|
|
3534
|
-
* @see https://developers.binance.com/docs/wallet/asset/funding-wallet // funding
|
|
3535
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Futures-Account-Balance-V2 // swap
|
|
3536
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Futures-Account-Balance // future
|
|
3537
|
-
* @see https://developers.binance.com/docs/derivatives/option/account/Option-Account-Information // option
|
|
3538
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/account/Account-Balance // portfolio margin
|
|
3539
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3540
|
-
* @param {string} [params.type] 'future', 'delivery', 'savings', 'funding', or 'spot' or 'papi'
|
|
3541
|
-
* @param {string} [params.marginMode] 'cross' or 'isolated', for margin trading, uses this.options.defaultMarginMode if not passed, defaults to undefined/None/null
|
|
3542
|
-
* @param {string[]|undefined} [params.symbols] unified market symbols, only used in isolated margin mode
|
|
3543
|
-
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch the balance for a portfolio margin account
|
|
3544
|
-
* @param {string} [params.subType] 'linear' or 'inverse'
|
|
3545
|
-
* @returns {object} a [balance structure]{@link https://docs.ccxt.com/#/?id=balance-structure}
|
|
3546
|
-
*/
|
|
3547
3547
|
await this.loadMarkets();
|
|
3548
3548
|
const defaultType = this.safeString2(this.options, 'fetchBalance', 'defaultType', 'spot');
|
|
3549
3549
|
let type = this.safeString(params, 'type', defaultType);
|
|
@@ -3797,20 +3797,20 @@ class binance extends binance$1 {
|
|
|
3797
3797
|
//
|
|
3798
3798
|
return this.parseBalanceCustom(response, type, marginMode, isPortfolioMargin);
|
|
3799
3799
|
}
|
|
3800
|
+
/**
|
|
3801
|
+
* @method
|
|
3802
|
+
* @name binance#fetchOrderBook
|
|
3803
|
+
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
3804
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#order-book // spot
|
|
3805
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Order-Book // swap
|
|
3806
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Order-Book // future
|
|
3807
|
+
* @see https://developers.binance.com/docs/derivatives/option/market-data/Order-Book // option
|
|
3808
|
+
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
3809
|
+
* @param {int} [limit] the maximum amount of order book entries to return
|
|
3810
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3811
|
+
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
3812
|
+
*/
|
|
3800
3813
|
async fetchOrderBook(symbol, limit = undefined, params = {}) {
|
|
3801
|
-
/**
|
|
3802
|
-
* @method
|
|
3803
|
-
* @name binance#fetchOrderBook
|
|
3804
|
-
* @description fetches information on open orders with bid (buy) and ask (sell) prices, volumes and other data
|
|
3805
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#order-book // spot
|
|
3806
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Order-Book // swap
|
|
3807
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Order-Book // future
|
|
3808
|
-
* @see https://developers.binance.com/docs/derivatives/option/market-data/Order-Book // option
|
|
3809
|
-
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
3810
|
-
* @param {int} [limit] the maximum amount of order book entries to return
|
|
3811
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
3812
|
-
* @returns {object} A dictionary of [order book structures]{@link https://docs.ccxt.com/#/?id=order-book-structure} indexed by market symbols
|
|
3813
|
-
*/
|
|
3814
3814
|
await this.loadMarkets();
|
|
3815
3815
|
const market = this.market(symbol);
|
|
3816
3816
|
const request = {
|
|
@@ -4038,15 +4038,15 @@ class binance extends binance$1 {
|
|
|
4038
4038
|
'info': ticker,
|
|
4039
4039
|
}, market);
|
|
4040
4040
|
}
|
|
4041
|
+
/**
|
|
4042
|
+
* @method
|
|
4043
|
+
* @name binance#fetchStatus
|
|
4044
|
+
* @description the latest known information on the availability of the exchange API
|
|
4045
|
+
* @see https://developers.binance.com/docs/wallet/others/system-status
|
|
4046
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4047
|
+
* @returns {object} a [status structure]{@link https://docs.ccxt.com/#/?id=exchange-status-structure}
|
|
4048
|
+
*/
|
|
4041
4049
|
async fetchStatus(params = {}) {
|
|
4042
|
-
/**
|
|
4043
|
-
* @method
|
|
4044
|
-
* @name binance#fetchStatus
|
|
4045
|
-
* @description the latest known information on the availability of the exchange API
|
|
4046
|
-
* @see https://developers.binance.com/docs/wallet/others/system-status
|
|
4047
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4048
|
-
* @returns {object} a [status structure]{@link https://docs.ccxt.com/#/?id=exchange-status-structure}
|
|
4049
|
-
*/
|
|
4050
4050
|
const response = await this.sapiGetSystemStatus(params);
|
|
4051
4051
|
//
|
|
4052
4052
|
// {
|
|
@@ -4063,21 +4063,21 @@ class binance extends binance$1 {
|
|
|
4063
4063
|
'info': response,
|
|
4064
4064
|
};
|
|
4065
4065
|
}
|
|
4066
|
+
/**
|
|
4067
|
+
* @method
|
|
4068
|
+
* @name binance#fetchTicker
|
|
4069
|
+
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
4070
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#24hr-ticker-price-change-statistics // spot
|
|
4071
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#rolling-window-price-change-statistics // spot
|
|
4072
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/24hr-Ticker-Price-Change-Statistics // swap
|
|
4073
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/24hr-Ticker-Price-Change-Statistics // future
|
|
4074
|
+
* @see https://developers.binance.com/docs/derivatives/option/market-data/24hr-Ticker-Price-Change-Statistics // option
|
|
4075
|
+
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
4076
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4077
|
+
* @param {boolean} [params.rolling] (spot only) default false, if true, uses the rolling 24 hour ticker endpoint /api/v3/ticker
|
|
4078
|
+
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
4079
|
+
*/
|
|
4066
4080
|
async fetchTicker(symbol, params = {}) {
|
|
4067
|
-
/**
|
|
4068
|
-
* @method
|
|
4069
|
-
* @name binance#fetchTicker
|
|
4070
|
-
* @description fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
4071
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#24hr-ticker-price-change-statistics // spot
|
|
4072
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#rolling-window-price-change-statistics // spot
|
|
4073
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/24hr-Ticker-Price-Change-Statistics // swap
|
|
4074
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/24hr-Ticker-Price-Change-Statistics // future
|
|
4075
|
-
* @see https://developers.binance.com/docs/derivatives/option/market-data/24hr-Ticker-Price-Change-Statistics // option
|
|
4076
|
-
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
4077
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4078
|
-
* @param {boolean} [params.rolling] (spot only) default false, if true, uses the rolling 24 hour ticker endpoint /api/v3/ticker
|
|
4079
|
-
* @returns {object} a [ticker structure]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
4080
|
-
*/
|
|
4081
4081
|
await this.loadMarkets();
|
|
4082
4082
|
const market = this.market(symbol);
|
|
4083
4083
|
const request = {
|
|
@@ -4109,19 +4109,19 @@ class binance extends binance$1 {
|
|
|
4109
4109
|
}
|
|
4110
4110
|
return this.parseTicker(response, market);
|
|
4111
4111
|
}
|
|
4112
|
+
/**
|
|
4113
|
+
* @method
|
|
4114
|
+
* @name binance#fetchBidsAsks
|
|
4115
|
+
* @description fetches the bid and ask price and volume for multiple markets
|
|
4116
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#symbol-order-book-ticker // spot
|
|
4117
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Symbol-Order-Book-Ticker // swap
|
|
4118
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Symbol-Order-Book-Ticker // future
|
|
4119
|
+
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the bids and asks for, all markets are returned if not assigned
|
|
4120
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4121
|
+
* @param {string} [params.subType] "linear" or "inverse"
|
|
4122
|
+
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
4123
|
+
*/
|
|
4112
4124
|
async fetchBidsAsks(symbols = undefined, params = {}) {
|
|
4113
|
-
/**
|
|
4114
|
-
* @method
|
|
4115
|
-
* @name binance#fetchBidsAsks
|
|
4116
|
-
* @description fetches the bid and ask price and volume for multiple markets
|
|
4117
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#symbol-order-book-ticker // spot
|
|
4118
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Symbol-Order-Book-Ticker // swap
|
|
4119
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Symbol-Order-Book-Ticker // future
|
|
4120
|
-
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the bids and asks for, all markets are returned if not assigned
|
|
4121
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4122
|
-
* @param {string} [params.subType] "linear" or "inverse"
|
|
4123
|
-
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
4124
|
-
*/
|
|
4125
4125
|
await this.loadMarkets();
|
|
4126
4126
|
symbols = this.marketSymbols(symbols, undefined, true, true, true);
|
|
4127
4127
|
const market = this.getMarketFromSymbols(symbols);
|
|
@@ -4148,19 +4148,19 @@ class binance extends binance$1 {
|
|
|
4148
4148
|
}
|
|
4149
4149
|
return this.parseTickers(response, symbols);
|
|
4150
4150
|
}
|
|
4151
|
+
/**
|
|
4152
|
+
* @method
|
|
4153
|
+
* @name binance#fetchLastPrices
|
|
4154
|
+
* @description fetches the last price for multiple markets
|
|
4155
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#symbol-price-ticker // spot
|
|
4156
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Symbol-Price-Ticker // swap
|
|
4157
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Symbol-Price-Ticker // future
|
|
4158
|
+
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the last prices
|
|
4159
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4160
|
+
* @param {string} [params.subType] "linear" or "inverse"
|
|
4161
|
+
* @returns {object} a dictionary of lastprices structures
|
|
4162
|
+
*/
|
|
4151
4163
|
async fetchLastPrices(symbols = undefined, params = {}) {
|
|
4152
|
-
/**
|
|
4153
|
-
* @method
|
|
4154
|
-
* @name binance#fetchLastPrices
|
|
4155
|
-
* @description fetches the last price for multiple markets
|
|
4156
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#symbol-price-ticker // spot
|
|
4157
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Symbol-Price-Ticker // swap
|
|
4158
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Symbol-Price-Ticker // future
|
|
4159
|
-
* @param {string[]|undefined} symbols unified symbols of the markets to fetch the last prices
|
|
4160
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4161
|
-
* @param {string} [params.subType] "linear" or "inverse"
|
|
4162
|
-
* @returns {object} a dictionary of lastprices structures
|
|
4163
|
-
*/
|
|
4164
4164
|
await this.loadMarkets();
|
|
4165
4165
|
symbols = this.marketSymbols(symbols, undefined, true, true, true);
|
|
4166
4166
|
const market = this.getMarketFromSymbols(symbols);
|
|
@@ -4253,21 +4253,21 @@ class binance extends binance$1 {
|
|
|
4253
4253
|
'info': entry,
|
|
4254
4254
|
};
|
|
4255
4255
|
}
|
|
4256
|
+
/**
|
|
4257
|
+
* @method
|
|
4258
|
+
* @name binance#fetchTickers
|
|
4259
|
+
* @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
|
4260
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#24hr-ticker-price-change-statistics // spot
|
|
4261
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/24hr-Ticker-Price-Change-Statistics // swap
|
|
4262
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/24hr-Ticker-Price-Change-Statistics // future
|
|
4263
|
+
* @see https://developers.binance.com/docs/derivatives/option/market-data/24hr-Ticker-Price-Change-Statistics // option
|
|
4264
|
+
* @param {string[]} [symbols] unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
4265
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4266
|
+
* @param {string} [params.subType] "linear" or "inverse"
|
|
4267
|
+
* @param {string} [params.type] 'spot', 'option', use params["subType"] for swap and future markets
|
|
4268
|
+
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
4269
|
+
*/
|
|
4256
4270
|
async fetchTickers(symbols = undefined, params = {}) {
|
|
4257
|
-
/**
|
|
4258
|
-
* @method
|
|
4259
|
-
* @name binance#fetchTickers
|
|
4260
|
-
* @description fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
|
4261
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#24hr-ticker-price-change-statistics // spot
|
|
4262
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/24hr-Ticker-Price-Change-Statistics // swap
|
|
4263
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/24hr-Ticker-Price-Change-Statistics // future
|
|
4264
|
-
* @see https://developers.binance.com/docs/derivatives/option/market-data/24hr-Ticker-Price-Change-Statistics // option
|
|
4265
|
-
* @param {string[]} [symbols] unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
4266
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4267
|
-
* @param {string} [params.subType] "linear" or "inverse"
|
|
4268
|
-
* @param {string} [params.type] 'spot', 'option', use params["subType"] for swap and future markets
|
|
4269
|
-
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
4270
|
-
*/
|
|
4271
4271
|
await this.loadMarkets();
|
|
4272
4272
|
symbols = this.marketSymbols(symbols, undefined, true, true, true);
|
|
4273
4273
|
const market = this.getMarketFromSymbols(symbols);
|
|
@@ -4297,18 +4297,18 @@ class binance extends binance$1 {
|
|
|
4297
4297
|
}
|
|
4298
4298
|
return this.parseTickers(response, symbols);
|
|
4299
4299
|
}
|
|
4300
|
+
/**
|
|
4301
|
+
* @method
|
|
4302
|
+
* @name binance#fetchMarkPrice
|
|
4303
|
+
* @description fetches mark price for the market
|
|
4304
|
+
* @see https://binance-docs.github.io/apidocs/futures/en/#mark-price
|
|
4305
|
+
* @see https://binance-docs.github.io/apidocs/delivery/en/#index-price-and-mark-price
|
|
4306
|
+
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
4307
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4308
|
+
* @param {string} [params.subType] "linear" or "inverse"
|
|
4309
|
+
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
4310
|
+
*/
|
|
4300
4311
|
async fetchMarkPrice(symbol, params = {}) {
|
|
4301
|
-
/**
|
|
4302
|
-
* @method
|
|
4303
|
-
* @name binance#fetchMarkPrice
|
|
4304
|
-
* @description fetches mark price for the market
|
|
4305
|
-
* @see https://binance-docs.github.io/apidocs/futures/en/#mark-price
|
|
4306
|
-
* @see https://binance-docs.github.io/apidocs/delivery/en/#index-price-and-mark-price
|
|
4307
|
-
* @param {string} symbol unified symbol of the market to fetch the ticker for
|
|
4308
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4309
|
-
* @param {string} [params.subType] "linear" or "inverse"
|
|
4310
|
-
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
4311
|
-
*/
|
|
4312
4312
|
await this.loadMarkets();
|
|
4313
4313
|
const market = this.market(symbol);
|
|
4314
4314
|
let type = undefined;
|
|
@@ -4333,18 +4333,18 @@ class binance extends binance$1 {
|
|
|
4333
4333
|
}
|
|
4334
4334
|
return this.parseTicker(response, market);
|
|
4335
4335
|
}
|
|
4336
|
+
/**
|
|
4337
|
+
* @method
|
|
4338
|
+
* @name binance#fetchMarkPrices
|
|
4339
|
+
* @description fetches mark prices for multiple markets
|
|
4340
|
+
* @see https://binance-docs.github.io/apidocs/futures/en/#mark-price
|
|
4341
|
+
* @see https://binance-docs.github.io/apidocs/delivery/en/#index-price-and-mark-price
|
|
4342
|
+
* @param {string[]} [symbols] unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
4343
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4344
|
+
* @param {string} [params.subType] "linear" or "inverse"
|
|
4345
|
+
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
4346
|
+
*/
|
|
4336
4347
|
async fetchMarkPrices(symbols = undefined, params = {}) {
|
|
4337
|
-
/**
|
|
4338
|
-
* @method
|
|
4339
|
-
* @name binance#fetchMarkPrices
|
|
4340
|
-
* @description fetches mark prices for multiple markets
|
|
4341
|
-
* @see https://binance-docs.github.io/apidocs/futures/en/#mark-price
|
|
4342
|
-
* @see https://binance-docs.github.io/apidocs/delivery/en/#index-price-and-mark-price
|
|
4343
|
-
* @param {string[]} [symbols] unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
4344
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4345
|
-
* @param {string} [params.subType] "linear" or "inverse"
|
|
4346
|
-
* @returns {object} a dictionary of [ticker structures]{@link https://docs.ccxt.com/#/?id=ticker-structure}
|
|
4347
|
-
*/
|
|
4348
4348
|
await this.loadMarkets();
|
|
4349
4349
|
symbols = this.marketSymbols(symbols, undefined, true, true, true);
|
|
4350
4350
|
const market = this.getMarketFromSymbols(symbols);
|
|
@@ -4427,31 +4427,31 @@ class binance extends binance$1 {
|
|
|
4427
4427
|
this.safeNumber2(ohlcv, volumeIndex, 'volume'),
|
|
4428
4428
|
];
|
|
4429
4429
|
}
|
|
4430
|
+
/**
|
|
4431
|
+
* @method
|
|
4432
|
+
* @name binance#fetchOHLCV
|
|
4433
|
+
* @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
4434
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#klinecandlestick-data
|
|
4435
|
+
* @see https://developers.binance.com/docs/derivatives/option/market-data/Kline-Candlestick-Data
|
|
4436
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Kline-Candlestick-Data
|
|
4437
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Index-Price-Kline-Candlestick-Data
|
|
4438
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Mark-Price-Kline-Candlestick-Data
|
|
4439
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Premium-Index-Kline-Data
|
|
4440
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Kline-Candlestick-Data
|
|
4441
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Index-Price-Kline-Candlestick-Data
|
|
4442
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Mark-Price-Kline-Candlestick-Data
|
|
4443
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Premium-Index-Kline-Data
|
|
4444
|
+
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
4445
|
+
* @param {string} timeframe the length of time each candle represents
|
|
4446
|
+
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
4447
|
+
* @param {int} [limit] the maximum amount of candles to fetch
|
|
4448
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4449
|
+
* @param {string} [params.price] "mark" or "index" for mark price and index price candles
|
|
4450
|
+
* @param {int} [params.until] timestamp in ms of the latest candle to fetch
|
|
4451
|
+
* @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)
|
|
4452
|
+
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
4453
|
+
*/
|
|
4430
4454
|
async fetchOHLCV(symbol, timeframe = '1m', since = undefined, limit = undefined, params = {}) {
|
|
4431
|
-
/**
|
|
4432
|
-
* @method
|
|
4433
|
-
* @name binance#fetchOHLCV
|
|
4434
|
-
* @description fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
4435
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#klinecandlestick-data
|
|
4436
|
-
* @see https://developers.binance.com/docs/derivatives/option/market-data/Kline-Candlestick-Data
|
|
4437
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Kline-Candlestick-Data
|
|
4438
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Index-Price-Kline-Candlestick-Data
|
|
4439
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Mark-Price-Kline-Candlestick-Data
|
|
4440
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Premium-Index-Kline-Data
|
|
4441
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Kline-Candlestick-Data
|
|
4442
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Index-Price-Kline-Candlestick-Data
|
|
4443
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Mark-Price-Kline-Candlestick-Data
|
|
4444
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Premium-Index-Kline-Data
|
|
4445
|
-
* @param {string} symbol unified symbol of the market to fetch OHLCV data for
|
|
4446
|
-
* @param {string} timeframe the length of time each candle represents
|
|
4447
|
-
* @param {int} [since] timestamp in ms of the earliest candle to fetch
|
|
4448
|
-
* @param {int} [limit] the maximum amount of candles to fetch
|
|
4449
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4450
|
-
* @param {string} [params.price] "mark" or "index" for mark price and index price candles
|
|
4451
|
-
* @param {int} [params.until] timestamp in ms of the latest candle to fetch
|
|
4452
|
-
* @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)
|
|
4453
|
-
* @returns {int[][]} A list of candles ordered as timestamp, open, high, low, close, volume
|
|
4454
|
-
*/
|
|
4455
4455
|
await this.loadMarkets();
|
|
4456
4456
|
let paginate = false;
|
|
4457
4457
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchOHLCV', 'paginate', false);
|
|
@@ -4836,36 +4836,36 @@ class binance extends binance$1 {
|
|
|
4836
4836
|
'fee': fee,
|
|
4837
4837
|
}, market);
|
|
4838
4838
|
}
|
|
4839
|
+
/**
|
|
4840
|
+
* @method
|
|
4841
|
+
* @name binance#fetchTrades
|
|
4842
|
+
* @description get the list of most recent trades for a particular symbol
|
|
4843
|
+
* Default fetchTradesMethod
|
|
4844
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#compressedaggregate-trades-list // publicGetAggTrades (spot)
|
|
4845
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Compressed-Aggregate-Trades-List // fapiPublicGetAggTrades (swap)
|
|
4846
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Compressed-Aggregate-Trades-List // dapiPublicGetAggTrades (future)
|
|
4847
|
+
* @see https://developers.binance.com/docs/derivatives/option/market-data/Recent-Trades-List // eapiPublicGetTrades (option)
|
|
4848
|
+
* Other fetchTradesMethod
|
|
4849
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#recent-trades-list // publicGetTrades (spot)
|
|
4850
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Recent-Trades-List // fapiPublicGetTrades (swap)
|
|
4851
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Recent-Trades-List // dapiPublicGetTrades (future)
|
|
4852
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#old-trade-lookup // publicGetHistoricalTrades (spot)
|
|
4853
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Old-Trades-Lookup // fapiPublicGetHistoricalTrades (swap)
|
|
4854
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Old-Trades-Lookup // dapiPublicGetHistoricalTrades (future)
|
|
4855
|
+
* @see https://developers.binance.com/docs/derivatives/option/market-data/Old-Trades-Lookup // eapiPublicGetHistoricalTrades (option)
|
|
4856
|
+
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
4857
|
+
* @param {int} [since] only used when fetchTradesMethod is 'publicGetAggTrades', 'fapiPublicGetAggTrades', or 'dapiPublicGetAggTrades'
|
|
4858
|
+
* @param {int} [limit] default 500, max 1000
|
|
4859
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4860
|
+
* @param {int} [params.until] only used when fetchTradesMethod is 'publicGetAggTrades', 'fapiPublicGetAggTrades', or 'dapiPublicGetAggTrades'
|
|
4861
|
+
* @param {int} [params.fetchTradesMethod] 'publicGetAggTrades' (spot default), 'fapiPublicGetAggTrades' (swap default), 'dapiPublicGetAggTrades' (future default), 'eapiPublicGetTrades' (option default), 'publicGetTrades', 'fapiPublicGetTrades', 'dapiPublicGetTrades', 'publicGetHistoricalTrades', 'fapiPublicGetHistoricalTrades', 'dapiPublicGetHistoricalTrades', 'eapiPublicGetHistoricalTrades'
|
|
4862
|
+
* @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)
|
|
4863
|
+
*
|
|
4864
|
+
* EXCHANGE SPECIFIC PARAMETERS
|
|
4865
|
+
* @param {int} [params.fromId] trade id to fetch from, default gets most recent trades, not used when fetchTradesMethod is 'publicGetTrades', 'fapiPublicGetTrades', 'dapiPublicGetTrades', or 'eapiPublicGetTrades'
|
|
4866
|
+
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
|
|
4867
|
+
*/
|
|
4839
4868
|
async fetchTrades(symbol, since = undefined, limit = undefined, params = {}) {
|
|
4840
|
-
/**
|
|
4841
|
-
* @method
|
|
4842
|
-
* @name binance#fetchTrades
|
|
4843
|
-
* @description get the list of most recent trades for a particular symbol
|
|
4844
|
-
* Default fetchTradesMethod
|
|
4845
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#compressedaggregate-trades-list // publicGetAggTrades (spot)
|
|
4846
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Compressed-Aggregate-Trades-List // fapiPublicGetAggTrades (swap)
|
|
4847
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Compressed-Aggregate-Trades-List // dapiPublicGetAggTrades (future)
|
|
4848
|
-
* @see https://developers.binance.com/docs/derivatives/option/market-data/Recent-Trades-List // eapiPublicGetTrades (option)
|
|
4849
|
-
* Other fetchTradesMethod
|
|
4850
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#recent-trades-list // publicGetTrades (spot)
|
|
4851
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Recent-Trades-List // fapiPublicGetTrades (swap)
|
|
4852
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Recent-Trades-List // dapiPublicGetTrades (future)
|
|
4853
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#old-trade-lookup // publicGetHistoricalTrades (spot)
|
|
4854
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Old-Trades-Lookup // fapiPublicGetHistoricalTrades (swap)
|
|
4855
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Old-Trades-Lookup // dapiPublicGetHistoricalTrades (future)
|
|
4856
|
-
* @see https://developers.binance.com/docs/derivatives/option/market-data/Old-Trades-Lookup // eapiPublicGetHistoricalTrades (option)
|
|
4857
|
-
* @param {string} symbol unified symbol of the market to fetch trades for
|
|
4858
|
-
* @param {int} [since] only used when fetchTradesMethod is 'publicGetAggTrades', 'fapiPublicGetAggTrades', or 'dapiPublicGetAggTrades'
|
|
4859
|
-
* @param {int} [limit] default 500, max 1000
|
|
4860
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4861
|
-
* @param {int} [params.until] only used when fetchTradesMethod is 'publicGetAggTrades', 'fapiPublicGetAggTrades', or 'dapiPublicGetAggTrades'
|
|
4862
|
-
* @param {int} [params.fetchTradesMethod] 'publicGetAggTrades' (spot default), 'fapiPublicGetAggTrades' (swap default), 'dapiPublicGetAggTrades' (future default), 'eapiPublicGetTrades' (option default), 'publicGetTrades', 'fapiPublicGetTrades', 'dapiPublicGetTrades', 'publicGetHistoricalTrades', 'fapiPublicGetHistoricalTrades', 'dapiPublicGetHistoricalTrades', 'eapiPublicGetHistoricalTrades'
|
|
4863
|
-
* @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)
|
|
4864
|
-
*
|
|
4865
|
-
* EXCHANGE SPECIFIC PARAMETERS
|
|
4866
|
-
* @param {int} [params.fromId] trade id to fetch from, default gets most recent trades, not used when fetchTradesMethod is 'publicGetTrades', 'fapiPublicGetTrades', 'dapiPublicGetTrades', or 'eapiPublicGetTrades'
|
|
4867
|
-
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=public-trades}
|
|
4868
|
-
*/
|
|
4869
4869
|
await this.loadMarkets();
|
|
4870
4870
|
let paginate = false;
|
|
4871
4871
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchTrades', 'paginate');
|
|
@@ -4980,23 +4980,23 @@ class binance extends binance$1 {
|
|
|
4980
4980
|
//
|
|
4981
4981
|
return this.parseTrades(response, market, since, limit);
|
|
4982
4982
|
}
|
|
4983
|
+
/**
|
|
4984
|
+
* @method
|
|
4985
|
+
* @name binance#editSpotOrder
|
|
4986
|
+
* @ignore
|
|
4987
|
+
* @description edit a trade order
|
|
4988
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#cancel-an-existing-order-and-send-a-new-order-trade
|
|
4989
|
+
* @param {string} id cancel order id
|
|
4990
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
4991
|
+
* @param {string} type 'market' or 'limit' or 'STOP_LOSS' or 'STOP_LOSS_LIMIT' or 'TAKE_PROFIT' or 'TAKE_PROFIT_LIMIT' or 'STOP'
|
|
4992
|
+
* @param {string} side 'buy' or 'sell'
|
|
4993
|
+
* @param {float} amount how much of currency you want to trade in units of base currency
|
|
4994
|
+
* @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
4995
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4996
|
+
* @param {string} [params.marginMode] 'cross' or 'isolated', for spot margin trading
|
|
4997
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4998
|
+
*/
|
|
4983
4999
|
async editSpotOrder(id, symbol, type, side, amount, price = undefined, params = {}) {
|
|
4984
|
-
/**
|
|
4985
|
-
* @method
|
|
4986
|
-
* @name binance#editSpotOrder
|
|
4987
|
-
* @ignore
|
|
4988
|
-
* @description edit a trade order
|
|
4989
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#cancel-an-existing-order-and-send-a-new-order-trade
|
|
4990
|
-
* @param {string} id cancel order id
|
|
4991
|
-
* @param {string} symbol unified symbol of the market to create an order in
|
|
4992
|
-
* @param {string} type 'market' or 'limit' or 'STOP_LOSS' or 'STOP_LOSS_LIMIT' or 'TAKE_PROFIT' or 'TAKE_PROFIT_LIMIT' or 'STOP'
|
|
4993
|
-
* @param {string} side 'buy' or 'sell'
|
|
4994
|
-
* @param {float} amount how much of currency you want to trade in units of base currency
|
|
4995
|
-
* @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
4996
|
-
* @param {string} [params.marginMode] 'cross' or 'isolated', for spot margin trading
|
|
4997
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
4998
|
-
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
4999
|
-
*/
|
|
5000
5000
|
await this.loadMarkets();
|
|
5001
5001
|
const market = this.market(symbol);
|
|
5002
5002
|
if (!market['spot']) {
|
|
@@ -5204,22 +5204,22 @@ class binance extends binance$1 {
|
|
|
5204
5204
|
params = this.omit(params, ['clientOrderId', 'newClientOrderId']);
|
|
5205
5205
|
return request;
|
|
5206
5206
|
}
|
|
5207
|
+
/**
|
|
5208
|
+
* @method
|
|
5209
|
+
* @name binance#editContractOrder
|
|
5210
|
+
* @description edit a trade order
|
|
5211
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Order
|
|
5212
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Modify-Order
|
|
5213
|
+
* @param {string} id cancel order id
|
|
5214
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
5215
|
+
* @param {string} type 'market' or 'limit'
|
|
5216
|
+
* @param {string} side 'buy' or 'sell'
|
|
5217
|
+
* @param {float} amount how much of currency you want to trade in units of base currency
|
|
5218
|
+
* @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
5219
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5220
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
5221
|
+
*/
|
|
5207
5222
|
async editContractOrder(id, symbol, type, side, amount, price = undefined, params = {}) {
|
|
5208
|
-
/**
|
|
5209
|
-
* @method
|
|
5210
|
-
* @name binance#editContractOrder
|
|
5211
|
-
* @description edit a trade order
|
|
5212
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Order
|
|
5213
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Modify-Order
|
|
5214
|
-
* @param {string} id cancel order id
|
|
5215
|
-
* @param {string} symbol unified symbol of the market to create an order in
|
|
5216
|
-
* @param {string} type 'market' or 'limit'
|
|
5217
|
-
* @param {string} side 'buy' or 'sell'
|
|
5218
|
-
* @param {float} amount how much of currency you want to trade in units of base currency
|
|
5219
|
-
* @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
5220
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5221
|
-
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
5222
|
-
*/
|
|
5223
5223
|
await this.loadMarkets();
|
|
5224
5224
|
const market = this.market(symbol);
|
|
5225
5225
|
const request = this.editContractOrderRequest(id, symbol, type, side, amount, price, params);
|
|
@@ -5259,23 +5259,23 @@ class binance extends binance$1 {
|
|
|
5259
5259
|
//
|
|
5260
5260
|
return this.parseOrder(response, market);
|
|
5261
5261
|
}
|
|
5262
|
+
/**
|
|
5263
|
+
* @method
|
|
5264
|
+
* @name binance#editOrder
|
|
5265
|
+
* @description edit a trade order
|
|
5266
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#cancel-an-existing-order-and-send-a-new-order-trade
|
|
5267
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Order
|
|
5268
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Modify-Order
|
|
5269
|
+
* @param {string} id cancel order id
|
|
5270
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
5271
|
+
* @param {string} type 'market' or 'limit'
|
|
5272
|
+
* @param {string} side 'buy' or 'sell'
|
|
5273
|
+
* @param {float} amount how much of currency you want to trade in units of base currency
|
|
5274
|
+
* @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
5275
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5276
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
5277
|
+
*/
|
|
5262
5278
|
async editOrder(id, symbol, type, side, amount = undefined, price = undefined, params = {}) {
|
|
5263
|
-
/**
|
|
5264
|
-
* @method
|
|
5265
|
-
* @name binance#editOrder
|
|
5266
|
-
* @description edit a trade order
|
|
5267
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#cancel-an-existing-order-and-send-a-new-order-trade
|
|
5268
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Order
|
|
5269
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Modify-Order
|
|
5270
|
-
* @param {string} id cancel order id
|
|
5271
|
-
* @param {string} symbol unified symbol of the market to create an order in
|
|
5272
|
-
* @param {string} type 'market' or 'limit'
|
|
5273
|
-
* @param {string} side 'buy' or 'sell'
|
|
5274
|
-
* @param {float} amount how much of currency you want to trade in units of base currency
|
|
5275
|
-
* @param {float} [price] the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
5276
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5277
|
-
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
5278
|
-
*/
|
|
5279
5279
|
await this.loadMarkets();
|
|
5280
5280
|
const market = this.market(symbol);
|
|
5281
5281
|
if (market['option']) {
|
|
@@ -5868,17 +5868,18 @@ class binance extends binance$1 {
|
|
|
5868
5868
|
'trades': fills,
|
|
5869
5869
|
}, market);
|
|
5870
5870
|
}
|
|
5871
|
+
/**
|
|
5872
|
+
* @method
|
|
5873
|
+
* @name binance#createOrders
|
|
5874
|
+
* @description *contract only* create a list of trade orders
|
|
5875
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Place-Multiple-Orders
|
|
5876
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Place-Multiple-Orders
|
|
5877
|
+
* @see https://developers.binance.com/docs/derivatives/option/trade/Place-Multiple-Orders
|
|
5878
|
+
* @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
|
|
5879
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5880
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
5881
|
+
*/
|
|
5871
5882
|
async createOrders(orders, params = {}) {
|
|
5872
|
-
/**
|
|
5873
|
-
* @method
|
|
5874
|
-
* @name binance#createOrders
|
|
5875
|
-
* @description *contract only* create a list of trade orders
|
|
5876
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Place-Multiple-Orders
|
|
5877
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Place-Multiple-Orders
|
|
5878
|
-
* @see https://developers.binance.com/docs/derivatives/option/trade/Place-Multiple-Orders
|
|
5879
|
-
* @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
|
|
5880
|
-
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
5881
|
-
*/
|
|
5882
5883
|
await this.loadMarkets();
|
|
5883
5884
|
const ordersRequests = [];
|
|
5884
5885
|
let orderSymbols = [];
|
|
@@ -5949,44 +5950,44 @@ class binance extends binance$1 {
|
|
|
5949
5950
|
//
|
|
5950
5951
|
return this.parseOrders(response);
|
|
5951
5952
|
}
|
|
5953
|
+
/**
|
|
5954
|
+
* @method
|
|
5955
|
+
* @name binance#createOrder
|
|
5956
|
+
* @description create a trade order
|
|
5957
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#new-order-trade
|
|
5958
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#test-new-order-trade
|
|
5959
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/New-Order
|
|
5960
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/New-Order
|
|
5961
|
+
* @see https://developers.binance.com/docs/derivatives/option/trade/New-Order
|
|
5962
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#sor
|
|
5963
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#test-new-order-using-sor-trade
|
|
5964
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-UM-Order
|
|
5965
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-CM-Order
|
|
5966
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-Margin-Order
|
|
5967
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-UM-Conditional-Order
|
|
5968
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-CM-Conditional-Order
|
|
5969
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
5970
|
+
* @param {string} type 'market' or 'limit' or 'STOP_LOSS' or 'STOP_LOSS_LIMIT' or 'TAKE_PROFIT' or 'TAKE_PROFIT_LIMIT' or 'STOP'
|
|
5971
|
+
* @param {string} side 'buy' or 'sell'
|
|
5972
|
+
* @param {float} amount how much of you want to trade in units of the base currency
|
|
5973
|
+
* @param {float} [price] the price that the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
5974
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5975
|
+
* @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.
|
|
5976
|
+
* @param {string} [params.marginMode] 'cross' or 'isolated', for spot margin trading
|
|
5977
|
+
* @param {boolean} [params.sor] *spot only* whether to use SOR (Smart Order Routing) or not, default is false
|
|
5978
|
+
* @param {boolean} [params.test] *spot only* whether to use the test endpoint or not, default is false
|
|
5979
|
+
* @param {float} [params.trailingPercent] the percent to trail away from the current market price
|
|
5980
|
+
* @param {float} [params.trailingTriggerPrice] the price to trigger a trailing order, default uses the price argument
|
|
5981
|
+
* @param {float} [params.triggerPrice] the price that a trigger order is triggered at
|
|
5982
|
+
* @param {float} [params.stopLossPrice] the price that a stop loss order is triggered at
|
|
5983
|
+
* @param {float} [params.takeProfitPrice] the price that a take profit order is triggered at
|
|
5984
|
+
* @param {boolean} [params.portfolioMargin] set to true if you would like to create an order in a portfolio margin account
|
|
5985
|
+
* @param {string} [params.stopLossOrTakeProfit] 'stopLoss' or 'takeProfit', required for spot trailing orders
|
|
5986
|
+
* @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
|
|
5987
|
+
* @param {bool} [params.hedged] *swap and portfolio margin only* true for hedged mode, false for one way mode, default is false
|
|
5988
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
5989
|
+
*/
|
|
5952
5990
|
async createOrder(symbol, type, side, amount, price = undefined, params = {}) {
|
|
5953
|
-
/**
|
|
5954
|
-
* @method
|
|
5955
|
-
* @name binance#createOrder
|
|
5956
|
-
* @description create a trade order
|
|
5957
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#new-order-trade
|
|
5958
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#test-new-order-trade
|
|
5959
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/New-Order
|
|
5960
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/New-Order
|
|
5961
|
-
* @see https://developers.binance.com/docs/derivatives/option/trade/New-Order
|
|
5962
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#sor
|
|
5963
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#test-new-order-using-sor-trade
|
|
5964
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-UM-Order
|
|
5965
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-CM-Order
|
|
5966
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-Margin-Order
|
|
5967
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-UM-Conditional-Order
|
|
5968
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/New-CM-Conditional-Order
|
|
5969
|
-
* @param {string} symbol unified symbol of the market to create an order in
|
|
5970
|
-
* @param {string} type 'market' or 'limit' or 'STOP_LOSS' or 'STOP_LOSS_LIMIT' or 'TAKE_PROFIT' or 'TAKE_PROFIT_LIMIT' or 'STOP'
|
|
5971
|
-
* @param {string} side 'buy' or 'sell'
|
|
5972
|
-
* @param {float} amount how much of you want to trade in units of the base currency
|
|
5973
|
-
* @param {float} [price] the price that the order is to be fulfilled, in units of the quote currency, ignored in market orders
|
|
5974
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
5975
|
-
* @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.
|
|
5976
|
-
* @param {string} [params.marginMode] 'cross' or 'isolated', for spot margin trading
|
|
5977
|
-
* @param {boolean} [params.sor] *spot only* whether to use SOR (Smart Order Routing) or not, default is false
|
|
5978
|
-
* @param {boolean} [params.test] *spot only* whether to use the test endpoint or not, default is false
|
|
5979
|
-
* @param {float} [params.trailingPercent] the percent to trail away from the current market price
|
|
5980
|
-
* @param {float} [params.trailingTriggerPrice] the price to trigger a trailing order, default uses the price argument
|
|
5981
|
-
* @param {float} [params.triggerPrice] the price that a trigger order is triggered at
|
|
5982
|
-
* @param {float} [params.stopLossPrice] the price that a stop loss order is triggered at
|
|
5983
|
-
* @param {float} [params.takeProfitPrice] the price that a take profit order is triggered at
|
|
5984
|
-
* @param {boolean} [params.portfolioMargin] set to true if you would like to create an order in a portfolio margin account
|
|
5985
|
-
* @param {string} [params.stopLossOrTakeProfit] 'stopLoss' or 'takeProfit', required for spot trailing orders
|
|
5986
|
-
* @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
|
|
5987
|
-
* @param {bool} [params.hedged] *swap and portfolio margin only* true for hedged mode, false for one way mode, default is false
|
|
5988
|
-
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
5989
|
-
*/
|
|
5990
5991
|
await this.loadMarkets();
|
|
5991
5992
|
const market = this.market(symbol);
|
|
5992
5993
|
const marketType = this.safeString(params, 'type', market['type']);
|
|
@@ -6390,18 +6391,18 @@ class binance extends binance$1 {
|
|
|
6390
6391
|
const requestParams = this.omit(params, ['type', 'newClientOrderId', 'clientOrderId', 'postOnly', 'stopLossPrice', 'takeProfitPrice', 'stopPrice', 'triggerPrice', 'trailingTriggerPrice', 'trailingPercent', 'quoteOrderQty', 'cost', 'test', 'hedged']);
|
|
6391
6392
|
return this.extend(request, requestParams);
|
|
6392
6393
|
}
|
|
6394
|
+
/**
|
|
6395
|
+
* @method
|
|
6396
|
+
* @name binance#createMarketOrderWithCost
|
|
6397
|
+
* @description create a market order by providing the symbol, side and cost
|
|
6398
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#new-order-trade
|
|
6399
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
6400
|
+
* @param {string} side 'buy' or 'sell'
|
|
6401
|
+
* @param {float} cost how much you want to trade in units of the quote currency
|
|
6402
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6403
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
6404
|
+
*/
|
|
6393
6405
|
async createMarketOrderWithCost(symbol, side, cost, params = {}) {
|
|
6394
|
-
/**
|
|
6395
|
-
* @method
|
|
6396
|
-
* @name binance#createMarketOrderWithCost
|
|
6397
|
-
* @description create a market order by providing the symbol, side and cost
|
|
6398
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#new-order-trade
|
|
6399
|
-
* @param {string} symbol unified symbol of the market to create an order in
|
|
6400
|
-
* @param {string} side 'buy' or 'sell'
|
|
6401
|
-
* @param {float} cost how much you want to trade in units of the quote currency
|
|
6402
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6403
|
-
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
6404
|
-
*/
|
|
6405
6406
|
await this.loadMarkets();
|
|
6406
6407
|
const market = this.market(symbol);
|
|
6407
6408
|
if (!market['spot']) {
|
|
@@ -6410,17 +6411,17 @@ class binance extends binance$1 {
|
|
|
6410
6411
|
params['cost'] = cost;
|
|
6411
6412
|
return await this.createOrder(symbol, 'market', side, cost, undefined, params);
|
|
6412
6413
|
}
|
|
6414
|
+
/**
|
|
6415
|
+
* @method
|
|
6416
|
+
* @name binance#createMarketBuyOrderWithCost
|
|
6417
|
+
* @description create a market buy order by providing the symbol and cost
|
|
6418
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#new-order-trade
|
|
6419
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
6420
|
+
* @param {float} cost how much you want to trade in units of the quote currency
|
|
6421
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6422
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
6423
|
+
*/
|
|
6413
6424
|
async createMarketBuyOrderWithCost(symbol, cost, params = {}) {
|
|
6414
|
-
/**
|
|
6415
|
-
* @method
|
|
6416
|
-
* @name binance#createMarketBuyOrderWithCost
|
|
6417
|
-
* @description create a market buy order by providing the symbol and cost
|
|
6418
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#new-order-trade
|
|
6419
|
-
* @param {string} symbol unified symbol of the market to create an order in
|
|
6420
|
-
* @param {float} cost how much you want to trade in units of the quote currency
|
|
6421
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6422
|
-
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
6423
|
-
*/
|
|
6424
6425
|
await this.loadMarkets();
|
|
6425
6426
|
const market = this.market(symbol);
|
|
6426
6427
|
if (!market['spot']) {
|
|
@@ -6429,17 +6430,17 @@ class binance extends binance$1 {
|
|
|
6429
6430
|
params['cost'] = cost;
|
|
6430
6431
|
return await this.createOrder(symbol, 'market', 'buy', cost, undefined, params);
|
|
6431
6432
|
}
|
|
6433
|
+
/**
|
|
6434
|
+
* @method
|
|
6435
|
+
* @name binance#createMarketSellOrderWithCost
|
|
6436
|
+
* @description create a market sell order by providing the symbol and cost
|
|
6437
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#new-order-trade
|
|
6438
|
+
* @param {string} symbol unified symbol of the market to create an order in
|
|
6439
|
+
* @param {float} cost how much you want to trade in units of the quote currency
|
|
6440
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6441
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
6442
|
+
*/
|
|
6432
6443
|
async createMarketSellOrderWithCost(symbol, cost, params = {}) {
|
|
6433
|
-
/**
|
|
6434
|
-
* @method
|
|
6435
|
-
* @name binance#createMarketSellOrderWithCost
|
|
6436
|
-
* @description create a market sell order by providing the symbol and cost
|
|
6437
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#new-order-trade
|
|
6438
|
-
* @param {string} symbol unified symbol of the market to create an order in
|
|
6439
|
-
* @param {float} cost how much you want to trade in units of the quote currency
|
|
6440
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6441
|
-
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
6442
|
-
*/
|
|
6443
6444
|
await this.loadMarkets();
|
|
6444
6445
|
const market = this.market(symbol);
|
|
6445
6446
|
if (!market['spot']) {
|
|
@@ -6448,25 +6449,25 @@ class binance extends binance$1 {
|
|
|
6448
6449
|
params['quoteOrderQty'] = cost;
|
|
6449
6450
|
return await this.createOrder(symbol, 'market', 'sell', cost, undefined, params);
|
|
6450
6451
|
}
|
|
6452
|
+
/**
|
|
6453
|
+
* @method
|
|
6454
|
+
* @name binance#fetchOrder
|
|
6455
|
+
* @description fetches information on an order made by the user
|
|
6456
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#query-order-user_data
|
|
6457
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-Order
|
|
6458
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Query-Order
|
|
6459
|
+
* @see https://developers.binance.com/docs/derivatives/option/trade/Query-Single-Order
|
|
6460
|
+
* @see https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-Order
|
|
6461
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-UM-Order
|
|
6462
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-CM-Order
|
|
6463
|
+
* @param {string} id the order id
|
|
6464
|
+
* @param {string} symbol unified symbol of the market the order was made in
|
|
6465
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6466
|
+
* @param {string} [params.marginMode] 'cross' or 'isolated', for spot margin trading
|
|
6467
|
+
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch an order in a portfolio margin account
|
|
6468
|
+
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
6469
|
+
*/
|
|
6451
6470
|
async fetchOrder(id, symbol = undefined, params = {}) {
|
|
6452
|
-
/**
|
|
6453
|
-
* @method
|
|
6454
|
-
* @name binance#fetchOrder
|
|
6455
|
-
* @description fetches information on an order made by the user
|
|
6456
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#query-order-user_data
|
|
6457
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-Order
|
|
6458
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Query-Order
|
|
6459
|
-
* @see https://developers.binance.com/docs/derivatives/option/trade/Query-Single-Order
|
|
6460
|
-
* @see https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-Order
|
|
6461
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-UM-Order
|
|
6462
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-CM-Order
|
|
6463
|
-
* @param {string} id the order id
|
|
6464
|
-
* @param {string} symbol unified symbol of the market the order was made in
|
|
6465
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6466
|
-
* @param {string} [params.marginMode] 'cross' or 'isolated', for spot margin trading
|
|
6467
|
-
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch an order in a portfolio margin account
|
|
6468
|
-
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
6469
|
-
*/
|
|
6470
6471
|
if (symbol === undefined) {
|
|
6471
6472
|
throw new errors.ArgumentsRequired(this.id + ' fetchOrder() requires a symbol argument');
|
|
6472
6473
|
}
|
|
@@ -6530,31 +6531,31 @@ class binance extends binance$1 {
|
|
|
6530
6531
|
}
|
|
6531
6532
|
return this.parseOrder(response, market);
|
|
6532
6533
|
}
|
|
6534
|
+
/**
|
|
6535
|
+
* @method
|
|
6536
|
+
* @name binance#fetchOrders
|
|
6537
|
+
* @description fetches information on multiple orders made by the user
|
|
6538
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#all-orders-user_data
|
|
6539
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders
|
|
6540
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/All-Orders
|
|
6541
|
+
* @see https://developers.binance.com/docs/derivatives/option/trade/Query-Option-Order-History
|
|
6542
|
+
* @see https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-All-Orders
|
|
6543
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Orders
|
|
6544
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Orders
|
|
6545
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Conditional-Orders
|
|
6546
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Conditional-Orders
|
|
6547
|
+
* @param {string} symbol unified market symbol of the market orders were made in
|
|
6548
|
+
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
6549
|
+
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
6550
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6551
|
+
* @param {string} [params.marginMode] 'cross' or 'isolated', for spot margin trading
|
|
6552
|
+
* @param {int} [params.until] the latest time in ms to fetch orders for
|
|
6553
|
+
* @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)
|
|
6554
|
+
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch orders in a portfolio margin account
|
|
6555
|
+
* @param {boolean} [params.stop] set to true if you would like to fetch portfolio margin account stop or conditional orders
|
|
6556
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
6557
|
+
*/
|
|
6533
6558
|
async fetchOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
6534
|
-
/**
|
|
6535
|
-
* @method
|
|
6536
|
-
* @name binance#fetchOrders
|
|
6537
|
-
* @description fetches information on multiple orders made by the user
|
|
6538
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#all-orders-user_data
|
|
6539
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders
|
|
6540
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/All-Orders
|
|
6541
|
-
* @see https://developers.binance.com/docs/derivatives/option/trade/Query-Option-Order-History
|
|
6542
|
-
* @see https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-All-Orders
|
|
6543
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Orders
|
|
6544
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Orders
|
|
6545
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Conditional-Orders
|
|
6546
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Conditional-Orders
|
|
6547
|
-
* @param {string} symbol unified market symbol of the market orders were made in
|
|
6548
|
-
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
6549
|
-
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
6550
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6551
|
-
* @param {string} [params.marginMode] 'cross' or 'isolated', for spot margin trading
|
|
6552
|
-
* @param {int} [params.until] the latest time in ms to fetch orders for
|
|
6553
|
-
* @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)
|
|
6554
|
-
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch orders in a portfolio margin account
|
|
6555
|
-
* @param {boolean} [params.stop] set to true if you would like to fetch portfolio margin account stop or conditional orders
|
|
6556
|
-
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
6557
|
-
*/
|
|
6558
6559
|
if (symbol === undefined) {
|
|
6559
6560
|
throw new errors.ArgumentsRequired(this.id + ' fetchOrders() requires a symbol argument');
|
|
6560
6561
|
}
|
|
@@ -6809,30 +6810,30 @@ class binance extends binance$1 {
|
|
|
6809
6810
|
//
|
|
6810
6811
|
return this.parseOrders(response, market, since, limit);
|
|
6811
6812
|
}
|
|
6813
|
+
/**
|
|
6814
|
+
* @method
|
|
6815
|
+
* @name binance#fetchOpenOrders
|
|
6816
|
+
* @description fetch all unfilled currently open orders
|
|
6817
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#current-open-orders-user_data
|
|
6818
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Current-All-Open-Orders
|
|
6819
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Current-All-Open-Orders
|
|
6820
|
+
* @see https://developers.binance.com/docs/derivatives/option/trade/Query-Current-Open-Option-Orders
|
|
6821
|
+
* @see https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-Open-Orders
|
|
6822
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-UM-Open-Orders
|
|
6823
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-UM-Open-Conditional-Orders
|
|
6824
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-CM-Open-Orders
|
|
6825
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-CM-Open-Conditional-Orders
|
|
6826
|
+
* @param {string} symbol unified market symbol
|
|
6827
|
+
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
6828
|
+
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
6829
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6830
|
+
* @param {string} [params.marginMode] 'cross' or 'isolated', for spot margin trading
|
|
6831
|
+
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch open orders in the portfolio margin account
|
|
6832
|
+
* @param {boolean} [params.stop] set to true if you would like to fetch portfolio margin account conditional orders
|
|
6833
|
+
* @param {string} [params.subType] "linear" or "inverse"
|
|
6834
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
6835
|
+
*/
|
|
6812
6836
|
async fetchOpenOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
6813
|
-
/**
|
|
6814
|
-
* @method
|
|
6815
|
-
* @name binance#fetchOpenOrders
|
|
6816
|
-
* @description fetch all unfilled currently open orders
|
|
6817
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#current-open-orders-user_data
|
|
6818
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Current-All-Open-Orders
|
|
6819
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Current-All-Open-Orders
|
|
6820
|
-
* @see https://developers.binance.com/docs/derivatives/option/trade/Query-Current-Open-Option-Orders
|
|
6821
|
-
* @see https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-Open-Orders
|
|
6822
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-UM-Open-Orders
|
|
6823
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-UM-Open-Conditional-Orders
|
|
6824
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-CM-Open-Orders
|
|
6825
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-Current-CM-Open-Conditional-Orders
|
|
6826
|
-
* @param {string} symbol unified market symbol
|
|
6827
|
-
* @param {int} [since] the earliest time in ms to fetch open orders for
|
|
6828
|
-
* @param {int} [limit] the maximum number of open orders structures to retrieve
|
|
6829
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6830
|
-
* @param {string} [params.marginMode] 'cross' or 'isolated', for spot margin trading
|
|
6831
|
-
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch open orders in the portfolio margin account
|
|
6832
|
-
* @param {boolean} [params.stop] set to true if you would like to fetch portfolio margin account conditional orders
|
|
6833
|
-
* @param {string} [params.subType] "linear" or "inverse"
|
|
6834
|
-
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
6835
|
-
*/
|
|
6836
6837
|
await this.loadMarkets();
|
|
6837
6838
|
let market = undefined;
|
|
6838
6839
|
let type = undefined;
|
|
@@ -6914,23 +6915,23 @@ class binance extends binance$1 {
|
|
|
6914
6915
|
}
|
|
6915
6916
|
return this.parseOrders(response, market, since, limit);
|
|
6916
6917
|
}
|
|
6918
|
+
/**
|
|
6919
|
+
* @method
|
|
6920
|
+
* @name binance#fetchOpenOrder
|
|
6921
|
+
* @description fetch an open order by the id
|
|
6922
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-Current-Open-Order
|
|
6923
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Query-Current-Open-Order
|
|
6924
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-UM-Open-Order
|
|
6925
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-UM-Open-Conditional-Order
|
|
6926
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-CM-Open-Order
|
|
6927
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-CM-Open-Conditional-Order
|
|
6928
|
+
* @param {string} id order id
|
|
6929
|
+
* @param {string} symbol unified market symbol
|
|
6930
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6931
|
+
* @param {string} [params.trigger] set to true if you would like to fetch portfolio margin account stop or conditional orders
|
|
6932
|
+
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
6933
|
+
*/
|
|
6917
6934
|
async fetchOpenOrder(id, symbol = undefined, params = {}) {
|
|
6918
|
-
/**
|
|
6919
|
-
* @method
|
|
6920
|
-
* @name binance#fetchOpenOrder
|
|
6921
|
-
* @description fetch an open order by the id
|
|
6922
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Query-Current-Open-Order
|
|
6923
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Query-Current-Open-Order
|
|
6924
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-UM-Open-Order
|
|
6925
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-UM-Open-Conditional-Order
|
|
6926
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-CM-Open-Order
|
|
6927
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Current-CM-Open-Conditional-Order
|
|
6928
|
-
* @param {string} id order id
|
|
6929
|
-
* @param {string} symbol unified market symbol
|
|
6930
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
6931
|
-
* @param {string} [params.trigger] set to true if you would like to fetch portfolio margin account stop or conditional orders
|
|
6932
|
-
* @returns {object} an [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
6933
|
-
*/
|
|
6934
6935
|
if (symbol === undefined) {
|
|
6935
6936
|
throw new errors.ArgumentsRequired(this.id + ' fetchOpenOrder() requires a symbol argument');
|
|
6936
6937
|
}
|
|
@@ -7131,29 +7132,29 @@ class binance extends binance$1 {
|
|
|
7131
7132
|
//
|
|
7132
7133
|
return this.parseOrder(response, market);
|
|
7133
7134
|
}
|
|
7135
|
+
/**
|
|
7136
|
+
* @method
|
|
7137
|
+
* @name binance#fetchClosedOrders
|
|
7138
|
+
* @description fetches information on multiple closed orders made by the user
|
|
7139
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#all-orders-user_data
|
|
7140
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders
|
|
7141
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/All-Orders
|
|
7142
|
+
* @see https://developers.binance.com/docs/derivatives/option/trade/Query-Option-Order-History
|
|
7143
|
+
* @see https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-All-Orders
|
|
7144
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Orders
|
|
7145
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Orders
|
|
7146
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Conditional-Orders
|
|
7147
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Conditional-Orders
|
|
7148
|
+
* @param {string} symbol unified market symbol of the market orders were made in
|
|
7149
|
+
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
7150
|
+
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
7151
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7152
|
+
* @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)
|
|
7153
|
+
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch orders in a portfolio margin account
|
|
7154
|
+
* @param {boolean} [params.stop] set to true if you would like to fetch portfolio margin account stop or conditional orders
|
|
7155
|
+
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
7156
|
+
*/
|
|
7134
7157
|
async fetchClosedOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
7135
|
-
/**
|
|
7136
|
-
* @method
|
|
7137
|
-
* @name binance#fetchClosedOrders
|
|
7138
|
-
* @description fetches information on multiple closed orders made by the user
|
|
7139
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#all-orders-user_data
|
|
7140
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders
|
|
7141
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/All-Orders
|
|
7142
|
-
* @see https://developers.binance.com/docs/derivatives/option/trade/Query-Option-Order-History
|
|
7143
|
-
* @see https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-All-Orders
|
|
7144
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Orders
|
|
7145
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Orders
|
|
7146
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Conditional-Orders
|
|
7147
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Conditional-Orders
|
|
7148
|
-
* @param {string} symbol unified market symbol of the market orders were made in
|
|
7149
|
-
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
7150
|
-
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
7151
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7152
|
-
* @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)
|
|
7153
|
-
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch orders in a portfolio margin account
|
|
7154
|
-
* @param {boolean} [params.stop] set to true if you would like to fetch portfolio margin account stop or conditional orders
|
|
7155
|
-
* @returns {Order[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
7156
|
-
*/
|
|
7157
7158
|
if (symbol === undefined) {
|
|
7158
7159
|
throw new errors.ArgumentsRequired(this.id + ' fetchClosedOrders() requires a symbol argument');
|
|
7159
7160
|
}
|
|
@@ -7161,29 +7162,29 @@ class binance extends binance$1 {
|
|
|
7161
7162
|
const filteredOrders = this.filterBy(orders, 'status', 'closed');
|
|
7162
7163
|
return this.filterBySinceLimit(filteredOrders, since, limit);
|
|
7163
7164
|
}
|
|
7165
|
+
/**
|
|
7166
|
+
* @method
|
|
7167
|
+
* @name binance#fetchCanceledOrders
|
|
7168
|
+
* @description fetches information on multiple canceled orders made by the user
|
|
7169
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#all-orders-user_data
|
|
7170
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders
|
|
7171
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/All-Orders
|
|
7172
|
+
* @see https://developers.binance.com/docs/derivatives/option/trade/Query-Option-Order-History
|
|
7173
|
+
* @see https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-All-Orders
|
|
7174
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Orders
|
|
7175
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Orders
|
|
7176
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Conditional-Orders
|
|
7177
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Conditional-Orders
|
|
7178
|
+
* @param {string} symbol unified market symbol of the market the orders were made in
|
|
7179
|
+
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
7180
|
+
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
7181
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7182
|
+
* @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)
|
|
7183
|
+
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch orders in a portfolio margin account
|
|
7184
|
+
* @param {boolean} [params.stop] set to true if you would like to fetch portfolio margin account stop or conditional orders
|
|
7185
|
+
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
7186
|
+
*/
|
|
7164
7187
|
async fetchCanceledOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
7165
|
-
/**
|
|
7166
|
-
* @method
|
|
7167
|
-
* @name binance#fetchCanceledOrders
|
|
7168
|
-
* @description fetches information on multiple canceled orders made by the user
|
|
7169
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#all-orders-user_data
|
|
7170
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders
|
|
7171
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/All-Orders
|
|
7172
|
-
* @see https://developers.binance.com/docs/derivatives/option/trade/Query-Option-Order-History
|
|
7173
|
-
* @see https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-All-Orders
|
|
7174
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Orders
|
|
7175
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Orders
|
|
7176
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Conditional-Orders
|
|
7177
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Conditional-Orders
|
|
7178
|
-
* @param {string} symbol unified market symbol of the market the orders were made in
|
|
7179
|
-
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
7180
|
-
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
7181
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7182
|
-
* @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)
|
|
7183
|
-
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch orders in a portfolio margin account
|
|
7184
|
-
* @param {boolean} [params.stop] set to true if you would like to fetch portfolio margin account stop or conditional orders
|
|
7185
|
-
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
7186
|
-
*/
|
|
7187
7188
|
if (symbol === undefined) {
|
|
7188
7189
|
throw new errors.ArgumentsRequired(this.id + ' fetchCanceledOrders() requires a symbol argument');
|
|
7189
7190
|
}
|
|
@@ -7191,29 +7192,29 @@ class binance extends binance$1 {
|
|
|
7191
7192
|
const filteredOrders = this.filterBy(orders, 'status', 'canceled');
|
|
7192
7193
|
return this.filterBySinceLimit(filteredOrders, since, limit);
|
|
7193
7194
|
}
|
|
7195
|
+
/**
|
|
7196
|
+
* @method
|
|
7197
|
+
* @name binance#fetchCanceledAndClosedOrders
|
|
7198
|
+
* @description fetches information on multiple canceled orders made by the user
|
|
7199
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#all-orders-user_data
|
|
7200
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders
|
|
7201
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/All-Orders
|
|
7202
|
+
* @see https://developers.binance.com/docs/derivatives/option/trade/Query-Option-Order-History
|
|
7203
|
+
* @see https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-All-Orders
|
|
7204
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Orders
|
|
7205
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Orders
|
|
7206
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Conditional-Orders
|
|
7207
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Conditional-Orders
|
|
7208
|
+
* @param {string} symbol unified market symbol of the market the orders were made in
|
|
7209
|
+
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
7210
|
+
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
7211
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7212
|
+
* @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)
|
|
7213
|
+
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch orders in a portfolio margin account
|
|
7214
|
+
* @param {boolean} [params.stop] set to true if you would like to fetch portfolio margin account stop or conditional orders
|
|
7215
|
+
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
7216
|
+
*/
|
|
7194
7217
|
async fetchCanceledAndClosedOrders(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
7195
|
-
/**
|
|
7196
|
-
* @method
|
|
7197
|
-
* @name binance#fetchCanceledAndClosedOrders
|
|
7198
|
-
* @description fetches information on multiple canceled orders made by the user
|
|
7199
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#all-orders-user_data
|
|
7200
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/All-Orders
|
|
7201
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/All-Orders
|
|
7202
|
-
* @see https://developers.binance.com/docs/derivatives/option/trade/Query-Option-Order-History
|
|
7203
|
-
* @see https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-All-Orders
|
|
7204
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Orders
|
|
7205
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Orders
|
|
7206
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-UM-Conditional-Orders
|
|
7207
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-All-CM-Conditional-Orders
|
|
7208
|
-
* @param {string} symbol unified market symbol of the market the orders were made in
|
|
7209
|
-
* @param {int} [since] the earliest time in ms to fetch orders for
|
|
7210
|
-
* @param {int} [limit] the maximum number of order structures to retrieve
|
|
7211
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7212
|
-
* @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)
|
|
7213
|
-
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch orders in a portfolio margin account
|
|
7214
|
-
* @param {boolean} [params.stop] set to true if you would like to fetch portfolio margin account stop or conditional orders
|
|
7215
|
-
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
7216
|
-
*/
|
|
7217
7218
|
if (symbol === undefined) {
|
|
7218
7219
|
throw new errors.ArgumentsRequired(this.id + ' fetchCanceledAndClosedOrders() requires a symbol argument');
|
|
7219
7220
|
}
|
|
@@ -7224,28 +7225,28 @@ class binance extends binance$1 {
|
|
|
7224
7225
|
const sortedOrders = this.sortBy(filteredOrders, 'timestamp');
|
|
7225
7226
|
return this.filterBySinceLimit(sortedOrders, since, limit);
|
|
7226
7227
|
}
|
|
7228
|
+
/**
|
|
7229
|
+
* @method
|
|
7230
|
+
* @name binance#cancelOrder
|
|
7231
|
+
* @description cancels an open order
|
|
7232
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#cancel-order-trade
|
|
7233
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-Order
|
|
7234
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Cancel-Order
|
|
7235
|
+
* @see https://developers.binance.com/docs/derivatives/option/trade/Cancel-Option-Order
|
|
7236
|
+
* @see https://developers.binance.com/docs/margin_trading/trade/Margin-Account-Cancel-Order
|
|
7237
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-UM-Order
|
|
7238
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-CM-Order
|
|
7239
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-UM-Conditional-Order
|
|
7240
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-CM-Conditional-Order
|
|
7241
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-Margin-Account-Order
|
|
7242
|
+
* @param {string} id order id
|
|
7243
|
+
* @param {string} symbol unified symbol of the market the order was made in
|
|
7244
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7245
|
+
* @param {boolean} [params.portfolioMargin] set to true if you would like to cancel an order in a portfolio margin account
|
|
7246
|
+
* @param {boolean} [params.stop] set to true if you would like to cancel a portfolio margin account conditional order
|
|
7247
|
+
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
7248
|
+
*/
|
|
7227
7249
|
async cancelOrder(id, symbol = undefined, params = {}) {
|
|
7228
|
-
/**
|
|
7229
|
-
* @method
|
|
7230
|
-
* @name binance#cancelOrder
|
|
7231
|
-
* @description cancels an open order
|
|
7232
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#cancel-order-trade
|
|
7233
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-Order
|
|
7234
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Cancel-Order
|
|
7235
|
-
* @see https://developers.binance.com/docs/derivatives/option/trade/Cancel-Option-Order
|
|
7236
|
-
* @see https://developers.binance.com/docs/margin_trading/trade/Margin-Account-Cancel-Order
|
|
7237
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-UM-Order
|
|
7238
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-CM-Order
|
|
7239
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-UM-Conditional-Order
|
|
7240
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-CM-Conditional-Order
|
|
7241
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-Margin-Account-Order
|
|
7242
|
-
* @param {string} id order id
|
|
7243
|
-
* @param {string} symbol unified symbol of the market the order was made in
|
|
7244
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7245
|
-
* @param {boolean} [params.portfolioMargin] set to true if you would like to cancel an order in a portfolio margin account
|
|
7246
|
-
* @param {boolean} [params.stop] set to true if you would like to cancel a portfolio margin account conditional order
|
|
7247
|
-
* @returns {object} An [order structure]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
7248
|
-
*/
|
|
7249
7250
|
if (symbol === undefined) {
|
|
7250
7251
|
throw new errors.ArgumentsRequired(this.id + ' cancelOrder() requires a symbol argument');
|
|
7251
7252
|
}
|
|
@@ -7330,27 +7331,27 @@ class binance extends binance$1 {
|
|
|
7330
7331
|
}
|
|
7331
7332
|
return this.parseOrder(response, market);
|
|
7332
7333
|
}
|
|
7334
|
+
/**
|
|
7335
|
+
* @method
|
|
7336
|
+
* @name binance#cancelAllOrders
|
|
7337
|
+
* @description cancel all open orders in a market
|
|
7338
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#cancel-all-open-orders-on-a-symbol-trade
|
|
7339
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-All-Open-Orders
|
|
7340
|
+
* @see https://developers.binance.com/docs/derivatives/option/trade/Cancel-all-Option-orders-on-specific-symbol
|
|
7341
|
+
* @see https://developers.binance.com/docs/margin_trading/trade/Margin-Account-Cancel-All-Open-Orders
|
|
7342
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-UM-Open-Orders
|
|
7343
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-UM-Open-Conditional-Orders
|
|
7344
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-CM-Open-Orders
|
|
7345
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-CM-Open-Conditional-Orders
|
|
7346
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-Margin-Account-All-Open-Orders-on-a-Symbol
|
|
7347
|
+
* @param {string} symbol unified market symbol of the market to cancel orders in
|
|
7348
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7349
|
+
* @param {string} [params.marginMode] 'cross' or 'isolated', for spot margin trading
|
|
7350
|
+
* @param {boolean} [params.portfolioMargin] set to true if you would like to cancel orders in a portfolio margin account
|
|
7351
|
+
* @param {boolean} [params.stop] set to true if you would like to cancel portfolio margin account conditional orders
|
|
7352
|
+
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
7353
|
+
*/
|
|
7333
7354
|
async cancelAllOrders(symbol = undefined, params = {}) {
|
|
7334
|
-
/**
|
|
7335
|
-
* @method
|
|
7336
|
-
* @name binance#cancelAllOrders
|
|
7337
|
-
* @description cancel all open orders in a market
|
|
7338
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#cancel-all-open-orders-on-a-symbol-trade
|
|
7339
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-All-Open-Orders
|
|
7340
|
-
* @see https://developers.binance.com/docs/derivatives/option/trade/Cancel-all-Option-orders-on-specific-symbol
|
|
7341
|
-
* @see https://developers.binance.com/docs/margin_trading/trade/Margin-Account-Cancel-All-Open-Orders
|
|
7342
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-UM-Open-Orders
|
|
7343
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-UM-Open-Conditional-Orders
|
|
7344
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-CM-Open-Orders
|
|
7345
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-All-CM-Open-Conditional-Orders
|
|
7346
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Cancel-Margin-Account-All-Open-Orders-on-a-Symbol
|
|
7347
|
-
* @param {string} symbol unified market symbol of the market to cancel orders in
|
|
7348
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7349
|
-
* @param {string} [params.marginMode] 'cross' or 'isolated', for spot margin trading
|
|
7350
|
-
* @param {boolean} [params.portfolioMargin] set to true if you would like to cancel orders in a portfolio margin account
|
|
7351
|
-
* @param {boolean} [params.stop] set to true if you would like to cancel portfolio margin account conditional orders
|
|
7352
|
-
* @returns {object[]} a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
7353
|
-
*/
|
|
7354
7355
|
if (symbol === undefined) {
|
|
7355
7356
|
throw new errors.ArgumentsRequired(this.id + ' cancelAllOrders() requires a symbol argument');
|
|
7356
7357
|
}
|
|
@@ -7506,22 +7507,22 @@ class binance extends binance$1 {
|
|
|
7506
7507
|
];
|
|
7507
7508
|
}
|
|
7508
7509
|
}
|
|
7510
|
+
/**
|
|
7511
|
+
* @method
|
|
7512
|
+
* @name binance#cancelOrders
|
|
7513
|
+
* @description cancel multiple orders
|
|
7514
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-Multiple-Orders
|
|
7515
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Cancel-Multiple-Orders
|
|
7516
|
+
* @param {string[]} ids order ids
|
|
7517
|
+
* @param {string} [symbol] unified market symbol
|
|
7518
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7519
|
+
*
|
|
7520
|
+
* EXCHANGE SPECIFIC PARAMETERS
|
|
7521
|
+
* @param {string[]} [params.origClientOrderIdList] max length 10 e.g. ["my_id_1","my_id_2"], encode the double quotes. No space after comma
|
|
7522
|
+
* @param {int[]} [params.recvWindow]
|
|
7523
|
+
* @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
7524
|
+
*/
|
|
7509
7525
|
async cancelOrders(ids, symbol = undefined, params = {}) {
|
|
7510
|
-
/**
|
|
7511
|
-
* @method
|
|
7512
|
-
* @name binance#cancelOrders
|
|
7513
|
-
* @description cancel multiple orders
|
|
7514
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Cancel-Multiple-Orders
|
|
7515
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Cancel-Multiple-Orders
|
|
7516
|
-
* @param {string[]} ids order ids
|
|
7517
|
-
* @param {string} [symbol] unified market symbol
|
|
7518
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7519
|
-
*
|
|
7520
|
-
* EXCHANGE SPECIFIC PARAMETERS
|
|
7521
|
-
* @param {string[]} [params.origClientOrderIdList] max length 10 e.g. ["my_id_1","my_id_2"], encode the double quotes. No space after comma
|
|
7522
|
-
* @param {int[]} [params.recvWindow]
|
|
7523
|
-
* @returns {object} an list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure}
|
|
7524
|
-
*/
|
|
7525
7526
|
if (symbol === undefined) {
|
|
7526
7527
|
throw new errors.ArgumentsRequired(this.id + ' cancelOrders() requires a symbol argument');
|
|
7527
7528
|
}
|
|
@@ -7578,22 +7579,22 @@ class binance extends binance$1 {
|
|
|
7578
7579
|
//
|
|
7579
7580
|
return this.parseOrders(response, market);
|
|
7580
7581
|
}
|
|
7582
|
+
/**
|
|
7583
|
+
* @method
|
|
7584
|
+
* @name binance#fetchOrderTrades
|
|
7585
|
+
* @description fetch all the trades made from a single order
|
|
7586
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#account-trade-list-user_data
|
|
7587
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Account-Trade-List
|
|
7588
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Account-Trade-List
|
|
7589
|
+
* @see https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-Trade-List
|
|
7590
|
+
* @param {string} id order id
|
|
7591
|
+
* @param {string} symbol unified market symbol
|
|
7592
|
+
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
7593
|
+
* @param {int} [limit] the maximum number of trades to retrieve
|
|
7594
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7595
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
7596
|
+
*/
|
|
7581
7597
|
async fetchOrderTrades(id, symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
7582
|
-
/**
|
|
7583
|
-
* @method
|
|
7584
|
-
* @name binance#fetchOrderTrades
|
|
7585
|
-
* @description fetch all the trades made from a single order
|
|
7586
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#account-trade-list-user_data
|
|
7587
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Account-Trade-List
|
|
7588
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Account-Trade-List
|
|
7589
|
-
* @see https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-Trade-List
|
|
7590
|
-
* @param {string} id order id
|
|
7591
|
-
* @param {string} symbol unified market symbol
|
|
7592
|
-
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
7593
|
-
* @param {int} [limit] the maximum number of trades to retrieve
|
|
7594
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7595
|
-
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
7596
|
-
*/
|
|
7597
7598
|
if (symbol === undefined) {
|
|
7598
7599
|
throw new errors.ArgumentsRequired(this.id + ' fetchOrderTrades() requires a symbol argument');
|
|
7599
7600
|
}
|
|
@@ -7609,27 +7610,27 @@ class binance extends binance$1 {
|
|
|
7609
7610
|
};
|
|
7610
7611
|
return await this.fetchMyTrades(symbol, since, limit, this.extend(request, params));
|
|
7611
7612
|
}
|
|
7613
|
+
/**
|
|
7614
|
+
* @method
|
|
7615
|
+
* @name binance#fetchMyTrades
|
|
7616
|
+
* @description fetch all trades made by the user
|
|
7617
|
+
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#account-trade-list-user_data
|
|
7618
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Account-Trade-List
|
|
7619
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Account-Trade-List
|
|
7620
|
+
* @see https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-Trade-List
|
|
7621
|
+
* @see https://developers.binance.com/docs/derivatives/option/trade/Account-Trade-List
|
|
7622
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/UM-Account-Trade-List
|
|
7623
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/CM-Account-Trade-List
|
|
7624
|
+
* @param {string} symbol unified market symbol
|
|
7625
|
+
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
7626
|
+
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
7627
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7628
|
+
* @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)
|
|
7629
|
+
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
7630
|
+
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch trades for a portfolio margin account
|
|
7631
|
+
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
7632
|
+
*/
|
|
7612
7633
|
async fetchMyTrades(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
7613
|
-
/**
|
|
7614
|
-
* @method
|
|
7615
|
-
* @name binance#fetchMyTrades
|
|
7616
|
-
* @description fetch all trades made by the user
|
|
7617
|
-
* @see https://developers.binance.com/docs/binance-spot-api-docs/rest-api#account-trade-list-user_data
|
|
7618
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Account-Trade-List
|
|
7619
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Account-Trade-List
|
|
7620
|
-
* @see https://developers.binance.com/docs/margin_trading/trade/Query-Margin-Account-Trade-List
|
|
7621
|
-
* @see https://developers.binance.com/docs/derivatives/option/trade/Account-Trade-List
|
|
7622
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/UM-Account-Trade-List
|
|
7623
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/CM-Account-Trade-List
|
|
7624
|
-
* @param {string} symbol unified market symbol
|
|
7625
|
-
* @param {int} [since] the earliest time in ms to fetch trades for
|
|
7626
|
-
* @param {int} [limit] the maximum number of trades structures to retrieve
|
|
7627
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7628
|
-
* @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)
|
|
7629
|
-
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
7630
|
-
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch trades for a portfolio margin account
|
|
7631
|
-
* @returns {Trade[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
7632
|
-
*/
|
|
7633
7634
|
await this.loadMarkets();
|
|
7634
7635
|
let paginate = false;
|
|
7635
7636
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchMyTrades', 'paginate');
|
|
@@ -7844,19 +7845,19 @@ class binance extends binance$1 {
|
|
|
7844
7845
|
//
|
|
7845
7846
|
return this.parseTrades(response, market, since, limit);
|
|
7846
7847
|
}
|
|
7848
|
+
/**
|
|
7849
|
+
* @method
|
|
7850
|
+
* @name binance#fetchMyDustTrades
|
|
7851
|
+
* @description fetch all dust trades made by the user
|
|
7852
|
+
* @see https://developers.binance.com/docs/wallet/asset/dust-log
|
|
7853
|
+
* @param {string} symbol not used by binance fetchMyDustTrades ()
|
|
7854
|
+
* @param {int} [since] the earliest time in ms to fetch my dust trades for
|
|
7855
|
+
* @param {int} [limit] the maximum number of dust trades to retrieve
|
|
7856
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7857
|
+
* @param {string} [params.type] 'spot' or 'margin', default spot
|
|
7858
|
+
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
7859
|
+
*/
|
|
7847
7860
|
async fetchMyDustTrades(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
7848
|
-
/**
|
|
7849
|
-
* @method
|
|
7850
|
-
* @name binance#fetchMyDustTrades
|
|
7851
|
-
* @description fetch all dust trades made by the user
|
|
7852
|
-
* @see https://developers.binance.com/docs/wallet/asset/dust-log
|
|
7853
|
-
* @param {string} symbol not used by binance fetchMyDustTrades ()
|
|
7854
|
-
* @param {int} [since] the earliest time in ms to fetch my dust trades for
|
|
7855
|
-
* @param {int} [limit] the maximum number of dust trades to retrieve
|
|
7856
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
7857
|
-
* @param {string} [params.type] 'spot' or 'margin', default spot
|
|
7858
|
-
* @returns {object[]} a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure}
|
|
7859
|
-
*/
|
|
7860
7861
|
//
|
|
7861
7862
|
// Binance provides an opportunity to trade insignificant (i.e. non-tradable and non-withdrawable)
|
|
7862
7863
|
// token leftovers (of any asset) into `BNB` coin which in turn can be used to pay trading fees with it.
|
|
@@ -7989,22 +7990,22 @@ class binance extends binance$1 {
|
|
|
7989
7990
|
'info': trade,
|
|
7990
7991
|
};
|
|
7991
7992
|
}
|
|
7993
|
+
/**
|
|
7994
|
+
* @method
|
|
7995
|
+
* @name binance#fetchDeposits
|
|
7996
|
+
* @description fetch all deposits made to an account
|
|
7997
|
+
* @see https://developers.binance.com/docs/wallet/capital/deposite-history
|
|
7998
|
+
* @see https://developers.binance.com/docs/fiat/rest-api/Get-Fiat-Deposit-Withdraw-History
|
|
7999
|
+
* @param {string} code unified currency code
|
|
8000
|
+
* @param {int} [since] the earliest time in ms to fetch deposits for
|
|
8001
|
+
* @param {int} [limit] the maximum number of deposits structures to retrieve
|
|
8002
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8003
|
+
* @param {bool} [params.fiat] if true, only fiat deposits will be returned
|
|
8004
|
+
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
8005
|
+
* @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)
|
|
8006
|
+
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
8007
|
+
*/
|
|
7992
8008
|
async fetchDeposits(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
7993
|
-
/**
|
|
7994
|
-
* @method
|
|
7995
|
-
* @name binance#fetchDeposits
|
|
7996
|
-
* @description fetch all deposits made to an account
|
|
7997
|
-
* @see https://developers.binance.com/docs/wallet/capital/deposite-history
|
|
7998
|
-
* @see https://developers.binance.com/docs/fiat/rest-api/Get-Fiat-Deposit-Withdraw-History
|
|
7999
|
-
* @param {string} code unified currency code
|
|
8000
|
-
* @param {int} [since] the earliest time in ms to fetch deposits for
|
|
8001
|
-
* @param {int} [limit] the maximum number of deposits structures to retrieve
|
|
8002
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8003
|
-
* @param {bool} [params.fiat] if true, only fiat deposits will be returned
|
|
8004
|
-
* @param {int} [params.until] the latest time in ms to fetch entries for
|
|
8005
|
-
* @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)
|
|
8006
|
-
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
8007
|
-
*/
|
|
8008
8009
|
await this.loadMarkets();
|
|
8009
8010
|
let paginate = false;
|
|
8010
8011
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchDeposits', 'paginate');
|
|
@@ -8102,22 +8103,22 @@ class binance extends binance$1 {
|
|
|
8102
8103
|
}
|
|
8103
8104
|
return this.parseTransactions(response, currency, since, limit);
|
|
8104
8105
|
}
|
|
8106
|
+
/**
|
|
8107
|
+
* @method
|
|
8108
|
+
* @name binance#fetchWithdrawals
|
|
8109
|
+
* @description fetch all withdrawals made from an account
|
|
8110
|
+
* @see https://developers.binance.com/docs/wallet/capital/withdraw-history
|
|
8111
|
+
* @see https://developers.binance.com/docs/fiat/rest-api/Get-Fiat-Deposit-Withdraw-History
|
|
8112
|
+
* @param {string} code unified currency code
|
|
8113
|
+
* @param {int} [since] the earliest time in ms to fetch withdrawals for
|
|
8114
|
+
* @param {int} [limit] the maximum number of withdrawals structures to retrieve
|
|
8115
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8116
|
+
* @param {bool} [params.fiat] if true, only fiat withdrawals will be returned
|
|
8117
|
+
* @param {int} [params.until] the latest time in ms to fetch withdrawals for
|
|
8118
|
+
* @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)
|
|
8119
|
+
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
8120
|
+
*/
|
|
8105
8121
|
async fetchWithdrawals(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
8106
|
-
/**
|
|
8107
|
-
* @method
|
|
8108
|
-
* @name binance#fetchWithdrawals
|
|
8109
|
-
* @description fetch all withdrawals made from an account
|
|
8110
|
-
* @see https://developers.binance.com/docs/wallet/capital/withdraw-history
|
|
8111
|
-
* @see https://developers.binance.com/docs/fiat/rest-api/Get-Fiat-Deposit-Withdraw-History
|
|
8112
|
-
* @param {string} code unified currency code
|
|
8113
|
-
* @param {int} [since] the earliest time in ms to fetch withdrawals for
|
|
8114
|
-
* @param {int} [limit] the maximum number of withdrawals structures to retrieve
|
|
8115
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8116
|
-
* @param {bool} [params.fiat] if true, only fiat withdrawals will be returned
|
|
8117
|
-
* @param {int} [params.until] the latest time in ms to fetch withdrawals for
|
|
8118
|
-
* @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)
|
|
8119
|
-
* @returns {object[]} a list of [transaction structures]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
8120
|
-
*/
|
|
8121
8122
|
await this.loadMarkets();
|
|
8122
8123
|
let paginate = false;
|
|
8123
8124
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchWithdrawals', 'paginate');
|
|
@@ -8539,21 +8540,21 @@ class binance extends binance$1 {
|
|
|
8539
8540
|
'amount': this.safeNumber(income, 'income'),
|
|
8540
8541
|
};
|
|
8541
8542
|
}
|
|
8543
|
+
/**
|
|
8544
|
+
* @method
|
|
8545
|
+
* @name binance#transfer
|
|
8546
|
+
* @description transfer currency internally between wallets on the same account
|
|
8547
|
+
* @see https://developers.binance.com/docs/wallet/asset/user-universal-transfer
|
|
8548
|
+
* @param {string} code unified currency code
|
|
8549
|
+
* @param {float} amount amount to transfer
|
|
8550
|
+
* @param {string} fromAccount account to transfer from
|
|
8551
|
+
* @param {string} toAccount account to transfer to
|
|
8552
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8553
|
+
* @param {string} [params.type] exchange specific transfer type
|
|
8554
|
+
* @param {string} [params.symbol] the unified symbol, required for isolated margin transfers
|
|
8555
|
+
* @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
8556
|
+
*/
|
|
8542
8557
|
async transfer(code, amount, fromAccount, toAccount, params = {}) {
|
|
8543
|
-
/**
|
|
8544
|
-
* @method
|
|
8545
|
-
* @name binance#transfer
|
|
8546
|
-
* @description transfer currency internally between wallets on the same account
|
|
8547
|
-
* @see https://developers.binance.com/docs/wallet/asset/user-universal-transfer
|
|
8548
|
-
* @param {string} code unified currency code
|
|
8549
|
-
* @param {float} amount amount to transfer
|
|
8550
|
-
* @param {string} fromAccount account to transfer from
|
|
8551
|
-
* @param {string} toAccount account to transfer to
|
|
8552
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8553
|
-
* @param {string} [params.type] exchange specific transfer type
|
|
8554
|
-
* @param {string} [params.symbol] the unified symbol, required for isolated margin transfers
|
|
8555
|
-
* @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
8556
|
-
*/
|
|
8557
8558
|
await this.loadMarkets();
|
|
8558
8559
|
const currency = this.currency(code);
|
|
8559
8560
|
const request = {
|
|
@@ -8645,21 +8646,21 @@ class binance extends binance$1 {
|
|
|
8645
8646
|
//
|
|
8646
8647
|
return this.parseTransfer(response, currency);
|
|
8647
8648
|
}
|
|
8649
|
+
/**
|
|
8650
|
+
* @method
|
|
8651
|
+
* @name binance#fetchTransfers
|
|
8652
|
+
* @description fetch a history of internal transfers made on an account
|
|
8653
|
+
* @see https://developers.binance.com/docs/wallet/asset/query-user-universal-transfer
|
|
8654
|
+
* @param {string} code unified currency code of the currency transferred
|
|
8655
|
+
* @param {int} [since] the earliest time in ms to fetch transfers for
|
|
8656
|
+
* @param {int} [limit] the maximum number of transfers structures to retrieve
|
|
8657
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8658
|
+
* @param {int} [params.until] the latest time in ms to fetch transfers for
|
|
8659
|
+
* @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)
|
|
8660
|
+
* @param {boolean} [params.internal] default false, when true will fetch pay trade history
|
|
8661
|
+
* @returns {object[]} a list of [transfer structures]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
8662
|
+
*/
|
|
8648
8663
|
async fetchTransfers(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
8649
|
-
/**
|
|
8650
|
-
* @method
|
|
8651
|
-
* @name binance#fetchTransfers
|
|
8652
|
-
* @description fetch a history of internal transfers made on an account
|
|
8653
|
-
* @see https://developers.binance.com/docs/wallet/asset/query-user-universal-transfer
|
|
8654
|
-
* @param {string} code unified currency code of the currency transferred
|
|
8655
|
-
* @param {int} [since] the earliest time in ms to fetch transfers for
|
|
8656
|
-
* @param {int} [limit] the maximum number of transfers structures to retrieve
|
|
8657
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8658
|
-
* @param {int} [params.until] the latest time in ms to fetch transfers for
|
|
8659
|
-
* @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)
|
|
8660
|
-
* @param {boolean} [params.internal] default false, when true will fetch pay trade history
|
|
8661
|
-
* @returns {object[]} a list of [transfer structures]{@link https://docs.ccxt.com/#/?id=transfer-structure}
|
|
8662
|
-
*/
|
|
8663
8664
|
await this.loadMarkets();
|
|
8664
8665
|
const internal = this.safeBool(params, 'internal');
|
|
8665
8666
|
params = this.omit(params, 'internal');
|
|
@@ -8790,16 +8791,17 @@ class binance extends binance$1 {
|
|
|
8790
8791
|
const rows = this.safeList2(response, 'rows', 'data', []);
|
|
8791
8792
|
return this.parseTransfers(rows, currency, since, limit);
|
|
8792
8793
|
}
|
|
8794
|
+
/**
|
|
8795
|
+
* @method
|
|
8796
|
+
* @name binance#fetchDepositAddress
|
|
8797
|
+
* @description fetch the deposit address for a currency associated with this account
|
|
8798
|
+
* @see https://developers.binance.com/docs/wallet/capital/deposite-address
|
|
8799
|
+
* @param {string} code unified currency code
|
|
8800
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8801
|
+
* @param {string} [params.network] network for fetch deposit address
|
|
8802
|
+
* @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
|
|
8803
|
+
*/
|
|
8793
8804
|
async fetchDepositAddress(code, params = {}) {
|
|
8794
|
-
/**
|
|
8795
|
-
* @method
|
|
8796
|
-
* @name binance#fetchDepositAddress
|
|
8797
|
-
* @description fetch the deposit address for a currency associated with this account
|
|
8798
|
-
* @see https://developers.binance.com/docs/wallet/capital/deposite-address
|
|
8799
|
-
* @param {string} code unified currency code
|
|
8800
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8801
|
-
* @returns {object} an [address structure]{@link https://docs.ccxt.com/#/?id=address-structure}
|
|
8802
|
-
*/
|
|
8803
8805
|
await this.loadMarkets();
|
|
8804
8806
|
const currency = this.currency(code);
|
|
8805
8807
|
const request = {
|
|
@@ -8883,17 +8885,17 @@ class binance extends binance$1 {
|
|
|
8883
8885
|
'tag': tag,
|
|
8884
8886
|
};
|
|
8885
8887
|
}
|
|
8888
|
+
/**
|
|
8889
|
+
* @method
|
|
8890
|
+
* @name binance#fetchTransactionFees
|
|
8891
|
+
* @deprecated
|
|
8892
|
+
* @description please use fetchDepositWithdrawFees instead
|
|
8893
|
+
* @see https://developers.binance.com/docs/wallet/capital/all-coins-info
|
|
8894
|
+
* @param {string[]|undefined} codes not used by binance fetchTransactionFees ()
|
|
8895
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8896
|
+
* @returns {object[]} a list of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
8897
|
+
*/
|
|
8886
8898
|
async fetchTransactionFees(codes = undefined, params = {}) {
|
|
8887
|
-
/**
|
|
8888
|
-
* @method
|
|
8889
|
-
* @name binance#fetchTransactionFees
|
|
8890
|
-
* @deprecated
|
|
8891
|
-
* @description please use fetchDepositWithdrawFees instead
|
|
8892
|
-
* @see https://developers.binance.com/docs/wallet/capital/all-coins-info
|
|
8893
|
-
* @param {string[]|undefined} codes not used by binance fetchTransactionFees ()
|
|
8894
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
8895
|
-
* @returns {object[]} a list of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
8896
|
-
*/
|
|
8897
8899
|
await this.loadMarkets();
|
|
8898
8900
|
const response = await this.sapiGetCapitalConfigGetall(params);
|
|
8899
8901
|
//
|
|
@@ -8998,16 +9000,16 @@ class binance extends binance$1 {
|
|
|
8998
9000
|
'info': response,
|
|
8999
9001
|
};
|
|
9000
9002
|
}
|
|
9003
|
+
/**
|
|
9004
|
+
* @method
|
|
9005
|
+
* @name binance#fetchDepositWithdrawFees
|
|
9006
|
+
* @description fetch deposit and withdraw fees
|
|
9007
|
+
* @see https://developers.binance.com/docs/wallet/capital/all-coins-info
|
|
9008
|
+
* @param {string[]|undefined} codes not used by binance fetchDepositWithdrawFees ()
|
|
9009
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
9010
|
+
* @returns {object[]} a list of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
9011
|
+
*/
|
|
9001
9012
|
async fetchDepositWithdrawFees(codes = undefined, params = {}) {
|
|
9002
|
-
/**
|
|
9003
|
-
* @method
|
|
9004
|
-
* @name binance#fetchDepositWithdrawFees
|
|
9005
|
-
* @description fetch deposit and withdraw fees
|
|
9006
|
-
* @see https://developers.binance.com/docs/wallet/capital/all-coins-info
|
|
9007
|
-
* @param {string[]|undefined} codes not used by binance fetchDepositWithdrawFees ()
|
|
9008
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
9009
|
-
* @returns {object[]} a list of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
9010
|
-
*/
|
|
9011
9013
|
await this.loadMarkets();
|
|
9012
9014
|
const response = await this.sapiGetCapitalConfigGetall(params);
|
|
9013
9015
|
//
|
|
@@ -9122,19 +9124,19 @@ class binance extends binance$1 {
|
|
|
9122
9124
|
}
|
|
9123
9125
|
return result;
|
|
9124
9126
|
}
|
|
9127
|
+
/**
|
|
9128
|
+
* @method
|
|
9129
|
+
* @name binance#withdraw
|
|
9130
|
+
* @description make a withdrawal
|
|
9131
|
+
* @see https://developers.binance.com/docs/wallet/capital/withdraw
|
|
9132
|
+
* @param {string} code unified currency code
|
|
9133
|
+
* @param {float} amount the amount to withdraw
|
|
9134
|
+
* @param {string} address the address to withdraw to
|
|
9135
|
+
* @param {string} tag
|
|
9136
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
9137
|
+
* @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
9138
|
+
*/
|
|
9125
9139
|
async withdraw(code, amount, address, tag = undefined, params = {}) {
|
|
9126
|
-
/**
|
|
9127
|
-
* @method
|
|
9128
|
-
* @name binance#withdraw
|
|
9129
|
-
* @description make a withdrawal
|
|
9130
|
-
* @see https://developers.binance.com/docs/wallet/capital/withdraw
|
|
9131
|
-
* @param {string} code unified currency code
|
|
9132
|
-
* @param {float} amount the amount to withdraw
|
|
9133
|
-
* @param {string} address the address to withdraw to
|
|
9134
|
-
* @param {string} tag
|
|
9135
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
9136
|
-
* @returns {object} a [transaction structure]{@link https://docs.ccxt.com/#/?id=transaction-structure}
|
|
9137
|
-
*/
|
|
9138
9140
|
[tag, params] = this.handleWithdrawTagAndParams(tag, params);
|
|
9139
9141
|
this.checkAddress(address);
|
|
9140
9142
|
await this.loadMarkets();
|
|
@@ -9189,22 +9191,22 @@ class binance extends binance$1 {
|
|
|
9189
9191
|
'tierBased': undefined,
|
|
9190
9192
|
};
|
|
9191
9193
|
}
|
|
9194
|
+
/**
|
|
9195
|
+
* @method
|
|
9196
|
+
* @name binance#fetchTradingFee
|
|
9197
|
+
* @description fetch the trading fees for a market
|
|
9198
|
+
* @see https://developers.binance.com/docs/wallet/asset/trade-fee
|
|
9199
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/User-Commission-Rate
|
|
9200
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/account/User-Commission-Rate
|
|
9201
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-User-Commission-Rate-for-UM
|
|
9202
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-User-Commission-Rate-for-CM
|
|
9203
|
+
* @param {string} symbol unified market symbol
|
|
9204
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
9205
|
+
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch trading fees in a portfolio margin account
|
|
9206
|
+
* @param {string} [params.subType] "linear" or "inverse"
|
|
9207
|
+
* @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
9208
|
+
*/
|
|
9192
9209
|
async fetchTradingFee(symbol, params = {}) {
|
|
9193
|
-
/**
|
|
9194
|
-
* @method
|
|
9195
|
-
* @name binance#fetchTradingFee
|
|
9196
|
-
* @description fetch the trading fees for a market
|
|
9197
|
-
* @see https://developers.binance.com/docs/wallet/asset/trade-fee
|
|
9198
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/User-Commission-Rate
|
|
9199
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/account/User-Commission-Rate
|
|
9200
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-User-Commission-Rate-for-UM
|
|
9201
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-User-Commission-Rate-for-CM
|
|
9202
|
-
* @param {string} symbol unified market symbol
|
|
9203
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
9204
|
-
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch trading fees in a portfolio margin account
|
|
9205
|
-
* @param {string} [params.subType] "linear" or "inverse"
|
|
9206
|
-
* @returns {object} a [fee structure]{@link https://docs.ccxt.com/#/?id=fee-structure}
|
|
9207
|
-
*/
|
|
9208
9210
|
await this.loadMarkets();
|
|
9209
9211
|
const market = this.market(symbol);
|
|
9210
9212
|
const type = market['type'];
|
|
@@ -9262,19 +9264,19 @@ class binance extends binance$1 {
|
|
|
9262
9264
|
}
|
|
9263
9265
|
return this.parseTradingFee(data, market);
|
|
9264
9266
|
}
|
|
9267
|
+
/**
|
|
9268
|
+
* @method
|
|
9269
|
+
* @name binance#fetchTradingFees
|
|
9270
|
+
* @description fetch the trading fees for multiple markets
|
|
9271
|
+
* @see https://developers.binance.com/docs/wallet/asset/trade-fee
|
|
9272
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Information-V2
|
|
9273
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Account-Information
|
|
9274
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Config
|
|
9275
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
9276
|
+
* @param {string} [params.subType] "linear" or "inverse"
|
|
9277
|
+
* @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
|
|
9278
|
+
*/
|
|
9265
9279
|
async fetchTradingFees(params = {}) {
|
|
9266
|
-
/**
|
|
9267
|
-
* @method
|
|
9268
|
-
* @name binance#fetchTradingFees
|
|
9269
|
-
* @description fetch the trading fees for multiple markets
|
|
9270
|
-
* @see https://developers.binance.com/docs/wallet/asset/trade-fee
|
|
9271
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Information-V2
|
|
9272
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Account-Information
|
|
9273
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Config
|
|
9274
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
9275
|
-
* @param {string} [params.subType] "linear" or "inverse"
|
|
9276
|
-
* @returns {object} a dictionary of [fee structures]{@link https://docs.ccxt.com/#/?id=fee-structure} indexed by market symbols
|
|
9277
|
-
*/
|
|
9278
9280
|
await this.loadMarkets();
|
|
9279
9281
|
let type = undefined;
|
|
9280
9282
|
[type, params] = this.handleMarketTypeAndParams('fetchTradingFees', undefined, params);
|
|
@@ -9442,20 +9444,20 @@ class binance extends binance$1 {
|
|
|
9442
9444
|
}
|
|
9443
9445
|
return undefined;
|
|
9444
9446
|
}
|
|
9447
|
+
/**
|
|
9448
|
+
* @method
|
|
9449
|
+
* @name binance#futuresTransfer
|
|
9450
|
+
* @ignore
|
|
9451
|
+
* @description transfer between futures account
|
|
9452
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/New-Future-Account-Transfer
|
|
9453
|
+
* @param {string} code unified currency code
|
|
9454
|
+
* @param {float} amount the amount to transfer
|
|
9455
|
+
* @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
|
|
9456
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
9457
|
+
* @param {float} params.recvWindow
|
|
9458
|
+
* @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=futures-transfer-structure}
|
|
9459
|
+
*/
|
|
9445
9460
|
async futuresTransfer(code, amount, type, params = {}) {
|
|
9446
|
-
/**
|
|
9447
|
-
* @method
|
|
9448
|
-
* @name binance#futuresTransfer
|
|
9449
|
-
* @ignore
|
|
9450
|
-
* @description transfer between futures account
|
|
9451
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/New-Future-Account-Transfer
|
|
9452
|
-
* @param {string} code unified currency code
|
|
9453
|
-
* @param {float} amount the amount to transfer
|
|
9454
|
-
* @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
|
|
9455
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
9456
|
-
* @param {float} params.recvWindow
|
|
9457
|
-
* @returns {object} a [transfer structure]{@link https://docs.ccxt.com/#/?id=futures-transfer-structure}
|
|
9458
|
-
*/
|
|
9459
9461
|
if ((type < 1) || (type > 4)) {
|
|
9460
9462
|
throw new errors.ArgumentsRequired(this.id + ' type must be between 1 and 4');
|
|
9461
9463
|
}
|
|
@@ -9474,17 +9476,17 @@ class binance extends binance$1 {
|
|
|
9474
9476
|
//
|
|
9475
9477
|
return this.parseTransfer(response, currency);
|
|
9476
9478
|
}
|
|
9479
|
+
/**
|
|
9480
|
+
* @method
|
|
9481
|
+
* @name binance#fetchFundingRate
|
|
9482
|
+
* @description fetch the current funding rate
|
|
9483
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Mark-Price
|
|
9484
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Index-Price-and-Mark-Price
|
|
9485
|
+
* @param {string} symbol unified market symbol
|
|
9486
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
9487
|
+
* @returns {object} a [funding rate structure]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
|
|
9488
|
+
*/
|
|
9477
9489
|
async fetchFundingRate(symbol, params = {}) {
|
|
9478
|
-
/**
|
|
9479
|
-
* @method
|
|
9480
|
-
* @name binance#fetchFundingRate
|
|
9481
|
-
* @description fetch the current funding rate
|
|
9482
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Mark-Price
|
|
9483
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Index-Price-and-Mark-Price
|
|
9484
|
-
* @param {string} symbol unified market symbol
|
|
9485
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
9486
|
-
* @returns {object} a [funding rate structure]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
|
|
9487
|
-
*/
|
|
9488
9490
|
await this.loadMarkets();
|
|
9489
9491
|
const market = this.market(symbol);
|
|
9490
9492
|
const request = {
|
|
@@ -9517,22 +9519,22 @@ class binance extends binance$1 {
|
|
|
9517
9519
|
//
|
|
9518
9520
|
return this.parseFundingRate(response, market);
|
|
9519
9521
|
}
|
|
9522
|
+
/**
|
|
9523
|
+
* @method
|
|
9524
|
+
* @name binance#fetchFundingRateHistory
|
|
9525
|
+
* @description fetches historical funding rate prices
|
|
9526
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Get-Funding-Rate-History
|
|
9527
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Get-Funding-Rate-History-of-Perpetual-Futures
|
|
9528
|
+
* @param {string} symbol unified symbol of the market to fetch the funding rate history for
|
|
9529
|
+
* @param {int} [since] timestamp in ms of the earliest funding rate to fetch
|
|
9530
|
+
* @param {int} [limit] the maximum amount of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure} to fetch
|
|
9531
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
9532
|
+
* @param {int} [params.until] timestamp in ms of the latest funding rate
|
|
9533
|
+
* @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)
|
|
9534
|
+
* @param {string} [params.subType] "linear" or "inverse"
|
|
9535
|
+
* @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure}
|
|
9536
|
+
*/
|
|
9520
9537
|
async fetchFundingRateHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
9521
|
-
/**
|
|
9522
|
-
* @method
|
|
9523
|
-
* @name binance#fetchFundingRateHistory
|
|
9524
|
-
* @description fetches historical funding rate prices
|
|
9525
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Get-Funding-Rate-History
|
|
9526
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Get-Funding-Rate-History-of-Perpetual-Futures
|
|
9527
|
-
* @param {string} symbol unified symbol of the market to fetch the funding rate history for
|
|
9528
|
-
* @param {int} [since] timestamp in ms of the earliest funding rate to fetch
|
|
9529
|
-
* @param {int} [limit] the maximum amount of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure} to fetch
|
|
9530
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
9531
|
-
* @param {int} [params.until] timestamp in ms of the latest funding rate
|
|
9532
|
-
* @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)
|
|
9533
|
-
* @param {string} [params.subType] "linear" or "inverse"
|
|
9534
|
-
* @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-history-structure}
|
|
9535
|
-
*/
|
|
9536
9538
|
await this.loadMarkets();
|
|
9537
9539
|
const request = {};
|
|
9538
9540
|
let paginate = false;
|
|
@@ -9595,18 +9597,18 @@ class binance extends binance$1 {
|
|
|
9595
9597
|
const sorted = this.sortBy(rates, 'timestamp');
|
|
9596
9598
|
return this.filterBySymbolSinceLimit(sorted, symbol, since, limit);
|
|
9597
9599
|
}
|
|
9600
|
+
/**
|
|
9601
|
+
* @method
|
|
9602
|
+
* @name binance#fetchFundingRates
|
|
9603
|
+
* @description fetch the funding rate for multiple markets
|
|
9604
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Mark-Price
|
|
9605
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Index-Price-and-Mark-Price
|
|
9606
|
+
* @param {string[]|undefined} symbols list of unified market symbols
|
|
9607
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
9608
|
+
* @param {string} [params.subType] "linear" or "inverse"
|
|
9609
|
+
* @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rates-structure}, indexed by market symbols
|
|
9610
|
+
*/
|
|
9598
9611
|
async fetchFundingRates(symbols = undefined, params = {}) {
|
|
9599
|
-
/**
|
|
9600
|
-
* @method
|
|
9601
|
-
* @name binance#fetchFundingRates
|
|
9602
|
-
* @description fetch the funding rate for multiple markets
|
|
9603
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Mark-Price
|
|
9604
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Index-Price-and-Mark-Price
|
|
9605
|
-
* @param {string[]|undefined} symbols list of unified market symbols
|
|
9606
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
9607
|
-
* @param {string} [params.subType] "linear" or "inverse"
|
|
9608
|
-
* @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rates-structure}, indexed by market symbols
|
|
9609
|
-
*/
|
|
9610
9612
|
await this.loadMarkets();
|
|
9611
9613
|
symbols = this.marketSymbols(symbols);
|
|
9612
9614
|
const defaultType = this.safeString2(this.options, 'fetchFundingRates', 'defaultType', 'future');
|
|
@@ -10274,21 +10276,21 @@ class binance extends binance$1 {
|
|
|
10274
10276
|
}
|
|
10275
10277
|
return this.options['leverageBrackets'];
|
|
10276
10278
|
}
|
|
10279
|
+
/**
|
|
10280
|
+
* @method
|
|
10281
|
+
* @name binance#fetchLeverageTiers
|
|
10282
|
+
* @description retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes
|
|
10283
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Notional-and-Leverage-Brackets
|
|
10284
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Notional-Bracket-for-Symbol
|
|
10285
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/account/UM-Notional-and-Leverage-Brackets
|
|
10286
|
+
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/account/CM-Notional-and-Leverage-Brackets
|
|
10287
|
+
* @param {string[]|undefined} symbols list of unified market symbols
|
|
10288
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
10289
|
+
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch the leverage tiers for a portfolio margin account
|
|
10290
|
+
* @param {string} [params.subType] "linear" or "inverse"
|
|
10291
|
+
* @returns {object} a dictionary of [leverage tiers structures]{@link https://docs.ccxt.com/#/?id=leverage-tiers-structure}, indexed by market symbols
|
|
10292
|
+
*/
|
|
10277
10293
|
async fetchLeverageTiers(symbols = undefined, params = {}) {
|
|
10278
|
-
/**
|
|
10279
|
-
* @method
|
|
10280
|
-
* @name binance#fetchLeverageTiers
|
|
10281
|
-
* @description retrieve information on the maximum leverage, and maintenance margin for trades of varying trade sizes
|
|
10282
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Notional-and-Leverage-Brackets
|
|
10283
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Notional-Bracket-for-Symbol
|
|
10284
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/account/UM-Notional-and-Leverage-Brackets
|
|
10285
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/account/CM-Notional-and-Leverage-Brackets
|
|
10286
|
-
* @param {string[]|undefined} symbols list of unified market symbols
|
|
10287
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
10288
|
-
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch the leverage tiers for a portfolio margin account
|
|
10289
|
-
* @param {string} [params.subType] "linear" or "inverse"
|
|
10290
|
-
* @returns {object} a dictionary of [leverage tiers structures]{@link https://docs.ccxt.com/#/?id=leverage-tiers-structure}, indexed by market symbols
|
|
10291
|
-
*/
|
|
10292
10294
|
await this.loadMarkets();
|
|
10293
10295
|
let type = undefined;
|
|
10294
10296
|
[type, params] = this.handleMarketTypeAndParams('fetchLeverageTiers', undefined, params);
|
|
@@ -10387,6 +10389,7 @@ class binance extends binance$1 {
|
|
|
10387
10389
|
const bracket = brackets[j];
|
|
10388
10390
|
tiers.push({
|
|
10389
10391
|
'tier': this.safeNumber(bracket, 'bracket'),
|
|
10392
|
+
'symbol': this.safeSymbol(marketId, market),
|
|
10390
10393
|
'currency': market['quote'],
|
|
10391
10394
|
'minNotional': this.safeNumber2(bracket, 'notionalFloor', 'qtyFloor'),
|
|
10392
10395
|
'maxNotional': this.safeNumber2(bracket, 'notionalCap', 'qtyCap'),
|
|
@@ -10397,16 +10400,16 @@ class binance extends binance$1 {
|
|
|
10397
10400
|
}
|
|
10398
10401
|
return tiers;
|
|
10399
10402
|
}
|
|
10403
|
+
/**
|
|
10404
|
+
* @method
|
|
10405
|
+
* @name binance#fetchPosition
|
|
10406
|
+
* @description fetch data on an open position
|
|
10407
|
+
* @see https://developers.binance.com/docs/derivatives/option/trade/Option-Position-Information
|
|
10408
|
+
* @param {string} symbol unified market symbol of the market the position is held in
|
|
10409
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
10410
|
+
* @returns {object} a [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
10411
|
+
*/
|
|
10400
10412
|
async fetchPosition(symbol, params = {}) {
|
|
10401
|
-
/**
|
|
10402
|
-
* @method
|
|
10403
|
-
* @name binance#fetchPosition
|
|
10404
|
-
* @description fetch data on an open position
|
|
10405
|
-
* @see https://developers.binance.com/docs/derivatives/option/trade/Option-Position-Information
|
|
10406
|
-
* @param {string} symbol unified market symbol of the market the position is held in
|
|
10407
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
10408
|
-
* @returns {object} a [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
10409
|
-
*/
|
|
10410
10413
|
await this.loadMarkets();
|
|
10411
10414
|
const market = this.market(symbol);
|
|
10412
10415
|
if (!market['option']) {
|
|
@@ -10441,16 +10444,16 @@ class binance extends binance$1 {
|
|
|
10441
10444
|
//
|
|
10442
10445
|
return this.parsePosition(response[0], market);
|
|
10443
10446
|
}
|
|
10447
|
+
/**
|
|
10448
|
+
* @method
|
|
10449
|
+
* @name binance#fetchOptionPositions
|
|
10450
|
+
* @description fetch data on open options positions
|
|
10451
|
+
* @see https://developers.binance.com/docs/derivatives/option/trade/Option-Position-Information
|
|
10452
|
+
* @param {string[]|undefined} symbols list of unified market symbols
|
|
10453
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
10454
|
+
* @returns {object[]} a list of [position structures]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
10455
|
+
*/
|
|
10444
10456
|
async fetchOptionPositions(symbols = undefined, params = {}) {
|
|
10445
|
-
/**
|
|
10446
|
-
* @method
|
|
10447
|
-
* @name binance#fetchOptionPositions
|
|
10448
|
-
* @description fetch data on open options positions
|
|
10449
|
-
* @see https://developers.binance.com/docs/derivatives/option/trade/Option-Position-Information
|
|
10450
|
-
* @param {string[]|undefined} symbols list of unified market symbols
|
|
10451
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
10452
|
-
* @returns {object[]} a list of [position structures]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
10453
|
-
*/
|
|
10454
10457
|
await this.loadMarkets();
|
|
10455
10458
|
symbols = this.marketSymbols(symbols);
|
|
10456
10459
|
const request = {};
|
|
@@ -10557,22 +10560,23 @@ class binance extends binance$1 {
|
|
|
10557
10560
|
'percentage': undefined,
|
|
10558
10561
|
});
|
|
10559
10562
|
}
|
|
10563
|
+
/**
|
|
10564
|
+
* @method
|
|
10565
|
+
* @name binance#fetchPositions
|
|
10566
|
+
* @description fetch all open positions
|
|
10567
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Information-V2
|
|
10568
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Account-Information
|
|
10569
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Position-Information-V2
|
|
10570
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Position-Information
|
|
10571
|
+
* @see https://developers.binance.com/docs/derivatives/option/trade/Option-Position-Information
|
|
10572
|
+
* @param {string[]} [symbols] list of unified market symbols
|
|
10573
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
10574
|
+
* @param {object} [params.params] extra parameters specific to the exchange API endpoint
|
|
10575
|
+
* @param {string} [params.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
|
+
*/
|
|
10560
10579
|
async fetchPositions(symbols = undefined, params = {}) {
|
|
10561
|
-
/**
|
|
10562
|
-
* @method
|
|
10563
|
-
* @name binance#fetchPositions
|
|
10564
|
-
* @description fetch all open positions
|
|
10565
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Information-V2
|
|
10566
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Account-Information
|
|
10567
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Position-Information-V2
|
|
10568
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Position-Information
|
|
10569
|
-
* @see https://developers.binance.com/docs/derivatives/option/trade/Option-Position-Information
|
|
10570
|
-
* @param {string[]} [symbols] list of unified market symbols
|
|
10571
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
10572
|
-
* @param {string} [method] method name to call, "positionRisk", "account" or "option", default is "positionRisk"
|
|
10573
|
-
* @param {bool} [params.useV2] set to true if you want to use the obsolete endpoint, where some more additional fields were provided
|
|
10574
|
-
* @returns {object[]} a list of [position structure]{@link https://docs.ccxt.com/#/?id=position-structure}
|
|
10575
|
-
*/
|
|
10576
10580
|
let defaultMethod = undefined;
|
|
10577
10581
|
[defaultMethod, params] = this.handleOptionAndParams(params, 'fetchPositions', 'method');
|
|
10578
10582
|
if (defaultMethod === undefined) {
|
|
@@ -10597,25 +10601,25 @@ class binance extends binance$1 {
|
|
|
10597
10601
|
throw new errors.NotSupported(this.id + '.options["fetchPositions"]["method"] or params["method"] = "' + defaultMethod + '" is invalid, please choose between "account", "positionRisk" and "option"');
|
|
10598
10602
|
}
|
|
10599
10603
|
}
|
|
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
|
+
*/
|
|
10600
10622
|
async fetchAccountPositions(symbols = undefined, params = {}) {
|
|
10601
|
-
/**
|
|
10602
|
-
* @method
|
|
10603
|
-
* @name binance#fetchAccountPositions
|
|
10604
|
-
* @ignore
|
|
10605
|
-
* @description fetch account positions
|
|
10606
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Information-V2
|
|
10607
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Account-Information
|
|
10608
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Position-Information-V2
|
|
10609
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Position-Information
|
|
10610
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Information-V3
|
|
10611
|
-
* @param {string[]} [symbols] list of unified market symbols
|
|
10612
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
10613
|
-
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch positions in a portfolio margin account
|
|
10614
|
-
* @param {string} [params.subType] "linear" or "inverse"
|
|
10615
|
-
* @param {boolean} [params.filterClosed] set to true if you would like to filter out closed positions, default is false
|
|
10616
|
-
* @param {boolean} [params.useV2] set to true if you want to use obsolete endpoint, where some more additional fields were provided
|
|
10617
|
-
* @returns {object} data on account positions
|
|
10618
|
-
*/
|
|
10619
10623
|
if (symbols !== undefined) {
|
|
10620
10624
|
if (!Array.isArray(symbols)) {
|
|
10621
10625
|
throw new errors.ArgumentsRequired(this.id + ' fetchPositions() requires an array argument for symbols');
|
|
@@ -10729,24 +10733,24 @@ class binance extends binance$1 {
|
|
|
10729
10733
|
symbols = this.marketSymbols(symbols);
|
|
10730
10734
|
return this.filterByArrayPositions(result, 'symbol', symbols, false);
|
|
10731
10735
|
}
|
|
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
|
+
*/
|
|
10732
10753
|
async fetchPositionsRisk(symbols = undefined, params = {}) {
|
|
10733
|
-
/**
|
|
10734
|
-
* @method
|
|
10735
|
-
* @name binance#fetchPositionsRisk
|
|
10736
|
-
* @ignore
|
|
10737
|
-
* @description fetch positions risk
|
|
10738
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Position-Information-V2
|
|
10739
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Position-Information
|
|
10740
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-UM-Position-Information
|
|
10741
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/account/Query-CM-Position-Information
|
|
10742
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Position-Information-V3
|
|
10743
|
-
* @param {string[]|undefined} symbols list of unified market symbols
|
|
10744
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
10745
|
-
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch positions for a portfolio margin account
|
|
10746
|
-
* @param {string} [params.subType] "linear" or "inverse"
|
|
10747
|
-
* @param {bool} [params.useV2] set to true if you want to use the obsolete endpoint, where some more additional fields were provided
|
|
10748
|
-
* @returns {object} data on the positions risk
|
|
10749
|
-
*/
|
|
10750
10754
|
if (symbols !== undefined) {
|
|
10751
10755
|
if (!Array.isArray(symbols)) {
|
|
10752
10756
|
throw new errors.ArgumentsRequired(this.id + ' fetchPositionsRisk() requires an array argument for symbols');
|
|
@@ -10909,24 +10913,24 @@ class binance extends binance$1 {
|
|
|
10909
10913
|
symbols = this.marketSymbols(symbols);
|
|
10910
10914
|
return this.filterByArrayPositions(result, 'symbol', symbols, false);
|
|
10911
10915
|
}
|
|
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
|
+
*/
|
|
10912
10933
|
async fetchFundingHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
10913
|
-
/**
|
|
10914
|
-
* @method
|
|
10915
|
-
* @name binance#fetchFundingHistory
|
|
10916
|
-
* @description fetch the history of funding payments paid and received on this account
|
|
10917
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Income-History
|
|
10918
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Get-Income-History
|
|
10919
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Income-History
|
|
10920
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-CM-Income-History
|
|
10921
|
-
* @param {string} symbol unified market symbol
|
|
10922
|
-
* @param {int} [since] the earliest time in ms to fetch funding history for
|
|
10923
|
-
* @param {int} [limit] the maximum number of funding history structures to retrieve
|
|
10924
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
10925
|
-
* @param {int} [params.until] timestamp in ms of the latest funding history entry
|
|
10926
|
-
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch the funding history for a portfolio margin account
|
|
10927
|
-
* @param {string} [params.subType] "linear" or "inverse"
|
|
10928
|
-
* @returns {object} a [funding history structure]{@link https://docs.ccxt.com/#/?id=funding-history-structure}
|
|
10929
|
-
*/
|
|
10930
10934
|
await this.loadMarkets();
|
|
10931
10935
|
let market = undefined;
|
|
10932
10936
|
let request = {
|
|
@@ -10975,21 +10979,21 @@ class binance extends binance$1 {
|
|
|
10975
10979
|
}
|
|
10976
10980
|
return this.parseIncomes(response, market, since, limit);
|
|
10977
10981
|
}
|
|
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
|
+
*/
|
|
10978
10996
|
async setLeverage(leverage, symbol = undefined, params = {}) {
|
|
10979
|
-
/**
|
|
10980
|
-
* @method
|
|
10981
|
-
* @name binance#setLeverage
|
|
10982
|
-
* @description set the level of leverage for a market
|
|
10983
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Change-Initial-Leverage
|
|
10984
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Change-Initial-Leverage
|
|
10985
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-UM-Initial-Leverage
|
|
10986
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/account/Change-CM-Initial-Leverage
|
|
10987
|
-
* @param {float} leverage the rate of leverage
|
|
10988
|
-
* @param {string} symbol unified market symbol
|
|
10989
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
10990
|
-
* @param {boolean} [params.portfolioMargin] set to true if you would like to set the leverage for a trading pair in a portfolio margin account
|
|
10991
|
-
* @returns {object} response from the exchange
|
|
10992
|
-
*/
|
|
10993
10997
|
if (symbol === undefined) {
|
|
10994
10998
|
throw new errors.ArgumentsRequired(this.id + ' setLeverage() requires a symbol argument');
|
|
10995
10999
|
}
|
|
@@ -11028,18 +11032,18 @@ class binance extends binance$1 {
|
|
|
11028
11032
|
}
|
|
11029
11033
|
return response;
|
|
11030
11034
|
}
|
|
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
|
+
*/
|
|
11031
11046
|
async setMarginMode(marginMode, symbol = undefined, params = {}) {
|
|
11032
|
-
/**
|
|
11033
|
-
* @method
|
|
11034
|
-
* @name binance#setMarginMode
|
|
11035
|
-
* @description set margin mode to 'cross' or 'isolated'
|
|
11036
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Change-Margin-Type
|
|
11037
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Change-Margin-Type
|
|
11038
|
-
* @param {string} marginMode 'cross' or 'isolated'
|
|
11039
|
-
* @param {string} symbol unified market symbol
|
|
11040
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
11041
|
-
* @returns {object} response from the exchange
|
|
11042
|
-
*/
|
|
11043
11047
|
if (symbol === undefined) {
|
|
11044
11048
|
throw new errors.ArgumentsRequired(this.id + ' setMarginMode() requires a symbol argument');
|
|
11045
11049
|
}
|
|
@@ -11096,22 +11100,22 @@ class binance extends binance$1 {
|
|
|
11096
11100
|
}
|
|
11097
11101
|
return response;
|
|
11098
11102
|
}
|
|
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
|
+
*/
|
|
11099
11118
|
async setPositionMode(hedged, symbol = undefined, params = {}) {
|
|
11100
|
-
/**
|
|
11101
|
-
* @method
|
|
11102
|
-
* @name binance#setPositionMode
|
|
11103
|
-
* @description set hedged to true or false for a market
|
|
11104
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Change-Position-Mode
|
|
11105
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Change-Position-Mode
|
|
11106
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Current-Position-Mode
|
|
11107
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-CM-Current-Position-Mode
|
|
11108
|
-
* @param {bool} hedged set to true to use dualSidePosition
|
|
11109
|
-
* @param {string} symbol not used by binance setPositionMode ()
|
|
11110
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
11111
|
-
* @param {boolean} [params.portfolioMargin] set to true if you would like to set the position mode for a portfolio margin account
|
|
11112
|
-
* @param {string} [params.subType] "linear" or "inverse"
|
|
11113
|
-
* @returns {object} response from the exchange
|
|
11114
|
-
*/
|
|
11115
11119
|
const defaultType = this.safeString(this.options, 'defaultType', 'future');
|
|
11116
11120
|
const type = this.safeString(params, 'type', defaultType);
|
|
11117
11121
|
params = this.omit(params, ['type']);
|
|
@@ -11157,21 +11161,21 @@ class binance extends binance$1 {
|
|
|
11157
11161
|
//
|
|
11158
11162
|
return response;
|
|
11159
11163
|
}
|
|
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
|
+
*/
|
|
11160
11178
|
async fetchLeverages(symbols = undefined, params = {}) {
|
|
11161
|
-
/**
|
|
11162
|
-
* @method
|
|
11163
|
-
* @name binance#fetchLeverages
|
|
11164
|
-
* @description fetch the set leverage for all markets
|
|
11165
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Information-V2
|
|
11166
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Account-Information
|
|
11167
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Account-Detail
|
|
11168
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-CM-Account-Detail
|
|
11169
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Symbol-Config
|
|
11170
|
-
* @param {string[]} [symbols] a list of unified market symbols
|
|
11171
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
11172
|
-
* @param {string} [params.subType] "linear" or "inverse"
|
|
11173
|
-
* @returns {object} a list of [leverage structures]{@link https://docs.ccxt.com/#/?id=leverage-structure}
|
|
11174
|
-
*/
|
|
11175
11179
|
await this.loadMarkets();
|
|
11176
11180
|
await this.loadLeverageBrackets(false, params);
|
|
11177
11181
|
let type = undefined;
|
|
@@ -11239,18 +11243,18 @@ class binance extends binance$1 {
|
|
|
11239
11243
|
'shortLeverage': shortLeverage,
|
|
11240
11244
|
};
|
|
11241
11245
|
}
|
|
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
|
+
*/
|
|
11242
11257
|
async fetchSettlementHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
11243
|
-
/**
|
|
11244
|
-
* @method
|
|
11245
|
-
* @name binance#fetchSettlementHistory
|
|
11246
|
-
* @description fetches historical settlement records
|
|
11247
|
-
* @see https://developers.binance.com/docs/derivatives/option/market-data/Historical-Exercise-Records
|
|
11248
|
-
* @param {string} symbol unified market symbol of the settlement history
|
|
11249
|
-
* @param {int} [since] timestamp in ms
|
|
11250
|
-
* @param {int} [limit] number of records, default 100, max 100
|
|
11251
|
-
* @param {object} [params] exchange specific params
|
|
11252
|
-
* @returns {object[]} a list of [settlement history objects]{@link https://docs.ccxt.com/#/?id=settlement-history-structure}
|
|
11253
|
-
*/
|
|
11254
11258
|
await this.loadMarkets();
|
|
11255
11259
|
const market = (symbol === undefined) ? undefined : this.market(symbol);
|
|
11256
11260
|
let type = undefined;
|
|
@@ -11285,18 +11289,18 @@ class binance extends binance$1 {
|
|
|
11285
11289
|
const sorted = this.sortBy(settlements, 'timestamp');
|
|
11286
11290
|
return this.filterBySymbolSinceLimit(sorted, symbol, since, limit);
|
|
11287
11291
|
}
|
|
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
|
+
*/
|
|
11288
11303
|
async fetchMySettlementHistory(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
11289
|
-
/**
|
|
11290
|
-
* @method
|
|
11291
|
-
* @name binance#fetchMySettlementHistory
|
|
11292
|
-
* @description fetches historical settlement records of the user
|
|
11293
|
-
* @see https://developers.binance.com/docs/derivatives/option/trade/User-Exercise-Record
|
|
11294
|
-
* @param {string} symbol unified market symbol of the settlement history
|
|
11295
|
-
* @param {int} [since] timestamp in ms
|
|
11296
|
-
* @param {int} [limit] number of records
|
|
11297
|
-
* @param {object} [params] exchange specific params
|
|
11298
|
-
* @returns {object[]} a list of [settlement history objects]
|
|
11299
|
-
*/
|
|
11300
11304
|
await this.loadMarkets();
|
|
11301
11305
|
const market = (symbol === undefined) ? undefined : this.market(symbol);
|
|
11302
11306
|
let type = undefined;
|
|
@@ -11421,17 +11425,17 @@ class binance extends binance$1 {
|
|
|
11421
11425
|
}
|
|
11422
11426
|
return result;
|
|
11423
11427
|
}
|
|
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
|
+
*/
|
|
11424
11438
|
async fetchLedgerEntry(id, code = undefined, params = {}) {
|
|
11425
|
-
/**
|
|
11426
|
-
* @method
|
|
11427
|
-
* @name binance#fetchLedgerEntry
|
|
11428
|
-
* @description fetch the history of changes, actions done by the user or operations that altered the balance of the user
|
|
11429
|
-
* @see https://developers.binance.com/docs/derivatives/option/account/Account-Funding-Flow
|
|
11430
|
-
* @param {string} id the identification number of the ledger entry
|
|
11431
|
-
* @param {string} code unified currency code
|
|
11432
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
11433
|
-
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
|
|
11434
|
-
*/
|
|
11435
11439
|
await this.loadMarkets();
|
|
11436
11440
|
let type = undefined;
|
|
11437
11441
|
[type, params] = this.handleMarketTypeAndParams('fetchLedgerEntry', undefined, params);
|
|
@@ -11459,26 +11463,26 @@ class binance extends binance$1 {
|
|
|
11459
11463
|
const first = this.safeDict(response, 0, response);
|
|
11460
11464
|
return this.parseLedgerEntry(first, currency);
|
|
11461
11465
|
}
|
|
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
|
+
*/
|
|
11462
11485
|
async fetchLedger(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
11463
|
-
/**
|
|
11464
|
-
* @method
|
|
11465
|
-
* @name binance#fetchLedger
|
|
11466
|
-
* @description fetch the history of changes, actions done by the user or operations that altered the balance of the user
|
|
11467
|
-
* @see https://developers.binance.com/docs/derivatives/option/account/Account-Funding-Flow
|
|
11468
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Income-History
|
|
11469
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Get-Income-History
|
|
11470
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-UM-Income-History
|
|
11471
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-CM-Income-History
|
|
11472
|
-
* @param {string} [code] unified currency code
|
|
11473
|
-
* @param {int} [since] timestamp in ms of the earliest ledger entry
|
|
11474
|
-
* @param {int} [limit] max number of ledger entries to return
|
|
11475
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
11476
|
-
* @param {int} [params.until] timestamp in ms of the latest ledger entry
|
|
11477
|
-
* @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)
|
|
11478
|
-
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch the ledger for a portfolio margin account
|
|
11479
|
-
* @param {string} [params.subType] "linear" or "inverse"
|
|
11480
|
-
* @returns {object} a [ledger structure]{@link https://docs.ccxt.com/#/?id=ledger-structure}
|
|
11481
|
-
*/
|
|
11482
11486
|
await this.loadMarkets();
|
|
11483
11487
|
let paginate = false;
|
|
11484
11488
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchLedger', 'paginate');
|
|
@@ -11992,44 +11996,44 @@ class binance extends binance$1 {
|
|
|
11992
11996
|
'datetime': this.iso8601(timestamp),
|
|
11993
11997
|
};
|
|
11994
11998
|
}
|
|
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
|
+
*/
|
|
11995
12010
|
async reduceMargin(symbol, amount, params = {}) {
|
|
11996
|
-
/**
|
|
11997
|
-
* @method
|
|
11998
|
-
* @name binance#reduceMargin
|
|
11999
|
-
* @description remove margin from a position
|
|
12000
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Isolated-Position-Margin
|
|
12001
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Modify-Isolated-Position-Margin
|
|
12002
|
-
* @param {string} symbol unified market symbol
|
|
12003
|
-
* @param {float} amount the amount of margin to remove
|
|
12004
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
12005
|
-
* @returns {object} a [margin structure]{@link https://docs.ccxt.com/#/?id=reduce-margin-structure}
|
|
12006
|
-
*/
|
|
12007
12011
|
return await this.modifyMarginHelper(symbol, amount, 2, params);
|
|
12008
12012
|
}
|
|
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
|
+
*/
|
|
12009
12024
|
async addMargin(symbol, amount, params = {}) {
|
|
12010
|
-
/**
|
|
12011
|
-
* @method
|
|
12012
|
-
* @name binance#addMargin
|
|
12013
|
-
* @description add margin
|
|
12014
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Modify-Isolated-Position-Margin
|
|
12015
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Modify-Isolated-Position-Margin
|
|
12016
|
-
* @param {string} symbol unified market symbol
|
|
12017
|
-
* @param {float} amount amount of margin to add
|
|
12018
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
12019
|
-
* @returns {object} a [margin structure]{@link https://docs.ccxt.com/#/?id=add-margin-structure}
|
|
12020
|
-
*/
|
|
12021
12025
|
return await this.modifyMarginHelper(symbol, amount, 1, params);
|
|
12022
12026
|
}
|
|
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
|
+
*/
|
|
12023
12036
|
async fetchCrossBorrowRate(code, params = {}) {
|
|
12024
|
-
/**
|
|
12025
|
-
* @method
|
|
12026
|
-
* @name binance#fetchCrossBorrowRate
|
|
12027
|
-
* @description fetch the rate of interest to borrow a currency for margin trading
|
|
12028
|
-
* @see https://developers.binance.com/docs/margin_trading/borrow-and-repay/Query-Margin-Interest-Rate-History
|
|
12029
|
-
* @param {string} code unified currency code
|
|
12030
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
12031
|
-
* @returns {object} a [borrow rate structure]{@link https://docs.ccxt.com/#/?id=borrow-rate-structure}
|
|
12032
|
-
*/
|
|
12033
12037
|
await this.loadMarkets();
|
|
12034
12038
|
const currency = this.currency(code);
|
|
12035
12039
|
const request = {
|
|
@@ -12050,38 +12054,38 @@ class binance extends binance$1 {
|
|
|
12050
12054
|
const rate = this.safeDict(response, 0);
|
|
12051
12055
|
return this.parseBorrowRate(rate);
|
|
12052
12056
|
}
|
|
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
|
+
*/
|
|
12053
12069
|
async fetchIsolatedBorrowRate(symbol, params = {}) {
|
|
12054
|
-
/**
|
|
12055
|
-
* @method
|
|
12056
|
-
* @name binance#fetchIsolatedBorrowRate
|
|
12057
|
-
* @description fetch the rate of interest to borrow a currency for margin trading
|
|
12058
|
-
* @see https://developers.binance.com/docs/margin_trading/account/Query-Isolated-Margin-Fee-Data
|
|
12059
|
-
* @param {string} symbol unified market symbol
|
|
12060
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
12061
|
-
*
|
|
12062
|
-
* EXCHANGE SPECIFIC PARAMETERS
|
|
12063
|
-
* @param {object} [params.vipLevel] user's current specific margin data will be returned if viplevel is omitted
|
|
12064
|
-
* @returns {object} an [isolated borrow rate structure]{@link https://docs.ccxt.com/#/?id=isolated-borrow-rate-structure}
|
|
12065
|
-
*/
|
|
12066
12070
|
const request = {
|
|
12067
12071
|
'symbol': symbol,
|
|
12068
12072
|
};
|
|
12069
12073
|
const borrowRates = await this.fetchIsolatedBorrowRates(this.extend(request, params));
|
|
12070
12074
|
return this.safeDict(borrowRates, symbol);
|
|
12071
12075
|
}
|
|
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
|
+
*/
|
|
12072
12088
|
async fetchIsolatedBorrowRates(params = {}) {
|
|
12073
|
-
/**
|
|
12074
|
-
* @method
|
|
12075
|
-
* @name binance#fetchIsolatedBorrowRates
|
|
12076
|
-
* @description fetch the borrow interest rates of all currencies
|
|
12077
|
-
* @see https://developers.binance.com/docs/margin_trading/account/Query-Isolated-Margin-Fee-Data
|
|
12078
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
12079
|
-
* @param {object} [params.symbol] unified market symbol
|
|
12080
|
-
*
|
|
12081
|
-
* EXCHANGE SPECIFIC PARAMETERS
|
|
12082
|
-
* @param {object} [params.vipLevel] user's current specific margin data will be returned if viplevel is omitted
|
|
12083
|
-
* @returns {object} a [borrow rate structure]{@link https://docs.ccxt.com/#/?id=borrow-rate-structure}
|
|
12084
|
-
*/
|
|
12085
12089
|
await this.loadMarkets();
|
|
12086
12090
|
const request = {};
|
|
12087
12091
|
const symbol = this.safeString(params, 'symbol');
|
|
@@ -12114,18 +12118,18 @@ class binance extends binance$1 {
|
|
|
12114
12118
|
//
|
|
12115
12119
|
return this.parseIsolatedBorrowRates(response);
|
|
12116
12120
|
}
|
|
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
|
+
*/
|
|
12117
12132
|
async fetchBorrowRateHistory(code, since = undefined, limit = undefined, params = {}) {
|
|
12118
|
-
/**
|
|
12119
|
-
* @method
|
|
12120
|
-
* @name binance#fetchBorrowRateHistory
|
|
12121
|
-
* @description retrieves a history of a currencies borrow interest rate at specific time slots
|
|
12122
|
-
* @see https://developers.binance.com/docs/margin_trading/borrow-and-repay/Query-Margin-Interest-Rate-History
|
|
12123
|
-
* @param {string} code unified currency code
|
|
12124
|
-
* @param {int} [since] timestamp for the earliest borrow rate
|
|
12125
|
-
* @param {int} [limit] the maximum number of [borrow rate structures]{@link https://docs.ccxt.com/#/?id=borrow-rate-structure} to retrieve
|
|
12126
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
12127
|
-
* @returns {object[]} an array of [borrow rate structures]{@link https://docs.ccxt.com/#/?id=borrow-rate-structure}
|
|
12128
|
-
*/
|
|
12129
12133
|
await this.loadMarkets();
|
|
12130
12134
|
if (limit === undefined) {
|
|
12131
12135
|
limit = 93;
|
|
@@ -12215,17 +12219,17 @@ class binance extends binance$1 {
|
|
|
12215
12219
|
'datetime': undefined,
|
|
12216
12220
|
};
|
|
12217
12221
|
}
|
|
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
|
+
*/
|
|
12218
12232
|
async createGiftCode(code, amount, params = {}) {
|
|
12219
|
-
/**
|
|
12220
|
-
* @method
|
|
12221
|
-
* @name binance#createGiftCode
|
|
12222
|
-
* @description create gift code
|
|
12223
|
-
* @see https://developers.binance.com/docs/gift_card/market-data/Create-a-single-token-gift-card
|
|
12224
|
-
* @param {string} code gift code
|
|
12225
|
-
* @param {float} amount amount of currency for the gift
|
|
12226
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
12227
|
-
* @returns {object} The gift code id, code, currency and amount
|
|
12228
|
-
*/
|
|
12229
12233
|
await this.loadMarkets();
|
|
12230
12234
|
const currency = this.currency(code);
|
|
12231
12235
|
// ensure you have enough token in your funding account before calling this code
|
|
@@ -12253,16 +12257,16 @@ class binance extends binance$1 {
|
|
|
12253
12257
|
'amount': amount,
|
|
12254
12258
|
};
|
|
12255
12259
|
}
|
|
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
|
+
*/
|
|
12256
12269
|
async redeemGiftCode(giftcardCode, params = {}) {
|
|
12257
|
-
/**
|
|
12258
|
-
* @method
|
|
12259
|
-
* @name binance#redeemGiftCode
|
|
12260
|
-
* @description redeem gift code
|
|
12261
|
-
* @see https://developers.binance.com/docs/gift_card/market-data/Redeem-a-Binance-Gift-Card
|
|
12262
|
-
* @param {string} giftcardCode
|
|
12263
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
12264
|
-
* @returns {object} response from the exchange
|
|
12265
|
-
*/
|
|
12266
12270
|
const request = {
|
|
12267
12271
|
'code': giftcardCode,
|
|
12268
12272
|
};
|
|
@@ -12280,16 +12284,16 @@ class binance extends binance$1 {
|
|
|
12280
12284
|
//
|
|
12281
12285
|
return response;
|
|
12282
12286
|
}
|
|
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
|
+
*/
|
|
12283
12296
|
async verifyGiftCode(id, params = {}) {
|
|
12284
|
-
/**
|
|
12285
|
-
* @method
|
|
12286
|
-
* @name binance#verifyGiftCode
|
|
12287
|
-
* @description verify gift code
|
|
12288
|
-
* @see https://developers.binance.com/docs/gift_card/market-data/Verify-Binance-Gift-Card-by-Gift-Card-Number
|
|
12289
|
-
* @param {string} id reference number id
|
|
12290
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
12291
|
-
* @returns {object} response from the exchange
|
|
12292
|
-
*/
|
|
12293
12297
|
const request = {
|
|
12294
12298
|
'referenceNo': id,
|
|
12295
12299
|
};
|
|
@@ -12304,21 +12308,21 @@ class binance extends binance$1 {
|
|
|
12304
12308
|
//
|
|
12305
12309
|
return response;
|
|
12306
12310
|
}
|
|
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
|
+
*/
|
|
12307
12325
|
async fetchBorrowInterest(code = undefined, symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
12308
|
-
/**
|
|
12309
|
-
* @method
|
|
12310
|
-
* @name binance#fetchBorrowInterest
|
|
12311
|
-
* @description fetch the interest owed by the user for borrowing currency for margin trading
|
|
12312
|
-
* @see https://developers.binance.com/docs/margin_trading/borrow-and-repay/Get-Interest-History
|
|
12313
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/account/Get-Margin-BorrowLoan-Interest-History
|
|
12314
|
-
* @param {string} [code] unified currency code
|
|
12315
|
-
* @param {string} [symbol] unified market symbol when fetch interest in isolated markets
|
|
12316
|
-
* @param {int} [since] the earliest time in ms to fetch borrrow interest for
|
|
12317
|
-
* @param {int} [limit] the maximum number of structures to retrieve
|
|
12318
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
12319
|
-
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch the borrow interest in a portfolio margin account
|
|
12320
|
-
* @returns {object[]} a list of [borrow interest structures]{@link https://docs.ccxt.com/#/?id=borrow-interest-structure}
|
|
12321
|
-
*/
|
|
12322
12326
|
await this.loadMarkets();
|
|
12323
12327
|
let isPortfolioMargin = undefined;
|
|
12324
12328
|
[isPortfolioMargin, params] = this.handleOptionAndParams2(params, 'fetchBorrowInterest', 'papi', 'portfolioMargin', false);
|
|
@@ -12402,22 +12406,22 @@ class binance extends binance$1 {
|
|
|
12402
12406
|
'datetime': this.iso8601(timestamp),
|
|
12403
12407
|
};
|
|
12404
12408
|
}
|
|
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
|
+
*/
|
|
12405
12424
|
async repayCrossMargin(code, amount, params = {}) {
|
|
12406
|
-
/**
|
|
12407
|
-
* @method
|
|
12408
|
-
* @name binance#repayCrossMargin
|
|
12409
|
-
* @description repay borrowed margin and interest
|
|
12410
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-Repay
|
|
12411
|
-
* @see https://developers.binance.com/docs/margin_trading/borrow-and-repay/Margin-Account-Borrow-Repay
|
|
12412
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-Repay-Debt
|
|
12413
|
-
* @param {string} code unified currency code of the currency to repay
|
|
12414
|
-
* @param {float} amount the amount to repay
|
|
12415
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
12416
|
-
* @param {boolean} [params.portfolioMargin] set to true if you would like to repay margin in a portfolio margin account
|
|
12417
|
-
* @param {string} [params.repayCrossMarginMethod] *portfolio margin only* 'papiPostRepayLoan' (default), 'papiPostMarginRepayDebt' (alternative)
|
|
12418
|
-
* @param {string} [params.specifyRepayAssets] *portfolio margin papiPostMarginRepayDebt only* specific asset list to repay debt
|
|
12419
|
-
* @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
|
|
12420
|
-
*/
|
|
12421
12425
|
await this.loadMarkets();
|
|
12422
12426
|
const currency = this.currency(code);
|
|
12423
12427
|
const request = {
|
|
@@ -12465,18 +12469,18 @@ class binance extends binance$1 {
|
|
|
12465
12469
|
}
|
|
12466
12470
|
return this.parseMarginLoan(response, currency);
|
|
12467
12471
|
}
|
|
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
|
+
*/
|
|
12468
12483
|
async repayIsolatedMargin(symbol, code, amount, params = {}) {
|
|
12469
|
-
/**
|
|
12470
|
-
* @method
|
|
12471
|
-
* @name binance#repayIsolatedMargin
|
|
12472
|
-
* @description repay borrowed margin and interest
|
|
12473
|
-
* @see https://developers.binance.com/docs/margin_trading/borrow-and-repay/Margin-Account-Borrow-Repay
|
|
12474
|
-
* @param {string} symbol unified market symbol, required for isolated margin
|
|
12475
|
-
* @param {string} code unified currency code of the currency to repay
|
|
12476
|
-
* @param {float} amount the amount to repay
|
|
12477
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
12478
|
-
* @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
|
|
12479
|
-
*/
|
|
12480
12484
|
await this.loadMarkets();
|
|
12481
12485
|
const currency = this.currency(code);
|
|
12482
12486
|
const market = this.market(symbol);
|
|
@@ -12496,19 +12500,19 @@ class binance extends binance$1 {
|
|
|
12496
12500
|
//
|
|
12497
12501
|
return this.parseMarginLoan(response, currency);
|
|
12498
12502
|
}
|
|
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
|
+
*/
|
|
12499
12515
|
async borrowCrossMargin(code, amount, params = {}) {
|
|
12500
|
-
/**
|
|
12501
|
-
* @method
|
|
12502
|
-
* @name binance#borrowCrossMargin
|
|
12503
|
-
* @description create a loan to borrow margin
|
|
12504
|
-
* @see https://developers.binance.com/docs/margin_trading/borrow-and-repay/Margin-Account-Borrow-Repay
|
|
12505
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Margin-Account-Borrow
|
|
12506
|
-
* @param {string} code unified currency code of the currency to borrow
|
|
12507
|
-
* @param {float} amount the amount to borrow
|
|
12508
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
12509
|
-
* @param {boolean} [params.portfolioMargin] set to true if you would like to borrow margin in a portfolio margin account
|
|
12510
|
-
* @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
|
|
12511
|
-
*/
|
|
12512
12516
|
await this.loadMarkets();
|
|
12513
12517
|
const currency = this.currency(code);
|
|
12514
12518
|
const request = {
|
|
@@ -12534,18 +12538,18 @@ class binance extends binance$1 {
|
|
|
12534
12538
|
//
|
|
12535
12539
|
return this.parseMarginLoan(response, currency);
|
|
12536
12540
|
}
|
|
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
|
+
*/
|
|
12537
12552
|
async borrowIsolatedMargin(symbol, code, amount, params = {}) {
|
|
12538
|
-
/**
|
|
12539
|
-
* @method
|
|
12540
|
-
* @name binance#borrowIsolatedMargin
|
|
12541
|
-
* @description create a loan to borrow margin
|
|
12542
|
-
* @see https://developers.binance.com/docs/margin_trading/borrow-and-repay/Margin-Account-Borrow-Repay
|
|
12543
|
-
* @param {string} symbol unified market symbol, required for isolated margin
|
|
12544
|
-
* @param {string} code unified currency code of the currency to borrow
|
|
12545
|
-
* @param {float} amount the amount to borrow
|
|
12546
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
12547
|
-
* @returns {object} a [margin loan structure]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
|
|
12548
|
-
*/
|
|
12549
12553
|
await this.loadMarkets();
|
|
12550
12554
|
const currency = this.currency(code);
|
|
12551
12555
|
const market = this.market(symbol);
|
|
@@ -12594,22 +12598,22 @@ class binance extends binance$1 {
|
|
|
12594
12598
|
'info': info,
|
|
12595
12599
|
};
|
|
12596
12600
|
}
|
|
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
|
+
*/
|
|
12597
12616
|
async fetchOpenInterestHistory(symbol, timeframe = '5m', since = undefined, limit = undefined, params = {}) {
|
|
12598
|
-
/**
|
|
12599
|
-
* @method
|
|
12600
|
-
* @name binance#fetchOpenInterestHistory
|
|
12601
|
-
* @description Retrieves the open interest history of a currency
|
|
12602
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Open-Interest-Statistics
|
|
12603
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Open-Interest-Statistics
|
|
12604
|
-
* @param {string} symbol Unified CCXT market symbol
|
|
12605
|
-
* @param {string} timeframe "5m","15m","30m","1h","2h","4h","6h","12h", or "1d"
|
|
12606
|
-
* @param {int} [since] the time(ms) of the earliest record to retrieve as a unix timestamp
|
|
12607
|
-
* @param {int} [limit] default 30, max 500
|
|
12608
|
-
* @param {object} [params] exchange specific parameters
|
|
12609
|
-
* @param {int} [params.until] the time(ms) of the latest record to retrieve as a unix timestamp
|
|
12610
|
-
* @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)
|
|
12611
|
-
* @returns {object} an array of [open interest structure]{@link https://docs.ccxt.com/#/?id=open-interest-structure}
|
|
12612
|
-
*/
|
|
12613
12617
|
if (timeframe === '1m') {
|
|
12614
12618
|
throw new errors.BadRequest(this.id + 'fetchOpenInterestHistory cannot use the 1m timeframe');
|
|
12615
12619
|
}
|
|
@@ -12667,18 +12671,18 @@ class binance extends binance$1 {
|
|
|
12667
12671
|
//
|
|
12668
12672
|
return this.parseOpenInterests(response, market, since, limit);
|
|
12669
12673
|
}
|
|
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
|
+
*/
|
|
12670
12685
|
async fetchOpenInterest(symbol, params = {}) {
|
|
12671
|
-
/**
|
|
12672
|
-
* @method
|
|
12673
|
-
* @name binance#fetchOpenInterest
|
|
12674
|
-
* @description retrieves the open interest of a contract trading pair
|
|
12675
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Open-Interest
|
|
12676
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Open-Interest
|
|
12677
|
-
* @see https://developers.binance.com/docs/derivatives/option/market-data/Open-Interest
|
|
12678
|
-
* @param {string} symbol unified CCXT market symbol
|
|
12679
|
-
* @param {object} [params] exchange specific parameters
|
|
12680
|
-
* @returns {object} an open interest structure{@link https://docs.ccxt.com/#/?id=open-interest-structure}
|
|
12681
|
-
*/
|
|
12682
12686
|
await this.loadMarkets();
|
|
12683
12687
|
const market = this.market(symbol);
|
|
12684
12688
|
const request = {};
|
|
@@ -12765,27 +12769,27 @@ class binance extends binance$1 {
|
|
|
12765
12769
|
'info': interest,
|
|
12766
12770
|
}, market);
|
|
12767
12771
|
}
|
|
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
|
+
*/
|
|
12768
12792
|
async fetchMyLiquidations(symbol = undefined, since = undefined, limit = undefined, params = {}) {
|
|
12769
|
-
/**
|
|
12770
|
-
* @method
|
|
12771
|
-
* @name binance#fetchMyLiquidations
|
|
12772
|
-
* @description retrieves the users liquidated positions
|
|
12773
|
-
* @see https://developers.binance.com/docs/margin_trading/trade/Get-Force-Liquidation-Record
|
|
12774
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Users-Force-Orders
|
|
12775
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Users-Force-Orders
|
|
12776
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Users-UM-Force-Orders
|
|
12777
|
-
* @see https://developers.binance.com/docs/derivatives/portfolio-margin/trade/Query-Users-CM-Force-Orders
|
|
12778
|
-
* @param {string} [symbol] unified CCXT market symbol
|
|
12779
|
-
* @param {int} [since] the earliest time in ms to fetch liquidations for
|
|
12780
|
-
* @param {int} [limit] the maximum number of liquidation structures to retrieve
|
|
12781
|
-
* @param {object} [params] exchange specific parameters for the binance api endpoint
|
|
12782
|
-
* @param {int} [params.until] timestamp in ms of the latest liquidation
|
|
12783
|
-
* @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)
|
|
12784
|
-
* @param {boolean} [params.portfolioMargin] set to true if you would like to fetch liquidations in a portfolio margin account
|
|
12785
|
-
* @param {string} [params.type] "spot"
|
|
12786
|
-
* @param {string} [params.subType] "linear" or "inverse"
|
|
12787
|
-
* @returns {object} an array of [liquidation structures]{@link https://docs.ccxt.com/#/?id=liquidation-structure}
|
|
12788
|
-
*/
|
|
12789
12793
|
await this.loadMarkets();
|
|
12790
12794
|
let paginate = false;
|
|
12791
12795
|
[paginate, params] = this.handleOptionAndParams(params, 'fetchMyLiquidations', 'paginate');
|
|
@@ -13015,16 +13019,16 @@ class binance extends binance$1 {
|
|
|
13015
13019
|
'datetime': this.iso8601(timestamp),
|
|
13016
13020
|
});
|
|
13017
13021
|
}
|
|
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
|
+
*/
|
|
13018
13031
|
async fetchGreeks(symbol, params = {}) {
|
|
13019
|
-
/**
|
|
13020
|
-
* @method
|
|
13021
|
-
* @name binance#fetchGreeks
|
|
13022
|
-
* @description fetches an option contracts greeks, financial metrics used to measure the factors that affect the price of an options contract
|
|
13023
|
-
* @see https://developers.binance.com/docs/derivatives/option/market-data/Option-Mark-Price
|
|
13024
|
-
* @param {string} symbol unified symbol of the market to fetch greeks for
|
|
13025
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
13026
|
-
* @returns {object} a [greeks structure]{@link https://docs.ccxt.com/#/?id=greeks-structure}
|
|
13027
|
-
*/
|
|
13028
13032
|
await this.loadMarkets();
|
|
13029
13033
|
const market = this.market(symbol);
|
|
13030
13034
|
const request = {
|
|
@@ -13103,18 +13107,18 @@ class binance extends binance$1 {
|
|
|
13103
13107
|
}
|
|
13104
13108
|
return tradingLimits;
|
|
13105
13109
|
}
|
|
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
|
+
*/
|
|
13106
13121
|
async fetchPositionMode(symbol = undefined, params = {}) {
|
|
13107
|
-
/**
|
|
13108
|
-
* @method
|
|
13109
|
-
* @name binance#fetchPositionMode
|
|
13110
|
-
* @description fetchs the position mode, hedged or one way, hedged for binance is set identically for all linear markets or all inverse markets
|
|
13111
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Get-Current-Position-Mode
|
|
13112
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Get-Current-Position-Mode
|
|
13113
|
-
* @param {string} symbol unified symbol of the market to fetch the order book for
|
|
13114
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
13115
|
-
* @param {string} [params.subType] "linear" or "inverse"
|
|
13116
|
-
* @returns {object} an object detailing whether the market is in hedged or one-way mode
|
|
13117
|
-
*/
|
|
13118
13122
|
let market = undefined;
|
|
13119
13123
|
if (symbol !== undefined) {
|
|
13120
13124
|
market = this.market(symbol);
|
|
@@ -13142,19 +13146,19 @@ class binance extends binance$1 {
|
|
|
13142
13146
|
'hedged': dualSidePosition,
|
|
13143
13147
|
};
|
|
13144
13148
|
}
|
|
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[]} symbols unified market symbols
|
|
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
|
+
*/
|
|
13145
13161
|
async fetchMarginModes(symbols = undefined, params = {}) {
|
|
13146
|
-
/**
|
|
13147
|
-
* @method
|
|
13148
|
-
* @name binance#fetchMarginModes
|
|
13149
|
-
* @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
|
|
13150
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Account-Information
|
|
13151
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Account-Information-V2
|
|
13152
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Symbol-Config
|
|
13153
|
-
* @param {string} symbol unified symbol of the market the order was made in
|
|
13154
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
13155
|
-
* @param {string} [params.subType] "linear" or "inverse"
|
|
13156
|
-
* @returns {object} a list of [margin mode structures]{@link https://docs.ccxt.com/#/?id=margin-mode-structure}
|
|
13157
|
-
*/
|
|
13158
13162
|
await this.loadMarkets();
|
|
13159
13163
|
let market = undefined;
|
|
13160
13164
|
if (symbols !== undefined) {
|
|
@@ -13238,6 +13242,49 @@ class binance extends binance$1 {
|
|
|
13238
13242
|
}
|
|
13239
13243
|
return this.parseMarginModes(assets, symbols, 'symbol', 'swap');
|
|
13240
13244
|
}
|
|
13245
|
+
/**
|
|
13246
|
+
* @method
|
|
13247
|
+
* @name binance#fetchMarginMode
|
|
13248
|
+
* @description fetches the margin mode of a specific symbol
|
|
13249
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/account/rest-api/Symbol-Config
|
|
13250
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/account/Account-Information
|
|
13251
|
+
* @param {string} symbol unified symbol of the market the order was made in
|
|
13252
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
13253
|
+
* @param {string} [params.subType] "linear" or "inverse"
|
|
13254
|
+
* @returns {object} a [margin mode structure]{@link https://docs.ccxt.com/#/?id=margin-mode-structure}
|
|
13255
|
+
*/
|
|
13256
|
+
async fetchMarginMode(symbol, params = {}) {
|
|
13257
|
+
await this.loadMarkets();
|
|
13258
|
+
const market = this.market(symbol);
|
|
13259
|
+
let subType = undefined;
|
|
13260
|
+
[subType, params] = this.handleSubTypeAndParams('fetchMarginMode', market, params);
|
|
13261
|
+
let response = undefined;
|
|
13262
|
+
if (subType === 'linear') {
|
|
13263
|
+
const request = {
|
|
13264
|
+
'symbol': market['id'],
|
|
13265
|
+
};
|
|
13266
|
+
response = await this.fapiPrivateGetSymbolConfig(this.extend(request, params));
|
|
13267
|
+
//
|
|
13268
|
+
// [
|
|
13269
|
+
// {
|
|
13270
|
+
// "symbol": "BTCUSDT",
|
|
13271
|
+
// "marginType": "CROSSED",
|
|
13272
|
+
// "isAutoAddMargin": "false",
|
|
13273
|
+
// "leverage": 21,
|
|
13274
|
+
// "maxNotionalValue": "1000000",
|
|
13275
|
+
// }
|
|
13276
|
+
// ]
|
|
13277
|
+
//
|
|
13278
|
+
}
|
|
13279
|
+
else if (subType === 'inverse') {
|
|
13280
|
+
const fetchMarginModesResponse = await this.fetchMarginModes([symbol], params);
|
|
13281
|
+
return fetchMarginModesResponse[symbol];
|
|
13282
|
+
}
|
|
13283
|
+
else {
|
|
13284
|
+
throw new errors.BadRequest(this.id + ' fetchMarginMode () supports linear and inverse subTypes only');
|
|
13285
|
+
}
|
|
13286
|
+
return this.parseMarginMode(response[0], market);
|
|
13287
|
+
}
|
|
13241
13288
|
parseMarginMode(marginMode, market = undefined) {
|
|
13242
13289
|
const marketId = this.safeString(marginMode, 'symbol');
|
|
13243
13290
|
market = this.safeMarket(marketId, market);
|
|
@@ -13256,16 +13303,16 @@ class binance extends binance$1 {
|
|
|
13256
13303
|
'marginMode': reMarginMode,
|
|
13257
13304
|
};
|
|
13258
13305
|
}
|
|
13306
|
+
/**
|
|
13307
|
+
* @method
|
|
13308
|
+
* @name binance#fetchOption
|
|
13309
|
+
* @description fetches option data that is commonly found in an option chain
|
|
13310
|
+
* @see https://developers.binance.com/docs/derivatives/option/market-data/24hr-Ticker-Price-Change-Statistics
|
|
13311
|
+
* @param {string} symbol unified market symbol
|
|
13312
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
13313
|
+
* @returns {object} an [option chain structure]{@link https://docs.ccxt.com/#/?id=option-chain-structure}
|
|
13314
|
+
*/
|
|
13259
13315
|
async fetchOption(symbol, params = {}) {
|
|
13260
|
-
/**
|
|
13261
|
-
* @method
|
|
13262
|
-
* @name binance#fetchOption
|
|
13263
|
-
* @description fetches option data that is commonly found in an option chain
|
|
13264
|
-
* @see https://developers.binance.com/docs/derivatives/option/market-data/24hr-Ticker-Price-Change-Statistics
|
|
13265
|
-
* @param {string} symbol unified market symbol
|
|
13266
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
13267
|
-
* @returns {object} an [option chain structure]{@link https://docs.ccxt.com/#/?id=option-chain-structure}
|
|
13268
|
-
*/
|
|
13269
13316
|
await this.loadMarkets();
|
|
13270
13317
|
const market = this.market(symbol);
|
|
13271
13318
|
const request = {
|
|
@@ -13344,20 +13391,21 @@ class binance extends binance$1 {
|
|
|
13344
13391
|
'quoteVolume': undefined,
|
|
13345
13392
|
};
|
|
13346
13393
|
}
|
|
13394
|
+
/**
|
|
13395
|
+
* @method
|
|
13396
|
+
* @name binance#fetchMarginAdjustmentHistory
|
|
13397
|
+
* @description fetches the history of margin added or reduced from contract isolated positions
|
|
13398
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Get-Position-Margin-Change-History
|
|
13399
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Get-Position-Margin-Change-History
|
|
13400
|
+
* @param {string} symbol unified market symbol
|
|
13401
|
+
* @param {string} [type] "add" or "reduce"
|
|
13402
|
+
* @param {int} [since] timestamp in ms of the earliest change to fetch
|
|
13403
|
+
* @param {int} [limit] the maximum amount of changes to fetch
|
|
13404
|
+
* @param {object} params extra parameters specific to the exchange api endpoint
|
|
13405
|
+
* @param {int} [params.until] timestamp in ms of the latest change to fetch
|
|
13406
|
+
* @returns {object[]} a list of [margin structures]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
|
|
13407
|
+
*/
|
|
13347
13408
|
async fetchMarginAdjustmentHistory(symbol = undefined, type = undefined, since = undefined, limit = undefined, params = {}) {
|
|
13348
|
-
/**
|
|
13349
|
-
* @method
|
|
13350
|
-
* @description fetches the history of margin added or reduced from contract isolated positions
|
|
13351
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/trade/rest-api/Get-Position-Margin-Change-History
|
|
13352
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/trade/Get-Position-Margin-Change-History
|
|
13353
|
-
* @param {string} symbol unified market symbol
|
|
13354
|
-
* @param {string} [type] "add" or "reduce"
|
|
13355
|
-
* @param {int} [since] timestamp in ms of the earliest change to fetch
|
|
13356
|
-
* @param {int} [limit] the maximum amount of changes to fetch
|
|
13357
|
-
* @param {object} params extra parameters specific to the exchange api endpoint
|
|
13358
|
-
* @param {int} [params.until] timestamp in ms of the latest change to fetch
|
|
13359
|
-
* @returns {object[]} a list of [margin structures]{@link https://docs.ccxt.com/#/?id=margin-loan-structure}
|
|
13360
|
-
*/
|
|
13361
13409
|
await this.loadMarkets();
|
|
13362
13410
|
if (symbol === undefined) {
|
|
13363
13411
|
throw new errors.ArgumentsRequired(this.id + ' fetchMarginAdjustmentHistory () requires a symbol argument');
|
|
@@ -13408,15 +13456,15 @@ class binance extends binance$1 {
|
|
|
13408
13456
|
const modifications = this.parseMarginModifications(response);
|
|
13409
13457
|
return this.filterBySymbolSinceLimit(modifications, symbol, since, limit);
|
|
13410
13458
|
}
|
|
13459
|
+
/**
|
|
13460
|
+
* @method
|
|
13461
|
+
* @name binance#fetchConvertCurrencies
|
|
13462
|
+
* @description fetches all available currencies that can be converted
|
|
13463
|
+
* @see https://developers.binance.com/docs/convert/market-data/Query-order-quantity-precision-per-asset
|
|
13464
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
13465
|
+
* @returns {object} an associative dictionary of currencies
|
|
13466
|
+
*/
|
|
13411
13467
|
async fetchConvertCurrencies(params = {}) {
|
|
13412
|
-
/**
|
|
13413
|
-
* @method
|
|
13414
|
-
* @name binance#fetchConvertCurrencies
|
|
13415
|
-
* @description fetches all available currencies that can be converted
|
|
13416
|
-
* @see https://developers.binance.com/docs/convert/market-data/Query-order-quantity-precision-per-asset
|
|
13417
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
13418
|
-
* @returns {object} an associative dictionary of currencies
|
|
13419
|
-
*/
|
|
13420
13468
|
await this.loadMarkets();
|
|
13421
13469
|
const response = await this.sapiGetConvertAssetInfo(params);
|
|
13422
13470
|
//
|
|
@@ -13463,19 +13511,19 @@ class binance extends binance$1 {
|
|
|
13463
13511
|
}
|
|
13464
13512
|
return result;
|
|
13465
13513
|
}
|
|
13514
|
+
/**
|
|
13515
|
+
* @method
|
|
13516
|
+
* @name binance#fetchConvertQuote
|
|
13517
|
+
* @description fetch a quote for converting from one currency to another
|
|
13518
|
+
* @see https://developers.binance.com/docs/convert/trade/Send-quote-request
|
|
13519
|
+
* @param {string} fromCode the currency that you want to sell and convert from
|
|
13520
|
+
* @param {string} toCode the currency that you want to buy and convert into
|
|
13521
|
+
* @param {float} amount how much you want to trade in units of the from currency
|
|
13522
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
13523
|
+
* @param {string} [params.walletType] either 'SPOT' or 'FUNDING', the default is 'SPOT'
|
|
13524
|
+
* @returns {object} a [conversion structure]{@link https://docs.ccxt.com/#/?id=conversion-structure}
|
|
13525
|
+
*/
|
|
13466
13526
|
async fetchConvertQuote(fromCode, toCode, amount = undefined, params = {}) {
|
|
13467
|
-
/**
|
|
13468
|
-
* @method
|
|
13469
|
-
* @name binance#fetchConvertQuote
|
|
13470
|
-
* @description fetch a quote for converting from one currency to another
|
|
13471
|
-
* @see https://developers.binance.com/docs/convert/trade/Send-quote-request
|
|
13472
|
-
* @param {string} fromCode the currency that you want to sell and convert from
|
|
13473
|
-
* @param {string} toCode the currency that you want to buy and convert into
|
|
13474
|
-
* @param {float} amount how much you want to trade in units of the from currency
|
|
13475
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
13476
|
-
* @param {string} [params.walletType] either 'SPOT' or 'FUNDING', the default is 'SPOT'
|
|
13477
|
-
* @returns {object} a [conversion structure]{@link https://docs.ccxt.com/#/?id=conversion-structure}
|
|
13478
|
-
*/
|
|
13479
13527
|
if (amount === undefined) {
|
|
13480
13528
|
throw new errors.ArgumentsRequired(this.id + ' fetchConvertQuote() requires an amount argument');
|
|
13481
13529
|
}
|
|
@@ -13500,19 +13548,19 @@ class binance extends binance$1 {
|
|
|
13500
13548
|
const toCurrency = this.currency(toCode);
|
|
13501
13549
|
return this.parseConversion(response, fromCurrency, toCurrency);
|
|
13502
13550
|
}
|
|
13551
|
+
/**
|
|
13552
|
+
* @method
|
|
13553
|
+
* @name binance#createConvertTrade
|
|
13554
|
+
* @description convert from one currency to another
|
|
13555
|
+
* @see https://developers.binance.com/docs/convert/trade/Accept-Quote
|
|
13556
|
+
* @param {string} id the id of the trade that you want to make
|
|
13557
|
+
* @param {string} fromCode the currency that you want to sell and convert from
|
|
13558
|
+
* @param {string} toCode the currency that you want to buy and convert into
|
|
13559
|
+
* @param {float} [amount] how much you want to trade in units of the from currency
|
|
13560
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
13561
|
+
* @returns {object} a [conversion structure]{@link https://docs.ccxt.com/#/?id=conversion-structure}
|
|
13562
|
+
*/
|
|
13503
13563
|
async createConvertTrade(id, fromCode, toCode, amount = undefined, params = {}) {
|
|
13504
|
-
/**
|
|
13505
|
-
* @method
|
|
13506
|
-
* @name binance#createConvertTrade
|
|
13507
|
-
* @description convert from one currency to another
|
|
13508
|
-
* @see https://developers.binance.com/docs/convert/trade/Accept-Quote
|
|
13509
|
-
* @param {string} id the id of the trade that you want to make
|
|
13510
|
-
* @param {string} fromCode the currency that you want to sell and convert from
|
|
13511
|
-
* @param {string} toCode the currency that you want to buy and convert into
|
|
13512
|
-
* @param {float} [amount] how much you want to trade in units of the from currency
|
|
13513
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
13514
|
-
* @returns {object} a [conversion structure]{@link https://docs.ccxt.com/#/?id=conversion-structure}
|
|
13515
|
-
*/
|
|
13516
13564
|
await this.loadMarkets();
|
|
13517
13565
|
const request = {};
|
|
13518
13566
|
let response = undefined;
|
|
@@ -13547,17 +13595,17 @@ class binance extends binance$1 {
|
|
|
13547
13595
|
const toCurrency = this.currency(toCode);
|
|
13548
13596
|
return this.parseConversion(response, fromCurrency, toCurrency);
|
|
13549
13597
|
}
|
|
13598
|
+
/**
|
|
13599
|
+
* @method
|
|
13600
|
+
* @name binance#fetchConvertTrade
|
|
13601
|
+
* @description fetch the data for a conversion trade
|
|
13602
|
+
* @see https://developers.binance.com/docs/convert/trade/Order-Status
|
|
13603
|
+
* @param {string} id the id of the trade that you want to fetch
|
|
13604
|
+
* @param {string} [code] the unified currency code of the conversion trade
|
|
13605
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
13606
|
+
* @returns {object} a [conversion structure]{@link https://docs.ccxt.com/#/?id=conversion-structure}
|
|
13607
|
+
*/
|
|
13550
13608
|
async fetchConvertTrade(id, code = undefined, params = {}) {
|
|
13551
|
-
/**
|
|
13552
|
-
* @method
|
|
13553
|
-
* @name binance#fetchConvertTrade
|
|
13554
|
-
* @description fetch the data for a conversion trade
|
|
13555
|
-
* @see https://developers.binance.com/docs/convert/trade/Order-Status
|
|
13556
|
-
* @param {string} id the id of the trade that you want to fetch
|
|
13557
|
-
* @param {string} [code] the unified currency code of the conversion trade
|
|
13558
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
13559
|
-
* @returns {object} a [conversion structure]{@link https://docs.ccxt.com/#/?id=conversion-structure}
|
|
13560
|
-
*/
|
|
13561
13609
|
await this.loadMarkets();
|
|
13562
13610
|
const request = {};
|
|
13563
13611
|
let response = undefined;
|
|
@@ -13625,19 +13673,19 @@ class binance extends binance$1 {
|
|
|
13625
13673
|
}
|
|
13626
13674
|
return this.parseConversion(data, fromCurrency, toCurrency);
|
|
13627
13675
|
}
|
|
13676
|
+
/**
|
|
13677
|
+
* @method
|
|
13678
|
+
* @name binance#fetchConvertTradeHistory
|
|
13679
|
+
* @description fetch the users history of conversion trades
|
|
13680
|
+
* @see https://developers.binance.com/docs/convert/trade/Get-Convert-Trade-History
|
|
13681
|
+
* @param {string} [code] the unified currency code
|
|
13682
|
+
* @param {int} [since] the earliest time in ms to fetch conversions for
|
|
13683
|
+
* @param {int} [limit] the maximum number of conversion structures to retrieve
|
|
13684
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
13685
|
+
* @param {int} [params.until] timestamp in ms of the latest conversion to fetch
|
|
13686
|
+
* @returns {object[]} a list of [conversion structures]{@link https://docs.ccxt.com/#/?id=conversion-structure}
|
|
13687
|
+
*/
|
|
13628
13688
|
async fetchConvertTradeHistory(code = undefined, since = undefined, limit = undefined, params = {}) {
|
|
13629
|
-
/**
|
|
13630
|
-
* @method
|
|
13631
|
-
* @name binance#fetchConvertTradeHistory
|
|
13632
|
-
* @description fetch the users history of conversion trades
|
|
13633
|
-
* @see https://developers.binance.com/docs/convert/trade/Get-Convert-Trade-History
|
|
13634
|
-
* @param {string} [code] the unified currency code
|
|
13635
|
-
* @param {int} [since] the earliest time in ms to fetch conversions for
|
|
13636
|
-
* @param {int} [limit] the maximum number of conversion structures to retrieve
|
|
13637
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
13638
|
-
* @param {int} [params.until] timestamp in ms of the latest conversion to fetch
|
|
13639
|
-
* @returns {object[]} a list of [conversion structures]{@link https://docs.ccxt.com/#/?id=conversion-structure}
|
|
13640
|
-
*/
|
|
13641
13689
|
await this.loadMarkets();
|
|
13642
13690
|
const request = {};
|
|
13643
13691
|
const msInThirtyDays = 2592000000;
|
|
@@ -13815,18 +13863,18 @@ class binance extends binance$1 {
|
|
|
13815
13863
|
'fee': undefined,
|
|
13816
13864
|
};
|
|
13817
13865
|
}
|
|
13866
|
+
/**
|
|
13867
|
+
* @method
|
|
13868
|
+
* @name binance#fetchFundingIntervals
|
|
13869
|
+
* @description fetch the funding rate interval for multiple markets
|
|
13870
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Get-Funding-Info
|
|
13871
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Get-Funding-Info
|
|
13872
|
+
* @param {string[]} [symbols] list of unified market symbols
|
|
13873
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
13874
|
+
* @param {string} [params.subType] "linear" or "inverse"
|
|
13875
|
+
* @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
|
|
13876
|
+
*/
|
|
13818
13877
|
async fetchFundingIntervals(symbols = undefined, params = {}) {
|
|
13819
|
-
/**
|
|
13820
|
-
* @method
|
|
13821
|
-
* @name binance#fetchFundingIntervals
|
|
13822
|
-
* @description fetch the funding rate interval for multiple markets
|
|
13823
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Get-Funding-Info
|
|
13824
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Get-Funding-Info
|
|
13825
|
-
* @param {string[]} [symbols] list of unified market symbols
|
|
13826
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
13827
|
-
* @param {string} [params.subType] "linear" or "inverse"
|
|
13828
|
-
* @returns {object[]} a list of [funding rate structures]{@link https://docs.ccxt.com/#/?id=funding-rate-structure}
|
|
13829
|
-
*/
|
|
13830
13878
|
await this.loadMarkets();
|
|
13831
13879
|
let market = undefined;
|
|
13832
13880
|
if (symbols !== undefined) {
|
|
@@ -13860,21 +13908,21 @@ class binance extends binance$1 {
|
|
|
13860
13908
|
const result = this.parseFundingRates(response, market);
|
|
13861
13909
|
return this.filterByArray(result, 'symbol', symbols);
|
|
13862
13910
|
}
|
|
13911
|
+
/**
|
|
13912
|
+
* @method
|
|
13913
|
+
* @name binance#fetchLongShortRatioHistory
|
|
13914
|
+
* @description fetches the long short ratio history for a unified market symbol
|
|
13915
|
+
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Long-Short-Ratio
|
|
13916
|
+
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Long-Short-Ratio
|
|
13917
|
+
* @param {string} symbol unified symbol of the market to fetch the long short ratio for
|
|
13918
|
+
* @param {string} [timeframe] the period for the ratio, default is 24 hours
|
|
13919
|
+
* @param {int} [since] the earliest time in ms to fetch ratios for
|
|
13920
|
+
* @param {int} [limit] the maximum number of long short ratio structures to retrieve
|
|
13921
|
+
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
13922
|
+
* @param {int} [params.until] timestamp in ms of the latest ratio to fetch
|
|
13923
|
+
* @returns {object[]} an array of [long short ratio structures]{@link https://docs.ccxt.com/#/?id=long-short-ratio-structure}
|
|
13924
|
+
*/
|
|
13863
13925
|
async fetchLongShortRatioHistory(symbol = undefined, timeframe = undefined, since = undefined, limit = undefined, params = {}) {
|
|
13864
|
-
/**
|
|
13865
|
-
* @method
|
|
13866
|
-
* @name binance#fetchLongShortRatioHistory
|
|
13867
|
-
* @description fetches the long short ratio history for a unified market symbol
|
|
13868
|
-
* @see https://developers.binance.com/docs/derivatives/usds-margined-futures/market-data/rest-api/Long-Short-Ratio
|
|
13869
|
-
* @see https://developers.binance.com/docs/derivatives/coin-margined-futures/market-data/Long-Short-Ratio
|
|
13870
|
-
* @param {string} symbol unified symbol of the market to fetch the long short ratio for
|
|
13871
|
-
* @param {string} [timeframe] the period for the ratio, default is 24 hours
|
|
13872
|
-
* @param {int} [since] the earliest time in ms to fetch ratios for
|
|
13873
|
-
* @param {int} [limit] the maximum number of long short ratio structures to retrieve
|
|
13874
|
-
* @param {object} [params] extra parameters specific to the exchange API endpoint
|
|
13875
|
-
* @param {int} [params.until] timestamp in ms of the latest ratio to fetch
|
|
13876
|
-
* @returns {object[]} an array of [long short ratio structures]{@link https://docs.ccxt.com/#/?id=long-short-ratio-structure}
|
|
13877
|
-
*/
|
|
13878
13926
|
await this.loadMarkets();
|
|
13879
13927
|
const market = this.market(symbol);
|
|
13880
13928
|
if (timeframe === undefined) {
|