CDK LNBits
ALPHA This library is in early development, the API will change and should be used with caution.
LNBits backend implementation for the Cashu Development Kit (CDK). This provides integration with LNBits for Lightning Network functionality.
Note: Only LNBits v1 API is supported. This backend uses the websocket-based v1 API for real-time payment notifications.
Installation
Add this to your Cargo.toml:
[]
= "*"
Configuration for cdk-mintd
Config File
[]
= "lnbits"
[]
= "your-admin-api-key"
= "your-invoice-api-key"
= "https://your-lnbits-instance.com/api/v1"
= 0.02 # Optional, defaults to 2%
= 2 # Optional, defaults to 2 sats
Environment Variables
All configuration can be set via environment variables:
| Variable | Description | Required |
|---|---|---|
CDK_MINTD_LN_BACKEND |
Set to lnbits |
Yes |
CDK_MINTD_LNBITS_ADMIN_API_KEY |
LNBits admin API key | Yes |
CDK_MINTD_LNBITS_INVOICE_API_KEY |
LNBits invoice API key | Yes |
CDK_MINTD_LNBITS_LNBITS_API |
LNBits API URL | Yes |
CDK_MINTD_LNBITS_FEE_PERCENT |
Fee percentage (default: 0.02) |
No |
CDK_MINTD_LNBITS_RESERVE_FEE_MIN |
Minimum fee in sats (default: 2) |
No |
Example
Getting API Keys
- Log in to your LNBits instance
- Go to your wallet
- Click on "API Info" to find your admin and invoice API keys
License
This project is licensed under the MIT License.