
    E#i                       S SK Jr  S SKJr  S SKrS SKrS SKJrJrJ	r	J
r
JrJrJrJrJrJrJrJrJrJrJrJrJr  S SKJr  S SKJr  S SKJr  S SKJr  S S	KJr  S S
KJr  S SKJ r   S SKJ!r!  S SKJ"r"  S SKJ#r#  S SKJ$r$  S SKJ%r%  S SKJ&r&  S SKJ'r'  S SKJ(r(  S SKJ)r)  S SKJ*r*  S SKJ+r+  S SKJ,r,  S SKJ-r-  S SKJ.r.  S SKJ/r/  S SK0J1r1  S SK0J2r2  S SK3J4r4   " S S\\5      r5g)     )Exchange)ImplicitAPIN)AnyBalancesCurrencyDepositAddressIntMarketNumOrder	OrderBook	OrderSide	OrderTypeStrStringsTickerTickersTradeTransaction)List)ExchangeError)AuthenticationError)PermissionDenied)AccountSuspended)ArgumentsRequired)
BadRequest)	BadSymbol)MarginModeAlreadySet)InsufficientFunds)InvalidOrder)OrderNotFound)OrderImmediatelyFillable)OrderNotFillable)NotSupported)DDoSProtection)RateLimitExceeded)ExchangeNotAvailable)OnMaintenance)InvalidNonce)RequestTimeout)BadResponse)TRUNCATE)	TICK_SIZE)Precisec                     ^  \ rS rSrS\4U 4S jjrS r0 4S\4S jjr0 4S\	\
   4S jjrS0 4S\S	\S\4S
 jjrSDS\S\
S\4S jjrSS0 4S\S\S	\S\	\   4S jjrSDS\S\
S\4S jjrS0 4S\S\4S jjrS r0 4S\S\4S jjrS0 4S\4S jjrSDS\
S\4S jjrSSS0 4S\S\S\S	\S\	\   4
S jjr0 4S\4S jjrSES jr S\!4S jr"SDS\S\
S\#4S  jjr$S! r%S0 4S\S"\&S#\'S$\(S%\)4
S& jjr*S0 4S'\S\!4S( jjr+SSS0 4S\!S\S	\S\	\#   4S) jjr,SSS0 4S\!S\S	\S\	\#   4S* jjr-SSS0 4S\!S\S	\S\	\#   4S+ jjr.S0 4S'\S\!4S, jjr/SSS0 4S\!S\S	\4S- jjr00 4S.\S\14S/ jjr2SSS0 4S.\!S\S	\S\	\3   4S0 jjr4SSS0 4S.\!S\S	\S\	\3   4S1 jjr5SDS2 jr6SDS3\S4\7S\34S5 jjr8S0 4S.\S$\(S6\S7\!S\34
S8 jjr9S9S:0 SS4S; jr:S.\;S<\S=\S>\S?\S@\4SA jr<0 4SB jr=SCr>U =r?$ )F
tokocrypto&   returnc           ,        > U R                  [        [        U ]  5       SSS/SSS0 SS _SS_S	S_S
S_SS_SS_SS _SS _SS_SS_SS _SS_SS_SS_SS_SS_SS _0 SS_SS_SS_SS_SS_SS_SS _SS _S S _S!S_S"S_S#S$_S%S_S&S_S'S_S(S_S)S_E0 S*S_S+S_S,S_S-S_S.S_S/S_S0S_S1S_S2S_S3S_S4S_S5S_S6S _S7S_S8S_S9S$_S:S_E0 S;S_S<S_S=S_S>S_S?S_S@S_SAS_SBS_SCS_SDS_SES_SFS_SGS_SHS_SIS_SJS_SKS_E0 SLS_SMS_SNS_SOS_SPS_SQS_SRS_SSS_STS_SUS_SVS_SWS_SXS_SYS_SZS_S[S_S\S_ESSSSSSS].ES^S_S`SaSbScSdSeSfSgShSiSjSkSlSm.SnSoSpSqSpSr.0SsStSuSv.SwSwSwSxSw/SySz/S{S|/S}S~//S.SwSwSzSwSwSS.SwSS.SwSS.S|S.SSw0SSw0SSw0S.SSwSwSwSwSwSwS.0SwSwSwSwSwSwSwSwS.SwSwSwSwSwS.S.S.SSSU R	                  S5      U R	                  S5      S.0[
        SSSSS}SSSSS.SSSSSSSSS.0 SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_0 SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_E0 SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_E0 SS_GS GS_GSGS_GSGS_GSGS_GSGS	_GS
GS_GSGS_GSGS_GSGS_GSGS_GSGS_GSGS_GSGS_GSGS_GSGS_GSGS_E0 GS GS!_GS"GS#_GS$GS%_GS&GS'_GS(GS)_GS*GS+_GS,GS-_GS.GS/_GS0GS1_GS2GS3_GS4GS5_GS6GS7_GS8GS9_GS:GS;_GS<GS=_GS>GS?_GS@GSA_EGSBGSCGSDGSEGSFGSGGSHGSI.ESS0SS0GSJ.0 GSKS_GSLS_GSMS_GSNS_GSOS_GSPS_GSQS_GSRS_GSSS_GSTS_GSUS_GSVS_GSWS_GSXS_GSYS_GSZS_GS[S_SSSSSSSSSSSSSSSGS\.EGS].0 GS^[        _GS_[        _GS`[        _GSa[        _GSb[        _GSc[        _GSd[        _GSe[        _GSf[        _GSg[        _GSh[        _GSi[        _GSj[        _GSk[        _GSl[        _GSm[        _GSn[        _0 GSo[        _GSp[        _GSq[         _GSr["        _GSs[         _GSt[        _GSu[$        _GSv[$        _GSw[        _GSx[        _GSy[&        _GSz[(        _GS{[        _GS|[&        _GS}[        _GS~[&        _GS[&        _E0 GS[&        _GS[&        _GS[&        _GS[&        _GS[&        _GS[&        _GS[        _GS[&        _GS[&        _GS[$        _GS[&        _GS[&        _GS[&        _GS[&        _GS[&        _GS[&        _GS[&        _E0 GS[&        _GS[*        _GS[        _GS[&        _GS[&        _GS[&        _GS[&        _GS[&        _GS[        _GS[        _GS[,        _GS[,        _GS[        _GS[        _GS[&        _GS[        _GS[        _E0 GS[.        _GS[        _GS[$        _GS[        _GS[        _GS[$        _GS[$        _GS[$        _GS[        _GS[        _GS[        _GS[*        _GS[&        _GS[        _GS[        _GS[        _GS[        _E0 GS[        _GS[&        _GS[        _GS[&        _GS[        _GS[&        _GS[        _GS[        _GS[&        _GS[        _GS[        _GS[        _GS[        _GS[&        _GS[        _GS[&        _GS[        _E0 GS[&        _GS[&        _GS[*        _GS[*        _GS[        _GS[        _GS[        _GS[&        _GS[        _GS[&        _GS[&        _GS[        _GS[        _GS[        _GS[&        _GS[&        _GS[&        _E0 GS[        _GS[        _GS[&        _GS[&        _GS[&        _GS[&        _GS[&        _GS[&        _GS[        _GS[        _GS[        _GS[        _GS[        _GS[*        _GS[*        _GS[&        _GS[&        _E0 GS[        _GS[        _GS[        _GS[        _GS[        _GS[&        _GS[&        _GS[        _GS[        _GS[        _GS[&        _GS[        _GS[        _GS[&        _GS[        _GS[        _GS[&        _E0 GS[&        _GS[        _GS[        _GS[&        _GS[&        _GS[        _GS[        _GS[&        _GS[&        _GS [        _GS[        _GS[&        _GS[        _GS[&        _GS[&        _GS[        _GS[&        _E0 GS[        _GS	[&        _GS
[        _GS[        _GS[&        _GS[&        _GS[&        _GS[        _GS[$        _GS[&        _GS[&        _GS[&        _GS[        _GS[&        _GS[        _GS[        _GS[&        _E0 GS[&        _GS[&        _GS[&        _GS[&        _GS[        _GS[&        _GS[&        _GS [&        _GS![        _GS"[&        _GS#[        _GS$[        _GS%[&        _GS&[&        _GS'[&        _GS([&        _GS)[&        _E[&        [$        [        [&        [&        [&        [&        [        [$        [$        [$        [$        [,        GS*.E[        [$        GS+.GS,.SSSSS SSS SSSSGS-.SSSSSSSGS..S SS{GS/GS/SGS0.SSSSGS1.SS{SSSGS2.SS{GS/GS/SSSGS3.SS{GS/SwGS/SSSGS4.GS5S{0GS6.	S S GS7.S S GS7.GS8.GS9.5      $ (:  Nr0   
TokocryptoIDFv1CORSspotTmarginswapfutureoption	addMarginborrowMargincancelAllOrderscancelOrdercancelOrderscreateDepositAddresscreateMarketBuyOrderWithCostcreateMarketOrderWithCostcreateMarketSellOrderWithCostcreateOrdercreateReduceOnlyOrdercreateStopLimitOrdercreateStopMarketOrdercreateStopOrderfetchAccountsfetchBalancefetchBidsAsksfetchBorrowInterestfetchBorrowRateHistoriesfetchBorrowRateHistoryfetchCanceledOrdersfetchClosedOrderfetchClosedOrdersemulatedfetchCrossBorrowRatefetchCrossBorrowRatesfetchCurrenciesfetchDepositfetchDepositAddressfetchDepositAddressesfetchDepositAddressesByNetworkfetchDepositsfetchDepositsWithdrawalsfetchFundingHistoryfetchFundingRatefetchFundingRateHistoryfetchFundingRatesfetchIndexOHLCVfetchIsolatedBorrowRatefetchIsolatedBorrowRatesfetchL3OrderBookfetchLedgerfetchLeveragefetchLeverageTiersfetchMarketLeverageTiersfetchMarketsfetchMarkOHLCVfetchMyTrades
fetchOHLCVfetchOpenInterestHistoryfetchOpenOrderfetchOpenOrders
fetchOrderfetchOrderBookfetchOrderBooksfetchOrdersfetchOrderTradesfetchPositionfetchPositionsfetchPositionsRiskfetchPremiumIndexOHLCVfetchStatusfetchTickerfetchTickers	fetchTimefetchTradesfetchTradingFeefetchTradingFeesfetchTradingLimitsfetchTransactionFeefetchTransactionFeesfetchTransactionsfetchTransfersfetchWithdrawalfetchWithdrawalsfetchWithdrawalWhitelistreduceMarginrepayCrossMarginrepayIsolatedMarginsetLeverage)	setMarginsetMarginModesetPositionModesignIntransferwithdraw1m3m5m15m30m1h2h4h6h8h12h1d3d1w1M)r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   zdhttps://user-images.githubusercontent.com/1294454/183870484-d3398d0c-f6a1-4cce-91b8-d58792308716.jpgrestzhttps://www.tokocrypto.comzhttps://api.binance.com/api/v3)publicbinanceprivatezhttps://tokocrypto.comz#https://www.tokocrypto.com/apidocs/z+https://www.tokocrypto.com/fees/newschedule)logoapiwwwdocfees   d        i  
   i  2   )costbyLimit(   )r   noSymbol   )pingtimedepthtrades	aggTradeshistoricalTradesklineszticker/24hrzticker/pricezticker/bookTickerexchangeInfouserDataStream)getputpostdeleter   )zopen/v1/common/timezopen/v1/common/symbolszopen/v1/market/depthzopen/v1/market/tradeszopen/v1/market/agg-tradeszopen/v1/market/klines)zopen/v1/orders/detailopen/v1/orderszopen/v1/account/spotzopen/v1/account/spot/assetzopen/v1/orders/tradesopen/v1/withdrawszopen/v1/depositszopen/v1/deposits/address)r   zopen/v1/orders/cancelzopen/v1/orders/ocor   zopen/v1/user-data-stream)r   r   )r   r   r   tradingz0.0075)	tierBased
percentagetakermakerGTCr   FULL)marketlimitETHTRXBNBBSCOMNIEOSSOL)ERC20TRC20BEP2BEP20r   r   SPLztronscan.orgr   zetherscan.ior   zbscscan.comzexplorer.binance.orgr   zbithomp.comXRPzbloks.iozstellar.expertXLMzblockchair.com/bitcoinBTCzblockchair.com/bitcoin-cashBCHzblockchair.com/ecashXECzexplorer.litecoin.netLTCzexplorer.avax.networkAVAXz
solscan.iozpolkadot.subscan.ioDOTzdashboard.internetcomputer.orgICPzexplorer.chiliz.comCHZzcardanoscan.ioADAzmainnet.theoan.comAIONzalgoexplorer.ioALGOzexplorer.ambrosus.comAMBzviewblock.io/zilliqaZILzviewblock.io/arweaveARzexplorer.ark.ioARKzatomscan.comATOMzwww.mintscan.ioCTKzexplorer.bitcoindiamond.orgBCDzbtgexplorer.comBTGzbts.aiBTSzexplorer.celo.orgCELOzexplorer.nervos.orgCKBzcerebro.cortexlabs.aiCTXCzchainz.cryptoid.infoVIAzexplorer.dcrdata.orgDCRzdigiexplorer.infoDGBzdock.subscan.ioDOCKzdogechain.infoDOGEzexplorer.elrond.comEGLDzblockscout.comETCzexplore-fetchhub.fetch.aiFETzfilfox.infoFILzfio.bloks.ioFIOzexplorer.firo.orgFIROz
neoscan.ioNEOzftmscan.comFTMzexplorer.gochain.ioGOzblock.gxb.ioGXSzhash-hash.infoHBARzwww.hiveblockexplorer.comHIVEzexplorer.helium.comHNTztracker.icon.foundationICXzwww.iostabc.comIOSTzexplorer.iota.orgIOTAziotexscan.ioIOTXzirishub.iobscan.ioIRISzkava.mintscan.ioKAVAzscope.klaytn.comKLAYzkmdexplorer.ioKMDzkusama.subscan.ioKSMzexplorer.lto.networkLTOzpolygonscan.comPOLYGONzexplorer.ont.ioONTzminaexplorer.comMINAznanolooker.comNANOzexplorer.nebulas.ioNASzexplorer.nbs.plusNBSzexplorer.nebl.ioNEBLz
nulscan.ioNULSz
nxscan.comNXSzexplorer.harmony.oneONEzexplorer.poa.networkPOAz	qtum.infoQTUMzexplorer.rsk.coRSKzwww.oasisscan.comROSEzravencoin.networkRVNzsc.tokenview.comSCzsecretnodes.comSCRTzexplorer.skycoin.comSKYzsteemscan.comSTEEMzexplorer.stacks.coSTXzwww.thetascan.ioTHETAzscan.tomochain.comTOMOzexplore.vechain.orgVETzexplorer.vite.netVITEzwww.wanscan.orgWANzwavesexplorer.comWAVESWAXPWTCXEMXVGYOYOWZECZEN)zwax.eosx.iozwaltonchain.prozchain.nem.ninjazverge-blockchain.infozexplorer.yoyow.orgzexplorer.zcha.inzexplorer.zensystem.io)r   r   MXNUGXSEKCHFVNDAEDDKKKZTHUFPENPHPUSDTRYEURNGNPLNBRL)ZARKESARSRUBAUDNOKCZKGBPUAHGHSHKDCADINRJPYNZD)!createMarketBuyOrderRequiresPricedefaultTimeInForce#hasAlreadyAuthenticatedSuccessfully"warnOnFetchOpenOrdersWithoutSymbol
recvWindowtimeDifferenceadjustForTimeDifferencenewOrderRespTypequoteOrderQtynetworksreverseNetworksimpliedNetworks
legalMoneyzSystem is under maintenance.zSystem abnormalityz/You are not authorized to execute self request.zAPI key does not existz Order would trigger immediately.z%Stop price would trigger immediately.z'Order would immediately match and take.z6Account has insufficient balance for requested action.z Rest API trading is not enabled.zYou don't have permission.zMarket is closed.z*Too many requests. Please try again later.z(This action disabled is on self account.z-1000z-1001z-1002z-1003z-1004z-1005z-1006z-1007z-1010z-1011z-1013z-1014z-1015z-1016z-1020z-1021z-1022z-1023z-1099z-1100z-1101z-1102z-1103z-1104z-1105z-1106z-1108z-1109z-1110z-1111z-1112z-1113z-1114z-1115z-1116z-1117z-1118z-1119z-1120z-1121z-1125z-1127z-1128z-1130z-1131z-1136z-2008z-2010z-2011z-2013z-2014-2015z-2016z-2018z-2019z-2020z-2021z-2022z-2023z-2024z-2025z-2026z-2027z-2028z-3000z-3001z-3002z-3003z-3004z-3005z-3006z-3007z-3008z-3009z-3010z-3011z-3012z-3013z-3014z-3015z-3016z-3017z-3018z-3019z-3020z-3021z-3022z-3023z-3024z-3025z-3026z-3027z-3028z-3029z-3036z-3037z-3038z-3041z-3042z-3043z-3044z-3045z-3999z-4001z-4002z-4003z-4004z-4005z-4006z-4007z-4008z-4010z-4011z-4012z-4013z-4014z-4015z-4016z-4017z-4018z-4019z-4021z-4022z-4023z-4024z-4025z-4026z-4027z-4028z-4029z-4030z-4031z-4032z-4033z-4034z-4035z-4036z-4037z-4038z-4039z-4040z-4041z-4042z-4043z-4044z-4045z-4046z-4047z-5001z-5002z-5003z-5004z-5005z-5006z-5007z-5008z-5009z-5010z-5011z-5012z-5013z-5021z-6001z-6003z-6004z-6005z-6006z-6007z-6008z-6009z-6011z-6012z-6013z-6014z-6015z-6016z-6017z-6018z-6019z-6020z-7001z-7002z-9000z-10017z-11008z-12014z-13000z-13001z-13002z-13003z-13004)z-13005z-13006z-13007z-21001z-21002z-21003	100001003220232103203321132073218)zhas no operation privilegeMAX_POSITION)exactbroad)IOCFOKPOGTD)
marginModetriggerPricetriggerDirectiontriggerPriceTypestopLossPricetakeProfitPriceattachedStopLossTakeProfittimeInForcehedgedtrailingleveragemarketBuyByCostmarketBuyRequiresPriceselfTradePreventionicebergi )rl  r   daysBack	untilDayssymbolRequired)rl  triggerru  r}  )rl  r   r~  ru  r}  )rl  r   r{  r|  r~  ru  r}  )rl  r   r{  daysBackCanceledr|  r~  ru  r}  r   )	sandboxrF   createOrdersrl   rq   rp   rt   rS   rm   )linearinverse)r8   r:   r;   )idname	countries	certifiedproversionhas
timeframesurlsr   r   precisionModeoptions
exceptionsfeatures)deep_extendsuperr0   describeparse_numberr-   r(   r   r   r   r"   r   r'   r%   r   r&   r+   r*   r    r   r)   r   r!   r#   )self	__class__s    W/home/james-whalen/.local/lib/python3.13/site-packages/ccxt/async_support/tokocrypto.pyr  tokocrypto.describe(   s   j$ @ B \\\ $\ 	\
 %\ %\ T\ \ "5\ t\ \ '\ /\ ,U\ 0\  t!\" (#\$ '%\& ('\( "4)\*  +\, -\.  /\0 &t1\2 +D3\4 )$5\6 &u7\8 #E9\: $Z;\< '=\> (?\@ "5A\B C\D &tE\F (G\H 1%I\J  K\L +EM\N &uO\P #EQ\R *5S\T $UU\V "5W\X *5Y\Z +E[\\ #E]\^ t_\`  a\b %ec\d +Je\f g\h !%i\j  k\l dm\n +Eo\p !%q\r "4s\t du\v !$w\x "5y\z t{\| #E}\~  \@ !%A\B %eC\D )%E\F uG\H uI\J K\L TM\N tO\P "5Q\R #ES\T %eU\V &uW\X 'Y\Z $U[\\ !%]\^ "5_\` #Da\b +Ec\d e\f #Eg\h &ui\j uk\l #!&#(! w\| $ ">#C#? 0<E" !" !*+#qC8dTVZZ^`bYc8d!e"#%&,-"#01r'B12(B67Q-G(* )! )! )!)2 /02301125612
 23*+016712-.,-45	 +,12./-.45I7r !%"&!..x8!..x8	 ' 6:&+7<6:&"#+0$#% "'""!""  ]$"G]$"G]$ "5]$ +F	]$
 "5]$ ]$ %e]$ -e]$ 25]$ +E]$ ,U]$ ,V]$ !%]$ *5]$ 5e]$  *5!]$" %e#]$$ )&%]$& &v']$( ,U)]$* +E+]$, +D-]$. &u/]$0 #F1]$2 &u3]$4 255]$6 &u7]$8 e9]$: (;]$< *5=]$> ,V?]$@ +EA]$B +EC]$D (E]$F &vG]$H %fI]$J *6K]$L %eM]$N 0O]$P "5Q]$R #ES]$T (U]$V !%W]$X "5Y]$Z *4[]$\ #E]]$^ %f_]$` 0a]$b *5c]$d .ue]$f &vg]$h (i]$j #Fk]$l )&m]$n 'o]$p 'q]$r %es]$t (u]$v +Ew]$x &yy]$z &u{]$| '}]$~ %f]$@ *5A]$B (C]$D 'E]$F !&G]$H !%I]$J +EK]$L +EM]$N  O]$P &uQ]$R (S]$T (U]$V 'W]$X &vY]$Z +E[]$\ $W]]$^ )%_]$` 'a]$b )&c]$d *5e]$f (g]$h &ui]$j (k]$l $*',',-2*1(--2y]$~ $U+#U+$!4!4! 4! 4	!
 4! 4! 4! 4! 4! 4! 4! 4! 4! 4! 4!  4!!" 4#!$  A!w]@Z2MZ(-Z FGWZ -.A	Z
 78PZ <=UZ >?WZ MN_Z 78LZ 12BZ ()=Z A.Z ?@PZ 1Z 1Z  0!Z" .#Z$ ^%Z& -'Z( [)Z* ^+Z, [-Z. -/Z0 \1Z2 \3Z4 .5Z6 17Z8 Z9Z: \;Z< 0=Z> Z?Z@ 0AZB ZCZD ZEZF ZGZH ZIZJ ZKZL ZMZN ZOZP ZQZR 0SZT ZUZV ZWZX \YZZ Z[Z\ Z]Z^ Z_Z` ZaZb ZcZd ZeZf ZgZh ZiZj YkZl 0mZn ZoZp ZqZr ZsZt ZuZv ZwZx 0yZz ]{Z| ]}Z~ ]Z@ 0AZB 0CZD ZEZF .GZH .IZJ -KZL 5MZN \OZP .QZR .SZT \UZV \WZX \YZZ .[Z\ ]]Z^ 0_Z` YaZb ZcZd ]eZf .gZh .iZj ]kZl .mZn ZoZp ]qZr ZsZt ]uZv ZwZx -yZz ]{Z| Z}Z~ ]Z@ -AZB -CZD .EZF ZGZH -IZJ ZKZL ]MZN ZOZP ZQZR YSZT YUZV ]WZX -YZZ ][Z\ Z]Z^ ._Z` ZaZb ZcZd ^eZf ]gZh ]iZj ZkZl ZmZn ZoZp 0qZr .sZt ZuZv ZwZx ZyZz Z{Z| Z}Z~ ZZ@ 0AZB -CZD ]EZF -GZH -IZJ YKZL YMZN ZOZP ZQZR ]SZT .UZV .WZX .YZZ ][Z\ Z]Z^ Z_Z` ]aZb ]cZd ]eZf ZgZh ]iZj -kZl ZmZn ]oZp ]qZr ZsZt ZuZv ]wZx ]yZz Z{Z| Z}Z~ ]Z@ 0AZB ZCZD ZEZF .GZH .IZJ ZKZL .MZN ZOZP ZQZR .SZT ZUZV ]WZX ZYZZ ][Z\ .]Z^ Z_Z` ZaZb ZcZd ]eZf \gZh ZiZj ZkZl ZmZn .oZp ZqZr .sZt ]uZv ZwZx ZyZz Z{Z| Z}Z~ ZZ@ 0AZB ZCZD ZEZF ZGZH .IZJ jKZL /MZN /OZP jQZR jSZT jUZV jWZX jYZZ )*1(((!+-(((()sZx 3C$0y`F  %&+(,,1,0).+06:#'#'"&#(	( #($)$)+/26/3#')$, %)&+!%$*%+*.& ',#($)*/	# ',!%#($)*.( ',!%$*%+#($)*.$ ',!%$*,-%+#($)*.	*  #ACJ ##
 ##SMKS
E
 S
 S
	    c                 B    U R                  5       U R                  S   -
  $ )NrU  )millisecondsr  )r  s    r  noncetokocrypto.nonce  s       "T\\2B%CCCr  c                 d   #    U R                  U5      I Sh  vN nU R                  US5      $  N7f)a*  

https://www.tokocrypto.com/apidocs/#check-server-time

fetches the current integer timestamp in milliseconds from the exchange server
:param dict [params]: extra parameters specific to the exchange API endpoint
:returns int: the current integer timestamp in milliseconds from the exchange server
N	timestamp)publicGetOpenV1CommonTimesafe_integer)r  paramsresponses      r  
fetch_timetokocrypto.fetch_time  s5      77??   ;77 @s   0.0c                 6  #    U R                  U5      I Sh  vN nU R                  S   (       a  U R                  5       I Sh  vN   U R                  US0 5      nU R                  US/ 5      n/ n[	        S[        U5      5       GH  nXF   nU R                  US5      nU R                  US5      n	U R                  US5      n
U R                  US5      nU R                  US	5      nU R                  U5      nU R                  U	5      nU R                  U5      nUS
-   U-   nU R                  US/ 5      nU R                  US5      nU R                  US5      nUS:H  nU R                  US/ 5      n[	        S[        U5      5       H  nUU   S:X  d  M  Sn  O   U R                  USS5      n0 SU
_SU_SU_SU_SU_SU_SU_SU	_SU_SS_SS_SU_SS_S S_S!S_S"S_S#U_SSSSSSSSU R                  U R                  U R                  US$5      5      5      U R                  U R                  U R                  US%5      5      5      U R                  U R                  U R                  US&5      5      5      U R                  U R                  U R                  US'5      5      5      S(.SSS).SSS).SSS).SSS).S*.SUS+.EnS,U;   aa  U R                  US,0 5      nU R                  US-5      US.   S/'   U R                  US05      U R                  US15      S).US2   S/'   US-   US.   S/'   S3U;   aV  U R                  US30 5      nU R                  US45      US.   S5'   U R                  US65      U R                  US75      S).US2   S5'   S8U;   a>  U R                  US80 5      nU R                  US65      U R                  US75      S).US2   S9'   S:U;   a/  U R                  US:0 5      nU R                  US;S<5      US2   S=   S>'   UR                  U5        GM     U$  GN GN7f)?a   

https://www.tokocrypto.com/apidocs/#get-all-supported-trading-symbol

retrieves data on all markets for tokocrypto
:param dict [params]: extra parameters specific to the exchange API endpoint
:returns dict[]: an array of objects representing market data
NrV  datalistr   	baseAsset
quoteAssetsymbolmarginAsset/filters
filterTypespotTradingEnable1permissionsTRD_GRP_003FisMarginTradingAllowedr  lowercaseIdbasequotesettlebaseIdquoteIdsettleIdtyper8   Tr9   r:   r;   deliveryr<   activequantityPrecisionpricePrecisionbaseAssetPrecisionquotePrecision)amountpricer  r  )minmax)rv  r  r  r   )contractr  r  contractSizeexpiryexpiryDatetimestrike
optionType	precisionlimitscreatedinfoPRICE_FILTERtickSizer  r  minPricemaxPricer  LOT_SIZEstepSizer  minQtymaxQtyMARKET_LOT_SIZEr   MIN_NOTIONALminNotionalnotionalr   r  )publicGetOpenV1CommonSymbolsr  load_time_difference
safe_valuerangelensafe_stringsafe_string_lowersafe_currency_codeindex_by	safe_boolr  parse_precisionsafe_numbersafe_number_2append)r  r  r  r  r  resultir   r  r  r  r  r  r  r  r  r  r  filtersByTypestatusr  r  jr  entryfilters                             r  fetch_marketstokocrypto.fetch_markets  s     ::6BBJ <<12++---x4tVR0q#d)$AWF%%fk:F&&v|<G!!&(3B00BK''>H**62D++G4E,,X6FCZ%'Foofi<G MM'<@M%%f.ABFmF//&-DK1c+./q>]2"F 0 &*^^F<TV[%\"4b4{4 &4 	4
 4 &4 &4 74 H4 4 4 04 4 %4 E4  %!4" &#4$ " $"&""//0D0DTEUEUV\^qEr0st!..t/C/CDDTDTU[]mDn/op --d.B.B4CSCSTZ\pCq.rs!..t/C/CDDTDTU[]mDn/op	  $#!
  $#
  $#
  $#$  g4Ej .K.2.>.>vz.Rk"7+  ++FJ?++FJ?,h( /5Z.@k"7+]*
BG/3/?/?
/Sk"8,++FH=++FH=-h) !M18I2N++FH=++FH=-h) .K151C1CFM[e1fh'.MM% M %N c CL .s)   PP+PPEPJ PPNr  r   c                   #    U R                  5       I Sh  vN   U R                  U5      n0 nUb  X%S'   SnUS   S:X  a7  US   US   -   US'   U R                  U R                  XS5      5      I Sh  vN nO0US   US'   U R	                  U R                  XS5      5      I Sh  vN nU R                  US	U5      nU R                  US
S5      nU R                  XqU5      n	U R                  US5      U	S'   U	$  N N NW7f)a  

https://www.tokocrypto.com/apidocs/#order-book

fetches information on open orders with bid(buy) and ask(sell) prices, volumes and other data
:param str symbol: unified symbol of the market to fetch the order book for
:param int [limit]: the maximum amount of order book entries to return
:param dict [params]: extra parameters specific to the exchange API endpoint
:returns dict: A dictionary of `order book structures <https://docs.ccxt.com/#/?id=order-book-structure>` indexed by market symbols
Nr   r  USDTr  r  r  r  r  Tr  lastUpdateIdr  )	load_marketsr   binanceGetDepthextendpublicGetOpenV1MarketDepthr  safe_integer_2parse_order_bookr  )
r  r  r   r  r   requestr  r  r  	orderbooks
             r  fetch_order_booktokocrypto.fetch_order_bookq  s     !!!V$$G'?f$ &x 06)3D DGH!11$++g2NOOH &tGH!<<T[[=YZZH< x:''#{C	))$	B	!..t^D	'[ 	" P [s5   C<C6AC<1C820C<"C:#AC<8C<:C<trader   c                 "   U R                  USS5      nU R                  USS5      nU R                  USS5      nU R                  USS5      nU R                  US	5      nU R                  Xr5      nU R                  US
S5      n	U R                  USSU	5      n	S n
U R                  US5      nU R	                  USS5      nS nUb  U(       a  SOSn
SnO-SU;   a  U R                  US5      n
OSU;   a  US   (       a  SOSn
S nSU;   a4  U R                  US5      U R                  U R                  US5      5      S.nSU;   a  US   (       a  SOSnSU;   a  US   (       a  SOSnU R                  UUU R                  U5      UU	US U
UUUUUS.U5      $ )Nr  r   pr  qqtyquoteQtybaseQtyr  tar  tradeIdorderIdmisBuyerMakersellbuyr   sideisBuyer
commissioncommissionAsset)r   currencyisMakerr   )r  r  datetimer  r  orderr  r  takerOrMakerr  r  r   fee)	r  safe_string_2r  safe_symbolsafe_value_2r  r  
safe_tradeiso8601)r  r  r   r  r  r  r   marketIdr  r  r  r  
buyerMakerr  r  s                  r  parse_tradetokocrypto.parse_trade  s   | ''sF;	""5#w7##E36!!%Y?##E84!!(3sC0tY;""5)4&&uc>B
 !'6UD"Lu_))%8DE! %i 0uf5 ((= 33D4D4DUL]4^_C &+I&67GLe&+Gn7'L"Y/( 
  	r  sincec                   #    U R                  5       I Sh  vN   U R                  U5      nSU R                  U5      0nUS   S:w  a_  Ub  X6S'   U R                  U R	                  Xd5      5      nU R                  US0 5      nU R                  US/ 5      n	U R                  XX#5      $ Ub  X6S'   Sn
U R                  U R                  S	U
5      nSnUS
:X  aE  UbB  X&S'   U R                  US5      US'   U R                  U R	                  Xd5      5      I Sh  vN nO(U R                  U R	                  Xd5      5      I Sh  vN nU R                  XX#5      $  GN> NB N7f)a"  

https://www.tokocrypto.com/apidocs/#recent-trades-list
https://www.tokocrypto.com/apidocs/#compressedaggregate-trades-list

get the list of most recent trades for a particular symbol
:param str symbol: unified symbol of the market to fetch trades for
:param int [since]: timestamp in ms of the earliest trade to fetch
:param int [limit]: the maximum amount of trades to fetch
:param dict [params]: extra parameters specific to the exchange API endpoint
:returns Trade[]: a list of `trade structures <https://docs.ccxt.com/#/?id=public-trades>`
Nr  r  r  r   r  r  binanceGetTradesfetchTradesMethodbinanceGetAggTrades	startTimei6 endTime)r  r   get_market_id_by_typepublicGetOpenV1MarketTradesr  	safe_dict	safe_listparse_tradesr  r  sumr(  r&  )r  r  r$  r   r  r   r  responseInnerr  r  defaultMethodmethodr  s                r  fetch_tradestokocrypto.fetch_trades7  sh     !!!V$d008
 '?f$ #(  <<T[[=YZM( >>-<D>>$3D$$T5@@$G*!!$,,0C]S++%2C#(K  "&%!9GI!55dkk'6RSSH!224;;w3OPPHN   5@@m 	"Z TPs4   EEC=EE(E=E>EEEtickerc                 V   U R                  US5      nU R                  US5      nU R                  XB5      nU R                  US5      nSU;   nS nS n	U(       a%  U R                  US5      nU R                  US5      n	O$U R                  US5      nU R                  US5      n	U R                  0 SU_SU_SU R	                  U5      _S	U R                  US
5      _SU R                  US5      _SU R                  US5      _SU R                  US5      _SU R                  US5      _SU R                  US5      _SU R                  US5      _SU R                  US5      _SU_SU_SU R                  US5      _SU R                  US5      _SU R                  US 5      _S!S _UU	US".EU5      $ )#N	closeTimer  	lastPrice
baseVolumevolumequoteVolumer  r  high	highPricelowlowPricebidbidPrice	bidVolumebidQtyaskaskPrice	askVolumeaskQtyvwapweightedAvgPriceopen	openPricecloselastpreviousCloseprevClosePricechangepriceChanger   priceChangePercentaverage)r:  r<  r  )r  r  r  safe_tickerr  )
r  r6  r   r  r   r  rN  isCoinmr:  r<  s
             r  parse_tickertokocrypto.parse_ticker  s:   ^ %%fk:	##FH5!!(346)
))&,?J**68<K))&(;J**6=AK !
f!
!
 Y/!
 D$$V[9	!

 4##FJ7!
 4##FJ7!
 ))&(;!
 4##FJ7!
 ))&(;!
 D$$V-?@!
 D$$V[9!
 T!
 D!
 T--f6FG!
 d&&v}=!
  $**63GH!!
" t#!
$ %&)!
* + 	r  symbolsc                    #    U R                  5       I Sh  vN   U R                  U5      I Sh  vN nU R                  X15      $  N. N7f)a  

https://binance-docs.github.io/apidocs/spot/en/#24hr-ticker-price-change-statistics

fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
:param str[]|None symbols: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
:param dict [params]: extra parameters specific to the exchange API endpoint
:returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
N)r  binanceGetTicker24hrparse_tickersr  rY  r  r  s       r  fetch_tickerstokocrypto.fetch_tickers  sE      !!!226::!!(44 	":   A	AA	AA	A	c                 4    US   S:X  a  US   US   -   $ US   $ )Nr  r  r  r  r   )r  r   s     r  r+   tokocrypto.get_market_id_by_type  s-    '?f$(#fY&777d|r  c                 b  #    U R                  5       I Sh  vN   U R                  U5      nSUS   US   -   0nU R                  U R                  XB5      5      I Sh  vN n[	        U[
        5      (       a$  U R                  US0 5      nU R                  Xc5      $ U R                  XS5      $  N NP7f)a  

https://binance-docs.github.io/apidocs/spot/en/#24hr-ticker-price-change-statistics

fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
:param str symbol: unified symbol of the market to fetch the ticker for
:param dict [params]: extra parameters specific to the exchange API endpoint
:returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
Nr  r  r  r   )r  r   r[  r  
isinstancer  r-  rW  )r  r  r  r   r  r  firstTickers          r  fetch_tickertokocrypto.fetch_ticker  s      !!!V$fX&	)::
 224;;w3OPPh%%..1b9K$$[99  22 	"
 Qs#   B/B+AB/B-AB/-B/c                    #    U R                  5       I Sh  vN   U R                  U5      I Sh  vN nU R                  X15      $  N. N7f)a  

https://binance-docs.github.io/apidocs/spot/en/#symbol-order-book-ticker

fetches the bid and ask price and volume for multiple markets
:param str[]|None symbols: unified symbols of the markets to fetch the bids and asks for, all markets are returned if not assigned
:param dict [params]: extra parameters specific to the exchange API endpoint
:returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
N)r  binanceGetTickerBookTickerr\  r]  s       r  fetch_bids_askstokocrypto.fetch_bids_asks  sE      !!!88@@!!(44 	"@r`  c           	          U R                  US5      U R                  US5      U R                  US5      U R                  US5      U R                  US5      U R                  US5      /$ )Nr   r   r         r   )r  r  )r  ohlcvr   s      r  parse_ohlcvtokocrypto.parse_ohlcv%  so    H eQ'UA&UA&UA&UA&UA&
 	
r  r   	timeframec                   #    U R                  5       I Sh  vN   U R                  U5      nSnSnU R                  US5      n	U R                  US5      n
U R	                  USS/5      nUc  UO
[        XH5      nU R                  U R                  X"5      US.nU	S:X  a	  US   US	'   OU R                  U5      US
'   Ub  X;S'   U
b  XS'   SnUS   S:X  a)  U R                  U R                  X5      5      I Sh  vN nO(U R                  U R                  X5      5      I Sh  vN nU R                  USU5      nU R                  XX#U5      $  GN4 NV N/7f)a  

https://binance-docs.github.io/apidocs/spot/en/#kline-candlestick-data

fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
:param str symbol: unified symbol of the market to fetch OHLCV data for
:param str timeframe: the length of time each candle represents
:param int [since]: timestamp in ms of the earliest candle to fetch
:param int [limit]: the maximum amount of candles to fetch
:param dict [params]: extra parameters specific to the exchange API endpoint
:param str [params.price]: "mark" or "index" for mark price and index price candles
:param int [params.until]: timestamp in ms of the latest candle to fetch
:returns int[][]: A list of candles ordered, open, high, low, close, volume
Nr   i  r  until)intervalr   indexr  pairr  r)  r*  r  r  r  )r  r   r  r  omitr  r  r+  binanceGetKlinesr  publicGetOpenV1MarketKlinesr.  parse_ohlcvs)r  r  rs  r$  r   r  r   defaultLimitmaxLimitr  ru  r  r  r  s                 r  fetch_ohlcvtokocrypto.fetch_ohlcvQ  sc     !!!V$   1!!&'26GW#56!&S5I(()O
 G$TlGFO $ : :6 BGH#(K !&I'?f$!224;;w3OPPH!==dkk'>Z[[H ~~h9  yGGI 	"2 Q[s4   EE
CE6E7(EE +EEEc                 |  #    U R                  5       I Sh  vN   U R                  U R                  SSS5      nU R                  USU5      nU R                  U R                  SS5      nU R	                  USU5      n0 nU R                  U R                  Xa5      5      I Sh  vN nU R                  XsU5      $  N N7f)a  

https://www.tokocrypto.com/apidocs/#account-information-signed

query for balance and get the amount of funds available for trading or funds locked in orders
:param dict [params]: extra parameters specific to the exchange API endpoint
:param str [params.type]: 'future', 'delivery', 'savings', 'funding', or 'spot'
:param str [params.marginMode]: 'cross' or 'isolated', for margin trading, uses self.options.defaultMarginMode if not passed, defaults to None/None/None
:param str[]|None [params.symbols]: unified market symbols, only used in isolated margin mode
:returns dict: a `balance structure <https://docs.ccxt.com/#/?id=balance-structure>`
NrL   defaultTyper8   r  rl  defaultMarginMode)r  r  r  r  r  privateGetOpenV1AccountSpotr  parse_balance_custom)r  r  r  r  r  rl  r  r  s           r  fetch_balancetokocrypto.fetch_balance  s      !!!((~}V\]< ..t||\K^_++FLBST
99$++g:VWW2 ((DD? 	" Xs"   B<B8B
B<!B:"B<:B<c                    U R                  US5      nUUU R                  U5      S.nU R                  US0 5      nU R                  US/ 5      n[        S[	        U5      5       Hh  nXx   n	U R                  U	S5      n
U R                  U
5      nU R                  5       nU R                  U	S5      US'   U R                  U	S5      US	'   XU'   Mj     U R                  U5      $ )
N
updateTime)r  r  r  r  accountAssetsr   assetfreelockedused)	r  r  r  r  r  r  r  accountsafe_balance)r  r  r  rl  r  r  r  balancesr  balance
currencyIdcoder  s                r  r  tokocrypto.parse_balance_custom  s    %%h=	"Y/

 x4??4"=q#h-(AkG))'7;J**:6DllnG"..w?GFO"..wAGFO"4L )   ((r  r  c                 J    SSSSSSSSSSSSSSSS.nU R                  X!U5      $ )NrK  closedcanceled	cancelingrejectedexpired)z-20r  23456NEWPARTIALLY_FILLEDFILLEDCANCELEDPENDING_CANCELREJECTEDEXPIREDr  r  r  statusess      r  parse_order_statustokocrypto.parse_order_status  sK     &")" 
" &99r  r  c                    U R                  U R                  US5      5      nU R                  US5      nU R                  XB5      nU R                  USS5      nU R                  US5      nU R                  US5      nU R	                  USS5      n	U R                  US	5      n
U R                  U/ S
Q5      nU R                  US5      nU R                  U R                  US5      5      nU R                  US5      nUS:X  a  SnOUS:X  a  SnU R                  US/ 5      nU R	                  USS5      nU R                  US5      nUS:X  a  SnUS:H  =(       d    US:H  nU R                  0 SU_SU_SU_SU_SU R                  U5      _SS _SU_SU_SU_SU_SU R                  US5      _SU_SU	_SU R                  U R                  U R                  US 5      5      5      _S!U
_S"U_S#U_US US US$.EU5      $ )%Nr  r  executedQtyr  
createTimeavgPricer  executedPriceorigQty)cummulativeQuoteQtycumQuoteexecutedQuoteQtycumBaser  r  r  r  r  r  fillsclientOrderIdclientIdrs  GTXrj  limit_makerr  r  r  r  lastTradeTimestamppostOnly
reduceOnlyrm  	stopPricer  r   rT  )filled	remainingr  r  r   )r  r  r  r  r  safe_string_nparse_order_typer  r  
safe_orderr  r  	omit_zero)r  r  r   r  r   r  r  r  rT  r  r  r   r  r  r  r  r  rs  r  s                      r  parse_ordertokocrypto.parse_order  s   F (()9)9%)JK##E84!!(3!!%<%%e\:	""5*5""5'?C!!%3 !!%)kleY/$$T%;%;E6%JK%%eV43;DS[Dw3**5/:N&&um<%KM)C{d/B  
E 
" 
 ] 
 	 

 Y/ 
 !$ 
 f 
 D 
 ; 
  
 $//%> 
 D 
 U 
 D--dnnT=M=MeU`=a.bc 
 f 
  D! 
" w# 
$ - 
. / 	r  c                 4    SSSSS.nU R                  X!U5      $ )Nr   r   )r  r  r  7r  r  s      r  r  tokocrypto.parse_order_typeo  s*    	
 &99r  r  r  r  r  c                   #    U R                  5       I Sh  vN   U R                  U5      nU R                  USS5      nU R                  USS5      n	U	(       a  SnU R	                  USS/5      nUR                  5       n
U
nU R                  USS5      nUb%  U R	                  USS/5      nUS	:X  a  S
nOUS:X  a  SnU R                  US   S5      nU R                  X5      (       dM  X:w  a$  [        U R                  S-   U-   S-   U-   S-   5      e[        U R                  S-   U-   S-   U-   S-   5      eSSSSSSSS.nUS   S-   US   -   U R                  X5      S.nUS :X  a  S!US"'   OUS#:X  a  SUS"'   UcK  U R                  U R                  S$5      nUb+  U R                  US%5      nUb  UU R                  5       -   US'   OXS'   SnSnSnUS	:X  a  US :X  a  US&   S'   nSnS(nU R                  US)S*S(5      u  nnU R                  US+S,5      nU R	                  US+S,/5      nUb  UnO^U(       aU  Uc  [        U R                  S--   5      eU R!                  U5      nU R!                  U5      n["        R$                  " UU5      nOUnU R'                  U[(        UU R*                  5      US,'   ORS(nOOUS:X  a  S(nS(nODUS
:X  d  US.:X  a  S(nS(nUS/   (       d
  US0   (       a  S(nOUS:X  d  US1:X  a  S(nS(nS(nO
US:X  a  S(nS(nU(       a  U R-                  X5      US2'   U(       a5  Uc  [        U R                  S3-   U-   S4-   5      eU R/                  X5      US''   U(       a5  Uc  [        U R                  S5-   U-   S4-   5      eU R/                  X5      US'   U R1                  U R3                  X5      5      I Sh  vN nU R5                  US60 5      nU R7                  UU5      $  GN N,7f)7a   
create a trade order

https://www.tokocrypto.com/apidocs/#new-order--signed

:param str symbol: unified symbol of the market to create an order in
:param str type: 'market' or 'limit'
:param str side: 'buy' or 'sell'
:param float amount: how much of currency you want to trade in units of base currency
:param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
:param dict [params]: extra parameters specific to the exchange API endpoint
:param float [params.triggerPrice]: the price at which a trigger order would be triggered
:param float [params.cost]: for spot market buy orders, the quote quantity that can be used alternative for the amount
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
Nr  r  r  FLIMIT_MAKERrm  r  MARKET	STOP_LOSSLIMITSTOP_LOSS_LIMITr  
orderTypesz+ triggerPrice parameter is not allowed for  z ordersz# is not a valid order type for the z marketr   r   rn  ro  r         )r  r  r  r  TAKE_PROFITTAKE_PROFIT_LIMITr  r  _r  )r  r  r  r   r  r  broker
marketTyper  r  TrF   rP  r   rX  a	   createOrder() requires the price argument for market buy orders to calculate the total cost to spend(amount * price), alternatively set the createMarketBuyOrderRequiresPrice option or param to False and pass the cost to spend(quote quantity) in the amount argumentr  r  r  r  quantityz/ createOrder() requires a price argument for a z orderz9 createOrder() requires a triggerPrice extra param for a r  )r  r   r  r  ry  upperr  r  in_arrayr    r  r  r  uuid22handle_option_and_paramsr  number_to_stringr.   
string_muldecimal_to_precisionr,   r  amount_to_precisionprice_to_precisionprivatePostOpenV1Ordersr  r-  r  )r  r  r  r  r  r  r  r   r  r  initialUppercaseTypeuppercaseTyperm  validOrderTypesreverseOrderTypeMappingr  r  brokerIdpriceIsRequiredtriggerPriceIsRequiredquantityIsRequiredr  quoteAmountrP  r   amountStringpriceStringr  rawOrders                                r  create_ordertokocrypto.create_orderx  s      !!!V$**6?JO>>&*e< D6J#@A#zz|,((M#YYv'DEF( +') 1//&.,G}}]<<#4"477-Z#Z]c#cfi#ilp#ps|#|}}"477S=4#7:_#_bh#hkt#tuu !")
 X&,vi/@@$$%<L
 5=GFOV^GFO __T\\8<F!++FLA'*2T[[]*BGJ'"/J!&" H$u}";/8	"481<@<Y<YZ`bo  rU  W[  =\916))&&/J6FO+DE#"&K6}*477  6A  ,A  B  B'+'<'<V'D&*&;&;E&B&-&8&8{&S"(K+/+D+D[RZ\egkgygy+z(%)"g%"O!%{*0N%)"!%h6)#4"&00mGZ6Z!%%)""Om+"O!%"&":":6"JGJ}"477-^#^ae#ehp#pqq#66vEGG!#"477-h#hko#orz#z{{'+'>'>v'T$55dkk'6RSS: >>(FB7&11[ 	"^ Ts"   O$ONO$5O"6*O$"O$r  c                    #    SU0nU R                  U R                  XC5      5      I Sh  vN nU R                  US0 5      nU R                  US/ 5      nU R                  US0 5      nU R	                  U5      $  NN7f)ah  

https://www.tokocrypto.com/apidocs/#query-order-signed

fetches information on an order made by the user
:param str id: order id
:param str symbol: unified symbol of the market the order was made in
:param dict [params]: extra parameters specific to the exchange API endpoint
:returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
r  Nr  r  r   )privateGetOpenV1Ordersr  r  r-  r  )	r  r  r  r  r  r  r  r  r  s	            r  fetch_ordertokocrypto.fetch_order  s      r
 44T[[5QRR> x4tVR0>>$2.))E Ss   (A;A9AA;c                   #    Uc  [        U R                  S-   5      eU R                  5       I Sh  vN   U R                  U5      nSUS   0nUb  X&S'   Ub  X6S'   U R	                  U R                  Xd5      5      I Sh  vN nU R                  US0 5      nU R                  US/ 5      n	U R                  XX#5      $  N N>7f)	a  

https://www.tokocrypto.com/apidocs/#all-orders-signed

fetches information on multiple orders made by the user
:param str symbol: unified market symbol of the market orders were made in
:param int [since]: the earliest time in ms to fetch orders for
:param int [limit]: the maximum number of order structures to retrieve
:param dict [params]: extra parameters specific to the exchange API endpoint
:returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
Nz) fetchOrders() requires a symbol argumentr  r  r)  r   r  r  )	r   r  r  r   r  r  r  r.  parse_orders)
r  r  r$  r   r  r   r  r  r  orderss
             r  fetch_orderstokocrypto.fetch_ordersI  s      >#DGG.Y$YZZ!!!V$fTl	
 #(K $G44T[[5QRRD x4fb1  >>i 	"  Ss"   /C B<AC ?B> =C >C c           	      h   #    SS0nU R                  XX0R                  XT5      5      I Sh  vN $  N7f)a  

https://www.tokocrypto.com/apidocs/#all-orders-signed

fetch all unfilled currently open orders
:param str symbol: unified market symbol
:param int [since]: the earliest time in ms to fetch open orders for
:param int [limit]: the maximum number of  open orders structures to retrieve
:param dict [params]: extra parameters specific to the exchange API endpoint
:returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
r  r   Nr  r  r  r  r$  r   r  r  s         r  fetch_open_orderstokocrypto.fetch_open_orders  2       &&ve[[=YZZZZ   )202c           	      h   #    SS0nU R                  XX0R                  XT5      5      I Sh  vN $  N7f)a  

https://www.tokocrypto.com/apidocs/#all-orders-signed

fetches information on multiple closed orders made by the user
:param str symbol: unified market symbol of the market orders were made in
:param int [since]: the earliest time in ms to fetch orders for
:param int [limit]: the maximum number of order structures to retrieve
:param dict [params]: extra parameters specific to the exchange API endpoint
:returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
r  r   Nr  r  s         r  fetch_closed_orderstokocrypto.fetch_closed_orders  r  r  c                    #    SU0nU R                  U R                  XC5      5      I Sh  vN nU R                  US0 5      nU R                  U5      $  N(7f)aN  

https://www.tokocrypto.com/apidocs/#cancel-order-signed

cancels an open order
:param str id: order id
:param str symbol: unified symbol of the market the order was made in
:param dict [params]: extra parameters specific to the exchange API endpoint
:returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
r  Nr  )privatePostOpenV1OrdersCancelr  r-  r  )r  r  r  r  r  r  r  s          r  cancel_ordertokocrypto.cancel_order  s\      r
 ;;DKK<XYY8 >>(FB7)); Zs   (AA)Ac                   #    Uc  [        U R                  S-   5      eU R                  5       I Sh  vN   U R                  U5      nSUS   0nU R	                  USS5      nUb  X&S'   Ub  XvS'   U R                  USS/5      nUb  X6S'   U R                  U R                  Xd5      5      I Sh  vN nU R                  US	0 5      n	U R                  U	S
/ 5      n
U R                  XX#5      $  N N>7f)a  

https://www.tokocrypto.com/apidocs/#account-trade-list-signed

fetch all trades made by the user
:param str symbol: unified market symbol
:param int [since]: the earliest time in ms to fetch trades for
:param int [limit]: the maximum number of trades structures to retrieve
:param dict [params]: extra parameters specific to the exchange API endpoint
:returns Trade[]: a list of `trade structures <https://docs.ccxt.com/#/?id=trade-structure>`
Nz+ fetchMyTrades() requires a symbol argumentr  r  ru  r*  r)  r   r  r  )r   r  r  r   r  ry  privateGetOpenV1OrdersTradesr  r  r.  r/  )r  r  r$  r   r  r   r  r*  r  r  r   s              r  fetch_my_tradestokocrypto.fetch_my_trades  s     >#DGG.[$[\\!!!V$fTl
 %%fgyA#(K !(IYYv	7';<F$G::4;;w;WXX4 x4fb1  >>S 	" Ys"   /C.C*A;C.-C,.=C.,C.r  c                 \  #    U R                  5       I Sh  vN   U R                  U5      nSUS   0nU R                  U R                  S0 5      nU R	                  US5      nU R                  XVU5      nUb  XdS'   U R                  US5      nU R                  U R                  XB5      5      I Sh  vN nU R                  US0 5      nU R                  US5      n	U R                  USS	5      n
[        U
5      S
:X  a  Sn
U R                  U	5        UUU R                  US5      U	U
S.$  GN Ny7f)aN  
fetch the deposit address for a currency associated with self account

https://www.tokocrypto.com/apidocs/#deposit-address-signed

:param str code: unified currency code
:param dict [params]: extra parameters specific to the exchange API endpoint
:returns dict: an `address structure <https://docs.ccxt.com/#/?id=address-structure>`
Nr  r  rY  networkr  address
addressTag r   )r  r  r  r  tag)r  r  r  r  safe_string_upperr  ry  privateGetOpenV1DepositsAddressr  r  check_address)r  r  r  r  r  rY  r  r  r  r  r  s              r  fetch_deposit_address tokocrypto.fetch_deposit_address  s9     !!!==&Xd^
 ??4<<R@((;""8g>!(IYYvy1F ==dkk'>Z[[  x4""43t\26s8q=C7#''i8
 	
I 	" \s#   D,D'BD,0D*1A7D,*D,c                   #    U R                  5       I Sh  vN   Sn0 nU R                  US5      nUb  U R                  U5      nUS   US'   Ub(  X&S'   U R                  US5      nUb  [	        X5      nXS'   Ub  X6S'   U R                  U R                  Xd5      5      I Sh  vN n	U R                  U	S	0 5      n
U R                  U
S
/ 5      nU R                  XX#5      $  N N>7f)a  

https://www.tokocrypto.com/apidocs/#deposit-history-signed

fetch all deposits made to an account
:param str code: unified currency code
:param int [since]: the earliest time in ms to fetch deposits for
:param int [limit]: the maximum number of deposits structures to retrieve
:param dict [params]: extra parameters specific to the exchange API endpoint
:param int [params.until]: the latest time in ms to fetch deposits for
:returns dict[]: a list of `transaction structures <https://docs.ccxt.com/#/?id=transaction-structure>`
Nru  r  coinr)      X r*  r   r  r  )
r  r  r  r0  r  privateGetOpenV1Depositsr  r  r.  parse_transactions)r  r  r$  r   r  r  r  ru  r*  r  r  depositss               r  fetch_depositstokocrypto.fetch_depositsG  s      !!!!!&'2}}T*H&tnGFO#(K hhuj1G g-!(I$G66t{{77STT0 x4>>$3&&x5HHU 	"  Us"   C#CBC#"C!#=C#!C#c                   #    U R                  5       I Sh  vN   0 nSnUb  U R                  U5      nUS   US'   Ub  X%S'   U R                  US5      US'   Ub  X5S'   U R                  U R	                  XT5      5      I Sh  vN nU R                  US0 5      nU R                  US	/ 5      n	U R                  XX#5      $  N N>7f)
a  

https://www.tokocrypto.com/apidocs/#withdraw-signed

fetch all withdrawals made from an account
:param str code: unified currency code
:param int [since]: the earliest time in ms to fetch withdrawals for
:param int [limit]: the maximum number of withdrawals structures to retrieve
:param dict [params]: extra parameters specific to the exchange API endpoint
:returns dict[]: a list of `transaction structures <https://docs.ccxt.com/#/?id=transaction-structure>`
Nr  r  r)  r  r*  r   r  r  )r  r  r0  privateGetOpenV1Withdrawsr  r  r.  r  )
r  r  r$  r   r  r  r  r  r  withdrawalss
             r  fetch_withdrawalstokocrypto.fetch_withdrawals  s      !!!}}T*H&tnGFO#(K !%%!<GI$G77G8TUU4 x4nnT626&&{eKKQ 	" Vs"   CB>A*CC =C Cc           	      j    SSS.SSSSSSSS.S.nU R                  X20 5      nU R                  XAU5      $ )Npendingok)r  r  r  failed)r  r  r  r  r  r  10)deposit
withdrawal)r  r  )r  r  r  statusesByTyper  s        r   parse_transaction_status_by_type+tokocrypto.parse_transaction_status_by_type  sW     
  
 ??><&99r  transactionr  c                    U R                  US5      nU R                  US5      nUb  [        U5      S:  a  S nU R                  US5      nUb  UR                  S5      S:  a  USS  nU R                  USS	5      nU R	                  Xb5      nS nU R                  US
5      n	U R                  USS5      n
U R                  US5      nUc  U	b  U
c  SnU	nO
U	c  U
b  SnU
nU R                  USS5      nS S S S.nUb  X}S'   XS'   U R                  US5      nSnUb  SnU R                  US5      nUc'  U R                  US0 5      nU R                  US5      nSn0 SU_SU_SU_SU_SU_SU R                  US5      _SU R                  US5      _SU R                  U R                  US5      U5      _SU_S U R                  U5      _SU_S!S _S"U_S#U_S$S _S%U_S&U R                  US'S(5      _S UUS).E$ )*Nr  r  r   txIdzInternal transfer r      r  fiatCurrency
insertTimer  r  r  r,  r-  transactionFeetotalFee)r  r   rater  r   transferTypeFTr  r  
withdrawIdr  txidr  r  r  r  addressFrom	addressTor  tagFromtagToupdatedsuccessTimer  )commentinternalr  )r  r  findr  r  r  r  r  r  r  r/  r  )r  r1  r  r  r  r<  r  r  r  r6  r  r  feeCostr  internalRawrD  r  r  s                     r  parse_transactiontokocrypto.parse_transaction  s   Z "";	:{L9?3x!|V4499-A#Ba#G9D''V^L
&&z<	&&{LA
((lKP
V4<&Z-? &	$:+A#&	$$[2BJO

 "
O!K''^D"Hk40:??;;D!!$5BD
K
"
 D
 D	

 
 t''Y?
 d&&{H=
 d;;D<L<L[Zb<ceij
 
 Y/
 w
 4
 
 3
 t
  S!
" t**;|T#
$  )
 	
r  r  r  c                   #    U R                  XE5      u  pEU R                  5       I Sh  vN   U R                  U5        U R                  U5      nUS   UU R	                  U5      S.nUb  XGS'   U R                  U5      u  pU R                  U5      n
U
b  U
R                  5       US'   U R                  U R                  Xy5      5      I Sh  vN nU R                  X5      $  N N7f)a  

https://www.tokocrypto.com/apidocs/#withdraw-signed

make a withdrawal
:param str code: unified currency code
:param float amount: the amount to withdraw
:param str address: the address to withdraw to
:param str tag:
:param dict [params]: extra parameters specific to the exchange API endpoint
:returns dict: a `transaction structure <https://docs.ccxt.com/#/?id=transaction-structure>`
Nr  )r  r  r  r  r  )handle_withdraw_tag_and_paramsr  r  r  r  handle_network_code_and_paramsnetwork_code_to_idr  privatePostOpenV1Withdrawsr  rH  )r  r  r  r  r  r  r  r  networkCodequery	networkIdr  s               r  r   tokocrypto.withdraw4	  s      99#F!!!7#==&d^ ++F3
 ?$'L!!@@H++K8	 !*!2GI88W9TUU %%h999 	"" Vs"   'C&C"B"C&C$C&$C&r   GETc                    X R                   S   S   ;  a  [        U R                  S-   U-   S-   5      eU R                   S   S   U   nUSU-   -  nUS:X  a  US-  nUS:H  =(       d    US	:H  nU(       aQ  U R                  (       a(  U R                  S
S.nUS:w  a  U R	                  U5      nGO[        U R                  S-   5      eUS:X  d7  US:X  a  US:w  d+  US:X  d%  US:X  a  US:w  d  US:X  d  US:X  d  US:X  d  US:X  Gai  U R                  5         S n	U R                  U R                  S5      n
U R                  SU R                  5       0U5      nU
b  XS'   U R                  US5      nUb  XS'   US:X  a  US:X  a  U R                  U5      n	OYUS:X  d0  UR                  S5      S:  d  US:X  d  UR                  S5      S:  a  U R                  U5      n	OU R	                  U5      n	U R                  U R                  U	5      U R                  U R                   5      ["        R$                  5      nU	SU-   -  n	S U R                  0nUS:X  d  US!:X  d  US:X  a	  US"U	-   -  nO&U	nS
US#'   OU(       a  US"U R	                  U5      -   -  nXsXeS$.$ )%Nr   r   z) does not have a testnet/sandbox URL for z
 endpointsr  wapiz.htmlr   	listenKeyz!application/x-www-form-urlencoded)X-MBX-APIKEYContent-TyperS  z5 userDataStream endpoint requires `apiKey` credentialr   sapizsystem/statussapiV3systemStatusdapiPrivatedapiPrivateV2fapiPrivatefapiPrivateV2rT  r  z
asset/dustbatchOrderszsub-accountr   zcapital/withdraw/applystakingz&signature=rW  DELETE?rX  )urlr3  bodyheaders)r  r$   r  apiKey	urlencoder   check_required_credentialsr  r  r  r  urlencode_with_array_repeatrE  	rawencodehmacencodesecrethashlibsha256)r  pathr   r3  r  rf  re  rd  r   rP  defaultRecvWindowextendedParamsrT  	signatures                 r  signtokocrypto.sign`	  s   yy'//tww)TTWZZ]iijjiiv&s+sTz&=7NC"22L8K{{ %)KK$G U?>>&1D)$''4k*kllYC6Mdo6MSVZbSbhkouhuz~  CQ  {Q  WZ  ^k  Wk  qt  xG  qG  MP  Ta  Ma  gj  n}  g}++-E $ 1 1$,, M![[TZZ\*N !,/@|,**6<@J%/9|,vDL$888H-'TYY}-E-JPTXpPpvzvv  AJ  wK  OP  wP~6~6		$++e"4dkk$++6NPWP^P^_I')33EG %Vx%7SF]sU{"*M'sT^^F333dOOr  reasonrd  r3  rf  re  c
                    US:X  d  US:X  a0  [        U R                  S-   [        U5      -   S-   U-   S-   U-   5      eUS:  a  UR                  S5      S:  a  [	        U R                  S-   U-   5      eUR                  S5      S:  a  [	        U R                  S	-   U-   5      eUR                  S
5      S:  a  [	        U R                  S-   U-   5      eUc  g U R                  USS5      n
U
(       d3  U R                  US5      nS nUb   [        R                  " U5      nUb  UnU R                  US5      nUb^  U R                  U R                  S   XR                  S-   U-   5        U R                  U R                  S   XR                  S-   U-   5        U R                  US5      nUb  US:X  d  [        R                  " US5      (       a  g US:X  a/  U R                  S   (       a  [        U R                  S-   U-   5      eU R                  S-   U-   nUS:X  a  [!        U5      eU R                  U R                  S   UU5        [#        U5      eU
(       d  [#        U R                  S-   U-   5      eg ! [         a  nS n S nAGNhS nAff = f)Ni  i  r  i  zPrice * QTY is zero or lessr   z- order cost = amount * price is zero or less r  z5 order amount should be evenly divisible by lot size r  z order price is invalid, i.e. exceeds allowed price precision, exceeds min price or max price limits or is invalid value in general, use self.price_to_precision(symbol, amount) successTmsgrf  rg  r  200r  r]  rR  zNo need to change margin type.)r%   r  strrE  r    r  r  jsonloads	Exceptionthrow_exactly_matched_exceptionr  throw_broadly_matched_exceptionr.   string_equalsr  r   r   )r  r  rw  rd  r3  rf  re  r  requestHeadersrequestBodyry  messageInnerparsedMessageemessageerrorfeedbacks                    r  handle_errorstokocrypto.handle_errors	  s   CKTS[ 3T!:S!@6!IC!ORV!VWW 3;yy671<"477-\#\_c#cddyy$)"477-d#dgk#kllyy(A-"477  .a  $a  dh  $h  i  i ..9d;++He<L M')$(JJ|$<M !,,H""8U3001I7T[T[^aTadkTkl001I7T[T[^aTadkTkl  62 7#8#8#D#D  dll3X&Y$TWWs]T%9::ww}t+H:: +844001I5RZ[))# 455C ! )$(M)s   	I5 5
J?JJc                    SU;   a  SU;  a  US   $ SU;   a  SU;  a  US   $ SU;   a  SU;  a  US   $ SU;   a?  SU;   a9  US   nUS   n[        S	[        U5      5       H  nXx   n	XiS	   ::  d  M  U	S
   s  $    U R                  USS
5      $ )NnoCoinr  r   r  noPoolIdpoolIdr   r   r   r   r   )r  r  r  )
r  r   r3  rq  r  configr   r   r  r  s
             r  calculate_rate_limiter_cost&tokocrypto.calculate_rate_limiter_cost	  s    6)9(##F"X-?*%%F"X-?*%%6!6(97OEY'G1c'l+
!H$ 8O ,   33r  rb  )N)NN)@__name__
__module____qualname____firstlineno__r   r  r  r	   r  r   r
   r  r|  r   r   dictr   r"  r4  r   rW  r   r   r^  r+  rg  rk  r  rq  r  r   r  r  r   r  r   r  r  r   r   floatr   r  r  r  r   r  r	  r  r   r  r   r   r%  r/  r   rH  r   ru  intr  r  __static_attributes____classcell__)r  s   @r  r0   r0   &   sc   T
# T
lD ') 8S 8( *, ZV Zx @DB 8S 8 8S\ 8tJ Jv J JX <@d[] cA cAS cA cAbfglbm cAJQ4 Q Q6 Qf 6:" 57 5 5
 68 3 3F 3* 8<B 5W 5*
 *
4 *
X ?CQUdhqs 3H 3H 3H3 3H^a 3Hx|  ~B  yC 3Hj *, +E +EZ)&: :(S Sv S Sj: mqy{ ]2 ]2I ]2Y ]2X] ]2fi ]2~ 8<B 0*C 0* 0*d 04$UYbd B? B?C B?s B?imnsit B?H 59tZ^gi [c [ [TW [nrsxny [ 7;\`ik [ [3 [VY [ptuzp{ [ 9=R +*S +*# +*Z 37TX\eg 7?C 7?s 7?RU 7?r =? 4
 4
> 4
l 04$UYbd 7I 7IC 7Is 7Iimnyiz 7Ir 37TX\eg 4LC 4Ls 4LRU 4Llpq|l} 4Ll:&i
T i
X i
Q\ i
V QU]_ *:3 *: *: *:# *:do *:X &eBSW 2Ph9# 9s 9 9c 9TX 9`c 9v MO 4 4r  r0   )6 ccxt.async_support.base.exchanger   ccxt.abstract.tokocryptor   ro  r}  ccxt.base.typesr   r   r   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   typingr   ccxt.base.errorsr   r   r   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   r'   r(   r)   r*   r+   ccxt.base.decimal_to_precisionr,   r-   ccxt.base.preciser.   r0   rb  r  r  <module>r     s    6 0   q  q  q  q  q  * 0 - - . ' & 1 . ) * 5 - ) + . 1 * ) + ( 3 4 %w&4; w&4r  