
    E#i6                    X   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  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Transaction)List)ExchangeError)AuthenticationError)ArgumentsRequired)
BadRequest)	BadSymbol)MarketClosed)InsufficientFunds)InvalidAddress)InvalidOrder)DDoSProtection)RateLimitExceeded)ExchangeNotAvailable)BadResponse)TRUNCATE)	TICK_SIZE)Precisec                   ,  ^  \ rS rSrS\4U 4S jjr0 4S\\   4S jjrS\	S\4S jr
0 4S\4S jjrS\4S jr0 4S\4S	 jjrS
0 4S\S\S\4S jjrS
0 4S\S\4S jjr0 4S\S\4S jjrSJS\	S\S\4S jjrS
S
S
0 4S\S\S\4S jjrS
S
0 4S\S\S\S\\   4S jjrSJS\	S\S\4S jjr0 4S\4S jjrSKS jr SS
S
0 4S\S\S\S\S\\!   4
S jjr"SJS\S\!4S jjr#S
S
S
0 4S\S\S\S\\$   4S jjr%S
S
S
0 4S\S\S\S\\$   4S jjr&S
0 4S \S\4S! jjr'S"\4S# jr(SJS$\	S\S\$4S% jjr)S& r*S
0 4S\S'\+S(\,S)\-S*\.4
S+ jjr/S
0 4S \S\4S, jjr0SJS-\1S\24S. jjr30 4S/\S\24S0 jjr4S
0 4S1\S\\2   4S2 jjr5S
0 4S/\S)\-S3\S4\S\64
S5 jjr7S
S
S
0 4S/\S\S\S\\6   4S6 jjr8S
S
S
0 4S/\S\S\S\\6   4S7 jjr9S
S
S
0 4S/\S\S\4S8 jjr:SJS9\	S-\1S\64S: jjr;S"\4S; jr<S
0 4S1\4S< jjr=SJS-\14S= jjr>S> r?S?S@0 S
S
4SA jr@0 4SB jrAS/\BSC\SD\SE\SF\	SG\4SH jrCSIrDU =rE$ )Lprobit   returnc                   > U R                  [        [        U ]  5       0 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_S.S_S/S_E0 S0S_S1S_S2S_S3S_S4S_S5S_S6S_S7S_S8S_S9S_S:S_S;S_S<S_S=S_S>S_S?S_S@S_E0 SAS_SBS_SCS_SDS_SES_SFS_SGS_SHS_SIS_SJS_SKS_SLS_SMS_SNS_SOS_SPS_SQS_E0 SRS_SSS_STS_SUS_SVS_SWS_SXS_SYS_SZS_S[S_S\S_S]S_S^S_S_S_S`S_SaS_SbS_E0 ScS_SdS_SeS_SfS_SgS_ShS_SiSj_SkS_SlS_SmS_SnS_SoS_SpS_SqS_SrS_SsS_StS_ESSSSSSSSu.E_SvSwSxSySzS{S|S}S~SSSSSS._SS_SSSSSS.SSS/SSS._SSSSSSSSSSS.0SSSS.SSSSSSSS.S.SSS00S._SSSSU R	                  S5      U R	                  S5      S.0_SS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 SSSSSSSSS.SS0S.	S S S.S S S.S._SS[
        [        [        [        [        [        [        [        [        [        [        [        [        [        [
        S.0_SSSS._S[        _SSSSS.SSSS.S._S0 SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS0E_5      $ )Nidr)   nameProBit	countriesSCKR	rateLimit2   proThasCORSspotmarginFswapfutureoption	addMarginborrowCrossMarginborrowIsolatedMarginborrowMargincancelOrdercloseAllPositionsclosePositioncreateMarketBuyOrderWithCostcreateMarketOrdercreateMarketOrderWithCostcreateMarketSellOrderWithCostcreateOrdercreateReduceOnlyOrdercreateStopLimitOrdercreateStopMarketOrdercreateStopOrderfetchAllGreeksfetchBalancefetchBorrowInterestfetchBorrowRatefetchBorrowRateHistoriesfetchBorrowRateHistoryfetchBorrowRatesfetchBorrowRatesPerSymbolfetchClosedOrdersfetchCrossBorrowRatefetchCrossBorrowRatesfetchCurrenciesfetchDepositAddressfetchDepositAddressesfetchDepositAddressesByNetworkfetchDepositsfetchDepositsWithdrawalsfetchFundingHistoryfetchFundingIntervalfetchFundingIntervalsfetchFundingRatefetchFundingRateHistoryfetchFundingRatesfetchGreeksfetchIndexOHLCVfetchIsolatedBorrowRatefetchIsolatedBorrowRatesfetchIsolatedPositionsfetchLeveragefetchLeveragesfetchLeverageTiersfetchLiquidationsfetchLongShortRatiofetchLongShortRatioHistoryfetchMarginAdjustmentHistoryfetchMarginModefetchMarginModesfetchMarketLeverageTiersfetchMarketsfetchMarkOHLCVfetchMarkPricefetchMarkPricesfetchMyLiquidationsfetchMySettlementHistoryfetchMyTrades
fetchOHLCVfetchOpenInterestfetchOpenInterestHistoryfetchOpenInterestsfetchOpenOrdersfetchOptionfetchOptionChain
fetchOrderfetchOrderBookfetchPositionfetchPositionHistoryfetchPositionModefetchPositionsfetchPositionsForSymbolfetchPositionsHistoryfetchPositionsRiskfetchPremiumIndexOHLCVfetchSettlementHistoryfetchTickerfetchTickers	fetchTimefetchTradesfetchTradingFeefetchTradingFeesfetchTransactionsemulatedfetchTransferfetchTransfersfetchUnderlyingAssetsfetchVolatilityHistoryfetchWithdrawalfetchWithdrawalsreduceMarginrepayCrossMarginrepayIsolatedMarginsandbox)setLeverage	setMarginsetMarginModesetPositionModesignIntransferwithdraw
timeframes1m3m5m10m15m30m1h4h6h12h1D1W1M)r   r   r   r   r   r   r   r   r   r   1d1wr   versionv1urlszdhttps://user-images.githubusercontent.com/51840849/79268032-c4379480-7ea2-11ea-80b3-dd96bb29fd0d.jpgzhttps://accounts.probit.comz#https://api.probit.com/api/exchange)accountspublicprivatezhttps://www.probit.comzhttps://docs-en.probit.comzhttps://docs-ko.probit.comzFhttps://support.probit.com/hc/en-us/articles/360020968611-Trading-Feesz!https://www.probit.com/r/34608773)logoapiwwwdocfeesreferralr   get   )marketcurrencycurrency_with_platformtimeticker
order_booktradecandle   )	new_ordercancel_order
withdrawal)balanceorder
open_orderorder_historytrade_historydeposit_addressztransfer/payment)postr   r   token)r   r   r   r   tradingz0.002)	tierBased
percentagemakertakerfeatures)IOCFOKPOGTD)
marginModetriggerPricetriggerDirectiontriggerPriceTypestopLossPricetakeProfitPriceattachedStopLossTakeProfittimeInForcehedgedtrailingleveragemarketBuyByCostmarketBuyRequiresPriceselfTradePreventioniceberg  i )r   limitdaysBack	untilDayssymbolRequired)r   triggerr   r   )r   r   r   r   r   Z   )r   r   r   daysBackCanceledr   r   r   r   r   i  )	r   rH   createOrdersry   r   r~   fetchOrdersrU   rz   )linearinverse)r8   r:   r;   
exceptionsexact)UNAUTHORIZEDINVALID_ARGUMENTTRADING_UNAVAILABLENOT_ENOUGH_BALANCENOT_ALLOWED_COMBINATIONINVALID_ORDERRATE_LIMIT_EXCEEDEDMARKET_UNAVAILABLEINVALID_MARKETMARKET_CLOSEDMARKET_NOT_FOUNDINVALID_CURRENCYTOO_MANY_OPEN_ORDERSDUPLICATE_ADDRESSinvalid_grantrequiredCredentials)apiKeysecretprecisionModeoptionsgtcioc)r   r   BSCETHTRON)BEP20ERC20TRC20)!createMarketBuyOrderRequiresPricer   networkscommonCurrenciesBBz	Baby BaliCBCCryptoBharatCoinCTKCryptykCTTCastweetDKTDAKOTAEGC	EcoG9coinEPSEpanusFXFanzyGMz
GM HoldingGOGOLGOLGoldofirHUSLzThe Hustle AppLANDLandboxSST
SocialSwapTCTzTop Coin TokenTORTorexUNIzUNICORN TokenUNISWAP)deep_extendsuperr)   describeparse_numberr   r   r#   r   r    r"   r   r   r!   r   r&   )self	__class__s    S/home/james-whalen/.local/lib/python3.13/site-packages/ccxt/async_support/probit.pyr<  probit.describe   s
   fd < > ~A
(~A
H~A
 $~A
 	~A

 4~A
  nnn %n 	n
 %n %n Un $Un 'n n tn $Un  n /n $Tn  ,U!n" 0#n$ t%n& ('n( ')n* (+n, "5-n. !%/n0 1n2 &u3n4 "55n6 +E7n8 )%9n: #E;n< ,U=n> $T?n@ 'AnB (CnD "4EnF &tGnH (InJ 1%KnL  MnN +DOnP &uQnR 'SnT (UnV #EWnX *5YnZ $U[n\ u]n^ "5_n` *5anb +Ecnd )%enf  gnh !%inj %eknl $Umnn &uonp -eqnr /snt "5unv #Ewnx +Eynz {n| !%}n~ !%n@ "5AnB &uCnD +EEnF  GnH dInJ $UKnL +EMnN %eOnP "4QnR uSnT #EUnV dWnX !$YnZ  [n\ ']n^ $U_n` !%anb *5cnd (enf %egnh )%inj )%knl tmnn onp Tqnr tsnt "5unv #Ewnx $Zynz  {n| !%}n~ (n@ )%AnB "5CnD #DEnF GnH #EInJ &uKnL 5MnN  %"!&#(! [n~A
j k~A
H tI~A
J ~ =CD
 000 a?K~A
h "#$%23 !"#&'!""#	 &'()&' $%!"&')*)*+,,-" ;"i~A
n !&"&!..w7!..w7	o~A
~ $&+(-,1,0).+06: $(#'"'#(	( #($)$)+/27/4#(+$. %)&+!%$*%+*/& ',#($)*.	# ',!%#($)*/( $(&+!%$*,-%'#($)*/	*  #s<| ##
 ##EF~A
L $7(2+?*;/9%1+<*>&/%1(1(2,:)7%8M~A
r "$s~A
z Y{~A
| 59"# 
 #"#}~A
T	  !k!)! y! z	!
 x! {! x! g! l! ! z! (! 	! |! '!  w!!" #!$ 5%!U	~A
 ~ ~	    c                    #    U R                  U5      I Sh  vN nU R                  US/ 5      nU R                  U5      $  N(7f)z

https://docs-en.probit.com/reference/market

retrieves data on all markets for probit
:param dict [params]: extra parameters specific to the exchange API endpoint
:returns dict[]: an array of objects representing market data
Ndata)publicGetMarket
safe_valueparse_markets)r>  paramsresponsemarketss       r@  fetch_marketsprobit.fetch_markets`  sD      --f552 //(FB7!!'**5 6s   AA )Ar   c                 T   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S5      nU R                  USS5      nU(       + =(       a    Un	U R                  US5      n
[        R                  " U
S	5      nU R                  US
5      n[        R                  " US	5      n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S_SS _S U R                  U5      U R                  U5      S S S 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 .U R                  US#5      U R                  US$5      S .U R                  US%5      U R                  US&5      S .S'.S US(.E$ ))Nr-   base_currency_idquote_currency_idclosedF
show_in_uiTtaker_fee_rate100maker_fee_ratesymbol/basequotesettlebaseIdquoteIdsettleIdtyper8   r9   r:   r;   r<   activecontractr   quantity_precisionprice_incrementcost_precision)amountpricecostminmaxmin_quantitymax_quantity	min_price	max_pricemin_costmax_cost)r   rc  rd  re  )r   r   r   contractSizeexpiryexpiryDatetimestrike
optionType	precisionlimitscreatedinfo)safe_stringsafe_currency_code	safe_boolr'   
string_divr=  parse_precisionsafe_number)r>  r   r-   rZ  r[  rW  rX  rP  showInUIr^  takerFeeRater   makerFeeRater   s                 r@  parse_marketprobit.parse_market  s   fd+!!&*<=""6+>?&&v.''0%8>>&,=(''0@A""<7''0@A""<73
"3
dSj5(3
 D3
 U	3

 d3
 f3
 w3
 3
 F3
 D3
 e3
 E3
 e3
 e3
 f3
  !3
" d#3
$ &&u-&&u- "++D,@,@AQAQRXZnAo,pq))&2CD))$*>*>t?O?OPVXh?i*jk  
  ++FNC++FNC
  ++FK@++FK@
  ++FJ?++FJ?$ e3
 3	
rB  c                 z  #    U R                  U5      I Sh  vN nU R                  US/ 5      n0 n[        S[        U5      5       GH  nX5   nU R	                  US5      nU R                  U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0 n[        S[        U5      5       GH.  nX   nU R	                  US5      nU R                  U5      nU R                  US	/ 5      nU R                  US0 5      n[        S[        U5      5       H$  nUU   nU R	                  US
5      nUU:X  d  M"  Un  O   UUSU R                  US5      (       + U R                  US5      (       + U R                  US5      U R                  U R                  U R	                  US5      5      5      U R                  US5      SS.U R                  US5      SS.S.US.	UU'   GM1     U R                  UUUU
SSSSSSSSS.SSS.SSS.S.US.5      XH'   GM     U$  GN!7f)z

https://docs-en.probit.com/reference/currency

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
NrD  r   r-   display_namezen-usplatformprioritywithdrawal_feecurrency_iddeposit_suspendedwithdrawal_suspendedrc  rt  min_withdrawal_amountrf  min_deposit_amountr   deposit)	r-   networkr^  r  r   feert  ru  rw  crypto)rc  r  r   )r-   coderw  r.   r^  r  r   r]  r  rt  ru  r  )publicGetCurrencyWithPlatform	safe_listrangelenrx  ry  	safe_dictsort_bynetwork_id_to_coderz  r}  r=  r|  safe_currency_structure)r>  rH  rI  
currenciesresultir   r-   r  displayNamer.   	platformsplatformsByPrioritynetworkListjr  idInnernetworkCodewithdrawFee
networkFeekwithdrawPlatformfeeCurrencyIds                          r@  fetch_currenciesprobit.fetch_currencies  s     ;;FCCr ^^Hfb9
q#j/*A!}H!!(D1B**2.D..>BK##K9DxR@I"&,,y*"E "K1c"567-0**7D9"55g>"nnW6FK!^^KB?
q#k"23A'21~$$($4$45E}$UM$*%5
 4 "*"#'>>';N#OO$(NN7<R$S S++JA!%!2!243G3GHXHXY`bmHn3o!p $(#3#3G=T#U#'%
 $(#3#3G=Q#R#'$	 $%,K( 8@  77   !  $#
  $# 
  $#! (39 FLS +H  Ds   H;H8D=H;C H;c                 X   US S S.nU R                  US/ 5      n[        S[        U5      5       Hh  nX4   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'   XU'   Mj     U R                  U5      $ )N)rw  	timestampdatetimerD  r   r  total	availablefree)rF  r  r  rx  ry  accountsafe_balance)	r>  rI  r  rD  r  r   
currencyIdr  r  s	            r@  parse_balanceprobit.parse_balanceQ  s    

 x4q#d)$AgG))'=AJ**:6DllnG#//AGG"..wDGFO"4L %   ((rB  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)a0  

https://docs-en.probit.com/reference/balance

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)load_marketsprivateGetBalancer  )r>  rH  rI  s      r@  fetch_balanceprobit.fetch_balanceb  sG      !!!//77 !!(++ 	"7s   A	AA	AA	A	NrU  r   c           	      >  #    U R                  5       I Sh  vN   U R                  U5      nSUS   0nU R                  U R                  XS5      5      I Sh  vN nU R	                  US/ 5      nU R                  US5      nU R                  XS   SSSS	S
5      $  N ND7f)a  

https://docs-en.probit.com/reference/order_book

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
N	market_idr-   rD  siderU  buysellrd  quantity)r  r   publicGetOrderBookextendrF  group_byparse_order_book)	r>  rU  r   rH  r   requestrI  rD  
dataBySides	            r@  fetch_order_bookprobit.fetch_order_bookz  s      !!!V$
 00W1MNN x4]]40
$$Z1A4PVX_akll# 	"
 Os"   BB?BBABBsymbolsc                 .  #    U R                  5       I Sh  vN   0 nUb%  U R                  U5      nSR                  U5      US'   U R                  U R	                  X25      5      I Sh  vN nU R                  US/ 5      nU R                  Xa5      $  Nz N*7f)a  

https://docs-en.probit.com/reference/ticker

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,
market_idsrD  )r  r  joinpublicGetTickerr  r  parse_tickers)r>  r  rH  r  	marketIdsrI  rD  s          r@  fetch_tickersprobit.fetch_tickers  s      !!!0I$'HHY$7GL!--dkk'.JKK" ~~h3!!$00/ 	"
 Ls"   BBAB(B))BBc                 d  #    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c  [        U R                  S-   5      eU R                  Xs5      $  N NW7f)a  

https://docs-en.probit.com/reference/ticker

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>`
Nr  r-   rD  r   z) fetchTicker() returned an empty response)r  r   r  r  rF  r$   r-   parse_ticker)r>  rU  rH  r   r  rI  rD  r   s           r@  fetch_tickerprobit.fetch_ticker  s      !!!V$&,
 --dkk'.JKK" x4q)>dgg(SSTT  005 	"
 Ls"   B0B,?B0B.AB0.B0r   c                    U R                  U R                  US5      5      nU R                  US5      nU R                  XBS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S _SS _SS _SS _SS _SS _SU_SU_SS _SU_SS _SS _UU	US.EU5      $ )Nr   r  -lastchangebase_volumequote_volumerU  r  r  highlowbid	bidVolumeask	askVolumevwapopenclosepreviousCloser   average)
baseVolumequoteVolumerw  )	parse8601rx  safe_symbolsafe_tickeriso8601)
r>  r   r   r  marketIdrU  r  r  r  r  s
             r@  r  probit.parse_ticker  s    NN4#3#3FF#CD	##FK8!!(C8  0!!&(3%%fm<
&&v~> !
f!
!
 Y/!
 D$$VV4	!

 4##FE2!
 4!
 !
 4!
 !
 D!
 D!
 U!
 E!
 T!
 f!
  $!!
" t#!
$ %&)!
* + 	rB  sincec                   #    U R                  5       I Sh  vN   SnU R                  5       nSU R                  US-
  5      U R                  U5      S.nUb  U R                  U5      nUS   US'   Ub4  U R                  U5      US'   U R                  [	        XbS-   5      5      US'   Ub  X7S	'   U R                  U R                  Xt5      5      I Sh  vN nU R                  US
/ 5      n	U R                  XX#5      $  N N+7f)a  

https://docs-en.probit.com/reference/trade

fetch all trades made by the user
:param str symbol: unified market symbol
:param int [since]: the earliest time in ms to fetch trades for
:param int [limit]: the maximum number of trades structures to retrieve
:param dict [params]: extra parameters specific to the exchange API endpoint
:returns Trade[]: a list of `trade structures <https://docs.ccxt.com/#/?id=trade-structure>`
Nd   l    ,b/ )r   
start_timeend_timer-   r  r  r  r   rD  )	r  millisecondsr  r   rg  privateGetTradeHistoryr  r  parse_trades)
r>  rU  r  r   rH  r   nowr  rI  rD  s
             r@  fetch_my_tradesprobit.fetch_my_trades  s
     !!!!,,s['89S)

 [[(F#)$<GK $(LL$7GL!"&,,s38K/L"MGJ$G44T[[5QRR( ~~h3  u<<K 	"  Ss"   C?C;B:C?C=*C?=C?c                   #    U R                  5       I Sh  vN   U R                  U5      nUS   SU R                  U R                  5       5      S.nUb  U R                  U5      US'   Ub  [	        US5      US'   OSUS'   U R                  U R                  Xd5      5      I Sh  vN nU R                  US/ 5      nU R                  XX#5      $  N N+7f)	a  

https://docs-en.probit.com/reference/trade-1

get the list of most recent trades for a particular symbol
:param str symbol: unified symbol of the market to fetch trades for
:param int [since]: timestamp in ms of the earliest trade to fetch
:param int [limit]: the maximum amount of trades to fetch
:param dict [params]: extra parameters specific to the exchange API endpoint
:returns Trade[]: a list of `trade structures <https://docs.ccxt.com/#/?id=public-trades>`
Nr-   z1970-01-01T00:00:00.000Z)r  r  r  r  r   r   rD  )	r  r   r  r  rg  publicGetTrader  r  r  )	r>  rU  r  r   rH  r   r  rI  rD  s	            r@  fetch_tradesprobit.fetch_trades?  s      !!!V$4T%6%6%89

 $(LL$7GL!"5$/GG#GG,,T[[-IJJ. ~~h3  u<<K 	" Ks"   CCBC$C%*CCr   c                 n   U R                  U R                  US5      5      nU R                  US5      nS nUb#  UR                  S5      nU R                  US5      nU R                  USU5      nU R                  XRS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S nUb(  U R                  US5      nU R	                  U5      nUUS.nU R                  UUUU R                  U5      UUS US U	U
S US.U5      $ )Nr   r-   :r   r  r  r  rd  r  order_id
fee_amountfee_currency_id)re  r   )r-   rw  r  r  rU  r   r]  r  takerOrMakerrd  rc  re  r  )r  rx  splitr  ry  
safe_trader  )r>  r   r   r  r-   r  partsrU  r  priceStringamountStringorderIdfeeCostStringr  r  feeCurrencyCodes                   r@  parse_tradeprobit.parse_trader  sb   : NN4#3#3E6#BC	eT*>HHSME''q1H##E;A!!(C8v.&&ug6''z:""5*5((=$ ,,U4EFM"55mDO%+C "Y/  " 
  	rB  c                    #    U R                  U5      I Sh  vN nU R                  U R                  US5      5      nU$  N'7f)a  

https://docs-en.probit.com/reference/time

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
NrD  )publicGetTimer  rx  )r>  rH  rI  r  s       r@  
fetch_timeprobit.fetch_time  sB      ++F33 NN4#3#3Hf#EF	 4s   A?(Ac                    U R                  U5      nUS:X  a  U R                  U5      nUR                  S5      nU R                  US5      nU R	                  US5      nS n	U(       a  U R                  U[        S5      5      n	US:  a  S[        U5      -   n	US-   U	-   S-   $ US:X  a{  U R                  US	-  5      nS
n
X-
  n[        [        R                  " X-  5      5      nU R                  XU-  5      nU(       a  U R                  X5      nU R                  US	-  5      $ U R                  US	-  5      nX@R                  X-  5      -  nU(       a  U R                  X5      nU R                  US	-  5      $ )Nr   r  r   r   
   0z-01T00:00:00.000Zr   r   i )parse_timeframer  r  rx  safe_integersumstrparse_to_intintmathfloor)r>  r  	timeframeafterdurationr  r  yearmonthmonthStringfirstSunday
differencenumWeekspreviousSundays                 r@  normalize_ohlcv_timestamp probit.normalize_ohlcv_timestamp  sh   ''	2ll9-GMM#&E##E1-D%%eQ/E#K"hhuc!f5rz!CJ.#:+.AAA$)))d*:;I K"0J4::j&;<=H!XXkh3FGN!%.!C<< 566)))d*:;I #4#4Y5I#JJI HHY9	<<	D 011rB  r   r  c                   #    U R                  5       I Sh  vN   U R                  U5      nU R                  U R                  X"5      nUc  SOUnU R	                  US5      n[        SU5      nUS   USUS.n	U R                  5       n
U R                  US5      nU R                  U5      S-  nUnUb  X-
  OU
nUc  Uc  UnUS-
  nXU-  -
  nO#Ub   U R	                  X4U-  5      n[        UU5      nU R                  X5      nU R                  XS	5      nUU	S
'   UU	S'   U R                  U R                  X5      5      I Sh  vN nU R                  US/ 5      nU R                  UXbX45      $  GNU N-7f)a  

https://docs-en.probit.com/reference/candle

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 str [params.until]: timestamp in ms of the earliest candle to fetch
:returns int[][]: A list of candles ordered, open, high, low, close, volume
Nr  r   r   r-   asc)r  intervalsortr   untilTr  r  rD  )r  r   rx  r   r  rg  r  r  r  r)  publicGetCandler  r  parse_ohlcvs)r>  rU  r  r  r   rH  r   r-  requestLimitr  r  r/  durationMilliseconds	startTimeendTime
startLimit
endByLimitstartTimeNormalizedendTimeNormalizedrI  rD  s                        r@  fetch_ohlcvprobit.fetch_ohlcv  s     !!!V$##DOOYJExxq)4. , !	
 !!!&'2#33I>E	383D%.3=}$J/C"CCI !XXe5I-IJ
gz2"<<YR ::7tT 3/
--dkk'.JKK$ ~~h3  v%GGc 	"< Ls"   E0E+D)E0 E.+E0.E0c           	          U R                  U R                  US5      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  r  r  r  )r  rx  r}  )r>  ohlcvr   s      r@  parse_ohlcvprobit.parse_ohlcv"  sw     NN4++E<@AUF+UF+UE*UG,UM2
 	
rB  c                 <  #    U R                  5       I Sh  vN   U R                  U5      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                  US5      nU R                  XX#5      $  N N*7f)a  

https://docs-en.probit.com/reference/open_order-1

fetch all unfilled currently open orders
:param str symbol: unified market symbol
:param int [since]: the earliest time in ms to fetch open orders for
:param int [limit]: the maximum number of  open orders structures to retrieve
:param dict [params]: extra parameters specific to the exchange API endpoint
:returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
Nr-   r  rD  )r  r  r   privateGetOpenOrderr  r  parse_orders	r>  rU  r  r   rH  r  r   rI  rD  s	            r@  fetch_open_ordersprobit.fetch_open_orders9  s      !!!u%[[(F#)$<GK 11$++g2NOO~~h/  u<< 	" Ps"   BBAB/B0)BBc                   #    U R                  5       I Sh  vN   U R                  S5      U R                  U R                  5       5      SS.nSnUb  U R                  U5      nUS   US'   U(       a  U R                  U5      US'   U(       a  X5S'   U R	                  U R                  XT5      5      I Sh  vN nU R                  US	5      nU R                  XX#5      $  N N*7f)
a  

https://docs-en.probit.com/reference/order

fetches information on multiple closed orders made by the user
:param str symbol: unified market symbol of the market orders were made in
:param int [since]: the earliest time in ms to fetch orders for
:param int [limit]: the maximum number of order structures to retrieve
:param dict [params]: extra parameters specific to the exchange API endpoint
:returns Order[]: a list of `order structures <https://docs.ccxt.com/#/?id=order-structure>`
Nr   r  )r  r  r   r-   r  r  r   rD  )r  r  r  r   privateGetOrderHistoryr  r  rB  rC  s	            r@  fetch_closed_ordersprobit.fetch_closed_ordersP  s      !!!,,q/T%6%6%89

 [[(F#)$<GK $(LL$7GL!$G44T[[5QRR~~h/  u<<! 	" Ss"   C!CBC!4C5)C!C!r-   c                   #    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S5      nUb  XeS'   OXS'   U R                  USS/5      nU R                  U R                  XW5      5      I Sh  vN nU R                  US/ 5      n	U R                  U	S	5      n
U R                  X5      $  N N<7f)
ab  

https://docs-en.probit.com/reference/order-3

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
:returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
Nz( fetchOrder() requires a symbol argumentr  r-   clientOrderIdclient_order_idr  rD  r   )r   r-   r  r   safe_string_2omitprivateGetOrderr  rF  r  parse_order)r>  r-   rU  rH  r   r  rK  queryrI  rD  r   s              r@  fetch_orderprobit.fetch_ordern  s      >#DGG.X$XYY!!!V$
 **6?DUV$)6%&"$J		&?4E"FG--dkk'.IJJx4tQ'.. 	" Ks"   /C#CA2C#$C!%;C#!C#statusc                 2    SSSS.nU R                  X!U5      $ )Nr  canceledrP  )r  	cancelledfilledrx  r>  rT  statusess      r@  parse_order_statusprobit.parse_order_status  s'    #

 &99rB  r   c                 |   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                  XrS5      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b  [        R
                  " X5      nU R                  US[        R
                  " X5      5      nU R                  USS5      nUS:X  a  S n
U R                  US5      nU R                  US5      nU R                  0 SU_SU_SU_SU	_SU R                  U	5      _SS _SU_SU_SU_SU_SU_SU
_SS _SU_SU_SU_SS _US S S.EU5      $ ) NrT  r-   r]  r  r  r  r   limit_pricefilled_quantityopen_quantitycancelled_quantityr  filled_costre  r   rL  time_in_forcerw  rK  r  r  lastTradeTimestamprU  r   rd  r   rc  rX  	remainingr  )re  r  trades)
r\  rx  r  r  r'   
string_addrM  safe_string_upper
safe_orderr  )r>  r   r   rT  r-   r]  r  r  rU  r  rd  rX  rf  canceledAmountrc  re  rK  r   s                     r@  rP  probit.parse_order  sW   ( (()9)9%)JKeT*v.v.##E;7!!(C8NN4#3#3E6#BC	  6!!%):;$$UO<	))%1EF%**9EI!!%W5G5G5Z[!!%?8E((0AB,,UOD  
" 
E 
 ] 
 	 

 Y/ 
 !$ 
 f 
 D 
 ; 
 D 
 f 
 U 
 D 
 f 
 f 
  ! 
" t# 
$ ) 
* + 	rB  c                 l    U R                  U[        U R                  U   S   S   U R                  5      $ )Nrt  re  )decimal_to_precisionr%   rJ  r  )r>  rU  re  s      r@  cost_to_precisionprobit.cost_to_precision  s4    ((xf9Mk9Z[a9bdhdvdvwwrB  r]  r  rc  rd  c                   #    U R                  5       I Sh  vN   U R                  U5      nU R                  U R                  S5      nU R                  X5      n	U R	                  USSU	5      n
US   UUU
S.nU R	                  USS5      nUb  XS'   SnUS:X  a)  U R                  X5      US	'   U R                  X5      US
'   OUS:X  a  US:X  a  SnU R                  USSS5      u  pU R                  US5      nU R                  US5      nUb  U R                  X5      nOU(       ag  Uc  [        U R                  S-   5      eU R                  U5      nU R                  U5      n[        R                  " UU5      nU R                  UU5      nOU R                  X5      nXS'   OU R                  X5      US
'   U R                  U/ SQ5      nU R!                  U R#                  UU5      5      I Sh  vN nU R                  US5      nU R%                  UU5      nUS:X  a$  US:X  a  SUS'   U R'                  U5      US'   SUS'   U$  GN. NW7f)a  
create a trade order

https://docs-en.probit.com/reference/order-1

: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
: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.cost]: the quote quantity that can be used alternative for the amount for market buy orders
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
Nr   rd  r-   )r  r]  r  rd  rK  rL  r   r_  r  r   r  TrH   r  re  z createOrder() requires the price argument for market buy orders to calculate the total cost to spend(amount * price), alternatively set the createMarketBuyOrderRequiresPrice option or param to False and pass the cost to spend in the amount argument)r   rd  rK  rL  rD  rc  rf  )r  r   rF  r  rM  price_to_precisionamount_to_precisionhandle_option_and_paramsrx  rN  ro  r    r-   number_to_stringr'   
string_mulprivatePostNewOrderr  rP  r=  )r>  rU  r]  r  rc  rd  rH  r   r  defaultTimeInForcer   r  rK  quoteAmountr  re  r
  r	  costRequestrQ  rI  rD  r   s                          r@  create_orderprobit.create_order  s     !!!V$//$,,>!__W;((Qcd(	
 **6?DUV$)6%&7?%)%<%<V%KGM""&":":6"JGJXu}481<@<Y<YZ`bo  rU  W[  =\91''7662#"&"8"8"FK6}*477  6q  ,q  r  r'+'<'<V'D&*&;&;E&B&-&8&8{&S&*&<&<V[&Q"&"8"8"HK"-&*&>&>v&N
#		&"fg11$++gu2MNN, x0  v. H45="E(O --k:E&M!%E+O 	"R Os#   I	IGI	/I0AI	I	c                 @  #    Uc  [        U R                  S-   5      eU R                  5       I Sh  vN   U R                  U5      nUS   US.nU R	                  U R                  XS5      5      I Sh  vN nU R                  US5      nU R                  U5      $  Nh N)7f)aC  

https://docs-en.probit.com/reference/order-2

cancels an open order
:param str id: order id
:param str symbol: unified symbol of the market the order was made in
:param dict [params]: extra parameters specific to the exchange API endpoint
:returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
Nz) cancelOrder() requires a symbol argumentr-   )r  r  rD  )r   r-   r  r   privatePostCancelOrderr  r  rP  )r>  r-   rU  rH  r   r  rI  rD  s           r@  r   probit.cancel_order,  s      >#DGG.Y$YZZ!!!V$
 44T[[5QRR~~h/%% 	" Ss"   /BBA B2B3(BBr   c                     U R                  US5      nU R                  US5      nU R                  US5      nU R                  XR5      nUS   nU R                  US5      nU R                  U5        UUUUUS.$ )Naddressdestination_tagr  r  platform_id)rw  r   r  r  tag)rx  safe_currencycheck_address)r>  depositAddressr   r  r  r  r  r  s           r@  parse_deposit_addressprobit.parse_deposit_addressC  s    "">9=~/@A%%nmD
%%j;"">=A7#"
 	
rB  r  c                   #    U R                  5       I Sh  vN   U R                  U5      nSUS   0nU R                  U R                  S0 5      nU R	                  US5      nU R                  XVU5      nUb  XdS'   U R                  US5      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	c  [        U R                  S	-   5      eU R                  X5      $  N NW7f)
aH  

https://docs-en.probit.com/reference/deposit_address

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>`
Nr  r-   r  r  r  rD  r   z1 fetchDepositAddress() returned an empty response)r  r   rF  r  ri  rx  rN  privateGetDepositAddressr  r   r-   r  )
r>  r  rH  r   r  r  r  rI  rD  firstAddresss
             r@  fetch_deposit_addressprobit.fetch_deposit_addressS  s	     !!!==&8D>
 ??4<<R@((;""8g>%,M"YYv}5F66t{{77STT0 x4tQ/ +^!^__)),AAQ 	" Us#   D
DBD
0D1AD
D
codesc                   #    U R                  5       I Sh  vN   0 nU(       aY  / n[        S[        U5      5       H*  nU R                  X   5      nUR	                  US   5        M,     SR                  U5      US'   U R                  U R                  X25      5      I Sh  vN nU R                  US/ 5      nU R                  X5      $  N N*7f)al  

https://docs-en.probit.com/reference/deposit_address

fetch deposit addresses for multiple currencies and chain types
:param str[]|None codes: list of unified currency codes, default is None
:param dict [params]: extra parameters specific to the exchange API endpoint
:returns dict: a list of `address structures <https://docs.ccxt.com/#/?id=address-structure>`
Nr   r-   r  r  rD  )
r  r  r  r   appendr  r  r  r  parse_deposit_addresses)	r>  r  rH  r  currencyIdsr  r   rI  rD  s	            r@  fetch_deposit_addressesprobit.fetch_deposit_addresses  s      !!!K1c%j)==2""8D>2 * &)XXe_GM"66t{{77STT~~h3++D88 	" Us"   CC	B	C C!)CCr  r  c                 2  #    U R                  XE5      u  pEU R                  U5        U R                  5       I Sh  vN   U R                  U5      nUc  SnUS   UUU R	                  U5      S.nU R                  U R                  S0 5      nU R                  US5      n	U R                  XU	5      n	U	b  XS'   U R                  US5      nU R                  U R                  Xu5      5      I Sh  vN n
U R                  U
S5      nU R                  X5      $  N N)7f)	a  

https://docs-en.probit.com/reference/withdrawal

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 r-   )r  r  r  rc  r  r  r  rD  )handle_withdraw_tag_and_paramsr  r  r   ru  rF  r  ri  rx  rN  privatePostWithdrawalr  r  parse_transaction)r>  r  rc  r  r  rH  r   r  r  r  rI  rD  s               r@  r   probit.withdraw  s     99#F
 	7#!!!==&;C#D>"++F3
 ??4<<R@((;""8g>%,M"YYvy1F33DKK4PQQ~~h/%%d551 	", Rs"   8DDB0D+D,(DDc           	      l   #    SS0nU R                  XX0R                  XT5      5      I Sh  vN nU$  N7f)a  
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 transaction 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_transactionsr  r>  r  r  r   rH  r  r  s          r@  fetch_depositsprobit.fetch_deposits  s>      I
 ..tE;;wC_`` a   )424c           	      l   #    SS0nU R                  XX0R                  XT5      5      I Sh  vN nU$  N7f)a  
fetch all withdrawals made to 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 transaction 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   Nr  r  s          r@  fetch_withdrawalsprobit.fetch_withdrawals  s>      L
 ..tE;;wC_`` ar  c                 N  #    U R                  5       I Sh  vN   Sn0 nUb  U R                  U5      nUS   US'   Ub  U R                  U5      US'   OU R                  S5      US'   U R                  US5      nUb(  U R                  U5      US'   U R	                  US/5      nO"U R                  U R                  5       5      US'   Ub  X6S'   OS	US'   U R                  U R                  Xd5      5      I Sh  vN nU R                  US
/ 5      n	U R                  XX#5      $  GN
 N,7f)a  
fetch history of deposits and withdrawals

https://docs-en.probit.com/reference/transferpayment

:param str code: unified currency code
:param int [since]: the earliest time in ms to fetch transactions for
:param int [limit]: the maximum number of transaction 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 transactions for
:returns dict[]: a list of `transaction structures <https://docs.ccxt.com/#/?id=transaction-structure>`
Nr-   r  r  r   r/  r  r   r  rD  )
r  r   r  r  rN  r  privateGetTransferPaymentr  r  parse_transactions)
r>  r  r  r   rH  r   r  r/  rI  rD  s
             r@  fetch_deposits_withdrawals!probit.fetch_deposits_withdrawals  s0     !!!!}}T*H%-d^GM"$(LL$7GL!$(LLOGL!!!&'2"&,,u"5GJYYvy1F"&,,t/@/@/B"CGJ$G"GG77G8TUU2 ~~h3&&tuDD] 	"( Vs"   D%D CD%6D#7*D%#D%transactionc                    U R                  US5      nU R                  US5      nU R                  U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 R                  US5      5      n
U R                  US5      nU R                  US	5      nU R	                  U5      nU R                  U R                  US
5      5      nU R                  US5      nS nUb  US:w  a  UU R                  U5      S.n0 SU_SU_SU_SU_SS _SU_SU_SS _SU_SU_S
U_SU_SU	_SU
_SU R                  U
5      _SS _SS _S UUS.E$ )Nr-   r  rc  r  r  hashr   r]  r  rT  r  r  )r   re  r   r  addressFrom	addressTotagFromr  tagTotxidr  r  updatedinternal)commentr  rw  )rx  r  r}  r  ry  parse_transaction_statusr=  r  )r>  r  r   r-   	networkIdr  rc  r  r  r  r  r]  r  r  rT  r  r  s                    r@  r  probit.parse_transaction%  s   * k40$$[-@	--i8!!+x8"";	:{,=>V4NN4#3#3K#HI	V4%%k=A
&&z2..t/?/?X/VW((e<$#)= ))-8C
"

 f
 {	

 4
 w
 
 t
 3
 S
 f
 D
 D
 
 Y/
  t!
" #
$ )
 	
rB  c           	      <    SSSSSSSSS.nU R                  X!U5      $ )NpendingokrV  )	requestedr  
confirming	confirmedapplyingdonerW  
cancellingrY  rZ  s      r@  r  probit.parse_transaction_statusd  s6    " #"!#$	
 &99rB  c                    #    U R                  5       I Sh  vN   U R                  U5      I Sh  vN nU R                  US5      nU R                  XAS5      $  NA N*7f)a/  

https://docs-en.probit.com/reference/currency

fetch deposit and withdraw fees
: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 `fees structures <https://docs.ccxt.com/#/?id=fee-structure>`
NrD  r-   )r  r  r  parse_deposit_withdraw_fees)r>  r  rH  rI  rD  s        r@  fetch_deposit_withdraw_fees"probit.fetch_deposit_withdraw_feesq  s[      !!!;;FCCp ~~h///TBBu 	"Cs   AAAA)AAc                    U R                  0 5      nU R                  US/ 5      nS S S.n[        S[        U5      5       H  nXF   nU R	                  US5      nU R                  XS   5      n	U R                  US0 5      n
U R                  U
S   S5      n[        U
5      (       d  Mg  UUb  SOS S.nUS:X  a  XS	'   UUS
.US   U	'   M     XS'   U$ )Nr  )r  r   r   r-   r  r  rc  Fr   r  r  rw  )deposit_withdraw_feerF  r  r  rx  r  r}  )r>  r  r   depositWithdrawFeer  depositResultr  r  r  r  withdrawalFeesr  withdrawResults                r@  parse_deposit_withdraw_fee!probit.parse_deposit_withdraw_fee  s    F "66r:OOCR8	
 q#i.)AlG(($7I11)f=MNK!__W6FKN**>!+<hGK>""&,7,C%$( 65Cz2 .,?":.{; *" &)6"!!rB  c                 "    U R                  5       $ N)r  )r>  s    r@  nonceprobit.nonce  s      ""rB  r   GETc                    U R                   S   U   S-   nU R                  X@R                  U5      5      nUS:X  ar  U R                  5         XpR	                  X5      -  nU R
                  S-   U R                  -   n	U R                  U	5      n
SU
-   SS.nU(       a  U R                  U5      nGO#XpR                  S-   -  nUS:X  a2  XpR	                  X5      -  nU(       a  US	U R                  U5      -   -  nOUS
:X  a  U R                  5       nU R                  5         U R                  U R                  S5      nUb  X:  a  [        U R                  S-   5      eU R!                  U R                  S5      nSSU-   0nXpR	                  X5      -  nUS:X  a  U(       a  US	U R                  U5      -   -  nOU(       a  U R                  U5      nSUS'   XsXeS.$ )Nr   rV  r   r  zBasic zapplication/json)AuthorizationContent-Typer   ?r   expiresz+ access token expired, call signIn() methodaccessTokenr  zBearer r  r  )urlmethodbodyheaders)r   rN  extract_paramscheck_required_credentialsimplode_paramsr  r  string_to_base64jsonr   	urlencoder  r  r  r   r-   rx  )r>  pathr   r  rH  r  r  r  rQ  authauth64r  r  r  s                 r@  signprobit.sign  s   iis#c)		&"5"5d";<*++-&&t44C;;$t{{2D**40F!)F!2 2G yy'<<#%%Ch**4883!666C	!'')//1++DLL)DO-dgg8e.eff"..t||]K#Y%< **488U?sT^^E%:::99U+D.@GN+dOOrB  c                 N  #    U R                  5         SS0nU R                  U R                  X!5      5      I Sh  vN nU R                  US5      nU R	                  US5      nXPR
                  S'   U R                  U R                  5       US-  5      U R
                  S'   U$  Nh7f)	z

https://docs-en.probit.com/reference/token

sign in, must be called prior to using other authenticated methods
:param dict [params]: extra parameters specific to the exchange API endpoint
:returns: response from exchange

grant_typeclient_credentialsN
expires_inaccess_tokenr  r   r  )r  accountsPostTokenr  r  rx  r  r  r  )r>  rH  r  rI  	expiresInr  s         r@  sign_inprobit.sign_in  s      	'').
 //G0LMM %%h=	&&x@&1]#"&((4+<+<+>	D@P"QY Ns   8B%B#A)B%reasonr  r  r  r  c
                    Uc  g SU;   a  U R                  US5      n
U
b  U R                  USS5      nU R                  US5      nU R                  S-   U
-   S-   U-   S-   U R                  U5      -   nSU R                  ;   a  U R                  U R                  S   X5        SU R                  ;   a  U R                  U R                  S   X5        [        U5      eg )N	errorCodemessager  details r   broad)rx  rF  r-   r  r   throw_exactly_matched_exceptionthrow_broadly_matched_exceptionr   )r>  r  r  r  r  r  r  rI  requestHeadersrequestBodyr  
errMessager  feedbacks                 r@  handle_errorsprobit.handle_errors9  s    ("((;?I$!--h	2F
//(I>77S=94s:ZG#MPTPYPYZaPbbdoo-889QS\gdoo-889QS]h#H--rB   r  )F)F__name__
__module____qualname____firstlineno__r   r<  r   r   rK  dictr  r   r  r   r  r  r  r
   r   r  r   r   r  r   r  r  r   r  r   r  r  r  r)  listr:  r>  r   rD  rH  rR  r\  rP  ro  r   r   floatr   r{  r   r   r	   r  r  r  r   r   r  r  r  r  r  r  r  r  r  r  r  r  __static_attributes____classcell__)r?  s   @r@  r)   r)      s   # B
 *, #+V #+J@
4 @
F @
D -/ H: HT) )" *, , ,0 @DB mS m mS\ m< 6:" !17 !1 !1F 68 $1 $1F $1L)4 ) )6 )V 37TX\eg 1=C 1=s 1=RU 1=f <@d[] 1= 1=S 1= 1=bfglbm 1=f@ @v @ @D ') S  2: ?CQUdhqs ?H ?H ?H3 ?H^a ?Hx|  ~B  yC ?HB
 
4 
. 59tZ^gi =c = =TW =nrsxny =. 7;\`ik = =3 =VY =ptuzp{ =< 8<B /C / /:: :< <v < <|x mqy{ V VI VY VX] Vfi Vp 9=R &S &# &.
h 
R` 
  =? 2B 2B> 2Bh >B" 97 9QUVdQe 9, QU]_ +63 +6 +6 +6# +6do +6Z 04$UYbd  C s imnyiz  37TX\eg C s RU lpq|l}  <@daenp ;ES ;E ;E[^ ;Ez=
T =
X =
Q\ =
~:s : BFb DCw DCL;" ;"z# &eBSW %PN $& 6# s  c TX `c  rB  r)   ). ccxt.async_support.base.exchanger   ccxt.abstract.probitr   r  ccxt.base.typesr   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$   ccxt.base.decimal_to_precisionr%   r&   ccxt.base.preciser'   r)   r  rB  r@  <module>r     sq    6 ,  }  }  }  }  }  * 0 . ' & ) . + ) + . 1 ( 3 4 %jX{ jrB  