
    ei                         d dl mZ d dlmZ d dl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 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)ImplicitAPIN)AnyBalancesCurrencyDepositAddressIntMarketNumOrder	OrderBook	OrderSide	OrderTypeStrTickerTradeTradingFees)List)ExchangeError)AuthenticationError)PermissionDenied)ArgumentsRequired)OrderNotFound)NotSupported)InvalidNonce)	TICK_SIZE)Precisec                       e Zd Zdef fdZ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/d	ed
edefdZi fdedefdZddi fdede	de	dee         fdZi f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ddi fdede	de	dee         fdZdi fdedefdZd/ded
edefdZ dddi fdede	de	fdZ!d Z"d/ded
edefdZ#d Z$i fd ede%fd!Z&d/d"e'de%fd#Z(d$ Z)d%d&i ddfd'Z*d(e+d)ed*ed+ed,ed-efd.Z, xZ-S )0bit2creturnc           !         |                      t          t          |                                           dddg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 d)dd*dd+dd,dd-dd.dd/dd0dd1dd2dd3dd4dd5dd6dd7dd8dd9di d:dd;dd<dd=dd>dd?dd@ddAddBddCddDddEddFddGddHddIddJdi dKddLddMddNddOddPddQddRddSddTddUddVddWddXddYddZdd[dddddddd\d]d^d_id`dadbdcgdddeg dfig dgg dhdidj|                     dkdldmdndodpdddq          |                     drdsdtdndudpdddq          |                     dvdwdxdndydpdddq          |                     dzd{d|dnd}dpdddq          d~ddd|                     d          |                     d          |                     d          |                     d          g|                     d          |                     d          g|                     d          |                     d          g|                     d          |                     d          g|                     d          |                     d          g|                     d          |                     d          g|                     d          |                     d          g|                     d          |                     d          g|                     d          |                     d          g|                     d          |                     d          g|                     d          |                     d          g|                     d          |                     d          gg|                     d          |                     d          g|                     d          |                     d          g|                     d          |                     d          g|                     d          |                     d          g|                     d          |                     d          g|                     d          |                     d          g|                     d          |                     d          g|                     d          |                     d          g|                     d          |                     d          g|                     d          |                     d          g|                     d          |                     d          g|                     d          |                     d          ggddiddidddd dddd dddddddddddddd ddddddddddddd ddddd d d d	d d dd d ddt          t          t          dt          t          ddd          S )Nr   Bit2CILi  FCORSspotTmarginswapfutureoption	addMarginborrowCrossMarginborrowIsolatedMarginborrowMargincancelAllOrderscancelOrdercloseAllPositionsclosePositioncreateOrder$createOrderWithTakeProfitAndStopLoss&createOrderWithTakeProfitAndStopLossWscreateReduceOnlyOrderfetchBalancefetchBorrowInterestfetchBorrowRatefetchBorrowRateHistoriesfetchBorrowRateHistoryfetchBorrowRatesfetchBorrowRatesPerSymbolfetchCrossBorrowRatefetchCrossBorrowRatesfetchDepositAddressfetchDepositAddressesfetchDepositAddressesByNetworkfetchFundingHistoryfetchFundingIntervalfetchFundingIntervalsfetchFundingRatefetchFundingRateHistoryfetchFundingRatesfetchGreeksfetchIndexOHLCVfetchIsolatedBorrowRatefetchIsolatedBorrowRatesfetchIsolatedPositionsfetchLeveragefetchLeveragesfetchLeverageTiersfetchLiquidationsfetchLongShortRatiofetchLongShortRatioHistoryfetchMarginAdjustmentHistoryfetchMarginModefetchMarginModesfetchMarketLeverageTiersfetchMarkOHLCVfetchMarkPricesfetchMyLiquidationsfetchMySettlementHistoryfetchMyTradesfetchOpenInterestfetchOpenInterestHistoryfetchOpenInterestsfetchOpenOrdersfetchOptionfetchOptionChain
fetchOrderfetchOrderBookfetchPositionfetchPositionHistoryfetchPositionModefetchPositionsfetchPositionsForSymbolfetchPositionsHistoryfetchPositionsRiskfetchPremiumIndexOHLCVfetchSettlementHistoryfetchTickerfetchTradesfetchTradingFeefetchTradingFeesfetchTransferfetchTransfersfetchUnderlyingAssetsfetchVolatilityHistoryreduceMarginrepayCrossMarginrepayIsolatedMarginrepayMargin)setLeverage	setMarginsetMarginModesetPositionModetransferwszOhttps://github.com/user-attachments/assets/db0bce50-6842-4c09-a1d5-0c87d22118aarestzhttps://bit2c.co.ilzhttps://www.bit2c.co.ilz<https://bit2c.co.il/Aff/63bfed10-e359-420c-ab5a-ad368dab0bafz https://www.bit2c.co.il/home/apizhttps://github.com/OferE/bit2c)logoapiwwwreferraldocget)zExchanges/{pair}/TickerzExchanges/{pair}/orderbookzExchanges/{pair}/tradeszExchanges/{pair}/lasttrades)zMerchant/CreateCheckoutzFunds/AddCoinFundsRequestzOrder/AddFundzOrder/AddOrderOrder/GetByIdzOrder/AddOrderMarketPriceBuyzOrder/AddOrderMarketPriceSellzOrder/CancelOrderzOrder/AddCoinFundsRequestzOrder/AddStopOrderzPayment/GetMyIdzPayment/SendzPayment/Pay)zAccount/BalancezAccount/Balance/v2zOrder/MyOrdersr   zOrder/AccountHistoryzOrder/OrderHistory)postr   )publicprivateBtcNisBTC/NISBTCNISBtcNis)idsymbolbasequotebaseIdquoteIdtyper%   EthNisETH/NISETHEthLtcNisLTC/NISLTCLtcUsdcNisUSDC/NISUSDCUsdc)r   r   r   r   tradingz0.025z0.03020000z0.02755000075000z0.0225100000z0.02250000z0.015500000z0.0125750000z0.011000000z0.0082000000z0.0063000000z0.0044000000z0.002z0.0175z0.0075z0.005z0.003z0.001)takermaker)	tierBased
percentager   r   tiersfetchTradesMethod public_get_exchanges_pair_trades)IOCFOKPOGTD)
marginModetriggerPricetriggerPriceTypetriggerDirectionstopLossPricetakeProfitPriceattachedStopLossTakeProfittimeInForcehedgedtrailingleveragemarketBuyRequiresPricemarketBuyByCostselfTradePreventionicebergd      )r   limitdaysBack	untilDayssymbolRequired)r   triggerr   r   )r   r   r   r   r   )	sandboxr2   createOrdersr[   rb   r_   fetchOrdersfetchClosedOrders
fetchOHLCV)linearinverse)r%   r'   r(   )zPlease provide valid APIkeyzNo order found.)zPlease provide valid noncez'please approve new terms of use on site)exactbroad)r   name	countries	rateLimitprohasurlsr   marketsfeesoptionsfeaturesprecisionMode
exceptions)deep_extendsuperr   describesafe_market_structureparse_numberr   r   r   r   r   )self	__class__s    V/var/www/html/volatility/venv/lib/python3.11/site-packages/ccxt/async_support/bit2c.pyr   zbit2c.describe   s   eT 2 2 ; ; = =\\\ %\ 	\
 %\ %\ U\ $U\ '\ \ "5\ t\ $U\  \ t\  7!\" 9%#\ \$ (%\& '\( &u)\* "5+\, +E-\. )%/\0 #E1\2 ,U3\4 '5\6 (7\8 &t9\: (;\< 1%=\> &u?\@ 'A\B (C\D #EE\ \ \F *5G\H $UI\J uK\L "5M\N *5O\P +EQ\R )%S\T  U\V !%W\X %eY\Z $U[\\ &u]\^ -e_\` /a\b "5c\d #Ee\f +Eg\ \ \h !%i\j "5k\l &um\n +Eo\p  q\r $Us\t +Eu\v %ew\x "4y\z u{\| #E}\~ d\@ !$A\B  C\D 'E\F $UG\H !%I\ \ \J *5K\L (M\N %eO\P )%Q\R )%S\T tU\V tW\X "5Y\Z #D[\\  ]\^ !%_\` (a\b )%c\d e\f #Eg\h &ui\j uk\ \l  %"!&#(!w\ \ \| j1 1Z64         ! " "H  55XQZdity  FK  X]  gm  w{  7|  7|  }  }55XQZdity  FK  X]  gm  w{  7|  7|  }  }55XQZdity  FK  X]  gm  w{  7|  7|  }  } 66iS]gmx}  JP  ]b  lr  |@  8A  8A  B  B	  !%"&!..w77!..v66 "..s33T5F5Fv5N5NO!..w779J9J89T9TU!..w779J9J79S9ST!..w779J9J89T9TU!..x88$:K:KF:S:ST!..x88$:K:KG:T:TU!..x88$:K:KH:U:UV!..x88$:K:KF:S:ST!..y994;L;LW;U;UV!..y994;L;LW;U;UV!..y994;L;LW;U;UV!..y994;L;LW;U;UV" "..s33T5F5Fw5O5OP!..w779J9J89T9TU!..w779J9J69R9RS!..w779J9J89T9TU!..x88$:K:KG:T:TU!..x88$:K:KF:S:ST!..x88$:K:KH:U:UV!..x88$:K:KG:T:TU!..y994;L;LW;U;UV!..y994;L;LW;U;UV!..y994;L;LW;U;UV!..y994;L;LW;U;UV" # #%N $%G
  %&+(-,0,1).+06:#(#("'#(	( ( #($)$)27+0/4#()$ $, %)&+!$$&%'*/& & ',#($)*/	# # ',!%#($)*.( ( $()-"&_0 0d ## 
 ## m: :v ' 4G'4  3??O	  {I@
 I@
 I I I	    c                    |d d d}t          | j                                                  }t          dt	          |                    D ]}||         }|                                 }|                     |          }|d                                         }||v r5|                     |d|z             |d<   |                     ||          |d<   |||<   | 	                    |          S )N)info	timestampdatetimer   r   
AVAILABLE_freetotal)
list
currencieskeysrangelenaccountcurrencyuppersafe_stringsafe_balance)	r   responseresultcodesicoder   r   	uppercases	            r   parse_balancezbit2c.parse_balance$  s    
 

 T_))++,,q#e**%% 	# 	#A8DllnnG}}T**H ,,..IH$$"&"2"28\I=U"V"V#'#3#3Hi#H#H "F4LL  (((r   c                    K   |                                   d{V  |                     |           d{V }|                     |          S )aN  
        query for balance and get the amount of funds available for trading or funds locked in orders

        https://bit2c.co.il/home/api#balance

        :param dict [params]: extra parameters specific to the exchange API endpoint
        :returns dict: a `balance structure <https://docs.ccxt.com/?id=balance-structure>`
        N)load_marketsprivateGetAccountBalanceV2r  )r   paramsr   s      r   fetch_balancezbit2c.fetch_balance6  sh       !!!!!!!!!88@@@@@@@@V !!(+++r   Nr   r   c                   K   |                                   d{V  |                     |          }d|d         i}|                     |                     ||                     d{V }|                     ||          S )a  
        fetches information on open orders with bid(buy) and ask(sell) prices, volumes and other data

        https://bit2c.co.il/home/api#orderb

        :param str symbol: unified symbol of the market to fetch the order book for
        :param int [limit]: the maximum amount of order book entries to return
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :returns dict: A dictionary of `order book structures <https://docs.ccxt.com/?id=order-book-structure>` indexed by market symbols
        Npairr   )r  marketpublicGetExchangesPairOrderbookextendparse_order_book)r   r   r   r
  r  request	orderbooks          r   fetch_order_bookzbit2c.fetch_order_bookm  s       !!!!!!!!!V$$F4L
 >>t{{7TZ?[?[\\\\\\\\	$$Y777r   tickerr  c                    |                      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|          S )Navallr   r   r   highlowbidh	bidVolumeaskl	askVolumevwapopencloselastpreviousClosechanger   average)
baseVolumequoteVolumer   )safe_symbolr   safe_ticker)r   r  r  r   averagePricer)  r%  s          r   parse_tickerzbit2c.parse_ticker  sz   !!$//''55%%fc22
-- !
f!
!
 !
 D	!

 4!
 4##FC00!
 !
 4##FC00!
 !
 D!
 D!
 T!
 D!
 T!
 d!
  $!!
" |#!
$ %)!
 !
 !
* +  	r   c                   K   |                                   d{V  |                     |          }d|d         i}|                     |                     ||                     d{V }|                     ||          S )a  
        fetches a price ticker, a statistical calculation with the information calculated over the past 24 hours for a specific market

        https://bit2c.co.il/home/api#ticker

        :param str symbol: unified symbol of the market to fetch the ticker for
        :param dict [params]: extra parameters specific to the exchange API endpoint
        :returns dict: a `ticker structure <https://docs.ccxt.com/?id=ticker-structure>`
        Nr  r   )r  r  publicGetExchangesPairTickerr  r.  )r   r   r
  r  r  r   s         r   fetch_tickerzbit2c.fetch_ticker  s       !!!!!!!!!V$$F4L
 ::4;;wPV;W;WXXXXXXXX  6222r   sincec                   K   |                                   d{V  |                     |          }| j        d         }d|d         i}||                     |          |d<   |||d<   d}|dk    r0|                     |                     ||                     d{V }n/|                     |                     ||                     d{V }t          |t                    rt          |          | 
                    ||||          S )a;  
        get the list of most recent trades for a particular symbol

        https://bit2c.co.il/home/api#transactions
        https://bit2c.co.il/home/api#trades

        :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   r  r   dater   r   )r  r  r   parse_to_intpublicGetExchangesPairTradesr   publicGetExchangesPairLasttrades
isinstancestrr   parse_trades)	r   r   r2  r   r
  r  methodr  r   s	            r   fetch_tradeszbit2c.fetch_trades  s@      !!!!!!!!!V$$12F4L
 "//66GFO$GG777!>>t{{7TZ?[?[\\\\\\\\HH!BB4;;wX^C_C_````````H h$$ 	*)))  65%@@@r   c                   K   |                                   d{V  |                     |           d{V }|                     |di           }t          |                                          }i }t          dt          |                    D ]}||         }|                     |          }|                     ||          }	|                     |	d          }
|                     |	d          }| 	                    t          j        |
d                    }| 	                    t          j        |d                    }|	|||ddd||<   |S )	a=  
        fetch the trading fees for multiple markets

        https://bit2c.co.il/home/api#balance

        :param dict [params]: extra parameters specific to the exchange API endpoint
        :returns dict: a dictionary of `fee structures <https://docs.ccxt.com/?id=fee-structure>` indexed by market symbols
        NFeesr   FeeMakerFeeTaker100T)r   r   r   r   r   r   )r  privateGetAccountBalance
safe_valuer   r   r   r   r+  r   r   r   
string_div)r   r
  r   r   r   r  r  marketIdr   feemakerStringtakerStringr   r   s                 r   fetch_trading_feeszbit2c.fetch_trading_fees  se      !!!!!!!!!66v>>>>>>>>" x44DIIKK  q#d))$$ 	 	AAwH%%h//F//$11C**3
;;K**3
;;K%%g&8e&L&LMME%%g&8e&L&LMME "! F6NN r   r   sideamountpricec                   K   |                                   d{V  d}|                     |          }||d         d}	|dk    r|d|                     |          z   z  }nc||	d<   |                     |          }
|                     |          }|                     t          j        |
|                    |	d<   |d	k    |	d
<    t          | |          |                     |	|                     d{V }| 	                    ||          S )a  
        create a trade order

        https://bit2c.co.il/home/api#addo

        :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
        :returns dict: an `order structure <https://docs.ccxt.com/?id=order-structure>`
        NprivatePostOrderAddOrderr   )AmountPairr  MarketPricePriceTotalbuyIsBid)
r  r  
capitalizenumber_to_stringparse_to_numericr   
string_mulgetattrr  parse_order)r   r   r   rJ  rK  rL  r
  r;  r  r  amountStringpriceStringr   s                r   create_orderzbit2c.create_order  s5      !!!!!!!!!+V$$4L
 
 8mdood&;&;;;FF$GG0088L//66K#44W5GVa5b5bccGG $GG.v..t{{7F/K/KLLLLLLLL&111r   r   c                    K   d|i}|                      |                     ||                     d{V }|                     |          S )a^  
        cancels an open order

        https://bit2c.co.il/home/api#cancelo

        :param str id: order id
        :param str symbol: Not used by bit2c 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   N)privatePostOrderCancelOrderr  r[  )r   r   r   r
  r  r   s         r   cancel_orderzbit2c.cancel_order%  s]       "
 99$++gv:V:VWWWWWWWW)))r   c                   K   |t          | j        dz             |                                  d{V  |                     |          }d|d         i}|                     |                     ||                     d{V }|                     ||d         i           }|                     |dg           }	|                     |dg           }
|                     | 	                    |	|
          |||          S )a  
        fetch all unfilled currently open orders

        https://bit2c.co.il/home/api#geto

        :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 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- fetchOpenOrders() requires a symbol argumentr  r   r  r  )
r   r   r  r  privateGetOrderMyOrdersr  rC  	safe_listparse_ordersarray_concat)r   r   r2  r   r
  r  r  r   ordersasksbidss              r   fetch_open_orderszbit2c.fetch_open_orders6  s
      >#DG.]$]^^^!!!!!!!!!V$$F4L
 55dkk'66R6RSSSSSSSS6$<<<vub11~~feR00  !2!24!>!>uUUUr   c                    K   |                                   d{V  |                     |          }d|i}|                     |                     ||                     d{V }|                     ||          S )ar  
        fetches information on an order made by the user

        https://bit2c.co.il/home/api#getoid

        :param str id: the order id
        :param str symbol: unified market symbol
        :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  privateGetOrderGetByIdr  r[  )r   r   r   r
  r  r  r   s          r   fetch_orderzbit2c.fetch_orderO  s       !!!!!!!!!V$$"
 44T[[&5Q5QRRRRRRRR &111r   orderc                    d }d}d|v r|d         }d}n|}|                      |d          }|                     d |          }|                     |dd          }|r.|                     |d          }|dk    s|d	k    rd
}	n6|dk    rd}	n-|                      |d          }|dk    s|dk    rd
}	n|dk    rd}	|                      |d          }
|
dk    rd}
n|
dk    rd}
|                      |d          }|dk    rd}n|dk    rd}|                      |d          }d }d }|r-|                      |d          }|                      |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 |d d(|          S ))NFNewOrderTr   createdi  status_typer      r#     closedstatusNewOpen	Completed
order_typer   r   1r  r   rT  sellrL  rK  initialAmountclientOrderIdr   r   lastTradeTimestampr   r   postOnlyrJ  r   filled	remainingcost)tradesrF  r   r(  )r   r+  safe_integer_productsafe_integer
safe_orderiso8601)r   rn  r  orderUnified
isNewOrderr   r   r   
tempStatusrv  r   rJ  rL  rK  r  s                  r   r[  zbit2c.parse_orderp  s   > 
 ,LJJ LlD11!!$//--lItLL	  	"**<GGJQ*//q!)),AAJU""jF&:&:{**! l;;3;;DDS[[D f553;;DDS[[D  w77	 	A%%lH==F((x@@II%%lODDF((x@@I  
" 
T 
  
 Y//	 

 !$ 
 f 
 f 
 D 
 4 
  
 D 
 U 
 D 
 f 
 d 
  ! 
" D# 
$ + 
  
  
, -  	r   c                   K   |                                   d{V  d}i }|||d<   ||d<   |D|                     |                                 d          |d<   |                     |d          |d<   | |                     |          }|d         |d<   |                     |                     ||                     d{V }|                     ||||          S )a  
        fetch all trades made by the user

        https://bit2c.co.il/home/api#orderh

        :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>`
        Ntake.toTimefromTimer   r  )r  yyyymmddmillisecondsr  privateGetOrderOrderHistoryr  r:  )r   r   r2  r   r
  r  r  r   s           r   fetch_my_tradeszbit2c.fetch_my_trades  s      !!!!!!!!!#GFO $d.?.?.A.A3 G GGH"&--s";";GJ[[((F$TlGFO99$++gv:V:VWWWWWWWWN   65%@@@r   c                     d}|                     d          }t          dt          |                    D ]}|||         z  }|S )N ,r   )splitr   r   )r   r9  	newStringstrPartsr  s        r   remove_comma_from_valuezbit2c.remove_comma_from_value  sK    	99S>>q#h--(( 	% 	%A!$IIr   tradec                 "   d }d }d }d }d }|                      |d          }|#|}	|                     |d          }
|                      |d          }|                     |          }|                      |d          }|                    d          }|                      |d          }|                     ||          }|                     |d         |          }|                     |d          }|rd	nd
}|r|d         n|d         }|                     |d          }|dk    rd}nd}|                      |d          }||dd}nw|                     |d          }
|                      |d          }	|                      |d          }|                      |d          }|                     |d          }||rd}nd}|                     d |          }|                     ||	|
|                     |
          |d         |d ||||d |d|          S )N	referenceticksrL  firstAmount|r  r   isMakerr   r      rs  actionrT  r|  	feeAmountr   )r  r   r4  tidrK  isBidr   )r   r   r   r   r   rn  r   rJ  takerOrMakerrL  rK  r  rF  )	r   safe_timestampr  r  safe_marketrC  r  
safe_trader  )r   r  r  rL  rK  orderIdrF  makerOrTakerr  r   r   reference_partsrE  r  r  rJ  feeCosts                    r   parse_tradezbit2c.parse_trade"  sl   F $$UK88	 B++E7;;I$$UG44E0077E%%e];;F'ooc22O''v66H%%h77F%%oa&8&AAFooeY77G&-:777L,3Koa((9KG&&uh77F{{&&uk::G"# % 
 ++E6::I!!%//B$$UG44E%%eX66F??5'22D " DD!D!!$//"Y//X&( 
  
   	r   c                     |dk    S )Nr    )r   r  s     r   is_fiatzbit2c.is_fiat  s    u}r   r  c                 Z  K   |                                   d{V  |                     |          }|                     |          rt          | j        dz             d|d         i}|                     |                     ||                     d{V }|                     ||          S )ac  
        fetch the deposit address for a currency associated with self account

        https://bit2c.co.il/home/api#addc

        :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>`
        Nz7 fetchDepositAddress() does not support fiat currenciesCoinr   )r  r   r  r   r   #privatePostFundsAddCoinFundsRequestr  parse_deposit_address)r   r  r
  r   r  r   s         r   fetch_deposit_addresszbit2c.fetch_deposit_address  s       !!!!!!!!!==&&<< 	dtw)bbcccHTN
 AA$++gW]B^B^________ ))(H===r   r   c                     |                      |d          }|                     |           |                     d |          }||d |d dS )Naddress)r   r   networkr  tag)r   check_addresssafe_currency_code)r   depositAddressr   r  r  s        r   r  zbit2c.parse_deposit_address  s`     "">9==7###&&tX66"
 
 	
r   c                 *    |                                  S N)r  )r   s    r   noncezbit2c.nonce  s      """r   r   GETc                    | j         d         d         dz   |                     ||          z   }|dk    r|dz  }n|                                  |                                 }|                     d|i|          }	|                     |	          }
|dk    r|	r|d|
z   z  }n|
}|                     |                     |
          |                     | j                  t          j
        d	          }d
| j        |d}||||dS )Nr   r   /r   z.jsonr  r  ?base64z!application/x-www-form-urlencoded)zContent-Typekeysign)urlr;  bodyheaders)r   implode_paramscheck_required_credentialsr  r  	urlencodehmacencodesecrethashlibsha512apiKey)r   pathr   r;  r
  r  r  r  r  queryauth	signatures               r   r  z
bit2c.sign  s   iv&,t/B/B4/P/PP(??7NCC++---JJLLEKK! E >>%((D &3:%C		$++d"3"3T[[5M5Mw~_ghhI C{! G
 fdwOOOr   httpCodereasonr  r;  r  r  c
                 .   |d S |                      |d          }
|
|                      |d          }
|
`| j        dz   |z   }|                     | j        d         |
|           |                     | j        d         |
|           t          |          d S )NerrorError r   r   )r   r   throw_exactly_matched_exceptionr   throw_broadly_matched_exceptionr   )r   r  r  r  r;  r  r  r   requestHeadersrequestBodyr  feedbacks               r   handle_errorszbit2c.handle_errors  s    4   733=$$Xw77Ew}t+H001I5RZ[[[001I5RZ[[[)))tr   r  ).__name__
__module____qualname__r   r   r   r  r  r9  r	   r   r  dictr
   r   r.  r1  r   r   r<  r   rI  r   r   floatr   r^  r   ra  r   rj  rm  r[  r  r  r  r  r   r  r   r  r  r  intr  __classcell__)r   s   @r   r   r      s)       J# J J J J J JX) ) ) ) )$ *, 5, 5, 5, 5, 5, 5,n @DB 8 8S 8 8S\ 8 8 8 8& 4  6    8 68 3 3 3F 3 3 3 3$ <@d[] %A %A %AS %A %Abfglbm %A %A %A %AN /1 . .[ . . . .` mqy{ 2 2 2I 2Y 2X] 2fi 2 2 2 2@ 9=R * *S *# * * * *" 59tZ^gi V Vc V VTW Vnrsxny V V V V2 8<B 2 2C 2 2 2 2 2Bh h hv h h h h hT 37TX\eg ?A ?AC ?As ?ARU ?A ?A ?A ?AB  \ \ \v \ \ \ \ \|   =? > > >> > > > >4
 
h 
R` 
 
 
 
$# # # &eBSW P P P P0c 3 S # X\ dg        r   r   )$ ccxt.async_support.base.exchanger   ccxt.abstract.bit2cr   r  ccxt.base.typesr   r   r   r   r	   r
   r   r   r   r   r   r   r   r   r   typingr   ccxt.base.errorsr   r   r   r   r   r   r   ccxt.base.decimal_to_precisionr   ccxt.base.preciser   r   r  r   r   <module>r     s   6 5 5 5 5 5 + + + + + +  _  _  _  _  _  _  _  _  _  _  _  _  _  _  _  _  _  _  _  _  _  _  _  _  _  _  _  _  _  _  _  _  _  _       * * * * * * 0 0 0 0 0 0 - - - - - - . . . . . . * * * * * * ) ) ) ) ) ) ) ) ) ) ) ) 4 4 4 4 4 4 % % % % % %D D D D DHk D D D D Dr   