Skip to content

Documentation / @etherfold/processor-entities / InputValues

Type Alias: InputValues<T> ​

InputValues<T> = T extends AbiEvent ? { [Property in InputNames<T>]: AbiParameterToPrimitiveType<Extract<T["inputs"][number], { name: Property }>> } : never

Defined in: packages/processor-entities/src/types.ts:33

The named inputs of an event, as a UNION when T is one.

The conditional is not decoration: it makes the mapped type DISTRIBUTE. An upgraded contract can carry two events under one name (Transfer(address,address,uint256) then Transfer(address,address,uint256,bytes)), and ExtractAbiEvent hands both of them over as a union, because a handler is keyed by NAME. Mapped without distributing, the two input lists MERGED into {from, to, id, memo} with memo REQUIRED -- so a pre-upgrade log handed the author undefined through a type promising a value. Distributed, args is a union the author narrows ('memo' in event.args) before reading a field only one version has.

The single-version case is unchanged: distributing over a non-union is the mapped type itself. Pinned both ways in test/handler-args.test.ts, under pnpm typecheck. There used to be a second copy of this type in the free-form processor package that had to be kept in step; that package is gone (ADR-0037) and this is now the only one.

Type Parameters ​

T ​

T extends AbiEvent