
    i!                         d dl Zd dlmZmZ d dlZd dlmZmZm	Z	m
Z
mZmZmZmZ 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 d d	lmZ d d
lmZ  G d dej        j                  ZdS )    N)
ArrayCacheArrayCacheBySymbolById)IntOrder	OrderBookStrStringsTickerTickersTrade)Client)List)ExchangeError)AuthenticationError)ArgumentsRequired)
BadRequest)	BadSymbolc            
       ^    e Zd Z fdZd Zddi fdZg di fdZi fdedefdZ	di fd	e
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ddi fdedededee         fdZdddi fd	e
dededee         fdZdddi fd	e
dededee         fdZdddi fdedededee         fdZdi fd	ee         dedefdZdi fdededefdZdefdZdefdZd$ fd	Zd ZdefdZ d$dZ!defdZ"d$def fdZ#d Z$d Z%defd Z&defd!Z'defd"Z(defd#Z) xZ*S )%coinbaseproc                     |                      t          t          |                                           dd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
          S )NTF)ws
watchOHLCVwatchOrderBookwatchOrderBookForSymbolswatchTickerwatchTickerswatchTradeswatchTradesForSymbolswatchMyTradesForSymbolswatchBalancewatchStatuswatchOrderswatchOrdersForSymbolswatchMyTradesr   zwss://ws-feed.pro.coinbase.comz2wss://ws-feed-public.sandbox.exchange.coinbase.com)apitest  )tradesLimitordersLimitmyTradesLimit)hasurlsoptions)deep_extendsuperr   describe)self	__class__s    Z/var/www/html/crypto-bot/backend/venv/lib/python3.11/site-packages/ccxt/pro/coinbasepro.pyr0   zcoinbasepro.describe   s    k4 8 8 A A C C#"&,0# $#)-+/ %$#)-!% $ : N	   $#!% 3F
 F
   	    c                 <   |                                   d}|                                 }t          |          dz   |z   }|                     |                     |          |                     | j                  t          j        d          }|| j	        || j
        dS )Nz/users/self/verifyGETbase64)	timestampkey	signature
passphrase)check_required_credentialsnoncestrhmacencodebase64_to_binarysecrethashlibsha256apiKeypassword)r1   pathr=   payloadr:   s        r3   authenticatezcoinbasepro.authenticate6   s    '')))#

e**u$t+IIdkk'22D4I4I$+4V4VX_Xfhpqq	;"-	
 
 	
r4   Nc                 t  K   |                                   d {V  d }|}g }|>|                     |          }|d|d         z   z  }|                    |d                    | j        d         d         }d|v r|dz   }d||gd}	|                     |	|          }
|                     |||
|           d {V S )	N:idr%   r   r:   ?	subscribetypeproduct_idschannels)load_marketsmarketappendr,   extendwatch)r1   namesymbolmessageHashStartparamsrT   messageHash
productIdsurlrN   requests              r3   rN   zcoinbasepro.subscribeC   s      !!!!!!!!!&
[[((F3--KfTl+++it$&  )C%
 
	 ++i00ZZ[';GGGGGGGGGr4   c                   K   |                                   d {V  d }|                     |          }g }g }t          dt          |                    D ][}||         }	|                     |	          }|                    |d                    |                    |dz   |d         z              \| j        d         d         }
d|v r|
dz   }
d	||gd
}|                     ||          }|                     |
|||           d {V S )Nr   rL   rK   rY   r%   r   r:   rM   rN   rO   )	rS   market_symbolsrangelenrT   rU   r,   rV   watch_multiple)r1   rX   symbolsrZ   r[   rT   messageHashesr]   irY   r^   rN   r_   s                r3   subscribe_multiplezcoinbasepro.subscribe_multipleZ   sF     !!!!!!!!!%%g..
q#g,,'' 	L 	LAQZF[[((FfTl+++  !1C!7&:J!JKKKKit$&  )C%
 
	 ++i00((mWmTTTTTTTTTr4   rY   returnc                 F   K   d}|                      ||||           d{V S )a  
        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>`
        tickerN)rN   )r1   rY   r[   rX   s       r3   watch_tickerzcoinbasepro.watch_tickers   s7       ^^D&$?????????r4   re   c                 :  K   |                                   d{V  t          |          }|dk    rt          | j        dz             d}d}|                     ||||           d{V }| j        ri }|||d         <   |S |                     | j        d|          S )a3  
        watches a price ticker, a statistical calculation with the information calculated over the past 24 hours for all markets of a specific list
        :param str[] [symbols]: unified symbol of the market to fetch the ticker for
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :param str [params.channel]: the channel to subscribe to, tickers by default. Can be tickers, sprd-tickers, index-tickers, block-tickers
        :returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
        Nr   z0 watchTickers requires a non-empty symbols arrayrk   rY   )rS   rc   r   rL   rh   
newUpdatesfilter_by_arraytickers)r1   re   r[   symbolsLengthchannelr\   rk   results           r3   watch_tickerszcoinbasepro.watch_tickers}   s       !!!!!!!!!GADG&XXYYY..wfUUUUUUUU? 	F'-F6(#$M##DL(GDDDr4   sincelimitc                   K   |                                   d{V  |                     |          }d}|                     ||||           d{V }| j        r|                    ||          }|                     |||dd          S )  
        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>`
        Nmatchesr8   T)rS   rY   rN   rn   getLimitfilter_by_since_limit)r1   rY   ru   rv   r[   rX   tradess          r3   watch_tradeszcoinbasepro.watch_trades   s       !!!!!!!!!V$$~~dFD&AAAAAAAA? 	3OOFE22E))&%TRRRr4   c                   K   t          |          }|dk    rt          | j        dz             |                                  d{V  |                     |          }d}|                     ||||           d{V }| j        rB|                     |d          }|                     |d          }	|	                    |	|          }| 
                    |||dd          S )rx   r   z> watchTradesForSymbols() requires a non-empty array of symbolsNry   rY   r8   T)rc   r   rL   rS   ra   rh   rn   
safe_valuesafe_stringrz   r{   )
r1   re   ru   rv   r[   rq   rX   r|   firsttradeSymbols
             r3   watch_trades_for_symbolsz$coinbasepro.watch_trades_for_symbols   s       GATW'gghhh!!!!!!!!!%%g....tWdFKKKKKKKK? 	8OOFA..E**5(;;KOOK77E))&%TRRRr4   c           	        K   |t          | j        dz             |                                  d{V  |                     |          }d}d}|                                 }|                     ||||                     ||                     d{V }| j        r|                    ||          }| 	                    |||dd          S )a  
        watches information on multiple trades made by the user
        :param str symbol: unified market symbol of the market trades were made in
        :param int [since]: the earliest time in ms to fetch trades for
        :param int [limit]: the maximum number of trade structures to retrieve
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :returns dict[]: a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
        Nz+ watchMyTrades() requires a symbol argumentusermyTradesr8   T)
r   rL   rS   rY   rI   rN   rV   rn   rz   r{   )	r1   rY   ru   rv   r[   rX   r\   authenticationr|   s	            r3   watch_my_tradeszcoinbasepro.watch_my_trades   s       >#DG.[$[\\\!!!!!!!!!V$$ **,,~~dFKVUcAdAdeeeeeeee? 	3OOFE22E))&%TRRRr4   c           	        K   |                      |dd          }|                                  d{V  d}d}|                                 }|                     ||||                     ||                     d{V }| j        rB|                     |d          }	|                     |	d          }
|                    |
|          }| 	                    |||dd          S )	a  
        watches information on multiple trades made by the user
        :param str[] symbols: unified symbol of the market to fetch trades for
        :param int [since]: the earliest time in ms to fetch trades for
        :param int [limit]: the maximum number of trade structures to retrieve
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :returns dict[]: a list of [trade structures]{@link https://docs.ccxt.com/#/?id=trade-structure
        NFr   r   r   rY   r8   T)
ra   rS   rI   rh   rV   rn   r   r   rz   r{   )r1   re   ru   rv   r[   rX   r\   r   r|   r   r   s              r3   watch_my_trades_for_symbolsz'coinbasepro.watch_my_trades_for_symbols   s       %%gtU;;!!!!!!!!! **,,..tWk4;;W]_mKnKnoooooooo? 	8OOFA..E**5(;;KOOK77E))&%TRRRr4   c           	        K   |                                   d{V  |                     |dd          }d}d}|                                 }|                     ||||                     ||                     d{V }| j        rB|                     |d          }	|                     |	d          }
|                    |
|          }| 	                    |||dd          S )	a  
        watches information on multiple orders made by the user
        :param str[] symbols: unified symbol of the market to fetch orders for
        :param int [since]: the earliest time in ms to fetch orders for
        :param int [limit]: the maximum number of trade structures to retrieve
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :returns dict[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
        NFr   ordersr   rY   r8   T)
rS   ra   rI   rh   rV   rn   r   r   rz   r{   )r1   re   ru   rv   r[   rX   r\   r   r   r   r   s              r3   watch_orders_for_symbolsz$coinbasepro.watch_orders_for_symbols   s       !!!!!!!!!%%gtU;;**,,..tWk4;;W]_mKnKnoooooooo? 	8OOFA..E**5(;;KOOK77E))&%TRRRr4   c           	        K   |t          | j        dz             |                                  d{V  |                     |          }d}d}|                                 }|                     ||||                     ||                     d{V }| j        r|                    ||          }| 	                    |||dd          S )a  
        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 <https://docs.ccxt.com/#/?id=order-structure>`
        Nz  watchMyTrades requires a symbolr   r   r8   T)
r   rL   rS   rY   rI   rN   rV   rn   rz   r{   )	r1   rY   ru   rv   r[   rX   r\   r   r   s	            r3   watch_orderszcoinbasepro.watch_orders   s       >DG&HHIII!!!!!!!!!V$$**,,~~dFKVUcAdAdeeeeeeee? 	3OOFE22E))&%TRRRr4   c                 ~  K   t          |          }|dk    rt          | j        dz             d}|                                  d{V  |                     |          }|                     |          }g }t          d|          D ]%}||         }	|                    |dz   |	z              &| j        d         d         }
d||gd	}| 	                    ||          }||||d
}| 
                                }|                     |
|| 	                    ||          ||           d{V }|                                S )a  
        watches information on open orders with bid(buy) and ask(sell) prices, volumes and other data
        :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
        r   zA watchOrderBookForSymbols() requires a non-empty array of symbolslevel2NrK   r%   r   rN   rO   )r\   re   	marketIdsrv   )rc   r   rL   rS   ra   
market_idsrb   rU   r,   rV   rI   rd   rv   )r1   re   rv   r[   rq   rX   r   rf   rg   marketIdr^   rN   r_   subscriptionr   	orderbooks                   r3   watch_order_book_for_symbolsz(coinbasepro.watch_order_book_for_symbols  s      GATW'jjkkk!!!!!!!!!%%g..OOG,,	q-(( 	8 	8A |H  h!67777it$$
 
	 ++i00"	
 
 **,,--c=$++gWeBfBfhu  xD  E  E  E  E  E  E  E  E	   r4   c                   K   d}|                                   d{V  |                     |          }|d         }|dz   |d         z   }| j        d         d         }d|d         g|gd	}|                     ||          }	|||d         |d
}
|                                 }|                     |||                     |	|          ||
           d{V }|                                S )a  
        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
        r   NrY   rK   rL   r%   r   rN   rO   )r\   rY   r   rv   )rS   rT   r,   rV   rI   rW   rv   )r1   rY   rv   r[   rX   rT   r\   r^   rN   r_   r   r   r   s                r3   watch_order_bookzcoinbasepro.watch_order_book3  s#      !!!!!!!!!V$$!Sj6$</it$t 
 
	 ++i00&t	
 
 **,,**S+t{{7N7[7[]hjvwwwwwwww	   r4   clientc                 ~   |                      |d          }||                     |          }|d         }d}|dz   |z   }|                     | j        |          }|5|                     | j        dd          }	t          |	          }|| j        |<   |                    |           |                    ||           |S )N
product_idrY   ry   rK   r(   r'   )	r   parse_ws_trader   r|   safe_integerr-   r   rU   resolve)
r1   r   messager   traderY   rP   r\   tradesArrayr(   s
             r3   handle_tradezcoinbasepro.handle_tradeU  s     ##G\::''00E8_F D*x/K//$+v>>K""//mTRR(55&1F#u%%%NN;444r4   c                 @   |                      |d          }||                     |          }d}|dz   |z   }| j        }|2|                     | j        dd          }t          |          }|| _        |                    |           |                    ||           |S )Nr   r   rK   r*   r'   )r   r   r   r   r-   r   rU   r   )	r1   r   r   r   r   rP   r\   r   rv   s	            r3   handle_my_tradezcoinbasepro.handle_my_tradev  s    ##G\::''00ED*x/K-K"))$,NN4U;; +u%%%NN;444r4   c                    t          t          |                               |          }d }d}d|v rd}d|d<   |                     |d          }n@d|d<   |                     |d          }|d         }|                     d	d
d||          |d<   |rdnd}|                     ||          |d<   |                     |d                   }|d         }d }	|d         ||                     |d          }
|
|z  }	||	|d|d<   |S )NFmaker_fee_rateTmakertakerOrMakertakertaker_fee_ratesidesellbuy)r   r   maker_order_idtaker_order_idorderrY   quotecost)rater   currencyfee)r/   r   parse_tradesafe_numberr   rT   )r1   r   rT   parsedfeeRateisMakercurrentSideidKeyfeeCurrencyfeeCostr   r2   s              r3   r   zcoinbasepro.parse_ws_trade  sW   f {D))55e<<u$$G%,F>"&&u.>??GG%,F>"&&u.>??G !.K!--/ / K) )F6N %,A  1A**5%88wVH-..Wo6N&W-@##FF33DWnG#
 
u
 r4   c                 :    ddd}|                      ||d          S )Nclosedcanceled)filledr   open)r   )r1   statusstatusess      r3   parse_ws_order_statusz!coinbasepro.parse_ws_order_status  s.    "
 
 &&999r4   c                 2   | j         }|2|                     | j        dd          }t          |          }|| _         |                     |d          }|                     |d          }|d|z   }|                     |          }|                     |d          }	|                     |d          }
|                     |d          }| j         }|                     |j        |i           }|                     ||	          }||                     ||
|          }|B| 	                    |          }|
                    |           |                    ||           d S |                     |d	          }|                     |d
i           }|                     |d	          }|||k    rl|dk    r|                     |          }|d         g |d<   |d         
                    |           |d         |d<   d}d}|d         }t          dt          |                    D ]B}||         }|                     ||d                   }|                     ||d                   }C|dk    r||z  |d<   ||d<   |d         2|dxx         |d         z  cc<   |d         |d         |d         z
  |d<   |d         d|d         d         d|d<   |d         d         E|d         d         7|                     |d         d         |d         d                   |d         d<   |
                    |           |                    ||           d S |dk    s|dk    r|                     |d
         |          }| 	                    |          }t#          |                                          }t          dt          |                    D ]}||         }||         ||         ||<   |
                    |           |                    ||           d S d S d S d S )Nr)   r'   rP   r   zorders:order_idr   r   sequenceinfomatchr|   r8   lastTradeTimestampr   r   amountaverager   	remainingr   r   )r   r   receiveddone)r   r   r-   r   r   safe_symbolr   hashmapsafe_value_2parse_ws_orderrU   r   r   rb   rc   sumrV   listkeys)r1   r   r   currentOrdersrv   rP   r   r\   rY   orderIdmakerOrderIdtakerOrderIdr   previousOrderspreviousOrderr   r   previousInfopreviousSequencer   	totalCosttotalAmountr|   rg   
tradeEntryr   r   r   r9   s                                r3   handle_orderzcoinbasepro.handle_order  sz   ^  %%dlM4HHE2599M'DK00##G\::#h.K%%h//F&&w
;;G++G5EFFL++G5EFFL[F!__V^VRHHN OONGDDM$ $ 1 1.,P\ ] ]$,,W55f%%%v{33333,,WjAA#}fbII#'#4#4\:#N#N $,(=M2M2Mw $ 3 3G < <(2:68M(3%h/66u===>CK>P&:;$%	&'!.x!8!&q#f++!6!6 V VA)/J(,Jv<N(O(OI*.((;
8@T*U*UKK&??7@;7NM)409f-(2>)(333uXF333,X6B=J8=TWdemWn=nk :(/7(),1%L,D4 4M%0 *%08D5QV<X^K_Kk;?88MRWDXY_D`bghmbnoubv;w;wM%08m444v{;;;;;*,,$&..#{{=+@'JJ $ 3 3D 9 9#EJJLL11!&q#d))!4!4 @ @A"&q'C$Sz55:3Zc 2m444v{;;;;;{  & 3N2M> 3A.r4   c           	      b   |                      |d          }|                      |d          }|                      |d          }|                     |          }|                      |d          }|                     |d          }|                     |dd          }	|                      |d          }
|                     |
          }|                      |d	          }|                     |          }|                      |d
          }|                     |d          }|                      |d          }d }|	||	|z
  }n|dk    r	d}|	|	|z
  }|                     i d|d|d|d|d|d|                     |          dd d|dd dd d|d|dd dd d|	dd dd |||d d d          S )Nr   
client_oidr   r   pricesizefundstimereason
order_typeremaining_sizerP   r   r   r   rY   rL   clientOrderIdr8   datetimer   timeInForcepostOnly	stopPricetriggerPricer   r   r   )r   r   r   r   r|   )r   r   r   safe_number_2	parse8601r   
safe_orderiso8601)r1   r   rT   rL   r   r   rY   r   r   r   r   r8   r   r   	orderTyper   rP   r   s                     r3   r   zcoinbasepro.parse_ws_ordert  sm   eZ00((==##E<88!!(++v..  00##E67;;v..NN4((	!!%22++F33$$UL99	$$U,<==	v..Y%:i'FFZF!"VO	  
E 
f 
 " 
 ]	 

  
 Y// 
 !$ 
 I 
 4 
  
 D 
 U 
  
 D 
 f 
  D! 
" t# 
$ "- 
  
  
   	r4   c                     |                      |d          }|]|                     |          }|d         }|| j        |<   d|z   }d|z   }|                    ||           |                    ||           |S )Nr   rY   zticker:)r   parse_tickerrp   r   )r1   r   r   r   rk   rY   r\   idMessageHashs           r3   handle_tickerzcoinbasepro.handle_ticker  s    ( ##G\::&&w//FH%F#)DL #f,K%0MNN6;///NN6=111r4   c                 `   |                      |d          }|)t          t          |                               ||          S |                      |d          }|                     ||d          }|                     |                      |d                    }|                      |d          }|                     i d|d|d|                     |          d	|                      |d
          d|                      |d          d|                      |d          d|                      |d          d|                      |d          d|                      |d          dd d|                      |d          d|d|dd dd dd dd |                      |d          d |d          S ) NrP   r   -r   r   rY   r8   r   highhigh_24hlowlow_24hbidbest_bid	bidVolumebest_bid_sizeaskbest_ask	askVolumebest_ask_sizevwapr   open_24hcloselastpreviousClosechange
percentager   
volume_24h)
baseVolumequoteVolumer   )r   r/   r   r   r   r   safe_tickerr   )	r1   rk   rT   rP   r   rY   r8   r  r2   s	           r3   r   zcoinbasepro.parse_ticker  s,   , //<d++88HHH##FL99!!(FC88NN4#3#3FF#C#CDD	00 !
f!
!
 Y//!
 D$$VZ88	!

 4##FI66!
 4##FJ77!
 ))&/BB!
 4##FJ77!
 ))&/BB!
 D!
 D$$VZ88!
 T!
 D!
 T!
 d!
  $!!
" t#!
$ **6<@@)!
 !
 !
   	r4   c                     |                      |d          }|                      |d          }|                    ||           d S )Nr      )r   store)r1   booksidedeltar   r   s        r3   handle_deltazcoinbasepro.handle_delta  sF      **!!%++uf%%%%%r4   c                 ~    t          dt          |                    D ]}|                     |||                    d S )Nr   )rb   rc   r  )r1   r  deltasrg   s       r3   handle_deltaszcoinbasepro.handle_deltas  sH    q#f++&& 	3 	3Ahq	2222	3 	3r4   c                    |                      |d          }|                      |d          }|                     |d d          }|d         }d}|dz   |z   }|                     |j        |i           }	|                     |	d          }
|dk    r|                     i |
          | j        |<   | j        |         }|                     |d	         |                     |d	g                      |                     |d
         |                     |d
g                      d |d<   d |d<   ||d<   |                    ||           d S |dk    r%| j        |         }| 	                    |                      |d                    }|                     |dg           }d	d
d}t          dt          |                    D ]}||         }|                      |d          }|                      ||          }|                     |d          }|                     |d          }||         }|                    ||           ||d<   |                     |          |d<   |                    ||           d S d S )NrP   r   r   rY   r   rK   rv   snapshotasksbidsr8   r   l2updater   changes)r   r   r   r     )r   safe_marketr   subscriptionsr   
order_book
orderbooksr  r   r   rb   rc   r   r  r   )r1   r   r   rP   r   rT   rY   rX   r\   r   rv   r   r8   r%  sidesrg   r  r9   r   r   r   r  s                         r3   handle_order_bookzcoinbasepro.handle_order_book  s   4 00##G\::!!(D#66!Sj8+v';["MM!!,88:&*oob%&@&@DOF#/Iy0$//'6SU2V2VWWWy0$//'6SU2V2VWWW%)Ik"$(Ij!"(IhNN9k22222Z/It'7'7'H'HIIIoogy"==G E 1c'll++ . . &&vq11''s33((33))&!44$T?uf----%.Ik"$(LL$;$;Ij!NN9k22222%  r4   c                     |S N )r1   r   r   s      r3   handle_subscription_statusz&coinbasepro.handle_subscription_status>  s	     r4   c                    |                      |d          }|                      |d          }	 |dk    rt          d|z             t          | j        dz   |z             # t          $ r }|                    |           Y d }~dS d }~ww xY w)Nr   r   zAuthentication FailedzAuthentication failed:  T)r   r   r   rL   	Exceptionreject)r1   r   r   errMsgr   errors         r3   handle_error_messagez coinbasepro.handle_error_messageL  s      !!'955!!'844	000)*Cf*LMMM#DGcMF$:;;; 	 	 	MM%   44444	s   2A   
B
*BB
c           
         |                      |d          }| j        | j        | j        | j        | j        | j        | j        | j        | j        d	}t          |j                  dz
  }|j        |dz
           dk    }|                     ||          }|P|dk    rH|r.| 	                    ||           |                     ||           d S | 
                    ||           d S d S  |||           d S )NrP   )	r!  r$  rN   rk   r   r   r  r   r6  r   r  rM   r   )r   r,  r0  r   r   r7  rc   r^   r   r   r   )r1   r   r   rP   methodslengthauthenticatedmethods           r3   handle_messagezcoinbasepro.handle_messageg  s   00..8()%'%.

 

 VZ1$
6A:.#5$//>w  7((999%%fg66666%%fg66666  F67#####r4   r.  )+__name__
__module____qualname__r0   rI   rN   rh   r>   r
   rl   r	   r   rt   r   r   r   r}   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r   r  r  r,  r0  r7  r=  __classcell__)r2   s   @r3   r   r      s           B
 
 
 ,0$r H H H H. 68$WY U U U U2 68 @ @ @F @ @ @ @ 6:" E E7 E E E E E* <@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, 37TX\eg S SC Ss SRU Slpqvlw S S S S* DHVZimvx S S SPS Scf S  ~B  CH  ~I S S S S* AESWfjsu S Sg SS S`c Sz~  @E  {F S S S S* 04$UYbd S S SC Ss Simnsit S S S S* SW_a $! $!$s) $!C $!fo $! $! $! $!L @DB  !  !S  !  !S\  !  !  !  !D6    Bf    Q Q Q Q Q Qf: : :S<6 S< S< S< S<j- - - -^F    >2 26 2 2 2 2 2 2h& & &
3 3 3=3 =3 =3 =3 =3~    6    6$V $ $ $ $ $ $ $ $r4   r   )ccxt.async_supportccxt ccxt.async_support.base.ws.cacher   r   rC   ccxt.base.typesr   r   r   r   r	   r
   r   r   !ccxt.async_support.base.ws.clientr   typingr   ccxt.base.errorsr   r   r   r   r   async_supportr   r/  r4   r3   <module>rJ     s2       O O O O O O O O  W W W W W W W W W W W W W W W W W W W W 4 4 4 4 4 4       * * * * * * 0 0 0 0 0 0 . . . . . . ' ' ' ' ' ' & & & & & &l$ l$ l$ l$ l$$$0 l$ l$ l$ l$ l$r4   