
    i}                         d dl mZ d dlmZ d dlZd dlmZmZmZm	Z	m
Z
mZmZmZmZmZmZmZmZ d dlmZ d dlmZ d dlmZ  G d d	ee          ZdS )
    )Exchange)ImplicitAPIN)BalancesCurrencyIntMarketNumOrder	OrderBook	OrderSide	OrderTypeStrTickerTradeTradingFees)List)	TICK_SIZE)Precisec                       e Zd Z fdZi fdee         fdZdefdZi fdefdZ	di fde
dedefd	Zd&d
edefdZi fde
defdZd&d
edefdZd Zdi fde
d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fdZd&d
edefdZddi fde
dededee         fdZi fdefdZdi fde
dedede de!f
dZ"di fde
defdZ#i fde
fd Z$d&d!e%fd"Z&d#d$i ddfd%Z' xZ(S )'independentreservec                 j   |                      t          t          |                                           ddddgddi dd ddd	d
dd
dd
dd
dd
dddd
dd
dddd
dd
dd
dd
dddd
i dd
dddd
dd
dddd
dd
d d
d!d
d"d
d#d
d$d
d%d
d&d
d'd
d(d
d)d
i d*dd+d
d,dd-d
d.dd/dd0dd1d
d2d
d3d
d4d
d5d
d6dd7dd8d
d9dd:d
d
d
d
d;d<d=d>d?d@dAdBdCg dDidEg dFid?dG|                     dH          |                     dH          dd
dIidJdKit
          dL          S )MNr   zIndependent ReserveAUNZi  TCORSspotmarginFswapfutureoption	addMargincancelOrdercloseAllPositionsclosePositioncreateOrdercreateReduceOnlyOrdercreateStopLimitOrdercreateStopMarketOrdercreateStopOrderfetchBalancefetchBorrowRateHistoriesfetchBorrowRateHistoryfetchClosedOrdersfetchCrossBorrowRatefetchCrossBorrowRatesfetchDepositAddressfetchDepositAddressesfetchDepositAddressesByNetworkfetchFundingHistoryfetchFundingRatefetchFundingRateHistoryfetchFundingRatesfetchIndexOHLCVfetchIsolatedBorrowRatefetchIsolatedBorrowRatesfetchLeveragefetchLeverageTiersfetchMarginModefetchMarketsfetchMarkOHLCVfetchMyTradesfetchOpenInterestHistoryfetchOpenOrders
fetchOrderfetchOrderBookfetchPositionfetchPositionModefetchPositionsfetchPositionsRiskfetchPremiumIndexOHLCVfetchTickerfetchTradesfetchTradingFeefetchTradingFeesreduceMargin)setLeveragesetMarginModesetPositionModezdhttps://user-images.githubusercontent.com/51840849/87182090-1e9e9080-c2ec-11ea-8e49-563db9a38f37.jpgz)https://api.independentreserve.com/Publicz*https://api.independentreserve.com/Private)publicprivatez"https://www.independentreserve.comz&https://www.independentreserve.com/API)logoapiwwwdocget)GetValidPrimaryCurrencyCodesGetValidSecondaryCurrencyCodesGetValidLimitOrderTypesGetValidMarketOrderTypesGetValidOrderTypesGetValidTransactionTypesGetMarketSummaryGetOrderBookGetAllOrdersGetTradeHistorySummaryGetRecentTrades
GetFxRatesGetOrderMinimumVolumesGetCryptoWithdrawalFeespost)GetOpenOrdersGetClosedOrdersGetClosedFilledOrdersGetOrderDetailsGetAccountsGetTransactionsGetFiatBankAccounts GetDigitalCurrencyDepositAddress"GetDigitalCurrencyDepositAddresses	GetTradesGetBrokerageFeesGetDigitalCurrencyWithdrawalPlaceLimitOrderPlaceMarketOrderCancelOrder0SynchDigitalCurrencyDepositAddressWithBlockchainRequestFiatWithdrawalWithdrawFiatCurrencyWithdrawDigitalCurrencytradingz0.005)takermaker
percentage	tierBasedPLAPlayChip)idname	countries	rateLimitprohasurlsrS   feescommonCurrenciesprecisionMode)deep_extendsuperr   describeparse_numberr   )self	__class__s    ]/var/www/html/crypto-bot/backend/venv/lib/python3.11/site-packages/ccxt/independentreserve.pyr   zindependentreserve.describe   s   &8$ ? ? H H J J&)777 %7 	7
 %7 %7 U7 t7 $U7  7 t7 (7 '7 (7 "57  !7" +E#7 7$ )%%7& $T'7( ')7* (+7, &t-7. (/70 1%172 &u374 #E576 *5778 $U97: "5;7< *5=7> +E?7@  A7B %eC7D "5E7 7 7F G7H !%I7J  K7L +EM7N "4O7P dQ7R !$S7T  U7V $UW7X !%Y7Z %e[7\ )%]7^ t_7` ta7b "5c7d #De7f g7 7h  %!&#(m7 7 7r IK  <?     &    '* *X !..w77!..w77"&!&	  z! '{~M
 ~M
 ~ ~ ~	    returnc                    |                      |          }|                     |          }|                     |          }g }t          dt	          |                    D ]}||         }|                     |          }|                     ||          }	t          dt	          |                    D ]}
||
         }|                     |          }|dz   |z   }|                    i d|d|dz   |z   d|d|ddd	|d
|dddddddddddddddddddddddddddddddd|	dddddddddd|d
           |S )z
        retrieves data on all markets for independentreserve
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :returns dict[]: an array of objects representing market data
        r   /r   symbolbasequotesettleNbaseIdquoteIdsettleIdtyper   Tr   Fr   r   r   activecontractlinear)amountprice)minmax)leverager   r   cost)
inversecontractSizeexpiryexpiryDatetimestrike
optionType	precisionlimitscreatedinfo)%publicGetGetValidPrimaryCurrencyCodes'publicGetGetValidSecondaryCurrencyCodespublicGetGetOrderMinimumVolumesrangelensafe_currency_codesafe_numberappend)r   paramsbaseCurrenciesquoteCurrenciesr   resultir   r   	minAmountjr   r   r   s                 r   fetch_marketsz independentreserve.fetch_markets   so    CCFKKFFvNN55f== q#n--.. 8	 8	A#A&F**622D((88I1c/2233 4 4)!,//88c\G+ 0"0dSj500 D0 U	0
 d0 f0 w0 0 F0 D0 e0 E0 e0 e0 d0  !0" d#0$  $$("&*""&"&!%" " $(#'% %
 $-#'# #
 $(#'" "
 $(#'! ! $  $_0 0 0 0 0 0 0	4j r   c                 p   d|i}t          dt          |                    D ]}||         }|                     |d          }|                     |          }|                                 }|                     |d          |d<   |                     |d          |d<   |||<   |                     |          S )Nr   r   CurrencyCodeAvailableBalancefreeTotalBalancetotal)r   r   safe_stringr   accountsafe_balance)r   responser   r   balance
currencyIdcoder   s           r   parse_balancez independentreserve.parse_balance   s    (#q#h--(( 	# 	#AqkG))'>BBJ**:66DllnnG"..w8JKKGFO#//HHGG"F4LL  (((r   c                 ~    |                                   |                     |          }|                     |          S )a!  
        query for 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>`
        )load_marketsprivatePostGetAccountsr   )r   r   r   s      r   fetch_balancez independentreserve.fetch_balance   s=     	..v66!!(+++r   Nr   limitc           	      \   |                                   |                     |          }|d         |d         d}|                     |                     ||                    }|                     |                     |d                    }|                     ||d         |dddd	          S )
a  
        fetches 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   r   primaryCurrencyCodesecondaryCurrencyCodeCreatedTimestampUtcr   	BuyOrders
SellOrdersPriceVolume)r   marketpublicGetGetOrderBookextend	parse8601r   parse_order_book)r   r   r   r   r   requestr   	timestamps           r   fetch_order_bookz#independentreserve.fetch_order_book   s     	V$$#)(#3%+I%6
 
 --dkk'6.J.JKKNN4#3#3H>S#T#TUU	$$Xvh/?KYegnpxyyyr   r   c                    |                      |                     |d                    }|                     |d          }|                     |d          }d }|
||dz   |z   }|                     ||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 )Nr   PrimaryCurrencyCodeSecondaryCurrencyCoder   r   	LastPricer   datetimehighDayHighestPricelowDayLowestPricebidCurrentHighestBidPrice	bidVolumeaskCurrentLowestOfferPrice	askVolumevwapopencloselastpreviousClosechanger|   averageDayAvgPrice DayVolumeXbtInSecondaryCurrrency)
baseVolumequoteVolumer   )r   r   safe_marketsafe_tickeriso8601)	r   tickerr   r   r   r   defaultMarketIdr   r   s	            r   parse_tickerzindependentreserve.parse_ticker	  s    NN4#3#3F<Q#R#RSS	!!&*?@@""6+BCCW%8$slW4O!!/63??!44 !
f!
!
 Y//!
 D$$V->??	!

 4##F,<==!
 4##F,DEE!
 !
 4##F,EFF!
 !
 D!
 D!
 T!
 D!
 T!
 d!
  $!!
" t''>>#!
$ **63UVV)!
 !
 !
* +  	r   c                     |                                   |                     |          }|d         |d         d}|                     |                     ||                    }|                     ||          S )a  
        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 exchange API endpoint
        :returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
        r   r   r   )r   r   publicGetGetMarketSummaryr   r  )r   r   r   r   r   r   s         r   fetch_tickerzindependentreserve.fetch_ticker7  s~     	V$$#)(#3%+I%6
 
 11$++gv2N2NOO   6222r   c                 
   d }|                      |d          }|                      |d          }d }d }|5|3|                     |          }|                     |          }|dz   |z   }n||d         }|d         }|d         }|                     |dd          }d }	|n|                    d	          d
k    rd}	n|                    d          d
k    rd}	|                    d          d
k    rd}n|                    d          d
k    rd}|                     |                      |d                    }
|                      |d          }|                      |d          }d }||t          j        ||          }|                     i d|d|                      |d          dd d|
d|                     |
          dd d|d|dd dd d|	d |                      |d!          d"d d#d d$|                      |d%          d&|                      |d'          d(|                     |d)d*          ||                      |d+          | 	                    |                      |d,                    |||d-d d.|          S )/Nr   r   r   r   r   r   Typer   Bidr   buyOffersellr   r   Limitr   r   VolumeFilled
FeePercentr   r   	OrderGuidclientOrderIdr   r   lastTradeTimestampr   timeInForcepostOnlysider   r   	stopPricetriggerPricer   Valuer   AvgPricer   VolumeOrderedr   OutstandingStatus)rater   currency)filled	remainingstatusfeetrades)
r   r   safe_string_2findr   r   
string_mul
safe_orderr   parse_order_status)r   orderr   r   r   r   r   r   	orderTyper  r   r  feeRatefeeCosts                 r   parse_orderzindependentreserve.parse_orderT  sM   F !!%)>??""5*ABBW%8**622D++G44ECZ%'FFH%F&>D7OE&&ufkBB	 ~~e$$))((A--~~h''1,,$		((A--#	NN4#3#3E;P#Q#QRR	!!%88""5,776#5(&99G  
E 
$""5+66 
 T 
 	 

 Y// 
 !$ 
 f 
 I 
 4 
  
 D 
 T%%eW55 
  
 D 
 D$$UG44 
  t''z::! 
" d((JJ# 
$ ))%??--d.>.>uh.O.OPP  
 5 
  
  
6 7  	r   c                 D    dddddddd}|                      |||          S )Nr   closedcanceled)OpenPartiallyFilledFilledPartiallyFilledAndCancelled	CancelledPartiallyFilledAndExpiredExpired)r   )r   r!  statusess      r   r(  z%independentreserve.parse_order_status  s=    %+5#)3!
 
 &&999r   r   c                     |                                   |                     |                     d|i|                    }d}||                     |          }|                     ||          S )a?  
        fetches information on an order made by the user
        :param str symbol: unified symbol of the market the order was made in
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
        	orderGuidN)r   privatePostGetOrderDetailsr   r   r-  )r   r   r   r   r   r   s         r   fetch_orderzindependentreserve.fetch_order  s}     	224;;@
4 4   [[((F&111r   sincec                 ~   |                                   |                     i           }d}|+|                     |          }|d         |d<   |d         |d<   |d}d|d<   ||d	<   |                     |                     ||                    }|                     |d
g           }|                     ||||          S )a  
        fetch all unfilled currently open orders
        :param str symbol: unified market symbol
        :param int [since]: the earliest time in ms to fetch open orders for
        :param int [limit]: the maximum number of  open orders structures to retrieve
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
        Nr   r   r   r   2      	pageIndexpageSizeData)r   orderedr   privatePostGetOpenOrdersr   	safe_listparse_orders	r   r   r=  r   r   r   r   r   datas	            r   fetch_open_ordersz$independentreserve.fetch_open_orders  s     	,,r""[[((F-3H-=G)*/5i/@G+,=E #
00Wf1M1MNN~~h33  vue<<<r   c                 ~   |                                   |                     i           }d}|+|                     |          }|d         |d<   |d         |d<   |d}d|d<   ||d	<   |                     |                     ||                    }|                     |d
g           }|                     ||||          S )a  
        fetches information on multiple closed 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 Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
        Nr   r   r   r   r?  r@  rA  rB  rC  )r   rD  r   privatePostGetClosedOrdersr   rF  rG  rH  s	            r   fetch_closed_ordersz&independentreserve.fetch_closed_orders  s     	,,r""[[((F-3H-=G)*/5i/@G+,=E #
224;;w3O3OPP~~h33  vue<<<r   r?  c                 P   |                                   |                     |dd          }|d}|                     ||d          }|                     |                     ||                    }d}||                     |          }|                     |d         |||          S )a  
        fetch all trades made by the user
        :param str symbol: unified market symbol
        :param int [since]: the earliest time in ms to fetch trades for
        :param int [limit]: the maximum number of trades structures to retrieve
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :returns Trade[]: a list of `trade structures <https://docs.ccxt.com/#/?id=trade-structure>`
        rA  r@  Nr?  )rA  rB  rC  )r   safe_integerrD  privatePostGetTradesr   r   parse_trades)	r   r   r=  r   r   rA  r   r   r   s	            r   fetch_my_tradesz"independentreserve.fetch_my_trades  s     	%%fk1==	=E,," 
  
   ,,T[[&-I-IJJ[[((F  &!165%HHHr   c                 >   |                      |d                   }|                     |d          }|                     |d          }|                     |dd          }|                     |dd          }|                     |          }|                     |          }	|                     t	          j        ||                    }
|                     |d          }|                     |d	          }d }|
||d
z   |z   }|                     ||d
          }|                     |d          }|7|                    d          dk    rd}n|                    d          dk    rd}|                     |||| 	                    |          ||d |d ||	|
d d|          S )NTradeTimestampUtc	TradeGuidr  r   SecondaryCurrencyTradePriceVolumeTradedPrimaryCurrencyAmountr   r   r   r   r	  r   r
  r  r  )r   r   r   r   r   r)  r   r  takerOrMakerr   r   r   r"  )
r   r   r$  r   r   r&  safe_symbolr%  
safe_trader   )r   trader   r   r   orderIdpriceStringamountStringr   r   r   r   r   marketIdr   r  s                   r   parse_tradezindependentreserve.parse_trade  s   NN5)<#=>>	e[11""5+66((9VWW))%AXYY!!+..""<00  !3K!N!NOO!!%)>??""5*ABBW%8|g-H!!(FC88{33yy1$$7##q(("Y//  
  
   	r   c                    |                                   |                     |          }|d         |d         dd}|                     |                     ||                    }|                     |d         |||          S )a  
        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 Trade[]: a list of `trade structures <https://docs.ccxt.com/#/?id=public-trades>`
        r   r   r?  )r   r   numberOfRecentTradesToRetrieveTrades)r   r   publicGetGetRecentTradesr   rQ  )r   r   r=  r   r   r   r   r   s           r   fetch_tradeszindependentreserve.fetch_trades:  s     	V$$#)(#3%+I%6.0
 

 00Wf1M1MNN  (!3VUEJJJr   c                    |                                   |                     |          }i }t          dt          |                    D ]S}||         }|                     |d          }|                     |          }|                     |d          }||d||<   Ti }	t          dt          | j                            D ]}| j        |         }
|                     |
          }| 	                    ||d         i           }| 	                    |d          |
|                     |d          |                     |d          ddd	|	|
<   |	S )
a  
        fetch the trading fees for multiple markets
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :returns dict: a dictionary of `fee structures <https://docs.ccxt.com/#/?id=fee-structure>` indexed by market symbols
        r   r   Fee)r   r"  r   r   r"  T)r   r   r{   rz   r|   r}   )
r   privatePostGetBrokerageFeesr   r   r   r   r   symbolsr   
safe_value)r   r   r   r   r   r"  r   r   
tradingFeer   r   r   s               r   fetch_trading_feesz%independentreserve.fetch_trading_feesM  se    	33F;; q#h--(( 	 	A1+C))#~>>J**:66D))#u55J! DJJ q#dl++,, 	 	A\!_F[[((F//$v;;CV44 ))#u55))#u55"! F6NN r   r   r  r   r   c                    |                                   |                     |          }|                     |          }||dk    rdndz  }|                     |d         |d         |d          }	d}
||	d<   |d	k    r/||	d
<   |                     |                     |	|                    }
n)|                     |                     |	|                    }
|                     |
|
d         d|          S )a`  
        create a trade order
        :param str symbol: unified symbol of the market to create an order in
        :param str type: 'market' or 'limit'
        :param str side: 'buy' or 'sell'
        :param float amount: how much of currency you want to trade in units of base currency
        :param float [price]: the price at which the order is to be fullfilled, in units of the quote currency, ignored in market orders
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
        r  r  r	  r   r   )r   r   r*  Nvolumer   r   r  )r   r   )r   r   
capitalizerD  privatePostPlaceLimitOrderr   privatePostPlaceMarketOrderr'  )r   r   r   r  r   r   r   r   r*  r   r   s              r   create_orderzindependentreserve.create_orderw  s    	V$$OOD))	WWe;	,,#)(#3%+I%6" 
  
  
 "7??$GG66t{{7F7S7STTHH77GV8T8TUUH;' 
  
   	r   c                     |                                   d|i}|                     |                     ||                    S )aD  
        cancels an open order
        :param str id: order id
        :param str symbol: unified symbol of the market the order was made in
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
        r:  )r   privatePostCancelOrderr   )r   r   r   r   r   s        r   cancel_orderzindependentreserve.cancel_order  sF     	
 **4;;w+G+GHHHr   r   c                     |                                   |                     |          }d|d         i}|                     |                     ||                    }|                     |          S )a  
        fetch the deposit address for a currency associated with self account
        :see: https://www.independentreserve.com/features/api#GetDigitalCurrencyDepositAddress
        :param str code: unified currency code
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :returns dict: an `address structure <https://docs.ccxt.com/#/?id=address-structure>`
        r   r   )r   r  +privatePostGetDigitalCurrencyDepositAddressr   parse_deposit_address)r   r   r   r  r   r   s         r   fetch_deposit_addressz(independentreserve.fetch_deposit_address  sr     	==&&!8D>
 CCDKKPWY_D`D`aa ))(333r   r  c                     |                      |d          }|                     |           ||                      |d          ||                      |d          d dS )NDepositAddressr   Tag)r   r  addresstagnetwork)r   check_address)r   depositAddressr  r~  s       r   ry  z(independentreserve.parse_deposit_address  sl     "">3CDD7###"((6::##NE::
 
 	
r   rP   GETc                    | j         d         |         dz   |z   }|dk    r|r|d|                     |          z   z  }n|                                  |                                 }|d| j        z   dt          |          z   g}	t          |                                          }
t          dt          |
                    D ]:}|
|         }t          ||                   }|	
                    |dz   |z              ;d	                    |	          }|                     |                     |          |                     | j                  t          j                  }|                     i           }| j        |d
<   ||d<   |                                |d<   t          dt          |
                    D ]}|
|         }||         ||<   |                     |          }ddi}||||dS )NrS   r   rP   ?zapiKey=znonce=r   =,apiKeynonce	signaturezContent-Typezapplication/json)urlmethodbodyheaders)r   	urlencodecheck_required_credentialsr  r  strlistkeysr   r   r   joinhmacencodesecrethashlibsha256rD  upperjson)r   pathrS   r  r   r  r  r  r  authr  r   keyvaluemessager  querys                    r   signzindependentreserve.sign  s   is#c)D0(?? 4sT^^F3333++---JJLLEDK'3u::%D
 &&D1c$ii(( / /1gF3K((C#I-....hhtnnG		$++g"6"6DK8P8PRYR`aaILL$$E"kE(O"E'N!*!2!2E+1c$ii(( ) )1g#C[c

99U##D%'9:GfdwOOOr   )N))__name__
__module____qualname__r   r   r   r   r   r   r   r  r   r   r   r   r  r  r
   r-  r(  r   r<  rJ  rM  rR  r   ra  rf  r   rm  r   r   floatr	   rs  rv  rz  r   ry  r  __classcell__)r   s   @r   r   r      s           B $& M M$v, M M M M^
) 
) 
) 
) 
) $& , ,( , , , , :>b z zs z3 zY z z z z$, ,6 ,V , , , ,\ 02 3 33 3f 3 3 3 3:\ \ \5 \ \ \ \|
: 
: 
: 26b 2 2c 23 2 2 2 2  /3TXac = = =3 =c =hlmrhs = = = =0 154VZce = =# =S =PS =jnotju = = = =0 -1tRT]_ I Ic I IC I I I I.# # #5 # # # #J 6:UW K K3 Ks K# K\`af\g K K K K& )+ ( ({ ( ( ( (T gksu  3 i y RW `c    @ 37r I Is IC I I I I 79 4 4# 4 4 4 40
 
h 
 
 
 
& &eBSW P P P P P P P Pr   r   )ccxt.base.exchanger    ccxt.abstract.independentreserver   r  ccxt.base.typesr   r   r   r   r	   r
   r   r   r   r   r   r   r   typingr   ccxt.base.decimal_to_precisionr   ccxt.base.preciser   r    r   r   <module>r     sh   ( ' ' ' ' ' 8 8 8 8 8 8  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J  J       4 4 4 4 4 4 % % % % % %^P ^P ^P ^P ^P; ^P ^P ^P ^P ^Pr   