name: StorageKey
description: A representation of a storage key (typically hashed) in the system. It can be constructed by passing in a raw key or a StorageFunction with (optional) arguments.
Hierarchy
↳ Bytes
↳ StorageKey
Implements
Indexable
[index: number]: number
Constructors
constructor
⊕ new StorageKey(value: AnyU8a | StorageKey | StorageFunction | [StorageFunction, any]): StorageKey
Overrides Bytes.constructor
Defined in StorageKey.ts:28
Parameters:
| Name | Type | |||
|---|---|---|---|---|
| value | AnyU8a | StorageKey | StorageFunction | [StorageFunction, any] |
Returns: StorageKey
Accessors
encodedLength
getencodedLength(): number
Inherited from Bytes.encodedLength
Overrides U8a.encodedLength
Defined in Bytes.ts:61
description: The length of the value when encoded as a Uint8Array
Returns: number
isEmpty
getisEmpty(): boolean
Defined in codec/U8a.ts:43
description: Returns true if the type wraps an empty/default all-0 value
Returns: boolean
length
getlength(): number
Overrides Uint8Array.length
Defined in codec/U8a.ts:50
description: The length of the value
Returns: number
meta
getmeta(): StorageFunctionMetadata | null
Defined in StorageKey.ts:82
description: The metadata or null when not available
Returns: StorageFunctionMetadata | null
outputType
getoutputType(): string | null
Defined in StorageKey.ts:89
description: The output type, null when not available
Returns: string | null
Methods
eq
▸ eq(other?: any): boolean
Defined in codec/U8a.ts:58
description: Compares the value of the input to see if there is a match
Parameters:
| Name | Type |
|---|---|
Optional other |
any |
Returns: boolean
subarray
▸ subarray(begin: number, end?: undefined | number): Uint8Array
Overrides Uint8Array.subarray
Defined in codec/U8a.ts:73
description: Create a new subarray from the actual buffer. This is needed for compat reasons since a new Uint8Array gets returned here
Parameters:
| Name | Type | Description | |
|---|---|---|---|
| begin | number |
The position to start at | |
Optional end |
undefined |
number |
The position to end at |
Returns: Uint8Array
toHex
▸ toHex(): string
Defined in codec/U8a.ts:80
description: Returns a hex string representation of the value
Returns: string
toJSON
▸ toJSON(): any
Implementation of Codec.toJSON
Defined in codec/U8a.ts:87
description: Converts the Object to JSON, typically used for RPC transfers
Returns: any
toString
▸ toString(): string
Implementation of Codec.toString
Overrides Uint8Array.toString
Defined in codec/U8a.ts:94
description: Returns the string representation of the value
Returns: string
toU8a
▸ toU8a(isBare?: undefined | false | true): Uint8Array
Defined in Bytes.ts:69
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
<Static> decodeStorageKey
▸ decodeStorageKey(value: AnyU8a | StorageKey | StorageFunction | [StorageFunction, any]): Uint8Array
Defined in StorageKey.ts:37
Parameters:
| Name | Type | |||
|---|---|---|---|---|
| value | AnyU8a | StorageKey | StorageFunction | [StorageFunction, any] |
Returns: Uint8Array
<Static> getMeta
▸ getMeta(value: StorageKey | StorageFunction | [StorageFunction, any]): StorageFunctionMetadata | null
Defined in StorageKey.ts:51
Parameters:
| Name | Type | ||
|---|---|---|---|
| value | StorageKey | StorageFunction | [StorageFunction, any] |
Returns: StorageFunctionMetadata | null
<Static> getType
▸ getType(value: StorageKey | StorageFunction | [StorageFunction, any]): string | null
Defined in StorageKey.ts:65
Parameters:
| Name | Type | ||
|---|---|---|---|
| value | StorageKey | StorageFunction | [StorageFunction, any] |
Returns: string | null