Crate cdk_lnbits

Crate cdk_lnbits 

Source
Expand description

CDK lightning backend for lnbits

§CDK LNBits

crates.io Documentation MIT licensed

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:

[dependencies]
cdk-lnbits = "*"

§Configuration for cdk-mintd

§Config File

[ln]
ln_backend = "lnbits"

[lnbits]
admin_api_key = "your-admin-api-key"
invoice_api_key = "your-invoice-api-key"
lnbits_api = "https://your-lnbits-instance.com/api/v1"
fee_percent = 0.02       # Optional, defaults to 2%
reserve_fee_min = 2      # Optional, defaults to 2 sats

§Environment Variables

All configuration can be set via environment variables:

VariableDescriptionRequired
CDK_MINTD_LN_BACKENDSet to lnbitsYes
CDK_MINTD_LNBITS_ADMIN_API_KEYLNBits admin API keyYes
CDK_MINTD_LNBITS_INVOICE_API_KEYLNBits invoice API keyYes
CDK_MINTD_LNBITS_LNBITS_APILNBits API URLYes
CDK_MINTD_LNBITS_FEE_PERCENTFee percentage (default: 0.02)No
CDK_MINTD_LNBITS_RESERVE_FEE_MINMinimum fee in sats (default: 2)No

§Example

export CDK_MINTD_LN_BACKEND=lnbits
export CDK_MINTD_LNBITS_ADMIN_API_KEY=your-admin-api-key
export CDK_MINTD_LNBITS_INVOICE_API_KEY=your-invoice-api-key
export CDK_MINTD_LNBITS_LNBITS_API=https://your-lnbits-instance.com/api/v1
cdk-mintd

§Getting API Keys

  1. Log in to your LNBits instance
  2. Go to your wallet
  3. Click on “API Info” to find your admin and invoice API keys

§License

This project is licensed under the MIT License.

Modules§

error
Error for LNbits ln backend

Structs§

LNbits
LNbits