liftedinit / alberto

A crypto wallet for any ledger supporting the Many protocol
https://alberto.app
Apache License 2.0
6 stars 7 forks source link

Running balance alongside transactions #142

Open fmorency opened 1 year ago

fmorency commented 1 year ago

As a user, I need the capability to display a running balance column alongside my transaction records. This feature would help me easily track the evolving balance of my account as I make transactions, allowing for a quick and accurate assessment of my financial standing.

Relates #143

stanleyjones commented 1 year ago

I've spent the morning looking into this issue and coming up with a few ways we could do it. Currently, Alberto does something like this:

  1. Fetch the 11 latest account events
  2. Fetch each transaction from its event
  3. Show the first 10 transactions
  4. If there are more than 10 transactions, show a "next" button
  5. Repeat when the user clicks the button, each time fetching 1 more than necessary to show

We have a few options:

Am I missing any ideas?

cc @fmorency @jgryffindor

stanleyjones commented 1 year ago
fmorency commented 1 year ago

@stanleyjones Check out https://github.com/liftedinit/alberto/pull/146, it contains things that will be useful for this task, i.e., useAllTransactionsList. You should be able to implement (A) or (B) with it.

We can look into (D) and (E) if/when we need to scale.

The only edge-case is the treasury which needs to start from the genesis balance and not 0.

fmorency commented 1 year ago

@stanleyjones You're also welcome to comment/improve on that PR!