Contents

acceptManualWithdrawal#

Create a manual withdrawal.

Creates a withdrawal transaction for the given amount at the given exchange, with a freshly generated reserve key pair. The user must then wire the amount to one of the exchange’s bank accounts returned in the result; the paytoUri of each account already includes the reserve public key as the transfer subject. Once the transfer arrives at the exchange, wallet-core withdraws the coins.

Request:

The request must be an AcceptManualWithdrawalRequest object.

Response:

On success, the result is an AcceptManualWithdrawalResult object.

Side effects:

Creates the withdrawal transaction (with a fresh reserve key pair) in the wallet database and starts the background task that watches the reserve and withdraws the coins once the transfer arrives. May refresh exchange information and query the bank conversion service over the network.

Expected errors:

The caller can handle the following errors inline: WALLET_KYC_LIMIT_EXCEEDED, WALLET_EXCHANGE_TOS_NOT_ACCEPTED, GENERIC_CURRENCY_MISMATCH, WALLET_EXCHANGE_KEYS_NOT_ACCEPTED.

interface AcceptManualWithdrawalRequest {
  exchangeBaseUrl: string;
  amount: AmountString;
  restrictAge?: number;

  // Instead of generating a fresh, random reserve key pair, use
  // the provided reserve private key.  Use with caution.  Usage of
  // this field may be restricted to developer mode.
  forceReservePriv?: EddsaPrivateKeyString;

  progressToken?: string;
}
interface AcceptManualWithdrawalResult {
  // Transaction ID of the newly created withdrawal transaction.
  transactionId: TransactionIdStr;

  // Public key of the newly created reserve.
  reservePub: string;

  // Bank accounts of the exchange that can be used to fund the
  // withdrawal.
  withdrawalAccountsList: WithdrawalExchangeAccountDetails[];
}