Add Bitcoin Lightning pay-per-call to any API in 3 lines. L402 protocol for FastAPI and Flask. 0.3% fee, zero config.
Project description
l402kit
Bitcoin Lightning payment middleware for FastAPI and Flask. 3 lines of code.
pip install l402kit
Usage
from l402kit import l402_required, BlinkProvider
lightning = BlinkProvider(api_key="...", wallet_id="...")
@app.get("/premium")
@l402_required(price_sats=100, lightning=lightning)
async def premium(request: Request):
return {"data": "You paid 100 sats!"}
Full docs: https://shinydapps.mintlify.app GitHub: https://github.com/ShinyDapps/l402-kit
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
l402kit-0.3.1.tar.gz
(4.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file l402kit-0.3.1.tar.gz.
File metadata
- Download URL: l402kit-0.3.1.tar.gz
- Upload date:
- Size: 4.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0b210919876f69ae15e0559887161a97055dbee5725c9eaed97a7dd5f105242c
|
|
| MD5 |
4cc76fe8bb20d87f8c34da5e80401b71
|
|
| BLAKE2b-256 |
bfe13b3ecd6728c09003449cde1de6ab9c796b6b14db63a18b4e143b8c040b82
|
File details
Details for the file l402kit-0.3.1-py3-none-any.whl.
File metadata
- Download URL: l402kit-0.3.1-py3-none-any.whl
- Upload date:
- Size: 6.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f19193a248d43c6a778049ac409dbd48fda384c6e462486d397e5dac07b60800
|
|
| MD5 |
90c2210c39a7a8ee54e2e0e46dd428c6
|
|
| BLAKE2b-256 |
596f02a492a9e6cf32c7efaa956f47419c1764c9420bb383738352ee96bddf41
|