Multiple balance for tez, fa1.2 and fa2
Context
Fetching balances from public was done client side on umami. Each account resulting in one http request.
This MR aims at reducing the burden of public node by fetch every balances in one http request. As it is not useful to index every balance update, the easiest way is to fetch the directly from the node.
Content
-
Mezos_fa2
contains the code to run a view on thebalance_of
entrypoint -
Mezos_balances
fetches any balances depending on arguments- if there is only the account list, it fetches tez balances
- if there is the account list and a token kt address, it fetches fa1.2 balances on the given contract (using already existing client code)
- if there is the account list, a token kt address and a token id, it fetches fa2 balances on the given contract
Edited by Rémy El Sibaïe