MCPcopy Create free account
hub / github.com/ElementsProject/lightning / currencyconvert

Function currencyconvert

tests/plugins/currencyUSDAUD5000.py:11–15  ·  view source on GitHub ↗

Converts currency using given APIs.

(plugin, amount, currency)

Source from the content-addressed store, hash-verified

9
10@plugin.method("currencyconvert")
11def currencyconvert(plugin, amount, currency):
12 """Converts currency using given APIs."""
13 if currency in ('USD', 'AUD'):
14 return {"msat": Millisatoshi(round(amount * 5000))}
15 raise Exception("No values available for currency {}".format(currency.upper()))
16
17
18plugin.run()

Callers

nothing calls this directly

Calls 1

MillisatoshiClass · 0.90

Tested by

no test coverage detected