Polkadot JS APIGlobals"primitive/StorageKey"StorageKey

# Class: StorageKey

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 StorageEntry with (optional) arguments.

# Hierarchy

Bytes

StorageKey

# Implements

# Indexable

  • [ index: number]: number

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 StorageEntry with (optional) arguments.

# Index

# Constructors

# Properties

# Accessors

# Methods

# Constructors

# constructor

+ new StorageKey(registry: Registry, value?: AnyU8a | StorageKey | StorageEntry | [StorageEntry, any], override: Partial‹StorageKeyExtra›): StorageKey

Overrides Bytes.constructor

Defined in packages/types/src/primitive/StorageKey.ts:165

Parameters:

Name Type Default
registry Registry -
value? AnyU8a | StorageKey | StorageEntry | [StorageEntry, any] -
override Partial‹StorageKeyExtra› {}

Returns: StorageKey

# Properties

# Readonly registry

registry: Registry

Implementation of IU8a.registry

Inherited from Raw.registry

Defined in packages/types/src/codec/Raw.ts:30

# Accessors

# args

get args(): Codec[]

Defined in packages/types/src/primitive/StorageKey.ts:214

description Return the decoded arguments (applicable to map/doublemap with decodable values)

Returns: Codec[]


# encodedLength

get encodedLength(): number

Inherited from Bytes.encodedLength

Overrides Raw.encodedLength

Defined in packages/types/src/primitive/Bytes.ts:55

description The length of the value when encoded as a Uint8Array

Returns: number


# hash

get hash(): H256

Inherited from Raw.hash

Defined in packages/types/src/codec/Raw.ts:48

description returns a hash of the contents

Returns: H256


# isEmpty

get isEmpty(): boolean

Inherited from Raw.isEmpty

Defined in packages/types/src/codec/Raw.ts:55

description Returns true if the type wraps an empty/default all-0 value

Returns: boolean


# length

get length(): number

Inherited from Raw.length

Overrides IU8a.length

Defined in packages/types/src/codec/Raw.ts:62

description The length of the value

Returns: number


# meta

get meta(): StorageEntryMetadataLatest | undefined

Defined in packages/types/src/primitive/StorageKey.ts:221

description The metadata or undefined when not available

Returns: StorageEntryMetadataLatest | undefined


# method

get method(): string | undefined

Defined in packages/types/src/primitive/StorageKey.ts:228

description The key method or undefined when not specified

Returns: string | undefined


# outputType

get outputType(): string

Defined in packages/types/src/primitive/StorageKey.ts:235

description The output type

Returns: string


# section

get section(): string | undefined

Defined in packages/types/src/primitive/StorageKey.ts:242

description The key section or undefined when not specified

Returns: string | undefined

# Methods

# bitLength

bitLength(): number

Implementation of IU8a

Inherited from Raw.bitLength

Defined in packages/types/src/codec/Raw.ts:70

description Returns the number of bits in the value

Returns: number


# eq

eq(other?: unknown): boolean

Implementation of IU8a

Inherited from Raw.eq

Defined in packages/types/src/codec/Raw.ts:77

description Compares the value of the input to see if there is a match

Parameters:

Name Type
other? unknown

Returns: boolean


# setMeta

setMeta(meta?: StorageEntryMetadataLatest): this

Defined in packages/types/src/primitive/StorageKey.ts:249

description Sets the meta for this key

Parameters:

Name Type
meta? StorageEntryMetadataLatest

Returns: this


# subarray

subarray(begin: number, end?: undefined | number): Uint8Array

Inherited from Raw.subarray

Overrides IU8a.subarray

Defined in packages/types/src/codec/Raw.ts:91

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
end? undefined | number The position to end at

Returns: Uint8Array


# toHex

toHex(): string

Inherited from Raw.toHex

Defined in packages/types/src/codec/Raw.ts:98

description Returns a hex string representation of the value

Returns: string


# toHuman

toHuman(): AnyJson

Overrides Raw.toHuman

Defined in packages/types/src/primitive/StorageKey.ts:268

description Returns the Human representation for this type

Returns: AnyJson


# toJSON

toJSON(): string

Implementation of IU8a

Inherited from Raw.toJSON

Defined in packages/types/src/codec/Raw.ts:112

description Converts the Object to JSON, typically used for RPC transfers

Returns: string


# toRawType

toRawType(): string

Implementation of IU8a

Overrides Bytes.toRawType

Defined in packages/types/src/primitive/StorageKey.ts:277

description Returns the raw type for this

Returns: string


# toString

toString(): string

Implementation of IU8a

Inherited from Raw.toString

Overrides IU8a.toString

Defined in packages/types/src/codec/Raw.ts:126

description Returns the string representation of the value

Returns: string


# toU8a

toU8a(isBare?: undefined | false | true): Uint8Array

Inherited from Bytes.toU8a

Overrides Raw.toU8a

Defined in packages/types/src/primitive/Bytes.ts:70

description Encodes the value as a Uint8Array as per the SCALE specifications

Parameters:

Name Type Description
isBare? undefined | false | true true when the value has none of the type-specific prefixes (internal)

Returns: Uint8Array


# Static getMeta

getMeta(value: StorageKey | StorageEntry | [StorageEntry, any]): StorageEntryMetadataLatest | undefined

Defined in packages/types/src/primitive/StorageKey.ts:180

Parameters:

Name Type
value StorageKey | StorageEntry | [StorageEntry, any]

Returns: StorageEntryMetadataLatest | undefined


# Static getType

getType(value: StorageKey | StorageEntry | [StorageEntry, any]): string

Defined in packages/types/src/primitive/StorageKey.ts:194

Parameters:

Name Type
value StorageKey | StorageEntry | [StorageEntry, any]

Returns: string