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