Constructor
new Network(name, identifier, addressHasher, createAddress)
Creates a new network with the specified name and identifier byte.
Parameters:
Name | Type | Description |
---|---|---|
name |
string | Network name. |
identifier |
number | Network identifier byte. |
addressHasher |
function | Gets the primary hasher to use in the public key to address conversion. |
createAddress |
function | Creates an encoded address from an address without checksum and checksum bytes. |
- Source:
Methods
isValidAddress(address) → {boolean}
Checks if an address is valid and belongs to this network.
Parameters:
Name | Type | Description |
---|---|---|
address |
Address | Address to check |
- Source:
Returns:
True if address is valid and belongs to this network.
- Type
- boolean
publicKeyToAddress(publicKey) → {Address}
Converts a public key to an address.
Parameters:
Name | Type | Description |
---|---|---|
publicKey |
PublicKey | Public key to convert. |
- Source:
Returns:
Address corresponding to the public key input.
- Type
- Address
toString() → {string}
Returns string representation of this object.
- Source:
Returns:
String representation of this object
- Type
- string