Metadata-Version: 2.1
Name: chargesats
Version: 0.1.1
Summary: A decorator library for Flask endpoints, to create CLN invoices
Author: niftynei
Author-email: niftynei@gmail.com
Requires-Python: >=3.10,<4.0
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Requires-Dist: flask (>=2.3.2,<3.0.0)
Requires-Dist: pyln-client (>=23.5.2,<24.0.0)
Description-Content-Type: text/markdown

# 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.

