Type alias AbiParameterToPrimitiveType<TAbiParameter, TAbiParameterKind>

AbiParameterToPrimitiveType<TAbiParameter, TAbiParameterKind>: TAbiParameter["type"] extends Exclude<AbiType, SolidityTuple | SolidityArray>
    ? AbiTypeToPrimitiveType<TAbiParameter["type"], TAbiParameterKind>
    : TAbiParameter extends {
            components: infer TComponents extends readonly AbiParameter[];
            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 {
                            name: string;
                        }
                        ? 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 extends string
                    ? Error<`Unknown type '${TAbiType}'.`>
                    : never
                : TAbiParameter extends {
                        components: Error<string>;
                    }
                    ? TAbiParameter["components"]
                    : unknown

Converts AbiParameter to corresponding TypeScript primitive type.

Type Parameters

Returns

TypeScript primitive type

Generated using TypeDoc