Polkadot JS APIGlobals"codec/VecAny"VecAny

# Class: VecAny <T>

name VecAny

description This manages codec arrays, assuming that the inputs are already of type Codec. Unlike a vector, this can be used to manage array-like structures with variable arguments of any types

# Type parameters

T: Codec

# Hierarchy

AbstractArray‹T›

VecAny

# Implements

# Indexable

  • [ n: number]: T

name VecAny

description This manages codec arrays, assuming that the inputs are already of type Codec. Unlike a vector, this can be used to manage array-like structures with variable arguments of any types

# Index

# Properties

# Accessors

# Methods

# Properties

# Readonly registry

registry: Registry

Implementation of Codec.registry

Inherited from AbstractArray.registry

Defined in packages/types/src/codec/AbstractArray.ts:23

# Accessors

# encodedLength

get encodedLength(): number

Inherited from AbstractArray.encodedLength

Defined in packages/types/src/codec/AbstractArray.ts:34

description The length of the value when encoded as a Uint8Array

Returns: number


# hash

get hash(): H256

Inherited from AbstractArray.hash

Defined in packages/types/src/codec/AbstractArray.ts:43

description returns a hash of the contents

Returns: H256


# isEmpty

get isEmpty(): boolean

Inherited from AbstractArray.isEmpty

Defined in packages/types/src/codec/AbstractArray.ts:50

description Checks if the value is an empty value

Returns: boolean


# length

get length(): number

Inherited from AbstractArray.length

Overrides void

Defined in packages/types/src/codec/AbstractArray.ts:57

description The length of the value

Returns: number

# Methods

# eq

eq(other?: unknown): boolean

Implementation of Codec

Inherited from AbstractArray.eq

Defined in packages/types/src/codec/AbstractArray.ts:65

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

Parameters:

Name Type
other? unknown

Returns: boolean


# filter

filter(callbackfn: function, thisArg?: unknown): T[]

Inherited from AbstractArray.filter

Overrides void

Defined in packages/types/src/codec/AbstractArray.ts:144

description Filters the array with the callback

Parameters:

callbackfn: function

The filter function

▸ (value: T, index: number, array: T[]): boolean

Parameters:

Name Type
value T
index number
array T[]

Optional thisArg: unknown

The this object to apply the result to

Returns: T[]


# includes

includes(check: unknown): boolean

Inherited from AbstractArray.includes

Defined in packages/types/src/codec/AbstractArray.ts:160

description Checks if the array includes a specific value

Parameters:

Name Type
check unknown

Returns: boolean


# map

map<U>(callbackfn: function, thisArg?: unknown): U[]

Inherited from AbstractArray.map

Overrides void

Defined in packages/types/src/codec/AbstractArray.ts:153

description Maps the array with the callback

Type parameters:

U

Parameters:

callbackfn: function

The mapping function

▸ (value: T, index: number, array: T[]): U

Parameters:

Name Type
value T
index number
array T[]

Optional thisArg: unknown

The this onject to apply the result to

Returns: U[]


# toArray

toArray(): T[]

Inherited from AbstractArray.toArray

Defined in packages/types/src/codec/AbstractArray.ts:72

description Converts the Object to an standard JavaScript Array

Returns: T[]


# toHex

toHex(): string

Inherited from AbstractArray.toHex

Defined in packages/types/src/codec/AbstractArray.ts:79

description Returns a hex string representation of the value

Returns: string


# toHuman

toHuman(isExtended?: undefined | false | true): AnyJson

Implementation of Codec

Inherited from AbstractArray.toHuman

Defined in packages/types/src/codec/AbstractArray.ts:86

description Converts the Object to to a human-friendly JSON, with additional fields, expansion and formatting of information

Parameters:

Name Type
isExtended? undefined | false | true

Returns: AnyJson


# toJSON

toJSON(): AnyJson

Implementation of Codec

Inherited from AbstractArray.toJSON

Defined in packages/types/src/codec/AbstractArray.ts:95

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

Returns: AnyJson


# toRawType

toRawType(): string

Implementation of Codec

Overrides AbstractArray.toRawType

Defined in packages/types/src/codec/VecAny.ts:20

description Returns the base runtime type name for this instance

Returns: string


# toString

toString(): string

Implementation of Codec

Inherited from AbstractArray.toString

Overrides void

Defined in packages/types/src/codec/AbstractArray.ts:109

description Returns the string representation of the value

Returns: string


# toU8a

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

Inherited from AbstractArray.toU8a

Defined in packages/types/src/codec/AbstractArray.ts:122

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