-
Notifications
You must be signed in to change notification settings - Fork 3.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
<!-- start pr-codex --> ## PR-Codex overview This PR primarily focuses on enhancing the handling of tokens and liquidity in the application. It introduces functions for unwrapping tokens and generating liquidity links, while also refining the logic for displaying token balances and managing native tokens. ### Detailed summary - Added `unwrappedToken` function to handle token unwrapping. - Modified balance calculation to use `useMemo` for performance. - Implemented `getAddLiquidityLink` and `getRemoveLiquidityLink` functions. - Updated token order logic to use wrapped token addresses. - Adjusted liquidity removal logic to consistently use wrapped token addresses. - Enhanced `currencyKey` function to utilize unwrapped tokens. - Refined SwapRoute component to display unwrapped token symbols. - Improved LiquidityRow component to use unwrapped token symbols and updated liquidity link generation. > ✨ Ask PR-Codex anything about this PR by commenting with `/codex {your question}` <!-- end pr-codex -->
- Loading branch information
Showing
9 changed files
with
67 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
import { Currency } from '@pancakeswap/ton-v2-sdk' | ||
import { currencyKey } from './tokens/currency' | ||
|
||
export const getAddLiquidityLink = (currency0?: Currency, currency1?: Currency) => { | ||
const key0 = currencyKey(currency0) | ||
const key1 = currencyKey(currency1) | ||
return `/liquidity/add/${key0}/${key1}` | ||
} | ||
|
||
export const getRemoveLiquidityLink = (currency0?: Currency, currency1?: Currency) => { | ||
const key0 = currencyKey(currency0) | ||
const key1 = currencyKey(currency1) | ||
return `/liquidity/remove/${key0}/${key1}` | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
import { Currency, Native, WNATIVE } from '@pancakeswap/ton-v2-sdk' | ||
|
||
export function unwrappedToken(token?: Currency): Currency | undefined { | ||
if (token && token.equals(WNATIVE[token.chainId as keyof typeof WNATIVE])) return Native.onChain(token.chainId) | ||
return token | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters