import { DynamicWagmiConnector } from "@dynamic-labs/wagmi-connector";
import { DynamicContextProvider } from "@dynamic-labs/sdk-react-core";
function App() {
return (
<DynamicContextProvider settings={{ environmentId: "your_env_id" }}>
<DynamicWagmiConnector>
<YourRoutes />
</DynamicWagmiConnector>
</DynamicContextProvider>
);
}
const evmNetworks: EvmNetwork[] = [
{
blockExplorerUrls: ["https://etherscan.io/"],
chainId: 1,
chainName: "Ethereum Mainnet",
iconUrls: ["https://app.dynamic.xyz/assets/networks/eth.svg"],
nativeCurrency: { decimals: 18, name: "Ether", symbol: "ETH" },
networkId: 1,
privateCustomerRpcUrls: ["https://mainnet.infura.io/v3/your-api-key"],
rpcUrls: ["https://cloudflare-eth.com"],
vanityName: "Ethereum",
},
];
For webSocket support with Wagmi, you can pass an object as the privateCustomerRpcUrls with your webSocket url configuration
const evmNetworks: EvmNetwork[] = [
{
...
privateCustomerRpcUrls: [
{
url: "https://mainnet.infura.io/v3/your-api-key",
webSocket: "wss://mainnet.infura.io/v3/your-api-key"
}
],
...
},
];