
    E#i@                    h   S SK Jr  S SKJr  S SKrS SKJrJrJrJ	r	J
r
JrJrJrJrJrJrJrJrJrJrJrJrJrJr  S SKJr  S SKJr  S SKJr  S SKJr  S S	KJr  S S
KJ r   S SKJ!r!  S SKJ"r"  S SKJ#r#  S SKJ$r$  S SKJ%r%  S SKJ&r&  S SKJ'r'  S SKJ(r(  S SKJ)r)  S SK*J+r+  S SK*J,r,  S SK-J.r.   " S S\\5      r/g)    )Exchange)ImplicitAPIN)AnyBalances
CurrenciesCurrencyDepositAddressIntMarketNumOrder	OrderBook	OrderSide	OrderTypeStrStringsTickerTickersTradeTradingFeesTransaction)List)ExchangeError)AuthenticationError)PermissionDenied)AccountSuspended)ArgumentsRequired)
BadRequest)	BadSymbol)InsufficientFunds)InvalidAddress)InvalidOrder)OrderNotFound)RateLimitExceeded)ExchangeNotAvailable)OnMaintenance)TRUNCATE)	TICK_SIZE)Precisec                   6  ^  \ rS rSrS\4U 4S jjr0 4S\4S jjr0 4S\\	   4S jjr
S r0 4S\4S jjrS r0 4S	\S\4S
 jjrSRS\S\	S\4S jjrS0 4S\S\4S jjrSS0 4S	\S\S\S\\   4S jjrSRS\S\	S\4S jjr0 4S\4S jjrSRS jrS0 4S	\S\S\4S jjrSRS\	S\4S jjr SSS0 4S	\!S\S\4S jjr"SSS0 4S	\!S\S\S\\   4S jjr#S\$4S jr%0 4S\$4S jjr&0 4S\S\'4S  jjr(S0 4S	\!S!\)S"\*S#\+S$\,4
S% jjr-S0 4S	\!S!\)S"\*S#\+S$\,4
S& jjr.SS0 4S'\4S( jjr/SS0 4S'\S	\S!\)S"\*S#\,S$\,4S) jjr0S0 4S'\!S	\!4S* jjr1S0 4S'\S	\!4S+ jjr2S0 4S	\!4S, jjr3S0 4S'\S	\!4S- jjr4SSS0 4S	\!S\S\4S. jjr5SSS0 4S	\!S\S\S\\6   4S/ jjr7SSS0 4S	\!S\S\S\\6   4S0 jjr8S1\!4S2 jr9SRS3\S\	S\64S4 jjr:SSS0 4S	\!S\S\4S5 jjr;SSS0 4S	\!S\S\S\\   4S6 jjr<S0 4S\!4S7 jjr=S0 4S\S#\+S8\S9\!S\>4
S: jjr?SSS0 4S\!S\S\4S; jjr@SSS0 4S\!S\S\S\\>   4S< jjrASSS0 4S\!S\S\4S= jjrBSSS0 4S\!S\S\S\\>   4S> jjrCS1\!4S? jrDSRS@\SA\ES\>4SB jjrFSRSA\E4SC jjrGS0 4SD\4SE jjrHSFSG0 SS4SH jrISI\JSJ\SK\SL\SM\SN\4SO jrK0 4SP jrLSQrMU =rN$ )Sbitvavo   returnc                   > U R                  [        [        U ]  5       0 SS_SS_SS/_SS_S	S
_SS_SS_S0 SS _SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_S S_0 S!S_S"S_S#S_S$S_S%S_S&S_S'S_S(S_S)S_S*S_S+S_S,S_S-S_S.S_S/S_S0S_S1S_E0 S2S_S3S_S4S_S5S6_S7S_S8S_S9S_S:S_S;S_S<S_S=S_S>S_S?S_S@S_SAS_SBS_SCS_E0 SDS_SES_SFS_SGS_SHS_SIS_SJS_SKS_SLS_SMS_SNS_SOS_SPS_SQS_SRS_SSS_STS_E0 SUS_SVS_SWS_SXS_SYS_SZS_S[S_S\S_S]S_S^S_S_S_S`S_SaS_SbS_ScS_SdS_SeS_E0 SfS_SgS_ShS_SiS_SjS_SkS_SlS_SmS_SnS_SoS_SpS_SqS_SrS_SsS_StS_SuS_SvS_ESSSSw.E_SxSySzS{S|S}S~SSSSSS._SSSSS.SSSSS._SSSSSSSSSSSSS.S.	0SSSSSS.SSSSSS.	SSS.SS0SSS.S.S._SSSSU R	                  S5      U R	                  S5      U R	                  S5      U R	                  S5      /U R	                  S5      U R	                  S5      /U R	                  S5      U R	                  S5      /U R	                  S5      U R	                  S5      /U R	                  S5      U R	                  S5      /U R	                  S5      U R	                  S5      /U R	                  S5      U R	                  S5      /U R	                  S5      U R	                  S5      /U R	                  S5      U R	                  S5      //	U R	                  S5      U R	                  S5      /U R	                  S5      U R	                  S5      /U R	                  S5      U R	                  S5      /U R	                  S5      U R	                  S5      /U R	                  S5      U R	                  S5      /U R	                  S5      U R	                  S5      /U R	                  S5      U R	                  S5      /U R	                  S5      U R	                  S5      /U R	                  S5      U R	                  S5      //	S.S.0_SSSS._SSSSS S SSS SSSSS.SSSSSSSSSS.SS.S SSSSSS.SSSSS.SS SSSS.SSSSSSSS.S SS0S.	S S S.S S S.S._S0 S[
        _S[        _S[        _S[        _S[        _S[        _S[        _S[        _S[        _S[        _S[        _S[        _S[        _S[        _S[        _S[        _S[        _0 S[        _S[        _S[        _S[        _S[        _S[        _S[        _S[
        _S[
        _S[        _S[        _S[        _S[
        _S[        _S[        _S[        _S[        _E0 S[        _S[        _S[        _S[        _S[        _S[        _S[        _S[        _S[        _S[        _S[        _S[        _S[        _S[
        _S[
        _S[        _S[        _E[         [
        [        [
        [        ["        [
        [        ["        ["        [
        S.E[        [        [        [        S.S._S[$        SSSS.S GS /GS._GS[&        _GSGSGS00E5      $ (  Nidr+   nameBitvavo	countriesNL	rateLimit<   versionv2	certifiedFproThasCORSspotmarginswapfutureoption	addMarginborrowCrossMarginborrowIsolatedMarginborrowMargincancelAllOrderscancelOrdercloseAllPositionsclosePositioncreateOrder$createOrderWithTakeProfitAndStopLoss&createOrderWithTakeProfitAndStopLossWscreatePostOnlyOrdercreateReduceOnlyOrdercreateStopLimitOrdercreateStopMarketOrdercreateStopOrder	editOrderfetchBalancefetchBorrowInterestfetchBorrowRatefetchBorrowRateHistoriesfetchBorrowRateHistoryfetchBorrowRatesfetchBorrowRatesPerSymbolfetchCrossBorrowRatefetchCrossBorrowRatesfetchCurrenciesfetchDepositAddressfetchDepositAddressesfetchDepositAddressesByNetworkfetchDepositsfetchDepositWithdrawFeeemulatedfetchDepositWithdrawFeesfetchFundingHistoryfetchFundingIntervalfetchFundingIntervalsfetchFundingRatefetchFundingRateHistoryfetchFundingRatesfetchGreeksfetchIndexOHLCVfetchIsolatedBorrowRatefetchIsolatedBorrowRatesfetchIsolatedPositionsfetchLeveragefetchLeveragesfetchLeverageTiersfetchLiquidationsfetchLongShortRatiofetchLongShortRatioHistoryfetchMarginAdjustmentHistoryfetchMarginModefetchMarginModesfetchMarketLeverageTiersfetchMarketsfetchMarkOHLCVfetchMarkPricesfetchMyLiquidationsfetchMySettlementHistoryfetchMyTrades
fetchOHLCVfetchOpenInterestfetchOpenInterestHistoryfetchOpenInterestsfetchOpenOrdersfetchOptionfetchOptionChain
fetchOrderfetchOrderBookfetchOrdersfetchPositionfetchPositionHistoryfetchPositionModefetchPositionsfetchPositionsForSymbolfetchPositionsHistoryfetchPositionsRiskfetchPremiumIndexOHLCVfetchSettlementHistoryfetchTickerfetchTickers	fetchTimefetchTradesfetchTradingFeefetchTradingFeesfetchTransferfetchTransfersfetchVolatilityHistoryfetchWithdrawalsreduceMarginrepayCrossMarginrepayIsolatedMarginrepayMarginsetLeverage	setMarginsetMarginMode)setPositionModetransferwithdraw
timeframes1m5m15m30m1h2h4h6h8h12h1d)r   r   r   r   r   r   r   r   r   r   r   urlszOhttps://github.com/user-attachments/assets/d213155c-8c71-4701-9bd5-45351febc2a8zhttps://api.bitvavo.com)publicprivatezhttps://bitvavo.com/zhttps://docs.bitvavo.com/zhttps://bitvavo.com/en/feesz!https://bitvavo.com/?a=24F34952F7)logoapiwwwdocfeesreferralr   get         )costnoMarket)	timemarketsassetsz{market}/bookz{market}/tradesz{market}/candleszticker/pricezticker/bookz
ticker/24h)	accountorderorders
ordersOpentradesbalancedepositdepositHistorywithdrawalHistory)r   
withdrawalr   )r   r   )r   postputdeleter   tradingz0.0025z0.0020100000z0.0020250000z0.0016500000z0.00121000000z0.00102500000z0.00085000000z0.000610000000z0.000525000000z0.0004z0.0015z0.0003)takermaker)	tierBased
percentager   r   tiersrequiredCredentials)apiKeysecretfeatures)IOCFOKPOGTD)EXPIRE_MAKEREXPIRE_TAKEREXPIRE_BOTHNONE)
marginModetriggerPricetriggerPriceTypetriggerDirectionstopLossPricetakeProfitPriceattachedStopLossTakeProfittimeInForcehedgedtrailingleveragemarketBuyRequiresPricemarketBuyByCostselfTradePreventioniceberg  i )r   limitdaysBack	untilDayssymbolRequired)r   triggerr   r   )r   r   r   r   r   )r   r   r   r   r   r   r   r     )	sandboxrI   createOrdersr}   r   r   r   fetchClosedOrdersr~   )linearinverse)r<   r>   r?   
exceptions101102103104105107108109110200201202203204205206210211212213214215216217230231232233234235236240300301302303304305306307308309310311312315317400401402403)404405406407408409410411412413414)zstart parameter is invalidzsymbol parameter is invalidzamount parameter is invalidzorderId parameter is invalid)exactbroadoptionsi'  ETHTRX)ERC20TRC20EUR)currencyToPrecisionRoundingModeBITVAVO-ACCESS-WINDOWnetworks
operatorIdfiatCurrenciesprecisionModecommonCurrenciesMIOTAIOTA)deep_extendsuperr+   describeparse_numberr   r   r$   r   r%   r   r"   r    r#   r   r   r&   r!   r'   r(   )self	__class__s    T/home/james-whalen/.local/lib/python3.13/site-packages/ccxt/async_support/bitvavo.pyrX  bitvavo.describe    s\   gt = ? wB
)wB
IwB
 $wB
 	wB

 twB
 wB
 4wB
  jjj %j 	j
 %j %j Uj $Uj 'j j "4j tj $Uj  j tj  7!j" 9%#j$ &u%j& ('j( ')j* (+j, "4-j. T/j0 1j2 &u3j4 "55j6 +E7j8 )%9j: #E;j< ,U=j> '?j@ (AjB "4CjD &tEjF (GjH 1%IjJ  KjL *:MjN +DOjP &uQjR 'SjT (UjV #EWjX *5YjZ $U[j\ u]j^ "5_j` *5ajb +Ecjd )%ejf  gjh !%ijj %ekjl $Umjn &uojp -eqjr /sjt "5ujv #Ewjx +Eyjz {j| !%}j~ "5j@ &uAjB +ECjD  EjF dGjH $UIjJ +EKjL %eMjN "4OjP uQjR #ESjT dUjV !$WjX tYjZ  [j\ ']j^ $U_j` !%ajb *5cjd (ejf %egjh )%ijj )%kjl tmjn ojp Tqjr tsjt "5ujv #Dwjx  yjz !%{j| )%}j~ #Dj@ AjB #ECjD &uEjF uGjH uIjJ UKjL  MjN $)! SjwB
f gwB
@ i78 .25?
AwB
V  !#$"#)*+,,-()'(/0b&A
 $%!""#/0b&A"##$#$*+-.
 "#&'
   "#"#'&WwB
d !%"&!..x8!..w7 "..s3T5F5Fx5PQ!..x8$:K:KH:UV!..x8$:K:KH:UV!..x8$:K:KH:UV!..y94;L;LX;VW!..y94;L;LX;VW!..y94;L;LX;VW!..z:D<M<Mh<WX!..z:D<M<Mh<WX
" "..s3T5F5Fx5PQ!..x8$:K:KH:UV!..x8$:K:KH:UV!..x8$:K:KH:UV!..y94;L;LX;VW!..y94;L;LX;VW!..y94;L;LX;VW!..z:D<M<Mh<WX!..z:D<M<Mh<WX
"ewB
d "$ewB
l $&+(,,0,0)-+/6:#'#'"&#(	( #($)$)27+/,1,1+/$)	0 $)3$6 %)&+!%$*%+*.& ',#($)*.	# ',!%#($)*.( '+!%$*%+#($)*.$ *.#y?B ##
 ##KImwB
@	 @=@:@ ,@ ,	@
 +@ /@ /@ /@ :@ :@ :@ :@ 9@ :@ :@  :!@" <#@$ <%@& <'@( <)@* <+@, <-@. ,/@0 <1@2 =3@4 =5@6 :7@8 <9@: <;@< ==@> :?@@ =A@B .C@D .E@F .G@H .I@J .K@N .O@P .Q@R +S@T .U@V .W@X +Y@Z +[@\ +]@^ :_@` +a@b =c@d =e@f +g@h +i@j )(%(,)(%))(@D 3=3<3?4@	EHA	wB
R 3;)."" ##('	SwB
f YgwB
h !iwB
 w w	    c                 d   #    U R                  U5      I Sh  vN nU R                  US5      $  N7f)z
fetches the current integer timestamp in milliseconds from the exchange server
:param dict [params]: extra parameters specific to the exchange API endpoint
:returns int: the current integer timestamp in milliseconds from the exchange server
Nr   )publicGetTimesafe_integerrZ  paramsresponses      r\  
fetch_timebitvavo.fetch_time  s4      ++F33   622	 4s   0.0c                 b   #    U R                  U5      I Sh  vN nU R                  U5      $  N7f)z

https://docs.bitvavo.com/#tag/General/paths/~1markets/get

retrieves data on all markets for bitvavo
:param dict [params]: extra parameters specific to the exchange API endpoint
:returns dict[]: an array of objects representing market data
N)publicGetMarketsparse_marketsrb  s      r\  fetch_marketsbitvavo.fetch_markets  s2      ..v66( !!(++) 7   /-/c                    / nU R                   n[        S[        U5      5       GH  nX   nU R                  US5      nU R                  US5      nU R                  US5      nU R	                  U5      n	U R	                  U5      n
U R                  US5      nUR                  U R                  0 SU_SU	S-   U
-   _SU	_SU
_S	S _S
U_SU_SS _SS_SS_SS_SS_SS_SS_SUS:H  _SS_SS _S S S S S S US   S   US   S   U R                  U R                  U R                  US5      5      5      U R                  US5      U R                  U R                  U R                  US5      5      5      S.S S S.U R                  US 5      U R                  US!5      S.S S S.U R                  US"5      U R                  US#5      S.S$.S US%.E5      5        GM     U$ )&Nr   marketbasequotestatusr/   symbol/settlebaseIdquoteIdsettleIdtyper<   Tr=   Fr>   r?   r@   activer   contractr  r   r   quantityDecimalstickSizenotionalDecimals)amountpricer   minmaxminOrderInBaseAssetmaxOrderInBaseAssetminOrderInQuoteAssetmaxOrderInQuoteAsset)r   r~  r  r   )r  contractSizeexpiryexpiryDatetimestrike
optionTyper   r   	precisionlimitscreatedinfo)
r   rangelensafe_stringsafe_currency_codeappendsafe_market_structurerY  parse_precisionsafe_number)rZ  r   resultr   irn  r/   ru  rv  ro  rp  rq  s               r\  ri  bitvavo.parse_markets  s   yyq#g,'AZF!!&(3B%%ff5F&&vw7G**62D++G4E%%fh7FMM$44 36b36$*u,36 36 	36
 $36 &36 736 D36 36 36 %36 36 %36 %36 6Y.36  E!36" $#36$   $"&"i1i1"//0D0DTEUEUV\^pEq0rs!--fjA --d.B.B4CSCSTZ\nCo.pq  $#!
  $//8MN#//8MN
  $#
  $//8NO#//8NO$  e36 3 3 (x r^  c                 b   #    U R                  U5      I Sh  vN nU R                  U5      $  N7f)z

https://docs.bitvavo.com/#tag/General/paths/~1assets/get

fetches all available currencies on an exchange
:param dict [params]: extra parameters specific to the exchange API endpoint
:returns dict: an associative dictionary of currencies
N)publicGetAssetsparse_currencies_customrb  s      r\  fetch_currenciesbitvavo.fetch_currencies  s4      --f55D ++H55E 6rl  c                 F   U R                  U R                  S/ 5      n0 n[        S[        U5      5       GHg  nX   nU R	                  US5      nU R                  U5      nU R                  Xr5      n0 n	U R                  US/ 5      n
U R	                  US5      S:H  nU R	                  US5      S:H  nU=(       a    UnU R                  US5      nU R	                  US	S
5      nU R                  US5      n[        S[        U
5      5       HK  nU
U   nU R                  U5      nUUUUUUUU R                  U R                  U5      5      SUS S.0S.	U	U'   MM     U R                  UUUU R	                  US5      UUUU	US U(       a  SOSS S S.S S S.US S.S.S.5      X7'   GMj     U$ )NrQ  r   rr  rO  depositStatusOKwithdrawalStatuswithdrawalFeedecimals8withdrawalMinAmountr   r  )	r  r/   networkry  r   r   feer  r  r0   fiatcrypto)r~  r   r   )r  r/   coder0   ry  r   r   rO  r  r  rx  r  )	safe_listrG  r  r  r  r  in_arrayr  network_id_to_coderY  r  safe_currency_structure)rZ  
currenciesrQ  r  r  currencyr/   r  isFiatrO  networksArrayr   r   ry  withdrawFeer  minWithdrawj	networkIdnetworkCodes                       r\  r  bitvavo.parse_currencies_custom3  s   D 6FKq#j/*A!}H!!(H5B**2.D]]48FH NN8ZDM&&xATIG))(4FG4OJ+F**8_EK((:sCI**85JKK1c-01)!,	"55i@$#*$& *&!%!2!243G3G	3R!S"#.#'%)% 2&  77 ((6: "&$"!"(h  $#
  $# 
  +#!9 FLC +x r^  rr  c                    #    U R                  5       I Sh  vN   U R                  U5      nSUS   0nU R                  U R                  XB5      5      I Sh  vN nU R	                  XS5      $  NU N7f)a  

https://docs.bitvavo.com/#tag/Market-Data/paths/~1ticker~124h/get

fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market
:param str symbol: unified symbol of the market to fetch the ticker for
:param dict [params]: extra parameters specific to the exchange API endpoint
:returns dict: a `ticker structure <https://docs.ccxt.com/#/?id=ticker-structure>`
Nrn  r/   )load_marketsrn  publicGetTicker24hextendparse_ticker)rZ  rr  rc  rn  requestrd  s         r\  fetch_tickerbitvavo.fetch_ticker  ss      !!!V$fTl
 00W1MNN"   22- 	"
 Os!   A0A,?A0A.A0.A0Ntickerrn  c                 r   U R                  US5      nU R                  X2S5      nU R                  US5      nU R                  US5      nU R                  US5      nU R                  US5      nU R                  US5      n	U R                  0 SU_SU_S	U R	                  U5      _S
U R                  US
5      _SU R                  US5      _SU R                  US5      _SU R                  US5      _SU R                  US5      _SU R                  US5      _SS _SU	_SU_SU_SS _SS _SS _SS _UUUS.EU5      $ )Nrn  -	timestamplastvolumevolumeQuoteopenrr  datetimehighlowbid	bidVolumebidSizeask	askVolumeaskSizevwapclosepreviousClosechanger   average)
baseVolumequoteVolumer  )r  safe_symbolra  safe_tickeriso8601)
rZ  r  rn  marketIdrr  r  r  r  r  r  s
             r\  r  bitvavo.parse_ticker  s   & ##FH5!!(C8%%fk:	/%%fh7
&&v}=/ !
f!
!
 Y/!
 D$$VV4	!

 4##FE2!
 4##FE2!
 ))&)<!
 4##FE2!
 ))&)<!
 D!
 D!
 T!
 D!
 T!
 d!
  $!!
" t#!
$ %&)!
* + 	r^  symbolsc                    #    U R                  5       I Sh  vN   U R                  U5      I Sh  vN nU R                  X15      $  N. N7f)a  
fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market
:param str[]|None symbols: unified symbols of the markets to fetch the ticker for, all market tickers are returned if not assigned
:param dict [params]: extra parameters specific to the exchange API endpoint
:returns dict: a dictionary of `ticker structures <https://docs.ccxt.com/#/?id=ticker-structure>`
N)r  r  parse_tickers)rZ  r  rc  rd  s       r\  fetch_tickersbitvavo.fetch_tickers  sG      !!!0088& !!(44) 	"8   A	AA	AA	A	sincer   c                   #    U R                  5       I Sh  vN   U R                  U5      nSnU R                  USS5      u  pdU(       a  U R                  SXX45      I Sh  vN $ SUS   0nUb  [	        US5      US'   Ub  X'S	'   U R                  S
Xt5      u  ptU R                  U R                  Xt5      5      I Sh  vN nU R                  XX#5      $  N Nt N7f)a  

https://docs.bitvavo.com/#tag/Market-Data/paths/~1{market}~1trades/get

get the list of most recent trades for a particular symbol
:param str symbol: unified symbol of the market to fetch trades for
:param int [since]: timestamp in ms of the earliest trade to fetch
:param int [limit]: the maximum amount of trades to fetch
:param dict [params]: extra parameters specific to the exchange API endpoint
:param int [params.until]: the latest time in ms to fetch entries for
: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 Trade[]: a list of `trade structures <https://docs.ccxt.com/#/?id=public-trades>`
NFr   paginatern  r/   r   r   startend)	r  rn  handle_option_and_paramsfetch_paginated_call_dynamicr  handle_until_optionpublicGetMarketTradesr  parse_trades)	rZ  rr  r  r   rc  rn  r  r  rd  s	            r\  fetch_tradesbitvavo.fetch_trades  s      !!!V$88PZ[::=&Y^gggfTl
 "5$/GG$G225'J33DKK4PQQ   5@@? 	"
 h Rs5   CCA	C C!AC<C=CCCtradec                 D   U R                  US5      nU R                  US5      nU R                  US5      nU R                  US5      nU R                  USS5      nU R                  US5      nU R                  XS5      n	U R	                  US	5      n
S nU
b  U
(       a  S	OS
nU R                  US5      nS nUb(  U R                  US5      nU R                  U5      nUUS.nU R                  US5      nU R                  UUU	UU R                  U5      US UUUUS US.U5      $ )Nr  r~  r  sider/   fillIdrn  r  r   r   r  feeCurrencyr   r  orderId)r  r/   rr  r  r  r   rx  r  takerOrMakerr  r~  r   r  )r  ra  safe_string_2r  
safe_valuer  
safe_trader  )rZ  r  rn  priceStringamountStringr  r  r/   r  rr  r   r  feeCostStringr  feeCurrencyIdfeeCurrencyCoder  s                    r\  parse_tradebitvavo.parse_trade4  sT   r &&ug6''x8%%e[9	v.tX6##E84!!(C8w/&+7L((6$ ,,UMBM"55mDO%+C ""5)4"Y/( " 
  	r^  c                    #    U R                  5       I Sh  vN   U R                  U5      I Sh  vN nU R                  U5      $  N. N7f)a,  

https://docs.bitvavo.com/#tag/Account/paths/~1account/get

fetch the trading fees for multiple markets
:param dict [params]: extra parameters specific to the exchange API endpoint
:returns dict: a dictionary of `fee structures <https://docs.ccxt.com/#/?id=fee-structure>` indexed by market symbols
N)r  privateGetAccountparse_trading_feesrb  s      r\  fetch_trading_feesbitvavo.fetch_trading_fees  sG      !!!//77 &&x00 	"7r  c                     U R                  US5      nU R                  US5      nU R                  US5      n0 n[        S[        U R                  5      5       H  nU R                  U   nUUUUSSS.Xh'   M     U$ )Nr   r   r   r   T)r  rr  r   r   r   r   )r  r  r  r  r  )	rZ  r   rn  	feesValuer   r   r  r  rr  s	            r\  r  bitvavo.parse_trading_fees  s     OOD&1	  G4  G4q#dll+,A\\!_F "!FN - r^  c                 &  #    U R                  5       I Sh  vN   U R                  U5      nSUS   0nUb  X%S'   U R                  U R                  XS5      5      I Sh  vN nU R	                  XdS   5      nU R                  US5      US'   U$  Nv N17f)a
  

https://docs.bitvavo.com/#tag/Market-Data/paths/~1{market}~1book/get

fetches information on open orders with bid(buy) and ask(sell) prices, volumes and other data
:param str symbol: unified symbol of the market to fetch the order book for
:param int [limit]: the maximum amount of order book entries to return
:param dict [params]: extra parameters specific to the exchange API endpoint
:returns dict: A dictionary of `order book structures <https://docs.ccxt.com/#/?id=order-book-structure>` indexed by market symbols
Nrn  r/   depthrr  nonce)r  rn  publicGetMarketBookr  parse_order_bookra  )rZ  rr  r   rc  rn  r  rd  	orderbooks           r\  fetch_order_bookbitvavo.fetch_order_book  s      !!!V$fTl
 $G11$++g2NOO" ))(84DE	!..xA	'5 	" Ps"   BBABB0BBc           	          U R                  US5      U R                  US5      U R                  US5      U R                  US5      U R                  US5      U R                  US5      /$ )Nr   r            r   )ra  r  )rZ  ohlcvrn  s      r\  parse_ohlcvbitvavo.parse_ohlcv  sn     eQ'UA&UA&UA&UA&UA&
 	
r^  r   c                 H   U R                  U5      nUS   U R                  U R                  X"5      S.nUbA  U R                  U5      nX7S'   Uc  SnO[	        US5      nU R                  X4U-  S-  5      US'   U R                  SXu5      u  puUb  XGS'   U R                  Xu5      $ )Nr/   )rn  intervalr  r   r   r  r   )rn  r  r   parse_timeframer  sumr  r  )	rZ  rr  	timeframer  r   rc  rn  r  durations	            r\  fetch_ohlcv_requestbitvavo.fetch_ohlcv_request  s    V$Tl(()O
 ++I6H$G}E4(!XXeX-=-DEGEN225'J$G{{7++r^  c           	      \  #    U R                  5       I Sh  vN   U R                  U5      nSnU R                  USS5      u  puU(       a  U R                  SXXBUS5      I Sh  vN $ U R	                  XX4U5      nU R                  U5      I Sh  vN n	U R                  XX#U5      $  N NE N7f)a  

https://docs.bitvavo.com/#tag/Market-Data/paths/~1{market}~1candles/get

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]: the maximum amount of candles to fetch
:param dict [params]: extra parameters specific to the exchange API endpoint
:param int [params.until]: the latest time in ms to fetch entries for
: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 int[][]: A list of candles ordered, open, high, low, close, volume
NFr~   r  r   )r  rn  r  "fetch_paginated_call_deterministicr!  publicGetMarketCandlesparse_ohlcvs)
rZ  rr  r  r  r   rc  rn  r  r  rd  s
             r\  fetch_ohlcvbitvavo.fetch_ohlcv  s      !!!V$88zZ@@v^cpvx|}}}**6eFS44W==   9UKK 	"
 ~=s4   B,B&AB,"B(#+B,B*B,(B,*B,c                 2   US S S.n[        S[        U5      5       Hh  nX   nU R                  US5      nU R                  U5      nU R	                  5       nU R                  US5      US'   U R                  US5      US'   XrU'   Mj     U R                  U5      $ )N)r  r  r  r   rr  	availablefreeinOrderused)r  r  r  r  r   safe_balance)rZ  rd  r  r  r   
currencyIdr  r   s           r\  parse_balancebitvavo.parse_balance4  s    

 q#h-(AkG))'8<J**:6DllnG"..wDGFO"..w	BGFO"4L )   ((r^  c                    #    U R                  5       I Sh  vN   U R                  U5      I Sh  vN nU R                  U5      $  N. N7f)a=  

https://docs.bitvavo.com/#tag/Account/paths/~1balance/get

query for balance and get the amount of funds available for trading or funds locked in orders
:param dict [params]: extra parameters specific to the exchange API endpoint
:returns dict: a `balance structure <https://docs.ccxt.com/#/?id=balance-structure>`
N)r  privateGetBalancer0  rb  s      r\  fetch_balancebitvavo.fetch_balanceD  sG      !!!//77 !!(++ 	"7r  r  c                 <  #    U R                  5       I Sh  vN   U R                  U5      nSUS   0nU R                  U R                  XB5      5      I Sh  vN nU R	                  US5      nU R	                  US5      nU R                  U5        UUSUUS.$  N NC7f)a  
fetch the deposit address for a currency associated with self account
: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>`
Nrr  r/   address	paymentId)r  r  r  r7  tag)r  r  privateGetDepositr  r  check_address)rZ  r  rc  r  r  rd  r7  r9  s           r\  fetch_deposit_addressbitvavo.fetch_deposit_addressZ  s      !!!==&htn
 //G0LMM ""8Y7x57#
 	
 	"
 Ns"   BB?BBABBrx  r  r~  r  c                    U R                  U5      nUS   UUS.nUS:H  =(       d    US:H  =(       d    US:H  n	US:H  =(       d    US:H  =(       d    US:H  n
U R                  US	5      nU R                  U/ S
Q5      nU R                  U	SU5      nU R	                  US5      nU R	                  US5      nU R                  U/ SQ5      nU	(       a  S nUbK  U R                  U5      nU R                  U5      n[        R                  " UU5      nU R                  U5      nOU R                  US5      nUb=  U R                  US   5      S   nU R                  U[        UU R                  5      US'   OU R                  X5      US'   U R                  US/5      nO/U
(       a(  U R!                  X5      US'   U R                  X5      US'   US L=(       d    US:H  =(       d    US:H  nUS L=(       d*    US L=(       a    U(       + =(       d    US:H  =(       d    US:H  nU(       a  Ub  UnU	(       a  SOSUS'   OU(       a  Ub  UnU	(       a  SOSUS'   Ub  U R!                  X5      US'   SUS'   SUS'   Ub
  US:w  a  XS	'   U(       a  SUS'   S nU R#                  USS5      u  nnUb  U R%                  U5      US'   O['        U R(                  S-   5      eS nU R#                  USS 5      u  nnUb  US!:X  a  S"US '   OUUS '   U R+                  X5      $ )#Nr/   )rn  r  	orderTypern  stopLoss
takeProfitr   stopLossLimittakeProfitLimitr   r   	stopPricetriggerAmountFr   r   )r   r   rE  r   r   r   rp  r  amountQuoter~  r  r?  rF  triggerType	lastTradetriggerReferencer   TpostOnlyrI   rP  zk createOrder() requires an operatorId in params or options, eg: exchange.options['operatorId'] = 1234567890r   r   
cancelBoth)rn  r  safe_string_nis_post_onlyr  omitnumber_to_stringr)   
string_mulrY  r  r  decimal_to_precisionr'   rR  amount_to_precisionprice_to_precisionr  parse_to_intr   r/   r  )rZ  rr  rx  r  r~  r  rc  rn  r  isMarketOrderisLimitOrderr   r   rK  r   r   r   r  r  quoteAmountr  isTakeProfit
isStopLossrP  r   s                            r\  create_order_requestbitvavo.create_order_requestx  sg   V$Tl

 )\tz/A\t|G[dT_-Dd$RcJc&&v}=))&2`a$$]E6B@//&2CD6#stD "33E:#44V<%00{K((5''7 MM&/:;G	)-)B)B4S\^b^p^p)q&$($<$<V$L!YYvx0F#66vEGG $ 8 8 HGH't3m9MmSW[lSl#4/  [\5M4eXdTd  [jnr|j|  [  CG  KZ  CZ
(,1>:OGK *.3@<FWGK #'+'>'>v'TGO$%,GM"*5G&'#+*=%0M""&GJ
!::6=R^_
F!$($5$5j$AGL!#DGG  /^  %^  _  _"&*&C&CFM[p&q#V*"m31=-.1D-.{{7++r^  c                    #    U R                  5       I Sh  vN   U R                  U5      nU R                  XX4XV5      nU R                  U5      I Sh  vN n	U R	                  X5      $  NR N7f)a  
create a trade order

https://docs.bitvavo.com/#tag/Trading-endpoints/paths/~1order/post

: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 bitvavo api endpoint
:param str [params.timeInForce]: "GTC", "IOC", or "PO"
:param float [params.stopPrice]: Alias for triggerPrice
:param float [params.triggerPrice]: The price at which a trigger order is triggered at
:param bool [params.postOnly]: If True, the order will only be posted to the order book and not executed immediately
:param float [params.stopLossPrice]: The price at which a stop loss order is triggered at
:param float [params.takeProfitPrice]: The price at which a take profit order is triggered at
:param str [params.triggerType]: "price"
:param str [params.triggerReference]: "lastTrade", "bestBid", "bestAsk", "midPrice" Only for stop orders: Use self to determine which parameter will trigger the order
:param str [params.selfTradePrevention]: one of EXPIRE_BOTH, cancelOldest, cancelNewest or decrementAndCancel
:param bool [params.disableMarketProtection]: don't cancel if the next fill price is 10% worse than the best fill price
:param bool [params.responseRequired]: Set self to 'false' when only an acknowledgement of success or failure is required, self is faster.
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
N)r  rn  r[  privatePostOrderparse_order)
rZ  rr  rx  r  r~  r  rc  rn  r  rd  s
             r\  create_orderbitvavo.create_order  sm     2 !!!V$++F$V..w77R 11Y 	" 8s!   A-A)<A-A+A-+A-r/   c                    0 nU R                  U5      n	U R                  US5      n
U R                  U/ SQ5      nU R                  U/ SQ5      nUb  U R	                  X&5      US'   Ub  U R                  X%5      US'   U
b  U R                  X*5      US'   Ub  U R	                  X+5      US'   U R                  X5      nU R                  U5      (       a  [        U R                  S-   5      eU R                  US5      nUc  XS	'   S nU R                  US
S5      u  pUb  U R                  U5      US'   O[        U R                  S-   5      eU	S   US'   U$ )NamountRemainingrD  )rc  r   rE  rF  r  r~  rF  zR editOrder() requires an amount argument, or a price argument, or non-empty paramsclientOrderIdr  rQ   rP  zi editOrder() requires an operatorId in params or options, eg: exchange.options['operatorId'] = 1234567890r/   rn  )rn  r  rM  rO  rT  rS  r  is_emptyr   r/   r  r  rU  )rZ  r/   rr  rx  r  r~  r  rc  r  rn  rc  r   rd  rP  s                 r\  edit_order_requestbitvavo.edit_order_request  s   V$**63DE))&2`a6#de#66vEGG $ 8 8 HGH&)-)A)A&)ZG%&#'+'>'>v'TGO$++g.==!!#DGG  /C  %C  D  D((A !#I
!::6;P\]
!$($5$5j$AGL!#DGG  /\  %\  ]  ]"4Lr^  c           	         #    U R                  5       I Sh  vN   U R                  U5      nU R                  XX4XVU5      n	U R                  U	5      I Sh  vN n
U R	                  X5      $  NS N7f)an  
edit a trade order

https://docs.bitvavo.com/#tag/Orders/paths/~1order/put

:param str id: cancel 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 bitvavo api endpoint
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
N)r  rn  rf  privatePutOrderr_  )rZ  r/   rr  rx  r  r~  r  rc  rn  r  rd  s              r\  
edit_orderbitvavo.edit_order  sl      !!!V$))"d&QWX--g6611	 	" 7s!   A.A*=A.A,A.,A.c                 J   Uc  [        U R                  S-   5      eU R                  U5      nSUS   0nU R                  US5      nUc  XS'   S nU R	                  USS5      u  psUb  U R                  U5      US'   O[        U R                  S-   5      eU R                  XS5      $ )	Nz) cancelOrder() requires a symbol argumentrn  r/   rd  r  rF   rP  zk cancelOrder() requires an operatorId in params or options, eg: exchange.options['operatorId'] = 1234567890)r   r/   rn  r  r  rU  r  )rZ  r/   rr  rc  rn  r  rd  rP  s           r\  cancel_order_requestbitvavo.cancel_order_request3  s    >#DGG.Y$YZZV$fTl
 ((A !#I
!::6=R^_
!$($5$5j$AGL!#DGG  /^  %^  _  _{{7++r^  c                    #    U R                  5       I Sh  vN   U R                  U5      nU R                  XU5      nU R                  U5      I Sh  vN nU R	                  Xd5      $  NQ N7f)a  

https://docs.bitvavo.com/#tag/Orders/paths/~1order/delete

cancels an open order

https://docs.bitvavo.com/#tag/Trading-endpoints/paths/~1order/delete

:param str id: order id
:param str symbol: unified symbol of the market the order was made in
:param dict [params]: extra parameters specific to the exchange API endpoint
:returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
N)r  rn  rm  privateDeleteOrderr_  )rZ  r/   rr  rc  rn  r  rd  s          r\  cancel_orderbitvavo.cancel_orderE  si      !!!V$++B?0099 11 	" :s!   A,A(;A,A*A,*A,c                   #    U R                  5       I Sh  vN   0 nSnUb  U R                  U5      nUS   US'   SnU R                  USS5      u  pRUb  U R                  U5      US'   O[	        U R
                  S-   5      eU R                  U R                  X25      5      I Sh  vN nU R                  Xd5      $  N N7f)aw  

https://docs.bitvavo.com/#tag/Orders/paths/~1orders/delete

cancel all open orders
:param str symbol: unified market symbol, only orders in the market of self symbol are cancelled when symbol is not None
:param dict [params]: extra parameters specific to the exchange API endpoint
:returns dict[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
Nr/   rn  rE   rP  zn canceAllOrders() requires an operatorId in params or options, eg: exchange.options['operatorId'] = 1234567890)	r  rn  r  rU  r   r/   privateDeleteOrdersr  parse_orders)rZ  rr  rc  r  rn  rP  rd  s          r\  cancel_all_ordersbitvavo.cancel_all_orders^  s      !!![[(F &tGH
!::6CTVbc
!$($5$5j$AGL!#DGG  /a  %a  b  b11$++g2NOO   22) 	" Ps"   B?B;BB?%B=&B?=B?c                 L  #    Uc  [        U R                  S-   5      eU R                  5       I Sh  vN   U R                  U5      nSUS   0nU R	                  US5      nUc  XS'   U R                  U R                  XS5      5      I Sh  vN nU R                  Xt5      $  Nn N7f)aw  
fetches information on an order made by the user

https://docs.bitvavo.com/#tag/Trading-endpoints/paths/~1order/get

: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
:returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
Nz( fetchOrder() requires a symbol argumentrn  r/   rd  r  )r   r/   r  rn  r  privateGetOrderr  r_  )rZ  r/   rr  rc  rn  r  rd  rd  s           r\  fetch_orderbitvavo.fetch_order~  s      >#DGG.X$XYY!!!V$fTl
 ((A !#I--dkk'.JKKF 11W 	" Ls"   /B$B AB$
B"B$"B$c                     U R                  U5      nSUS   0nUb  X&S'   Ub  X6S'   U R                  SXd5      u  pdU R                  Xd5      $ Nrn  r/   r  r   r  rn  r  r  rZ  rr  r  r   rc  rn  r  s          r\  fetch_orders_requestbitvavo.fetch_orders_request  a    V$fTl
 $G$G225'J{{7++r^  c                   #    Uc  [        U R                  S-   5      eU R                  5       I Sh  vN   SnU R                  USS5      u  pTU(       a  U R	                  SXX45      I Sh  vN $ U R                  U5      nU R                  XX45      nU R                  U5      I Sh  vN nU R                  XX#5      $  N NT N7f)a*  

https://docs.bitvavo.com/#tag/Trading-endpoints/paths/~1orders/get

fetches information on multiple orders made by the user
:param str symbol: unified market symbol of the market orders were made in
:param int [since]: the earliest time in ms to fetch orders for
:param int [limit]: the maximum number of order structures to retrieve
:param dict [params]: extra parameters specific to the exchange API endpoint
:param 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)
:param int [params.until]: the latest time in ms to fetch entries for
:returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
Nz) fetchOrders() requires a symbol argumentFr   r  )	r   r/   r  r  r  rn  r  privateGetOrdersru  	rZ  rr  r  r   rc  r  rn  r  rd  s	            r\  fetch_ordersbitvavo.fetch_orders  s      >#DGG.Y$YZZ!!!88PZ[::=&Y^gggV$++F5I..w77J   5@@Y 	" h 83   /CB=8C*B?+;C&C'C?CCc                    #    U R                  5       I Sh  vN   0 nSnUb  U R                  U5      nUS   US'   U R                  U R                  XT5      5      I Sh  vN nU R	                  XvX#5      $  N^ N7f)a  

https://docs.bitvavo.com/#tag/Trading-endpoints/paths/~1ordersOpen/get

fetch all unfilled currently open orders
:param str symbol: unified market symbol
:param int [since]: the earliest time in ms to fetch open orders for
:param int [limit]: the maximum number of  open orders structures to retrieve
:param dict [params]: extra parameters specific to the exchange API endpoint
:returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
Nr/   rn  )r  rn  privateGetOrdersOpenr  ru  )rZ  rr  r  r   rc  r  rn  rd  s           r\  fetch_open_ordersbitvavo.fetch_open_orders  s      !!!
 [[(F &tGH224;;w3OPPJ   5@@[ 	" Qs"   A9A5AA9A7A97A9rq  c                 F    SSSSSSSSSSSSSS.nU R                  X!U5      $ )Nr  canceledclosed)newr  canceledAuctioncanceledSelfTradePreventioncanceledIOCcanceledFOKcanceledMarketProtectioncanceledPostOnlyfilledpartiallyFilledexpiredrejectedawaitingTriggerr  rZ  rq  statusess      r\  parse_order_statusbitvavo.parse_order_statusB  sE    ")+5%%(2 *%!"%
 &99r^  r   c                    U R                  US5      nU R                  US5      nU R                  US5      nU R                  XRS5      nUS   nU R                  U R                  US5      5      nU R                  US5      nU R                  US5      n	U R                  US	5      n
U R                  US
5      nU R                  US5      nU R                  US5      nU R                  US5      nUc;  U R                  US5      nU R                  US5      n[        R
                  " UU5      nS nU R                  US5      nUb(  U R                  US5      nU R                  U5      nUUS.nU R                  US/ 5      nU R                  US5      nU R                  US5      nU R                  0 SU_SU_SS _SU_SU R                  U5      _SS _SU_SU	_SU_SU_SU_S	U
_SU R                  US5      _S
U_SU_SS _S U_UUUUS!.EU5      $ )"Nr  r  rn  r  rr  rq  r  r?  r  r~  rc  filledAmountfilledAmountQuoterG  amountQuoteRemainingfeePaidr  r  fillsr   rK  r  r/   rd  r  r  lastTradeTimestamprx  r   r   r  r  )	remainingrq  r  r   )r  ra  safe_marketr  r)   
string_subr  r  r  
safe_orderr  )rZ  r   rn  r/   r  r  rr  rq  r  rx  r  r~  r  r  r   rG  r  r  feeCostr   r  	rawTradesr   rK  s                           r\  r_  bitvavo.parse_orderT  s   \ eY/%%eY7	##E84!!(C8!(()9)9%)JKv.{3  0!!%2$$U,=>	!!%8':;<**5-@K#'#3#3E;Q#R %%k3GHD""5)4 ,,UMBM"55mDO+C OOE7B7	&&um<??5*5  
E 
" 
 T 
 	 

 Y/ 
 !$ 
 f 
 D 
 ; 
  
 D 
 U 
 D,,UNC 
 f 
 D 
  t! 
" f# 
$ #+ 
, - 	r^  c                     U R                  U5      nSUS   0nUb  X&S'   Ub  X6S'   U R                  SXd5      u  pdU R                  Xd5      $ r}  r~  r  s          r\  fetch_my_trades_requestbitvavo.fetch_my_trades_request  r  r^  c                   #    Uc  [        U R                  S-   5      eU R                  5       I Sh  vN   SnU R                  USS5      u  pTU(       a  U R	                  SXX45      I Sh  vN $ U R                  U5      nU R                  XX45      nU R                  U5      I Sh  vN nU R                  XX#5      $  N NT N7f)a  

https://docs.bitvavo.com/#tag/Trading-endpoints/paths/~1trades/get

fetch all trades made by the user
:param str symbol: unified market symbol
:param int [since]: the earliest time in ms to fetch trades for
:param int [limit]: the maximum number of trades structures to retrieve
:param dict [params]: extra parameters specific to the exchange API endpoint
:param int [params.until]: the latest time in ms to fetch entries for
: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 Trade[]: a list of `trade structures <https://docs.ccxt.com/#/?id=trade-structure>`
Nz+ fetchMyTrades() requires a symbol argumentFr}   r  )	r   r/   r  r  r  rn  r  privateGetTradesr  r  s	            r\  fetch_my_tradesbitvavo.fetch_my_trades  s      >#DGG.[$[\\!!!88R\]::?F[`iiiV$..veL..w77$   5@@3 	" j 8r  c                     U R                  U5      nUS   U R                  X5      US.nUb  XGS'   U R                  Xu5      $ )Nr/   )rr  r~  r7  r8  )r  currency_to_precisionr  )rZ  r  r~  r7  r9  rc  r  r  s           r\  withdraw_requestbitvavo.withdraw_request  sM    ==&tn00>
 ?#&K {{7++r^  r7  r9  c                 &  #    U R                  XE5      u  pEU R                  U5        U R                  5       I Sh  vN   U R                  U5      nU R	                  XX4U5      nU R                  U5      I Sh  vN nU R                  X5      $  NR N7f)aO  
make a withdrawal
: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)handle_withdraw_tag_and_paramsr;  r  r  r  privatePostWithdrawalparse_transaction)	rZ  r  r~  r7  r9  rc  r  r  rd  s	            r\  r   bitvavo.withdraw  s      99#F7#!!!==&''gFK33G<< %%h99 	" =s!   8BB<B7B8BBc                     0 nS nUb  U R                  U5      nUS   US'   Ub  X%S'   Ub  X5S'   U R                  XT5      $ Nr/   rr  r  r   r  r  rZ  r  r  r   rc  r  r  s          r\  fetch_withdrawals_request!bitvavo.fetch_withdrawals_request  ]    
 }}T*H (GH$G$G{{7++r^  c                    #    U R                  5       I Sh  vN   U R                  XX45      nSnUb  U R                  U5      nU R                  U5      I Sh  vN nU R	                  XvX#SS05      $  NZ N7f)a  

https://docs.bitvavo.com/#tag/Account/paths/~1withdrawalHistory/get

fetch all withdrawals made from an account
: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 bitvavo api endpoint
:returns dict[]: a list of `transaction structures <https://docs.ccxt.com/#/?id=transaction-structure>`
Nrx  r   )r  r  r  privateGetWithdrawalHistoryparse_transactionsrZ  r  r  r   rc  r  r  rd  s           r\  fetch_withdrawalsbitvavo.fetch_withdrawals+  s      !!!00eL}}T*H99'BB &&x5&R^I_``) 	"
 C"   A5A1A A5A3A53A5c                     0 nS nUb  U R                  U5      nUS   US'   Ub  X%S'   Ub  X5S'   U R                  XT5      $ r  r  r  s          r\  fetch_deposits_requestbitvavo.fetch_deposits_requestM  r  r^  c                    #    U R                  5       I Sh  vN   U R                  XX45      nSnUb  U R                  U5      nU R                  U5      I Sh  vN nU R	                  XvX#SS05      $  NZ N7f)a  

https://docs.bitvavo.com/#tag/Account/paths/~1depositHistory/get

fetch all deposits made to an account
: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 bitvavo api endpoint
:returns dict[]: a list of `transaction structures <https://docs.ccxt.com/#/?id=transaction-structure>`
Nrx  r   )r  r  r  privateGetDepositHistoryr  r  s           r\  fetch_depositsbitvavo.fetch_deposits^  s      !!!--d5I}}T*H66w?? &&x5&R[I\]]% 	"
 @r  c           
      >    SSSSSSSSSS.	nU R                  X!U5      $ )Npendingokr  )	awaiting_processingawaiting_email_confirmationawaiting_bitvavo_inspectionapprovedsending
in_mempool	processed	completedr  r  r  s      r\  parse_transaction_status bitvavo.parse_transaction_status~  s9    #,+4+4! #""

 &99r^  transactionr  c                 4   S nU R                  US5      nU R                  US5      nU R                  XR5      nU R                  U R                  US5      5      nU R	                  US5      nU R                  US5      n	U R                  US5      n
S nU R	                  US5      nUb  UUS.nS nS	U;   d  SU;   a  S
nOSnU R                  US5      n0 SU_SU_SU
_SU_SU R                  U5      _SS _SU	_SU	_SS _SU_SU_SU_SU_SU_SU_SS _SU_S S S S.E$ )Nr  rr  rq  r~  r7  txIdr  r  successr   r   r8  r  r/   txidr  addressFrom	addressTotagFromr9  tagTorx  r  updated)r  commentinternal)ra  r  r  r  r  r  )rZ  r  r  r/   r  r/  r  rq  r~  r7  r  r  r  rx  r9  s                  r\  r  bitvavo.parse_transaction  s   D %%k;?	%%k8<
&&z<..t/?/?X/VW!!+x8"";	:V4"";6 C $){*BDD{K8
K
"
 D
 	

 Y/
 4
 w
 
 t
 3
 S
 D
 f
 
 f
  t!
" 3#
$ )
 	
r^  c                     UU R                  US5      SS.U R                  US5      SS.0 S.nU R                  US5      nU R                  US5      nU R                  US5      nUS	:X  a  UnU R                  XV5      nUS
   US   S.US   U'   U$ )Nr  F)r  r   
depositFee)r  r   r   rO  rO  r   r  Mainnetr   r   )r   r   )r  r  r  r  )rZ  r  r  r  rO  r  currencyCoder  s           r\  parse_deposit_withdraw_fee"bitvavo.parse_deposit_withdraw_fee  s    & ''_=#
 ''\:# 
 ??3
3OOHa0	''&9	!$I--iFi(z*+
z;' r^  codesc                    #    U R                  5       I Sh  vN   U R                  U5      I Sh  vN nU R                  X1S5      $  N/ N7f)a7  
fetch deposit and withdraw fees

https://docs.bitvavo.com/#tag/General/paths/~1assets/get

:param str[]|None codes: list of unified currency codes
:param dict [params]: extra parameters specific to the exchange API endpoint
:returns dict: a list of `fee structures <https://docs.ccxt.com/#/?id=fee-structure>`
Nrr  )r  r  parse_deposit_withdraw_fees)rZ  r  rc  rd  s       r\  fetch_deposit_withdraw_fees#bitvavo.fetch_deposit_withdraw_fees  sI      !!!--f55( //JJ+ 	"5s   A
AA
AA
A
r   GETc                    U R                  X@R                  U5      5      nSU R                  -   S-   U R                  X5      -   nUS:H  =(       d    US:H  n	U	(       a  U(       a  USU R	                  U5      -   -  nUS:X  a  U R                  5         Sn
U	(       d  U(       a  U R                  U5      nUn
[        U R                  5       5      nX-   U-   U
-   nU R                  U R                  U5      U R                  U R                  5      [        R                  5      nU R                  U R                  SS5      nU R                   UUUS	.nU	(       d  S
US'   U R"                  S   U   U-   nXXeS.$ )Nrs  r  DELETE?r    rN  10000)zBITVAVO-ACCESS-KEYzBITVAVO-ACCESS-SIGNATUREzBITVAVO-ACCESS-TIMESTAMPrN  zapplication/jsonzContent-Typer   )urlmethodbodyheaders)rO  extract_paramsr6   implode_params	urlencodecheck_required_credentialsjsonstrmillisecondshmacencoder   hashlibsha256r  rG  r   r   )rZ  pathr   r   rc  r  r  queryr  getOrDeletepayloadr  auth	signatureaccessWindows                  r\  signbitvavo.sign%  sU   		&"5"5d";<DLL 3&)<)<T)JJ?Fh,>sT^^E222)++-G99U+D"GD--/0I%+g5D		$++d"3T[[5Mw~~^I++DLL:QSZ[L&*kk,5,5)5	G *<'iis#c)dOOr^  httpCodereasonr  r   r  r  c
                    Uc  g U R                  US5      n
U R                  US5      nU
b[  U R                  S-   U-   nU R                  U R                  S   X5        U R	                  U R                  S   X5        [        U5      eg )N	errorCodeerror rF  rE  )r  r/   throw_broadly_matched_exceptionr  throw_exactly_matched_exceptionr   )rZ  r  r  r  r   r  r  rd  requestHeadersrequestBodyr  r  feedbacks                r\  handle_errorsbitvavo.handle_errorsB  s     $$X{;	  73 ww}t+H001I5[001I9_))r^  c                 J    SU;   a  SU;  a  US   $ U R                  USS5      $ )Nr   rn  r   r   )r  )rZ  r   r   r  rc  configs         r\  calculate_rate_limiter_cost#bitvavo.calculate_rate_limiter_costS  s/    & 8v+=*%%vvq11r^   )N)O__name__
__module____qualname____firstlineno__r   rX  r
   re  r   r   rj  ri  r   r  r  r  r   r  dictr  r   r   r  r   r  r  r   r  r  r   r  listr  r   r!  r'  r   r0  r4  r	   r<  r   r   floatr   r[  r`  rf  rj  rm  rq  rv  rz  r  r   r  r  r  r_  r  r  r  r   r   r  r  r  r  r  r   r  r  r  r  intr"  r&  __static_attributes____classcell__)r[  s   @r\  r+   r+      s   x# xt ') 
3S 
3 *, ,V ,>?B -/ +6: +6Z`D 68  3  3F  3D/4 / /6 /b 6:" 57 5 5: <@d[] -A -AS -A -Abfglbm -A^\ \v \ \| /1 1[ 1,4 @DB %S % %S\ %N
 
4 
( :>D_cln ,# ,c ,Y\ ,. 8<$]ajl L LC LWZ Lquvzq{ L@) )  *, , ,, =? 
 
> 
< os{} @,3 @,i @,y @,Z_ @,hk @,D mqy{ E2 E2I E2Y E2X] E2fi E2N FJQU^` S : fjx|  FH 23 2 29 2I 2_b 2ru 2* ;?r ,s ,C ,$ 9=R 2S 2# 22 59 3c 3@ 8<B 82C 82 82t 26DW[df ,3 ,c ,QT ," 04$UYbd <A <AC <As <Aimnsit <A| 59tZ^gi 9Ac 9A 9ATW 9Anrsxny 9Av: :$b bv b bH 59tZ^gi ,c , ,TW ," 37TX\eg )AC )As )ARU )Alpqvlw )AV @DB ,S , QU]_ :3 : : :# :do :2 59tZ^gi ,c , ,TW ," 37TX\eg  aC  as  aRU  alpq|l}  aD 26DW[df ,3 ,c ,QT ," 04$UYbd ^ ^C ^s ^imnyiz ^@:s :L
T L
X L
Q\ L
\( (T BFb Kw KB &eBSW P:c 3 S # X\ dg " MO 2 2r^  r+   )0 ccxt.async_support.base.exchanger   ccxt.abstract.bitvavor   r  ccxt.base.typesr   r   r   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   typingr   ccxt.base.errorsr   r   r   r   r   r   r   r    r!   r"   r#   r$   r%   r&   ccxt.base.decimal_to_precisionr'   r(   ccxt.base.preciser)   r+   r(  r^  r\  <module>r:     sz    6 -  J  J  J  J  J  J  * 0 - - . ' & . + ) * . 1 * 3 4 %x 2h x 2r^  