Networksnamespace provides constants and functions for working with blockchain networks supported by the SDK.
Networkclass defined in
Networksis primarily used as a "data wrapper", in that each instance of a
Networkis useful for retrieving information about the defined network, such as its name, nativee currency symbol, and Chain ID.
string) - The primary or official name of the network, for example "Binance Smart Chain"
string) - The native currency symbol for this network. Examples: "BNB" on Binance Smart Chain, "AVAX" on Avalanche.
string) - An array of strings containing the actual, on-chain address of all entries in
Networkclass also provides the following functions:
Tokenpassed to it is supported by the Synapse Protocol on the given network.
tokenis supported for use on the network by the Synapse Protocol,
trueif the Synapse Bridge Zap contract for this network is a
L2BridgeZap, rather than a
L1BridgeZap. Currently, Bridge Zaps for all networks except the Ethereum mainnet are
Networkinstance based on the passed Chain ID, if it corresponds to a network which is known and supported by the Synapse Protocol.
Networkinstance if it corresponds to a supported network, or null.
Tokens which are supported by the Synapse Protocol on a given network, based on the passed Chain ID.
chainIdcorresponds to a supported network), or null.
network: Network | BigNumberish- This param can be either a Network instance, or the Chain ID of a Synapse Protocol-supported network.
tokenis supported by the Synapse Protocol on
Networkinstances corresponding to all networks supported by the Synapse Protocol.