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

Method withdraw

python/ccxt/woo.py:2876–2924  ·  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

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

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