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

Method withdraw

python/ccxt/coinsph.py:1807–1840  ·  view source on GitHub ↗

make a withdrawal to coins_ph account https://docs.coins.ph/rest-api/#withdrawuser_data :param str code: unified currency code :param float amount: the amount to withdraw :param str address: not used by coinsph withdraw() :param str tag: :pa

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

Source from the content-addressed store, hash-verified

1805 }
1806
1807 def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}) -> Transaction:
1808 """
1809 make a withdrawal to coins_ph account
1810
1811 https://docs.coins.ph/rest-api/#withdrawuser_data
1812
1813 :param str code: unified currency code
1814 :param float amount: the amount to withdraw
1815 :param str address: not used by coinsph withdraw()
1816 :param str tag:
1817 :param dict [params]: extra parameters specific to the exchange API endpoint
1818 :returns dict: a `transaction structure <https://docs.ccxt.com/?id=transaction-structure>`
1819 """
1820 options = self.safe_value(self.options, 'withdraw')
1821 warning = self.safe_bool(options, 'warning', True)
1822 if warning:
1823 raise InvalidAddress(self.id + " withdraw() makes a withdrawals only to coins_ph account, add .options['withdraw']['warning'] = False to make a withdrawal to your coins_ph account")
1824 networkCode = self.safe_string(params, 'network')
1825 networkId = self.network_code_to_id(networkCode, code)
1826 if networkId is None:
1827 raise BadRequest(self.id + ' withdraw() require network parameter')
1828 self.load_markets()
1829 currency = self.currency(code)
1830 request = {
1831 'coin': currency['id'],
1832 'amount': self.number_to_string(amount),
1833 'network': networkId,
1834 'address': address,
1835 }
1836 if tag is not None:
1837 request['withdrawOrderId'] = tag
1838 params = self.omit(params, 'network')
1839 response = self.privatePostOpenapiWalletV1WithdrawApply(self.extend(request, params))
1840 return self.parse_transaction(response, currency)
1841
1842 def fetch_deposits(self, code: Str = None, since: Int = None, limit: Int = None, params={}) -> List[Transaction]:
1843 """

Callers

nothing calls this directly

Calls 12

parse_transactionMethod · 0.95
InvalidAddressClass · 0.90
BadRequestClass · 0.90
safe_valueMethod · 0.80
safe_boolMethod · 0.80
safe_stringMethod · 0.80
network_code_to_idMethod · 0.45
load_marketsMethod · 0.45
currencyMethod · 0.45
omitMethod · 0.45
extendMethod · 0.45

Tested by

no test coverage detected