Python reference SDK for the Ergo rail of Accord Protocol — agent payments, Note operations, LangChain / OpenAI integrations. Mirrors the legacy npm package of the same name; the canonical Python Accord layer will publish later under a different PyPI name.
Project description
ergo-agent-pay (Python)
Python reference SDK for the Ergo rail of Accord Protocol. Agent payments, Note operations, balance + UTxO inspection, LangChain / OpenAI integrations.
The package keeps its legacy npm-mirror name. A canonical Python Accord layer (port of @accord-protocol/core) is not yet published; when it is, it will live under a different PyPI name and import from this package as a rail dependency.
Zero required dependencies — uses Python standard library only.
pip install ergo-agent-pay
Quick start
from ergo_agent_pay import ErgoAgentPay
agent = ErgoAgentPay(address="YOUR_ADDRESS", network="testnet")
# Check balance
balance = agent.get_balance()
print(f"Balance: {balance['ergs']} ERG")
# Inspect a Note
note = agent.check_note("abc123...")
print(f"Note value: {note.value_erg} ERG")
print(f"Expired: {note.is_expired}")
print(f"Task hash: {note.task_hash}")
# Compute task hash for acceptance predicate
task_hash = ErgoAgentPay.compute_task_hash("task output here")
LangChain integration
from ergo_agent_pay import ErgoAgentPay
agent = ErgoAgentPay(address="YOUR_ADDRESS", network="testnet")
tool = agent.as_langchain_tool(server_url="http://localhost:3000")
# Use in any LangChain agent
from langchain.agents import AgentExecutor
tools = [tool]
OpenAI function calling
definition = agent.as_openai_function()
response = openai.chat.completions.create(
model="gpt-4o",
messages=[{"role": "user", "content": "Pay 0.001 ERG to <address>"}],
tools=[{"type": "function", "function": definition}],
)
Transaction building
Python doesn't have a Fleet SDK equivalent. For full transaction building, use:
- TypeScript SDK (recommended): run
ergo-agent-payTypeScript server, call via HTTP - ergpy:
pip install ergpy— AppKit JVM wrapper - sigma-rust: Python bindings for Rust-based TX builder
See example 06 for the HTTP delegation pattern.
Note lifecycle — what Python can do
| Operation | Python | TypeScript |
|---|---|---|
| Get balance | ✅ | ✅ |
| Get UTxOs | ✅ | ✅ |
| Check note (decode registers) | ✅ | ✅ |
| Compute task hash | ✅ (BLAKE2b-256) | ✅ (BLAKE2b-256) |
| LangChain tool | ✅ | ✅ |
| OpenAI function | ✅ | ✅ |
| Build TX (issueNote, pay) | Via HTTP server | ✅ native |
| Sign TX | External | ✅ signer fn |
| Submit TX | ✅ | ✅ |
API reference
Full API reference: docs/api-reference.md
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 ergo_agent_pay-0.3.0.tar.gz.
File metadata
- Download URL: ergo_agent_pay-0.3.0.tar.gz
- Upload date:
- Size: 14.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
851d7d3a39a8ea5a76409a07d137137bd7f5a2c6006512c5d079835e1f9619ef
|
|
| MD5 |
92962a035391a4c0f20ab96acb154042
|
|
| BLAKE2b-256 |
e816afddcb336d66ab792a702cf373b0a0c4de10e3e108dcd9c8f4e72883f8a5
|
Provenance
The following attestation bundles were made for ergo_agent_pay-0.3.0.tar.gz:
Publisher:
publish-pypi.yml on accord-protocol/accord-protocol
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ergo_agent_pay-0.3.0.tar.gz -
Subject digest:
851d7d3a39a8ea5a76409a07d137137bd7f5a2c6006512c5d079835e1f9619ef - Sigstore transparency entry: 1538936277
- Sigstore integration time:
-
Permalink:
accord-protocol/accord-protocol@e447916cd5744a3cc842f77fa54624a3cc305117 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/accord-protocol
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@e447916cd5744a3cc842f77fa54624a3cc305117 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file ergo_agent_pay-0.3.0-py3-none-any.whl.
File metadata
- Download URL: ergo_agent_pay-0.3.0-py3-none-any.whl
- Upload date:
- Size: 11.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fede9bd197ef7550ee2bf0a21eb0cf0d3b10f8cde80f770e68910f439b893982
|
|
| MD5 |
29b3d6e6a0b4cfff475e68435285ec32
|
|
| BLAKE2b-256 |
8afb21e8cc9b49366c06a46d84ddb8655ff1de9bc7912a375845b101d54bb794
|
Provenance
The following attestation bundles were made for ergo_agent_pay-0.3.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on accord-protocol/accord-protocol
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ergo_agent_pay-0.3.0-py3-none-any.whl -
Subject digest:
fede9bd197ef7550ee2bf0a21eb0cf0d3b10f8cde80f770e68910f439b893982 - Sigstore transparency entry: 1538936363
- Sigstore integration time:
-
Permalink:
accord-protocol/accord-protocol@e447916cd5744a3cc842f77fa54624a3cc305117 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/accord-protocol
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@e447916cd5744a3cc842f77fa54624a3cc305117 -
Trigger Event:
workflow_dispatch
-
Statement type: