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];Combination of a wallet operation, parameters, and its status, including relevant results of the operation.
Type Parameters
| Type Parameter |
|---|
T extends AnvilWalletOperationType |
Remarks
This is a mapped type indexed by [T] rather than a plain interface so it distributes over T:
instantiated with one operation type it is a single tagged object, and instantiated with the full
AnvilWalletOperationType union (as every exposure
site holding mixed-type operations does) it becomes the discriminated union of every variant, each
with its own correlated parameters type. A plain generic interface does not distribute this way —
applying it once to the full union would compute one object type whose parameters is the union of
every operation’s params, with no correlation to type, so switch (op.type) would narrow nothing.
The indexed mapped-type form this discrimination requires does not get a rendered Type Declaration/Properties section the way a plain interface or intersection alias (such as AnvilTransactionRequest) does, so the per-field documentation lives here instead:
type— which protocol action this step performs; selects the shape ofparametersandvalidationErrorResponse.status— current lifecycle state. Use isTerminalOperationStatus to tell whether it can still change.parameters— the inputs the step will be executed 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— exact typed data and protocol facts this signature step will authorize. Present on inspectable authorization workflows before execution.validationErrorResponse— typed reason for aFailedstep: validation issues, a wallet rejection, or a decoded revert. On anIndeterminatestep with notransactionHashit readsroot: ['UnknownOutcome']: the connection failed during the send and the outcome is unknown, not failed. Absent while the step is healthy.