
    !:hr                    D   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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l0m1Z1  G d dee      Z2y)    )Exchange)ImplicitAPIN)AccountAnyBalancesBool
Conversion
CurrenciesCurrencyDepositAddressIntLedgerEntryLeverageMarginModificationMarket
MarketTypeNumOrder	OrderBook	OrderSide	OrderTypePositionStrStringsFundingRateFundingRatesTradeTradingFeesTransactionTransferEntry)List)ExchangeError)AuthenticationError)ArgumentsRequired)
BadRequest)InvalidOrder)NotSupported)OperationFailed)RateLimitExceeded)OnMaintenance)	TICK_SIZE)Precisec                       e Zd Zdef fdZi fdZi fdefdZi fdee	   fdZ
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	defdZd Zi fdefdZi fdefdZi fd	edefdZi fd	edefdZdddi fd	edededededefdZdddi fd	edededededefdZdi fd	ededededef
dZd Z ddi fded	ededededefdZ!di fded	e"fdZ#di fd	e"fd Z$i f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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'e"fd(Z*dd)ede	defd*Z+d+e"fd,Z,di fd	edede-fd-Z.d.ddi fd	ed
ededee/   fd/Z0dde	de/fd0Z1dddi fded	e"d
edefd1Z2dddi fd	e"d
edefd2Z3i fdee4   fd3Z5d4 Z6i fde7fd5Z8de7fd6Z9i fd7ede:fd8Z;dddi fd7e"d
ededefd9Z<dddi fd7e"d
ededee=   fd:Z>dd;ed<e?de=fd=Z@d> ZAd? ZBdddi fd7e"d
ededeeC   fd@ZDdddi fd7e"d
ededeeC   fdAZEdddi fd7e"d
ededeeC   fdBZFddCed<e?deCfdDZGd+e"fdEZHi fd7ededFedGedeIf
dHZJdddi fd7e"d
ededeeI   fdIZKddJed<e?deIfdKZLd+e"de"fdLZMdi fd7ededMedeCfdNZNdi fd7eded	e"fdOZOdd<e?fdPZPdQ ZQdRdSi ddfdTZRdUeSdVedWedXedYedZefd[ZTdde	fd\ZUdddi fd	e"d
edefd]ZVdde	deWfd^ZXi fd	edeWfd_ZYi fd	edeWfd`ZZdi fdae[de\fdbZ]dddi fd	e"d
edefdcZ^di fdde_d	e"fdeZ`i fd	edeafdfZbddgede	deafdhZcdi fdged	e"fdiZdi fd	ededeefdjZfi fd	ededeefdkZgi fd	edeefdlZhi fd	e"fdmZidi fdae[deej   fdnZkddoede	fdpZldi fdqedrededemfdsZndi fdedqedrededemf
dtZodi fded7e"demfduZpdddi fd7e"d
ededeem   fdvZqddwedxe?dye?demfdzZri fdefd{Zsd| Ztd}e_f fd~Zu xZvS )wooreturnc                    | j                  t        t        |          i ddddddg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d)dd*dd+dd,dd-dd.dd/dd0dd1dd2dd3di d4dd5dd6dd7dd8dd9dd:dd;dd<dd=dd>dd?dd@ddAddBddCddDdi dEddFddGddHddIddJddKddLddMddNddOddPddQddRddSddTddUdi dVddWddXddYddZdd[dd\dd]dd^dd_dd`ddaddbdcddddeddfddgdddddddhdidjdkdldmdndodpdqdrdsdtdudvdwdxdydydzd{d|d|dzd}d~gdgdddddddddidddddddddddddddii dddddddddddddddddddddddddddddddddddddddddddd	ddddddddddddddddddddzddddiiidddiidddddddddddddddddddddddddddddddddd| j	                  d      | j	                  d      didddddddddddddddi ddidd	dd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dddddȜdddddɜddddddʜddd ddddd̜ddd d ddddd͜ddidМ	ddidddidԜddid d֜d d d֜dלdi di dt
        dt        dt        dt        dt        dt        dt        dt        dt        dt        dt        dt        dt        dt        dt        dt        t        t        t        t        t        t        dddt        i      S )Nidr.   namezWOO X	countriesKY	rateLimitd   versionv1	certifiedTprohostnamezwoox.iohasCORSspotmarginswapfutureFoption	addMargincancelAllOrderscancelAllOrdersAftercancelOrdercancelWithdrawcloseAllPositionsclosePositioncreateConvertTradecreateDepositAddresscreateMarketBuyOrderWithCostcreateMarketOrdercreateMarketOrderWithCostcreateMarketSellOrderWithCostcreateOrder$createOrderWithTakeProfitAndStopLosscreateReduceOnlyOrdercreateStopLimitOrdercreateStopLossOrdercreateStopMarketOrdercreateStopOrdercreateTakeProfitOrdercreateTrailingAmountOrdercreateTrailingPercentOrdercreateTriggerOrderfetchAccountsfetchBalancefetchCanceledOrdersfetchClosedOrderfetchClosedOrdersfetchConvertCurrenciesfetchConvertQuotefetchConvertTradefetchConvertTradeHistoryfetchCurrenciesfetchDepositAddressfetchDepositAddressesfetchDepositAddressesByNetworkfetchDepositsfetchDepositsWithdrawalsfetchFundingHistoryfetchFundingIntervalfetchFundingIntervalsfetchFundingRatefetchFundingRateHistoryfetchFundingRatesfetchIndexOHLCVfetchLedgerfetchLeveragefetchMarginAdjustmentHistoryfetchMarginModefetchMarketsfetchMarkOHLCVfetchMyTrades
fetchOHLCVfetchOpenInterestHistoryfetchOpenOrderfetchOpenOrders
fetchOrderfetchOrderBookfetchOrdersfetchOrderTradesfetchPositionfetchPositionHistoryfetchPositionModefetchPositionsfetchPositionsHistoryfetchPremiumIndexOHLCVfetchStatusfetchTickerfetchTickers	fetchTimefetchTradesfetchTradingFeefetchTradingFeesfetchTransactionsemulatedfetchTransfersfetchWithdrawalsreduceMarginsandbox)setLeverage	setMarginsetPositionModetransferwithdraw
timeframes1m5m15m30m1h4h12h1d1w1mon1y)r   r   r   r   r   r   r   r   r   1Mr   urlszdhttps://user-images.githubusercontent.com/1294454/150730761-1a00e5e0-d28c-480f-9e65-089ce3e6ef3b.jpgzhttps://api-pub.woox.iozhttps://api.{hostname})pubpublicprivatezhttps://api-pub.staging.woox.iozhttps://api.staging.woox.iozhttps://woox.io/zhttps://docs.woox.io/zFhttps://support.woox.io/hc/en-001/articles/4404611795353--Trading-Feesz%https://woox.io/register?ref=DIJT0CNLgffffff?)urldiscount)logoapitestwwwdocfeesreferralr   get
   )z
hist/klinezhist/trades   )infozinfo/{symbol}system_infomarket_tradestokentoken_networkfunding_rateszfunding_rate/{symbol}funding_rate_historyfutureszfutures/{symbol}zorderbook/{symbol}klinezclient/tokenorder/{oid}zclient/order/{client_order_id}orderszclient/trade/{tid}zorder/{oid}/tradeszclient/tradeszclient/hist_tradeszstaking/yield_historyzclient/holdingzasset/depositzasset/history<   zsub_account/allzsub_account/assetszsub_account/asset_detailzsub_account/ip_restrictionzasset/main_sub_transfer_history   gp=
ף
@)	token_interestztoken_interest/{token}zinterest/historyinterest/repayzfunding_fee/history	positionszposition/{symbol}zclient/transaction_historyclient/futures_leveragex      )orderzorder/cancel_all_afterzasset/main_sub_transferz	asset/ltvasset/withdrawzasset/internal_withdrawr   zclient/account_modezclient/position_modezclient/leverager   zclient/isolated_margin)r   zclient/orderr   r   )r   postdeleter   insuranceFund   )algo/order/{oid}zalgo/ordersbalancesaccountinfor   buypower	referralsreferral_rewardszconvert/exchangeInfozconvert/assetInfozconvert/rfqzconvert/tradezconvert/trades)
algo/orderzconvert/rft   )r   zorder/client/{client_order_id}r   z#algo/order/client/{client_order_id})zalgo/order/{order_id}zalgo/orders/pendingzalgo/orders/pending/{symbol}zorders/pending)r   r   putr   )r   r   )r8   v2v3r   tradingz0.0002z0.0005)	tierBased
percentagemakertakeroptionsr   ERC20ATOMZRX)HTOMGUATOMr   TRONETHBSC)TRXTRC20r   BEP20fillResponseFromRequest$bc830de7-50f3-460b-9ee0-f430f83f9dad)	timeDifferenceadjustForTimeDifferencesandboxMode!createMarketBuyOrderRequiresPriceznetwork-aliases-for-tokensnetworksdefaultNetworkCodeForCurrenciesr   brokerIdfeatures)lastmarkindex)IOCFOKPOGTD)
marginModetriggerPricetriggerPriceTypetriggerDirectionstopLossPricetakeProfitPriceattachedStopLossTakeProfittimeInForcehedgedtrailingleveragemarketBuyByCostmarketBuyRequiresPriceselfTradePreventioniceberg  Z   i'  )r   limitdaysBack	untilDayssymbolRequired)r   triggerr  r  )r   r  r  r  r  i )r   r  r  r  r  r  r  )r   r  r  daysBackCanceledr  r  r  r  r    )	r   rP   createOrdersrw   r|   r{   r~   r_   rx   extendsdefaultr  )r  rP   forSwap)linearinverse)r  r>   r  r@   rA   commonCurrencies
exceptionsz-1000z-1001z-1002z-1003z-1004z-1005z-1006z-1007z-1008z-1009z-1012z-1101z-1102z-1103z-1104z-1105)zCan not placemaintenancezsymbol must not be blankzThe token is not supportedz7Your order and symbol are not valid or already canceledzCInsufficient WOO. Please enable margin trading for leverage trading)exactbroadprecisionMode)deep_extendsuperr.   describeparse_numberr(   r#   r)   r%   r&   r"   r*   r+   )self	__class__s    P/var/www/html/turnos/venv/lib/python3.12/site-packages/ccxt/async_support/woo.pyr"  zwoo.describe   s   c4 9 ; e>
%e>
Ge>
 $e>
 	e>

 te>
 e>
 4e>
 	e>
  [[[ $[ 	[
 %[ %[ T[ "4[ '[ t[ !%[ $U[  [ %d[ '[  /![" $U#[$ ,U%[& 0'[( t)[* 7+[, (-[. '/[0 &t1[2 (3[4 "55[6 (7[8 ,T9[: -d;[< %d=[>  ?[@ A[B &uC[D #EE[F $TG[H )$I[J $TK[L $TM[N +DO[P "4Q[R &tS[T (U[V 1%W[X  Y[Z +D[[\ &t][^ '_[` (a[b #Dc[d *4e[f $Tg[h "5i[j tk[l  m[n /o[p "5q[r s[t !%u[v  w[x dy[z +E{[| !%}[~ "4[@ dA[B !$C[D tE[F #DG[H  I[J 'K[L $UM[N !$O[P (Q[R )%S[T tU[V uW[X Y[Z T[[\ t][^ "5_[` #Da[b $Zc[d !$e[f #Dg[h i[j 4k[l  $"#'  u[e>
J Ke>
d ~467 =;<
 *+ ] C $'ee>
T  *,+-  $%-.+,-.%&-.-.5645'(0123%& $ *A )1  =a  %a	 
 1!  1!  ,Q  1!  4Q  -a  ,R  ,R  .r  1"  7   9"! " >r# $ /16802.035)-15:<795 : &'6779)+.079.03645/27968! &',-&'.1	#W1 1JX ,a   +Q  12+,()+-)-())+024512+--../   +,+-!
 ,->?01CD	  6734<=./	#5  'g{Ue>
L !%"&!..x8!..x8	Me>
\ "#+0$59 ""# 	/ "#""	4
 .t C5]e>
T	 #&*(,$($(%*-
 -2).+06:#'#'"&#'	( #($($)+/27/4#'1$4 %)&+!$$&%**/& ',#'$)*/	# ',!$#'$(*/( ',!$$(%+#'$(*/$ ',!$$(,0%+#'$(*/	*  #IGR y  ) $$ "9  $	 ##q\U	e>
N Oe>
P _0 0 .	
 Z Z Z Z \ Z Z \ \ \ \  \!& &3#00:2<OY[e'Qe>
H YIe>
 e e	    c                    K   | j                  |       d{   }| j                  |di       }| j                  |d      }|d}n
|dk(  rd}nd}|ddd|dS 7 @w)	aT  
        the latest known information on the availability of the exchange API

        https://docs.woox.io/#get-system-maintenance-status-public

        :param dict [params]: extra parameters specific to the exchange API endpoint
        :returns dict: a `status structure <https://docs.ccxt.com/#/?id=exchange-status-structure>`
        Ndatastatuserror0okr  )r*  updatedetar   r   )v1PublicGetSystemInfo	safe_dictsafe_string)r$  paramsresponser)  r*  s        r&  fetch_statuszwoo.fetch_status  sz      33F;; ~~h3!!$1>Fs]F"F
 	
' <s   AAAAc                 d   K   | j                  |       d{   }| j                  |d      S 7 w)aW  
        fetches the current integer timestamp in milliseconds from the exchange server

        https://docs.woox.io/#get-system-maintenance-status-public

        :param dict [params]: extra parameters specific to the exchange API endpoint
        :returns int: the current integer timestamp in milliseconds from the exchange server
        N	timestamp)r0  safe_integer)r$  r3  r4  s      r&  
fetch_timezwoo.fetch_time  s5      33F;;   ;77 <s   0.0c                    K   | j                   d   r| j                          d{    | j                  |       d{   }| j                  |dg       }| j	                  |      S 7 A7 *w)a  
        retrieves data on all markets for woo

        https://docs.woox.io/#exchange-information

        :param dict [params]: extra parameters specific to the exchange API endpoint
        :returns dict[]: an array of objects representing market data
        r   Nrows)r   load_time_differencev1PublicGetInfo	safe_listparse_marketsr$  r3  r4  r)  s       r&  fetch_marketszwoo.fetch_markets  sh      <<12++-----f55, ~~h3!!$''1 .5s   #A+A'A+A))A+)A+marketc                    | j                  |d      }|j                  d      }| j                  |d      }d}d}|dk(  rd}d}n	|dk(  rd}d	}| j                  |d
      }| j                  |d      }	| j                  |      }
| j                  |	      }d }d }|
dz   |z   }d }d }d }d}|}|rHd}| j                  |d      }| j                  |      }|
dz   |z   dz   |z   }| j                  d      }d}d}| j                  |d      dk(  }i d|d|d|
d|d|d|d|	d|dd|d|d	|ddddd|d|d|||d d d d | j	                  |d      | j	                  |d      d d d d!| j	                  |d"      | j	                  |d#      d!| j	                  |d$      | j	                  |d%      d!| j	                  |d&      d d!d'| j                  |d(      |d)
S )*Nsymbol_r   FSPOTTr>   PERPr@   r   r   /:1
is_tradingr1   basequotesettlebaseIdquoteIdsettleIdtyper?   rA   rB   activecontractr  	base_tick
quote_tick)amountpriceminmaxbase_minbase_max	quote_min	quote_maxmin_notional)r  rW  rX  costcreated_time)
r  contractSizeexpiryexpiryDatetimestrike
optionType	precisionlimitscreatedr   )r2  splitsafe_currency_coder#  safe_numbersafe_timestamp)r$  rB  marketIdpartsfirstr>   r@   
marketTyperO  rP  rL  rM  rQ  rN  rD  rc  r  r  r?   rT  rS  s                        r&  parse_marketzwoo.parse_market   s   ##FH5s#  *F?DJf_DJ!!%+""5!,&&v.''0e# F''q1H,,X6FCZ%'#-6F,,S1LFG!!&,73>0
(0
f0
 D0
 U	0

 f0
 f0
 w0
 0
 J0
 D0
 f0
 D0
 e0
 e0
 f0
  !0
" f#0
$ ("**6;?))&,?  
  ++FJ?++FJ?
  ++FK@++FK@
  ++FNC$ **6>B_0
 0	
r'  NrD  sincer  c                    K   | j                          d{    | j                  |      }d|d   i}|||d<   | j                  | j                  ||             d{   }| j	                  |dg       }| j                  ||||      S 7 s7 -w)a  
        get the list of most recent trades for a particular symbol

        https://docs.woox.io/#market-trades-public

        :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>`
        NrD  r1   r  r;  )load_marketsrB  v1PublicGetMarketTradesextendr>  parse_trades)	r$  rD  rt  r  r3  rB  requestr4  resultResponses	            r&  fetch_tradeszwoo.fetch_tradest  s      !!!V$fTl
 $GG55dkk'66RSS< &"=  FFM 	" Ts"   BB
ABB,BBtradec                 T   d|v }| j                  |d      }| j                  |d      }| j                  ||      }|d   }| j                  |d      }| j                  |d      }| j                  |d      }	| j                  |dd      }
| j                  |
d	      }|||
d	<   t	        j
                  ||      }| j                  |d
      }| j                  |d      }d }|r| j                  |d      dk(  }|rdnd}| j                  ||| j                  |      ||||||	|d |
|d|      S )Nr1   executed_timestamprD  executed_priceexecuted_quantityorder_id	fee_assetfeera  sideis_makerrJ  r   r   )r1   r7  datetimerD  r  rX  rW  ra  r   takerOrMakerrR  r  r   )	rn  r2  safe_marketparse_token_and_fee_tempr,   
string_mulsafe_string_lower
safe_tradeiso8601)r$  r}  rB  isFromFetchOrderr7  ro  rD  rX  rW  r  r  feeCostra  r  r1   r  isMakers                    r&  parse_tradezwoo.parse_trade  se   8 !EM''/CD	##E84!!(F3!  (89!!%)<=##E:6++E;F""3/!CK!!%0%%eV4eT* &&uj9S@G&-77L"Y/( 
  	r'  c                     | j                  ||      }d }|(| j                  ||      }| j                  |      }||d}|S )Nra  currency)r2  rl  )r$  itemfeeTokenKeyfeeAmountKeyr  r  feeCurrencyIdfeeCurrencyCodes           r&  r  zwoo.parse_token_and_fee_temp  sU    ""46 ,,T;?M"55mDO+C 
r'  c           
        K   | j                          d{    | j                  |       d{   }| j                  |di       }| j                  |d      }| j                  |d      }i }t	        dt        | j                              D ]c  }| j                  |   }||| j                  t        j                  |d            | j                  t        j                  |d            ddd||<   e |S 7 7 ƭw)	aL  
        fetch the trading fees for multiple markets

        https://docs.woox.io/#get-account-information-new

        :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
        Nr)  makerFeeRatetakerFeeRater   10000T)r   rD  r   r   r   r   )
rv  v3PrivateGetAccountinfor1  r2  rangelensymbolsr#  r,   
string_div)	r$  r3  r4  r)  r   r   resultirD  s	            r&  fetch_trading_feeszwoo.fetch_trading_fees  s      !!!55f==: ~~h3  ~6  ~6q#dll+, 		A\\!_F  **7+=+=eW+MN**7+=+=eW+MN"!F6N		 Y 	"=s    C8C4C8C6CC86C8c                   K   i }| j                  |       d{   }| j                  |dg       }| j                  |d      }t        |j	                               }t        dt        |            D ]  }||   }||   }	| j                  |      }
d}d}i }t        dt        |	            D ]  }|	|   }| j                  |d      }| j                  |d      }|j                  d      }|d   }| j                  | j                  |d            }|||nt        j                  ||      }||ddd	ddd	d
dddd| j                  |      |d	||<    |||
| j                  |      dd|dddddd	ddd	d|	d||
<    |S 7 iw)a  
        fetches all available currencies on an exchange

        https://docs.woox.io/#available-token-public

        :param dict [params]: extra parameters specific to the exchange API endpoint
        :returns dict: an associative dictionary of currencies
        Nr;  balance_tokenr   fullnamer   rE  decimalsrY  )r   deposit)	r1   networkri  rS  r  r   r  rh  r   crypto)r  r   )r1   r2   coderh  rS  r  r   r  r   rR  ri  r   )v1PublicGetTokenr>  group_bylistkeysr  r  rl  r2  rk  parse_precisionr,   
string_minr#  )r$  r3  r  tokenResponse	tokenRowsnetworksByCurrencyIdcurrencyIdsr  
currencyIdr   r  r2   minPrecisionresultingNetworksjr  	networkIdsplittedunifiedNetworkrh  s                       r&  fetch_currencieszwoo.fetch_currencies*  s     "33F;;z NN=&"=	#}}YH/4467q#k*+ :	A$QJ+J7H**:6DDL&(1c(m, "1+''< ,,Wg>	$??3/!)! 001A1A':1VW	(1=1E9GL^L^_hjvLwL#- $(#'%
 $(#'$	 ## $!%!2!29!=#%5!.1< !!..|<-    $# 
  $#!	 !+F4LI:	v w <s   FFE)Fra  c                    K   | j                          d{    | j                  |      }|d   st        | j                  dz         | j	                  |dd|d|       d{   S 7 P7 w)a  
        create a market buy order by providing the symbol and cost

        https://docs.woox.io/#send-order

        :param str symbol: unified symbol of the market to create an order in
        :param float cost: how much you want to trade in units of the quote currency
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
        Nr>   z9 createMarketBuyOrderWithCost() supports spot orders onlyrB  buyr   rv  rB  r'   r1   create_orderr$  rD  ra  r3  rB  s        r&  !create_market_buy_order_with_costz%woo.create_market_buy_order_with_cost  sn      !!!V$f~tww)ddee&&vxaPPP	 	" Q"   A+A'AA+"A)#A+)A+c                    K   | j                          d{    | j                  |      }|d   st        | j                  dz         | j	                  |dd|d|       d{   S 7 P7 w)a  
        create a market sell order by providing the symbol and cost

        https://docs.woox.io/#send-order

        :param str symbol: unified symbol of the market to create an order in
        :param float cost: how much you want to trade in units of the quote currency
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
        Nr>   z: createMarketSellOrderWithCost() supports spot orders onlyrB  sellr   r  r  s        r&  "create_market_sell_order_with_costz&woo.create_market_sell_order_with_cost  sn      !!!V$f~tww)eeff&&vxq&QQQ	 	" Rr  rR  r  rW  rX  c	                    K   |t        | j                  dz         |t        | j                  dz         ||d<   ||d<   | j                  ||||||       d{   S 7 w)a  
        create a trailing order by providing the symbol, type, side, amount, price and trailingAmount

        https://docs.woox.io/#send-algo-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 you want to trade in units of the base currency, or number of contracts
        :param float [price]: the price for the order to be filled at, in units of the quote currency, ignored in market orders
        :param float trailingAmount: the quote amount to trail away from the current market price
        :param float trailingTriggerPrice: the price to activate a trailing order, default uses the price argument
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
        Nz? createTrailingAmountOrder() requires a trailingAmount argumentzE createTrailingAmountOrder() requires a trailingTriggerPrice argumenttrailingAmounttrailingTriggerPricer$   r1   r  )	r$  rD  rR  r  rW  rX  r  r  r3  s	            r&  create_trailing_amount_orderz woo.create_trailing_amount_order  su       !#DGG.o$opp'#DGG.u$uvv#1 )=%&&&vtT65&QQQQ   AA!AA!c	                    K   |t        | j                  dz         |t        | j                  dz         ||d<   ||d<   | j                  ||||||       d{   S 7 w)a  
        create a trailing order by providing the symbol, type, side, amount, price and trailingPercent

        https://docs.woox.io/#send-algo-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 you want to trade in units of the base currency, or number of contracts
        :param float [price]: the price for the order to be filled at, in units of the quote currency, ignored in market orders
        :param float trailingPercent: the percent to trail away from the current market price
        :param float trailingTriggerPrice: the price to activate a trailing order, default uses the price argument
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
        NzA createTrailingPercentOrder() requires a trailingPercent argumentzF createTrailingPercentOrder() requires a trailingTriggerPrice argumenttrailingPercentr  r  )	r$  rD  rR  r  rW  rX  r  r  r3  s	            r&  create_trailing_percent_orderz!woo.create_trailing_percent_order  su       "#DGG.q$qrr'#DGG.v$vww$3 !)=%&&&vtT65&QQQQr  c                 	  K   | j                  |dd      }| j                  |ddg      }|j                         }| j                          d{    | j	                  |      }	|j                         }
|	d   |
d}d}| j                  d|      \  }}|| j                  |      |d<   | j                  |dd	      }| j                  |d
      }| j                  |d      }| j                  |d      }| j                  |dd| j                  |            }| j                  |dd      }| j                  |dd      }|du}|du}|xs |}|xs& |duxs  |duxs |duxs | j                  |d      du}|dk(  }| j                  |d      }| j                  |d|      }|rdnd}|rdnd}|rdnd}|rdnd}|rdnd}|||<   |s|rd|d<   n|dk(  rd |d<   n
|d!k(  rd"|d<   |r|||<   |s|| j                  ||      ||<   |r|s| j                  |d#d$      } | j                  |d#d$g      }|du}!|	d%   rk|!s| gd}"| | j                  ||       }"nJ| j                  |      }#| j                  |      }$t        j                   |#|$      }%| j                  ||%      }"|"|d$<   n0| j#                  ||      |d<   n|d&k7  r| j#                  ||      ||<   | j%                  |g d'      }&|&|&||<   |rZ|t'        | j(                  d(z         | j                  ||      |d<   d)|d<   |r||d<   n|rt        j*                  |d*      }'|'|d<   n| |d)k7  r| j                  ||      |d<   d+|d<   n||d,|d<   |	d   d-d&g d.}(|(d   })|
d/k(  rd0nd/}*|<| j                  |d|      }+|*d1| j                  ||+      d2d3d4},|)j-                  |,       |<| j                  |d|      }-|*d5| j                  ||-      d2d3d4}.|)j-                  |.       |(g|d<   | j                  |g d6      }d}/|r*| j/                  | j1                  ||             d{   }/n)| j3                  | j1                  ||             d{   }/| j5                  |/d7      }0|0(| j7                  |0d8g       }1| j9                  |1d9   |	      S | j9                  |/|	      }2||2d<   |2S 7 |7 7 ^w):a\  
        create a trade order

        https://docs.woox.io/#send-order
        https://docs.woox.io/#send-algo-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 fulfilled, in units of the quote currency, ignored in market orders
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :param str [params.marginMode]: *for swap markets only* 'cross' or 'isolated', default 'cross'
        :param float [params.triggerPrice]: The price a trigger order is triggered at
        :param dict [params.takeProfit]: *takeProfit object in params* containing the triggerPrice at which the attached take profit order will be triggered(perpetual swap markets only)
        :param float [params.takeProfit.triggerPrice]: take profit trigger price
        :param dict [params.stopLoss]: *stopLoss object in params* containing the triggerPrice at which the attached stop loss order will be triggered(perpetual swap markets only)
        :param float [params.stopLoss.triggerPrice]: stop loss trigger price
        :param float [params.algoType]: 'STOP' or 'TRAILING_STOP' or 'OCO' or 'CLOSE_POSITION'
        :param float [params.cost]: *spot market buy only* the quote quantity that can be used alternative for the amount
        :param str [params.trailingAmount]: the quote amount to trail away from the current market price
        :param str [params.trailingPercent]: the percent to trail away from the current market price
        :param str [params.trailingTriggerPrice]: the price to trigger a trailing order, default uses the price argument
        :param str [params.position_side]: 'SHORT' or 'LONG' - if position mode is HEDGE_MODE and the trading involves futures, then is required, otherwise self parameter is not required
        :returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
        
reduceOnlyreduce_onlyNr1   )rD  r  rP   margin_moder   	stopPricestopLoss
takeProfitalgoTyper  activatedPricer  callbackValuer  callbackRatechildOrdersMARKETr  clientOrderIdclient_order_idquantityorder_quantityrX  order_pricerR  
order_type	POST_ONLYfokr   iocr   ra  order_amountr>   POSITIONAL_TP_SLclOrdIDr  r  zL createOrder() requires a trailingTriggerPrice parameter for trailing ordersTRAILING_STOP100STOPBRACKETF)rD  r  r  r  BUYSELL	STOP_LOSSCLOSE_POSITIONT)r  r  r   rR  r  TAKE_PROFIT)r  r  r  postOnlyr  r  r   r  r  r  r  r  r)  r;  r   )safe_bool_2omitupperrv  rB  handle_margin_mode_and_paramsencode_margin_modesafe_string_2
safe_valuer2  number_to_stringr  is_post_onlyprice_to_precisioncost_to_precisionr,   r  amount_to_precisionsafe_string_nr$   r1   r  appendv3PrivatePostAlgoOrderrx  v1PrivatePostOrderr1  r>  parse_order)3r$  rD  rR  r  rW  rX  r3  r  	orderTyperB  	orderSiderz  r   r   r  r  r  r  r  r  isTrailingAmountOrderisTrailingPercentOrder
isTrailingisConditionalisMarketr  r  reduceOnlyKeyclientOrderIdKeyorderQtyKeypriceKeytypeKeyra  isPriceProvidedquoteAmountamountStringpriceStringcostRequestr  convertedTrailingPercentoutterOrderr  	closeSider   stopLossOrderr  takeProfitOrderr4  r)  r;  r   s3                                                      r&  r  zwoo.create_order  s    6 %%flMJ
6L-#@AJJL	!!!V$JJL	Tl
 
!??vV
F!%)%<%<Z%HGM"))&.+N??6:6__V\:
##FJ7#11&:PRbdhdydyz  eA   B++F4DoV,,V5FW .d :!0!<*D.D
"  il$&>  i(RVBV  iZdlpZp  iuy  vE  vE  FL  N[  v\  dh  vh(,,V]C$$XtV<(5=.;?AR$1j7G+7)&|$(3%%(-%%(-%%/GM"E- $ 7 7 FGHM%%ffnEDYYv'?@F#4/Of~?t7G"#"&"8"8"FK#'#8#8#@L"&"7"7">K")"4"4\;"OK"&"8"8"MK*5',0,D,DVV,T()++#'#;#;FF#KGK **63bc$(5G$%#+'  3A  )A  B  B(,(?(?H\(]G$%"1GJ$+9('+2+=+=ou+U(*B'%?**.*A*A&,*W'&,
#"
(>"+GJ ,#.!	!K &m4K#,#5EI# $ 0 0>8 T% +$($;$;FM$R,"&' ""=1%"&"2"2:~z"Z% -$($;$;FO$T,"&) ""?3&1]GM"6  $b  c!88Wf9UVVH!44T[[&5QRRH4 ~~h/>>$3D##DGV44  62fe 	"` WRs8   ASS	O7SS)S/S0ASSSc                 2    ddd}| j                  |||      S )NCROSSISOLATED)crossisolatedr2  )r$  modemodess      r&  r  zwoo.encode_margin_mode  s&    "
 tT22r'  r1   c                   K   | j                          d{    | j                  |      }i }	|| j                  ||      |	d<   || j                  ||      |	d<   | j	                  |dd      }
| j                  |d|
      }|du}| j                  |g d      }|| j                  ||      |	d<   | j	                  |d	d
| j                  |            }| j	                  |dd      }| j	                  |dd      }|du}|du}|xs |}|r<|| j                  ||      |	d
<   |r||	d<   n|rt        j                  |d      }||	d<   | j                  |g d      }|xs |duxs | j                  |d      du}d}|r[||	d<   |r*| j                  | j                  |	|             d{   }n| j                  | j                  |	|             d{   }nZ||	d<   |r*| j                  | j                  |	|             d{   }n)| j!                  | j                  |	|             d{   }| j#                  |di       }| j%                  ||      S 7 @7 7 7 Z7 2w)a  
        edit a trade order

        https://docs.woox.io/#edit-order
        https://docs.woox.io/#edit-order-by-client_order_id
        https://docs.woox.io/#edit-algo-order
        https://docs.woox.io/#edit-algo-order-by-client_order_id

        :param str id: order id
        :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 fulfilled, in units of the quote currency, ignored in market orders
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :param float [params.triggerPrice]: The price a trigger order is triggered at
        :param float [params.stopLossPrice]: price to trigger stop-loss orders
        :param float [params.takeProfitPrice]: price to trigger take-profit orders
        :param str [params.trailingAmount]: the quote amount to trail away from the current market price
        :param str [params.trailingPercent]: the percent to trail away from the current market price
        :param str [params.trailingTriggerPrice]: the price to trigger a trailing order, default uses the price argument
        :returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
        NrX  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  r  oidr)  )rv  rB  r  r  r  r2  safe_number_nr  r,   r  r  r  (v3PrivatePutAlgoOrderClientClientOrderIdrx  $v3PrivatePutOrderClientClientOrderIdv3PrivatePutAlgoOrderOidv3PrivatePutOrderOidr1  r  )r$  r1   rD  rR  r  rW  rX  r3  rB  rz  clientOrderIdUnifiedclientOrderIdExchangeSpecificisByClientOrderr   r  r  r  r  r  r  r  r  r4  r)  s                           r&  
edit_orderzwoo.edit_order  s    0 !!!V$
 #66vuEGG"&":":66"JGJ#11&)_U(,(8(8ARTh(i%7tC))&2st#&*&=&=fl&SGN##11&:PRbdhdydyz  eA   B++F4DoV,,V5FW .d :!0!<*D.D
#/,0,C,CFL`,a()$+9('+2+=+=ou+U(*B'6  $Q  R"x|4'?xT__U[]jEkswEw)FG%&!%!N!Nt{{[bdjOk!ll!%!J!J4;;W^`fKg!hhGEN!%!>!>t{{7TZ?[!\\!%!:!:4;;wPV;W!XX ~~h3f--u 	"H mh ]XsX   I!IFI!'I()I!I0I!I)I!,I-*I!I!I!I!I!c                   K   | j                  |ddd      }| j                  |ddg      }|s|t        | j                  dz         | j	                          d{    d}|| j                  |      }i }| j                  |dd      }| j                  |d|      }|du}	d}
|r/||d	<   | j                  | j                  ||             d{   }
n{|d
   |d<   |	rC||d<   | j                  |g d      }| j                  | j                  ||             d{   }
n.||d	<   | j                  | j                  ||             d{   }
d|i}|	r||d<   n||d
<   | j                  | j                  |
      |      S 7 &7 7 j7 =w)a2  

        https://docs.woox.io/#cancel-algo-order
        https://docs.woox.io/#cancel-order
        https://docs.woox.io/#cancel-order-by-client_order_id

        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
        :param boolean [params.trigger]: whether the order is a trigger/algo order
        :returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
        r  stopFNz) cancelOrder() requires a symbol argumentr  r  r  r  r1   rD  r  )r  r  r$   r1   rv  rB  r  r2  v3PrivateDeleteAlgoOrderOrderIdrx  v1PrivateDeleteClientOrderv1PrivateDeleteOrderr  )r$  r1   rD  r3  	isTriggerrB  rz  r.  r/  r0  r4  extendParamss               r&  cancel_orderzwoo.cancel_order  s     $$VYF	6Iv#67fn#DGG.Y$YZZ!!![[(F#11&)_U(,(8(8ARTh(i%7tC"$GJ!AA$++gW]B^__H &tGH-J)*6+Z[!%!@!@WV\A]!^^&(
#!%!:!:4;;wPV;W!XX '/.KL*+!#L{{4++H5|DD; 	" ` _ YsJ   AF	F A2F	FAF	F.F		F
7F	F	F	F	c                   K   | j                          d{    | j                  |dd      }| j                  |ddg      }|r| j                  |       d{   S |t	        | j
                  dz         | j                  |      }d|d   i}| j                  | j                  ||             d{   }| j                  |      gS 7 7 s7 w)a  

        https://docs.woox.io/#cancel-all-pending-orders
        https://docs.woox.io/#cancel-orders
        https://docs.woox.io/#cancel-all-pending-algo-orders

        cancel all open orders in a market
        :param str symbol: unified market symbol
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :param boolean [params.trigger]: whether the order is a trigger/algo order
        :returns dict: an list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
        Nr3  r  z* cancelOrders() requires a symbol argumentrD  r1   )
rv  r  r   v3PrivateDeleteAlgoOrdersPendingr$   r1   rB  v1PrivateDeleteOrdersrx  
safe_order)r$  rD  r3  r  rB  rz  r4  s          r&  cancel_all_orderszwoo.cancel_all_ordersA  s      !!!""669=6FI#67>>vFFF>#DGG.Z$Z[[V$fTl
 33DKK4PQQ OOH%
 	
% 	" G Rs5   CC
ACCAC3C4CCCtimeoutc                    K   | j                          d{    d|dkD  r|ndi}| j                  | j                  ||             d{   }| j                  |      gS 7 J7 w)aM  
        dead man's switch, cancel all orders after the given timeout

        https://docs.woox.io/#cancel-all-after

        :param number timeout: time in milliseconds, 0 represents cancel the timer
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :returns dict: the api result
        Ntrigger_afterr   )rv   v1PrivatePostOrderCancelAllAfterrx  r=  )r$  r?  r3  rz  r4  s        r&  cancel_all_orders_afterzwoo.cancel_all_orders_afterd  ss      !!!1W1
 >>t{{7TZ?[\\ OOH%
 	
 	" ]s!   A%A!3A%
A#A%#A%c                 \  K   | j                          d{    || j                  |      nd}| j                  |dd      }| j                  |ddg      }i }| j	                  |dd      }d}|r/||d<   | j                  | j                  ||             d{   }n_|r/||d<   | j                  | j                  ||             d{   }n.||d<   | j                  | j                  ||             d{   }| j                  |d|      }	| j                  |	|      S 7 7 7 ]7 0w)	a  

        https://docs.woox.io/#get-algo-order
        https://docs.woox.io/#get-order

        fetches information on an order made by the user
        :param str id: the 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
        :param boolean [params.trigger]: whether the order is a trigger/algo order
        :returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
        Nr3  r  r  r  r(  r  r)  )rv  rB  r  r  r  v3PrivateGetAlgoOrderOidrx  $v1PrivateGetClientOrderClientOrderIdv1PrivateGetOrderOidr1  r  )
r$  r1   rD  r3  rB  r  rz  r  r4  r   s
             r&  fetch_orderzwoo.fetch_order  s9     !!!)/);V$$""669=6FI#67**69oNGEN!::4;;wPV;WXXH)6G%&!FFt{{SZ\bGcddHGEN!66t{{7F7STTHH &(;//i 	" Y e UsF   D,D#BD,D&0D,
D(.D,9D*:*D,&D,(D,*D,c           	        K   | j                          d{    d}| j                  |dd      \  }}|r| j                  d||||dd       d{   S i }d}| j                  |dd      }| j	                  |d	d      }	| j                  |g d
      }|| j                  |      }|d   |d<   ||s|	r||d<   n||d<   |||d<   nd|d<   |rd|d<   n|	rd|d<   d}
|s|	r*| j                  | j                  ||             d{   }
n)| j                  | j                  ||             d{   }
| j                  |
d|
      }| j                  |d      }| j                  ||||      S 7 V7  7 m7 Ew)  
        fetches information on multiple orders made by the user

        https://docs.woox.io/#get-orders
        https://docs.woox.io/#get-algo-orders

        :param str symbol: unified market symbol of the market orders were made in
        :param int [since]: the earliest time in ms to fetch orders for
        :param int [limit]: the maximum number of order structures to retrieve
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :param boolean [params.trigger]: whether the order is a trigger/algo order
        :param boolean [params.isTriggered]: whether the order has been triggered(False by default)
        :param str [params.side]: 'buy' or 'sell'
        :param boolean [params.trailing]: set to True if you want to fetch trailing orders
        :param boolean [params.paginate]: set to True if you want to fetch orders with pagination
        :returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
        NFr~   paginatepager  r3  r  r  )r3  r  r  r1   rD  createdTimeStartstart_tsizer  r  r)  r;  )rv  handle_option_and_params fetch_paginated_call_incrementalr  	safe_boolr  rB  v3PrivateGetAlgoOrdersrx  v1PrivateGetOrdersr  r>  parse_orders)r$  rD  rt  r  r3  rK  rz  rB  r  r  r4  r)  r   s                r&  fetch_orderszwoo.fetch_orders  s    $ !!!88PZ[&>>}fV[]bdjlrtwxxx""669=>>&*e<6#BC[[(F &tGH(.3*+%*	"#GFO!GFO"(GJ"1GJh!88Wf9UVVH!44T[[&5QRRH@ x:f-  >>A 	" y0 WRsF   E6E,8E6E/B4E6E2)E6.E4/>E6/E62E64E6c                    K   | j                          d{    | j                  |ddi      }| j                  ||||       d{   S 7 47 w)rJ  Nr*  
INCOMPLETErv  rx  rV  r$  rD  rt  r  r3  extendedParamss         r&  fetch_open_orderszwoo.fetch_open_orders  sR     $ !!!Vh-EF&&vue^LLL 	"L!   AA/AAAAc                    K   | j                          d{    | j                  |ddi      }| j                  ||||       d{   S 7 47 w)rJ  Nr*  	COMPLETEDrY  rZ  s         r&  fetch_closed_orderszwoo.fetch_closed_orders-  sR     $ !!!Vh-DE&&vue^LLL 	"Lr]  r  c                 4    dddd}| j                  ||d       S )Nr   r   r   )r  r  	post_onlyr$  )r$  r  timeInForcess      r&  parse_time_in_forcezwoo.parse_time_in_forceC  s)    

 k4@@r'  r   c                 V   | j                  |g d      }| j                  |g d      }| j                  | j                  |dd            }| j	                  |d      }| j                  ||      }|d   }| j                  |dd      }| j                  |dd	      }	| j                  |d
d      }
| j                  |dd      }| j                  |dd      }| j                  |d      }| j                  | j                  |dd            }| j                  | j                  |dd            }| j                  |dd      }| j                  |dd      }| j                  |d      }| j                  |d      }d }d }| j                  |d      }|}| j                  |d      }| j                  |dg       }t        |      }|dkD  rH| j                  |d      }| j                  |d      }| j                  |d      }| j                  |d      }| j                  |dd      }| j                  i d |d|d!|d"| j                  |      d#d d$|d| j!                  |      d|d|d%| j#                  |      d&d d'| j%                  |d(      d|d|d|d)|d*|||	|d |
|||d+|d,|      S )-N)r7  rb  createdTime)r  orderIdalgoOrderIdr  r  rD  r  rX  r  r  r  rW  r  rR  r*  
algoStatusr  executedtotalExecutedQuantityaverage_executed_priceaverageExecutedPrice	total_feetotalFeer  feeAssetTransactionsr   r  r   r   updatedTimeupdated_timer1   r7  r  lastTradeTimestamplastUpdateTimestampr  r  r  r  r  r   r  )averagerW  filled	remainingra  tradesr  r   )safe_timestamp_nr  	omit_zeror  r2  r  safe_string_lower_2safe_value_2r  safe_number_2r  rm  r  safe_timestamp_2r=  r  parse_order_statusrd  rR  )r$  r   rB  r7  rg  r  ro  rD  rX  rW  ra  r	  r*  r  rw  rv  r  feeCurrencytransactionsr   r  r   r  rq  innerChildOrdersinnerChildOrdersLengthr  r  ru  s                                r&  r  zwoo.parse_orderK  s_   Z ))%1]^	$$U,RSt'9'9%ARTc'de##E84!!(F3!""5-A##E+;ZH!!%B,,UL&I	""5(LA%%eV4 1 1%E\ ]^..!3!3E;SUk!lm  Z@((ZHun=''~>#!ooe];"OOK3E#umRH%()9%:"%)"&//2BA"F $0@! D"&"2"2?N"S $ 0 0 O"33E=.Y  
' 
] 
  
 Y/	 

 !$ 
 "#6 
 d--f5 
 f 
 I 
 433I> 
  
 $..> 
 D 
 U 
 L 
  ! 
" ]# 
$ "' 9 
: ; 	r'  r*  c           
      H    |dddddddddd	}| j                  |||      S |S )Nopenclosedcanceledrejected)	NEWFILLEDCANCEL_SENTCANCEL_ALL_SENT	CANCELLEDPARTIAL_FILLEDREJECTEDrX  r_  r$  r$  r*  statusess      r&  r  zwoo.parse_order_status  sF    ")#-'"(&$%
H ##Hff==r'  c           	      <  K   | j                          d{    | j                  |      }d|d   i}|t        |d      }||d<   | j                  | j	                  ||             d{   }| j                  |d      }| j                  |||ddd	d
      S 7 7 /w)a-  
        fetches information on open orders with bid(buy) and ask(sell) prices, volumes and other data

        https://docs.woox.io/#orderbook-snapshot-public

        :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
        NrD  r1   r  	max_levelr7  bidsasksrX  r  )rv  rB  rZ  v1PublicGetOrderbookSymbolrx  r8  parse_order_book)r$  rD  r  r3  rB  rz  r4  r7  s           r&  fetch_order_bookzwoo.fetch_order_book  s      !!!V$fTl
 t$E#(GK 88Wf9UVV" %%h<	$$Xvy&&RY[eff5 	" Ws"   BBAB*B+.BBr   c                 r  K   | j                          d{    | j                  |      }|d   | j                  | j                  ||      d}|du}|1|/| j	                  |      dz  dz  }	| j                         |	z
  }
||
k  }|r||d<   n|t        |d      |d<   d}|s*| j                  | j                  ||             d{   }n;| j                  | j                  ||             d{   }| j                  |d      }| j                  |d	g       }| j                  |||||      S 7 7 k7 Cw)
a  

        https://docs.woox.io/#kline-public
        https://docs.woox.io/#kline-historical-data-public

        fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market
        :param str symbol: unified symbol of the market to fetch OHLCV data for
        :param str timeframe: the length of time each candle represents
        :param int [since]: timestamp in ms of the earliest candle to fetch
        :param int [limit]: max=1000, max=100 when since is defined and is less than(now - (999 * (timeframe in ms)))
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :returns int[][]: A list of candles ordered, open, high, low, close, volume
        Nr1   )rD  rR  r  i  
start_timer  r)  r;  )rv  rB  r2  r   parse_timeframemillisecondsrZ  v1PublicGetKlinerx  v1PubGetHistKliner1  r>  parse_ohlcvs)r$  rD  	timeframert  r  r3  rB  rz  useHistEndpointoneThousandCandlesstartWithLimitr4  r;  s                r&  fetch_ohlcvzwoo.fetch_ohlcv  sW     !!!V$Tl$$T__iK
  t+E$5!%!5!5i!@4!G#!M!..03EEN#n4O$)GL!"5$/GG!224;;w3OPPH, "33DKK4PQQH~~h7H. ~~h3  vy%GGA 	"" Q, Rs4   D7D0B0D7D3)D71D52?D73D75D7c           	          | j                  |d      | j                  |d      | j                  |d      | j                  |d      | j                  |d      | j                  |d      gS )Nstart_timestampr  highlowclosevolume)r8  rm  )r$  ohlcvrB  s      r&  parse_ohlcvzwoo.parse_ohlcv>  so     e%67UF+UF+UE*UG,UH-
 	
r'  c                   K   | j                          d{    d}|| j                  |      }d|i}| j                  | j                  ||             d{   }| j	                  |dg       }	| j                  |	||||      S 7 n7 .w)a  
        fetch all the trades made from a single order

        https://docs.woox.io/#get-trades

        :param str id: order id
        :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 to retrieve
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :returns dict[]: a list of `trade structures <https://docs.ccxt.com/#/?id=trade-structure>`
        Nr(  r;  )rv  rB  v1PrivateGetOrderOidTradesrx  r>  ry  )
r$  r1   rD  rt  r  r3  rB  rz  r4  ry  s
             r&  fetch_order_tradeszwoo.fetch_order_tradesI  s      !!![[(F2
 88Wf9UVV& &"5  vFF7 	" Ws"   B	BAB	B-B	B	c           	        K   | j                          d{    d}| j                  |dd      \  }}|r| j                  d||||dd       d{   S i }d}|| j                  |      }|d   |d<   |||d	<   | j	                  d
||      \  }}|||d<   nd|d<   | j                  | j                  ||             d{   }| j                  |dg       }	| j                  |	||||      S 7 7 7 0w)aJ  
        fetch all trades made by the user

        https://docs.woox.io/#get-trade-history

        :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
        :param boolean [params.paginate]: set to True if you want to fetch trades with pagination
        :returns Trade[]: a list of `trade structures <https://docs.ccxt.com/#/?id=trade-structure>`
        NFrw   rK  rL  r  r1   rD  rN  end_trO  r;  )	rv  rP  rQ  rB  handle_until_optionv1PrivateGetClientTradesrx  r>  ry  )
r$  rD  rt  r  r3  rK  rz  rB  r4  ry  s
             r&  fetch_my_tradeszwoo.fetch_my_tradess  s-     !!!88R\]&>>PVX]_dflntvyzzz[[(F &tGH!&GI227GVL#GFO!GFO66t{{7F7STT0 &"5  vFFU 	" { Us4   C4C.8C4C0A1C4C2-C40C42C4c                    K   | j                  |       d{   }| j                  |dg       }| j                  ||      S 7 )w)aY  
        fetch all the accounts associated with a profile

        https://docs.woox.io/#get-assets-of-subaccounts

        :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
        Nr;  )v1PrivateGetSubAccountAssetsr>  parse_accounts)r$  r3  r4  r;  s       r&  fetch_accountszwoo.fetch_accounts  sH      ::6BB" ~~h3""400% Cs   AA*Ac                 \    | j                  |d      }|| j                  |d      |d |dk(  dS )Naccountapplication_idmain)r   r1   r2   r  rR  r$  )r$  r  	accountIds      r&  parse_accountzwoo.parse_account  sB     $$Wi8	""7,<='
 	
r'  c                    K   | j                          d{    | j                  |       d{   }| j                  |d      }| j                  |      S 7 @7 )w)ae  
        query for balance and get the amount of funds available for trading or funds locked in orders

        https://docs.woox.io/#get-current-holding-get-balance-new

        :param dict [params]: extra parameters specific to the exchange API endpoint
        :returns dict: a `balance structure <https://docs.ccxt.com/#/?id=balance-structure>`
        Nr)  )rv  v3PrivateGetBalancesr1  parse_balancer@  s       r&  fetch_balancezwoo.fetch_balance  sY      !!!226::0 ~~h/!!$''5 	":s   AAAA(AAc                 P   d|i}| j                  |dg       }t        dt        |            D ]g  }||   }| j                  | j	                  |d            }| j                         }| j	                  |d      |d<   | j	                  |d      |d<   |||<   i | j                  |      S )Nr   holdingr   r   totalavailableBalancefree)r>  r  r  rl  r2  r  safe_balance)r$  r4  r  r   r  balancer  r  s           r&  r  zwoo.parse_balance  s    H
 >>(Ir:q#h-( 	#AqkG**4+;+;GW+MNDllnG#//CGG"..w8JKGFO"F4L	#   ((r'  r  c                   K   | j                          d{    | j                  |      }| j                  |      }| j                  |d|      }| j	                  |d      }|dz   |d   z   }d|i}| j                  | j                  ||             d{   }| j                  |d      }	| j                  |d      }
| j                  |
       ||||
|	dS 7 7 Cw)	as  
        fetch the deposit address for a currency associated with self account

        https://docs.woox.io/#get-token-deposit-address

        :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>`
        Nr  rE  r  r   extraaddress)r   r  r  r  tag)rv  r  !default_network_code_for_currencyr2  r  v1PrivateGetAssetDepositrx  check_address)r$  r  r3  r  networkCodeDefaultnetworkCodecodeForExchangerz  r4  r  r  s              r&  fetch_deposit_addresszwoo.fetch_deposit_address  s      !!!==&!CCDI&&vy:LM69-%+hv.>>_
 66t{{7F7STT x1""8Y77#"
 	
% 	" Us#   CCA>CCACCc                 n  K   | j                          d {    i }d }|| j                  |      }|d   |d<   |||d<   |||d<   | j                  |d      }| j                  |d      }|||d<   | j	                  | j                  ||             d {   }|| j                  |dg       gS 7 7 w)Nr1   r  rN  pageSizerR  r;  )rv  r  r2  r  v1PrivateGetAssetHistoryrx  r>  )	r$  r  rt  r  r3  rz  r  transactionTyper4  s	            r&  get_asset_history_rowszwoo.get_asset_history_rows2  s     !!!!}}T*H'/~GO$!&GI"'GJ**66:66*&-GFO66t{{7F7STTF $..62>??c 	" Us"   B5B1B B5B3B53B5c                    K   | j                  ||||       d{   }| j                  |d      }| j                  |d      }| j                  |||||      S 7 =w)a?  
        fetch the history of changes, actions done by the user or operations that altered balance of the user

        https://docs.woox.io/#get-asset-history

        :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 entries 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>`
        Nr   r   )r  r  r>  parse_ledger)r$  r  rt  r  r3  currencyRowsr  r;  s           r&  fetch_ledgerzwoo.fetch_ledgerf  s`      "88ueVTT??<3~~lA.  xvFF Us   AA>Ar  r  c                 Z   | j                  |d      }| j                  ||      }|d   }| j                  ||      }| j                  |d      }| j                  |d      }|dk(  rdnd}| j	                  |d      }	| j                  |d	d
      }
| j                  || j                  |d      || j                  |d      d | j                  |d      | j                  | j                  |d            |d d ||	| j                  |	      | j                  | j                  |d            |
d|      S )Nr   r  rW  
token_sideDEPOSITinoutrb  	fee_token
fee_amountr1   r  tx_idr*  rR  )r   r1   r  r  referenceAccountreferenceIdr*  rW  beforeafter	directionr7  r  rR  r  )
r2  get_currency_from_chaincodesafe_currencyrm  rn  r  safe_ledger_entryparse_transaction_statusr  parse_ledger_entry_type)r$  r  r  networkizedCodecurrencyDefinedr  rW  r  r  r7  r  s              r&  parse_ledger_entryzwoo.parse_ledger_entryw  sD   **49::?HUv&%%dH5!!$1l3!Y.DU	''n=	++D+|L%%""4.''i8 $++D':33D4D4DT84TU""Y/001A1A$1OP'
  ! 	r'  c                 2    ddd}| j                  |||      S )Ntransactionr   )BALANCE
COLLATERALr$  )r$  rR  typess      r&  r  zwoo.parse_ledger_entry_type  s&    $$
 tT22r'  c                     ||S |j                  d      }t        |      }| j                  |d      }| j                  |d|      }|dkD  r|d| j                  |d      z   z  }| j                  |      }|S )NrE  r   r   r   )rk  r  r2  r  )r$  r  r  rp  partsLength	firstPartr  s          r&  r  zwoo.get_currency_from_chaincode  s    O#))#.Ee*K((2I))%I>JQcD$4$4UA$>>>
))*5Hr'  c           	      n   K   ddi}| j                  |||| j                  ||             d{   S 7 w)a  
        fetch all deposits made to an account

        https://docs.woox.io/#get-asset-history

        :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>`
        r  r  Nfetch_deposits_withdrawalsrx  r$  r  rt  r  r3  rz  s         r&  fetch_depositszwoo.fetch_deposits  s@      )
 44T5%U\^dIeffff   ,535c           	      n   K   ddi}| j                  |||| j                  ||             d{   S 7 w)a  
        fetch all withdrawals made from an account

        https://docs.woox.io/#get-asset-history

        :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>`
        r  WITHDRAWNr  r  s         r&  fetch_withdrawalszwoo.fetch_withdrawals  s@      *
 44T5%U\^dIeffffr  c           	         K   ddi}| j                  |||| j                  ||             d{   }| j                  |d      }| j                  |d      }| j	                  |||||      S 7 =w)aV  
        fetch history of deposits and withdrawals

        https://docs.woox.io/#get-asset-history

        :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>`
        rR  r  Nr   r   )r  rx  r  r>  parse_transactions)	r$  r  rt  r  r3  rz  r  r  r;  s	            r&  r  zwoo.fetch_deposits_withdrawals  s}      I
 "88ueT[[Y`bhMijj??<3~~lA. &&tXueVLL ks   ,A.A,>A.r  c                    | j                  |d      }| j                  ||      }|d   }| j                  |d      }|dk(  rd}| j                  |dd      }| j                  |d      }| j                  |d	      }	| j	                  |d
      }
i d|d| j                  |dd      d| j                  |d      d|
d| j                  |
      dd d|	d|d| j                  |d      dd dd d|d| j                  |d      d|d| j                  | j                  |d            d| j	                  |d      dd d |d d S )!Nr   r  r  r   
withdrawalr  r  target_addresssource_addressrb  r   r1   withdraw_idtxidr  r7  r  r  addressFrom	addressTor  r  tagFromtagTorR  rW  r  r*  r.  rs  comment)internalr  r  )	r2  r  r  r  rn  r  r  rm  r  )r$  r  r  r  r  r  movementDirectionr  r  r  r7  s              r&  parse_transactionzwoo.parse_transaction  s   **;@::?HUv& 22;M
* ,++KlS$$[2BC	&&{4DE''^D	
K
$$$[$F
 D$$[':
 	

 Y/
 t
 ;
 
 4##K9
 t
 T
 %
 d&&{H=
 
 d33D4D4D[RZ4[\
  t**;G!
" t#
$ )
 	
r'  c                 8    dddddd}| j                  |||      S Npendingr-  r  )r  
CONFIRMING
PROCESSINGr_  CANCELEDr$  r  s      r&  r  zwoo.parse_transaction_status	  /    ##"
 &&99r'  fromAccount	toAccountc                   K   | j                          d{    | j                  |      }|d   | j                  |      ||d}| j                  | j	                  ||             d{   }| j                  ||      }	| j                  | j                  di       }
| j                  |
dd      }|r||	d<   ||	d<   ||	d	<   |	S 7 7 [w)
a  
        transfer currency internally between wallets on the same account

        https://docs.woox.io/#get-transfer-history

        :param str code: unified currency code
        :param float amount: amount to transfer
        :param str fromAccount: account to transfer from
        :param str toAccount: account to transfer to
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :returns dict: a `transfer structure <https://docs.ccxt.com/#/?id=transfer-structure>`
        Nr1   )r   rW  from_application_idto_application_idr   r   TrW  r  r  )	rv  r  parse_to_numeric!v1PrivatePostAssetMainSubTransferrx  parse_transferr1  r   rR  )r$  r  rW  r  r  r3  r  rz  r4  r   transferOptionsr   s               r&  r   zwoo.transfer	  s      !!!==&d^++F3#.!*	
 ??GU[@\]] &&x:..z2F"&..B[]a"b"!'HX&1H]#$-H[!- 	" ^s#   CCAC)C*ACCc                 (  K   i }|||d<   |||d<   | j                  |d      }| j                  |dg      }|||d<   | j                  | j                  ||             d{   }| j	                  |dg       }| j                  |d|||      S 7 ,w)av  
        fetch a history of internal transfers made on an account

        https://docs.woox.io/#get-transfer-history

        :param str code: unified currency code of the currency transferred
        :param int [since]: the earliest time in ms to fetch transfers for
        :param int [limit]: the maximum number of  transfers structures to retrieve
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :param int [params.until]: the latest time in ms to fetch entries for
        :returns dict[]: a list of `transfer structures <https://docs.ccxt.com/#/?id=transfer-structure>`
        NrO  rN  untilr  r;  )r8  r  'v1PrivateGetAssetMainSubTransferHistoryrx  r>  parse_transfers)	r$  r  rt  r  r3  rz  r&  r4  r)  s	            r&  fetch_transferszwoo.fetch_transfers:	  s      #GFO!&GI!!&'26G9-$GGEEdkkRY[aFbcc2 ~~h3##D$ufEE5 ds   A!B#B$-Br   c                    | j                  |d      }| j                  ||      }|d   }| j                  |d      }| j                  |d      }d }||rdnd}| j                  |d      || j	                  |      || j                  |d      | j                  |d	      | j                  |d
      | j                  | j                  |d|            |d	S )Nr   r  rb  successr-  failedr1   rW  r  r   r*  )	r1   r7  r  r  rW  r  r  r*  r   )r2  r  rn  rR  r  rm  parse_transfer_status)	r$  r   r  r  r  r  r7  r+  r*  s	            r&  r#  zwoo.parse_transferl	  s    , **8W=::?HUv&''.A	..95$T(F""8T2"Y/&&x:++H6KL))(4GH001A1A(HV\1]^

 
	
r'  c                 8    dddddd}| j                  |||      S r  r$  r  s      r&  r-  zwoo.parse_transfer_status	  r  r'  r  c                 r  K   | j                  ||      \  }}| j                          d{    | j                  |       | j                  |      }||d}|||d<   | j	                  | j
                  di       }| j	                  |di       }	| j                  |d      }
| j                  ||
|
      }| j	                  |	|i       }| j                  |d      }|t        | j                  dz         ||d<   | j                  | j                  ||             d{   }| j                  ||      S 7 7 w)	a  
        make a withdrawal

        https://docs.woox.io/#token-withdraw

        :param str code: unified currency code
        :param float amount: the amount to withdraw
        :param str address: the address to withdraw to
        :param str tag:
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :returns dict: a `transaction structure <https://docs.ccxt.com/#/?id=transaction-structure>`
        N)rW  r  r  r   r  r1   z% withdraw() require network parameterr   )handle_withdraw_tag_and_paramsrv  r  r  r1  r   safe_string_upperr2  r%   r1   v1PrivatePostAssetWithdrawrx  r  )r$  r  rW  r  r  r3  r  rz  r   currencyNetworksr  r  coinNetworkcoinNetworkIdr4  s                  r&  r   zwoo.withdraw	  sB     99#vFV!!!7#==&
 ?"GG>>$,,
B?>>(JC((;$$Xw@	nn%5y"E((d; TWW'NNOO(88Wf9UVV %%h993 	"$ Ws"   )D7D2C/D7D5D75D7c                 h  K   | j                          d{    d}|| j                  |      }|d   }| j                  |      }|d   | j                  ||      d}| j	                  | j                  ||             d{   }| j                  ||      }	| j                  |	||d      S 7 7 -w)a  
        repay borrowed margin and interest

        https://docs.woox.io/#repay-interest

        :param str code: unified currency code of the currency to repay
        :param float amount: the amount to repay
        :param str symbol: not used by woo.repayMargin()
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :returns dict: a `margin loan structure <https://docs.ccxt.com/#/?id=margin-loan-structure>`
        NrD  r1   )r   rW  )rW  rD  )rv  rB  r  currency_to_precisionv1PrivatePostInterestRepayrx  parse_margin_loan)
r$  r  rW  rD  r3  rB  r  rz  r4  r  s
             r&  repay_marginzwoo.repay_margin	  s      !!![[(FH%F==&d^00v>
 88Wf9UVV ,,Xx@{{;)
  	# 	" Ws"   B2B.A+B2B0,B20B2c                 6    d | j                  d |      d d d d |dS )N)r1   r  rW  rD  r7  r  r   )rl  )r$  r   r  s      r&  r9  zwoo.parse_margin_loan	  s0     //h?
 	
r'  c                 B    | j                         | j                  d   z
  S )Nr   )r  r   )r$  s    r&  noncez	woo.nonce	  s       "T\\2B%CCCr'  r   GETc                    |d   }|d   }| j                  ||      }	| j                  | j                  d   |         }
|
d|z   dz   z  }
| j                  || j	                  |            }| j                  |      }|dk(  r'|
|dz   |	z   z  }
|r|
d| j                  |      z   z  }
n|dk(  r!|
|	z  }
|r|
d| j                  |      z   z  }
n| j                          |dk(  rz|d	k(  s|d
k(  rp| j                  | j                  dd      }|s@d}| j                  | j                  d|      }|j                  d      dkD  }|r||d<   n||d<   | j                  |      }d}t        | j                               }|
|	z  }
| j                  |d}|dk(  r`||z   dz   |z   dz   |	z   }|dk(  s
|dk(  s|dk(  r| j                  |      }||z  }n#|r!| j                  |      }|
d|z   z  }
|d|z   z  }d|d<   n:| j                  |      }|dk(  s
|dk(  s|dk(  r|}n
|r|
d|z   z  }
|d|z   z  }d|d<   | j!                  | j#                  |      | j#                  | j$                        t&        j(                        |d<   |
|||dS )Nr   r   r   rH  r   ?r   POSTr   r   r   Fr   r   algo	broker_id )z	x-api-keyzx-api-timestampr   PUTDELETEzapplication/jsonzcontent-type|z!application/x-www-form-urlencodedzx-api-signature)r   methodbodyheaders)implode_paramsimplode_hostnamer   r  extract_paramskeysort	urlencodecheck_required_credentialsrR  r   r2  findstrr=  apiKeyjsonhmacencodesecrethashlibsha256)r$  pathsectionrI  r3  rK  rJ  r7   accesspathWithParamsr   isSandboxModeapplicationIdr   r7  authtsquerys                     r&  signzwoo.sign	  s   !*,,T6:##DIIe$4V$<=sW}s""64#6#6t#<=f%X6C<.00CsT^^F333u_>!CsT^^F333++-T\%9TW_ $t||]E R$$JM#//j-XH $		& 1B 6I -5z*.6{+f-DTZZ\"B>!C![[#%G $F{S(72S8>IV#v&H:L99V,DDLD $v 6sU{*e+*<'~~f-V#v&H:LDsTz)b *M')-4;;t3DdkkRVR]R]F^`g`n`n)oG%&fdwOOr'  httpCodereasonr   rI  rK  rJ  c
                    |sy | j                  |d      }
| j                  |d      }|
sa| j                  dz   | j                  |      z   }| j	                  | j
                  d   ||       | j                  | j
                  d   ||       y )Nr+  r   r  r  )rR  r2  r1   rU  throw_broadly_matched_exceptionr  throw_exactly_matched_exception)r$  re  rf  r   rI  rK  rJ  r4  requestHeadersrequestBodyr+  	errorCodefeedbacks                r&  handle_errorszwoo.handle_errors9
  s    
 ..95$$Xv6	ww}tyy'::H001I4QYZ001I9V^_r'  c           	         | j                  |d      }| j                  ||      }| j                  |d      }| j                  d      }| j                  |d      }| j                  |d      }| j	                  |d      }	| j                  |d      }
|
dk(  rt        j                  |      n|}||||| j                  |      || j                  |      |	d	S )
NrD  funding_feeUSDr1   rs  funding_ratepayment_typePay)r   rD  r  r7  r  r1   rW  rate)	r2  safe_symbolrl  rn  rm  r,   
string_negr  r#  )r$  incomerB  ro  rD  rW  r  r1   r7  rv  paymentTypes              r&  parse_incomezwoo.parse_incomeH
  s     ##FH5!!(F3!!&-8&&u-fd+''?	7&&v~>0;u0D##F+6"Y/''/	
 		
r'  c                 X  K   | j                          d{    d}| j                  |dd      \  }}|r!| j                  d||||dddd	       d{   S i }d}|| j                  |      }|d   |d	<   |||d
<   |||d<   nd|d<   | j	                  | j                  ||             d{   }| j                  |di       }	| j                  |	d      }
| j                  |dg       }t        |      }|dkD  r||dz
     }|
|d<   |||dz
  <   | j                  ||||      S 7 7 7 zw)a"  
        fetch the history of funding payments paid and received on self account

        https://docs.woox.io/#get-funding-fee-history

        :param str [symbol]: unified market symbol
        :param int [since]: the earliest time in ms to fetch funding history for
        :param int [limit]: the maximum number of funding history structures to retrieve
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :param boolean [params.paginate]: default False, when True will automatically paginate by calling self endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
        :returns dict: a `funding history structure <https://docs.ccxt.com/#/?id=funding-history-structure>`
        NFrj   rK  rL  r   r  r1   rD  rN  rO  i  metacurrent_pager;  r   )rv  rP  fetch_paginated_call_cursorrB  v1PrivateGetFundingFeeHistoryrx  r1  r8  r>  r  parse_incomes)r$  rD  rt  r  r3  rK  rz  rB  r4  r}  cursorr  resultLengthlastItems                 r&  fetch_funding_historyzwoo.fetch_funding_historyj
  s     !!!88AVXbc&99:OQWY^`egmouw}  @A  CF  G  G  G[[(F &tGH!&GI#GFO"GFO;;DKKQW<XYY0 ~~h3""48&"56{!lQ./H%HV'/F<!#$!!&&%??a 	" G Zs5   D*D#:D*D&AD*-D(.A6D*&D*(D*c                    | j                  |d      }| j                  |      }| j                  |d      }| j                  |d      }| j                  |d      }| j                  |d      }i d|d|d   dd dd d	| j                  d
      dd d|d| j	                  |      d| j                  |d      d|d| j	                  |      dd dd dd d| j                  |d      d|d| j	                  |      d|dz   iS )NrD  next_funding_timeest_funding_rate_timestamplast_funding_rate_timestampest_funding_rate_intervalr   	markPrice
indexPriceinterestRater,  estimatedSettlePricer7  r  fundingRateest_funding_ratefundingTimestampfundingDatetimenextFundingRatenextFundingTimestampnextFundingDatetimepreviousFundingRatelast_funding_ratepreviousFundingTimestamppreviousFundingDatetimeintervalh)r2  rB  r8  r#  r  rm  )r$  r  rB  rD  r  estFundingRateTimestamplastFundingRateTimestampintervalStrings           r&  parse_funding_ratezwoo.parse_funding_rate
  s    !!+x8V$#00>QR"&"3"3KA]"^#'#4#4[B_#` ))+7RS
K
fX&
 
 $	

 D--c2
 #D
 0
 %<=
 4++K9KL
  4
 t||,@A
 t
 #D
 "4
 "4#3#3KAT#U
  '(@!
" &t||4L'M#
$ ,%
 	
r'  c                 B   K   | j                  ||       d{   S 7 w)aw  
        fetch the current funding rate interval

        https://docs.woox.io/#get-predicted-funding-rate-for-one-market-public

        :param str symbol: unified market symbol
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :returns dict: a `funding rate structure <https://docs.ccxt.com/#/?id=funding-rate-structure>`
        N)fetch_funding_rate)r$  rD  r3  s      r&  fetch_funding_intervalzwoo.fetch_funding_interval
  s!      ,,VV<<<<s   c                    K   | j                          d{    | j                  |      }d|d   i}| j                  | j                  ||             d{   }| j	                  ||      S 7 W7 w)an  
        fetch the current funding rate

        https://docs.woox.io/#get-predicted-funding-rate-for-one-market-public

        :param str symbol: unified market symbol
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :returns dict: a `funding rate structure <https://docs.ccxt.com/#/?id=funding-rate-structure>`
        NrD  r1   )rv  rB  v1PublicGetFundingRateSymbolrx  r  r$  rD  r3  rB  rz  r4  s         r&  r  zwoo.fetch_funding_rate
  sz      !!!V$fTl
 ::4;;wPV;WXX &&x88) 	"
 Y"   A2A.A A2A0A20A2r  c                    K   | j                          d{    | j                  |      }| j                  |       d{   }| j                  |dg       }| j	                  ||      S 7 S7 +w)a  
        fetch the funding rate for multiple markets

        https://docs.woox.io/#get-predicted-funding-rate-for-all-markets-public

        :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 `funding rate structures <https://docs.ccxt.com/#/?id=funding-rates-structure>`, indexed by market symbols
        Nr;  )rv  market_symbolsv1PublicGetFundingRatesr>  parse_funding_rates)r$  r  r3  r4  r;  s        r&  fetch_funding_rateszwoo.fetch_funding_rates
  sm      !!!%%g.55f==" ~~h3''g66) 	"=s!   A.A*)A. A,*A.,A.c           
      6  K   | j                          d{    d}| j                  |dd      \  }}|r| j                  d||||dd       d{   S i }|| j                  |      }|d   }|d   |d<   || j	                  |d	z        |d
<   | j                  d||d      \  }}| j                  | j                  ||             d{   }| j                  |d      }	g }
t        dt        |	            D ]p  }|	|   }| j                  |d      }| j                  |d      }|
j                  || j                  |      | j                  |d      || j!                  |      d       r | j#                  |
d      }| j%                  ||||      S 7 {7 E7 ̭w)a  
        fetches historical funding rate prices

        https://docs.woox.io/#get-funding-rate-history-for-one-market-public

        :param str symbol: unified symbol of the market to fetch the funding rate history for
        :param int [since]: timestamp in ms of the earliest funding rate to fetch
        :param int [limit]: the maximum amount of `funding rate structures <https://docs.ccxt.com/#/?id=funding-rate-history-structure>` to fetch
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :param int [params.until]: timestamp in ms of the latest funding rate
        :param boolean [params.paginate]: default False, when True will automatically paginate by calling self endpoint multiple times. See in the docs all the [availble parameters](https://github.com/ccxt/ccxt/wiki/Manual#pagination-params)
        :returns dict[]: a list of `funding rate structures <https://docs.ccxt.com/#/?id=funding-rate-history-structure>`
        NFrn   rK  rL     rD  r1   r  rN  r  gMbP?r;  r   funding_rate_timestamprs  )r   rD  r  r7  r  r7  )rv  rP  rQ  rB  parse_to_intr  v1PublicGetFundingRateHistoryrx  r>  r  r  r2  r8  r  rw  rm  r  sort_byfilter_by_symbol_since_limit)r$  rD  rt  r  r3  rK  rz  rB  r4  r  ratesr  entryro  r7  sorteds                   r&  fetch_funding_rate_historyzwoo.fetch_funding_rate_history  s     !!!88AZ\fg&>>?XZ`bginpvx~  AC  D  D  D[[(FH%F &tGH!%!2!254<!@GI227GVUS;;DKKQW<XYY( &1q#f+& 
	A1IE''x8H))%1IJILL**84#//~F& LL3 	
	 e[100NN_ 	" D Zs5   FF8FFA:F
FCFFFr  c                 ~   K   d}|rd}nd}d|i}| j                  | j                  ||             d{   }|S 7 w)a~  
        set hedged to True or False for a market

        https://docs.woox.io/#update-position-mode

        :param bool hedged: set to True to use HEDGE_MODE, False for ONE_WAY
        :param str symbol: not used by woo setPositionMode
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :returns dict: response from the exchange
        N
HEDGE_MODEONE_WAYposition_mode)v1PrivatePostClientPositionModerx  )r$  r  rD  r3  	hedgeModerz  r4  s          r&  set_position_modezwoo.set_position_mode^  sT      	$I!IY
 ==dkk'SY>Z[[  \s   2=;=c                   K   | j                          d{    | j                  |      }d}|d   r| j                  |       d{   }n|d   r]d|d   i}d}| j                  d|d      \  }}| j	                  |      |d<   | j                  | j                  ||             d{   }n!t        | j                  d	z   |d
   z   dz         | j                  |di       }| j                  ||      S 7 7 7 Ow)a	  
        fetch the set leverage for a market

        https://docs.woox.io/#get-account-information-new

        :param str symbol: unified market symbol
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :param str [params.marginMode]: *for swap markets only* 'cross' or 'isolated'
        :param str [params.position_mode]: *for swap markets only* 'ONE_WAY' or 'HEDGE_MODE'
        :returns dict: a `leverage structure <https://docs.ccxt.com/#/?id=leverage-structure>`
        Nr>   r@   rD  r1   rr   r"  r  & fetchLeverage() is not supported for rR   marketsr)  )rv  rB  r  r  r  !v1PrivateGetClientFuturesLeveragerx  r'   r1   r1  parse_leverage)r$  rD  r3  rB  r4  rz  r   r)  s           r&  fetch_leveragezwoo.fetch_leverage{  s     !!!V$&>!99&AAH: F^&,G #J!%!C!COU[]d!eJ%)%<%<Z%HGM"!CCDKKPWY_D`aaHT tww)QQTZ[aTbbeoopp~~h3""400i 	" BH bs5   C;C50C;C7A!C;)C9*AC;7C;9C;r  c                    | j                  |d      }| j                  ||      }| j                  |d      }| j                  |d      }|}|}| j	                  |dg       }t        dt        |            D ]S  }	| j                  ||	i       }
| j                  |
d      }| j                  |
d      }|dk(  r|}|}D|dk(  r|}L|d	k(  sR|}U ||d   |||d
S )NrD  default_margin_moder  detailsr   position_sideBOTHLONGSHORT)r   rD  r   longLeverageshortLeverage)r2  r  r  r8  r>  r  r  r1  )r$  r  rB  ro  r   spotLeverager  r  r  r  positionpositionLeverager  s                r&  r  zwoo.parse_leverage  s   ##Hh7!!(F3++H6KL
((:>#$..9b9q#g,' 
	1A~~gq"5H#00:F##Ho>Dv~/ 0/ 0
	1 X&$(*
 	
r'  c                   K   | j                          d{    d|i}d}|| j                  |      }||d   r)| j                  | j                  ||             d{   S |d   r]|d   |d<   d}| j	                  d|d      \  }}| j                  |      |d	<   | j                  | j                  ||             d{   S t        | j                  d
z   |d   z   dz         7 7 7 )w)a  
        set the level of leverage for a market

        https://docs.woox.io/#update-leverage-setting
        https://docs.woox.io/#update-futures-leverage-setting

        :param float leverage: the rate of leverage(1, 2, 3, 4 or 5 for spot markets, 1, 2, 3, 4, 5, 10, 15, 20 for swap markets)
        :param str [symbol]: unified market symbol(is mandatory for swap markets)
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :param str [params.marginMode]: *for swap markets only* 'cross' or 'isolated'
        :param str [params.position_side]: *for swap markets only* 'LONG' or 'SHORT' in hedge mode, 'BOTH' in one way mode.
        :returns dict: response from the exchange
        Nr  r>   r@   r1   rD  rr   r"  r  r  rR  r  )	rv  rB  v1PrivatePostClientLeveragerx  r  r  "v1PrivatePostClientFuturesLeverager'   r1   )r$  r  rD  r3  rz  rB  r   s          r&  set_leveragezwoo.set_leverage  s     !!!
 [[(FNvf~99$++gv:VWWWF^ &tGH"J!%!C!COU[]d!eJ%)%<%<Z%HGM"@@WV\A]^^^tww)QQTZ[aTbbeoopp! 	" X _s5   C-C'AC-C) A!C-C+&C-)C-+C-c                 F   K   | j                  ||d|       d{   S 7 w)a  
        add margin

        https://docs.woox.io/#update-isolated-margin-setting

        :param str symbol: unified market symbol
        :param float amount: amount of margin to add
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :param str [params.position_side]: 'LONG' or 'SHORT' in hedge mode, 'BOTH' in one way mode
        :returns dict: a `margin structure <https://docs.ccxt.com/#/?id=add-margin-structure>`
        ADDNmodify_margin_helperr$  rD  rW  r3  s       r&  
add_marginzwoo.add_margin  s%      ..vvufMMMM   !!c                 F   K   | j                  ||d|       d{   S 7 w)a  
        remove margin from a position

        https://docs.woox.io/#update-isolated-margin-setting

        :param str symbol: unified market symbol
        :param float amount: amount of margin to remove
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :param str [params.position_side]: 'LONG' or 'SHORT' in hedge mode, 'BOTH' in one way mode
        :returns dict: a `margin structure <https://docs.ccxt.com/#/?id=reduce-margin-structure>`
        REDUCENr  r  s       r&  reduce_marginzwoo.reduce_margin&  s%      ..vvxPPPPr  c                    K   | j                          d {    | j                  |      }|d   d||d}| j                  | j                  ||             d {   S 7 H7 w)Nr1   USDT)rD  adjust_tokenadjust_amountaction)rv  rB  !v1PrivatePostClientIsolatedMarginrx  )r$  rD  rW  rR  r3  rB  rz  s          r&  r  zwoo.modify_margin_helper4  sk     !!!V$Tl"#	
 ;;DKKQW<XYYY 	" Zs"   A#AAA#A!A#!A#c                    K   | j                          d {    | j                  |      }d|d   i}| j                  | j                  ||             d {   }| j	                  ||      S 7 W7 w)NrD  r1   )rv  rB  v1PrivateGetPositionSymbolrx  parse_positionr  s         r&  fetch_positionzwoo.fetch_position?  sw     !!!V$fTl
 88Wf9UVV2 ""8V44= 	"
 Wr  c                    K   | j                          d {    | j                  |       d {   }| j                  |di       }| j                  |dg       }| j	                  ||      S 7 U7 >w)Nr)  r   )rv  v3PrivateGetPositionsr1  r>  parse_positions)r$  r  r3  r4  r  r   s         r&  fetch_positionszwoo.fetch_positions`  so     !!!33F;;l &"5NN6;;	##Iw77s 	";s   A0A,A0A.=A0.A0r  c                    | j                  |d      }| j                  ||      }| j                  |d      }d }t        j                  |d      rd}nd}| j                  |d      }| j	                  |dd      }| j                  |d	      }| j	                  |d
d      }	t        j                  ||	      }
t        j                  |
|      }t        j                  |      }t        j                  ||      }| j                  |d      }| j                  i d|dd d| j                  |d      d	|d| j                  |      dd dd dd dd dd d| j                  |	      d| j                  |      d| j                  |d      d| j                  |      d| j                  |      d| j                  |      dd | j                  |dd      | j                  |      d d | j                  |dd      |d |dk7  d d d 
      S )!NrD  r  r,  longshortrc  r  
mark_pricer7  averageOpenPriceaverage_open_pricepositionSider   r1   r  ru  initialMargininitialMarginPercentagemaintenanceMarginmaintenanceMarginPercentage
entryPricenotionalr  unrealizedPnl	contractsmarginRatioestLiqPriceest_liq_pricer   r  r  )
liquidationPricer  	lastPrice
collateralr   r  r   r  r   r  )r2  r  r,   	string_gtr  rn  
string_subr  
string_abssafe_positionr  r#  rm  r~  r|  )r$  r  rB  rT  rO  r  rc  r  r7  r  priceDifferenceunrealisedPnlr  r  s                 r&  r  zwoo.parse_position  s   b ##Hh7!!(F3)4T3'DD''?&&xlK	''+>	''2DFZ[
!,,Y
C**?DA!!$'%%dI6''.A!! #
H#
$#
 d&&vx8#
 	#

 Y/#
 "4#
 T#
 &t#
  #
 *4#
 $++J7#
 ))(3#
 ((:>#
 T..}=#
 **40#
  D--l;!#
" 4##
$ !% 2 28]O \**95228\=Y"f,!#7#
  	r'  fromCodetoCodec                   K   | j                          d{    |j                         |j                         | j                  |      d}| j                  | j	                  ||             d{   }| j                  |di       }| j                  |d|      }| j                  |      }	| j                  |d|      }
| j                  |
      }| j                  ||	|      S 7 7 tw)a(  
        fetch a quote for converting from one currency to another

        https://docs.woox.io/#get-quote-rfq

        :param str fromCode: the currency that you want to sell and convert from
        :param str toCode: the currency that you want to buy and convert into
        :param float [amount]: how much you want to trade in units of the from currency
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :returns dict: a `conversion structure <https://docs.ccxt.com/#/?id=conversion-structure>`
        N)	sellTokenbuyTokensellQuantityr)  r
  r  )	rv  r  r  v3PrivateGetConvertRfqrx  r1  r2  r  parse_conversion)r$  r  r  rW  r3  rz  r4  r)  fromCurrencyIdfromCurrencytoCurrencyId
toCurrencys               r&  fetch_convert_quotezwoo.fetch_convert_quote  s      !!!!) 11&9

 44T[[&5QRR" ~~h3))$XF}}^4''j&A]]<0
$$T<DD9 	" Ss#   C'C#AC'0C%1A3C'%C'c                    K   | j                          d{    d|i}| j                  | j                  ||             d{   }| j                  |di       }| j	                  |      S 7 U7 *w)aU  
        convert from one currency to another

        https://docs.woox.io/#send-quote-rft

        :param str id: the id of the trade that you want to make
        :param str fromCode: the currency that you want to sell and convert from
        :param str toCode: the currency that you want to buy and convert into
        :param float [amount]: how much you want to trade in units of the from currency
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :returns dict: a `conversion structure <https://docs.ccxt.com/#/?id=conversion-structure>`
        NrP  r)  )rv  v3PrivatePostConvertRftrx  r1  r  )	r$  r1   r  r  rW  r3  rz  r4  r)  s	            r&  create_convert_tradezwoo.create_convert_trade&  sw      !!!r
 55dkk'66RSS ~~h3$$T**! 	" Ts!   A0A,,A0A.)A0.A0c                   K   | j                          d{    d|i}| j                  | j                  ||             d{   }| j                  |di       }| j	                  |d      }| j	                  |d      }d}	d}
|| j                  |      }	|| j                  |      }
| j                  ||	|
      S 7 7 zw)a  
        fetch the data for a conversion trade

        https://docs.woox.io/#get-quote-trade

        :param str id: the id of the trade that you want to fetch
        :param str [code]: the unified currency code of the conversion trade
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :returns dict: a `conversion structure <https://docs.ccxt.com/#/?id=conversion-structure>`
        NrP  r)  	sellAssetbuyAsset)rv  v3PrivateGetConvertTraderx  r1  r2  r  r  )r$  r1   r  r3  rz  r4  r)  r  r  r  r  s              r&  fetch_convert_tradezwoo.fetch_convert_tradeE  s      !!!r
 66t{{7F7STT ~~h3))$<''j9
%==8L#|4J$$T<DD9 	" Us"   C B<,C B>A9C >C c                 X  K   | j                          d{    i }| j                  d||      \  }}|||d<   |||d<   | j                  | j                  ||             d{   }| j	                  |di       }| j                  |dg       }| j                  ||dd||      S 7 7 Bw)	a]  
        fetch the users history of conversion trades

        https://docs.woox.io/#get-quote-trades

        :param str [code]: the unified currency code
        :param int [since]: the earliest time in ms to fetch conversions for
        :param int [limit]: the maximum number of conversion structures to retrieve
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :param int [params.until]: timestamp in ms of the latest conversion to fetch
        :returns dict[]: a list of `conversion structures <https://docs.ccxt.com/#/?id=conversion-structure>`
        NendTime	startTimerO  r)  tradeVosr  r  )rv  r  v3PrivateGetConvertTradesrx  r1  r>  parse_conversions)	r$  r  rt  r  r3  rz  r4  r)  r;  s	            r&  fetch_convert_trade_historyzwoo.fetch_convert_trade_historyn  s      !!!229gvN#(GK #GFO77GV8TUU* ~~h3~~dJ3%%dD+z5RWXX= 	" Vs#   B*B&AB*%B(&AB*(B*
conversionr  r  c                 x   | j                  |dd      }| j                  |dd      }| j                  ||      }| j                  |dd      }| j                  ||      }||| j                  |      | j	                  |d      || j                  |dd	      || j                  |d
d      | j                  |d      d d
S )NexpireTimestamprf  r
  r  r  r  rP  r  
sellAmountbuyQuantity	buyAmountbuyPrice)
r   r7  r  r1   r  
fromAmountr  toAmountrX  r  )safe_integer_2r  rl  r  r2  r~  rm  )	r$  r#  r  r  r7  fromCurrr  tor  s	            r&  r  zwoo.parse_conversion  s    H ''
4E}U	%%j+zJ**8\B
JD((Z8"Y/"":y9$,,ZV **:}kR%%j*=
 	
r'  c                   K   | j                          d{    | j                  |       d{   }i }| j                  |dg       }t        dt	        |            D ]j  }||   }| j                  |d      }| j                  |      }|||ddddddd| j                  |d      dddddddddd| j                  |d      d	||<   l |S 7 7 w)
a  
        fetches all available currencies that can be converted

        https://docs.woox.io/#get-quote-asset-info

        :param dict [params]: extra parameters specific to the exchange API endpoint
        :returns dict: an associative dictionary of currencies
        Nr;  r   r   tickrY  )rW  r   r  rf  )r   r1   r  r   rR  r2   rS  r  r   r  rh  ri  rj  )	rv  v3PrivateGetConvertAssetInfor>  r  r  r2  rl  rm  rn  )	r$  r3  r4  r  r)  r  r  r1   r  s	            r&  fetch_convert_currencieszwoo.fetch_convert_currencies  s     !!!::6BB ~~h3q#d)$ 	AGE!!%1B**2.D  !--eV<  $#
  $#!
  $#   ..umD5F4L		@ c 	"Bs    CCCCBCCc                     | j                  |      }|d   }t        |j                               }t        dt	        |            D ]  }||   }|dk(  s|c S  | j                  |d      S )Nr   r   r   )r  r  r  r  r  r  )r$  r  currencyItemr   networkKeysr  r  s          r&  r  z%woo.default_network_code_for_currency  sn    }}T*
+8==?+q#k*+ 	A!!nG%	
 {A..r'  enablec                 J    t         t        |   |       || j                  d<   y )Nr   )r!  r.   set_sandbox_moder   )r$  r6  r%  s     r&  r8  zwoo.set_sandbox_mode  s     c4)&1&,]#r'  )N)NN)w__name__
__module____qualname__r   r"  r5  r   r9  r!   r   rA  dictrs  rS  r   r|  r  r  r   r  r
   r  floatr  r  r   r   r   r   r  r  r  r  r1  r   r9  r>  rC  rH  rV  r\  r`  rd  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   r  r  r  r  r    r   r)  r#  r-  r   r:  r9  r=  rd  intro  r{  r  r   r  r  r  r   r   r  r  boolr  r   r  r  r  r   r  r  r  r  r   r  r  r	   r  r  r  r"  r  r2  r  r8  __classcell__)r%  s   @r&  r.   r.      s
   f# fP )+ "
H ') 8S 8, *, "(V "(HR
4 R
F R
h <@d[] 2G 2GS 2G 2Gbfglbm 2Gh= =v = =~
 /1 5[ 5n -/ E: EN XZ Qc Q Q" Y[ Rs R% R" }A  RV  mq  z| R RI RU^ Rhm Rvy R  AF R0 ~B  TX  os  |~ R# RY RV_ Rin Rwz R  CH R0 mqy{ p pI pY pX] pfi pd3 fjx|  FH R.3 R. R.9 R.I R._b R.ru R.h 9=R /ES /E# /Eb 59 !
c !
F BD 
S 
8 8<B A0C A0 A0F 04$UYbd R? R?C R?s R?imnsit R?h 59tZ^gi Mc M MTW Mnrsxny M, 7;\`ik M M3 MVY Mptuzp{ M,As Aj jv j jX   @DB %gS %g %gS\ %gN 8<$]ajl NH NHC NHWZ NHquvzq{ NH`	
 	
4 	
 ?CQUdhqs (G3 (G (G3 (G^a (GT 37TX\eg 7GC 7Gs 7GRU 7Gr +- 1g 1:
" *, #( #(J) ) =? #
 #
> #
J 8<$]ajl 2@ 2@C 2@WZ 2@qt 2@h .2SW`b Gs G# GS Ggklwgx G"t x ; 83 04$UYbd g gC gs gimnyiz g" 37TX\eg gC gs gRU glpq|l} g" <@daenp MS M M[^ Muy  {F  vG M>!
T !
X !
Q\ !
F:s : ac #3 # #C #TW #gt #J 154VZce 0F# 0FS 0FPS 0Fjno|j} 0Fd(
t (
x (
= (
T:C :C : JNVX ':3 ': ': ':]h ':R JNVX  s  E  3  D
 
 D "*%DW[ 9Pvc 3 S # X\ dg  
6  
D 9=4^bkm =@# =@S =@X[ =@~(
f (
 (
T @B 
=3 
=k 
= <> 9s 9+ 9@ <@ 7 7| 7@ >BPTcgpr =Os =O# =O]` =O~ CGr d C : 8: `13 `1h `1D
t 
V 
x 
6 ?C2 q3 q q@ CE Ns NE NI[ N FH Q# Qu QL^ Q LN 	Z 	ZRd 	Z 8: 53 5B 8<B :8W :84PX> :8x^t ^V ^@ SW_a (E# (Es (EC (Efp (ET ]aik +S +C + +VY +pz +> >B" 'EC 'Es 'EQ[ 'ER =Atbfoq +Yc +Y +Y\_ +Yvz  |F  wG +YZ4
4 4
x 4
\d 4
pz 4
l 57 :: :x	/-t - -r'  r.   )3 ccxt.async_support.base.exchanger   ccxt.abstract.woor   rY  ccxt.base.typesr   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   r    typingr!   ccxt.base.errorsr"   r#   r$   r%   r&   r'   r(   r)   r*   ccxt.base.decimal_to_precisionr+   ccxt.base.preciser,   r.    r'  r&  <module>rI     st    6 )                  * 0 . ' ) ) , . * 4 %B8-(K B8-r'  