Type alias EthKeyring<State>

EthKeyring<State>: Keyring<State> & {
    patchUserOperation?(address, userOp, context): Promise<{
        callGasLimit?: string;
        paymasterAndData: string;
        preVerificationGas?: string;
        verificationGasLimit?: string;
    }>;
    prepareUserOperation?(address, transactions, context): Promise<{
        bundlerUrl: string;
        callData: string;
        dummyPaymasterAndData: string;
        dummySignature: string;
        gasLimits?: {
            callGasLimit: string;
            preVerificationGas: string;
            verificationGasLimit: string;
        };
        initCode: string;
        nonce: string;
    }>;
    signUserOperation?(address, userOp, context): Promise<string>;
}

Type Parameters

  • State extends Json

Type declaration

  • patchUserOperation?:function
    • Patches properties of a UserOperation. Currently, only the paymasterAndData can be patched.

      Parameters

      • address: string

        Address of the sender.

      • userOp: {
            callData: string;
            callGasLimit: string;
            initCode: string;
            maxFeePerGas: string;
            maxPriorityFeePerGas: string;
            nonce: string;
            paymasterAndData: string;
            preVerificationGas: string;
            sender: string;
            signature: string;
            verificationGasLimit: string;
        }

        UserOperation to patch.

        • callData: string
        • callGasLimit: string
        • initCode: string
        • maxFeePerGas: string
        • maxPriorityFeePerGas: string
        • nonce: string
        • paymasterAndData: string
        • preVerificationGas: string
        • sender: string
        • signature: string
        • verificationGasLimit: string
      • context: KeyringExecutionContext

        Keyring execution context.

      Returns Promise<{
          callGasLimit?: string;
          paymasterAndData: string;
          preVerificationGas?: string;
          verificationGasLimit?: string;
      }>

      A patch to apply to the UserOperation.

  • prepareUserOperation?:function
    • Convert a base transaction to a base UserOperation.

      Parameters

      • address: string

        Address of the sender.

      • transactions: {
            data: string;
            to: string;
            value: string;
        }[]

        Base transactions to include in the UserOperation.

      • context: KeyringExecutionContext

        Keyring execution context.

      Returns Promise<{
          bundlerUrl: string;
          callData: string;
          dummyPaymasterAndData: string;
          dummySignature: string;
          gasLimits?: {
              callGasLimit: string;
              preVerificationGas: string;
              verificationGasLimit: string;
          };
          initCode: string;
          nonce: string;
      }>

      A pseudo-UserOperation that can be used to construct a real.

  • signUserOperation?:function
    • Signs an UserOperation.

      Parameters

      • address: string

        Address of the sender.

      • userOp: {
            callData: string;
            callGasLimit: string;
            initCode: string;
            maxFeePerGas: string;
            maxPriorityFeePerGas: string;
            nonce: string;
            paymasterAndData: string;
            preVerificationGas: string;
            sender: string;
            signature: string;
            verificationGasLimit: string;
        }

        UserOperation to sign.

        • callData: string
        • callGasLimit: string
        • initCode: string
        • maxFeePerGas: string
        • maxPriorityFeePerGas: string
        • nonce: string
        • paymasterAndData: string
        • preVerificationGas: string
        • sender: string
        • signature: string
        • verificationGasLimit: string
      • context: KeyringExecutionContext

        Keyring execution context.

      Returns Promise<string>

      The signature of the UserOperation.