
    iK                         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 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)BalancesIntOrder	OrderBookStrTickerTrade)Client)List)ExchangeError)ArgumentsRequired)NotSupportedc            
       V    e Zd Z fdZd Zi fdefdZdefdZi fde	de
fdZdefd	Zd
d
i fde	dededee         fdZd
d
i fde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efdZd
i fde	dedefdZd
i fdee	         dedefdZdefdZd Zd Z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
d
i fde	dededee          fdZ!d
d
i fdeee	                  dedefdZ"defdZ#d'de fd Z$d
i fd!e	d"efd#Z%defd$Z&defd%Z'i fd&Z( xZ)S )(deribitc                     |                      t          t          |                                           dddddddddddddddiddiddd	d
dddddddddddiddddddg ddi i d          S )NTF)wswatchBalancewatchTickerwatchTickerswatchTradeswatchTradesForSymbolswatchMyTradeswatchOrderswatchOrderBookwatchOrderBookForSymbols
watchOHLCVwatchOHLCVForSymbolsr   z wss://test.deribit.com/ws/api/v2zwss://www.deribit.com/ws/api/v2)testapi1351530601201803607201D)1m3m5m15m30m1h2h4h6h12h1dinterval100ms20none)r9   useDepthEndpointdepthgroup)
timeframesr   r   )BTCETHSOLUSDC)r   
currencies)hasurlsoptions	streaming
exceptions)deep_extendsuperr   describe)self	__class__s    V/var/www/html/crypto-bot/backend/venv/lib/python3.11/site-packages/ccxt/pro/deribit.pyrM   zderibit.describe   s   gt 4 4 = = ? ? $# %#)-!%#"&,0"(,   < ;	  "!!##"###$"# # #G.
 %,,1!%!'	1 1' 4 <;;7 :m8B
 8B
 8 8 8	    c                 z    |                      |                     | j        dd          d          }|| j        d<   |S )N	requestIdr      )sumsafe_integerrH   )rN   rS   s     rP   
request_idzderibit.request_idN   s;    HHT..t|[!LLaPP	$-[!rQ   returnc                   K   |                      |           d{V  d}| j        d         d         }|                     | j        dg           }g }t	          dt          |                    D ]"}||         }|                    d|z              #dd	d
|i|                                 d}|                     ||          }	| 	                    |||	||	           d{V S )a]  
        :see: https://docs.deribit.com/#user-portfolio-currency
        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>`
        Nbalancer"   r   rE   r   zuser.portfolio.2.0private/subscribechannelsjsonrpcmethodparamsid)
authenticaterG   
safe_valuerH   rangelenappendrW   rK   watch)
rN   ra   messageHashurlrE   r]   icurrencyCode	subscriberequests
             rP   watch_balancezderibit.watch_balanceS   s      '''''''''it$__T\<DD
q#j//** 	> 	>A%a=LOO-<====)H //##
 
	 ""9f55ZZ[';PPPPPPPPPrQ   clientc                 D   |                      |di           }|                      |di           }|| j        d<   |                     |d          }|                     |          }|                     |          }|| j        |<   d}|                    | j        |           d S )Nra   datainfocurrencyrZ   )rd   rZ   safe_stringsafe_currency_codeparse_balanceresolve)	rN   rp   messagera   rr   
currencyIdrl   rZ   ri   s	            rP   handle_balancezderibit.handle_balancem   s    X (B77vvr22#V%%dJ77
..z::$$T**%,\"t|[11111rQ   symbolc                 :  K   |                                   d{V  |                     |          }| j        d         d         }|                     |dd          }|                     |d          }|                                   d{V  |dk    r|                                  d{V  d|d         z   d	z   |z   }d
ddd|d         z   d	z   |z   gi|                                 d}|                     ||          }|                     |||||           d{V S )a-  
        :see: https://docs.deribit.com/#ticker-instrument_name-interval
        watches a price ticker, a statistical calculation with the information for a specific market.
        :param str symbol: unified symbol of the market to fetch the ticker for
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :param str [params.interval]: specify aggregation and frequency of notifications. Possible values: 100ms, raw
        :returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
        Nr"   r   r9   r:   rawzticker.rb   .r[   public/subscriber]   r^   )	load_marketsmarketrG   ru   omitrc   rW   rK   rh   )	rN   r|   ra   r   rj   r9   channelry   rn   s	            rP   watch_tickerzderibit.watch_ticker   sg      !!!!!!!!!V$$it$##FJ@@6:..!!!!!!!!!u##%%%%%%%%%fTl*S08;(Y5;hFG //##
 
 ""7F33ZZWgwHHHHHHHHHrQ   c                 N   |                      |di           }|                      |di           }|                     |d          }|                     |          }|                     |          }|                     |d          }|| j        |<   |                    ||           d S )Nra   rr   instrument_namer   )rd   ru   safe_symbolparse_tickertickersrx   )	rN   rp   ry   ra   rr   marketIdr|   tickerri   s	            rP   handle_tickerzderibit.handle_ticker   s    < (B77vvr22##D*;<<!!(++""4((&&vy99%Vv{+++++rQ   Nsincelimitc                 N   K   d|d<   |                      |g|||           d{V S )a  
        get the list of most recent trades for a particular symbol
        :see: https://docs.deribit.com/#trades-instrument_name-interval
        :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
        :param str [params.interval]: specify aggregation and frequency of notifications. Possible values: 100ms, raw
        :returns dict[]: a list of `trade structures <https://docs.ccxt.com/#/?id=public-trades>`
        r   callerMethodNameN)watch_trades_for_symbols)rN   r|   r   r   ra   s        rP   watch_tradeszderibit.watch_trades   sA       &3!"22F8UE6RRRRRRRRRrQ   symbolsc                   K   d}|                      |ddd          \  }}|dk    r|                                  d{V  |                     d|||           d{V }| j        rB|                     |d          }|                     |d          }|                    ||          }|                     |||d	d
          S )a%  
        get the list of most recent trades for a list of symbols
        :see: https://docs.deribit.com/#trades-instrument_name-interval
        :param str[] symbols: 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>`
        Nr   r9   r:   r~   tradesr   r|   	timestampT)handle_option_and_paramsrc   watch_multiple_wrapper
newUpdates	safe_dictru   getLimitfilter_by_since_limit)	rN   r   r   r   ra   r9   r   firsttradeSymbols	            rP   r   z deribit.watch_trades_for_symbols   s       88AXZdfmnn&u##%%%%%%%%%228XwPVWWWWWWWW? 	8NN61--E**5(;;KOOK77E))&%TRRRrQ   c                 .   |                      |di           }|                     |dd          }|                    d          }|                     |d          }|                     |d          }|                     |          }|                     |          }	|                     |dg           }
|                     | j        |          3|                     | j	        dd	          }t          |          | j        |<   | j        |         }t          d
t          |
                    D ]5}|
|         }|                     ||	          }|                    |           6|| j        |<   d|z   dz   |z   }|                    | j        |         |           d S )Nra   r    r   rT      rr   tradesLimit  r   ztrades||)r   ru   splitr   safe_market	safe_listrd   r   rV   rH   r   re   rf   parse_traderg   rx   )rN   rp   ry   ra   r   partsr   r9   r|   r   r   r   storedrk   tradeparsedri   s                    rP   handle_tradeszderibit.handle_trades
  s   , 266""69b99c""##E1--##E1--!!(++!!(++33??4;//7%%dlM4HHE",U"3"3DKV$q#f++&& 	" 	"A1IE%%eV44FMM&!!!!$F&(3.9t{6*K88888rQ   c                   K   |                      |           d{V  |/|                                  d{V  |                     |          }| j        d         d         }|                     |dd          }|                     |d          }d|z   }ddd	|gi|                                 d
}|                     ||          }	|                     |||	||	           d{V }
| 	                    |
|||d          S )a  
        get the list of trades associated with the user
        :see: https://docs.deribit.com/#user-trades-instrument_name-interval
        :param str symbol: unified symbol of the market to fetch trades for. Use 'any' to watch all trades
        :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
        :param str [params.interval]: specify aggregation and frequency of notifications. Possible values: 100ms, raw
        :returns dict[]: a list of `trade structures <https://docs.ccxt.com/#/?id=public-trades>`
        Nr"   r   r9   r~   zuser.trades.any.any.r[   r\   r]   r^   T)
rc   r   r|   rG   ru   r   rW   rK   rh   filter_by_symbol_since_limit)rN   r|   r   r   ra   rj   r9   r   ry   rn   r   s              rP   watch_my_tradeszderibit.watch_my_trades4  s9      '''''''''##%%%%%%%%%[[((Fit$##FJ>>6:..(83)WI //##
 
 ""7F33zz#w'JJJJJJJJ00tTTTrQ   c                    |                      |di           }|                     |dd          }|                      |dg           }| j        }|+|                     | j        dd          }t          |          }|                     |          }i }	t          dt          |                    D ],}
||
         }|	                    |           |d         }d	|	|<   -|
                    ||           d S )
Nra   r   r   rr   r   r   r   r|   T)rd   ru   myTradesrV   rH   r   parse_tradesre   rf   rg   rx   )rN   rp   ry   ra   r   r   cachedTradesr   r   	marketIdsrk   r   r|   s                rP   handle_my_tradeszderibit.handle_my_tradesS  s    B (B77""69b9944}%%dlM4HHE1%88L""6**	q#f++&& 	% 	%A1IE&&&8_F $If|W-----rQ   c                 L   K   d|d<   |                      |g||           d{V S )a  
        :see: https://docs.deribit.com/#book-instrument_name-group-depth-interval
        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.interval]: Frequency of notifications. Events will be aggregated over self interval. Possible values: 100ms, raw
        :returns dict: A dictionary of `order book structures <https://docs.ccxt.com/#/?id=order-book-structure>` indexed by market symbols
        r   r   N)watch_order_book_for_symbols)rN   r|   r   ra   s       rP   watch_order_bookzderibit.watch_order_book  s?       &6!"66xOOOOOOOOOrQ   c                   K   d}|                      |ddd          \  }}|dk    r|                                  d{V  d}d}|                      |ddd          \  }}|rId}|                      |dd	d
          \  }}d}|                      |ddd          \  }}|dz   |z   dz   |z   }n|}|                     d|||           d{V }	|	                                S )a(  
        watches information on open orders with bid(buy) and ask(sell) prices, volumes and other data
        :see: https://docs.deribit.com/#book-instrument_name-group-depth-interval
        :param str[] symbols: unified array of symbols
        :param int [limit]: the maximum amount of order book entries to return
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :returns dict: A dictionary of `order book structures <https://docs.ccxt.com/#/?id=order-book-structure>` indexed by market symbols
        Nr   r9   r:   r~   r   r=   Fr>   r;   r?   r<   r   book)r   rc   r   r   )
rN   r   r   ra   r9   
descriptorr=   r>   r?   	orderbooks
             rP   r   z$deribit.watch_order_book_for_symbols  s7      88A[]gipqq&u##%%%%%%%%%
#'#@#@Icewy~## & 	"E 99&B\^egkllME6E 99&B\^egmnnME6u,s2X=JJ!J55fj'SYZZZZZZZZ	   rQ   c                    |                      |di           }|                      |di           }|                     |d          }|                    d          }d}t          |          }|dk    }	|	rQ|                     |d          }
|                     |d          }|                     |d	          }|
dz   |z   dz   |z   }n|                     |d          }|}|                     |d
          }|                     |          }|                     |d          }|                      | j        |          }||                                 }|                      |dg           }|                      |dg           }|                     |d         |           |                     |d         |           ||d<   ||d<   | 	                    |          |d<   ||d<   || j        |<   d|z   dz   |z   }|
                    ||           d S )Nra   rr   r   r   r      r         r   r   asksbidsnoncedatetimer|   zbook|r   )rd   ru   r   rf   r   rV   
orderbookscounted_order_bookhandle_deltasiso8601rx   )rN   rp   ry   ra   rr   r   r   r   partsLength
isDetailedr?   r>   r9   r   r|   r   storedOrderBookr   r   ri   s                       rP   handle_order_bookzderibit.handle_order_book  s"   \ (B77vvr22""6955c""
%jj A%
 	"$$UA..E$$UA..E''q11Hu,s2X=JJ''q11H!J##D*;<<!!(++%%dK88	//$/6BB""5577OtVR00tVR00?62D999?62D999#, '0$&*ll9&=&=
#$*!"1&,z944444rQ   c                    |                      |dg           }|                      |dg           }g }t          dt          |                    D ]1}|                    ||         d         ||         d         g           2g }t          dt          |                    D ]1}|                    ||         d         ||         d         g           2||d<   ||d<   |S )Nr   r   r   rT   r   )rd   re   rf   rg   )rN   rr   r   r   cleanedBidsrk   cleanedAskss          rP   clean_order_bookzderibit.clean_order_book  s    tVR00tVR00q#d))$$ 	9 	9AQ
DGAJ78888q#d))$$ 	9 	9AQ
DGAJ78888"V"VrQ   c                     |d         }|d         }|d         dk    s|d         dk    r|                     ||d           d S |d         dk    r|                     ||d           d S d S )NrT   r   r   newchangedelete)store)rN   booksidedeltapriceamounts        rP   handle_deltazderibit.handle_delta  s    aq8uaH 4 4NN5&!,,,,,1X!!NN5&!,,,,, "!rQ   c                 ~    t          dt          |                    D ]}|                     |||                    d S )Nr   )re   rf   r   )rN   r   deltasrk   s       rP   r   zderibit.handle_deltas  sH    q#f++&& 	3 	3Ahq	2222	3 	3rQ   c                   K   |                                   d{V  |                     |           d{V  ||                     |          }| j        d         d         }|                     |dd          }|                     |dd          }|                     |dd          }|                     |ddd          }d	|z   d
z   |z   d
z   |z   }	ddd|	gi|                                 d}
|                     |
|          }|                     ||	||	|           d{V }| j	        r|
                    ||          }|                     ||||d          S )a8  
        :see: https://docs.deribit.com/#user-orders-instrument_name-raw
        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
        :returns dict[]: a list of [order structures]{@link https://docs.ccxt.com/#/?id=order-structure
        Nr"   r   rt   anyr9   r~   kindzuser.orders.r   r[   r\   r]   r^   T)r   rc   r|   rG   ru   r   rW   rK   rh   r   r   r   )rN   r|   r   r   ra   rj   rt   r9   r   r   ry   rn   orderss                rP   watch_orderszderibit.watch_orders  s      !!!!!!!!!'''''''''[[((Fit$##FJ>>##FJ>>666:z6BB 4'#-83>I)WI //##
 
 ""7F33zz#w'JJJJJJJJ? 	3OOFE22E00tTTTrQ   c                 B   | j         0|                     | j        dd          }t          |          | _         |                     |di           }|                     |dd          }|                     |di           }g }t          |t                    r|                     |          }n| 	                    |          }|g}| j         }	t          dt          |                    D ]}
|	                    ||
                    |                    | j         |           d S )NordersLimitr   ra   r   r   rr   r   )r   rV   rH   r   rd   ru   
isinstancelistparse_ordersparse_orderre   rf   rg   rx   )rN   rp   ry   r   ra   r   rr   r   ordercachedOrdersrk   s              rP   handle_orderszderibit.handle_orders6  s   F ;%%dlM4HHE077DK(B77""69b99vvr22dD!! 	&&t,,FF$$T**EWF{q#f++&& 	+ 	+Aq	****t{G,,,,,rQ   r.   c                    K   |                                   d{V  |                     |          }|                     ||gg|||           d{V }||         |         S )a  
        :see: https://docs.deribit.com/#chart-trades-instrument_name-resolution
        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
        N)r   r|   watch_ohlcv_for_symbols)rN   r|   	timeframer   r   ra   ohlcvss          rP   watch_ohlcvzderibit.watch_ohlcvj  s       !!!!!!!!!V$$33fi5H4I5RWY_````````f~i((rQ   symbolsAndTimeframesc                 r  K   t          |          }|dk    st          |d         t                    st          | j        dz             |                     dd||           d{V \  }}}| j        r|                    ||          }|                     |||dd          }	| 	                    |||	          S )a  
        watches historical candlestick data containing the open, high, low, and close price, and the volume of a market
        :see: https://docs.deribit.com/#chart-trades-instrument_name-resolution
        :param str[][] symbolsAndTimeframes: array of arrays containing unified symbols and timeframes to fetch OHLCV data for, example [['BTC/USDT', '1m'], ['LTC/USDT', '5m']]
        :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
        r   zu watchOHLCVForSymbols() requires a an array of symbols and timeframes, like  [['BTC/USDT', '1m'], ['LTC/USDT', '5m']]chart.tradesNT)
rf   r   r   r   rb   r   r   r   r   create_ohlcv_object)
rN   r   r   r   ra   symbolsLengthr|   r   candlesfiltereds
             rP   r   zderibit.watch_ohlcv_for_symbolsz  s       011AZ0DQ0G%N%N#DG  /f  %f  g  g  g+/+F+F~W[]qsy+z+z%z%z%z%z%z%z"	7? 	4$$VU33E--gueQMM''	8DDDrQ   c                    |                      |di           }|                     |dd          }|                    d          }|                     |d          }|                     |d          }|                     |          }|d         }	|                      | j        di           }
|                      |
d	i           }|                     ||          }|                      | j        |	i           | j        |	<   |                     | j        |	         |          9|                     | j        d
d          }t          |          | j        |	         |<   | j        |	         |         }|                      |di           }| 
                    ||          }|                    |           || j        |	         |<   |	||g}d|	z   dz   |z   }|                    ||           d S )Nra   r   r   r   r   r   r|   r   r@   
OHLCVLimitr   rr   zchart.trades|r   )r   ru   r   r   rH   find_timeframer   rd   rV   r   parse_ws_ohlcvrg   rx   )rN   rp   ry   ra   r   r   r   rawTimeframer   r|   	wsOptionsr@   unifiedTimeframer   r   ohlcvr   resolveDatari   s                      rP   handle_ohlcvzderibit.handle_ohlcv  s   & 266""69b99c""##E1--''q11!!(++!NN4<r::	^^I|R@@
..|ZHH"nnT[&"EEF??4;v.0@AAI%%dlL$GGE4I%4P4PDK 01V$%56vvr22$$UF33f06F,-/8%.4|C{K00000rQ   c           	         |                      |d          |                     |d          |                     |d          |                     |d          |                     |d          |                     |d          gS )Ntickopenhighlowclosevolume)rV   safe_number)rN   r   r   s      rP   r   zderibit.parse_ws_ohlcv  s     eV,,UF++UF++UE**UG,,UH--
 	
rQ   channelNamechannelDescriptorc                   K   |                                   d {V  | j        d         d         }g }g }|dk    }|r|                     |d          n|}	|                     |	d d           t	          dt          |                    D ]}
||
         }d }|rB|                     |d                   }|d         }|                     | j        ||          }|}n|                     |          }|dz   |d         z   dz   |z   }|	                    |           |	                    |d	z   |d
         z   d	z   |z              ddd|i| 
                                d}|                     ||          }d}|                     |          }t          |          |k    rt          | j        dz             |                     ||||           d {V S )Nr"   r   r   r   FrT   r   rb   r   r|   r[   r   r]   r^   i  zG requested subscription length over limit, try to reduce symbols amount)r   rG   get_list_from_object_valuesmarket_symbolsre   rf   r   ru   r@   rg   rW   rK   jsonr   rb   watch_multiple)rN   r  r  symbolsArrayra   rj   rawSubscriptionsmessageHashesisOHLCVr   rk   currentr   	unifiedTfrawTfry   rn   extendedRequestmaxMessageByteLimit
jsonedTexts                       rP   r   zderibit.watch_multiple_wrapper  s$     !!!!!!!!!it$.0GN`$22<CCCT`GT5111q#l++,, 	a 	aA"1oGF .WQZ00#AJ	(()YOO$)!!W--!C'&,6<?PPG##G,,,  s!2VH5E!E!KN_!_````(, //##
 
 **7F;;'YY//
z??111*s sttt((m_N^_________rQ   c                 (   |                      |d          }|-t          | j        dz   |                     |          z             |                      |d          }|                     |d          }||                    d          }|                     |d          }| j        | j        | j        d}| j	        | j
        | j        | j        |                      ||                     |d                    d	}	|                      |	|          }
|
 |
||           d S t          | j        d
z   |                     |          z             |                      |di           }|                     |d          }||                     ||           d S d S )Nerror ra   r   r   r   )r   	portfolior   rT   )r   r   r   chartuserz# no handler found for self message resultaccess_token)rd   r   rb   r  ru   r   r   r{   r   r   r   r   r  r   handle_authentication_message)rN   rp   ry   r  ra   r   r   	channelIduserHandlershandlershandlerr"  accessTokens                rP   handle_messagezderibit.handle_message  s   x 11#		%0@0@ @AAA(33""6955MM#&&E((22I/!0, L ,.,*d6F6Fua6P6PQQ H ooh	::G"(((tw)NNQUQZQZ[bQcQccddd(B77&&v~>>"..vw????? #"rQ   c                 6    d}|                     ||           |S )Nauthenticated)rx   )rN   rp   ry   ri   s       rP   r$  z%deribit.handle_authentication_messageK  s"    $ &w,,,rQ   c           
        K   | j         d         d         }|                     |          }|                                 }|                     |          }|}d}|                     |j        |          }||                                  |                                 }	|                     | 	                    |dz   |z   dz             | 	                    | j
                  t          j                  }
d|	dd| j        ||
|dd	d
}|                     |||                     ||          |           d {V }||j        |<   |S )Nr"   r   r,  
r[   zpublic/authclient_signaturer   )
grant_type	client_idr   	signaturer   rr   )r_   rb   r`   ra   )rG   rp   millisecondsnumber_to_stringrd   subscriptionscheck_required_credentialsrW   hmacencodesecrethashlibsha256apiKeyrh   extend)rN   ra   rj   rp   time
timeStringr   ri   futurerS   r2  rn   s               rP   rc   zderibit.authenticatea  sX     it$S!!  ""**400
%!5{CC>++---))I		$++j4.?%.G$.N"O"OQUQ\Q\]a]hQiQikrkyzzI '"4!%!%!*" 	 G  ::c;GV8T8TVabbbbbbbbF06F -rQ   )N)*__name__
__module____qualname__rM   rW   r   ro   r   r{   strr   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   r   r*  r$  rc   __classcell__)rO   s   @rP   r   r      s       9 9 9 9 9v  
 *, Q Q Q Q Q Q442V 42 42 42 42l 68 I I IF I I I I:%,F %, %, %, %,N <@d[] S S SS S Sbfglbm S S S S OSaenp S Sd3i S S[^ Suyz  vA S S S S*(9F (9 (9 (9 (9T 37TX\eg U UC Us URU Ulpqvlw U U U U>/.v /. /. /. /.b @DB P PS P PS\ P P P P SW_a ! !$s) !C !fo ! ! ! !6M5 M5 M5 M5 M5^  - - -3 3 3 04$UYbd  U  U  UC  Us  Uimnsit  U  U  U  UD2-F 2- 2- 2- 2-h 8<$]ajl ) ) )C )WZ )quvzq{ ) ) ) )  aesw  AC E E$tCy/ EZ] Emp E E E E&)16 )1 )1 )1 )1V
 
D 
 
 
 
* cgoq "` "` "`PS "` "` "` "`HX@V X@ X@ X@ X@tF    , )+        rQ   r   )ccxt.async_supportccxt ccxt.async_support.base.ws.cacher   r   r   r:  ccxt.base.typesr   r   r   r	   r
   r   r   !ccxt.async_support.base.ws.clientr   typingr   ccxt.base.errorsr   r   r   async_supportr    rQ   rP   <module>rO     s       f f f f f f f f f f  O O O O O O O O O O O O O O O O O O 4 4 4 4 4 4       * * * * * * . . . . . . ) ) ) ) ) )k k k k kd ( k k k k krQ   