prepare-withdraw-exchange.rst (1757B)
1 .. ts:op:: prepareWithdrawExchange 2 3 Prepare for withdrawing via a ``taler://withdraw-exchange`` URI. 4 5 The URI names the exchange to withdraw from and may fix an amount. 6 Wallet-core fetches (or updates) the exchange entry, ephemerally 7 adding the exchange to the wallet's known exchanges if it is not 8 known yet, and checks that the currency of the URI's amount matches 9 the exchange's currency. 10 11 This is the first step of a manual withdrawal that is initiated on 12 the exchange's side. The client can then query the fees and other 13 details with :ts:op:`getWithdrawalDetailsForAmount` and create the 14 withdrawal with :ts:op:`acceptManualWithdrawal`. 15 16 **Request:** 17 18 The request must be a `PrepareWithdrawExchangeRequest` object. 19 20 **Response:** 21 22 On success, the result is a `PrepareWithdrawExchangeResponse` object. 23 24 **Side effects:** 25 26 Fetches (or updates) the exchange entry over the network; if the 27 exchange is not known to the wallet yet, it is ephemerally added to 28 the known exchanges. No withdrawal transaction is created. 29 30 **Expected errors:** 31 32 The caller can handle the following errors inline: 33 ``WALLET_TALER_URI_MALFORMED``, ``GENERIC_CURRENCY_MISMATCH``. 34 35 .. ts:def:: PrepareWithdrawExchangeRequest 36 37 interface PrepareWithdrawExchangeRequest { 38 // A taler://withdraw-exchange URI. 39 talerUri: string; 40 41 progressToken?: string; 42 } 43 44 .. ts:def:: PrepareWithdrawExchangeResponse 45 46 interface PrepareWithdrawExchangeResponse { 47 // Base URL of the exchange that already existed or was 48 // ephemerally added as an exchange entry to the wallet. 49 exchangeBaseUrl: string; 50 51 // Amount from the taler://withdraw-exchange URI. 52 // Only present if specified in the URI. 53 amount?: AmountString; 54 }