Closed fernandomg closed 4 months ago
The latest updates on your projects. Learn more about Vercel for Git ↗︎
Name | Status | Preview | Updated (UTC) |
---|---|---|---|
dappbooster | ✅ Ready (Inspect) | Visit Preview | Jul 22, 2024 4:10pm |
Holy f*ck, that spinner looks terrible there (I'll fix it later...).
haha, some skeleton would look better. But it is what it is by default 😁
I'm not getting my ETH balances, it's always 0.00 (I tried with a wallet with 0.05 ETH and another one with 0.0001 ETH, maybe it's a rounding problem?).
The same happens with MATIC, so maybe your code hates my native tokens IDK.
hmmm!!! So despite having support for 0xe
and 0x0
as representation for native tokens, it only works with the ZeroAddress.
I'll update the code and env var values.
@gabitoesmiapodo, please check if the balance is properly displayed now.
To me, it's working on the 4 chains.
Closes #156
Description:
A refactor around
useTokens
hooks was made.In fact,
useTokens
was moved touseTokenLists
, anduseTokens
has a new API and logic. It will load balances into the tokens lists (that list generated byuseTokenLists
) if it's possible and required.Components to display the balance were updated, and
TokenBalance
was created to reflect the current loading state of the balances which takes time to resolve the whole list of balances and prices for the tokens provided.To gather balances and prices a new dependency was added:
@lifi/sdk
and theuseTokens
hook is tied to its interfaces and types; so, in the case of needing a new source of prices/balances, we'll need to refactor it.The architectural decision behind this:
useTokenLists
)useTokens
), where we add information to each token using theextensions
field and storebalance
andpriceUSD
data. After that, the lists are sorted by price value in descending order.useMemo
), and will react to any change in the dependant values, so it properly reflects in the UI.Steps:
(Required steps to reproduce or test the fix / feature)
Type of change:
How Has This Been Tested?
Remember to check that:
Screenshots
https://github.com/user-attachments/assets/7f2718a7-5e25-48da-afb2-90f0cfe86637