Get historical wallet balance for cities
Closed this issue · 2 comments
Once the new treasury contracts are deployed, there will be a split of information between the previous wallet and the new contract.
In order to make this easier for integrations, could we return the historical balance via at-block
and stx-get-balance
?
Then we would just need to hardcode the old wallet principal and record the block height where the core contracts are updated, so that:
- any queries before the block height look up balance of old wallet
- any queries at or after the block height look up balance of contract
It'd also be interesting to explore how this works should a few more versions of a treasury be deployed.
Update: the principal can be hard-coded into the function for the wallet address, but cannot be stored as a constant just yet.
At this point each treasury contract will be identical except for it's deployed name, and it would be safer to start with that and review this again in future versions after Stacks 2.1 launches.