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

Method withdraw

python/ccxt/async_support/woo.py:2877–2925  ·  view source on GitHub ↗

make a withdrawal https://docs.woox.io/#token-withdraw-v3 :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 parameter

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

Source from the content-addressed store, hash-verified

2875 return self.safe_string(statuses, status, status)
2876
2877 async def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}) -> Transaction:
2878 """
2879 make a withdrawal
2880
2881 https://docs.woox.io/#token-withdraw-v3
2882
2883 :param str code: unified currency code
2884 :param float amount: the amount to withdraw
2885 :param str address: the address to withdraw to
2886 :param str tag:
2887 :param dict [params]: extra parameters specific to the exchange API endpoint
2888 :returns dict: a `transaction structure <https://docs.ccxt.com/?id=transaction-structure>`
2889 """
2890 tag, params = self.handle_withdraw_tag_and_params(tag, params)
2891 await self.load_markets()
2892 self.check_address(address)
2893 currency = self.currency(code)
2894 request = {
2895 'amount': amount,
2896 'address': address,
2897 }
2898 if tag is not None:
2899 request['extra'] = tag
2900 network = self.safe_string(params, 'network')
2901 if network is None:
2902 raise ArgumentsRequired(self.id + ' withdraw() requires a network parameter for ' + code)
2903 params = self.omit(params, 'network')
2904 request['token'] = currency['id']
2905 request['network'] = self.network_code_to_id(network, currency['code'])
2906 response = await self.v3PrivatePostAssetWalletWithdraw(self.extend(request, params))
2907 #
2908 # {
2909 # "success": True,
2910 # "withdraw_id": "20200119145703654"
2911 # }
2912 #
2913 data = self.safe_dict(response, 'data', {})
2914 transactionData = self.extend(data, {
2915 'id': self.safe_string(data, 'withdrawId'),
2916 'timestamp': self.safe_integer(response, 'timestamp'),
2917 'currency': code,
2918 'amount': amount,
2919 'addressTo': address,
2920 'tag': tag,
2921 'network': network,
2922 'type': 'withdrawal',
2923 'status': 'pending',
2924 })
2925 return self.parse_transaction(transactionData, currency)
2926
2927 async def repay_margin(self, code: str, amount: float, symbol: Str = None, params={}):
2928 """

Callers

nothing calls this directly

Calls 13

parse_transactionMethod · 0.95
ArgumentsRequiredClass · 0.90
check_addressMethod · 0.80
safe_stringMethod · 0.80
safe_dictMethod · 0.80
safe_integerMethod · 0.80
load_marketsMethod · 0.45
currencyMethod · 0.45
omitMethod · 0.45
network_code_to_idMethod · 0.45

Tested by

no test coverage detected