Skip to content
This repository has been archived by the owner on Jan 24, 2024. It is now read-only.

feat(balances): Eliminate requirement for balance fetcher #524

Merged
merged 10 commits into from
May 30, 2022

Conversation

immasandwich
Copy link
Contributor

@immasandwich immasandwich commented May 26, 2022

Description

  • Instead of a single BalanceFetcher class, Studio will allow you to register a balance fetcher class per app token group and contract position group.
  • For app token groups, the default strategy is to call erc20.balanceOf on all of the indexed tokens
  • For contract position groups, the default strategy is to return an empty array
  • Users can register a balance fetcher per group to override the default strategy (generally required for contract position groups because of their non-standard nature; generally not required for app token groups because of the ERC20 standard)
  • Enable a registering a presenter to re-group balances and hydrate the response with additional metadata
  • The default presenter will simply group balances by their groups in the app definition and present them

Checklist

How to test?

http://localhost:5001/apps/rari-fuse/balances?addresses[]=0x9c5083dd4838e120dbeac44c052179692aa5dac5 (Rari Fuse balances for pennilesswassie.sismo.eth; regrouped and hydrated with metadata)
http://localhost:5001/apps/aelin/balances?addresses[]=0xde6d499de897c1c989e2bc0b3fce48626c84a6c3 (Aelin balances for gaojianxiao.eth; default afterware)

@immasandwich immasandwich merged commit 2a69f87 into main May 30, 2022
@immasandwich immasandwich deleted the poc-no-balance-fetcher branch May 30, 2022 19:57
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant