superhero-com / superhero-wallet

Superhero is a multi-blockchain wallet to manage crypto assets and navigate the web3 and DeFi space. Currently supporting Bitcoin, Ethereum and æternity blockchains.
https://wallet.superhero.com
ISC License
40 stars 38 forks source link

Fiat value not properly fetched (possibly 3rd party API fault). Suggestion for workaround. #2961

Closed onvisions closed 4 months ago

onvisions commented 7 months ago

The Fiat value of Coins/Tokens is not properly fetched by third party API (CoinGecko) which leads to following bugs observed in the wallet extension:

  1. The Total portfolio value of all accounts is displayed as "0" although the user has tokens and coins in various accounts.
  2. Fiat values are displayed as "0" in the transactions list.
  3. Fiat values of token amounts in the token selector (Sending or Receiving flow) are not displayed.

Image Image

Suggestion: if the problem is with CoinGecko API we may implement logic to display the latest successfully fetched data about the asset price if it's no older than 10 mins (the exact period to be determined). In case data is older we should hide the fiat value until we can fetch properly. IMO It's more frustrating and confusing to see balance $0.00 instead of not seeing any value at all.

peronczyk commented 4 months ago

As we don't have any control if CoinGecko API call fails I agree that the only solution is to cache the previous values. I have implemented the local storage caching. The task is ready to review and test @Liubov-crypto .

In order to test it you can try to block the CoinGecko url in your browser after opening the app for the 1st time and then try to opn/close it again.

Liubov-crypto commented 4 months ago

After I blocked the CoinGecko URL and reloaded the app, it will show the total amount, but will not show the amount for each transaction, such as ETH. I don't know if this is correct, but the same is on product.

Image

the rest is LGTM

I've registered mentioned issue separately.

Liubov-crypto commented 4 months ago

LGTM