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

Method withdraw

python/ccxt/async_support/phemex.py:4759–4825  ·  view source on GitHub ↗

make a withdrawal https://phemex-docs.github.io/#create-withdraw-request :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

4757 return self.filter_by_symbol_since_limit(sorted, symbol, since, limit)
4758
4759 async def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}) -> Transaction:
4760 """
4761 make a withdrawal
4762
4763 https://phemex-docs.github.io/#create-withdraw-request
4764
4765 :param str code: unified currency code
4766 :param float amount: the amount to withdraw
4767 :param str address: the address to withdraw to
4768 :param str tag:
4769 :param dict [params]: extra parameters specific to the phemex api endpoint
4770 :param str [params.network]: unified network code
4771 :returns dict: a `transaction structure <https://github.com/ccxt/ccxt/wiki/Manual#transaction-structure>`
4772 """
4773 tag, params = self.handle_withdraw_tag_and_params(tag, params)
4774 await self.load_markets()
4775 self.check_address(address)
4776 currency = self.currency(code)
4777 networkCode = None
4778 networkCode, params = self.handle_network_code_and_params(params)
4779 networkId = None
4780 if networkCode is not None:
4781 networkId = self.network_code_to_id(networkCode, code)
4782 stableCoins = self.safe_value(self.options, 'stableCoins')
4783 if networkId is None:
4784 if not (self.in_array(code, stableCoins)):
4785 networkId = currency['id']
4786 else:
4787 raise ArgumentsRequired(self.id + ' withdraw() requires an extra argument params["network"]')
4788 request = {
4789 'currency': currency['id'],
4790 'address': address,
4791 'amount': amount,
4792 'chainName': networkId.upper(),
4793 }
4794 if tag is not None:
4795 request['addressTag'] = tag
4796 response = await self.privatePostPhemexWithdrawWalletsApiCreateWithdraw(self.extend(request, params))
4797 #
4798 # {
4799 # "code": 0,
4800 # "msg": "OK",
4801 # "data": {
4802 # "id": "10000001",
4803 # "freezeId": null,
4804 # "address": "44exxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
4805 # "amountRv": "100",
4806 # "chainCode": "11",
4807 # "chainName": "TRX",
4808 # "currency": "USDT",
4809 # "currencyCode": 3,
4810 # "email": "abc@gmail.com",
4811 # "expiredTime": "0",
4812 # "feeRv": "1",
4813 # "nickName": null,
4814 # "phone": null,
4815 # "rejectReason": "",
4816 # "submitedAt": "1670000000000",

Callers

nothing calls this directly

Calls 13

parse_transactionMethod · 0.95
ArgumentsRequiredClass · 0.90
check_addressMethod · 0.80
safe_valueMethod · 0.80
in_arrayMethod · 0.80
safe_dictMethod · 0.80
load_marketsMethod · 0.45
currencyMethod · 0.45
network_code_to_idMethod · 0.45

Tested by

no test coverage detected