Installation
The Mento SDK v3 requires Node.js 18+ and viem as a peer dependency (ethers.js is no longer used). The package is published in dual CJS/ESM format with an exports map for Node and bundlers.
npm install @mento-protocol/mento-sdk viem
# or
pnpm add @mento-protocol/mento-sdk viem
# or
yarn add @mento-protocol/mento-sdk viemPeer dependency: viem ^2.21.44 (or compatible v2.x). The SDK uses viem for chain config, encoding, and wallet interactions.
Create the client
import { Mento, ChainId } from '@mento-protocol/mento-sdk'
// Use default public RPC for the chain
const mento = await Mento.create(ChainId.CELO)
// Or pass a custom RPC URL
const mento = await Mento.create(ChainId.CELO, 'https://your-rpc-url.com')
// Or pass an existing viem PublicClient (e.g. for custom transport or chain)
const mento = await Mento.create(ChainId.CELO, yourPublicClient)What you can do next
Area
Guides
Discovery
Discovering tokens, pools and routes — tokens, pools, routes, trading status
Trading
Liquidity
Liquidity management — add/remove liquidity, zap in/out for FPMM pools
Borrow
Borrow (CDP) — open/adjust/close troves, fees, system params
Runnable examples: mento-sdk-examples.
Last updated