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

Method withdraw

python/ccxt/bybit.py:6150–6200  ·  view source on GitHub ↗

make a withdrawal https://bybit-exchange.github.io/docs/v5/asset/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 [params]:

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

Source from the content-addressed store, hash-verified

6148 return self.safe_string(types, type, type)
6149
6150 def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}) -> Transaction:
6151 """
6152 make a withdrawal
6153
6154 https://bybit-exchange.github.io/docs/v5/asset/withdraw
6155
6156 :param str code: unified currency code
6157 :param float amount: the amount to withdraw
6158 :param str address: the address to withdraw to
6159 :param str tag:
6160 :param dict [params]: extra parameters specific to the exchange API endpoint
6161 :param str [params.accountType]: 'UTA', 'FUND', 'FUND,UTA', and 'SPOT(for classic accounts only)
6162 :returns dict: a `transaction structure <https://docs.ccxt.com/?id=transaction-structure>`
6163 """
6164 tag, params = self.handle_withdraw_tag_and_params(tag, params)
6165 accountType = None
6166 accounts = self.is_unified_enabled()
6167 isUta = accounts[1]
6168 accountType, params = self.handle_option_and_params(params, 'withdraw', 'accountType')
6169 if accountType is None:
6170 accountType = 'UTA' if isUta else 'SPOT'
6171 self.load_markets()
6172 self.check_address(address)
6173 currency = self.currency(code)
6174 request = {
6175 'coin': currency['id'],
6176 'amount': self.number_to_string(amount),
6177 'address': address,
6178 'timestamp': self.milliseconds(),
6179 'accountType': accountType,
6180 }
6181 if tag is not None:
6182 request['tag'] = tag
6183 networkCode, query = self.handle_network_code_and_params(params)
6184 networkId = self.network_code_to_id(networkCode, code)
6185 if networkId is not None:
6186 request['chain'] = networkId.upper()
6187 response = self.privatePostV5AssetWithdrawCreate(self.extend(request, query))
6188 #
6189 # {
6190 # "retCode": "0",
6191 # "retMsg": "success",
6192 # "result": {
6193 # "id": "9377266"
6194 # },
6195 # "retExtInfo": {},
6196 # "time": "1666892894902"
6197 # }
6198 #
6199 result = self.safe_dict(response, 'result', {})
6200 return self.parse_transaction(result, currency)
6201
6202 def fetch_position(self, symbol: str, params={}) -> Position:
6203 """

Callers

nothing calls this directly

Calls 13

is_unified_enabledMethod · 0.95
parse_transactionMethod · 0.95
check_addressMethod · 0.80
safe_dictMethod · 0.80
load_marketsMethod · 0.45
currencyMethod · 0.45
millisecondsMethod · 0.45
network_code_to_idMethod · 0.45

Tested by

no test coverage detected