agent-notary SDK
Asyncio-native Python SDK for the A&O Trust Layer Notary API.
Install
pip install agent-notary
Quickstart
import asyncio
from agent_notary import NotaryClient, NotarizeRequest
async def main():
client = NotaryClient(
api_key="your-api-key",
base_url="https://api.aotrust.link/v1"
)
# Submit notarization
req = NotarizeRequest(
tx_hash="EzrfDW5b...",
work_hash="599d6999...",
agent_sig="base64_sig_A...",
agent_pubkey="aff91a18...",
)
result = await client.notarize(req)
print(f"Job: {result.job_id}")
# Poll for PDR
status = await client.wait_for_pdr(result.job_id, timeout=60)
if status.is_anchored:
pdr = await client.get_pdr(result.job_id)
assert pdr.verify(client.notary_pubkey)
print("PDR Valid: YES")
asyncio.run(main())
Configuration
| Env Var | Constructor Arg | Description |
|---|---|---|
NOTARY_API_KEY |
api_key |
API key for auth |
NOTARY_API_URL |
base_url |
API base URL |
NOTARY_PUBKEY |
notary_pubkey |
Notary Ed25519 public key (hex) |
Endpoints
| Method | Path | Description |
|---|---|---|
| POST | /v1/notarize |
Submit notarization |
| GET | /v1/status/{job_id} |
Poll job status |
| GET | /v1/pdr/{job_id} |
Get PDR |
| POST | /v1/notarize/quote |
Get price quote |
| GET | /.well-known/agent.json |
MCP Server Card |
| GET | /openapi.json |
OpenAPI 3.0 spec |
PDR Verification
pdr = await client.get_pdr(job_id)
is_valid = pdr.verify(notary_pubkey_hex="9c7d64bb...")
Uses NEP-413 raw-buffer verification. No SHA256 pre-hash.
Error Handling
from agent_notary.exceptions import NotaryAuthError, NotaryPaymentError, NotaryNotFoundError
try:
result = await client.notarize(req)
except NotaryAuthError:
print("Invalid API key")
except NotaryPaymentError as e:
print(f"Payment/sig failed: {e}")
Development
pip install -e ".[dev]"
pytest tests/ -v
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
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 aotrust_protocol-2.2.0-py3-none-any.whl.
File metadata
- Download URL: aotrust_protocol-2.2.0-py3-none-any.whl
- Upload date:
- Size: 7.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
twine/7.0.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d11b811fcefb76908adae62e9d1bdc210bce5a813d8dfdd448f869c8c62bef0d
|
|
| MD5 |
d066b4cfa59e334c971cae1287042d8f
|
|
| BLAKE2b-256 |
2305487baa87bbd71085fac55c4b0f8425ce1a5de7f8e11fcf049c08048399ae
|