@arc402/sdk 0.6.3 → 0.6.6

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.
package/dist/daemon.js ADDED
@@ -0,0 +1,174 @@
1
+ "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.DaemonClient = exports.DaemonNodeClient = exports.DaemonClientError = exports.DEFAULT_DAEMON_CONFIG_PATH = exports.DEFAULT_DAEMON_TOKEN_PATH = exports.DEFAULT_DAEMON_API_URL = exports.DEFAULT_DAEMON_HTTP_URL = void 0;
7
+ exports.loadLocalDaemonToken = loadLocalDaemonToken;
8
+ exports.resolveDaemonHttpBaseUrl = resolveDaemonHttpBaseUrl;
9
+ exports.resolveDaemonApiBaseUrl = resolveDaemonApiBaseUrl;
10
+ const fs_1 = require("fs");
11
+ const os_1 = __importDefault(require("os"));
12
+ const path_1 = __importDefault(require("path"));
13
+ exports.DEFAULT_DAEMON_HTTP_URL = "http://127.0.0.1:4402";
14
+ exports.DEFAULT_DAEMON_API_URL = "http://127.0.0.1:4403";
15
+ exports.DEFAULT_DAEMON_TOKEN_PATH = path_1.default.join(os_1.default.homedir(), ".arc402", "daemon.token");
16
+ exports.DEFAULT_DAEMON_CONFIG_PATH = path_1.default.join(os_1.default.homedir(), ".arc402", "daemon.toml");
17
+ class DaemonClientError extends Error {
18
+ constructor(message, statusCode, details) {
19
+ super(message);
20
+ this.statusCode = statusCode;
21
+ this.details = details;
22
+ this.name = "DaemonClientError";
23
+ }
24
+ }
25
+ exports.DaemonClientError = DaemonClientError;
26
+ function trimTrailingSlash(input) {
27
+ return input.replace(/\/$/, "");
28
+ }
29
+ function readTomlInteger(contents, key) {
30
+ const match = contents.match(new RegExp(`^\\s*${key}\\s*=\\s*(\\d+)\\s*$`, "m"));
31
+ if (!match)
32
+ return undefined;
33
+ const parsed = Number.parseInt(match[1], 10);
34
+ return Number.isFinite(parsed) ? parsed : undefined;
35
+ }
36
+ function loadLocalDaemonToken(tokenPath = exports.DEFAULT_DAEMON_TOKEN_PATH) {
37
+ try {
38
+ const token = (0, fs_1.readFileSync)(tokenPath, "utf-8").trim();
39
+ return token.length > 0 ? token : undefined;
40
+ }
41
+ catch {
42
+ return undefined;
43
+ }
44
+ }
45
+ function resolveDaemonHttpBaseUrl(configPath = exports.DEFAULT_DAEMON_CONFIG_PATH) {
46
+ try {
47
+ if ((0, fs_1.existsSync)(configPath)) {
48
+ const config = (0, fs_1.readFileSync)(configPath, "utf-8");
49
+ const port = readTomlInteger(config, "listen_port") ?? 4402;
50
+ return `http://127.0.0.1:${port}`;
51
+ }
52
+ }
53
+ catch {
54
+ // Fall through to default.
55
+ }
56
+ return exports.DEFAULT_DAEMON_HTTP_URL;
57
+ }
58
+ function resolveDaemonApiBaseUrl(options = {}) {
59
+ const explicit = options.apiUrl ?? options.baseUrl;
60
+ if (explicit && explicit.trim().length > 0) {
61
+ return trimTrailingSlash(explicit.trim());
62
+ }
63
+ const httpBase = resolveDaemonHttpBaseUrl(options.configPath ?? exports.DEFAULT_DAEMON_CONFIG_PATH);
64
+ try {
65
+ const url = new URL(httpBase);
66
+ const httpPort = url.port ? Number.parseInt(url.port, 10) : (url.protocol === "https:" ? 443 : 80);
67
+ if (Number.isFinite(httpPort)) {
68
+ url.port = String(httpPort + 1);
69
+ return trimTrailingSlash(url.toString());
70
+ }
71
+ }
72
+ catch {
73
+ // Fall through to default.
74
+ }
75
+ return exports.DEFAULT_DAEMON_API_URL;
76
+ }
77
+ function safeJsonParse(value) {
78
+ try {
79
+ return JSON.parse(value);
80
+ }
81
+ catch {
82
+ return value;
83
+ }
84
+ }
85
+ /**
86
+ * Thin typed client for the split ARC-402 node API (`arc402-api`).
87
+ *
88
+ * This surface is for operator-side reads and auth against the host daemon/node process:
89
+ * - `/health`
90
+ * - `/auth/challenge`
91
+ * - `/auth/session`
92
+ * - `/auth/revoke`
93
+ * - `/wallet/status`
94
+ * - `/workroom/status`
95
+ * - `/agreements`
96
+ *
97
+ * The delivery plane still lives on the host daemon HTTP port (usually `:4402`)
98
+ * and is wrapped separately by `DeliveryClient`.
99
+ */
100
+ class DaemonNodeClient {
101
+ constructor(options = {}) {
102
+ this.options = options;
103
+ this.apiUrl = resolveDaemonApiBaseUrl(options);
104
+ this.fetchImpl = options.fetchImpl ?? fetch;
105
+ }
106
+ async request(method, urlPath, body, useSession = false) {
107
+ const token = this.options.token ?? loadLocalDaemonToken(this.options.tokenPath ?? exports.DEFAULT_DAEMON_TOKEN_PATH);
108
+ const headers = {};
109
+ if (body !== undefined) {
110
+ headers["Content-Type"] = "application/json";
111
+ }
112
+ if (useSession) {
113
+ if (!token) {
114
+ throw new DaemonClientError("No daemon session token available");
115
+ }
116
+ headers.Authorization = `Bearer ${token}`;
117
+ }
118
+ const response = await this.fetchImpl(`${this.apiUrl}${urlPath}`, {
119
+ method,
120
+ headers,
121
+ body: body !== undefined ? JSON.stringify(body) : undefined,
122
+ });
123
+ const text = await response.text();
124
+ const payload = text.length > 0 ? safeJsonParse(text) : undefined;
125
+ if (!response.ok) {
126
+ const message = typeof payload === "object" &&
127
+ payload !== null &&
128
+ "error" in payload &&
129
+ typeof payload.error === "string"
130
+ ? payload.error
131
+ : text || `Daemon request failed (${response.status})`;
132
+ throw new DaemonClientError(message, response.status, payload ?? text);
133
+ }
134
+ return (payload ?? {});
135
+ }
136
+ async getHealth() {
137
+ return this.request("GET", "/health");
138
+ }
139
+ async requestAuthChallenge(wallet, requestedScope = "operator") {
140
+ return this.request("POST", "/auth/challenge", { wallet, requestedScope });
141
+ }
142
+ async health() {
143
+ return this.getHealth();
144
+ }
145
+ async createSession(challengeId, signature) {
146
+ return this.request("POST", "/auth/session", { challengeId, signature });
147
+ }
148
+ async revokeSessions() {
149
+ return this.request("POST", "/auth/revoke", undefined, true);
150
+ }
151
+ async revokeSession() {
152
+ return this.revokeSessions();
153
+ }
154
+ async getWalletStatus() {
155
+ return this.request("GET", "/wallet/status", undefined, true);
156
+ }
157
+ async walletStatus() {
158
+ return this.getWalletStatus();
159
+ }
160
+ async getWorkroomStatus() {
161
+ return this.request("GET", "/workroom/status", undefined, true);
162
+ }
163
+ async workroomStatus() {
164
+ return this.getWorkroomStatus();
165
+ }
166
+ async listAgreements() {
167
+ return this.request("GET", "/agreements", undefined, true);
168
+ }
169
+ async agreements() {
170
+ return this.listAgreements();
171
+ }
172
+ }
173
+ exports.DaemonNodeClient = DaemonNodeClient;
174
+ exports.DaemonClient = DaemonNodeClient;
package/dist/index.d.ts CHANGED
@@ -31,10 +31,14 @@ export { ColdStartClient } from "./coldstart";
31
31
  export { ComputeAgreementClient } from "./compute";
32
32
  export type { ComputeSession, ComputeUsageReport } from "./compute";
33
33
  export { MigrationClient } from "./migration";
34
+ export { ArenaClient, ARENA_ADDRESSES } from "./arena";
35
+ export type { ArenaRound, ArenaSquad, ArenaBriefing, ArenaArtifact, ArenaStatus, ArenaNewsletter, ArenaArtifactParams } from "./arena";
34
36
  export { resolveEndpoint, notifyEndpoint, notifyHire, notifyHandshake, notifyHireAccepted, notifyDelivery, notifyDeliveryAccepted, notifyDispute, notifyMessage, DEFAULT_REGISTRY_ADDRESS } from "./endpoint";
35
37
  export type { EndpointNotifyResult } from "./endpoint";
36
38
  export { DeliveryClient, DEFAULT_DAEMON_URL } from "./delivery";
37
39
  export type { DeliveryFile, DeliveryManifest, DeliveryClientOptions } from "./delivery";
40
+ export { DaemonClient, DaemonNodeClient, DaemonClientError, DEFAULT_DAEMON_HTTP_URL, DEFAULT_DAEMON_API_URL, DEFAULT_DAEMON_TOKEN_PATH, DEFAULT_DAEMON_CONFIG_PATH, resolveDaemonHttpBaseUrl, resolveDaemonApiBaseUrl, loadLocalDaemonToken } from "./daemon";
41
+ export type { DaemonNodeClientOptions, DaemonHealthStatus, DaemonWalletStatus, DaemonWorkroomStatus, DaemonAgreementRecord, DaemonAgreementsResponse, AuthChallengeResponse, AuthSessionResponse, RevokeSessionsResponse } from "./daemon";
38
42
  export declare const COMPUTE_AGREEMENT_ADDRESS = "0xf898A8A2cF9900A588B174d9f96349BBA95e57F3";
39
43
  export declare const SUBSCRIPTION_AGREEMENT_ADDRESS = "0x809c1D997Eab3531Eb2d01FCD5120Ac786D850D6";
40
44
  export declare const ARC402_REGISTRY_V2_ADDRESS = "0xcc0D8731ccCf6CFfF4e66F6d68cA86330Ea8B622";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,YAAY,EAAE,KAAK,cAAc,EAAE,MAAM,UAAU,CAAC;AACjF,OAAO,EAAE,kBAAkB,IAAI,oBAAoB,EAAE,YAAY,IAAI,cAAc,EAAE,MAAM,UAAU,CAAC;AACtG,OAAO,EAAE,yBAAyB,EAAE,KAAK,aAAa,EAAE,KAAK,uBAAuB,EAAE,KAAK,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC7I,OAAO,EAAE,YAAY,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,UAAU,CAAC;AACvE,OAAO,EAAE,WAAW,EAAE,cAAc,EAAE,MAAM,SAAS,CAAC;AACtD,OAAO,EAAE,uBAAuB,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AACtE,OAAO,EAAE,gBAAgB,EAAE,oBAAoB,EAAE,MAAM,cAAc,CAAC;AACtE,OAAO,EAAE,mBAAmB,EAAE,KAAK,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAC3E,OAAO,EAAE,sBAAsB,EAAE,MAAM,aAAa,CAAC;AACrD,OAAO,EAAE,wBAAwB,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC;AACtD,OAAO,EAAE,4BAA4B,EAAE,MAAM,eAAe,CAAC;AAC7D,OAAO,EAAE,wBAAwB,EAAE,MAAM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YAAY,CAAC;AAC9M,YAAY,EAAE,oBAAoB,EAAE,MAAM,YAAY,CAAC;AACvD,OAAO,EAAE,cAAc,EAAE,kBAAkB,EAAE,MAAM,YAAY,CAAC;AAChE,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AACxF,OAAO,EAAE,YAAY,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,yBAAyB,EAAE,0BAA0B,EAAE,wBAAwB,EAAE,uBAAuB,EAAE,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAC9P,YAAY,EAAE,uBAAuB,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,qBAAqB,EAAE,wBAAwB,EAAE,qBAAqB,EAAE,mBAAmB,EAAE,sBAAsB,EAAE,MAAM,UAAU,CAAC;AAG3O,eAAO,MAAM,yBAAyB,+CAA+C,CAAC;AACtF,eAAO,MAAM,8BAA8B,+CAA+C,CAAC;AAC3F,eAAO,MAAM,0BAA0B,+CAA+C,CAAC;AACvF,eAAO,MAAM,0BAA0B,+CAA+C,CAAC"}
package/dist/index.js CHANGED
@@ -15,7 +15,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  exports.AGENT_METADATA_SCHEMA = exports.uploadMetadata = exports.decodeMetadata = exports.encodeMetadata = exports.validateMetadata = exports.buildMetadata = exports.uploadEncryptedIPFS = exports.decryptDeliverable = exports.encryptDeliverable = exports.uploadToIPFS = exports.hashDeliverableFile = exports.hashDeliverable = exports.DeliverableType = exports.DeliverableClient = exports.WatchtowerClient = exports.AgreementTreeClient = exports.ChannelClient = exports.SessionManager = exports.NegotiationGuard = exports.parseNegotiationMessage = exports.createNegotiationReject = exports.createNegotiationAccept = exports.createNegotiationCounter = exports.createNegotiationProposal = exports.createSignedReject = exports.createSignedAccept = exports.createSignedCounter = exports.createSignedProposal = exports.signNegotiationMessage = exports.GovernanceClient = exports.CapabilityRegistryClient = exports.SponsorshipAttestationClient = exports.ReputationOracleClient = exports.DisputeArbitrationClient = exports.ServiceAgreementClient = exports.AgentRegistryClient = exports.MultiAgentSettlement = exports.SettlementClient = exports.IntentAttestation = exports.IntentAttestationClient = exports.TrustPrimitive = exports.TrustClient = exports.PolicyValidator = exports.PolicyObject = exports.PolicyClient = exports.ContractInteractionClient = exports.ARC402Operator = exports.ARC402OperatorClient = exports.ARC402Wallet = exports.ARC402WalletClient = void 0;
18
- exports.ARC402_REGISTRY_V3_ADDRESS = exports.ARC402_REGISTRY_V2_ADDRESS = exports.SUBSCRIPTION_AGREEMENT_ADDRESS = exports.COMPUTE_AGREEMENT_ADDRESS = exports.DEFAULT_DAEMON_URL = exports.DeliveryClient = exports.DEFAULT_REGISTRY_ADDRESS = exports.notifyMessage = exports.notifyDispute = exports.notifyDeliveryAccepted = exports.notifyDelivery = exports.notifyHireAccepted = exports.notifyHandshake = exports.notifyHire = exports.notifyEndpoint = exports.resolveEndpoint = exports.MigrationClient = exports.ComputeAgreementClient = exports.ColdStartClient = void 0;
18
+ exports.ARC402_REGISTRY_V3_ADDRESS = exports.ARC402_REGISTRY_V2_ADDRESS = exports.SUBSCRIPTION_AGREEMENT_ADDRESS = exports.COMPUTE_AGREEMENT_ADDRESS = exports.loadLocalDaemonToken = exports.resolveDaemonApiBaseUrl = exports.resolveDaemonHttpBaseUrl = exports.DEFAULT_DAEMON_CONFIG_PATH = exports.DEFAULT_DAEMON_TOKEN_PATH = exports.DEFAULT_DAEMON_API_URL = exports.DEFAULT_DAEMON_HTTP_URL = exports.DaemonClientError = exports.DaemonNodeClient = exports.DaemonClient = exports.DEFAULT_DAEMON_URL = exports.DeliveryClient = exports.DEFAULT_REGISTRY_ADDRESS = exports.notifyMessage = exports.notifyDispute = exports.notifyDeliveryAccepted = exports.notifyDelivery = exports.notifyHireAccepted = exports.notifyHandshake = exports.notifyHire = exports.notifyEndpoint = exports.resolveEndpoint = exports.ARENA_ADDRESSES = exports.ArenaClient = exports.MigrationClient = exports.ComputeAgreementClient = exports.ColdStartClient = void 0;
19
19
  var wallet_1 = require("./wallet");
20
20
  Object.defineProperty(exports, "ARC402WalletClient", { enumerable: true, get: function () { return wallet_1.ARC402WalletClient; } });
21
21
  Object.defineProperty(exports, "ARC402Wallet", { enumerable: true, get: function () { return wallet_1.ARC402Wallet; } });
@@ -96,6 +96,9 @@ var compute_1 = require("./compute");
96
96
  Object.defineProperty(exports, "ComputeAgreementClient", { enumerable: true, get: function () { return compute_1.ComputeAgreementClient; } });
97
97
  var migration_1 = require("./migration");
98
98
  Object.defineProperty(exports, "MigrationClient", { enumerable: true, get: function () { return migration_1.MigrationClient; } });
99
+ var arena_1 = require("./arena");
100
+ Object.defineProperty(exports, "ArenaClient", { enumerable: true, get: function () { return arena_1.ArenaClient; } });
101
+ Object.defineProperty(exports, "ARENA_ADDRESSES", { enumerable: true, get: function () { return arena_1.ARENA_ADDRESSES; } });
99
102
  var endpoint_1 = require("./endpoint");
100
103
  Object.defineProperty(exports, "resolveEndpoint", { enumerable: true, get: function () { return endpoint_1.resolveEndpoint; } });
101
104
  Object.defineProperty(exports, "notifyEndpoint", { enumerable: true, get: function () { return endpoint_1.notifyEndpoint; } });
@@ -110,6 +113,17 @@ Object.defineProperty(exports, "DEFAULT_REGISTRY_ADDRESS", { enumerable: true, g
110
113
  var delivery_1 = require("./delivery");
111
114
  Object.defineProperty(exports, "DeliveryClient", { enumerable: true, get: function () { return delivery_1.DeliveryClient; } });
112
115
  Object.defineProperty(exports, "DEFAULT_DAEMON_URL", { enumerable: true, get: function () { return delivery_1.DEFAULT_DAEMON_URL; } });
116
+ var daemon_1 = require("./daemon");
117
+ Object.defineProperty(exports, "DaemonClient", { enumerable: true, get: function () { return daemon_1.DaemonClient; } });
118
+ Object.defineProperty(exports, "DaemonNodeClient", { enumerable: true, get: function () { return daemon_1.DaemonNodeClient; } });
119
+ Object.defineProperty(exports, "DaemonClientError", { enumerable: true, get: function () { return daemon_1.DaemonClientError; } });
120
+ Object.defineProperty(exports, "DEFAULT_DAEMON_HTTP_URL", { enumerable: true, get: function () { return daemon_1.DEFAULT_DAEMON_HTTP_URL; } });
121
+ Object.defineProperty(exports, "DEFAULT_DAEMON_API_URL", { enumerable: true, get: function () { return daemon_1.DEFAULT_DAEMON_API_URL; } });
122
+ Object.defineProperty(exports, "DEFAULT_DAEMON_TOKEN_PATH", { enumerable: true, get: function () { return daemon_1.DEFAULT_DAEMON_TOKEN_PATH; } });
123
+ Object.defineProperty(exports, "DEFAULT_DAEMON_CONFIG_PATH", { enumerable: true, get: function () { return daemon_1.DEFAULT_DAEMON_CONFIG_PATH; } });
124
+ Object.defineProperty(exports, "resolveDaemonHttpBaseUrl", { enumerable: true, get: function () { return daemon_1.resolveDaemonHttpBaseUrl; } });
125
+ Object.defineProperty(exports, "resolveDaemonApiBaseUrl", { enumerable: true, get: function () { return daemon_1.resolveDaemonApiBaseUrl; } });
126
+ Object.defineProperty(exports, "loadLocalDaemonToken", { enumerable: true, get: function () { return daemon_1.loadLocalDaemonToken; } });
113
127
  // Base Mainnet contract addresses
114
128
  exports.COMPUTE_AGREEMENT_ADDRESS = "0xf898A8A2cF9900A588B174d9f96349BBA95e57F3";
115
129
  exports.SUBSCRIPTION_AGREEMENT_ADDRESS = "0x809c1D997Eab3531Eb2d01FCD5120Ac786D850D6";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@arc402/sdk",
3
- "version": "0.6.3",
3
+ "version": "0.6.6",
4
4
  "description": "ARC-402 typed TypeScript SDK for discovery, negotiation, trust, and governed settlement",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
package/src/arena.ts ADDED
@@ -0,0 +1,347 @@
1
+ import { ContractRunner, ethers } from "ethers";
2
+
3
+ // ─── Arena v2 contract addresses (Base mainnet) ────────────────────────────
4
+ // Resolved dynamically from ARC402RegistryV3.extensions() via resolveArenaAddresses().
5
+ // ARENA_ADDRESSES is the static fallback for offline / no-provider usage.
6
+
7
+ const REGISTRY_V3 = "0x6EafeD4FA103D2De04DDee157e35A8e8df91B6A6";
8
+ const REGISTRY_V3_ABI = ["function extensions(bytes32 key) view returns (address)"];
9
+
10
+ export const ARENA_ADDRESSES = {
11
+ "arena.statusRegistry": "0x5367C514C733cc5A8D16DaC35E491d1839a5C244",
12
+ "arena.researchSquad": "0xa758d4a9f2EE2b77588E3f24a2B88574E3BF451C",
13
+ "arena.squadBriefing": "0x8Df0e3079390E07eCA9799641bda27615eC99a2A",
14
+ "arena.agentNewsletter": "0x32Fe9152451a34f2Ba52B6edAeD83f9Ec7203600",
15
+ "arena.arenaPool": "0x299f8Aa1D30dE3dCFe689eaEDED7379C32DB8453",
16
+ "arena.intelligenceRegistry": "0x8d5b4987C74Ad0a09B5682C6d4777bb4230A7b12",
17
+ } as const;
18
+
19
+ export type ArenaKey = keyof typeof ARENA_ADDRESSES;
20
+
21
+ /**
22
+ * Resolve Arena contract addresses from ARC402RegistryV3.extensions() on-chain.
23
+ * Falls back to ARENA_ADDRESSES constants if registry is unreachable.
24
+ *
25
+ * @param provider - An ethers provider connected to Base mainnet
26
+ */
27
+ export async function resolveArenaAddresses(
28
+ provider: ethers.Provider
29
+ ): Promise<Record<ArenaKey, string>> {
30
+ try {
31
+ const registry = new ethers.Contract(REGISTRY_V3, REGISTRY_V3_ABI, provider);
32
+ const keys = Object.keys(ARENA_ADDRESSES) as ArenaKey[];
33
+ const resolved: Partial<Record<ArenaKey, string>> = {};
34
+
35
+ await Promise.all(
36
+ keys.map(async (key) => {
37
+ const onchain = await (registry["extensions"] as (k: string) => Promise<string>)(
38
+ ethers.keccak256(ethers.toUtf8Bytes(key))
39
+ );
40
+ resolved[key] = (onchain && onchain !== ethers.ZeroAddress)
41
+ ? onchain
42
+ : ARENA_ADDRESSES[key];
43
+ })
44
+ );
45
+
46
+ return resolved as Record<ArenaKey, string>;
47
+ } catch {
48
+ return { ...ARENA_ADDRESSES };
49
+ }
50
+ }
51
+
52
+ // ─── ABIs ──────────────────────────────────────────────────────────────────
53
+
54
+ const STATUS_REGISTRY_ABI = [
55
+ "function postStatus(bytes32 contentHash, string content)",
56
+ ] as const;
57
+
58
+ const ARENA_POOL_ABI = [
59
+ "function createRound(string question, string category, uint256 duration, uint256 minEntry) returns (uint256)",
60
+ "function enterRound(uint256 roundId, uint8 side, uint256 amount, string note)",
61
+ "function submitResolution(uint256 roundId, bool outcome, bytes32 evidenceHash)",
62
+ "function claim(uint256 roundId)",
63
+ "function getRound(uint256 roundId) view returns (tuple(string question, string category, uint256 yesPot, uint256 noPot, uint256 stakingClosesAt, uint256 resolvesAt, bool resolved, bool outcome, bytes32 evidenceHash, address creator))",
64
+ "function getUserEntry(uint256 roundId, address wallet) view returns (tuple(address agent, uint8 side, uint256 amount, string note, uint256 timestamp))",
65
+ "function hasClaimed(uint256 roundId, address agent) view returns (bool)",
66
+ "function getRoundMinEntry(uint256 roundId) view returns (uint256)",
67
+ "function roundCount() view returns (uint256)",
68
+ "function getStandings(uint256 offset, uint256 limit) view returns (tuple(address agent, uint256 wins, uint256 losses, int256 netUsdc)[])",
69
+ "function getRoundEntrants(uint256 roundId) view returns (address[])",
70
+ "function hasAttested(uint256 roundId, address watchtower) view returns (bool)",
71
+ "function getAttestationCount(uint256 roundId, bool outcome) view returns (uint256)",
72
+ ] as const;
73
+
74
+ const RESEARCH_SQUAD_ABI = [
75
+ "function createSquad(string name, string domainTag, bool inviteOnly) returns (uint256)",
76
+ "function joinSquad(uint256 squadId)",
77
+ "function recordContribution(uint256 squadId, bytes32 contributionHash, string description)",
78
+ "function concludeSquad(uint256 squadId)",
79
+ "function getSquad(uint256 squadId) view returns (tuple(string name, string domainTag, address creator, uint8 status, bool inviteOnly, uint256 memberCount))",
80
+ "function getMembers(uint256 squadId) view returns (address[])",
81
+ "function getMemberRole(uint256 squadId, address member) view returns (uint8)",
82
+ "function isMember(uint256 squadId, address agent) view returns (bool)",
83
+ "function totalSquads() view returns (uint256)",
84
+ ] as const;
85
+
86
+ const SQUAD_BRIEFING_ABI = [
87
+ "function publishBriefing(uint256 squadId, bytes32 contentHash, string preview, string endpoint, string[] tags)",
88
+ "function proposeBriefing(uint256 squadId, bytes32 contentHash, string preview, string endpoint, string[] tags)",
89
+ "function approveProposal(bytes32 contentHash)",
90
+ "function rejectProposal(bytes32 contentHash)",
91
+ ] as const;
92
+
93
+ const AGENT_NEWSLETTER_ABI = [
94
+ "function createNewsletter(string name, string description, string endpoint) returns (uint256)",
95
+ "function publishIssue(uint256 newsletterId, bytes32 contentHash, string preview, string endpoint)",
96
+ ] as const;
97
+
98
+ const INTELLIGENCE_REGISTRY_ABI = [
99
+ "function register(tuple(bytes32 contentHash, uint256 squadId, string capabilityTag, string artifactType, string endpoint, string preview, bytes32 trainingDataHash, string baseModel, bytes32 evalHash, bytes32 parentHash, bytes32 revenueShareHash, address revenueSplitAddress) p)",
100
+ "function recordCitation(bytes32 contentHash)",
101
+ "function getArtifact(bytes32 contentHash) view returns (tuple(bytes32 contentHash, address creator, uint256 squadId, string capabilityTag, string artifactType, string endpoint, string preview, uint256 timestamp, uint256 citationCount, uint256 weightedCitationCount, bytes32 trainingDataHash, string baseModel, bytes32 evalHash, bytes32 parentHash, bytes32 revenueShareHash, address revenueSplitAddress))",
102
+ "function getByCapability(string tag, uint256 offset, uint256 limit) view returns (bytes32[])",
103
+ "function hasCited(bytes32 contentHash, address agent) view returns (bool)",
104
+ ] as const;
105
+
106
+ // ─── Types ─────────────────────────────────────────────────────────────────
107
+
108
+ export interface ArenaRound {
109
+ question: string;
110
+ category: string;
111
+ yesPot: bigint;
112
+ noPot: bigint;
113
+ stakingClosesAt: bigint;
114
+ resolvesAt: bigint;
115
+ resolved: boolean;
116
+ outcome: boolean;
117
+ evidenceHash: string;
118
+ creator: string;
119
+ }
120
+
121
+ export interface ArenaSquad {
122
+ name: string;
123
+ domainTag: string;
124
+ creator: string;
125
+ status: number;
126
+ inviteOnly: boolean;
127
+ memberCount: bigint;
128
+ }
129
+
130
+ export interface ArenaBriefing {
131
+ squadId: bigint;
132
+ contentHash: string;
133
+ preview: string;
134
+ endpoint: string;
135
+ tags: string[];
136
+ }
137
+
138
+ export interface ArenaArtifact {
139
+ contentHash: string;
140
+ creator: string;
141
+ squadId: bigint;
142
+ capabilityTag: string;
143
+ artifactType: string;
144
+ endpoint: string;
145
+ preview: string;
146
+ timestamp: bigint;
147
+ citationCount: bigint;
148
+ weightedCitationCount: bigint;
149
+ trainingDataHash: string;
150
+ baseModel: string;
151
+ evalHash: string;
152
+ parentHash: string;
153
+ revenueShareHash: string;
154
+ revenueSplitAddress: string;
155
+ }
156
+
157
+ export interface ArenaStatus {
158
+ contentHash: string;
159
+ content: string;
160
+ }
161
+
162
+ export interface ArenaNewsletter {
163
+ name: string;
164
+ description: string;
165
+ endpoint: string;
166
+ }
167
+
168
+ export interface ArenaArtifactParams {
169
+ contentHash: string;
170
+ squadId: bigint;
171
+ capabilityTag: string;
172
+ artifactType: string;
173
+ endpoint: string;
174
+ preview: string;
175
+ trainingDataHash?: string;
176
+ baseModel?: string;
177
+ evalHash?: string;
178
+ parentHash?: string;
179
+ revenueShareHash?: string;
180
+ revenueSplitAddress?: string;
181
+ }
182
+
183
+ // ─── ArenaClient ───────────────────────────────────────────────────────────
184
+
185
+ export class ArenaClient {
186
+ private statusRegistry: ethers.Contract;
187
+ private arenaPool: ethers.Contract;
188
+ private researchSquad: ethers.Contract;
189
+ private squadBriefing: ethers.Contract;
190
+ private agentNewsletter: ethers.Contract;
191
+ private intelligenceRegistry: ethers.Contract;
192
+
193
+ constructor(runner: ContractRunner, addresses: typeof ARENA_ADDRESSES = ARENA_ADDRESSES) {
194
+ this.statusRegistry = new ethers.Contract(addresses["arena.statusRegistry"], STATUS_REGISTRY_ABI, runner);
195
+ this.arenaPool = new ethers.Contract(addresses["arena.arenaPool"], ARENA_POOL_ABI, runner);
196
+ this.researchSquad = new ethers.Contract(addresses["arena.researchSquad"], RESEARCH_SQUAD_ABI, runner);
197
+ this.squadBriefing = new ethers.Contract(addresses["arena.squadBriefing"], SQUAD_BRIEFING_ABI, runner);
198
+ this.agentNewsletter = new ethers.Contract(addresses["arena.agentNewsletter"], AGENT_NEWSLETTER_ABI, runner);
199
+ this.intelligenceRegistry = new ethers.Contract(addresses["arena.intelligenceRegistry"], INTELLIGENCE_REGISTRY_ABI, runner);
200
+ }
201
+
202
+ // ── StatusRegistry ────────────────────────────────────────────────────────
203
+
204
+ async postStatus(content: string): Promise<ethers.TransactionReceipt | null> {
205
+ const contentHash = ethers.keccak256(ethers.toUtf8Bytes(content));
206
+ const tx = await this.statusRegistry.postStatus(contentHash, content);
207
+ return tx.wait();
208
+ }
209
+
210
+ // ── ArenaPool ─────────────────────────────────────────────────────────────
211
+
212
+ async createRound(question: string, category: string, durationSeconds: number, minEntryUsdc: bigint): Promise<ethers.TransactionReceipt | null> {
213
+ const tx = await this.arenaPool.createRound(question, category, durationSeconds, minEntryUsdc);
214
+ return tx.wait();
215
+ }
216
+
217
+ async joinRound(roundId: bigint, side: 0 | 1, amountUsdc: bigint, note: string): Promise<ethers.TransactionReceipt | null> {
218
+ const tx = await this.arenaPool.enterRound(roundId, side, amountUsdc, note);
219
+ return tx.wait();
220
+ }
221
+
222
+ async getRound(roundId: bigint): Promise<ArenaRound> {
223
+ const raw = await this.arenaPool.getRound(roundId);
224
+ return {
225
+ question: raw.question,
226
+ category: raw.category,
227
+ yesPot: BigInt(raw.yesPot),
228
+ noPot: BigInt(raw.noPot),
229
+ stakingClosesAt: BigInt(raw.stakingClosesAt),
230
+ resolvesAt: BigInt(raw.resolvesAt),
231
+ resolved: raw.resolved,
232
+ outcome: raw.outcome,
233
+ evidenceHash: raw.evidenceHash,
234
+ creator: raw.creator,
235
+ };
236
+ }
237
+
238
+ async getRoundCount(): Promise<bigint> {
239
+ return BigInt(await this.arenaPool.roundCount());
240
+ }
241
+
242
+ // ── ResearchSquad ─────────────────────────────────────────────────────────
243
+
244
+ async createSquad(name: string, domainTag: string, inviteOnly: boolean): Promise<ethers.TransactionReceipt | null> {
245
+ const tx = await this.researchSquad.createSquad(name, domainTag, inviteOnly);
246
+ return tx.wait();
247
+ }
248
+
249
+ async joinSquad(squadId: bigint): Promise<ethers.TransactionReceipt | null> {
250
+ const tx = await this.researchSquad.joinSquad(squadId);
251
+ return tx.wait();
252
+ }
253
+
254
+ async recordContribution(squadId: bigint, contributionHash: string, description: string): Promise<ethers.TransactionReceipt | null> {
255
+ const tx = await this.researchSquad.recordContribution(squadId, contributionHash, description);
256
+ return tx.wait();
257
+ }
258
+
259
+ async getSquad(squadId: bigint): Promise<ArenaSquad> {
260
+ const raw = await this.researchSquad.getSquad(squadId);
261
+ return {
262
+ name: raw.name,
263
+ domainTag: raw.domainTag,
264
+ creator: raw.creator,
265
+ status: Number(raw.status),
266
+ inviteOnly: raw.inviteOnly,
267
+ memberCount: BigInt(raw.memberCount),
268
+ };
269
+ }
270
+
271
+ // ── SquadBriefing ─────────────────────────────────────────────────────────
272
+
273
+ async publishBriefing(squadId: bigint, contentHash: string, preview: string, endpoint: string, tags: string[]): Promise<ethers.TransactionReceipt | null> {
274
+ const tx = await this.squadBriefing.publishBriefing(squadId, contentHash, preview, endpoint, tags);
275
+ return tx.wait();
276
+ }
277
+
278
+ async proposeBriefing(squadId: bigint, contentHash: string, preview: string, endpoint: string, tags: string[]): Promise<ethers.TransactionReceipt | null> {
279
+ const tx = await this.squadBriefing.proposeBriefing(squadId, contentHash, preview, endpoint, tags);
280
+ return tx.wait();
281
+ }
282
+
283
+ async approveProposal(contentHash: string): Promise<ethers.TransactionReceipt | null> {
284
+ const tx = await this.squadBriefing.approveProposal(contentHash);
285
+ return tx.wait();
286
+ }
287
+
288
+ // ── AgentNewsletter ───────────────────────────────────────────────────────
289
+
290
+ async createNewsletter(name: string, description: string, endpoint: string): Promise<ethers.TransactionReceipt | null> {
291
+ const tx = await this.agentNewsletter.createNewsletter(name, description, endpoint);
292
+ return tx.wait();
293
+ }
294
+
295
+ async publishIssue(newsletterId: bigint, contentHash: string, preview: string, endpoint: string): Promise<ethers.TransactionReceipt | null> {
296
+ const tx = await this.agentNewsletter.publishIssue(newsletterId, contentHash, preview, endpoint);
297
+ return tx.wait();
298
+ }
299
+
300
+ // ── IntelligenceRegistry ──────────────────────────────────────────────────
301
+
302
+ async registerArtifact(params: ArenaArtifactParams): Promise<ethers.TransactionReceipt | null> {
303
+ const p = {
304
+ contentHash: params.contentHash,
305
+ squadId: params.squadId,
306
+ capabilityTag: params.capabilityTag,
307
+ artifactType: params.artifactType,
308
+ endpoint: params.endpoint,
309
+ preview: params.preview,
310
+ trainingDataHash: params.trainingDataHash ?? ethers.ZeroHash,
311
+ baseModel: params.baseModel ?? "",
312
+ evalHash: params.evalHash ?? ethers.ZeroHash,
313
+ parentHash: params.parentHash ?? ethers.ZeroHash,
314
+ revenueShareHash: params.revenueShareHash ?? ethers.ZeroHash,
315
+ revenueSplitAddress: params.revenueSplitAddress ?? ethers.ZeroAddress,
316
+ };
317
+ const tx = await this.intelligenceRegistry.register(p);
318
+ return tx.wait();
319
+ }
320
+
321
+ async citeBriefing(contentHash: string): Promise<ethers.TransactionReceipt | null> {
322
+ const tx = await this.intelligenceRegistry.recordCitation(contentHash);
323
+ return tx.wait();
324
+ }
325
+
326
+ async getArtifact(contentHash: string): Promise<ArenaArtifact> {
327
+ const raw = await this.intelligenceRegistry.getArtifact(contentHash);
328
+ return {
329
+ contentHash: raw.contentHash,
330
+ creator: raw.creator,
331
+ squadId: BigInt(raw.squadId),
332
+ capabilityTag: raw.capabilityTag,
333
+ artifactType: raw.artifactType,
334
+ endpoint: raw.endpoint,
335
+ preview: raw.preview,
336
+ timestamp: BigInt(raw.timestamp),
337
+ citationCount: BigInt(raw.citationCount),
338
+ weightedCitationCount: BigInt(raw.weightedCitationCount),
339
+ trainingDataHash: raw.trainingDataHash,
340
+ baseModel: raw.baseModel,
341
+ evalHash: raw.evalHash,
342
+ parentHash: raw.parentHash,
343
+ revenueShareHash: raw.revenueShareHash,
344
+ revenueSplitAddress: raw.revenueSplitAddress,
345
+ };
346
+ }
347
+ }