agentwallet-sdk 6.0.5 → 6.2.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.
Files changed (40) hide show
  1. package/README.md +201 -1
  2. package/dist/bridge/solana.d.ts.map +1 -1
  3. package/dist/bridge/types.d.ts.map +1 -1
  4. package/dist/identity/index.d.ts +2 -0
  5. package/dist/identity/index.d.ts.map +1 -1
  6. package/dist/identity/index.js +2 -0
  7. package/dist/identity/index.js.map +1 -1
  8. package/dist/identity/uaid.d.ts +193 -0
  9. package/dist/identity/uaid.d.ts.map +1 -0
  10. package/dist/identity/uaid.js +296 -0
  11. package/dist/identity/uaid.js.map +1 -0
  12. package/dist/index.d.ts +4994 -13961
  13. package/dist/index.d.ts.map +1 -1
  14. package/dist/index.js +6 -0
  15. package/dist/index.js.map +1 -1
  16. package/dist/policy/UptoBillingPolicy.d.ts +88 -0
  17. package/dist/policy/UptoBillingPolicy.d.ts.map +1 -0
  18. package/dist/policy/UptoBillingPolicy.js +183 -0
  19. package/dist/policy/UptoBillingPolicy.js.map +1 -0
  20. package/dist/policy/UptoBillingPolicy.test.d.ts +2 -0
  21. package/dist/policy/UptoBillingPolicy.test.d.ts.map +1 -0
  22. package/dist/policy/UptoBillingPolicy.test.js +102 -0
  23. package/dist/policy/UptoBillingPolicy.test.js.map +1 -0
  24. package/dist/router/PaymentRouter.d.ts +79 -0
  25. package/dist/router/PaymentRouter.d.ts.map +1 -0
  26. package/dist/router/PaymentRouter.js +144 -0
  27. package/dist/router/PaymentRouter.js.map +1 -0
  28. package/dist/router/index.d.ts +3 -0
  29. package/dist/router/index.d.ts.map +1 -0
  30. package/dist/router/index.js +2 -0
  31. package/dist/router/index.js.map +1 -0
  32. package/dist/swap/SwapModule.d.ts +2 -2
  33. package/dist/swap/SwapModule.d.ts.map +1 -1
  34. package/dist/swap/types.d.ts.map +1 -1
  35. package/dist/tokens/solana.d.ts.map +1 -1
  36. package/package.json +2 -2
  37. package/dist/x402/chains/stellar/index.d.ts +0 -149
  38. package/dist/x402/chains/stellar/index.d.ts.map +0 -1
  39. package/dist/x402/chains/stellar/index.js +0 -199
  40. package/dist/x402/chains/stellar/index.js.map +0 -1
@@ -0,0 +1,296 @@
1
+ /**
2
+ * uaid.ts — Universal Agent Identifier (UAID) Resolution Layer
3
+ *
4
+ * Provides cross-chain agent identity resolution via the HOL Registry Broker.
5
+ * UAIDs are chain-agnostic identifiers that bridge ERC-8004 tokens on EVM chains
6
+ * to agents on Solana, Hedera, off-chain frameworks, and any other protocol.
7
+ *
8
+ * This module is an optional extension — agents that only operate on EVM chains
9
+ * can continue using ERC8004Client directly.
10
+ *
11
+ * Registry: https://hol.org
12
+ * SDK: @hol-org/rb-client (peer dependency — install only if needed)
13
+ *
14
+ * @module identity/uaid
15
+ */
16
+ // ─── Constants ───────────────────────────────────────────────────────────────
17
+ const DEFAULT_BROKER_URL = 'https://hol.org/registry/api/v1';
18
+ const DEFAULT_TIMEOUT_MS = 10000;
19
+ const DEFAULT_CACHE_TTL_MS = 300000; // 5 minutes
20
+ /** EVM chain IDs for UAID protocol mapping */
21
+ const EVM_CHAIN_IDS = {
22
+ 'ethereum': 1,
23
+ 'base': 8453,
24
+ 'base-sepolia': 84532,
25
+ 'arbitrum': 42161,
26
+ 'arbitrum-sepolia': 421614,
27
+ 'polygon': 137,
28
+ };
29
+ // ─── Client ──────────────────────────────────────────────────────────────────
30
+ export class UAIDResolver {
31
+ constructor(config = {}) {
32
+ this.cache = new Map();
33
+ this.brokerUrl = (config.brokerUrl ?? DEFAULT_BROKER_URL).replace(/\/+$/, '');
34
+ this.apiKey = config.apiKey;
35
+ this.timeoutMs = config.timeoutMs ?? DEFAULT_TIMEOUT_MS;
36
+ this.cacheTtlMs = config.cacheTtlMs ?? DEFAULT_CACHE_TTL_MS;
37
+ }
38
+ // ── Core resolution ──────────────────────────────────────────────────────
39
+ /**
40
+ * Resolve a UAID to an agent identity.
41
+ *
42
+ * Works across chains — the resolver contacts the HOL Registry Broker to
43
+ * find the agent's identity regardless of whether it lives on EVM, Hedera,
44
+ * Solana, or off-chain.
45
+ *
46
+ * @param uaid - Universal Agent Identifier string
47
+ * @returns Resolution result with identity details
48
+ *
49
+ * @example
50
+ * ```ts
51
+ * const resolver = new UAIDResolver();
52
+ * const result = await resolver.resolve('uaid:aid:0x8004...;uid=42;proto=erc8004');
53
+ * if (result.resolved) {
54
+ * console.log(result.identity?.paymentAddress);
55
+ * }
56
+ * ```
57
+ */
58
+ async resolve(uaid) {
59
+ // Check cache
60
+ const cached = this.cache.get(uaid);
61
+ if (cached && cached.expiresAt > Date.now()) {
62
+ return cached.result;
63
+ }
64
+ try {
65
+ const response = await this.brokerRequest('GET', `/agents/resolve?uaid=${encodeURIComponent(uaid)}`);
66
+ if (!response.ok) {
67
+ const result = {
68
+ resolved: false, uaid, identity: null, protocol: 'unknown',
69
+ registryVerified: false, error: `Registry returned ${response.status}`,
70
+ };
71
+ return result;
72
+ }
73
+ const data = await response.json();
74
+ const identity = {
75
+ agentId: String(data.agentId ?? data.nativeId ?? ''),
76
+ owner: data.owner ?? data.controller ?? '',
77
+ agentURI: data.agentURI ?? data.metadataUri ?? '',
78
+ paymentAddress: data.paymentAddress ?? data.agentWallet ?? '',
79
+ registrationFile: data.registrationFile ?? null,
80
+ protocol: data.protocol ?? 'unknown',
81
+ chain: data.chain ?? '',
82
+ uaid,
83
+ };
84
+ const result = {
85
+ resolved: true, uaid, identity,
86
+ protocol: data.protocol ?? 'unknown',
87
+ chain: data.chain,
88
+ trustScore: data.trustScore,
89
+ registryVerified: data.verified ?? false,
90
+ };
91
+ // Cache the result
92
+ this.cache.set(uaid, { result, expiresAt: Date.now() + this.cacheTtlMs });
93
+ return result;
94
+ }
95
+ catch (error) {
96
+ const message = error instanceof Error ? error.message : String(error);
97
+ return {
98
+ resolved: false, uaid, identity: null, protocol: 'unknown',
99
+ registryVerified: false, error: `Resolution failed: ${message}`,
100
+ };
101
+ }
102
+ }
103
+ /**
104
+ * Search the HOL registry for agents matching criteria.
105
+ *
106
+ * @param query - Search terms (name, capability, protocol)
107
+ * @param options - Optional filters
108
+ * @returns Array of matching UAIDResolution results
109
+ */
110
+ async search(query, options) {
111
+ try {
112
+ const params = new URLSearchParams({ q: query });
113
+ if (options?.protocol)
114
+ params.set('protocol', options.protocol);
115
+ if (options?.limit)
116
+ params.set('limit', String(options.limit));
117
+ if (options?.minTrustScore)
118
+ params.set('minTrust', String(options.minTrustScore));
119
+ const response = await this.brokerRequest('GET', `/agents/search?${params}`);
120
+ if (!response.ok)
121
+ return [];
122
+ const data = await response.json();
123
+ const results = (data.agents ?? []).map((agent) => ({
124
+ resolved: true,
125
+ uaid: agent.uaid,
126
+ identity: {
127
+ agentId: String(agent.agentId ?? agent.nativeId ?? ''),
128
+ owner: (agent.owner ?? agent.controller ?? ''),
129
+ agentURI: (agent.agentURI ?? agent.metadataUri ?? ''),
130
+ paymentAddress: (agent.paymentAddress ?? agent.agentWallet ?? ''),
131
+ registrationFile: (agent.registrationFile ?? null),
132
+ protocol: (agent.protocol ?? 'unknown'),
133
+ chain: (agent.chain ?? ''),
134
+ uaid: agent.uaid,
135
+ },
136
+ protocol: (agent.protocol ?? 'unknown'),
137
+ chain: agent.chain,
138
+ trustScore: agent.trustScore,
139
+ registryVerified: (agent.verified ?? false),
140
+ }));
141
+ return results;
142
+ }
143
+ catch {
144
+ return [];
145
+ }
146
+ }
147
+ // ── ERC-8004 ↔ UAID bridge ────────────────────────────────────────────────
148
+ /**
149
+ * Convert an ERC-8004 AgentIdentity to a UniversalAgentIdentity.
150
+ *
151
+ * Useful when you already have an on-chain identity and want to work
152
+ * with the universal format (e.g., for cross-chain discovery).
153
+ */
154
+ erc8004ToUniversal(identity, chain) {
155
+ const chainId = EVM_CHAIN_IDS[chain];
156
+ return {
157
+ agentId: identity.agentId.toString(),
158
+ owner: identity.owner,
159
+ agentURI: identity.agentURI,
160
+ paymentAddress: identity.agentWallet,
161
+ registrationFile: identity.registrationFile,
162
+ protocol: 'erc8004',
163
+ chain: `eip155:${chainId}`,
164
+ uaid: `uaid:aid:eip155:${chainId}:${identity.owner};uid=${identity.agentId};proto=erc8004`,
165
+ };
166
+ }
167
+ /**
168
+ * Build a UAID string for an ERC-8004 agent.
169
+ *
170
+ * This creates the identifier — it does NOT register with the HOL registry.
171
+ * Use registerERC8004Agent() to make the agent discoverable cross-chain.
172
+ */
173
+ buildERC8004UAID(agentId, chain, ownerAddress) {
174
+ const chainId = EVM_CHAIN_IDS[chain];
175
+ return `uaid:aid:eip155:${chainId}:${ownerAddress};uid=${agentId};proto=erc8004`;
176
+ }
177
+ /**
178
+ * Register an ERC-8004 agent in the HOL registry for cross-chain discovery.
179
+ *
180
+ * After registration, agents on Solana, Hedera, or any protocol can
181
+ * discover and verify this agent's identity via its UAID.
182
+ *
183
+ * Requires an API key with write permissions.
184
+ *
185
+ * @param params - Registration parameters
186
+ * @returns The assigned UAID
187
+ */
188
+ async registerERC8004Agent(params) {
189
+ if (!this.apiKey) {
190
+ throw new Error('UAIDResolver: API key required for registration. Get one at https://hol.org');
191
+ }
192
+ const chainId = EVM_CHAIN_IDS[params.chain];
193
+ const uaid = `uaid:aid:eip155:${chainId}:${params.registryAddress ?? '0x8004A169FB4a3325136EB29fA0ceB6D2e539a432'};uid=${params.agentId};proto=erc8004`;
194
+ const response = await this.brokerRequest('POST', '/agents/register', {
195
+ uaid,
196
+ protocol: 'erc8004',
197
+ chain: `eip155:${chainId}`,
198
+ agentId: params.agentId.toString(),
199
+ name: params.name,
200
+ description: params.description,
201
+ capabilities: params.capabilities ?? [],
202
+ registryAddress: params.registryAddress ?? '0x8004A169FB4a3325136EB29fA0ceB6D2e539a432',
203
+ });
204
+ if (!response.ok) {
205
+ const errorBody = await response.text().catch(() => '');
206
+ throw new Error(`UAIDResolver: Registration failed (${response.status}): ${errorBody}`);
207
+ }
208
+ const data = await response.json();
209
+ return data.uaid ?? uaid;
210
+ }
211
+ // ── Verification ──────────────────────────────────────────────────────────
212
+ /**
213
+ * Verify an agent's identity via UAID — works across any chain.
214
+ *
215
+ * This is the cross-chain equivalent of ERC8004Client.lookupAgentIdentity().
216
+ * For EVM agents, it verifies the UAID maps to a valid on-chain ERC-8004 token.
217
+ * For non-EVM agents, it verifies through the registry's native trust mechanism.
218
+ *
219
+ * @param uaid - Universal Agent Identifier to verify
220
+ * @returns Verification result
221
+ */
222
+ async verify(uaid) {
223
+ const resolution = await this.resolve(uaid);
224
+ if (!resolution.resolved || !resolution.identity) {
225
+ return {
226
+ verified: false,
227
+ identity: null,
228
+ trustScore: 0,
229
+ protocol: resolution.protocol,
230
+ error: resolution.error ?? 'Agent not found in registry',
231
+ };
232
+ }
233
+ return {
234
+ verified: resolution.registryVerified,
235
+ identity: resolution.identity,
236
+ trustScore: resolution.trustScore ?? 0,
237
+ protocol: resolution.protocol,
238
+ };
239
+ }
240
+ // ── Utility ───────────────────────────────────────────────────────────────
241
+ /**
242
+ * Parse a UAID string into its components.
243
+ *
244
+ * Format: `uaid:aid:<identifier>;uid=<unique-id>;proto=<protocol>[;nativeId=<id>]`
245
+ */
246
+ static parseUAID(uaid) {
247
+ if (!uaid.startsWith('uaid:'))
248
+ return null;
249
+ const parts = uaid.split(';');
250
+ const aidPart = parts.find(p => p.startsWith('uaid:aid:'));
251
+ const uidPart = parts.find(p => p.startsWith('uid='));
252
+ const protoPart = parts.find(p => p.startsWith('proto='));
253
+ const nativeIdPart = parts.find(p => p.startsWith('nativeId='));
254
+ if (!aidPart || !uidPart || !protoPart)
255
+ return null;
256
+ return {
257
+ raw: uaid,
258
+ aid: aidPart.replace('uaid:aid:', ''),
259
+ uid: uidPart.replace('uid=', ''),
260
+ protocol: protoPart.replace('proto=', ''),
261
+ nativeId: nativeIdPart?.replace('nativeId=', ''),
262
+ };
263
+ }
264
+ /** Clear the resolution cache */
265
+ clearCache() {
266
+ this.cache.clear();
267
+ }
268
+ // ── Private ───────────────────────────────────────────────────────────────
269
+ async brokerRequest(method, path, body) {
270
+ const url = `${this.brokerUrl}${path}`;
271
+ const headers = {
272
+ 'Accept': 'application/json',
273
+ 'User-Agent': 'agentwallet-sdk/uaid-resolver',
274
+ };
275
+ if (this.apiKey) {
276
+ headers['Authorization'] = `Bearer ${this.apiKey}`;
277
+ }
278
+ if (body) {
279
+ headers['Content-Type'] = 'application/json';
280
+ }
281
+ const controller = new AbortController();
282
+ const timeout = setTimeout(() => controller.abort(), this.timeoutMs);
283
+ try {
284
+ return await fetch(url, {
285
+ method,
286
+ headers,
287
+ body: body ? JSON.stringify(body) : undefined,
288
+ signal: controller.signal,
289
+ });
290
+ }
291
+ finally {
292
+ clearTimeout(timeout);
293
+ }
294
+ }
295
+ }
296
+ //# sourceMappingURL=uaid.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"uaid.js","sourceRoot":"","sources":["../../src/identity/uaid.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAwGH,gFAAgF;AAEhF,MAAM,kBAAkB,GAAG,iCAAiC,CAAC;AAC7D,MAAM,kBAAkB,GAAG,KAAM,CAAC;AAClC,MAAM,oBAAoB,GAAG,MAAO,CAAC,CAAC,YAAY;AAElD,8CAA8C;AAC9C,MAAM,aAAa,GAAmC;IACpD,UAAU,EAAE,CAAC;IACb,MAAM,EAAE,IAAI;IACZ,cAAc,EAAE,KAAK;IACrB,UAAU,EAAE,KAAK;IACjB,kBAAkB,EAAE,MAAM;IAC1B,SAAS,EAAE,GAAG;CACf,CAAC;AASF,gFAAgF;AAEhF,MAAM,OAAO,YAAY;IAOvB,YAAY,SAA6B,EAAE;QAF1B,UAAK,GAAG,IAAI,GAAG,EAAsB,CAAC;QAGrD,IAAI,CAAC,SAAS,GAAG,CAAC,MAAM,CAAC,SAAS,IAAI,kBAAkB,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC;QAC9E,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;QAC5B,IAAI,CAAC,SAAS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