import { DynamicContextProvider } from "@dynamic-labs/sdk-react-core";import { AbstractEvmWalletConnectors } from "@dynamic-labs-connectors/abstract-global-wallet-evm";import { Chain } from "viem";import { abstractTestnet, abstract } from "viem/chains"; // Use abstract for mainnetexport default function AbstractWalletWrapper({ children,}: { children: React.ReactNode;}) { return ( <DynamicContextProvider theme="auto" settings={{ overrides: { evmNetworks: [ toDynamicChain( abstractTestnet, "https://abstract-assets.abs.xyz/icons/light.png" ), ], }, environmentId: "your-dynamic-environment-id", walletConnectors: [AbstractEvmWalletConnectors], }} > {children} </DynamicContextProvider> );}
Next.js App Router: If you are using Next.js App
Router, create a new component and add the use client directive at the top of your file (see
example)
and wrap your application in this component.