generate command initiates the MPC process to create a set of shares. The users share and the wallet address is automatically stored in the user’s secure phone storage.
Once you have a Portal instance, you can now generate a wallet. In the example below, we create a Generate Wallet button:
createWallet returns a Result<CreateWalletsResponse>. On success, ethereumAddress and solanaAddress hold the new wallet’s EVM and Solana addresses.
Starting from SDK version 10.1.0, if the EVM or Solana address isn’t available after the wallet is created,
createWallet returns a failed Result carrying an IllegalStateException instead of a successful result with an empty address. Handle it in onFailure, as in the example above.WARNING: To create a wallet with the Portal SDK, your device must be configured to use passcode authentication. If you change your passcode, your Portal wallet will continue to operate as expected. However, if you disable passcode authentication after running the
generate function, you will be required to execute the recover function before you can continue using your Portal wallet.