backupWallet

suspend fun backupWallet(backupMethod: BackupMethods = BackupMethods.Gdrive, backupConfigs: BackupConfigs? = null, progress: (status: MpcStatus) -> Unit = {}): BackupWalletResponse

Backs up the wallet share using the specified backup method.

This function initiates the backup process for the wallet share stored on the device. It supports different backup methods, including Google Drive and password-based encryption.

Return

A BackupWalletResponse object containing the result of the backup operation.

Parameters

backupMethod

The method to use for backing up the wallet. Defaults to BackupMethods.Gdrive. Other available options are defined in the BackupMethods enum.

backupConfigs

Optional configuration settings for the backup process. If using BackupMethods.Password, this should contain the password. If using other methods, this can be null.

progress

A callback function to receive updates on the backup progress. It receives an MpcStatus object representing the current status. Defaults to an empty function that does nothing.

Throws

If there is no wallet share available on the device storage.

Any other exceptions that might occur during the backup process, such as network errors or invalid credentials. These should be handled by the caller.