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
Defined in
@nimiq/core/types/wasm/web.d.ts:612
Methods
__getClassname()
__getClassname():
string
Returns
string
Defined in
@nimiq/core/types/wasm/web.d.ts:608
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.
Parameters
other
Returns
number
Defined in
@nimiq/core/types/wasm/web.d.ts:677
equals()
equals(
other
):boolean
Returns if this address is equal to the other address.
Parameters
other
Returns
boolean
Defined in
@nimiq/core/types/wasm/web.d.ts:668
free()
free():
void
Returns
void
Defined in
@nimiq/core/types/wasm/web.d.ts:604
serialize()
serialize():
Uint8Array
Returns the byte representation of the address.
Returns
Uint8Array
Defined in
@nimiq/core/types/wasm/web.d.ts:662
toHex()
toHex():
string
Formats the address into hex format.
Returns
string
Defined in
@nimiq/core/types/wasm/web.d.ts:657
toPlain()
toPlain():
string
Formats the address into a plain string format.
Returns
string
Defined in
@nimiq/core/types/wasm/web.d.ts:647
toUserFriendlyAddress()
toUserFriendlyAddress():
string
Formats the address into user-friendly IBAN format.
Returns
string
Defined in
@nimiq/core/types/wasm/web.d.ts:652
deserialize()
static
deserialize(bytes
):Address
Deserializes an address from a byte array.
Parameters
bytes
Uint8Array
Returns
Defined in
@nimiq/core/types/wasm/web.d.ts:618
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
Defined in
@nimiq/core/types/wasm/web.d.ts:626
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
Defined in
@nimiq/core/types/wasm/web.d.ts:634
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
Defined in
@nimiq/core/types/wasm/web.d.ts:642