- prepareWithdrawExchange#
Prepare for withdrawing via a
taler://withdraw-exchangeURI.The URI names the exchange to withdraw from and may fix an amount. Wallet-core fetches (or updates) the exchange entry, ephemerally adding the exchange to the wallet’s known exchanges if it is not known yet, and checks that the currency of the URI’s amount matches the exchange’s currency.
This is the first step of a manual withdrawal that is initiated on the exchange’s side. The client can then query the fees and other details with getWithdrawalDetailsForAmount and create the withdrawal with acceptManualWithdrawal.
Request:
The request must be a PrepareWithdrawExchangeRequest object.
Response:
On success, the result is a PrepareWithdrawExchangeResponse object.
Side effects:
Fetches (or updates) the exchange entry over the network; if the exchange is not known to the wallet yet, it is ephemerally added to the known exchanges. No withdrawal transaction is created.
Expected errors:
The caller can handle the following errors inline:
WALLET_TALER_URI_MALFORMED,GENERIC_CURRENCY_MISMATCH.
interface PrepareWithdrawExchangeRequest {
// A taler://withdraw-exchange URI.
talerUri: string;
progressToken?: string;
}
interface PrepareWithdrawExchangeResponse {
// Base URL of the exchange that already existed or was
// ephemerally added as an exchange entry to the wallet.
exchangeBaseUrl: string;
// Amount from the taler://withdraw-exchange URI.
// Only present if specified in the URI.
amount?: AmountString;
}