Skip to main content

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


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.0.tar.gz (4.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

l402kit-0.3.0-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

Details for the file l402kit-0.3.0.tar.gz.

File metadata

  • Download URL: l402kit-0.3.0.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

Hashes for l402kit-0.3.0.tar.gz
Algorithm Hash digest
SHA256 562db004c4792917e6c7e5408481b0398d0e5cadcb21bbe541ba17864ae26a76
MD5 8f395083977ed60e120ab0904830fdf7
BLAKE2b-256 7b31673a7bf96969a5a81c515bc5ce7d4520cd9822947bca0694c4ce1fb677eb

See more details on using hashes here.

File details

Details for the file l402kit-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: l402kit-0.3.0-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

Hashes for l402kit-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0302a1b35948f12471ae0d629ebc992f1081c782bf32670a2a38a8724fd2f432
MD5 5afc0220add1fe9f927c7c4ffdbd0a1a
BLAKE2b-256 8829345ae65920255e15aa6fce21d3540d655573206a29ca7bb204bb3bb48246

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page