
    E#i                         S SK rS SKJrJrJr  S SKrS SKJrJ	r	J
r
JrJrJrJrJr  S SKJr  S SKJr  S SKJr   " S S\R,                  R.                  5      rg)	    N)
ArrayCacheArrayCacheBySymbolByIdArrayCacheByTimestamp)AnyBalancesIntOrder	OrderBookStrTickerTrade)Client)List)ExchangeErrorc                     ^  \ rS rSrS\4U 4S jjrS rSSS0 4S\S\S	\S
\S\	\
   4
S jjrSSS0 4S\S\S	\S
\S\	\
   4
S jjrS r0 4S\S\4S jjr0 4S\S\4S jjrS rS%S jrSS0 4S\S	\S
\S\	\   4S jjrSS0 4S\S	\S
\S\	\   4S jjrS rS%S jrSSS0 4S\S	\S
\S\	\   4S jjrS rS%S jrS r0 4S\4S jjrS\ 4S jr!S0 4S\S
\S\"4S jjr#S0 4S\S
\S\"4S jjr$S r%S  r&S\ 4S! jr'S" r(0 4S# jr)S$r*U =r+$ )&lbank   returnc                    > U R                  [        [        U ]  5       SSSSSSSSSSSSSSS.SSS00SSS	S
SSSSSSSSS.
000 0 S.5      $ )NTF)wsfetchOHLCVWsfetchOrderBookWsfetchTickerWsfetchTradesWswatchBalancewatchTickerwatchTickerswatchTradeswatchTradesForSymbolswatchMyTradeswatchOrderswatchOrderBook
watchOHLCVapir   zwss://www.lbkex.net/ws/V2/r#   
timeframes1min5min15min30min1hr4hrdayweekmonthyear)
1m5m15m30m1h4h1d1w1M1y)hasurlsoptions	streaming
exceptions)deep_extendsuperr   describe)self	__class__s    H/home/james-whalen/.local/lib/python3.13/site-packages/ccxt/pro/lbank.pyrA   lbank.describe   s    eT ; = $$(!%!% $# %#).!&#"&"" 6  $$&&###$%$# Q*@
 * *	    c                     U R                  U R                  SS5      nU R                  US5      nX R                  S'   U$ )N	requestIdr      )safe_integerr<   sum)rB   previousValuenewValues      rD   
request_idlbank.request_id>   s;    ))$,,QG88M1-$,[!rF   r0   Nsymbol	timeframesincelimitc                 0  #    U R                  5       I Sh  vN   U R                  U5      nU R                  S   S   nU R                  U R                  S0 5      nU R                  US0 5      n	U R                  XU5      n
SUS   -   S-   U
-   nS	S
U
US   S.nUb4  U R                  [        [        R                  " US-  5      5      5      US'   Ub  XLS'   U R                  X5      nU R                  5       nU R                  X{XU5      I Sh  vN $  N N7f)ad  

https://www.lbank.com/en-US/docs/index.html#request-amp-subscription-instruction

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
Nr$   r   r#   r%   fetchOHLCV:rP   :requestkbarid)actionrW   rX   pair  startsize)load_marketsmarketr;   
safe_valuer<   safe_stringparse_to_intintmathfloorr?   rN   watch)rB   rP   rQ   rR   rS   paramsr`   urlwatchOHLCVOptionsr%   timeframeIdmessageHashmessagerW   rH   s                  rD   fetch_ohlcv_wslbank.fetch_ohlcv_wsD   s     !!!V$iit$ OODLL,K__%6bI
&&ziH#fX&66<{J4L	
 #00TZZ5M1NOGG#FO""73OO%	ZZ'gNNN' 	"& Os"   DDC6DDDDc                   #    U R                  5       I Sh  vN   U R                  U5      nU R                  U R                  S0 5      nU R                  US0 5      nU R	                  XU5      n	SUS   -   S-   U	-   n
U R
                  S   S   nS	S
U	US   S.nU R                  X5      nU R                  XX5      I Sh  vN nU R                  (       a  UR                  X5      nU R                  XUSS5      $  N N<7f)a[  

https://www.lbank.com/en-US/docs/index.html#subscription-of-k-line-data

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
Nr#   r%   ohlcv:rP   rV   r$   r   	subscriberX   rY   )rZ   rr   rX   r[   r   T)r_   r`   ra   r<   rb   r;   r?   rg   
newUpdatesgetLimitfilter_by_since_limit)rB   rP   rQ   rR   rS   rh   r`   rj   r%   rk   rl   ri   rr   rW   ohlcvs                  rD   watch_ohlcvlbank.watch_ohlcvf   s     !!!V$ OODLL,K__%6bI
&&ziH!11C7+Eiit$!4L	
	 ""95jj7HH??NN61E))%q$GG# 	" Is"   C=C9B'C=>C;?;C=;C=c           	      >   U R                  US5      nU R                  US S5      nU R                  U R                  S0 5      nU R                  US0 5      nU R                  US5      nUGbQ  U R                  US/ 5      nU R	                  US5      U R                  US5      U R                  US5      U R                  US	5      U R                  US
5      U R                  US5      /n	U R                  US5      n
U R                  X5      nU R                  U R                  U0 5      U R                  U'   U R                  U R                  U   U5      nUc9  U R	                  U R                  SS5      n[        U5      nXR                  U   U'   UR                  U	5        SU-   S-   U
-   nUR                  X5        g U R                  US0 5      nU R                  US5      n
U R                  US5      nU R                  U5      U R                  US5      U R                  US5      U R                  US5      U R                  US5      U R                  US5      /n	U R                  X5      nU R                  U R                  U0 5      U R                  U'   U R                  U R                  U   U5      nUc9  U R	                  U R                  SS5      n[        U5      nXR                  U   U'   UR                  U	5        SU-   S-   U
-   nUR                  X5        g )Nr[   _r#   r%   recordsr   rI               rX   
OHLCVLimitr\   rU   rV   slottohlcvrq   )rb   safe_symbolra   r<   rJ   safe_numberfind_timeframeohlcvsr   appendresolve	parse8601)rB   clientrm   marketIdrP   rj   r%   r{   rawOHLCVparsedrk   rQ   storedrS   rl   datetimes                   rD   handle_ohlcvlbank.handle_ohlcv   s   h ##GV4!!(D#6 OODLL,K__%6bI
//'95w26H!!(A.  1-  1-  1-  1-  1-F **7F;K++KDI"&//$++vr"JDKK__T[[%8)DF~))$,,dK.u517F#I.MM&!'&036DKNN6/w;H**8V<K''#6Hx(  3/  3/  3/  3/  3/F ++KDI"&//$++vr"JDKK__T[[%8)DF~))$,,dK.u517F#I.MM&!"V+c1K?KNN6/rF   c                 "  #    U R                  5       I Sh  vN   U R                  U5      nU R                  S   S   nSUS   -   nSSUS   S	.nU R                  Xb5      nU R	                  5       nU R                  XEXxU5      I Sh  vN $  Nt N7f)
a  

https://www.lbank.com/en-US/docs/index.html#request-amp-subscription-instruction

fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
:param str symbol: unified symbol of the market to fetch the ticker for
:param dict [params]: extra parameters specific to the cex api endpoint
:returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
Nr$   r   fetchTicker:rP   rW   tickrY   )rZ   rW   r[   r_   r`   r;   r?   rN   rg   )	rB   rP   rh   r`   ri   rl   rm   rW   rH   s	            rD   fetch_ticker_wslbank.fetch_ticker_ws   s      !!!V$iit$$vh'774L

 ""73OO%	ZZ'gNNN 	" Os"   BBA/BBBBc                   #    U R                  5       I Sh  vN   U R                  U5      nU R                  S   S   nSUS   -   nSSUS   S	.nU R                  Xb5      nU R	                  XEXuU5      I Sh  vN $  Nd N7f)
a  

https://www.lbank.com/en-US/docs/index.html#market

watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
:param str symbol: unified symbol of the market to fetch the ticker for
:param dict params: extra parameters specific to the lbank api endpoint
:returns dict: a `ticker structure <https://docs.ccxt.com/en/latest/manual.html#ticker-structure>`
Nr$   r   ticker:rP   rr   r   rY   rZ   rr   r[   )r_   r`   r;   r?   rg   )rB   rP   rh   r`   ri   rl   rm   rW   s           rD   watch_tickerlbank.watch_ticker  s      !!!V$iit$&"22!4L

 ""73ZZ'PPP 	" Qs"   A?A;AA?6A=7A?=A?c                    U R                  US5      nU R                  U5      nU R                  U5      nU R                  X%5      nX`R                  U'   SU-   nUR                  Xg5        SU-   nUR                  Xg5        g )Nr[   r   r   )rb   r   safe_marketparse_ws_tickertickersr   )rB   r   rm   r   rP   r`   parsedTickerrl   s           rD   handle_tickerlbank.handle_ticker  s~    , ##GV4!!(+!!(+++G<+V&(|1$v-|1rF   c                    U R                  US5      nU R                  X25      nU R                  US5      nU R                  US5      nU R                  0 SU_SU R	                  U5      _SU_SU R                  US5      _SU R                  US5      _S	S _S
S _SS _SS _SS _SS _SS _SU R                  US5      _SS _SS _SU R                  US5      _SS _U R                  US5      U R                  US5      US.EU5      $ )Nr[   TSr   rP   	timestampr   highlowbid	bidVolumeask	askVolumevwapopencloselastlatestpreviousClosechange
percentageaveragevolturnover)
baseVolumequoteVolumeinfo)rb   r   ra   safe_tickerr   )rB   tickerr`   r   rP   r   
tickerDatas          rD   r   lbank.parse_ws_ticker8  s   , ##FF3!!(3##FD1__VV4
 !
f!
1!
 !
 D$$Z8	!

 4##J6!
 4!
 !
 4!
 !
 D!
 D!
 T!
 D$$Z:!
 T!
 d!
  $**:x@!!
" t#!
$ **:u=++J
C)!
* + 	rF   c                 .  #    U R                  5       I Sh  vN   U R                  U5      nU R                  S   S   nSUS   -   nUc  SnSSUS	   US
.nU R                  X5      n	U R	                  5       n
U R                  XgXU	5      I Sh  vN $  Nz N7f)a  
get the list of most recent trades for a particular symbol

https://www.lbank.com/en-US/docs/index.html#request-amp-subscription-instruction

:param str symbol: unified symbol of the market to fetch trades for
:param int [since]: timestamp in ms of the earliest trade to fetch
:param int [limit]: the maximum amount of trades to fetch
:param dict [params]: extra parameters specific to the exchange API endpoint
:returns Trade[]: a list of `trade structures <https://docs.ccxt.com/#/?id=public-trades>`
Nr$   r   fetchTrades:rP   
   rW   traderY   )rZ   rW   r[   r^   r   )rB   rP   rR   rS   rh   r`   ri   rl   rm   rW   rH   s              rD   fetch_trades_wslbank.fetch_trades_wsi  s      !!!V$iit$$vh'77=E4L	
 ""73OO%	ZZ'gNNN 	" Os"   BBA5BBBBc                 *  #    U R                  5       I Sh  vN   U R                  U5      nU R                  S   S   nSUS   -   nSSUS   S	.nU R                  X5      n	U R	                  XgXU	5      I Sh  vN n
U R                  XUS
S5      $  Nx N7f)a  

https://www.lbank.com/en-US/docs/index.html#trade-record

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>`
Nr$   r   trades:rP   rr   r   rY   r   r   T)r_   r`   r;   r?   rg   ru   )rB   rP   rR   rS   rh   r`   ri   rl   rm   rW   tradess              rD   watch_tradeslbank.watch_trades  s      !!!V$iit$&"22! 4L

 ""73zz#G'RR))&TRR 	" Ss"   BBAB6B7BBc                    U R                  US5      nU R                  U5      nU R                  U5      nU R                  U R                  U5      nUc6  U R                  U R                  SS5      n[        U5      nX`R                  U'   U R                  US5      nU R                  USU/5      n	[        S[        U	5      5       H,  n
U R                  X   U5      nXKS'   UR                  U5        M.     X`R                  U'   SU-   nUR                  U R                  U   U5        S	U-   nUR                  U R                  U   U5        g )
Nr[   tradesLimitr\   r   r   r   rP   r   r   )rb   r   r   ra   r   rJ   r<   r   rangelenparse_ws_trader   r   )rB   r   rm   r   rP   r`   r   rS   rawTrade	rawTradesir   rl   s                rD   handle_tradeslbank.handle_trades  s-   6 ##GV4!!(+!!(+f5>%%dllM4HE&F"(KK??7G4OOGXzB	q#i.)A''	f=E$(OMM%  * %F&(t{{6*K8$v-t{{6*K8rF   c                    U R                  US5      nUb  U R                  U5      OU R                  US5      nUc  U R                  U5      nU R	                  USS5      nUR                  S5      nU R                  US5      nU R                  US5      nUn	Ub  US:X  a
  U	S:X  a  S	OSn	U R                  UUS S S S S U	U R	                  US
S5      U R	                  USS5      U R                  US5      S US.U5      $ )Nr   r   	directionr}   rz   rI   makerbuysellpricevolumer|   amount)r   r   rP   rY   ordertypetakerOrMakersider   r   costfeer   )rJ   iso8601rb   r   safe_string_2split
safe_trade)
rB   r   r`   r   r   rawSideparts	firstPart
secondPartr   s
             rD   r   lbank.parse_ws_trade  s     %%eQ/	1:1FDLL+dN^N^_dfjNkx0I$$UK;c"$$UA.	%%eQ/
!jG&;"em6%D"  ''w:((!<$$UH5 
  	rF   c                   #    U R                  5       I Sh  vN   U R                  U5      I Sh  vN nU R                  S   S   nSnSnUc  SnO/U R                  U5      n	U R	                  U5      nSU	S   -   nU	S   nS	S
UUS.n
U R                  X5      nU R                  XgXU5      I Sh  vN nU R                  XX#S5      $  N N N7f)a  

https://www.lbank.com/en-US/docs/index.html#update-subscribed-orders

get the list of trades associated with the user
: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 lbank api endpoint
:returns dict[]: a list of `trade structures <https://docs.ccxt.com/#/?id=public-trades>`
Nr$   r   allz
orders:allorders:rP   rY   rr   orderUpdate)rZ   rr   subscribeKeyr[   T)r_   authenticater;   r`   rP   r?   rg   filter_by_symbol_since_limit)rB   rP   rR   rS   rh   keyri   rl   r[   r`   rm   rW   orderss                rD   watch_orderslbank.watch_orders  s      !!!%%f--iit$>&K[[(F[[(F#fX&66K$<D!&	
 ""73zz#G'RR00tTT) 	"-$ Ss2   CCCCA=C-C	.CC	Cc                 v   U R                  US5      nU R                  US S5      nS nU R                  c)  U R                  U R                  SS5      n[        U5      nOU R                  nU R                  U5      nUR                  U5        XPl        UR                  US5        SU-   nUR                  XX5        g )Nr[   rz   ordersLimitr\   r   r   )	rb   r   r   rJ   r<   r   parse_ws_orderr   r   )	rB   r   rm   r   rP   myOrdersrS   r   rl   s	            rD   handle_orderslbank.handle_orders  s    & ##GV4!!(D#6;;%%dllM4HE-e4H{{H##G,x*&(x-rF   c           	         U R                  US0 5      nU R                  USS5      nUR                  S5      nU R                  US5      nU R                  US5      nS nUS:w  a  US:w  a
  US	:X  a  S	OS
nU R                  US5      n	U R                  XS5      n
U R	                  US5      nU R                  US5      nU R                  US5      nS nUS	:X  a  US:X  a  UnU R                  0 SU_SU R                  US5      _SU R                  US5      _SU_SU R                  U5      _SS _SU R	                  US5      _SU
_SU_SU_SU R                  USS5      _SS _SU R                  US5      _SU R                  USS5      _S U R                  US!5      _S"U R                  US#5      _S$U R                  U5      _S US S%.EU5      $ )&Nr   r    rz   r   rI   r   r   r`   rS   r[   
updateTimeorderStatusorderAmtr   rY   uuidclientOrderId
customerIDr   r   lastTradeTimestamplastUpdateTimestamprP   r   r   
orderPrice	stopPricer   avgPricer   	remaining	remainAmtfilledaccAmtstatus)r   r   r   )	ra   rb   r   r   rJ   
safe_orderr   r   parse_ws_order_status)rB   r   r`   r   rawType	typePartsr   exchangeTyper   r   rP   r   r  orderAmountr   s                  rD   r   lbank.parse_ws_order:  sd   T ooe]B?"";;MM#&		1-''	15e6 1 , 88wD##E62!!(C8%%k<@	!!+}=&&{J?H45=D  
E 
$"";7 
 T--k<H 
 	 

 Y/ 
 !$ 
 "4#4#4[,#O 
 f 
 D 
 D 
 T''WlK 
  
 t''Z@ 
 d((h
K 
 ))+{C 
  d&&{H=! 
" d008# 
$ ) 
* + 	rF   c                 6    SSSSSS.nU R                  X!U5      $ )Ncanceledr   closed)z-10124)rb   )rB   r  statusess      rD   r  lbank.parse_ws_order_status  s-    
 &99rF   c                   #    U R                  5       I Sh  vN   U R                  U5      I Sh  vN nU R                  S   S   nSnSSUS.nU R                  XQ5      nU R	                  X4XdU5      I Sh  vN $  Nc NL N7f)a=  
watch balance and get the amount of funds available for trading or funds locked in orders

https://www.lbank.com/docs/index.html#update-subscribed-asset

:param dict [params]: extra parameters specific to the exchange API endpoint
:returns dict: a `balance structure <https://docs.ccxt.com/#/?id=balance-structure>`
Nr$   r   balancerr   assetUpdate)rZ   rr   r   )r_   r   r;   r?   rg   )rB   rh   r   ri   rl   rm   rW   s          rD   watch_balancelbank.watch_balance  s      !!!%%f--iit$!&

 ""73ZZ'PPP 	"- Qs2   B A:B A<AB 5A>6B <B >B r   c                 Z   U R                  US0 5      nU R                  U R                  US5      5      nU R                  U5      nX0R                  S'   X@R                  S'   XPR                  S'   U R                  US5      nU R                  U5      nU R                  5       nU R                  US5      US'   U R                  US5      US	'   U R                  US
5      US'   XR                  U'   U R                  U R                  5      U l        UR                  U R                  S5        g )Ndatar   r   r   r   	assetCodefreefreezeusedassettotalr$  )		safe_dictr   rb   r   r$  safe_currency_codeaccountsafe_balancer   )	rB   r   rm   r)  r   r   
currencyIdcoder2  s	            rD   handle_balancelbank.handle_balance  s     ~~gvr2NN4#3#3GT#BC	<<	*#V$-[!#+Z %%dK8
&&z2,,.**48**4:++D':$T((6t||Y/rF   c                 ,  #    U R                  5       I Sh  vN   U R                  U5      nU R                  S   S   nSUS   -   nUc  SnSSUUS	   S
.nU R                  Xs5      nU R	                  XVX5      I Sh  vN n	U	R                  5       $  Ny N7f)a$  

https://www.lbank.com/en-US/docs/index.html#request-amp-subscription-instruction

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|None limit: the maximum amount of order book entries to return
:param dict params: extra parameters specific to the lbank api endpoint
:returns dict: A dictionary of `order book structures <https://docs.ccxt.com/en/latest/manual.html#order-book-structure>` indexed by market symbols
Nr$   r   fetchOrderbook:rP   d   rW   depthrY   )rZ   rW   r;  r[   )r_   r`   r;   r?   rg   rS   
rB   rP   rS   rh   r`   ri   rl   rr   rW   	orderbooks
             rD   fetch_order_book_wslbank.fetch_order_book_ws  s      !!!V$iit$'&*::=E4L	
	 ""95**SwLL	   	" Ms"   BBA$B;B<BBc                 P  #    U R                  5       I Sh  vN   U R                  U5      nU R                  S   S   nSUS   -   nU R                  US5      nUc  SnSS	UUS
   S.nU R	                  Xs5      nU R                  XVX5      I Sh  vN n	U	R                  5       $  N N7f)a  

https://www.lbank.com/en-US/docs/index.html#market-depth

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|None limit: the maximum amount of order book entries to return
:param dict params: extra parameters specific to the lbank api endpoint
:returns dict: A dictionary of `order book structures <https://docs.ccxt.com/en/latest/manual.html#order-book-structure>` indexed by market symbols
Nr$   r   
orderbook:rP   aggregationr:  rr   r;  rY   )rZ   rr   r;  r[   )r_   r`   r;   omitr?   rg   rS   r<  s
             rD   watch_order_booklbank.watch_order_book  s      !!!V$iit$"VH%556=1=E! 4L	
	 ""95**SwLL	   	" Ms"   B&B"A6B&B$B&$B&c                    U R                  US5      nU R                  U5      nU R                  USU5      nU R                  US5      nU R                  U5      nX@R                  ;  a  U R                  0 5      U R                  U'   U R                  U   nU R                  XTUSS5      n	UR                  U	5        SU-   n
UR                  X5        SU-   n
UR                  X5        g )Nr[   r;  r   bidsasksrA  r9  )	rb   r   ra   r   
orderbooks
order_bookparse_order_bookresetr   )rB   r   rm   r   rP   	orderBookr   r   r=  snapshotrl   s              rD   handle_order_booklbank.handle_order_book  s    r ##GV4!!(+OOGWg>	##GT2NN8,	//)&*oob&9DOOF#OOF+	((IvvV!"V+y.'&0y.rF   c                     U R                  USS5      n[        U R                  S-   U-   5      nUR                  U5        g )Nrm   r   )rb   r   rY   reject)rB   r   rm   errMsgerrors        rD   handle_error_messagelbank.handle_error_messageJ  s;     !!'9b9dggmf45erF   c                    #    U R                  US5      n UR                  SUS.5      I S h  vN   g  N! [         a  nU R                  X5         S nAg S nAff = f7f)Npingpong)rZ   rZ  )rb   send	Exceptionon_error)rB   r   rm   pingIdes        rD   handle_pinglbank.handle_pingW  s_      !!'62	%++      	%MM&$$	%s6   A5 35 A5 
AAAAAc                    U R                  US5      nUS:X  a  U R                  X5        g U R                  USS5      nUS:X  a  U R                  U R                  X5        g U R
                  U R                  U R                  U R                  U R                  U R                  S.nU R                  XT5      nUb	  U" X5        g g )Nr  rU  r   rZ   rY  )rX   r;  r   r   r   r%  )rb   rV  r   spawnr`  r   rO  r   r   r   r6  ra   )rB   r   rm   r  r   handlershandlers          rD   handle_messagelbank.handle_messaged  s    !!'84W%%f6!!'68<6>JJt''9%%++''&&--..
 //(1F$ rF   c                   #    U R                   S   S   nU R                  U5      nU R                  5       nSnU R                  UR                  U5      nUc  U R                  5         U R                  U5      I S h  vN nU R                  US5      nUSLa  [        U R                  S-   5      eU R                  US5      U R                  US5      S	.UR                  S'   OU R                  US
S5      n	X:  az  SUS   0n
U R                  U R                  X5      5      I S h  vN nU R                  US5      nUS:w  a  [        U R                  S-   5      eU R                  US5      US   S   S
'   UR                  S   S   $  GN Nd7f)Nr$   r   authenticatedresultTz failed to get subscribe keyr)  iZ2 )r   expiresrk  r   r   r   truez# failed to refresh the SubscribeKeysubscriptions)r;   r   millisecondsra   rm  check_required_credentialsspotPrivatePostSubscribeGetKeyr   rY   rb   rK   rJ   "spotPrivatePostSubscribeRefreshKeyextend)rB   rh   ri   r   nowrl   ri  responserj  rk  rW   s              rD   r   lbank.authenticatey  s     iit$S!!%(<(<kJ ++-!@@HHH __Xx8FT!#DGG.L$LMM''&988C15F  1
 ''y!DG}"M%$8! "&!H!HU\Ie!ff ))(H=V#'2W(WXXFJhhsT[F\'8C##O4U;;3 I" gs&   A9F;F<B(F$F	%A"F	F)r$  r   )N),__name__
__module____qualname____firstlineno__r   rA   rN   strr   r   listrn   rw   r   r   r   r   r   r   r   r   r   r   r   r   r	   r   r   r   r  r   r&  r   r6  r
   r>  rD  rO  rV  r`  rf  r   __static_attributes____classcell__)rC   s   @rD   r   r      sY   +# +Z BFTXgktv  O3  O3  Oc  Oad  O{  AE  |F  OD ?CQUdhqs H H H3 H^a Hx|  ~B  yC H@c0J 9; OC Ov O. 68 Q QF Q,2@/b ?CQU^` OC O O3 Oeijoep O8 <@d[] S SS S Sbfglbm S2-9^'R 04$UYbd  U  UC  Us  Uimnsit  UD .DOb: *, Q Q*0V 0@ CGr ! !C !V_ !6 @DB !S ! !S\ !8G/R% %%* )+ #< #<rF   r   )ccxt.async_supportccxt ccxt.async_support.base.ws.cacher   r   r   re   ccxt.base.typesr   r   r   r	   r
   r   r   r   !ccxt.async_support.base.ws.clientr   typingr   ccxt.base.errorsr   async_supportr    rF   rD   <module>r     s?     f f  T T T 4  *M<D$$ M<rF   