polypad-agent (Python)
Thin typed client for the Polypad agent API (MCP) on Robinhood Chain. Version 2.0.1, matching the
server. Published on PyPI: pip install polypad-agent.
Install
pip install polypad-agent
Connect once
from polypad_agent import PolypadClient
client = PolypadClient()
# Show the user this URL: they connect their wallet, sign one message, and get a token.
print(client.connect_url(return_url="https://example.com/agent/done"))
# Store the token as POLYPAD_WALLET_TOKEN. The client reads it automatically.
Quickstart
from polypad_agent import PolypadClient
client = PolypadClient() # reads POLYPAD_WALLET_TOKEN
print(client.list_tokens(sort="new", limit=5))
print(client.quote_trade(token="POLYDASH", side="buy", amountEth="0.01"))
mint = client.prepare_fund_mint(fund="0x7c1d31629ac68aebe83f230edbc7eacfc26285ef", quantity=1)
print(mint["signing"]["url"]) # the user opens this and signs
The loop
# Chat agent: prepare, show the link, wait for the hash, poll until confirmed.
done = client.prepare_sign_confirm(
"polypad_prepare_fund_mint",
{"fund": "0x7c1d31629ac68aebe83f230edbc7eacfc26285ef", "quantity": 1},
on_signing_link=lambda url, summary: print(summary["headline"], url),
get_tx_hash=read_hash_from_return_callback,
return_url="https://example.com/agent/done",
)
print(done["status"], done["tx_hash"], done["result"])
# Script with its own wallet (the Forge path): prepare, sign, broadcast, confirm.
launched = client.prepare_sign_broadcast(
"polypad_prepare_token_launch",
{"name": "Agent Swarm", "symbol": "SWARM", "creatorFeeBps": 100, "devBuyEth": "0"},
private_key=os.environ["LAUNCHER_PRIVATE_KEY"],
)
print(launched["status"], launched["tx_hash"])
Pay-per-call
from polypad_agent import pay_for_report
report = pay_for_report(
"token-report",
"address=0x3Da9244DDE38284017fD15e45d1Fdf66D3617B4B",
private_key=os.environ["PAYER_PRIVATE_KEY"],
)
Recipes
examples/launch_token.py— launch a token from a script, then create its staking pool.examples/run_fund.py— create a tokenized fund, then mint the manager's skin shares.examples/smoke.py— read-only live smoke test (initialize, tools/list, stats).
More in the package
confirm/sign_and_send/sign_send_and_confirm— the standalone sign-loop helpers (confirmpollspolypad_get_tx_statusuntil the transaction confirms or fails).sign_x402_payment/fetch_with_x402/product_url/next_permit2_nonce— x402 building blocks for USDG (EIP-3009) and POLYDASH (Permit2) payments.build_create_key_tx/build_deposit_tx/build_withdraw_tx/build_revoke_key_tx/get_key_status/get_vault_balance— SpendVault spending keys.TOOL_NAMES/PREPARE_TOOLS/is_prepare_tool,RATE_LIMITS,ACTION_LIMITS,ERROR_MEANINGS— the 21 tools, the published limits, and the server's error meanings.
Tests
PYTHONPATH=src python -m unittest discover -s tests -v # 44 tests (mocked transport, no network)
Per-call from still works: pass it explicitly and the client leaves the token out for that call.
Contracts are unaudited.
Metadata
Release files for polypad-agent 2.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| polypad_agent-2.0.1.tar.gz | 28.7 kB | Without provenance | Details for polypad_agent-2.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| polypad_agent-2.0.1-py3-none-any.whl | Python 3 | none | any | Details for polypad_agent-2.0.1-py3-none-any.whl |
Total release size: 54.4 kB
Release files / polypad_agent-2.0.1.tar.gz
| Download URL | polypad_agent-2.0.1.tar.gz |
|---|---|
| Size | 28.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ce17bb8c316a49cbf4a41d453aa4ba040000d8f96523ab76efbe585e1a94f341
|
|
BLAKE2b-256 checksum How to use checksums |
d32dcdebb3a506743015cccb58a1aac80c3c033b30f2bd86e17b28887b48ff72
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Release files / polypad_agent-2.0.1-py3-none-any.whl
| Download URL | polypad_agent-2.0.1-py3-none-any.whl |
|---|---|
| Size | 25.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
999e161d4f17985c4983e2c4c35ddba92a6efcfb0a2a251466101eec541cc3df
|
|
BLAKE2b-256 checksum How to use checksums |
6f642a348e218d001971d7f6c445c0a277b4d914025c9f177e0ba583df5d8957
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.3
|
Security for polypad-agent 2.0.1
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.