Skip to content
This repository has been archived by the owner on Apr 25, 2024. It is now read-only.

Generating callData using NonFungiblePositionManager.removeCallParameters() fails #138

Open
99linesofcode opened this issue Aug 1, 2022 · 0 comments
Labels
bug Something isn't working

Comments

@99linesofcode
Copy link

Results in:

Error: could not parse Fraction

Assuming fetched position data:
image

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:

image

@hensha256 hensha256 added the bug Something isn't working label Aug 11, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants