@oobe-protocol-labs/synapse-sap-sdk 0.7.0 → 0.9.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.
- package/dist/cjs/constants/seeds.js +2 -0
- package/dist/cjs/constants/seeds.js.map +1 -1
- package/dist/cjs/core/client.js +44 -0
- package/dist/cjs/core/client.js.map +1 -1
- package/dist/cjs/idl/synapse_agent_sap.json +1050 -629
- package/dist/cjs/index.js +8 -3
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/modules/escrow-v2.js +17 -38
- package/dist/cjs/modules/escrow-v2.js.map +1 -1
- package/dist/cjs/modules/index.js +3 -1
- package/dist/cjs/modules/index.js.map +1 -1
- package/dist/cjs/modules/receipt.js +144 -0
- package/dist/cjs/modules/receipt.js.map +1 -0
- package/dist/cjs/pda/index.js +24 -1
- package/dist/cjs/pda/index.js.map +1 -1
- package/dist/cjs/registries/index.js +3 -1
- package/dist/cjs/registries/index.js.map +1 -1
- package/dist/cjs/registries/metaplex-bridge.js +446 -0
- package/dist/cjs/registries/metaplex-bridge.js.map +1 -0
- package/dist/cjs/types/enums.js +47 -2
- package/dist/cjs/types/enums.js.map +1 -1
- package/dist/cjs/types/index.js +3 -1
- package/dist/cjs/types/index.js.map +1 -1
- package/dist/esm/constants/seeds.js +2 -0
- package/dist/esm/constants/seeds.js.map +1 -1
- package/dist/esm/core/client.js +44 -0
- package/dist/esm/core/client.js.map +1 -1
- package/dist/esm/idl/synapse_agent_sap.json +1050 -629
- package/dist/esm/index.js +4 -4
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/modules/escrow-v2.js +18 -39
- package/dist/esm/modules/escrow-v2.js.map +1 -1
- package/dist/esm/modules/index.js +1 -0
- package/dist/esm/modules/index.js.map +1 -1
- package/dist/esm/modules/receipt.js +140 -0
- package/dist/esm/modules/receipt.js.map +1 -0
- package/dist/esm/pda/index.js +22 -0
- package/dist/esm/pda/index.js.map +1 -1
- package/dist/esm/registries/index.js +1 -0
- package/dist/esm/registries/index.js.map +1 -1
- package/dist/esm/registries/metaplex-bridge.js +409 -0
- package/dist/esm/registries/metaplex-bridge.js.map +1 -0
- package/dist/esm/types/enums.js +46 -1
- package/dist/esm/types/enums.js.map +1 -1
- package/dist/esm/types/index.js +1 -1
- package/dist/esm/types/index.js.map +1 -1
- package/dist/types/constants/seeds.d.ts +2 -0
- package/dist/types/constants/seeds.d.ts.map +1 -1
- package/dist/types/core/client.d.ts +38 -0
- package/dist/types/core/client.d.ts.map +1 -1
- package/dist/types/index.d.ts +6 -6
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/modules/escrow-v2.d.ts +13 -6
- package/dist/types/modules/escrow-v2.d.ts.map +1 -1
- package/dist/types/modules/index.d.ts +1 -0
- package/dist/types/modules/index.d.ts.map +1 -1
- package/dist/types/modules/receipt.d.ts +77 -0
- package/dist/types/modules/receipt.d.ts.map +1 -0
- package/dist/types/pda/index.d.ts +15 -0
- package/dist/types/pda/index.d.ts.map +1 -1
- package/dist/types/registries/index.d.ts +2 -0
- package/dist/types/registries/index.d.ts.map +1 -1
- package/dist/types/registries/metaplex-bridge.d.ts +228 -0
- package/dist/types/registries/metaplex-bridge.d.ts.map +1 -0
- package/dist/types/types/accounts.d.ts +46 -2
- package/dist/types/types/accounts.d.ts.map +1 -1
- package/dist/types/types/enums.d.ts +52 -1
- package/dist/types/types/enums.d.ts.map +1 -1
- package/dist/types/types/index.d.ts +3 -3
- package/dist/types/types/index.d.ts.map +1 -1
- package/package.json +26 -6
- package/src/constants/seeds.ts +2 -0
- package/src/core/client.ts +46 -0
- package/src/idl/synapse_agent_sap.json +1050 -629
- package/src/index.ts +14 -0
- package/src/modules/escrow-v2.ts +21 -42
- package/src/modules/index.ts +1 -0
- package/src/modules/receipt.ts +207 -0
- package/src/pda/index.ts +32 -0
- package/src/registries/index.ts +10 -0
- package/src/registries/metaplex-bridge.ts +645 -0
- package/src/types/accounts.ts +51 -2
- package/src/types/enums.ts +55 -1
- package/src/types/index.ts +5 -0
|
@@ -0,0 +1,409 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module registries/metaplex-bridge
|
|
3
|
+
* @description Bridge between Synapse Agent Protocol (SAP) and Metaplex
|
|
4
|
+
* Core's `AgentIdentity` external plugin adapter (mpl-core ≥ 1.9.0).
|
|
5
|
+
*
|
|
6
|
+
* ## Why this design (verified against mpl-core PR #258, v1.9.0)
|
|
7
|
+
*
|
|
8
|
+
* The MPL Core `AgentIdentity` plugin has exactly one field:
|
|
9
|
+
*
|
|
10
|
+
* ```ts
|
|
11
|
+
* type AgentIdentity = { uri: string };
|
|
12
|
+
* ```
|
|
13
|
+
*
|
|
14
|
+
* The URI must point to an **EIP-8004** agent registration JSON. There is
|
|
15
|
+
* no on-chain executive list, no `addExecutive` / `delegateExecutionV1`
|
|
16
|
+
* instruction. Capabilities, services, executives, and reputation live
|
|
17
|
+
* off-chain in that JSON. The plugin only hooks the `Execute` lifecycle
|
|
18
|
+
* event, allowing the URI's authority to gate execution.
|
|
19
|
+
*
|
|
20
|
+
* The most efficient SAP × MPL integration therefore is:
|
|
21
|
+
*
|
|
22
|
+
* 1. SAP serves a **live EIP-8004 JSON** at a deterministic URL derived
|
|
23
|
+
* from the SAP `AgentAccount` PDA (e.g.
|
|
24
|
+
* `https://explorer.oobeprotocol.ai/agents/<sapAgentPda>/eip-8004.json`).
|
|
25
|
+
* 2. The MPL Core asset attaches an `AgentIdentity` adapter whose `uri`
|
|
26
|
+
* points to that URL.
|
|
27
|
+
* 3. Every SAP write (capability change, vault delegate add/revoke, x402
|
|
28
|
+
* tier update) is reflected in the JSON automatically — **no second
|
|
29
|
+
* transaction required, on either chain or for any wallet.**
|
|
30
|
+
*
|
|
31
|
+
* One SAP transaction = both protocols updated. That is the efficiency
|
|
32
|
+
* win that motivated the Phase 1 redesign on 2026-04-22.
|
|
33
|
+
*
|
|
34
|
+
* @category Registries
|
|
35
|
+
* @since v0.9.0
|
|
36
|
+
* @see https://github.com/metaplex-foundation/mpl-core/pull/258
|
|
37
|
+
* @see https://eips.ethereum.org/EIPS/eip-8004
|
|
38
|
+
*/
|
|
39
|
+
import { PublicKey, } from "@solana/web3.js";
|
|
40
|
+
import { deriveAgent, deriveAgentStats, deriveVault } from "../pda";
|
|
41
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
42
|
+
// Lazy peer-dep loader
|
|
43
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
44
|
+
const PEER_DEP_INSTALL_HINT = "MetaplexBridge requires @metaplex-foundation/mpl-core (>=1.9.0) and " +
|
|
45
|
+
"@metaplex-foundation/umi-bundle-defaults. " +
|
|
46
|
+
"Install: npm i @metaplex-foundation/mpl-core @metaplex-foundation/umi-bundle-defaults";
|
|
47
|
+
let cachedRuntime = null;
|
|
48
|
+
async function loadMplCore() {
|
|
49
|
+
if (cachedRuntime)
|
|
50
|
+
return cachedRuntime;
|
|
51
|
+
try {
|
|
52
|
+
const [mplCore, umiBundle, umiCore] = await Promise.all([
|
|
53
|
+
import("@metaplex-foundation/mpl-core"),
|
|
54
|
+
import("@metaplex-foundation/umi-bundle-defaults"),
|
|
55
|
+
import("@metaplex-foundation/umi"),
|
|
56
|
+
]);
|
|
57
|
+
cachedRuntime = { mplCore, umiBundle, umiCore };
|
|
58
|
+
return cachedRuntime;
|
|
59
|
+
}
|
|
60
|
+
catch (cause) {
|
|
61
|
+
throw new Error(PEER_DEP_INSTALL_HINT, { cause: cause });
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
65
|
+
// MetaplexBridge
|
|
66
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
67
|
+
/**
|
|
68
|
+
* @name MetaplexBridge
|
|
69
|
+
* @description Read-side merger and write-side instruction composer for
|
|
70
|
+
* SAP × Metaplex Core `AgentIdentity` integration.
|
|
71
|
+
*
|
|
72
|
+
* Linking is **single-transaction**: the MPL `addExternalPluginAdapterV1`
|
|
73
|
+
* instruction sets a URI that points at SAP's live registration host.
|
|
74
|
+
* Subsequent SAP state changes propagate automatically — no extra MPL
|
|
75
|
+
* transaction required.
|
|
76
|
+
*
|
|
77
|
+
* @category Registries
|
|
78
|
+
* @since v0.9.0
|
|
79
|
+
*/
|
|
80
|
+
export class MetaplexBridge {
|
|
81
|
+
program;
|
|
82
|
+
constructor(program) {
|
|
83
|
+
this.program = program;
|
|
84
|
+
}
|
|
85
|
+
// ─────────────────────────────────────────────────────
|
|
86
|
+
// Pure helpers
|
|
87
|
+
// ─────────────────────────────────────────────────────
|
|
88
|
+
/**
|
|
89
|
+
* @name deriveRegistrationUrl
|
|
90
|
+
* @description Compute the deterministic EIP-8004 registration URL for
|
|
91
|
+
* a SAP agent. Hosts MUST serve the JSON at exactly this path so that
|
|
92
|
+
* {@link MetaplexBridge.verifyLink} validates without external config.
|
|
93
|
+
*
|
|
94
|
+
* @since v0.9.0
|
|
95
|
+
*/
|
|
96
|
+
deriveRegistrationUrl(sapAgentPda, baseUrl) {
|
|
97
|
+
const trimmed = baseUrl.replace(/\/+$/, "");
|
|
98
|
+
return `${trimmed}/agents/${sapAgentPda.toBase58()}/eip-8004.json`;
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* @name buildEip8004Registration
|
|
102
|
+
* @description Build a canonical EIP-8004 JSON document for a SAP agent.
|
|
103
|
+
* Designed to be called server-side by a registry host.
|
|
104
|
+
*
|
|
105
|
+
* @since v0.9.0
|
|
106
|
+
*/
|
|
107
|
+
async buildEip8004Registration(args) {
|
|
108
|
+
const [sapPda] = deriveAgent(args.sapAgentOwner);
|
|
109
|
+
const identity = await this.fetchAgentNullable(sapPda);
|
|
110
|
+
if (!identity) {
|
|
111
|
+
throw new Error(`buildEip8004Registration: SAP agent not found for owner ${args.sapAgentOwner.toBase58()}`);
|
|
112
|
+
}
|
|
113
|
+
const delegates = await this.fetchActiveVaultDelegates(sapPda);
|
|
114
|
+
return {
|
|
115
|
+
version: "0.1",
|
|
116
|
+
name: this.readString(identity, "name") ?? "Synapse Agent",
|
|
117
|
+
description: this.readString(identity, "description") ?? undefined,
|
|
118
|
+
synapseAgent: sapPda.toBase58(),
|
|
119
|
+
authority: args.sapAgentOwner.toBase58(),
|
|
120
|
+
capabilities: this.readCapabilities(identity),
|
|
121
|
+
services: args.services ?? [],
|
|
122
|
+
executives: delegates,
|
|
123
|
+
updatedAt: new Date().toISOString(),
|
|
124
|
+
extra: args.extra,
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
// ─────────────────────────────────────────────────────
|
|
128
|
+
// Write side — build MPL instructions only
|
|
129
|
+
// ─────────────────────────────────────────────────────
|
|
130
|
+
/**
|
|
131
|
+
* @name buildAttachAgentIdentityIx
|
|
132
|
+
* @description Build the MPL Core `addExternalPluginAdapterV1`
|
|
133
|
+
* `TransactionInstruction` that attaches an `AgentIdentity` plugin
|
|
134
|
+
* pointing at SAP's live EIP-8004 registration URL.
|
|
135
|
+
*
|
|
136
|
+
* @since v0.9.0
|
|
137
|
+
*/
|
|
138
|
+
async buildAttachAgentIdentityIx(opts) {
|
|
139
|
+
const [sapPda] = deriveAgent(opts.sapAgentOwner);
|
|
140
|
+
const uri = this.deriveRegistrationUrl(sapPda, opts.registrationBaseUrl);
|
|
141
|
+
return this.buildAddExternalPluginIx({
|
|
142
|
+
asset: opts.asset,
|
|
143
|
+
authority: opts.authority,
|
|
144
|
+
payer: opts.payer ?? opts.authority,
|
|
145
|
+
uri,
|
|
146
|
+
rpcUrl: opts.rpcUrl,
|
|
147
|
+
});
|
|
148
|
+
}
|
|
149
|
+
/**
|
|
150
|
+
* @name buildUpdateAgentIdentityUriIx
|
|
151
|
+
* @description Build the MPL Core `updateExternalPluginAdapterV1`
|
|
152
|
+
* instruction that re-points an existing `AgentIdentity` plugin.
|
|
153
|
+
*
|
|
154
|
+
* @since v0.9.0
|
|
155
|
+
*/
|
|
156
|
+
async buildUpdateAgentIdentityUriIx(opts) {
|
|
157
|
+
const { mplCore, umiBundle, umiCore } = await loadMplCore();
|
|
158
|
+
const umi = umiBundle.createUmi(opts.rpcUrl).use(mplCore.mplCore());
|
|
159
|
+
const authority = umiCore.createNoopSigner(umiCore.publicKey(opts.authority.toBase58()));
|
|
160
|
+
const payer = umiCore.createNoopSigner(umiCore.publicKey((opts.payer ?? opts.authority).toBase58()));
|
|
161
|
+
const builder = mplCore.updateExternalPluginAdapterV1(umi, {
|
|
162
|
+
asset: umiCore.publicKey(opts.asset.toBase58()),
|
|
163
|
+
authority,
|
|
164
|
+
payer,
|
|
165
|
+
key: { __kind: "AgentIdentity" },
|
|
166
|
+
updateInfo: {
|
|
167
|
+
__kind: "AgentIdentity",
|
|
168
|
+
fields: [
|
|
169
|
+
{
|
|
170
|
+
uri: opts.newUri,
|
|
171
|
+
lifecycleChecks: null,
|
|
172
|
+
},
|
|
173
|
+
],
|
|
174
|
+
},
|
|
175
|
+
});
|
|
176
|
+
return this.firstWeb3Ix(builder, "updateExternalPluginAdapterV1");
|
|
177
|
+
}
|
|
178
|
+
// ─────────────────────────────────────────────────────
|
|
179
|
+
// Read side
|
|
180
|
+
// ─────────────────────────────────────────────────────
|
|
181
|
+
/**
|
|
182
|
+
* @name getUnifiedProfile
|
|
183
|
+
* @description Fetch a merged view of an agent across SAP and Metaplex.
|
|
184
|
+
* Provide `wallet` (SAP-first) or `asset` (MPL-first), or both.
|
|
185
|
+
*
|
|
186
|
+
* @since v0.9.0
|
|
187
|
+
*/
|
|
188
|
+
async getUnifiedProfile(input) {
|
|
189
|
+
if (!input.wallet && !input.asset) {
|
|
190
|
+
throw new Error("getUnifiedProfile: provide `wallet` or `asset`");
|
|
191
|
+
}
|
|
192
|
+
let sapPda = null;
|
|
193
|
+
let identity = null;
|
|
194
|
+
let stats = null;
|
|
195
|
+
if (input.wallet) {
|
|
196
|
+
[sapPda] = deriveAgent(input.wallet);
|
|
197
|
+
identity = await this.fetchAgentNullable(sapPda);
|
|
198
|
+
stats = await this.fetchStatsNullable(sapPda);
|
|
199
|
+
}
|
|
200
|
+
let mpl = null;
|
|
201
|
+
if (input.asset) {
|
|
202
|
+
mpl = await this.fetchMplSnapshot(input.asset, input.rpcUrl);
|
|
203
|
+
if (!sapPda && mpl?.registration?.synapseAgent) {
|
|
204
|
+
try {
|
|
205
|
+
sapPda = new PublicKey(mpl.registration.synapseAgent);
|
|
206
|
+
identity = await this.fetchAgentNullable(sapPda);
|
|
207
|
+
stats = await this.fetchStatsNullable(sapPda);
|
|
208
|
+
}
|
|
209
|
+
catch {
|
|
210
|
+
/* invalid PDA in JSON */
|
|
211
|
+
}
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
if (!sapPda) {
|
|
215
|
+
throw new Error("getUnifiedProfile: failed to resolve SAP agent PDA");
|
|
216
|
+
}
|
|
217
|
+
return {
|
|
218
|
+
sap: { pda: sapPda, identity, stats },
|
|
219
|
+
mpl,
|
|
220
|
+
linked: this.detectLink(sapPda, mpl),
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
/**
|
|
224
|
+
* @name verifyLink
|
|
225
|
+
* @description Verify the bidirectional link between an MPL Core asset
|
|
226
|
+
* and a SAP agent. Returns `true` only when both URL and JSON sides
|
|
227
|
+
* reference the SAP agent PDA.
|
|
228
|
+
*
|
|
229
|
+
* @since v0.9.0
|
|
230
|
+
*/
|
|
231
|
+
async verifyLink(args) {
|
|
232
|
+
const snap = await this.fetchMplSnapshot(args.asset, args.rpcUrl);
|
|
233
|
+
if (!snap?.agentIdentityUri || !snap.registration)
|
|
234
|
+
return false;
|
|
235
|
+
const expectedSuffix = `/agents/${args.sapAgentPda.toBase58()}/eip-8004.json`;
|
|
236
|
+
if (!snap.agentIdentityUri.endsWith(expectedSuffix))
|
|
237
|
+
return false;
|
|
238
|
+
return snap.registration.synapseAgent === args.sapAgentPda.toBase58();
|
|
239
|
+
}
|
|
240
|
+
// ═════════════════════════════════════════════════════
|
|
241
|
+
// Private — SAP fetching
|
|
242
|
+
// ═════════════════════════════════════════════════════
|
|
243
|
+
get accounts() {
|
|
244
|
+
return this.program.account;
|
|
245
|
+
}
|
|
246
|
+
async fetchAgentNullable(pda) {
|
|
247
|
+
try {
|
|
248
|
+
return await this.accounts.agentAccount.fetch(pda);
|
|
249
|
+
}
|
|
250
|
+
catch {
|
|
251
|
+
return null;
|
|
252
|
+
}
|
|
253
|
+
}
|
|
254
|
+
async fetchStatsNullable(agentPda) {
|
|
255
|
+
try {
|
|
256
|
+
const [statsPda] = deriveAgentStats(agentPda);
|
|
257
|
+
return await this.accounts.agentStats.fetch(statsPda);
|
|
258
|
+
}
|
|
259
|
+
catch {
|
|
260
|
+
return null;
|
|
261
|
+
}
|
|
262
|
+
}
|
|
263
|
+
async fetchActiveVaultDelegates(agentPda) {
|
|
264
|
+
try {
|
|
265
|
+
const [vaultPda] = deriveVault(agentPda);
|
|
266
|
+
// VaultDelegate layout: [discriminator(8) | bump(1) | vault(32) | ...]
|
|
267
|
+
const all = await this.accounts.vaultDelegate.all([
|
|
268
|
+
{ memcmp: { offset: 8 + 1, bytes: vaultPda.toBase58() } },
|
|
269
|
+
]);
|
|
270
|
+
const now = Math.floor(Date.now() / 1000);
|
|
271
|
+
return all
|
|
272
|
+
.map(({ account }) => {
|
|
273
|
+
const expiresRaw = account.expiresAt.toString();
|
|
274
|
+
const expiresAt = expiresRaw === "0" ? null : expiresRaw;
|
|
275
|
+
return { wallet: account.delegate.toBase58(), expiresAt };
|
|
276
|
+
})
|
|
277
|
+
.filter((d) => d.expiresAt === null || Number(d.expiresAt) > now);
|
|
278
|
+
}
|
|
279
|
+
catch {
|
|
280
|
+
return [];
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
// ═════════════════════════════════════════════════════
|
|
284
|
+
// Private — MPL fetching
|
|
285
|
+
// ═════════════════════════════════════════════════════
|
|
286
|
+
async fetchMplSnapshot(asset, rpcUrl) {
|
|
287
|
+
const { mplCore, umiBundle, umiCore } = await loadMplCore();
|
|
288
|
+
const umi = umiBundle.createUmi(rpcUrl).use(mplCore.mplCore());
|
|
289
|
+
try {
|
|
290
|
+
const fetched = await mplCore.fetchAsset(umi, umiCore.publicKey(asset.toBase58()));
|
|
291
|
+
const owner = new PublicKey(fetched.owner.toString());
|
|
292
|
+
const uri = this.extractAgentIdentityUri(fetched);
|
|
293
|
+
const registration = uri ? await this.fetchEip8004Safe(uri) : null;
|
|
294
|
+
return {
|
|
295
|
+
asset,
|
|
296
|
+
owner,
|
|
297
|
+
name: fetched.name ?? null,
|
|
298
|
+
agentIdentityUri: uri,
|
|
299
|
+
registration,
|
|
300
|
+
};
|
|
301
|
+
}
|
|
302
|
+
catch {
|
|
303
|
+
return null;
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
extractAgentIdentityUri(asset) {
|
|
307
|
+
const adapters = asset.agentIdentities;
|
|
308
|
+
if (!adapters || adapters.length === 0)
|
|
309
|
+
return null;
|
|
310
|
+
const first = adapters[0];
|
|
311
|
+
if (!first)
|
|
312
|
+
return null;
|
|
313
|
+
return typeof first.uri === "string" ? first.uri : null;
|
|
314
|
+
}
|
|
315
|
+
async fetchEip8004Safe(uri) {
|
|
316
|
+
try {
|
|
317
|
+
const res = await fetch(uri, { method: "GET" });
|
|
318
|
+
if (!res.ok)
|
|
319
|
+
return null;
|
|
320
|
+
const json = (await res.json());
|
|
321
|
+
if (typeof json.synapseAgent !== "string" ||
|
|
322
|
+
typeof json.authority !== "string") {
|
|
323
|
+
return null;
|
|
324
|
+
}
|
|
325
|
+
return {
|
|
326
|
+
version: json.version ?? "0.1",
|
|
327
|
+
name: json.name ?? "",
|
|
328
|
+
description: json.description,
|
|
329
|
+
synapseAgent: json.synapseAgent,
|
|
330
|
+
authority: json.authority,
|
|
331
|
+
capabilities: Array.isArray(json.capabilities) ? json.capabilities : [],
|
|
332
|
+
services: Array.isArray(json.services) ? json.services : [],
|
|
333
|
+
executives: Array.isArray(json.executives) ? json.executives : [],
|
|
334
|
+
updatedAt: json.updatedAt ?? "",
|
|
335
|
+
extra: json.extra,
|
|
336
|
+
};
|
|
337
|
+
}
|
|
338
|
+
catch {
|
|
339
|
+
return null;
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
// ═════════════════════════════════════════════════════
|
|
343
|
+
// Private — MPL instruction building
|
|
344
|
+
// ═════════════════════════════════════════════════════
|
|
345
|
+
async buildAddExternalPluginIx(args) {
|
|
346
|
+
const { mplCore, umiBundle, umiCore } = await loadMplCore();
|
|
347
|
+
const umi = umiBundle.createUmi(args.rpcUrl).use(mplCore.mplCore());
|
|
348
|
+
const authority = umiCore.createNoopSigner(umiCore.publicKey(args.authority.toBase58()));
|
|
349
|
+
const payer = umiCore.createNoopSigner(umiCore.publicKey(args.payer.toBase58()));
|
|
350
|
+
// HookableLifecycleEvent.Execute = 4; ExternalCheckResult { flags: 1 } = CanApprove
|
|
351
|
+
const ExecuteEvent = mplCore.HookableLifecycleEvent.Execute;
|
|
352
|
+
const builder = mplCore.addExternalPluginAdapterV1(umi, {
|
|
353
|
+
asset: umiCore.publicKey(args.asset.toBase58()),
|
|
354
|
+
authority,
|
|
355
|
+
payer,
|
|
356
|
+
initInfo: {
|
|
357
|
+
__kind: "AgentIdentity",
|
|
358
|
+
fields: [
|
|
359
|
+
{
|
|
360
|
+
uri: args.uri,
|
|
361
|
+
initPluginAuthority: { __kind: "UpdateAuthority" },
|
|
362
|
+
lifecycleChecks: [[ExecuteEvent, { flags: 1 }]],
|
|
363
|
+
},
|
|
364
|
+
],
|
|
365
|
+
},
|
|
366
|
+
});
|
|
367
|
+
return this.firstWeb3Ix(builder, "addExternalPluginAdapterV1");
|
|
368
|
+
}
|
|
369
|
+
async firstWeb3Ix(builder, name) {
|
|
370
|
+
const items = builder.getInstructions();
|
|
371
|
+
const first = items[0];
|
|
372
|
+
if (!first) {
|
|
373
|
+
throw new Error(`MetaplexBridge: ${name} produced no instructions`);
|
|
374
|
+
}
|
|
375
|
+
return this.umiIxToWeb3(first);
|
|
376
|
+
}
|
|
377
|
+
umiIxToWeb3(ix) {
|
|
378
|
+
return {
|
|
379
|
+
programId: new PublicKey(ix.programId.toString()),
|
|
380
|
+
keys: ix.keys.map((k) => ({
|
|
381
|
+
pubkey: new PublicKey(k.pubkey.toString()),
|
|
382
|
+
isSigner: k.isSigner,
|
|
383
|
+
isWritable: k.isWritable,
|
|
384
|
+
})),
|
|
385
|
+
data: Buffer.from(ix.data),
|
|
386
|
+
};
|
|
387
|
+
}
|
|
388
|
+
// ═════════════════════════════════════════════════════
|
|
389
|
+
// Private — link detection + duck-typed readers
|
|
390
|
+
// ═════════════════════════════════════════════════════
|
|
391
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
392
|
+
detectLink(sapPda, mpl) {
|
|
393
|
+
if (!mpl?.agentIdentityUri || !mpl.registration)
|
|
394
|
+
return false;
|
|
395
|
+
const expectedSuffix = `/agents/${sapPda.toBase58()}/eip-8004.json`;
|
|
396
|
+
if (!mpl.agentIdentityUri.endsWith(expectedSuffix))
|
|
397
|
+
return false;
|
|
398
|
+
return mpl.registration.synapseAgent === sapPda.toBase58();
|
|
399
|
+
}
|
|
400
|
+
readString(identity, key) {
|
|
401
|
+
const value = identity[key];
|
|
402
|
+
return typeof value === "string" ? value : null;
|
|
403
|
+
}
|
|
404
|
+
readCapabilities(identity) {
|
|
405
|
+
const caps = identity.capabilities ?? [];
|
|
406
|
+
return caps.map((c) => c.id).filter((s) => typeof s === "string");
|
|
407
|
+
}
|
|
408
|
+
}
|
|
409
|
+
//# sourceMappingURL=metaplex-bridge.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metaplex-bridge.js","sourceRoot":"","sources":["../../../src/registries/metaplex-bridge.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqCG;AAEH,OAAO,EACL,SAAS,GAEV,MAAM,iBAAiB,CAAC;AAazB,OAAO,EAAE,WAAW,EAAE,gBAAgB,EAAE,WAAW,EAAE,MAAM,QA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QACxE,MAAM,KAAK,GAAG,QAAQ,CAAC,GAAG,CAAC,CAAC;QAC5B,OAAO,OAAO,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC;IAClD,CAAC;IAEO,gBAAgB,CAAC,QAA0B;QACjD,MAAM,IAAI,GAA8B,QAAQ,CAAC,YAAY,IAAI,EAAE,CAAC;QACpE,OAAO,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAe,EAAE,CAAC,OAAO,CAAC,KAAK,QAAQ,CAAC,CAAC;IACjF,CAAC;CACF"}
|
package/dist/esm/types/enums.js
CHANGED
|
@@ -175,7 +175,7 @@ export const ToolCategory = {
|
|
|
175
175
|
* @name SettlementSecurity
|
|
176
176
|
* @description Anchor-compatible enum variants for V2 escrow settlement security levels.
|
|
177
177
|
*
|
|
178
|
-
* - `SelfReport` — Agent settles unilaterally (
|
|
178
|
+
* - `SelfReport` — **DEPRECATED in v0.7** — Agent settles unilaterally (abuse vector).
|
|
179
179
|
* - `CoSigned` — Agent + client must co-sign every settlement.
|
|
180
180
|
* - `DisputeWindow` — Settlement enters pending state, depositor can dispute.
|
|
181
181
|
*
|
|
@@ -183,6 +183,7 @@ export const ToolCategory = {
|
|
|
183
183
|
* @since v0.5.0
|
|
184
184
|
*/
|
|
185
185
|
export const SettlementSecurity = {
|
|
186
|
+
/** @deprecated Removed in v0.7 — returns SelfReportDeprecated error */
|
|
186
187
|
SelfReport: { selfReport: {} },
|
|
187
188
|
CoSigned: { coSigned: {} },
|
|
188
189
|
DisputeWindow: { disputeWindow: {} },
|
|
@@ -202,6 +203,50 @@ export const DisputeOutcome = {
|
|
|
202
203
|
AutoReleased: { autoReleased: {} },
|
|
203
204
|
DepositorWins: { depositorWins: {} },
|
|
204
205
|
AgentWins: { agentWins: {} },
|
|
206
|
+
/** @since v0.7.0 — Proportional refund based on proven vs claimed calls */
|
|
207
|
+
PartialRefund: { partialRefund: {} },
|
|
208
|
+
/** @since v0.7.0 — 50/50 split for irresolvable quality disputes */
|
|
209
|
+
Split: { split: {} },
|
|
210
|
+
};
|
|
211
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
212
|
+
// Dispute Type (v0.7)
|
|
213
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
214
|
+
/**
|
|
215
|
+
* @name DisputeType
|
|
216
|
+
* @description Categories of disputes that can be filed against a pending settlement.
|
|
217
|
+
*
|
|
218
|
+
* - `NonDelivery` — Agent took payment but delivered nothing.
|
|
219
|
+
* - `PartialDelivery` — Agent delivered fewer calls than claimed.
|
|
220
|
+
* - `Overcharge` — Agent charged more than the agreed price.
|
|
221
|
+
* - `Quality` — Agent delivered but output quality is disputed.
|
|
222
|
+
*
|
|
223
|
+
* @category Types
|
|
224
|
+
* @since v0.7.0
|
|
225
|
+
*/
|
|
226
|
+
export const DisputeType = {
|
|
227
|
+
NonDelivery: 0,
|
|
228
|
+
PartialDelivery: 1,
|
|
229
|
+
Overcharge: 2,
|
|
230
|
+
Quality: 3,
|
|
231
|
+
};
|
|
232
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
233
|
+
// Resolution Layer (v0.7)
|
|
234
|
+
// ═══════════════════════════════════════════════════════════════════
|
|
235
|
+
/**
|
|
236
|
+
* @name ResolutionLayer
|
|
237
|
+
* @description How a dispute was resolved.
|
|
238
|
+
*
|
|
239
|
+
* - `Pending` — Not yet resolved.
|
|
240
|
+
* - `Auto` — Resolved automatically via receipt merkle proofs.
|
|
241
|
+
* - `Governance` — Resolved via protocol governance (quality disputes).
|
|
242
|
+
*
|
|
243
|
+
* @category Types
|
|
244
|
+
* @since v0.7.0
|
|
245
|
+
*/
|
|
246
|
+
export const ResolutionLayer = {
|
|
247
|
+
Pending: { pending: {} },
|
|
248
|
+
Auto: { auto: {} },
|
|
249
|
+
Governance: { governance: {} },
|
|
205
250
|
};
|
|
206
251
|
// ═══════════════════════════════════════════════════════════════════
|
|
207
252
|
// Billing Interval (V2.1)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"enums.js","sourceRoot":"","sources":["../../../src/types/enums.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,sEAAsE;AACtE,cAAc;AACd,sEAAsE;AAEtE;;;;;;;;;;;;;;;;;GAiBG;AACH,MAAM,CAAC,MAAM,SAAS,GAAG;IACvB,GAAG,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE;IAChB,IAAI,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;IAClB,GAAG,EAAE,EAAE,GAAG,EAAE,EAAE,EAAE;CACR,CAAC;AASX,sEAAsE;AACtE,eAAe;AACf,sEAAsE;AAEtE;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,MAAM,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;IACtB,UAAU,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE;IAC9B,UAAU,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE;IAC9B,SAAS,EAAE,EAAE,SAAS,EAAE,EAAE,EAAE;IAC5B,UAAU,EAAE,EAAE,UAAU,EAAE,EAAE,EAAE;IAC9B,MAAM,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;CACd,CAAC;AAQX,sEAAsE;AACtE,mBAAmB;AACnB,sEAAsE;AAEtE;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,CAAC,MAAM,cAAc,GAAG;IAC5B,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;IACxB,MAAM,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE;IACtB,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;IACxB,IAAI,EAAE,EAAE,IAAI,EAAE,EAAE,EAAE;CACV,CAAC;AASX,sEAAsE;AACtE,oBAAoB;AACpB,sEAAsE;AAEtE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AAE,MAAM,EAAE,EAAE,EAAE;IACtB,OAAO,EAAE,EAAE,OAAO,EAAE,EAAE,EAAE;CAChB,CAAC"}
|
package/dist/esm/types/index.js
CHANGED
|
@@ -20,6 +20,6 @@
|
|
|
20
20
|
* ```
|
|
21
21
|
*/
|
|
22
22
|
// ── Enums ────────────────────────────────────────────
|
|
23
|
-
export { TokenType, PluginType, SettlementMode, ToolHttpMethod, ToolCategory, SettlementSecurity, DisputeOutcome, BillingInterval, } from "./enums";
|
|
23
|
+
export { TokenType, PluginType, SettlementMode, ToolHttpMethod, ToolCategory, SettlementSecurity, DisputeOutcome, BillingInterval, DisputeType, ResolutionLayer, } from "./enums";
|
|
24
24
|
export { DelegatePermission, SchemaType, CompressionType, } from "./instructions";
|
|
25
25
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,wDAAwD;AACxD,OAAO,EACL,SAAS,EACT,UAAU,EACV,cAAc,EACd,cAAc,EACd,YAAY,EACZ,kBAAkB,EAClB,cAAc,EACd,eAAe,GAChB,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AAEH,wDAAwD;AACxD,OAAO,EACL,SAAS,EACT,UAAU,EACV,cAAc,EACd,cAAc,EACd,YAAY,EACZ,kBAAkB,EAClB,cAAc,EACd,eAAe,EACf,WAAW,EACX,eAAe,GAChB,MAAM,SAAS,CAAC;AAyEjB,OAAO,EACL,kBAAkB,EAClB,UAAU,EACV,eAAe,GAChB,MAAM,gBAAgB,CAAC"}
|
|
@@ -56,6 +56,8 @@ export declare const SEEDS: {
|
|
|
56
56
|
readonly SUBSCRIPTION: "sap_sub";
|
|
57
57
|
readonly SHARD: "sap_shard";
|
|
58
58
|
readonly INDEX_PAGE: "sap_idx_page";
|
|
59
|
+
/** @since v0.7.0 — Receipt batch merkle root PDA */
|
|
60
|
+
readonly RECEIPT: "sap_receipt";
|
|
59
61
|
};
|
|
60
62
|
/**
|
|
61
63
|
* Union type of all valid keys in the {@link SEEDS} object.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"seeds.d.ts","sourceRoot":"","sources":["../../../src/constants/seeds.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"seeds.d.ts","sourceRoot":"","sources":["../../../src/constants/seeds.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAMH;;;;;;;;;;;;;;;;;;GAkBG;AACH,eAAO,MAAM,KAAK;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IA8BhB,oDAAoD;;CAE5C,CAAC;AAEX;;;;;;;;GAQG;AACH,MAAM,MAAM,OAAO,GAAG,MAAM,OAAO,KAAK,CAAC"}
|
|
@@ -32,6 +32,7 @@ import { ToolsModule } from "../modules/tools";
|
|
|
32
32
|
import { VaultModule } from "../modules/vault";
|
|
33
33
|
import { EscrowModule } from "../modules/escrow";
|
|
34
34
|
import { EscrowV2Module } from "../modules/escrow-v2";
|
|
35
|
+
import { ReceiptModule } from "../modules/receipt";
|
|
35
36
|
import { StakingModule } from "../modules/staking";
|
|
36
37
|
import { SubscriptionModule } from "../modules/subscription";
|
|
37
38
|
import { AttestationModule } from "../modules/attestation";
|
|
@@ -42,6 +43,7 @@ import { DiscoveryRegistry } from "../registries/discovery";
|
|
|
42
43
|
import { X402Registry } from "../registries/x402";
|
|
43
44
|
import { SessionManager } from "../registries/session";
|
|
44
45
|
import { AgentBuilder } from "../registries/builder";
|
|
46
|
+
import { MetaplexBridge } from "../registries/metaplex-bridge";
|
|
45
47
|
/** Re-usable Anchor program type (untyped — SDK provides its own types). */
|
|
46
48
|
type SapProgram = Program<any>;
|
|
47
49
|
/**
|
|
@@ -223,6 +225,15 @@ export declare class SapClient {
|
|
|
223
225
|
* @see {@link EscrowV2Module}
|
|
224
226
|
*/
|
|
225
227
|
get escrowV2(): EscrowV2Module;
|
|
228
|
+
/**
|
|
229
|
+
* @name receipt
|
|
230
|
+
* @description Receipt batch inscriptions and automatic dispute resolution (v0.7).
|
|
231
|
+
* @returns {ReceiptModule} The lazily-instantiated `ReceiptModule` singleton.
|
|
232
|
+
* @category Modules
|
|
233
|
+
* @since v0.7.0
|
|
234
|
+
* @see {@link ReceiptModule}
|
|
235
|
+
*/
|
|
236
|
+
get receipt(): ReceiptModule;
|
|
226
237
|
/**
|
|
227
238
|
* @name staking
|
|
228
239
|
* @description Agent staking: init stake, deposit, request unstake,
|
|
@@ -370,6 +381,33 @@ export declare class SapClient {
|
|
|
370
381
|
* ```
|
|
371
382
|
*/
|
|
372
383
|
get builder(): AgentBuilder;
|
|
384
|
+
/**
|
|
385
|
+
* @name metaplex
|
|
386
|
+
* @description Bridge between SAP and the Metaplex Agent Kit
|
|
387
|
+
* (MPL Core Asset + AgentIdentity plugin). Read-side merges SAP
|
|
388
|
+
* `AgentAccount` with MPL Core asset metadata; write-side composes
|
|
389
|
+
* atomic dual-protocol delegation instructions.
|
|
390
|
+
*
|
|
391
|
+
* Requires the optional peer dependencies
|
|
392
|
+
* `@metaplex-foundation/mpl-core` and
|
|
393
|
+
* `@metaplex-foundation/umi-bundle-defaults`. They are imported lazily
|
|
394
|
+
* the first time a method that needs them is called, so consumers that
|
|
395
|
+
* do not use the bridge incur zero overhead.
|
|
396
|
+
*
|
|
397
|
+
* @returns {MetaplexBridge} The lazily-instantiated `MetaplexBridge` singleton.
|
|
398
|
+
* @category Registries
|
|
399
|
+
* @since v0.9.0
|
|
400
|
+
* @see {@link MetaplexBridge}
|
|
401
|
+
*
|
|
402
|
+
* @example
|
|
403
|
+
* ```ts
|
|
404
|
+
* const profile = await client.metaplex.getUnifiedProfile({
|
|
405
|
+
* wallet: agentWallet,
|
|
406
|
+
* rpcUrl: "https://api.mainnet-beta.solana.com",
|
|
407
|
+
* });
|
|
408
|
+
* ```
|
|
409
|
+
*/
|
|
410
|
+
get metaplex(): MetaplexBridge;
|
|
373
411
|
}
|
|
374
412
|
export {};
|
|
375
413
|
//# sourceMappingURL=client.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../src/core/client.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAE,KAAK,cAAc,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAEjD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAC/C,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAC;AAC7D,OAAO,EAAE,iBAAiB,EAAE,MAAM,wBAAwB,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AACjD,OAAO,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AACxC,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,iBAAiB,EA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