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

Base<AccountId | AccountIndex>

↳ Address

Implements

Constructors

constructor

⊕ new Address(value?: AnyAddress): Address

Overrides Base.constructor

Defined in type/Address.ts:26

Parameters:

Name Type Default value
Default value value AnyAddress new Uint8Array()

Returns: Address


Accessors

encodedLength

get encodedLength(): number

Defined in type/Address.ts:68

description: The length of the value when encoded as a Uint8Array

Returns: number


isEmpty

get isEmpty(): boolean

Defined in type/Address.ts:82

description: Checks if the value is an empty value

Returns: boolean


rawLength

get rawLength(): number

Defined in type/Address.ts:89

description: The length of the raw value, either AccountIndex or AccountId

Returns: number


Methods

eq

▸ eq(other?: any): boolean

Implementation of Codec.eq

Defined in type/Address.ts:98

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

Parameters:

Name Type
Optional other any

Returns: boolean


toHex

▸ toHex(): string

Implementation of Codec.toHex

Defined in type/Address.ts:105

description: Returns a hex string representation of the value

Returns: string


toJSON

▸ toJSON(): any

Implementation of Codec.toJSON

Defined in type/Address.ts:112

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

Returns: any


toString

▸ toString(): string

Implementation of Codec.toString

Defined in type/Address.ts:119

description: Returns the string representation of the value

Returns: string


toU8a

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

Implementation of Codec.toU8a

Defined in type/Address.ts:127

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> decodeAddress

▸ decodeAddress(value: AnyAddress): AccountId | AccountIndex

Defined in type/Address.ts:33

Parameters:

Name Type
value AnyAddress

Returns: AccountId | AccountIndex


Last Updated: 2/25/2019, 4:39:16 PM