• Gets the initialization code for account deployment.

    Parameters

    • unpackedUserOperation: {
          callData: `0x${string}`;
          callGasLimit: bigint;
          factory: `0x${string}`;
          factoryData: `0x${string}`;
          maxFeePerGas: bigint;
          maxPriorityFeePerGas: bigint;
          nonce: bigint;
          paymaster: `0x${string}`;
          paymasterData: `0x${string}`;
          paymasterPostOpGasLimit?: bigint;
          paymasterVerificationGasLimit?: bigint;
          preVerificationGas: bigint;
          sender: `0x${string}`;
          signature: `0x${string}`;
          verificationGasLimit: bigint;
      }

      The unpacked user operation

      • callData: `0x${string}`
      • callGasLimit: bigint

        Gas limit for the main execution call

      • factory: `0x${string}`
      • factoryData: `0x${string}`
      • maxFeePerGas: bigint

        Maximum total fee per gas unit

      • maxPriorityFeePerGas: bigint

        Maximum priority fee per gas unit

      • nonce: bigint

        Account nonce

      • paymaster: `0x${string}`
      • paymasterData: `0x${string}`
      • OptionalpaymasterPostOpGasLimit?: bigint

        Gas limit for paymaster post-operation execution

      • OptionalpaymasterVerificationGasLimit?: bigint

        Gas limit for paymaster verification

      • preVerificationGas: bigint

        Gas overhead for pre-verification operations

      • sender: `0x${string}`
      • signature: `0x${string}`
      • verificationGasLimit: bigint

        Gas limit for the verification phase

    Returns `0x${string}`

    The initialization code or "0x" if no factory is specified

    const initCode = getInitCode({
    factory: "0x123...",
    factoryData: "0x456..."
    });