https://docs.upbit.com/kr/reference/withdraw https://global-docs.upbit.com/reference/withdraw make a withdrawal :param str code: unified currency code :param float amount: the amount to withdraw :param str address: the address to withdraw to
(self, code: str, amount: float, address: str, tag: Str = None, params={})
| 2151 | return self.parse_deposit_address(response) |
| 2152 | |
| 2153 | def withdraw(self, code: str, amount: float, address: str, tag: Str = None, params={}) -> Transaction: |
| 2154 | """ |
| 2155 | |
| 2156 | https://docs.upbit.com/kr/reference/withdraw |
| 2157 | https://global-docs.upbit.com/reference/withdraw |
| 2158 | |
| 2159 | make a withdrawal |
| 2160 | :param str code: unified currency code |
| 2161 | :param float amount: the amount to withdraw |
| 2162 | :param str address: the address to withdraw to |
| 2163 | :param str tag: |
| 2164 | :param dict [params]: extra parameters specific to the exchange API endpoint |
| 2165 | :returns dict: a `transaction structure <https://docs.ccxt.com/?id=transaction-structure>` |
| 2166 | """ |
| 2167 | tag, params = self.handle_withdraw_tag_and_params(tag, params) |
| 2168 | self.load_markets() |
| 2169 | currency = self.currency(code) |
| 2170 | request = { |
| 2171 | 'amount': amount, |
| 2172 | } |
| 2173 | response: dict |
| 2174 | if code != 'KRW': |
| 2175 | self.check_address(address) |
| 2176 | # 2023-05-23 Change to required parameters for digital assets |
| 2177 | network = self.safe_string_upper_2(params, 'network', 'net_type') |
| 2178 | if network is None: |
| 2179 | raise ArgumentsRequired(self.id + ' withdraw() requires a network argument') |
| 2180 | params = self.omit(params, ['network']) |
| 2181 | request['net_type'] = network |
| 2182 | request['currency'] = currency['id'] |
| 2183 | request['address'] = address |
| 2184 | if tag is not None: |
| 2185 | request['secondary_address'] = tag |
| 2186 | params = self.omit(params, 'network') |
| 2187 | response = self.privatePostWithdrawsCoin(self.extend(request, params)) |
| 2188 | else: |
| 2189 | response = self.privatePostWithdrawsKrw(self.extend(request, params)) |
| 2190 | # |
| 2191 | # { |
| 2192 | # "type": "withdraw", |
| 2193 | # "uuid": "9f432943-54e0-40b7-825f-b6fec8b42b79", |
| 2194 | # "currency": "BTC", |
| 2195 | # "txid": "ebe6937b-130e-4066-8ac6-4b0e67f28adc", |
| 2196 | # "state": "processing", |
| 2197 | # "created_at": "2018-04-13T11:24:01+09:00", |
| 2198 | # "done_at": null, |
| 2199 | # "amount": "0.01", |
| 2200 | # "fee": "0.0", |
| 2201 | # "krw_amount": "80420.0" |
| 2202 | # } |
| 2203 | # |
| 2204 | return self.parse_transaction(response) |
| 2205 | |
| 2206 | def nonce(self): |
| 2207 | return self.milliseconds() |
nothing calls this directly
no test coverage detected