Skip to main content

A decorator library for Flask endpoints, to create CLN invoices

Project description

Charge Sats

A very simple Python library to add Pay-Per-View technology to a Flask endpoint.

Here's a quick example of how to use it. Note that it assumes the CLN node is running on/within reach of the Flask server.

from flask import Flask
from chargesats import Charger


app = Flask(__name__)


# Init the charger!
lnrpc = '/home/runner/.lightning/regtest/lightning-rpc'
Charger.init(lnrpc, 'secret do not share')


@app.route('/')
# Use the charger to charge some sats for an endpoint!
@Charger.charge(amount="100sat")
def index():
    return 'This cost you 100 sats\\n'


app.run(host='0.0.0.0', port=81)

Pending Tasks

  • Uses runes as tokens for repeat calls
  • Add ability to use commando

Authors

@niftynei (niftynei@gmail.com) is the responsible party.

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

chargesats-0.1.1.tar.gz (2.3 kB view details)

Uploaded Source

Built Distribution

chargesats-0.1.1-py3-none-any.whl (2.8 kB view details)

Uploaded Python 3

File details

Details for the file chargesats-0.1.1.tar.gz.

File metadata

  • Download URL: chargesats-0.1.1.tar.gz
  • Upload date:
  • Size: 2.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.10.6 Linux/5.15.0-75-generic

File hashes

Hashes for chargesats-0.1.1.tar.gz
Algorithm Hash digest
SHA256 e9eb917bf0aeb7b04f383e7b63fb21816ccebeb7b1743571a652721e465a1f8b
MD5 4dc9ae172cb6fba0af5727e122246892
BLAKE2b-256 f58d89ad2d768f9e5cff6ea1a68809d13f460bb8e79859ce4522738647dffa97

See more details on using hashes here.

File details

Details for the file chargesats-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: chargesats-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 2.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.5.1 CPython/3.10.6 Linux/5.15.0-75-generic

File hashes

Hashes for chargesats-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 1caab841b226d2acea32d53ebcc0d027bafa3d92da06d5f8b78a3932940e4268
MD5 5f4c44d9f9bfda9c678d90cfdae27eb7
BLAKE2b-256 a76c81e6c8229cb968c82366a7c651b430d6bff918442f40898a79f80156f233

See more details on using hashes here.

Supported by

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