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

@nimiq/core/types/wasm/web.d.ts:597

Methods

__getClassname()

__getClassname(): string

Returns

string

Defined in

@nimiq/core/types/wasm/web.d.ts:593


free()

free(): void

Returns

void

Defined in

@nimiq/core/types/wasm/web.d.ts:589


serialize()

serialize(): Uint8Array

Returns

Uint8Array

Defined in

@nimiq/core/types/wasm/web.d.ts:640


toHex()

toHex(): string

Formats the address into hex format.

Returns

string

Defined in

@nimiq/core/types/wasm/web.d.ts:636


toPlain()

toPlain(): string

Formats the address into a plain string format.

Returns

string

Defined in

@nimiq/core/types/wasm/web.d.ts:626


toUserFriendlyAddress()

toUserFriendlyAddress(): string

Formats the address into user-friendly IBAN format.

Returns

string

Defined in

@nimiq/core/types/wasm/web.d.ts:631


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

@nimiq/core/types/wasm/web.d.ts:605


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

@nimiq/core/types/wasm/web.d.ts:613


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

@nimiq/core/types/wasm/web.d.ts:621