API ReferenceTransactions, wallets, and signaturesType Alias
WalletOperation\<T\>
type WalletOperation<T> = { [K in T]: { authorization?: AnvilAuthorization; parameters: AnvilWalletOperationTypeParams<K>; signature?: Bytes; status: WalletOperationStatus; transactionHash?: string; type: K; validationErrorResponse?: K extends keyof AnvilWalletOperationTypeErrorMap ? AnvilWalletOperationTypeErrorMap[K] : never; };}[T];One step of a WalletOperationWorkflow: the protocol action it performs, the inputs it runs with, its current status, and its result once it has one.
Type Parameters
| Type Parameter |
|---|
T extends AnvilWalletOperationType |
Remarks
A workflow’s steps can be of different types. Switch on type to narrow parameters and
validationErrorResponse to that step’s shapes.
Fields:
type— which protocol action this step performs, such asERC20ApproveorVaultDeposit. It selects the shape ofparametersandvalidationErrorResponse.status— the step’s WalletOperationStatus. Use isTerminalOperationStatus to tell whether it can still change.parameters— the inputs the step runs with; the exact type is AnvilWalletOperationTypeParams<T>.transactionHash— set once a transaction step has been submitted (statusAwaitingConfirmationor later). Absent for signature steps.signature— set once a signature step reachesSigned. Absent for transaction steps.authorization— the exact typed data and protocol facts a signature step asks the wallet to sign. Set before execution when the workflow lets you inspect what will be signed, as LOCModule.buildCancelAuthorizationWorkflow does.validationErrorResponse— why aFailedstep failed: validation issues, a wallet rejection, or a decoded revert. On anIndeterminatestep with notransactionHashit reads{ root: ['UnknownOutcome'] }: the connection failed during the send, so the outcome is unknown rather than failed. Absent while the step is healthy.