Skip to main content

@zerodevapp/wagmi

AutoConnect

Activating the autoConnect option for Wagmi requires activating the shimDisconnect option on the connector:

const connector = new GoogleSocialWalletConnector({options: {
projectId: defaultProjectId,
shimDisconnect: true
}})

Chain Switching

Using ZeroDev with multiple chains requires providing multiple projectIds via the projectIds option. Additionally, supplying the chains within the connector is required for chain switching.

import { polygonMumbai, goerli } from 'wagmi/chains'

const { chains, provider, webSocketProvider } = configureChains(
[polygonMumbai, goerli],
[publicProvider()],
)

const socialConnector = new GoogleWalletConnector({
+ chains,
options: {
- projectId: '<project-id>',
+ projectIds: ['<project-id-1>', '<project-id-2>'],
}
})
Full Code (Editable)
Result
Loading...