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.2.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.2.0-py3-none-any.whl (6.7 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: l402kit-0.2.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.2.0.tar.gz
Algorithm Hash digest
SHA256 0e1da2b2da72109bd654ce0da8b05e232f741944b36164e3730a130f0b2886d9
MD5 67f81b64d3c9ddbf9d4e70e3bc7daa4b
BLAKE2b-256 f55bc77f1e7b91b0dbb6da2a4c276e0963af46d9e00818a6bf50a439ea3ad00b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: l402kit-0.2.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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c96f9ecb920a6b5c854c142747a3d342a6bad7881e806a3ebd50d0f3d6d85167
MD5 0315b57e77d6dfb30ef4e86cfd27ecb5
BLAKE2b-256 7f49435e538265e6ad7e86d3d0cda43d862ef73320d942a2fdb0abaaaab04c15

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