A Python library for interacting with Speed API and managing Lightning Network invoices
Project description
speedapi_lib
This is a Python library for interacting with the Speed API and managing Lightning Network invoices.
Installation
You can install this library from your private GitHub repository:
pip install speedapi-lib
Usage
from speedapi_lib.speedapi import SpeedAPI
# Initialize the SpeedAPI class with user-provided inputs
api = SpeedAPI(secret_key='your_secret_key', base_url='https://api.tryspeed.com')
# Get balance in SATS
balance = api.get_balance_sats()
print(f"Balance: {balance} SATS")
# Decode and print invoice details
invoice_str = "your_invoice_here"
invoice_info = api.get_invoice_info(invoice_str)
print(invoice_info)
# Pay the invoice if balance is sufficient
if balance >= invoice_info["amount"]:
payment_response = api.pay_invoice(invoice_str)
print("Payment successful:", payment_response)
else:
print("Insufficient balance to pay invoice")
License
This project is licensed under the MIT License - see the LICENSE file for details.
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
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file speedapi_lib-0.1.4.tar.gz.
File metadata
- Download URL: speedapi_lib-0.1.4.tar.gz
- Upload date:
- Size: 2.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cf970896c1208a42a075b568ffe01d32f40b53249241211a911668530c5f9549
|
|
| MD5 |
b9f78480322e78253c6e9255cc86a8b6
|
|
| BLAKE2b-256 |
9c59e16c4aee132bf777c729fed918da2e23730ff79ff79c681f56716119dd7a
|
File details
Details for the file speedapi_lib-0.1.4-py3-none-any.whl.
File metadata
- Download URL: speedapi_lib-0.1.4-py3-none-any.whl
- Upload date:
- Size: 3.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e0afcafed13991fe5efee3af1c23f36836fad6b286ebb6b8acab4f2912c8525f
|
|
| MD5 |
1f7164debdb93eb851b42f9a272ea886
|
|
| BLAKE2b-256 |
c81d10349c3b2ce32463aea82600698bbb67bdd9fe65f8444de13ae1ae5ced3c
|