Class: Address
An object representing a Nimiq address. Offers methods to parse and format addresses from and to strings.
Table of contents
Constructors
Methods
- __getClassname
- free
- serialize
- toHex
- toPlain
- toUserFriendlyAddress
- fromAny
- fromString
- fromUserFriendlyAddress
Constructors
constructor
• new Address(bytes
): Address
Parameters
Name | Type |
---|---|
bytes | Uint8Array |
Returns
Defined in
web.d.ts:579
Methods
__getClassname
▸ __getClassname(): string
Returns
string
Defined in
web.d.ts:575
free
▸ free(): void
Returns
void
Defined in
web.d.ts:571
serialize
▸ serialize(): Uint8Array
Returns
Uint8Array
Defined in
web.d.ts:622
toHex
▸ toHex(): string
Formats the address into hex format.
Returns
string
Defined in
web.d.ts:618
toPlain
▸ toPlain(): string
Formats the address into a plain string format.
Returns
string
Defined in
web.d.ts:608
toUserFriendlyAddress
▸ toUserFriendlyAddress(): string
Formats the address into user-friendly IBAN format.
Returns
string
Defined in
web.d.ts:613
fromAny
▸ fromAny(addr
): Address
Parses an address from an Address instance or a string representation.
Throws when an address cannot be parsed from the argument.
Parameters
Name | Type |
---|---|
addr | string | Address |
Returns
Defined in
web.d.ts:587
fromString
▸ 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
Name | Type |
---|---|
str | string |
Returns
Defined in
web.d.ts:595
fromUserFriendlyAddress
▸ fromUserFriendlyAddress(str
): Address
Parses an address from its user-friendly string representation.
Throws when an address cannot be parsed from the string.
Parameters
Name | Type |
---|---|
str | string |
Returns
Defined in
web.d.ts:603