Closed HonzaR closed 2 weeks ago
I think there are two use cases:
Currency conversion will require a web service API call, and we'll need to likely expose an APIs for each of those use cases.
In the future, we might also want to support different currencies.
So building upon the API suggestion, we might need two additional model objects. One to represent the currency to be converted, and another representing a snapshot of a conversion at a point in time.
Is your feature request related to a problem? Please describe.
Assuming we have a conversion rate as implemented in #614, we need methods that take an amount in Zatoshi and creates a properly formatted fiat currency amount.
This can be mostly ported over from the Secant app.
We already have a function for converting ZEC to USD, which requires USD price for 1 ZEC:
convertZecToUsd(zecPrice: BigDecimal)
But the SDK does not seem to provide thezecPrice
.Then, we'd also like to have a function for formatting conversion result of ZEC to USD as a String, like we already have for Zatoshi to ZEC:
convertZatoshiToZecString()
Describe the solution you'd like
For request number 2 the solution could be something like this:
Additional context
The solution should be part of
CurrencyFormatter.kt
.