
    E#iz                    ,   S SK Jr  S SKJr  S SKrS SKJrJrJrJ	r	J
r
JrJrJrJrJrJrJrJrJrJrJrJrJrJr  S SKJr  S SKJr  S SKJr  S SKJr  S S	KJr  S S
KJ r   S SKJ!r!  S SKJ"r"  S SKJ#r#  S SKJ$r$  S SKJ%r%  S SK&J'r'  S SK(J)r)   " S S\\5      r*g)    )Exchange)ImplicitAPIN)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    S/home/james-whalen/.local/lib/python3.13/site-packages/ccxt/async_support/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                   #    U R                  SSS5      I Sh  vN 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$  GN(7f)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     ,,->@XZ^__<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 u `s   IIH(Ic                   #    U R                  U5      U R                  U5      /n[        R                  " U6 I Sh  vN 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$  GN7f)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
Nr      r  
base_assetquote_assetr  r*   r+   uuid/basequotesettle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contractPublicGetSymbolsasynciogatherr  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_markets[  sd     ,,V4d6S6STZ6[\&~~x88!!$)!,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 [ 9s   9O(O%N*O(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                   #    U R                  5       I Sh  vN   U R                  U5      nSnU R                  SX25      u  pBUS:X  aS  SUS   0nU R                  U R	                  XR5      5      I Sh  vN nU R                  US0 5      nU R                  Xs5      $ U R                  U/U5      I Sh  vN nU R                  X5      $  N NV N7f)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_tickerb  s      !!!V$99-X6>!6$<G "HHU\IeffH" ^^Hfb9F$$V44 ..x@@G??733; 	" g( As4   CCAC2C	3>C1C2C	CCr   c                 H  #    U R                  5       I Sh  vN   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(       ad  Ub%  U R                  U5      n	SR                  U	5      US'   U R                  U R                  Xr5      5      I Sh  vN n
U R                  U
S/ 5      nOU R                  U5      I Sh  vN nU R                  X5      nU R                  USU5      $  GN NX N-7f)	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.(+%!<<T[[=YZZH8 >>(FB7D::6BBD4 $$T3++GXwGGQ 	" [< Cs4   D"DB.D"D,D"2D 3)D"D" D"c                    #    U R                  U5      I Sh  vN nU R                  US0 5      nU R                  US5      nU R                  US-  5      $  N=7f)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
Nr  	Timestamp@B )publicGetPingr  safe_integerparse_to_int)r  r  r  r  r  s        r  
fetch_timebigone.fetch_time  s[      ++F33 ~~h3%%dK8	  W!455 4s   AA>ArN  c           	        #    U R                  5       I Sh  vN   U R                  U5      nSnUS   (       aD  SUS   0nU R                  U R                  Xc5      5      I Sh  vN nU R	                  XTS   U5      $ SUS   0nUb  X&S'   U R                  U R                  Xc5      5      I Sh  vN nU R                  US0 5      nU R                  XtS   SSS	S
S5      $  N N} N47f)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 "FFt{{SZGcddH8 11(8<LeTT "6$<G  #( !GGT[HdeeH x<I((84DdFTZ\ceoppu 	" eF fs5   C$CAC$"C #A
C$-C".1C$ C$"C$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  rI  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.$ )NrC  rD  r   T)r  rC  rD  r  r  nonce)r(  rQ  filter_by_limitsort_by)r  rI  r  rN  responseBidsresponseAsksrC  rD  s           r  rF   bigone.parse_contract_order_bookD  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  rZ  r  r  priceStringamountStringr  r^  	takerSiderh  makerOrderIdtakerOrderIdorderIdr*   r  makerCurrencyCodetakerCurrencyCodemakerFeeCosttakerFeeCosts                      r  parse_tradebigone.parse_tradeR  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                 P  #    U R                  5       I Sh  vN   U R                  U5      nUS   (       a  [        U R                  S-   5      eSUS   0n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  
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>`
Nr  z5 fetchTrades() can only fetch trades for spot marketsr  r*   r  )r#  r  r!   r*   &publicGetAssetPairsAssetPairNameTradesr&  r  parse_trades	r  r  r{  rN  r  r  r)  r  r   s	            r  fetch_tradesbigone.fetch_trades  s      !!!V$*tww)``aavd|
 DDT[[QXEabb, &"5  >>= 	" cs"   B&B"A!B&8B$9*B&$B&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  )rk  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       I Sh  vN   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      I Sh  vN nU R                  US/ 5      nU R                  XX#U5      $  GNt N-7f)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
Nr  z4 fetchOHLCV() can only fetch ohlcvs for spot marketsuntilrT  d   r*   )r  periodrN    r  r  r  )r#  r  r!   r*   r>  r  rt   parse_timeframesumrm  r  omit'publicGetAssetPairsAssetPairNameCandlesr&  r  parse_ohlcvs)r  r  r  r{  rN  r  r  r  untilIsDefinedsinceIsDefinedr)  duration
endByLimitr  r  s                  r  fetch_ohlcvbigone.fetch_ohlcv  sw     !!!V$*tww)__``!!&'2t+t+=*~CCE%d|&&t	M

 ++I6H%)9D)@AJ"&,,s:qy/I"J"&,,z":"ll5195GFO67+EEdkkRYFbcc0 ~~h3  yGGe 	"2 ds"   FF
EFF +FF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_balanceO  s    

 >>(FB7q#h-(AkG%%g~>F**62DllnG#//CGG"..w8HIGFO"4L )   ((r  c                 4  #    U R                  5       I Sh  vN   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      I Sh  vN nOU R	                  U5      I Sh  vN nU R                  U5      $  N{ N1 N7f)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>`
Nr   r   r   )r#  r  r  privateGetFundAccountsprivateGetAccountsr  )r  r  r  r  s       r  fetch_balancebigone.fetch_balance`  s      !!!366*9!88@@H!44V<<H !!(++% 	"
 A<s4   BBAB"B#B<B=BBB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  rg  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   r\  r^  rd  rc  rb  
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  rk  r$   	string_eqr  r  
safe_orderrm  parse_order_status)r  rg  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       I Sh  vN   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      I Sh  vN $  NZ N7f)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>`
Nr5   z9 createMarketBuyOrderWithCost() supports spot orders onlyFr3  r  rc  )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  sw      !!!V$f~tww)ddee6;23&&vxdFSSS 	"
 Ts"   A5A1AA5,A3-A53A5r^  r  r  c                   #    U R                  5       I Sh  vN   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      I Sh  vN nU R+                  US 5      nU R-                  UU5      $  GN N+7f)!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>`
       Nrc  rd  ra  r  r  Fr  )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  rp  ro  quoteAmountcostRequestr  r  rg  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//G0LMM x0v..W 	"v Ns"   K J;I;K J>)K >K r*   c                    #    U R                  5       I Sh  vN   SU0nU R                  U R                  XC5      5      I Sh  vN nU R                  US5      nU R	                  U5      $  NS N)7f)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>`
Nr*   r  )r#  privatePostOrdersIdCancelr&  r  r  r  r*   r  r  r)  r  rg  s          r  cancel_orderbigone.cancel_orderB  si      !!!r
77G8TUU x0&&! 	"Us!   A.A*+A.A,(A.,A.c           	      N  #    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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	$  GN
 N7f)
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>`
Nr  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  rt  s               r  cancel_all_ordersbigone.cancel_all_orders_  s)     !!!V$vd|
 55dkk'6RSS ~~h3NN4b9	h3q#i.)AlGMM$//$+   * q#f+&AiGMM$//"+   ' I 	"
 Ts"   D%D ?D%D#C
D%#D%c                    #    U R                  5       I Sh  vN   SU0nU R                  U R                  XC5      5      I Sh  vN nU R                  US0 5      nU R	                  U5      $  NT N*7f)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>`
Nr*   r  )r#  privateGetOrdersIdr&  r  r  r  s          r  fetch_orderbigone.fetch_order  si      !!!r
00W1MNNx4&&	 	"Ns!   A/A++A/A-)A/-A/c                 P  #    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b  X6S'   U R	                  U R                  Xd5      5      I Sh  vN nU R                  US/ 5      nU R                  XX#5      $  Np N+7f)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>`
Nz) fetchOrders() requires a symbol argumentr  r*   rN  r  )r   r*   r#  r  privateGetOrdersr&  r  parse_orders)	r  r  r{  rN  r  r  r)  r  r   s	            r  fetch_ordersbigone.fetch_orders  s      >#DGG.Y$YZZ!!!V$vd|
 $G..t{{7/KLL* &"5  >>C 	" M"   /B&B"AB&8B$9*B&$B&c                 P  #    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b  X6S'   U R	                  U R                  Xd5      5      I Sh  vN nU R                  US/ 5      nU R                  XX#5      $  Np N+7f)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>`
Nz+ 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..t{{7/KLLF &"5  >>Y 	" M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           	      h   #    SS0nU R                  XX0R                  XT5      5      I Sh  vN $  N7f)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   Nr  r&  r  r  r{  rN  r  r)  s         r  fetch_open_ordersbigone.fetch_open_orders  s7      Y
 &&ve[[=YZZZZ   )202c           	      h   #    SS0nU R                  XX0R                  XT5      5      I Sh  vN $  N7f)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  Nr  r  s         r  fetch_closed_ordersbigone.fetch_closed_orders&  s7      X
 &&ve[[=YZZZZr  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  rT  bigone.nonce7  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  subrT  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strrT  apiKeyjwtencodesecretjsonr*   r/   )r  pathr   r  r  r  r  querybaseUrlr  rT  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                 f  #    U R                  5       I Sh  vN   U R                  U5      nSUS   0nU R                  U5      u  pVU R                  U R	                  XF5      5      I Sh  vN 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
.$  GN N7f)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>`
Nr  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addressObjectr3  r4  s                  r  fetch_deposit_addressbigone.fetch_deposit_addressW  s:     !!!==&HTN
 &*%H%H%P"@@WAdee$ ~~h3Y
>*b bcc MM$8 DDTXij'8RP""=':}f57#../@A
 	
E 	" fs#   D1D,AD1)D/*CD1/D1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_addressr2  customer_id
withdrawalr  is_internalr  r  r  r  addressFromr3  	addressTotagFromr4  tagTor  r  r  updated)r  commentinternal)r  r  r  rH  rk  r  r  rm  )r  rJ  r  
currencyIdr  r*   r  r  r  rV  rM  r3  r4  r  rX  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       I Sh  vN   0 nSnUb  U R                  U5      nUS   US'   Ub  X5S'   U R                  U R                  XT5      5      I Sh  vN nU R	                  US/ 5      nU R                  XX#5      $  Nx N+7f)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  r{  rN  r  r)  r  r  r   s	            r  fetch_depositsbigone.fetch_deposits  s      !!!
 }}T*H&.tnGN#$G00W1MNN, >>(FB7&&x5HHI 	" O"   BBAB%B&*BBc                 *  #    U R                  5       I Sh  vN   0 nSnUb  U R                  U5      nUS   US'   Ub  X5S'   U R                  U R                  XT5      5      I Sh  vN nU R	                  US/ 5      nU R                  XX#5      $  Nx N+7f)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  r^  )	r  r  r{  rN  r  r)  r  r  r   s	            r  fetch_withdrawalsbigone.fetch_withdrawals  s      !!!
 }}T*H&.tnGN#$G33DKK4PQQ, nnXvr:&&{eKKI 	" Rra  fromAccount	toAccountc                 b  #    U R                  5       I Sh  vN   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      I Sh  vN 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$  GN Na7f)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>`
Nr4  guidr*   )r  r  fromtori  rr   r   Trf  rg  r  )r#  r  r  r   r  r  currency_to_precisionprivatePostTransferr&  parse_transferr  )r  r  r  rf  rg  r  r  r4  fromIdtoIdri  r)  r  rr   transferOptionsr   s                   r  rr   bigone.transferQ  s.     !!!==&6FK!!.{K9E		<tn00>
 11$++g2NOO &&x:..z2F"&..B[]a"b"&1]#$-[!!'X!TN= 	" Ps#   D/D*B4D/D-AD/-D/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  rf  rg  r  )r  parse_transfer_status)r  rr   r  r  s       r  rn  bigone.parse_transfer~  sF     &1006

 
	
r  c                 .    SS0nU R                  X!S5      $ )Nr  rB  r  r  r  s      r  rt  bigone.parse_transfer_status  s#    
 (;;r  r3  r4  c                   #    U R                  XE5      u  pEU R                  5       I Sh  vN   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      I Sh  vN n	U R                  U	S0 5      n
U R                  X5      $  N N*7f)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>`
Nr*   )r  rN  r  r2  r  r  )
handle_withdraw_tag_and_paramsr#  r  rl  r5  network_code_to_idprivatePostWithdrawalsr&  r  rZ  )r  r  r  r3  r4  r  r  r)  r  r  r  s              r  rs   bigone.withdraw  s      99#F!!!==&tn%00>

 ?!FO"AA&I"&*&=&=k&JGN#44T[[5QRR, ~~h3%%d55K 	" Ss"   'CCBC-C.)CC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  r}  r~  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   rJ  rQ  objectrF  r   ry  r  rM  r  r  r   r  r  r  r   r  floatr  r   r   r   r  r   r  r  r  r  r  r  r	  r  rT  r.  r	   r?  rH  r   r   rZ  r_  rd  r   rr   rn  rt  rs   intr  __static_attributes____classcell__)r  s   @r  r&   r&      s   {# {z -/ A: AF *, wV wrL4 L L6 L\ 68 '4 '4F '4R 6:" RH7 RH RHh ') 6S 6* @DB EqS Eq EqS\ EqN
6 
3 
s 
^g 
y/ y/v y/ y/v <@d[] *? *?S *? *?bfglbm *?X
 
4 
( ?CQUdhqs @H @H @H3 @H^a @Hx|  ~B  yC @HD) )" *, , ,<3s 3D Dv D DL XZ Tc T T$ mqy{ a/ a/I a/Y a/X] a/fi a/F 9=R 'S '# ': 59 .c .` 8<B 'C ' '" 04$UYbd /? /?C /?s /?imnsit /?b 37TX\eg :?C :?s :?RU :?x2 2 59tZ^gi [c [ [TW [nrsxny [" 7;\`ik [ [3 [VY [ptuzp{ ["L &eBSW P8 =? 2
 2
> 2
h	:s 	:U
T U
X U
Q\ U
n 04$UYbd 0I 0IC 0Is 0Iimnyiz 0Id 37TX\eg 0LC 0Ls 0LRU 0Llpq|l} 0Ld ac +3 + +C +TW +gt +Z
t 
x 
= 
(<C <C < QU]_ 363 36 36 36# 36do 36jc 3 S # X\ dg  r  r&   )+ ccxt.async_support.base.exchanger   ccxt.abstract.bigoner   r  ccxt.base.typesr   r   r   r   r	   r
   r   r   r   r   r   r   r   r   r   r   r   r   r   typingr   ccxt.base.errorsr   r   r   r   r   r   r   r    r!   r"   ccxt.base.decimal_to_precisionr#   ccxt.base.preciser$   r&   r  r  r  <module>r     sk    6 ,  L  L  L  L  L  L  * 0 - . ' & . ) ) . 4 %C#X{ C#r  