Interface for EntryPoint v0.6.0 contract interactions.

interface IEntryPointV6 {
    address: `0x${string}`;
    encodeHandleOpsFunctionData: (
        userOperation: {
            callData: `0x${string}`;
            callGasLimit: bigint;
            initCode: `0x${string}`;
            maxFeePerGas: bigint;
            maxPriorityFeePerGas: bigint;
            nonce: bigint;
            paymasterAndData: `0x${string}`;
            preVerificationGas: bigint;
            sender: `0x${string}`;
            signature: `0x${string}`;
            verificationGasLimit: bigint;
        },
        beneficiary: `0x${string}`,
    ) => `0x${string}`;
    getNonce: (
        smartAccountAddress: `0x${string}`,
        key?: bigint,
    ) => Promise<bigint>;
    simulateHandleOp: (
        params: SimulateHandleOpParamsV6,
    ) => Promise<
        {
            paid: bigint;
            preOpGas: bigint;
            targetResult: `0x${string}`;
            targetSuccess: boolean;
            validAfter: number;
            validUntil: number;
        },
    >;
}

Hierarchy (View Summary)

Properties

address: `0x${string}`

Contract address

encodeHandleOpsFunctionData: (
    userOperation: {
        callData: `0x${string}`;
        callGasLimit: bigint;
        initCode: `0x${string}`;
        maxFeePerGas: bigint;
        maxPriorityFeePerGas: bigint;
        nonce: bigint;
        paymasterAndData: `0x${string}`;
        preVerificationGas: bigint;
        sender: `0x${string}`;
        signature: `0x${string}`;
        verificationGasLimit: bigint;
    },
    beneficiary: `0x${string}`,
) => `0x${string}`

Encodes function data for handleOps

Type declaration

    • (
          userOperation: {
              callData: `0x${string}`;
              callGasLimit: bigint;
              initCode: `0x${string}`;
              maxFeePerGas: bigint;
              maxPriorityFeePerGas: bigint;
              nonce: bigint;
              paymasterAndData: `0x${string}`;
              preVerificationGas: bigint;
              sender: `0x${string}`;
              signature: `0x${string}`;
              verificationGasLimit: bigint;
          },
          beneficiary: `0x${string}`,
      ): `0x${string}`
    • Encodes the function data for handling user operations.

      Parameters

      • userOperation: {
            callData: `0x${string}`;
            callGasLimit: bigint;
            initCode: `0x${string}`;
            maxFeePerGas: bigint;
            maxPriorityFeePerGas: bigint;
            nonce: bigint;
            paymasterAndData: `0x${string}`;
            preVerificationGas: bigint;
            sender: `0x${string}`;
            signature: `0x${string}`;
            verificationGasLimit: bigint;
        }

        The user operation to encode

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

          Gas limit for the main execution call

        • initCode: `0x${string}`
        • maxFeePerGas: bigint

          Maximum total fee per gas unit

        • maxPriorityFeePerGas: bigint

          Maximum priority fee per gas unit

        • nonce: bigint

          Account nonce

        • paymasterAndData: `0x${string}`
        • preVerificationGas: bigint

          Gas overhead for pre-verification operations

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

          Gas limit for the verification phase

      • beneficiary: `0x${string}`

        The address that will receive the gas refund

      Returns `0x${string}`

      The encoded function data as a hex string

      const encodedData = entryPoint.encodeHandleOpsFunctionData(
      userOperation,
      '0x123...' // beneficiary address
      );
getNonce: (smartAccountAddress: `0x${string}`, key?: bigint) => Promise<bigint>

Gets the nonce for an account

Type declaration

    • (smartAccountAddress: `0x${string}`, key?: bigint): Promise<bigint>
    • Retrieves the nonce for a smart account at the specified key.

      Parameters

      • smartAccountAddress: `0x${string}`

        The address of the smart account

      • key: bigint = 0n

        Optional key for the nonce, defaults to 0n

      Returns Promise<bigint>

      The current nonce value as a bigint

      const nonce = await entryPoint.getNonce('0x123...');
      const nonceAtKey = await entryPoint.getNonce('0x123...', 1n);
simulateHandleOp: (
    params: SimulateHandleOpParamsV6,
) => Promise<
    {
        paid: bigint;
        preOpGas: bigint;
        targetResult: `0x${string}`;
        targetSuccess: boolean;
        validAfter: number;
        validUntil: number;
    },
>

Simulates handling a user operation

Type declaration

    • (
          params: SimulateHandleOpParamsV6,
      ): Promise<
          {
              paid: bigint;
              preOpGas: bigint;
              targetResult: `0x${string}`;
              targetSuccess: boolean;
              validAfter: number;
              validUntil: number;
          },
      >
    • Simulates the execution of a user operation. This method always reverts by design, and the execution result is parsed from the revert data.

      Parameters

      • params: SimulateHandleOpParamsV6

        The simulation parameters

        Parameters for the simulateHandleOp method

        • OptionalstateOverrides?: StateOverrideSet

          Optional state overrides to modify blockchain state during simulation

        • targetAddress: `0x${string}`

          The target contract address for the simulation

        • targetCallData: `0x${string}`

          The calldata to be executed on the target contract

        • userOperation: {
              callData: `0x${string}`;
              callGasLimit: bigint;
              initCode: `0x${string}`;
              maxFeePerGas: bigint;
              maxPriorityFeePerGas: bigint;
              nonce: bigint;
              paymasterAndData: `0x${string}`;
              preVerificationGas: bigint;
              sender: `0x${string}`;
              signature: `0x${string}`;
              verificationGasLimit: bigint;
          }

          The user operation to simulate

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

            Gas limit for the main execution call

          • initCode: `0x${string}`
          • maxFeePerGas: bigint

            Maximum total fee per gas unit

          • maxPriorityFeePerGas: bigint

            Maximum priority fee per gas unit

          • nonce: bigint

            Account nonce

          • paymasterAndData: `0x${string}`
          • preVerificationGas: bigint

            Gas overhead for pre-verification operations

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

            Gas limit for the verification phase

      Returns Promise<
          {
              paid: bigint;
              preOpGas: bigint;
              targetResult: `0x${string}`;
              targetSuccess: boolean;
              validAfter: number;
              validUntil: number;
          },
      >

      The execution result containing validation and execution details

      ParseError if the error data cannot be parsed

      SimulateHandleOpError if the simulation fails with an error

      const result = await entryPoint.simulateHandleOp({
      userOperation: {
      sender: '0x123...',
      nonce: '0x1',
      // ... other UserOperation fields
      },
      targetAddress: '0x456...',
      targetCallData: '0x789...',
      stateOverrides: {
      // Optional state modifications
      }
      });