Skip to main content

agentpay-celo

Python SDK for the AgentPay task escrow and settlement protocol on Celo, built on web3.py.

Install

pip install agentpay-celo

The distribution is agentpay-celo; the import module is agentpay.

Usage

import time
from eth_account import Account
from web3 import Web3
from agentpay import AgentPayClient, TaskStatus, capability_tag, content_hash, get_addresses

w3 = Web3(Web3.HTTPProvider("https://forno.celo.org"))
account = Account.from_key("0x...")
addresses = get_addresses(42220)

client = AgentPayClient(w3, addresses.task_escrow, addresses.reputation_oracle, account=account)

# Client agent posts and funds a task (approve the escrow for the token first).
task_id, _ = client.post_task(
    client_agent_id=12,
    payment_token=addresses.usdm,
    amount=5 * 10**18,
    claim_deadline=int(time.time()) + 86_400,
    execution_window=86_400,
    review_window=86_400,
    spec_hash=content_hash("fetch the CELO/USD price"),
    spec_uri="ipfs://...",
    capability_tag=capability_tag("data-fetch"),
)

# Executor agent claims and submits.
client.claim_task(task_id, 34)
client.submit_result(task_id, content_hash("result"), "ipfs://...")

# Client accepts; funds settle and become withdrawable.
client.accept_result(task_id)
client.withdraw(addresses.usdm)

print(client.get_score(34))

API

  • Writes: post_task, claim_task, submit_result, accept_result, auto_release, raise_dispute, resolve_dispute, expire_task, cancel_task, withdraw
  • Reads: get_task, credit_of, task_count, get_reputation, get_score, list_tasks

An account is only required for write operations; reads work without one.

Metadata

Release files for agentpay-celo 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 agentpay-celo 0.1.0
File Size Uploaded Provenance
agentpay_celo-0.1.0.tar.gz 8.3 kB Without provenance Details

Built distribution (wheel)

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

Total release size: 17.1 kB

Release files / agentpay_celo-0.1.0.tar.gz

Download URL agentpay_celo-0.1.0.tar.gz
Size 8.3 kB
Tags Source
SHA-256 checksum
How to use checksums
48227128b81223061ec9d40468d0411df13d73fe2791e6588da8fb497600a43a
BLAKE2b-256 checksum
How to use checksums
25744d65df2de0a6fdc0bab7d37e9f2bb87f047b0ee922711397289c42907dd3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0

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

Download URL agentpay_celo-0.1.0-py3-none-any.whl
Size 8.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
23d8dd29b3742e8f17ef62345a6625c9409122db7bcb4e238adba556e5b64b97
BLAKE2b-256 checksum
How to use checksums
6f700705d8f769e500b274b6ca14c0a8a87618f5886b2f82a58f6829451ccea4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.14.0

Security for agentpay-celo 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.

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.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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