참고: 이 페이지는 아직 한국어로 번역되지 않았습니다. 아래는 영어 원문입니다.Each input and output of a Fragment is an Array of ParamType.
Properties
| Property | Modifier | Type | Description |
|---|---|---|---|
arrayChildren | readonly | null | ParamType | The type of each child in the array. For non-array types this is null. |
arrayLength | readonly | null | number | The array length, or -1 for dynamic-lengthed arrays.For non-array types this is null. |
baseType | readonly | string | The base type (e.g. "address", "tuple", "array") |
components | readonly | null | readonly ParamType[] | The components for the tuple. For non-tuple types this is null. |
indexed | readonly | null | boolean | True if the parameters is indexed. For non-indexable types this is null. |
name | readonly | string | The local name of the parameter (or "" if unbound) |
type | readonly | string | The fully qualified type (e.g. "address", "tuple(address)", "uint256[3][]") |
Methods
format()
sighash" => "(uint256,address)"
"minimal" => "tuple(uint256,address) indexed"
"full" => "tuple(uint256 foo, address bar) indexed baz"
Parameters
| Parameter | Type |
|---|---|
format? | FormatType |
Returns
string
The formatted type.
Source
abi/fragments.ts:707isArray()
Returns
this is ParamType & Object
True if this is an Array type.
Source
abi/fragments.ts:768isIndexable()
Returns
this is ParamType & Object
True if this is an Indexable type.
Source
abi/fragments.ts:786isTuple()
Returns
this is ParamType & Object
True if this is a Tuple type.
Source
abi/fragments.ts:777walk()
value, calling process on each type, destructing the value recursively.
Parameters
| Parameter | Type |
|---|---|
value | any |
process | ParamTypeWalkFunc |
Returns
any
Source
abi/fragments.ts:793walkAsync()
value, asynchronously calling process on each type, destructing the value
recursively.
This can be used to resolve ENS naes by walking and resolving each "address" type.
Parameters
| Parameter | Type |
|---|---|
value | any |
process | ParamTypeWalkAsyncFunc |
Returns
Promise<any>
Source
abi/fragments.ts:903from()
obj.
If allowIndexed then the indexed keyword is permitted, otherwise the indexed keyword will throw an error.
Parameters
| Parameter | Type |
|---|---|
obj | any |
allowIndexed? | boolean |
Returns
ParamType
Source
abi/fragments.ts:920isParamType()
value is a ParamType.
Parameters
| Parameter | Type |
|---|---|
value | any |
Returns
value is ParamType
