Skip to main content

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 name
  • get_service(id) — get service details
  • list_all_services() — list all services
  • get_agreement(id) — get agreement details
  • get_client_agreements(address) — agreements where address is client
  • get_provider_agreements(address) — agreements where address is provider
  • total_services() / total_agreements() / total_fees()

Write Methods (require private key)

  • list_service(agent_id, capability, price_usdc, metadata_uri) — list a service
  • create_agreement(provider, provider_agent_id, ...) — create escrowed agreement
  • confirm_completion(agreement_id) — release escrow
  • dispute(agreement_id) — dispute an agreement
  • hire(capability, amount_usdc, task_description) — find + hire in one call

Examples

See examples/ for LangChain integration and more.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

arc_commerce_sdk-0.1.0.tar.gz (36.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

arc_commerce_sdk-0.1.0-py3-none-any.whl (26.6 kB view details)

Uploaded Python 3

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

Hashes for arc_commerce_sdk-0.1.0.tar.gz
Algorithm Hash digest
SHA256 5dcf6d67382ecd5aca4bc1335cd7937d46ab1d08e35cb6ac1675c686c9242cf6
MD5 155f6e3304e44334edf619599392e665
BLAKE2b-256 ef86496983d03d362f1295b8fda21e3da8a7ecfa6ab7323e17e1919b70c9df67

See more details on using hashes here.

File details

Details for the file arc_commerce_sdk-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for arc_commerce_sdk-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1d4451abf72aa784c80c735f4662fd38be6ccdf2ccb459dc48bae3afb58a47cd
MD5 ff0e5c513db928e6aedfadc718120189
BLAKE2b-256 026fa01df464fdbb0ec24e4a313004e70c8089775b09da3ec6e1193ef65a4dfe

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page