For new React apps, we recommend the JavaScript SDK with React Hooks (@dynamic-labs-sdk/react-hooks) instead of the legacy React SDK documented here. The JS SDK comes with many benefits such as a much smaller bundle size and other optimizations. Use the React quickstart (JavaScript SDK) to get started.
You can enable any EVM network that we do not currently support out of the box by passing an array of EvmNetwork
to the DynamicContextProvider’s overrides.evmNetworks settings.This can be done in two different ways:
By passing an array of EvmNetwork, it completely overrides whatever networks were received from your dashboard configurations and uses that array instead.
By passing a method with signature (dashboardNetworks: EvmNetwork[]) => EvmNetwork[], 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:
The following example sets the Ethereum mainnet and Polygon as supported networks for the application.
A comprehensive list of networks can be found at chainlist.org
The transaction confirmation UI renders a network’s native token amount using nativeCurrency.decimals. Custom or emerging EVM chains must set decimals to the chain’s correct value (18 for most EVM chains) or the confirm popup will display the wrong amount.
To adjust decimals, rpcUrls, or other fields on dashboard-provided networks without replacing them, use the callback form of overrides.evmNetworks — (dashboardNetworks: EvmNetwork[]) => EvmNetwork[] — as shown above.
You can enable any Solana network that is not enabled through the developer console 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:
You can enable any Cosmos network that we do not currently support in our dashboard by passing an array of GenericNetwork
to the DynamicContextProvider’s overrides.cosmosNetworks 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:
The following example sets Sei for the application. Remember to enable the cosmos blockchain in the developer console
// we are setting the chainId and networkID to a random ID that will not conflict with other active chains in Dynamic.const cosmosNetworks= [{ blockExplorerUrls: ["https://www.seiscan.app/pacific-1"], chain: 'Sei', chainId: '404', iconUrls: ['https://app.dynamic.xyz/assets/networks/sei.svg'], lcdUrl: 'https://rest.wallet.pacific-1.sei.io', name: 'pacific-1', nativeCurrency: { decimals: 18, denom: 'usei', name: 'Sei', symbol: 'Sei', }, networkId: '404', rpcUrls: ['https://rpc.wallet.pacific-1.sei.io'], shortName: 'Sei', vanityName: 'Sei', }];const App = () => (<DynamicContextProvider settings={{ environmentId: 'REPLACE_WITH_YOUR_ENV_ID', overrides: { cosmosNetworks }, }}> <Home /></DynamicContextProvider>);export default App;