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:601

Methods

__getClassname()

__getClassname(): string

Returns

string

Defined in

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


free()

free(): void

Returns

void

Defined in

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


serialize()

serialize(): Uint8Array

Returns

Uint8Array

Defined in

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


toHex()

toHex(): string

Formats the address into hex format.

Returns

string

Defined in

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


toPlain()

toPlain(): string

Formats the address into a plain string format.

Returns

string

Defined in

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


toUserFriendlyAddress()

toUserFriendlyAddress(): string

Formats the address into user-friendly IBAN format.

Returns

string

Defined in

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


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:609


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:617


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:625