This small package allows you to add a dedicated, functional, connector to integrate Phantom into your wagmi ^v1 project
to install
yarn add phantom-wagmi-connector
# or
npm install phantom-wagmi-connector
# or
pnpm add phantom-wagmi-connector
import { PhantomConnector } from 'phantom-wagmi-connector'
import { PhantomConnector } from 'phantom-wagmi-connector'
const connector = new PhantomConnector()
import { mainnet, polygon } from 'wagmi/chains'
import { PhantomConnector } from 'phantom-wagmi-connector'
const connector = new PhantomConnector({
chains: [mainnet, polygon],
})
Options for configuring the connector.
import { PhantomConnector } from 'phantom-wagmi-connector'
const connector = new PhantomConnector({
options: {
shimDisconnect: true,
},
})
Phantom does not support programmatic disconnect on EVM chains. This flag simulates the disconnect behavior by keeping track of connection status in storage. Defaults to true.
import { PhantomConnector } from 'phantom-wagmi-connector'
const connector = new PhantomConnector({
options: {
shimDisconnect: false,
},
})