Recovering a wallet with the SDK
Last updated
Last updated
The function is used to recover a wallet if user lost their password or if they’re using a new device. It requires the user to have their seedphrase in order for them to recover the wallet.
In the recovery process, we create a new set of key pair and send the public key to wallaby and we get back the user's wallabyAuthPubKey
, then we use the key to encrypt the seedphrase provided by the user then send it to Wallaby to get back the wallet and its assets.
If the recovery is successfull, we encrypt and store in localstorage the seedphrase using the client's public key (clientAuthPubKey
) and the private key using the new password the user provides.
Function Parameters
newPassword
string
A unique new password for the wallet
seedPhrase
string
The user's seed phrase in plain text.
Function Response
user
The user information.
wallet
Wallet
Wallet object.
Example: