Migration Guide
If you're currently integrated with the Lens Protocol, this guide will walk you through the necessary steps to upgrade to the latest versions of the API and SDKs.
@lens-protocol/wagmi
v4.0.0-alpha.0
This version supports Wagmi v2.
Update Packages
Peer dependency wagmi updated to 2.x.
Peer dependency viem updated to 2.x.
Install the new peer dependency @tanstack/react-query at a minimum version of ^5.
Update Files
Read the wagmi migration guide for migrating from v1 to v2 to make sure your application is compatible.
Pass the Wagmi configuration object into the bindings function.
import { createConfig, http } from 'wagmi';import { polygon } from 'wagmi/chains';
import { LensConfig, LensProvider, production } from "@lens-protocol/react-web";import { bindings } from '@lens-protocol/wagmi';
export const wagmiConfig = createConfig({ chains: [polygon], transports: { [polygon.id]: http(), },});
export const lensConfig: LensConfig = { environment: production,- bindings: bindings(),+ bindings: bindings(wagmiConfig),};