Skip to content

Conversation

@nicosampler
Copy link
Collaborator

@nicosampler nicosampler commented Nov 4, 2025

  • Expose both getPosition and getPostionInfo.
  • Refactor getPositonInfo
  • Refactor getPosition
  • Add new helper getTickInfo
  • Add and refactor unit tests

@codecov
Copy link

codecov bot commented Nov 4, 2025

Codecov Report

❌ Patch coverage is 95.55556% with 8 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
src/core/uniDevKitV4.ts 54.54% 5 Missing ⚠️
src/utils/buildAddLiquidityCallData.ts 83.33% 1 Missing ⚠️
src/utils/buildCollectFeesCallData.ts 0.00% 1 Missing ⚠️
src/utils/getTickInfo.ts 97.50% 1 Missing ⚠️

📢 Thoughts on this report? Let us know!

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This pull request refactors the codebase to use standardized "currency" terminology instead of "token", aligning with Uniswap V4 SDK conventions. It also introduces new utility functions for fetching position and tick information while improving code organization and test coverage.

Key changes:

  • Renamed token0/token1 to currency0/currency1 throughout the codebase
  • Split getPosition functionality into getPosition (returns SDK instances) and getPositionInfo (returns raw data)
  • Added new getTickInfo utility function for fetching tick-level pool data

Reviewed Changes

Copilot reviewed 23 out of 23 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
src/utils/preparePermit2Data.ts Updated documentation example to use currency0 instead of token0
src/utils/preparePermit2BatchData.ts Updated documentation example to use currency0/currency1 instead of token0/token1
src/utils/getTickInfo.ts New utility to fetch tick information from V4 StateView
src/utils/getPositionInfo.ts New utility to fetch raw position data without SDK instances
src/utils/getPosition.ts Refactored to use getPositionInfo and renamed variables to currency0/currency1
src/utils/buildRemoveLiquidityCallData.ts Updated getPosition call signature (removed object wrapper)
src/utils/buildCollectFeesCallData.ts Updated getPosition call signature (removed object wrapper)
src/utils/buildAddLiquidityCallData.ts Updated terminology and variable names to use currency0/currency1
src/types/utils/index.ts Added export for getTickInfo types
src/types/utils/getTickInfo.ts New type definitions for tick information
src/types/utils/getPosition.ts Updated types to use currency0/currency1 and added GetPositionInfoResponse
src/types/utils/buildAddLiquidityCallData.ts Updated documentation to use currency0/currency1
src/test/utils/getTickInfo.test.ts New tests for getTickInfo utility
src/test/utils/getPositionInfo.test.ts New tests for getPositionInfo utility
src/test/utils/getPosition.test.ts Refactored tests to use mocked getPositionInfo
src/test/utils/getPool.test.ts Renamed test variables to use currency terminology
src/test/utils/buildRemoveLiquidityCallData.test.ts Updated test expectations for new getPosition signature
src/test/utils/buildAddLiquidityCallData.test.ts Updated tests to use currency0/currency1 terminology
src/test/helpers/testFactories.ts Updated factory functions to use currency0/currency1 parameters
src/helpers/tokens.ts Updated parameter names and documentation to use currency terminology
src/core/uniDevKitV4.ts Added getTickInfo and getPositionInfo methods, updated documentation
package.json Version bump from 1.1.1 to 2.1.1
README.md Updated documentation for new methods and terminology

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Member

@luchobonatti luchobonatti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 💯 !

@nicosampler nicosampler merged commit 4fd8fd3 into main Nov 4, 2025
2 checks passed
@github-actions
Copy link

github-actions bot commented Nov 4, 2025

🎉 This PR is included in version 2.0.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants