openchainxyz / ethereum-transaction-viewer-frontend

Frontend for https://tx.eth.samczsun.com/
390 stars 67 forks source link

Instead of requesting price for native token use the 0x address #17

Closed StErMi closed 1 year ago

StErMi commented 1 year ago

The current version of the app in ValueChange is requesting some prices on DefiLlama.

If the token is NATIVE_TOKEN it will try to call this endpoint https://coins.llama.fi/prices/current/fantom:native_token On DefiLlama, you have two options

1) use coingecko:<coinGeckoID> 2) use the 0x address directly to get the native token price for a network. In this example, it would be https://coins.llama.fi/prices/current/fantom:0x0000000000000000000000000000000000000000

I don't have the full knowledge of the codebase so probably other part of the codes should be changed.