@agentpos/rail-arc 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +76 -76
  2. package/package.json +12 -13
package/README.md CHANGED
@@ -1,76 +1,76 @@
1
- # @agentpos/rail-arc
2
-
3
- AgentPOS payment rail for **Arc**, Circle's L1: x402 checkout in USDC, settled by the **Circle
4
- Facilitator Service** straight to the merchant's own Arc wallet. AgentPOS never holds funds or
5
- keys and takes no commission; the merchant stays the merchant of record.
6
-
7
- It plugs into the open-source AgentPOS core
8
- ([`@agentpos/core`](https://www.npmjs.com/package/@agentpos/core),
9
- [NovaCorpAI/agentpos](https://github.com/NovaCorpAI/agentpos)), which turns an existing store
10
- (WooCommerce today) into one AI agents can buy from.
11
-
12
- > **Testnet only for now.** Arc mainnet (`eip155:5042`) is defined here but stays locked in the
13
- > core until the Arc production gate passes. Use Arc testnet (`eip155:5042002`).
14
-
15
- ## Install
16
-
17
- ```bash
18
- npm install @agentpos/core @agentpos/rail-arc
19
- ```
20
-
21
- Importing the package registers both Arc networks with the core (pricing, address validation,
22
- wallet linking). Node >= 22.5.
23
-
24
- ## Store side: offer Arc in the 402
25
-
26
- ```ts
27
- import { createAgentPOSApp } from "@agentpos/site";
28
- import { ARC_TESTNET, arcStoreNetwork } from "@agentpos/rail-arc";
29
-
30
- const app = createAgentPOSApp({
31
- // ...site, core, connector, storage
32
- x402Networks: [
33
- arcStoreNetwork(ARC_TESTNET, "0xMerchantArcWallet", {
34
- url: process.env.AGENTPOS_ARC_FACILITATOR_URL!, // https://api.circle.com/v1/facilitator/x402
35
- apiKey: process.env.AGENTPOS_ARC_FACILITATOR_API_KEY_TESTNET!, // console.circle.com
36
- }),
37
- ],
38
- });
39
- ```
40
-
41
- The store keeps its own network and adds Arc next to it. The order is created only after the
42
- facilitator settles, idempotent by transaction hash. `arcStoreNetwork` also brings a read-only
43
- payment watcher that alerts on any USDC that reached the merchant's wallet without an order.
44
-
45
- ## Buyer side: pay on Arc under the human's mandate
46
-
47
- ```ts
48
- import { BuyerService } from "@agentpos/mcp-buyer";
49
- import { ARC_TESTNET, arcBuyerNetwork } from "@agentpos/rail-arc";
50
-
51
- // mandate: { "maxPerTx": "15", "maxTotal": "20", "allowedNetworks": ["eip155:5042002"] }
52
- const buyer = new BuyerService({ profile, networks: [arcBuyerNetwork(ARC_TESTNET, account)] });
53
- ```
54
-
55
- The agent pays on Arc only when the mandate lists it, each payment is capped at the cart total
56
- converted exactly to Arc's 6-decimal USDC (a price Arc cannot represent is refused, never
57
- rounded), and the period limit adds up spending across every network.
58
-
59
- ## What else is exported
60
-
61
- - `ARC_MAINNET`, `ARC_TESTNET`, `registerArcNetworks()`: the networks and their USDC.
62
- - `registerArcWalletProof()`: lets a merchant link an Arc wallet by signing a challenge
63
- (EIP-191, ERC-1271 for smart accounts). No key ever reaches AgentPOS.
64
- - `arcResourceExtension`, `arcAccept`: lower-level x402 wiring for a custom server.
65
- - `createArcPaymentWatcher`: the reconciliation reader on its own.
66
-
67
- ## Evidence
68
-
69
- Real purchases on Arc testnet through the Circle Facilitator Service, with the order created in
70
- WooCommerce only after settlement, are listed with their transaction hashes in the
71
- [repository README](https://github.com/NovaCorpAI/agentpos-arc#readme). A purchase also runs
72
- once a day in CI.
73
-
74
- ## License
75
-
76
- Apache-2.0. Built by NovaCorpAI SpA, Santiago, Chile.
1
+ # @agentpos/rail-arc
2
+
3
+ AgentPOS payment rail for **Arc**, Circle's L1: x402 checkout in USDC, settled by the **Circle
4
+ Facilitator Service** straight to the merchant's own Arc wallet. AgentPOS never holds funds or
5
+ keys and takes no commission; the merchant stays the merchant of record.
6
+
7
+ It plugs into the open-source AgentPOS core
8
+ ([`@agentpos/core`](https://www.npmjs.com/package/@agentpos/core),
9
+ [NovaCorpAI/agentpos](https://github.com/NovaCorpAI/agentpos)), which turns an existing store
10
+ (WooCommerce today) into one AI agents can buy from.
11
+
12
+ > **Testnet only for now.** Arc mainnet (`eip155:5042`) is defined here but stays locked in the
13
+ > core until the Arc production gate passes. Use Arc testnet (`eip155:5042002`).
14
+
15
+ ## Install
16
+
17
+ ```bash
18
+ npm install @agentpos/core @agentpos/rail-arc
19
+ ```
20
+
21
+ Importing the package registers both Arc networks with the core (pricing, address validation,
22
+ wallet linking). Node >= 22.5.
23
+
24
+ ## Store side: offer Arc in the 402
25
+
26
+ ```ts
27
+ import { createAgentPOSApp } from "@agentpos/site";
28
+ import { ARC_TESTNET, arcStoreNetwork } from "@agentpos/rail-arc";
29
+
30
+ const app = createAgentPOSApp({
31
+ // ...site, core, connector, storage
32
+ x402Networks: [
33
+ arcStoreNetwork(ARC_TESTNET, "0xMerchantArcWallet", {
34
+ url: process.env.AGENTPOS_ARC_FACILITATOR_URL!, // https://api.circle.com/v1/facilitator/x402
35
+ apiKey: process.env.AGENTPOS_ARC_FACILITATOR_API_KEY_TESTNET!, // console.circle.com
36
+ }),
37
+ ],
38
+ });
39
+ ```
40
+
41
+ The store keeps its own network and adds Arc next to it. The order is created only after the
42
+ facilitator settles, idempotent by transaction hash. `arcStoreNetwork` also brings a read-only
43
+ payment watcher that alerts on any USDC that reached the merchant's wallet without an order.
44
+
45
+ ## Buyer side: pay on Arc under the human's mandate
46
+
47
+ ```ts
48
+ import { BuyerService } from "@agentpos/mcp-buyer";
49
+ import { ARC_TESTNET, arcBuyerNetwork } from "@agentpos/rail-arc";
50
+
51
+ // mandate: { "maxPerTx": "15", "maxTotal": "20", "allowedNetworks": ["eip155:5042002"] }
52
+ const buyer = new BuyerService({ profile, networks: [arcBuyerNetwork(ARC_TESTNET, account)] });
53
+ ```
54
+
55
+ The agent pays on Arc only when the mandate lists it, each payment is capped at the cart total
56
+ converted exactly to Arc's 6-decimal USDC (a price Arc cannot represent is refused, never
57
+ rounded), and the period limit adds up spending across every network.
58
+
59
+ ## What else is exported
60
+
61
+ - `ARC_MAINNET`, `ARC_TESTNET`, `registerArcNetworks()`: the networks and their USDC.
62
+ - `registerArcWalletProof()`: lets a merchant link an Arc wallet by signing a challenge
63
+ (EIP-191, ERC-1271 for smart accounts). No key ever reaches AgentPOS.
64
+ - `arcResourceExtension`, `arcAccept`: lower-level x402 wiring for a custom server.
65
+ - `createArcPaymentWatcher`: the reconciliation reader on its own.
66
+
67
+ ## Evidence
68
+
69
+ Real purchases on Arc testnet through the Circle Facilitator Service, with the order created in
70
+ WooCommerce only after settlement, are listed with their transaction hashes in the
71
+ [repository README](https://github.com/NovaCorpAI/agentpos-arc#readme). A purchase also runs
72
+ once a day in CI.
73
+
74
+ ## License
75
+
76
+ Apache-2.0. Built by NovaCorpAI SpA, Santiago, Chile.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agentpos/rail-arc",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "AgentPOS payment rail for Arc: x402 checkout in USDC on Circle's Arc network, settled by the Circle Facilitator Service straight to the merchant's wallet.",
5
5
  "license": "Apache-2.0",
6
6
  "homepage": "https://agentposhq.com",
@@ -37,17 +37,6 @@
37
37
  "engines": {
38
38
  "node": ">=22.5"
39
39
  },
40
- "scripts": {
41
- "build": "tsc -p tsconfig.json",
42
- "typecheck": "tsc -p tsconfig.typecheck.json",
43
- "test": "vitest run",
44
- "lint": "eslint src",
45
- "e2e:arc-testnet": "tsx scripts/e2e-arc-testnet.ts",
46
- "e2e:arc-woo": "tsx scripts/e2e-arc-woo.ts",
47
- "e2e:arc-buyer": "tsx scripts/e2e-arc-buyer.ts",
48
- "ci:wallet": "tsx scripts/ci-wallet.ts",
49
- "buy:arc": "tsx scripts/buy-on-arc.ts"
50
- },
51
40
  "dependencies": {
52
41
  "@agentpos/core": "^0.1.5",
53
42
  "@x402/core": "2.28.0",
@@ -69,5 +58,15 @@
69
58
  "publishConfig": {
70
59
  "access": "public",
71
60
  "provenance": true
61
+ },
62
+ "scripts": {
63
+ "build": "tsc -p tsconfig.json",
64
+ "typecheck": "tsc -p tsconfig.typecheck.json",
65
+ "test": "vitest run",
66
+ "lint": "eslint src",
67
+ "e2e:arc-testnet": "tsx scripts/e2e-arc-testnet.ts",
68
+ "e2e:arc-woo": "tsx scripts/e2e-arc-woo.ts",
69
+ "e2e:arc-buyer": "tsx scripts/e2e-arc-buyer.ts",
70
+ "ci:wallet": "tsx scripts/ci-wallet.ts"
72
71
  }
73
- }
72
+ }