-
Notifications
You must be signed in to change notification settings - Fork 8
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
Add currency abstraction #1815
Comments
WIP: Added the TFT class which contains conversions to/from USD alongside monthly and yearly conversions. Currently working on implementing the script to use the mentioned functions. I didn't add hourly as it's the default value. |
WIP: Used decimal in the abstraction and updated the script. Currently working on adding unit tests. |
WIP: Edited the TFT module and updated its script and added some tests. However, some of the tests are not working and I'm working on fixing them. |
Work completed: Changed the class name and removed the calculator and the substrate_url completely and got TFT price directly from TFChain instead. Applied changes in the script and its tests. Also, added more tests. |
Changed the previous flow so the user would need to get the rate himself before creating a currency instance (Now the Grid Client is not needed to create the instance). Also added the possibility for the user to change the decimal value for all the method results. |
We keep doing the conversions manually, and .toFixed calls way too often, let's introduce some sort of Tft class or Currency that can handle the logic of conversion, hourly, monthly, yearly calculations, and the string representation, .. etc
The text was updated successfully, but these errors were encountered: