Scaffold
Environment Setup
Get your environment ID from app.dynamic.xyz and add it tofrontend/.env.local:
Provider Setup
Dynamic usesDynamicContextProvider for wallet orchestration and DynamicWagmiConnector to bridge wallet state into wagmi. You also need to manually configure the EVM network details.
Providers.tsx
ThemeProvider → DynamicContextProvider → WagmiProvider → QueryClientProvider → DynamicWagmiConnector
Key details:
EthereumWalletConnectorsenables Ethereum-compatible wallets in Dynamic’s modal.evmNetworksconfigures Base Sepolia as the target network with its chain ID, RPC, and block explorer.DynamicWagmiConnectorbridges Dynamic’s wallet state into wagmi hooks.multiInjectedProviderDiscovery: falseprevents conflicts between Dynamic and wagmi’s wallet detection.
Inco SDK Integration
The Inco SDK works with thewalletClient provided by wagmi (which Dynamic bridges through DynamicWagmiConnector). Here’s the core pattern:
useConfLottery.ts
useWalletClient() provides the signer that Inco’s attestedDecrypt uses for signing attestation requests.
Dependencies
| Package | Purpose |
|---|---|
@dynamic-labs/sdk-react-core | Dynamic wallet orchestration |
@dynamic-labs/ethereum | Ethereum wallet connectors |
@dynamic-labs/wagmi-connector | Dynamic-wagmi bridge |
@inco/js | Inco encryption/decryption |
wagmi | EVM wallet hooks |
viem | Ethereum utilities |