@ch4r10teer41/clawpass 1.0.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.
@@ -0,0 +1,1611 @@
1
+ import { Provider, Signer } from 'ethers';
2
+ import { z } from 'zod';
3
+
4
+ /**
5
+ * Core type definitions for ERC-8004 Trustless Agents
6
+ */
7
+ interface AgentRegistry {
8
+ namespace: string;
9
+ chainId: string;
10
+ identityRegistry: string;
11
+ }
12
+ interface AgentService {
13
+ name: string;
14
+ endpoint: string;
15
+ version?: string;
16
+ skills?: string[];
17
+ domains?: string[];
18
+ }
19
+ interface AgentRegistration {
20
+ agentId: number;
21
+ agentRegistry: string;
22
+ }
23
+ interface AgentRegistrationFile {
24
+ type: string;
25
+ name: string;
26
+ description: string;
27
+ image?: string;
28
+ services: AgentService[];
29
+ x402Support: boolean;
30
+ active: boolean;
31
+ registrations: AgentRegistration[];
32
+ supportedTrust?: ('reputation' | 'crypto-economic' | 'tee-attestation')[];
33
+ }
34
+ interface MetadataEntry {
35
+ metadataKey: string;
36
+ metadataValue: string;
37
+ }
38
+ interface FeedbackData {
39
+ agentId: number;
40
+ value: bigint;
41
+ valueDecimals: number;
42
+ tag1?: string;
43
+ tag2?: string;
44
+ endpoint?: string;
45
+ feedbackURI?: string;
46
+ feedbackHash?: string;
47
+ }
48
+ interface FeedbackRecord {
49
+ agentId: bigint;
50
+ clientAddress: string;
51
+ feedbackIndex: bigint;
52
+ value: bigint;
53
+ valueDecimals: number;
54
+ tag1: string;
55
+ tag2: string;
56
+ isRevoked: boolean;
57
+ }
58
+ interface FeedbackFile {
59
+ agentRegistry: string;
60
+ agentId: number;
61
+ clientAddress: string;
62
+ createdAt: string;
63
+ value: number;
64
+ valueDecimals: number;
65
+ tag1?: string;
66
+ tag2?: string;
67
+ endpoint?: string;
68
+ mcp?: {
69
+ tool?: string;
70
+ prompt?: string;
71
+ resource?: string;
72
+ };
73
+ a2a?: {
74
+ skills?: string[];
75
+ contextId?: string;
76
+ taskId?: string;
77
+ };
78
+ oasf?: {
79
+ skills?: string[];
80
+ domains?: string[];
81
+ };
82
+ proofOfPayment?: {
83
+ fromAddress: string;
84
+ toAddress: string;
85
+ chainId: string;
86
+ txHash: string;
87
+ };
88
+ [key: string]: unknown;
89
+ }
90
+ interface ValidationRequest {
91
+ validatorAddress: string;
92
+ agentId: number;
93
+ requestURI: string;
94
+ requestHash: string;
95
+ }
96
+ interface ValidationResponse {
97
+ requestHash: string;
98
+ response: number;
99
+ responseURI?: string;
100
+ responseHash?: string;
101
+ tag?: string;
102
+ }
103
+ interface ValidationStatus {
104
+ validatorAddress: string;
105
+ agentId: number;
106
+ response: number;
107
+ responseHash: string;
108
+ tag: string;
109
+ lastUpdate: bigint;
110
+ }
111
+ interface ValidationSummary {
112
+ count: bigint;
113
+ averageResponse: number;
114
+ }
115
+ interface FeedbackSummary {
116
+ count: bigint;
117
+ summaryValue: bigint;
118
+ summaryValueDecimals: number;
119
+ }
120
+ interface AgentIdentifier {
121
+ agentRegistry: AgentRegistry;
122
+ agentId: number;
123
+ }
124
+ declare function formatAgentRegistry(registry: AgentRegistry): string;
125
+ declare function parseAgentRegistry(registryString: string): AgentRegistry;
126
+
127
+ /**
128
+ * Client for interacting with ERC-8004 Identity Registry
129
+ */
130
+
131
+ declare class IdentityRegistryClient {
132
+ private contract;
133
+ private signer?;
134
+ constructor(contractAddress: string, providerOrSigner: Provider | Signer);
135
+ /**
136
+ * Register a new agent with URI and optional metadata
137
+ */
138
+ register(agentURI?: string, metadata?: MetadataEntry[]): Promise<bigint>;
139
+ /**
140
+ * Update the agent URI
141
+ */
142
+ setAgentURI(agentId: bigint, newURI: string): Promise<void>;
143
+ /**
144
+ * Get the agent URI (tokenURI)
145
+ */
146
+ getAgentURI(agentId: bigint): Promise<string>;
147
+ /**
148
+ * Fetch and parse the agent registration file from URI
149
+ */
150
+ getAgentRegistrationFile(agentId: bigint): Promise<AgentRegistrationFile>;
151
+ /**
152
+ * Set metadata for an agent
153
+ */
154
+ setMetadata(agentId: bigint, metadataKey: string, metadataValue: string): Promise<void>;
155
+ /**
156
+ * Get metadata for an agent
157
+ */
158
+ getMetadata(agentId: bigint, metadataKey: string): Promise<string>;
159
+ /**
160
+ * Get the agent wallet address
161
+ */
162
+ getAgentWallet(agentId: bigint): Promise<string>;
163
+ /**
164
+ * Set the agent wallet with signature
165
+ */
166
+ setAgentWallet(agentId: bigint, newWallet: string, deadline: bigint, signature: string): Promise<void>;
167
+ /**
168
+ * Unset the agent wallet
169
+ */
170
+ unsetAgentWallet(agentId: bigint): Promise<void>;
171
+ /**
172
+ * Get the owner of an agent
173
+ */
174
+ getOwner(agentId: bigint): Promise<string>;
175
+ /**
176
+ * Create a signature for setting agent wallet (EIP-712)
177
+ */
178
+ createAgentWalletSignature(agentId: bigint, newWallet: string, deadline: bigint, chainId: bigint): Promise<string>;
179
+ }
180
+
181
+ /**
182
+ * Client for interacting with ERC-8004 Reputation Registry
183
+ */
184
+
185
+ declare class ReputationRegistryClient {
186
+ private contract;
187
+ private signer?;
188
+ constructor(contractAddress: string, providerOrSigner: Provider | Signer);
189
+ /**
190
+ * Get the identity registry address
191
+ */
192
+ getIdentityRegistry(): Promise<string>;
193
+ /**
194
+ * Give feedback to an agent
195
+ */
196
+ giveFeedback(feedback: FeedbackData): Promise<void>;
197
+ /**
198
+ * Revoke feedback
199
+ */
200
+ revokeFeedback(agentId: bigint, feedbackIndex: bigint): Promise<void>;
201
+ /**
202
+ * Append a response to feedback
203
+ */
204
+ appendResponse(agentId: bigint, clientAddress: string, feedbackIndex: bigint, responseURI: string, responseHash?: string): Promise<void>;
205
+ /**
206
+ * Get feedback summary for an agent
207
+ */
208
+ getSummary(agentId: bigint, clientAddresses: string[], tag1?: string, tag2?: string): Promise<FeedbackSummary>;
209
+ /**
210
+ * Read a specific feedback
211
+ */
212
+ readFeedback(agentId: bigint, clientAddress: string, feedbackIndex: bigint): Promise<FeedbackRecord>;
213
+ /**
214
+ * Read all feedback for an agent with optional filters
215
+ */
216
+ readAllFeedback(agentId: bigint, clientAddresses?: string[], tag1?: string, tag2?: string, includeRevoked?: boolean): Promise<FeedbackRecord[]>;
217
+ /**
218
+ * Get response count for feedback
219
+ */
220
+ getResponseCount(agentId: bigint, clientAddress?: string, feedbackIndex?: bigint, responders?: string[]): Promise<bigint>;
221
+ /**
222
+ * Get all clients who gave feedback to an agent
223
+ */
224
+ getClients(agentId: bigint): Promise<string[]>;
225
+ /**
226
+ * Get the last feedback index for a client-agent pair
227
+ */
228
+ getLastIndex(agentId: bigint, clientAddress: string): Promise<bigint>;
229
+ /**
230
+ * Fetch and parse feedback file from URI
231
+ */
232
+ getFeedbackFile(feedbackURI: string): Promise<FeedbackFile>;
233
+ /**
234
+ * Calculate hash for feedback file content
235
+ */
236
+ static calculateFeedbackHash(content: string): string;
237
+ }
238
+
239
+ /**
240
+ * Client for interacting with ERC-8004 Validation Registry
241
+ */
242
+
243
+ declare class ValidationRegistryClient {
244
+ private contract;
245
+ private signer?;
246
+ constructor(contractAddress: string, providerOrSigner: Provider | Signer);
247
+ /**
248
+ * Get the identity registry address
249
+ */
250
+ getIdentityRegistry(): Promise<string>;
251
+ /**
252
+ * Submit a validation request
253
+ */
254
+ validationRequest(request: ValidationRequest): Promise<void>;
255
+ /**
256
+ * Submit a validation response (called by validator)
257
+ */
258
+ validationResponse(response: ValidationResponse): Promise<void>;
259
+ /**
260
+ * Get validation status for a request
261
+ */
262
+ getValidationStatus(requestHash: string): Promise<ValidationStatus>;
263
+ /**
264
+ * Get validation summary for an agent
265
+ */
266
+ getSummary(agentId: bigint, validatorAddresses?: string[], tag?: string): Promise<ValidationSummary>;
267
+ /**
268
+ * Get all validation request hashes for an agent
269
+ */
270
+ getAgentValidations(agentId: bigint): Promise<string[]>;
271
+ /**
272
+ * Get all validation request hashes for a validator
273
+ */
274
+ getValidatorRequests(validatorAddress: string): Promise<string[]>;
275
+ /**
276
+ * Calculate request hash from request data
277
+ */
278
+ static calculateRequestHash(requestData: string): string;
279
+ /**
280
+ * Calculate response hash from response data
281
+ */
282
+ static calculateResponseHash(responseData: string): string;
283
+ }
284
+
285
+ interface ClawpassConfig {
286
+ identityRegistryAddress: string;
287
+ reputationRegistryAddress: string;
288
+ validationRegistryAddress: string;
289
+ providerOrSigner: Provider | Signer;
290
+ }
291
+ /**
292
+ * Main Clawpass client providing unified access to all ERC-8004 registries
293
+ */
294
+ declare class ClawpassClient {
295
+ readonly identity: IdentityRegistryClient;
296
+ readonly reputation: ReputationRegistryClient;
297
+ readonly validation: ValidationRegistryClient;
298
+ constructor(config: ClawpassConfig);
299
+ /**
300
+ * Verify that reputation and validation registries are linked to the identity registry
301
+ */
302
+ verifyRegistryLinks(): Promise<boolean>;
303
+ /**
304
+ * Get comprehensive agent information
305
+ */
306
+ getAgentInfo(agentId: bigint): Promise<{
307
+ agentId: bigint;
308
+ owner: string;
309
+ wallet: string;
310
+ registration: AgentRegistrationFile;
311
+ }>;
312
+ /**
313
+ * Get agent reputation summary from trusted clients
314
+ */
315
+ getAgentReputation(agentId: bigint, trustedClients: string[], tag1?: string, tag2?: string): Promise<{
316
+ summary: FeedbackSummary;
317
+ feedback: FeedbackRecord[];
318
+ }>;
319
+ /**
320
+ * Get agent validation summary
321
+ */
322
+ getAgentValidationSummary(agentId: bigint, validatorAddresses?: string[], tag?: string): Promise<{
323
+ summary: ValidationSummary;
324
+ validationCount: number;
325
+ validationHashes: string[];
326
+ }>;
327
+ }
328
+
329
+ /**
330
+ * Zod schemas for runtime validation of ERC-8004 data structures
331
+ */
332
+
333
+ declare const AgentServiceSchema: z.ZodObject<{
334
+ name: z.ZodString;
335
+ endpoint: z.ZodString;
336
+ version: z.ZodOptional<z.ZodString>;
337
+ skills: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
338
+ domains: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
339
+ }, "strip", z.ZodTypeAny, {
340
+ endpoint: string;
341
+ name: string;
342
+ version?: string | undefined;
343
+ skills?: string[] | undefined;
344
+ domains?: string[] | undefined;
345
+ }, {
346
+ endpoint: string;
347
+ name: string;
348
+ version?: string | undefined;
349
+ skills?: string[] | undefined;
350
+ domains?: string[] | undefined;
351
+ }>;
352
+ declare const AgentRegistrationSchema: z.ZodObject<{
353
+ agentId: z.ZodNumber;
354
+ agentRegistry: z.ZodString;
355
+ }, "strip", z.ZodTypeAny, {
356
+ agentId: number;
357
+ agentRegistry: string;
358
+ }, {
359
+ agentId: number;
360
+ agentRegistry: string;
361
+ }>;
362
+ declare const AgentRegistrationFileSchema: z.ZodObject<{
363
+ type: z.ZodLiteral<"https://eips.ethereum.org/EIPS/eip-8004#registration-v1">;
364
+ name: z.ZodString;
365
+ description: z.ZodString;
366
+ image: z.ZodOptional<z.ZodString>;
367
+ services: z.ZodArray<z.ZodObject<{
368
+ name: z.ZodString;
369
+ endpoint: z.ZodString;
370
+ version: z.ZodOptional<z.ZodString>;
371
+ skills: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
372
+ domains: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
373
+ }, "strip", z.ZodTypeAny, {
374
+ endpoint: string;
375
+ name: string;
376
+ version?: string | undefined;
377
+ skills?: string[] | undefined;
378
+ domains?: string[] | undefined;
379
+ }, {
380
+ endpoint: string;
381
+ name: string;
382
+ version?: string | undefined;
383
+ skills?: string[] | undefined;
384
+ domains?: string[] | undefined;
385
+ }>, "many">;
386
+ x402Support: z.ZodBoolean;
387
+ active: z.ZodBoolean;
388
+ registrations: z.ZodArray<z.ZodObject<{
389
+ agentId: z.ZodNumber;
390
+ agentRegistry: z.ZodString;
391
+ }, "strip", z.ZodTypeAny, {
392
+ agentId: number;
393
+ agentRegistry: string;
394
+ }, {
395
+ agentId: number;
396
+ agentRegistry: string;
397
+ }>, "many">;
398
+ supportedTrust: z.ZodOptional<z.ZodArray<z.ZodEnum<["reputation", "crypto-economic", "tee-attestation"]>, "many">>;
399
+ }, "strip", z.ZodTypeAny, {
400
+ name: string;
401
+ type: "https://eips.ethereum.org/EIPS/eip-8004#registration-v1";
402
+ description: string;
403
+ services: {
404
+ endpoint: string;
405
+ name: string;
406
+ version?: string | undefined;
407
+ skills?: string[] | undefined;
408
+ domains?: string[] | undefined;
409
+ }[];
410
+ x402Support: boolean;
411
+ active: boolean;
412
+ registrations: {
413
+ agentId: number;
414
+ agentRegistry: string;
415
+ }[];
416
+ image?: string | undefined;
417
+ supportedTrust?: ("reputation" | "crypto-economic" | "tee-attestation")[] | undefined;
418
+ }, {
419
+ name: string;
420
+ type: "https://eips.ethereum.org/EIPS/eip-8004#registration-v1";
421
+ description: string;
422
+ services: {
423
+ endpoint: string;
424
+ name: string;
425
+ version?: string | undefined;
426
+ skills?: string[] | undefined;
427
+ domains?: string[] | undefined;
428
+ }[];
429
+ x402Support: boolean;
430
+ active: boolean;
431
+ registrations: {
432
+ agentId: number;
433
+ agentRegistry: string;
434
+ }[];
435
+ image?: string | undefined;
436
+ supportedTrust?: ("reputation" | "crypto-economic" | "tee-attestation")[] | undefined;
437
+ }>;
438
+ declare const FeedbackFileSchema: z.ZodObject<{
439
+ agentRegistry: z.ZodString;
440
+ agentId: z.ZodNumber;
441
+ clientAddress: z.ZodString;
442
+ createdAt: z.ZodString;
443
+ value: z.ZodNumber;
444
+ valueDecimals: z.ZodNumber;
445
+ tag1: z.ZodOptional<z.ZodString>;
446
+ tag2: z.ZodOptional<z.ZodString>;
447
+ endpoint: z.ZodOptional<z.ZodString>;
448
+ mcp: z.ZodOptional<z.ZodObject<{
449
+ tool: z.ZodOptional<z.ZodString>;
450
+ prompt: z.ZodOptional<z.ZodString>;
451
+ resource: z.ZodOptional<z.ZodString>;
452
+ }, "strip", z.ZodTypeAny, {
453
+ tool?: string | undefined;
454
+ prompt?: string | undefined;
455
+ resource?: string | undefined;
456
+ }, {
457
+ tool?: string | undefined;
458
+ prompt?: string | undefined;
459
+ resource?: string | undefined;
460
+ }>>;
461
+ a2a: z.ZodOptional<z.ZodObject<{
462
+ skills: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
463
+ contextId: z.ZodOptional<z.ZodString>;
464
+ taskId: z.ZodOptional<z.ZodString>;
465
+ }, "strip", z.ZodTypeAny, {
466
+ skills?: string[] | undefined;
467
+ contextId?: string | undefined;
468
+ taskId?: string | undefined;
469
+ }, {
470
+ skills?: string[] | undefined;
471
+ contextId?: string | undefined;
472
+ taskId?: string | undefined;
473
+ }>>;
474
+ oasf: z.ZodOptional<z.ZodObject<{
475
+ skills: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
476
+ domains: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
477
+ }, "strip", z.ZodTypeAny, {
478
+ skills?: string[] | undefined;
479
+ domains?: string[] | undefined;
480
+ }, {
481
+ skills?: string[] | undefined;
482
+ domains?: string[] | undefined;
483
+ }>>;
484
+ proofOfPayment: z.ZodOptional<z.ZodObject<{
485
+ fromAddress: z.ZodString;
486
+ toAddress: z.ZodString;
487
+ chainId: z.ZodString;
488
+ txHash: z.ZodString;
489
+ }, "strip", z.ZodTypeAny, {
490
+ fromAddress: string;
491
+ toAddress: string;
492
+ chainId: string;
493
+ txHash: string;
494
+ }, {
495
+ fromAddress: string;
496
+ toAddress: string;
497
+ chainId: string;
498
+ txHash: string;
499
+ }>>;
500
+ }, "strip", z.ZodTypeAny, {
501
+ agentId: number;
502
+ value: number;
503
+ valueDecimals: number;
504
+ clientAddress: string;
505
+ agentRegistry: string;
506
+ createdAt: string;
507
+ tag1?: string | undefined;
508
+ tag2?: string | undefined;
509
+ endpoint?: string | undefined;
510
+ mcp?: {
511
+ tool?: string | undefined;
512
+ prompt?: string | undefined;
513
+ resource?: string | undefined;
514
+ } | undefined;
515
+ a2a?: {
516
+ skills?: string[] | undefined;
517
+ contextId?: string | undefined;
518
+ taskId?: string | undefined;
519
+ } | undefined;
520
+ oasf?: {
521
+ skills?: string[] | undefined;
522
+ domains?: string[] | undefined;
523
+ } | undefined;
524
+ proofOfPayment?: {
525
+ fromAddress: string;
526
+ toAddress: string;
527
+ chainId: string;
528
+ txHash: string;
529
+ } | undefined;
530
+ }, {
531
+ agentId: number;
532
+ value: number;
533
+ valueDecimals: number;
534
+ clientAddress: string;
535
+ agentRegistry: string;
536
+ createdAt: string;
537
+ tag1?: string | undefined;
538
+ tag2?: string | undefined;
539
+ endpoint?: string | undefined;
540
+ mcp?: {
541
+ tool?: string | undefined;
542
+ prompt?: string | undefined;
543
+ resource?: string | undefined;
544
+ } | undefined;
545
+ a2a?: {
546
+ skills?: string[] | undefined;
547
+ contextId?: string | undefined;
548
+ taskId?: string | undefined;
549
+ } | undefined;
550
+ oasf?: {
551
+ skills?: string[] | undefined;
552
+ domains?: string[] | undefined;
553
+ } | undefined;
554
+ proofOfPayment?: {
555
+ fromAddress: string;
556
+ toAddress: string;
557
+ chainId: string;
558
+ txHash: string;
559
+ } | undefined;
560
+ }>;
561
+ type ValidatedAgentRegistrationFile = z.infer<typeof AgentRegistrationFileSchema>;
562
+ type ValidatedFeedbackFile = z.infer<typeof FeedbackFileSchema>;
563
+
564
+ /**
565
+ * Utility functions for Clawpass
566
+ */
567
+
568
+ /**
569
+ * Create a base64-encoded data URI for on-chain agent registration
570
+ */
571
+ declare function createDataURI(registrationFile: AgentRegistrationFile): string;
572
+ /**
573
+ * Parse a data URI to extract the registration file
574
+ */
575
+ declare function parseDataURI(dataURI: string): AgentRegistrationFile;
576
+ /**
577
+ * Convert a number to fixed-point representation for feedback values
578
+ */
579
+ declare function toFixedPoint(value: number, decimals: number): bigint;
580
+ /**
581
+ * Convert fixed-point representation back to number
582
+ */
583
+ declare function fromFixedPoint(value: bigint, decimals: number): number;
584
+ /**
585
+ * Create a feedback file object
586
+ */
587
+ declare function createFeedbackFile(agentRegistry: string, agentId: number, clientAddress: string, value: number, valueDecimals: number, options?: {
588
+ tag1?: string;
589
+ tag2?: string;
590
+ endpoint?: string;
591
+ mcp?: FeedbackFile['mcp'];
592
+ a2a?: FeedbackFile['a2a'];
593
+ oasf?: FeedbackFile['oasf'];
594
+ proofOfPayment?: FeedbackFile['proofOfPayment'];
595
+ [key: string]: unknown;
596
+ }): FeedbackFile;
597
+ /**
598
+ * Calculate keccak256 hash of content
599
+ */
600
+ declare function calculateHash(content: string): string;
601
+ /**
602
+ * Verify hash matches content
603
+ */
604
+ declare function verifyHash(content: string, hash: string): boolean;
605
+ /**
606
+ * Format agent registry string
607
+ */
608
+ declare function formatAgentRegistryString(namespace: string, chainId: string, identityRegistry: string): string;
609
+ /**
610
+ * Parse agent registry string
611
+ */
612
+ declare function parseAgentRegistryString(registryString: string): {
613
+ namespace: string;
614
+ chainId: string;
615
+ identityRegistry: string;
616
+ };
617
+ /**
618
+ * Create IPFS URI from CID
619
+ */
620
+ declare function createIPFSUri(cid: string): string;
621
+ /**
622
+ * Extract CID from IPFS URI
623
+ */
624
+ declare function extractCIDFromIPFS(ipfsUri: string): string;
625
+ /**
626
+ * Convert IPFS URI to HTTP gateway URL
627
+ */
628
+ declare function ipfsToHTTP(ipfsUri: string, gateway?: string): string;
629
+ /**
630
+ * Calculate average from feedback values
631
+ */
632
+ declare function calculateAverageFeedback(feedbackValues: Array<{
633
+ value: bigint;
634
+ decimals: number;
635
+ }>): number;
636
+ /**
637
+ * Encode metadata value to bytes (hex string)
638
+ */
639
+ declare function encodeMetadata(value: string): string;
640
+ /**
641
+ * Decode metadata value from bytes (hex string)
642
+ */
643
+ declare function decodeMetadata(hexValue: string): string;
644
+
645
+ var IdentityRegistry = [
646
+ {
647
+ type: "function",
648
+ name: "register",
649
+ inputs: [
650
+ {
651
+ name: "agentURI",
652
+ type: "string"
653
+ },
654
+ {
655
+ name: "metadata",
656
+ type: "tuple[]",
657
+ components: [
658
+ {
659
+ name: "metadataKey",
660
+ type: "string"
661
+ },
662
+ {
663
+ name: "metadataValue",
664
+ type: "bytes"
665
+ }
666
+ ]
667
+ }
668
+ ],
669
+ outputs: [
670
+ {
671
+ name: "agentId",
672
+ type: "uint256"
673
+ }
674
+ ],
675
+ stateMutability: "nonpayable"
676
+ },
677
+ {
678
+ type: "function",
679
+ name: "register",
680
+ inputs: [
681
+ {
682
+ name: "agentURI",
683
+ type: "string"
684
+ }
685
+ ],
686
+ outputs: [
687
+ {
688
+ name: "agentId",
689
+ type: "uint256"
690
+ }
691
+ ],
692
+ stateMutability: "nonpayable"
693
+ },
694
+ {
695
+ type: "function",
696
+ name: "register",
697
+ inputs: [
698
+ ],
699
+ outputs: [
700
+ {
701
+ name: "agentId",
702
+ type: "uint256"
703
+ }
704
+ ],
705
+ stateMutability: "nonpayable"
706
+ },
707
+ {
708
+ type: "function",
709
+ name: "setAgentURI",
710
+ inputs: [
711
+ {
712
+ name: "agentId",
713
+ type: "uint256"
714
+ },
715
+ {
716
+ name: "newURI",
717
+ type: "string"
718
+ }
719
+ ],
720
+ outputs: [
721
+ ],
722
+ stateMutability: "nonpayable"
723
+ },
724
+ {
725
+ type: "function",
726
+ name: "tokenURI",
727
+ inputs: [
728
+ {
729
+ name: "tokenId",
730
+ type: "uint256"
731
+ }
732
+ ],
733
+ outputs: [
734
+ {
735
+ name: "",
736
+ type: "string"
737
+ }
738
+ ],
739
+ stateMutability: "view"
740
+ },
741
+ {
742
+ type: "function",
743
+ name: "getMetadata",
744
+ inputs: [
745
+ {
746
+ name: "agentId",
747
+ type: "uint256"
748
+ },
749
+ {
750
+ name: "metadataKey",
751
+ type: "string"
752
+ }
753
+ ],
754
+ outputs: [
755
+ {
756
+ name: "",
757
+ type: "bytes"
758
+ }
759
+ ],
760
+ stateMutability: "view"
761
+ },
762
+ {
763
+ type: "function",
764
+ name: "setMetadata",
765
+ inputs: [
766
+ {
767
+ name: "agentId",
768
+ type: "uint256"
769
+ },
770
+ {
771
+ name: "metadataKey",
772
+ type: "string"
773
+ },
774
+ {
775
+ name: "metadataValue",
776
+ type: "bytes"
777
+ }
778
+ ],
779
+ outputs: [
780
+ ],
781
+ stateMutability: "nonpayable"
782
+ },
783
+ {
784
+ type: "function",
785
+ name: "getAgentWallet",
786
+ inputs: [
787
+ {
788
+ name: "agentId",
789
+ type: "uint256"
790
+ }
791
+ ],
792
+ outputs: [
793
+ {
794
+ name: "",
795
+ type: "address"
796
+ }
797
+ ],
798
+ stateMutability: "view"
799
+ },
800
+ {
801
+ type: "function",
802
+ name: "setAgentWallet",
803
+ inputs: [
804
+ {
805
+ name: "agentId",
806
+ type: "uint256"
807
+ },
808
+ {
809
+ name: "newWallet",
810
+ type: "address"
811
+ },
812
+ {
813
+ name: "deadline",
814
+ type: "uint256"
815
+ },
816
+ {
817
+ name: "signature",
818
+ type: "bytes"
819
+ }
820
+ ],
821
+ outputs: [
822
+ ],
823
+ stateMutability: "nonpayable"
824
+ },
825
+ {
826
+ type: "function",
827
+ name: "unsetAgentWallet",
828
+ inputs: [
829
+ {
830
+ name: "agentId",
831
+ type: "uint256"
832
+ }
833
+ ],
834
+ outputs: [
835
+ ],
836
+ stateMutability: "nonpayable"
837
+ },
838
+ {
839
+ type: "function",
840
+ name: "ownerOf",
841
+ inputs: [
842
+ {
843
+ name: "tokenId",
844
+ type: "uint256"
845
+ }
846
+ ],
847
+ outputs: [
848
+ {
849
+ name: "",
850
+ type: "address"
851
+ }
852
+ ],
853
+ stateMutability: "view"
854
+ },
855
+ {
856
+ type: "event",
857
+ name: "Registered",
858
+ inputs: [
859
+ {
860
+ name: "agentId",
861
+ type: "uint256",
862
+ indexed: true
863
+ },
864
+ {
865
+ name: "agentURI",
866
+ type: "string",
867
+ indexed: false
868
+ },
869
+ {
870
+ name: "owner",
871
+ type: "address",
872
+ indexed: true
873
+ }
874
+ ]
875
+ },
876
+ {
877
+ type: "event",
878
+ name: "URIUpdated",
879
+ inputs: [
880
+ {
881
+ name: "agentId",
882
+ type: "uint256",
883
+ indexed: true
884
+ },
885
+ {
886
+ name: "newURI",
887
+ type: "string",
888
+ indexed: false
889
+ },
890
+ {
891
+ name: "updatedBy",
892
+ type: "address",
893
+ indexed: true
894
+ }
895
+ ]
896
+ },
897
+ {
898
+ type: "event",
899
+ name: "MetadataSet",
900
+ inputs: [
901
+ {
902
+ name: "agentId",
903
+ type: "uint256",
904
+ indexed: true
905
+ },
906
+ {
907
+ name: "indexedMetadataKey",
908
+ type: "string",
909
+ indexed: true
910
+ },
911
+ {
912
+ name: "metadataKey",
913
+ type: "string",
914
+ indexed: false
915
+ },
916
+ {
917
+ name: "metadataValue",
918
+ type: "bytes",
919
+ indexed: false
920
+ }
921
+ ]
922
+ }
923
+ ];
924
+
925
+ var ReputationRegistry = [
926
+ {
927
+ type: "function",
928
+ name: "initialize",
929
+ inputs: [
930
+ {
931
+ name: "identityRegistry_",
932
+ type: "address"
933
+ }
934
+ ],
935
+ outputs: [
936
+ ],
937
+ stateMutability: "nonpayable"
938
+ },
939
+ {
940
+ type: "function",
941
+ name: "getIdentityRegistry",
942
+ inputs: [
943
+ ],
944
+ outputs: [
945
+ {
946
+ name: "",
947
+ type: "address"
948
+ }
949
+ ],
950
+ stateMutability: "view"
951
+ },
952
+ {
953
+ type: "function",
954
+ name: "giveFeedback",
955
+ inputs: [
956
+ {
957
+ name: "agentId",
958
+ type: "uint256"
959
+ },
960
+ {
961
+ name: "value",
962
+ type: "int128"
963
+ },
964
+ {
965
+ name: "valueDecimals",
966
+ type: "uint8"
967
+ },
968
+ {
969
+ name: "tag1",
970
+ type: "string"
971
+ },
972
+ {
973
+ name: "tag2",
974
+ type: "string"
975
+ },
976
+ {
977
+ name: "endpoint",
978
+ type: "string"
979
+ },
980
+ {
981
+ name: "feedbackURI",
982
+ type: "string"
983
+ },
984
+ {
985
+ name: "feedbackHash",
986
+ type: "bytes32"
987
+ }
988
+ ],
989
+ outputs: [
990
+ ],
991
+ stateMutability: "nonpayable"
992
+ },
993
+ {
994
+ type: "function",
995
+ name: "revokeFeedback",
996
+ inputs: [
997
+ {
998
+ name: "agentId",
999
+ type: "uint256"
1000
+ },
1001
+ {
1002
+ name: "feedbackIndex",
1003
+ type: "uint64"
1004
+ }
1005
+ ],
1006
+ outputs: [
1007
+ ],
1008
+ stateMutability: "nonpayable"
1009
+ },
1010
+ {
1011
+ type: "function",
1012
+ name: "appendResponse",
1013
+ inputs: [
1014
+ {
1015
+ name: "agentId",
1016
+ type: "uint256"
1017
+ },
1018
+ {
1019
+ name: "clientAddress",
1020
+ type: "address"
1021
+ },
1022
+ {
1023
+ name: "feedbackIndex",
1024
+ type: "uint64"
1025
+ },
1026
+ {
1027
+ name: "responseURI",
1028
+ type: "string"
1029
+ },
1030
+ {
1031
+ name: "responseHash",
1032
+ type: "bytes32"
1033
+ }
1034
+ ],
1035
+ outputs: [
1036
+ ],
1037
+ stateMutability: "nonpayable"
1038
+ },
1039
+ {
1040
+ type: "function",
1041
+ name: "getSummary",
1042
+ inputs: [
1043
+ {
1044
+ name: "agentId",
1045
+ type: "uint256"
1046
+ },
1047
+ {
1048
+ name: "clientAddresses",
1049
+ type: "address[]"
1050
+ },
1051
+ {
1052
+ name: "tag1",
1053
+ type: "string"
1054
+ },
1055
+ {
1056
+ name: "tag2",
1057
+ type: "string"
1058
+ }
1059
+ ],
1060
+ outputs: [
1061
+ {
1062
+ name: "count",
1063
+ type: "uint64"
1064
+ },
1065
+ {
1066
+ name: "summaryValue",
1067
+ type: "int128"
1068
+ },
1069
+ {
1070
+ name: "summaryValueDecimals",
1071
+ type: "uint8"
1072
+ }
1073
+ ],
1074
+ stateMutability: "view"
1075
+ },
1076
+ {
1077
+ type: "function",
1078
+ name: "readFeedback",
1079
+ inputs: [
1080
+ {
1081
+ name: "agentId",
1082
+ type: "uint256"
1083
+ },
1084
+ {
1085
+ name: "clientAddress",
1086
+ type: "address"
1087
+ },
1088
+ {
1089
+ name: "feedbackIndex",
1090
+ type: "uint64"
1091
+ }
1092
+ ],
1093
+ outputs: [
1094
+ {
1095
+ name: "value",
1096
+ type: "int128"
1097
+ },
1098
+ {
1099
+ name: "valueDecimals",
1100
+ type: "uint8"
1101
+ },
1102
+ {
1103
+ name: "tag1",
1104
+ type: "string"
1105
+ },
1106
+ {
1107
+ name: "tag2",
1108
+ type: "string"
1109
+ },
1110
+ {
1111
+ name: "isRevoked",
1112
+ type: "bool"
1113
+ }
1114
+ ],
1115
+ stateMutability: "view"
1116
+ },
1117
+ {
1118
+ type: "function",
1119
+ name: "readAllFeedback",
1120
+ inputs: [
1121
+ {
1122
+ name: "agentId",
1123
+ type: "uint256"
1124
+ },
1125
+ {
1126
+ name: "clientAddresses",
1127
+ type: "address[]"
1128
+ },
1129
+ {
1130
+ name: "tag1",
1131
+ type: "string"
1132
+ },
1133
+ {
1134
+ name: "tag2",
1135
+ type: "string"
1136
+ },
1137
+ {
1138
+ name: "includeRevoked",
1139
+ type: "bool"
1140
+ }
1141
+ ],
1142
+ outputs: [
1143
+ {
1144
+ name: "clients",
1145
+ type: "address[]"
1146
+ },
1147
+ {
1148
+ name: "feedbackIndexes",
1149
+ type: "uint64[]"
1150
+ },
1151
+ {
1152
+ name: "values",
1153
+ type: "int128[]"
1154
+ },
1155
+ {
1156
+ name: "valueDecimals",
1157
+ type: "uint8[]"
1158
+ },
1159
+ {
1160
+ name: "tag1s",
1161
+ type: "string[]"
1162
+ },
1163
+ {
1164
+ name: "tag2s",
1165
+ type: "string[]"
1166
+ },
1167
+ {
1168
+ name: "revokedStatuses",
1169
+ type: "bool[]"
1170
+ }
1171
+ ],
1172
+ stateMutability: "view"
1173
+ },
1174
+ {
1175
+ type: "function",
1176
+ name: "getResponseCount",
1177
+ inputs: [
1178
+ {
1179
+ name: "agentId",
1180
+ type: "uint256"
1181
+ },
1182
+ {
1183
+ name: "clientAddress",
1184
+ type: "address"
1185
+ },
1186
+ {
1187
+ name: "feedbackIndex",
1188
+ type: "uint64"
1189
+ },
1190
+ {
1191
+ name: "responders",
1192
+ type: "address[]"
1193
+ }
1194
+ ],
1195
+ outputs: [
1196
+ {
1197
+ name: "count",
1198
+ type: "uint64"
1199
+ }
1200
+ ],
1201
+ stateMutability: "view"
1202
+ },
1203
+ {
1204
+ type: "function",
1205
+ name: "getClients",
1206
+ inputs: [
1207
+ {
1208
+ name: "agentId",
1209
+ type: "uint256"
1210
+ }
1211
+ ],
1212
+ outputs: [
1213
+ {
1214
+ name: "",
1215
+ type: "address[]"
1216
+ }
1217
+ ],
1218
+ stateMutability: "view"
1219
+ },
1220
+ {
1221
+ type: "function",
1222
+ name: "getLastIndex",
1223
+ inputs: [
1224
+ {
1225
+ name: "agentId",
1226
+ type: "uint256"
1227
+ },
1228
+ {
1229
+ name: "clientAddress",
1230
+ type: "address"
1231
+ }
1232
+ ],
1233
+ outputs: [
1234
+ {
1235
+ name: "",
1236
+ type: "uint64"
1237
+ }
1238
+ ],
1239
+ stateMutability: "view"
1240
+ },
1241
+ {
1242
+ type: "event",
1243
+ name: "NewFeedback",
1244
+ inputs: [
1245
+ {
1246
+ name: "agentId",
1247
+ type: "uint256",
1248
+ indexed: true
1249
+ },
1250
+ {
1251
+ name: "clientAddress",
1252
+ type: "address",
1253
+ indexed: true
1254
+ },
1255
+ {
1256
+ name: "feedbackIndex",
1257
+ type: "uint64",
1258
+ indexed: false
1259
+ },
1260
+ {
1261
+ name: "value",
1262
+ type: "int128",
1263
+ indexed: false
1264
+ },
1265
+ {
1266
+ name: "valueDecimals",
1267
+ type: "uint8",
1268
+ indexed: false
1269
+ },
1270
+ {
1271
+ name: "indexedTag1",
1272
+ type: "string",
1273
+ indexed: true
1274
+ },
1275
+ {
1276
+ name: "tag1",
1277
+ type: "string",
1278
+ indexed: false
1279
+ },
1280
+ {
1281
+ name: "tag2",
1282
+ type: "string",
1283
+ indexed: false
1284
+ },
1285
+ {
1286
+ name: "endpoint",
1287
+ type: "string",
1288
+ indexed: false
1289
+ },
1290
+ {
1291
+ name: "feedbackURI",
1292
+ type: "string",
1293
+ indexed: false
1294
+ },
1295
+ {
1296
+ name: "feedbackHash",
1297
+ type: "bytes32",
1298
+ indexed: false
1299
+ }
1300
+ ]
1301
+ },
1302
+ {
1303
+ type: "event",
1304
+ name: "FeedbackRevoked",
1305
+ inputs: [
1306
+ {
1307
+ name: "agentId",
1308
+ type: "uint256",
1309
+ indexed: true
1310
+ },
1311
+ {
1312
+ name: "clientAddress",
1313
+ type: "address",
1314
+ indexed: true
1315
+ },
1316
+ {
1317
+ name: "feedbackIndex",
1318
+ type: "uint64",
1319
+ indexed: true
1320
+ }
1321
+ ]
1322
+ },
1323
+ {
1324
+ type: "event",
1325
+ name: "ResponseAppended",
1326
+ inputs: [
1327
+ {
1328
+ name: "agentId",
1329
+ type: "uint256",
1330
+ indexed: true
1331
+ },
1332
+ {
1333
+ name: "clientAddress",
1334
+ type: "address",
1335
+ indexed: true
1336
+ },
1337
+ {
1338
+ name: "feedbackIndex",
1339
+ type: "uint64",
1340
+ indexed: false
1341
+ },
1342
+ {
1343
+ name: "responder",
1344
+ type: "address",
1345
+ indexed: true
1346
+ },
1347
+ {
1348
+ name: "responseURI",
1349
+ type: "string",
1350
+ indexed: false
1351
+ },
1352
+ {
1353
+ name: "responseHash",
1354
+ type: "bytes32",
1355
+ indexed: false
1356
+ }
1357
+ ]
1358
+ }
1359
+ ];
1360
+
1361
+ var ValidationRegistry = [
1362
+ {
1363
+ type: "function",
1364
+ name: "initialize",
1365
+ inputs: [
1366
+ {
1367
+ name: "identityRegistry_",
1368
+ type: "address"
1369
+ }
1370
+ ],
1371
+ outputs: [
1372
+ ],
1373
+ stateMutability: "nonpayable"
1374
+ },
1375
+ {
1376
+ type: "function",
1377
+ name: "getIdentityRegistry",
1378
+ inputs: [
1379
+ ],
1380
+ outputs: [
1381
+ {
1382
+ name: "",
1383
+ type: "address"
1384
+ }
1385
+ ],
1386
+ stateMutability: "view"
1387
+ },
1388
+ {
1389
+ type: "function",
1390
+ name: "validationRequest",
1391
+ inputs: [
1392
+ {
1393
+ name: "validatorAddress",
1394
+ type: "address"
1395
+ },
1396
+ {
1397
+ name: "agentId",
1398
+ type: "uint256"
1399
+ },
1400
+ {
1401
+ name: "requestURI",
1402
+ type: "string"
1403
+ },
1404
+ {
1405
+ name: "requestHash",
1406
+ type: "bytes32"
1407
+ }
1408
+ ],
1409
+ outputs: [
1410
+ ],
1411
+ stateMutability: "nonpayable"
1412
+ },
1413
+ {
1414
+ type: "function",
1415
+ name: "validationResponse",
1416
+ inputs: [
1417
+ {
1418
+ name: "requestHash",
1419
+ type: "bytes32"
1420
+ },
1421
+ {
1422
+ name: "response",
1423
+ type: "uint8"
1424
+ },
1425
+ {
1426
+ name: "responseURI",
1427
+ type: "string"
1428
+ },
1429
+ {
1430
+ name: "responseHash",
1431
+ type: "bytes32"
1432
+ },
1433
+ {
1434
+ name: "tag",
1435
+ type: "string"
1436
+ }
1437
+ ],
1438
+ outputs: [
1439
+ ],
1440
+ stateMutability: "nonpayable"
1441
+ },
1442
+ {
1443
+ type: "function",
1444
+ name: "getValidationStatus",
1445
+ inputs: [
1446
+ {
1447
+ name: "requestHash",
1448
+ type: "bytes32"
1449
+ }
1450
+ ],
1451
+ outputs: [
1452
+ {
1453
+ name: "validatorAddress",
1454
+ type: "address"
1455
+ },
1456
+ {
1457
+ name: "agentId",
1458
+ type: "uint256"
1459
+ },
1460
+ {
1461
+ name: "response",
1462
+ type: "uint8"
1463
+ },
1464
+ {
1465
+ name: "responseHash",
1466
+ type: "bytes32"
1467
+ },
1468
+ {
1469
+ name: "tag",
1470
+ type: "string"
1471
+ },
1472
+ {
1473
+ name: "lastUpdate",
1474
+ type: "uint256"
1475
+ }
1476
+ ],
1477
+ stateMutability: "view"
1478
+ },
1479
+ {
1480
+ type: "function",
1481
+ name: "getSummary",
1482
+ inputs: [
1483
+ {
1484
+ name: "agentId",
1485
+ type: "uint256"
1486
+ },
1487
+ {
1488
+ name: "validatorAddresses",
1489
+ type: "address[]"
1490
+ },
1491
+ {
1492
+ name: "tag",
1493
+ type: "string"
1494
+ }
1495
+ ],
1496
+ outputs: [
1497
+ {
1498
+ name: "count",
1499
+ type: "uint64"
1500
+ },
1501
+ {
1502
+ name: "averageResponse",
1503
+ type: "uint8"
1504
+ }
1505
+ ],
1506
+ stateMutability: "view"
1507
+ },
1508
+ {
1509
+ type: "function",
1510
+ name: "getAgentValidations",
1511
+ inputs: [
1512
+ {
1513
+ name: "agentId",
1514
+ type: "uint256"
1515
+ }
1516
+ ],
1517
+ outputs: [
1518
+ {
1519
+ name: "",
1520
+ type: "bytes32[]"
1521
+ }
1522
+ ],
1523
+ stateMutability: "view"
1524
+ },
1525
+ {
1526
+ type: "function",
1527
+ name: "getValidatorRequests",
1528
+ inputs: [
1529
+ {
1530
+ name: "validatorAddress",
1531
+ type: "address"
1532
+ }
1533
+ ],
1534
+ outputs: [
1535
+ {
1536
+ name: "",
1537
+ type: "bytes32[]"
1538
+ }
1539
+ ],
1540
+ stateMutability: "view"
1541
+ },
1542
+ {
1543
+ type: "event",
1544
+ name: "ValidationRequest",
1545
+ inputs: [
1546
+ {
1547
+ name: "validatorAddress",
1548
+ type: "address",
1549
+ indexed: true
1550
+ },
1551
+ {
1552
+ name: "agentId",
1553
+ type: "uint256",
1554
+ indexed: true
1555
+ },
1556
+ {
1557
+ name: "requestURI",
1558
+ type: "string",
1559
+ indexed: false
1560
+ },
1561
+ {
1562
+ name: "requestHash",
1563
+ type: "bytes32",
1564
+ indexed: true
1565
+ }
1566
+ ]
1567
+ },
1568
+ {
1569
+ type: "event",
1570
+ name: "ValidationResponse",
1571
+ inputs: [
1572
+ {
1573
+ name: "validatorAddress",
1574
+ type: "address",
1575
+ indexed: true
1576
+ },
1577
+ {
1578
+ name: "agentId",
1579
+ type: "uint256",
1580
+ indexed: true
1581
+ },
1582
+ {
1583
+ name: "requestHash",
1584
+ type: "bytes32",
1585
+ indexed: true
1586
+ },
1587
+ {
1588
+ name: "response",
1589
+ type: "uint8",
1590
+ indexed: false
1591
+ },
1592
+ {
1593
+ name: "responseURI",
1594
+ type: "string",
1595
+ indexed: false
1596
+ },
1597
+ {
1598
+ name: "responseHash",
1599
+ type: "bytes32",
1600
+ indexed: false
1601
+ },
1602
+ {
1603
+ name: "tag",
1604
+ type: "string",
1605
+ indexed: false
1606
+ }
1607
+ ]
1608
+ }
1609
+ ];
1610
+
1611
+ export { type AgentIdentifier, type AgentRegistration, type AgentRegistrationFile, AgentRegistrationFileSchema, AgentRegistrationSchema, type AgentRegistry, type AgentService, AgentServiceSchema, ClawpassClient, type ClawpassConfig, type FeedbackData, type FeedbackFile, FeedbackFileSchema, type FeedbackRecord, type FeedbackSummary, IdentityRegistry as IdentityRegistryABI, IdentityRegistryClient, type MetadataEntry, ReputationRegistry as ReputationRegistryABI, ReputationRegistryClient, type ValidatedAgentRegistrationFile, type ValidatedFeedbackFile, ValidationRegistry as ValidationRegistryABI, ValidationRegistryClient, type ValidationRequest, type ValidationResponse, type ValidationStatus, type ValidationSummary, calculateAverageFeedback, calculateHash, createDataURI, createFeedbackFile, createIPFSUri, decodeMetadata, encodeMetadata, extractCIDFromIPFS, formatAgentRegistry, formatAgentRegistryString, fromFixedPoint, ipfsToHTTP, parseAgentRegistry, parseAgentRegistryString, parseDataURI, toFixedPoint, verifyHash };