provisionWallet

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

Recovers an existing one based on provided parameters.

This function handles the process of setting up a new multi-party computation (MPC) wallet or recovering an existing one using various backup methods.

Return

A String representing the address of the provisioned wallet.

Parameters

cipherText

Optional. The encrypted data required for recovery when using specific backup methods like Cloud or Manual. If null, it indicates a new wallet creation. If provided, it signifies wallet recovery. The format and content of this string depend on the backupMethod.

backupMethod

The chosen method for backing up and recovering the wallet. See BackupMethods for the available options like NONE, CLOUD, MANUAL.

backupConfigs

Optional. Configuration details for the chosen backup method. If using CLOUD backup, this should contain cloud-specific details. If null, default configurations may be used or an error may be thrown depending on backupMethod.

progress

A lambda function that receives updates on the wallet provisioning or recovery status. It provides feedback via MpcStatus indicating different stages such as INITIALIZING, GENERATING_KEYS, COMPLETED, or FAILED. This allows the calling function to track the operation's progress and handle potential errors.

See also