generateSolanaAndBackup

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

Generates a Solana wallet and then backs it up using the specified method.

This function first generates a new Solana wallet using generateSolanaWallet. If wallet generation is successful, it proceeds to back up the generated wallet using the provided backupMethod and backupConfigs. The progress of the backup operation is reported via the progress callback.

Return

A Result object that either contains the BackupWalletResponse on success or an exception on failure.

Parameters

backupMethod

The method to use for backing up the wallet. Defaults to BackupMethods.Gdrive.

backupConfigs

Optional configurations for the backup method. If null, default configurations will be used.

progress

A callback function that receives MpcStatus updates during the backup process.

Throws

if there's an error during the wallet generation or during the backup process.