generateWallets

open suspend fun generateWallets(progress: (status: MpcStatus) -> Unit = {}): Map<PortalNamespace, String>

Generates new wallets for both SECP256K1 and ED25519 curves using Multi-Party Computation (MPC).

This function is responsible for generating new signing shares for two cryptographic curves, storing them securely, updating their status on the server, and returning the associated wallet addresses. It handles progress reporting, error handling, and synchronization of wallet modification operations.

Return

A map containing the generated wallet addresses. Currently, it only includes the address for the EIP155 namespace, associated with the SECP256K1 curve.

Parameters

progress

A callback function to report the progress of the wallet generation process. It receives an MpcStatus object, which indicates the current status and whether the operation is completed.

Throws

Throws an error if: - The MPC version is not "v6" (generation is only supported for v6). - A wallet modification operation is already in progress. - There are validation errors with the Keychain operations. - The server returns an error during share generation. - The generated share data is missing or invalid. - The signing share pair ID cannot be derived from the generated share.

Throws an MpcError if the server returns an error during the generation process.