Skip to content

Network⚓︎

Network
Represents a NEM network.

Extends⚓︎

Constructors⚓︎

new Network()⚓︎

new Network(
   name, 
   identifier, 
   epochTime): Network

Creates a new network with the specified name, identifier byte and generation hash seed.

Parameters⚓︎

Parameter Type Description
name string Network name.
identifier number Network identifier byte.
epochTime Date Network epoch time.

Returns⚓︎

Network

Overrides⚓︎

Network.constructor

Properties⚓︎

Property Modifier Type Description Inherited from
datetimeConverter public NetworkTimestampDatetimeConverter Network timestamp datetime converter associated with this network. Network.datetimeConverter
identifier public number Network identifier byte. Network.identifier
name public string Network name. Network.name
MAINNET static Network NEM main network. -
NETWORKS static Network[] NEM well known networks. -
TESTNET static Network NEM test network. -

Methods⚓︎

fromDatetime()⚓︎

fromDatetime(referenceDatetime): any
Network.fromDatetime
Converts a datetime to a network timestamp.

Parameters⚓︎

Parameter Type Description
referenceDatetime Date Reference datetime to convert.

Returns⚓︎

any

Network timestamp representation of the reference datetime.

Inherited from⚓︎

Network.fromDatetime


isValidAddress()⚓︎

isValidAddress(address): boolean
Network.isValidAddress
Checks if an address is valid and belongs to this network.

Parameters⚓︎

Parameter Type Description
address any Address to check.

Returns⚓︎

boolean

true if address is valid and belongs to this network.

Inherited from⚓︎

Network.isValidAddress


isValidAddressString()⚓︎

isValidAddressString(addressString): boolean
Network.isValidAddressString
Checks if an address string is valid and belongs to this network.

Parameters⚓︎

Parameter Type Description
addressString string Address to check.

Returns⚓︎

boolean

true if address is valid and belongs to this network.

Inherited from⚓︎

Network.isValidAddressString


publicKeyToAddress()⚓︎

publicKeyToAddress(publicKey): any
Network.publicKeyToAddress
Converts a public key to an address.

Parameters⚓︎

Parameter Type Description
publicKey PublicKey Public key to convert.

Returns⚓︎

any

Address corresponding to the public key input.

Inherited from⚓︎

Network.publicKeyToAddress


toDatetime()⚓︎

toDatetime(referenceNetworkTimestamp): Date
Network.toDatetime
Converts a network timestamp to a datetime.

Parameters⚓︎

Parameter Type Description
referenceNetworkTimestamp any Reference network timestamp to convert.

Returns⚓︎

Date

Datetime representation of the reference network timestamp.

Inherited from⚓︎

Network.toDatetime


toString()⚓︎

toString(): string
Network.toString
Returns string representation of this object.

Returns⚓︎

string

String representation of this object

Inherited from⚓︎

Network.toString