Skip to content
Open
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
feat: add AgentCoin action provider
Adds agentcoinActionProvider (find_service, route_task, place_order, get_order, claim_listing, verify, refund) for escrowed agent-to-agent orders with delivery verdicts on Base Sepolia. Includes static zod schemas, unit tests, README and a changeset.
  • Loading branch information
kemppelinvestments-del authored Nov 12, 2026
commit 3b87adf8ff232da81fa69bc30895dddca90134cc
5 changes: 5 additions & 0 deletions typescript/.changeset/brave-agentcoin-escrow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@coinbase/agentkit": patch
---

Added AgentCoin action provider for escrowed agent-to-agent orders with delivery verdicts on Base Sepolia
33 changes: 33 additions & 0 deletions typescript/agentkit/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,39 @@ const agent = createAgent({
</table>
</details>
<details>
<summary><strong>AgentCoin</strong></summary>
<table width="100%">
<tr>
<td width="200"><code>find_service</code></td>
<td width="768">Searches the AgentCoin index of paid agent services (A2A, MCP, x402, ERC-8004) or fetches one listing (Base Sepolia testnet).</td>
</tr>
<tr>
<td width="200"><code>route_task</code></td>
<td width="768">Ranks candidate sellers for a task and budget, with quote, request template and delivery score.</td>
</tr>
<tr>
<td width="200"><code>place_order</code></td>
<td width="768">Places an escrowed order and funds it from the wallet; funds are released only on a staked evaluator's delivery verdict.</td>
</tr>
<tr>
<td width="200"><code>get_order</code></td>
<td width="768">Returns an order's status, escrow job state, verdict and signed delivery record.</td>
</tr>
<tr>
<td width="200"><code>claim_listing</code></td>
<td width="768">Seller side: indexes a metadata URL and claims a listing with an EIP-712 signature or well-known file.</td>
</tr>
<tr>
<td width="200"><code>verify</code></td>
<td width="768">Checks AgentCoin EIP-191 signatures on delivery scores and delivery records locally.</td>
</tr>
<tr>
<td width="200"><code>refund</code></td>
<td width="768">Sends the escrow refund-path call that applies to a job (cancel, claimRefund, timeoutRelease or finalize).</td>
</tr>
</table>
</details>
<details>
<summary><strong>Base Account</strong></summary>
<table width="100%">
<tr>
Expand Down
56 changes: 56 additions & 0 deletions typescript/agentkit/src/action-providers/agentcoin/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# AgentCoin Action Provider

This directory contains the **AgentCoinActionProvider** implementation, which lets an agent find paid agent services, pay them through an escrow that releases funds only on a staked evaluator's delivery verdict, and claim refunds.

> **Testnet only.** The provider supports **Base Sepolia** (`eip155:84532`) and test USDC (`0x036CbD53842c5426634e7929541eC2318f3dCF7e`). The hosted router at https://agentcoinhq.com is an early testnet deployment; payments have no real value. Source for the AgentCoin client libraries: https://github.com/stos-technologies/agentcoin

## Directory Structure

```
agentcoin/
├── agentcoinActionProvider.ts # Main provider
├── agentcoinActionProvider.test.ts # Unit tests
├── constants.ts # Router URL, contract addresses and ABIs
├── schemas.ts # Action schemas
├── index.ts # Main exports
└── README.md # This file
```

## Actions

- `find_service`: Search the AgentCoin index of paid agent services (A2A, MCP, x402, ERC-8004), or fetch one listing by id
- `route_task`: Rank candidate sellers for a task and budget (quote, request template, delivery score). No payment
- `place_order`: Place an escrowed order and fund it from the wallet

- Checks the router's unsigned transactions against local constants (USDC, JobEscrow, chain, amount, buyer) before signing
- Sends `USDC.approve` and `JobEscrow.createAndFundFor`, records the job with the router and calls the seller
- The amount is capped by `maxPayment` (default 50000 base units = 0.05 test USDC)

- `get_order`: Read an order's status, escrow job state, deliverable hash, verdict and signed delivery record
- `claim_listing`: Seller side. Index a metadata URL and/or claim a listing with an EIP-712 signature or a `/.well-known/agentcoin-claim` file
- `verify`: Check AgentCoin EIP-191 signatures locally (delivery scores and delivery records, RFC 8785 canonical JSON)
- `refund`: Send the JobEscrow refund-path call that applies to the job (`cancel`, `claimRefund`, `timeoutRelease` or `finalize`), after a simulation

## Configuration

```typescript
import { agentcoinActionProvider } from "@coinbase/agentkit";

const provider = agentcoinActionProvider({
baseUrl: "https://agentcoinhq.com", // optional, or set AGENTCOIN_URL
maxPayment: 50000n, // optional, USDC base units per order
allowedServiceIds: ["svc_962928f654d2a8a1"], // optional allowlist for place_order
});
```

No API key is needed. Signing and transactions use the agent's `EvmWalletProvider`.

## Network Support

Base Sepolia only (`base-sepolia`).

## Notes

- Escrow flow: funds sit in JobEscrow until a staked evaluator rules. A "delivered" verdict pays the seller; "not delivered", or no verdict before the deadline, refunds the buyer. A challenged verdict that is overturned slashes the evaluator's stake.
- Delivery scores exclude orders placed by the AgentCoin operator itself.
- For direct (non-escrow) x402 payments, use the `x402` action provider.
Loading
Loading