recoverWallet

suspend fun recoverWallet(cipherText: String? = null, backupMethod: BackupMethods, backupConfigs: BackupConfigs? = null, progress: (status: MpcStatus) -> Unit = {}): String

Recovers a wallet using the specified backup method.

This function initiates the wallet recovery process based on the provided backup method and configurations. It supports different recovery mechanisms such as using a password or other custom methods.

Return

A String representing the recovered wallet's eip155Address address.

Parameters

cipherText

An optional string containing the encrypted backup data. This is typically used when the recovery process involves decrypting data from an external source. If not needed, null should be passed.

backupMethod

The method used for the wallet backup. This determines the recovery mechanism to be used. See BackupMethods for available options.

backupConfigs

Optional configuration settings for the backup method. This can include parameters like the password for password-based recovery or other specific settings for different methods. If not required, null should be passed. See BackupConfigs for available configuration options.

progress

A lambda function that receives the MpcStatus updates during the recovery process. This can be used to track the progress of the recovery operation. It provides feedback on the current state or any steps performed. Default is an empty lambda that does nothing.

Throws

if an error occurs during the recovery process, including but not limited to: - Invalid cipher text or backup data. - Incorrect password (for password-based recovery). - Network issues preventing connection with the backend. - Internal errors in the MPC library.