Type alias TypedDataToPrimitiveTypes<TTypedData, TAbiParameterKind, TKeyReferences>

TypedDataToPrimitiveTypes<TTypedData, TAbiParameterKind, TKeyReferences>: {
    [K in keyof TTypedData]: {
        [K2 in TTypedData[K][number] as K2["name"]]: K2["type"] extends K
            ? Error<`Cannot convert self-referencing struct '${K2["type"]}' to primitive type.`>
            : K2["type"] extends keyof TTypedData
                ? K2["type"] extends keyof TKeyReferences
                    ? Error<`Circular reference detected. '${K2["type"]}' is a circular reference.`>
                    : TypedDataToPrimitiveTypes<Exclude<TTypedData, K>, TAbiParameterKind, TKeyReferences & {
                        [_ in K2["type"] | K]: true
                    }>[K2["type"]]
                : K2["type"] extends `${infer TType extends keyof TTypedData & string}[${infer Tail}]`
                    ? AbiParameterToPrimitiveType<{
                        components: _TypedDataParametersToAbiParameters<TTypedData[TType], TTypedData, TKeyReferences & {
                            [_ in TType | K]: true
                        }>;
                        name: K2["name"];
                        type: `tuple[${Tail}]`;
                    }, TAbiParameterKind>
                    : K2["type"] extends TypedDataType
                        ? AbiParameterToPrimitiveType<K2, TAbiParameterKind>
                        : Error<`Cannot convert unknown type '${K2["type"]}' to primitive type.`>
    }
}

Converts TTypedData to corresponding TypeScript primitive types.

Type Parameters

Returns

Union of TypeScript primitive types

Generated using TypeDoc