SatRank SDK for autonomous agents on Bitcoin Lightning — discover, score, and pay Lightning-native HTTP services
Project description
satrank — Python SDK
Python client for SatRank. One verb — fulfill() —
that discovers, pays, and reports a Lightning-native HTTP service in a single
call with a hard budget guarantee.
Install
pip install satrank # core
pip install "satrank[nwc]" # + Nostr Wallet Connect driver
Python 3.10+.
Quickstart
import asyncio
from satrank import SatRank
from satrank.wallet import LndWallet
async def main() -> None:
async with SatRank(
api_base="https://satrank.dev",
wallet=LndWallet(
rest_endpoint="https://127.0.0.1:8080",
macaroon_hex="...", # admin macaroon (hex)
),
caller="my-agent",
) as sr:
result = await sr.fulfill(
intent={"category": "data/weather", "keywords": ["paris"]},
budget_sats=50,
)
print(result["response_body"] if result["success"] else result["error"])
asyncio.run(main())
Discovery only (no wallet)
async with SatRank(api_base="https://satrank.dev", caller="explorer") as sr:
cats = await sr.list_categories()
res = await sr.resolve_intent(category="data/weather", limit=10)
for c in res["candidates"]:
print(c["rank"], c.get("price_sats"), c.get("service_name"))
Wallet drivers
LndWallet— LND REST, macaroon auth.NwcWallet— NIP-47 Nostr Wallet Connect (needssatrank[nwc]).LnurlWallet— LNbits-style HTTP wallets.
See docs/sdk/wallet-drivers.md in the repo.
Documentation
License
MIT.
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
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 satrank-1.0.1.tar.gz.
File metadata
- Download URL: satrank-1.0.1.tar.gz
- Upload date:
- Size: 29.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
869b9427224b46bca3c6feb3e9f2d936feb877c15d8fabf557d737e0cdd532fd
|
|
| MD5 |
76402fc7deff94abc2018d82c662829e
|
|
| BLAKE2b-256 |
53a1134ab593fb35a11bd48a368588d7dd262102a85a8269fbccd9e600cdb121
|
File details
Details for the file satrank-1.0.1-py3-none-any.whl.
File metadata
- Download URL: satrank-1.0.1-py3-none-any.whl
- Upload date:
- Size: 26.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.10.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
283de240f04557081e9b0926cce9f9771d7d901ceb6f25378ed0ba221248e23f
|
|
| MD5 |
173b2b9044e4cf9506569de58f06b774
|
|
| BLAKE2b-256 |
0ea4b532668b5a002a23b419be326260eea65340dba4a42b7c0b109bafbbcf6d
|