Fetching Positions
This section demonstrates how to fetch liquidity positions on the Storyhunt V3 protocol.
Introduction
Connecting to the NonfungiblePositionManager Contract
NonfungiblePositionManager Contractimport { ethers } from 'ethers';
import INONFUNGIBLE_POSITION_MANAGER from '@storyhunt/v3-periphery/artifacts/contracts/NonfungiblePositionManager.sol/NonfungiblePositionManager.json';
const provider = new ethers.providers.JsonRpcProvider(rpcUrl);
const nfpmContract = new ethers.Contract(
NONFUNGIBLE_POSITION_MANAGER_CONTRACT_ADDRESS,
INONFUNGIBLE_POSITION_MANAGER.abi,
provider
);Fetching Position IDs
const numPositions = await nfpmContract.balanceOf(address);