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