Skip to content

defaultUserOpSigner

Provides a default middleware function for signing user operations with a client account. This function validates the request and adds the signature to it. This is already included in the client returned from createSmartAccountClient

Import

import { defaultUserOpSigner } from "@aa-sdk/core";

Parameters

struct

UserOperationStruct The user operation structure to be signed

context

* The middleware context containing the client and account information

context.client

Client The client object, which should include account and chain information

context.account

Account Optional, the account used for signing, defaults to the client's account if not provided

Returns

Promise<UserOperationStruct> A promise that resolves to the signed user operation structure