Refactor fetching token information: symbol, decimals, etc
See original GitHub issueCurrent logic for fetching token information is overcomplicated and not working properly (https://github.com/gnosis/safe-react/issues/1068).
So, the problem:
Currently token information is fetched for a transaction inside fetchTransactions
(https://github.com/gnosis/safe-react/issues/1070). This shouldn’t be a thing, imagine the following example:
- we get a transaction with an unknown token, we fail to fetch info and now showing
UNKNOWN
- later we get this token info from the backend
UNKNOWN
will still be shown because the token info is tied to the transaction
Possible solution:
Implement a react component for displaying token symbols with a usage like this: <TokenSymbol address={}
It should get the symbol from state, if there’s no info in state, fetch it
This function should work as a good base: https://github.com/gnosis/safe-react/blob/a5b45850494097e7b288e84dc25e0b8a8a017564/src/logic/tokens/store/actions/fetchTokens.ts#L60
Issue Analytics
- State:
- Created 3 years ago
- Reactions:1
- Comments:8 (8 by maintainers)
Top Results From Across the Web
Covert ERC-20 tokens with different decimals to amount to Wei
The token contract should have a function to get how many decimals it uses. If you know that the token contract uses 3...
Read more >How do I get a token's name, symbol, decimals, etc.?
Update: Make this call directly from the RPC. You can query the RPC directly as follows: curl --location --request POST 'https://archival-rpc.
Read more >How to manage your Design Tokens with Style Dictionary
Recently I have come across a tool, called Style Dictionary, developed by Danny Banks at Amazon, that allows you to manage design tokens...
Read more >ERC: Token Registries · Issue #22 · ethereum/EIPs - GitHub
Sets or returns the base unit of a token. Although most tokens are displayed to the final user as containing decimal points, token...
Read more >How to Fetch and Update Data From Ethereum With React ...
Here's how to configure your dapp's frontend so token balances and fund transfers update in your users' Ethereum wallets.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Ahhh got it, now it makes sense, thanks for the clarification! @Uxio0
This has been refactored since, so I think we can close it.