Skip to content

signUserOperation

Signs the unsigned UserOperationStruct returned from buildUserOperation, buildUserOperationFromTx, or buildUserOperationFromTxs actions of the SmartAccountClient using the account connected to the client.

Usage

Returns

Promise<{ hash: Hash, request: UserOperationRequest }>

A Promise containing the signed result of the input UserOperationStruct using the account connected to the SmartAccountClient

Parameters

SignUserOperationParameters<TAccount extends SmartContractAccount | undefined = SmartContractAccount | undefined>

SignUserOperationParameters
export type SignUserOperationParameters<
  TAccount extends SmartContractAccount | undefined =
    | SmartContractAccount
    | undefined,
  TEntryPointVersion extends GetEntryPointFromAccount<TAccount> = GetEntryPointFromAccount<TAccount>,
  TContext extends UserOperationContext | undefined =
    | UserOperationContext
    | undefined
> = {
  uoStruct: UserOperationStruct<TEntryPointVersion>;
} & GetAccountParameter<TAccount> &
  GetContextParameter<TContext>;
  • uoStruct: UserOperationStruct

The unsigned UserOperationStruct returned from buildUserOperation, buildUserOperationFromTx, or buildUserOperationFromTxs actions of the SmartAccountClient returned after running the client middleware pipeline to construct the user operation struct from the input user operation calldata

  • account?: TAccount extends SmartContractAccount | undefined

When using this action, if the SmartContractAccount has not been connected to the SmartAccountClient (e.g. SmartAccountClient not instantiated with your SmartContractAccount during createSmartAccountClient). You can check if the account is connected to the client by checking the account field of SmartAccountClient. If the account is not connected, you can specify the SmartContractAccount instance to use for the function call.