Skip to content
On this page

Type alias: AbiParameterToPrimitiveType<TAbiParameter, TAbiParameterKind>

AbiParameterToPrimitiveType: <TAbiParameter, TAbiParameterKind> TAbiParameter["type"] extends Exclude< AbiType, SolidityTuple | SolidityArray > ? AbiTypeToPrimitiveType< TAbiParameter["type"], TAbiParameterKind > : TAbiParameter extends {components: infer TComponents; type: SolidityTuple;} ? TComponents extends readonly [] ? [] : _HasUnnamedAbiParameter< TComponents > extends true ? readonly [...{ [K in keyof TComponents]: AbiParameterToPrimitiveType<TComponents[K], TAbiParameterKind> }] : { [Component in TComponents[number] as Component extends Object ? Component["name"] : never]: AbiParameterToPrimitiveType<Component, TAbiParameterKind> } : TAbiParameter["type"] extends `${infer Head}[${"" | `${SolidityFixedArrayRange}`}]` ? TAbiParameter["type"] extends `${Head}[${infer Size}]` ? Size extends keyof SolidityFixedArraySizeLookup ? Tuple< AbiParameterToPrimitiveType< Merge< TAbiParameter, {type: Head;} >, TAbiParameterKind >, SolidityFixedArraySizeLookup[Size] > : readonly AbiParameterToPrimitiveType< Merge< TAbiParameter, {type: Head;} >, TAbiParameterKind >[] : never : ResolvedConfig["StrictAbiType"] extends true ? TAbiParameter["type"] extends infer TAbiType ? Error$1< `Unknown type '${TAbiType}'.` > : never : unknown

Converts AbiParameter to corresponding TypeScript primitive type.

Type parameters

ParameterDefaultDescription
TAbiParameter extends AbiParameter | {name: string; type: unknown;}-AbiParameter to convert to TypeScript representation
TAbiParameterKind extends AbiParameterKindAbiParameterKindOptional AbiParameterKind to narrow by parameter type

Defined In

node_modules/.pnpm/abitype@0.7.1_typescript@4.9.5/node_modules/abitype/dist/index.d.ts:93


Generated using TypeDoc and typedoc-plugin-markdown