Open antiwinter opened 1 year ago
Hi @antiwinter ,
You get all the values you need from the positions
function on the NonfungiblePositionManager Contract.
From the response of getPositionInfo()
create the position like this:
const currentPositionInfo = await getPositionInfo(positionId)
const currentPosition = new Position({
pool,
liquidity: JSBI.BigInt(currentPositionInfo.liquidity.toString()),
tickLower: currentPositionInfo.tickLower,
tickUpper: currentPositionInfo.tickUpper,
})
In the example code the
currentPosition
is constructed fromCurrentConfig
which is a const value and can be the same as the mint one. But in real use, there won't be such aCurrentConfig
, then how can I calculate it frompositionId
or the object returned bypositionContract.positions(tokenId)
?