name: Type
description: This is a extended version of String, specifically to handle types. Here we rely fully on what string provides us, however we also adjust the types received from the runtime, i.e. we remove the T:: prefixes found in some types for consistency accross implementation.
Hierarchy
↳ Text
↳ Type
Implements
Indexable
[index: number]: string
Constructors
constructor
⊕ new Type(value?: Text | Uint8Array | string): Type
Overrides Text.constructor
Defined in Type.ts:19
Parameters:
| Name | Type | Default value | ||
|---|---|---|---|---|
Default value value |
Text | Uint8Array |
string |
"" |
Returns: Type
Accessors
encodedLength
getencodedLength(): number
Overrides Text.encodedLength
Defined in Type.ts:72
description: The length of the value when encoded as a Uint8Array
Returns: number
length
getlength(): number
Overrides String.length
Defined in Text.ts:54
description: The length of the value
Returns: number
Methods
toHex
▸ toHex(): string
Defined in Text.ts:62
description: Returns a hex string representation of the value
Returns: string
toJSON
▸ toJSON(): any
Implementation of Codec.toJSON
Defined in Text.ts:69
description: Converts the Object to JSON, typically used for RPC transfers
Returns: any
toString
▸ toString(): string
Implementation of Codec.toString
Overrides String.toString
Defined in Text.ts:76
description: Returns the string representation of the value
Returns: string
toU8a
▸ toU8a(isBare?: undefined | false | true): Uint8Array
Defined in Type.ts:83
description: Encodes the value as a Uint8Array as per the parity-codec specifications
Parameters:
| Name | Type | Description | ||
|---|---|---|---|---|
Optional isBare |
undefined |
false |
true |
true when the value has none of the type-specific prefixes (internal) |
Returns: Uint8Array