Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This pull request introduces several changes to improve the handling and usage of token pool prices across multiple components and hooks. The main updates include integrating a new hook to fetch token pool prices, modifying various components to utilize these prices, and updating utility functions to account for the new data.
Integration of Token Pool Prices
New Hook for Fetching Token Pool Prices:
useGetTokenPoolPrices
hook to fetch and cache token pool prices from the backend. (src/hooks/useGetTokenPoolPrices.ts
)Component Updates to Use Token Pool Prices:
Connected
,ConnectedMobile
, andMyWallet
components to includetokenPoolPrices
in the calculation oftotalUsd
. (src/components/WalletManagement/Connected/index.tsx
) [1] (src/components/WalletManagement/ConnectedMobile/ConnectedMobile.tsx
) [2] (src/components/WalletManagement/MyWallet/MyWallet.tsx
) [3] [4]Balance
,TransferConvertToken
,CreatePoolForm
,SelectToken
, andNewPoolModal
components to usetokenPoolPrices
for various calculations and displays. (src/pages/Balance/index.tsx
) [1] [2] [3] (src/pages/Balance/TransferConvertToken/index.tsx
) [4] [5] (src/pages/Pool-V3/components/CreatePoolForm/index.tsx
) [6] (src/pages/Pool-V3/components/SelectToken/index.tsx
) [7] [8] (src/pages/Pools/NewPoolModal/NewPoolModal.tsx
) [9] [10] [11] [12] [13]Utility Function Enhancements
getTotalUsd
function to includepricesViaPool
parameter, allowing it to consider token pool prices in addition to CoinGecko prices. (src/libs/utils.ts
)getUsd
function to utilize token pool prices if available. (src/libs/utils.ts
)Miscellaneous Changes
parseTokenInfoRawDenom
and other utilities across various files to support the new functionality. (src/pages/Balance/TransferConvertToken/index.tsx
) [1] (src/pages/Pool-V3/components/CreatePoolForm/index.tsx
) [2] (src/pages/Pool-V3/components/SelectToken/index.tsx
) [3] (src/pages/Pools/NewPoolModal/NewPoolModal.tsx
) [4]These changes collectively enhance the application's ability to handle and display token pool prices, improving the accuracy and reliability of financial data presented to the users.