w8io icon indicating copy to clipboard operation
w8io copied to clipboard

Can I see my balance at N-th block?

Open username1565 opened this issue 6 years ago • 2 comments

Hello. Can I see my balances at N-th block? Can you add this ability in future?

username1565 avatar Nov 06 '19 11:11 username1565

The main reason why it is hard, because past states can be reached only with on-the-fly rollbacks from the current state.

So it is hard to implement in common, but it can be done for accounts with not so much transactions.

Will look into it.

deemru avatar Nov 06 '19 12:11 deemru

I see this site: https://dev.pywaves.org/balances/ is working by "reports-principle".

But I think this can be realized by caching the requests, if sorting by assets will be available, then this can be just cached, after request.

For example: Request: "WavesExplorer, show me all transactions of token X for address ADDRESS". Response: "blah-blah - all transactions for token X for ADDRESS + blocks". Then, only blocks and amounts are cached for this token X for this ADDRESS. And then, there is more easy to get balance for token X for N-th block, and collect this values for many tokens. Else, if this balances was not been requested, then just nulls there or actual balance, according last regularry report.

username1565 avatar Nov 06 '19 12:11 username1565