mirror of
https://github.com/lnbits/lnbits-legend.git
synced 2025-01-18 21:32:38 +01:00
Added conversion endpoint
Exposes fiat_amount_as_satoshis
This commit is contained in:
parent
25b502e5d5
commit
4e0e5b9956
@ -501,3 +501,12 @@ async def api_perform_lnurlauth(callback: str):
|
||||
@core_app.get("/api/v1/currencies")
|
||||
async def api_list_currencies_available():
|
||||
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…
Reference in New Issue
Block a user