Polkadot JS APIGlobals"generic/Address"Address

# Class: Address

name Address

description A wrapper around an AccountId and/or AccountIndex that is encoded with a prefix. Since we are dealing with underlying publicKeys (or shorter encoded addresses), we extend from Base with an AccountId/AccountIndex wrapper. Basically the Address is encoded as [ <prefix-byte>, ...publicKey/...bytes ] as per spec

# Hierarchy

# Implements

# Index

# Constructors

# Properties

# Accessors

# Methods

# Constructors

# constructor

+ new Address(registry: Registry, value: AnyAddress): Address

Overrides void

Defined in packages/types/src/generic/Address.ts:51

Parameters:

Name Type Default
registry Registry -
value AnyAddress new Uint8Array()

Returns: Address

# Properties

# Readonly registry

registry: Registry

Implementation of Codec.registry

Inherited from Base.registry

Defined in packages/types/src/codec/Base.ts:17

# Accessors

# encodedLength

get encodedLength(): number

Overrides Base.encodedLength

Defined in packages/types/src/generic/Address.ts:74

description The length of the value when encoded as a Uint8Array

Returns: number


# hash

get hash(): H256

Inherited from Base.hash

Defined in packages/types/src/codec/Base.ts:36

description returns a hash of the contents

Returns: H256


# isEmpty

get isEmpty(): boolean

Inherited from Base.isEmpty

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

description Checks if the value is an empty value

Returns: boolean

# Methods

# eq

eq(other?: unknown): boolean

Implementation of Codec

Inherited from Base.eq

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

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

Parameters:

Name Type
other? unknown

Returns: boolean


# toHex

toHex(): string

Overrides Base.toHex

Defined in packages/types/src/generic/Address.ts:97

description Returns a hex string representation of the value

Returns: string


# toHuman

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

Implementation of Codec

Inherited from Base.toHuman

Defined in packages/types/src/codec/Base.ts:64

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 Base.toJSON

Defined in packages/types/src/codec/Base.ts:71

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

Returns: AnyJson


# toRawType

toRawType(): string

Implementation of Codec

Overrides Base.toRawType

Defined in packages/types/src/generic/Address.ts:104

description Returns the base runtime type name for this instance

Returns: string


# toString

toString(): string

Implementation of Codec

Inherited from Base.toString

Defined in packages/types/src/codec/Base.ts:78

description Returns the string representation of the value

Returns: string


# toU8a

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

Overrides Base.toU8a

Defined in packages/types/src/generic/Address.ts:112

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