ccxt-ir 4.3.46.0.1__py2.py3-none-any.whl
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.
- ccxt/__init__.py +358 -0
- ccxt/abantether.py +316 -0
- ccxt/abstract/__init__.py +0 -0
- ccxt/abstract/abantether.py +5 -0
- ccxt/abstract/ace.py +15 -0
- ccxt/abstract/afratether.py +6 -0
- ccxt/abstract/alpaca.py +70 -0
- ccxt/abstract/arzinja.py +5 -0
- ccxt/abstract/arzplus.py +7 -0
- ccxt/abstract/ascendex.py +77 -0
- ccxt/abstract/bequant.py +115 -0
- ccxt/abstract/bigone.py +45 -0
- ccxt/abstract/binance.py +712 -0
- ccxt/abstract/binancecoinm.py +712 -0
- ccxt/abstract/binanceus.py +764 -0
- ccxt/abstract/binanceusdm.py +712 -0
- ccxt/abstract/bingx.py +113 -0
- ccxt/abstract/bit2c.py +27 -0
- ccxt/abstract/bitbank.py +27 -0
- ccxt/abstract/bitbay.py +53 -0
- ccxt/abstract/bitbns.py +40 -0
- ccxt/abstract/bitcoincom.py +115 -0
- ccxt/abstract/bitfinex.py +69 -0
- ccxt/abstract/bitfinex2.py +139 -0
- ccxt/abstract/bitflyer.py +38 -0
- ccxt/abstract/bitget.py +508 -0
- ccxt/abstract/bithumb.py +32 -0
- ccxt/abstract/bitimen.py +7 -0
- ccxt/abstract/bitir.py +7 -0
- ccxt/abstract/bitmart.py +99 -0
- ccxt/abstract/bitmex.py +97 -0
- ccxt/abstract/bitopro.py +29 -0
- ccxt/abstract/bitpanda.py +35 -0
- ccxt/abstract/bitpin.py +7 -0
- ccxt/abstract/bitrue.py +72 -0
- ccxt/abstract/bitso.py +43 -0
- ccxt/abstract/bitstamp.py +258 -0
- ccxt/abstract/bitteam.py +29 -0
- ccxt/abstract/bitvavo.py +27 -0
- ccxt/abstract/bl3p.py +19 -0
- ccxt/abstract/blockchaincom.py +28 -0
- ccxt/abstract/blofin.py +37 -0
- ccxt/abstract/btcalpha.py +18 -0
- ccxt/abstract/btcbox.py +13 -0
- ccxt/abstract/btcmarkets.py +39 -0
- ccxt/abstract/btcturk.py +20 -0
- ccxt/abstract/bybit.py +298 -0
- ccxt/abstract/cex.py +33 -0
- ccxt/abstract/coinbase.py +94 -0
- ccxt/abstract/coinbaseadvanced.py +94 -0
- ccxt/abstract/coinbaseexchange.py +67 -0
- ccxt/abstract/coinbaseinternational.py +39 -0
- ccxt/abstract/coincatch.py +94 -0
- ccxt/abstract/coincheck.py +33 -0
- ccxt/abstract/coinex.py +237 -0
- ccxt/abstract/coinlist.py +54 -0
- ccxt/abstract/coinmate.py +62 -0
- ccxt/abstract/coinmetro.py +34 -0
- ccxt/abstract/coinone.py +67 -0
- ccxt/abstract/coinsph.py +54 -0
- ccxt/abstract/coinspot.py +28 -0
- ccxt/abstract/cryptocom.py +107 -0
- ccxt/abstract/currencycom.py +68 -0
- ccxt/abstract/delta.py +50 -0
- ccxt/abstract/deribit.py +125 -0
- ccxt/abstract/digifinex.py +91 -0
- ccxt/abstract/eterex.py +5 -0
- ccxt/abstract/excoino.py +7 -0
- ccxt/abstract/exir.py +8 -0
- ccxt/abstract/exmo.py +55 -0
- ccxt/abstract/exnovin.py +6 -0
- ccxt/abstract/farhadexchange.py +5 -0
- ccxt/abstract/fmfwio.py +115 -0
- ccxt/abstract/gate.py +265 -0
- ccxt/abstract/gateio.py +265 -0
- ccxt/abstract/gemini.py +58 -0
- ccxt/abstract/hashkey.py +67 -0
- ccxt/abstract/hitbtc.py +115 -0
- ccxt/abstract/hitbtc3.py +115 -0
- ccxt/abstract/hitobit.py +8 -0
- ccxt/abstract/hollaex.py +33 -0
- ccxt/abstract/htx.py +548 -0
- ccxt/abstract/huobi.py +548 -0
- ccxt/abstract/huobijp.py +114 -0
- ccxt/abstract/hyperliquid.py +6 -0
- ccxt/abstract/idex.py +26 -0
- ccxt/abstract/independentreserve.py +37 -0
- ccxt/abstract/indodax.py +26 -0
- ccxt/abstract/jibitex.py +7 -0
- ccxt/abstract/kraken.py +57 -0
- ccxt/abstract/krakenfutures.py +38 -0
- ccxt/abstract/kucoin.py +214 -0
- ccxt/abstract/kucoinfutures.py +233 -0
- ccxt/abstract/kuna.py +182 -0
- ccxt/abstract/latoken.py +56 -0
- ccxt/abstract/lbank.py +61 -0
- ccxt/abstract/luno.py +37 -0
- ccxt/abstract/lykke.py +29 -0
- ccxt/abstract/mercado.py +25 -0
- ccxt/abstract/mexc.py +178 -0
- ccxt/abstract/ndax.py +97 -0
- ccxt/abstract/nobitex.py +7 -0
- ccxt/abstract/novadax.py +29 -0
- ccxt/abstract/oceanex.py +22 -0
- ccxt/abstract/okcoin.py +74 -0
- ccxt/abstract/okexchange.py +8 -0
- ccxt/abstract/okx.py +324 -0
- ccxt/abstract/ompfinex.py +7 -0
- ccxt/abstract/onetrading.py +35 -0
- ccxt/abstract/oxfun.py +34 -0
- ccxt/abstract/p2b.py +22 -0
- ccxt/abstract/paradex.py +40 -0
- ccxt/abstract/paymium.py +28 -0
- ccxt/abstract/phemex.py +115 -0
- ccxt/abstract/poloniex.py +69 -0
- ccxt/abstract/poloniexfutures.py +48 -0
- ccxt/abstract/probit.py +23 -0
- ccxt/abstract/ramzinex.py +7 -0
- ccxt/abstract/sarmayex.py +5 -0
- ccxt/abstract/sarrafex.py +7 -0
- ccxt/abstract/tabdeal.py +7 -0
- ccxt/abstract/tetherland.py +5 -0
- ccxt/abstract/timex.py +62 -0
- ccxt/abstract/tokocrypto.py +37 -0
- ccxt/abstract/tradeogre.py +16 -0
- ccxt/abstract/twox.py +5 -0
- ccxt/abstract/ubitex.py +7 -0
- ccxt/abstract/upbit.py +38 -0
- ccxt/abstract/vertex.py +19 -0
- ccxt/abstract/wallex.py +8 -0
- ccxt/abstract/wavesexchange.py +154 -0
- ccxt/abstract/wazirx.py +30 -0
- ccxt/abstract/whitebit.py +98 -0
- ccxt/abstract/woo.py +83 -0
- ccxt/abstract/woofipro.py +119 -0
- ccxt/abstract/xt.py +152 -0
- ccxt/abstract/yobit.py +16 -0
- ccxt/abstract/zaif.py +38 -0
- ccxt/abstract/zonda.py +53 -0
- ccxt/ace.py +1012 -0
- ccxt/afratether.py +293 -0
- ccxt/alpaca.py +1083 -0
- ccxt/arzinja.py +285 -0
- ccxt/arzplus.py +412 -0
- ccxt/ascendex.py +3330 -0
- ccxt/async_support/__init__.py +337 -0
- ccxt/async_support/abantether.py +316 -0
- ccxt/async_support/ace.py +1012 -0
- ccxt/async_support/afratether.py +293 -0
- ccxt/async_support/alpaca.py +1083 -0
- ccxt/async_support/arzinja.py +285 -0
- ccxt/async_support/arzplus.py +412 -0
- ccxt/async_support/ascendex.py +3330 -0
- ccxt/async_support/base/__init__.py +1 -0
- ccxt/async_support/base/exchange.py +1966 -0
- ccxt/async_support/base/throttler.py +50 -0
- ccxt/async_support/base/ws/__init__.py +38 -0
- ccxt/async_support/base/ws/aiohttp_client.py +125 -0
- ccxt/async_support/base/ws/cache.py +212 -0
- ccxt/async_support/base/ws/client.py +193 -0
- ccxt/async_support/base/ws/fast_client.py +96 -0
- ccxt/async_support/base/ws/functions.py +59 -0
- ccxt/async_support/base/ws/future.py +58 -0
- ccxt/async_support/base/ws/order_book.py +78 -0
- ccxt/async_support/base/ws/order_book_side.py +174 -0
- ccxt/async_support/bequant.py +33 -0
- ccxt/async_support/bigone.py +2113 -0
- ccxt/async_support/binance.py +12234 -0
- ccxt/async_support/binancecoinm.py +45 -0
- ccxt/async_support/binanceus.py +211 -0
- ccxt/async_support/binanceusdm.py +58 -0
- ccxt/async_support/bingx.py +4325 -0
- ccxt/async_support/bit2c.py +866 -0
- ccxt/async_support/bitbank.py +1001 -0
- ccxt/async_support/bitbay.py +17 -0
- ccxt/async_support/bitbns.py +1154 -0
- ccxt/async_support/bitcoincom.py +17 -0
- ccxt/async_support/bitfinex.py +1617 -0
- ccxt/async_support/bitfinex2.py +3552 -0
- ccxt/async_support/bitflyer.py +995 -0
- ccxt/async_support/bitget.py +8273 -0
- ccxt/async_support/bithumb.py +1061 -0
- ccxt/async_support/bitimen.py +401 -0
- ccxt/async_support/bitir.py +490 -0
- ccxt/async_support/bitmart.py +4415 -0
- ccxt/async_support/bitmex.py +2756 -0
- ccxt/async_support/bitopro.py +1630 -0
- ccxt/async_support/bitpanda.py +16 -0
- ccxt/async_support/bitpin.py +454 -0
- ccxt/async_support/bitrue.py +3027 -0
- ccxt/async_support/bitso.py +1670 -0
- ccxt/async_support/bitstamp.py +2203 -0
- ccxt/async_support/bitteam.py +2239 -0
- ccxt/async_support/bitvavo.py +1968 -0
- ccxt/async_support/bl3p.py +485 -0
- ccxt/async_support/blockchaincom.py +1104 -0
- ccxt/async_support/blofin.py +2066 -0
- ccxt/async_support/btcalpha.py +891 -0
- ccxt/async_support/btcbox.py +544 -0
- ccxt/async_support/btcmarkets.py +1221 -0
- ccxt/async_support/btcturk.py +911 -0
- ccxt/async_support/bybit.py +8159 -0
- ccxt/async_support/cex.py +1605 -0
- ccxt/async_support/coinbase.py +4475 -0
- ccxt/async_support/coinbaseadvanced.py +17 -0
- ccxt/async_support/coinbaseexchange.py +1734 -0
- ccxt/async_support/coinbaseinternational.py +1899 -0
- ccxt/async_support/coincatch.py +5069 -0
- ccxt/async_support/coincheck.py +815 -0
- ccxt/async_support/coinex.py +5526 -0
- ccxt/async_support/coinlist.py +2243 -0
- ccxt/async_support/coinmate.py +1067 -0
- ccxt/async_support/coinmetro.py +1797 -0
- ccxt/async_support/coinone.py +1127 -0
- ccxt/async_support/coinsph.py +1850 -0
- ccxt/async_support/coinspot.py +534 -0
- ccxt/async_support/cryptocom.py +2822 -0
- ccxt/async_support/currencycom.py +1950 -0
- ccxt/async_support/delta.py +3376 -0
- ccxt/async_support/deribit.py +3437 -0
- ccxt/async_support/digifinex.py +3960 -0
- ccxt/async_support/eterex.py +286 -0
- ccxt/async_support/excoino.py +399 -0
- ccxt/async_support/exir.py +375 -0
- ccxt/async_support/exmo.py +2462 -0
- ccxt/async_support/exnovin.py +360 -0
- ccxt/async_support/farhadexchange.py +266 -0
- ccxt/async_support/fmfwio.py +34 -0
- ccxt/async_support/gate.py +6976 -0
- ccxt/async_support/gateio.py +16 -0
- ccxt/async_support/gemini.py +1825 -0
- ccxt/async_support/hashkey.py +4150 -0
- ccxt/async_support/hitbtc.py +3423 -0
- ccxt/async_support/hitbtc3.py +16 -0
- ccxt/async_support/hitobit.py +391 -0
- ccxt/async_support/hollaex.py +1813 -0
- ccxt/async_support/htx.py +8506 -0
- ccxt/async_support/huobi.py +16 -0
- ccxt/async_support/huobijp.py +1801 -0
- ccxt/async_support/hyperliquid.py +2431 -0
- ccxt/async_support/idex.py +1766 -0
- ccxt/async_support/independentreserve.py +784 -0
- ccxt/async_support/indodax.py +1247 -0
- ccxt/async_support/jibitex.py +395 -0
- ccxt/async_support/kraken.py +2894 -0
- ccxt/async_support/krakenfutures.py +2601 -0
- ccxt/async_support/kucoin.py +4602 -0
- ccxt/async_support/kucoinfutures.py +2698 -0
- ccxt/async_support/kuna.py +1841 -0
- ccxt/async_support/latoken.py +1664 -0
- ccxt/async_support/lbank.py +2683 -0
- ccxt/async_support/luno.py +1067 -0
- ccxt/async_support/lykke.py +1270 -0
- ccxt/async_support/mercado.py +842 -0
- ccxt/async_support/mexc.py +5369 -0
- ccxt/async_support/ndax.py +2354 -0
- ccxt/async_support/nobitex.py +419 -0
- ccxt/async_support/novadax.py +1484 -0
- ccxt/async_support/oceanex.py +903 -0
- ccxt/async_support/okcoin.py +2936 -0
- ccxt/async_support/okexchange.py +349 -0
- ccxt/async_support/okx.py +7827 -0
- ccxt/async_support/ompfinex.py +472 -0
- ccxt/async_support/onetrading.py +1911 -0
- ccxt/async_support/oxfun.py +2773 -0
- ccxt/async_support/p2b.py +1194 -0
- ccxt/async_support/paradex.py +2015 -0
- ccxt/async_support/paymium.py +564 -0
- ccxt/async_support/phemex.py +4473 -0
- ccxt/async_support/poloniex.py +2232 -0
- ccxt/async_support/poloniexfutures.py +1717 -0
- ccxt/async_support/probit.py +1734 -0
- ccxt/async_support/ramzinex.py +476 -0
- ccxt/async_support/sarmayex.py +357 -0
- ccxt/async_support/sarrafex.py +478 -0
- ccxt/async_support/tabdeal.py +364 -0
- ccxt/async_support/tetherland.py +349 -0
- ccxt/async_support/timex.py +1593 -0
- ccxt/async_support/tokocrypto.py +2405 -0
- ccxt/async_support/tradeogre.py +608 -0
- ccxt/async_support/twox.py +326 -0
- ccxt/async_support/ubitex.py +409 -0
- ccxt/async_support/upbit.py +1833 -0
- ccxt/async_support/vertex.py +2922 -0
- ccxt/async_support/wallex.py +445 -0
- ccxt/async_support/wavesexchange.py +2473 -0
- ccxt/async_support/wazirx.py +1224 -0
- ccxt/async_support/whitebit.py +2469 -0
- ccxt/async_support/woo.py +3114 -0
- ccxt/async_support/woofipro.py +2533 -0
- ccxt/async_support/xt.py +4454 -0
- ccxt/async_support/yobit.py +1283 -0
- ccxt/async_support/zaif.py +725 -0
- ccxt/async_support/zonda.py +1828 -0
- ccxt/base/__init__.py +27 -0
- ccxt/base/decimal_to_precision.py +174 -0
- ccxt/base/errors.py +242 -0
- ccxt/base/exchange.py +5941 -0
- ccxt/base/precise.py +287 -0
- ccxt/base/types.py +502 -0
- ccxt/bequant.py +33 -0
- ccxt/bigone.py +2112 -0
- ccxt/binance.py +12233 -0
- ccxt/binancecoinm.py +45 -0
- ccxt/binanceus.py +211 -0
- ccxt/binanceusdm.py +58 -0
- ccxt/bingx.py +4324 -0
- ccxt/bit2c.py +866 -0
- ccxt/bitbank.py +1001 -0
- ccxt/bitbay.py +17 -0
- ccxt/bitbns.py +1154 -0
- ccxt/bitcoincom.py +17 -0
- ccxt/bitfinex.py +1617 -0
- ccxt/bitfinex2.py +3552 -0
- ccxt/bitflyer.py +995 -0
- ccxt/bitget.py +8272 -0
- ccxt/bithumb.py +1061 -0
- ccxt/bitimen.py +401 -0
- ccxt/bitir.py +490 -0
- ccxt/bitmart.py +4415 -0
- ccxt/bitmex.py +2756 -0
- ccxt/bitopro.py +1630 -0
- ccxt/bitpanda.py +16 -0
- ccxt/bitpin.py +454 -0
- ccxt/bitrue.py +3026 -0
- ccxt/bitso.py +1670 -0
- ccxt/bitstamp.py +2203 -0
- ccxt/bitteam.py +2239 -0
- ccxt/bitvavo.py +1968 -0
- ccxt/bl3p.py +485 -0
- ccxt/blockchaincom.py +1104 -0
- ccxt/blofin.py +2066 -0
- ccxt/btcalpha.py +891 -0
- ccxt/btcbox.py +544 -0
- ccxt/btcmarkets.py +1221 -0
- ccxt/btcturk.py +911 -0
- ccxt/bybit.py +8158 -0
- ccxt/cex.py +1605 -0
- ccxt/coinbase.py +4474 -0
- ccxt/coinbaseadvanced.py +17 -0
- ccxt/coinbaseexchange.py +1734 -0
- ccxt/coinbaseinternational.py +1899 -0
- ccxt/coincatch.py +5069 -0
- ccxt/coincheck.py +815 -0
- ccxt/coinex.py +5525 -0
- ccxt/coinlist.py +2243 -0
- ccxt/coinmate.py +1067 -0
- ccxt/coinmetro.py +1797 -0
- ccxt/coinone.py +1127 -0
- ccxt/coinsph.py +1850 -0
- ccxt/coinspot.py +534 -0
- ccxt/cryptocom.py +2822 -0
- ccxt/currencycom.py +1950 -0
- ccxt/delta.py +3376 -0
- ccxt/deribit.py +3437 -0
- ccxt/digifinex.py +3959 -0
- ccxt/eterex.py +286 -0
- ccxt/excoino.py +399 -0
- ccxt/exir.py +375 -0
- ccxt/exmo.py +2462 -0
- ccxt/exnovin.py +360 -0
- ccxt/farhadexchange.py +266 -0
- ccxt/fmfwio.py +34 -0
- ccxt/gate.py +6975 -0
- ccxt/gateio.py +16 -0
- ccxt/gemini.py +1824 -0
- ccxt/hashkey.py +4150 -0
- ccxt/hitbtc.py +3423 -0
- ccxt/hitbtc3.py +16 -0
- ccxt/hitobit.py +391 -0
- ccxt/hollaex.py +1813 -0
- ccxt/htx.py +8505 -0
- ccxt/huobi.py +16 -0
- ccxt/huobijp.py +1801 -0
- ccxt/hyperliquid.py +2430 -0
- ccxt/idex.py +1766 -0
- ccxt/independentreserve.py +784 -0
- ccxt/indodax.py +1247 -0
- ccxt/jibitex.py +395 -0
- ccxt/kraken.py +2894 -0
- ccxt/krakenfutures.py +2601 -0
- ccxt/kucoin.py +4601 -0
- ccxt/kucoinfutures.py +2698 -0
- ccxt/kuna.py +1841 -0
- ccxt/latoken.py +1664 -0
- ccxt/lbank.py +2682 -0
- ccxt/luno.py +1067 -0
- ccxt/lykke.py +1270 -0
- ccxt/mercado.py +842 -0
- ccxt/mexc.py +5369 -0
- ccxt/ndax.py +2354 -0
- ccxt/nobitex.py +419 -0
- ccxt/novadax.py +1484 -0
- ccxt/oceanex.py +903 -0
- ccxt/okcoin.py +2936 -0
- ccxt/okexchange.py +349 -0
- ccxt/okx.py +7826 -0
- ccxt/ompfinex.py +472 -0
- ccxt/onetrading.py +1911 -0
- ccxt/oxfun.py +2772 -0
- ccxt/p2b.py +1194 -0
- ccxt/paradex.py +2015 -0
- ccxt/paymium.py +564 -0
- ccxt/phemex.py +4473 -0
- ccxt/poloniex.py +2232 -0
- ccxt/poloniexfutures.py +1717 -0
- ccxt/pro/__init__.py +149 -0
- ccxt/pro/alpaca.py +685 -0
- ccxt/pro/ascendex.py +916 -0
- ccxt/pro/bequant.py +38 -0
- ccxt/pro/binance.py +3488 -0
- ccxt/pro/binancecoinm.py +28 -0
- ccxt/pro/binanceus.py +48 -0
- ccxt/pro/binanceusdm.py +31 -0
- ccxt/pro/bingx.py +1264 -0
- ccxt/pro/bitcoincom.py +34 -0
- ccxt/pro/bitfinex.py +621 -0
- ccxt/pro/bitfinex2.py +1083 -0
- ccxt/pro/bitget.py +1692 -0
- ccxt/pro/bithumb.py +368 -0
- ccxt/pro/bitmart.py +1449 -0
- ccxt/pro/bitmex.py +1656 -0
- ccxt/pro/bitopro.py +445 -0
- ccxt/pro/bitpanda.py +15 -0
- ccxt/pro/bitrue.py +447 -0
- ccxt/pro/bitstamp.py +522 -0
- ccxt/pro/bitvavo.py +1270 -0
- ccxt/pro/blockchaincom.py +738 -0
- ccxt/pro/blofin.py +692 -0
- ccxt/pro/bybit.py +2000 -0
- ccxt/pro/cex.py +1440 -0
- ccxt/pro/coinbase.py +678 -0
- ccxt/pro/coinbaseadvanced.py +16 -0
- ccxt/pro/coinbaseexchange.py +895 -0
- ccxt/pro/coinbaseinternational.py +620 -0
- ccxt/pro/coincatch.py +1464 -0
- ccxt/pro/coincheck.py +199 -0
- ccxt/pro/coinex.py +1061 -0
- ccxt/pro/coinone.py +395 -0
- ccxt/pro/cryptocom.py +947 -0
- ccxt/pro/currencycom.py +536 -0
- ccxt/pro/deribit.py +892 -0
- ccxt/pro/exmo.py +629 -0
- ccxt/pro/gate.py +1416 -0
- ccxt/pro/gateio.py +15 -0
- ccxt/pro/gemini.py +865 -0
- ccxt/pro/hashkey.py +802 -0
- ccxt/pro/hitbtc.py +1216 -0
- ccxt/pro/hollaex.py +563 -0
- ccxt/pro/htx.py +2215 -0
- ccxt/pro/huobi.py +15 -0
- ccxt/pro/huobijp.py +570 -0
- ccxt/pro/hyperliquid.py +525 -0
- ccxt/pro/idex.py +672 -0
- ccxt/pro/independentreserve.py +270 -0
- ccxt/pro/kraken.py +1356 -0
- ccxt/pro/krakenfutures.py +1492 -0
- ccxt/pro/kucoin.py +1133 -0
- ccxt/pro/kucoinfutures.py +1081 -0
- ccxt/pro/lbank.py +843 -0
- ccxt/pro/luno.py +303 -0
- ccxt/pro/mexc.py +1122 -0
- ccxt/pro/ndax.py +506 -0
- ccxt/pro/okcoin.py +698 -0
- ccxt/pro/okx.py +1851 -0
- ccxt/pro/onetrading.py +1275 -0
- ccxt/pro/oxfun.py +950 -0
- ccxt/pro/p2b.py +419 -0
- ccxt/pro/paradex.py +352 -0
- ccxt/pro/phemex.py +1441 -0
- ccxt/pro/poloniex.py +1166 -0
- ccxt/pro/poloniexfutures.py +990 -0
- ccxt/pro/probit.py +551 -0
- ccxt/pro/upbit.py +520 -0
- ccxt/pro/vertex.py +943 -0
- ccxt/pro/wazirx.py +749 -0
- ccxt/pro/whitebit.py +864 -0
- ccxt/pro/woo.py +1078 -0
- ccxt/pro/woofipro.py +1183 -0
- ccxt/pro/xt.py +1067 -0
- ccxt/probit.py +1734 -0
- ccxt/ramzinex.py +476 -0
- ccxt/sarmayex.py +357 -0
- ccxt/sarrafex.py +478 -0
- ccxt/static_dependencies/__init__.py +1 -0
- ccxt/static_dependencies/ecdsa/__init__.py +14 -0
- ccxt/static_dependencies/ecdsa/_version.py +520 -0
- ccxt/static_dependencies/ecdsa/curves.py +56 -0
- ccxt/static_dependencies/ecdsa/der.py +221 -0
- ccxt/static_dependencies/ecdsa/ecdsa.py +310 -0
- ccxt/static_dependencies/ecdsa/ellipticcurve.py +197 -0
- ccxt/static_dependencies/ecdsa/keys.py +332 -0
- ccxt/static_dependencies/ecdsa/numbertheory.py +531 -0
- ccxt/static_dependencies/ecdsa/rfc6979.py +100 -0
- ccxt/static_dependencies/ecdsa/util.py +266 -0
- ccxt/static_dependencies/ethereum/__init__.py +7 -0
- ccxt/static_dependencies/ethereum/abi/__init__.py +16 -0
- ccxt/static_dependencies/ethereum/abi/abi.py +19 -0
- ccxt/static_dependencies/ethereum/abi/base.py +152 -0
- ccxt/static_dependencies/ethereum/abi/codec.py +217 -0
- ccxt/static_dependencies/ethereum/abi/constants.py +3 -0
- ccxt/static_dependencies/ethereum/abi/decoding.py +565 -0
- ccxt/static_dependencies/ethereum/abi/encoding.py +720 -0
- ccxt/static_dependencies/ethereum/abi/exceptions.py +139 -0
- ccxt/static_dependencies/ethereum/abi/grammar.py +443 -0
- ccxt/static_dependencies/ethereum/abi/packed.py +13 -0
- ccxt/static_dependencies/ethereum/abi/py.typed +0 -0
- ccxt/static_dependencies/ethereum/abi/registry.py +643 -0
- ccxt/static_dependencies/ethereum/abi/tools/__init__.py +3 -0
- ccxt/static_dependencies/ethereum/abi/tools/_strategies.py +230 -0
- ccxt/static_dependencies/ethereum/abi/utils/__init__.py +0 -0
- ccxt/static_dependencies/ethereum/abi/utils/numeric.py +83 -0
- ccxt/static_dependencies/ethereum/abi/utils/padding.py +27 -0
- ccxt/static_dependencies/ethereum/abi/utils/string.py +19 -0
- ccxt/static_dependencies/ethereum/account/__init__.py +3 -0
- ccxt/static_dependencies/ethereum/account/encode_typed_data/__init__.py +4 -0
- ccxt/static_dependencies/ethereum/account/encode_typed_data/encoding_and_hashing.py +239 -0
- ccxt/static_dependencies/ethereum/account/encode_typed_data/helpers.py +40 -0
- ccxt/static_dependencies/ethereum/account/messages.py +263 -0
- ccxt/static_dependencies/ethereum/account/py.typed +0 -0
- ccxt/static_dependencies/ethereum/hexbytes/__init__.py +5 -0
- ccxt/static_dependencies/ethereum/hexbytes/_utils.py +54 -0
- ccxt/static_dependencies/ethereum/hexbytes/main.py +65 -0
- ccxt/static_dependencies/ethereum/hexbytes/py.typed +0 -0
- ccxt/static_dependencies/ethereum/typing/__init__.py +63 -0
- ccxt/static_dependencies/ethereum/typing/abi.py +6 -0
- ccxt/static_dependencies/ethereum/typing/bls.py +7 -0
- ccxt/static_dependencies/ethereum/typing/discovery.py +5 -0
- ccxt/static_dependencies/ethereum/typing/encoding.py +7 -0
- ccxt/static_dependencies/ethereum/typing/enums.py +17 -0
- ccxt/static_dependencies/ethereum/typing/ethpm.py +9 -0
- ccxt/static_dependencies/ethereum/typing/evm.py +20 -0
- ccxt/static_dependencies/ethereum/typing/networks.py +1122 -0
- ccxt/static_dependencies/ethereum/typing/py.typed +0 -0
- ccxt/static_dependencies/ethereum/utils/__init__.py +115 -0
- ccxt/static_dependencies/ethereum/utils/abi.py +72 -0
- ccxt/static_dependencies/ethereum/utils/address.py +171 -0
- ccxt/static_dependencies/ethereum/utils/applicators.py +151 -0
- ccxt/static_dependencies/ethereum/utils/conversions.py +190 -0
- ccxt/static_dependencies/ethereum/utils/currency.py +107 -0
- ccxt/static_dependencies/ethereum/utils/curried/__init__.py +269 -0
- ccxt/static_dependencies/ethereum/utils/debug.py +20 -0
- ccxt/static_dependencies/ethereum/utils/decorators.py +132 -0
- ccxt/static_dependencies/ethereum/utils/encoding.py +6 -0
- ccxt/static_dependencies/ethereum/utils/exceptions.py +4 -0
- ccxt/static_dependencies/ethereum/utils/functional.py +75 -0
- ccxt/static_dependencies/ethereum/utils/hexadecimal.py +74 -0
- ccxt/static_dependencies/ethereum/utils/humanize.py +188 -0
- ccxt/static_dependencies/ethereum/utils/logging.py +159 -0
- ccxt/static_dependencies/ethereum/utils/module_loading.py +31 -0
- ccxt/static_dependencies/ethereum/utils/numeric.py +43 -0
- ccxt/static_dependencies/ethereum/utils/py.typed +0 -0
- ccxt/static_dependencies/ethereum/utils/toolz.py +76 -0
- ccxt/static_dependencies/ethereum/utils/types.py +54 -0
- ccxt/static_dependencies/ethereum/utils/typing/__init__.py +18 -0
- ccxt/static_dependencies/ethereum/utils/typing/misc.py +14 -0
- ccxt/static_dependencies/ethereum/utils/units.py +31 -0
- ccxt/static_dependencies/keccak/__init__.py +3 -0
- ccxt/static_dependencies/keccak/keccak.py +197 -0
- ccxt/static_dependencies/lark/__init__.py +38 -0
- ccxt/static_dependencies/lark/__pyinstaller/__init__.py +6 -0
- ccxt/static_dependencies/lark/__pyinstaller/hook-lark.py +14 -0
- ccxt/static_dependencies/lark/ast_utils.py +59 -0
- ccxt/static_dependencies/lark/common.py +86 -0
- ccxt/static_dependencies/lark/exceptions.py +292 -0
- ccxt/static_dependencies/lark/grammar.py +130 -0
- ccxt/static_dependencies/lark/grammars/__init__.py +0 -0
- ccxt/static_dependencies/lark/indenter.py +143 -0
- ccxt/static_dependencies/lark/lark.py +658 -0
- ccxt/static_dependencies/lark/lexer.py +678 -0
- ccxt/static_dependencies/lark/load_grammar.py +1428 -0
- ccxt/static_dependencies/lark/parse_tree_builder.py +391 -0
- ccxt/static_dependencies/lark/parser_frontends.py +257 -0
- ccxt/static_dependencies/lark/parsers/__init__.py +0 -0
- ccxt/static_dependencies/lark/parsers/cyk.py +340 -0
- ccxt/static_dependencies/lark/parsers/earley.py +314 -0
- ccxt/static_dependencies/lark/parsers/earley_common.py +42 -0
- ccxt/static_dependencies/lark/parsers/earley_forest.py +801 -0
- ccxt/static_dependencies/lark/parsers/grammar_analysis.py +203 -0
- ccxt/static_dependencies/lark/parsers/lalr_analysis.py +332 -0
- ccxt/static_dependencies/lark/parsers/lalr_interactive_parser.py +158 -0
- ccxt/static_dependencies/lark/parsers/lalr_parser.py +122 -0
- ccxt/static_dependencies/lark/parsers/lalr_parser_state.py +110 -0
- ccxt/static_dependencies/lark/parsers/xearley.py +165 -0
- ccxt/static_dependencies/lark/reconstruct.py +107 -0
- ccxt/static_dependencies/lark/tools/__init__.py +70 -0
- ccxt/static_dependencies/lark/tools/nearley.py +202 -0
- ccxt/static_dependencies/lark/tools/serialize.py +32 -0
- ccxt/static_dependencies/lark/tools/standalone.py +196 -0
- ccxt/static_dependencies/lark/tree.py +267 -0
- ccxt/static_dependencies/lark/tree_matcher.py +186 -0
- ccxt/static_dependencies/lark/tree_templates.py +180 -0
- ccxt/static_dependencies/lark/utils.py +343 -0
- ccxt/static_dependencies/lark/visitors.py +596 -0
- ccxt/static_dependencies/marshmallow/__init__.py +81 -0
- ccxt/static_dependencies/marshmallow/base.py +65 -0
- ccxt/static_dependencies/marshmallow/class_registry.py +94 -0
- ccxt/static_dependencies/marshmallow/decorators.py +231 -0
- ccxt/static_dependencies/marshmallow/error_store.py +60 -0
- ccxt/static_dependencies/marshmallow/exceptions.py +71 -0
- ccxt/static_dependencies/marshmallow/fields.py +2114 -0
- ccxt/static_dependencies/marshmallow/orderedset.py +89 -0
- ccxt/static_dependencies/marshmallow/schema.py +1228 -0
- ccxt/static_dependencies/marshmallow/types.py +12 -0
- ccxt/static_dependencies/marshmallow/utils.py +378 -0
- ccxt/static_dependencies/marshmallow/validate.py +678 -0
- ccxt/static_dependencies/marshmallow/warnings.py +2 -0
- ccxt/static_dependencies/marshmallow_dataclass/__init__.py +1047 -0
- ccxt/static_dependencies/marshmallow_dataclass/collection_field.py +51 -0
- ccxt/static_dependencies/marshmallow_dataclass/lazy_class_attribute.py +45 -0
- ccxt/static_dependencies/marshmallow_dataclass/mypy.py +71 -0
- ccxt/static_dependencies/marshmallow_dataclass/typing.py +14 -0
- ccxt/static_dependencies/marshmallow_dataclass/union_field.py +82 -0
- ccxt/static_dependencies/marshmallow_oneofschema/__init__.py +1 -0
- ccxt/static_dependencies/marshmallow_oneofschema/one_of_schema.py +193 -0
- ccxt/static_dependencies/msgpack/__init__.py +55 -0
- ccxt/static_dependencies/msgpack/exceptions.py +48 -0
- ccxt/static_dependencies/msgpack/ext.py +168 -0
- ccxt/static_dependencies/msgpack/fallback.py +951 -0
- ccxt/static_dependencies/parsimonious/__init__.py +10 -0
- ccxt/static_dependencies/parsimonious/exceptions.py +105 -0
- ccxt/static_dependencies/parsimonious/expressions.py +479 -0
- ccxt/static_dependencies/parsimonious/grammar.py +487 -0
- ccxt/static_dependencies/parsimonious/nodes.py +325 -0
- ccxt/static_dependencies/parsimonious/utils.py +40 -0
- ccxt/static_dependencies/starknet/__init__.py +0 -0
- ccxt/static_dependencies/starknet/cairo/__init__.py +0 -0
- ccxt/static_dependencies/starknet/cairo/data_types.py +123 -0
- ccxt/static_dependencies/starknet/cairo/deprecated_parse/__init__.py +0 -0
- ccxt/static_dependencies/starknet/cairo/deprecated_parse/cairo_types.py +77 -0
- ccxt/static_dependencies/starknet/cairo/deprecated_parse/parser.py +46 -0
- ccxt/static_dependencies/starknet/cairo/deprecated_parse/parser_transformer.py +138 -0
- ccxt/static_dependencies/starknet/cairo/felt.py +64 -0
- ccxt/static_dependencies/starknet/cairo/type_parser.py +121 -0
- ccxt/static_dependencies/starknet/cairo/v1/__init__.py +0 -0
- ccxt/static_dependencies/starknet/cairo/v1/type_parser.py +59 -0
- ccxt/static_dependencies/starknet/cairo/v2/__init__.py +0 -0
- ccxt/static_dependencies/starknet/cairo/v2/type_parser.py +77 -0
- ccxt/static_dependencies/starknet/ccxt_utils.py +7 -0
- ccxt/static_dependencies/starknet/common.py +15 -0
- ccxt/static_dependencies/starknet/constants.py +39 -0
- ccxt/static_dependencies/starknet/hash/__init__.py +0 -0
- ccxt/static_dependencies/starknet/hash/address.py +79 -0
- ccxt/static_dependencies/starknet/hash/compiled_class_hash_objects.py +111 -0
- ccxt/static_dependencies/starknet/hash/selector.py +16 -0
- ccxt/static_dependencies/starknet/hash/storage.py +12 -0
- ccxt/static_dependencies/starknet/hash/utils.py +78 -0
- ccxt/static_dependencies/starknet/models/__init__.py +0 -0
- ccxt/static_dependencies/starknet/models/typed_data.py +45 -0
- ccxt/static_dependencies/starknet/serialization/__init__.py +24 -0
- ccxt/static_dependencies/starknet/serialization/_calldata_reader.py +40 -0
- ccxt/static_dependencies/starknet/serialization/_context.py +142 -0
- ccxt/static_dependencies/starknet/serialization/data_serializers/__init__.py +10 -0
- ccxt/static_dependencies/starknet/serialization/data_serializers/_common.py +82 -0
- ccxt/static_dependencies/starknet/serialization/data_serializers/array_serializer.py +43 -0
- ccxt/static_dependencies/starknet/serialization/data_serializers/bool_serializer.py +37 -0
- ccxt/static_dependencies/starknet/serialization/data_serializers/byte_array_serializer.py +66 -0
- ccxt/static_dependencies/starknet/serialization/data_serializers/cairo_data_serializer.py +71 -0
- ccxt/static_dependencies/starknet/serialization/data_serializers/enum_serializer.py +71 -0
- ccxt/static_dependencies/starknet/serialization/data_serializers/felt_serializer.py +50 -0
- ccxt/static_dependencies/starknet/serialization/data_serializers/named_tuple_serializer.py +58 -0
- ccxt/static_dependencies/starknet/serialization/data_serializers/option_serializer.py +43 -0
- ccxt/static_dependencies/starknet/serialization/data_serializers/output_serializer.py +40 -0
- ccxt/static_dependencies/starknet/serialization/data_serializers/payload_serializer.py +72 -0
- ccxt/static_dependencies/starknet/serialization/data_serializers/struct_serializer.py +36 -0
- ccxt/static_dependencies/starknet/serialization/data_serializers/tuple_serializer.py +36 -0
- ccxt/static_dependencies/starknet/serialization/data_serializers/uint256_serializer.py +76 -0
- ccxt/static_dependencies/starknet/serialization/data_serializers/uint_serializer.py +100 -0
- ccxt/static_dependencies/starknet/serialization/data_serializers/unit_serializer.py +32 -0
- ccxt/static_dependencies/starknet/serialization/errors.py +10 -0
- ccxt/static_dependencies/starknet/serialization/factory.py +229 -0
- ccxt/static_dependencies/starknet/serialization/function_serialization_adapter.py +110 -0
- ccxt/static_dependencies/starknet/serialization/tuple_dataclass.py +59 -0
- ccxt/static_dependencies/starknet/utils/__init__.py +0 -0
- ccxt/static_dependencies/starknet/utils/constructor_args_translator.py +86 -0
- ccxt/static_dependencies/starknet/utils/iterable.py +13 -0
- ccxt/static_dependencies/starknet/utils/schema.py +13 -0
- ccxt/static_dependencies/starknet/utils/typed_data.py +182 -0
- ccxt/static_dependencies/starkware/__init__.py +0 -0
- ccxt/static_dependencies/starkware/crypto/__init__.py +0 -0
- ccxt/static_dependencies/starkware/crypto/fast_pedersen_hash.py +50 -0
- ccxt/static_dependencies/starkware/crypto/math_utils.py +78 -0
- ccxt/static_dependencies/starkware/crypto/signature.py +2344 -0
- ccxt/static_dependencies/starkware/crypto/utils.py +63 -0
- ccxt/static_dependencies/sympy/__init__.py +0 -0
- ccxt/static_dependencies/sympy/core/__init__.py +0 -0
- ccxt/static_dependencies/sympy/core/intfunc.py +35 -0
- ccxt/static_dependencies/sympy/external/__init__.py +0 -0
- ccxt/static_dependencies/sympy/external/gmpy.py +345 -0
- ccxt/static_dependencies/sympy/external/importtools.py +187 -0
- ccxt/static_dependencies/sympy/external/ntheory.py +637 -0
- ccxt/static_dependencies/sympy/external/pythonmpq.py +341 -0
- ccxt/static_dependencies/toolz/__init__.py +26 -0
- ccxt/static_dependencies/toolz/_signatures.py +784 -0
- ccxt/static_dependencies/toolz/_version.py +520 -0
- ccxt/static_dependencies/toolz/compatibility.py +30 -0
- ccxt/static_dependencies/toolz/curried/__init__.py +101 -0
- ccxt/static_dependencies/toolz/curried/exceptions.py +22 -0
- ccxt/static_dependencies/toolz/curried/operator.py +22 -0
- ccxt/static_dependencies/toolz/dicttoolz.py +339 -0
- ccxt/static_dependencies/toolz/functoolz.py +1049 -0
- ccxt/static_dependencies/toolz/itertoolz.py +1057 -0
- ccxt/static_dependencies/toolz/recipes.py +46 -0
- ccxt/static_dependencies/toolz/utils.py +9 -0
- ccxt/static_dependencies/typing_inspect/__init__.py +0 -0
- ccxt/static_dependencies/typing_inspect/typing_inspect.py +851 -0
- ccxt/tabdeal.py +364 -0
- ccxt/test/__init__.py +3 -0
- ccxt/test/base/__init__.py +29 -0
- ccxt/test/base/test_account.py +26 -0
- ccxt/test/base/test_balance.py +56 -0
- ccxt/test/base/test_borrow_interest.py +35 -0
- ccxt/test/base/test_borrow_rate.py +32 -0
- ccxt/test/base/test_calculate_fee.py +51 -0
- ccxt/test/base/test_crypto.py +127 -0
- ccxt/test/base/test_currency.py +76 -0
- ccxt/test/base/test_datetime.py +109 -0
- ccxt/test/base/test_decimal_to_precision.py +392 -0
- ccxt/test/base/test_deep_extend.py +68 -0
- ccxt/test/base/test_deposit_withdrawal.py +50 -0
- ccxt/test/base/test_exchange_datetime_functions.py +76 -0
- ccxt/test/base/test_funding_rate_history.py +29 -0
- ccxt/test/base/test_last_price.py +31 -0
- ccxt/test/base/test_ledger_entry.py +45 -0
- ccxt/test/base/test_ledger_item.py +48 -0
- ccxt/test/base/test_leverage_tier.py +33 -0
- ccxt/test/base/test_liquidation.py +50 -0
- ccxt/test/base/test_margin_mode.py +24 -0
- ccxt/test/base/test_margin_modification.py +35 -0
- ccxt/test/base/test_market.py +193 -0
- ccxt/test/base/test_number.py +411 -0
- ccxt/test/base/test_ohlcv.py +33 -0
- ccxt/test/base/test_open_interest.py +32 -0
- ccxt/test/base/test_order.py +64 -0
- ccxt/test/base/test_order_book.py +69 -0
- ccxt/test/base/test_position.py +60 -0
- ccxt/test/base/test_shared_methods.py +353 -0
- ccxt/test/base/test_status.py +24 -0
- ccxt/test/base/test_throttle.py +126 -0
- ccxt/test/base/test_ticker.py +92 -0
- ccxt/test/base/test_trade.py +47 -0
- ccxt/test/base/test_trading_fee.py +26 -0
- ccxt/test/base/test_transaction.py +39 -0
- ccxt/test/test_async.py +1649 -0
- ccxt/test/test_sync.py +1648 -0
- ccxt/test/tests_async.py +1558 -0
- ccxt/test/tests_helpers.py +287 -0
- ccxt/test/tests_init.py +39 -0
- ccxt/test/tests_sync.py +1555 -0
- ccxt/tetherland.py +349 -0
- ccxt/timex.py +1593 -0
- ccxt/tokocrypto.py +2405 -0
- ccxt/tradeogre.py +608 -0
- ccxt/twox.py +326 -0
- ccxt/ubitex.py +409 -0
- ccxt/upbit.py +1833 -0
- ccxt/vertex.py +2922 -0
- ccxt/wallex.py +445 -0
- ccxt/wavesexchange.py +2472 -0
- ccxt/wazirx.py +1224 -0
- ccxt/whitebit.py +2469 -0
- ccxt/woo.py +3114 -0
- ccxt/woofipro.py +2533 -0
- ccxt/xt.py +4453 -0
- ccxt/yobit.py +1283 -0
- ccxt/zaif.py +725 -0
- ccxt/zonda.py +1828 -0
- ccxt_ir-4.3.46.0.1.dist-info/LICENSE.txt +21 -0
- ccxt_ir-4.3.46.0.1.dist-info/METADATA +655 -0
- ccxt_ir-4.3.46.0.1.dist-info/RECORD +772 -0
- ccxt_ir-4.3.46.0.1.dist-info/WHEEL +6 -0
- ccxt_ir-4.3.46.0.1.dist-info/top_level.txt +1 -0
ccxt/timex.py
ADDED
|
@@ -0,0 +1,1593 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
|
|
3
|
+
# PLEASE DO NOT EDIT THIS FILE, IT IS GENERATED AND WILL BE OVERWRITTEN:
|
|
4
|
+
# https://github.com/ccxt/ccxt/blob/master/CONTRIBUTING.md#how-to-contribute-code
|
|
5
|
+
|
|
6
|
+
from ccxt.base.exchange import Exchange
|
|
7
|
+
from ccxt.abstract.timex import ImplicitAPI
|
|
8
|
+
from ccxt.base.types import Balances, Currencies, Currency, Int, Market, Num, Order, OrderBook, OrderSide, OrderType, Str, Strings, Ticker, Tickers, Trade, TradingFeeInterface, Transaction
|
|
9
|
+
from typing import List
|
|
10
|
+
from ccxt.base.errors import ExchangeError
|
|
11
|
+
from ccxt.base.errors import AuthenticationError
|
|
12
|
+
from ccxt.base.errors import PermissionDenied
|
|
13
|
+
from ccxt.base.errors import ArgumentsRequired
|
|
14
|
+
from ccxt.base.errors import BadRequest
|
|
15
|
+
from ccxt.base.errors import InsufficientFunds
|
|
16
|
+
from ccxt.base.errors import InvalidOrder
|
|
17
|
+
from ccxt.base.errors import OrderNotFound
|
|
18
|
+
from ccxt.base.errors import NotSupported
|
|
19
|
+
from ccxt.base.errors import RateLimitExceeded
|
|
20
|
+
from ccxt.base.errors import ExchangeNotAvailable
|
|
21
|
+
from ccxt.base.decimal_to_precision import TICK_SIZE
|
|
22
|
+
from ccxt.base.precise import Precise
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class timex(Exchange, ImplicitAPI):
|
|
26
|
+
|
|
27
|
+
def describe(self):
|
|
28
|
+
return self.deep_extend(super(timex, self).describe(), {
|
|
29
|
+
'id': 'timex',
|
|
30
|
+
'name': 'TimeX',
|
|
31
|
+
'countries': ['AU'],
|
|
32
|
+
'version': 'v1',
|
|
33
|
+
'rateLimit': 1500,
|
|
34
|
+
'has': {
|
|
35
|
+
'CORS': None,
|
|
36
|
+
'spot': True,
|
|
37
|
+
'margin': False,
|
|
38
|
+
'swap': False,
|
|
39
|
+
'future': False,
|
|
40
|
+
'option': False,
|
|
41
|
+
'addMargin': False,
|
|
42
|
+
'cancelOrder': True,
|
|
43
|
+
'cancelOrders': True,
|
|
44
|
+
'createOrder': True,
|
|
45
|
+
'createReduceOnlyOrder': False,
|
|
46
|
+
'createStopLimitOrder': False,
|
|
47
|
+
'createStopMarketOrder': False,
|
|
48
|
+
'createStopOrder': False,
|
|
49
|
+
'editOrder': True,
|
|
50
|
+
'fetchBalance': True,
|
|
51
|
+
'fetchBorrowRateHistories': False,
|
|
52
|
+
'fetchBorrowRateHistory': False,
|
|
53
|
+
'fetchClosedOrders': True,
|
|
54
|
+
'fetchCrossBorrowRate': False,
|
|
55
|
+
'fetchCrossBorrowRates': False,
|
|
56
|
+
'fetchCurrencies': True,
|
|
57
|
+
'fetchDeposit': False,
|
|
58
|
+
'fetchDepositAddress': True,
|
|
59
|
+
'fetchDepositAddresses': False,
|
|
60
|
+
'fetchDepositAddressesByNetwork': False,
|
|
61
|
+
'fetchDeposits': True,
|
|
62
|
+
'fetchFundingHistory': False,
|
|
63
|
+
'fetchFundingRate': False,
|
|
64
|
+
'fetchFundingRateHistory': False,
|
|
65
|
+
'fetchFundingRates': False,
|
|
66
|
+
'fetchIndexOHLCV': False,
|
|
67
|
+
'fetchIsolatedBorrowRate': False,
|
|
68
|
+
'fetchIsolatedBorrowRates': False,
|
|
69
|
+
'fetchLeverage': False,
|
|
70
|
+
'fetchLeverageTiers': False,
|
|
71
|
+
'fetchMarginMode': False,
|
|
72
|
+
'fetchMarkets': True,
|
|
73
|
+
'fetchMarkOHLCV': False,
|
|
74
|
+
'fetchMyTrades': True,
|
|
75
|
+
'fetchOHLCV': True,
|
|
76
|
+
'fetchOpenInterestHistory': False,
|
|
77
|
+
'fetchOpenOrders': True,
|
|
78
|
+
'fetchOrder': True,
|
|
79
|
+
'fetchOrderBook': True,
|
|
80
|
+
'fetchPosition': False,
|
|
81
|
+
'fetchPositionHistory': False,
|
|
82
|
+
'fetchPositionMode': False,
|
|
83
|
+
'fetchPositions': False,
|
|
84
|
+
'fetchPositionsForSymbol': False,
|
|
85
|
+
'fetchPositionsHistory': False,
|
|
86
|
+
'fetchPositionsRisk': False,
|
|
87
|
+
'fetchPremiumIndexOHLCV': False,
|
|
88
|
+
'fetchTicker': True,
|
|
89
|
+
'fetchTickers': True,
|
|
90
|
+
'fetchTime': True,
|
|
91
|
+
'fetchTrades': True,
|
|
92
|
+
'fetchTradingFee': True, # maker fee only
|
|
93
|
+
'fetchWithdrawal': False,
|
|
94
|
+
'fetchWithdrawals': True,
|
|
95
|
+
'reduceMargin': False,
|
|
96
|
+
'setLeverage': False,
|
|
97
|
+
'setMarginMode': False,
|
|
98
|
+
'setPositionMode': False,
|
|
99
|
+
},
|
|
100
|
+
'timeframes': {
|
|
101
|
+
'1m': 'I1',
|
|
102
|
+
'5m': 'I5',
|
|
103
|
+
'15m': 'I15',
|
|
104
|
+
'30m': 'I30',
|
|
105
|
+
'1h': 'H1',
|
|
106
|
+
'2h': 'H2',
|
|
107
|
+
'4h': 'H4',
|
|
108
|
+
'6h': 'H6',
|
|
109
|
+
'12h': 'H12',
|
|
110
|
+
'1d': 'D1',
|
|
111
|
+
'1w': 'W1',
|
|
112
|
+
},
|
|
113
|
+
'urls': {
|
|
114
|
+
'logo': 'https://user-images.githubusercontent.com/1294454/70423869-6839ab00-1a7f-11ea-8f94-13ae72c31115.jpg',
|
|
115
|
+
'api': {
|
|
116
|
+
'rest': 'https://plasma-relay-backend.timex.io',
|
|
117
|
+
},
|
|
118
|
+
'www': 'https://timex.io',
|
|
119
|
+
'doc': 'https://plasma-relay-backend.timex.io/swagger-ui/index.html',
|
|
120
|
+
'referral': 'https://timex.io/?refcode=1x27vNkTbP1uwkCck',
|
|
121
|
+
},
|
|
122
|
+
'api': {
|
|
123
|
+
'addressbook': {
|
|
124
|
+
'get': [
|
|
125
|
+
'me',
|
|
126
|
+
],
|
|
127
|
+
'post': [
|
|
128
|
+
'',
|
|
129
|
+
'id/{id}',
|
|
130
|
+
'id/{id}/remove',
|
|
131
|
+
],
|
|
132
|
+
},
|
|
133
|
+
'custody': {
|
|
134
|
+
'get': [
|
|
135
|
+
'credentials', # Get api key for address
|
|
136
|
+
'credentials/h/{hash}', # Get api key by hash
|
|
137
|
+
'credentials/k/{key}', # Get api key by key
|
|
138
|
+
'credentials/me',
|
|
139
|
+
'credentials/me/address', # Get api key by hash
|
|
140
|
+
'deposit-addresses', # Get deposit addresses list
|
|
141
|
+
'deposit-addresses/h/{hash}', # Get deposit address by hash
|
|
142
|
+
],
|
|
143
|
+
},
|
|
144
|
+
'history': {
|
|
145
|
+
'get': [
|
|
146
|
+
'orders', # Gets historical orders
|
|
147
|
+
'orders/details', # Gets order details
|
|
148
|
+
'orders/export/csv', # Export orders to csv
|
|
149
|
+
'trades', # Gets historical trades
|
|
150
|
+
'trades/export/csv', # Export trades to csv
|
|
151
|
+
],
|
|
152
|
+
},
|
|
153
|
+
'currencies': {
|
|
154
|
+
'get': [
|
|
155
|
+
'a/{address}', # Gets currency by address
|
|
156
|
+
'i/{id}', # Gets currency by id
|
|
157
|
+
's/{symbol}', # Gets currency by symbol
|
|
158
|
+
],
|
|
159
|
+
'post': [
|
|
160
|
+
'perform', # Creates new currency
|
|
161
|
+
'prepare', # Prepare creates new currency
|
|
162
|
+
'remove/perform', # Removes currency by symbol
|
|
163
|
+
's/{symbol}/remove/prepare', # Prepare remove currency by symbol
|
|
164
|
+
's/{symbol}/update/perform', # Prepare update currency by symbol
|
|
165
|
+
's/{symbol}/update/prepare', # Prepare update currency by symbol
|
|
166
|
+
],
|
|
167
|
+
},
|
|
168
|
+
'manager': {
|
|
169
|
+
'get': [
|
|
170
|
+
'deposits',
|
|
171
|
+
'transfers',
|
|
172
|
+
'withdrawals',
|
|
173
|
+
],
|
|
174
|
+
},
|
|
175
|
+
'markets': {
|
|
176
|
+
'get': [
|
|
177
|
+
'i/{id}', # Gets market by id
|
|
178
|
+
's/{symbol}', # Gets market by symbol
|
|
179
|
+
],
|
|
180
|
+
'post': [
|
|
181
|
+
'perform', # Creates new market
|
|
182
|
+
'prepare', # Prepare creates new market
|
|
183
|
+
'remove/perform', # Removes market by symbol
|
|
184
|
+
's/{symbol}/remove/prepare', # Prepare remove market by symbol
|
|
185
|
+
's/{symbol}/update/perform', # Prepare update market by symbol
|
|
186
|
+
's/{symbol}/update/prepare', # Prepare update market by symbol
|
|
187
|
+
],
|
|
188
|
+
},
|
|
189
|
+
'public': {
|
|
190
|
+
'get': [
|
|
191
|
+
'candles', # Gets candles
|
|
192
|
+
'currencies', # Gets all the currencies
|
|
193
|
+
'markets', # Gets all the markets
|
|
194
|
+
'orderbook', # Gets orderbook
|
|
195
|
+
'orderbook/raw', # Gets raw orderbook
|
|
196
|
+
'orderbook/v2', # Gets orderbook v2
|
|
197
|
+
'tickers', # Gets all the tickers
|
|
198
|
+
'trades', # Gets trades
|
|
199
|
+
],
|
|
200
|
+
},
|
|
201
|
+
'statistics': {
|
|
202
|
+
'get': [
|
|
203
|
+
'address', # calculateAddressStatistics
|
|
204
|
+
],
|
|
205
|
+
},
|
|
206
|
+
'trading': {
|
|
207
|
+
'get': [
|
|
208
|
+
'balances', # Get trading balances for all(or selected) currencies
|
|
209
|
+
'fees', # Get trading fee rates for all(or selected) markets
|
|
210
|
+
'orders', # Gets open orders
|
|
211
|
+
],
|
|
212
|
+
'post': [
|
|
213
|
+
'orders', # Create new order
|
|
214
|
+
'orders/json', # Create orders
|
|
215
|
+
],
|
|
216
|
+
'put': [
|
|
217
|
+
'orders', # Cancel or update orders
|
|
218
|
+
'orders/json', # Update orders
|
|
219
|
+
],
|
|
220
|
+
'delete': [
|
|
221
|
+
'orders', # Delete orders
|
|
222
|
+
'orders/json', # Delete orders
|
|
223
|
+
],
|
|
224
|
+
},
|
|
225
|
+
'tradingview': {
|
|
226
|
+
'get': [
|
|
227
|
+
'config', # Gets config
|
|
228
|
+
'history', # Gets history
|
|
229
|
+
'symbol_info', # Gets symbol info
|
|
230
|
+
'time', # Gets time
|
|
231
|
+
],
|
|
232
|
+
},
|
|
233
|
+
},
|
|
234
|
+
'precisionMode': TICK_SIZE,
|
|
235
|
+
'exceptions': {
|
|
236
|
+
'exact': {
|
|
237
|
+
'0': ExchangeError,
|
|
238
|
+
'1': NotSupported,
|
|
239
|
+
'4000': BadRequest,
|
|
240
|
+
'4001': BadRequest,
|
|
241
|
+
'4002': InsufficientFunds,
|
|
242
|
+
'4003': AuthenticationError,
|
|
243
|
+
'4004': AuthenticationError,
|
|
244
|
+
'4005': BadRequest,
|
|
245
|
+
'4006': BadRequest,
|
|
246
|
+
'4007': BadRequest,
|
|
247
|
+
'4300': PermissionDenied,
|
|
248
|
+
'4100': AuthenticationError,
|
|
249
|
+
'4400': OrderNotFound,
|
|
250
|
+
'5001': InvalidOrder,
|
|
251
|
+
'5002': ExchangeError,
|
|
252
|
+
'400': BadRequest,
|
|
253
|
+
'401': AuthenticationError,
|
|
254
|
+
'403': PermissionDenied,
|
|
255
|
+
'404': OrderNotFound,
|
|
256
|
+
'429': RateLimitExceeded,
|
|
257
|
+
'500': ExchangeError,
|
|
258
|
+
'503': ExchangeNotAvailable,
|
|
259
|
+
},
|
|
260
|
+
'broad': {
|
|
261
|
+
'Insufficient': InsufficientFunds,
|
|
262
|
+
},
|
|
263
|
+
},
|
|
264
|
+
'options': {
|
|
265
|
+
'expireIn': 31536000, # 365 × 24 × 60 × 60
|
|
266
|
+
'fetchTickers': {
|
|
267
|
+
'period': '1d',
|
|
268
|
+
},
|
|
269
|
+
'fetchTrades': {
|
|
270
|
+
'sort': 'timestamp,asc',
|
|
271
|
+
},
|
|
272
|
+
'fetchMyTrades': {
|
|
273
|
+
'sort': 'timestamp,asc',
|
|
274
|
+
},
|
|
275
|
+
'fetchOpenOrders': {
|
|
276
|
+
'sort': 'createdAt,asc',
|
|
277
|
+
},
|
|
278
|
+
'fetchClosedOrders': {
|
|
279
|
+
'sort': 'createdAt,asc',
|
|
280
|
+
},
|
|
281
|
+
'defaultSort': 'timestamp,asc',
|
|
282
|
+
'defaultSortOrders': 'createdAt,asc',
|
|
283
|
+
},
|
|
284
|
+
})
|
|
285
|
+
|
|
286
|
+
def fetch_time(self, params={}):
|
|
287
|
+
"""
|
|
288
|
+
fetches the current integer timestamp in milliseconds from the exchange server
|
|
289
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
290
|
+
:returns int: the current integer timestamp in milliseconds from the exchange server
|
|
291
|
+
"""
|
|
292
|
+
response = self.tradingviewGetTime(params)
|
|
293
|
+
#
|
|
294
|
+
# 1708682617
|
|
295
|
+
#
|
|
296
|
+
return self.parse_to_int(response) * 1000
|
|
297
|
+
|
|
298
|
+
def fetch_markets(self, params={}) -> List[Market]:
|
|
299
|
+
"""
|
|
300
|
+
retrieves data on all markets for timex
|
|
301
|
+
:see: https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Public/listMarkets
|
|
302
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
303
|
+
:returns dict[]: an array of objects representing market data
|
|
304
|
+
"""
|
|
305
|
+
response = self.publicGetMarkets(params)
|
|
306
|
+
#
|
|
307
|
+
# [
|
|
308
|
+
# {
|
|
309
|
+
# "symbol": "ETHBTC",
|
|
310
|
+
# "name": "ETH/BTC",
|
|
311
|
+
# "baseCurrency": "ETH",
|
|
312
|
+
# "baseTokenAddress": "0x45932db54b38af1f5a57136302eeba66a5975c15",
|
|
313
|
+
# "quoteCurrency": "BTC",
|
|
314
|
+
# "quoteTokenAddress": "0x8370fbc6ddec1e18b4e41e72ed943e238458487c",
|
|
315
|
+
# "feeCurrency": "BTC",
|
|
316
|
+
# "feeTokenAddress": "0x8370fbc6ddec1e18b4e41e72ed943e238458487c",
|
|
317
|
+
# "quantityIncrement": "0.0000001",
|
|
318
|
+
# "takerFee": "0.005",
|
|
319
|
+
# "makerFee": "0.0025",
|
|
320
|
+
# "tickSize": "0.00000001",
|
|
321
|
+
# "baseMinSize": "0.0001",
|
|
322
|
+
# "quoteMinSize": "0.00001",
|
|
323
|
+
# "locked": False
|
|
324
|
+
# }
|
|
325
|
+
# ]
|
|
326
|
+
#
|
|
327
|
+
return self.parse_markets(response)
|
|
328
|
+
|
|
329
|
+
def fetch_currencies(self, params={}) -> Currencies:
|
|
330
|
+
"""
|
|
331
|
+
fetches all available currencies on an exchange
|
|
332
|
+
:see: https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Public/listCurrencies
|
|
333
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
334
|
+
:returns dict: an associative dictionary of currencies
|
|
335
|
+
"""
|
|
336
|
+
response = self.publicGetCurrencies(params)
|
|
337
|
+
#
|
|
338
|
+
# [
|
|
339
|
+
# {
|
|
340
|
+
# "symbol": "BTC",
|
|
341
|
+
# "name": "Bitcoin",
|
|
342
|
+
# "address": "0x8370fbc6ddec1e18b4e41e72ed943e238458487c",
|
|
343
|
+
# "icon": "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNjAiIGhlaWdodD0iNjAiIHZpZXdCb3g9IjAgMCA2MCA2MCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggb3BhY2l0eT0iMC41IiBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTMwIDUzQzQyLjcwMjUgNTMgNTMgNDIuNzAyNSA1MyAzMEM1MyAxNy4yOTc1IDQyLjcwMjUgNyAzMCA3QzE3LjI5NzUgNyA3IDE3LjI5NzUgNyAzMEM3IDQyLjcwMjUgMTcuMjk3NSA1MyAzMCA1M1pNMzAgNTVDNDMuODA3MSA1NSA1NSA0My44MDcxIDU1IDMwQzU1IDE2LjE5MjkgNDMuODA3MSA1IDMwIDVDMTYuMTkyOSA1IDUgMTYuMTkyOSA1IDMwQzUgNDMuODA3MSAxNi4xOTI5IDU1IDMwIDU1WiIvPgo8cGF0aCBkPSJNNDAuOTQyNSAyNi42NTg1QzQxLjQwMDMgMjMuNjExMyAzOS4wNzA1IDIxLjk3MzIgMzUuODg0OCAyMC44ODA0TDM2LjkxODIgMTYuNzUyNkwzNC4zOTUxIDE2LjEyNjRMMzMuMzg5IDIwLjE0NTVDMzIuNzI1OCAxOS45ODA5IDMyLjA0NDUgMTkuODI1NiAzMS4zNjc1IDE5LjY3MTdMMzIuMzgwOCAxNS42MjYyTDI5Ljg1OTEgMTVMMjguODI1IDE5LjEyNjRDMjguMjc2IDE5LjAwMTkgMjcuNzM3IDE4Ljg3ODggMjcuMjEzOSAxOC43NDkzTDI3LjIxNjggMTguNzM2NEwyMy43MzcyIDE3Ljg3MTJMMjMuMDY2IDIwLjU1NDhDMjMuMDY2IDIwLjU1NDggMjQuOTM4IDIwLjk4MjEgMjQuODk4NSAyMS4wMDg1QzI1LjkyMDQgMjEuMjYyNiAyNi4xMDUgMjEuOTM2IDI2LjA3NDEgMjIuNDY5OUwyNC44OTcgMjcuMTcyNEMyNC45Njc1IDI3LjE5MDMgMjUuMDU4NyAyNy4yMTYgMjUuMTU5MyAyNy4yNTYxQzI1LjA3NTMgMjcuMjM1NCAyNC45ODU0IDI3LjIxMjQgMjQuODkyNyAyNy4xOTAzTDIzLjI0MjggMzMuNzc3OEMyMy4xMTc3IDM0LjA4NjkgMjIuODAwOCAzNC41NTA2IDIyLjA4NjUgMzQuMzc0NkMyMi4xMTE3IDM0LjQxMTEgMjAuMjUyNiAzMy45MTg3IDIwLjI1MjYgMzMuOTE4N0wxOSAzNi43OTQ5TDIyLjI4MzQgMzcuNjFDMjIuODk0MiAzNy43NjI0IDIzLjQ5MjggMzcuOTIyIDI0LjA4MjEgMzguMDcyM0wyMy4wMzggNDIuMjQ3NEwyNS41NTgyIDQyLjg3MzZMMjYuNTkyMyAzOC43NDI5QzI3LjI4MDcgMzguOTI5IDI3Ljk0OSAzOS4xMDA3IDI4LjYwMyAzOS4yNjI0TDI3LjU3MjUgNDMuMzczOEwzMC4wOTU2IDQ0TDMxLjEzOTcgMzkuODMyOEMzNS40NDIyIDQwLjY0MzYgMzguNjc3NCA0MC4zMTY2IDQwLjAzOTIgMzYuNDQxNEM0MS4xMzY1IDMzLjMyMTIgMzkuOTg0NiAzMS41MjEzIDM3LjcyMDkgMzAuMzQ3N0MzOS4zNjk0IDI5Ljk2OTEgNDAuNjExMiAyOC44ODkyIDQwLjk0MjUgMjYuNjU4NVYyNi42NTg1Wk0zNS4xNzc3IDM0LjcwODhDMzQuMzk4IDM3LjgyOSAyOS4xMjI2IDM2LjE0MjIgMjcuNDEyMiAzNS43MTkzTDI4Ljc5NzcgMzAuMTg4MUMzMC41MDgxIDMwLjYxMzIgMzUuOTkyNiAzMS40NTQ4IDM1LjE3NzcgMzQuNzA4OFpNMzUuOTU4MSAyNi42MTM0QzM1LjI0NjcgMjkuNDUxNyAzMC44NTU5IDI4LjAwOTcgMjkuNDMxNiAyNy42NTYxTDMwLjY4NzcgMjIuNjM5NUMzMi4xMTIgMjIuOTkzIDM2LjY5OSAyMy42NTI4IDM1Ljk1ODEgMjYuNjEzNFoiLz4KPC9zdmc+Cg==",
|
|
344
|
+
# "background": "transparent",
|
|
345
|
+
# "fiatSymbol": "BTC",
|
|
346
|
+
# "decimals": 8,
|
|
347
|
+
# "tradeDecimals": 20,
|
|
348
|
+
# "displayDecimals": 4,
|
|
349
|
+
# "crypto": True,
|
|
350
|
+
# "depositEnabled": True,
|
|
351
|
+
# "withdrawalEnabled": True,
|
|
352
|
+
# "transferEnabled": True,
|
|
353
|
+
# "buyEnabled": False,
|
|
354
|
+
# "purchaseEnabled": False,
|
|
355
|
+
# "redeemEnabled": False,
|
|
356
|
+
# "active": True,
|
|
357
|
+
# "withdrawalFee": "50000000000000000",
|
|
358
|
+
# "purchaseCommissions": []
|
|
359
|
+
# },
|
|
360
|
+
# ]
|
|
361
|
+
#
|
|
362
|
+
result = []
|
|
363
|
+
for i in range(0, len(response)):
|
|
364
|
+
currency = response[i]
|
|
365
|
+
result.append(self.parse_currency(currency))
|
|
366
|
+
return self.index_by(result, 'code')
|
|
367
|
+
|
|
368
|
+
def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
|
369
|
+
"""
|
|
370
|
+
fetch all deposits made to an account
|
|
371
|
+
:see: https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Manager/getDeposits
|
|
372
|
+
:param str code: unified currency code
|
|
373
|
+
:param int [since]: the earliest time in ms to fetch deposits for
|
|
374
|
+
:param int [limit]: the maximum number of deposits structures to retrieve
|
|
375
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
376
|
+
:returns dict[]: a list of `transaction structures <https://docs.ccxt.com/#/?id=transaction-structure>`
|
|
377
|
+
"""
|
|
378
|
+
address = self.safe_string(params, 'address')
|
|
379
|
+
params = self.omit(params, 'address')
|
|
380
|
+
if address is None:
|
|
381
|
+
raise ArgumentsRequired(self.id + ' fetchDeposits() requires an address parameter')
|
|
382
|
+
request: dict = {
|
|
383
|
+
'address': address,
|
|
384
|
+
}
|
|
385
|
+
response = self.managerGetDeposits(self.extend(request, params))
|
|
386
|
+
#
|
|
387
|
+
# [
|
|
388
|
+
# {
|
|
389
|
+
# "from": "0x1134cc86b45039cc211c6d1d2e4b3c77f60207ed",
|
|
390
|
+
# "timestamp": "2022-01-01T00:00:00Z",
|
|
391
|
+
# "to": "0x1134cc86b45039cc211c6d1d2e4b3c77f60207ed",
|
|
392
|
+
# "token": "0x6baad3fe5d0fd4be604420e728adbd68d67e119e",
|
|
393
|
+
# "transferHash": "0x5464cdff35448314e178b8677ea41e670ea0f2533f4e52bfbd4e4a6cfcdef4c2",
|
|
394
|
+
# "value": "100"
|
|
395
|
+
# }
|
|
396
|
+
# ]
|
|
397
|
+
#
|
|
398
|
+
currency = self.safe_currency(code)
|
|
399
|
+
return self.parse_transactions(response, currency, since, limit)
|
|
400
|
+
|
|
401
|
+
def fetch_withdrawals(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
|
|
402
|
+
"""
|
|
403
|
+
fetch all withdrawals made to an account
|
|
404
|
+
:see: https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Manager/getWithdraws
|
|
405
|
+
:param str code: unified currency code
|
|
406
|
+
:param int [since]: the earliest time in ms to fetch withdrawals for
|
|
407
|
+
:param int [limit]: the maximum number of transaction structures to retrieve
|
|
408
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
409
|
+
:returns dict[]: a list of `transaction structures <https://docs.ccxt.com/#/?id=transaction-structure>`
|
|
410
|
+
"""
|
|
411
|
+
address = self.safe_string(params, 'address')
|
|
412
|
+
params = self.omit(params, 'address')
|
|
413
|
+
if address is None:
|
|
414
|
+
raise ArgumentsRequired(self.id + ' fetchDeposits() requires an address parameter')
|
|
415
|
+
request: dict = {
|
|
416
|
+
'address': address,
|
|
417
|
+
}
|
|
418
|
+
response = self.managerGetWithdrawals(self.extend(request, params))
|
|
419
|
+
#
|
|
420
|
+
# [
|
|
421
|
+
# {
|
|
422
|
+
# "from": "0x1134cc86b45039cc211c6d1d2e4b3c77f60207ed",
|
|
423
|
+
# "timestamp": "2022-01-01T00:00:00Z",
|
|
424
|
+
# "to": "0x1134cc86b45039cc211c6d1d2e4b3c77f60207ed",
|
|
425
|
+
# "token": "0x6baad3fe5d0fd4be604420e728adbd68d67e119e",
|
|
426
|
+
# "transferHash": "0x5464cdff35448314e178b8677ea41e670ea0f2533f4e52bfbd4e4a6cfcdef4c2",
|
|
427
|
+
# "value": "100"
|
|
428
|
+
# }
|
|
429
|
+
# ]
|
|
430
|
+
#
|
|
431
|
+
currency = self.safe_currency(code)
|
|
432
|
+
return self.parse_transactions(response, currency, since, limit)
|
|
433
|
+
|
|
434
|
+
def get_currency_by_address(self, address):
|
|
435
|
+
currencies = self.currencies
|
|
436
|
+
for i in range(0, len(currencies)):
|
|
437
|
+
currency = currencies[i]
|
|
438
|
+
info = self.safe_value(currency, 'info', {})
|
|
439
|
+
a = self.safe_string(info, 'address')
|
|
440
|
+
if a == address:
|
|
441
|
+
return currency
|
|
442
|
+
return None
|
|
443
|
+
|
|
444
|
+
def parse_transaction(self, transaction: dict, currency: Currency = None) -> Transaction:
|
|
445
|
+
#
|
|
446
|
+
# {
|
|
447
|
+
# "from": "0x1134cc86b45039cc211c6d1d2e4b3c77f60207ed",
|
|
448
|
+
# "timestamp": "2022-01-01T00:00:00Z",
|
|
449
|
+
# "to": "0x1134cc86b45039cc211c6d1d2e4b3c77f60207ed",
|
|
450
|
+
# "token": "0x6baad3fe5d0fd4be604420e728adbd68d67e119e",
|
|
451
|
+
# "transferHash": "0x5464cdff35448314e178b8677ea41e670ea0f2533f4e52bfbd4e4a6cfcdef4c2",
|
|
452
|
+
# "value": "100"
|
|
453
|
+
# }
|
|
454
|
+
#
|
|
455
|
+
datetime = self.safe_string(transaction, 'timestamp')
|
|
456
|
+
currencyAddresss = self.safe_string(transaction, 'token', '')
|
|
457
|
+
currency = self.get_currency_by_address(currencyAddresss)
|
|
458
|
+
return {
|
|
459
|
+
'info': transaction,
|
|
460
|
+
'id': self.safe_string(transaction, 'transferHash'),
|
|
461
|
+
'txid': self.safe_string(transaction, 'txid'),
|
|
462
|
+
'timestamp': self.parse8601(datetime),
|
|
463
|
+
'datetime': datetime,
|
|
464
|
+
'network': None,
|
|
465
|
+
'address': None,
|
|
466
|
+
'addressTo': self.safe_string(transaction, 'to'),
|
|
467
|
+
'addressFrom': self.safe_string(transaction, 'from'),
|
|
468
|
+
'tag': None,
|
|
469
|
+
'tagTo': None,
|
|
470
|
+
'tagFrom': None,
|
|
471
|
+
'type': None,
|
|
472
|
+
'amount': self.safe_number(transaction, 'value'),
|
|
473
|
+
'currency': self.safe_currency_code(None, currency),
|
|
474
|
+
'status': 'ok',
|
|
475
|
+
'updated': None,
|
|
476
|
+
'internal': None,
|
|
477
|
+
'comment': None,
|
|
478
|
+
'fee': None,
|
|
479
|
+
}
|
|
480
|
+
|
|
481
|
+
def fetch_tickers(self, symbols: Strings = None, params={}) -> Tickers:
|
|
482
|
+
"""
|
|
483
|
+
fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
|
|
484
|
+
:see: https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Public/listTickers
|
|
485
|
+
:param str[]|None symbols: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
|
|
486
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
487
|
+
:returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
|
|
488
|
+
"""
|
|
489
|
+
self.load_markets()
|
|
490
|
+
period = self.safe_string(self.options['fetchTickers'], 'period', '1d')
|
|
491
|
+
request: dict = {
|
|
492
|
+
'period': self.timeframes[period], # I1, I5, I15, I30, H1, H2, H4, H6, H12, D1, W1
|
|
493
|
+
}
|
|
494
|
+
response = self.publicGetTickers(self.extend(request, params))
|
|
495
|
+
#
|
|
496
|
+
# [
|
|
497
|
+
# {
|
|
498
|
+
# "ask": 0.017,
|
|
499
|
+
# "bid": 0.016,
|
|
500
|
+
# "high": 0.019,
|
|
501
|
+
# "last": 0.017,
|
|
502
|
+
# "low": 0.015,
|
|
503
|
+
# "market": "TIME/ETH",
|
|
504
|
+
# "open": 0.016,
|
|
505
|
+
# "period": "H1",
|
|
506
|
+
# "timestamp": "2018-12-14T20:50:36.134Z",
|
|
507
|
+
# "volume": 4.57,
|
|
508
|
+
# "volumeQuote": 0.07312
|
|
509
|
+
# }
|
|
510
|
+
# ]
|
|
511
|
+
#
|
|
512
|
+
return self.parse_tickers(response, symbols)
|
|
513
|
+
|
|
514
|
+
def fetch_ticker(self, symbol: str, params={}) -> Ticker:
|
|
515
|
+
"""
|
|
516
|
+
fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
|
|
517
|
+
:see: https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Public/listTickers
|
|
518
|
+
:param str symbol: unified symbol of the market to fetch the ticker for
|
|
519
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
520
|
+
:returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
|
|
521
|
+
"""
|
|
522
|
+
self.load_markets()
|
|
523
|
+
market = self.market(symbol)
|
|
524
|
+
period = self.safe_string(self.options['fetchTickers'], 'period', '1d')
|
|
525
|
+
request: dict = {
|
|
526
|
+
'market': market['id'],
|
|
527
|
+
'period': self.timeframes[period], # I1, I5, I15, I30, H1, H2, H4, H6, H12, D1, W1
|
|
528
|
+
}
|
|
529
|
+
response = self.publicGetTickers(self.extend(request, params))
|
|
530
|
+
#
|
|
531
|
+
# [
|
|
532
|
+
# {
|
|
533
|
+
# "ask": 0.017,
|
|
534
|
+
# "bid": 0.016,
|
|
535
|
+
# "high": 0.019,
|
|
536
|
+
# "last": 0.017,
|
|
537
|
+
# "low": 0.015,
|
|
538
|
+
# "market": "TIME/ETH",
|
|
539
|
+
# "open": 0.016,
|
|
540
|
+
# "period": "H1",
|
|
541
|
+
# "timestamp": "2018-12-14T20:50:36.134Z",
|
|
542
|
+
# "volume": 4.57,
|
|
543
|
+
# "volumeQuote": 0.07312
|
|
544
|
+
# }
|
|
545
|
+
# ]
|
|
546
|
+
#
|
|
547
|
+
ticker = self.safe_dict(response, 0)
|
|
548
|
+
return self.parse_ticker(ticker, market)
|
|
549
|
+
|
|
550
|
+
def fetch_order_book(self, symbol: str, limit: Int = None, params={}) -> OrderBook:
|
|
551
|
+
"""
|
|
552
|
+
fetches information on open orders with bid(buy) and ask(sell) prices, volumes and other data
|
|
553
|
+
:see: https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Public/orderbookV2
|
|
554
|
+
:param str symbol: unified symbol of the market to fetch the order book for
|
|
555
|
+
:param int [limit]: the maximum amount of order book entries to return
|
|
556
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
557
|
+
:returns dict: A dictionary of `order book structures <https://docs.ccxt.com/#/?id=order-book-structure>` indexed by market symbols
|
|
558
|
+
"""
|
|
559
|
+
self.load_markets()
|
|
560
|
+
market = self.market(symbol)
|
|
561
|
+
request: dict = {
|
|
562
|
+
'market': market['id'],
|
|
563
|
+
}
|
|
564
|
+
if limit is not None:
|
|
565
|
+
request['limit'] = limit
|
|
566
|
+
response = self.publicGetOrderbookV2(self.extend(request, params))
|
|
567
|
+
#
|
|
568
|
+
# {
|
|
569
|
+
# "timestamp":"2019-12-05T00:21:09.538",
|
|
570
|
+
# "bid":[
|
|
571
|
+
# {
|
|
572
|
+
# "index":"2",
|
|
573
|
+
# "price":"0.02024007",
|
|
574
|
+
# "baseTokenAmount":"0.0096894",
|
|
575
|
+
# "baseTokenCumulativeAmount":"0.0096894",
|
|
576
|
+
# "quoteTokenAmount":"0.000196114134258",
|
|
577
|
+
# "quoteTokenCumulativeAmount":"0.000196114134258"
|
|
578
|
+
# },
|
|
579
|
+
# "ask":[
|
|
580
|
+
# {
|
|
581
|
+
# "index":"-3",
|
|
582
|
+
# "price":"0.02024012",
|
|
583
|
+
# "baseTokenAmount":"0.005",
|
|
584
|
+
# "baseTokenCumulativeAmount":"0.005",
|
|
585
|
+
# "quoteTokenAmount":"0.0001012006",
|
|
586
|
+
# "quoteTokenCumulativeAmount":"0.0001012006"
|
|
587
|
+
# },
|
|
588
|
+
# ]
|
|
589
|
+
# }
|
|
590
|
+
#
|
|
591
|
+
timestamp = self.parse8601(self.safe_string(response, 'timestamp'))
|
|
592
|
+
return self.parse_order_book(response, symbol, timestamp, 'bid', 'ask', 'price', 'baseTokenAmount')
|
|
593
|
+
|
|
594
|
+
def fetch_trades(self, symbol: str, since: Int = None, limit: Int = None, params={}) -> List[Trade]:
|
|
595
|
+
"""
|
|
596
|
+
get the list of most recent trades for a particular symbol
|
|
597
|
+
:see: https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Public/listTrades
|
|
598
|
+
:param str symbol: unified symbol of the market to fetch trades for
|
|
599
|
+
:param int [since]: timestamp in ms of the earliest trade to fetch
|
|
600
|
+
:param int [limit]: the maximum amount of trades to fetch
|
|
601
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
602
|
+
:returns Trade[]: a list of `trade structures <https://docs.ccxt.com/#/?id=public-trades>`
|
|
603
|
+
"""
|
|
604
|
+
self.load_markets()
|
|
605
|
+
market = self.market(symbol)
|
|
606
|
+
options = self.safe_value(self.options, 'fetchTrades', {})
|
|
607
|
+
defaultSort = self.safe_value(options, 'sort', 'timestamp,asc')
|
|
608
|
+
sort = self.safe_string(params, 'sort', defaultSort)
|
|
609
|
+
query = self.omit(params, 'sort')
|
|
610
|
+
request: dict = {
|
|
611
|
+
# 'address': 'string', # trade’s member account(?)
|
|
612
|
+
# 'cursor': 1234, # int64(?)
|
|
613
|
+
# 'from': self.iso8601(since),
|
|
614
|
+
'market': market['id'],
|
|
615
|
+
# 'page': 0, # results page you want to retrieve 0 .. N
|
|
616
|
+
# 'size': limit, # number of records per page, 100 by default
|
|
617
|
+
'sort': sort, # array[string], sorting criteria in the format "property,asc" or "property,desc", default is ascending
|
|
618
|
+
# 'till': self.iso8601(self.milliseconds()),
|
|
619
|
+
}
|
|
620
|
+
if since is not None:
|
|
621
|
+
request['from'] = self.iso8601(since)
|
|
622
|
+
if limit is not None:
|
|
623
|
+
request['size'] = limit # default is 100
|
|
624
|
+
response = self.publicGetTrades(self.extend(request, query))
|
|
625
|
+
#
|
|
626
|
+
# [
|
|
627
|
+
# {
|
|
628
|
+
# "id":1,
|
|
629
|
+
# "timestamp":"2019-06-25T17:01:50.309",
|
|
630
|
+
# "direction":"BUY",
|
|
631
|
+
# "price":"0.027",
|
|
632
|
+
# "quantity":"0.001"
|
|
633
|
+
# }
|
|
634
|
+
# ]
|
|
635
|
+
#
|
|
636
|
+
return self.parse_trades(response, market, since, limit)
|
|
637
|
+
|
|
638
|
+
def fetch_ohlcv(self, symbol: str, timeframe='1m', since: Int = None, limit: Int = None, params={}) -> List[list]:
|
|
639
|
+
"""
|
|
640
|
+
fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
|
|
641
|
+
:see: https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Public/listCandles
|
|
642
|
+
:param str symbol: unified symbol of the market to fetch OHLCV data for
|
|
643
|
+
:param str timeframe: the length of time each candle represents
|
|
644
|
+
:param int [since]: timestamp in ms of the earliest candle to fetch
|
|
645
|
+
:param int [limit]: the maximum amount of candles to fetch
|
|
646
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
647
|
+
:returns int[][]: A list of candles ordered, open, high, low, close, volume
|
|
648
|
+
"""
|
|
649
|
+
self.load_markets()
|
|
650
|
+
market = self.market(symbol)
|
|
651
|
+
request: dict = {
|
|
652
|
+
'market': market['id'],
|
|
653
|
+
'period': self.safe_string(self.timeframes, timeframe, timeframe),
|
|
654
|
+
}
|
|
655
|
+
# if since and limit are not specified
|
|
656
|
+
duration = self.parse_timeframe(timeframe)
|
|
657
|
+
if limit is None:
|
|
658
|
+
limit = 1000 # exchange provides tens of thousands of data, but we set generous default value
|
|
659
|
+
if since is not None:
|
|
660
|
+
request['from'] = self.iso8601(since)
|
|
661
|
+
request['till'] = self.iso8601(self.sum(since, self.sum(limit, 1) * duration * 1000))
|
|
662
|
+
else:
|
|
663
|
+
now = self.milliseconds()
|
|
664
|
+
request['till'] = self.iso8601(now)
|
|
665
|
+
request['from'] = self.iso8601(now - limit * duration * 1000 - 1)
|
|
666
|
+
response = self.publicGetCandles(self.extend(request, params))
|
|
667
|
+
#
|
|
668
|
+
# [
|
|
669
|
+
# {
|
|
670
|
+
# "timestamp":"2019-12-04T23:00:00",
|
|
671
|
+
# "open":"0.02024009",
|
|
672
|
+
# "high":"0.02024009",
|
|
673
|
+
# "low":"0.02024009",
|
|
674
|
+
# "close":"0.02024009",
|
|
675
|
+
# "volume":"0.00008096036",
|
|
676
|
+
# "volumeQuote":"0.004",
|
|
677
|
+
# },
|
|
678
|
+
# ]
|
|
679
|
+
#
|
|
680
|
+
return self.parse_ohlcvs(response, market, timeframe, since, limit)
|
|
681
|
+
|
|
682
|
+
def parse_balance(self, response) -> Balances:
|
|
683
|
+
result: dict = {
|
|
684
|
+
'info': response,
|
|
685
|
+
'timestamp': None,
|
|
686
|
+
'datetime': None,
|
|
687
|
+
}
|
|
688
|
+
for i in range(0, len(response)):
|
|
689
|
+
balance = response[i]
|
|
690
|
+
currencyId = self.safe_string(balance, 'currency')
|
|
691
|
+
code = self.safe_currency_code(currencyId)
|
|
692
|
+
account = self.account()
|
|
693
|
+
account['total'] = self.safe_string(balance, 'totalBalance')
|
|
694
|
+
account['used'] = self.safe_string(balance, 'lockedBalance')
|
|
695
|
+
result[code] = account
|
|
696
|
+
return self.safe_balance(result)
|
|
697
|
+
|
|
698
|
+
def fetch_balance(self, params={}) -> Balances:
|
|
699
|
+
"""
|
|
700
|
+
query for balance and get the amount of funds available for trading or funds locked in orders
|
|
701
|
+
:see: https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Trading/getBalances
|
|
702
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
703
|
+
:returns dict: a `balance structure <https://docs.ccxt.com/#/?id=balance-structure>`
|
|
704
|
+
"""
|
|
705
|
+
self.load_markets()
|
|
706
|
+
response = self.tradingGetBalances(params)
|
|
707
|
+
#
|
|
708
|
+
# [
|
|
709
|
+
# {"currency":"BTC","totalBalance":"0","lockedBalance":"0"},
|
|
710
|
+
# {"currency":"AUDT","totalBalance":"0","lockedBalance":"0"},
|
|
711
|
+
# {"currency":"ETH","totalBalance":"0","lockedBalance":"0"},
|
|
712
|
+
# {"currency":"TIME","totalBalance":"0","lockedBalance":"0"},
|
|
713
|
+
# {"currency":"USDT","totalBalance":"0","lockedBalance":"0"}
|
|
714
|
+
# ]
|
|
715
|
+
#
|
|
716
|
+
return self.parse_balance(response)
|
|
717
|
+
|
|
718
|
+
def create_order(self, symbol: str, type: OrderType, side: OrderSide, amount: float, price: Num = None, params={}):
|
|
719
|
+
"""
|
|
720
|
+
create a trade order
|
|
721
|
+
:see: https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Trading/createOrder
|
|
722
|
+
:param str symbol: unified symbol of the market to create an order in
|
|
723
|
+
:param str type: 'market' or 'limit'
|
|
724
|
+
:param str side: 'buy' or 'sell'
|
|
725
|
+
:param float amount: how much of currency you want to trade in units of base currency
|
|
726
|
+
:param float [price]: the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
|
|
727
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
728
|
+
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
|
729
|
+
"""
|
|
730
|
+
self.load_markets()
|
|
731
|
+
market = self.market(symbol)
|
|
732
|
+
uppercaseSide = side.upper()
|
|
733
|
+
uppercaseType = type.upper()
|
|
734
|
+
postOnly = self.safe_bool(params, 'postOnly', False)
|
|
735
|
+
if postOnly:
|
|
736
|
+
uppercaseType = 'POST_ONLY'
|
|
737
|
+
params = self.omit(params, ['postOnly'])
|
|
738
|
+
request: dict = {
|
|
739
|
+
'symbol': market['id'],
|
|
740
|
+
'quantity': self.amount_to_precision(symbol, amount),
|
|
741
|
+
'side': uppercaseSide,
|
|
742
|
+
'orderTypes': uppercaseType,
|
|
743
|
+
# 'clientOrderId': '123',
|
|
744
|
+
# 'expireIn': 1575523308, # in seconds
|
|
745
|
+
# 'expireTime': 1575523308, # unix timestamp
|
|
746
|
+
}
|
|
747
|
+
query = params
|
|
748
|
+
if (uppercaseType == 'LIMIT') or (uppercaseType == 'POST_ONLY'):
|
|
749
|
+
request['price'] = self.price_to_precision(symbol, price)
|
|
750
|
+
defaultExpireIn = self.safe_integer(self.options, 'expireIn')
|
|
751
|
+
expireTime = self.safe_value(params, 'expireTime')
|
|
752
|
+
expireIn = self.safe_value(params, 'expireIn', defaultExpireIn)
|
|
753
|
+
if expireTime is not None:
|
|
754
|
+
request['expireTime'] = expireTime
|
|
755
|
+
elif expireIn is not None:
|
|
756
|
+
request['expireIn'] = expireIn
|
|
757
|
+
else:
|
|
758
|
+
raise InvalidOrder(self.id + ' createOrder() method requires a expireTime or expireIn param for a ' + type + ' order, you can also set the expireIn exchange-wide option')
|
|
759
|
+
query = self.omit(params, ['expireTime', 'expireIn'])
|
|
760
|
+
else:
|
|
761
|
+
request['price'] = 0
|
|
762
|
+
response = self.tradingPostOrders(self.extend(request, query))
|
|
763
|
+
#
|
|
764
|
+
# {
|
|
765
|
+
# "orders": [
|
|
766
|
+
# {
|
|
767
|
+
# "cancelledQuantity": "0.3",
|
|
768
|
+
# "clientOrderId": "my-order-1",
|
|
769
|
+
# "createdAt": "1970-01-01T00:00:00",
|
|
770
|
+
# "cursorId": 50,
|
|
771
|
+
# "expireTime": "1970-01-01T00:00:00",
|
|
772
|
+
# "filledQuantity": "0.3",
|
|
773
|
+
# "id": "string",
|
|
774
|
+
# "price": "0.017",
|
|
775
|
+
# "quantity": "0.3",
|
|
776
|
+
# "side": "BUY",
|
|
777
|
+
# "symbol": "TIMEETH",
|
|
778
|
+
# "type": "LIMIT",
|
|
779
|
+
# "updatedAt": "1970-01-01T00:00:00"
|
|
780
|
+
# }
|
|
781
|
+
# ]
|
|
782
|
+
# }
|
|
783
|
+
#
|
|
784
|
+
orders = self.safe_value(response, 'orders', [])
|
|
785
|
+
order = self.safe_dict(orders, 0, {})
|
|
786
|
+
return self.parse_order(order, market)
|
|
787
|
+
|
|
788
|
+
def edit_order(self, id: str, symbol: str, type: OrderType, side: OrderSide, amount: Num = None, price: Num = None, params={}):
|
|
789
|
+
self.load_markets()
|
|
790
|
+
market = self.market(symbol)
|
|
791
|
+
request: dict = {
|
|
792
|
+
'id': id,
|
|
793
|
+
}
|
|
794
|
+
if amount is not None:
|
|
795
|
+
request['quantity'] = self.amount_to_precision(symbol, amount)
|
|
796
|
+
if price is not None:
|
|
797
|
+
request['price'] = self.price_to_precision(symbol, price)
|
|
798
|
+
response = self.tradingPutOrders(self.extend(request, params))
|
|
799
|
+
#
|
|
800
|
+
# {
|
|
801
|
+
# "changedOrders": [
|
|
802
|
+
# {
|
|
803
|
+
# "newOrder": {
|
|
804
|
+
# "cancelledQuantity": "0.3",
|
|
805
|
+
# "clientOrderId": "my-order-1",
|
|
806
|
+
# "createdAt": "1970-01-01T00:00:00",
|
|
807
|
+
# "cursorId": 50,
|
|
808
|
+
# "expireTime": "1970-01-01T00:00:00",
|
|
809
|
+
# "filledQuantity": "0.3",
|
|
810
|
+
# "id": "string",
|
|
811
|
+
# "price": "0.017",
|
|
812
|
+
# "quantity": "0.3",
|
|
813
|
+
# "side": "BUY",
|
|
814
|
+
# "symbol": "TIMEETH",
|
|
815
|
+
# "type": "LIMIT",
|
|
816
|
+
# "updatedAt": "1970-01-01T00:00:00"
|
|
817
|
+
# },
|
|
818
|
+
# "oldId": "string",
|
|
819
|
+
# },
|
|
820
|
+
# ],
|
|
821
|
+
# "unchangedOrders": ["string"],
|
|
822
|
+
# }
|
|
823
|
+
#
|
|
824
|
+
if 'unchangedOrders' in response:
|
|
825
|
+
orderIds = self.safe_value(response, 'unchangedOrders', [])
|
|
826
|
+
orderId = self.safe_string(orderIds, 0)
|
|
827
|
+
return self.safe_order({
|
|
828
|
+
'id': orderId,
|
|
829
|
+
'info': response,
|
|
830
|
+
})
|
|
831
|
+
orders = self.safe_value(response, 'changedOrders', [])
|
|
832
|
+
firstOrder = self.safe_value(orders, 0, {})
|
|
833
|
+
order = self.safe_dict(firstOrder, 'newOrder', {})
|
|
834
|
+
return self.parse_order(order, market)
|
|
835
|
+
|
|
836
|
+
def cancel_order(self, id: str, symbol: Str = None, params={}):
|
|
837
|
+
"""
|
|
838
|
+
cancels an open order
|
|
839
|
+
:see: https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Trading/deleteOrders
|
|
840
|
+
:param str id: order id
|
|
841
|
+
:param str symbol: not used by timex cancelOrder()
|
|
842
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
843
|
+
:returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
|
844
|
+
"""
|
|
845
|
+
self.load_markets()
|
|
846
|
+
return self.cancel_orders([id], symbol, params)
|
|
847
|
+
|
|
848
|
+
def cancel_orders(self, ids, symbol: Str = None, params={}):
|
|
849
|
+
"""
|
|
850
|
+
cancel multiple orders
|
|
851
|
+
:see: https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Trading/deleteOrders
|
|
852
|
+
:param str[] ids: order ids
|
|
853
|
+
:param str symbol: unified market symbol, default is None
|
|
854
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
855
|
+
:returns dict: an list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
|
856
|
+
"""
|
|
857
|
+
self.load_markets()
|
|
858
|
+
request: dict = {
|
|
859
|
+
'id': ids,
|
|
860
|
+
}
|
|
861
|
+
response = self.tradingDeleteOrders(self.extend(request, params))
|
|
862
|
+
#
|
|
863
|
+
# {
|
|
864
|
+
# "changedOrders": [
|
|
865
|
+
# {
|
|
866
|
+
# "newOrder": {
|
|
867
|
+
# "cancelledQuantity": "0.3",
|
|
868
|
+
# "clientOrderId": "my-order-1",
|
|
869
|
+
# "createdAt": "1970-01-01T00:00:00",
|
|
870
|
+
# "cursorId": 50,
|
|
871
|
+
# "expireTime": "1970-01-01T00:00:00",
|
|
872
|
+
# "filledQuantity": "0.3",
|
|
873
|
+
# "id": "string",
|
|
874
|
+
# "price": "0.017",
|
|
875
|
+
# "quantity": "0.3",
|
|
876
|
+
# "side": "BUY",
|
|
877
|
+
# "symbol": "TIMEETH",
|
|
878
|
+
# "type": "LIMIT",
|
|
879
|
+
# "updatedAt": "1970-01-01T00:00:00"
|
|
880
|
+
# },
|
|
881
|
+
# "oldId": "string",
|
|
882
|
+
# },
|
|
883
|
+
# ],
|
|
884
|
+
# "unchangedOrders": ["string"],
|
|
885
|
+
# }
|
|
886
|
+
return response
|
|
887
|
+
|
|
888
|
+
def fetch_order(self, id: str, symbol: Str = None, params={}):
|
|
889
|
+
"""
|
|
890
|
+
fetches information on an order made by the user
|
|
891
|
+
:see: https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/History/getOrderDetails
|
|
892
|
+
:param str symbol: not used by timex fetchOrder
|
|
893
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
894
|
+
:returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
|
|
895
|
+
"""
|
|
896
|
+
self.load_markets()
|
|
897
|
+
request: dict = {
|
|
898
|
+
'orderHash': id,
|
|
899
|
+
}
|
|
900
|
+
response = self.historyGetOrdersDetails(request)
|
|
901
|
+
#
|
|
902
|
+
# {
|
|
903
|
+
# "order": {
|
|
904
|
+
# "cancelledQuantity": "0.3",
|
|
905
|
+
# "clientOrderId": "my-order-1",
|
|
906
|
+
# "createdAt": "1970-01-01T00:00:00",
|
|
907
|
+
# "cursorId": 50,
|
|
908
|
+
# "expireTime": "1970-01-01T00:00:00",
|
|
909
|
+
# "filledQuantity": "0.3",
|
|
910
|
+
# "id": "string",
|
|
911
|
+
# "price": "0.017",
|
|
912
|
+
# "quantity": "0.3",
|
|
913
|
+
# "side": "BUY",
|
|
914
|
+
# "symbol": "TIMEETH",
|
|
915
|
+
# "type": "LIMIT",
|
|
916
|
+
# "updatedAt": "1970-01-01T00:00:00"
|
|
917
|
+
# },
|
|
918
|
+
# "trades": [
|
|
919
|
+
# {
|
|
920
|
+
# "fee": "0.3",
|
|
921
|
+
# "id": 100,
|
|
922
|
+
# "makerOrTaker": "MAKER",
|
|
923
|
+
# "makerOrderId": "string",
|
|
924
|
+
# "price": "0.017",
|
|
925
|
+
# "quantity": "0.3",
|
|
926
|
+
# "side": "BUY",
|
|
927
|
+
# "symbol": "TIMEETH",
|
|
928
|
+
# "takerOrderId": "string",
|
|
929
|
+
# "timestamp": "2019-12-05T07:48:26.310Z"
|
|
930
|
+
# }
|
|
931
|
+
# ]
|
|
932
|
+
# }
|
|
933
|
+
#
|
|
934
|
+
order = self.safe_value(response, 'order', {})
|
|
935
|
+
trades = self.safe_list(response, 'trades', [])
|
|
936
|
+
return self.parse_order(self.extend(order, {'trades': trades}))
|
|
937
|
+
|
|
938
|
+
def fetch_open_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
|
939
|
+
"""
|
|
940
|
+
fetch all unfilled currently open orders
|
|
941
|
+
:see: https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Trading/getOpenOrders
|
|
942
|
+
:param str symbol: unified market symbol
|
|
943
|
+
:param int [since]: the earliest time in ms to fetch open orders for
|
|
944
|
+
:param int [limit]: the maximum number of open orders structures to retrieve
|
|
945
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
946
|
+
:returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
|
947
|
+
"""
|
|
948
|
+
self.load_markets()
|
|
949
|
+
options = self.safe_value(self.options, 'fetchOpenOrders', {})
|
|
950
|
+
defaultSort = self.safe_value(options, 'sort', 'createdAt,asc')
|
|
951
|
+
sort = self.safe_string(params, 'sort', defaultSort)
|
|
952
|
+
query = self.omit(params, 'sort')
|
|
953
|
+
request: dict = {
|
|
954
|
+
# 'clientOrderId': '123', # order’s client id list for filter
|
|
955
|
+
# page: 0, # results page you want to retrieve(0 .. N)
|
|
956
|
+
'sort': sort, # sorting criteria in the format "property,asc" or "property,desc", default order is ascending, multiple sort criteria are supported
|
|
957
|
+
}
|
|
958
|
+
market: Market = None
|
|
959
|
+
if symbol is not None:
|
|
960
|
+
market = self.market(symbol)
|
|
961
|
+
request['symbol'] = market['id']
|
|
962
|
+
if limit is not None:
|
|
963
|
+
request['size'] = limit
|
|
964
|
+
response = self.tradingGetOrders(self.extend(request, query))
|
|
965
|
+
#
|
|
966
|
+
# {
|
|
967
|
+
# "orders": [
|
|
968
|
+
# {
|
|
969
|
+
# "cancelledQuantity": "0.3",
|
|
970
|
+
# "clientOrderId": "my-order-1",
|
|
971
|
+
# "createdAt": "1970-01-01T00:00:00",
|
|
972
|
+
# "cursorId": 50,
|
|
973
|
+
# "expireTime": "1970-01-01T00:00:00",
|
|
974
|
+
# "filledQuantity": "0.3",
|
|
975
|
+
# "id": "string",
|
|
976
|
+
# "price": "0.017",
|
|
977
|
+
# "quantity": "0.3",
|
|
978
|
+
# "side": "BUY",
|
|
979
|
+
# "symbol": "TIMEETH",
|
|
980
|
+
# "type": "LIMIT",
|
|
981
|
+
# "updatedAt": "1970-01-01T00:00:00"
|
|
982
|
+
# }
|
|
983
|
+
# ]
|
|
984
|
+
# }
|
|
985
|
+
#
|
|
986
|
+
orders = self.safe_list(response, 'orders', [])
|
|
987
|
+
return self.parse_orders(orders, market, since, limit)
|
|
988
|
+
|
|
989
|
+
def fetch_closed_orders(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Order]:
|
|
990
|
+
"""
|
|
991
|
+
fetches information on multiple closed orders made by the user
|
|
992
|
+
:see: https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/History/getOrders
|
|
993
|
+
:param str symbol: unified market symbol of the market orders were made in
|
|
994
|
+
:param int [since]: the earliest time in ms to fetch orders for
|
|
995
|
+
:param int [limit]: the maximum number of order structures to retrieve
|
|
996
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
997
|
+
:returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
|
|
998
|
+
"""
|
|
999
|
+
self.load_markets()
|
|
1000
|
+
options = self.safe_value(self.options, 'fetchClosedOrders', {})
|
|
1001
|
+
defaultSort = self.safe_value(options, 'sort', 'createdAt,asc')
|
|
1002
|
+
sort = self.safe_string(params, 'sort', defaultSort)
|
|
1003
|
+
query = self.omit(params, 'sort')
|
|
1004
|
+
request: dict = {
|
|
1005
|
+
# 'clientOrderId': '123', # order’s client id list for filter
|
|
1006
|
+
# page: 0, # results page you want to retrieve(0 .. N)
|
|
1007
|
+
'sort': sort, # sorting criteria in the format "property,asc" or "property,desc", default order is ascending, multiple sort criteria are supported
|
|
1008
|
+
'side': 'BUY', # or 'SELL'
|
|
1009
|
+
# 'till': self.iso8601(self.milliseconds()),
|
|
1010
|
+
}
|
|
1011
|
+
market: Market = None
|
|
1012
|
+
if symbol is not None:
|
|
1013
|
+
market = self.market(symbol)
|
|
1014
|
+
request['symbol'] = market['id']
|
|
1015
|
+
if since is not None:
|
|
1016
|
+
request['from'] = self.iso8601(since)
|
|
1017
|
+
if limit is not None:
|
|
1018
|
+
request['size'] = limit
|
|
1019
|
+
response = self.historyGetOrders(self.extend(request, query))
|
|
1020
|
+
#
|
|
1021
|
+
# {
|
|
1022
|
+
# "orders": [
|
|
1023
|
+
# {
|
|
1024
|
+
# "cancelledQuantity": "0.3",
|
|
1025
|
+
# "clientOrderId": "my-order-1",
|
|
1026
|
+
# "createdAt": "1970-01-01T00:00:00",
|
|
1027
|
+
# "cursorId": 50,
|
|
1028
|
+
# "expireTime": "1970-01-01T00:00:00",
|
|
1029
|
+
# "filledQuantity": "0.3",
|
|
1030
|
+
# "id": "string",
|
|
1031
|
+
# "price": "0.017",
|
|
1032
|
+
# "quantity": "0.3",
|
|
1033
|
+
# "side": "BUY",
|
|
1034
|
+
# "symbol": "TIMEETH",
|
|
1035
|
+
# "type": "LIMIT",
|
|
1036
|
+
# "updatedAt": "1970-01-01T00:00:00"
|
|
1037
|
+
# }
|
|
1038
|
+
# ]
|
|
1039
|
+
# }
|
|
1040
|
+
#
|
|
1041
|
+
orders = self.safe_list(response, 'orders', [])
|
|
1042
|
+
return self.parse_orders(orders, market, since, limit)
|
|
1043
|
+
|
|
1044
|
+
def fetch_my_trades(self, symbol: Str = None, since: Int = None, limit: Int = None, params={}):
|
|
1045
|
+
"""
|
|
1046
|
+
fetch all trades made by the user
|
|
1047
|
+
:see: https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/History/getTrades_1
|
|
1048
|
+
:param str symbol: unified market symbol
|
|
1049
|
+
:param int [since]: the earliest time in ms to fetch trades for
|
|
1050
|
+
:param int [limit]: the maximum number of trades structures to retrieve
|
|
1051
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
1052
|
+
:returns Trade[]: a list of `trade structures <https://docs.ccxt.com/#/?id=trade-structure>`
|
|
1053
|
+
"""
|
|
1054
|
+
self.load_markets()
|
|
1055
|
+
options = self.safe_value(self.options, 'fetchMyTrades', {})
|
|
1056
|
+
defaultSort = self.safe_value(options, 'sort', 'timestamp,asc')
|
|
1057
|
+
sort = self.safe_string(params, 'sort', defaultSort)
|
|
1058
|
+
query = self.omit(params, 'sort')
|
|
1059
|
+
request: dict = {
|
|
1060
|
+
# 'cursorId': 123, # int64(?)
|
|
1061
|
+
# 'from': self.iso8601(since),
|
|
1062
|
+
# 'makerOrderId': '1234', # maker order hash
|
|
1063
|
+
# 'owner': '...', # owner address(?)
|
|
1064
|
+
# 'page': 0, # results page you want to retrieve(0 .. N)
|
|
1065
|
+
# 'side': 'BUY', # or 'SELL'
|
|
1066
|
+
# 'size': limit,
|
|
1067
|
+
'sort': sort, # sorting criteria in the format "property,asc" or "property,desc", default order is ascending, multiple sort criteria are supported
|
|
1068
|
+
# 'symbol': market['id'],
|
|
1069
|
+
# 'takerOrderId': '1234',
|
|
1070
|
+
# 'till': self.iso8601(self.milliseconds()),
|
|
1071
|
+
}
|
|
1072
|
+
market: Market = None
|
|
1073
|
+
if symbol is not None:
|
|
1074
|
+
market = self.market(symbol)
|
|
1075
|
+
request['symbol'] = market['id']
|
|
1076
|
+
if since is not None:
|
|
1077
|
+
request['from'] = self.iso8601(since)
|
|
1078
|
+
if limit is not None:
|
|
1079
|
+
request['size'] = limit
|
|
1080
|
+
response = self.historyGetTrades(self.extend(request, query))
|
|
1081
|
+
#
|
|
1082
|
+
# {
|
|
1083
|
+
# "trades": [
|
|
1084
|
+
# {
|
|
1085
|
+
# "fee": "0.3",
|
|
1086
|
+
# "id": 100,
|
|
1087
|
+
# "makerOrTaker": "MAKER",
|
|
1088
|
+
# "makerOrderId": "string",
|
|
1089
|
+
# "price": "0.017",
|
|
1090
|
+
# "quantity": "0.3",
|
|
1091
|
+
# "side": "BUY",
|
|
1092
|
+
# "symbol": "TIMEETH",
|
|
1093
|
+
# "takerOrderId": "string",
|
|
1094
|
+
# "timestamp": "2019-12-08T04:54:11.171Z"
|
|
1095
|
+
# }
|
|
1096
|
+
# ]
|
|
1097
|
+
# }
|
|
1098
|
+
#
|
|
1099
|
+
trades = self.safe_list(response, 'trades', [])
|
|
1100
|
+
return self.parse_trades(trades, market, since, limit)
|
|
1101
|
+
|
|
1102
|
+
def parse_trading_fee(self, fee: dict, market: Market = None) -> TradingFeeInterface:
|
|
1103
|
+
#
|
|
1104
|
+
# {
|
|
1105
|
+
# "fee": 0.0075,
|
|
1106
|
+
# "market": "ETHBTC"
|
|
1107
|
+
# }
|
|
1108
|
+
#
|
|
1109
|
+
marketId = self.safe_string(fee, 'market')
|
|
1110
|
+
rate = self.safe_number(fee, 'fee')
|
|
1111
|
+
return {
|
|
1112
|
+
'info': fee,
|
|
1113
|
+
'symbol': self.safe_symbol(marketId, market),
|
|
1114
|
+
'maker': rate,
|
|
1115
|
+
'taker': rate,
|
|
1116
|
+
'percentage': None,
|
|
1117
|
+
'tierBased': None,
|
|
1118
|
+
}
|
|
1119
|
+
|
|
1120
|
+
def fetch_trading_fee(self, symbol: str, params={}) -> TradingFeeInterface:
|
|
1121
|
+
"""
|
|
1122
|
+
fetch the trading fees for a market
|
|
1123
|
+
:see: https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Trading/getFees
|
|
1124
|
+
:param str symbol: unified market symbol
|
|
1125
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
1126
|
+
:returns dict: a `fee structure <https://docs.ccxt.com/#/?id=fee-structure>`
|
|
1127
|
+
"""
|
|
1128
|
+
self.load_markets()
|
|
1129
|
+
market = self.market(symbol)
|
|
1130
|
+
request: dict = {
|
|
1131
|
+
'markets': market['id'],
|
|
1132
|
+
}
|
|
1133
|
+
response = self.tradingGetFees(self.extend(request, params))
|
|
1134
|
+
#
|
|
1135
|
+
# [
|
|
1136
|
+
# {
|
|
1137
|
+
# "fee": 0.0075,
|
|
1138
|
+
# "market": "ETHBTC"
|
|
1139
|
+
# }
|
|
1140
|
+
# ]
|
|
1141
|
+
#
|
|
1142
|
+
result = self.safe_value(response, 0, {})
|
|
1143
|
+
return self.parse_trading_fee(result, market)
|
|
1144
|
+
|
|
1145
|
+
def parse_market(self, market: dict) -> Market:
|
|
1146
|
+
#
|
|
1147
|
+
# {
|
|
1148
|
+
# "symbol": "ETHBTC",
|
|
1149
|
+
# "name": "ETH/BTC",
|
|
1150
|
+
# "baseCurrency": "ETH",
|
|
1151
|
+
# "baseTokenAddress": "0x45932db54b38af1f5a57136302eeba66a5975c15",
|
|
1152
|
+
# "quoteCurrency": "BTC",
|
|
1153
|
+
# "quoteTokenAddress": "0x8370fbc6ddec1e18b4e41e72ed943e238458487c",
|
|
1154
|
+
# "feeCurrency": "BTC",
|
|
1155
|
+
# "feeTokenAddress": "0x8370fbc6ddec1e18b4e41e72ed943e238458487c",
|
|
1156
|
+
# "quantityIncrement": "0.0000001",
|
|
1157
|
+
# "takerFee": "0.005",
|
|
1158
|
+
# "makerFee": "0.0025",
|
|
1159
|
+
# "tickSize": "0.00000001",
|
|
1160
|
+
# "baseMinSize": "0.0001",
|
|
1161
|
+
# "quoteMinSize": "0.00001",
|
|
1162
|
+
# "locked": False
|
|
1163
|
+
# }
|
|
1164
|
+
#
|
|
1165
|
+
locked = self.safe_value(market, 'locked')
|
|
1166
|
+
id = self.safe_string(market, 'symbol')
|
|
1167
|
+
baseId = self.safe_string(market, 'baseCurrency')
|
|
1168
|
+
quoteId = self.safe_string(market, 'quoteCurrency')
|
|
1169
|
+
base = self.safe_currency_code(baseId)
|
|
1170
|
+
quote = self.safe_currency_code(quoteId)
|
|
1171
|
+
amountIncrement = self.safe_string(market, 'quantityIncrement')
|
|
1172
|
+
minBase = self.safe_string(market, 'baseMinSize')
|
|
1173
|
+
minAmount = Precise.string_max(amountIncrement, minBase)
|
|
1174
|
+
priceIncrement = self.safe_string(market, 'tickSize')
|
|
1175
|
+
minCost = self.safe_number(market, 'quoteMinSize')
|
|
1176
|
+
return {
|
|
1177
|
+
'id': id,
|
|
1178
|
+
'symbol': base + '/' + quote,
|
|
1179
|
+
'base': base,
|
|
1180
|
+
'quote': quote,
|
|
1181
|
+
'settle': None,
|
|
1182
|
+
'baseId': baseId,
|
|
1183
|
+
'quoteId': quoteId,
|
|
1184
|
+
'settleId': None,
|
|
1185
|
+
'type': 'spot',
|
|
1186
|
+
'spot': True,
|
|
1187
|
+
'margin': False,
|
|
1188
|
+
'swap': False,
|
|
1189
|
+
'future': False,
|
|
1190
|
+
'option': False,
|
|
1191
|
+
'active': not locked,
|
|
1192
|
+
'contract': False,
|
|
1193
|
+
'linear': None,
|
|
1194
|
+
'inverse': None,
|
|
1195
|
+
'taker': self.safe_number(market, 'takerFee'),
|
|
1196
|
+
'maker': self.safe_number(market, 'makerFee'),
|
|
1197
|
+
'contractSize': None,
|
|
1198
|
+
'expiry': None,
|
|
1199
|
+
'expiryDatetime': None,
|
|
1200
|
+
'strike': None,
|
|
1201
|
+
'optionType': None,
|
|
1202
|
+
'precision': {
|
|
1203
|
+
'amount': self.safe_number(market, 'quantityIncrement'),
|
|
1204
|
+
'price': self.safe_number(market, 'tickSize'),
|
|
1205
|
+
},
|
|
1206
|
+
'limits': {
|
|
1207
|
+
'leverage': {
|
|
1208
|
+
'min': None,
|
|
1209
|
+
'max': None,
|
|
1210
|
+
},
|
|
1211
|
+
'amount': {
|
|
1212
|
+
'min': self.parse_number(minAmount),
|
|
1213
|
+
'max': None,
|
|
1214
|
+
},
|
|
1215
|
+
'price': {
|
|
1216
|
+
'min': self.parse_number(priceIncrement),
|
|
1217
|
+
'max': None,
|
|
1218
|
+
},
|
|
1219
|
+
'cost': {
|
|
1220
|
+
'min': minCost,
|
|
1221
|
+
'max': None,
|
|
1222
|
+
},
|
|
1223
|
+
},
|
|
1224
|
+
'created': None,
|
|
1225
|
+
'info': market,
|
|
1226
|
+
}
|
|
1227
|
+
|
|
1228
|
+
def parse_currency(self, currency: dict):
|
|
1229
|
+
#
|
|
1230
|
+
# {
|
|
1231
|
+
# "symbol": "BTC",
|
|
1232
|
+
# "name": "Bitcoin",
|
|
1233
|
+
# "address": "0x8370fbc6ddec1e18b4e41e72ed943e238458487c",
|
|
1234
|
+
# "icon": "data:image/svg+xml;base64,PHN2ZyB3aWR...mc+Cg==",
|
|
1235
|
+
# "background": "transparent",
|
|
1236
|
+
# "fiatSymbol": "BTC",
|
|
1237
|
+
# "decimals": 8,
|
|
1238
|
+
# "tradeDecimals": 20,
|
|
1239
|
+
# "displayDecimals": 4,
|
|
1240
|
+
# "crypto": True,
|
|
1241
|
+
# "depositEnabled": True,
|
|
1242
|
+
# "withdrawalEnabled": True,
|
|
1243
|
+
# "transferEnabled": True,
|
|
1244
|
+
# "buyEnabled": False,
|
|
1245
|
+
# "purchaseEnabled": False,
|
|
1246
|
+
# "redeemEnabled": False,
|
|
1247
|
+
# "active": True,
|
|
1248
|
+
# "withdrawalFee": "50000000000000000",
|
|
1249
|
+
# "purchaseCommissions": []
|
|
1250
|
+
# }
|
|
1251
|
+
#
|
|
1252
|
+
# https://github.com/ccxt/ccxt/issues/6878
|
|
1253
|
+
#
|
|
1254
|
+
# {
|
|
1255
|
+
# "symbol":"XRP",
|
|
1256
|
+
# "name":"Ripple",
|
|
1257
|
+
# "address":"0x0dc8882914f3ddeebf4cec6dc20edb99df3def6c",
|
|
1258
|
+
# "decimals":6,
|
|
1259
|
+
# "tradeDecimals":16,
|
|
1260
|
+
# "depositEnabled":true,
|
|
1261
|
+
# "withdrawalEnabled":true,
|
|
1262
|
+
# "transferEnabled":true,
|
|
1263
|
+
# "active":true
|
|
1264
|
+
# }
|
|
1265
|
+
#
|
|
1266
|
+
id = self.safe_string(currency, 'symbol')
|
|
1267
|
+
code = self.safe_currency_code(id)
|
|
1268
|
+
name = self.safe_string(currency, 'name')
|
|
1269
|
+
depositEnabled = self.safe_value(currency, 'depositEnabled')
|
|
1270
|
+
withdrawEnabled = self.safe_value(currency, 'withdrawalEnabled')
|
|
1271
|
+
isActive = self.safe_value(currency, 'active')
|
|
1272
|
+
active = depositEnabled and withdrawEnabled and isActive
|
|
1273
|
+
# fee = self.safe_number(currency, 'withdrawalFee')
|
|
1274
|
+
feeString = self.safe_string(currency, 'withdrawalFee')
|
|
1275
|
+
tradeDecimals = self.safe_integer(currency, 'tradeDecimals')
|
|
1276
|
+
fee = None
|
|
1277
|
+
if (feeString is not None) and (tradeDecimals is not None):
|
|
1278
|
+
feeStringLen = len(feeString)
|
|
1279
|
+
dotIndex = feeStringLen - tradeDecimals
|
|
1280
|
+
if dotIndex > 0:
|
|
1281
|
+
whole = feeString[0:dotIndex]
|
|
1282
|
+
fraction = feeString[-dotIndex:]
|
|
1283
|
+
fee = self.parse_number(whole + '.' + fraction)
|
|
1284
|
+
else:
|
|
1285
|
+
fraction = '.'
|
|
1286
|
+
for i in range(0, -dotIndex):
|
|
1287
|
+
fraction += '0'
|
|
1288
|
+
fee = self.parse_number(fraction + feeString)
|
|
1289
|
+
return {
|
|
1290
|
+
'id': code,
|
|
1291
|
+
'code': code,
|
|
1292
|
+
'info': currency,
|
|
1293
|
+
'type': None,
|
|
1294
|
+
'name': name,
|
|
1295
|
+
'active': active,
|
|
1296
|
+
'deposit': depositEnabled,
|
|
1297
|
+
'withdraw': withdrawEnabled,
|
|
1298
|
+
'fee': fee,
|
|
1299
|
+
'precision': self.parse_number(self.parse_precision(self.safe_string(currency, 'decimals'))),
|
|
1300
|
+
'limits': {
|
|
1301
|
+
'withdraw': {'min': fee, 'max': None},
|
|
1302
|
+
'amount': {'min': None, 'max': None},
|
|
1303
|
+
},
|
|
1304
|
+
'networks': {},
|
|
1305
|
+
}
|
|
1306
|
+
|
|
1307
|
+
def parse_ticker(self, ticker: dict, market: Market = None) -> Ticker:
|
|
1308
|
+
#
|
|
1309
|
+
# {
|
|
1310
|
+
# "ask": 0.017,
|
|
1311
|
+
# "bid": 0.016,
|
|
1312
|
+
# "high": 0.019,
|
|
1313
|
+
# "last": 0.017,
|
|
1314
|
+
# "low": 0.015,
|
|
1315
|
+
# "market": "TIME/ETH",
|
|
1316
|
+
# "open": 0.016,
|
|
1317
|
+
# "period": "H1",
|
|
1318
|
+
# "timestamp": "2018-12-14T20:50:36.134Z",
|
|
1319
|
+
# "volume": 4.57,
|
|
1320
|
+
# "volumeQuote": 0.07312
|
|
1321
|
+
# }
|
|
1322
|
+
#
|
|
1323
|
+
marketId = self.safe_string(ticker, 'market')
|
|
1324
|
+
symbol = self.safe_symbol(marketId, market, '/')
|
|
1325
|
+
timestamp = self.parse8601(self.safe_string(ticker, 'timestamp'))
|
|
1326
|
+
last = self.safe_string(ticker, 'last')
|
|
1327
|
+
open = self.safe_string(ticker, 'open')
|
|
1328
|
+
return self.safe_ticker({
|
|
1329
|
+
'symbol': symbol,
|
|
1330
|
+
'info': ticker,
|
|
1331
|
+
'timestamp': timestamp,
|
|
1332
|
+
'datetime': self.iso8601(timestamp),
|
|
1333
|
+
'high': self.safe_string(ticker, 'high'),
|
|
1334
|
+
'low': self.safe_string(ticker, 'low'),
|
|
1335
|
+
'bid': self.safe_string(ticker, 'bid'),
|
|
1336
|
+
'bidVolume': None,
|
|
1337
|
+
'ask': self.safe_string(ticker, 'ask'),
|
|
1338
|
+
'askVolume': None,
|
|
1339
|
+
'vwap': None,
|
|
1340
|
+
'open': open,
|
|
1341
|
+
'close': last,
|
|
1342
|
+
'last': last,
|
|
1343
|
+
'previousClose': None,
|
|
1344
|
+
'change': None,
|
|
1345
|
+
'percentage': None,
|
|
1346
|
+
'average': None,
|
|
1347
|
+
'baseVolume': self.safe_string(ticker, 'volume'),
|
|
1348
|
+
'quoteVolume': self.safe_string(ticker, 'volumeQuote'),
|
|
1349
|
+
}, market)
|
|
1350
|
+
|
|
1351
|
+
def parse_trade(self, trade: dict, market: Market = None) -> Trade:
|
|
1352
|
+
#
|
|
1353
|
+
# fetchTrades(public)
|
|
1354
|
+
#
|
|
1355
|
+
# {
|
|
1356
|
+
# "id":1,
|
|
1357
|
+
# "timestamp":"2019-06-25T17:01:50.309",
|
|
1358
|
+
# "direction":"BUY",
|
|
1359
|
+
# "price":"0.027",
|
|
1360
|
+
# "quantity":"0.001"
|
|
1361
|
+
# }
|
|
1362
|
+
#
|
|
1363
|
+
# fetchMyTrades, fetchOrder(private)
|
|
1364
|
+
#
|
|
1365
|
+
# {
|
|
1366
|
+
# "id": "7613414",
|
|
1367
|
+
# "makerOrderId": "0x8420af060722f560098f786a2894d4358079b6ea5d14b395969ed77bc87a623a",
|
|
1368
|
+
# "takerOrderId": "0x1235ef158a361815b54c9988b6241c85aedcbc1fe81caf8df8587d5ab0373d1a",
|
|
1369
|
+
# "symbol": "LTCUSDT",
|
|
1370
|
+
# "side": "BUY",
|
|
1371
|
+
# "quantity": "0.2",
|
|
1372
|
+
# "fee": "0.22685",
|
|
1373
|
+
# "feeToken": "USDT",
|
|
1374
|
+
# "price": "226.85",
|
|
1375
|
+
# "makerOrTaker": "TAKER",
|
|
1376
|
+
# "timestamp": "2021-04-09T15:39:45.608"
|
|
1377
|
+
# }
|
|
1378
|
+
#
|
|
1379
|
+
marketId = self.safe_string(trade, 'symbol')
|
|
1380
|
+
symbol = self.safe_symbol(marketId, market)
|
|
1381
|
+
timestamp = self.parse8601(self.safe_string(trade, 'timestamp'))
|
|
1382
|
+
priceString = self.safe_string(trade, 'price')
|
|
1383
|
+
amountString = self.safe_string(trade, 'quantity')
|
|
1384
|
+
price = self.parse_number(priceString)
|
|
1385
|
+
amount = self.parse_number(amountString)
|
|
1386
|
+
cost = self.parse_number(Precise.string_mul(priceString, amountString))
|
|
1387
|
+
id = self.safe_string(trade, 'id')
|
|
1388
|
+
side = self.safe_string_lower_2(trade, 'direction', 'side')
|
|
1389
|
+
takerOrMaker = self.safe_string_lower(trade, 'makerOrTaker')
|
|
1390
|
+
orderId: Str = None
|
|
1391
|
+
if takerOrMaker is not None:
|
|
1392
|
+
orderId = self.safe_string(trade, takerOrMaker + 'OrderId')
|
|
1393
|
+
fee = None
|
|
1394
|
+
feeCost = self.safe_number(trade, 'fee')
|
|
1395
|
+
feeCurrency = self.safe_currency_code(self.safe_string(trade, 'feeToken'))
|
|
1396
|
+
if feeCost is not None:
|
|
1397
|
+
fee = {
|
|
1398
|
+
'cost': feeCost,
|
|
1399
|
+
'currency': feeCurrency,
|
|
1400
|
+
}
|
|
1401
|
+
return {
|
|
1402
|
+
'info': trade,
|
|
1403
|
+
'id': id,
|
|
1404
|
+
'timestamp': timestamp,
|
|
1405
|
+
'datetime': self.iso8601(timestamp),
|
|
1406
|
+
'symbol': symbol,
|
|
1407
|
+
'order': orderId,
|
|
1408
|
+
'type': None,
|
|
1409
|
+
'side': side,
|
|
1410
|
+
'price': price,
|
|
1411
|
+
'amount': amount,
|
|
1412
|
+
'cost': cost,
|
|
1413
|
+
'takerOrMaker': takerOrMaker,
|
|
1414
|
+
'fee': fee,
|
|
1415
|
+
}
|
|
1416
|
+
|
|
1417
|
+
def parse_ohlcv(self, ohlcv, market: Market = None) -> list:
|
|
1418
|
+
#
|
|
1419
|
+
# {
|
|
1420
|
+
# "timestamp":"2019-12-04T23:00:00",
|
|
1421
|
+
# "open":"0.02024009",
|
|
1422
|
+
# "high":"0.02024009",
|
|
1423
|
+
# "low":"0.02024009",
|
|
1424
|
+
# "close":"0.02024009",
|
|
1425
|
+
# "volume":"0.00008096036",
|
|
1426
|
+
# "volumeQuote":"0.004",
|
|
1427
|
+
# }
|
|
1428
|
+
#
|
|
1429
|
+
return [
|
|
1430
|
+
self.parse8601(self.safe_string(ohlcv, 'timestamp')),
|
|
1431
|
+
self.safe_number(ohlcv, 'open'),
|
|
1432
|
+
self.safe_number(ohlcv, 'high'),
|
|
1433
|
+
self.safe_number(ohlcv, 'low'),
|
|
1434
|
+
self.safe_number(ohlcv, 'close'),
|
|
1435
|
+
self.safe_number(ohlcv, 'volume'),
|
|
1436
|
+
]
|
|
1437
|
+
|
|
1438
|
+
def parse_order(self, order: dict, market: Market = None) -> Order:
|
|
1439
|
+
#
|
|
1440
|
+
# fetchOrder, createOrder, cancelOrder, cancelOrders, fetchOpenOrders, fetchClosedOrders
|
|
1441
|
+
#
|
|
1442
|
+
# {
|
|
1443
|
+
# "cancelledQuantity": "0.3",
|
|
1444
|
+
# "clientOrderId": "my-order-1",
|
|
1445
|
+
# "createdAt": "1970-01-01T00:00:00",
|
|
1446
|
+
# "cursorId": 50,
|
|
1447
|
+
# "expireTime": "1970-01-01T00:00:00",
|
|
1448
|
+
# "filledQuantity": "0.3",
|
|
1449
|
+
# "id": "string",
|
|
1450
|
+
# "price": "0.017",
|
|
1451
|
+
# "quantity": "0.3",
|
|
1452
|
+
# "side": "BUY",
|
|
1453
|
+
# "symbol": "TIMEETH",
|
|
1454
|
+
# "type": "LIMIT",
|
|
1455
|
+
# "updatedAt": "1970-01-01T00:00:00"
|
|
1456
|
+
# "trades": [], # injected from the outside
|
|
1457
|
+
# }
|
|
1458
|
+
#
|
|
1459
|
+
id = self.safe_string(order, 'id')
|
|
1460
|
+
type = self.safe_string_lower(order, 'type')
|
|
1461
|
+
side = self.safe_string_lower(order, 'side')
|
|
1462
|
+
marketId = self.safe_string(order, 'symbol')
|
|
1463
|
+
symbol = self.safe_symbol(marketId, market)
|
|
1464
|
+
timestamp = self.parse8601(self.safe_string(order, 'createdAt'))
|
|
1465
|
+
price = self.safe_string(order, 'price')
|
|
1466
|
+
amount = self.safe_string(order, 'quantity')
|
|
1467
|
+
filled = self.safe_string(order, 'filledQuantity')
|
|
1468
|
+
canceledQuantity = self.omit_zero(self.safe_string(order, 'cancelledQuantity'))
|
|
1469
|
+
status: str
|
|
1470
|
+
if Precise.string_equals(filled, amount):
|
|
1471
|
+
status = 'closed'
|
|
1472
|
+
elif canceledQuantity is not None:
|
|
1473
|
+
status = 'canceled'
|
|
1474
|
+
else:
|
|
1475
|
+
status = 'open'
|
|
1476
|
+
rawTrades = self.safe_value(order, 'trades', [])
|
|
1477
|
+
clientOrderId = self.safe_string(order, 'clientOrderId')
|
|
1478
|
+
return self.safe_order({
|
|
1479
|
+
'info': order,
|
|
1480
|
+
'id': id,
|
|
1481
|
+
'clientOrderId': clientOrderId,
|
|
1482
|
+
'timestamp': timestamp,
|
|
1483
|
+
'datetime': self.iso8601(timestamp),
|
|
1484
|
+
'lastTradeTimestamp': None,
|
|
1485
|
+
'symbol': symbol,
|
|
1486
|
+
'type': type,
|
|
1487
|
+
'timeInForce': None,
|
|
1488
|
+
'postOnly': None,
|
|
1489
|
+
'side': side,
|
|
1490
|
+
'price': price,
|
|
1491
|
+
'stopPrice': None,
|
|
1492
|
+
'triggerPrice': None,
|
|
1493
|
+
'amount': amount,
|
|
1494
|
+
'cost': None,
|
|
1495
|
+
'average': None,
|
|
1496
|
+
'filled': filled,
|
|
1497
|
+
'remaining': None,
|
|
1498
|
+
'status': status,
|
|
1499
|
+
'fee': None,
|
|
1500
|
+
'trades': rawTrades,
|
|
1501
|
+
}, market)
|
|
1502
|
+
|
|
1503
|
+
def fetch_deposit_address(self, code: str, params={}):
|
|
1504
|
+
"""
|
|
1505
|
+
fetch the deposit address for a currency associated with self account, does not accept params["network"]
|
|
1506
|
+
:see: https://plasma-relay-backend.timex.io/swagger-ui/index.html?urls.primaryName=Relay#/Currency/selectCurrencyBySymbol
|
|
1507
|
+
:param str code: unified currency code
|
|
1508
|
+
:param dict [params]: extra parameters specific to the exchange API endpoint
|
|
1509
|
+
:returns dict: an `address structure <https://docs.ccxt.com/#/?id=address-structure>`
|
|
1510
|
+
"""
|
|
1511
|
+
self.load_markets()
|
|
1512
|
+
currency = self.currency(code)
|
|
1513
|
+
request: dict = {
|
|
1514
|
+
'symbol': currency['code'],
|
|
1515
|
+
}
|
|
1516
|
+
response = self.currenciesGetSSymbol(self.extend(request, params))
|
|
1517
|
+
#
|
|
1518
|
+
# {
|
|
1519
|
+
# id: '1',
|
|
1520
|
+
# currency: {
|
|
1521
|
+
# symbol: 'BTC',
|
|
1522
|
+
# name: 'Bitcoin',
|
|
1523
|
+
# address: '0x8370fbc6ddec1e18b4e41e72ed943e238458487c',
|
|
1524
|
+
# decimals: '8',
|
|
1525
|
+
# tradeDecimals: '20',
|
|
1526
|
+
# fiatSymbol: 'BTC',
|
|
1527
|
+
# depositEnabled: True,
|
|
1528
|
+
# withdrawalEnabled: True,
|
|
1529
|
+
# transferEnabled: True,
|
|
1530
|
+
# active: True
|
|
1531
|
+
# }
|
|
1532
|
+
# }
|
|
1533
|
+
#
|
|
1534
|
+
data = self.safe_dict(response, 'currency', {})
|
|
1535
|
+
return self.parse_deposit_address(data, currency)
|
|
1536
|
+
|
|
1537
|
+
def parse_deposit_address(self, depositAddress, currency: Currency = None):
|
|
1538
|
+
#
|
|
1539
|
+
# {
|
|
1540
|
+
# symbol: 'BTC',
|
|
1541
|
+
# name: 'Bitcoin',
|
|
1542
|
+
# address: '0x8370fbc6ddec1e18b4e41e72ed943e238458487c',
|
|
1543
|
+
# decimals: '8',
|
|
1544
|
+
# tradeDecimals: '20',
|
|
1545
|
+
# fiatSymbol: 'BTC',
|
|
1546
|
+
# depositEnabled: True,
|
|
1547
|
+
# withdrawalEnabled: True,
|
|
1548
|
+
# transferEnabled: True,
|
|
1549
|
+
# active: True
|
|
1550
|
+
# }
|
|
1551
|
+
#
|
|
1552
|
+
currencyId = self.safe_string(depositAddress, 'symbol')
|
|
1553
|
+
return {
|
|
1554
|
+
'info': depositAddress,
|
|
1555
|
+
'currency': self.safe_currency_code(currencyId, currency),
|
|
1556
|
+
'address': self.safe_string(depositAddress, 'address'),
|
|
1557
|
+
'tag': None,
|
|
1558
|
+
'network': None,
|
|
1559
|
+
}
|
|
1560
|
+
|
|
1561
|
+
def sign(self, path, api='public', method='GET', params={}, headers=None, body=None):
|
|
1562
|
+
paramsToExtract = self.extract_params(path)
|
|
1563
|
+
path = self.implode_params(path, params)
|
|
1564
|
+
params = self.omit(params, paramsToExtract)
|
|
1565
|
+
url = self.urls['api']['rest'] + '/' + api + '/' + path
|
|
1566
|
+
if params:
|
|
1567
|
+
url += '?' + self.urlencode_with_array_repeat(params)
|
|
1568
|
+
if api != 'public' and api != 'tradingview':
|
|
1569
|
+
self.check_required_credentials()
|
|
1570
|
+
auth = self.string_to_base64(self.apiKey + ':' + self.secret)
|
|
1571
|
+
secret = 'Basic ' + auth
|
|
1572
|
+
headers = {'authorization': secret}
|
|
1573
|
+
return {'url': url, 'method': method, 'body': body, 'headers': headers}
|
|
1574
|
+
|
|
1575
|
+
def handle_errors(self, statusCode: int, statusText: str, url: str, method: str, responseHeaders: dict, responseBody, response, requestHeaders, requestBody):
|
|
1576
|
+
if response is None:
|
|
1577
|
+
return None
|
|
1578
|
+
if statusCode >= 400:
|
|
1579
|
+
#
|
|
1580
|
+
# {"error":{"timestamp":"05.12.2019T05:25:43.584+0000","status":"BAD_REQUEST","message":"Insufficient ETH balance. Required: 1, actual: 0.","code":4001}}
|
|
1581
|
+
# {"error":{"timestamp":"05.12.2019T04:03:25.419+0000","status":"FORBIDDEN","message":"Access denied","code":4300}}
|
|
1582
|
+
#
|
|
1583
|
+
feedback = self.id + ' ' + responseBody
|
|
1584
|
+
error = self.safe_value(response, 'error')
|
|
1585
|
+
if error is None:
|
|
1586
|
+
error = response
|
|
1587
|
+
code = self.safe_string_2(error, 'code', 'status')
|
|
1588
|
+
message = self.safe_string_2(error, 'message', 'debugMessage')
|
|
1589
|
+
self.throw_broadly_matched_exception(self.exceptions['broad'], message, feedback)
|
|
1590
|
+
self.throw_exactly_matched_exception(self.exceptions['exact'], code, feedback)
|
|
1591
|
+
self.throw_exactly_matched_exception(self.exceptions['exact'], message, feedback)
|
|
1592
|
+
raise ExchangeError(feedback)
|
|
1593
|
+
return None
|