Polkadot JS APIGlobals"codec/Tuple"Tuple

# Class: Tuple

name Tuple

description A Tuple defines an anonymous fixed-length array, where each element has its own type. It extends the base JS Array object.

# Hierarchy

AbstractArrayCodec

Tuple

MortalEra

EventData

LinkageResult

# Implements

# Indexable

name Tuple

description A Tuple defines an anonymous fixed-length array, where each element has its own type. It extends the base JS Array object.

# Index

# Constructors

# Properties

# Accessors

# Methods

# Constructors

# constructor

+ new Tuple(registry: Registry, Types: TupleTypes, value?: AnyTuple): Tuple

Overrides void

Defined in packages/types/src/codec/Tuple.ts:56

Parameters:

Name Type
registry Registry
Types TupleTypes
value? AnyTuple

Returns: Tuple

# Properties

# Readonly registry

registry: Registry

Implementation of Codec.registry

Inherited from AbstractArray.registry

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

# Accessors

# Types

get Types(): string[]

Defined in packages/types/src/codec/Tuple.ts:90

description The types definition of the tuple

Returns: string[]


# encodedLength

get encodedLength(): number

Overrides AbstractArray.encodedLength

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

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): Codec[]

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: Codec, index: number, array: Codec[]): boolean

Parameters:

Name Type
value Codec
index number
array Codec[]

Optional thisArg: unknown

The this object to apply the result to

Returns: Codec[]


# 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: Codec, index: number, array: Codec[]): U

Parameters:

Name Type
value Codec
index number
array Codec[]

Optional thisArg: unknown

The this onject to apply the result to

Returns: U[]


# toArray

toArray(): Codec[]

Inherited from AbstractArray.toArray

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

description Converts the Object to an standard JavaScript Array

Returns: Codec[]


# 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/Tuple.ts:99

description Returns the base runtime type name for this instance

Returns: string


# toString

toString(): string

Implementation of Codec

Overrides AbstractArray.toString

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

description Returns the string representation of the value

Returns: string


# toU8a

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

Overrides AbstractArray.toU8a

Defined in packages/types/src/codec/Tuple.ts:121

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 with

with(Types: TupleTypes): ConstructorTuple

Defined in packages/types/src/codec/Tuple.ts:68

Parameters:

Name Type
Types TupleTypes

Returns: ConstructorTuple