@moltlaunch/sdk 2.4.0 → 3.0.0

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/README.md CHANGED
@@ -3,361 +3,270 @@
3
3
  </p>
4
4
 
5
5
  <p align="center">
6
- <strong>Hardware-anchored identity, STARK proofs, and Sybil detection for AI agents on Solana</strong>
6
+ <strong>Composable Signal Architecture for AI Agent Identity on Solana</strong>
7
7
  </p>
8
8
 
9
9
  <p align="center">
10
10
  <a href="https://www.npmjs.com/package/@moltlaunch/sdk"><img src="https://img.shields.io/npm/v/@moltlaunch/sdk" alt="npm" /></a>
11
- <a href="https://web-production-419d9.up.railway.app"><img src="https://img.shields.io/badge/API-live-brightgreen" alt="API" /></a>
11
+ <a href="https://youragent.id"><img src="https://img.shields.io/badge/API-live-brightgreen" alt="API" /></a>
12
12
  <a href="LICENSE"><img src="https://img.shields.io/badge/license-MIT-green" alt="MIT" /></a>
13
13
  </p>
14
14
 
15
15
  ---
16
16
 
17
- ## Install
18
-
19
- ```bash
20
- npm install @moltlaunch/sdk
21
- ```
17
+ ## V3 — Composable Signal Architecture
22
18
 
23
- ## What It Does
19
+ MoltLaunch V3 replaces centralized scoring with **on-chain composable signals**. Multiple independent authorities submit attestations about an agent's infrastructure, economic stake, and hardware binding. Trust scores are derived permissionlessly from these attestations.
24
20
 
25
- | Feature | Description |
26
- |---------|-------------|
27
- | **Hardware Identity** | Tie agent identity to physical hardware — CPU, TPM, DePIN devices |
28
- | **Sybil Detection** | Detect duplicate agents sharing the same infrastructure |
29
- | **Agent Verification** | Score agents 0-100 with on-chain AI |
30
- | **STARK Proofs** | Prove "score ≥ 60" without revealing the actual score |
31
- | **Behavioral Scoring** | Track agent behavior over time via execution traces |
32
- | **On-Chain Anchoring** | Write attestations to Solana (Memo program) |
33
- | **DePIN Integration** | Link identity to io.net, Akash, Render, Helium, Nosana |
21
+ **Program:** `6AZSAhq4iJTwCfGEVssoa1p3GnBqGkbcQ1iDdP1U1pSb` (Solana Devnet)
34
22
 
35
23
  ---
36
24
 
37
- ## Quick Start
25
+ ## Install
38
26
 
39
- ```typescript
40
- import { MoltLaunch } from "@moltlaunch/sdk";
41
- const ml = new MoltLaunch();
42
-
43
- // Verify an agent
44
- const result = await ml.verify({
45
- agentId: "my-agent",
46
- capabilities: ["trading"],
47
- codeUrl: "https://github.com/org/repo"
48
- });
27
+ ```bash
28
+ npm install @moltlaunch/sdk
29
+ ```
30
+
31
+ ## Architecture
49
32
 
50
- console.log(result.score); // 78
51
- console.log(result.tier); // "good"
52
- console.log(result.verified); // true
33
+ ```
34
+ ┌─────────────────┐
35
+ ProtocolConfig │
36
+ │ (singleton) │
37
+ └────────┬────────┘
38
+
39
+ ┌──────────────────┼──────────────────┐
40
+ ▼ ▼ ▼
41
+ ┌──────────────┐ ┌──────────────┐ ┌──────────────┐
42
+ │ Authority A │ │ Authority B │ │ Authority C │
43
+ │ (Single) │ │ (Oracle) │ │ (NCN) │
44
+ └──────┬───────┘ └──────┬───────┘ └──────┬───────┘
45
+ │ │ │
46
+ ▼ ▼ ▼
47
+ ┌─────────────────────────────────────────────────┐
48
+ │ Attestation Layer │
49
+ │ (one per agent × authority pair) │
50
+ │ signal_type · hash · tee_quote · expires_at │
51
+ └──────────────────────┬──────────────────────────┘
52
+
53
+
54
+ ┌──────────────────┐
55
+ │ AgentIdentity │
56
+ │ (signal hub) │
57
+ │ │
58
+ │ trust_score │
59
+ │ infra_type │
60
+ │ economic_stake │
61
+ │ hardware_bind │
62
+ │ attestation_cnt │
63
+ │ is_flagged │
64
+ └──────────────────┘
53
65
  ```
54
66
 
55
67
  ---
56
68
 
57
- ## 🔑 Hardware-Anchored Identity (Anti-Sybil)
58
-
59
- The core feature. Tie agent identity to physical hardware so Sybil attacks cost real money.
69
+ ## Quick Start
60
70
 
61
- ### Generate Identity
71
+ ### Read Agent Identity (No Wallet Needed)
62
72
 
63
73
  ```typescript
64
- const identity = await ml.generateIdentity({
65
- includeHardware: true, // CPU, memory, hostname
66
- includeRuntime: true, // Node version, OS
67
- includeCode: true, // SHA-256 of agent's main file
68
- includeTPM: true, // TPM endorsement key (if available)
69
- codeEntry: "./index.js",
70
- agentId: "my-agent",
71
- anchor: true // Write to Solana
72
- });
73
-
74
- console.log(identity.hash); // "7f04b937d885..."
75
- console.log(identity.trustLevel); // 3 (hardware-anchored)
76
- console.log(identity.anchored); // true
77
- console.log(identity.anchorExplorer); // Solana explorer link
78
- ```
74
+ import { MoltLaunchClient } from "@moltlaunch/sdk";
75
+ import { PublicKey } from "@solana/web3.js";
79
76
 
80
- Same machine + same code = **same identity hash**. Can't fake 10 different agents on one server.
77
+ const client = new MoltLaunchClient(); // defaults to devnet
81
78
 
82
- ### Trust Levels
79
+ const agent = await client.getAgentIdentity(
80
+ new PublicKey("AgentWalletPubkey...")
81
+ );
83
82
 
84
- | Level | Method | Sybil Cost |
85
- |-------|--------|------------|
86
- | 0 | None | $0 |
87
- | 1 | API key | $0 |
88
- | 2 | Code hash | $0 |
89
- | 3 | **Hardware fingerprint** | **$100/mo** |
90
- | 4 | **TPM attestation** | **$200+/mo** |
91
- | 5 | **DePIN device** | **$500+/mo** |
92
-
93
- ### Check Two Agents for Sybil
94
-
95
- ```typescript
96
- const result = await ml.checkSybil("agent-1", "agent-2");
97
-
98
- // {
99
- // sameIdentity: true,
100
- // sybilRisk: "HIGH",
101
- // reason: "Same hardware fingerprint — likely same operator",
102
- // recommendation: "Do not seat at same table"
103
- // }
83
+ console.log(`Trust Score: ${agent.trustScore}/100`);
84
+ console.log(`Infra Type: ${agent.infraType}`);
85
+ console.log(`Attestations: ${agent.attestationCount}`);
86
+ console.log(`Flagged: ${agent.isFlagged}`);
87
+ console.log(`Economic Stake: ${agent.hasEconomicStake}`);
88
+ console.log(`Hardware Binding: ${agent.hasHardwareBinding}`);
104
89
  ```
105
90
 
106
- ### Check a Table (Multi-Agent)
91
+ ### Register an Agent
107
92
 
108
93
  ```typescript
109
- const table = await ml.checkTableSybils([
110
- "BluffMaster", "TightBot", "AggroAlice",
111
- "SuspiciousBot", "FishBot", "NitNancy"
112
- ]);
113
-
114
- // {
115
- // safe: false,
116
- // sybilClusters: [["BluffMaster", "SuspiciousBot"]],
117
- // flaggedAgents: ["BluffMaster", "SuspiciousBot"],
118
- // recommendation: "1 Sybil cluster — 2 agents share hardware"
119
- // }
120
- ```
94
+ import { Keypair } from "@solana/web3.js";
95
+ import { MoltLaunchClient } from "@moltlaunch/sdk";
121
96
 
122
- ### DePIN Device Registration
123
-
124
- ```typescript
125
- await ml.registerDePINDevice({
126
- provider: "io.net", // or: akash, render, helium, hivemapper, nosana
127
- deviceId: "device_abc123",
128
- agentId: "my-agent"
97
+ const wallet = Keypair.generate();
98
+ const client = new MoltLaunchClient({
99
+ wallet: { publicKey: wallet.publicKey, signTransaction: ..., signAllTransactions: ... },
129
100
  });
130
- // Trust level → 5 (highest)
131
- ```
132
-
133
- ### Identity Report
134
101
 
135
- ```typescript
136
- const report = await ml.getIdentityReport("my-agent");
137
-
138
- // {
139
- // trustLevel: 3,
140
- // trustLadder: {
141
- // level0: { status: "passed" },
142
- // level1: { status: "passed" },
143
- // level2: { status: "passed" },
144
- // level3: { status: "passed", description: "Hardware fingerprint" },
145
- // level4: { status: "missing", description: "TPM attestation" },
146
- // level5: { status: "missing", description: "DePIN device" }
147
- // },
148
- // sybilResistance: { current: "$100/mo", level: 3, maxLevel: 5 }
149
- // }
102
+ const txId = await client.registerAgent("my-agent", wallet);
103
+ console.log(`Registered! TX: ${txId}`);
150
104
  ```
151
105
 
152
- ---
106
+ ### Submit an Attestation (Authority)
153
107
 
154
- ## 🔐 STARK Proofs (Privacy-Preserving)
108
+ ```typescript
109
+ import { MoltLaunchClient, SignalType } from "@moltlaunch/sdk";
155
110
 
156
- Prove properties about your agent without revealing the underlying data.
111
+ const client = new MoltLaunchClient({ wallet: authorityWallet });
157
112
 
158
- ### Threshold Proof
113
+ // 32-byte attestation hash (e.g. SHA-256 of evidence)
114
+ const attestationHash = new Uint8Array(32);
115
+ crypto.getRandomValues(attestationHash);
159
116
 
160
- ```typescript
161
- // Prove "score >= 60" without revealing exact score
162
- const proof = await ml.generateProof("my-agent", { threshold: 60 });
117
+ // Expires in 30 days
118
+ const expiresAt = Math.floor(Date.now() / 1000) + 30 * 24 * 60 * 60;
163
119
 
164
- console.log(proof.valid); // true
165
- console.log(proof.claim); // "Score >= 60"
166
- console.log(proof.proof.commitment); // cryptographic commitment
167
- // Verifier knows: passed 60. Doesn't know: scored 61 or 99.
120
+ const txId = await client.submitAttestation(
121
+ agentPubkey, // agent's wallet pubkey
122
+ SignalType.InfraCloud, // signal type
123
+ attestationHash, // 32-byte hash
124
+ expiresAt, // unix timestamp
125
+ authorityKeypair, // authority signs
126
+ );
168
127
  ```
169
128
 
170
- ### Consistency Proof
129
+ ### Refresh Signals (Permissionless)
171
130
 
172
131
  ```typescript
173
- // Prove "maintained >= 60 for 30 days"
174
- const proof = await ml.generateConsistencyProof("my-agent", {
175
- threshold: 60,
176
- days: 30
177
- });
178
- // Hides individual daily scores
132
+ // Anyone can call this no authority needed
133
+ const txId = await client.refreshSignals(agentPubkey);
179
134
  ```
180
135
 
181
- ### Streak Proof
136
+ ### Flag an Agent (Authority)
182
137
 
183
138
  ```typescript
184
- // Prove "7+ consecutive periods above threshold"
185
- const proof = await ml.generateStreakProof("my-agent", {
186
- threshold: 60,
187
- minStreak: 7
188
- });
139
+ const reasonHash = new Uint8Array(32); // SHA-256 of reason
140
+ const txId = await client.flagAgent(agentPubkey, reasonHash, authorityKeypair);
189
141
  ```
190
142
 
191
- ### Stability Proof
143
+ ### Revoke an Attestation
192
144
 
193
145
  ```typescript
194
- // Prove "score variance stayed below 100"
195
- const proof = await ml.generateStabilityProof("my-agent", {
196
- maxVariance: 100
197
- });
146
+ const txId = await client.revokeAttestation(agentPubkey, authorityKeypair);
198
147
  ```
199
148
 
200
149
  ---
201
150
 
202
- ## 📊 Execution Traces (Behavioral Scoring)
203
-
204
- Submit behavioral data to build continuous reputation.
205
-
206
- ### Submit a Trace
207
-
208
- ```typescript
209
- const trace = await ml.submitTrace("my-agent", {
210
- period: {
211
- start: "2026-02-01T00:00:00Z",
212
- end: "2026-02-07T23:59:59Z"
213
- },
214
- summary: {
215
- totalActions: 150,
216
- successRate: 0.92,
217
- tradesExecuted: 45,
218
- winRate: 0.73
219
- }
220
- });
221
-
222
- console.log(trace.traceId); // "trace_abc123"
223
- console.log(trace.commitment); // Merkle root
224
- console.log(trace.onChainAnchor); // { signature, explorer } (auto-anchored)
225
- ```
226
-
227
- ### Get Behavioral Score
151
+ ## PDA Derivation
228
152
 
229
153
  ```typescript
230
- const score = await ml.getBehavioralScore("my-agent");
231
- // { score: 22, breakdown: { hasTraces: 5, verified: 5, ... }, traceCount: 12 }
154
+ import {
155
+ findConfigPda,
156
+ findAgentPda,
157
+ findAuthorityPda,
158
+ findAttestationPda,
159
+ } from "@moltlaunch/sdk";
160
+
161
+ const [configPda] = findConfigPda();
162
+ const [agentPda] = findAgentPda(walletPubkey);
163
+ const [authorityPda] = findAuthorityPda(authorityPubkey);
164
+ const [attestationPda] = findAttestationPda(agentWallet, authorityPubkey);
232
165
  ```
233
166
 
234
- ### Anchor Trace On-Chain
235
-
236
- ```typescript
237
- const anchor = await ml.anchorTrace("trace_abc123");
238
- // { anchored: true, txSignature: "4EXao...", slot: 12345678 }
239
- ```
167
+ | PDA | Seeds |
168
+ |-----|-------|
169
+ | `ProtocolConfig` | `["moltlaunch"]` |
170
+ | `AgentIdentity` | `["agent", wallet]` |
171
+ | `Authority` | `["authority", pubkey]` |
172
+ | `Attestation` | `["attestation", agent_wallet, authority_pubkey]` |
240
173
 
241
174
  ---
242
175
 
243
- ## 🧠 Agent Verification
244
-
245
- ### Deep Verification
246
-
247
- ```typescript
248
- const result = await ml.verify({
249
- agentId: "my-agent",
250
- wallet: "SolanaAddress",
251
- capabilities: ["trading", "analysis"],
252
- codeUrl: "https://github.com/org/repo",
253
- documentation: true,
254
- testCoverage: 85,
255
- codeLines: 3000
256
- });
257
-
258
- // {
259
- // verified: true,
260
- // score: 78,
261
- // tier: "good", // excellent (80+) | good (60+) | needs_work (40+) | poor
262
- // onChainAI: { enabled: true, executedOnChain: true },
263
- // attestation: { hash: "abc123...", expiresAt: "2026-03-10" }
264
- // }
265
- ```
176
+ ## On-Chain Types
266
177
 
267
- ### Quick Checks
268
-
269
- ```typescript
270
- // Boolean check
271
- if (await ml.isVerified("agent-id")) { ... }
272
-
273
- // Capability check with minimum score
274
- const canTrade = await ml.checkCapability("agent-id", "trading", 70);
178
+ ### InfraType
179
+ | Variant | Description |
180
+ |---------|-------------|
181
+ | `Unknown` | No infrastructure attestation yet |
182
+ | `Cloud` | Standard cloud infrastructure |
183
+ | `TEE` | Trusted Execution Environment |
184
+ | `DePIN` | Decentralized Physical Infrastructure |
275
185
 
276
- // Batch status
277
- const batch = await ml.getStatusBatch(["agent-1", "agent-2", "agent-3"]);
278
- ```
186
+ ### SignalType
187
+ | Variant | Description |
188
+ |---------|-------------|
189
+ | `InfraCloud` | Cloud infrastructure attestation |
190
+ | `InfraTEE` | TEE attestation (with optional quote) |
191
+ | `InfraDePIN` | DePIN device attestation |
192
+ | `EconomicStake` | Economic stake verification |
193
+ | `HardwareBinding` | Hardware binding attestation |
194
+ | `General` | General-purpose attestation |
195
+
196
+ ### AuthorityType
197
+ | Variant | Description |
198
+ |---------|-------------|
199
+ | `Single` | Single-signer authority |
200
+ | `MultisigMember` | Member of a multisig |
201
+ | `OracleOperator` | Oracle-based operator |
202
+ | `NCNValidator` | Jito NCN validator |
279
203
 
280
204
  ---
281
205
 
282
- ## ⛓️ On-Chain AI
283
-
284
- Verification scoring runs on Solana via Cauldron/Frostbite RISC-V VM.
206
+ ## Consumer Integration
285
207
 
286
- ```
287
- Network: Solana Devnet
288
- VM: FHcy35f4NGZK9b6j5TGMYstfB6PXEtmNbMLvjfR1y2Li
289
- Program: FRsToriMLgDc1Ud53ngzHUZvCRoazCaGeGUuzkwoha7m
290
- ```
208
+ Any protocol can read agent trust signals to make access decisions:
291
209
 
292
210
  ```typescript
293
- const info = await ml.getOnChainInfo();
211
+ import { MoltLaunchClient, InfraType } from "@moltlaunch/sdk";
212
+
213
+ const client = new MoltLaunchClient();
214
+ const agent = await client.getAgentIdentity(wallet);
215
+
216
+ if (agent.infraType === InfraType.TEE && agent.hasEconomicStake) {
217
+ grantFlashLoan(); // High trust — TEE + economic skin in the game
218
+ } else if (agent.trustScore >= 30) {
219
+ grantBasicAccess(); // Medium trust — at least one attestation
220
+ } else {
221
+ deny(); // Unverified — no attestations
222
+ }
294
223
  ```
295
224
 
296
225
  ---
297
226
 
298
227
  ## API Reference
299
228
 
300
- | Method | Description |
301
- |--------|-------------|
302
- | **Identity** | |
303
- | `generateIdentity(opts)` | Generate hardware-anchored identity hash |
304
- | `verifyIdentity(agentId)` | Verify agent against registered fingerprint |
305
- | `checkSybil(id1, id2)` | Compare two agents for Sybil |
306
- | `checkTableSybils(ids[])` | Check group for Sybil clusters |
307
- | `registerDePINDevice(opts)` | Register DePIN device attestation |
308
- | `getIdentityReport(agentId)` | Get trust ladder breakdown |
309
- | **Verification** | |
310
- | `verify(opts)` | Deep verification with on-chain AI |
311
- | `verifySecure(opts)` | Replay-protected verification |
312
- | `getStatus(agentId)` | Check verification status |
313
- | `getStatusBatch(ids[])` | Batch status check |
314
- | `isVerified(agentId)` | Quick boolean check |
315
- | `checkCapability(id, cap, min)` | Capability + score check |
316
- | `checkRevocation(hash)` | Check attestation revocation |
317
- | `renew(agentId)` | Renew verification |
318
- | **STARK Proofs** | |
319
- | `generateProof(id, opts)` | Threshold proof |
320
- | `generateConsistencyProof(id, opts)` | Time-series proof |
321
- | `generateStreakProof(id, opts)` | Consecutive period proof |
322
- | `generateStabilityProof(id, opts)` | Variance proof |
323
- | `getProofCost(type)` | Cost estimate |
324
- | **Traces** | |
325
- | `submitTrace(id, data)` | Submit behavioral data |
326
- | `getTraces(id, opts)` | Query trace history |
327
- | `getBehavioralScore(id)` | Get reputation score |
328
- | `anchorTrace(traceId)` | Anchor on-chain |
329
- | **Other** | |
330
- | `applyToPool(opts)` | Join staking pool |
331
- | `getPools(topic?)` | Get pool info |
332
- | `getLeaderboard()` | Agent rankings |
333
- | `getOnChainInfo()` | On-chain deployment info |
334
- | `isHealthy()` | API health check |
335
- | `generateNonce()` | Random nonce for replay protection |
229
+ ### MoltLaunchClient
230
+
231
+ | Method | Description | Signer |
232
+ |--------|-------------|--------|
233
+ | `getConfig()` | Fetch protocol config | |
234
+ | `getAgentIdentity(wallet)` | Fetch agent signal hub | |
235
+ | `getAuthority(pubkey)` | Fetch authority account | |
236
+ | `getAttestation(agent, authority)` | Fetch attestation | |
237
+ | `registerAgent(name, keypair)` | Register new agent | Agent wallet |
238
+ | `submitAttestation(...)` | Submit attestation | Authority |
239
+ | `revokeAttestation(agent, authority)` | Revoke attestation | Authority |
240
+ | `refreshSignals(agent)` | Refresh trust score | Anyone |
241
+ | `flagAgent(agent, reason, authority)` | Flag an agent | Authority |
242
+ | `unflagAgent(agent, admin)` | Unflag an agent | Admin |
243
+ | `initialize(admin)` | Initialize protocol | Admin |
244
+ | `addAuthority(pubkey, type, admin)` | Add authority | Admin |
245
+ | `removeAuthority(pubkey, admin)` | Remove authority | Admin |
246
+ | `setPaused(paused, admin)` | Pause/unpause | Admin |
247
+ | `transferAdmin(newAdmin, admin)` | Transfer admin | Admin |
336
248
 
337
249
  ---
338
250
 
339
251
  ## Changelog
340
252
 
341
- ### v2.3.0 (Current)
342
- - `_getTPMFingerprint()` TPM 2.0 hardware attestation
343
- - `registerDePINDevice()` DePIN provider registration
344
- - `getIdentityReport()` — Trust ladder breakdown
345
- - TPM + DePIN integrated into `generateIdentity()`
346
-
347
- ### v2.2.0
348
- - `generateIdentity()` — Hardware-anchored identity
349
- - `verifyIdentity()` Identity verification
350
- - `checkSybil()` Pairwise Sybil detection
351
- - `checkTableSybils()` Multi-agent Sybil check
352
-
353
- ### v2.1.0
354
- - STARK proofs (threshold, consistency, streak, stability)
355
- - Execution traces (submit, score, anchor)
356
- - Helper methods (`isVerified`, `checkCapability`, `getProofCost`)
253
+ ### v3.0.0 (Current)
254
+ - **Complete rewrite** for Composable Signal Architecture
255
+ - On-chain program at `6AZSAhq4iJTwCfGEVssoa1p3GnBqGkbcQ1iDdP1U1pSb`
256
+ - `registerAgent()` — creates AgentIdentity PDA
257
+ - `submitAttestation()` authority submits attestation with signal type
258
+ - `revokeAttestation()` — authority revokes own attestation
259
+ - `refreshSignals()` — permissionless trust score refresh
260
+ - `flagAgent()` / `unflagAgent()` authority/admin flagging
261
+ - PDA derivation helpers
262
+ - Full TypeScript types matching on-chain enums
263
+ - Bundled IDL for Anchor integration
264
+
265
+ ### v2.4.0
266
+ - TPM challenge-response, DePIN registration
357
267
 
358
268
  ### v2.0.0
359
269
  - On-chain AI verification via Cauldron
360
- - Batch status checks, pool application
361
270
 
362
271
  ### v1.0.0
363
272
  - Initial release
@@ -369,11 +278,11 @@ const info = await ml.getOnChainInfo();
369
278
  | Resource | URL |
370
279
  |----------|-----|
371
280
  | npm | https://www.npmjs.com/package/@moltlaunch/sdk |
372
- | Live API | https://web-production-419d9.up.railway.app |
373
- | Docs | https://web-production-419d9.up.railway.app/docs.html |
374
- | skill.md | https://web-production-419d9.up.railway.app/skill.md |
375
- | Registry | https://web-production-419d9.up.railway.app/registry.html |
376
- | GitHub (main) | https://github.com/tradingstarllc/moltlaunch |
281
+ | Demo | https://youragent.id/demo.html |
282
+ | Docs | https://youragent.id/docs.html |
283
+ | Explorer | https://explorer.solana.com/address/6AZSAhq4iJTwCfGEVssoa1p3GnBqGkbcQ1iDdP1U1pSb?cluster=devnet |
284
+ | GitHub (program) | https://github.com/tradingstarllc/moltlaunch |
285
+ | GitHub (SDK) | https://github.com/tradingstarllc/moltlaunch-sdk |
377
286
  | GitHub (site) | https://github.com/tradingstarllc/moltlaunch-site |
378
287
 
379
288
  ---
@@ -0,0 +1,69 @@
1
+ /**
2
+ * MoltLaunch V3 — SDK Client
3
+ *
4
+ * High-level API for interacting with the on-chain Composable Signal Architecture.
5
+ * Program: 6AZSAhq4iJTwCfGEVssoa1p3GnBqGkbcQ1iDdP1U1pSb (devnet)
6
+ */
7
+ import { Connection, PublicKey, Keypair } from "@solana/web3.js";
8
+ import * as anchor from "@coral-xyz/anchor";
9
+ import { Wallet } from "@coral-xyz/anchor";
10
+ import { AgentIdentity, Attestation, Authority, ProtocolConfig, SignalType, AuthorityType } from "./types";
11
+ export interface MoltLaunchClientOptions {
12
+ /** Solana RPC URL (defaults to devnet) */
13
+ rpcUrl?: string;
14
+ /** Commitment level */
15
+ commitment?: anchor.web3.Commitment;
16
+ /** Wallet / signer (required for write operations) */
17
+ wallet?: Wallet;
18
+ }
19
+ export declare class MoltLaunchClient {
20
+ readonly connection: Connection;
21
+ readonly programId: PublicKey;
22
+ private program;
23
+ private provider;
24
+ constructor(opts?: MoltLaunchClientOptions);
25
+ /** Fetch the singleton ProtocolConfig account */
26
+ getConfig(): Promise<ProtocolConfig>;
27
+ /** Fetch an AgentIdentity by wallet public key */
28
+ getAgentIdentity(wallet: PublicKey): Promise<AgentIdentity>;
29
+ /** Fetch an Authority account */
30
+ getAuthority(pubkey: PublicKey): Promise<Authority>;
31
+ /** Fetch an Attestation account */
32
+ getAttestation(agentWallet: PublicKey, authorityPubkey: PublicKey): Promise<Attestation>;
33
+ /**
34
+ * Register a new agent identity on-chain.
35
+ * Signer = the agent's wallet keypair.
36
+ */
37
+ registerAgent(name: string, walletKeypair: Keypair): Promise<string>;
38
+ /**
39
+ * Submit an attestation for an agent.
40
+ * Signer = the authority's keypair.
41
+ */
42
+ submitAttestation(agentWallet: PublicKey, signalType: SignalType, attestationHash: number[] | Uint8Array, expiresAt: number | bigint, authorityKeypair: Keypair, teeQuote?: number[] | Uint8Array | null): Promise<string>;
43
+ /**
44
+ * Revoke an attestation (only the original authority can revoke).
45
+ */
46
+ revokeAttestation(agentWallet: PublicKey, authorityKeypair: Keypair): Promise<string>;
47
+ /**
48
+ * Refresh an agent's trust signals (permissionless — anyone can call).
49
+ */
50
+ refreshSignals(agentWallet: PublicKey, signerKeypair?: Keypair): Promise<string>;
51
+ /**
52
+ * Flag an agent (authority-only).
53
+ */
54
+ flagAgent(agentWallet: PublicKey, reasonHash: number[] | Uint8Array, authorityKeypair: Keypair): Promise<string>;
55
+ /**
56
+ * Unflag an agent (admin-only).
57
+ */
58
+ unflagAgent(agentWallet: PublicKey, adminKeypair: Keypair): Promise<string>;
59
+ /** Initialize the protocol (admin, one-time) */
60
+ initialize(adminKeypair: Keypair): Promise<string>;
61
+ /** Add an authority (admin-only) */
62
+ addAuthority(authorityPubkey: PublicKey, authorityType: AuthorityType, adminKeypair: Keypair): Promise<string>;
63
+ /** Remove an authority (admin-only) */
64
+ removeAuthority(authorityPubkey: PublicKey, adminKeypair: Keypair): Promise<string>;
65
+ /** Pause / unpause protocol (admin-only) */
66
+ setPaused(paused: boolean, adminKeypair: Keypair): Promise<string>;
67
+ /** Transfer admin to a new pubkey (admin-only) */
68
+ transferAdmin(newAdmin: PublicKey, adminKeypair: Keypair): Promise<string>;
69
+ }