Open pir8radio opened 1 year ago
To get a name for a given account, another 2 API calls may be needed. First is to check if it is an AT using getAT
to get contract name. If there is an error within this request, then it is a regular account. The second request getAccount
can get the details of the regular account. (remember getAccount does not return AT name https://github.com/signum-network/signum-node/issues/743 )
This will cause a lot of calls to the node for each page of transactions that is loaded. Also they need to be done asynchronous (first show details without the name, then resolve names and update later) to not make the loading page very slow (or even not loading if some call does not receive answer).
In the classic/neoclassic, the approach is to look for a friendly name only in the contacts (frontend) to add the name. It can be done very fast because no API call is needed.
For the tokens in classic/neoclassic, the approach is to look for token details in cache. If there is no cached token, show unknown asset and make a lazy call to get and cache token details (name, decimals, etc...). In this way, when a second page (or the page is refreshed in 30 seconds) the token name will be shown correctly.
Cache the account name would be a solution, but this info shall be refreshed regularly because users can change the name. For the tokens it is easier because the only value that can change is the circulating quantity. Also there are way less active tokens then active users. Circulating quantity is shown only on asset details and for each time asset details is shown, then that token cache is refreshed to update this property (not often).
I can pull them from already known adresses (contacts, and added accounts) - this would be a middleway
Please add account names below (or wherever) somewhere near the account numbers on transactions, transfers etc. like the attached image.. Right now I must click that account to figure out who sent me moola...
Maybe similar to explorer shown below: