Network<TAddress, TNetworkTimestamp>⚓︎
- Network<TAddress, TNetworkTimestamp>
- Represents a network.
Extended by⚓︎
Type Parameters⚓︎
| Type Parameter | Description |
|---|---|
TAddress extends object |
|
TNetworkTimestamp extends NetworkTimestamp |
Constructors⚓︎
new Network()⚓︎
new Network<TAddress, TNetworkTimestamp>(
name,
identifier,
datetimeConverter,
addressHasher,
createAddress,
AddressClass,
NetworkTimestampClass): Network<TAddress, TNetworkTimestamp>
Creates a new network with the specified name and identifier byte.
Parameters⚓︎
| Parameter | Type | Description |
|---|---|---|
name |
string |
Network name. |
identifier |
number |
Network identifier byte. |
datetimeConverter |
NetworkTimestampDatetimeConverter |
Network timestamp datetime converter associated with this network. |
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. |
AddressClass |
AddressConstructable |
Address class associated with this network. |
NetworkTimestampClass |
Constructable |
Network timestamp class associated with this network. |
Returns⚓︎
Network<TAddress, TNetworkTimestamp>
Properties⚓︎
| Property | Type | Description |
|---|---|---|
datetimeConverter |
NetworkTimestampDatetimeConverter |
Network timestamp datetime converter associated with this network. |
identifier |
number |
Network identifier byte. |
name |
string |
Network name. |
Methods⚓︎
fromDatetime()⚓︎
- Network<TAddress, TNetworkTimestamp>.fromDatetime
- Converts a datetime to a network timestamp.
Parameters⚓︎
| Parameter | Type | Description |
|---|---|---|
referenceDatetime |
Date |
Reference datetime to convert. |
Returns⚓︎
TNetworkTimestamp
Network timestamp representation of the reference datetime.
isValidAddress()⚓︎
- Network<TAddress, TNetworkTimestamp>.isValidAddress
- Checks if an address is valid and belongs to this network.
Parameters⚓︎
| Parameter | Type | Description |
|---|---|---|
address |
TAddress |
Address to check. |
Returns⚓︎
boolean
\c true if address is valid and belongs to this network.
isValidAddressString()⚓︎
- Network<TAddress, TNetworkTimestamp>.isValidAddressString
- Checks if an address string is valid and belongs to this network.
Parameters⚓︎
| Parameter | Type | Description |
|---|---|---|
addressString |
string |
Address to check. |
Returns⚓︎
boolean
\c true if address is valid and belongs to this network.
publicKeyToAddress()⚓︎
- Network<TAddress, TNetworkTimestamp>.publicKeyToAddress
- Converts a public key to an address.
Parameters⚓︎
| Parameter | Type | Description |
|---|---|---|
publicKey |
PublicKey |
Public key to convert. |
Returns⚓︎
TAddress
Address corresponding to the public key input.
toDatetime()⚓︎
- Network<TAddress, TNetworkTimestamp>.toDatetime
- Converts a network timestamp to a datetime.
Parameters⚓︎
| Parameter | Type | Description |
|---|---|---|
referenceNetworkTimestamp |
TNetworkTimestamp |
Reference network timestamp to convert. |
Returns⚓︎
Date
Datetime representation of the reference network timestamp.
toString()⚓︎
- Network<TAddress, TNetworkTimestamp>.toString
- Returns string representation of this object.
Returns⚓︎
string
String representation of this object