
    E#iy                    $   S SK Jr  S SKJ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\\5      r)g)    )Exchange)ImplicitAPI)AnyBalances
CurrenciesCurrencyDepositAddressIntMarketNumOrder	OrderBook	OrderSide	OrderTypeStrStringsTickerTickersTradeTransactionTransferEntry)List)ExchangeError)AuthenticationError)PermissionDenied)ArgumentsRequired)
BadRequest)	BadSymbol)InsufficientFunds)InvalidOrder)NotSupported)RateLimitExceeded)	TICK_SIZE)Precisec                   Z  ^  \ 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
SOS\S\	S\4S	 jjr0 4S
\S\4S jjrS0 4S\S\4S jjr0 4S\4S jjrS0 4S
\S\S\4S jjrS rSOS\S
\S\S\4S jjrSOS\S\	S\4S jjrSS0 4S
\S\S\S\\   4S jjrSOS\	S\4S jjrSSS0 4S
\S\S\S\S\\   4
S jjrS\ 4S jr!0 4S\ 4S jjr"S\4S jr#SOS \S\	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
\,4S) jjr-S0 4S
\,4S* jjr.S0 4S(\S
\,4S+ jjr/SSS0 4S
\,S\S\S\\$   4S, jjr0SSS0 4S
\,S\S\4S- jjr1S.\,4S/ jr2SSS0 4S
\,S\S\S\\$   4S0 jjr3SSS0 4S
\,S\S\S\\$   4S1 jjr4S2 r5S3S40 SS4S5 jr60 4S6\S\74S7 jjr8S.\,4S8 jr9SOS9\S:\:S\;4S; jjr<SSS0 4S6\,S\S\S\\;   4S< jjr=SSS0 4S6\,S\S\S\\;   4S= jjr>0 4S6\S%\&S>\S?\S\?4
S@ jjr@SOSA\S:\:S\?4SB jjrAS.\,S\,4SC jrBS0 4S6\S%\&SD\SE\,S\;4
SF jjrCSG\DSH\SI\SJ\SK\SL\4SM jrESNrFU =rG$ )Pbigone   returnc                   > U R                  [        [        U ]  5       0 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SSSSSSSSSSSSSSA.E_SBSCSDSESFSGSHSISJSKSLSMSNSO._SPSQ_SRSSSTSUSVSVSWSX.SYSZS[S\S]._S^S_/ S`Q0/ SaQ/ SbQSc.S_/ SdQ0/ SeQSfSg/ShSi/SjSg/Sk.S_Sl/0SX._SmU R	                  Sn5      U R	                  Sn5      So.Sp0 0Sq._SrSSsStStSuSuSv.SwS0SxSSySSz.S{S|S}00 S~S~_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_0 SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_E0 SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_SS_ESSSSSSSSSSSSSSS.ES._SSSSS SSSS SSSSS.SSSSSSSS.S SSS S SS.SSSSS.SSSSSS.SSS S SSSS.SSS S S SSSS.SS0S.	SS0SSSSSS.0GS GS GS.GS GS GS.GS.SGS0SGS0GS.S S GS.GS._GS[
        _GS0 GS[        _GS	[        _GS
[        _GS[        _GS[        _GS[        _GS[        _GS[        _GS[        _GS[        _GS[        _GS[        _GS[        _GS[        _GS[        _GS[        _GS[        _[        [        [        [        [        [        GS.E0 GS._GSGSGSGSGSGS GS!._5      $ ("  Nidr&   nameBigONE	countriesCNversionv3	rateLimit   hasCORSspotTmarginFswapfutureoptionborrowCrossMarginborrowIsolatedMarginborrowMargincancelAllOrderscancelOrdercreateMarketBuyOrderWithCostcreateMarketOrderWithCostcreateMarketSellOrderWithCostcreateOrdercreatePostOnlyOrdercreateStopLimitOrdercreateStopMarketOrdercreateStopOrderfetchAllGreeksfetchBalancefetchBorrowInterestfetchBorrowRatefetchBorrowRateHistoriesfetchBorrowRateHistoryfetchBorrowRatesfetchBorrowRatesPerSymbolfetchClosedOrdersfetchCrossBorrowRatefetchCrossBorrowRatesfetchCurrenciesfetchDepositAddressfetchDepositAddressesfetchDepositAddressesByNetworkfetchDepositsfetchFundingHistoryfetchFundingRatefetchFundingRateHistoryfetchFundingRatesfetchGreeksfetchIsolatedBorrowRatefetchIsolatedBorrowRatesfetchMarketsfetchMyTrades
fetchOHLCVfetchOpenOrdersfetchOptionfetchOptionChain
fetchOrderfetchOrderBookfetchOrders)fetchTickerfetchTickers	fetchTimefetchTradesfetchTradingFeefetchTradingFeesfetchTransactionFeesfetchVolatilityHistoryfetchWithdrawalsrepayCrossMarginrepayIsolatedMargintransferwithdraw
timeframesmin1min5min15min30hour1hour3hour4hour6hour12day1week1month1)1m5m15m30m1h3h4h6h12h1d1w1Mhostnamezbig.oneurlszOhttps://github.com/user-attachments/assets/4e5cfd53-98cc-4b90-92cd-0d7b512653d1zhttps://{hostname}/api/v3z https://{hostname}/api/v3/viewerz"https://{hostname}/api/contract/v2zhttps://{hostname}/api/)publicprivatecontractPubliccontractPrivatewebExchangezhttps://big.onez"https://open.big.one/docs/api.htmlzKhttps://bigone.zendesk.com/hc/en-us/articles/115001933374-BigONE-Fee-Policyz&https://b1.run/users/new?code=D3LLBVFT)logoapiwwwdocfeesreferralr   get)pingasset_pairsz#asset_pairs/{asset_pair_name}/depthz$asset_pairs/{asset_pair_name}/tradesz$asset_pairs/{asset_pair_name}/tickerz%asset_pairs/{asset_pair_name}/candleszasset_pairs/tickers)	accountszfund/accountszassets/{asset_symbol}/addressordersorders/{id}zorders/multitradeswithdrawalsdeposits)r   zorders/{id}/cancelzorders/cancelr   rr   )r   post)symbolsinstrumentszdepth@{symbol}/snapshotzinstruments/differencezinstruments/prices)r   r   r   zorders/openingzorders/countzorders/opening/countr   ztrades/countr   zorders/batchzpositions/{symbol}/marginzpositions/{symbol}/risk-limitr   )r   r   putdeletez	v3/assetsr   z0.001)makertakerrs   )tradingfundingoptionsSPOTFUNDCONTRACT)r5   fundr   r8   r7   fillResponseFromRequesti   )webApiEnablewebApiRetrieswebApiMuteFailureERC20USDTTRC20ABBCACAAcalaAE	AeternityALGOAlgorandAPTAptosARArweaveASTRAstarAVAXCAvaxAVAXX	AvaxChainBEAMBeamBEP20BinanceSmartChainBITCI
BitciChainBTCBitcoinBCHBitcoinCashBSV	BitcoinSVCELOCeloCKKBCKBATOMCosmosCRC20CRODASHDashDOGEDogecoinXECECashEOSETHEthereumETCEthereumClassicETHWEthereumPowFTMFantomFILFilecoinFSNFusionGRINGrinONEHarmonyHRC20	HecochainHBARHederaHNTHeliumZENHorizenIOSTIRISKLAYKlaytnKSMKusamaLTCLitecoinXMRMoneroGLMRMoonbeamNEARNearNEONeoNEON3NeoN3OASISOasisOKC	OkexchainONTOntologyOPTIMISMOptimismDOTPolkadotMATICPolygonQtumREIRippleSGBShidenSolanaStellarTeraTezosTronVechainVSystemsWAXZcash)QTUMr  XRPr  SDNSOLXLMTERAXTZr   VETVSYSr'  ZEC)!createMarketBuyOrderRequiresPriceaccountsByTyperr   exchangeMillisecondsCorrectionrR   defaultNetworkdefaultNetworksnetworksfeatures)IOCFOKPOGTD)
marginModetriggerPricetriggerPriceTypetriggerDirectionstopLossPricetakeProfitPriceattachedStopLossTakeProfittimeInForcehedgedtrailingleveragemarketBuyRequiresPricemarketBuyByCostselfTradePreventioniceberg   )r>  limitdaysBack	untilDayssymbolRequired)r>  triggerrG  rQ  )r>  rN  rR  rG  rQ  )r>  rN  rO  rP  rR  rG  rQ  )r>  rN  rO  daysBackCanceledrP  rR  rG  rQ  rN    )	sandboxrB   createOrdersr_   rd   ra   rf   rO   r`   extendsdefaultr@  )markindexlasti )rO  rP  )rW  rB   rf   rO   forDerivatives)linearinverse)rX  r5   r\  r7   r8   precisionMode
exceptions1000110005z7Amount's scale must greater than AssetPair's base scalezFPrice mulit with amount should larger than AssetPair's min_quote_value10007100111001310014104031042940004401034010440301403024060140602)406034060440605401204012160100)exactbroadcommonCurrencies	CybereitsFXTTOKENFreeRossDAOzMobilian CoinzBigONE Token)CREFXTFREEMBNr   )deep_extendsuperr&   describeparse_numberr#   r   r   r    r   r   r   r"   r   )self	__class__s    E/home/james-whalen/.local/lib/python3.13/site-packages/ccxt/bigone.pyr  bigone.describe   s
   fd < > zA
(zA
HzA
 $zA
 t	zA

 zA
  AAA %A 	A
 $A %A $UA 'A A "4A tA /A ,UA 0A tA  &t!A" '#A$ (%A& "4'A( !%)A* +A, &u-A. "5/A0 +E1A2 )%3A4 #E5A6 ,U7A8 $T9A: ';A< (=A> "4?A@ &tAAB (CAD 1%EAF  GAH &uIAJ #EKAL *5MAN $UOAP uQAR *5SAT +EUAV WAX  YAZ d[A\ "4]A^ u_A` #EaAb dcAd !$eAf tgAh  $ $!##($)(-*/$($)',  AAzA
P QzA
l 	mzA
n i9A&J'K#< );eDozA
J  

*  #	 !&
 47
 &&'$2 # CFKzA
X !..w7!..w7
 YzA
j 59""%(&# .t 37$(%&)-$
 #*G$`F`7` +` J	`
 7` )` G` V` [` F` 0` \` 9` =` ;`  F!`" E#`$ H%`& U'`( F)`* J+`, 7-`. 5/`0 :1`2 ,3`4 M5`6 87`8 :9`: 8;`< F=`> 9?`@ [A`B HC`D 8E`F 9G`H FI`J FK`L HM`N 8O`P :Q`R 8S`T JU`V FW`X 5Y`Z W[`\ W]`^ ;_`` :a`b 
c`d :e`f Yg`h # # ##$""#$& "C`-wkzA
Z	 $&+(,,0,0).+06:#'#("&#(	( #($)$)26+//4#()$, %)&+!$$(%)*.& ',#($)*/	# ',!$#($)*.( ',!$$(%)#($)*.$ ',!$$(,0%)#($)*.	*  #ACJ y  ) +$(%)$(-$ %+%+$
 %+%+*#* "#3 "#3 	 ##Gg[	zA
j YkzA
l Z] N| ]^j	
 Z ] Y . - . 0 0 0 - ]  ]!" ]#$ /))))&/25mzA
f "!%&%!gzA
 z z	    c                 n   U R                  SSS5      nUc  0 $ 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	0 n
U R                  US	/ 5      nU R                  U R                  US
S5      5      n[        S[        U5      5       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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
S5      5      nUUSUUSU R                  U5      U R                  U5      USS.USS.S.US.
U
U'   M     [        U5      nSnU R                  US5      (       a  SnO$US:X  a  U R                  U5      (       a  SnOSnOSnU R                  UUUU	USSSSU R                  U5      SSS.SSS.S.U
S.5      XH'   GM     U$ )z
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
rR   webExchangeGetV3AssetsTNdatar   symbolr+   binding_gatewayswithdrawal_scalescalegateway_nameis_deposit_enabledis_withdrawal_enabledmin_deposit_amountmin_withdrawal_amountwithdrawal_feeminmax)depositrs   )
r*   networkr6   r  rs   activefee	precisionlimitsinfois_fiatfiat	leveragedothercrypto)amountrs   )r*   coder  r+   typer  r  rs   r  r  r  r8  )fetch_web_endpoint	safe_listrangelensafe_stringsafe_currency_codeparse_precisionsafe_string_2network_id_to_code	safe_boolr  is_leveraged_currencysafe_currency_structure)r  paramsr  currenciesDataresulticurrencyr*   r  r+   r8  chainscurrencyMaxPrecisionjchain	networkIdnetworkCoder  rs   minDepositAmountminWithdrawalAmountwithdrawalFeer  chainLengthr  s                            r  fetch_currenciesbigone.fetch_currencies  s    &&'8:RTXY<IZ fb9q#n-.A%(H!!(H5B**2.D##Hf5DH^^H.@"EF#'#7#78J8J8Ugip8q#r 1c&k*	 ,,UNC	"55i@..0DE>>%1HI#'#3#3E;O#P &*&6&6u>U&V# $ 0 08H I 001C1CEK]_f1gh	#*"& (",,];!%!2!29!= $4#'$
 $7#'%	 "')% +> f+KD~~h	22!--b11&D"D77  !../CD  $#
  $#!	 %+9 FLe /R r  c                    U R                  U5      U R                  U5      /nUnUS   nUS   nU R                  US/ 5      n/ n[        S[	        U5      5       GH  nXh   n	U R                  U	S0 5      n
U R                  U	S0 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 R                  0 SU R                  U	S5      _S	U R                  U	S5      _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S_SS_SSSSSSSU R                  U R                  U R                  U	S5      5      5      U R                  U R                  U R                  U	S5      5      5      S.SSS.SSS.SSS.U R                  U	S 5      U R                  U	S!5      S.S".SU	S#.E5      5        GM     [        S[	        U5      5       GH  nXX   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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U_SU_SU_SU_SU_SS_SS_SS_SS_SS_SS_SU R                  U	S)5      _SS_S*U(       + _UU R                  U	S+5      SSSSU R                  U R                  U R                  U	S,5      5      5      U R                  U R                  U R                  U	S-5      5      5      S.SSS.SSS.U R                  U	S.5      U R                  U	S/5      S.U R                  U	S05      SS.S".U	S1.	E5      5        GM     U$ )2z
retrieves data on all markets for bigone

https://open.big.one/docs/spot_asset_pair.html

:param dict [params]: extra parameters specific to the exchange API endpoint
:returns dict[]: an array of objects representing market data
r      r  
base_assetquote_assetr  r*   r+   uuid/basequotesettleNbaseIdquoteIdsettleIdr  r5   Tr6   Fr7   r8   r9   r  contract
base_scalequote_scale)r  pricer  min_quote_valuemax_quote_value)rH  r  r  cost)r]  r^  contractSizeexpiryexpiryDatetimestrike
optionTyper  r  createdr  baseCurrencyquoteCurrencysettleCurrency	isInverse:enabler]  
multipliervaluePrecisionpricePrecisionpriceMinpriceMaxinitialMargin)	r^  r  r  r  r  r  r  r  r  )publicGetAssetPairscontractPublicGetSymbolsr  r  r  	safe_dictr  r  appendsafe_market_structurer  r  safe_numberr  )r  r  promisespromisesResultresponsecontractResponsemarketsr  r  market	baseAsset
quoteAssetr  r  r  r  r  marketIdr  r^  s                       r  fetch_marketsbigone.fetch_marketsZ  sO    ,,V4d6S6STZ6[\!!!$)!,j ..626q#g,'AZFv|R@IrBJ%%i:F&&z8<G**62D++G4EMM$44 16d&&vv616((616 $*u,16 	16
 16 $16 &16 716 D16 16 16 %16 16 %16 %16  $!16" E#16$  $"&""//0D0DTEUEUV\^jEk0lm!..t/C/CDDTDTU[]jDk/lm  $#!
  $#
  $#
  $//8IJ#//8IJ$  a16 1 1 (t q#./0A%(F%%fn=F&&v?G''0@AH''9H**62D++G4E,,X6FnnV[9GMM$44 /6h/6$*u,s2V;/6 /6 	/6
 &/6 &/6 7/6 H/6 /6 /6 %/6 /6 %/6 %/6 $..:/6  D!/6" g+#/6$ # $ 0 0 F"&""//0D0DTEUEUV\^nEo0pq!..t/C/CDDTDTU[]mDn/op  $#!
  $#
  $//
C#//
C
  $//H#$ ]/6 / / 1t r  Ntickerr  c           
         SU;   a  SOSnU R                  USS5      nU R                  XBSU5      nU R                  USS5      nU R                  US0 5      nU R                  US	0 5      nU R                  0 SU_S
S _SS _SU R                  USS5      _SU R                  US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 R	                  US5      _SU_SU_SS _SU R                  USS5      _SS _SS _U R                  USS5      U R	                  US5      U R	                  US 5      U R	                  US!5      US".EU5      $ )#Nasset_pair_namer5   r7   r  -closelatestPricebidask	timestampdatetimehighlast24hMaxPricelowlast24hMinPricer  	bidVolumequantity	askVolumevwapopenr[  previousClosechangedaily_changelast24hPriceChange
percentageaveragevolume	volume24hvolume24hInUsd	markPrice
indexPrice)
baseVolumequoteVolumer  r  r  )r  safe_symbolr  safe_tickerr  )	r  r  r  
marketTyper  r  r  r  r  s	            r  parse_tickerbigone.parse_ticker  s   ^ !2V ;V&
%%f.?J!!(CD""67MBnnVUB/nnVUB/ !
f!
!
 !
 D&&vv7HI	!

 4%%fe5FG!
 4##C1!
 ))#z:!
 4##C1!
 ))#z:!
 D!
 D$$VV4!
 U!
 E!
 T!
 d((AUV!
  $!!
" t#!
$ ,,VX{K++F4DE))&+>**6<@-!
. / 	r  r  c                 Z   U R                  5         U R                  U5      nSnU R                  SX25      u  pBUS:X  aK  SUS   0nU R                  U R	                  XR5      5      nU R                  US0 5      nU R                  Xs5      $ U R                  U/U5      nU R                  X5      $ )a  
fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market

https://open.big.one/docs/spot_tickers.html

: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>`
Nrg   r5   r  r*   r  )	load_marketsr  handle_market_type_and_params&publicGetAssetPairsAssetPairNameTickerextendr  r  fetch_tickers
safe_value)	r  r  r  r  r  requestr  r  tickerss	            r  fetch_tickerbigone.fetch_tickera  s     	V$99-X6>!6$<G BB4;;wC_`H" ^^Hfb9F$$V44((&6:G??733r  r   c                    U R                  5         SnU R                  US5      nUb  U R                  U5      nSnU R                  SX25      u  pRUS:H  n0 nU R	                  U5      nSnU(       a\  Ub%  U R                  U5      n	SR                  U	5      US'   U R                  U R                  Xr5      5      n
U R                  U
S/ 5      nOU R                  U5      nU R                  X5      nU R                  USU5      $ )	a  
fetches price tickers for multiple markets, statistical information calculated over the past 24 hours for each market

https://open.big.one/docs/spot_tickers.html

:param str[] [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>`
Nr   rh   r5   ,
pair_namesr  r  )r!  r  r  r"  market_symbols
market_idsjoinpublicGetAssetPairsTickersr$  r  contractPublicGetInstrumentsparse_tickersfilter_by_array_tickers)r  r   r  r  r  r  isSpotr'  r  idsr  r(  s               r  r%  bigone.fetch_tickers  s    	!!'1-[[(F99.&Y%%g."oog.(+%66t{{77STH8 >>(FB7D44V<D4 $$T3++GXwGGr  c                     U R                  U5      nU R                  US0 5      nU R                  US5      nU R                  US-  5      $ )a  
fetches the current integer timestamp in milliseconds from the exchange server

https://open.big.one/docs/spot_ping.html

:param dict [params]: extra parameters specific to the exchange API endpoint
:returns int: the current integer timestamp in milliseconds from the exchange server
r  	Timestamp@B )publicGetPingr  safe_integerparse_to_int)r  r  r  r  r  s        r  
fetch_timebigone.fetch_time  sP     %%f- ~~h3%%dK8	  W!455r  rN  c           	         U R                  5         U R                  U5      nSnUS   (       a<  SUS   0nU R                  U R                  Xc5      5      nU R	                  XTS   U5      $ SUS   0nUb  X&S'   U R                  U R                  Xc5      5      nU R                  US0 5      nU R                  XtS   SSS	S
S5      $ )a	  
fetches information on open orders with bid(buy) and ask(sell) prices, volumes and other data

https://open.big.one/docs/contract_misc.html#get-orderbook-snapshot

: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
Nr  r  r*   r  rN  r  bidsasksr  r
  )r!  r  $contractPublicGetDepthSymbolSnapshotr$  parse_contract_order_book%publicGetAssetPairsAssetPairNameDepthr  parse_order_book)r  r  rN  r  r  r  r'  	orderbooks           r  fetch_order_bookbigone.fetch_order_book  s     	V$*&,G @@WA]^H8 11(8<LeTT "6$<G  #( AA$++gB^_H x<I((84DdFTZ\ceoppr  c                     [        UR                  5       5      n/ n[        S[        U5      5       H<  nX$   nX   nUR	                  U R                  U5      U R                  U5      /5        M>     U$ )Nr   )listkeysr  r  r  r  )r  bidsAsksbidsAsksKeysr  r  r  r  s          r  parse_contract_bids_asksbigone.parse_contract_bids_asks:  si    HMMO,q#l+,A OE_FMM4,,U3T5F5Fv5NOP - r  rG  c                 "   U R                  US5      nU R                  US5      nU R                  U5      nU R                  U5      nUU R                  U R                  USS5      U5      U R                  U R                  US5      U5      S S S S.$ )NrA  rB  r   T)r  rA  rB  r  r  nonce)r&  rO  filter_by_limitsort_by)r  rG  r  rN  responseBidsresponseAsksrA  rB  s           r  rD   bigone.parse_contract_order_bookC  s    y&9y&9,,\:,,\:((dAt)DeL((dA)>F
 	
r  tradec                    U R                  U R                  USS5      5      nU R                  US5      nU R                  US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S n	Ub  Ub  US	:w  a	  X:X  a  S
OSn	Uc  US:X  a  SOSnOUS:X  a  SnOUS:X  a  SnU R                  US5      n
U R                  US5      nS nU
b  U
nOUb  UnU R                  US5      nUUU R	                  U5      US   USUU	UUS US.nU	b>  US:X  a  U	S:X  a  US   nUS   nONUS   nUS   nOCU	S:X  a  US   nUS   nO2US   nUS   nO'US	:X  a!  US:X  a  US   nUS   nOUS:X  a
  US   nUS   nU R                  US5      nU R                  US5      nUb  Ub  UWS.UWS./US'   OUWS.US'   OUb	  UWS.US'   OS US'   U R                  X5      $ )N
created_atinserted_atr  r  r  r  side
taker_sideSELF_TRADINGr   r   ASKsellbuyBIDmaker_order_idtaker_order_idr*   r  rN  )r*   r  r  r  orderr  r\  takerOrMakerr  r  r  r  r  r  	maker_fee	taker_fee)r  r  r   r  )	parse8601r  r  safe_marketiso8601
safe_trade)r  rX  r  r  priceStringamountStringr  r\  	takerSiderf  makerOrderIdtakerOrderIdorderIdr*   r  makerCurrencyCodetakerCurrencyCodemakerFeeCosttakerFeeCosts                      r  parse_tradebigone.parse_tradeQ  s   T NN4#5#5e\=#YZ	&&ug6''x8##E+<=!!(C8v.$$UL9	 !(8t~?U'0'87wL< (506uDu}''/?@''/?@#"G%"GeT*"Y/X&( "
  #u}7*(.v%(.w%(.w%(.v%7*(.w%(.v%(.v%(.w%^#E!$*7O!$*6N!e#$*6N!$*7O!''{;''{;#')7HI)7HI"v
 *6CT Uu%%1?PQF5M F5Mv..r  sincec                     U R                  5         U R                  U5      nUS   (       a  [        U R                  S-   5      eSUS   0nU R	                  U R                  Xd5      5      nU R                  US/ 5      nU R                  XX#5      $ )a  
get the list of most recent trades for a particular symbol

https://open.big.one/docs/spot_asset_pair_trade.html

:param str symbol: unified symbol of the market to fetch trades for
:param int [since]: timestamp in ms of the earliest trade to fetch
:param int [limit]: the maximum amount of trades to fetch
:param dict [params]: extra parameters specific to the exchange API endpoint
:returns Trade[]: a list of `trade structures <https://docs.ccxt.com/#/?id=public-trades>`
r  z5 fetchTrades() can only fetch trades for spot marketsr  r*   r  )r!  r  r!   r*   &publicGetAssetPairsAssetPairNameTradesr$  r  parse_trades	r  r  ry  rN  r  r  r'  r  r   s	            r  fetch_tradesbigone.fetch_trades  s     	V$*tww)``aavd|
 >>t{{7?[\, &"5  >>r  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      /$ )Ntimer  r  r  r  r  )ri  r  r  )r  ohlcvr  s      r  parse_ohlcvbigone.parse_ohlcv  sw     NN4++E6:;UF+UF+UE*UG,UH-
 	
r  r   	timeframec                    U R                  5         U R                  U5      nUS   (       a  [        U R                  S-   5      eU R	                  US5      nUSLnUSLn	Uc  U	(       a	  U(       a  SOSnUS   U R                  U R                  X"5      US.n
U	(       ae  U R                  U5      nU R                  X4U-  S	-  5      nU(       a!  U R                  [        XS
-   5      5      U
S'   O3U R                  U5      U
S'   OU(       a  U R                  US
-   5      U
S'   U R                  US5      nU R                  U R                  X5      5      nU R                  US/ 5      nU R                  XX#U5      $ )a  
fetches historical candlestick data containing the open, high, low, and close price, and the volume of a market

https://open.big.one/docs/spot_asset_pair_candle.html

: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]: timestamp in ms of the earliest candle to fetch
:returns int[][]: A list of candles ordered, open, high, low, close, volume
r  z4 fetchOHLCV() can only fetch ohlcvs for spot marketsuntilNrT  d   r*   )r  periodrN    r  r  r  )r!  r  r!   r*   r<  r  rt   parse_timeframesumrk  r  omit'publicGetAssetPairsAssetPairNameCandlesr$  r  parse_ohlcvs)r  r  r  ry  rN  r  r  r  untilIsDefinedsinceIsDefinedr'  duration
endByLimitr  r  s                  r  fetch_ohlcvbigone.fetch_ohlcv  s^    	V$*tww)__``!!&'2t+t+=*~CCE%d|&&t	M

 ++I6H%)9D)@AJ"&,,s:qy/I"J"&,,z":"ll5195GFO67+??G@\]0 ~~h3  yGGr  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)r  r  r  r  r   asset_symbolbalancetotallocked_balanceused)r  r  r  r  r  accountsafe_balance)	r  r  r  balancesr  r  r  r  r  s	            r  parse_balancebigone.parse_balanceN  s    

 >>(FB7q#h-(AkG%%g~>F**62DllnG#//CGG"..w8HIGFO"4L )   ((r  c                     U R                  5         U R                  USS5      nU R                  US5      nSnUS:X  d  US:X  a  U R                  U5      nOU R	                  U5      nU R                  U5      $ )a]  
query for balance and get the amount of funds available for trading or funds locked in orders

https://open.big.one/docs/fund_accounts.html
https://open.big.one/docs/spot_accounts.html

:param dict [params]: extra parameters specific to the exchange API endpoint
:returns dict: a `balance structure <https://docs.ccxt.com/#/?id=balance-structure>`
r   Nr   r   )r!  r  r  privateGetFundAccountsprivateGetAccountsr  )r  r  r  r  s       r  fetch_balancebigone.fetch_balance_  sz     	366*9226:H..v6H !!(++r  r  c                 4    SSSSS.nU R                  X!U5      $ )NrN  r  )
STOP_LIMITSTOP_MARKETLIMITMARKETr  )r  r  typess      r  
parse_typebigone.parse_type}  s*    !#	
 T22r  re  c           
         U R                  US5      nU R                  US5      nU R                  XBS5      nU R                  U R                  US5      5      nU R                  US5      nUS:X  a  SnOSnU R                  US	5      n[        R                  " US
5      (       a  S nU R                  US5      n	S n
U	(       a  Sn
U R                  U R                  US5      5      nU R                  US5      nS nS nS nUS:X  a  US:X  a  U R                  US5      nO$U R                  US5      nU R                  US5      nU R                  0 SU_SU_SU R                  US5      _SU_SU R                  U5      _SU R                  U R                  US5      5      _SU_SU_SU
_SU R                  US5      _SU_SU_SU_SU_SU_SU R                  US 5      _S!U_S U R                  U R                  US"5      5      S S S#.EU5      $ )$Nr*   r  r  rZ  r\  rb  ra  r`  
stop_price0immediate_or_cancelr:  r  r  r  filled_amountr  r  clientOrderIdclient_order_idr  r  lastTradeTimestamp
updated_atr  rE  postOnly	post_onlyr?  r  r  avg_deal_pricefilledstate)	remainingstatusr  r   )
r  r  ri  r$   	string_eqr  r  
safe_orderrk  parse_order_status)r  re  r  r*   r  r  r  r\  r?  immediateOrCancelrE  r  r  r  r  r  s                   r  parse_orderbigone.parse_order  s   ( eT*##E+<=!!(C8NN4#3#3E<#HI	v.5=DD''|<\3//L NN52GHKt//v>?  08##E?;D%%eX6F%%e_=F  
E 
" 
 T--e5FG 
 	 

 Y/ 
 !$..1A1A%1V"W 
 f 
 D 
 ; 
 uk: 
 D 
 U 
 L 
 f 
 D 
  t''/?@! 
" f# 
$ --d.>.>ug.NO+ 
, - 	r  r  c                     U R                  5         U R                  U5      nUS   (       d  [        U R                  S-   5      eSUS'   U R	                  USSUSU5      $ )a  
create a market buy order by providing the symbol and cost

https://open.big.one/docs/spot_orders.html#create-order

:param str symbol: unified symbol of the market to create an order in
:param float cost: how much you want to trade in units of the quote currency
:param dict [params]: extra parameters specific to the exchange API endpoint
:returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
r5   z9 createMarketBuyOrderWithCost() supports spot orders onlyFr3  r  ra  N)r!  r  r!   r*   create_order)r  r  r  r  r  s        r  !create_market_buy_order_with_cost(bigone.create_market_buy_order_with_cost  s`     	V$f~tww)ddee6;23  5$fMMr  r\  r  r  c                 R   U R                  5         U R                  U5      nUS:H  nU(       a  SOSn	UR                  5       n
U
S:H  nU R                  USS5      nSnU R	                  U
S:H  X5      u  pU R                  U/ S	Q5      nUS
   U	U R                  X5      S.nU(       d  U
S:X  aY  U R                  X5      US'   U(       a)  U R                  US5      nUS:X  a  SUS'   U(       a  SUS'   U R                  X5      US'   OU(       a  SnU R                  USSS5      u  nnU R                  US5      nU R                  US5      nU(       a  Uc  Uc  [        U R                  S-   5      eU R                  U5      nU R                  U5      nU R                  [         R"                  " UU5      5      nUb  UOUnU R%                  UU5      US'   O)U R%                  X5      US'   OU R                  X5      US'   Ub4  U R                  X5      US'   U(       a  SOSUS'   U(       a  Sn
OU
S:X  a  Sn
XS'   U R                  US5      nUb  UUS'   U R                  U/ SQ5      nU R'                  U R)                  X5      5      nU R+                  US 5      nU R-                  UU5      $ )!ag  
       create a trade order

       https://open.big.one/docs/spot_orders.html#create-order

       :param str symbol: unified symbol of the market to create an order in
       :param str type: 'market' or 'limit'
       :param str side: 'buy' or 'sell'
       :param float amount: how much of currency you want to trade in units of base currency
       :param float [price]: the price at which the order is to be fulfilled, in units of the quote currency, ignored in market orders
       :param dict [params]: extra parameters specific to the exchange API endpoint
       :param 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 str [params.timeInForce]: "GTC", "IOC", or "PO"
       :param float [params.cost]: *spot market buy only* the quote quantity that can be used alternative for the amount

EXCHANGE SPECIFIC PARAMETERS
       :param str [params.operator]: *stop order only* GTE or LTE(default)
       :param str [params.client_order_id]: must match ^[a-zA-Z0-9-_]{1,36}$ self regex. client_order_id is unique in 24 hours, If created 24 hours later and the order closed, it will be released and can be reused
       :returns dict: an `order structure <https://docs.ccxt.com/#/?id=order-structure>`
       ra  rb  r_  r  r  FNr  )r?  	stopPricer  r*   )r  r\  r  r  r  rE  r:  Tr  r  rB   r3  r  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 argumentr  GTELTEoperatorr  r  r  r  )r  r  r?  rE  r  r  )r!  r  upperr  handle_post_onlysafe_string_namount_to_precisionprice_to_precisionr  handle_option_and_paramsr  r  r    r*   number_to_stringparse_to_numericr$   
string_mulcost_to_precisionprivatePostOrdersr$  r  r  )r  r  r  r\  r  r  r  r  isBuyrequestSideuppercaseTypeisLimitexchangeSpecificParamr  r?  r'  rE  r3  r  rn  rm  quoteAmountcostRequestr  r  re  s                             r  r  bigone.create_order  s   , 	V$$e%

7* $v{E J00-82KNcl))&2]^%d|..v>
 }4#66vEGG"..v}E%'59G12+/GK( $ 8 8 HGH481<@<Y<YZ`bo  rU  W[  =\916''76624DL*477  6q  ,q  r  r'+'<'<V'D&*&;&;E&B&*&;&;G<N<N|]h<i&j/3/?dk,0,B,B6;,W)(,(>(>v(NGH%$($<$<V$L!#$($;$;F$QGL!+0%eGJ ,(* -'((A$)6G%&6#no))$++g*FG x0v..r  r*   c                     U R                  5         SU0nU R                  U R                  XC5      5      nU R                  US5      nU R	                  U5      $ )a<  
cancels an open order

https://open.big.one/docs/spot_orders.html#cancel-order

:param str id: order id
:param str symbol: Not used by bigone cancelOrder()
:param dict [params]: extra parameters specific to the exchange API endpoint
:returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
r*   r  )r!  privatePostOrdersIdCancelr$  r  r  r  r*   r  r  r'  r  re  s          r  cancel_orderbigone.cancel_orderA  sU     	r
11$++g2NO x0&&r  c           	         U R                  5         U R                  U5      nSUS   0nU R                  U R                  XB5      5      nU R	                  US0 5      nU R                  US/ 5      nU R                  US/ 5      n/ n	[        S[        U5      5       H+  n
Xz   nU	R                  U R                  UUSS.5      5        M-     [        S[        U5      5       H+  n
X   nU	R                  U R                  UUSS.5      5        M-     U	$ )	ay  
cancel all open orders

https://open.big.one/docs/spot_orders.html#cancel-all-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>`
r  r*   r  	cancelledfailedr   canceled)r  r*   r  )
r!  r  privatePostOrdersCancelr$  r  r  r  r  r  r  )r  r  r  r  r'  r  r  r  r  r  r  rr  s               r  cancel_all_ordersbigone.cancel_all_orders^  s    	V$vd|
 //G0LM ~~h3NN4b9	h3q#i.)AlGMM$//$+   * q#f+&AiGMM$//"+   ' r  c                     U R                  5         SU0nU R                  U R                  XC5      5      nU R                  US0 5      nU R	                  U5      $ )aY  
fetches information on an order made by the user

https://open.big.one/docs/spot_orders.html#get-one-order

:param str id: the order id
:param str symbol: not used by bigone fetchOrder
:param dict [params]: extra parameters specific to the exchange API endpoint
:returns dict: An `order structure <https://docs.ccxt.com/#/?id=order-structure>`
r*   r  )r!  privateGetOrdersIdr$  r  r  r  s          r  fetch_orderbigone.fetch_order  sU     	r
**4;;w+GHx4&&r  c                     Uc  [        U R                  S-   5      eU R                  5         U R                  U5      nSUS   0nUb  X6S'   U R	                  U R                  Xd5      5      nU R                  US/ 5      nU R                  XX#5      $ )a  
fetches information on multiple orders made by the user

https://open.big.one/docs/spot_orders.html#get-user-orders-in-one-asset-pair

: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>`
z) fetchOrders() requires a symbol argumentr  r*   rN  r  )r   r*   r!  r  privateGetOrdersr$  r  parse_orders)	r  r  ry  rN  r  r  r'  r  r   s	            r  fetch_ordersbigone.fetch_orders  s     >#DGG.Y$YZZV$vd|
 $G((W)EF* &"5  >>r  c                     Uc  [        U R                  S-   5      eU R                  5         U R                  U5      nSUS   0nUb  X6S'   U R	                  U R                  Xd5      5      nU R                  US/ 5      nU R                  XX#5      $ )a  
fetch all trades made by the user

https://open.big.one/docs/spot_trade.html#trades-of-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>`
z+ fetchMyTrades() requires a symbol argumentr  r*   rN  r  )r   r*   r!  r  privateGetTradesr$  r  r|  r}  s	            r  fetch_my_tradesbigone.fetch_my_trades  s     >#DGG.[$[\\V$vd|
 $G((W)EFF &"5  >>r  r  c                 0    SSSS.nU R                  X!5      $ )Nr  closedr  )PENDINGFILLED	CANCELLEDr  r  r  statusess      r  r  bigone.parse_order_status  s%    #

 11r  c           	      L    SS0nU R                  XX0R                  XT5      5      $ )a  
fetch all unfilled currently open orders

https://open.big.one/docs/spot_orders.html#get-user-orders-in-one-asset-pair

: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>`
r  r  r  r$  r  r  ry  rN  r  r'  s         r  fetch_open_ordersbigone.fetch_open_orders  s.     Y
   {{77STTr  c           	      L    SS0nU R                  XX0R                  XT5      5      $ )a  
fetches information on multiple closed orders made by the user

https://open.big.one/docs/spot_orders.html#get-user-orders-in-one-asset-pair

: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>`
r  r  r  r  s         r  fetch_closed_ordersbigone.fetch_closed_orders%  s.     X
   {{77STTr  c                     U R                  U R                  SS5      S-  nU R                  U R                  5       S-  U5      $ )Nr5  r   r:  r  )r<  r   r  microseconds)r  exchangeTimeCorrections     r  rR  bigone.nonce6  sC    !%!2!24<<Aacd!eho!oxx))+d24JKKr  r   GETc                    U R                  X@R                  U5      5      nU R                  U R                  S   U   5      nUS-   U R	                  X5      -   n	0 nUS:X  d  US:X  d  US:X  a  U(       a  U	SU R                  U5      -   -  n	OU R                  5         [        U R                  5       5      n
SU R                  U
S.nU R                  XR                  U R                  5      S	5      nS
U-   US'   US:X  a  U(       a  U	SU R                  U5      -   -  n	OUS:X  a  SUS'   U R                  U5      nSU R                  -   S-   U R                  -   US'   XXeS.$ )Nr   r  r   r   r   ?	OpenAPIV2)r  subrR  sha256zBearer Authorizationr  POSTzapplication/jsonzContent-Typezccxt/r  z
User-Agent)urlmethodbodyheaders)r  extract_paramsimplode_hostnamer   implode_params	urlencodecheck_required_credentialsstrrR  apiKeyjwtencodesecretjsonr*   r/   )r  pathr   r  r  r  r  querybaseUrlr  rR  r'  tokens                r  signbigone.sign:  sV   		&"5"5d";<''		%(8(=>md11$??(?c]2c=M6MsT^^E222++-

%E#{{G HHWkk$++&>IE'05'8GO$3!666C6!*<'yy' '$'' 1C 7$,, FdOOr  r  c                 4   U R                  5         U R                  U5      nSUS   0nU R                  U5      u  pVU R                  U R	                  XF5      5      nU R                  US/ 5      n[        U5      n	U	S:  a  [        U R                  S-   5      eU R                  US5      n
U R                  XU
5      nU R                  X0 5      nU R                  US5      nU R                  US5      nU R                  U5        UUU R                  U5      UUS	.$ )
ai  
fetch the deposit address for a currency associated with self account

https://open.big.one/docs/spot_deposit.html#get-deposite-address-of-one-asset-of-user

:param str code: unified currency code
:param dict [params]: extra parameters specific to the exchange API endpoint
:returns dict: an `address structure <https://docs.ccxt.com/#/?id=address-structure>`
r  r*   r  r  z6 fetchDepositAddress() returned empty address responser  valuememo)r  r  r  addresstag)r!  r  handle_network_code_and_params"privateGetAssetsAssetSymbolAddressr$  r  r  r   r*   index_by#select_network_id_from_raw_networksr  r  check_addressr  )r  r  r  r  r'  r  paramsOmittedr  r  
dataLengthchainsIndexedByIdselectedNetworkIdaddressObjectr/  r0  s                  r  fetch_deposit_addressbigone.fetch_deposit_addressV  s"    	==&HTN
 &*%H%H%P"::4;;w;^_$ ~~h3Y
>*b bcc MM$8 DDTXij'8RP""=':}f57#../@A
 	
r  c                 6    SSSSSS.nU R                  X!U5      $ )Nokpending)WITHHOLDUNCONFIRMED	CONFIRMED	COMPLETEDr  r  r   s      r  parse_transaction_statusbigone.parse_transaction_status  s/     $ 
 &99r  transactionr  c                    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 R                  US5      5      nU R	                  U R                  US5      5      nU R	                  U R                  USS5      5      n	U R                  US5      n
U R                  US	5      nU R                  US
5      nSU;   a  S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S _SS _SU_SS _SU_SS _SU_SU_SU_SU_SU	_S S US.E$ )Nr  r*   r  r  r[  r  completed_attxidtarget_addressr.  customer_id
withdrawalr  is_internalr  r  r  r  addressFromr/  	addressTotagFromr0  tagTor  r  r  updated)r  commentinternal)r  r  r  rD  ri  r  r  rk  )r  rF  r  
currencyIdr  r*   r  r  r  rR  rI  r/  r0  r  rT  s                  r  parse_transactionbigone.parse_transaction  s   h %%k>B
&&z2k40!!+x8..t/?/?W/UVNN4#3#3K#OP	..!3!3K~!^_V4"";0@A{F3 - <|9>>+}=
K
"
 D
 	

 Y/
 t
 4
 t
 
 t
 3
 T
 D
 f
 
  f!
" w#
$  )
 	
r  c                     U R                  5         0 nSnUb  U R                  U5      nUS   US'   Ub  X5S'   U R                  U R                  XT5      5      nU R	                  US/ 5      nU R                  XX#5      $ )a  
fetch all deposits made to an account

https://open.big.one/docs/spot_deposit.html#deposit-of-user

:param str code: unified currency code
:param int [since]: the earliest time in ms to fetch deposits for
:param int [limit]: the maximum number of deposits structures to retrieve
:param dict [params]: extra parameters specific to the exchange API endpoint
:returns dict[]: a list of `transaction structures <https://docs.ccxt.com/#/?id=transaction-structure>`
Nr*   r  rN  r  )r!  r  privateGetDepositsr$  r  parse_transactions)	r  r  ry  rN  r  r'  r  r  r   s	            r  fetch_depositsbigone.fetch_deposits  s     	
 }}T*H&.tnGN#$G**4;;w+GH, >>(FB7&&x5HHr  c                     U R                  5         0 nSnUb  U R                  U5      nUS   US'   Ub  X5S'   U R                  U R                  XT5      5      nU R	                  US/ 5      nU R                  XX#5      $ )a  
fetch all withdrawals made from an account

https://open.big.one/docs/spot_withdrawal.html#get-withdrawals-of-user

:param str code: unified currency code
:param int [since]: the earliest time in ms to fetch withdrawals for
:param int [limit]: the maximum number of withdrawals structures to retrieve
:param dict [params]: extra parameters specific to the exchange API endpoint
:returns dict[]: a list of `transaction structures <https://docs.ccxt.com/#/?id=transaction-structure>`
Nr*   r  rN  r  )r!  r  privateGetWithdrawalsr$  r  rZ  )	r  r  ry  rN  r  r'  r  r  r   s	            r  fetch_withdrawalsbigone.fetch_withdrawals  s     	
 }}T*H&.tnGN#$G--dkk'.JK, nnXvr:&&{eKKr  fromAccount	toAccountc                 0   U R                  5         U R                  U5      nU R                  U R                  S0 5      nU R	                  XsU5      nU R	                  XtU5      n	U R	                  USU R                  5       5      n
US   U R                  X5      UU	U
S.nU R                  U R                  X5      5      nU R                  X5      nU R                  U R                  S0 5      nU R                  USS5      nU(       a  X=S'   XMS	'   X-S
'   XS'   U$ )a  
transfer currency internally between wallets on the same account

https://open.big.one/docs/spot_transfer.html#transfer-of-user

:param str code: unified currency code
:param float amount: amount to transfer
:param str fromAccount: 'SPOT', 'FUND', or 'CONTRACT'
:param str toAccount: 'SPOT', 'FUND', or 'CONTRACT'
:param dict [params]: extra parameters specific to the exchange API endpoint
:returns dict: a `transfer structure <https://docs.ccxt.com/#/?id=transfer-structure>`
r4  guidr*   )r  r  fromtord  rr   r   Tra  rb  r  )r!  r  r  r   r  r  currency_to_precisionprivatePostTransferr$  parse_transferr  )r  r  r  ra  rb  r  r  r4  fromIdtoIdrd  r'  r  rr   transferOptionsr   s                   r  rr   bigone.transferP  s    	==&6FK!!.{K9E		<tn00>
 ++DKK,HI &&x:..z2F"&..B[]a"b"&1]#$-[!!'X!TNr  rr   c                 \    U R                  US5      nUS S S S S S S U R                  U5      S.	$ )Nr  )	r  r*   r  r  r  r  ra  rb  r  )r  parse_transfer_status)r  rr   r  r  s       r  ri  bigone.parse_transfer}  sF     &1006

 
	
r  c                 .    SS0nU R                  X!S5      $ )Nr  r>  r  r  r   s      r  ro  bigone.parse_transfer_status  s#    
 (;;r  r/  r0  c                    U R                  XE5      u  pEU R                  5         U R                  U5      nUS   UU R                  X5      S.nUb  XGS'   SnU R	                  U5      u  pUb  U R                  U5      US'   U R                  U R                  Xu5      5      n	U R                  U	S0 5      n
U R                  X5      $ )a  
make a withdrawal

https://open.big.one/docs/spot_withdrawal.html#create-withdrawal-of-user

: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>`
r*   )r  rJ  r  Nr.  r  r  )
handle_withdraw_tag_and_paramsr!  r  rg  r1  network_code_to_idprivatePostWithdrawalsr$  r  rV  )r  r  r  r/  r0  r  r  r'  r  r  r  s              r  rs   bigone.withdraw  s     99#F==&tn%00>

 ?!FO"AA&I"&*&=&=k&JGN#..t{{7/KL, ~~h3%%d55r  httpCodereasonr  r  r  r  c
                 Z   Uc  g U R                  US5      n
U R                  US5      nU
S:w  a}  U
bz  U R                  S-   U-   nU R                  U R                  S   X5        U R                  U R                  S   X5        U R	                  U R                  S   X5        [        U5      eg )Nr  messager   rv  rw  )r  r*   throw_exactly_matched_exceptionr`  throw_broadly_matched_exceptionr   )r  rx  ry  r  r  r  r  r  requestHeadersrequestBodyr  r{  feedbacks                r  handle_errorsbigone.handle_errors  s    
 &1""8Y7CKd.ww}t+H001I7]001I4Z001I7]))r   )N)H__name__
__module____qualname____firstlineno__r   r  r   r  r   r   r  dictr   r  r   r)  r   r   r%  r
   r>  r   rH  rO  objectrD  r   rw  r~  rK  r  r  r   r  r  r  r   r  floatr  r   r   r   r  r   r  r  r  r  r  r  r  r	  rR  r*  r	   r;  rD  r   r   rV  r[  r_  r   rr   ri  ro  rs   intr  __static_attributes____classcell__)r  s   @r  r&   r&      s
   {# {z ') AZ AF $& w$v, wrL4 L L6 L\ 02 '43 '4f '4R 04B RHW RH7 RHh !# 6s 6* :>b Eqs Eq3 EqY EqN
6 
3 
s 
^g 
y/ y/v y/ y/v 6:UW *?3 *?s *?# *?\`af\g *?X
 
4 
( 9=4^bkm @H# @H# @HS @HX[ @Hrvw{r| @HD) )" $& ,( ,<3s 3D Dv D DL RT N N5 N$ gksu a/3 a/i a/y a/RW a/`c a/F 37r 's 'C ': /32 . .` 26b 'c '3 '" *.Dt\^ /?3 /?c /? /?cghmcn /?b -1tRV_a :?c :? :?C :?x2 2 /3TXac U U3 Uc Uhlmrhs U" 154VZce U# US UPS Ujnotju U"L &eBSW P8 79 2
# 2
^ 2
h	:s 	:U
T U
X U
Q\ U
n *.Dt\^ 0I3 0Ic 0I 0Icghsct 0Id -1tRV_a 0Lc 0L 0LC 0Lfjkvfw 0Ld [] +S +% +c +c +an +Z
t 
x 
= 
(<C <C < KOWY 36S 36% 36# 36C 36^i 36jc 3 S # X\ dg  r  r&   N)*ccxt.base.exchanger   ccxt.abstract.bigoner   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"   ccxt.base.decimal_to_precisionr#   ccxt.base.preciser$   r&   r  r  r  <module>r     sh    ( , L  L  L  L  L  L  * 0 - . ' & . ) ) . 4 %C#X{ C#r  