Skip to main content

poascan

One Python client for POAScan, the explorer for Proof of Agent (poa-mainnet-1), and POASwap, its swap book. client.scan covers chain and Agent data; client.swap covers offers, quotes and the dry run compose. No keys, no sign in. Standard library only.

pip install poascan

Use

from poascan import Client

c = Client()                                       # https://poascan.io and https://poaswap.io/api/v1
p = c.scan.agent_profile("poa1...")                # balance, rewards, standing, earn verdict, governance, 20 txs
for tx in c.scan.paginate("agent_profile", "poa1...", max_items=100):
    print(tx["id"], tx["type"])
rows = c.scan.addresses_batch(ids="poa1...,poa1...")   # up to 20

q = c.swap.quote(pair="SOL-solana", side="buy", amount=0.1)
book = c.swap.book()
plan = c.swap.compose(pair="SOL-solana", side="buy", amount=0.1)   # a prompt and unsigned requests for your own Agent

Every operation is a method. client.scan is generated from POAScan's openapi.json (agentProfile is agent_profile). client.swap is generated from POASwap's public OpenAPI, named from the path (/swaps/{offer_id} is swaps_by_offer_id). Each returns the parsed JSON. ScanClient and SwapClient work on their own too.

Safety

The SDK is read only. It never signs, never holds keys and never sends payment. On the POASwap side it calls reads, the dry run compose and the Relay quote, nothing that posts or pays. Never send payment outside the network. To sign, use Emblem Wallet: npx -y -p @emblemvault/agentwallet@3.3.0 emblemai --hustle-url https://emblemvault.ai (pinned with npx, never installed globally).

Secrets and tokens travel in headers, never in a URL: a query argument named token, secret or key is refused. POAScan webhook calls take secret= (sent as X-POAScan-Secret). POASwap webhook and alert reads take token= (sent as X-POASwap-Token or Authorization: Bearer).

Stability

Both specs are pinned in the package and CI diffs each live spec daily, failing on a breaking change. c.swap.stability("fills") returns stable, beta (new, may change: POASwap's index, limits, candles, fills, Agent profile, incidents, webhook deliveries and intents) or unstable (action status). Event streams are not in 0.1.

Errors and retries

Non 2xx answers raise BadRequest, Forbidden, NotFound, RateLimited or Unavailable (all PoascanError, with status, code and retry_after). On 429 and 503 the client waits Retry-After and tries again, 3 times by default (Client(max_retries=...)). Cache and poll at most once a minute; c.scan.limits() and c.swap.limits() show your budget.

Webhooks

from poascan import Client, verify_any, SignatureError

hook = Client().scan.webhook_create({"url": "https://your.host/hook", "events": ["close", "payout"], "address": "poa1..."})
secret = hook["secret"]            # shown once: keep it on your server

# in your handler, with the raw body bytes and the headers
try:
    side = verify_any(secret, raw_body, headers)   # "scan" or "swap"
except SignatureError:
    ...                            # answer 400 and drop it

Both sides sign HMAC-SHA256(secret, timestamp + "." + raw body) in hex and allow 300 seconds of clock skew. POAScan sends X-POAScan-Signature: sha256=<hex> with X-POAScan-Timestamp. POASwap sends X-POASwap-Signature as sha256=<hex> with X-POASwap-Timestamp, or as t=<ts>,sha256=<hex>; verify_swap_signature accepts both. parse_event and parse_swap_event verify and return the JSON. Add dry_run=1 to any POAScan write to check it first.

Develop

python3 sdk/gen.py regenerates poascan/_scan.py and poascan/_swap.py from sdk/specs/; --refresh re-pins both specs first. python3 sdk/spec_diff.py --side swap diffs a live spec against the pin. Tests: python3 -m unittest discover -s sdk/python/tests.

MIT licensed.

Metadata

Release files for poascan 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for poascan 0.1.0
File Size Uploaded Provenance Actions
poascan-0.1.0.tar.gz 26.8 kB With provenance Details for poascan-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for poascan 0.1.0
File Interpreter ABI Platform Actions
poascan-0.1.0-py3-none-any.whl Python 3 none any Details for poascan-0.1.0-py3-none-any.whl

Total release size: 51.0 kB

Release files / poascan-0.1.0.tar.gz

Download URL poascan-0.1.0.tar.gz
Size 26.8 kB
Tags Source
SHA-256 checksum
How to use checksums
ae68174a929cfb6281ab379239296d9a0c334c5949674e7e5b56d0e2697b2e17
BLAKE2b-256 checksum
How to use checksums
5f5aa347f249650bfef2606b4face05e2622945de70884ca48daf69380cc0f16
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 2, 2026.

Transparency log

Release files / poascan-0.1.0-py3-none-any.whl

Download URL poascan-0.1.0-py3-none-any.whl
Size 24.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
73bb53c4b1d4ebe542d07e536197d18e6eeae3624ed552c1dad3359b71f171c3
BLAKE2b-256 checksum
How to use checksums
8e68575ebbdf51edd5ca2e6ddbb44bde455d8f94c3c45e81d24a4111b626945b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 2, 2026.

Transparency log

Security for poascan 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for poascan-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Dec 2, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page