Python SDK for Agent Commerce Protocol on Arc Network
Project description
arc-commerce-sdk
Python SDK for Agent Commerce Protocol — an ERC-8183 conditional sequencer on Arc.
Install
pip install arc-commerce-sdk
Quick Start — Pipeline (the primitive)
A pipeline is an ordered sequence of ERC-8183 jobs, atomically funded, conditionally halted.
from arc_commerce import ArcCommerce
import os
agent = ArcCommerce(private_key=os.environ["ARC_PRIVATE_KEY"])
pipeline_id = agent.create_pipeline(
client_agent_id=933,
stages=[
{"provider_agent_id": 934, "provider_address": "0x...", "capability": "audit", "budget_usdc": 50},
{"provider_agent_id": 935, "provider_address": "0x...", "capability": "deploy", "budget_usdc": 30},
],
currency="USDC",
deadline_hours=24,
)
# Inspect status — stages advance only on approval
pipeline = agent.get_pipeline(pipeline_id)
print(f"Pipeline #{pipeline_id}: {pipeline.status.name}, {pipeline.total_budget_usdc} USDC")
# Approve a completed stage; rejection halts and refunds unstarted stages
agent.approve_stage(pipeline.stages[0].job_id)
Marketplace operations (parallel, optional)
The SDK also wraps the v2 marketplace contracts shipped in src/marketplace/. These are independent of the pipeline primitive — use them only if you want a single-job hire flow.
client = ArcCommerce()
services = client.find_services("smart_contract_audit")
for s in services:
print(f"Agent #{s.agent_id}: {s.price_usdc} USDC")
API
Read Methods
find_services(capability)— find active services by capability nameget_service(id)— get service detailslist_all_services()— list all servicesget_agreement(id)— get agreement detailsget_client_agreements(address)— agreements where address is clientget_provider_agreements(address)— agreements where address is providertotal_services()/total_agreements()/total_fees()
Write Methods (require private key)
list_service(agent_id, capability, price_usdc, metadata_uri)— list a servicecreate_agreement(provider, provider_agent_id, ...)— create escrowed agreementconfirm_completion(agreement_id)— release escrowdispute(agreement_id)— dispute an agreementhire(capability, amount_usdc, task_description)— find + hire in one call
Examples
See examples/ for LangChain integration and more.
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 arc_commerce_sdk-0.1.0.tar.gz.
File metadata
- Download URL: arc_commerce_sdk-0.1.0.tar.gz
- Upload date:
- Size: 36.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5dcf6d67382ecd5aca4bc1335cd7937d46ab1d08e35cb6ac1675c686c9242cf6
|
|
| MD5 |
155f6e3304e44334edf619599392e665
|
|
| BLAKE2b-256 |
ef86496983d03d362f1295b8fda21e3da8a7ecfa6ab7323e17e1919b70c9df67
|
File details
Details for the file arc_commerce_sdk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: arc_commerce_sdk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 26.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1d4451abf72aa784c80c735f4662fd38be6ccdf2ccb459dc48bae3afb58a47cd
|
|
| MD5 |
ff0e5c513db928e6aedfadc718120189
|
|
| BLAKE2b-256 |
026fa01df464fdbb0ec24e4a313004e70c8089775b09da3ec6e1193ef65a4dfe
|