Custom SVM networks
You can enable any Solana network that is not enabled through the dashboard by passing an array of GenericNetwork
to the DynamicContextProvider
’s overrides.solNetworks
settings.
This can be done in two different ways:
-
By passing an array of
GenericNetwork
, it completely overrides whatever networks were received from your dashboard configurations and uses that array instead. -
By passing a method with signature
(dashboardNetworks: GenericNetwork[]) => GenericNetwork[]
, you can use this callback to first receive the array of networks that was sent from your dashboard configurations, and then return the array of networks you want the app to use.
The second approach is best for making adjustments to the networks you get from our dashboard (like changing rpc urls), as well as when you want to hide some specific networks.
If you’re just trying to merge new networks with the ones from dashboard, we have a helper function that will make that easier:
Note that the order of the params for
mergeNetworks
matters: the first param takes precedence in case of a conflict.
Example
The following example sets up Solana mainnet and devnet as supported networks for the application.
Type Reference
Definition
Attribute | Value | Required/Optional |
---|---|---|
blockExplorerUrls | string[] | Required |
chainId | string | Required |
cluster | string | Required |
genesisHash | string | Required |
name | string | Required |
iconUrls | string[] | Required |
nativeCurrency | NativeCurrency | Required |
networkId | string | Required |
rpcUrls | string[] | Required |
vanityName | string | Optional |
NativeCurrency
Attribute | Value | Required/Optional |
---|---|---|
decimals | number | Required |
iconUrl | string | Optional |
name | string | Required |
symbol | string | Required |
Was this page helpful?