Class: SolNetwork
moralis-monorepo / @moralisweb3/common-sol-utils / SolNetwork
Class: SolNetwork
@moralisweb3/common-sol-utils.SolNetwork
A representation of a Solana network.
Implements
MoralisData
Table of contents
Accessors
Methods
Properties
Accessors
DEVNET
• Static
get
DEVNET(): SolNetwork
Returns DEVNET network
Example
SolNetwork.MAINNET
Returns
MAINNET
• Static
get
MAINNET(): SolNetwork
Returns MAINNET network
Example
SolNetwork.MAINNET
Returns
Methods
create
▸ Static
create(network
): SolNetwork
Create a new instance of SolNetwork from any valid network input.
Example
const network = SolNetwork.create("mainnet")
Throws
an error when a passed network is invalid.
Parameters
Name | Type |
---|---|
network | SolNetworkish |
Returns
equals
▸ equals(network
): boolean
Checks the equality of the current network with another Solana network.
Example
network.equals("mainnet")
Example
network.equals(SolNetwork.create("mainnet"))
Parameters
Name | Type |
---|---|
network | SolNetworkish |
Returns
boolean
Implementation of
MoralisData.equals
format
▸ format(): MoralisDataFormatted
Formats the network to a specific format. Currently returns a string representing the network.
Example
network.format(); // "mainnet"
Returns
MoralisDataFormatted
Implementation of
MoralisData.format
toJSON
▸ toJSON(): string
Example
network.toJSON(); // "mainnet"
Returns
string
a string representing the network.
toString
▸ toString(): string
Example
network.toString(); // "mainnet"
Returns
string
a string representing the network.
Properties
network
• Readonly
network: "mainnet"
| "devnet"