Connect with WalletConnect

WalletConnect is an open-source, chain-agnostic protocol that securely links wallets and Web3 applications. It uses a bridge server to relay encrypted messages, allowing users to connect by scanning a QR code or via deep-linking, without exposing private keys.

Integration Steps for WalletConnect

Prerequisites

Register at WalletConnect Cloud and obtain the project ID.


Install Dependency

npm install ethers wagmi viem @walletconnect/ethereum-provider

Set up Injective EVM network configuration

// lib/injectiveChain.ts
import { defineChain } from 'viem'

export const injectiveEvm = defineChain({
  id: 1439,
  name: 'Injective EVM',
  nativeCurrency: {
    name: 'INJ',
    symbol: 'INJ',
    decimals: 18,
  },
  rpcUrls: {
    default: { http: ['https://k8s.testnet.json-rpc.injective.network'] },
  },
  blockExplorers: {
    default: { name: 'InjectiveScan', url: 'https://testnet.blockscout.injective.network/blocks' },
  },
})

Set up Wagmi + WalletConnect

Integrate into your project


More Info

Last updated