Skip to main content

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 (needs satrank[nwc]).
  • LnurlWallet — LNbits-style HTTP wallets.

See docs/sdk/wallet-drivers.md in the repo.

Documentation

License

MIT.

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

satrank-1.0.0.tar.gz (29.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

satrank-1.0.0-py3-none-any.whl (26.7 kB view details)

Uploaded Python 3

File details

Details for the file satrank-1.0.0.tar.gz.

File metadata

  • Download URL: satrank-1.0.0.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

Hashes for satrank-1.0.0.tar.gz
Algorithm Hash digest
SHA256 6b43972d32ba5d12ff3293e93e86571f679ec9b0228b20a3a772db30575afcb2
MD5 ae6233f8aa4dec6dc6e46aa83d563996
BLAKE2b-256 8b8f76b9bd23c779861f0732fd79acf0c5308e0810aca275032433d6146c35cc

See more details on using hashes here.

File details

Details for the file satrank-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: satrank-1.0.0-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

Hashes for satrank-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1c9378440db8f43bf96a39b6f30821e778ce86ff4f568045acc273f7e7bb8d41
MD5 8cdaec70f25e56c4656d945fcc0cd4c8
BLAKE2b-256 e5503f82ee8813d72e16af8295fa6b76bb4e812773e1a81d283217e08bc551a5

See more details on using hashes here.

Supported by

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