Skip to content

Commit d1ab61a

Browse files
refactor: rename AgentCoin to AgentKoin
Renames the action provider, its directory, files, identifiers, README and changeset from AgentCoin to AgentKoin. The hosted service domain and wire-level identifiers keep their current names.
1 parent 3b87adf commit d1ab61a

10 files changed

Lines changed: 104 additions & 102 deletions

File tree

typescript/.changeset/brave-agentcoin-escrow.md renamed to typescript/.changeset/brave-agentkoin-escrow.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
"@coinbase/agentkit": patch
33
---
44

5-
Added AgentCoin action provider for escrowed agent-to-agent orders with delivery verdicts on Base Sepolia
5+
Added AgentKoin action provider for escrowed agent-to-agent orders with delivery verdicts on Base Sepolia

‎typescript/agentkit/README.md‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,11 @@ const agent = createAgent({
178178
</table>
179179
</details>
180180
<details>
181-
<summary><strong>AgentCoin</strong></summary>
181+
<summary><strong>AgentKoin</strong></summary>
182182
<table width="100%">
183183
<tr>
184184
<td width="200"><code>find_service</code></td>
185-
<td width="768">Searches the AgentCoin index of paid agent services (A2A, MCP, x402, ERC-8004) or fetches one listing (Base Sepolia testnet).</td>
185+
<td width="768">Searches the AgentKoin index of paid agent services (A2A, MCP, x402, ERC-8004) or fetches one listing (Base Sepolia testnet).</td>
186186
</tr>
187187
<tr>
188188
<td width="200"><code>route_task</code></td>
@@ -202,7 +202,7 @@ const agent = createAgent({
202202
</tr>
203203
<tr>
204204
<td width="200"><code>verify</code></td>
205-
<td width="768">Checks AgentCoin EIP-191 signatures on delivery scores and delivery records locally.</td>
205+
<td width="768">Checks AgentKoin EIP-191 signatures on delivery scores and delivery records locally.</td>
206206
</tr>
207207
<tr>
208208
<td width="200"><code>refund</code></td>

‎typescript/agentkit/src/action-providers/agentcoin/index.ts‎

Lines changed: 0 additions & 2 deletions
This file was deleted.

typescript/agentkit/src/action-providers/agentcoin/README.md renamed to typescript/agentkit/src/action-providers/agentkoin/README.md

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
1-
# AgentCoin Action Provider
1+
# AgentKoin Action Provider
22

3-
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.
3+
> AgentKoin was formerly named AgentCoin. The hosted service domain and some wire-level identifiers (`agentcoinhq.com`, `/.well-known/agentcoin-claim`) keep the old name for now.
44
5-
> **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
5+
This directory contains the **AgentKoinActionProvider** 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.
6+
7+
> **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 AgentKoin client libraries: https://github.com/stos-technologies/agentcoin
68
79
## Directory Structure
810

911
```
10-
agentcoin/
11-
├── agentcoinActionProvider.ts # Main provider
12-
├── agentcoinActionProvider.test.ts # Unit tests
12+
agentkoin/
13+
├── agentkoinActionProvider.ts # Main provider
14+
├── agentkoinActionProvider.test.ts # Unit tests
1315
├── constants.ts # Router URL, contract addresses and ABIs
1416
├── schemas.ts # Action schemas
1517
├── index.ts # Main exports
@@ -18,7 +20,7 @@ agentcoin/
1820

1921
## Actions
2022

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

@@ -28,16 +30,16 @@ agentcoin/
2830

2931
- `get_order`: Read an order's status, escrow job state, deliverable hash, verdict and signed delivery record
3032
- `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
31-
- `verify`: Check AgentCoin EIP-191 signatures locally (delivery scores and delivery records, RFC 8785 canonical JSON)
33+
- `verify`: Check AgentKoin EIP-191 signatures locally (delivery scores and delivery records, RFC 8785 canonical JSON)
3234
- `refund`: Send the JobEscrow refund-path call that applies to the job (`cancel`, `claimRefund`, `timeoutRelease` or `finalize`), after a simulation
3335

3436
## Configuration
3537

3638
```typescript
37-
import { agentcoinActionProvider } from "@coinbase/agentkit";
39+
import { agentkoinActionProvider } from "@coinbase/agentkit";
3840

39-
const provider = agentcoinActionProvider({
40-
baseUrl: "https://agentcoinhq.com", // optional, or set AGENTCOIN_URL
41+
const provider = agentkoinActionProvider({
42+
baseUrl: "https://agentcoinhq.com", // optional, or set AGENTKOIN_URL
4143
maxPayment: 50000n, // optional, USDC base units per order
4244
allowedServiceIds: ["svc_962928f654d2a8a1"], // optional allowlist for place_order
4345
});
@@ -52,5 +54,5 @@ Base Sepolia only (`base-sepolia`).
5254
## Notes
5355

5456
- 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.
55-
- Delivery scores exclude orders placed by the AgentCoin operator itself.
57+
- Delivery scores exclude orders placed by the AgentKoin operator itself.
5658
- For direct (non-escrow) x402 payments, use the `x402` action provider.

typescript/agentkit/src/action-providers/agentcoin/agentcoinActionProvider.test.ts renamed to typescript/agentkit/src/action-providers/agentkoin/agentkoinActionProvider.test.ts

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -8,19 +8,19 @@ import {
88
import { privateKeyToAccount } from "viem/accounts";
99
import { EvmWalletProvider } from "../../wallet-providers";
1010
import {
11-
agentcoinActionProvider,
12-
AgentCoinActionProvider,
11+
agentkoinActionProvider,
12+
AgentKoinActionProvider,
1313
canonicalJson,
14-
verifyAgentCoinSignature,
15-
} from "./agentcoinActionProvider";
14+
verifyAgentKoinSignature,
15+
} from "./agentkoinActionProvider";
1616
import {
1717
FindServiceSchema,
1818
PlaceOrderSchema,
1919
RefundSchema,
2020
RouteTaskSchema,
2121
VerifySchema,
2222
} from "./schemas";
23-
import { AGENTCOIN_ESCROW, AGENTCOIN_USDC, ERC20_APPROVE_ABI, ESCROW_ABI } from "./constants";
23+
import { AGENTKOIN_ESCROW, AGENTKOIN_USDC, ERC20_APPROVE_ABI, ESCROW_ABI } from "./constants";
2424

2525
const BUYER = "0x78e2C0164A80F3e337AE17e3bA4b8EA2C0Fa488e";
2626
const PROVIDER = "0x6A32bC3Bb5eA1dc814f14E29e6f026535129A84f";
@@ -43,8 +43,8 @@ const escrowOrder = (overrides: Record<string, unknown> = {}) => ({
4343
mode: "escrow",
4444
escrow: {
4545
chainId: 84532,
46-
contract: AGENTCOIN_ESCROW,
47-
token: AGENTCOIN_USDC,
46+
contract: AGENTKOIN_ESCROW,
47+
token: AGENTKOIN_USDC,
4848
amount: "10000",
4949
provider: PROVIDER,
5050
evaluator: EVALUATOR,
@@ -53,18 +53,18 @@ const escrowOrder = (overrides: Record<string, unknown> = {}) => ({
5353
{
5454
label: "approve",
5555
chainId: 84532,
56-
to: AGENTCOIN_USDC,
56+
to: AGENTKOIN_USDC,
5757
value: "0",
5858
data: encodeFunctionData({
5959
abi: ERC20_APPROVE_ABI,
6060
functionName: "approve",
61-
args: [AGENTCOIN_ESCROW, 10000n],
61+
args: [AGENTKOIN_ESCROW, 10000n],
6262
}),
6363
},
6464
{
6565
label: "createAndFundFor",
6666
chainId: 84532,
67-
to: AGENTCOIN_ESCROW,
67+
to: AGENTKOIN_ESCROW,
6868
value: "0",
6969
data: encodeFunctionData({
7070
abi: ESCROW_ABI,
@@ -78,7 +78,7 @@ const escrowOrder = (overrides: Record<string, unknown> = {}) => ({
7878
});
7979

8080
const jobCreatedLog = () => ({
81-
address: AGENTCOIN_ESCROW,
81+
address: AGENTKOIN_ESCROW,
8282
topics: encodeEventTopics({
8383
abi: ESCROW_ABI,
8484
eventName: "JobCreated",
@@ -96,7 +96,7 @@ const jobCreatedLog = () => ({
9696
),
9797
});
9898

99-
describe("AgentCoin schemas", () => {
99+
describe("AgentKoin schemas", () => {
100100
it("accepts a valid search", () => {
101101
expect(FindServiceSchema.safeParse({ q: "notary", maxPrice: "10000" }).success).toBe(true);
102102
});
@@ -130,7 +130,7 @@ describe("canonicalJson", () => {
130130
});
131131
});
132132

133-
describe("verifyAgentCoinSignature", () => {
133+
describe("verifyAgentKoinSignature", () => {
134134
const account = privateKeyToAccount(`0x${"11".repeat(32)}`);
135135

136136
const sign = async (doc: Record<string, unknown>) => {
@@ -143,30 +143,30 @@ describe("verifyAgentCoinSignature", () => {
143143
};
144144

145145
it("accepts a valid signature", async () => {
146-
const result = await verifyAgentCoinSignature(await sign({ v: "x", n: 1 }));
146+
const result = await verifyAgentKoinSignature(await sign({ v: "x", n: 1 }));
147147
expect(result.valid).toBe(true);
148148
expect(result.signer).toBe(account.address);
149149
expect(result.signerIsOperator).toBe(false);
150150
});
151151

152152
it("rejects a modified document", async () => {
153153
const doc = await sign({ v: "x", n: 1 });
154-
const result = await verifyAgentCoinSignature({ ...doc, n: 2 });
154+
const result = await verifyAgentKoinSignature({ ...doc, n: 2 });
155155
expect(result.valid).toBe(false);
156156
});
157157

158158
it("reports a missing signature", async () => {
159-
expect((await verifyAgentCoinSignature({ v: "x" })).valid).toBe(false);
159+
expect((await verifyAgentKoinSignature({ v: "x" })).valid).toBe(false);
160160
});
161161
});
162162

163-
describe("AgentCoinActionProvider", () => {
164-
let provider: AgentCoinActionProvider;
163+
describe("AgentKoinActionProvider", () => {
164+
let provider: AgentKoinActionProvider;
165165
let wallet: jest.Mocked<EvmWalletProvider>;
166166
let fetchMock: jest.SpyInstance;
167167

168168
beforeEach(() => {
169-
provider = agentcoinActionProvider({ baseUrl: "https://router.example/" });
169+
provider = agentkoinActionProvider({ baseUrl: "https://router.example/" });
170170
wallet = {
171171
getAddress: jest.fn().mockReturnValue(BUYER),
172172
getNetwork: jest
@@ -322,7 +322,7 @@ describe("AgentCoinActionProvider", () => {
322322
});
323323

324324
it("respects allowedServiceIds", async () => {
325-
const limited = agentcoinActionProvider({ allowedServiceIds: ["svc_a"] });
325+
const limited = agentkoinActionProvider({ allowedServiceIds: ["svc_a"] });
326326
const out = JSON.parse(await limited.placeOrder(wallet, { serviceId: "svc_b" }));
327327
expect(out.success).toBe(false);
328328
expect(fetchMock).not.toHaveBeenCalled();

0 commit comments

Comments
 (0)