MCPcopy Create free account
hub / github.com/ccxt/ccxt / withdraw

Method withdraw

python/ccxt/async_support/binance.py:9168–9200  ·  view source on GitHub ↗

make a withdrawal https://developers.binance.com/docs/wallet/capital/withdraw :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 [para

(self, code: str, amount: float, address: str, tag: Str = None, params={})

Source from the content-addressed store, hash-verified

9166 return result
9167
9168 async def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}) -> Transaction:
9169 """
9170 make a withdrawal
9171
9172 https://developers.binance.com/docs/wallet/capital/withdraw
9173
9174 :param str code: unified currency code
9175 :param float amount: the amount to withdraw
9176 :param str address: the address to withdraw to
9177 :param str tag:
9178 :param dict [params]: extra parameters specific to the exchange API endpoint
9179 :returns dict: a `transaction structure <https://docs.ccxt.com/?id=transaction-structure>`
9180 """
9181 tag, params = self.handle_withdraw_tag_and_params(tag, params)
9182 self.check_address(address)
9183 await self.load_markets()
9184 currency = self.currency(code)
9185 request = {
9186 'coin': currency['id'],
9187 'address': address,
9188 # issue sapiGetCapitalConfigGetall() to get networks for withdrawing USDT ERC20 vs USDT Omni
9189 # 'network': 'ETH', # 'BTC', 'TRX', etc, optional
9190 }
9191 if tag is not None:
9192 request['addressTag'] = tag
9193 networkCode = None
9194 networkCode, params = self.handle_network_code_and_params(params)
9195 if networkCode is not None:
9196 request['network'] = self.network_code_to_id(networkCode, currency['code'])
9197 request['amount'] = self.currency_to_precision(currency['code'], amount, networkCode)
9198 response = await self.sapiPostCapitalWithdrawApply(self.extend(request, params))
9199 # {id: '9a67628b16ba4988ae20d329333f16bc'}
9200 return self.parse_transaction(response, currency)
9201
9202 def parse_trading_fee(self, fee: dict, market: Market = None) -> TradingFeeInterface:
9203 #

Callers

nothing calls this directly

Calls 10

parse_transactionMethod · 0.95
check_addressMethod · 0.80
currency_to_precisionMethod · 0.80
load_marketsMethod · 0.45
currencyMethod · 0.45
network_code_to_idMethod · 0.45
extendMethod · 0.45

Tested by

no test coverage detected