Claim Fee
This is an example of claiming fees earned from a position in Pangea.
import { ethers } from "ethers";
import {BigNumber} from "@ethersproject/bignumber";
/// concentrated Liquidity Pool Manager address
const poolManagerAddress = "0x000...";
/// web3 Provider (metamask provider / jsonRPC provider / ...)
const provider = ethers.getDefaultProvider();
// claims fee from position
async function collect(
tokenId:number, // tokenId
recipient:string // recipient address
) {
const poolManager = await ConcentratedLiquidityPoolManager__factory.connect(positionManagerAddress, provider);
const tx = await poolManager.collect(
tokenId, /
recipient,
false // Unwrap? "true" if you want to get KLAY instead of wKLAY
);
await tx.wait();
}yp
Last updated