This is a template WASM extension meant to be copied and modified.
No Python code from the extension is executed. The host only exposes the
explicit permissions you declare in config.json.
- Update
config.jsonpermissions to the APIs you need. - Update
kv_schemafor the keys your extension will store. - Replace the UI in
templates/andstatic/. - Replace the WASM module in
wasm/.
- Access the filesystem.
- Access environment variables or LNbits settings (outside of the API for fetching settings).
- Make outbound network calls.
- Execute Python or shell commands.
ext.db.read_writecontrols access to the extension KV store.api.METHOD:/pathlets the extension call internal LNbits endpoints through the proxy (exact path match). Check /openapi.json or /docs for available endpoints.ext.payments.watchlets the extension register backend payment watchers.
Permissions are shown at enable time and must be explicitly approved.
WASM extensions can call any internal LNbits endpoint by declaring the matching permission and using:
POST /{ext_id}/api/v1/proxy
Example:
{
"method": "POST",
"path": "/api/v1/payments",
"body": {"out": false, "amount": 10, "memo": "Example"}
}You can compile in any language that targets WASM. This template includes:
wasm/module.wat(minimal WAT)wasm/rust-example/(Rust)wasm/assemblyscript-example/(AssemblyScript)
Each example folder includes build instructions.