Description
Currently the only Provider implementation is CantanProvider, which issues live gRPC calls to Canton's StateService.GetActiveContracts for every balanceOf and totalSupply request. This is expensive — GetAllHoldings fetches the entire Active Contract Set for CIP56Holding, then filters client-side.
The indexer already materializes this data into PostgreSQL (indexer_balances, indexer_tokens) via its streaming processor.
Scope:
- Create pkg/token/provider/indexer.go implementing the existing Provider interface:
- The implementation should call the indexer's HTTP API
- Add unit tests with mocked HTTP responses
Description
Currently the only Provider implementation is CantanProvider, which issues live gRPC calls to Canton's StateService.GetActiveContracts for every balanceOf and totalSupply request. This is expensive — GetAllHoldings fetches the entire Active Contract Set for CIP56Holding, then filters client-side.
The indexer already materializes this data into PostgreSQL (indexer_balances, indexer_tokens) via its streaming processor.
Scope: