@agentic-trust/agentic-trust-sdk 1.0.43

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 (78) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +213 -0
  3. package/abis/BaseRegistrarImplementation.json +1013 -0
  4. package/abis/ETHRegistrarController.json +1004 -0
  5. package/abis/IdentityRegistry.json +1044 -0
  6. package/abis/NameWrapper.json +2026 -0
  7. package/abis/PublicResolver.json +1772 -0
  8. package/abis/ReputationRegistry.json +701 -0
  9. package/abis/ValidationRegistry.json +505 -0
  10. package/dist/AIAgentAssociationClient.d.ts +58 -0
  11. package/dist/AIAgentAssociationClient.d.ts.map +1 -0
  12. package/dist/AIAgentAssociationClient.js +100 -0
  13. package/dist/AIAgentAssociationClient.js.map +1 -0
  14. package/dist/AIAgentDiscoveryClient.d.ts +673 -0
  15. package/dist/AIAgentDiscoveryClient.d.ts.map +1 -0
  16. package/dist/AIAgentDiscoveryClient.js +3184 -0
  17. package/dist/AIAgentDiscoveryClient.js.map +1 -0
  18. package/dist/AIAgentENSClient.d.ts +149 -0
  19. package/dist/AIAgentENSClient.d.ts.map +1 -0
  20. package/dist/AIAgentENSClient.js +958 -0
  21. package/dist/AIAgentENSClient.js.map +1 -0
  22. package/dist/AIAgentIdentityClient.d.ts +159 -0
  23. package/dist/AIAgentIdentityClient.d.ts.map +1 -0
  24. package/dist/AIAgentIdentityClient.js +660 -0
  25. package/dist/AIAgentIdentityClient.js.map +1 -0
  26. package/dist/AIAgentL2ENSDurenClient.d.ts +120 -0
  27. package/dist/AIAgentL2ENSDurenClient.d.ts.map +1 -0
  28. package/dist/AIAgentL2ENSDurenClient.js +735 -0
  29. package/dist/AIAgentL2ENSDurenClient.js.map +1 -0
  30. package/dist/AIAgentL2ENSNamespaceClient.d.ts +58 -0
  31. package/dist/AIAgentL2ENSNamespaceClient.d.ts.map +1 -0
  32. package/dist/AIAgentL2ENSNamespaceClient.js +214 -0
  33. package/dist/AIAgentL2ENSNamespaceClient.js.map +1 -0
  34. package/dist/AIAgentReputationClient.d.ts +69 -0
  35. package/dist/AIAgentReputationClient.d.ts.map +1 -0
  36. package/dist/AIAgentReputationClient.js +203 -0
  37. package/dist/AIAgentReputationClient.js.map +1 -0
  38. package/dist/AIAgentValidationClient.d.ts +60 -0
  39. package/dist/AIAgentValidationClient.d.ts.map +1 -0
  40. package/dist/AIAgentValidationClient.js +123 -0
  41. package/dist/AIAgentValidationClient.js.map +1 -0
  42. package/dist/OrgIdentityClient.d.ts +27 -0
  43. package/dist/OrgIdentityClient.d.ts.map +1 -0
  44. package/dist/OrgIdentityClient.js +169 -0
  45. package/dist/OrgIdentityClient.js.map +1 -0
  46. package/dist/abis/BaseRegistrarImplementation.json +1013 -0
  47. package/dist/abis/ETHRegistrarController.json +1004 -0
  48. package/dist/abis/IdentityRegistry.json +1044 -0
  49. package/dist/abis/NameWrapper.json +2026 -0
  50. package/dist/abis/PublicResolver.json +1772 -0
  51. package/dist/abis/ReputationRegistry.json +701 -0
  52. package/dist/abis/ValidationRegistry.json +505 -0
  53. package/dist/index.d.ts +25 -0
  54. package/dist/index.d.ts.map +1 -0
  55. package/dist/index.js +24 -0
  56. package/dist/index.js.map +1 -0
  57. package/dist/schema.d.ts +13 -0
  58. package/dist/schema.d.ts.map +1 -0
  59. package/dist/schema.js +696 -0
  60. package/dist/schema.js.map +1 -0
  61. package/dist/schemaKb.d.ts +12 -0
  62. package/dist/schemaKb.d.ts.map +1 -0
  63. package/dist/schemaKb.js +593 -0
  64. package/dist/schemaKb.js.map +1 -0
  65. package/dist/tsconfig.tsbuildinfo +1 -0
  66. package/dist/utils/did8004.d.ts +57 -0
  67. package/dist/utils/did8004.d.ts.map +1 -0
  68. package/dist/utils/did8004.js +127 -0
  69. package/dist/utils/did8004.js.map +1 -0
  70. package/dist/utils/didEns.d.ts +46 -0
  71. package/dist/utils/didEns.d.ts.map +1 -0
  72. package/dist/utils/didEns.js +107 -0
  73. package/dist/utils/didEns.js.map +1 -0
  74. package/dist/utils/didEthr.d.ts +40 -0
  75. package/dist/utils/didEthr.d.ts.map +1 -0
  76. package/dist/utils/didEthr.js +87 -0
  77. package/dist/utils/didEthr.js.map +1 -0
  78. package/package.json +79 -0
@@ -0,0 +1,57 @@
1
+ export interface ParsedDid8004 {
2
+ /**
3
+ * DID without any URL fragment (decoded form)
4
+ * e.g. did:8004:11155111:724
5
+ */
6
+ did: string;
7
+ /**
8
+ * DID method – always "8004"
9
+ */
10
+ method: '8004';
11
+ /**
12
+ * Optional namespace between method and chain id (e.g. "eip155")
13
+ */
14
+ namespace?: string;
15
+ /**
16
+ * Chain id component parsed as a number
17
+ */
18
+ chainId: number;
19
+ /**
20
+ * Agent identifier component (string to preserve full precision)
21
+ */
22
+ agentId: string;
23
+ /**
24
+ * Optional fragment (portion after '#', decoded)
25
+ */
26
+ fragment?: string;
27
+ /**
28
+ * Encoded DID string suitable for use in URLs
29
+ */
30
+ encoded: string;
31
+ }
32
+ export interface BuildDid8004Options {
33
+ namespace?: string;
34
+ fragment?: string;
35
+ /**
36
+ * When true (default) the resulting DID is URI-encoded.
37
+ */
38
+ encode?: boolean;
39
+ }
40
+ /**
41
+ * Construct a did:8004 identifier.
42
+ *
43
+ * @param chainId - numeric or string chain id
44
+ * @param agentId - agent identifier (string or number)
45
+ * @param namespaceOrOptions - optional namespace string or options bag
46
+ * @param options - optional options when namespace is provided as third argument
47
+ */
48
+ export declare function buildDid8004(chainId: number | string, agentId: number | string, namespaceOrOptions?: string | BuildDid8004Options, options?: BuildDid8004Options): string;
49
+ /**
50
+ * Parse a did:8004 identifier.
51
+ *
52
+ * Accepts encoded or decoded strings and supports identifiers with or without
53
+ * an intermediate namespace (e.g. did:8004:11155111:724).
54
+ */
55
+ export declare function parseDid8004(raw: string | undefined | null): ParsedDid8004;
56
+ export declare function resolveDid8004(did: string): any;
57
+ //# sourceMappingURL=did8004.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"did8004.d.ts","sourceRoot":"","sources":["../../utils/did8004.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,aAAa;IAC5B;;;OAGG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;CACjB;AAKD,MAAM,WAAW,mBAAmB;IAClC,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAgBD;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,MAAM,GAAG,MAAM,EACxB,OAAO,EAAE,MAAM,GAAG,MAAM,EACxB,kBAAkB,CAAC,EAAE,MAAM,GAAG,mBAAmB,EACjD,OAAO,CAAC,EAAE,mBAAmB,GAC5B,MAAM,CAyBR;AAED;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,aAAa,CA8D1E;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CA8B/C"}
@@ -0,0 +1,127 @@
1
+ const DID_8004_PREFIX = 'did:8004:';
2
+ function normaliseComponent(value, label) {
3
+ const stringValue = typeof value === 'number' ? Number.isFinite(value) ? value.toString(10) : '' : value?.toString() ?? '';
4
+ const trimmed = stringValue.trim();
5
+ if (!trimmed) {
6
+ throw new Error(`${label} is required to build did:8004 identifier`);
7
+ }
8
+ return trimmed;
9
+ }
10
+ function encodeIfNeeded(value, encode) {
11
+ return encode === false ? value : encodeURIComponent(value);
12
+ }
13
+ /**
14
+ * Construct a did:8004 identifier.
15
+ *
16
+ * @param chainId - numeric or string chain id
17
+ * @param agentId - agent identifier (string or number)
18
+ * @param namespaceOrOptions - optional namespace string or options bag
19
+ * @param options - optional options when namespace is provided as third argument
20
+ */
21
+ export function buildDid8004(chainId, agentId, namespaceOrOptions, options) {
22
+ let namespace;
23
+ let opts;
24
+ if (typeof namespaceOrOptions === 'object' && namespaceOrOptions !== null) {
25
+ opts = namespaceOrOptions;
26
+ }
27
+ else {
28
+ namespace = namespaceOrOptions;
29
+ opts = options;
30
+ }
31
+ const chainComponent = normaliseComponent(chainId, 'Chain ID');
32
+ const agentComponent = normaliseComponent(agentId, 'Agent ID');
33
+ const encode = opts?.encode ?? true;
34
+ const fragment = opts?.fragment ? opts.fragment.replace(/^#/, '').trim() : undefined;
35
+ const prefix = DID_8004_PREFIX.slice(0, -1); // "did:8004"
36
+ const segments = namespace
37
+ ? [prefix, namespace, chainComponent, agentComponent]
38
+ : [prefix, chainComponent, agentComponent];
39
+ const baseDid = segments.join(':');
40
+ const didWithFragment = fragment ? `${baseDid}#${fragment}` : baseDid;
41
+ return encodeIfNeeded(didWithFragment, encode);
42
+ }
43
+ /**
44
+ * Parse a did:8004 identifier.
45
+ *
46
+ * Accepts encoded or decoded strings and supports identifiers with or without
47
+ * an intermediate namespace (e.g. did:8004:11155111:724).
48
+ */
49
+ export function parseDid8004(raw) {
50
+ const encodedInput = (raw ?? '').toString().trim();
51
+ if (!encodedInput) {
52
+ throw new Error('Missing did:8004 identifier');
53
+ }
54
+ let decoded;
55
+ try {
56
+ decoded = decodeURIComponent(encodedInput);
57
+ }
58
+ catch (error) {
59
+ throw new Error(`Invalid percent-encoding in did:8004 identifier: ${error.message}`);
60
+ }
61
+ const [baseDidRaw, fragment] = decoded.split('#', 2);
62
+ const baseDid = baseDidRaw ?? '';
63
+ if (!baseDid) {
64
+ throw new Error(`Invalid did:8004 identifier: ${decoded}`);
65
+ }
66
+ if (!baseDid.startsWith(DID_8004_PREFIX)) {
67
+ throw new Error(`Invalid did:8004 identifier: ${decoded}`);
68
+ }
69
+ const parts = baseDid.split(':');
70
+ if (parts.length < 4 || parts[0] !== 'did' || parts[1] !== '8004') {
71
+ throw new Error(`Malformed did:8004 identifier: ${decoded}`);
72
+ }
73
+ let namespace;
74
+ let chainIndex = 2;
75
+ if (parts.length >= 5) {
76
+ namespace = parts[2];
77
+ chainIndex = 3;
78
+ }
79
+ const chainComponent = parts[chainIndex];
80
+ const agentComponent = parts.slice(chainIndex + 1).join(':');
81
+ if (!chainComponent) {
82
+ throw new Error(`Chain id missing in did:8004 identifier: ${decoded}`);
83
+ }
84
+ const chainId = Number.parseInt(chainComponent, 10);
85
+ if (!Number.isFinite(chainId)) {
86
+ throw new Error(`Invalid chain id in did:8004 identifier: ${decoded}`);
87
+ }
88
+ const agentId = agentComponent.trim();
89
+ if (!agentId) {
90
+ throw new Error(`Agent id missing in did:8004 identifier: ${decoded}`);
91
+ }
92
+ return {
93
+ did: baseDid,
94
+ method: '8004',
95
+ namespace,
96
+ chainId,
97
+ agentId,
98
+ fragment: fragment?.trim() || undefined,
99
+ encoded: encodeIfNeeded(baseDid + (fragment ? `#${fragment}` : ''), true),
100
+ };
101
+ }
102
+ export function resolveDid8004(did) {
103
+ console.info(`Resolving DID 222: ${did}`);
104
+ const parts = did.split(':').slice(1);
105
+ const [method, networkId, agentId] = parts;
106
+ if (method !== 'contract') {
107
+ throw new Error(`Unsupported DID method: ${method}`);
108
+ }
109
+ if (!agentId) {
110
+ throw new Error(`Missing agentId in DID: ${did}`);
111
+ }
112
+ const controllerAddress = agentId.toLowerCase();
113
+ return {
114
+ '@context': ['https://www.w3.org/ns/did/v1'],
115
+ id: did,
116
+ verificationMethod: [
117
+ {
118
+ id: `${did}#controller`,
119
+ type: 'EcdsaSecp256k1RecoveryMethod2020',
120
+ controller: did,
121
+ agentId: `${controllerAddress}@eip155:${networkId}`,
122
+ },
123
+ ],
124
+ authentication: [`${did}#controller`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,CAAA;IAE/C,OAAO;QACL,UAAU,EAAE,CAAC,8BAA8B,CAAC;QAC5C,EAAE,EAAE,GAAG;QACP,kBAAkB,EAAE;YAClB;gBACE,EAAE,EAAE,GAAG,GAAG,aAAa;gBACvB,IAAI,EAAE,kCAAkC;gBACxC,UAAU,EAAE,GAAG;gBACf,OAAO,EAAE,GAAG,iBAAiB,WAAW,SAAS,EAAE;aACpD;SACF;QACD,cAAc,EAAE,CAAC,GAAG,GAAG,aAAa,CAAC;KACtC,CAAA;AACH,CAAC"}
@@ -0,0 +1,46 @@
1
+ export interface ParsedEnsDid {
2
+ /**
3
+ * Decoded ENS DID without URL encoding (e.g. did:ens:11155111:my-agent.org.eth)
4
+ */
5
+ did: string;
6
+ /**
7
+ * DID method – always "ens"
8
+ */
9
+ method: 'ens';
10
+ /**
11
+ * Chain id component parsed as a number
12
+ */
13
+ chainId: number;
14
+ /**
15
+ * ENS name component (e.g. my-agent.org.eth)
16
+ */
17
+ ensName: string;
18
+ /**
19
+ * Encoded DID string suitable for use in URLs
20
+ */
21
+ encoded: string;
22
+ }
23
+ /**
24
+ * Parse a did:ens identifier.
25
+ *
26
+ * Accepts encoded or decoded strings and expects format:
27
+ * did:ens:chainId:ensname
28
+ */
29
+ export declare function parseEnsDid(raw: string | undefined | null): ParsedEnsDid;
30
+ export interface BuildEnsDidOptions {
31
+ /**
32
+ * When true (default) the resulting DID is URI-encoded.
33
+ */
34
+ encode?: boolean;
35
+ }
36
+ /**
37
+ * Build a did:ens identifier from chain id and ENS name.
38
+ */
39
+ export declare function buildEnsDid(chainId: number | string, ensName: string, options?: BuildEnsDidOptions): string;
40
+ /**
41
+ * Build an ENS DID from agent name and organization name.
42
+ * e.g. agentName = "my-agent", orgName = "org", chainId = 11155111
43
+ * → did:ens:11155111:my-agent.org.eth
44
+ */
45
+ export declare function buildEnsDidFromAgentAndOrg(chainId: number | string, agentName: string, orgName: string, options?: BuildEnsDidOptions): string;
46
+ //# sourceMappingURL=didEns.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"didEns.d.ts","sourceRoot":"","sources":["../../utils/didEns.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,YAAY;IAC3B;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,MAAM,EAAE,KAAK,CAAC;IACd;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;CACjB;AAMD;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,YAAY,CAwDxE;AAED,MAAM,WAAW,kBAAkB;IACjC;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;GAEG;AACH,wBAAgB,WAAW,CACzB,OAAO,EAAE,MAAM,GAAG,MAAM,EACxB,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,kBAAkB,GAC3B,MAAM,CAmCR;AAED;;;;GAIG;AACH,wBAAgB,0BAA0B,CACxC,OAAO,EAAE,MAAM,GAAG,MAAM,EACxB,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,kBAAkB,GAC3B,MAAM,CAyBR"}
@@ -0,0 +1,107 @@
1
+ const ENS_DID_PREFIX = 'did:ens:';
2
+ function encodeIfNeeded(value, encode) {
3
+ return encode === false ? value : encodeURIComponent(value);
4
+ }
5
+ /**
6
+ * Parse a did:ens identifier.
7
+ *
8
+ * Accepts encoded or decoded strings and expects format:
9
+ * did:ens:chainId:ensname
10
+ */
11
+ export function parseEnsDid(raw) {
12
+ const encodedInput = (raw ?? '').toString().trim();
13
+ if (!encodedInput) {
14
+ throw new Error('Missing ENS DID parameter');
15
+ }
16
+ let decoded;
17
+ try {
18
+ decoded = decodeURIComponent(encodedInput);
19
+ }
20
+ catch (error) {
21
+ throw new Error(`Invalid percent-encoding in ENS DID: ${error.message}`);
22
+ }
23
+ if (!decoded.startsWith(ENS_DID_PREFIX)) {
24
+ throw new Error(`Invalid ENS DID format: ${decoded}. Expected format: did:ens:chainId:ensname`);
25
+ }
26
+ const parts = decoded.split(':');
27
+ if (parts.length < 4) {
28
+ throw new Error(`ENS DID missing components: ${decoded}. Expected format: did:ens:chainId:ensname`);
29
+ }
30
+ const chainIdPart = parts[2] ?? '';
31
+ const ensNamePart = parts.slice(3).join(':').trim();
32
+ const chainId = Number.parseInt(chainIdPart, 10);
33
+ if (!Number.isFinite(chainId) || chainId <= 0) {
34
+ throw new Error(`Invalid chainId in ENS DID: ${decoded}`);
35
+ }
36
+ if (!ensNamePart) {
37
+ throw new Error(`Invalid ENS name in ENS DID: ${decoded}`);
38
+ }
39
+ // Validate that ENS name ends with .eth
40
+ if (!ensNamePart.toLowerCase().endsWith('.eth')) {
41
+ throw new Error(`Invalid ENS name in ENS DID: ${decoded}. ENS name must end with .eth`);
42
+ }
43
+ const did = `${ENS_DID_PREFIX}${chainId}:${ensNamePart}`;
44
+ return {
45
+ did,
46
+ method: 'ens',
47
+ chainId,
48
+ ensName: ensNamePart,
49
+ encoded: encodeIfNeeded(did, true),
50
+ };
51
+ }
52
+ /**
53
+ * Build a did:ens identifier from chain id and ENS name.
54
+ */
55
+ export function buildEnsDid(chainId, ensName, options) {
56
+ const chainIdStr = typeof chainId === 'number'
57
+ ? chainId.toString(10)
58
+ : chainId?.toString() ?? '';
59
+ const ensNameStr = ensName?.toString() ?? '';
60
+ const normalizedChainId = chainIdStr.trim();
61
+ const normalizedEnsName = ensNameStr.trim();
62
+ if (!normalizedChainId) {
63
+ throw new Error('Chain ID is required to build ENS DID');
64
+ }
65
+ if (!normalizedEnsName) {
66
+ throw new Error('ENS name is required to build ENS DID');
67
+ }
68
+ const chainIdNum = Number.parseInt(normalizedChainId, 10);
69
+ if (!Number.isFinite(chainIdNum) || chainIdNum <= 0) {
70
+ throw new Error(`Invalid chain ID: ${normalizedChainId}`);
71
+ }
72
+ // Ensure ENS name ends with .eth (case-insensitive check)
73
+ const lowerEnsName = normalizedEnsName.toLowerCase();
74
+ if (!lowerEnsName.endsWith('.eth')) {
75
+ throw new Error(`Invalid ENS name: ${normalizedEnsName}. ENS name must end with .eth to be a valid did:ens`);
76
+ }
77
+ const did = `${ENS_DID_PREFIX}${chainIdNum}:${normalizedEnsName}`;
78
+ const encode = options?.encode ?? true;
79
+ return encodeIfNeeded(did, encode);
80
+ }
81
+ /**
82
+ * Build an ENS DID from agent name and organization name.
83
+ * e.g. agentName = "my-agent", orgName = "org", chainId = 11155111
84
+ * → did:ens:11155111:my-agent.org.eth
85
+ */
86
+ export function buildEnsDidFromAgentAndOrg(chainId, agentName, orgName, options) {
87
+ if (!agentName || typeof agentName !== 'string') {
88
+ throw new Error('Agent name is required');
89
+ }
90
+ if (!orgName || typeof orgName !== 'string') {
91
+ throw new Error('Organization name is required');
92
+ }
93
+ // Normalize agent name: lowercase and replace spaces with hyphens
94
+ const agentNameLabel = agentName.trim().toLowerCase().replace(/\s+/g, '-');
95
+ if (!agentNameLabel) {
96
+ throw new Error('Agent name cannot be empty');
97
+ }
98
+ // Normalize org name: lowercase and remove .eth suffix if present
99
+ const orgNameClean = orgName.trim().toLowerCase().replace(/\.eth$/i, '');
100
+ if (!orgNameClean) {
101
+ throw new Error('Organization name cannot be empty');
102
+ }
103
+ // Construct full ENS name: agentName.orgName.eth
104
+ const fullEnsName = `${agentNameLabel}.${orgNameClean}.eth`;
105
+ return buildEnsDid(chainId, fullEnsName, options);
106
+ }
107
+ //# sourceMappingURL=didEns.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"didEns.js","sourceRoot":"","sources":["../../utils/didEns.ts"],"names":[],"mappings":"AAAA,MAAM,cAAc,GAAG,UAAU,CAAC;AAyBlC,SAAS,cAAc,CAAC,KAAa,EAAE,MAA2B;IAChE,OAAO,MAAM,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,C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E;IAClE,MAAM,YAAY,GAAG,OAAO,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;IACzE,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;IACvD,CAAC;IAED,iDAAiD;IACjD,MAAM,WAAW,GAAG,GAAG,cAAc,IAAI,YAAY,MAAM,CAAC;IAE5D,OAAO,WAAW,CAAC,OAAO,EAAE,WAAW,EAAE,OAAO,CAAC,CAAC;AACpD,CAAC"}
@@ -0,0 +1,40 @@
1
+ export interface ParsedEthrDid {
2
+ /**
3
+ * Decoded ETHR DID without URL encoding (e.g. did:ethr:11155111:0x1234...)
4
+ */
5
+ did: string;
6
+ /**
7
+ * DID method – always "ethr"
8
+ */
9
+ method: 'ethr';
10
+ /**
11
+ * Chain id component parsed as a number
12
+ */
13
+ chainId: number;
14
+ /**
15
+ * Account address component
16
+ */
17
+ account: `0x${string}`;
18
+ /**
19
+ * Encoded DID string suitable for use in URLs
20
+ */
21
+ encoded: string;
22
+ }
23
+ /**
24
+ * Parse a did:ethr identifier.
25
+ *
26
+ * Accepts encoded or decoded strings and supports:
27
+ * did:ethr:chainId:0x..., did:ethr:0x...
28
+ */
29
+ export declare function parseEthrDid(raw: string | undefined | null): ParsedEthrDid;
30
+ export interface BuildEthrDidOptions {
31
+ /**
32
+ * When true (default) the resulting DID is URI-encoded.
33
+ */
34
+ encode?: boolean;
35
+ }
36
+ /**
37
+ * Build a did:ethr identifier from chain id and account address.
38
+ */
39
+ export declare function buildEthrDid(chainId: number | string, account: `0x${string}`, options?: BuildEthrDidOptions): string;
40
+ //# sourceMappingURL=didEthr.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"didEthr.d.ts","sourceRoot":"","sources":["../../utils/didEthr.ts"],"names":[],"mappings":"AAEA,MAAM,WAAW,aAAa;IAC5B;;OAEG;IACH,GAAG,EAAE,MAAM,CAAC;IACZ;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;OAEG;IACH,OAAO,EAAE,KAAK,MAAM,EAAE,CAAC;IACvB;;OAEG;IACH,OAAO,EAAE,MAAM,CAAC;CACjB;AAMD;;;;;GAKG;AACH,wBAAgB,YAAY,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,GAAG,aAAa,CA8D1E;AAED,MAAM,WAAW,mBAAmB;IAClC;;OAEG;IACH,MAAM,CAAC,EAAE,OAAO,CAAC;CAClB;AAED;;GAEG;AACH,wBAAgB,YAAY,CAC1B,OAAO,EAAE,MAAM,GAAG,MAAM,EACxB,OAAO,EAAE,KAAK,MAAM,EAAE,EACtB,OAAO,CAAC,EAAE,mBAAmB,GAC5B,MAAM,CAkCR"}
@@ -0,0 +1,87 @@
1
+ const ETHR_DID_PREFIX = 'did:ethr:';
2
+ function encodeIfNeeded(value, encode) {
3
+ return encode === false ? value : encodeURIComponent(value);
4
+ }
5
+ /**
6
+ * Parse a did:ethr identifier.
7
+ *
8
+ * Accepts encoded or decoded strings and supports:
9
+ * did:ethr:chainId:0x..., did:ethr:0x...
10
+ */
11
+ export function parseEthrDid(raw) {
12
+ const encodedInput = (raw ?? '').toString().trim();
13
+ if (!encodedInput) {
14
+ throw new Error('Missing ETHR DID parameter');
15
+ }
16
+ let decoded;
17
+ try {
18
+ decoded = decodeURIComponent(encodedInput);
19
+ }
20
+ catch (error) {
21
+ throw new Error(`Invalid percent-encoding in ETHR DID: ${error.message}`);
22
+ }
23
+ if (!decoded.startsWith(ETHR_DID_PREFIX)) {
24
+ throw new Error(`Invalid ETHR DID format: ${decoded}. Expected format: did:ethr:chainId:account or did:ethr:account`);
25
+ }
26
+ const segments = decoded.split(':');
27
+ const accountCandidate = segments[segments.length - 1];
28
+ if (!accountCandidate || !accountCandidate.startsWith('0x')) {
29
+ throw new Error('ETHR DID is missing account component');
30
+ }
31
+ const remaining = segments.slice(2, -1);
32
+ let chainId = 0;
33
+ for (let i = remaining.length - 1; i >= 0; i -= 1) {
34
+ const value = remaining[i];
35
+ if (value && /^\d+$/.test(value)) {
36
+ const parsed = Number.parseInt(value, 10);
37
+ if (Number.isFinite(parsed) && parsed > 0) {
38
+ chainId = parsed;
39
+ break;
40
+ }
41
+ }
42
+ }
43
+ if (!chainId) {
44
+ throw new Error(`Missing or invalid chainId in ETHR DID: ${decoded}`);
45
+ }
46
+ if (accountCandidate.length !== 42 ||
47
+ !/^0x[a-fA-F0-9]{40}$/.test(accountCandidate)) {
48
+ throw new Error('Invalid account address in ETHR DID');
49
+ }
50
+ const did = `${ETHR_DID_PREFIX}${chainId}:${accountCandidate}`;
51
+ return {
52
+ did,
53
+ method: 'ethr',
54
+ chainId,
55
+ account: accountCandidate,
56
+ encoded: encodeIfNeeded(did, true),
57
+ };
58
+ }
59
+ /**
60
+ * Build a did:ethr identifier from chain id and account address.
61
+ */
62
+ export function buildEthrDid(chainId, account, options) {
63
+ const chainIdStr = typeof chainId === 'number'
64
+ ? chainId.toString(10)
65
+ : chainId?.toString() ?? '';
66
+ const accountStr = account?.toString() ?? '';
67
+ const normalizedChainId = chainIdStr.trim();
68
+ const normalizedAccount = accountStr.trim();
69
+ if (!normalizedChainId) {
70
+ throw new Error('Chain ID is required to build ETHR DID');
71
+ }
72
+ if (!normalizedAccount) {
73
+ throw new Error('Account address is required to build ETHR DID');
74
+ }
75
+ const chainIdNum = Number.parseInt(normalizedChainId, 10);
76
+ if (!Number.isFinite(chainIdNum) || chainIdNum <= 0) {
77
+ throw new Error(`Invalid chain ID: ${normalizedChainId}`);
78
+ }
79
+ if (normalizedAccount.length !== 42 ||
80
+ !/^0x[a-fA-F0-9]{40}$/.test(normalizedAccount)) {
81
+ throw new Error(`Invalid account address: ${normalizedAccount}`);
82
+ }
83
+ const did = `${ETHR_DID_PREFIX}${chainIdNum}:${normalizedAccount}`;
84
+ const encode = options?.encode ?? true;
85
+ return encodeIfNeeded(did, encode);
86
+ }
87
+ //# sourceMappingURL=didEthr.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"didEthr.js","sourceRoot":"","sources":["../../utils/didEthr.ts"],"names":[],"mappings":"AAAA,MAAM,eAAe,GAAG,WAAW,CAAC;AAyBpC,SAAS,cAAc,CAAC,KAAa,EAAE,MAA2B;IAChE,OAAO,MAAM,KAAK,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,kBAAkB,CAAC,KAAK,CAAC,CAAC;AAC9D,CAAC;AAED;;;;;GAKG;AACH,MAAM,UAAU,YAAY,CAAC,GAA8B;IACzD,MAAM,YAAY,GAAG,CAAC,GAAG,IAAI,EAAE,CAAC,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,CAAC;IACnD,IAAI,CAAC,YAAY,EAAE,CAAC;QAClB,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;IAChD,CAAC;IAED,IAAI,OAAe,CAAC;IACpB,IAAI,CAAC;QACH,OAAO,GAAG,kBAAkB,CAAC,YAAY,CAAC,CAAC;IAC7C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,IAAI,KAAK,CACb,yCAA0C,KAAe,CAAC,OAAO,EAAE,CACpE,CAAC;IACJ,CAAC;IAED,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,eAAe,CAAC,EAAE,CAAC;QACzC,MAAM,IAAI,KAAK,CACb,4BAA4B,OAAO,iEAAiE,CACrG,CAAC;IACJ,CAAC;IAED,MAAM,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;IACpC,MAAM,gBAAgB,GAAG,QAAQ,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAEvD,IAAI,CAAC,gBAAgB,IAAI,CAAC,gBAAgB,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QAC5D,MAAM,IAAI,KAAK,CAAC,uCA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
2
+ "name": "@agentic-trust/agentic-trust-sdk",
3
+ "version": "1.0.43",
4
+ "description": "Agentic Trust SDK - TypeScript SDK for managing AI agents with ENS integration, identity management, and reputation systems",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "module": "./dist/index.js",
8
+ "types": "./dist/index.d.ts",
9
+ "exports": {
10
+ ".": {
11
+ "import": "./dist/index.js",
12
+ "types": "./dist/index.d.ts"
13
+ },
14
+ "./utils/did8004": {
15
+ "import": "./dist/utils/did8004.js",
16
+ "types": "./dist/utils/did8004.d.ts"
17
+ },
18
+ "./package.json": "./package.json",
19
+ "./abis/*.json": {
20
+ "import": "./abis/*.json",
21
+ "require": "./abis/*.json",
22
+ "default": "./abis/*.json"
23
+ }
24
+ },
25
+ "files": [
26
+ "dist",
27
+ "abis",
28
+ "README.md"
29
+ ],
30
+ "keywords": [
31
+ "erc8004",
32
+ "ai-agents",
33
+ "ens",
34
+ "ethereum",
35
+ "identity",
36
+ "reputation",
37
+ "trustless-agents",
38
+ "blockchain",
39
+ "typescript",
40
+ "sdk"
41
+ ],
42
+ "author": "ERC-8004 Team",
43
+ "license": "MIT",
44
+ "repository": {
45
+ "type": "git",
46
+ "url": "https://github.com/erc8004/erc-8004-identity-indexer.git",
47
+ "directory": "packages/agentic-trust-sdk"
48
+ },
49
+ "dependencies": {
50
+ "@metamask/smart-accounts-kit": "^0.1.0",
51
+ "@thenamespace/indexer": "^1.0.2",
52
+ "@thenamespace/mint-manager": "^1.1.0",
53
+ "ethers": "^6.13.2",
54
+ "graphql": "^16.12.0",
55
+ "graphql-request": "^6.1.0",
56
+ "viem": "^2.37.11",
57
+ "@agentic-trust/8092-sdk": "1.0.43",
58
+ "@agentic-trust/8004-sdk": "1.0.43"
59
+ },
60
+ "peerDependencies": {
61
+ "react": ">=18.0.0"
62
+ },
63
+ "devDependencies": {
64
+ "@types/react": "^18.0.0",
65
+ "typescript": "^5.0.0"
66
+ },
67
+ "engines": {
68
+ "node": ">=18.0.0"
69
+ },
70
+ "publishConfig": {
71
+ "access": "public"
72
+ },
73
+ "scripts": {
74
+ "build": "tsc -b",
75
+ "dev": "tsc -b --watch",
76
+ "clean": "rm -rf dist tsconfig.tsbuildinfo",
77
+ "type-check": "tsc --noEmit"
78
+ }
79
+ }