
    E#iN                         S SK rS SKJrJr  S SKJrJrJrJ	r	J
r
JrJrJrJrJrJr  S SKJr  S SKJr  S SKJr  S SKJr  S SKJr   " S	 S
\R4                  R6                  5      rg)    N)ArrayCacheBySymbolByIdArrayCacheByTimestamp)AnyBalancesBoolIntOrder	OrderBookStrStringsTickerTickersTrade)Client)List)ExchangeError)NotSupported)Precisec                   ,  ^  \ rS rSrS\4U 4S jjr0 4S\4S jjrS r0 4S\	S\
4S jjrS0 4S	\S\4S
 jjrS\4S jrS+S jrSSS0 4S\S\S\S\\   4S jjrS0 4S\	S\S\4S jjrS\4S jrS rS rSSS0 4S\S\S\S\\   4S jjrS\4S jrS+S jrS r S\4S jr!S\4S jr"S r#S r$SSS0 4S\	S\	S\S\S\\%   4
S jjr&S\4S  jr'S+S! jr(S\4S" jr)S\4S# jr*S\S\+4S$ jr,S\4S% jr-S\4S& jr.S\4S' jr// 0 4S	\4S( jjr00 4S) jr1S*r2U =r3$ ),
onetrading   returnc                    > U R                  [        [        U ]  5       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
.SS	S
.SSS
.SS	S
.SS	S
.SS	S
.S.	S.0 0 S.5      $ )NTF)
wswatchBalancewatchTickerwatchTickerswatchTradeswatchTradesForSymbolswatchMyTradeswatchOrderswatchOrderBook
watchOHLCVapir   zwss://streams.onetrading.com/   MINUTES   )unitperiod         HOURS   DAYSWEEKSMONTHS)	1m5m15m30m1h4h1d1w1M)bp_remaining_quota
timeframes)hasurlsoptions	streaming
exceptions)deep_extendsuperr   describe)self	__class__s    M/home/james-whalen/.local/lib/python3.13/site-packages/ccxt/pro/onetrading.pyrD   onetrading.describe   s    j$ @ B $# $$).!%#"&" 9 '* !*"#
 !*"#
 !*"$
 !*"$
 !("#
 !("#
 !'"#
 !("#
 !)"#C%(R{?E
 ? ?	    c                   #    U R                  U5      I Sh  vN   U R                  S   S   nSnSnU R                  U R                  SS5      nSUS	S0/S
.nU R	                  Xa5      nU R                  X#XtU5      I Sh  vN $  Nl N7f)aA  

https://developers.bitpanda.com/exchange/#account-history-channel

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$   r   balanceACCOUNT_HISTORYr;   r%   	SUBSCRIBEnametyper;   channels)authenticater>   safe_integerr?   rB   watch)rE   paramsurlmessageHashsubscribeHashbpRemainingQuota	subscriberequests           rG   watch_balanceonetrading.watch_balanceT   s      '''iit$),,T\\;OQTU"2 -
	 ""95ZZ''RRR 	( Ss"   BBA'B?B BBc                 l    U R                  U5      U l        SnUR                  U R                  U5        g )NrK   )parse_balancerK   resolve)rE   clientmessagerW   s       rG   handle_balance_snapshot"onetrading.handle_balance_snapshotn   s-    : ))'2t||[1rI   symbolc                    #    U R                  5       I Sh  vN   U R                  U5      nUS   nSnSU-   nSSSS./S.nU R                  XVXA/U5      I Sh  vN $  NF N7f)	a  

https://developers.bitpanda.com/exchange/#market-ticker-channel

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 exchange API endpoint
:returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
Nre   MARKET_TICKERticker.rM   INLINErN   price_points_moderP   rQ   )load_marketsmarket
watch_many)rE   re   rU   rn   subscriptionHashrW   r[   s          rG   watch_tickeronetrading.watch_ticker   s      !!!V$!*&( ,)1
 __[;KXW]^^^ 	" _s"   A!AAA!AA!A!Nsymbolsc                    #    U R                  5       I Sh  vN   U R                  U5      nUc  / nSnSnSSSS./S.nU R                  XEX1U5      I Sh  vN nU R                  USU5      $  NU N7f)	a  

https://developers.bitpanda.com/exchange/#market-ticker-channel

watches price tickers, a statistical calculation with the information for all markets or those specified.
:param str symbols: unified symbols of the markets to fetch the ticker for
:param dict [params]: extra parameters specific to the exchange API endpoint
:returns dict: an array of `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
Nrg   tickersrM   ri   rj   rl   re   )rm   market_symbolsro   filter_by_array)rE   rs   rU   rp   rW   r[   ru   s          rG   watch_tickersonetrading.watch_tickers   s      !!!%%g.?G* ,)1
 >NY_``##GXw??! 	" as!   A0A,=A0A.A0.A0ra   c                    U R                  US/ 5      nU R                  US5      n[        S[        U5      5       H  nX5   nU R                  US5      nU R	                  U5      nU R                  U5      U R                  U'   U R                  U5      n	XR                  U   S'   U R                  U	5      U R                  U   S'   UR                  U R                  U   SU-   5        M     UR                  U R                  S5        g )	Nticker_updatestimer   
instrument	timestampdatetimerh   ru   )

safe_valuesafe_stringrangelensafe_symbolparse_ws_tickerru   	parse8601iso8601r`   )
rE   ra   rb   ru   r   itickermarketIdre   r~   s
             rG   handle_tickeronetrading.handle_ticker   s    " //'+;R@##GV4q#g,'AZF''=H%%h/F#'#7#7#?DLL x0I09LL -/3||I/FDLL ,NN4<</V1CD ( 	t||Y/rI   c                    U R                  US5      nU R                  0 SU R                  X25      _SS _SS _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U R                  US5      _SU R                  US5      _SS _SU R                  US5      _SU R                  US5      _SS _S U R                  US5      US.EU5      $ )Nr}   re   r~   r   highlowbid	bidVolumeask	askVolumevwapopenclose
last_pricelastpreviousClosechangeprice_change
percentageprice_change_percentageaveragevolume)
baseVolumequoteVolumeinfo)r   safe_tickerr   safe_number)rE   r   rn   r   s       rG   r   onetrading.parse_ws_ticker   sr    ##FL9 !
d&&x8!
!
 !
 D$$VV4	!

 4##FE2!
 4!
 !
 4!
 !
 D!
 D!
 T%%fl;!
 D$$V\:!
 T!
 d&&v~>!
  $**63LM!!
" t#!
$ ++FH=)!
* + 	rI   sincelimitc                 R  #    U R                  5       I Sh  vN   SnUb  U R                  U5      nUS   nUSU-   -  nU R                  U5      I Sh  vN   U R                  S   S   nSnU R	                  U R
                  SS	5      n	S
U	SS0/S.n
U R                  X5      nU R                  XuXU5      I Sh  vN nU R                  (       a  UR                  X5      nU R                  XX#5      n[        U5      nUS:X  a  U R                  XX45      I Sh  vN $ U$  GN N Nj N7f)a  

https://developers.bitpanda.com/exchange/#account-history-channel

get the list of trades associated with the user
: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
:returns dict[]: a list of `trade structures <https://docs.ccxt.com/#/?id=public-trades>`
NmyTradesre   :r$   r   rL   r;   r%   rM   rN   rO   r   )rm   rn   rR   r>   rS   r?   rB   rT   
newUpdatesgetLimitfilter_by_symbol_since_limitr   watch_my_trades)rE   re   r   r   rU   rW   rn   rV   rX   rY   rZ   r[   trades	numTradess                 rG   r   onetrading.watch_my_trades  s?     !!! [[(FH%F3<'K'''iit$),,T\\;OQTU"2 -
	 ""95zz#GGTT??OOF2E2265PK	>--fUKKK7 	" 	( U LsG   D'D;D'D!A%D'8D#9AD'D%D'!D'#D'%D'c                    #    U R                  5       I Sh  vN   U R                  U5      nUS   nSU-   nSnSnUb  UnSSUS./S.nU R                  XXXa/U5      I Sh  vN n	U	R                  5       $  N] N7f)	a  

https://developers.bitpanda.com/exchange/#market-ticker-channel

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
:returns dict: A dictionary of `order book structures <https://docs.ccxt.com/#/?id=order-book-structure>` indexed by market symbols
Nre   book:
ORDER_BOOKr   rM   )rN   depthrl   )rm   rn   ro   r   )
rE   re   r   rU   rn   rW   rp   r   r[   	orderbooks
             rG   watch_order_bookonetrading.watch_order_book0  s      !!!V$!&'E )"
 //+@PRZ\bcc	  % 	"" ds"   A8A4AA8A6 A86A8c                 x   U R                  US5      nU R                  US5      nU R                  U5      nU R                  US5      nU R                  U5      nSU-   nU R                  U R                  U5      n	U	c  U R                  0 5      n	US:X  a&  U R                  X%USS5      n
U	R                  U
5        OFUS:X  a%  U R                  US	/ 5      nU R                  X5        O[        U R                  S
-   U-   5      eXyS'   XyS'   U R                  U5      U	S'   XR                  U'   UR                  X5        g )NrP   instrument_coder|   r   ORDER_BOOK_SNAPSHOTbidsasksORDER_BOOK_UPDATEchangesz1 watchOrderBook() did not recognize message type noncer~   r   )r   r   r   r   
orderbooks
order_bookparse_order_bookresethandle_deltasr   idr   r`   )rE   ra   rb   rP   r   re   dateTimer~   channelr   snapshotr   s               rG   handle_order_bookonetrading.handle_order_bookO  s6   : 0##G->?!!(+##GV4NN8,	F"OODOOV<	+I((,,WiQWXHOOH%((oogy"=Gy2tww)\\_ccdd&'!*+ $Y 7	*"+y*rI   c                    U R                  USS5      nU R                  US5      nUS:X  a  US   nUR                  U5        g US:X  a  US   nUR                  U5        g [        U R                  S-   U R                  U5      -   5      e)	Nr'      r   BUYr   SELLr   z/ watchOrderBook() received unknown change type )parse_bid_askr   
storeArrayr   r   json)rE   r   deltabidAskrP   r   r   s          rG   handle_deltaonetrading.handle_delta  s     ##E1a0q)5=V$DOOF#V^V$DOOF#tww)ZZ]a]f]fgl]mmnnrI   c                 d    [        S[        U5      5       H  nU R                  XU   5        M     g )Nr   )r   r   r   )rE   r   deltasr   s       rG   r   onetrading.handle_deltas  s+     q#f+&Ai3 'rI   c                 t  #    U R                  5       I Sh  vN   SnUb  U R                  U5      nUS   nUSU-   -  nU R                  U5      I Sh  vN   U R                  S   S   nU R	                  USS5      nU R                  U R                  S	S
5      n	SU	SU0/S.n
U R                  X5      nU R                  XuXU5      I Sh  vN nU R                  (       a  UR                  X5      nU R                  XX#5      n[        U5      nUS:X  a  U R                  XX45      I Sh  vN $ U$  GN N Nj N7f)aK  

https://developers.bitpanda.com/exchange/#account-history-channel

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 [params.channel]: can listen to orders using ACCOUNT_HISTORY or TRADING
:returns dict[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
Nordersre   r   r$   r   r   rL   r;   r%   rM   rN   rO   r   )rm   rn   rR   r>   r   rS   r?   rB   rT   r   r   r   r   watch_orders)rE   re   r   r   rU   rW   rn   rV   rX   rY   rZ   r[   r   	numOrderss                 rG   r   onetrading.watch_orders  sN     !!![[(FH%F3<'K'''iit$((<MN,,T\\;OQTU"2 M
	 ""95zz#GGTT??OOF2E2265PK	>**6%HHH7 	" 	( U IsG   D8D/;D8D2A6D8	D4
AD8(D6)D82D84D86D8c                 P   U R                   c-  U R                  U R                  SS5      n[        U5      U l         U R	                  U5      nU R                   nUR                  U5        UR                  U R                   SUS   -   5        UR                  U R                   S5        g )NordersLimit  orders:re   r   )r   rS   r?   r   parse_trading_orderappendr`   )rE   ra   rb   r   orderr   s         rG   handle_tradingonetrading.handle_trading  s    Z ;;%%dllM4HE07DK((1et{{Ih$?@t{{H-rI   c           
      D   U R                  US5      nU R                  US5      nU R                  XBS5      nU R                  0 SU R                  US5      _SU R                  US5      _SU_S	U R                  U5      _S
U_SS _SU_SS _SS _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S _SS _SS _U R                  US5      U R                  U R                  US5      5      S S S.EU5      $ )Nr|   r   _r   order_idclientOrderId	client_idr   r~   r   lastTradeTimestampre   rP   timeInForcepostOnlysidepricematched_price	stopPricetrigger_priceamountcostr   filled	remainingstatus)r   r   feer   )r   r   
safe_orderr   safe_string_lowersafe_number_2r   parse_trading_order_status)rE   r   rn   r   r   re   s         rG   r   onetrading.parse_trading_order  s   j ##E62##E+<=!!(C8  
$""5*5 
T--e[A 
 E 
 1	 

  
 !$ 
 f 
 D 
 4 
  
 D**5&9 
 T''wH 
 ))%A 
 d&&uh7 
 D 
  t! 
" d# 
$ ))%=55d6F6Fuh6WX+ 
, - 	rI   c                 :    SSSSSSSS.nU R                  X!U5      $ )Ncanceledrejectedclosed)	CANCELLED
SELF_TRADEFILLED_FULLYINSUFFICIENT_FUNDSINSUFFICIENT_LIQUIDITYTIME_TO_MARKET_EXCEEDEDLAST_PRICE_UNKNOWNr   rE   r   statusess      rG   r   %onetrading.parse_trading_order_statusl  s3    #$$",&0'1",
 &99rI   c                    U R                   c-  U R                  U R                  SS5      n[        U5      U l         U R                  c-  U R                  U R                  SS5      n[        U5      U l        U R                  US/ 5      n[        U5      nUS:X  a  g U R                   n[        S[        U5      5       H  nU R                  XG   5      nU R                  USS5      n	UR                  U5        UR                  U R                   SU	-   5        U R                  XG   S	/ 5      n
[        S[        U
5      5       Hc  nU R                  X   5      nU R                  USU	5      n	U R                  R                  U5        UR                  U R                  S
U	-   5        Me     M     UR                  U R                   S5        UR                  U R                  S5        g )Nr   r   tradesLimitr   r   re    r   r   	myTrades:r   )r   rS   r?   r   r   r   r   r   parse_orderr   r   r`   parse_trade)rE   ra   rb   r   	rawOrdersrawOrdersLengthr   r   r   re   	rawTradesiitrades                rG   handle_ordersonetrading.handle_ordersx  s   p ;;%%dllM4HE07DK== %%dllM4HE259DMOOGXr:	i.aq#i.)A$$Y\2E%%eXr:FMM% NN4;;	F(:;	hCIAs9~.((7))%6B$$U+t}}kF.BC	 / * 	t{{H-t}}j1rI   c                    U R                   c-  U R                  U R                  SS5      n[        U5      U l         U R                  c-  U R                  U R                  SS5      n[        U5      U l        S nU R                   nU R                  US0 5      nU R                  US5      nUS:X  d  US:X  d  US:X  a  U R                  US	5      nU R                  US
S5      n	U R                  U R                   SUS5      n
U R                  U
S0 5      nUS   nU R                  US5      nU R                  U5      nUS:X  a  [        R                  " US5      (       a  SnUUUU R                  U	5      U	S.nUR                  U5        O5U R                  U5      nU R                  USS5      nUR                  U5        UR                  U R                   SU-   5        UR                  U R                   S5        / SQn[!        S[#        U5      5       H.  nU R                  UUU   5      nUc  M  U R%                  U5        M0     UR                  U R&                  S5        US:X  a}  U R)                  U5      nU R                  USS5      nU R                  nUR                  U5        UR                  U R                  SU-   5        UR                  U R                  S5        g g )Nr   r   r  updaterP   ORDER_REJECTEDORDER_CLOSEDSTOP_ORDER_TRIGGEREDr   r|   r~   r   Fr   re   filled_amount0r  )r   re   r   r~   r   r  r   r   )lockedunlockedspentspent_on_feescrediteddeductedrK   TRADE_SETTLEDr  r   )r   rS   r?   r   r   r   r   safe_string_2rw   parse_ws_order_statusr   	string_eqr   r   r  r`   r   r   update_balancerK   r  )rE   ra   rb   r   re   r   r  
updateTypeorderIdr   previousOrderArraypreviousOrderr   r   orderObjectparsedbalanceKeysr   
newBalancer   s                       rG   handle_account_update onetrading.handle_account_update  s   | ;;%%dllM4HE07DK== %%dllM4HE259DM(B7%%ff5
))Z>-IZ[qMq&&vz:G))&&+FH!%!5!5dkk4RW!X OO,>2FM"8,F%%fo>F//
;F^+0A0A&#0N0N#  !^^H5$!K MM+&%%f-F%%fh;FMM&!t{{I$67t{{H-^q#k*+AQ@J%##J/ , 	t||Y/(%%f-F%%fh;F}}HOOF#NN4==+*>?NN4==*5 )rI   c                 2    SSSS.nU R                  X!U5      $ )Nr  r  	triggered)r  r  r   r  r  s      rG   r+   onetrading.parse_ws_order_status  s'    ($$/

 &99rI   c                    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'   X@R                  U'   U R	                  U R                  5      U l        g )Ncurrency_codenew_availablefree
new_lockedused)r   safe_currency_codeaccountrK   safe_balance)rE   rK   
currencyIdcoderB  s        rG   r-  onetrading.update_balance  s     %%g?
&&z2,,.**7OD**7LA$T((6rI   r2   	timeframec                   #    U R                  5       I Sh  vN   U R                  U5      nUS   nUS   nU R                  S   S   nU R                  U R                  S0 5      n	U R                  X5      n
U
c  [        U R                  S-   5      eSU-   S	-   U-   nS
nU R                  U R                  U5      nSn0 nUb_  U R                  UR                  U5      nUb>  U R                  X0 5      nU R                  UUS5      nU(       d  SnSUR                  U'   O0 nU R                  X5      nUc  0 X'   SX   U'   / n[        UR                  5       5      n[        S[        U5      5       Hh  n[        UUU      R                  5       5      n[        S[        U5      5       H-  nU R                  X5      nUU   US.nUR                  U5        M/     Mj     US
US./S.nU R                  XU R!                  UU5      X5      I Sh  vN nU R"                  (       a  UR%                  X5      nU R'                  UX4SS5      $  GN/ N=7f)aR  

https://developers.bitpanda.com/exchange/#candlesticks-channel

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
Nre   r   r$   r   r<   zO self interval is not supported, please provide one of the supported timeframesohlcv..CANDLESTICKSrM   FUPDATE_SUBSCRIPTIONTr   )r   time_granularity)rN   
propertiesrl   )rm   rn   r>   r   r?   r   r   clientssubscriptions	safe_boollistkeysr   r   r   rT   rB   r   r   filter_by_since_limit)rE   re   rG  r   r   rU   rn   r   rV   r<   timeframeIdrW   rp   ra   rP   subscriptionohlcvMarketmarketSubscribedsubscriptionMarketIdrN  	marketIdsr   marketIdtimeframesr  marketTimeframeIdpropertyr[   ohlcvs                               rG   watch_ohlcvonetrading.watch_ohlcv  s`     !!!V$!$<iit$__T\\<D
ooj<tww)zz{{'#-	9)s3??6+?+?AQRL'"oolbI#'>>+y%#P '0D=AF(()9:!#|F'%'L",0y)
**,-	q#i.)A!%l9Q<&@&E&E&G!HAs#567$(OOJ$J!'0|(9" !!(+ 8 *  +",
 jj43C3CGV3TVfuu??NN61E))%q$GGg 	"` vs"   I
IG3I

I;I
I
c           	          U R                  US5      nU R                  U5      nU R                  US5      nU R                  US5      nU R                  U R                  S0 5      nU R	                  Xg5      nSU-   S-   U-   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                  U R                  U0 5      U R                  U'   U R                  U R                  U   U5      nUc(  U R                  U R                  SS5      n[        U5      nUR                  U
5        XR                  U   U'   UR                  X5        g )Nr   r|   granularityr<   rI  rJ  r   r   r   r   r   
OHLCVLimitr   )r   r   r   r?   find_timeframer   r   ohlcvsrS   r   r   r`   )rE   ra   rb   r   re   r   rU  r<   rG  r   r3  storedr   s                rG   handle_ohlcvonetrading.handle_ohlcv4  sq   F ##G->?!!(+##GV4oog}=__T\\<D
''@	V#c)I5NN8$Wf-Wf-We,Wg.Wh/
 #oodkk62FFV!4i@>%%dllL$GE*51Ff)/FI&v'rI   c                     U=(       d    U R                   n[        UR                  5       5      n[        S[	        U5      5       H)  nX4   nX%   S   US   :X  d  M  X%   S   US   :X  d  M'  Us  $    g )Nr   r(   r)   )r<   rR  rS  r   r   )rE   rG  r<   rS  r   keys         rG   rd  onetrading.find_timeframeo  sq    24??
JOO%&q#d)$A'Cv&)F*;;
PX@Y]fgo]p@p
 % rI   c                     U$ N rE   ra   rb   s      rG   handle_subscriptionsonetrading.handle_subscriptionsx  s	     rI   c                     U$ rm  rn  ro  s      rG   handle_heartbeatonetrading.handle_heartbeat  s	     rI   c                 V    [        U R                  S-   U R                  U5      -   5      e)N )r   r   r   ro  s      rG   handle_error_messageonetrading.handle_error_message  s%     DGGcMDIIg,>>??rI   c           	         U R                  US5      nUb  U R                  X5        g U R                  US5      n0 SU R                  _SU R                  _SU R                  _SU R                  _SU R                  _SU R
                  _S	U R                  _S
U R                  _SU R                  _SU R                  _SU R                  _SU R                  _SU R                  _SU R                  _SU R                  _SU R                  _SU R                  _U R                  U R                  U R                  U R                  U R                  U R                  U R                  S.EnU R                  XT5      nUb	  U" X5        g g )NerrorrP   r   r   ACTIVE_ORDERS_SNAPSHOTINACTIVE_ORDERS_SNAPSHOTACCOUNT_UPDATEBALANCES_SNAPSHOTSUBSCRIPTIONSSUBSCRIPTION_UPDATED
PRICE_TICKPRICE_TICK_HISTORY	HEARTBEATMARKET_TICKER_UPDATESPRICE_POINT_UPDATESCANDLESTICK_SNAPSHOTCANDLESTICKAUTHENTICATEDFILL)DONEBOOKEDUPDATETRACKED	TRIGGEREDSTOP_TRACKEDSTOP_TRIGGERED)r   rw  r   r  r6  rc   rp  r   rs  handle_price_point_updatesrg  handle_authentication_messager   )rE   ra   rb   rz  rP   handlershandlers          rG   handle_messageonetrading.handle_message  s   1%%f6w/
!7!7
!4#9#9
 %d&8&8
 '(:(:	

 d88
  !=!=
 T66
 #D$=$=
 $,,
 !$";";
 ..
 $T%7%7
 "4#B#B
 #D$5$5
 4,,
  T??!
" D''#
$ ''))))**,, //"111
4 //(1F$ rI   c                     U$ rm  rn  ro  s      rG   r  %onetrading.handle_price_point_updates  s	    & rI   c                 f    U R                  UR                  S5      nUb  UR                  S5        U$ )NauthenticatedT)r   futuresr`   )rE   ra   rb   futures       rG   r  (onetrading.handle_authentication_message  s/     ANN4 rI   c                   #    / n[        U5      nUS:X  a$  [        U R                  R                  5       5      nOU R	                  U5      nU R
                  S   S   nU R                  U R                  U5      n	Sn
0 nU	bn  U R                  U	R                  U5      nUbM  [        S[        U5      5       H3  nXl   nU R                  XS5      nU(       a  M"  Sn
S U	R                  U'   M5     O0 n[        S[        U5      5       H  nXl   nSX'   M     XS'   [        UR                  5       5      US	   S   S
'   U R                  XU R                  X%5      X;5      I S h  vN $  N7f)Nr   r$   r   rM   FrL  TrP   rQ   instrument_codes)r   rR  markets_by_idrS  
market_idsr>   r   rO  rP  r   rQ  rT   rB   )rE   rW   r[   rp   rs   rU   rZ  
numSymbolsrV   ra   rP   rV  r   r   rX  s                  rG   ro   onetrading.watch_many  sZ    	\
?T//4467I0Iiit$s3??6+?+?AQRL'q#i.1A(|H'+~~le'T$++4AE,,-=> 2  "q#i.)A |H%)L" * 59,:K:K:M5N
A12ZZ$2B2B72SUetttts   CE$BE$E"E$c                 N  #    U R                   S   S   nU R                  U5      nSnUR                  S5      nU R                  UR                  U5      nUcA  U R                  5         SU R                  S.nU R                  X$U R                  Xq5      U5        UI S h  vN $  N7f)Nr$   r   r  AUTHENTICATE)rP   	api_token)	r>   ra   reusableFuturer   rP  check_required_credentialsapiKeyrT   extend)rE   rU   rV   ra   rW   r  r  r[   s           rG   rR   onetrading.authenticate  s     iit$S!%&&7(<(<kJ ++-&![[G JJsW)E{S||s   BB%B#B%)rK   r   r   rm  )4__name__
__module____qualname____firstlineno__r   rD   r   r\   rc   strr   rq   r   r   rx   r   r   r   r   r   r   r   r   r
   r   r   r   r   r	   r   r   r   r   r  r6  r+  r-  rR  r_  rg  rd  rp  rs  r   rw  r  r  r  ro   rR   __static_attributes____classcell__)rF   s   @rG   r   r      s@   @# @D *, S S42B 68 _ _F _4 6:" @7 @ @80F 0<"H 37TX\eg 'C 's 'RU 'lpqvlw 'R @DB !S ! !S\ !>2+ 2+ho4 04$UYbd ( (C (s (imnsit (T4.V 4.ln`
:O2F O2bN6F N6`:7" ?CQUdhqs @H @H @H3 @H^a @Hx|  ~B  yC @HD9(6 9(v6 	v 		@6 	@t 	@"%V "%H *F  []eg uPW u: )+  rI   r   )ccxt.async_supportccxt ccxt.async_support.base.ws.cacher   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   ccxt.base.preciser   async_supportr   rn  rI   rG   <module>r     sB     Z l l l l 4  * ) %|##.. |rI   