createSimplePasskeyAccount method

  1. @override
Future createSimplePasskeyAccount(
  1. PassKeyPair pkp,
  2. Uint256 salt
)
override

Creates a new Passkey wallet address using counterfactual deployment.

This method generates a new Passkey wallet address based on the provided parameters. The wallet may not actually be deployed, and deployed should be used to check deployment status. An initCode will be attached on the first transaction.

  • pkp: The PasskeyPair for the wallet passkey signer.
  • salt: The salt for create2.

Implementation

@override
Future createSimplePasskeyAccount(PassKeyPair pkp, Uint256 salt) async {
  _initCode = hexlify(_getInitCode('createPasskeyAccount', [
    pkp.credentialHexBytes,
    pkp.publicKey[0].value,
    pkp.publicKey[1].value,
    salt.value
  ]));
  getSimplePassKeyAccountAddress(pkp, salt)
      .then((addr) => {_walletAddress = addr});
}