accept-manual-withdrawal.rst (2040B)
1 .. ts:op:: acceptManualWithdrawal 2 3 Create a manual withdrawal. 4 5 Creates a withdrawal transaction for the given amount at the given 6 exchange, with a freshly generated reserve key pair. The user must 7 then wire the amount to one of the exchange's bank accounts returned 8 in the result; the ``paytoUri`` of each account already includes the 9 reserve public key as the transfer subject. Once the transfer 10 arrives at the exchange, wallet-core withdraws the coins. 11 12 **Request:** 13 14 The request must be an `AcceptManualWithdrawalRequest` object. 15 16 **Response:** 17 18 On success, the result is an `AcceptManualWithdrawalResult` object. 19 20 **Side effects:** 21 22 Creates the withdrawal transaction (with a fresh reserve key pair) in 23 the wallet database and starts the background task that watches the 24 reserve and withdraws the coins once the transfer arrives. May 25 refresh exchange information and query the bank conversion service 26 over the network. 27 28 **Expected errors:** 29 30 The caller can handle the following errors inline: 31 ``WALLET_KYC_LIMIT_EXCEEDED``, ``WALLET_EXCHANGE_TOS_NOT_ACCEPTED``, 32 ``GENERIC_CURRENCY_MISMATCH``, ``WALLET_EXCHANGE_KEYS_NOT_ACCEPTED``. 33 34 .. ts:def:: AcceptManualWithdrawalRequest 35 36 interface AcceptManualWithdrawalRequest { 37 exchangeBaseUrl: string; 38 amount: AmountString; 39 restrictAge?: number; 40 41 // Instead of generating a fresh, random reserve key pair, use 42 // the provided reserve private key. Use with caution. Usage of 43 // this field may be restricted to developer mode. 44 forceReservePriv?: EddsaPrivateKeyString; 45 46 progressToken?: string; 47 } 48 49 .. ts:def:: AcceptManualWithdrawalResult 50 51 interface AcceptManualWithdrawalResult { 52 // Transaction ID of the newly created withdrawal transaction. 53 transactionId: TransactionIdStr; 54 55 // Public key of the newly created reserve. 56 reservePub: string; 57 58 // Bank accounts of the exchange that can be used to fund the 59 // withdrawal. 60 withdrawalAccountsList: WithdrawalExchangeAccountDetails[]; 61 }