
    iR                    L   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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! 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) d dl*m+Z+  G d dee          Z,dS )    )Exchange)ImplicitAPIN)AccountBalances
CurrenciesCurrencyIntLeverageMarketNumOrder	OrderBook	OrderSide	OrderTypeStrStringsTickerTickersTradeTradingFeesTransaction)List)ExchangeError)AuthenticationError)ArgumentsRequired)
BadRequest)	BadSymbol)InsufficientFunds)InvalidOrder)OrderNotFound)NotSupported)DDoSProtection)ExchangeNotAvailable)InvalidNonce)	TICK_SIZE)Precisec                       e Zd Z fdZd Zi fdZi fdefdZi fdee	         fdZ
i fdee         fdZi fdefdZd@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	i fdedefdZd@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e	defdZ d	d	i fdedededee         fdZ!d@de	de"fdZ#d Z$d Z%d Z&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.d	d	d	i fde-dededee"         fd&Z/d	i fd$ede-fd'Z0d	d	d	i fde-dedefd(Z1d	d	d	i fd)e-dededee2         fd*Z3d	d	d	i fd)e-dededee2         fd+Z4d	d	d	i fd)e-dededee2         fd,Z5d	d	d	i fd)e-dedefd-Z6d@d.e7de2fd/Z8d0 Z9d1 Z:d	d	d	i fd)e-dedefd2Z;d@d.e7fd3Z<d4 Z=d5 Z>i fdede?fd6Z@d@de?fd7ZAi fd)efd8ZBd@d.e7fd9ZCd:d;i d	d	fd<ZDd	i fdefd=ZEd@de	fd>ZFd? ZG xZHS )Acurrencycomc                    |                      t          t          |                                           i ddddddg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 d(d d)d d*d
d+d
d,dd-d d.dd/d
d0d
d1dd2di d3d
d4d
d5d
d6d
d7d
d8d
d9d
d:dd;dd<d
d=dd>d
d?d
d@ddAd
dBddCdi dDd dEddFddGddHd dId dJd dKd dLd
dMddNd dOd
dPddQddRddSddTd
dd d d d"d d dd d d d d d d dUdVdWdXdYdZd[d\d]d^d_d`	dadbdcdddededfdgdhdhdidjdkdlgdmdndodpdqdqdqdqdqdqdqdqdqdqdqdqdridpi dsdqdtdqdudqdvdqdwdqdxdqdydqdzdqd{dqd|dqd}dqd~dqddqddqddqddqddqii ddqddqddqddqddqddqddqddqddqddqddqddqddqddqddqddqddqdqdqdqdqdqdqdqdqddqdqdqdqdqdqdqdqddqdqddddddpd
d|                     d          |                     d          didt
          dddddd
d
dddddg dd	dt          t          t          t          t          t          t          t          t          t          t          t          dt          t          t          t          t          t          t          t          t          t          t          t          t          dddddddddddddddd          S )Nidr(   namezCurrency.com	countriesBY	rateLimitd   	certifiedFproTversionv2hasCORSspotmarginswapfutureoption	addMargincancelAllOrderscancelOrdercancelOrderscreateDepositAddresscreateLimitOrdercreateMarketOrdercreateOrdercreateStopLimitOrdercreateStopMarketOrdercreateStopOrder	editOrderemulatedfetchAccountsfetchBalancefetchBidsAsksfetchBorrowRateHistoryfetchCanceledOrdersfetchClosedOrderfetchClosedOrdersfetchCrossBorrowRatefetchCrossBorrowRatesfetchCurrenciesfetchDepositfetchDepositAddressfetchDepositAddressesfetchDepositAddressesByNetworkfetchDepositsfetchDepositsWithdrawalsfetchFundingHistoryfetchFundingRatefetchFundingRateHistoryfetchFundingRatesfetchIndexOHLCVfetchIsolatedBorrowRatefetchIsolatedBorrowRatesfetchL2OrderBookfetchLedgerfetchLedgerEntryfetchLeveragefetchLeverageTiersfetchMarginModefetchMarketsfetchMarkOHLCVfetchMyTrades
fetchOHLCVfetchOpenOrderfetchOpenOrders
fetchOrderfetchOrderBookfetchOrderBooksfetchOrdersfetchOrderTradesfetchPositionfetchPositionModefetchPositionsfetchPositionsRiskfetchPremiumIndexOHLCVfetchTickerfetchTickers	fetchTimefetchTradesfetchTradingFee)fetchTradingFeesfetchTradingLimitsfetchTransactionFeefetchTransactionFeesfetchTransactionsfetchTransfersfetchWithdrawalfetchWithdrawalsreduceMarginsetLeveragesetMarginModesetPositionModesignIntransferwithdraw
timeframes1m5m10m15m30m1h4h1d1w)	r   r   r   r   r   r   r   r   r   hostnamezbackend.currency.comurlszchttps://user-images.githubusercontent.com/1294454/83718672-36745c00-a63e-11ea-81a9-677b1f789a4d.jpgz"https://api-adapter.{hostname}/apiz https://marketcap.{hostname}/api)publicprivate	marketcapz'https://demo-api-adapter.{hostname}/api)r   r   zhttps://www.currency.comz;https://currency.com/trading/signup?c=362jaimv&pid=referralzhttps://currency.com/apiz!https://currency.com/fees-charges)logoapitestwwwreferraldocfeesr   get   )zv1/timezv1/exchangeInfozv1/depthzv1/aggTradesz	v1/klineszv1/ticker/24hrzv2/timezv2/exchangeInfozv2/depthzv2/aggTradesz	v2/klineszv2/ticker/24hrz	v1/assetsz
v1/candleszv1/orderbookz
v1/summaryz	v1/tickerzv1/token/assetszv1/token/orderbookzv1/token/summaryzv1/token/tickerzv1/token/tradeszv1/token_crypto/OHLCzv1/token_crypto/assetszv1/token_crypto/orderbookzv1/token_crypto/summaryzv1/token_crypto/tickerzv1/token_crypto/tradesz	v1/tradesz
v1/accountzv1/currencieszv1/depositszv1/depositAddressz	v1/ledgerzv1/leverageSettingszv1/myTradeszv1/openOrderszv1/tradingPositionszv1/tradingPositionsHistoryzv1/transactionszv1/withdrawalsz
v2/accountzv2/currencieszv2/depositszv2/depositAddressz	v2/ledger)zv2/leverageSettingszv2/myTradeszv2/openOrderszv2/tradingPositionszv2/tradingPositionsHistoryzv2/transactionszv2/withdrawalszv2/fetchOrder)v1/orderzv1/updateTradingPositionzv1/updateTradingOrderzv1/closeTradingPositionv2/orderzv2/updateTradingPositionzv2/updateTradingOrderzv2/closeTradingPosition)r   r   )r   postdelete)r   r   r   r   tradingz0.002)feeSide	tierBased
percentagetakermakerprecisionModeoptionsGTCi  r   FULLRESULT)marketlimitstop	_LEVERAGE)USDEURUSDT)	defaultTimeInForce"warnOnFetchOpenOrdersWithoutSymbol
recvWindowtimeDifferenceadjustForTimeDifferenceparseOrderToPrecisionnewOrderRespTypeleverage_markets_suffixcollateralCurrencies
exceptions)z?FIELD_VALIDATION_ERROR Cancel is available only for LIMIT orderzAPI key does not existz Order would trigger immediately.z6Account has insufficient balance for requested action.z Rest API trading is not enabled.z!Combination of parameters invalidzInvalid limit pricez"Only leverage symbol allowed here:z$market data service is not availablezyour time is ahead of serverzCan not find accountz6You mentioned an invalid value for the price parameter)z-1000z-1013z-1022z-1030z-1100z-1104z-1025z-1128z-2010z-2011z-2013z-2014z-2015)broadexactcommonCurrencies	AccenturezAMC Entertainment HoldingszBank of Nova ScotiazAvis Budget Group InczContinental Resourcesz-New Oriental Education & Technology Group IncEatonzFox CorporationzGeneral Motors CoiQIYIOshkoshzDave & Buster's Entertainment)ACNAMCBNSCARCLREDUETNFOXGMIQOSKPLAY)deep_extendsuperr(   describeparse_numberr%   r   r   r   r#   r   r   r$   r   r    )self	__class__s    V/var/www/html/crypto-bot/backend/venv/lib/python3.11/site-packages/ccxt/currencycom.pyr   zcurrencycom.describe   s$	   k4 8 8 A A C C WF
-WF
NWF
 $WF
 	WF

 WF
 4WF
 tWF
  TTT $T 	T
 %T %T TT "4T tT T 'T #DT $TT tT 'T  (!T" "4#T T$ Z%T&  'T( )T*  +T, )$-T. &t/T0 #D1T2 $T3T4 '5T6 (7T8 "49T: ;T< &t=T> (?T@ 1%ATB  CTD +DET T TF &uGTH #EITJ *5KTL $UMTN "5OTP *5QTR +ESTT #DUTV tWTX #EYTZ  [T\ %e]T^ "5_T` aTb !%cTd  eTf dgT T Th !$iTj "4kTl dmTn !$oTp "4qTr tsTt #DuTv  wTx $UyTz !${T| %d}T~ )%T@ tATB CTD TETF tGTH "5IT TJ %)&*'+(,%/"&#'$( $#!%#'  gT T TWF
| 
 
}WF
R .SWF
T }BC!C  HH  2Y. <! UWF
z #$+,$%()%&*+#$+,$%()%&*+ "  #Q$a ' %a	
 $Q *1 -a +A *1 *1 / 1! 4Q 21 1!  1!!" $Q#,$a' &q ,Q	
 $Q .q &q ( .q 5a *1 )! %a ( &q  ,Q!" $Q#$ 01'()*/067+,*+)*3  8 %&451234$%451234	 	 %&$% M* *MQ Q{WF
^ $!&"&!..w77!..w77 _WF
p YqWF
t &+6:&"#+0).$%$% %
 ,7(>(>(> uWF
R Wc.A8DN_8L9C+5:C<P4@,6NX  2)0))*0'***00  SWF
R "3,..F() 7! !SWF
 W W W	    c                 F    |                                  | j        d         z
  S )Nr   )millisecondsr   )r   s    r   noncezcurrencycom.nonce7  s!      ""T\2B%CCCr   c                 X    |                      |          }|                     |d          S )ah  
        fetches the current integer timestamp in milliseconds from the exchange server
        :see: https://apitradedoc.currency.com/swagger-ui.html#/rest-api/timeUsingGET
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :returns int: the current integer timestamp in milliseconds from the exchange server
        
serverTime)publicGetV2Timesafe_integerr   paramsresponses      r   
fetch_timezcurrencycom.fetch_time:  s/     ''//   <888r   returnc                    |                      d          sdS |                     |          }i }t          dt          |                    D ]}||         }|                     |d          }|                     |          }|                     |d          }|||                     |d          |                     |d          ddd||                     | 	                    |                     |d                              ddd	|                     |d
          |                     |d          d	|                     |d          dd	d|d||<   
|S )a4  
        fetches all available currencies on an exchange
        :see: https://apitradedoc.currency.com/swagger-ui.html#/rest-api/getCurrenciesUsingGET
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :returns dict: an associative dictionary of currencies
        FNr   displaySymbolcommissionFixedtyper+   	precisionminmaxminWithdrawalmaxWithdrawal
minDeposit)amountr   deposit)r*   coder   r+   activer   r   feer   limitsinfo)
check_required_credentialsprivateGetV2Currenciesrangelensafe_stringsafe_currency_codesafe_numbersafe_string_lowerr   parse_precision)	r   r   r   resulticurrencyr*   r   r   s	            r   fetch_currencieszcurrencycom.fetch_currenciesI  s    ..u55 	4..v662 q#h--(( 	 	A{H!!(O<<B**2..D""8->??C..x@@((6:: !..t/C/CDDTDTU]_jDkDk/l/lmm  $# 
  $///JJ#///JJ! !
  $//,GG#     !1 F4LL4 r   c                    |                      |          }| j        d         r|                                  |                     |dg           }g }t	          dt          |                    D ]}||         }|                     |d          }|                     |d          }|                     |d          }	|                     |          }
|                     |	          }|
dz   |z   }|                     |d          }|d	k    }d
}|dk    }|rdnd}d}|r)|                    | j        d         d          }|d|z   z  }|                     |d          dk    }| 	                    |dd          }|                     |d|          }|                     |d|          }t          j        |d          }t          j        |d          }|                     |dg           }|                     |d          }d}d}|                     |d          }d|v rr|                     |di           }|                     |d          }|                     |d          }|                     |d          }|t          j        |d          r|}|                     |                     |                     |d                               }ddd!}d"|v rZ|                     |d"i           }|                     |d#          }|                     |d$          |                     |d%          d!}ddd!} d&|v rD|                     |d&i           }|                     |d$          |                     |d%          d!} d}!d'|v r-|                     |d'i           }|                     |d(          }!|p|}"|                    i d)|d|d*|
d+|d,dd-|d.|	d/dd0|d|d1|d|d2|d3d
d4|d5|"d6|"rd7ndd|                     |          |                     |          ddddd||d8ddd!|| ||                     |          d!|!dd!d9d|d:           |S );a8  
        retrieves data on all markets for currencycom
        :see: https://apitradedoc.currency.com/swagger-ui.html#/rest-api/exchangeInfoUsingGET
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :returns dict[]: an array of objects representing market data
        r   symbolsr   symbol	baseAsset
quoteAsset/
marketTypeSPOTFLEVERAGEr8   r6   Nr    :statusTRADINGexchangeFee
tradingFeemakerFeetakerFee100filters
filterTypetickSizePRICE_FILTERminPricemaxPrice0baseAssetPrecisionr   LOT_SIZEstepSizeminQtymaxQtyMARKET_LOT_SIZEMIN_NOTIONALminNotionalr*   basequotesettlebaseIdquoteIdsettleIdr   r7   r9   r:   r   contractlinearT)r   price)leverager   r   r0  cost)inverser   r   contractSizeexpiryexpiryDatetimestrike
optionTyper   r   createdr   )publicGetV2ExchangeInfor   load_time_difference
safe_valuer   r   r   r   replacesafe_string_2r&   
string_divindex_byr   	string_gtr   r  append)#r   r   r   marketsr  r  r   r*   r+  r,  r(  r)  r	  typeRawr6   futuresr8   r   r7   r   r  r  r  r  filtersByTypelimitPriceMinlimitPriceMaxprecisionPricefilterr  precisionAmountlimitAmountlimitMarketcostMin
isContracts#                                      r   fetch_marketszcurrencycom.fetch_markets  s    //77d <12 	(%%'''//(Ir::q#g,,'' s	 s	AQZF!!&(33B%%fk::F&&v|<<G**622D++G44ECZ%'F&&v|<<Gv%DGz)D!-66vDF &5N(OQSTT#+%%%fh779DF,,V]LQQK''
KHHH''
KHHH)(E::H)(E::Hoofi<<G MM'<@@M M M!--fjAAN..KK!%!1!1&*!E!E
 !% 0 0 D D++FJ??(w/@3/O/O($,M"//0D0DTEUEUV\^rEsEs0t0tuuO K ]**
BGG"&"2"26:"F"F++FH==++FH== 
  K !M118I2NN++FH==++FH==  G..KK**6=AAJMM 0b0&0 0 	0
 $0 &0 70 D0 0 0 &0 0 '0 %0 &0  J!0" *6$$$#0$  **844**844 $"&"-+   $#! ! *),#00?? 
  '#     _0 0 0 0 0 0 0b r   c                 h   |                      |          }|                     |dg           }g }t          dt          |                    D ]e}||         }|                     |d          }|                     |d          }|                     |          }	|                    |d|	|d           f|S )ax  
        fetch all the accounts associated with a profile
        :see: https://apitradedoc.currency.com/swagger-ui.html#/rest-api/accountUsingGET
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :returns dict: a dictionary of `account structures <https://docs.ccxt.com/#/?id=account-structure>` indexed by the account type
        balancesr   	accountIdassetN)r*   r   r  r   )privateGetV2Accountr<  r   r   r   r   rB  )
r   r   r   accountsr  r  accountrS  
currencyIdcurrencyCodes
             r   fetch_accountszcurrencycom.fetch_accountsA  s     ++F33@ ??8Z<<q#h--(( 
	 
	AqkG((+>>I))'7;;J22:>>LMM(	      r   c                 0   |                                   |                     |          }|                     |d          }|                     |d          }i }t          dt	          | j                            D ]}| j        |         }||||ddd||<   |S )ai  
        fetch the trading fees for multiple markets
        :see: https://apitradedoc.currency.com/swagger-ui.html#/rest-api/accountUsingGET
        :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
        makerCommissiontakerCommissionr   TF)r   r	  r   r   r   r   )load_marketsrU  r   r   r   r  )r   r   r   r  r  r  r  r	  s           r   fetch_trading_feeszcurrencycom.fetch_trading_feesw  s     	++F33 ##H.?@@##H.?@@q#dl++,, 		 		A\!_F  !!"" F6NN r   Nc                    d|i}|                      |dg           }t          dt          |                    D ]}||         }|                     |d          }|                     |          }|                                 }	|                     |d          |	d<   |                     |d          |	d<   |	||<   |                     |          S )Nr   rR  r   rT  freelockedused)r<  r   r   r   r   rW  safe_balance)
r   r   r   r  rR  r  balancerX  r   rW  s
             r   parse_balancezcurrencycom.parse_balance  s    . (#??8Z<<q#h--(( 	# 	#AqkG))'7;;J**:66DllnnG"..w??GFO"..wAAGFO"F4LL  (((r   c                 ~    |                                   |                     |          }|                     |          S )az  
        query for balance and get the amount of funds available for trading or funds locked in orders
        :see: https://apitradedoc.currency.com/swagger-ui.html#/rest-api/accountUsingGET
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :returns dict: a `balance structure <https://docs.ccxt.com/#/?id=balance-structure>`
        )r^  rU  rf  r   s      r   fetch_balancezcurrencycom.fetch_balance  s@     	++F33@ !!(+++r   r	  r   c                 *   |                                   |                     |          }d|d         i}|||d<   |                     |                     ||                    }|                     ||          }|                     |d          |d<   |S )aJ  
        fetches information on open orders with bid(buy) and ask(sell) prices, volumes and other data
        :see: https://apitradedoc.currency.com/swagger-ui.html#/rest-api/depthUsingGET
        :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*   Nr   lastUpdateIdr   )r^  r   publicGetV2Depthextendparse_order_bookr   )r   r	  r   r   r   requestr   	orderbooks           r   fetch_order_bookzcurrencycom.fetch_order_book  s     	V$$fTl
 $GG((Wf)E)EFF  ))(F;;	!..xHH	'r   r   c           	         |                      |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#          |d$|          S )%N	closeTime	timestampr	  
symbolNamer  	lastPricedatetimehigh	highPricelowlowPricebidbidPrice	bidVolumebidQtyaskaskPriceofr	askVolumeofrQtyvwapweightedAvgPriceopen	openPricecloselastpreviousCloseprevClosePricechangepriceChanger   priceChangePercentaveragevolumequoteVolume)
baseVolumer  r   )safe_integer_2r>  safe_marketr   safe_tickeriso8601)r   tickerr   rs  marketIdr  s         r   parse_tickerzcurrencycom.parse_ticker  sK   f ''[II	%%fhEE!!(FC8844 !
fX&!
!
 Y//!
 D$$V[99	!

 4##FJ77!
 4%%fj%@@!
 ))&(;;!
 4%%fj%@@!
 ))&(;;!
 D$$V-?@@!
 D$$V[99!
 T!
 D!
 T--f6FGG!
 d&&v}==!
  $**63GHH!!
" t#!
$ **68<<++FMBB)!
 !
 !
* +  	r   c                     |                                   |                     |          }d|d         i}|                     |                     ||                    }|                     ||          S )a  
        fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
        :see: https://apitradedoc.currency.com/swagger-ui.html#/rest-api/ticker_24hrUsingGET
        :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   publicGetV2Ticker24hrrl  r  r   r	  r   r   rn  r   s         r   fetch_tickerzcurrencycom.fetch_ticker\  sr     	V$$fTl
 --dkk'6.J.JKK*   6222r   r  c                     |                                   |                     |          }|                     ||          S )a.  
        fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
        :see: https://apitradedoc.currency.com/swagger-ui.html#/rest-api/ticker_24hrUsingGET
        :param str[]|None symbols: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
        )r^  r  parse_tickers)r   r  r   r   s       r   fetch_tickerszcurrencycom.fetch_tickers  sA     	--f55& !!(G444r   c           	         |                      |d          |                     |d          |                     |d          |                     |d          |                     |d          |                     |d          gS )Nr   r               )r   r   )r   ohlcvr   s      r   parse_ohlcvzcurrencycom.parse_ohlcv  s     eQ''UA&&UA&&UA&&UA&&UA&&
 	
r   r   sincec                 Z   |                                   |                     |          }|d         |                     | j        ||          d}|||d<   |t	          |d          |d<   |                     |                     ||                    }|                     |||||          S )a  
        fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
        :see: https://apitradedoc.currency.com/swagger-ui.html#/rest-api/klinesUsingGET
        :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
        r*   )r	  intervalN	startTime  r   )r^  r   r   r   r   publicGetV2Klinesrl  parse_ohlcvs)	r   r	  	timeframer  r   r   r   rn  r   s	            r   fetch_ohlcvzcurrencycom.fetch_ohlcv  s     	V$$Tl(()YOO
 
 #(GK "5$//GG))$++gv*F*FGG   69eUKKKr   c                    |                      |dd          }|                     |dd          }|                     |dd          }|                     |dd          }d }|                     |d	          }d }	d
|v r|d
         rdnd}d}	nd|v r|d         rdnd}|d         rdnd}	d }
d|v r@|                     |d          |                     |                     |d                    d}
|                     |d          }|                     ||          }|                     ||||                     |          |d |	|||d |
|d|          S )NTtimepr0  qqtyar*   orderIdmsellbuyr   isBuyerisMakerr   
commissioncommissionAsset)r2  r  r	  )r*   orderrs  rv  r	  r   takerOrMakersider0  r   r2  r   r   )r  r>  r   r   safe_symbol
safe_trader  )r   trader   rs  priceStringamountStringr*   r  r  r  r   r  r	  s                r   parse_tradezcurrencycom.parse_trade  s   L ''sF;;	((W==))%e<<sD11""5)44%<<"3Z266UD"LL%"9-:55FD&+I&6C77GL5  ((== 33D4D4DUL]4^4^__ C ##E844!!(F33"Y//( " 
  
   	r   c                 "   |                                   |                     |          }d|d         i}|t          |d          |d<   |||d<   |                     |                     ||                    }|                     ||||          S )a8  
        get the list of most recent trades for a particular symbol
        :see: https://apitradedoc.currency.com/swagger-ui.html#/rest-api/aggTradesUsingGET
        :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*   Nr  r   r  )r^  r   r   publicGetV2AggTradesrl  parse_tradesr   r	  r  r   r   r   rn  r   s           r   fetch_tradeszcurrencycom.fetch_trades  s     	V$$fTl
 "5$//GG#(GK ,,T[[&-I-IJJ   65%@@@r   c                    |                      |d          }|                     ||d          }|                      |d          }|                      |d          }|                     |dd          }|                      |d          }t          j        |          }	|                     |                      |d                    }
|                     |                     |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|          S )Nr	  r  r  r0  origQtyquantityexecutedQtyr  timeInForcetimeInForceTyper   r  )r  transactTimers  fillsr   r*   rs  rv  lastTradeTimestamp	stopPricetriggerPricer   r2  r  filled	remaining)r  r   trades)r   r  r>  r&   
string_absparse_order_statusparse_order_time_in_forceparse_order_typeparse_order_sidesafe_integer_nr<  
safe_orderr  )r   r  r   r  r	  r*   r0  r   	filledRawr  r  r  r   r  rs  r  s                   r   parse_orderzcurrencycom.parse_order>  sc   H ##E844!!(FC88eY//  00##E9jAA$$UM::	#I..(()9)9%)J)JKK44T5G5G}^o5p5pqq$$T%5%5eV%D%DEE$$T%5%5eV%D%DEE''/T/T/TUU	w//  
E 
" 
  
 Y//	 

 !$ 
 f 
 D 
 ; 
 D 
 U 
  
 D 
 f 
 D 
 t 
  f! 
" # 
$ ) 
  
  
* +  	r   c           
      H    dddddddddd	}|                      |||          S )Nr  closedcanceled	cancelingrejectedexpired)	NEWCREATEDMODIFIEDPARTIALLY_FILLEDFILLEDCANCELEDPENDING_CANCELREJECTEDEXPIREDr   r   r  statusess      r   r  zcurrencycom.parse_order_status  sC     &")" 

 

 &&999r   c                 <    dddd}|                      |||          S )Nr   r   r   )MARKETLIMITSTOPr  r  s      r   r  zcurrencycom.parse_order_type  s1    

 

 &&999r   c                 <    dddd}|                      |||          S )Nr   FOKIOC)r   r  r  r  r  s      r   r  z%currencycom.parse_order_time_in_force  s1    
 

 &&999r   c                 :    ddd}|                      |||          S )Nr  r  )BUYSELLr  r  s      r   r  zcurrencycom.parse_order_side  s.    
 
 &&999r   r   r  r   r0  c                    |                                   |                     |          }d}|d         rW|                     | j        d          }|                     |d|          }|#t	          | j        dz   |d         z   dz             |                     | j        d         |d          }	|d	         |                     ||          |                                |                                |	d
}
|dk    r*| 	                    ||          |
d<   | j        d         |
d<   nz|dk    rd|
d<   | 	                    ||          |
d<   nU|dk    rO| 
                    |dd          }|                     |ddg          }|d|
d<   | 	                    ||          |
d<   |                     |                     |
|                    }|                     ||          S )a  
        create a trade order
        :see: https://apitradedoc.currency.com/swagger-ui.html#/rest-api/orderUsingPOST
        :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>`
        Nr7   rS  z^ createOrder() requires an accountId parameter or an exchange.options['accountId'] option for r   z marketsr   r   r*   )r	  r  r   r  r   r   r0  r   r  r   r  r   r  r  )r^  r   r   r   r   r*   r<  amount_to_precisionupperprice_to_precisionsafe_value_2omitprivatePostV2Orderrl  r  )r   r	  r   r  r   r0  r   r   rS  r   rn  r  r   s                r   create_orderzcurrencycom.create_order  s    	V$$	( 	r(({CCI((iHHI '  3S  )S  V\  ]c  Vd  )d  gq  )q  r  r  r??4<8J+KTS[\\Tl00@@JJLLJJLL 0
 
 7??#66vuEEGG%)\2F%GGM""v~~"(#'#:#:65#I#I  !! --fnkRR	6NK+HII(&,GFO'+'>'>vy'Q'QGG$**4;;w+G+GHHP &111r   r*   c                    |t          | j        dz             |                                  |                     |          }||d         d}|                     |                     ||                    }|                     |          S )a  
        fetches information on an order made by the user
        :see: https://apitradedoc.currency.com/swagger-ui.html#/rest-api/getOrderUsingGET
        :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>`
        Nz( fetchOrder() requires a symbol argumentr*   )r  r	  )r   r*   r^  r   privateGetV2FetchOrderrl  r  )r   r*   r	  r   r   rn  r   s          r   fetch_orderzcurrencycom.fetch_order)  s     >#DG.X$XYYYV$$Tl
 
 ..t{{7F/K/KLL. )))r   c                    |                                   d}i }|!|                     |          }|d         |d<   np| j        d         rc| j        }t	          |          }|                     |dz            }	t          | j        dz   t          |	          z   dz   | j        z   dz             | 	                    | 
                    ||                    }
|                     |
||||          S )	a$  
        fetch all unfilled currently open orders
        :see: https://apitradedoc.currency.com/swagger-ui.html#/rest-api/openOrdersUsingGET
        :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  zm fetchOpenOrders() WARNING: fetching open orders without specifying a symbol is rate-limited to one call per z? seconds. Do not call self method frequently to avoid ban. Set zX.options["warnOnFetchOpenOrdersWithoutSymbol"] = False to suppress self warning message.)r^  r   r   r  r   parse_to_intr   r*   strprivateGetV2OpenOrdersrl  parse_orders)r   r	  r  r   r   r   rn  r  
numSymbolsfetchOpenOrdersRateLimitr   s              r   fetch_open_orderszcurrencycom.fetch_open_ordersR  s7    	[[((F &tGH\>? 	flGWJ'+'8'8a'H'H$  +Z  !Z  ]`  ay  ]z  ]z  !z  }~  !~  AE  AH  !H  Ke  !e  f  f  f..t{{7F/K/KLL(   65%HHHr   c                 ^   |t          | j        dz             |                                  |                     |          }|                     |d          }d|d         i}|||d<   n||d<   |                     |                     ||                    }|                     ||          S )a  
        cancels an open order
        :see: https://apitradedoc.currency.com/swagger-ui.html#/rest-api/cancelOrderUsingDELETE
        :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>`
        Nz) cancelOrder() requires a symbol argumentorigClientOrderIdr	  r*   r  )r   r*   r^  r   r<  privateDeleteV2Orderrl  r  )r   r*   r	  r   r   r  rn  r   s           r   cancel_orderzcurrencycom.cancel_order}  s     >#DG.Y$YZZZV$$ OOF4GHHfTl

 $!#GI+<G'(,,T[[&-I-IJJ &111r   c                 *   |t          | j        dz             |                                  |                     |          }d|d         i}|||d<   |                     |                     ||                    }|                     ||||          S )a  
        fetch all trades made by the user
        :see: https://apitradedoc.currency.com/swagger-ui.html#/rest-api/myTradesUsingGET
        :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>`
        Nz+ fetchMyTrades() requires a symbol argumentr	  r*   r   )r   r*   r^  r   privateGetV2MyTradesrl  r  r  s           r   fetch_my_tradeszcurrencycom.fetch_my_trades  s     >#DG.[$[\\\V$$fTl
 $GG,,T[[&-I-IJJ&   65%@@@r   r   c                 4    |                      d||||          S )a$  
        fetch all deposits made to an account
        :see: https://apitradedoc.currency.com/swagger-ui.html#/rest-api/getDepositsUsingGET
        :param str code: unified currency code
        :param int [since]: the earliest time in ms to fetch deposits for
        :param int [limit]: the maximum number of deposits structures to retrieve
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :returns dict[]: a list of `transaction structures <https://docs.ccxt.com/#/?id=transaction-structure>`
        privateGetV2Depositsfetch_transactions_by_methodr   r   r  r   r   s        r   fetch_depositszcurrencycom.fetch_deposits  s#     001GuV[]cdddr   c                 4    |                      d||||          S )a2  
        fetch all withdrawals made from an account
        :see: https://apitradedoc.currency.com/swagger-ui.html#/rest-api/getWithdrawalsUsingGET
        :param str code: unified currency code
        :param int [since]: the earliest time in ms to fetch withdrawals for
        :param int [limit]: the maximum number of withdrawals structures to retrieve
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :returns dict[]: a list of `transaction structures <https://docs.ccxt.com/#/?id=transaction-structure>`
        privateGetV2Withdrawalsr  r  s        r   fetch_withdrawalszcurrencycom.fetch_withdrawals  s$     001JDRWY^`fgggr   c                 4    |                      d||||          S )a  
        fetch history of deposits and withdrawals
        :see: https://apitradedoc.currency.com/swagger-ui.html#/rest-api/getTransactionsUsingGET
        :param str [code]: unified currency code for the currency of the deposit/withdrawals, default is None
        :param int [since]: timestamp in ms of the earliest deposit/withdrawal, default is None
        :param int [limit]: max number of deposit/withdrawals to return, default is None
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :returns dict: a list of `transaction structure <https://docs.ccxt.com/#/?id=transaction-structure>`
        privateGetV2Transactionsr  r  s        r   fetch_deposits_withdrawalsz&currencycom.fetch_deposits_withdrawals  s$     001KTSXZ_aghhhr   c                     |                                   i }d }||                     |          }|||d<   |||d<   d }|dk    r*|                     |                     ||                    }nw|dk    r*|                     |                     ||                    }nG|dk    r*|                     |                     ||                    }nt          | j        dz             |                     |||||          S )Nr  r   r  r"  r%  z4 fetchTransactionsByMethod() not support self method)	r^  r  r  rl  r"  r%  r!   r*   parse_transactions)	r   methodr   r  r   r   rn  r  r   s	            r   r  z(currencycom.fetch_transactions_by_method  s   }}T**H#(GK $GG+++00Wf1M1MNNHH00033DKK4P4PQQHH11144T[[&5Q5QRRHHtw)__```" &&x5%PPPr   r  c                    |                      |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S )Nrs  r  r  )r  r2  rater2  r   r*   txidblockchainTransactionHashr   networkr   r  staterv  addressaddressFrom	addressTotagtagFromtagToupdated)internalcommentr   )r   r   r   parse_transaction_typer   parse_transaction_statusr  )r   transactionr  rs  rX  r   feeCostr   s           r   parse_transactionzcurrencycom.parse_transaction  s    %%k;??	%%k:>>
&&z8<<"";==
 

 "C
O!CK
K
$"";55
 D$$[2MNN
 D//0@0@f0U0UVV	

 
 t
 d&&{H==
 d33D4D4D[RY4Z4Z[[
 
 Y//
 t
 4
 
 4
 t
  T!
" t#
$ )
 
 
 	
r   c                 :    ddd}|                      |||          S )Npendingok)APPROVAL	PROCESSEDr  r  s      r   r:  z$currencycom.parse_transaction_statusG  s.    !
 
 &&999r   c                 :    ddd}|                      |||          S )Nr   
withdrawal)r   rD  r  r   r   typess      r   r9  z"currencycom.parse_transaction_typeN  s.     &
 
 tT222r   c                     |                                   i }d}||                     |          }|||d<   |||d<   |                     |                     ||                    }|                     ||||          S )ao  
        fetch the history of changes, actions done by the user or operations that altered balance of the user
        :see: https://apitradedoc.currency.com/swagger-ui.html#/rest-api/getLedgerUsingGET
        :param str code: unified currency code, default is None
        :param int [since]: timestamp in ms of the earliest ledger entry, default is None
        :param int [limit]: max number of ledger entrys to return, default is None
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :returns dict: a `ledger structure <https://docs.ccxt.com/#/?id=ledger-structure>`
        Nr  r   )r^  r  privateGetV2Ledgerrl  parse_ledger)r   r   r  r   r   rn  r  r   s           r   fetch_ledgerzcurrencycom.fetch_ledgerU  s     	}}T**H#(GK $GG**4;;w+G+GHH8   8UEBBBr   c                    |                      |d          }|                      |d          }t          j        |          }|                     |d          }|                      |d          }|                     ||          }|                      |d          }	d }
|	||	d}
t          j        |d          rdnd	}|||                     |          |d |                      |d
          d |                     |                      |d                    ||d |                      |d          |                     |                      |d                    |
|d}|S )Nr*   r   rs  r  r  )r  r2  r  outinr-  r   re  r  )r*   rs  rv  	directionrW  referenceIdreferenceAccountr   r  r   beforeafterr  r   r   )	r   r&   r  r   r   	string_ltr  parse_ledger_entry_typeparse_ledger_entry_status)r   itemr  r*   r  r   rs  rX  r   r<  r   rN  r  s                r   parse_ledger_entryzcurrencycom.parse_ledger_entry  sl   dD))''h77#L11%%dK88	%%dJ77
&&z8<<""466#W55C$.|SAAKEEt	"Y//"++D2MNN $001A1A$1O1OPP%%dI6644T5E5EdH5U5UVV
 
" r   c                 <    dddd}|                      |||          S )Nr?  r@  r  )rA  rB  	CANCELLEDr  r  s      r   rU  z%currencycom.parse_ledger_entry_status  s1    !#
 

 &&999r   c                 <    dddd}|                      |||          S )Nr;  r   )r   rD  exchange_commissionr  rE  s      r   rT  z#currencycom.parse_ledger_entry_type  s1    $'#(
 

 tT222r   c                     |                                   |                     |          }d|d         i}|                     |                     ||                    }|                     ||          S )a|  
        fetch the set leverage for a market
        :see: https://apitradedoc.currency.com/swagger-ui.html#/rest-api/leverageSettingsUsingGET
        :param str symbol: unified market symbol
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :returns dict: a `leverage structure <https://docs.ccxt.com/#/?id=leverage-structure>`
        r	  r*   )r^  r   privateGetV2LeverageSettingsrl  parse_leverager  s         r   fetch_leveragezcurrencycom.fetch_leverage  sr     	V$$fTl
 44T[[&5Q5QRR ""8V444r   c                 J    |                      |d          }||d         d ||dS )Nvaluer	  )r   r	  
marginModelongLeverageshortLeverage)r   )r   r1  r   leverageValues       r   r^  zcurrencycom.parse_leverage  s:    ))(G<<X&)*
 
 	
r   c                     |                                   |                     |          }d|d         i}|                     |                     ||                    }|                     ||          S )a  
        fetch the deposit address for a currency associated with self account
        :see: https://apitradedoc.currency.com/swagger-ui.html#/rest-api/getDepositAddressUsingGET
        :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>`
        coinr*   )r^  r  privateGetV2DepositAddressrl  parse_deposit_address)r   r   r   r  rn  r   s         r   fetch_deposit_addressz!currencycom.fetch_deposit_address  sr     	==&&HTN
 224;;w3O3OPP ))(H===r   c                     |                      |d          }|                     |           |                     d |          }|d         |d d |dS )Nr0  r   )r  r0  r3  r.  r   )r   check_addresssafe_currency)r   depositAddressr  r0  s       r   ri  z!currencycom.parse_deposit_address  sc    "">9==7###%%dH55 ("
 
 	
r   r   GETc                 ~   | j         d         |         dz   |z   }|dk    r	d| j        i}|dk    r|                                  |                     |                     |                                 | j        d         d|                    }|                     |                     |          |                     | j	                  t          j                  }	|d|	z   z  }d| j        i}|d	k    s|d
k    r	|d|z   z  }n%|}d|d<   n|r|d|                     |          z   z  }|                     |          }||||dS )Nr   r  historicalTradeszX-MBX-APIKEYr   r   )rs  r   z&signature=ro  DELETE?z!application/x-www-form-urlencodedzContent-Type)urlr)  bodyheaders)r   apiKeyr   	urlencoderl  r   r   hmacencodesecrethashlibsha256implode_hostname)
r   pathr   r)  r   rv  ru  rt  query	signatures
             r   signzcurrencycom.sign  so   is#c)D0%%%G )++---NN4;;!ZZ\\"l<80 0 $ $  E 		$++e"4"4dkk$+6N6NPWP^__I')33EG %Vx%7%7sU{"*M'' 4sT^^F3333##C((fdwOOOr   c                     |                                   |                     |          }|                     |dg           }|                     ||          S )a  
        fetch all open positions
        :see: https://apitradedoc.currency.com/swagger-ui.html#/rest-api/tradingPositionsUsingGET
        :param str[]|None symbols: list of unified market symbols
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :returns dict[]: a list of `position structure <https://docs.ccxt.com/#/?id=position-structure>`
        	positions)r^  privateGetV2TradingPositions	safe_listparse_positions)r   r  r   r   datas        r   fetch_positionszcurrencycom.fetch_positions  sW     	44V<<B ~~hR88##D'222r   c                    |                      |                     |d          |          }|d         }|                     |d          }|                     |d          }t          j        |d          rdnd}t          j        |          }|                     |d          }|                     |d          }	|                     |d	          }
t          j        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 d d          S )Nr	  createdTimestampopenQuantityr  longshortr  uplr7   1r   rs  rv  lastUpdateTimestamp	contractsr4  
entryPrice
collateralr  unrealizedProfitr1  r   rb  notional	markPriceru  )liquidationPriceinitialMargininitialMarginPercentagemaintenanceMarginmaintenanceMarginPercentagemarginRatior*   unrealizedPnlhedgedstopLossPricetakeProfitPrice)r  r   r   r&   rA  r  r   r?  safe_positionr  r   )r   positionr   r	  rs  quantityRawr  r  r  r  marginCoeffr1  s               r   parse_positionzcurrencycom.parse_position=  s   : !!$"2"28X"F"FOO!%%h0BCC	&&x@@ *;<<Ivv'%k22%%h<<
++He<<&&x::%c;77!! #
H#
f#
 #
 Y//	#

 "4#
 **844#
 D#
 *#
 $#
 D#
  0#
 #
 $#
 $#
  !#
" ##
$ %#
& !%!'+!%!2!2;!?!?+/!!#;#
 #
 #
   	r   c
                    |dk    s|dk    r3t          | j        dz   t          |          z   dz   |z   dz   |z             |dk    r|                    d          dk    rt	          | j        dz   |z             |                    d          dk    rt	          | j        d	z   |z             |                    d
          dk    rt	          | j        dz   |z             |d S |                     |d          }
|
|
dk    r| j        dz   |                     |          z   }|                     | j        d         |
|           |                     |d          }| 	                    | j        d         ||           t          |          d S )Ni  i   i  zPrice * QTY is zero or lessr   z- order cost = amount * price is zero or less r!  z5 order amount should be evenly divisible by lot size r  z order price is invalid, i.e. exceeds allowed price precision, exceeds min price or max price limits or is invalid float value in general, use self.price_to_precision(symbol, amount) r   r  r   msgr   )r"   r*   r  findr   r   jsonthrow_exactly_matched_exceptionr   throw_broadly_matched_exceptionr   )r   httpCodereasonrt  r)  rv  ru  r   requestHeadersrequestBody	errorCodefeedbackmessages                r   handle_errorszcurrencycom.handle_errors  s   OOS 3X!>!Dv!MPS!SVZ!Z[[[ s??yy6771<<"47-\#\_c#cdddyy$$))"47-d#dgk#klllyy((A--"47  .g  $g  jn  $n  o  o  o4 $$Xv66	!	S(8(8w}tyy':'::H001I9V^___&&x77G001I7T\]]])))tr   )N)I__name__
__module____qualname__r   r   r   r   r  r   r   rP  r   rZ  r   r_  rf  r   rh  r  r	   r   rp  r   r  r  r   r   r  listr  r  r   r  r  r   r  r  r  r  r  r   r   floatr   r  r   r  r  r  r  r   r   r#  r&  r  r   r=  r:  r9  rJ  rW  rU  rT  r
   r_  r^  rj  ri  r  r  r  r  __classcell__)r   s   @r   r(   r(      s       X X X X XtD D D !# 9 9 9 9 ') C CZ C C C CJ $& q q$v, q q q qf %' 4 44= 4 4 4 4l )+ $ ${ $ $ $ $L!) !) !) !)F $& (, (,( (, (, (, (,T :>b " "s "3 "Y " " " "HL L6 LV L L L L\ 02 "3 "33 "3f "3 "3 "3 "3H 04B 5 5W 57 5 5 5 5<
 
 
4 
 
 
 
( 26DW[df L L# Lc LQT Lkoptku L L L L>I I I5 I I I IV 6:UW  A  A3  As  A#  A\`af\g  A  A  A  ADf f f5 f f f fP: : :: : :: : :: : : gksu V2 V23 V2i V2y V2RW V2`c V2 V2 V2 V2p 26b '* '*c '*3 '* '* '* '*R /3TXac )I )I )I3 )Ic )Ihlmrhs )I )I )I )IV 37r %2 %2s %2C %2 %2 %2 %2N -1tRV_a &A &Ac &A &AC &A &A &A &AP *.Dt\^ 
e 
e3 
ec 
e 
ecghsct 
e 
e 
e 
e -1tRV_a 
h 
hc 
h 
hC 
hfjkvfw 
h 
h 
h 
h 6:[_hj 
i 
is 
i# 
iUX 
iost  pA 
i 
i 
i 
i @DRVeirt #Q #Q #QC #Q_b #Q #Q #Q #QJ0
 0
x 0
; 0
 0
 0
 0
d: : :3 3 3 (,$TZ\ /C /C /CC /Cs /C /C /C /Cb     >: : :3 3 3 24 5 5S 5 5 5 5 5,
 
x 
 
 
 
 79 > ># > > > >&

 

h 

 

 

 

 &eBSW P P P P8 26b +3 +3w +3 +3 +3 +3ZE Ev E E E EN      r   r(   )-ccxt.base.exchanger   ccxt.abstract.currencycomr   r|  ccxt.base.typesr   r   r   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   typingr   ccxt.base.errorsr   r   r   r   r   r   r   r    r!   r"   r#   r$   ccxt.base.decimal_to_precisionr%   ccxt.base.preciser&   r(    r   r   <module>r     s~   ( ' ' ' ' ' 1 1 1 1 1 1  H  H  H  H  H  H  H  H  H  H  H  H  H  H  H  H  H  H  H  H  H  H  H  H  H  H  H  H  H  H  H  H  H  H  H  H  H  H  H  H  H  H       * * * * * * 0 0 0 0 0 0 . . . . . . ' ' ' ' ' ' & & & & & & . . . . . . ) ) ) ) ) ) * * * * * * ) ) ) ) ) ) + + + + + + 1 1 1 1 1 1 ) ) ) ) ) ) 4 4 4 4 4 4 % % % % % %B B B B B(K B B B B Br   