LNbits API is built using
FastAPI, a high-performance, easy to code API framework.
FastAPI auto-generates swagger UI docs for testing
endpoints /docs
views.py
is used
for setting application routes:
views_api.py
is
used for setting application API endpoints:
LNbits uses Quasar Framework for frontend deisgn elements. Quasar Framework is an open-source Vue.js based framework for building apps.
TIP: Look through/template
files
in other extensions for examples of Quasar elements being
used.
In the below example we make a dialogue popup box (box can
be triggered
LNbits uses Vue components for best-in-class high-performance and responsive performance.
Typical example of Vue components in a frontend script:
In a page body, models can be called.
Content can be
conditionally rendered using Vue's
v-if
:
A magical "g" (ie
this.g.user.wallets[0].inkey
) is always available, with info about the user, wallets
and extensions:
{% raw %}{{ g }}{% endraw %}
LNbits includes a handy exchange rate function, that streams rates from 6 different sources.
Exchange rate API:from lnbits.utils.exchange_rates import
fiat_amount_as_satoshis
: