Class: Network

Network(name, identifier, addressHasher, createAddress)

Represents a network.

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

Network(name, identifier)

Represents a NEM network.

Constructor

new Network(name, identifier)

Creates a new network with the specified name, identifier byte and generation hash seed.
Parameters:
Name Type Description
name string Network name.
identifier number Network identifier byte.
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

Network(name, identifier, generationHashSeed)

Represents a Symbol network.

Constructor

new Network(name, identifier, generationHashSeed)

Creates a new network with the specified name, identifier byte and generation hash seed.
Parameters:
Name Type Description
name string Network name.
identifier number Network identifier byte.
generationHashSeed Hash256 Network generation hash seed.
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