Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Balance History Chart #29

Merged
merged 21 commits into from
Dec 12, 2022
Merged

Balance History Chart #29

merged 21 commits into from
Dec 12, 2022

Conversation

flomang
Copy link
Collaborator

@flomang flomang commented Dec 11, 2022

I figured that this is smooth enough now to share so the other devs can have a taste of something really sweet. This merge adds a historical balance chart to the wallet home screen.

You'll notice that I've started to construct a balance history of the grin wallet in wallet/operation/tx_list_display.rs - starting from line 140. The backdating of the first transaction to "2019-01-20T00:00:00Z" is only left in for dev purposes to provide us adequate data to populate the chart with. My first transaction in a recovered wallet was being set to the date that I restored the wallet. I'm not sure if that is how things are supposed to work?

Some work will be needed to identify what interval is best to populate the chart with - daily or hourly - contingent upon the oldest transaction of the wallet. The chart requires a certain number of data points to be populated with to be useful.

Historical prices are currently pulled from coingecko. I'm sure we could make this configurable one day so the user can choose where they want to source this information from. It's probably more than I want to deal with for version 1.0 though. This is currently handled in "wallet/operation/home.rs" - function update_prices.

Last but not least is the added config - Currency. This setting will change the user's home title balance as well as the chart historical prices. You'll noticed that the symbol is missing for "bitcoin" when you switch. I think we need to find a font that supports it or we explore other solutions to make that more obvious for the user.

As with most of the current code base this is not finished yet but it works well enough to play with.

@yeastplume
Copy link
Member

This looks great! Really fills out the home screen in a very useful way.

@yeastplume yeastplume merged commit 181c567 into mimblewimble:master Dec 12, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants