Classes

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](Address)
ParameterType
FirstUint8Array
Returns
Address

Methods

__getClassname()

\_\_getClassname(): `string`

compare()

compare(`other`): `number`

Compares this address to the other address.

Returns -1 if this address is smaller than the other address, 0 if they are equal, and 1 if this address is larger than the other address.

ParameterType
FirstAddress

equals()

equals(`other`): `boolean`

Returns if this address is equal to the other address.

ParameterType
FirstAddress

free()

free(): `void`

serialize()

serialize(): `Uint8Array`

Returns the byte representation of the address.


toHex()

toHex(): `string`

Formats the address into hex format.


toPlain()

toPlain(): `string`

Formats the address into a plain string format.


toUserFriendlyAddress()

toUserFriendlyAddress(): `string`

Formats the address into user-friendly IBAN format.


deserialize()

`static` deserialize(`bytes`): [Address](Address)

Deserializes an address from a byte array.

ParameterType
FirstUint8Array
Returns
Address

fromAny()

`static` fromAny(`addr`): [Address](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.

ParameterType
Firststring | Address | Uint8Array
Returns
Address

fromString()

`static` fromString(`str`): [Address](Address)

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

Throws when an address cannot be parsed from the string.

ParameterType
Firststring
Returns
Address

fromUserFriendlyAddress()

`static` fromUserFriendlyAddress(`str`): [Address](Address)

Parses an address from its user-friendly string representation.

Throws when an address cannot be parsed from the string.

ParameterType
Firststring
Returns
Address

On this page