Skip to content

Class: Address

An object representing a Nimiq address. Offers methods to parse and format addresses from and to strings.

Constructors

new Address()

new Address(bytes): Address

Parameters

bytes: Uint8Array

Returns

Address

Defined in

web.d.ts:599

Methods

__getClassname()

__getClassname(): string

Returns

string

Defined in

web.d.ts:595


free()

free(): void

Returns

void

Defined in

web.d.ts:591


serialize()

serialize(): Uint8Array

Returns

Uint8Array

Defined in

web.d.ts:642


toHex()

toHex(): string

Formats the address into hex format.

Returns

string

Defined in

web.d.ts:638


toPlain()

toPlain(): string

Formats the address into a plain string format.

Returns

string

Defined in

web.d.ts:628


toUserFriendlyAddress()

toUserFriendlyAddress(): string

Formats the address into user-friendly IBAN format.

Returns

string

Defined in

web.d.ts:633


fromAny()

static fromAny(addr): Address

Parses an address from an Address instance, a hex string representation, or a byte array.

Throws when an address cannot be parsed from the argument.

Parameters

addr: string | Uint8Array | Address

Returns

Address

Defined in

web.d.ts:607


fromString()

static fromString(str): Address

Parses an address from a string representation, either user-friendly or hex format.

Throws when an address cannot be parsed from the string.

Parameters

str: string

Returns

Address

Defined in

web.d.ts:615


fromUserFriendlyAddress()

static fromUserFriendlyAddress(str): Address

Parses an address from its user-friendly string representation.

Throws when an address cannot be parsed from the string.

Parameters

str: string

Returns

Address

Defined in

web.d.ts:623