v3-sdk
v3-sdk copied to clipboard
Generating callData using NonFungiblePositionManager.removeCallParameters() fails
Results in:
Error: could not parse Fraction
Assuming fetched position data:

With a position.liquidity.toString() value of 341124671496446
And the following example code:
const position = await positionManagerContract.positions(db.data?.positions[0].id);
console.log(position);
const remove = NonfungiblePositionManager.removeCallParameters(position, {
tokenId: db.data?.positions[0].id,
liquidityPercentage: new Percent(1),
slippageTolerance: new Percent(50, 10_000),
deadline: (await provider.getBlock('latest')).timestamp + 150,
burnToken: false, // true to burn NFT
collectOptions: {
expectedCurrencyOwed0: CurrencyAmount.fromRawAmount(token0, position.feeGrowthInside0LastX128),
expectedCurrencyOwed1: CurrencyAmount.fromRawAmount(token1, position.feeGrowthInside1LastX128),
recipient: wallet.address
}
});
console.log(remove);
It fails here:
