-
Notifications
You must be signed in to change notification settings - Fork 39
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
Prices + CoinGecko integration #81
Conversation
A prices system has been added to MPW, made to support multiple price providers in the future, as well as with existing multi-currency support and persistent user preference, defaulting to USD otherwise. Some trivial cleanup was also done, along with linting and prettier being ran, catching a few out-of-scope files, better sooner than later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tACK 99989be
Tested, works fine, looks great.
PIVX Price: .338106 at time of writing
Math checks out lol
nit: global.js new lines 408-415
my eyessss
ESLint/Prettier did not take kindly to global.js 408-415 😂 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Other than these two notes, I'm really liking this
* CoinGecko's endpoint for PIVX data, optimised for least bandwidth | ||
* - No localisation, tickers, community data, developer data or sparklines | ||
*/ | ||
export const COINGECKO_ENDPOINT = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should keep this in chain_params, and if it's null for the current chain we can either remove the price or set it to 0, this way testnet coins don't display mainnet prices
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think there will ever be an instance where non-mainnet has a price (so "alternative" price tracking or per-network prices wouldn't really be useful).
But for consistency, I think keeping the prices as-is on all networks is fine, so tPIV would still show a value to keep the UI consistent for testing purposes, thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm still not convinced about this, tPIV should be valued at 0$, but it seems like i'm alone on this, since it's a small detail I think we can merge
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tACK 7a2b047
I think it should show pricing for testing purposes even though tPIV has no value, it's helpful than using the entire main net to cross check.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tACK
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
tACK
Abstract
A prices system has been added to MPW, made to support multiple price providers in the future, as well as with existing multi-currency support (~61 currencies) and persistent user preference, defaulting to USD otherwise.
Some trivial cleanup was also done, along with linting and prettier being ran, catching a few out-of-scope files, better sooner than later!
What does this PR address?
This PR finishes the "display currency" functionality for the Dashboard UI, as well as making it easy in the future to display "conversion currencies" in future screens, like seeing your Stakes in USD or BTC, or having a "Send USD" option, which sends the equivalent of PIVX your favored currency.
What features or improvements were added?
A modular price system, along with multi-currency support and persistent user settings for each currency.
How does this benefit users?
Users can now view their PIVX in equivalent display currencies, and customise their currency out of a large selection from CoinGecko in the MPW settings, which is persisted across sessions.