Added conversion endpoint
Exposes fiat_amount_as_satoshis
This commit is contained in:
parent
25b502e5d5
commit
4e0e5b9956
1 changed files with 9 additions and 0 deletions
|
|
@ -501,3 +501,12 @@ async def api_perform_lnurlauth(callback: str):
|
||||||
@core_app.get("/api/v1/currencies")
|
@core_app.get("/api/v1/currencies")
|
||||||
async def api_list_currencies_available():
|
async def api_list_currencies_available():
|
||||||
return list(currencies.keys())
|
return list(currencies.keys())
|
||||||
|
|
||||||
|
|
||||||
|
class ConversionData(BaseModel):
|
||||||
|
unit: str
|
||||||
|
amount: float
|
||||||
|
|
||||||
|
@core_app.post("/api/v1/conversion")
|
||||||
|
async def api_fiat_as_sats(data: ConversionData):
|
||||||
|
return await fiat_amount_as_satoshis(data.amount, data.unit)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue