
    ei;                        d dl Zd dlmZmZmZ d dlZd dlmZm	Z	m
Z
mZmZmZmZmZmZmZmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ  G d	 d
ej        j                  ZdS )    N)
ArrayCacheArrayCacheBySymbolByIdArrayCacheByTimestamp)AnyBalancesIntOrder	OrderBookStrStringsTickerTickersFundingRateTrade)Client)List)AuthenticationError)ArgumentsRequired)NotSupportedc                   `    e Zd Zdef fdZi fdedefdZdefdZ	di fde
defd	Zdefd
Zd?dZdi fde
defdZdefdZd?dZi fdZi fdZi fdZi fdZdddi fdededededee         f
dZdefdZd?defdZdi fdededefdZdefdZd ZdefdZ d Z!d Z"ddi fdedededee#         fd Z$defd!Z%dddi fde&dededee#         fd"Z'd?defd#Z(d?d$Z)dddi fde&dededee*         fd%Z+defd&Z,d?d'Z-d?d(Z.d) Z/d* Z0i fde1fd+Z2defd,Z3i fdede4fd-Z5i fdedefd.Z6defd/Z7i fdedefd0Z8di fde
defd1Z9di fde
defd2Z:di fdededefd3Z;i fdedefd4Z<i fdedefd5Z=ded6ee         fd7Z>i fd8Z?i fd9Z@defd:ZAdefd;ZBdefd<ZCdefd=ZDdefd>ZE xZFS )@mexcreturnc                 N   |                      t          t          |                                           i ddddddddddddd	dd
ddddddddddddddddddddddddddddddddddddiiddddddddd d!d"d#d$
d%d&d'd d(| j        d)d*i d+          S ),NwsTcancelAllOrdersWsFcancelOrdersWscancelOrderWscreateOrderWseditOrderWsfetchBalanceWsfetchOpenOrdersWsfetchOrderWsfetchTradesWswatchBalancewatchFundingRatewatchFundingRates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   describerV   )self	__class__s    K/var/www/html/volatility/venv/lib/python3.11/site-packages/ccxt/pro/mexc.pyr_   zmexc.describe   s   dD 1 1 : : < <d#U !%  	
   u !% $U     #D $U   d  !$!" t#$  $ $!%#).!%"&#' $$(!%9  >  ; >  )0$) ! ""!!! !"  &(*+# # ") . 	! CC?
 C?
 C C C	    symbolc                 .  K   |                                   d{V  |                     |          }d|d         z   }|d         r(d|d         z   }|                     |||           d{V S d}d|d         i}|                     ||||           d{V S )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:rd   r7   -spot@public.aggre.bookTicker.v3.api.pb@100ms@idz
sub.ticker)load_marketsmarketwatch_spot_publicwatch_swap_publicr`   rd   paramsrj   messageHashchannelrequestParamss          rb   watch_tickerzmexc.watch_tickerY   s       !!!!!!!!!V$$&"22&> 	]EtTG//fMMMMMMMMM"G&,#M //mU[\\\\\\\\\rc   clientc                    |                      ||           |                     |g d          }|                     |dd          }|                     |dd          }|                     |          }|d         }d }|d         r4|                     ||          }||d<   |                     |          |d<   n|                     ||          }|| j        |<   d	|z   }	|	                    ||	           d S )
N)ddatapublicAggreBookTickersrd   tsendTimer7   	timestampdatetimerf   )
handle_bid_asksafe_dict_nsafe_string_2safe_integer_2safe_marketparse_ws_tickeriso8601parse_tickertickersresolve)
r`   rs   message	rawTickermarketIdr{   rj   rd   tickerro   s
             rb   handle_tickerzmexc.handle_tickers   s   H 	FG,,,$$W.T.T.TUU	%%gsH==''jAA	!!(++!&> 	:)))V<<F"+F;!%i!8!8F:&&y&99F%V&(v{+++++rc   Nsymbolsc                   K   |                                   d{V  |                     |d          }g }|                     |d          }d}||                     |          }d}|                     d||          \  }}|dk    }|r| j        d         d         d         n| j        d         d         d         }i }	|rt          | j        dz             d	|	d
<   i |	d<   |                    d           | 	                    ||| 
                    |	|          |           d{V }
|r| j        ri }|
||
d         <   |S |                     | j        d|          S )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,   r7   r6   r   r8   + watchTickers does not support spot marketszsub.tickersmethodrn   r   rd   )ri   market_symbolssafe_stringrj   handle_market_type_and_paramsrY   r   rh   appendwatch_multipleextend
newUpdatesfilter_by_arrayr   )r`   r   rn   messageHashesfirstSymbolrj   typeisSpoturlrequestr   results               rb   watch_tickerszmexc.watch_tickers   s      !!!!!!!!!%%gt44&&w22"[[--F99.&RXYYf&.17\dit$V,,di>Nt>TU[>\ 	+tw)VVWWW8 !.GH "GH  *****3t{{7TZ?[?[]jkkkkkkkk 	do 	F'-F6(#$M##DL(GDDDrc   c                    |                      |dd          }|                     |dd          }|                     |d          }|                     |          }|                    d          }|d u }|r|n|d         }	d}
|	r|
nd}|dz   }g }t	          d	t          |                    D ]|}||         }d }|	r|                     ||          }n|                     |          }|d
         }|| j        |<   |	                    |           d|z   }|
                    ||           }|
                    ||           d S )Nrv   ru   c rx   r7   zspot:r   r   rd   rf   )safe_list_2r   r   
startswithrangelenr   r   r   r   r   )r`   rs   r   rv   rp   r   rj   channelStartsWithSpotmarketIdIsUndefinedr   
spotPrefixmessageHashPrefixtopicr   ientryr   rd   ro   s                      rb   handle_tickerszmexc.handle_tickers  ss   z 55""7C44##GS11!!(++ ' 2 26 : :&$.*=Q&&6&>
*08JJb!H,q#d))$$ 	0 	0AGEF 2--eV<<**511H%F#)DL MM&!!!#f,KNN6;////vu%%%%%rc   c           	         |                      |d          }|                     |d          }|                      |d          }|                     i d|d|                     ||          d|d|                     |          dd d	|                     |d
          d|                     |d          d|d|d|                     |dd          d|                     |dd          d|                     |dd          d|                     |dd          dd dd dd d|                     |d          d |                     |d           |                     |d!          d"|          S )#Nrx   ry   pinford   r{   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   rj   r   r{   prices         rb   r   zmexc.parse_ws_ticker^  s   B ##FC00%%fc22	  -- !
F!
d&&x88!
 !
 Y//	!

 D!
 D$$VS11!
 4##FC00!
 U!
 E!
 4%%fc:>>!
 ++FCGG!
 4%%fc:>>!
 ++FCGG!
 D!
 T!
  d!!
" $**6488#!
$ **6377++FC88)!
 !
 !
* +  	rc   c                 H  K   |                                   d{V  |                     |dddd          }d}|t          | j        dz             |                     |          }|                     d|d         |          \  }}|dk    }|st          | j        dz             g }g }t          dt          |                    D ][}|r9| 	                    ||                   }	|
                    d	|	d
         z              |
                    d||         z              \| j        d         d         d         }
d|d}|                     |
||                     ||          |           d{V }| j        ri }|||d         <   |S |                     | j        d|          S )a  

        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   r7   ' watchBidsAsks only support spot marketrg   rh   bidask:r6   r   SUBSCRIPTIONr   rn   rd   )ri   r   r   rh   markets_for_symbolsr   r   r   r   rj   r   rY   r   r   r   r   bidsasks)r`   r   rn   
marketTypemarketsr   r   topicsr   rj   r   r   r   r   s                 rb   watch_bids_askszmexc.watch_bids_asks  s      !!!!!!!!!%%gtT5$GG
?#DG.X$XYYY**733!??QXYZQ[]cdd
Fv% 	Ttw)RRSSSq#g,,'' 	9 	9A ^WQZ00MPVW[P\\]]]  WQZ!78888it$V,$
 
 **3t{{7TZ?[?[]jkkkkkkkk? 	G(.GF8$%N##DM8WEEErc   c                     |                      |          }|                     |d          }|d S || j        |<   d|z   }|                    ||           d S )Nrd   r   )parse_ws_bid_askr   r   r   )r`   rs   r   parsedTickerrd   ro   s         rb   r}   zmexc.handle_bid_ask  sf     ,,W55!!,99>F ,f&(|[11111rc   c                    |                      |d          }|                     |d          }|                     ||          }|                     |d          }|                     |d          }|                     |||                     |          |                     |d          |                     |d          |                     |d          |                     |d          |d	|          S )
Nru   rx   rd   ry   r   r   r   r   )rd   r{   r|   r   r   r   r   r   )	safe_dictr   r   r   r   r   r   )r`   r   rj   rv   r   rd   r{   s          rb   r   zmexc.parse_ws_bid_ask  s    ~~fc**##FC00!!(F33!!&(33%%fc22	"Y//##D#..))$44##D#..))$44	!
 	!
 	 	 		rc   c                   K   |                      |dd          }|                     |dg          }| j        d         d         d         }|rdnd}||gd}|                     |||                     ||          |           d {V S )	NunsubscribedFr6   r   r7   UNSUBSCRIPTIONr   r   )	safe_boolomitrY   watchr   )r`   rp   ro   rn   r   r   r   r   s           rb   rk   zmexc.watch_spot_public  s      ~~fneDD6N#344it$V,&2G!!i
 
 ZZ[$++gv2N2NP[\\\\\\\\\rc   c                   K   |                                   |                     |           d {V }| j        d         d         d         dz   |z   }d|gd}|                     |||                     ||          |           d {V S )Nr6   r   r7   ?listenKey=r   r   )check_required_credentialsauthenticaterY   r   r   )r`   rp   ro   rn   rU   r   r   s          rb   watch_spot_privatezmexc.watch_spot_private  s      '')))++G44444444	it$V,}<yH$i
 
 ZZ[$++gv2N2NPWXXXXXXXXXrc   c                    K   | j         d         d         d         }||d}|                     ||          }|                     ||||           d {V S )Nr6   r   r8   r   param)rY   r   r   )r`   rp   ro   rq   rn   r   r   r   s           rb   rl   zmexc.watch_swap_public  sm      it$V,"
 
 ++gv..ZZ[';GGGGGGGGGrc   c                   K   |                                   d}| j        d         d         d         }t          |                                           }| j        |z   }|                     |                     |          |                     | j                  t          j	                  }|| j        ||dd}| 
                    ||          }	|                     |||	|           d {V S )Nloginr6   r   r8   )apiKey	signaturereqTimer   )r   rY   strmillisecondsr   hmacencodesecrethashlibsha256r   r   )
r`   ro   rn   rp   r   r{   payloadr   r   r   s
             rb   watch_swap_privatezmexc.watch_swap_private  s      '')))it$V,))++,,	+	)IIdkk'22DKK4L4Lgn]]	+&$ 
 
 ++gv..ZZ['7CCCCCCCCCrc   rD   	timeframesincelimitc                 "  K   |                                   d{V  |                     |          }|d         }|                     | j        di           }|                     ||          }d|z   dz   |z   }	d}
|d         r/d|d         z   d	z   |z   }|                     ||	|           d{V }
n+d
}|d         |d}|                     ||	||           d{V }
| j        r|
                    ||          }| 	                    |
||dd          S )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
        Nrd   rT   candles::r7   spot@public.kline.v3.api.pb@rh   @z	sub.klinerd   intervalr   T)
ri   rj   
safe_valuerZ   r   rk   rl   r   getLimitfilter_by_since_limit)r`   rd   r  r  r  rn   rj   rT   timeframeIdro   ohlcvrp   rq   s                rb   watch_ohlcvzmexc.watch_ohlcv  s^      !!!!!!!!!V$$!__T\<DD
&&z9== 6)C/);&> 		^4vd|CcIKWG00+vNNNNNNNNEE!G ,'# #M 00+}V\]]]]]]]]E? 	2NN6511E))%q$GGGrc   c                 P   d }d }d }d|v r|                      |                     |d                    }|                     |di           }|                     |d          }|                     || j        d                   }|                     ||                     |                    }n|                     |ddi           }|                     |d|          }	| 	                    |	dd          }|                     | j        di           }
|                     ||
          }| 	                    |d	d          }|                     |          }|d         }|                     |	|          }d
|z   dz   |z   }|                     | j
        |i           | j
        |<   |                     | j
        |         |          }|;|                     | j        dd          }t          |          }|| j
        |         |<   |                    |           |                    ||           d S )NpublicSpotKlinerd   r  rT   ru   rv   kr   rx   r  r  
OHLCVLimit  )rd   r   r   find_timeframerZ   parse_ws_ohlcvr   safe_value_2r  r   ohlcvsr   r   r   r   )r`   rs   r   parsedrd   r  rv   r  ru   rawOhlcvrT   r   rj   ro   storedr  s                   rb   handle_ohlcvzmexc.handle_ohlcv9  s   B 	''[[!1!1'8!D!DEEF>>'+<bAAD**4<<K++Kl9STTI((t/?/?/G/GHHFF!!'3;;Aq#q11H,,XsJGGK|RHHJ++KDDI))'3AAH%%h//FH%F((6::F 6)C/);"oodk62FFFV!4i@@>%%dlL$GGE*511F-3DK	*fv{+++++rc   c           	      t   |                      |dd          }|/|                     |d          s||                      |dd          }|                     |dd          |                      |dd          |                      |d	d
          |                      |dd          |                      |dd          |gS )Nr   volumer7   r   ry   windowStartoopeningPricer   highestPricer   lowestPricer   closingPrice)r   r   safe_timestamp_2)r`   r  rj   r   s       rb   r  zmexc.parse_ws_ohlcv  s    X ##E399 )G)Gfn''sC88F!!%m<<uc>::uc>::uc=99uc>::
 	
rc   c                   K   |                                   d{V  |                     |          }|d         }d|z   }d}|d         rLd}|                     |ddd          \  }}d|z   d	z   |d
         z   }|                     |||           d{V }n*d}d|d
         i}	|                     |||	|           d{V }|                                S )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
        Nrd   
orderbook:r7   r)   	frequency100ms"spot@public.aggre.depth.v3.api.pb@r	  rh   z	sub.depth)ri   rj   handle_option_and_paramsrk   rl   r  )
r`   rd   r  rn   rj   ro   	orderbookr*  rp   rq   s
             rb   watch_order_bookzmexc.watch_order_book  s       !!!!!!!!!V$$!"V+	&> 
	bI $ = =fFVXcel m mIv:YFLvVZ|[G"44Wk6RRRRRRRRII!G&,#M #44Wk=Z`aaaaaaaaI   rc   c                     |                      |d          }|                    d          }|                      |d          }|                     |          }|                     i           | j        |<   d S )Nmsgr	     )r   splitr   
order_book
orderbooks)r`   rs   r   r1  partsr   rd   s          rb   handle_order_book_subscriptionz#mexc.handle_order_book_subscription  sn     w..		###E1--!!(++"&//""5"5rc   c                 R   |                      |d          }|                     |d          }|                     |g d          }||dz
  k     rdS t          dt	          |                    D ],}||         }|                     |g d          }||k    r|c S -t	          |          S )Nnoncer   rversionfromVersion   )r   r  safe_integer_nr   r   )	r`   r.  cacher9  
firstDeltafirstDeltaNoncer   delta
deltaNonces	            rb   get_cache_indexzmexc.get_cache_index  s    !!)W55__UA..
--j:Y:Y:YZZ?Q&&&2q#e**%% 	 	A!HE,,U4S4S4STTJU"" #5zzrc   c                    |                      |g d          }|                     |dd          }|                     |          }d|z   }|                     |j        |          }|                     |d          }|| j        vr|                                 | j        |<   | j        |         }	|                     |	d          }
d}|
lt          |	j	                  }| 
                    dd	d
          }||k    r|                     | j        ||||i            |	j	                            |           d S 	 |                     |	|           |                     |g d          }||	d<   |                     |          |	d<   n7# t"          $ r*}|j        |= |                    ||           d}Y d }~nd }~ww xY w|rd S |                    |	|           d S )N)ru   rv   publicAggreDepthsrx   rd   r)  r  r9  Fr)   rP   rN   )ry   tsrz   r{   r|   T)r~   r   r   r  subscriptionsr   r5  r4  r   rA  handle_optionspawnload_order_bookr   handle_deltar@  r   	Exceptionrejectr   )r`   rs   r   rv   r   rd   ro   subscriptionr  storedOrderBookr9  shouldReturncacheLengthrP   r{   es                   rb   handle_order_bookzmexc.handle_order_book  s   F )K)K)KLL%%gsH==!!(++"V+v';[II!!,88$/))&*oo&7&7DOF#/&1!!/7;;=o344K ../?RTUUMm++

4/feUWXXX!((...F		 ot444++G5L5L5LMMI+4OK(*.,,y*A*AOJ'' 	  	  	 $[1MM![)))LLLLLL		 
  	F44444s   4AF   
F4
 F//F4c                 4   t          dt          |                    D ]y}||         }t          |t                    r|                    |           5|                     |dd          }|                     |dd          }|                    ||           zd S )Nr   r   r   r   quantity)r   r   
isinstancelist
storeArraysafe_float_2store)r`   booksidebidasksr   bidaskr   amounts          rb   handle_bookside_deltazmexc.handle_bookside_deltak  s     q#g,,'' 	. 	.AQZF&$'' .##F++++))&#w??**63
CCuf----	. 	.rc   c                 P   |                      |d          }|                     |g d          }||k     rd S ||d<   |                     |dg           }|                     |dg           }|d         }|d         }|                     ||           |                     ||           d S )Nr9  r:  asksbids)r   r@  	safe_listrb  )	r`   r.  rD  existingNoncerE  rd  re  asksOrderSidebidsOrderSides	            rb   rN  zmexc.handle_delta{  s    )))W==((0O0O0OPP
%% F'	'~~eVR00~~eVR00!&)!&)""=$777""=$77777rc   c                   K   |                                   d{V  |                     |          }|d         }d|z   }d}|d         r)d|d         z   }|                     |||           d{V }n*d}d|d         i}	|                     |||	|           d{V }| j        r|                    ||          }|                     |||dd	          S )
a  

        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>`
        Nrd   trades:r7   (spot@public.aggre.deals.v3.api.pb@100ms@rh   zsub.dealr{   T)ri   rj   rk   rl   r   r  r  )
r`   rd   r  r  rn   rj   ro   tradesrp   rq   s
             rb   watch_tradeszmexc.watch_trades  s      !!!!!!!!!V$$!&(&> 	_@6$<OG11';OOOOOOOOFF G&,#M  11';W]^^^^^^^^F? 	3OOFE22E))&%TRRRrc   c                    |                      |dd          }|                     |          }|d         }d|z   }|                     | j        |          }|5|                     | j        dd          }t          |          }|| j        |<   |                     |ddg          }	|                     |	dd	|	g          }
|	| 	                    |d
g           }
t          dt          |
                    D ]Z}d }|d         r|                     |
|         |          }n|                     |
|         |          }|                    |           [|                    ||           d S )Nrx   rd   rk  tradesLimitr  ru   publicAggreDealsdeals	dealsListrv   r   r7   )r   r   r  rm  r   rZ   r   r~   r   rf  r   r   parse_ws_tradeparse_trader   r   )r`   rs   r   r   rj   rd   ro   r  r  ru   rm  jparsedTrades                rb   handle_tradeszmexc.handle_trades  ss   f %%gsH==!!(++!&(f55>%%dlM4HHE&&F"(DKWs,>&?@@!!!WkA3??9^^GVR88Fq#f++&& 	' 	'AKf~ B"11&)VDD"..vay&AAMM+&&&&v{+++++rc   c                   K   |                                   d{V  d}d}|%|                     |          }|d         }|dz   |z   }d}|                     d||          \  }}d}|dk    r d}	|                     |	||           d{V }n|                     ||           d{V }| j        r|                    ||          }|                     ||||d          S )	a  

        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myTradesrd   r  r'   r7   zspot@private.deals.v3.api.pbTri   rj   r   r   r  r   r  filter_by_symbol_since_limit)
r`   rd   r  r  rn   ro   rj   r   rm  rp   s
             rb   watch_my_tradeszmexc.watch_my_trades  s%      !!!!!!!!! [[((FH%F%+f4K99/6SYZZf6>>4G227KPPPPPPPPFF22;GGGGGGGGF? 	3OOFE22E00tTTTrc   c                 F   d}|                      |g d          }|                     |d          }|                     |dd|          }|                     |          }|d         }	d }
|d         r|                     ||          }
n|                     ||          }
| j        }|2|                     | j        dd          }t          |          }|| _        |
                    |
           |                    ||           |dz   |	z   }|                    ||           d S )	Nrz  )ru   rv   privateDealsrd   rx   r7   rp  r  r  )r~   r   r   r   rt  ru  rz  r   rZ   r   r   r   )r`   rs   r   rQ  ro   rv   futuresMarketIdr   rj   rd   traderm  r  symbolSpecificMessageHashs                 rb   handle_my_tradezmexc.handle_my_trade  s8   F !)F)F)FGG**4::%%gsHoNN!!(++!&> 	3''f55EE$$T622E>%%dlM4HHE+E22F"DMev{+++$/#$5$>!v899999rc   c                    |                      |dd          }|                     |dd          }||                     |d          }d }|                     |dd          }|                     |dd          }|                     |d	d
          }|dk    rdnd}|                     |d          }	|                     |dd          }
|                     |dd          }|                     |||                     |dd          ||                     |          |                     d |          d ||	rdnd|||                     |d          |
|                     |          dd|          S )NTtimery   tradeIdr   r   r   rX  S	tradeType1buysellmn	feeAmountNfeeCurrencyr   orderIdmakertakerra  )costcurrency)r   rh   orderr{   r|   rd   r   sidetakerOrMakerr   ra  r  fee)r   r   r   
safe_trader   r   r   safe_currency_code)r`   r  rj   r{   r  priceStringamountStringrawSider  isMakerr  feeCurrencyIds               rb   rt  zmexc.parse_ws_tradeJ  s   d ''sF;;	$$UC;;))%55IG((W==))%jAA$$UC== Cuuf##E3//&&uc;??	**5#}EE''sI>>"Y//&&tV44(/=GGg "$$UH55! 33MBB  
  
" #  	rc   c                   K   |                                   d{V  d}d}|%|                     |          }|d         }|dz   |z   }d}|                     d||          \  }}d}|dk    r d}	|                     |	||           d{V }n|                     ||           d{V }| j        r|                    ||          }|                     ||||d          S )	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ordersrd   r  r*   r7   zspot@private.orders.v3.api.pbTr{  )
r`   rd   r  r  rn   ro   rj   r   r  rp   s
             rb   watch_orderszmexc.watch_orders  s%      !!!!!!!!![[((FH%F%+f4K99-QWXXf6>>5G227KPPPPPPPPFF22;GGGGGGGGF? 	3OOFE22E00tTTTrc   c                 F   d}|                      |g d          }|                     |d          }|                     |dd|          }|                     |          }|d         }d }	|d         r|                     ||          }	n|                     ||          }	| j        }
|
2|                     | j        dd          }t          |          }
|
| _        |

                    |	           |                    |
|           |dz   |z   }|                    |
|           d S )	Nr  )ru   rv   privateOrdersrd   rx   r7   ordersLimitr  r  )r~   r   r   r   parse_ws_orderparse_orderr  r   rZ   r   r   r   )r`   rs   r   ro   rv   r  r   rj   rd   r  r  r  r  s                rb   handle_orderzmexc.handle_order  s8   R )G)G)GHH**4::%%gsHoNN!!(++!&> 	4((v66FF%%dF33F>%%dlM4HHE+E22F DKfv{+++$/#$5$>!v899999rc   c           	         |                      |d          }|                     |d          }|                     |dd          }|                     |d          }d }|                     |d          }||d d}|                     i d|                     |d          d	|                     |d
          d|d|                     |          dd d|                     ||          d|                     d |          d|                     |          d|                     |          d|dk    rdndd|                     |d          d|                     |dd          d|                     |dd          d|                     |d          d|                     |d          d|                     |d          d|                     |d          |                     |d           |d |d!|          S )"N
createTimer  statusstate	orderTyper  )r  r  rh   clientOrderIdclientIdr{   r|   lastTradeTimestamprd   r   timeInForcer  r  r  r  r   	stopPricetriggerPricePr   avgPricera  rX  r  filledcumulativeQuantityremainQuantity)	remainingr  rm  r   )	r   r   r   
safe_orderr   parse_ws_order_statusr   parse_ws_order_typeparse_ws_time_in_force)	r`   r  rj   r{   r  r  r   r  r  s	            rb   r  zmexc.parse_ws_order  s   H %%e\::	{33##E8W=={33&&uc22"' C   
$""5$// 
T--eZ@@ 
  
 Y//	 

 !$ 
 d00@@ 
 d&&tV44 
 D,,T22 
 466t<< 
 dckkEE 
 T%%eW55 
 ++E>3GG 
 D..uncJJ 
 t''z:: 
 d&&uj99 
  D$$UH55! 
" d&&u.BCC# 
$ ))%1ABB+ 
  
  
, -  	rc   c                 J    ddddddddddd
}|                      |||          S )Nr   closedcanceledrejected)
0r  2345NEWCANCELEDEXECUTEDFAILEDr   )r`   r  rj   statusess       rb   r  zmexc.parse_ws_order_status  sF    "  
 
 &&999rc   c           	      D    ddd d ddddd}|                      ||          S )Nr  rj   r  r  r  r  r  100101102r  )r`   r   typess      rb   r  zmexc.parse_ws_order_type  s>    	
 	
 t,,,rc   c           	      D    ddddddddd}|                      ||          S )NGTCPOIOCFOKr  r  )r`   r  timeInForceIdss      rb   r  zmexc.parse_ws_time_in_force  s>    	 
 	 
 <<<rc   c                    K   |                                   d{V  d}|                     dd|          \  }}d|z   }|dk    rd}|                     |||           d{V S |                     ||           d{V S )a{  

        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:r7   spot@private.account.v3.api.pb)ri   r   r   r  )r`   rn   r   ro   rp   s        rb   watch_balancezmexc.watch_balance  s       !!!!!!!!!99.$PVWWf 4'6>>6G00+vNNNNNNNNN00fEEEEEEEEErc   c                 &   |                      |d          }|dk    rdnd}d|z   }|                     |ddg          }|                     |dd	          }|                     |d
|          }|| j        vr
i | j        |<   || j        |         d<   || j        |         d<   |                     |          | j        |         d<   |                     |ddg          }	|                     |	          }
|                                 }|                     |dd          |d<   |                     |ddg          |d<   || j        |         |
<   | 	                    | j        |                   | j        |<   |
                    | j        |         |           d S )Nrp   r  r7   r8   r  rv   privateAccountrI  r  r  r   r{   r|   r  	vcoinNamebalanceAmountavailableBalancefreefrozenBalancefrozenAmountused)r   r~   r   balancer   safe_string_nr  accountr   safe_balancer   )r`   rs   r   rp   r   ro   rv   futuresTimestampr{   
currencyIdcoder  s               rb   handle_balancezmexc.handle_balance  s   F ""7I66!%EEEvvF 4'&2B)CDD..wlKK''f6FGG	$$!#DL%)T6"*3T;')-i)@)@T:&''z;.GHH
&&z22,,..,,T?DVWW,,TO^3TUU#*T4 !..t|D/ABBTt|D);77777rc   c                    K   |                                   d{V  |                     |          }d|d         z   }d}d|d         i}|                     ||||           d{V S )af  
        watch the current funding rate

        https://www.mexc.com/api-docs/futures/websocket-api#funding-rate

        :param str symbol: unified market symbol
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :returns dict: a `funding rate structure <https://docs.ccxt.com/?id=funding-rate-structure>`
        NfundingRate:rd   zsub.funding.raterh   )ri   rj   rl   rm   s          rb   watch_funding_ratezmexc.watch_funding_rate  s       !!!!!!!!!V$$$vh'77$fTl
 ++G[-QWXXXXXXXXXrc   c                 T  K   |                                   d{V  |                     |          }d|d         z   }d}d}d|d         i}| j        d         d         d         }|                     ||||           |                     |          }|                     ||g           dS )	a~  
        unWatches the current funding rate for a symbol

        https://www.mexc.com/api-docs/futures/websocket-api#funding-rate

        :param str symbol: unified symbol of the market
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :returns dict: a `funding rate structure <https://docs.ccxt.com/?id=funding-rate-structure>`
        Nunsubscribe:fundingRate:rd   zunsub.funding.raterh   r6   r   r8   )ri   rj   rY   rl   rs   handle_unsubscriptions	r`   rd   rn   rj   ro   r   rp   rq   rs   s	            rb   un_watch_funding_ratezmexc.un_watch_funding_rate  s       !!!!!!!!!V$$06(3CC&fTl
 it$V,w]FKKKS!!##F[M:::trc   c                     |                      |di           }|                     |          }|d         }|| j        |<   d|z   }|                    ||           d S )Nrv   rd   r  )r   parse_funding_ratefundingRatesr   )r`   rs   r   rv   fundingRaterd   ro   s          rb   handle_funding_ratezmexc.handle_funding_rate  sg     ~~gvr22--d33X&$/&!$v-{K00000rc   c                   K   |                                   d{V  |                     |          }d|d         z   }d}d}|d         rAd|d         z   }| j        d         d         d         }d	|d
<   |                     |||           n=d}d|d         i}| j        d         d         d         }|                     ||||           |                     |          }|                     ||g           dS )a  
        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:rd   r7   rg   rh   r6   r   Tr   zunsub.tickerr8   ri   rj   rY   rk   rl   rs   r  r  s	            rb   un_watch_tickerzmexc.un_watch_ticker3  s!      !!!!!!!!!V$$+fX.>>&> 	PEtTG)E"4(0C%)F>"""7K@@@@$G&,#M )E"4(0C""7KOOOS!!##F[M:::trc   c                   K   |                                   d{V  |                     |d          }g }|                     |d          }d}||                     |          }d}|                     d||          \  }}|dk    }|r| j        d         d         d         n| j        d         d         d         }i }	|rt          | j        dz             d	|	d
<   i |	d<   |                    d           | 	                    |          }
| 
                    |||                     |	|          |           |                     |
|           dS )a  
        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,   r7   r6   r   r8   r   zunsub.tickersr   rn   zunsubscribe:ticker)ri   r   r   rj   r   rY   r   rh   r   rs   r   r   r  )r`   r   rn   r   r   rj   r   r   r   r   rs   s              rb   un_watch_tickerszmexc.un_watch_tickersO  su      !!!!!!!!!%%gt44&&w22"[[--F99.&RXYYf&.17\dit$V,,di>Nt>TU[>\ 	7tw)VVWWW8 !0GH "GH  !5666S!!CGV0L0Lm\\\##FM:::trc   c                 2  K   |                                   d{V  |                     |dddd          }d}|t          | j        dz             |                     |          }|                     d|d         |          \  }}|dk    }|st          | j        dz             g }g }t          dt          |                    D ][}|r9| 	                    ||                   }	|
                    d	|	d
         z              |
                    d||         z              \| j        d         d         d         }
d|d}|                     |
          }|                     |
||                     ||          |           |                     ||           dS )a7  
        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   r7   r   rg   rh   unsubscribe:bidask:r6   r   r   r   )ri   r   r   rh   r   r   r   r   r   rj   r   rY   rs   r   r   r  )r`   r   rn   r   r   r   r   r   r   rj   r   r   rs   s                rb   un_watch_bids_askszmexc.un_watch_bids_asks  s      !!!!!!!!!%%gtT5$GG
?#DG.X$XYYY**733!??QXYZQ[]cdd
Fv% 	Ttw)RRSSSq#g,,'' 	E 	EA ^WQZ00MPVW[P\\]]]  !6!CDDDDit$V,&
 
 S!!CGV0L0Lm\\\##FM:::trc   c                 h  K   |                                   d{V  |                     |          }|d         }|                     | j        di           }|                     ||          }d|z   dz   |z   }d}|d         rG| j        d         d         d         }d	|d
         z   dz   |z   }	d|d<   |                     |	||           n>| j        d         d         d         }d}	|d
         |d}
|                     |	||
|           |                     |          }| 	                    ||g           dS )aJ  
        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
        Nrd   rT   zunsubscribe:candles:r  r7   r6   r   r  rh   r	  Tr   r8   zunsub.kliner
  )
ri   rj   r  rZ   r   rY   rk   rl   rs   r  )r`   rd   r  rn   rj   rT   r  ro   r   rp   rq   rs   s               rb   un_watch_ohlcvzmexc.un_watch_ohlcv  sg      !!!!!!!!!V$$!__T\<DD
&&z9==,v5;iG&> 	P)E"4(0C4vd|CcIKWG%)F>"""7K@@@@)E"4(0C#G ,'# #M ""7KOOOS!!##F[M:::trc   c                 0  K   |                                   d{V  |                     |          }|d         }d|z   }d}|d         rd| j        d         d         d         }d}|                     |ddd	          \  }}d
|z   dz   |d         z   }d|d<   |                     |||           n=| j        d         d         d         }d}d|d         i}|                     ||||           |                     |          }	|                     |	|g           dS )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
        Nrd   unsubscribe:orderbook:r7   r6   r   r)   r*  r+  r,  r	  rh   Tr   r8   zunsub.depth)ri   rj   rY   r-  rk   rl   rs   r  )
r`   rd   rn   rj   ro   r   r*  rp   rq   rs   s
             rb   un_watch_order_bookzmexc.un_watch_order_book  sR      !!!!!!!!!V$$!.7&> 	P)E"4(0CI $ = =fFVXcel m mIv:YFLvVZ|[G%)F>"""7K@@@@)E"4(0C#G&,#M ""7KOOOS!!##F[M:::trc   c                   K   |                                   d{V  |                     |          }|d         }d|z   }d}|d         rA| j        d         d         d         }d|d         z   }d	|d
<   |                     |||           n=| j        d         d         d         }d}d|d         i}|                     ||||           |                     |          }|                     ||g           dS )a  
        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>`
        Nrd   unsubscribe:trades:r7   r6   r   rl  rh   Tr   r8   z
unsub.dealr  r  s	            rb   un_watch_tradeszmexc.un_watch_trades  s!      !!!!!!!!!V$$!+f4&> 	P)E"4(0C@6$<OG%)F>"""7K@@@@)E"4(0C"G&,#M ""7KOOOS!!##F[M:::trc   r   c                 *   t          dt          |                    D ]s}||         }|                    dd          }|                     |||           |                    d          dk    r|                    dd          }|                    d          dk    rUt          | j                                                  }t          dt          |                    D ]}| j        ||         = || j        v r| j        |= |                    d          dk    r)|                    dd          }|| j        v r| j        |= )|                    d	          dk    rm|	                    d
          }	| 
                    |	d          }t          |	          dk    r|d
| 
                    |	d          z   z  }|| j        v r| j        |= |                    d          dk    r)|                    dd          }|| j        v r| j        |= |                    d          dk    r)|                    dd          }|| j        v r| j        |= 3|                    d          dk    r'|                    dd          }|| j        v r| j        |= ud S )Nr   zunsubscribe:r   r   r  unsubscriber`  r  candlesr  r2     rO   r.  r	  rm  r  r  r  )r   r   replaceclean_unsubscriptionfindrZ  r   keysr   r3  r   r  r5  rm  r  )
r`   rs   r   r   ro   subMessageHashrd   r   rv  splitHashess
             rb   r  zmexc.handle_unsubscriptions  s   q#m,,-- #	2 #	2A'*K(00DDN%%fnkJJJ))Q..$,,-BBGG;;}--22"4<#4#4#6#677G"1c'll33 5 5 L445t|++V,!!(++q00$,,-BBGGT]**f-!!),,11)//44))+q99{##a''cD$4$4[!$D$DDDFT[((F+!!+..!33$,,-ErJJT_,,/!!(++q00$,,-BBGGT[((F+!!-00A55$,,-GLLT...)&1G#	2 #	2rc   c                 0  K   |                      | j        d          }||S |                     |           d {V }|                      |d          }|| j        d<   |                     | j        dd          }|                     || j        ||           |S )NrU   rR   r9   )r   rZ   spotPrivatePostUserDataStreamr   delaykeep_alive_listen_key)r`   subscriptionHashrn   rU   responserR   s         rb   r   zmexc.authenticate,  s      $$T\;??	 ;;FCCCCCCCC $$X{;;	$-[!#00?UW^__

')CYPVWWWrc   c                   K   |d S d|i}	 |                      |                     ||                     d {V  |                     | j        dd          }|                     || j        ||           d S # t          $ rf}| j        d         d         d         dz   |z   }|                     |          }d | j        d<   |	                    |           | j
        |= Y d }~d S d }~ww xY w)NrU   rR   r9   r6   r   r7   r   )spotPrivatePutUserDataStreamr   r   rZ   r  r  rO  rY   rs   rP  clients)r`   rU   rn   r   rR   errorr   rs   s           rb   r  zmexc.keep_alive_listen_key=  s     F
		"33DKK4P4PQQQQQQQQQ#'#4#4T\CY[b#c#c JJ+T-GTZ[[[[[ 	" 	" 	")E"4(0=@9LC[[%%F(,DL%MM%   S!!!!!!!	"s   A(A6 6
C& AC!!C&c                 8    |                                  |_        |S N)r   lastPong)r`   rs   r   s      rb   handle_pongzmexc.handle_pongN  s    ++--rc   c                 f   |                      |dd          }|dk    r|                     ||           d S |                    d          dk    r`|                    d          }|                      |d          }| j        | j        d}|                     ||          }| |||           d S d S d S )Nr1  r   PONGr	  r?  r>  )public.increase.depth.v3.apipublic.aggre.depth.v3.api.pb)r   r%  r  r3  r7  r  )r`   rs   r   r1  r6  rp   methodsr   s           rb   handle_subscription_statuszmexc.handle_subscription_statusR  s     wr22&==VW-----XXc]]RIIcNNE&&ua00G040S040S G __Wg66F!vw'''''   "!rc   c                    |                      |d          }|                    d          }|                      |d          }|dk    r|                     ||           n|dk    r|                     ||           n|dk    r|                     ||           ns|dk    r|                     ||           nV|dk    r|                     ||           n9|d	k    r|                     ||           n|d
k    r|                     ||           dS )Nrp   r	  r>  zpublic.kline.v3.api.pbzpublic.aggre.deals.v3.api.pbz!public.aggre.bookTicker.v3.api.pbr)  zprivate.account.v3.api.pbzprivate.deals.v3.api.pbzprivate.orders.v3.api.pbT)	r   r3  r  rx  r   rV  r  r  r  )r`   rs   r   rp   channelParts	channelIds         rb   handle_protobuf_messagezmexc.handle_protobuf_messageh  sD   & ""7I66}}S))$$\155	000fg....888vw////===vw////888""6733335550000333  1111444fg...trc   c                 r   t          |t                    r4|dk    r.t          | j        dz             }|                    |           d S |                     |          r-|                     |          }|                     ||           d S d|v r|                     ||           d S | 	                    |d          }d }|| 	                    |d          }n+|
                    d          }| 	                    |d          }i d| j        d	| j        d
| j        d| j        d| j        d| j        d| j        d| j        d| j        d| j        d| j        d| j        d| j        d| j        d| j        d| j        d| j        | j        | j        d}||v r||         } |||           d S d S )NzInvalid listen keyz invalid listen keyr1  r   rp   r	  r>  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.tickersr(  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)pongzpush.funding.rate)rY  r   r   rh   rP  is_binary_messagedecode_proto_msgr/  r+  r   r3  rx  r  r   r   rV  r  r  r  r%  r  )	r`   rs   r   r!  r   rp   r6  r*  r   s	            rb   handle_messagezmexc.handle_message  sf   gs## 	...+DG6K,KLLe$$$!!'** 	++G44G((999FG++FG<<<FWc**9&&w	::GGGGCLLE&&ua00G
!4#5
+
 "4#4
 $+	

 '(:
 '(:
 ()<
 4-
 D/
 +D,B
 $0
 $T%6
 "4#4
 %d&9
 "4#6
  #D$8!
" '(<#
$ $!%!9'
 
 
* gW%FF67##### rc   c                 
    ddiS )Nr   rV    )r`   rs   s     rb   rV   z	mexc.ping  s    &!!rc   r#  )G__name__
__module____qualname__r   r_   r   r   rr   r   r   r   r   r   r   r   r   r}   r   rk   r   rl   r  r   r   rZ  r  r  r  r
   r/  r7  rF  rV  rb  rN  r   rn  rx  r   r}  r  rt  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  rV   __classcell__)ra   s   @rb   r   r      s       D# D D D D D DL 68 ] ] ]F ] ] ] ]4S,F S, S, S, S,j 6:" >E >E7 >E >E >E >E >E@T&V T& T& T& T&l9 9 9 9v 8<B %F %FW %F7 %F %F %F %FN2V 2 2 2 2,   " DF 	] 	] 	] 	] EG Y Y Y Y SU H H H H <> D D D D$ ?CQUdhqs  H  H  H  H3  H^a  Hx|  ~B  yC  H  H  H  HD\,6 \, \, \, \,|8
 8
D 8
 8
 8
 8
t @DB ! !S ! !S\ ! ! ! !>6V 6 6 6 6  a5 a5 a5 a5 a5F. . . 8 8 8 <@d[] S S SS S Sbfglbm S S S S>G,F G, G, G, G,R 37TX\eg U UC Us URU Ulpqvlw U U U U@6: 6:f 6: 6: 6: 6:pO O O Ob 04$UYbd U U UC Us Uimnsit U U U UB\:6 \: \: \: \:|e e e eN: : : :- - -= = = *, F F F F F F&58V 58 58 58 58n <> Y Ys Y+ Y Y Y Y& ?A  # S    01& 1 1 1 1( 9;  C s    8 9=R 6 6g 6C 6 6 6 6p ;?r      c        D BFb  3 3 UX    B =?   3    > 9;  C s    :$2V $2DI $2 $2 $2 $2L ;=    " =? " " " ""&    ( ( ( ( (,$f $ $ $ $L+$V +$ +$ +$ +$Z"6 " " " " " " " "rc   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   r   !ccxt.async_support.base.ws.clientr   typingr   ccxt.base.errorsr   r   r   async_supportr   r6  rc   rb   <module>rC     s&       f f f f f f f f f f  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 4 4 4 4 4 4       0 0 0 0 0 0 . . . . . . ) ) ) ) ) )k" k" k" k" k"4" k" k" k" k" k"rc   