Expand description
§ERC-8183: Agentic Commerce Protocol Rust SDK
A type-safe, ergonomic Rust SDK for interacting with ERC-8183 on-chain contracts.
ERC-8183 defines the Agentic Commerce Protocol: a job with escrowed
budget, six states (Open → Funded → Submitted → Completed | Rejected | Expired),
and an evaluator who alone may mark the job completed. The client funds
the job; the provider submits work; the evaluator attests completion or
rejection.
§Quick Start
use alloy::primitives::{Address, U256};
use alloy::providers::ProviderBuilder;
use erc8183::{Erc8183, Network, types::CreateJobParams};
// 1. Connect using the built-in RPC URL
let network = Network::MonadMainnet;
let provider = ProviderBuilder::new()
.connect_http(network.rpc_url().parse()?);
// 2. Create client and get a job handle
let client = Erc8183::new(provider).with_network(network);
let job = client.job()?;
// 3. Create a job (requires signer-enabled provider)
let params = CreateJobParams::new(
Address::ZERO, // deferred provider
"0xEvaluator...".parse()?, // evaluator
U256::from(1_700_000_000u64), // expiredAt
"Build a REST API", // description
);
let job_id = job.create_job(params).await?;
// 4. Query job data
let data = job.get_job(job_id).await?;
println!("{data}"); // "Job #1 [Open] budget=0 client=0x... provider=0x..."§Architecture
The SDK is designed around the alloy provider abstraction:
Erc8183— The top-level client, generic overP: Provider. Accepts any alloy provider the user has already configured. Usewith_networkfor built-in deployments orwith_addressfor custom contracts.JobHandle— Job lifecycle + view + admin. Core operations use the standardIERC8183binding (portable); view/admin useAgenticCommerce.Network— Pre-configured addresses for live deployments.types— Domain types:JobStatus,Job,CreateJobParams, etc.contracts— Three-layersol!bindings:IERC8183(standard, portable),AgenticCommerce(QNTX implementation),IACPHook(hook interface).hooks— Hook selector constants matchingBaseACPHook.
Re-exports§
Modules§
- client
- The top-level
Erc8183client for interacting with the Agentic Commerce Protocol. - contracts
- Contract bindings for the ERC-8183 Agentic Commerce Protocol.
- error
- Typed error definitions for the ERC-8183 SDK.
- hooks
- Hook development helpers for the ERC-8183 Agentic Commerce Protocol.
- job
- Job operations for the Agentic Commerce Protocol.
- networks
- Pre-configured network definitions with known contract addresses.
- types
- Core domain types for the ERC-8183 SDK.