Type alias: AbiParameterToPrimitiveType<TAbiParameter, TAbiParameterKind>
AbiParameterToPrimitiveType: <
TAbiParameter
,TAbiParameterKind
>TAbiParameter
["type"
] extendsExclude
<AbiType
,SolidityTuple
|SolidityArray
> ?AbiTypeToPrimitiveType
<TAbiParameter
["type"
],TAbiParameterKind
> :TAbiParameter
extends {components
: infer TComponents;type
:SolidityTuple
;} ?TComponents
extends readonly [] ? [] :_HasUnnamedAbiParameter
<TComponents
> extendstrue
? 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 keyofSolidityFixedArraySizeLookup
?Tuple
<AbiParameterToPrimitiveType
<Merge
<TAbiParameter
, {type
:Head
;} >,TAbiParameterKind
>,SolidityFixedArraySizeLookup
[Size
] > : readonlyAbiParameterToPrimitiveType
<Merge
<TAbiParameter
, {type
:Head
;} >,TAbiParameterKind
>[] :never
:ResolvedConfig
["StrictAbiType"
] extendstrue
?TAbiParameter
["type"
] extends infer TAbiType ?Error$1
< `Unknown type '${TAbiType}'.` > :never
:unknown
Converts AbiParameter to corresponding TypeScript primitive type.
Type parameters
Parameter | Default | Description |
---|---|---|
TAbiParameter extends AbiParameter | {name : string ; type : unknown ;} | - | AbiParameter to convert to TypeScript representation |
TAbiParameterKind extends AbiParameterKind | AbiParameterKind | Optional 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