Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/price service #1152

Merged
merged 3 commits into from
Feb 12, 2025
Merged

Feat/price service #1152

merged 3 commits into from
Feb 12, 2025

Conversation

trungbach
Copy link
Contributor

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:

    • Added useGetTokenPoolPrices hook to fetch and cache token pool prices from the backend. (src/hooks/useGetTokenPoolPrices.ts)
  • Component Updates to Use Token Pool Prices:

    • Updated Connected, ConnectedMobile, and MyWallet components to include tokenPoolPrices in the calculation of totalUsd. (src/components/WalletManagement/Connected/index.tsx) [1] (src/components/WalletManagement/ConnectedMobile/ConnectedMobile.tsx) [2] (src/components/WalletManagement/MyWallet/MyWallet.tsx) [3] [4]
    • Modified Balance, TransferConvertToken, CreatePoolForm, SelectToken, and NewPoolModal components to use tokenPoolPrices 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

  • Updated Utility Functions:
    • Modified getTotalUsd function to include pricesViaPool parameter, allowing it to consider token pool prices in addition to CoinGecko prices. (src/libs/utils.ts)
    • Enhanced getUsd function to utilize token pool prices if available. (src/libs/utils.ts)

Miscellaneous Changes

  • Additional Imports:
    • Added necessary imports for 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.

Copy link

cloudflare-workers-and-pages bot commented Feb 12, 2025

Deploying beta-oraidex with  Cloudflare Pages  Cloudflare Pages

Latest commit: 4ebe636
Status:🚫  Build failed.

View logs

@trungbach trungbach requested a review from haunv3 February 12, 2025 09:43
@trungbach trungbach merged commit 943febf into main Feb 12, 2025
2 of 3 checks passed
@trungbach trungbach deleted the feat/price-service branch February 12, 2025 09:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants