Skip to content
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 as ERC20Approve or VaultDeposit. It selects the shape of parameters and validationErrorResponse.
  • 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 (status AwaitingConfirmation or later). Absent for signature steps.
  • signature — set once a signature step reaches Signed. 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 a Failed step failed: validation issues, a wallet rejection, or a decoded revert. On an Indeterminate step with no transactionHash it reads { root: ['UnknownOutcome'] }: the connection failed during the send, so the outcome is unknown rather than failed. Absent while the step is healthy.