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

  1. Peer dependency wagmi updated to 2.x.

  2. Peer dependency viem updated to 2.x.

  3. Install the new peer dependency @tanstack/react-query at a minimum version of ^5.

npm install wagmi@2.x viem@2.x @tanstack/react-query@^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),};