
    eiy                    ,   d dl mZ d dlmZ d dlmZmZmZmZm	Z	m
Z
mZmZmZmZmZmZmZmZmZmZmZmZmZ d dlmZ d dlmZ d dlmZ d dlmZ d dlmZ d d	lmZ d d
lm Z  d dlm!Z! d dlm"Z" d dlm#Z# d dlm$Z$ d dl%m&Z& d dl'm(Z(  G d dee          Z)dS )    )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                       e Zd Zdef fdZi fdefdZi fdee         fdZ	dMde
dedefdZi fd	edefd
Zdi fdedefdZi fdefdZdi fd	ededefdZd ZdMded	ededefdZdMde
dedefdZddi fd	edededee         fdZdMdedefdZdddi fd	ededededee         f
dZdefdZ i fdefdZ!defdZ"dMde
dede#fd Z$i fd	ed!e%fd"Z&di fd	ede'd#e(d$e%d%e)f
d&Z*di fd'ed	e+fd(Z,di fd	e+fd)Z-di fd'ed	e+fd*Z.dddi fd	e+dededee#         fd+Z/dddi fd	e+dedefd,Z0d-e+fd.Z1dddi fd	e+dededee#         fd/Z2dddi fd	e+dededee#         fd0Z3d1 Z4d2d3i ddfd4Z5i fd5ede6fd6Z7d-e+fd7Z8dMd8e
d9e9de:fd:Z;dddi fd5e+dededee:         fd;Z<dddi fd5e+dededee:         fd<Z=i fd5ed$e%d=ed>ede>f
d?Z?dMd@e
d9e9de>fdAZ@d-e+de+fdBZAdi fd5ed$e%dCedDe+de:f
dEZBdFeCdGedHedIedJe
dKefdLZD xZES )Nbigonereturnc                    |                      t          t          |                                           i ddddddgddd	d
di dd dddddddd ddddddddddddddddddddddddi ddd dd!dd"dd#dd$dd%dd&dd'dd(dd)dd*dd+dd,dd-dd.dd/di d0dd1dd2dd3dd4dd5dd6dd7dd8dd9dd:dd;dd<dd=dd>dd?dd@di dAddBddCddDddEddFddGddHddIddJddKddLddMddNddOddPddQdRdSdTdUdVdWdXdYdZd[d\d]d^d_d`dadbdcdddededfdgdhdidjdkdldmdng doig dpg dqdrdng dsig dtdudvgdwdxgdydvgdzdnd{gidgd||                     d}          |                     d}          d~dPi idddddddddddiddddddddii ddddddddddddddddddddddddddddddddddi ddddddddddddddddddddddddÓddœddǓddɓdd˓dd͓i ddϓddГddѓddӓddՓddדddٓddۓddݓddߓddddddddddddddddddddddddddddddddddd dddd ddddddddddddd d ddd d dddddddddddddddd d ddddddd d d ddddddid		d
diddddddidddddddd
did
didd d dddt
          di dt          dt          dt          dt          dt          dt          dt          dt          dt          dt          d t          d!t          d"t          d#t          d$t          d%t          d&t          t          t          t          t          t          t          d'i d(d)d*d+d,d-d.d/          S (0  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fetchOpenInterestfetchOpenInterestHistoryfetchOpenInterests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   rt   )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taker)tradingfundingoptionsSPOTFUNDCONTRACT)r4   fundr   r7   r6   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accountsByTypert   exchangeMillisecondsCorrectionrQ   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@  triggerrI  rS  )r@  rP  rT  rI  rS  )r@  rP  rQ  rR  rT  rI  rS  )r@  rP  rQ  daysBackCanceledrR  rT  rI  rS  rP    )	sandboxrA   createOrdersr^   rf   rc   rh   rN   r_   extendsdefaultrB  )markindexlasti )rQ  rR  )rY  rA   rh   rN   forDerivatives)linearinverse)rZ  r4   r^  r6   r7   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    I/var/www/html/volatility/venv/lib/python3.11/site-packages/ccxt/bigone.pyr  zbigone.describe   s   fd 3 3 < < > > }A
(}A
H}A
 $}A
 t	}A

 }A
  DDD %D 	D
 $D %D $UD 'D D "4D tD /D ,UD 0D tD  &t!D" '#D D$ (%D& "4'D( !%)D* +D, &u-D. "5/D0 +E1D2 )%3D4 #E5D6 ,U7D8 $T9D: ';D< (=D> "4?D@ &tADB (CDD 1%ED D DF  GDH &uIDJ #EKDL *5MDN $UODP uQDR *5SDT +EUDV WDX  YDZ d[D\ $U]D^ +E_D` %eaDb "4cDd ueDf #EgD D Dh diDj !$kDl tmDn toDp qDr TsDt tuDv "5wDx #EyDz '{D| )%}D~ #DD@ #EADB &uCDD DEDF DGD D}A
V  W}A
r 	s}A
t i9A&J'K#<  );eD u}A
P    

 
 
   *    #	 	 	 !&
 47
 &&'$ $2 # CF FQ}A
^ !..w77!..w77 
  _}A
p 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 wq}A
`	 $&+(,,0,0).+06:#'#("&#(	( ( #($)$)26+//4#()$ $, %)&+!$$(%)*.& & ',#($)*/	# # ',!$#($)*.( ( ',!$$(%)#($)*.$ $ ',!$$(,0%)#($)*.	* 	*  #AC CJ y  ) +$(%)$(- -$ %+%+$ $
 %+%+* *# #* "#3 "#3 	  ## Gg ga	}A
p Yq}A
r Z] N| ]^j	
 Z ] Y . - . 0 0 0 - ]  ]!" ]#$ /))))&/  25 s}A
l "!%&%! !m}A
 } } }	    c                 >   |                      ddd          }|i S |                     |dg           }i }t          dt          |                    D ]I}||         }|                     |d          }|                     |          }|                     |d          }	i }
|                     |d	g           }|                     |                     |d
d                    }t          dt          |                    D ]}||         }|                     |d          }|                     |          }| 	                    |d          }| 	                    |d          }|                     |d          }|                     |d          }|                     |d          }|                     |                     |d
d                    }||d||d| 
                    |          | 
                    |          |dd|ddd|d
|
|<   t          |          }d}| 	                    |d          rd}n#|dk    r|                     |          rd}nd}nd}|                     ||||	|dddd| 
                    |          ddddddd|
d          ||<   K|S )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
        rQ   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)depositru   )
r)   networkr5   r  ru   activefee	precisionlimitsinfois_fiatfiat	leveragedothercrypto)amountru   )r)   coder  r*   typer  r  ru   r  r  r  r:  )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*   r:  chainscurrencyMaxPrecisionjchain	networkIdnetworkCoder  ru   minDepositAmountminWithdrawalAmountwithdrawalFeer  chainLengthr  s                            r  fetch_currencieszbigone.fetch_currencies  s?    &&'8:RTXYY<IZ fb99q#n--.. H	 H	A%a(H!!(H55B**2..D##Hf55DH^^H.@"EEF#'#7#78J8J8Ugip8q8q#r#r 1c&kk**  q	 ,,UNCC	"55i@@..0DEE>>%1HII#'#3#3E;O#P#P &*&6&6u>U&V&V# $ 0 08H I I 001C1CEK]_f1g1ghh	#*"& (",,];;!%!2!29!=!= $4#'$ $
 $7#'% %	 	 "') )%%* f++KD~~h	22  !!--b11 #&DD"DD77  !../CDD  $# 
  $#! !	 	 %+9 9  F4LL. r  c                 	   |                      |          |                     |          g}|}|d         }|d         }|                     |dg           }g }t          dt	          |                    D ]}||         }	|                     |	di           }
|                     |	di           }|                     |
d          }|                     |d          }|                     |          }|                     |          }|                    | 	                    i d|                     |	d          d	|                     |	d          d|d
z   |z   d|d|ddd|d|ddddddddddddddddddddddddd| 
                    |                     |                     |	d                              | 
                    |                     |                     |	d                              dddddddddd|                     |	d           |                     |	d!          dd"d|	d#                     t          dt	          |                    D ]}||         }	|                     |	d$          }|                     |	d%          }|                     |	d&          }|                     |	d          }|                     |          }|                     |          }|                     |          }|                     |	d'          }|                    | 	                    i d|d|d
z   |z   d(z   |z   d|d|d|d|d|d|ddddddddddddd|                     |	d)          ddd*| ||                     |	d+          dddd| 
                    |                     |                     |	d,                              | 
                    |                     |                     |	d-                              ddddddd|                     |	d.          |                     |	d/          d|                     |	d0          ddd"|	d1	                     |S )2a  
        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  r4   Tr5   Fr6   r7   r8   r  contract
base_scalequote_scale)r  pricer  min_quote_valuemax_quote_value)rJ  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_marketszbigone.fetch_markets]  sR    ,,V44d6S6STZ6[6[\!!!$)!,j ..6266q#g,,'' 9	 9	AQZFv|R@@IrBBJ%%i::F&&z8<<G**622D++G44EMM$44 16d&&vv6616((6616 $*u,16 	16
 16 $16 &16 716 D16 16 16 %16 16 %16 %16  $!16" E#16$  $"&""//0D0DTEUEUV\^jEkEk0l0lmm!..t/C/CDDTDTU[]jDkDk/l/lmm   $#! !
  $# 
  $# 
  $//8IJJ#//8IJJ  $  a16 16 16 1 1 1 1 1 1d q#.//00 9	 9	A%a(F%%fn==F&&v??G''0@AAH''99H**622D++G44E,,X66FnnV[9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 F"&""//0D0DTEUEUV\^nEoEo0p0pqq!..t/C/CDDTDTU[]mDnDn/o/opp   $#! !
  $# 
  $//
CC#//
CC 
  $//HH#  $ ]/6 /6 /6 / / / / / /` r  Ntickerr  c           
         d|v rdnd}|                      |dd          }|                     ||d|          }|                      |dd          }|                     |di           }|                     |d	i           }|                     i d|d
d dd d|                      |dd          d|                      |dd          d|                     |d          d|                     |d          d	|                     |d          d|                     |d          dd d|                     |d          d|d|dd d|                     |d          dd dd |                      |dd          |                     |d          |                     |d          |                     |d           |d!|          S )"Nasset_pair_namer4   r6   r  -closelatestPricebidask	timestampdatetimehighlast24hMaxPricelowlast24hMinPricer  	bidVolumequantity	askVolumevwapopenr]  previousClosechangedaily_change
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_tickerzbigone.parse_ticker  s]   ^ !2V ; ;VV&
%%f.?JJ!!(FCDD""67MBBnnVUB//nnVUB// !
f!
!
 !
 D&&vv7HII	!

 4%%fe5FGG!
 4##C11!
 ))#z::!
 4##C11!
 ))#z::!
 D!
 D$$VV44!
 U!
 E!
 T!
 d&&v~>>!
  $!!
" t#!
$ ,,VX{KK++F4DEE))&+>>**6<@@-!
 !
 !
. /  	r  r  c                    |                                   |                     |          }d}|                     d||          \  }}|dk    r`d|d         i}|                     |                     ||                    }|                     |di           }|                     ||          S |                     |g|          }|                     ||          S )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>`
        Nri   r4   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_tickerzbigone.fetch_tickerd  s     	V$$99-QWXXf6>>!6$<G BB4;;wX^C_C_``H" ^^Hfb99F$$VV444((&6::G??7F333r  r   c                 f   |                                   d}|                     |d          }||                     |          }d}|                     d||          \  }}|dk    }i }|                     |          }d}|rp|-|                     |          }	d                    |	          |d<   |                     |                     ||                    }
| 	                    |
dg           }n| 
                    |          }|                     ||          }|                     |d|          S )	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   rj   r4   ,
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"  zbigone.fetch_tickers  s=    	!!'1--[[((F99.&RXYYf%%g.. "	="oog..(+%66t{{7F7S7STTH8 >>(FB77DD44V<<D4 $$T733++GXwGGGr  c                     |                      |          }|                     |di           }|                     |d          }|                     |dz            S )aE  
        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_timezbigone.fetch_time  s\     %%f-- ~~h33%%dK88	  W!4555r  rP  c           	         |                                   |                     |          }d}|d         rPd|d         i}|                     |                     ||                    }|                     ||d         |          S d|d         i}|||d<   |                     |                     ||                    }|                     |di           }|                     ||d         ddd	d
d          S )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  rP  r  bidsasksr  r	  )r  r  $contractPublicGetDepthSymbolSnapshotr!  parse_contract_order_book%publicGetAssetPairsAssetPairNameDepthr  parse_order_book)r  r  rP  r  r  r  r$  	orderbooks           r  fetch_order_bookzbigone.fetch_order_book  s    	V$$* 7	q&,G @@WV\A]A]^^H8 11(F8<LeTTT "6$<G  #( AA$++gW]B^B^__H x<<I((F84DdFTZ\ceopppr  c                 &   t          |                                          }g }t          dt          |                    D ]O}||         }||         }|                    |                     |          |                     |          g           P|S )Nr   )listkeysr  r  r  r  )r  bidsAsksbidsAsksKeysr  r  r  r  s          r  parse_contract_bids_askszbigone.parse_contract_bids_asks=  s    HMMOO,,q#l++,, 	Q 	QA OEe_FMM4,,U33T5F5Fv5N5NOPPPPr  rA  c                 b   |                      |d          }|                      |d          }|                     |          }|                     |          }||                     |                     |dd          |          |                     |                     |d          |          d d d dS )Nr;  r<  r   T)r  r;  r<  r  r  nonce)r#  rH  filter_by_limitsort_by)r  rA  r  rP  responseBidsresponseAsksr;  r<  s           r  r>  z bigone.parse_contract_order_bookF  s    y&99y&99,,\::,,\::((dAt)D)DeLL((dA)>)>FF
 
 	
r  tradec                    |                      |                     |dd                    }|                     |d          }|                     |d          }|                     |d          }|                     ||d          }|                     |d          }|                     |d          }d }	|||d	k    r
||k    rd
nd}	||dk    rdnd}n|dk    rd}n|dk    rd}|                     |d          }
|                     |d          }d }|
|
}n||}|                     |d          }|||                     |          |d         |d||	||d |d}|	V|dk    r(|	dk    r|d         }|d         }nl|d         }|d         }n[|	dk    r|d         }|d         }nD|d         }|d         }n3|d	k    r-|dk    r|d         }|d         }n|dk    r|d         }|d         }|                     |d          }|                     |d          }||||d||dg|d<   n||d|d<   n|	||d|d<   nd |d<   |                     ||          S )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  rP  )r)   r  r  r  orderr  rS  takerOrMakerr  r  r  r  r  r  	maker_fee	taker_fee)r  r  r   r  )	parse8601r  r  safe_marketiso8601
safe_trade)r  rO  r  r  priceStringamountStringr  rS  	takerSider]  makerOrderIdtakerOrderIdorderIdr)   r  makerCurrencyCodetakerCurrencyCodemakerFeeCosttakerFeeCosts                      r  parse_tradezbigone.parse_tradeT  s&   T NN4#5#5e\=#Y#YZZ	&&ug66''x88##E+<==!!(FC88v..$$UL99	 !(8t~?U?U'0D'8'877wL< (50066uDDu}}''/?@@''/?@@#"GG%"GeT**"Y//X&( "
 
  #u}}7**(.v%(.w%%(.w%(.v%%7**(.w%(.v%%(.v%(.w%%^##E!!$*7O!$*6N!!e##$*6N!$*7O!''{;;''{;;#')7HII)7HII"v
 *6CT U Uu%%1?PQQF5MM F5Mvv...r  sincec                 V   |                                   |                     |          }|d         rt          | j        dz             d|d         i}|                     |                     ||                    }|                     |dg           }|                     ||||          S )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  ro  rP  r  r  r$  r  r   s	            r  fetch_tradeszbigone.fetch_trades  s     	V$$* 	btw)``aaavd|
 >>t{{7TZ?[?[\\, &"55  >>>r  c           	      (   |                      |                     |d                    |                     |d          |                     |d          |                     |d          |                     |d          |                     |d          gS )Ntimer  r  r  r  r  )r`  r  r  )r  ohlcvr  s      r  parse_ohlcvzbigone.parse_ohlcv  s     NN4++E6::;;UF++UF++UE**UG,,UH--
 	
r  r   	timeframec                 6   |                                   |                     |          }|d         rt          | j        dz             |                     |d          }|du}|du}	||	r|rdnd}|d         |                     | j        ||          |d}
|	rv|                     |          }|                     |||z  d	z            }|r*| 	                    t          ||d
z                       |
d<   n6| 	                    |          |
d<   n|r| 	                    |d
z             |
d<   |                     |d          }|                     |                     |
|                    }|                     |dg           }|                     |||||          S )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untilNrV  d   r)   )r  periodrP    r  rv  r  )r  r  r!   r)   r7  r  rv   parse_timeframesumrb  r  omit'publicGetAssetPairsAssetPairNameCandlesr!  r  parse_ohlcvs)r  r  ry  ro  rP  r  r  r{  untilIsDefinedsinceIsDefinedr$  duration
endByLimitr  r  s                  r  fetch_ohlcvzbigone.fetch_ohlcv  s    	V$$* 	atw)__```!!&'22t+t+=*G~GCCCE%d|&&t	9MM
 

  		6++I66H%)9D)@AAJ ;"&,,s:uqy/I/I"J"J"&,,z":": 	6"ll51955GFO67++??GU[@\@\]]0 ~~h33  vy%GGGr  c                    |d d d}|                      |dg           }t          dt          |                    D ]}||         }|                     |d          }|                     |          }|                                 }|                     |d          |d<   |                     |d          |d<   |||<   |                     |          S )	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_balancezbigone.parse_balanceQ  s    
 

 >>(FB77q#h--(( 	# 	#AqkG%%g~>>F**622DllnnG#//CCGG"..w8HIIGFO"F4LL  (((r  c                     |                                   |                     |dd          }|                     |d          }d}|dk    s|dk    r|                     |          }n|                     |          }|                     |          S )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_balancezbigone.fetch_balanceb  s     	3366**9226::HH..v66H !!(+++r  r  c                 >    ddddd}|                      |||          S )NrP  r  )
STOP_LIMITSTOP_MARKETLIMITMARKETr  )r  r  typess      r  
parse_typezbigone.parse_type  s4    !#	
 
 tT222r  r\  c           
         |                      |d          }|                      |d          }|                     ||d          }|                     |                      |d                    }|                      |d          }|dk    rd}nd}|                      |d	          }t          j        |d
          rd }|                     |d          }	d }
|	rd}
|                     |                      |d                    }|                      |d          }d }d }d }|dk    r|dk    r|                      |d          }n,|                      |d          }|                      |d          }|                     i d|d|d|                      |d          d|d|                     |          d|                     |                      |d                    d|d|d|
d|                     |d          d|d|d|d|d|d|                      |d           d!|d | 	                    |                      |d"                    d d d#|          S )$Nr)   r  r  rQ  rS  rY  rX  rW  
stop_price0immediate_or_cancelr<  r  r  r  filled_amountr  r  clientOrderIdclient_order_idr  r  lastTradeTimestamp
updated_atr  rG  postOnly	post_onlyrA  r  r  avg_deal_pricefilledstate)	remainingstatusr  r   )
r  r  r`  r$   	string_eqr  r  
safe_orderrb  parse_order_status)r  r\  r  r)   r  r  r  rS  rA  immediateOrCancelrG  r  r  r  r  r  s                   r  parse_orderzbigone.parse_order  s   ( eT**##E+<==!!(FC88NN4#3#3E<#H#HII	v..5==DDD''|<<\3// 	 L NN52GHH 	 Kt//v>>??  008##E?;;DD%%eX66F%%e_==F  
E 
" 
 T--e5FGG 
 	 

 Y// 
 !$..1A1A%1V1V"W"W 
 f 
 D 
 ; 
 uk:: 
 D 
 U 
 L 
 f 
 D 
  t''/?@@! 
" f# 
$ --d.>.>ug.N.NOO+ 
  
  
, -  	r  r  c                     |                                   |                     |          }|d         st          | j        dz             d|d<   |                     |dd|d|          S )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>`
        r4   z9 createMarketBuyOrderWithCost() supports spot orders onlyFr5  r  rX  N)r  r  r!   r)   create_order)r  r  r  r  r  s        r  !create_market_buy_order_with_costz(bigone.create_market_buy_order_with_cost  ss     	V$$f~ 	ftw)ddeee6;23  5$fMMMr  rS  r  r  c                    |                                   |                     |          }|dk    }|rdnd}	|                                }
|
dk    }|                     |dd          }d}|                     |
dk    ||          \  }}|                     |g d	          }|d
         |	|                     ||          d}|s|
dk    r^|                     ||          |d<   |r(|                     |d          }|dk    rd|d<   |rd|d<   |                     ||          |d<   n|rd}| 	                    |ddd          \  }}| 
                    |d          }|                     |d          }|r||t          | j        dz             |                     |          }|                     |          }|                     t!          j        ||                    }||n|}|                     ||          |d<   n3|                     ||          |d<   n|                     ||          |d<   |/|                     ||          |d<   |rdnd|d<   |rd}
n|
dk    rd}
|
|d<   |                     |d          }|||d<   |                     |g d          }|                     |                     ||                    }|                     |d           }|                     ||          S )!av  
        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>`
        rX  rY  rV  r  r  FNr  )rA  	stopPricer  r)   )r  rS  r  r  r  rG  r<  Tr  r  rA   r5  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  rA  rG  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  rS  r  r  r  r  isBuyrequestSideuppercaseTypeisLimitexchangeSpecificParamr  rA  r$  rG  r5  r  re  rd  quoteAmountcostRequestr  r  r\  s                             r  r  zbigone.create_order  s   , 	V$$$/ee%

7* $v{E J J00-82KNcekll&))&2]2]2]^^%d|..vv>>
 
  	M}44#66vuEEGG 0"..v}EE%''59G12 0+/GK( $ 8 8 H HGH M481<@<Y<YZ`bo  rU  W[  =\  =\916''7766224 
ODL*47  6q  ,q  r  r  r'+'<'<V'D'D&*&;&;E&B&B&*&;&;G<N|]h<i<i&j&j/3/?ddk,0,B,B6;,W,W))(,(>(>vv(N(NGH%%$($<$<VV$L$L!#$($;$;FL$Q$QGL!+0";%%eGJ . ,(** -'((AA$)6G%&6#n#n#noo))$++gv*F*FGG x00v...r  r)   c                     |                                   d|i}|                     |                     ||                    }|                     |d          }|                     |          S )ar  
        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  r\  s          r  cancel_orderzbigone.cancel_orderD  si     	r
11$++gv2N2NOO x00&&&r  c           	         |                                   |                     |          }d|d         i}|                     |                     ||                    }|                     |di           }|                     |dg           }|                     |dg           }g }	t          dt          |                    D ]6}
||
         }|	                    | 	                    ||dd                     7t          dt          |                    D ]6}
||
         }|	                    | 	                    ||dd                     7|	S )	a  
        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  ri  s               r  cancel_all_orderszbigone.cancel_all_ordersa  su    	V$$vd|
 //GV0L0LMM ~~h33NN4b99	h33q#i..)) 	 	AlGMM$//$+ +      
 q#f++&& 	 	AQiGMM$//"+ +      
 r  c                     |                                   d|i}|                     |                     ||                    }|                     |di           }|                     |          S )a  
        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_orderzbigone.fetch_order  si     	r
**4;;w+G+GHHx44&&&r  c                 X   |t          | j        dz             |                                  |                     |          }d|d         i}|||d<   |                     |                     ||                    }|                     |dg           }|                     ||||          S )aB  
        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)   rP  r  )r   r)   r  r  privateGetOrdersr!  r  parse_orders)	r  r  ro  rP  r  r  r$  r  r   s	            r  fetch_orderszbigone.fetch_orders  s     >#DG.Y$YZZZV$$vd|
 $GG((Wf)E)EFF* &"55  >>>r  c                 X   |t          | j        dz             |                                  |                     |          }d|d         i}|||d<   |                     |                     ||                    }|                     |dg           }|                     ||||          S )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)   rP  r  )r   r)   r  r  privateGetTradesr!  r  rr  rs  s	            r  fetch_my_tradeszbigone.fetch_my_trades  s     >#DG.[$[\\\V$$vd|
 $GG((Wf)E)EFFF &"55  >>>r  r  c                 :    dddd}|                      ||          S )Nr  closedr  )PENDINGFILLED	CANCELLEDr  r  r  statusess      r  r  zbigone.parse_order_status  s/    #
 

 &111r  c           	      b    ddi}|                      ||||                     ||                    S )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  ro  rP  r  r$  s         r  fetch_open_orderszbigone.fetch_open_orders  s:     Y
   t{{7F7S7STTTr  c           	      b    ddi}|                      ||||                     ||                    S )aI  
        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_orderszbigone.fetch_closed_orders(  s:     X
   t{{7F7S7STTTr  c                     |                      | j        dd          dz  }|                     |                                 dz  |          S )Nr7  r   r5  r~  )r7  r   r  microseconds)r  exchangeTimeCorrections     r  rJ  zbigone.nonce9  sJ    !%!2!24<Aacd!e!eho!oxx))++d24JKKKr  r   GETc                    |                      ||                     |                    }|                     | j        d         |                   }|dz   |                     ||          z   }	i }|dk    s|dk    s|dk    r|r|	d|                     |          z   z  }	n|                                  t          |                                           }
d| j	        |
d}| 
                    ||                     | j                  d	          }d
|z   |d<   |dk    r|r|	d|                     |          z   z  }	n |dk    rd|d<   |                     |          }d| j        z   dz   | j        z   |d<   |	|||dS )Nr   r  r   r   r   ?	OpenAPIV2)r  subrJ  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strrJ  apiKeyjwtencodesecretjsonr)   r.   )r  pathr   r  r  r  r  querybaseUrlr  rJ  r$  tokens                r  signzbigone.sign=  s   		&$"5"5d";";<<''	%(8(=>>md11$???(??c]22c=M6M6M 3sT^^E2222++---

%%E#{ G HHWdkk$+&>&>IIE'05'8GO$ 73!6!666C6!!*<'yy'' '$' 1C 7$, FfdwOOOr  r  c                    |                                   |                     |          }d|d         i}|                     |          \  }}|                     |                     ||                    }|                     |dg           }t          |          }	|	dk     rt          | j        dz             | 	                    |d          }
| 
                    |||
          }|                     |
|i           }|                     |d          }|                     |d          }|                     |           |||                     |          ||d	S )
a  
        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  r  s                  r  fetch_deposit_addresszbigone.fetch_deposit_addressY  sc    	==&&HTN
 &*%H%H%P%P"]::4;;wP];^;^__$ ~~h33YY
>>*b bccc MM$88 DDT;Xijj'8:KRPP""='::}f557###../@AA
 
 	
r  c                 @    dddddd}|                      |||          S )Nokpending)WITHHOLDUNCONFIRMED	CONFIRMED	COMPLETEDr  r  r  s      r  parse_transaction_statuszbigone.parse_transaction_status  s9     $ 
 
 &&999r  transactionr  c                    |                      |d          }|                     |          }|                      |d          }|                     |d          }|                     |                      |d                    }|                     |                      |d                    }|                     |                     |dd                    }	|                      |d          }
|                      |d	          }|                      |d
          }d|v rdnd}|                     |d          }i d|d|d|
d|d|                     |          dd dd dd d|dd d|dd d|d|d|d|d|	d d |dS )Nr  r)   r  r  rR  r  completed_attxidtarget_addressr  customer_id
withdrawalr  is_internalr  r  r  r  addressFromr  	addressTotagFromr  tagTor  r  r  updated)r  commentinternal)r  r  r  r&  r`  r  r  rb  )r  r'  r  
currencyIdr  r)   r  r  r  r3  r*  r  r  r  r5  s                  r  parse_transactionzbigone.parse_transaction  s   h %%k>BB
&&z22k400!!+x88..t/?/?W/U/UVVNN4#3#3K#O#OPP	..!3!3K~!^!^__V44"";0@AA{F33 - < <||9>>+}==
K
"
 D
 	

 Y//
 t
 4
 t
 
 t
 3
 T
 D
 f
 
  f!
" w#
$  )
 
 
 	
r  c                 4   |                                   i }d}| |                     |          }|d         |d<   |||d<   |                     |                     ||                    }|                     |dg           }|                     ||||          S )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  rP  r  )r  r  privateGetDepositsr!  r  parse_transactions)	r  r  ro  rP  r  r$  r  r  r   s	            r  fetch_depositszbigone.fetch_deposits  s     	
 }}T**H&.tnGN#$GG**4;;w+G+GHH, >>(FB77&&x5%HHHr  c                 4   |                                   i }d}| |                     |          }|d         |d<   |||d<   |                     |                     ||                    }|                     |dg           }|                     ||||          S )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  rP  r  )r  r  privateGetWithdrawalsr!  r  r:  )	r  r  ro  rP  r  r$  r  r  r   s	            r  fetch_withdrawalszbigone.fetch_withdrawals!  s     	
 }}T**H&.tnGN#$GG--dkk'6.J.JKK, nnXvr::&&{HeUKKKr  fromAccount	toAccountc                    |                                   |                     |          }|                     | j        di           }|                     |||          }|                     |||          }	|                     |d|                                           }
|d         |                     ||          ||	|
d}|                     |                     ||                    }| 	                    ||          }|                     | j        di           }| 
                    |dd          }|r||d<   ||d	<   ||d
<   |
|d<   |S )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>`
        r6  guidr)   )r  r  fromtorB  rt   r   Tr?  r@  r  )r  r  r  r   r  r  currency_to_precisionprivatePostTransferr!  parse_transferr  )r  r  r  r?  r@  r  r  r6  fromIdtoIdrB  r$  r  rt   transferOptionsr   s                   r  rt   zbigone.transferS  sX    	==&&6FKK!!.+{KK	9EE		<<tn00v>>
 
 ++DKK,H,HII &&x::..z2FF"&..B[]a"b"b" 	"&1H]#$-H[!!'HX!HTNr  rt   c                 l    |                      |d          }|d d d d d d d |                     |          d	S )Nr  )	r  r)   r  r  r  r  r?  r@  r  )r  parse_transfer_status)r  rt   r  r  s       r  rG  zbigone.parse_transfer  sQ     &110066

 

 
	
r  c                 8    ddi}|                      ||d          S )Nr  r   r  r  r  s      r  rL  zbigone.parse_transfer_status  s(    
 &(;;;r  r  r  c                    |                      ||          \  }}|                                  |                     |          }|d         ||                     ||          d}|||d<   d}|                     |          \  }}||                     |          |d<   |                     |                     ||                    }	|                     |	di           }
| 	                    |
|          S )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  r+  r  Nr  r  r  )
handle_withdraw_tag_and_paramsr  r  rE  r  network_code_to_idprivatePostWithdrawalsr!  r  r7  )r  r  r  r  r  r  r  r$  r  r  r  s              r  ru   zbigone.withdraw  s    99#vFFV==&&tn%00v>>
 

 ?!GFO"AA&IIV"&*&=&=k&J&JGN#..t{{7F/K/KLL, ~~h33%%dH555r  httpCodereasonr  r  r  r  c
                 z   |d S |                      |d          }
|                      |d          }|
dk    r|
| j        dz   |z   }|                     | j        d         ||           |                     | j        d         |
|           |                     | j        d         ||           t          |          d S )Nr  messager   rx  ry  )r  r)   throw_exactly_matched_exceptionrb  throw_broadly_matched_exceptionr   )r  rR  rS  r  r  r  r  r  requestHeadersrequestBodyr  rU  feedbacks                r  handle_errorszbigone.handle_errors  s    4
 &11""8Y77CKKd.w}t+H001I7T\]]]001I4QYZZZ001I7T\]]])))tr  )N)F__name__
__module____qualname__r   r  r   r  r   r   r  dictr   r  r  r&  r   r   r"  r
   r9  r   rB  rH  objectr>  r   rn  rt  rD  rx  r  r   r  r  r  r   r  floatr  r   r   r   r  r   r  r  r  r  r  r  r  r  rJ  r  r	   r  r&  r   r   r7  r;  r>  r   rt   rG  rL  ru   intr\  __classcell__)r  s   @r  r&   r&      sa       ~# ~ ~ ~ ~ ~ ~@ ') A AZ A A A AF $& w w$v, w w w wrL L4 L L6 L L L L\ 02 '4 '43 '4f '4 '4 '4 '4R 04B RH RHW RH7 RH RH RH RHh !# 6 6s 6 6 6 6* :>b Eq Eqs Eq3 EqY Eq Eq Eq EqN  
 
6 
3 
s 
^g 
 
 
 
y/ y/ y/v y/ y/ y/ y/ y/v 6:UW *? *?3 *?s *?# *?\`af\g *? *? *? *?X
 
 
4 
 
 
 
( 9=4^bkm @H @H# @H# @HS @HX[ @Hrvw{r| @H @H @H @HD) ) ) ) )" $& , ,( , , , ,<3s 3 3 3 3D D Dv D D D D DL RT N N N5 N N N N$ gksu a/ a/3 a/i a/y a/RW a/`c a/ a/ a/ a/F 37r ' 's 'C ' ' ' ': /32 . . . . . .` 26b ' 'c '3 ' ' ' '" *.Dt\^ /? /?3 /?c /? /?cghmcn /? /? /? /?b -1tRV_a :? :?c :? :?C :? :? :? :?x2 2 2 2 2 /3TXac U U U3 Uc Uhlmrhs U U U U" 154VZce U U# US UPS Ujnotju U U U U"L L L &eBSW P P P P8 79 2
 2
# 2
^ 2
 2
 2
 2
h	:s 	: 	: 	: 	:U
 U
T U
X U
Q\ U
 U
 U
 U
n *.Dt\^ 0I 0I3 0Ic 0I 0Icghsct 0I 0I 0I 0Id -1tRV_a 0L 0Lc 0L 0LC 0Lfjkvfw 0L 0L 0L 0Ld [] + +S +% +c +c +an + + + +Z
 
t 
x 
= 
 
 
 
(<C <C < < < < KOWY 36 36S 36% 36# 36C 36^i 36 36 36 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  <module>rm     sQ   ( ' ' ' ' ' , , , , , , L  L  L  L  L  L  L  L  L  L  L  L  L  L  L  L  L  L  L  L  L  L  L  L  L  L  L  L  L  L  L  L  L  L  L  L  L  L  L  L  L  L       * * * * * * 0 0 0 0 0 0 - - - - - - . . . . . . ' ' ' ' ' ' & & & & & & . . . . . . ) ) ) ) ) ) ) ) ) ) ) ) . . . . . . 4 4 4 4 4 4 % % % % % %F# F# F# F# F#X{ F# F# F# F# F#r  