Upgrade conversion endpoint (#491)

This commit is contained in:
Tiago Vasconcelos
2022-01-14 09:19:30 -03:00
committed by GitHub
parent fc021b3736
commit 918e9be7ed
2 changed files with 24 additions and 4 deletions
+3
View File
@@ -284,3 +284,6 @@ async def get_fiat_rate_satoshis(currency: str) -> float:
async def fiat_amount_as_satoshis(amount: float, currency: str) -> int:
return int(amount * (await get_fiat_rate_satoshis(currency)))
async def satoshis_amount_as_fiat(amount: float, currency: str) -> float:
return float(amount / (await get_fiat_rate_satoshis(currency)))