
    E#iN.                        S SK rS SKJrJrJ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  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
\R4                  R6                  5      rg)    N)
ArrayCacheArrayCacheBySymbolByIdArrayCacheByTimestamp)
AnyBalancesIntOrder	OrderBookStrStringsTickerTickersTrade)Client)List)AuthenticationError)ArgumentsRequired)NotSupportedc                     ^  \ rS rSrS\4U 4S jjr0 4S\S\4S jjrS\	4S jr
S0 4S	\S\4S
 jjrS\	4S jrS>S jrS0 4S	\S\4S jjrS\	4S jrS>S jr0 4S jr0 4S jr0 4S jr0 4S jrSSS0 4S\S\S\S\S\\   4
S jjrS\	4S jrS>S\4S jjrS0 4S\S\S\4S jjrS\	4S jrS r S\	4S jr!S r"S  r#SS0 4S\S\S\S\\$   4S! jjr%S\	4S" jr&SSS0 4S\'S\S\S\\$   4S# jjr(S>S\	4S$ jjr)S>S% jr*SSS0 4S\'S\S\S\\+   4S& jjr,S\	4S' jr-S>S( jr.S>S) jr/S* r0S+ r10 4S\24S, jjr3S\	4S- jr40 4S\S\4S. jjr5S0 4S	\S\4S/ jjr6S0 4S	\S\4S0 jjr7S0 4S\S\S\4S1 jjr80 4S\S\4S2 jjr90 4S\S\4S3 jjr:S\	S4\\   4S5 jr;0 4S6 jr<0 4S7 jr=S\	4S8 jr>S\	4S9 jr?S\	4S: jr@S\	4S; jrAS\	4S< jrBS=rCU =rD$ )?mexc   returnc                 "  > U R                  [        [        U ]  5       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_SSSSSSSSSS.	ESSSSS.00SSSSSSSSS S!S"S#S$.
S%S&S'.S S(.U R                  S)S*.0 S+.5      $ ),NwsTcancelAllOrdersWsFcancelOrdersWscancelOrderWscreateOrderWseditOrderWsfetchBalanceWsfetchOpenOrdersWsfetchOrderWsfetchTradesWswatchBalancewatchMyTrades
watchOHLCVwatchOrderBookwatchOrderswatchTickerwatchTickers)	watchBidsAskswatchTradeswatchTradesForSymbolsunWatchTickerunWatchTickersunWatchBidsAsksunWatchOHLCVunWatchOrderBookunWatchTradesapizwss://wbs-api.mexc.com/wszwss://contract.mexc.com/edge)spotswapO Min1Min5Min15Min30Min60Hour4Hour8Day1Week1Month1)
1m5m15m30m1h4h8h1d1w1M      )snapshotDelaysnapshotMaxRetries)listenKeyRefreshRatedecompressBinary
timeframesr'   	listenKeyi@  )ping	keepAlive)hasurlsoptions	streaming
exceptions)deep_extendsuperr   describerT   )self	__class__s    G/home/james-whalen/.local/lib/python3.13/site-packages/ccxt/pro/mexc.pyr]   mexc.describe   s   dD : <d#U !%  	
   u !% $U       d !$ t  t!" #$ "&#).!%"&#' $$(!%5:  ; > )0$) ! ""!!! !" &(*+# "). 		!A?
 A A	    symbolc                   #    U R                  5       I Sh  vN   U R                  U5      nSUS   -   nUS   (       a"  SUS   -   nU R                  XTU5      I Sh  vN $ SnSUS   0nU R                  XTXb5      I Sh  vN $  Nl N) N7f)a  
watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market

https://mexcdevelop.github.io/apidocs/spot_v3_en/#individual-symbol-book-ticker-streams
https://mexcdevelop.github.io/apidocs/contract_v1_en/#public-channels
https://mexcdevelop.github.io/apidocs/spot_v3_en/#miniticker

:param str symbol: unified symbol of the market to fetch the ticker for
:param dict [params]: extra parameters specific to the exchange API endpoint
:param boolean [params.miniTicker]: set to True for using the miniTicker endpoint
:returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
Nticker:rc   r5   -spot@public.aggre.bookTicker.v3.api.pb@100ms@idz
sub.ticker)load_marketsmarketwatch_spot_publicwatch_swap_public)r^   rc   paramsri   messageHashchannelrequestParamss          r`   watch_tickermexc.watch_tickerW   s      !!!V$&"22&>EtTG//fMMM"G&,#M //m\\\ 	"
 N ]s4   B	BAB	B"B	>B?B	B	B	clientc                    U R                  X5        U R                  U/ SQ5      nU R                  USS5      nU R                  USS5      nU R	                  U5      nUS   nS nUS   (       a*  U R                  X65      nXXS'   U R                  U5      US'   OU R                  X65      nXR                  U'   S	U-   n	UR                  X5        g )
N)ddatapublicAggreBookTickersrc   tsendTimer5   	timestampdatetimere   )
handle_bid_asksafe_dict_nsafe_string_2safe_integer_2safe_marketparse_ws_tickeriso8601parse_tickertickersresolve)
r^   rr   message	rawTickermarketIdrz   ri   rc   tickerrm   s
             r`   handle_tickermexc.handle_tickerq   s    H 	F,$$W.TU	%%gsH=''jA	!!(+!&>)))<F"+;!%i!8F:&&y9F%V&(v+rb   Nsymbolsc                   #    U R                  5       I Sh  vN   U R                  US5      n/ nU R                  US5      nSnUb  U R                  U5      nSnU R	                  SXR5      u  pbUS:H  nU(       a  U R
                  S   S   S   OU R
                  S   S   S   n0 n	U(       a  [        U R                  S-   5      eS	U	S
'   0 U	S'   UR                  S5        U R                  XU R                  X5      U5      I Sh  vN n
U(       a  U R                  (       a  0 nXU
S   '   U$ U R                  U R                  SU5      $  GN3 NG7f)a  
watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list

https://mexcdevelop.github.io/apidocs/spot_v3_en/#individual-symbol-book-ticker-streams
https://mexcdevelop.github.io/apidocs/contract_v1_en/#public-channels
https://mexcdevelop.github.io/apidocs/spot_v3_en/#minitickers

:param str[] symbols: unified symbol of the market to fetch the ticker for
:param dict [params]: extra parameters specific to the exchange API endpoint
:param boolean [params.miniTicker]: set to True for using the miniTicker endpoint
:returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
Nr   r*   r5   r4   r   r6   + watchTickers does not support spot marketszsub.tickersmethodrl   r   rc   )rh   market_symbolssafe_stringri   handle_market_type_and_paramsrW   r   rg   appendwatch_multipleextend
newUpdatesfilter_by_arrayr   )r^   r   rl   messageHashesfirstSymbolri   typeisSpoturlrequestr   results               r`   watch_tickersmexc.watch_tickers   sU     !!!%%gt4&&w2"[[-F99.&Y&.17diit$V,dii>Nt>TU[>\tww)VVWW8 !.GH "GH  ***3t{{7?[]jkkdooF'-6(#$M##DLL(GDDc 	"X ls#   EE	C-EEAEEc                 6   U R                  USS5      nU R                  USS5      nU R                  US5      nU R                  U5      nUR                  S5      nUS L nU(       a  UOUS   n	Sn
U	(       a  U
OSnUS-   n/ n[	        S	[        U5      5       Ho  nX>   nS nU	(       a  U R                  X5      nOU R                  U5      nUS
   nUU R                  U'   UR                  U5        SU-   nUR                  UU5        Mq     UR                  X5        g )Nru   rt   c rw   r5   zspot:r   r   rc   re   )safe_list_2r   r   
startswithrangelenr   r   r   r   r   )r^   rr   r   ru   rn   r   ri   channelStartsWithSpotmarketIdIsUndefinedr   
spotPrefixmessageHashPrefixtopicr   ientryr   rc   rm   s                      r`   handle_tickersmexc.handle_tickers  s%   z 5""7C4##GS1!!(+ ' 2 26 :&$.*=&6&>
*0Jb!H,q#d)$AGEF--e<**51H%F#)DLL MM&!#f,KNN6;/ % 	v%rb   c           	      h   U R                  US5      nU R                  US5      nU R                  US5      nU R                  0 SU_SU R                  X25      _SU_SU R	                  U5      _SS _S	U R                  US
5      _SU R                  US5      _SU_SU_SU R                  USS5      _SU R                  USS5      _SU R                  USS5      _SU R                  USS5      _SS _SS _SS _SU R                  US5      _S U R                  US 5      U R                  US!5      S".EU5      $ )#Nrw   rx   pinforc   rz   r{   openhighhlowlcloselastbidbbidPrice	bidVolumeBbidQuantityaskaaskPrice	askVolumeAaskQuantityvwappreviousClosechange
percentagetrvq)average
baseVolumequoteVolume)r   safe_integersafe_tickersafe_symbolr   safe_numbersafe_number_2)r^   r   ri   r   rz   prices         r`   r   mexc.parse_ws_ticker\  s   B ##FC0%%fc2	  - !
F!
d&&x8!
 !
 Y/	!

 D!
 D$$VS1!
 4##FC0!
 U!
 E!
 4%%fc:>!
 ++FCG!
 4%%fc:>!
 ++FCG!
 D!
 T!
  d!!
" $**648#!
$ **637++FC8)!
* + 	rb   c                 
  #    U R                  5       I Sh  vN   U R                  USSSS5      nSnUc  [        U R                  S-   5      eU R	                  U5      nU R                  SUS   U5      u  p2US:H  nU(       d  [        U R                  S-   5      e/ n/ n[        S[        U5      5       HJ  nU(       a*  U R                  X   5      n	UR                  S	U	S
   -   5        UR                  SX   -   5        ML     U R                  S   S   S   n
SUS.nU R                  XU R                  X5      U5      I Sh  vN nU R                  (       a  0 nXUS   '   U$ U R                  U R                   SU5      $  GNh N@7f)ai  

https://mexcdevelop.github.io/apidocs/spot_v3_en/#individual-symbol-book-ticker-streams

watches best bid & ask for symbols
:param str[] symbols: 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>`
NTF( watchBidsAsks required symbols argumentr+   r   r5   ' watchBidsAsks only support spot marketrf   rg   bidask:r4   r   SUBSCRIPTIONr   rl   rc   )rh   r   r   rg   markets_for_symbolsr   r   r   r   ri   r   rW   r   r   r   r   bidsasks)r^   r   rl   
marketTypemarketsr   r   topicsr   ri   r   r   r   r   s                 r`   watch_bids_asksmexc.watch_bids_asks  s     !!!%%gtT5$G
?#DGG.X$XYY**73!??QXYZQ[]cd
v%tww)RRSSq#g,'AWZ0MPVW[P\\]  WZ!78	 (
 iit$V,$
 **3t{{7?[]jkk??G(.F8$%N##DMM8WEE7 	", ls"   FE>D)F F>FFc                     U R                  U5      nU R                  US5      nUc  g X0R                  U'   SU-   nUR                  X55        g )Nrc   r   )parse_ws_bid_askr   r   r   )r^   rr   r   parsedTickerrc   rm   s         r`   r|   mexc.handle_bid_ask  sP     ,,W5!!,9> ,f&(|1rb   c                    U R                  US5      nU R                  US5      nU R                  XB5      nU R                  US5      nU R                  US5      nU R	                  UUU R                  U5      U R                  US5      U R                  US5      U R                  US5      U R                  US5      US	.U5      $ )
Nrt   rw   rc   rx   r   r   r   r   )rc   rz   r{   r   r   r   r   r   )	safe_dictr   r   r   r   r   r   )r^   r   ri   ru   r   rc   rz   s          r`   r   mexc.parse_ws_bid_ask  s    ~~fc*##FC0!!(3!!&(3%%fc2	"Y/##D#.))$4##D#.))$4	!
 	 		rb   c                    #    U R                  USS5      nU R                  US/5      nU R                  S   S   S   nU(       a  SOSnUU/S.nU R                  XRU R	                  Xs5      U5      I S h  vN $  N7f)	NunsubscribedFr4   r   r5   UNSUBSCRIPTIONr   r   )	safe_boolomitrW   watchr   )r^   rn   rm   rl   r   r   r   r   s           r`   rj   mexc.watch_spot_public  s     ~~fneD6N#34iit$V,&2!i
 ZZ$++g2NP[\\\\s   A2A;4A95A;c                    #    U R                  5         U R                  U5      I S h  vN nU R                  S   S   S   S-   U-   nSU/S.nU R                  XRU R	                  Xc5      U5      I S h  vN $  NO N7f)Nr4   r   r5   ?listenKey=r   r   )check_required_credentialsauthenticaterW   r   r   )r^   rn   rm   rl   rS   r   r   s          r`   watch_spot_privatemexc.watch_spot_private  s     '')++G44	iit$V,}<yH$i
 ZZ$++g2NPWXXX 5 Ys"   %A;A7A
A;2A93A;9A;c                    #    U R                   S   S   S   nUUS.nU R                  Xd5      nU R                  XRXr5      I S h  vN $  N7f)Nr4   r   r6   r   param)rW   r   r   )r^   rn   rm   ro   rl   r   r   r   s           r`   rk   mexc.watch_swap_public  sQ     iit$V,"
 ++g.ZZ'GGGGs   AA
AA
c                   #    U R                  5         SnU R                  S   S   S   n[        U R                  5       5      nU R                  U-   nU R                  U R                  U5      U R                  U R                  5      [        R                  5      nUU R                  UUS.S.nU R                  X5      n	U R                  XAX5      I S h  vN $  N7f)Nloginr4   r   r6   )apiKey	signaturereqTimer   )r   rW   strmillisecondsr   hmacencodesecrethashlibsha256r   r   )
r^   rm   rl   rn   r   rz   payloadr   r   r   s
             r`   watch_swap_privatemexc.watch_swap_private  s     '')iit$V,))+,	++	)IIdkk'2DKK4Lgnn]	++&$
 ++g.ZZ'CCCCs   CCCCrB   	timeframesincelimitc                   #    U R                  5       I Sh  vN   U R                  U5      nUS   nU R                  U R                  S0 5      nU R	                  Xr5      nSU-   S-   U-   n	Sn
US   (       a)  SUS   -   S	-   U-   nU R                  XU5      I Sh  vN n
O$S
nUS   US.nU R                  XX5      I Sh  vN n
U R                  (       a  U
R                  X5      nU R                  XUSS5      $  N Na N>7f)a`  

https://www.mexc.com/api-docs/spot-v3/websocket-market-streams#trade-streams

watches 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
:returns int[][]: A list of candles ordered, open, high, low, close, volume
Nrc   rR   candles::r5   spot@public.kline.v3.api.pb@rg   @z	sub.klinerc   intervalr   T)
rh   ri   
safe_valuerX   r   rj   rk   r   getLimitfilter_by_since_limit)r^   rc   r  r  r  rl   ri   rR   timeframeIdrm   ohlcvrn   ro   s                r`   watch_ohlcvmexc.watch_ohlcv  s     !!!V$!__T\\<D
&&z= 6)C/);&>4vd|CcIKWG00vNNE!G ,'#M 00}]]E??NN61E))%q$GG' 	" O ^s4   C?C9BC?C;$C?>C=?;C?;C?=C?c                    S nS nS nSU;   a  U R                  U R                  US5      5      nU R                  US0 5      nU R                  US5      nU R                  XpR                  S   5      nU R                  X`R                  U5      5      nOU R                  USS0 5      nU R                  USU5      n	U R                  U	SS5      nU R                  U R                  S0 5      n
U R                  Xz5      nU R                  US	S5      nU R                  U5      nUS   nU R                  X5      nS
U-   S-   U-   nU R                  U R                  U0 5      U R                  U'   U R                  U R                  U   U5      nUc9  U R                  U R                  SS5      n[        U5      nXR                  U   U'   UR                  U5        UR                  X5        g )NpublicSpotKlinerc   r  rR   rt   ru   kr   rw   r  r  
OHLCVLimit  )rc   r   r   find_timeframerX   parse_ws_ohlcvr   safe_value_2r  r~   ohlcvsr   r   r   r   )r^   rr   r   parsedrc   r  ru   r  rt   rawOhlcvrR   r   ri   rm   storedr  s                   r`   handle_ohlcvmexc.handle_ohlcv7  s   B 	'[[!1!1'8!DEF>>'+<bAD**4<K++Kl9STI((/?/?/GHF!!'3;Aq#q1H,,XsJGK|RHJ++KDI))'3AH%%h/FH%F((:F 6)C/);"oodkk62FFV!4i@>%%dllL$GE*51F-3KK	*fv+rb   c           
          U R                  USS5      U R                  USS5      U R                  USS5      U R                  USS5      U R                  US	S
5      U R                  USS5      /$ )Nrx   windowStartoopeningPricer   highestPricer   lowestPricer   closingPricer   volume)safe_timestamp_2r   )r^   r  ri   s      r`   r#  mexc.parse_ws_ohlcv  s{    Z !!%m<uc>:uc>:uc=9uc>:uc84
 	
rb   c                   #    U R                  5       I Sh  vN   U R                  U5      nUS   nSU-   nSnUS   (       aP  SnU R                  USSS5      u  psSU-   S	-   US
   -   nU R                  XU5      I Sh  vN nUR                  5       $ SnSUS
   0n	U R	                  XX5      I Sh  vN nUR                  5       $  N NI N7f)a  

https://www.mexc.com/api-docs/spot-v3/websocket-market-streams#trade-streams
https://mexcdevelop.github.io/apidocs/contract_v1_en/#public-channels

watches 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
:param str [params.frequency]: the frequency of the order book updates, default is '10ms', can be '100ms' or '10ms
:returns dict: A dictionary of `order book structures <https://docs.ccxt.com/#/?id=order-book-structure>` indexed by market symbols
Nrc   
orderbook:r5   r'   	frequency100ms"spot@public.aggre.depth.v3.api.pb@r  rg   z	sub.depth)rh   ri   handle_option_and_paramsrj   rk   r  )
r^   rc   r  rl   ri   rm   	orderbookr7  rn   ro   s
             r`   watch_order_bookmexc.watch_order_book  s      !!!V$!"V+	&>I $ = =fFVXcel mI:YFLvVZ|[G"44W6RRI    "G&,#M #44W=aaI  ! 	" S bs4   CCA&C=C>2C0C	1CC	Cc                     U R                  US5      nUR                  S5      nU R                  US5      nU R                  U5      nU R                  0 5      U R                  U'   g )Nmsgr     )r   splitr   
order_book
orderbooks)r^   rr   r   r?  partsr   rc   s          r`   handle_order_book_subscription#mexc.handle_order_book_subscription  s\     w.		###E1-!!(+"&//""5rb   c                    U R                  US5      nU R                  US5      nU R                  U/ SQ5      nX5S-
  :  a  g[        S[	        U5      5       H$  nX&   nU R                  U/ SQ5      nX:  d  M"  Us  $    [	        U5      $ )Nnoncer   rversionfromVersion   )r   r  safe_integer_nr   r   )	r^   r;  cacherH  
firstDeltafirstDeltaNoncer   delta
deltaNonces	            r`   get_cache_indexmexc.get_cache_index  s    !!)W5__UA.
--j:YZQ&&q#e*%AHE,,U4STJ"	 &
 5zrb   c                 h   U R                  U/ SQ5      nU R                  USS5      nU R                  U5      nSU-   nU R                  UR                  U5      nU R                  US5      nXPR                  ;  a  U R                  5       U R                  U'   U R                  U   n	U R                  U	S5      n
SnU
cg  [        U	R                  5      nU R                  SS	S
5      nX:X  a  U R                  U R                  XXX0 5        U	R                  R                  U5        g  U R                  X5        U R                  U/ SQ5      nXS'   U R!                  U5      U	S'   U(       a  g UR'                  X5        g ! ["         a*  nUR                  U	 UR%                  X5        Sn S nANIS nAff = f)N)rt   ru   publicAggreDepthsrw   rc   r6  r  rH  Fr'   rN   rL   )rx   tsry   rz   r{   T)r}   r~   r   r  subscriptionsr   rC  rB  r   rP  handle_optionspawnload_order_bookr   handle_deltarO  r   	Exceptionrejectr   )r^   rr   r   ru   r   rc   rm   subscriptionr  storedOrderBookrH  shouldReturncacheLengthrN   rz   es                   r`   handle_order_bookmexc.handle_order_book  s   F )KL%%gsH=!!(+"V+v';';[I!!,8//)&*oo&7DOOF#//&1!!/7;=o334K ../?RTUM+

4//fUWX!!((.		 o4++G5LMI+4K(*.,,y*AOJ' 4  	 $$[1MM!)L		 s   &=E= =
F1 F,,F1c                    [        S[        U5      5       Hf  nX#   n[        U[        5      (       a  UR	                  U5        M/  U R                  USS5      nU R                  USS5      nUR                  XV5        Mh     g )Nr   r   r   r   quantity)r   r   
isinstancelist
storeArraysafe_float_2store)r^   booksidebidasksr   bidaskr   amounts          r`   handle_bookside_deltamexc.handle_bookside_deltad  so     q#g,'AZF&$''##F+))&#w?**63
Cu- (rb   c                    U R                  US5      nU R                  U/ SQ5      nXC:  a  g XAS'   U R                  US/ 5      nU R                  US/ 5      nUS   nUS   nU R                  Xu5        U R                  X5        g )NrH  rI  asksbids)r   rO  	safe_listrs  )	r^   r;  rS  existingNoncerT  rv  rw  asksOrderSidebidsOrderSides	            r`   r^  mexc.handle_deltat  s    )))W=((0OP
% ''~~eVR0~~eVR0!&)!&)""=7""=7rb   c                   #    U R                  5       I Sh  vN   U R                  U5      nUS   nSU-   nSnUS   (       a#  SUS   -   nU R                  XU5      I Sh  vN nO#SnSUS   0n	U R                  XX5      I Sh  vN nU R                  (       a  UR                  X5      nU R                  XrUSS	5      $  N N` N>7f)
a9  

https://www.mexc.com/api-docs/spot-v3/websocket-market-streams#trade-streams
https://mexcdevelop.github.io/apidocs/contract_v1_en/#public-channels

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 dict[]: a list of `trade structures <https://docs.ccxt.com/#/?id=public-trades>`
Nrc   trades:r5   (spot@public.aggre.deals.v3.api.pb@100ms@rg   zsub.dealrz   T)rh   ri   rj   rk   r   r  r  )
r^   rc   r  r  rl   ri   rm   tradesrn   ro   s
             r`   watch_tradesmexc.watch_trades  s      !!!V$!&(&>@6$<OG11'OOF G&,#M  11'^^F??OOF2E))&TRR! 	" P _s4   CB>ACC  #CC;C CCc                 n   U R                  USS5      nU R                  U5      nUS   nSU-   nU R                  U R                  U5      nUc6  U R	                  U R
                  SS5      n[        U5      nXpR                  U'   U R                  USS/5      n	U R                  U	SS	U	/5      n
U	c  U R                  US
/ 5      n
[        S[        U
5      5       HI  nS nUS   (       a  U R                  X   U5      nOU R                  X   U5      nUR                  U5        MK     UR                  Xv5        g )Nrw   rc   r~  tradesLimitr!  rt   publicAggreDealsdeals	dealsListru   r   r5   )r~   r   r  r  r   rX   r   r}   r   rx  r   r   parse_ws_tradeparse_trader   r   )r^   rr   r   r   ri   rc   rm   r(  r  rt   r  jparsedTrades                r`   handle_tradesmexc.handle_trades  s.   f %%gsH=!!(+!&(f5>%%dllM4HE&F"(KKWs,>&?@!!!WkA3?9^^GVR8Fq#f+&AKf~"11&)VD"..vy&AMM+& ' 	v+rb   c                   #    U R                  5       I Sh  vN   SnSnUb  U R                  U5      nUS   nUS-   U-   nSnU R                  SXd5      u  ptSnUS:X  a  Sn	U R                  XU5      I Sh  vN nOU R	                  XT5      I Sh  vN nU R
                  (       a  UR                  X5      nU R                  XX#S5      $  N NU N=7f)	aR  

https://www.mexc.com/api-docs/spot-v3/websocket-user-data-streams#spot-account-deals
https://mexcdevelop.github.io/apidocs/contract_v1_en/#private-channels

watches information on multiple trades made by the user
:param str symbol: unified market symbol of the market trades were made in
:param int [since]: the earliest time in ms to fetch trades for
:param int [limit]: the maximum number of trade structures to retrieve
:param dict [params]: extra parameters specific to the exchange API endpoint
:returns dict[]: a list of `trade structures <https://docs.ccxt.com/#/?id=trade-structure>`
NmyTradesrc   r  r%   r5   zspot@private.deals.v3.api.pbTrh   ri   r   r   r
  r   r  filter_by_symbol_since_limit)
r^   rc   r  r  rl   rm   ri   r   r  rn   s
             r`   watch_my_tradesmexc.watch_my_trades  s      !!! [[(FH%F%+f4K99/6Z6>4G227PPF22;GGF??OOF2E00tTT# 	" QG4   CC	AC5C6CC:CCCc                    SnU R                  U/ SQ5      nU R                  US5      nU R                  USSU5      nU R                  U5      nUS   n	S n
US   (       a  U R	                  XX5      n
OU R                  XX5      n
U R                  nUc.  U R                  U R                  SS5      n[        U5      nXl        UR                  U
5        UR                  X5        US-   U	-   nUR                  X5        g )	Nr  )rt   ru   privateDealsrc   rw   r5   r  r!  r  )r}   r   r~   r   r  r  r  r   rX   r   r   r   )r^   rr   r   ra  rm   ru   futuresMarketIdr   ri   rc   trader  r  symbolSpecificMessageHashs                 r`   handle_my_trademexc.handle_my_trade  s    F !)FG**4:%%gsHoN!!(+!&>''5E$$T2E>%%dllM4HE+E2F"Mev+$/#$5$>!v9rb   c                 h   U R                  USS5      nU R                  USS5      nUc  U R                  US5      nS nU R                  USS5      nU R                  USS5      nU R                  US	S
5      nUS:X  a  SOSnU R                  US5      n	U R                  USS5      n
U R                  USS5      nU R                  UUU R                  USS5      UU R	                  U5      U R                  S U5      S UU	(       a  SOSUUU R                  US5      U
U R                  U5      S.S.U5      $ )NTtimerx   tradeIdr   r   r   ri  S	tradeType1buysellmn	feeAmountNfeeCurrencyr   orderIdmakertakerrr  )costcurrency)r   rg   orderrz   r{   rc   r   sidetakerOrMakerr   rr  r  fee)r   r~   r   
safe_trader   r   r   safe_currency_code)r^   r  ri   rz   r  priceStringamountStringrawSider  isMakerr  feeCurrencyIds               r`   r  mexc.parse_ws_tradeC  sX   d ''sF;	$$UC;))%5IG((W=))%jA$$UC= Cuf##E3/&&uc;?	**5#}E''sI>"Y/&&tV4(/Gg "$$UH5! 33MB 
" # 	rb   c                   #    U R                  5       I Sh  vN   SnSnUb  U R                  U5      nUS   nUS-   U-   nSnU R                  SXd5      u  ptSnUS:X  a  Sn	U R                  XU5      I Sh  vN nOU R	                  XT5      I Sh  vN nU R
                  (       a  UR                  X5      nU R                  XX#S5      $  N NU N=7f)	a  

https://www.mexc.com/api-docs/spot-v3/websocket-user-data-streams#spot-account-orders
https://mexcdevelop.github.io/apidocs/spot_v3_en/#margin-account-orders

watches 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
:param str|None params['type']: the type of orders to retrieve, can be 'spot' or 'margin'
:returns dict[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
Nordersrc   r  r(   r5   zspot@private.orders.v3.api.pbTr  )
r^   rc   r  r  rl   rm   ri   r   r  rn   s
             r`   watch_ordersmexc.watch_orders  s      !!![[(FH%F%+f4K99-X6>5G227PPF22;GGF??OOF2E00tTT# 	" QGr  c                    SnU R                  U/ SQ5      nU R                  US5      nU R                  USSU5      nU R                  U5      nUS   nS n	US   (       a  U R	                  XG5      n	OU R                  XG5      n	U R                  n
U
c.  U R                  U R                  SS5      n[        U5      n
Xl        U
R                  U	5        UR                  X5        US-   U-   nUR                  X5        g )	Nr  )rt   ru   privateOrdersrc   rw   r5   ordersLimitr!  r  )r}   r   r~   r   parse_ws_orderparse_orderr  r   rX   r   r   r   )r^   rr   r   rm   ru   r  r   ri   rc   r&  r  r  r  s                r`   handle_ordermexc.handle_order  s    R )GH**4:%%gsHoN!!(+!&>((6F%%d3F>%%dllM4HE+E2F Kfv+$/#$5$>!v9rb   c                 
   U R                  US5      nU R                  US5      nU R                  US5      nU R                  US5      nS nU R                  US5      nUb  US S.nU R                  0 SU R                  US5      _SU R                  US	5      _S
U_SU R                  U5      _SS _SU R	                  XR5      _SU R                  S U5      _SU R                  U5      _SU R                  U5      _SUS:X  a  SOS_SU R                  US5      _SS _SS _SU R                  US5      _SU R                  US5      _SU R                  US5      _SU R                  US5      _U R                  US5      US US.EU5      $ ) N
createTimer  status	orderTyper  )r  r  rg   clientOrderIdclientIdrz   r{   lastTradeTimestamprc   r   timeInForcer  r  r  r  r   	stopPricetriggerPricer   avgPricerr  ri  r  filledcumulativeQuantityremainQuantity)	remainingr  r  r   )r   r   
safe_orderr   parse_ws_order_statusr   parse_ws_order_typeparse_ws_time_in_force)	r^   r  ri   rz   r  r  r   r  r  s	            r`   r  mexc.parse_ws_order  s   H %%e\:	{3!!%2{3&&uc2"'C   
$""5$/ 
T--eZ@ 
  
 Y/	 

 !$ 
 d00@ 
 d&&tV4 
 D,,T2 
 466t< 
 dckE 
 T%%eW5 
  
 D 
 t''z: 
 d&&uj9 
  D$$UH5! 
" d&&u.BC# 
$ ))%1AB+ 
, - 	rb   c           
      >    SSSSSSSSSS.	nU R                  X1U5      $ )Nr   closedcanceledrejected)	r  2345NEWCANCELEDEXECUTEDFAILEDr   )r^   r  ri   statusess       r`   r  mexc.parse_ws_order_statusz  s9    "  

 &99rb   c                 6    SSS S SSS.nU R                  X!5      $ )Nr  ri   r  r  r  r  r  100r  )r^   r   typess      r`   r  mexc.parse_ws_order_type  s.    
 ,,rb   c                 6    SSSSSSS.nU R                  X!5      $ )NGTCPOIOCFOKr  r  )r^   r  timeInForceIdss      r`   r  mexc.parse_ws_time_in_force  s.     
 <<rb   c                    #    U R                  5       I Sh  vN   SnU R                  SSU5      u  p!SU-   nUS:X  a  SnU R                  XCU5      I Sh  vN $ U R                  X15      I Sh  vN $  N[ N N7f)aU  

https://www.mexc.com/api-docs/spot-v3/websocket-user-data-streams#spot-account-update

watch 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
:returns dict: a `balance structure <https://docs.ccxt.com/#/?id=balance-structure>`
Nr$   balance:r5   spot@private.account.v3.api.pb)rh   r   r   r
  )r^   rl   r   rm   rn   s        r`   watch_balancemexc.watch_balance  s      !!!99.$PVW 4'6>6G00vNNN00EEE 	" OEs3   A8A2=A8A4A8-A6.A84A86A8c                    U R                  US5      nUS:X  a  SOSnSU-   nU R                  USS/5      nU R                  USS	5      nU R                  US
U5      nX@R                  ;  a  0 U R                  U'   X`R                  U   S'   XR                  U   S'   U R	                  U5      U R                  U   S'   U R                  USS/5      n	U R                  U	5      n
U R                  5       nU R                  USS5      US'   U R                  USS/5      US'   XR                  U   U
'   U R                  U R                  U   5      U R                  U'   UR                  U R                  U   U5        g )Nrn   r  r5   r6   r  ru   privateAccountrY  r  r  r   rz   r{   r  	vcoinNamebalanceAmountavailableBalancefreefrozenBalancefrozenAmountused)r   r}   r   balancer   safe_string_nr  accountr~   safe_balancer   )r^   rr   r   rn   r   rm   ru   futuresTimestamprz   
currencyIdcoder  s               r`   handle_balancemexc.handle_balance  sx   F ""7I6!%EEvF 4'&2B)CD..wlK''f6FG	$!#DLL%)T6"*3T;')-i)@T:&''z;.GH
&&z2,,.,,T?DVW,,TO^3TU#*T4 !..t||D/ABTt||D);7rb   c                   #    U R                  5       I Sh  vN   U R                  U5      nSUS   -   nSnSnUS   (       a5  SUS   -   nU R                  S   S   S   nS	US
'   U R                  XdU5        O0SnSUS   0nU R                  S   S   S   nU R	                  XdXr5        U R                  U5      nU R                  X/5        g N7f)aw  
unWatches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
: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>`
Nunsubscribe:ticker:rc   r5   rf   rg   r4   r   Tr   zunsub.tickerr6   rh   ri   rW   rj   rk   rr   handle_unsubscriptions	r^   rc   rl   ri   rm   r   rn   ro   rr   s	            r`   un_watch_tickermexc.un_watch_ticker  s      !!!V$+fX.>>&>EtTG))E"4(0C%)F>"""7@$G&,#M ))E"4(0C""7OS!##FM:' 	"   CCB5Cc                 R  #    U R                  5       I Sh  vN   U R                  US5      n/ nU R                  US5      nSnUb  U R                  U5      nSnU R	                  SXR5      u  pbUS:H  nU(       a  U R
                  S   S   S   OU R
                  S   S   S   n0 n	U(       a  [        U R                  S-   5      eS	U	S
'   0 U	S'   UR                  S5        U R                  U5      n
U R                  XU R                  X5      U5        U R                  X5        g GN7f)az  
unWatches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
:param str[] symbols: 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*   r5   r4   r   r6   r   zunsub.tickersr   rl   zunsubscribe:ticker)rh   r   r   ri   r   rW   r   rg   r   rr   r   r   r  )r^   r   rl   r   r   ri   r   r   r   r   rr   s              r`   un_watch_tickersmexc.un_watch_tickers  s/     !!!%%gt4&&w2"[[-F99.&Y&.17diit$V,dii>Nt>TU[>\tww)VVWW8 !0GH "GH  !56S!CG0Lm\##F:_ 	"s   D'D$DD'c                   #    U R                  5       I Sh  vN   U R                  USSSS5      nSnUc  [        U R                  S-   5      eU R	                  U5      nU R                  SUS   U5      u  p2US:H  nU(       d  [        U R                  S-   5      e/ n/ n[        S[        U5      5       HJ  nU(       a*  U R                  X   5      n	UR                  S	U	S
   -   5        UR                  SX   -   5        ML     U R                  S   S   S   n
SUS.nU R                  U
5      nU R                  XU R                  X5      U5        U R                  X5        g GNJ7f)a  
unWatches best bid & ask for symbols
:param str[] symbols: 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>`
NTFr   r+   r   r5   r   rf   rg   unsubscribe:bidask:r4   r   r   r   )rh   r   r   rg   r   r   r   r   r   ri   r   rW   rr   r   r   r  )r^   r   rl   r   r   r   r   r   r   ri   r   r   rr   s                r`   un_watch_bids_asksmexc.un_watch_bids_asks<  sj     !!!%%gtT5$G
?#DGG.X$XYY**73!??QXYZQ[]cd
v%tww)RRSSq#g,'AWZ0MPVW[P\\]  !6!CD	 (
 iit$V,&
 S!CG0Lm\##F:3 	"s   E#E E
E#c                   #    U R                  5       I Sh  vN   U R                  U5      nUS   nU R                  U R                  S0 5      nU R	                  XR5      nSU-   S-   U-   nSnUS   (       a;  U R
                  S   S   S   nS	US
   -   S-   U-   n	SUS'   U R                  XU5        O1U R
                  S   S   S   nSn	US
   US.n
U R                  XX5        U R                  U5      nU R                  X/5        g N7f)a  
unWatches 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 dict [params]: extra parameters specific to the exchange API endpoint
:param dict [params.timezone]: if provided, kline intervals are interpreted in that timezone instead of UTC, example '+08:00'
:returns int[][]: A list of candles ordered, open, high, low, close, volume
Nrc   rR   zunsubscribe:candles:r  r5   r4   r   r  rg   r  Tr   r6   zunsub.kliner  )
rh   ri   r  rX   r   rW   rj   rk   rr   r  )r^   rc   r  rl   ri   rR   r  rm   r   rn   ro   rr   s               r`   un_watch_ohlcvmexc.un_watch_ohlcv^  s'     !!!V$!__T\\<D
&&z=,v5;iG&>))E"4(0C4vd|CcIKWG%)F>"""7@))E"4(0C#G ,'#M ""7OS!##FM:- 	"s   DDC0Dc                   #    U R                  5       I Sh  vN   U R                  U5      nUS   nSU-   nSnUS   (       aS  U R                  S   S   S   nSnU R                  USSS	5      u  pbS
U-   S-   US   -   nSUS'   U R	                  XtU5        O0U R                  S   S   S   nSnSUS   0nU R                  XtX5        U R                  U5      n	U R                  X/5        g N7f)a  
unWatches information on open orders with bid(buy) and ask(sell) prices, volumes and other data
:param str symbol: unified array of symbols
:param dict [params]: extra parameters specific to the exchange API endpoint
:param str [params.frequency]: the frequency of the order book updates, default is '10ms', can be '100ms' or '10ms
:returns dict: A dictionary of `order book structures <https://docs.ccxt.com/#/?id=order-book-structure>` indexed by market symbols
Nrc   unsubscribe:orderbook:r5   r4   r   r'   r7  r8  r9  r  rg   Tr   r6   zunsub.depth)rh   ri   rW   r:  rj   rk   rr   r  )
r^   rc   rl   ri   rm   r   r7  rn   ro   rr   s
             r`   un_watch_order_bookmexc.un_watch_order_book  s     !!!V$!.7&>))E"4(0CI $ = =fFVXcel mI:YFLvVZ|[G%)F>"""7@))E"4(0C#G&,#M ""7OS!##FM:+ 	"s   C+C)CC+c                   #    U R                  5       I Sh  vN   U R                  U5      nUS   nSU-   nSnUS   (       a5  U R                  S   S   S   nSUS   -   nS	US
'   U R                  XdU5        O0U R                  S   S   S   nSnSUS   0nU R	                  XdXr5        U R                  U5      nU R                  X/5        g N7f)au  
unsubscribes from the trades channel
:param str symbol: unified symbol of the market to fetch trades for
:param dict [params]: extra parameters specific to the exchange API endpoint
:param str [params.name]: the name of the method to call, 'trade' or 'aggTrade', default is 'trade'
:returns dict[]: a list of `trade structures <https://docs.ccxt.com/#/?id=public-trades>`
Nrc   unsubscribe:trades:r5   r4   r   r  rg   Tr   r6   z
unsub.dealr  r  s	            r`   un_watch_tradesmexc.un_watch_trades  s      !!!V$!+f4&>))E"4(0C@6$<OG%)F>"""7@))E"4(0C"G&,#M ""7OS!##FM:' 	"r  r   c                    [        S[        U5      5       GH4  nX#   nUR                  SS5      nU R                  XU5        UR	                  S5      S:  a  UR                  SS5      nUR	                  S5      S:  aP  [        U R                  R                  5       5      n[        S[        U5      5       H  nU R                  Xx   	 M     M  X`R                  ;   a  U R                  U	 M  M  UR	                  S5      S:  a4  UR                  SS5      nX`R                  ;   a  U R                  U	 GM  GM!  UR	                  S	5      S:  al  UR                  S
5      n	U R                  U	S5      n[        U	5      S:  a  US
U R                  U	S5      -   -  nX`R                  ;   a  U R                  U	 GM  GM  UR	                  S5      S:  a4  UR                  SS5      nX`R                  ;   a  U R                  U	 GM  GM  UR	                  S5      S:  d  GM  UR                  SS5      nX`R                  ;   d  GM'  U R                  U	 GM7     g )Nr   zunsubscribe:r   r   r  unsubscriberq  r  candlesr  r@     rM   r;  r  r  r#  )r   r   replaceclean_unsubscriptionfindrk  r   keysr   rA  r   r%  rC  r  )
r^   rr   r   r   rm   subMessageHashrc   r   r  splitHashess
             r`   r  mexc.handle_unsubscriptions  s   q#m,-A'*K(00DN%%fkJ)Q.$,,-BBG;;}-2"4<<#4#4#67G"1c'l3 LL4 4||+V, ,!!(+q0$,,-BBG]]*f- +!!),1)//4))+q9{#a'cD$4$4[!$DDDF[[(F+ )!!+.!3$,,-ErJ__,/ -!!(+q0$,,-BBG[[(F+? .rb   c                 8  #    U R                  U R                  S5      nUb  U$ U R                  U5      I S h  vN nU R                  US5      nX0R                  S'   U R                  U R                  SS5      nU R	                  XPR
                  X25        U$  N_7f)NrS   rP   r7   )r   rX   spotPrivatePostUserDataStreamr   delaykeep_alive_listen_key)r^   subscriptionHashrl   rS   responserP   s         r`   r   mexc.authenticate  s     $$T\\;?	 ;;FCC $$X{;	$-[!#00?UW^_

')C)CYW Ds   6BBA Bc                   #    Uc  g SU0n U R                  U R                  X25      5      I S h  vN   U R                  U R                  SS5      nU R	                  X@R
                  X5        g  N>! [         ac  nU R                  S   S   S   S-   U-   nU R                  U5      nS U R                  S'   UR                  U5        U R                  U	  S nAg S nAff = f7f)NrS   rP   r7   r4   r   r5   r   )spotPrivatePutUserDataStreamr   r   rX   r3  r4  r_  rW   rr   r`  clients)r^   rS   rl   r   rP   errorr   rr   s           r`   r4  mexc.keep_alive_listen_key  s     
		"33DKK4PQQQ#'#4#4T\\CY[b#c JJ+-G-G[ R  	"))E"4(0=@9LC[[%F(,DLL%MM% S!	"s?   	C #A0 A.=A0 -C .A0 0
C:ACC CC c                 0    U R                  5       Ul        U$ N)r  lastPong)r^   rr   r   s      r`   handle_pongmexc.handle_pong  s    ++-rb   c                 8   U R                  USS5      nUS:X  a  U R                  X5        g UR                  S5      S:  aZ  UR                  S5      nU R                  US5      nU R                  U R                  S.nU R                  Xe5      nUb	  U" X5        g g g )Nr?  r   PONGr  rN  rM  )public.increase.depth.v3.apipublic.aggre.depth.v3.api.pb)r   r@  r,  rA  rE  r  )r^   rr   r   r?  rD  rn   methodsr   s           r`   handle_subscription_statusmexc.handle_subscription_status  s     wr2&=V-XXc]RIIcNE&&ua0G040S0S040S0SG __W6F!v' "  rb   c                    U R                  US5      nUR                  S5      nU R                  US5      nUS:X  a  U R                  X5        gUS:X  a  U R                  X5        gUS:X  a  U R	                  X5        gUS:X  a  U R                  X5        gUS:X  a  U R                  X5        gUS	:X  a  U R                  X5        gUS
:X  a  U R                  X5        g)Nrn   r  rM  zpublic.kline.v3.api.pbzpublic.aggre.deals.v3.api.pbz!public.aggre.bookTicker.v3.api.pbrE  zprivate.account.v3.api.pbzprivate.deals.v3.api.pbzprivate.orders.v3.api.pbT)	r   rA  r)  r  r   rf  r
  r  r  )r^   rr   r   rn   channelParts	channelIds         r`   handle_protobuf_messagemexc.handle_protobuf_message  s   & ""7I6}}S)$$\15	00f.  88v/  ==v/  88""63  550
 	 33  1  44f.rb   c                    [        U[        5      (       a0  US:X  a*  [        U R                  S-   5      nUR	                  U5        g U R                  U5      (       a#  U R                  U5      nU R                  X5        g SU;   a  U R                  X5        g U R                  US5      nS nUc  U R                  US5      nO#UR                  S5      nU R                  US5      n0 SU R                  _S	U R                  _S
U R                  _SU R                  _SU R                  _SU R                  _SU R                  _SU R                  _SU R                  _SU R                  _SU R                  _SU R                   _SU R                   _SU R"                  _SU R"                  _SU R$                  _SU R$                  _SU R&                  0EnXW;   a  Xu   nU" X5        g g )NzInvalid listen keyz invalid listen keyr?  r   rn   r  rM  zpublic.deals.v3.apiz	push.dealzpublic.kline.v3.apiz
push.klinezpublic.bookTicker.v3.apizpublic.miniTicker.v3.apizpublic.miniTickers.v3.apizpush.tickerzpush.tickersrD  z
push.depthzprivate.orders.v3.apizpush.personal.orderzprivate.account.v3.apizpush.personal.assetzprivate.deals.v3.apizpush.personal.order.dealpong)rj  r  r   rg   r`  is_binary_messagedecode_proto_msgrL  rG  r   rA  r  r)  r   r   rf  r  r
  r  r@  )	r^   rr   r   r;  r   rn   rD  rF  r   s	            r`   handle_messagemexc.handle_message?  s7   gs##..+DGG6K,KLe$!!'**++G4G((9G++F<Wc*9&&w	:GGGCLE&&ua0G
!4#5#5
++
 "4#4#4
 $++	

 '(:(:
 '(:(:
 ()<)<
 4--
 D//
 +D,B,B
 $00
 $T%6%6
 "4#4#4
 %d&9&9
 "4#6#6
  #D$8$8!
" '(<(<#
$ D$$%
( %F6# rb   c                 
    SS0$ )Nr   rT    )r^   rr   s     r`   rT   	mexc.pingk  s    &!!rb   )r  r  r>  )E__name__
__module____qualname____firstlineno__r   r]   r  r   rp   r   r   r   r   r   r   r   r   r|   r   rj   r   rk   r
  r   r   rk  r  r)  r#  r
   r<  rE  rU  rf  rs  r^  r   r  r  r   r  r  r  r	   r  r  r  r  r  r  r   r  r
  r  r  r  r  r   r$  r  r   r4  r@  rG  rL  rR  rT   __static_attributes____classcell__)r_   s   @r`   r   r      s   B# BH 68 ] ]F ]4S,F S,j 6:" >E7 >E >E@T&V T&l9v 8<B %FW %F7 %FN2V 2," DF 	] EG Y SU H <> D$ ?CQUdhqs  H  H  H3  H^a  Hx|  ~B  yC  HD\,6 \,|3
D 3
j @DB !S ! !S\ !>6V 6a5 a5F. 8 <@d[] S SS S Sbfglbm S>G,F G,R 37TX\eg UC Us URU Ulpqvlw U@6:f 6:pOb 04$UYbd U UC Us Uimnsit UB\:6 \:|eN:	-	= *, F F&58V 58n 9; C s 8 9=R 6g 6C 6p ;?r    c  D BFb 3 3 UX B =?  3 > 9; C s : ,V  ,DI  ,D ;= " =? ""& ( (,$f $L*$V *$X"6 " "rb   r   )ccxt.async_supportccxt ccxt.async_support.base.ws.cacher   r   r   r  ccxt.base.typesr   r   r   r	   r
   r   r   r   r   r   !ccxt.async_support.base.ws.clientr   typingr   ccxt.base.errorsr   r   r   async_supportr   rU  rb   r`   <module>re     sE     f f  f f f 4  0 . )["4"" ["rb   