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_rpc(lnrpc)
@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)
Authors
@niftynei (niftynei@gmail.com) is the responsible party.
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
chargesats-0.1.0.tar.gz
(2.1 kB
view hashes)
Built Distribution
Close
Hashes for chargesats-0.1.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 373eab37de8243f4e7959baf287d8e0e8abf42590e1ccd28ac9ef8bbec70fe59 |
|
MD5 | db6e0d49a0ce60144deb740da336dbf0 |
|
BLAKE2b-256 | 79cdb9dc467447358343493feec894c4e8baf297da0825756af415860c81d750 |