-
Notifications
You must be signed in to change notification settings - Fork 23
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
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
…t should control the chart data.
… affect immedately.
This looks great! Really fills out the home screen in a very useful way. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.