Custom connectors
Add custom connectors for Ethers or Wagmi
- Wagmi
- Ethers
- Solana
If you already have Wagmi integrated into your application or would like more control over Wagmi's configuration, you can integrate AppKit on top of it.
import { createConfig, cookieStorage, createStorage, http } from 'wagmi'
import { sepolia } from 'wagmi/chains'
import { walletConnect } from 'wagmi/connectors'
export const projectId = process.env.NEXT_PUBLIC_PROJECT_ID
const metadata = {
//...
}
// Create wagmiConfig
export const config = createConfig({
chains: [sepolia],
transports: {
[sepolia.id]: http()
},
connectors: [
walletConnect({ projectId, metadata, showQrModal: false }), // showQrModal must be false.
// Other connectors...
],
ssr: true,
storage: createStorage({
storage: cookieStorage
})
})
Coming soon...
Add custom wallet adapters for Solana wallets by first installing the wallet adapter package and then including the adapters in the wallets array. You can find a more Solana wallet adapters here.
- npm
- Yarn
- Bun
- pnpm
npm install @solana/wallet-adapter-solflare
yarn add @solana/wallet-adapter-solflare
bun add @solana/wallet-adapter-solflare
pnpm add @solana/wallet-adapter-solflare
import { createWeb3Modal, defaultSolanaConfig } from '@web3modal/solana/react'
import { solana, solanaTestnet, solanaDevnet } from '@web3modal/solana/chains'
import { SolflareWalletAdapter } from '@solana/wallet-adapter-solflare'
// 0. Setup chains
const chains = [solana, solanaTestnet, solanaDevnet]
// 1. Get projectId from https://cloud.walletconnect.com
const projectId = 'YOUR_PROJECT_ID'
// 2. Create solanaConfig
const metadata = {
//...
}
const solanaConfig = defaultSolanaConfig({
chains,
projectId,
metadata
})
// 3. Create modal
const modal = createWeb3Modal({
solanaConfig,
projectId: projectId,
metadata: metadata,
chains,
enableAnalytics: true,
termsConditionsUrl: 'https://walletconnect.com/terms',
privacyPolicyUrl: 'https://walletconnect.com/privacy',
wallets: [
new SolflareWalletAdapter(),
]
})