@oma3/omatrust 0.1.0-alpha.1 → 0.1.0-alpha.10

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 (36) hide show
  1. package/README.md +21 -7
  2. package/dist/identity/index.cjs +1 -1
  3. package/dist/identity/index.cjs.map +1 -1
  4. package/dist/identity/index.js +1 -1
  5. package/dist/identity/index.js.map +1 -1
  6. package/dist/index-B9KW02US.d.cts +119 -0
  7. package/dist/index-DXrwBex9.d.ts +119 -0
  8. package/dist/index.cjs +656 -91
  9. package/dist/index.cjs.map +1 -1
  10. package/dist/index.d.cts +2 -1
  11. package/dist/index.d.ts +2 -1
  12. package/dist/index.js +657 -92
  13. package/dist/index.js.map +1 -1
  14. package/dist/reputation/index.browser.cjs +2133 -0
  15. package/dist/reputation/index.browser.cjs.map +1 -0
  16. package/dist/reputation/index.browser.d.cts +14 -0
  17. package/dist/reputation/index.browser.d.ts +14 -0
  18. package/dist/reputation/index.browser.js +2071 -0
  19. package/dist/reputation/index.browser.js.map +1 -0
  20. package/dist/reputation/index.cjs +675 -90
  21. package/dist/reputation/index.cjs.map +1 -1
  22. package/dist/reputation/index.d.cts +2 -1
  23. package/dist/reputation/index.d.ts +2 -1
  24. package/dist/reputation/index.js +669 -92
  25. package/dist/reputation/index.js.map +1 -1
  26. package/dist/subject-ownership-CXvzEjpH.d.cts +434 -0
  27. package/dist/subject-ownership-CXvzEjpH.d.ts +434 -0
  28. package/dist/widgets/index.cjs +195 -0
  29. package/dist/widgets/index.cjs.map +1 -0
  30. package/dist/widgets/index.d.cts +134 -0
  31. package/dist/widgets/index.d.ts +134 -0
  32. package/dist/widgets/index.js +185 -0
  33. package/dist/widgets/index.js.map +1 -0
  34. package/package.json +33 -6
  35. package/dist/index-ChbJxwOA.d.cts +0 -415
  36. package/dist/index-ChbJxwOA.d.ts +0 -415
package/README.md CHANGED
@@ -3,7 +3,9 @@
3
3
  Framework-agnostic TypeScript SDK for OMATrust.
4
4
 
5
5
  Current npm state:
6
- - Published prerelease: `0.1.0-alpha.0`
6
+ - As of February 25, 2026:
7
+ - `latest` -> `0.1.0-alpha.5`
8
+ - `alpha` -> `0.1.0-alpha.5`
7
9
  - Scope: `@oma3/omatrust`
8
10
 
9
11
  ## Install
@@ -14,10 +16,16 @@ Install current published package:
14
16
  npm install @oma3/omatrust ethers
15
17
  ```
16
18
 
17
- If you want to pin the current prerelease explicitly:
19
+ Install the current `alpha` tag explicitly:
18
20
 
19
21
  ```bash
20
- npm install @oma3/omatrust@0.1.0-alpha.0 ethers
22
+ npm install @oma3/omatrust@alpha ethers
23
+ ```
24
+
25
+ If you want to pin an exact version:
26
+
27
+ ```bash
28
+ npm install @oma3/omatrust@0.1.0-alpha.5 ethers
21
29
  ```
22
30
 
23
31
  If you use the reputation module, also install EAS SDK:
@@ -44,15 +52,21 @@ npm install @ethereum-attestation-service/eas-sdk
44
52
  - trait hashing + metadata keys
45
53
  - data hash verification
46
54
 
55
+ - Check current dist-tags:
56
+
57
+ ```bash
58
+ npm dist-tag ls @oma3/omatrust
59
+ ```
60
+
47
61
  ## Documentation
48
62
 
49
63
  Use the OMATrust developer docs as the canonical source for quick starts and API examples:
50
64
 
51
65
  - [SDK Getting Started](https://github.com/oma3dao/developer-docs/blob/main/docs/sdk/getting-started.md)
52
- - [Reputation SDK Guide](https://github.com/oma3dao/developer-docs/blob/main/docs/sdk/reputation-sdk.md)
53
- - [Reputation SDK Reference](https://github.com/oma3dao/developer-docs/blob/main/docs/sdk/reputation-reference.md)
54
- - [Identity SDK Reference](https://github.com/oma3dao/developer-docs/blob/main/docs/sdk/identity-reference.md)
55
- - [App Registry SDK Reference](https://github.com/oma3dao/developer-docs/blob/main/docs/sdk/app-registry-reference.md)
66
+ - [SDK Guides](https://github.com/oma3dao/developer-docs/blob/main/docs/sdk/guides.md)
67
+ - [Reputation SDK Reference](https://github.com/oma3dao/developer-docs/blob/main/docs/sdk/api-reference/reputation-sdk.md)
68
+ - [Identity SDK Reference](https://github.com/oma3dao/developer-docs/blob/main/docs/sdk/api-reference/identity-sdk.md)
69
+ - [App Registry SDK Reference](https://github.com/oma3dao/developer-docs/blob/main/docs/app-registry/registry-sdk-reference.md)
56
70
 
57
71
  ## Notes
58
72
 
@@ -97,7 +97,7 @@ function extractDidIdentifier(did) {
97
97
  }
98
98
  function normalizeDomain(domain) {
99
99
  assertString(domain, "domain", "INVALID_DID");
100
- return domain.trim().toLowerCase().replace(/\.$/, "");
100
+ return domain.trim().toLowerCase().replace(/\.$/, "").replace(/^www\./, "");
101
101
  }
102
102
  function normalizeDidWeb(input) {
103
103
  assertString(input, "input", "INVALID_DID");
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/shared/errors.ts","../../src/shared/assert.ts","../../src/identity/caip.ts","../../src/identity/did.ts","../../src/identity/data.ts"],"names":["keccak256","toUtf8Bytes","isAddress","getAddress","canonicalize","sha256"],"mappings":";;;;;;;;;;;;AAAO,IAAM,aAAA,GAAN,cAA4B,KAAA,CAAM;AAAA,EACvC,IAAA;AAAA,EACA,OAAA;AAAA,EAEA,WAAA,CAAY,IAAA,EAAc,OAAA,EAAiB,OAAA,EAAmB;AAC5D,IAAA,KAAA,CAAM,OAAO,CAAA;AACb,IAAA,IAAA,CAAK,IAAA,GAAO,eAAA;AACZ,IAAA,IAAA,CAAK,IAAA,GAAO,IAAA;AACZ,IAAA,IAAA,CAAK,OAAA,GAAU,OAAA;AAAA,EACjB;AACF,CAAA;;;ACRO,SAAS,YAAA,CAAa,KAAA,EAAgB,IAAA,EAAc,IAAA,GAAO,eAAA,EAA0C;AAC1G,EAAA,IAAI,OAAO,KAAA,KAAU,QAAA,IAAY,MAAM,IAAA,EAAK,CAAE,WAAW,CAAA,EAAG;AAC1D,IAAA,MAAM,IAAI,cAAc,IAAA,EAAM,CAAA,EAAG,IAAI,CAAA,2BAAA,CAAA,EAA+B,EAAE,OAAO,CAAA;AAAA,EAC/E;AACF;;;ACUA,IAAM,aAAA,GAAgB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,GAAA,EAAK;AACR,IAAA,MAAM,IAAI,aAAA,CAAc,eAAA,EAAiB,gCAAA,EAAkC,EAAE,KAAK,CAAA;AAAA,EACpF;AACA,EAAA,OAAO,GAAA;AACT;AAEO,SAAS,oBAAoB,GAAA,EAA8C;AAChF,EAAA,MAAM,OAAA,GAAU,iBAAiB,GAAG,CAAA;AACpC,EAAA,OAAO;AAAA,IACL,OAAA;AAAA,IACA,IAAA,EAAMJ,gBAAAA,CAAUC,kBAAAA,CAAY,OAAO,CAAC;AAAA,GACtC;AACF;AAEO,SAAS,qBAAA,CAAsB,KAAc,SAAA,EAAwC;AAC1F,EAAA,MAAM,GAAA,GAAM,iBAAiB,GAAG,CAAA;AAChC,EAAA,MAAM,KAAA,GAAQA,mBAAY,GAAG,CAAA;AAC7B,EAAA,OAAQ,cAAc,WAAA,GAAcD,gBAAAA,CAAU,KAAK,CAAA,GAAIK,cAAO,KAAK,CAAA;AACrE","file":"index.cjs","sourcesContent":["export class OmaTrustError extends Error {\n code: string;\n details?: unknown;\n\n constructor(code: string, message: string, details?: unknown) {\n super(message);\n this.name = \"OmaTrustError\";\n this.code = code;\n this.details = details;\n }\n}\n\nexport function toOmaTrustError(\n code: string,\n message: string,\n details?: unknown\n): OmaTrustError {\n return new OmaTrustError(code, message, details);\n}\n","import { OmaTrustError } from \"./errors\";\n\nexport function assertString(value: unknown, name: string, code = \"INVALID_INPUT\"): asserts value is string {\n if (typeof value !== \"string\" || value.trim().length === 0) {\n throw new OmaTrustError(code, `${name} must be a non-empty string`, { value });\n }\n}\n\nexport function assertNumber(value: unknown, name: string, code = \"INVALID_INPUT\"): asserts value is number {\n if (typeof value !== \"number\" || Number.isNaN(value)) {\n throw new OmaTrustError(code, `${name} must be a valid number`, { value });\n }\n}\n\nexport function assertObject(value: unknown, name: string, code = \"INVALID_INPUT\"): asserts value is Record<string, unknown> {\n if (!value || typeof value !== \"object\" || Array.isArray(value)) {\n throw new OmaTrustError(code, `${name} must be an object`, { value });\n }\n}\n\nexport function asError(err: unknown): Error {\n if (err instanceof Error) {\n return err;\n }\n return new Error(String(err));\n}\n","import { OmaTrustError } from \"../shared/errors\";\nimport { assertString } from \"../shared/assert\";\n\nexport type Caip10 = string;\n\nexport type ParsedCaip10 = {\n namespace: string;\n reference: string;\n address: string;\n};\n\nexport type ParsedCaip2 = {\n namespace: string;\n reference: string;\n};\n\nconst CAIP_10_REGEX = /^(?<namespace>[a-z0-9-]+):(?<reference>[a-zA-Z0-9-]+):(?<address>.+)$/;\nconst CAIP_2_REGEX = /^(?<namespace>[a-z0-9-]+):(?<reference>[a-zA-Z0-9-]+)$/;\n\nexport function parseCaip10(input: string): ParsedCaip10 {\n assertString(input, \"input\", \"INVALID_CAIP\");\n const trimmed = input.trim();\n const match = trimmed.match(CAIP_10_REGEX);\n if (!match?.groups) {\n throw new OmaTrustError(\"INVALID_CAIP\", \"Invalid CAIP-10 format\", { input });\n }\n\n const namespace = match.groups.namespace;\n const reference = match.groups.reference;\n const address = match.groups.address;\n\n if (!namespace || !reference || !address) {\n throw new OmaTrustError(\"INVALID_CAIP\", \"Invalid CAIP-10 components\", { input });\n }\n\n return { namespace, reference, address };\n}\n\nexport function buildCaip10(namespace: string, reference: string, address: string): Caip10 {\n assertString(namespace, \"namespace\", \"INVALID_CAIP\");\n assertString(reference, \"reference\", \"INVALID_CAIP\");\n assertString(address, \"address\", \"INVALID_CAIP\");\n return `${namespace}:${reference}:${address}`;\n}\n\nexport function normalizeCaip10(input: string): Caip10 {\n const parsed = parseCaip10(input);\n const namespace = parsed.namespace.toLowerCase();\n const reference = parsed.reference;\n\n let address = parsed.address;\n if (namespace === \"eip155\") {\n address = address.toLowerCase();\n }\n\n return buildCaip10(namespace, reference, address);\n}\n\nexport function buildCaip2(namespace: string, reference: string): string {\n assertString(namespace, \"namespace\", \"INVALID_CAIP\");\n assertString(reference, \"reference\", \"INVALID_CAIP\");\n return `${namespace}:${reference}`;\n}\n\nexport function parseCaip2(caip2: string): ParsedCaip2 {\n assertString(caip2, \"caip2\", \"INVALID_CAIP\");\n const trimmed = caip2.trim();\n const match = trimmed.match(CAIP_2_REGEX);\n if (!match?.groups) {\n throw new OmaTrustError(\"INVALID_CAIP\", \"Invalid CAIP-2 format\", { caip2 });\n }\n\n const namespace = match.groups.namespace;\n const reference = match.groups.reference;\n if (!namespace || !reference) {\n throw new OmaTrustError(\"INVALID_CAIP\", \"Invalid CAIP-2 components\", { caip2 });\n }\n\n return { namespace, reference };\n}\n","import { getAddress, isAddress, keccak256, toUtf8Bytes } from \"ethers\";\nimport { OmaTrustError } from \"../shared/errors\";\nimport { assertString } from \"../shared/assert\";\nimport { parseCaip10 } from \"./caip\";\n\nexport type Hex = `0x${string}`;\nexport type Did = string;\n\nconst DID_REGEX = /^did:[a-z0-9]+:.+$/i;\n\nexport function isValidDid(did: string): boolean {\n return DID_REGEX.test(did);\n}\n\nexport function extractDidMethod(did: Did): string | null {\n const match = did.match(/^did:([a-z0-9]+):/i);\n return match ? match[1] : null;\n}\n\nexport function extractDidIdentifier(did: Did): string | null {\n const match = did.match(/^did:[a-z0-9]+:(.+)$/i);\n return match ? match[1] : null;\n}\n\nexport function normalizeDomain(domain: string): string {\n assertString(domain, \"domain\", \"INVALID_DID\");\n return domain.trim().toLowerCase().replace(/\\.$/, \"\");\n}\n\nexport function normalizeDidWeb(input: string): Did {\n assertString(input, \"input\", \"INVALID_DID\");\n const trimmed = input.trim();\n\n if (trimmed.startsWith(\"did:\") && !trimmed.startsWith(\"did:web:\")) {\n throw new OmaTrustError(\"INVALID_DID\", \"Expected did:web DID\", { input });\n }\n\n const identifier = trimmed.startsWith(\"did:web:\")\n ? trimmed.slice(\"did:web:\".length)\n : trimmed;\n\n const [host, ...pathParts] = identifier.split(\"/\");\n if (!host) {\n throw new OmaTrustError(\"INVALID_DID\", \"Invalid did:web identifier\", { input });\n }\n\n const normalizedHost = normalizeDomain(host);\n const path = pathParts.length > 0 ? `/${pathParts.join(\"/\")}` : \"\";\n return `did:web:${normalizedHost}${path}`;\n}\n\nexport function normalizeDidPkh(input: string): Did {\n assertString(input, \"input\", \"INVALID_DID\");\n const trimmed = input.trim();\n if (!trimmed.startsWith(\"did:pkh:\")) {\n throw new OmaTrustError(\"INVALID_DID\", \"Expected did:pkh DID\", { input });\n }\n\n const parts = trimmed.split(\":\");\n if (parts.length !== 5) {\n throw new OmaTrustError(\"INVALID_DID\", \"Invalid did:pkh format\", { input });\n }\n\n const [, , namespace, chainId, address] = parts;\n if (!namespace || !chainId || !address) {\n throw new OmaTrustError(\"INVALID_DID\", \"Invalid did:pkh components\", { input });\n }\n\n return `did:pkh:${namespace.toLowerCase()}:${chainId}:${address.toLowerCase()}`;\n}\n\nexport function normalizeDidHandle(input: string): Did {\n assertString(input, \"input\", \"INVALID_DID\");\n const trimmed = input.trim();\n if (!trimmed.startsWith(\"did:handle:\")) {\n throw new OmaTrustError(\"INVALID_DID\", \"Expected did:handle DID\", { input });\n }\n\n const parts = trimmed.split(\":\");\n if (parts.length !== 4) {\n throw new OmaTrustError(\"INVALID_DID\", \"Invalid did:handle format\", { input });\n }\n\n const [, , platform, username] = parts;\n if (!platform || !username) {\n throw new OmaTrustError(\"INVALID_DID\", \"Invalid did:handle components\", { input });\n }\n\n return `did:handle:${platform.toLowerCase()}:${username}`;\n}\n\nexport function normalizeDidKey(input: string): Did {\n assertString(input, \"input\", \"INVALID_DID\");\n const trimmed = input.trim();\n if (!trimmed.startsWith(\"did:key:\")) {\n throw new OmaTrustError(\"INVALID_DID\", \"Expected did:key DID\", { input });\n }\n\n return trimmed;\n}\n\nexport function normalizeDid(input: string): Did {\n assertString(input, \"input\", \"INVALID_DID\");\n const trimmed = input.trim();\n\n if (!trimmed.startsWith(\"did:\")) {\n return normalizeDidWeb(trimmed);\n }\n\n if (!isValidDid(trimmed)) {\n throw new OmaTrustError(\"INVALID_DID\", \"Invalid DID format\", { input });\n }\n\n const method = extractDidMethod(trimmed);\n switch (method) {\n case \"web\":\n return normalizeDidWeb(trimmed);\n case \"pkh\":\n return normalizeDidPkh(trimmed);\n case \"handle\":\n return normalizeDidHandle(trimmed);\n case \"key\":\n return normalizeDidKey(trimmed);\n default:\n return trimmed;\n }\n}\n\nexport function computeDidHash(did: Did): Hex {\n const normalized = normalizeDid(did);\n return keccak256(toUtf8Bytes(normalized)) as Hex;\n}\n\nexport function computeDidAddress(didHash: Hex): Hex {\n assertString(didHash, \"didHash\", \"INVALID_DID\");\n if (!/^0x[0-9a-fA-F]{64}$/.test(didHash)) {\n throw new OmaTrustError(\"INVALID_DID\", \"didHash must be 32-byte hex\", { didHash });\n }\n\n // Spec: low-order 160 bits of didHash, serialized as lowercase 0x-hex.\n return `0x${didHash.slice(-40).toLowerCase()}` as Hex;\n}\n\nexport function didToAddress(did: Did): Hex {\n return computeDidAddress(computeDidHash(did));\n}\n\nexport function validateDidAddress(did: Did, address: Hex): boolean {\n try {\n return didToAddress(did).toLowerCase() === String(address).toLowerCase();\n } catch {\n return false;\n }\n}\n\nexport function buildDidWeb(domain: string): Did {\n return `did:web:${normalizeDomain(domain)}`;\n}\n\nexport function buildDidPkh(\n namespace: string,\n chainId: string | number,\n address: string\n): Did {\n assertString(namespace, \"namespace\", \"INVALID_DID\");\n assertString(address, \"address\", \"INVALID_DID\");\n if (chainId === \"\" || chainId === null || chainId === undefined) {\n throw new OmaTrustError(\"INVALID_DID\", \"chainId is required\", { chainId });\n }\n return `did:pkh:${namespace.toLowerCase()}:${chainId}:${address.toLowerCase()}`;\n}\n\nexport function buildEvmDidPkh(chainId: string | number, address: string): Did {\n return buildDidPkh(\"eip155\", chainId, address);\n}\n\nexport function buildDidPkhFromCaip10(caip10: string): Did {\n const parsed = parseCaip10(caip10);\n return buildDidPkh(parsed.namespace, parsed.reference, parsed.address);\n}\n\nfunction parseDidPkh(did: Did): { namespace: string; chainId: string; address: string } | null {\n if (!did.startsWith(\"did:pkh:\")) {\n return null;\n }\n\n const parts = did.split(\":\");\n if (parts.length !== 5) {\n return null;\n }\n\n const [, , namespace, chainId, address] = parts;\n if (!namespace || !chainId || !address) {\n return null;\n }\n\n return { namespace, chainId, address };\n}\n\nexport function getChainIdFromDidPkh(did: Did): string | null {\n return parseDidPkh(did)?.chainId ?? null;\n}\n\nexport function getAddressFromDidPkh(did: Did): string | null {\n return parseDidPkh(did)?.address ?? null;\n}\n\nexport function getNamespaceFromDidPkh(did: Did): string | null {\n return parseDidPkh(did)?.namespace ?? null;\n}\n\nexport function isEvmDidPkh(did: Did): boolean {\n return getNamespaceFromDidPkh(did) === \"eip155\";\n}\n\nexport function getDomainFromDidWeb(did: Did): string | null {\n if (!did.startsWith(\"did:web:\")) {\n return null;\n }\n\n const identifier = did.slice(\"did:web:\".length);\n const [domain] = identifier.split(\"/\");\n return domain || null;\n}\n\nexport function extractAddressFromDid(identifier: string): string {\n assertString(identifier, \"identifier\", \"INVALID_DID\");\n\n if (identifier.startsWith(\"did:pkh:\")) {\n const pkh = parseDidPkh(normalizeDidPkh(identifier));\n if (!pkh) {\n throw new OmaTrustError(\"INVALID_DID\", \"Invalid did:pkh identifier\", { identifier });\n }\n return pkh.address;\n }\n\n if (identifier.startsWith(\"did:ethr:\")) {\n const parts = identifier.replace(\"did:ethr:\", \"\").split(\":\");\n const address = parts.length === 1 ? parts[0] : parts[1];\n if (!address || !isAddress(address)) {\n throw new OmaTrustError(\"INVALID_DID\", \"Invalid did:ethr identifier\", { identifier });\n }\n return getAddress(address);\n }\n\n if (identifier.match(/^[a-z0-9-]+:[a-zA-Z0-9-]+:0x[a-fA-F0-9]{40}$/)) {\n const parsed = parseCaip10(identifier);\n return parsed.address;\n }\n\n if (isAddress(identifier)) {\n return getAddress(identifier);\n }\n\n throw new OmaTrustError(\"INVALID_DID\", \"Unsupported identifier format\", { identifier });\n}\n","import canonicalize from \"canonicalize\";\nimport { keccak256, sha256, toUtf8Bytes } from \"ethers\";\nimport { OmaTrustError } from \"../shared/errors\";\n\ntype Hex = `0x${string}`;\n\nexport function canonicalizeJson(obj: unknown): string {\n const jcs = canonicalize(obj);\n if (!jcs) {\n throw new OmaTrustError(\"INVALID_INPUT\", \"Object cannot be canonicalized\", { obj });\n }\n return jcs;\n}\n\nexport function canonicalizeForHash(obj: unknown): { jcsJson: string; hash: Hex } {\n const jcsJson = canonicalizeJson(obj);\n return {\n jcsJson,\n hash: keccak256(toUtf8Bytes(jcsJson)) as Hex\n };\n}\n\nexport function hashCanonicalizedJson(obj: unknown, algorithm: \"keccak256\" | \"sha256\"): Hex {\n const jcs = canonicalizeJson(obj);\n const bytes = toUtf8Bytes(jcs);\n return (algorithm === \"keccak256\" ? keccak256(bytes) : sha256(bytes)) as Hex;\n}\n"]}
1
+ {"version":3,"sources":["../../src/shared/errors.ts","../../src/shared/assert.ts","../../src/identity/caip.ts","../../src/identity/did.ts","../../src/identity/data.ts"],"names":["keccak256","toUtf8Bytes","isAddress","getAddress","canonicalize","sha256"],"mappings":";;;;;;;;;;;;AAAO,IAAM,aAAA,GAAN,cAA4B,KAAA,CAAM;AAAA,EACvC,IAAA;AAAA,EACA,OAAA;AAAA,EAEA,WAAA,CAAY,IAAA,EAAc,OAAA,EAAiB,OAAA,EAAmB;AAC5D,IAAA,KAAA,CAAM,OAAO,CAAA;AACb,IAAA,IAAA,CAAK,IAAA,GAAO,eAAA;AACZ,IAAA,IAAA,CAAK,IAAA,GAAO,IAAA;AACZ,IAAA,IAAA,CAAK,OAAA,GAAU,OAAA;AAAA,EACjB;AACF,CAAA;;;ACRO,SAAS,YAAA,CAAa,KAAA,EAAgB,IAAA,EAAc,IAAA,GAAO,eAAA,EAA0C;AAC1G,EAAA,IAAI,OAAO,KAAA,KAAU,QAAA,IAAY,MAAM,IAAA,EAAK,CAAE,WAAW,CAAA,EAAG;AAC1D,IAAA,MAAM,IAAI,cAAc,IAAA,EAAM,CAAA,EAAG,IAAI,CAAA,2BAAA,CAAA,EAA+B,EAAE,OAAO,CAAA;AAAA,EAC/E;AACF;;;ACUA,IAAM,aAAA,GAAgB,uEAAA;AACtB,IAAM,Y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AAa,GAAG,CAAA;AAC5B,EAAA,IAAI,CAAC,GAAA,EAAK;AACR,IAAA,MAAM,IAAI,aAAA,CAAc,eAAA,EAAiB,gCAAA,EAAkC,EAAE,KAAK,CAAA;AAAA,EACpF;AACA,EAAA,OAAO,GAAA;AACT;AAEO,SAAS,oBAAoB,GAAA,EAA8C;AAChF,EAAA,MAAM,OAAA,GAAU,iBAAiB,GAAG,CAAA;AACpC,EAAA,OAAO;AAAA,IACL,OAAA;AAAA,IACA,IAAA,EAAMJ,gBAAAA,CAAUC,kBAAAA,CAAY,OAAO,CAAC;AAAA,GACtC;AACF;AAEO,SAAS,qBAAA,CAAsB,KAAc,SAAA,EAAwC;AAC1F,EAAA,MAAM,GAAA,GAAM,iBAAiB,GAAG,CAAA;AAChC,EAAA,MAAM,KAAA,GAAQA,mBAAY,GAAG,CAAA;AAC7B,EAAA,OAAQ,cAAc,WAAA,GAAcD,gBAAAA,CAAU,KAAK,CAAA,GAAIK,cAAO,KAAK,CAAA;AACrE","file":"index.cjs","sourcesContent":["export class OmaTrustError extends Error {\n code: string;\n details?: unknown;\n\n constructor(code: string, message: string, details?: unknown) {\n super(message);\n this.name = \"OmaTrustError\";\n this.code = code;\n this.details = details;\n }\n}\n\nexport function toOmaTrustError(\n code: string,\n message: string,\n details?: unknown\n): OmaTrustError {\n return new OmaTrustError(code, message, details);\n}\n","import { OmaTrustError } from \"./errors\";\n\nexport function assertString(value: unknown, name: string, code = \"INVALID_INPUT\"): asserts value is string {\n if (typeof value !== \"string\" || value.trim().length === 0) {\n throw new OmaTrustError(code, `${name} must be a non-empty string`, { value });\n }\n}\n\nexport function assertNumber(value: unknown, name: string, code = \"INVALID_INPUT\"): asserts value is number {\n if (typeof value !== \"number\" || Number.isNaN(value)) {\n throw new OmaTrustError(code, `${name} must be a valid number`, { value });\n }\n}\n\nexport function assertObject(value: unknown, name: string, code = \"INVALID_INPUT\"): asserts value is Record<string, unknown> {\n if (!value || typeof value !== \"object\" || Array.isArray(value)) {\n throw new OmaTrustError(code, `${name} must be an object`, { value });\n }\n}\n\nexport function asError(err: unknown): Error {\n if (err instanceof Error) {\n return err;\n }\n return new Error(String(err));\n}\n","import { OmaTrustError } from \"../shared/errors\";\nimport { assertString } from \"../shared/assert\";\n\nexport type Caip10 = string;\n\nexport type ParsedCaip10 = {\n namespace: string;\n reference: string;\n address: string;\n};\n\nexport type ParsedCaip2 = {\n namespace: string;\n reference: string;\n};\n\nconst CAIP_10_REGEX = /^(?<namespace>[a-z0-9-]+):(?<reference>[a-zA-Z0-9-]+):(?<address>.+)$/;\nconst CAIP_2_REGEX = /^(?<namespace>[a-z0-9-]+):(?<reference>[a-zA-Z0-9-]+)$/;\n\nexport function parseCaip10(input: string): ParsedCaip10 {\n assertString(input, \"input\", \"INVALID_CAIP\");\n const trimmed = input.trim();\n const match = trimmed.match(CAIP_10_REGEX);\n if (!match?.groups) {\n throw new OmaTrustError(\"INVALID_CAIP\", \"Invalid CAIP-10 format\", { input });\n }\n\n const namespace = match.groups.namespace;\n const reference = match.groups.reference;\n const address = match.groups.address;\n\n if (!namespace || !reference || !address) {\n throw new OmaTrustError(\"INVALID_CAIP\", \"Invalid CAIP-10 components\", { input });\n }\n\n return { namespace, reference, address };\n}\n\nexport function buildCaip10(namespace: string, reference: string, address: string): Caip10 {\n assertString(namespace, \"namespace\", \"INVALID_CAIP\");\n assertString(reference, \"reference\", \"INVALID_CAIP\");\n assertString(address, \"address\", \"INVALID_CAIP\");\n return `${namespace}:${reference}:${address}`;\n}\n\nexport function normalizeCaip10(input: string): Caip10 {\n const parsed = parseCaip10(input);\n const namespace = parsed.namespace.toLowerCase();\n const reference = parsed.reference;\n\n let address = parsed.address;\n if (namespace === \"eip155\") {\n address = address.toLowerCase();\n }\n\n return buildCaip10(namespace, reference, address);\n}\n\nexport function buildCaip2(namespace: string, reference: string): string {\n assertString(namespace, \"namespace\", \"INVALID_CAIP\");\n assertString(reference, \"reference\", \"INVALID_CAIP\");\n return `${namespace}:${reference}`;\n}\n\nexport function parseCaip2(caip2: string): ParsedCaip2 {\n assertString(caip2, \"caip2\", \"INVALID_CAIP\");\n const trimmed = caip2.trim();\n const match = trimmed.match(CAIP_2_REGEX);\n if (!match?.groups) {\n throw new OmaTrustError(\"INVALID_CAIP\", \"Invalid CAIP-2 format\", { caip2 });\n }\n\n const namespace = match.groups.namespace;\n const reference = match.groups.reference;\n if (!namespace || !reference) {\n throw new OmaTrustError(\"INVALID_CAIP\", \"Invalid CAIP-2 components\", { caip2 });\n }\n\n return { namespace, reference };\n}\n","import { getAddress, isAddress, keccak256, toUtf8Bytes } from \"ethers\";\nimport { OmaTrustError } from \"../shared/errors\";\nimport { assertString } from \"../shared/assert\";\nimport { parseCaip10 } from \"./caip\";\n\nexport type Hex = `0x${string}`;\nexport type Did = string;\n\nconst DID_REGEX = /^did:[a-z0-9]+:.+$/i;\n\nexport function isValidDid(did: string): boolean {\n return DID_REGEX.test(did);\n}\n\nexport function extractDidMethod(did: Did): string | null {\n const match = did.match(/^did:([a-z0-9]+):/i);\n return match ? match[1] : null;\n}\n\nexport function extractDidIdentifier(did: Did): string | null {\n const match = did.match(/^did:[a-z0-9]+:(.+)$/i);\n return match ? match[1] : null;\n}\n\nexport function normalizeDomain(domain: string): string {\n assertString(domain, \"domain\", \"INVALID_DID\");\n return domain.trim().toLowerCase().replace(/\\.$/, \"\").replace(/^www\\./, \"\");\n}\n\nexport function normalizeDidWeb(input: string): Did {\n assertString(input, \"input\", \"INVALID_DID\");\n const trimmed = input.trim();\n\n if (trimmed.startsWith(\"did:\") && !trimmed.startsWith(\"did:web:\")) {\n throw new OmaTrustError(\"INVALID_DID\", \"Expected did:web DID\", { input });\n }\n\n const identifier = trimmed.startsWith(\"did:web:\")\n ? trimmed.slice(\"did:web:\".length)\n : trimmed;\n\n const [host, ...pathParts] = identifier.split(\"/\");\n if (!host) {\n throw new OmaTrustError(\"INVALID_DID\", \"Invalid did:web identifier\", { input });\n }\n\n const normalizedHost = normalizeDomain(host);\n const path = pathParts.length > 0 ? `/${pathParts.join(\"/\")}` : \"\";\n return `did:web:${normalizedHost}${path}`;\n}\n\nexport function normalizeDidPkh(input: string): Did {\n assertString(input, \"input\", \"INVALID_DID\");\n const trimmed = input.trim();\n if (!trimmed.startsWith(\"did:pkh:\")) {\n throw new OmaTrustError(\"INVALID_DID\", \"Expected did:pkh DID\", { input });\n }\n\n const parts = trimmed.split(\":\");\n if (parts.length !== 5) {\n throw new OmaTrustError(\"INVALID_DID\", \"Invalid did:pkh format\", { input });\n }\n\n const [, , namespace, chainId, address] = parts;\n if (!namespace || !chainId || !address) {\n throw new OmaTrustError(\"INVALID_DID\", \"Invalid did:pkh components\", { input });\n }\n\n return `did:pkh:${namespace.toLowerCase()}:${chainId}:${address.toLowerCase()}`;\n}\n\nexport function normalizeDidHandle(input: string): Did {\n assertString(input, \"input\", \"INVALID_DID\");\n const trimmed = input.trim();\n if (!trimmed.startsWith(\"did:handle:\")) {\n throw new OmaTrustError(\"INVALID_DID\", \"Expected did:handle DID\", { input });\n }\n\n const parts = trimmed.split(\":\");\n if (parts.length !== 4) {\n throw new OmaTrustError(\"INVALID_DID\", \"Invalid did:handle format\", { input });\n }\n\n const [, , platform, username] = parts;\n if (!platform || !username) {\n throw new OmaTrustError(\"INVALID_DID\", \"Invalid did:handle components\", { input });\n }\n\n return `did:handle:${platform.toLowerCase()}:${username}`;\n}\n\nexport function normalizeDidKey(input: string): Did {\n assertString(input, \"input\", \"INVALID_DID\");\n const trimmed = input.trim();\n if (!trimmed.startsWith(\"did:key:\")) {\n throw new OmaTrustError(\"INVALID_DID\", \"Expected did:key DID\", { input });\n }\n\n return trimmed;\n}\n\nexport function normalizeDid(input: string): Did {\n assertString(input, \"input\", \"INVALID_DID\");\n const trimmed = input.trim();\n\n if (!trimmed.startsWith(\"did:\")) {\n return normalizeDidWeb(trimmed);\n }\n\n if (!isValidDid(trimmed)) {\n throw new OmaTrustError(\"INVALID_DID\", \"Invalid DID format\", { input });\n }\n\n const method = extractDidMethod(trimmed);\n switch (method) {\n case \"web\":\n return normalizeDidWeb(trimmed);\n case \"pkh\":\n return normalizeDidPkh(trimmed);\n case \"handle\":\n return normalizeDidHandle(trimmed);\n case \"key\":\n return normalizeDidKey(trimmed);\n default:\n return trimmed;\n }\n}\n\nexport function computeDidHash(did: Did): Hex {\n const normalized = normalizeDid(did);\n return keccak256(toUtf8Bytes(normalized)) as Hex;\n}\n\nexport function computeDidAddress(didHash: Hex): Hex {\n assertString(didHash, \"didHash\", \"INVALID_DID\");\n if (!/^0x[0-9a-fA-F]{64}$/.test(didHash)) {\n throw new OmaTrustError(\"INVALID_DID\", \"didHash must be 32-byte hex\", { didHash });\n }\n\n // Spec: low-order 160 bits of didHash, serialized as lowercase 0x-hex.\n return `0x${didHash.slice(-40).toLowerCase()}` as Hex;\n}\n\nexport function didToAddress(did: Did): Hex {\n return computeDidAddress(computeDidHash(did));\n}\n\nexport function validateDidAddress(did: Did, address: Hex): boolean {\n try {\n return didToAddress(did).toLowerCase() === String(address).toLowerCase();\n } catch {\n return false;\n }\n}\n\nexport function buildDidWeb(domain: string): Did {\n return `did:web:${normalizeDomain(domain)}`;\n}\n\nexport function buildDidPkh(\n namespace: string,\n chainId: string | number,\n address: string\n): Did {\n assertString(namespace, \"namespace\", \"INVALID_DID\");\n assertString(address, \"address\", \"INVALID_DID\");\n if (chainId === \"\" || chainId === null || chainId === undefined) {\n throw new OmaTrustError(\"INVALID_DID\", \"chainId is required\", { chainId });\n }\n return `did:pkh:${namespace.toLowerCase()}:${chainId}:${address.toLowerCase()}`;\n}\n\nexport function buildEvmDidPkh(chainId: string | number, address: string): Did {\n return buildDidPkh(\"eip155\", chainId, address);\n}\n\nexport function buildDidPkhFromCaip10(caip10: string): Did {\n const parsed = parseCaip10(caip10);\n return buildDidPkh(parsed.namespace, parsed.reference, parsed.address);\n}\n\nfunction parseDidPkh(did: Did): { namespace: string; chainId: string; address: string } | null {\n if (!did.startsWith(\"did:pkh:\")) {\n return null;\n }\n\n const parts = did.split(\":\");\n if (parts.length !== 5) {\n return null;\n }\n\n const [, , namespace, chainId, address] = parts;\n if (!namespace || !chainId || !address) {\n return null;\n }\n\n return { namespace, chainId, address };\n}\n\nexport function getChainIdFromDidPkh(did: Did): string | null {\n return parseDidPkh(did)?.chainId ?? null;\n}\n\nexport function getAddressFromDidPkh(did: Did): string | null {\n return parseDidPkh(did)?.address ?? null;\n}\n\nexport function getNamespaceFromDidPkh(did: Did): string | null {\n return parseDidPkh(did)?.namespace ?? null;\n}\n\nexport function isEvmDidPkh(did: Did): boolean {\n return getNamespaceFromDidPkh(did) === \"eip155\";\n}\n\nexport function getDomainFromDidWeb(did: Did): string | null {\n if (!did.startsWith(\"did:web:\")) {\n return null;\n }\n\n const identifier = did.slice(\"did:web:\".length);\n const [domain] = identifier.split(\"/\");\n return domain || null;\n}\n\nexport function extractAddressFromDid(identifier: string): string {\n assertString(identifier, \"identifier\", \"INVALID_DID\");\n\n if (identifier.startsWith(\"did:pkh:\")) {\n const pkh = parseDidPkh(normalizeDidPkh(identifier));\n if (!pkh) {\n throw new OmaTrustError(\"INVALID_DID\", \"Invalid did:pkh identifier\", { identifier });\n }\n return pkh.address;\n }\n\n if (identifier.startsWith(\"did:ethr:\")) {\n const parts = identifier.replace(\"did:ethr:\", \"\").split(\":\");\n const address = parts.length === 1 ? parts[0] : parts[1];\n if (!address || !isAddress(address)) {\n throw new OmaTrustError(\"INVALID_DID\", \"Invalid did:ethr identifier\", { identifier });\n }\n return getAddress(address);\n }\n\n if (identifier.match(/^[a-z0-9-]+:[a-zA-Z0-9-]+:0x[a-fA-F0-9]{40}$/)) {\n const parsed = parseCaip10(identifier);\n return parsed.address;\n }\n\n if (isAddress(identifier)) {\n return getAddress(identifier);\n }\n\n throw new OmaTrustError(\"INVALID_DID\", \"Unsupported identifier format\", { identifier });\n}\n","import canonicalize from \"canonicalize\";\nimport { keccak256, sha256, toUtf8Bytes } from \"ethers\";\nimport { OmaTrustError } from \"../shared/errors\";\n\ntype Hex = `0x${string}`;\n\nexport function canonicalizeJson(obj: unknown): string {\n const jcs = canonicalize(obj);\n if (!jcs) {\n throw new OmaTrustError(\"INVALID_INPUT\", \"Object cannot be canonicalized\", { obj });\n }\n return jcs;\n}\n\nexport function canonicalizeForHash(obj: unknown): { jcsJson: string; hash: Hex } {\n const jcsJson = canonicalizeJson(obj);\n return {\n jcsJson,\n hash: keccak256(toUtf8Bytes(jcsJson)) as Hex\n };\n}\n\nexport function hashCanonicalizedJson(obj: unknown, algorithm: \"keccak256\" | \"sha256\"): Hex {\n const jcs = canonicalizeJson(obj);\n const bytes = toUtf8Bytes(jcs);\n return (algorithm === \"keccak256\" ? keccak256(bytes) : sha256(bytes)) as Hex;\n}\n"]}
@@ -91,7 +91,7 @@ function extractDidIdentifier(did) {
91
91
  }
92
92
  function normalizeDomain(domain) {
93
93
  assertString(domain, "domain", "INVALID_DID");
94
- return domain.trim().toLowerCase().replace(/\.$/, "");
94
+ return domain.trim().toLowerCase().replace(/\.$/, "").replace(/^www\./, "");
95
95
  }
96
96
  function normalizeDidWeb(input) {
97
97
  assertString(input, "input", "INVALID_DID");
@@ -1 +1 @@
1
- {"version":3,"sources":["../../src/shared/errors.ts","../../src/shared/assert.ts","../../src/identity/caip.ts","../../src/identity/did.ts","../../src/identity/data.ts"],"names":["keccak256","toUtf8Bytes"],"mappings":";;;;;;AAAO,IAAM,aAAA,GAAN,cAA4B,KAAA,CAAM;AAAA,EACvC,IAAA;AAAA,EACA,OAAA;AAAA,EAEA,WAAA,CAAY,IAAA,EAAc,OAAA,EAAiB,OAAA,EAAmB;AAC5D,IAAA,KAAA,CAAM,OAAO,CAAA;AACb,IAAA,IAAA,CAAK,IAAA,GAAO,eAAA;AACZ,IAAA,IAAA,CAAK,IAAA,GAAO,IAAA;AACZ,IAAA,IAAA,CAAK,OAAA,GAAU,OAAA;AAAA,EACjB;AACF,CAAA;;;ACRO,SAAS,YAAA,CAAa,KAAA,EAAgB,IAAA,EAAc,IAA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EAAG;AACzB,IAAA,OAAO,WAAW,UAAU,CAAA;AAAA,EAC9B;AAEA,EAAA,MAAM,IAAI,aAAA,CAAc,aAAA,EAAe,+BAAA,EAAiC,EAAE,YAAY,CAAA;AACxF;ACzPO,SAAS,iBAAiB,GAAA,EAAsB;AACrD,EAAA,MAAM,GAAA,GAAM,aAAa,GAAG,CAAA;AAC5B,EAAA,IAAI,CAAC,GAAA,EAAK;AACR,IAAA,MAAM,IAAI,aAAA,CAAc,eAAA,EAAiB,gCAAA,EAAkC,EAAE,KAAK,CAAA;AAAA,EACpF;AACA,EAAA,OAAO,GAAA;AACT;AAEO,SAAS,oBAAoB,GAAA,EAA8C;AAChF,EAAA,MAAM,OAAA,GAAU,iBAAiB,GAAG,CAAA;AACpC,EAAA,OAAO;AAAA,IACL,OAAA;AAAA,IACA,IAAA,EAAMA,SAAAA,CAAUC,WAAAA,CAAY,OAAO,CAAC;AAAA,GACtC;AACF;AAEO,SAAS,qBAAA,CAAsB,KAAc,SAAA,EAAwC;AAC1F,EAAA,MAAM,GAAA,GAAM,iBAAiB,GAAG,CAAA;AAChC,EAAA,MAAM,KAAA,GAAQA,YAAY,GAAG,CAAA;AAC7B,EAAA,OAAQ,cAAc,WAAA,GAAcD,SAAAA,CAAU,KAAK,CAAA,GAAI,OAAO,KAAK,CAAA;AACrE","file":"index.js","sourcesContent":["export class OmaTrustError extends Error {\n code: string;\n details?: unknown;\n\n constructor(code: string, message: string, details?: unknown) {\n super(message);\n this.name = \"OmaTrustError\";\n this.code = code;\n this.details = details;\n }\n}\n\nexport function toOmaTrustError(\n code: string,\n message: string,\n details?: unknown\n): OmaTrustError {\n return new OmaTrustError(code, message, details);\n}\n","import { OmaTrustError } from \"./errors\";\n\nexport function assertString(value: unknown, name: string, code = \"INVALID_INPUT\"): asserts value is string {\n if (typeof value !== \"string\" || value.trim().length === 0) {\n throw new OmaTrustError(code, `${name} must be a non-empty string`, { value });\n }\n}\n\nexport function assertNumber(value: unknown, name: string, code = \"INVALID_INPUT\"): asserts value is number {\n if (typeof value !== \"number\" || Number.isNaN(value)) {\n throw new OmaTrustError(code, `${name} must be a valid number`, { value });\n }\n}\n\nexport function assertObject(value: unknown, name: string, code = \"INVALID_INPUT\"): asserts value is Record<string, unknown> {\n if (!value || typeof value !== \"object\" || Array.isArray(value)) {\n throw new OmaTrustError(code, `${name} must be an object`, { value });\n }\n}\n\nexport function asError(err: unknown): Error {\n if (err instanceof Error) {\n return err;\n }\n return new Error(String(err));\n}\n","import { OmaTrustError } from \"../shared/errors\";\nimport { assertString } from \"../shared/assert\";\n\nexport type Caip10 = string;\n\nexport type ParsedCaip10 = {\n namespace: string;\n reference: string;\n address: string;\n};\n\nexport type ParsedCaip2 = {\n namespace: string;\n reference: string;\n};\n\nconst CAIP_10_REGEX = /^(?<namespace>[a-z0-9-]+):(?<reference>[a-zA-Z0-9-]+):(?<address>.+)$/;\nconst CAIP_2_REGEX = /^(?<namespace>[a-z0-9-]+):(?<reference>[a-zA-Z0-9-]+)$/;\n\nexport function parseCaip10(input: string): ParsedCaip10 {\n assertString(input, \"input\", \"INVALID_CAIP\");\n const trimmed = input.trim();\n const match = trimmed.match(CAIP_10_REGEX);\n if (!match?.groups) {\n throw new OmaTrustError(\"INVALID_CAIP\", \"Invalid CAIP-10 format\", { input });\n }\n\n const namespace = match.groups.namespace;\n const reference = match.groups.reference;\n const address = match.groups.address;\n\n if (!namespace || !reference || !address) {\n throw new OmaTrustError(\"INVALID_CAIP\", \"Invalid CAIP-10 components\", { input });\n }\n\n return { namespace, reference, address };\n}\n\nexport function buildCaip10(namespace: string, reference: string, address: string): Caip10 {\n assertString(namespace, \"namespace\", \"INVALID_CAIP\");\n assertString(reference, \"reference\", \"INVALID_CAIP\");\n assertString(address, \"address\", \"INVALID_CAIP\");\n return `${namespace}:${reference}:${address}`;\n}\n\nexport function normalizeCaip10(input: string): Caip10 {\n const parsed = parseCaip10(input);\n const namespace = parsed.namespace.toLowerCase();\n const reference = parsed.reference;\n\n let address = parsed.address;\n if (namespace === \"eip155\") {\n address = address.toLowerCase();\n }\n\n return buildCaip10(namespace, reference, address);\n}\n\nexport function buildCaip2(namespace: string, reference: string): string {\n assertString(namespace, \"namespace\", \"INVALID_CAIP\");\n assertString(reference, \"reference\", \"INVALID_CAIP\");\n return `${namespace}:${reference}`;\n}\n\nexport function parseCaip2(caip2: string): ParsedCaip2 {\n assertString(caip2, \"caip2\", \"INVALID_CAIP\");\n const trimmed = caip2.trim();\n const match = trimmed.match(CAIP_2_REGEX);\n if (!match?.groups) {\n throw new OmaTrustError(\"INVALID_CAIP\", \"Invalid CAIP-2 format\", { caip2 });\n }\n\n const namespace = match.groups.namespace;\n const reference = match.groups.reference;\n if (!namespace || !reference) {\n throw new OmaTrustError(\"INVALID_CAIP\", \"Invalid CAIP-2 components\", { caip2 });\n }\n\n return { namespace, reference };\n}\n","import { getAddress, isAddress, keccak256, toUtf8Bytes } from \"ethers\";\nimport { OmaTrustError } from \"../shared/errors\";\nimport { assertString } from \"../shared/assert\";\nimport { parseCaip10 } from \"./caip\";\n\nexport type Hex = `0x${string}`;\nexport type Did = string;\n\nconst DID_REGEX = /^did:[a-z0-9]+:.+$/i;\n\nexport function isValidDid(did: string): boolean {\n return DID_REGEX.test(did);\n}\n\nexport function extractDidMethod(did: Did): string | null {\n const match = did.match(/^did:([a-z0-9]+):/i);\n return match ? match[1] : null;\n}\n\nexport function extractDidIdentifier(did: Did): string | null {\n const match = did.match(/^did:[a-z0-9]+:(.+)$/i);\n return match ? match[1] : null;\n}\n\nexport function normalizeDomain(domain: string): string {\n assertString(domain, \"domain\", \"INVALID_DID\");\n return domain.trim().toLowerCase().replace(/\\.$/, \"\");\n}\n\nexport function normalizeDidWeb(input: string): Did {\n assertString(input, \"input\", \"INVALID_DID\");\n const trimmed = input.trim();\n\n if (trimmed.startsWith(\"did:\") && !trimmed.startsWith(\"did:web:\")) {\n throw new OmaTrustError(\"INVALID_DID\", \"Expected did:web DID\", { input });\n }\n\n const identifier = trimmed.startsWith(\"did:web:\")\n ? trimmed.slice(\"did:web:\".length)\n : trimmed;\n\n const [host, ...pathParts] = identifier.split(\"/\");\n if (!host) {\n throw new OmaTrustError(\"INVALID_DID\", \"Invalid did:web identifier\", { input });\n }\n\n const normalizedHost = normalizeDomain(host);\n const path = pathParts.length > 0 ? `/${pathParts.join(\"/\")}` : \"\";\n return `did:web:${normalizedHost}${path}`;\n}\n\nexport function normalizeDidPkh(input: string): Did {\n assertString(input, \"input\", \"INVALID_DID\");\n const trimmed = input.trim();\n if (!trimmed.startsWith(\"did:pkh:\")) {\n throw new OmaTrustError(\"INVALID_DID\", \"Expected did:pkh DID\", { input });\n }\n\n const parts = trimmed.split(\":\");\n if (parts.length !== 5) {\n throw new OmaTrustError(\"INVALID_DID\", \"Invalid did:pkh format\", { input });\n }\n\n const [, , namespace, chainId, address] = parts;\n if (!namespace || !chainId || !address) {\n throw new OmaTrustError(\"INVALID_DID\", \"Invalid did:pkh components\", { input });\n }\n\n return `did:pkh:${namespace.toLowerCase()}:${chainId}:${address.toLowerCase()}`;\n}\n\nexport function normalizeDidHandle(input: string): Did {\n assertString(input, \"input\", \"INVALID_DID\");\n const trimmed = input.trim();\n if (!trimmed.startsWith(\"did:handle:\")) {\n throw new OmaTrustError(\"INVALID_DID\", \"Expected did:handle DID\", { input });\n }\n\n const parts = trimmed.split(\":\");\n if (parts.length !== 4) {\n throw new OmaTrustError(\"INVALID_DID\", \"Invalid did:handle format\", { input });\n }\n\n const [, , platform, username] = parts;\n if (!platform || !username) {\n throw new OmaTrustError(\"INVALID_DID\", \"Invalid did:handle components\", { input });\n }\n\n return `did:handle:${platform.toLowerCase()}:${username}`;\n}\n\nexport function normalizeDidKey(input: string): Did {\n assertString(input, \"input\", \"INVALID_DID\");\n const trimmed = input.trim();\n if (!trimmed.startsWith(\"did:key:\")) {\n throw new OmaTrustError(\"INVALID_DID\", \"Expected did:key DID\", { input });\n }\n\n return trimmed;\n}\n\nexport function normalizeDid(input: string): Did {\n assertString(input, \"input\", \"INVALID_DID\");\n const trimmed = input.trim();\n\n if (!trimmed.startsWith(\"did:\")) {\n return normalizeDidWeb(trimmed);\n }\n\n if (!isValidDid(trimmed)) {\n throw new OmaTrustError(\"INVALID_DID\", \"Invalid DID format\", { input });\n }\n\n const method = extractDidMethod(trimmed);\n switch (method) {\n case \"web\":\n return normalizeDidWeb(trimmed);\n case \"pkh\":\n return normalizeDidPkh(trimmed);\n case \"handle\":\n return normalizeDidHandle(trimmed);\n case \"key\":\n return normalizeDidKey(trimmed);\n default:\n return trimmed;\n }\n}\n\nexport function computeDidHash(did: Did): Hex {\n const normalized = normalizeDid(did);\n return keccak256(toUtf8Bytes(normalized)) as Hex;\n}\n\nexport function computeDidAddress(didHash: Hex): Hex {\n assertString(didHash, \"didHash\", \"INVALID_DID\");\n if (!/^0x[0-9a-fA-F]{64}$/.test(didHash)) {\n throw new OmaTrustError(\"INVALID_DID\", \"didHash must be 32-byte hex\", { didHash });\n }\n\n // Spec: low-order 160 bits of didHash, serialized as lowercase 0x-hex.\n return `0x${didHash.slice(-40).toLowerCase()}` as Hex;\n}\n\nexport function didToAddress(did: Did): Hex {\n return computeDidAddress(computeDidHash(did));\n}\n\nexport function validateDidAddress(did: Did, address: Hex): boolean {\n try {\n return didToAddress(did).toLowerCase() === String(address).toLowerCase();\n } catch {\n return false;\n }\n}\n\nexport function buildDidWeb(domain: string): Did {\n return `did:web:${normalizeDomain(domain)}`;\n}\n\nexport function buildDidPkh(\n namespace: string,\n chainId: string | number,\n address: string\n): Did {\n assertString(namespace, \"namespace\", \"INVALID_DID\");\n assertString(address, \"address\", \"INVALID_DID\");\n if (chainId === \"\" || chainId === null || chainId === undefined) {\n throw new OmaTrustError(\"INVALID_DID\", \"chainId is required\", { chainId });\n }\n return `did:pkh:${namespace.toLowerCase()}:${chainId}:${address.toLowerCase()}`;\n}\n\nexport function buildEvmDidPkh(chainId: string | number, address: string): Did {\n return buildDidPkh(\"eip155\", chainId, address);\n}\n\nexport function buildDidPkhFromCaip10(caip10: string): Did {\n const parsed = parseCaip10(caip10);\n return buildDidPkh(parsed.namespace, parsed.reference, parsed.address);\n}\n\nfunction parseDidPkh(did: Did): { namespace: string; chainId: string; address: string } | null {\n if (!did.startsWith(\"did:pkh:\")) {\n return null;\n }\n\n const parts = did.split(\":\");\n if (parts.length !== 5) {\n return null;\n }\n\n const [, , namespace, chainId, address] = parts;\n if (!namespace || !chainId || !address) {\n return null;\n }\n\n return { namespace, chainId, address };\n}\n\nexport function getChainIdFromDidPkh(did: Did): string | null {\n return parseDidPkh(did)?.chainId ?? null;\n}\n\nexport function getAddressFromDidPkh(did: Did): string | null {\n return parseDidPkh(did)?.address ?? null;\n}\n\nexport function getNamespaceFromDidPkh(did: Did): string | null {\n return parseDidPkh(did)?.namespace ?? null;\n}\n\nexport function isEvmDidPkh(did: Did): boolean {\n return getNamespaceFromDidPkh(did) === \"eip155\";\n}\n\nexport function getDomainFromDidWeb(did: Did): string | null {\n if (!did.startsWith(\"did:web:\")) {\n return null;\n }\n\n const identifier = did.slice(\"did:web:\".length);\n const [domain] = identifier.split(\"/\");\n return domain || null;\n}\n\nexport function extractAddressFromDid(identifier: string): string {\n assertString(identifier, \"identifier\", \"INVALID_DID\");\n\n if (identifier.startsWith(\"did:pkh:\")) {\n const pkh = parseDidPkh(normalizeDidPkh(identifier));\n if (!pkh) {\n throw new OmaTrustError(\"INVALID_DID\", \"Invalid did:pkh identifier\", { identifier });\n }\n return pkh.address;\n }\n\n if (identifier.startsWith(\"did:ethr:\")) {\n const parts = identifier.replace(\"did:ethr:\", \"\").split(\":\");\n const address = parts.length === 1 ? parts[0] : parts[1];\n if (!address || !isAddress(address)) {\n throw new OmaTrustError(\"INVALID_DID\", \"Invalid did:ethr identifier\", { identifier });\n }\n return getAddress(address);\n }\n\n if (identifier.match(/^[a-z0-9-]+:[a-zA-Z0-9-]+:0x[a-fA-F0-9]{40}$/)) {\n const parsed = parseCaip10(identifier);\n return parsed.address;\n }\n\n if (isAddress(identifier)) {\n return getAddress(identifier);\n }\n\n throw new OmaTrustError(\"INVALID_DID\", \"Unsupported identifier format\", { identifier });\n}\n","import canonicalize from \"canonicalize\";\nimport { keccak256, sha256, toUtf8Bytes } from \"ethers\";\nimport { OmaTrustError } from \"../shared/errors\";\n\ntype Hex = `0x${string}`;\n\nexport function canonicalizeJson(obj: unknown): string {\n const jcs = canonicalize(obj);\n if (!jcs) {\n throw new OmaTrustError(\"INVALID_INPUT\", \"Object cannot be canonicalized\", { obj });\n }\n return jcs;\n}\n\nexport function canonicalizeForHash(obj: unknown): { jcsJson: string; hash: Hex } {\n const jcsJson = canonicalizeJson(obj);\n return {\n jcsJson,\n hash: keccak256(toUtf8Bytes(jcsJson)) as Hex\n };\n}\n\nexport function hashCanonicalizedJson(obj: unknown, algorithm: \"keccak256\" | \"sha256\"): Hex {\n const jcs = canonicalizeJson(obj);\n const bytes = toUtf8Bytes(jcs);\n return (algorithm === \"keccak256\" ? keccak256(bytes) : sha256(bytes)) as Hex;\n}\n"]}
1
+ {"version":3,"sources":["../../src/shared/errors.ts","../../src/shared/assert.ts","../../src/identity/caip.ts","../../src/identity/did.ts","../../src/identity/data.ts"],"names":["keccak256","toUtf8Bytes"],"mappings":";;;;;;AAAO,IAAM,aAAA,GAAN,cAA4B,KAAA,CAAM;AAAA,EACvC,IAAA;AAAA,EACA,OAAA;AAAA,EAEA,WAAA,CAAY,IAAA,EAAc,OAAA,EAAiB,OAAA,EAAmB;AAC5D,IAAA,KAAA,CAAM,OAAO,CAAA;AACb,IAAA,IAAA,CAAK,IAAA,GAAO,eAAA;AACZ,IAAA,IAAA,CAAK,IAAA,GAAO,IAAA;AACZ,IAAA,IAAA,CAAK,OAAA,GAAU,OAAA;AAAA,EACjB;AACF,CAAA;;;ACRO,SAAS,YAAA,CAAa,KAAA,EAAgB,IAAA,EAAc,IAAA,GAAO,eAAA,EAA0C;AAC1G,EAAA,IAAI,OAAO,KAAA,KAAU,QAAA,IAAY,MAAM,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AA,OAAO,WAAW,UAAU,CAAA;AAAA,EAC9B;AAEA,EAAA,MAAM,IAAI,aAAA,CAAc,aAAA,EAAe,+BAAA,EAAiC,EAAE,YAAY,CAAA;AACxF;ACzPO,SAAS,iBAAiB,GAAA,EAAsB;AACrD,EAAA,MAAM,GAAA,GAAM,aAAa,GAAG,CAAA;AAC5B,EAAA,IAAI,CAAC,GAAA,EAAK;AACR,IAAA,MAAM,IAAI,aAAA,CAAc,eAAA,EAAiB,gCAAA,EAAkC,EAAE,KAAK,CAAA;AAAA,EACpF;AACA,EAAA,OAAO,GAAA;AACT;AAEO,SAAS,oBAAoB,GAAA,EAA8C;AAChF,EAAA,MAAM,OAAA,GAAU,iBAAiB,GAAG,CAAA;AACpC,EAAA,OAAO;AAAA,IACL,OAAA;AAAA,IACA,IAAA,EAAMA,SAAAA,CAAUC,WAAAA,CAAY,OAAO,CAAC;AAAA,GACtC;AACF;AAEO,SAAS,qBAAA,CAAsB,KAAc,SAAA,EAAwC;AAC1F,EAAA,MAAM,GAAA,GAAM,iBAAiB,GAAG,CAAA;AAChC,EAAA,MAAM,KAAA,GAAQA,YAAY,GAAG,CAAA;AAC7B,EAAA,OAAQ,cAAc,WAAA,GAAcD,SAAAA,CAAU,KAAK,CAAA,GAAI,OAAO,KAAK,CAAA;AACrE","file":"index.js","sourcesContent":["export class OmaTrustError extends Error {\n code: string;\n details?: unknown;\n\n constructor(code: string, message: string, details?: unknown) {\n super(message);\n this.name = \"OmaTrustError\";\n this.code = code;\n this.details = details;\n }\n}\n\nexport function toOmaTrustError(\n code: string,\n message: string,\n details?: unknown\n): OmaTrustError {\n return new OmaTrustError(code, message, details);\n}\n","import { OmaTrustError } from \"./errors\";\n\nexport function assertString(value: unknown, name: string, code = \"INVALID_INPUT\"): asserts value is string {\n if (typeof value !== \"string\" || value.trim().length === 0) {\n throw new OmaTrustError(code, `${name} must be a non-empty string`, { value });\n }\n}\n\nexport function assertNumber(value: unknown, name: string, code = \"INVALID_INPUT\"): asserts value is number {\n if (typeof value !== \"number\" || Number.isNaN(value)) {\n throw new OmaTrustError(code, `${name} must be a valid number`, { value });\n }\n}\n\nexport function assertObject(value: unknown, name: string, code = \"INVALID_INPUT\"): asserts value is Record<string, unknown> {\n if (!value || typeof value !== \"object\" || Array.isArray(value)) {\n throw new OmaTrustError(code, `${name} must be an object`, { value });\n }\n}\n\nexport function asError(err: unknown): Error {\n if (err instanceof Error) {\n return err;\n }\n return new Error(String(err));\n}\n","import { OmaTrustError } from \"../shared/errors\";\nimport { assertString } from \"../shared/assert\";\n\nexport type Caip10 = string;\n\nexport type ParsedCaip10 = {\n namespace: string;\n reference: string;\n address: string;\n};\n\nexport type ParsedCaip2 = {\n namespace: string;\n reference: string;\n};\n\nconst CAIP_10_REGEX = /^(?<namespace>[a-z0-9-]+):(?<reference>[a-zA-Z0-9-]+):(?<address>.+)$/;\nconst CAIP_2_REGEX = /^(?<namespace>[a-z0-9-]+):(?<reference>[a-zA-Z0-9-]+)$/;\n\nexport function parseCaip10(input: string): ParsedCaip10 {\n assertString(input, \"input\", \"INVALID_CAIP\");\n const trimmed = input.trim();\n const match = trimmed.match(CAIP_10_REGEX);\n if (!match?.groups) {\n throw new OmaTrustError(\"INVALID_CAIP\", \"Invalid CAIP-10 format\", { input });\n }\n\n const namespace = match.groups.namespace;\n const reference = match.groups.reference;\n const address = match.groups.address;\n\n if (!namespace || !reference || !address) {\n throw new OmaTrustError(\"INVALID_CAIP\", \"Invalid CAIP-10 components\", { input });\n }\n\n return { namespace, reference, address };\n}\n\nexport function buildCaip10(namespace: string, reference: string, address: string): Caip10 {\n assertString(namespace, \"namespace\", \"INVALID_CAIP\");\n assertString(reference, \"reference\", \"INVALID_CAIP\");\n assertString(address, \"address\", \"INVALID_CAIP\");\n return `${namespace}:${reference}:${address}`;\n}\n\nexport function normalizeCaip10(input: string): Caip10 {\n const parsed = parseCaip10(input);\n const namespace = parsed.namespace.toLowerCase();\n const reference = parsed.reference;\n\n let address = parsed.address;\n if (namespace === \"eip155\") {\n address = address.toLowerCase();\n }\n\n return buildCaip10(namespace, reference, address);\n}\n\nexport function buildCaip2(namespace: string, reference: string): string {\n assertString(namespace, \"namespace\", \"INVALID_CAIP\");\n assertString(reference, \"reference\", \"INVALID_CAIP\");\n return `${namespace}:${reference}`;\n}\n\nexport function parseCaip2(caip2: string): ParsedCaip2 {\n assertString(caip2, \"caip2\", \"INVALID_CAIP\");\n const trimmed = caip2.trim();\n const match = trimmed.match(CAIP_2_REGEX);\n if (!match?.groups) {\n throw new OmaTrustError(\"INVALID_CAIP\", \"Invalid CAIP-2 format\", { caip2 });\n }\n\n const namespace = match.groups.namespace;\n const reference = match.groups.reference;\n if (!namespace || !reference) {\n throw new OmaTrustError(\"INVALID_CAIP\", \"Invalid CAIP-2 components\", { caip2 });\n }\n\n return { namespace, reference };\n}\n","import { getAddress, isAddress, keccak256, toUtf8Bytes } from \"ethers\";\nimport { OmaTrustError } from \"../shared/errors\";\nimport { assertString } from \"../shared/assert\";\nimport { parseCaip10 } from \"./caip\";\n\nexport type Hex = `0x${string}`;\nexport type Did = string;\n\nconst DID_REGEX = /^did:[a-z0-9]+:.+$/i;\n\nexport function isValidDid(did: string): boolean {\n return DID_REGEX.test(did);\n}\n\nexport function extractDidMethod(did: Did): string | null {\n const match = did.match(/^did:([a-z0-9]+):/i);\n return match ? match[1] : null;\n}\n\nexport function extractDidIdentifier(did: Did): string | null {\n const match = did.match(/^did:[a-z0-9]+:(.+)$/i);\n return match ? match[1] : null;\n}\n\nexport function normalizeDomain(domain: string): string {\n assertString(domain, \"domain\", \"INVALID_DID\");\n return domain.trim().toLowerCase().replace(/\\.$/, \"\").replace(/^www\\./, \"\");\n}\n\nexport function normalizeDidWeb(input: string): Did {\n assertString(input, \"input\", \"INVALID_DID\");\n const trimmed = input.trim();\n\n if (trimmed.startsWith(\"did:\") && !trimmed.startsWith(\"did:web:\")) {\n throw new OmaTrustError(\"INVALID_DID\", \"Expected did:web DID\", { input });\n }\n\n const identifier = trimmed.startsWith(\"did:web:\")\n ? trimmed.slice(\"did:web:\".length)\n : trimmed;\n\n const [host, ...pathParts] = identifier.split(\"/\");\n if (!host) {\n throw new OmaTrustError(\"INVALID_DID\", \"Invalid did:web identifier\", { input });\n }\n\n const normalizedHost = normalizeDomain(host);\n const path = pathParts.length > 0 ? `/${pathParts.join(\"/\")}` : \"\";\n return `did:web:${normalizedHost}${path}`;\n}\n\nexport function normalizeDidPkh(input: string): Did {\n assertString(input, \"input\", \"INVALID_DID\");\n const trimmed = input.trim();\n if (!trimmed.startsWith(\"did:pkh:\")) {\n throw new OmaTrustError(\"INVALID_DID\", \"Expected did:pkh DID\", { input });\n }\n\n const parts = trimmed.split(\":\");\n if (parts.length !== 5) {\n throw new OmaTrustError(\"INVALID_DID\", \"Invalid did:pkh format\", { input });\n }\n\n const [, , namespace, chainId, address] = parts;\n if (!namespace || !chainId || !address) {\n throw new OmaTrustError(\"INVALID_DID\", \"Invalid did:pkh components\", { input });\n }\n\n return `did:pkh:${namespace.toLowerCase()}:${chainId}:${address.toLowerCase()}`;\n}\n\nexport function normalizeDidHandle(input: string): Did {\n assertString(input, \"input\", \"INVALID_DID\");\n const trimmed = input.trim();\n if (!trimmed.startsWith(\"did:handle:\")) {\n throw new OmaTrustError(\"INVALID_DID\", \"Expected did:handle DID\", { input });\n }\n\n const parts = trimmed.split(\":\");\n if (parts.length !== 4) {\n throw new OmaTrustError(\"INVALID_DID\", \"Invalid did:handle format\", { input });\n }\n\n const [, , platform, username] = parts;\n if (!platform || !username) {\n throw new OmaTrustError(\"INVALID_DID\", \"Invalid did:handle components\", { input });\n }\n\n return `did:handle:${platform.toLowerCase()}:${username}`;\n}\n\nexport function normalizeDidKey(input: string): Did {\n assertString(input, \"input\", \"INVALID_DID\");\n const trimmed = input.trim();\n if (!trimmed.startsWith(\"did:key:\")) {\n throw new OmaTrustError(\"INVALID_DID\", \"Expected did:key DID\", { input });\n }\n\n return trimmed;\n}\n\nexport function normalizeDid(input: string): Did {\n assertString(input, \"input\", \"INVALID_DID\");\n const trimmed = input.trim();\n\n if (!trimmed.startsWith(\"did:\")) {\n return normalizeDidWeb(trimmed);\n }\n\n if (!isValidDid(trimmed)) {\n throw new OmaTrustError(\"INVALID_DID\", \"Invalid DID format\", { input });\n }\n\n const method = extractDidMethod(trimmed);\n switch (method) {\n case \"web\":\n return normalizeDidWeb(trimmed);\n case \"pkh\":\n return normalizeDidPkh(trimmed);\n case \"handle\":\n return normalizeDidHandle(trimmed);\n case \"key\":\n return normalizeDidKey(trimmed);\n default:\n return trimmed;\n }\n}\n\nexport function computeDidHash(did: Did): Hex {\n const normalized = normalizeDid(did);\n return keccak256(toUtf8Bytes(normalized)) as Hex;\n}\n\nexport function computeDidAddress(didHash: Hex): Hex {\n assertString(didHash, \"didHash\", \"INVALID_DID\");\n if (!/^0x[0-9a-fA-F]{64}$/.test(didHash)) {\n throw new OmaTrustError(\"INVALID_DID\", \"didHash must be 32-byte hex\", { didHash });\n }\n\n // Spec: low-order 160 bits of didHash, serialized as lowercase 0x-hex.\n return `0x${didHash.slice(-40).toLowerCase()}` as Hex;\n}\n\nexport function didToAddress(did: Did): Hex {\n return computeDidAddress(computeDidHash(did));\n}\n\nexport function validateDidAddress(did: Did, address: Hex): boolean {\n try {\n return didToAddress(did).toLowerCase() === String(address).toLowerCase();\n } catch {\n return false;\n }\n}\n\nexport function buildDidWeb(domain: string): Did {\n return `did:web:${normalizeDomain(domain)}`;\n}\n\nexport function buildDidPkh(\n namespace: string,\n chainId: string | number,\n address: string\n): Did {\n assertString(namespace, \"namespace\", \"INVALID_DID\");\n assertString(address, \"address\", \"INVALID_DID\");\n if (chainId === \"\" || chainId === null || chainId === undefined) {\n throw new OmaTrustError(\"INVALID_DID\", \"chainId is required\", { chainId });\n }\n return `did:pkh:${namespace.toLowerCase()}:${chainId}:${address.toLowerCase()}`;\n}\n\nexport function buildEvmDidPkh(chainId: string | number, address: string): Did {\n return buildDidPkh(\"eip155\", chainId, address);\n}\n\nexport function buildDidPkhFromCaip10(caip10: string): Did {\n const parsed = parseCaip10(caip10);\n return buildDidPkh(parsed.namespace, parsed.reference, parsed.address);\n}\n\nfunction parseDidPkh(did: Did): { namespace: string; chainId: string; address: string } | null {\n if (!did.startsWith(\"did:pkh:\")) {\n return null;\n }\n\n const parts = did.split(\":\");\n if (parts.length !== 5) {\n return null;\n }\n\n const [, , namespace, chainId, address] = parts;\n if (!namespace || !chainId || !address) {\n return null;\n }\n\n return { namespace, chainId, address };\n}\n\nexport function getChainIdFromDidPkh(did: Did): string | null {\n return parseDidPkh(did)?.chainId ?? null;\n}\n\nexport function getAddressFromDidPkh(did: Did): string | null {\n return parseDidPkh(did)?.address ?? null;\n}\n\nexport function getNamespaceFromDidPkh(did: Did): string | null {\n return parseDidPkh(did)?.namespace ?? null;\n}\n\nexport function isEvmDidPkh(did: Did): boolean {\n return getNamespaceFromDidPkh(did) === \"eip155\";\n}\n\nexport function getDomainFromDidWeb(did: Did): string | null {\n if (!did.startsWith(\"did:web:\")) {\n return null;\n }\n\n const identifier = did.slice(\"did:web:\".length);\n const [domain] = identifier.split(\"/\");\n return domain || null;\n}\n\nexport function extractAddressFromDid(identifier: string): string {\n assertString(identifier, \"identifier\", \"INVALID_DID\");\n\n if (identifier.startsWith(\"did:pkh:\")) {\n const pkh = parseDidPkh(normalizeDidPkh(identifier));\n if (!pkh) {\n throw new OmaTrustError(\"INVALID_DID\", \"Invalid did:pkh identifier\", { identifier });\n }\n return pkh.address;\n }\n\n if (identifier.startsWith(\"did:ethr:\")) {\n const parts = identifier.replace(\"did:ethr:\", \"\").split(\":\");\n const address = parts.length === 1 ? parts[0] : parts[1];\n if (!address || !isAddress(address)) {\n throw new OmaTrustError(\"INVALID_DID\", \"Invalid did:ethr identifier\", { identifier });\n }\n return getAddress(address);\n }\n\n if (identifier.match(/^[a-z0-9-]+:[a-zA-Z0-9-]+:0x[a-fA-F0-9]{40}$/)) {\n const parsed = parseCaip10(identifier);\n return parsed.address;\n }\n\n if (isAddress(identifier)) {\n return getAddress(identifier);\n }\n\n throw new OmaTrustError(\"INVALID_DID\", \"Unsupported identifier format\", { identifier });\n}\n","import canonicalize from \"canonicalize\";\nimport { keccak256, sha256, toUtf8Bytes } from \"ethers\";\nimport { OmaTrustError } from \"../shared/errors\";\n\ntype Hex = `0x${string}`;\n\nexport function canonicalizeJson(obj: unknown): string {\n const jcs = canonicalize(obj);\n if (!jcs) {\n throw new OmaTrustError(\"INVALID_INPUT\", \"Object cannot be canonicalized\", { obj });\n }\n return jcs;\n}\n\nexport function canonicalizeForHash(obj: unknown): { jcsJson: string; hash: Hex } {\n const jcsJson = canonicalizeJson(obj);\n return {\n jcsJson,\n hash: keccak256(toUtf8Bytes(jcsJson)) as Hex\n };\n}\n\nexport function hashCanonicalizedJson(obj: unknown, algorithm: \"keccak256\" | \"sha256\"): Hex {\n const jcs = canonicalizeJson(obj);\n const bytes = toUtf8Bytes(jcs);\n return (algorithm === \"keccak256\" ? keccak256(bytes) : sha256(bytes)) as Hex;\n}\n"]}
@@ -0,0 +1,119 @@
1
+ import { D as Did, A as AttestationQueryResult, a as AttestationValidationError, B as BuildDelegatedTypedDataFromEncodedParams, C as CallControllerWitnessParams, b as CallControllerWitnessResult, c as ChainConstants, d as CreatePopEip712ProofParams, e as CreatePopJwsProofParams, E as EvidencePointerProof, f as EvmOwnershipProvider, G as GetAttestationParams, g as GetAttestationsByAttesterParams, h as GetLatestAttestationsParams, H as Hex, L as ListAttestationsParams, P as PopEip712Proof, i as PopJwsProof, j as PrepareDelegatedAttestationParams, k as PrepareDelegatedAttestationResult, l as ProofPurpose, m as ProofType, n as ProofWrapper, R as RevokeAttestationParams, o as RevokeAttestationResult, S as SchemaField, p as SubjectOwnershipVerificationMethod, q as SubjectOwnershipVerificationResult, r as SubmitAttestationParams, s as SubmitAttestationResult, t as SubmitDelegatedAttestationParams, u as SubmitDelegatedAttestationResult, T as TxEncodedValueProof, v as TxInteractionProof, V as VerifyAttestationParams, w as VerifyAttestationResult, x as VerifyDidJsonControllerDidOptions, y as VerifyDidPkhOwnershipParams, z as VerifyDidWebOwnershipParams, F as VerifyProofParams, I as VerifyProofResult, J as VerifySubjectOwnershipParams, X as X402OfferProof, K as X402ReceiptProof, M as buildDelegatedAttestationTypedData, N as buildDelegatedTypedDataFromEncoded, O as buildDnsTxtRecord, Q as buildEip712Domain, U as calculateAverageUserReviewRating, W as calculateTransferAmount, Y as calculateTransferAmountFromAddresses, Z as callControllerWitness, _ as constructSeed, $ as createEvidencePointerProof, a0 as createPopEip712Proof, a1 as createPopJwsProof, a2 as createTxEncodedValueProof, a3 as createTxInteractionProof, a4 as createX402OfferProof, a5 as createX402ReceiptProof, a6 as decodeAttestationData, a7 as deduplicateReviews, a8 as encodeAttestationData, a9 as extractAddressesFromDidDocument, aa as extractExpirationTime, ab as fetchDidDocument, ac as formatSchemaUid, ad as formatTransferAmount, ae as getAttestation, af as getAttestationsByAttester, ag as getAttestationsForDid, ah as getChainConstants, ai as getExplorerAddressUrl, aj as getExplorerTxUrl, ak as getLatestAttestations, al as getMajorVersion, am as getOmaTrustProofEip712Types, an as getSchemaDetails, ao as getSupportedChainIds, ap as hashSeed, aq as isChainSupported, ar as listAttestations, as as normalizeSchema, at as parseDnsTxtRecord, au as prepareDelegatedAttestation, av as revokeAttestation, aw as schemaToString, ax as splitSignature, ay as submitAttestation, az as submitDelegatedAttestation, aA as validateAttestationData, aB as verifyAttestation, aC as verifyDidDocumentControllerDid, aD as verifyDidJsonControllerDid, aE as verifyDidPkhOwnership, aF as verifyDidWebOwnership, aG as verifyEip712Signature, aH as verifyProof, aI as verifySchemaExists, aJ as verifySubjectOwnership } from './subject-ownership-CXvzEjpH.cjs';
2
+
3
+ interface VerifyDnsTxtControllerDidOptions {
4
+ resolveTxt?: (host: string) => Promise<string[][]>;
5
+ recordPrefix?: string;
6
+ }
7
+ declare function verifyDnsTxtControllerDid(domain: string, expectedControllerDid: Did, options?: VerifyDnsTxtControllerDidOptions): Promise<{
8
+ valid: boolean;
9
+ record?: string;
10
+ reason?: string;
11
+ }>;
12
+
13
+ declare const index_AttestationQueryResult: typeof AttestationQueryResult;
14
+ declare const index_AttestationValidationError: typeof AttestationValidationError;
15
+ declare const index_BuildDelegatedTypedDataFromEncodedParams: typeof BuildDelegatedTypedDataFromEncodedParams;
16
+ declare const index_CallControllerWitnessParams: typeof CallControllerWitnessParams;
17
+ declare const index_CallControllerWitnessResult: typeof CallControllerWitnessResult;
18
+ declare const index_ChainConstants: typeof ChainConstants;
19
+ declare const index_CreatePopEip712ProofParams: typeof CreatePopEip712ProofParams;
20
+ declare const index_CreatePopJwsProofParams: typeof CreatePopJwsProofParams;
21
+ declare const index_Did: typeof Did;
22
+ declare const index_EvidencePointerProof: typeof EvidencePointerProof;
23
+ declare const index_EvmOwnershipProvider: typeof EvmOwnershipProvider;
24
+ declare const index_GetAttestationParams: typeof GetAttestationParams;
25
+ declare const index_GetAttestationsByAttesterParams: typeof GetAttestationsByAttesterParams;
26
+ declare const index_GetLatestAttestationsParams: typeof GetLatestAttestationsParams;
27
+ declare const index_Hex: typeof Hex;
28
+ declare const index_ListAttestationsParams: typeof ListAttestationsParams;
29
+ declare const index_PopEip712Proof: typeof PopEip712Proof;
30
+ declare const index_PopJwsProof: typeof PopJwsProof;
31
+ declare const index_PrepareDelegatedAttestationParams: typeof PrepareDelegatedAttestationParams;
32
+ declare const index_PrepareDelegatedAttestationResult: typeof PrepareDelegatedAttestationResult;
33
+ declare const index_ProofPurpose: typeof ProofPurpose;
34
+ declare const index_ProofType: typeof ProofType;
35
+ declare const index_ProofWrapper: typeof ProofWrapper;
36
+ declare const index_RevokeAttestationParams: typeof RevokeAttestationParams;
37
+ declare const index_RevokeAttestationResult: typeof RevokeAttestationResult;
38
+ declare const index_SchemaField: typeof SchemaField;
39
+ declare const index_SubjectOwnershipVerificationMethod: typeof SubjectOwnershipVerificationMethod;
40
+ declare const index_SubjectOwnershipVerificationResult: typeof SubjectOwnershipVerificationResult;
41
+ declare const index_SubmitAttestationParams: typeof SubmitAttestationParams;
42
+ declare const index_SubmitAttestationResult: typeof SubmitAttestationResult;
43
+ declare const index_SubmitDelegatedAttestationParams: typeof SubmitDelegatedAttestationParams;
44
+ declare const index_SubmitDelegatedAttestationResult: typeof SubmitDelegatedAttestationResult;
45
+ declare const index_TxEncodedValueProof: typeof TxEncodedValueProof;
46
+ declare const index_TxInteractionProof: typeof TxInteractionProof;
47
+ declare const index_VerifyAttestationParams: typeof VerifyAttestationParams;
48
+ declare const index_VerifyAttestationResult: typeof VerifyAttestationResult;
49
+ declare const index_VerifyDidJsonControllerDidOptions: typeof VerifyDidJsonControllerDidOptions;
50
+ declare const index_VerifyDidPkhOwnershipParams: typeof VerifyDidPkhOwnershipParams;
51
+ declare const index_VerifyDidWebOwnershipParams: typeof VerifyDidWebOwnershipParams;
52
+ type index_VerifyDnsTxtControllerDidOptions = VerifyDnsTxtControllerDidOptions;
53
+ declare const index_VerifyProofParams: typeof VerifyProofParams;
54
+ declare const index_VerifyProofResult: typeof VerifyProofResult;
55
+ declare const index_VerifySubjectOwnershipParams: typeof VerifySubjectOwnershipParams;
56
+ declare const index_X402OfferProof: typeof X402OfferProof;
57
+ declare const index_X402ReceiptProof: typeof X402ReceiptProof;
58
+ declare const index_buildDelegatedAttestationTypedData: typeof buildDelegatedAttestationTypedData;
59
+ declare const index_buildDelegatedTypedDataFromEncoded: typeof buildDelegatedTypedDataFromEncoded;
60
+ declare const index_buildDnsTxtRecord: typeof buildDnsTxtRecord;
61
+ declare const index_buildEip712Domain: typeof buildEip712Domain;
62
+ declare const index_calculateAverageUserReviewRating: typeof calculateAverageUserReviewRating;
63
+ declare const index_calculateTransferAmount: typeof calculateTransferAmount;
64
+ declare const index_calculateTransferAmountFromAddresses: typeof calculateTransferAmountFromAddresses;
65
+ declare const index_callControllerWitness: typeof callControllerWitness;
66
+ declare const index_constructSeed: typeof constructSeed;
67
+ declare const index_createEvidencePointerProof: typeof createEvidencePointerProof;
68
+ declare const index_createPopEip712Proof: typeof createPopEip712Proof;
69
+ declare const index_createPopJwsProof: typeof createPopJwsProof;
70
+ declare const index_createTxEncodedValueProof: typeof createTxEncodedValueProof;
71
+ declare const index_createTxInteractionProof: typeof createTxInteractionProof;
72
+ declare const index_createX402OfferProof: typeof createX402OfferProof;
73
+ declare const index_createX402ReceiptProof: typeof createX402ReceiptProof;
74
+ declare const index_decodeAttestationData: typeof decodeAttestationData;
75
+ declare const index_deduplicateReviews: typeof deduplicateReviews;
76
+ declare const index_encodeAttestationData: typeof encodeAttestationData;
77
+ declare const index_extractAddressesFromDidDocument: typeof extractAddressesFromDidDocument;
78
+ declare const index_extractExpirationTime: typeof extractExpirationTime;
79
+ declare const index_fetchDidDocument: typeof fetchDidDocument;
80
+ declare const index_formatSchemaUid: typeof formatSchemaUid;
81
+ declare const index_formatTransferAmount: typeof formatTransferAmount;
82
+ declare const index_getAttestation: typeof getAttestation;
83
+ declare const index_getAttestationsByAttester: typeof getAttestationsByAttester;
84
+ declare const index_getAttestationsForDid: typeof getAttestationsForDid;
85
+ declare const index_getChainConstants: typeof getChainConstants;
86
+ declare const index_getExplorerAddressUrl: typeof getExplorerAddressUrl;
87
+ declare const index_getExplorerTxUrl: typeof getExplorerTxUrl;
88
+ declare const index_getLatestAttestations: typeof getLatestAttestations;
89
+ declare const index_getMajorVersion: typeof getMajorVersion;
90
+ declare const index_getOmaTrustProofEip712Types: typeof getOmaTrustProofEip712Types;
91
+ declare const index_getSchemaDetails: typeof getSchemaDetails;
92
+ declare const index_getSupportedChainIds: typeof getSupportedChainIds;
93
+ declare const index_hashSeed: typeof hashSeed;
94
+ declare const index_isChainSupported: typeof isChainSupported;
95
+ declare const index_listAttestations: typeof listAttestations;
96
+ declare const index_normalizeSchema: typeof normalizeSchema;
97
+ declare const index_parseDnsTxtRecord: typeof parseDnsTxtRecord;
98
+ declare const index_prepareDelegatedAttestation: typeof prepareDelegatedAttestation;
99
+ declare const index_revokeAttestation: typeof revokeAttestation;
100
+ declare const index_schemaToString: typeof schemaToString;
101
+ declare const index_splitSignature: typeof splitSignature;
102
+ declare const index_submitAttestation: typeof submitAttestation;
103
+ declare const index_submitDelegatedAttestation: typeof submitDelegatedAttestation;
104
+ declare const index_validateAttestationData: typeof validateAttestationData;
105
+ declare const index_verifyAttestation: typeof verifyAttestation;
106
+ declare const index_verifyDidDocumentControllerDid: typeof verifyDidDocumentControllerDid;
107
+ declare const index_verifyDidJsonControllerDid: typeof verifyDidJsonControllerDid;
108
+ declare const index_verifyDidPkhOwnership: typeof verifyDidPkhOwnership;
109
+ declare const index_verifyDidWebOwnership: typeof verifyDidWebOwnership;
110
+ declare const index_verifyDnsTxtControllerDid: typeof verifyDnsTxtControllerDid;
111
+ declare const index_verifyEip712Signature: typeof verifyEip712Signature;
112
+ declare const index_verifyProof: typeof verifyProof;
113
+ declare const index_verifySchemaExists: typeof verifySchemaExists;
114
+ declare const index_verifySubjectOwnership: typeof verifySubjectOwnership;
115
+ declare namespace index {
116
+ export { index_AttestationQueryResult as AttestationQueryResult, index_AttestationValidationError as AttestationValidationError, index_BuildDelegatedTypedDataFromEncodedParams as BuildDelegatedTypedDataFromEncodedParams, index_CallControllerWitnessParams as CallControllerWitnessParams, index_CallControllerWitnessResult as CallControllerWitnessResult, index_ChainConstants as ChainConstants, index_CreatePopEip712ProofParams as CreatePopEip712ProofParams, index_CreatePopJwsProofParams as CreatePopJwsProofParams, index_Did as Did, index_EvidencePointerProof as EvidencePointerProof, index_EvmOwnershipProvider as EvmOwnershipProvider, index_GetAttestationParams as GetAttestationParams, index_GetAttestationsByAttesterParams as GetAttestationsByAttesterParams, index_GetLatestAttestationsParams as GetLatestAttestationsParams, index_Hex as Hex, index_ListAttestationsParams as ListAttestationsParams, index_PopEip712Proof as PopEip712Proof, index_PopJwsProof as PopJwsProof, index_PrepareDelegatedAttestationParams as PrepareDelegatedAttestationParams, index_PrepareDelegatedAttestationResult as PrepareDelegatedAttestationResult, index_ProofPurpose as ProofPurpose, index_ProofType as ProofType, index_ProofWrapper as ProofWrapper, index_RevokeAttestationParams as RevokeAttestationParams, index_RevokeAttestationResult as RevokeAttestationResult, index_SchemaField as SchemaField, index_SubjectOwnershipVerificationMethod as SubjectOwnershipVerificationMethod, index_SubjectOwnershipVerificationResult as SubjectOwnershipVerificationResult, index_SubmitAttestationParams as SubmitAttestationParams, index_SubmitAttestationResult as SubmitAttestationResult, index_SubmitDelegatedAttestationParams as SubmitDelegatedAttestationParams, index_SubmitDelegatedAttestationResult as SubmitDelegatedAttestationResult, index_TxEncodedValueProof as TxEncodedValueProof, index_TxInteractionProof as TxInteractionProof, index_VerifyAttestationParams as VerifyAttestationParams, index_VerifyAttestationResult as VerifyAttestationResult, index_VerifyDidJsonControllerDidOptions as VerifyDidJsonControllerDidOptions, index_VerifyDidPkhOwnershipParams as VerifyDidPkhOwnershipParams, index_VerifyDidWebOwnershipParams as VerifyDidWebOwnershipParams, type index_VerifyDnsTxtControllerDidOptions as VerifyDnsTxtControllerDidOptions, index_VerifyProofParams as VerifyProofParams, index_VerifyProofResult as VerifyProofResult, index_VerifySubjectOwnershipParams as VerifySubjectOwnershipParams, index_X402OfferProof as X402OfferProof, index_X402ReceiptProof as X402ReceiptProof, index_buildDelegatedAttestationTypedData as buildDelegatedAttestationTypedData, index_buildDelegatedTypedDataFromEncoded as buildDelegatedTypedDataFromEncoded, index_buildDnsTxtRecord as buildDnsTxtRecord, index_buildEip712Domain as buildEip712Domain, index_calculateAverageUserReviewRating as calculateAverageUserReviewRating, index_calculateTransferAmount as calculateTransferAmount, index_calculateTransferAmountFromAddresses as calculateTransferAmountFromAddresses, index_callControllerWitness as callControllerWitness, index_constructSeed as constructSeed, index_createEvidencePointerProof as createEvidencePointerProof, index_createPopEip712Proof as createPopEip712Proof, index_createPopJwsProof as createPopJwsProof, index_createTxEncodedValueProof as createTxEncodedValueProof, index_createTxInteractionProof as createTxInteractionProof, index_createX402OfferProof as createX402OfferProof, index_createX402ReceiptProof as createX402ReceiptProof, index_decodeAttestationData as decodeAttestationData, index_deduplicateReviews as deduplicateReviews, index_encodeAttestationData as encodeAttestationData, index_extractAddressesFromDidDocument as extractAddressesFromDidDocument, index_extractExpirationTime as extractExpirationTime, index_fetchDidDocument as fetchDidDocument, index_formatSchemaUid as formatSchemaUid, index_formatTransferAmount as formatTransferAmount, index_getAttestation as getAttestation, index_getAttestationsByAttester as getAttestationsByAttester, index_getAttestationsForDid as getAttestationsForDid, index_getChainConstants as getChainConstants, index_getExplorerAddressUrl as getExplorerAddressUrl, index_getExplorerTxUrl as getExplorerTxUrl, index_getLatestAttestations as getLatestAttestations, index_getMajorVersion as getMajorVersion, index_getOmaTrustProofEip712Types as getOmaTrustProofEip712Types, index_getSchemaDetails as getSchemaDetails, index_getSupportedChainIds as getSupportedChainIds, index_hashSeed as hashSeed, index_isChainSupported as isChainSupported, index_listAttestations as listAttestations, index_normalizeSchema as normalizeSchema, index_parseDnsTxtRecord as parseDnsTxtRecord, index_prepareDelegatedAttestation as prepareDelegatedAttestation, index_revokeAttestation as revokeAttestation, index_schemaToString as schemaToString, index_splitSignature as splitSignature, index_submitAttestation as submitAttestation, index_submitDelegatedAttestation as submitDelegatedAttestation, index_validateAttestationData as validateAttestationData, index_verifyAttestation as verifyAttestation, index_verifyDidDocumentControllerDid as verifyDidDocumentControllerDid, index_verifyDidJsonControllerDid as verifyDidJsonControllerDid, index_verifyDidPkhOwnership as verifyDidPkhOwnership, index_verifyDidWebOwnership as verifyDidWebOwnership, index_verifyDnsTxtControllerDid as verifyDnsTxtControllerDid, index_verifyEip712Signature as verifyEip712Signature, index_verifyProof as verifyProof, index_verifySchemaExists as verifySchemaExists, index_verifySubjectOwnership as verifySubjectOwnership };
117
+ }
118
+
119
+ export { type VerifyDnsTxtControllerDidOptions as V, index as i, verifyDnsTxtControllerDid as v };
@@ -0,0 +1,119 @@
1
+ import { D as Did, A as AttestationQueryResult, a as AttestationValidationError, B as BuildDelegatedTypedDataFromEncodedParams, C as CallControllerWitnessParams, b as CallControllerWitnessResult, c as ChainConstants, d as CreatePopEip712ProofParams, e as CreatePopJwsProofParams, E as EvidencePointerProof, f as EvmOwnershipProvider, G as GetAttestationParams, g as GetAttestationsByAttesterParams, h as GetLatestAttestationsParams, H as Hex, L as ListAttestationsParams, P as PopEip712Proof, i as PopJwsProof, j as PrepareDelegatedAttestationParams, k as PrepareDelegatedAttestationResult, l as ProofPurpose, m as ProofType, n as ProofWrapper, R as RevokeAttestationParams, o as RevokeAttestationResult, S as SchemaField, p as SubjectOwnershipVerificationMethod, q as SubjectOwnershipVerificationResult, r as SubmitAttestationParams, s as SubmitAttestationResult, t as SubmitDelegatedAttestationParams, u as SubmitDelegatedAttestationResult, T as TxEncodedValueProof, v as TxInteractionProof, V as VerifyAttestationParams, w as VerifyAttestationResult, x as VerifyDidJsonControllerDidOptions, y as VerifyDidPkhOwnershipParams, z as VerifyDidWebOwnershipParams, F as VerifyProofParams, I as VerifyProofResult, J as VerifySubjectOwnershipParams, X as X402OfferProof, K as X402ReceiptProof, M as buildDelegatedAttestationTypedData, N as buildDelegatedTypedDataFromEncoded, O as buildDnsTxtRecord, Q as buildEip712Domain, U as calculateAverageUserReviewRating, W as calculateTransferAmount, Y as calculateTransferAmountFromAddresses, Z as callControllerWitness, _ as constructSeed, $ as createEvidencePointerProof, a0 as createPopEip712Proof, a1 as createPopJwsProof, a2 as createTxEncodedValueProof, a3 as createTxInteractionProof, a4 as createX402OfferProof, a5 as createX402ReceiptProof, a6 as decodeAttestationData, a7 as deduplicateReviews, a8 as encodeAttestationData, a9 as extractAddressesFromDidDocument, aa as extractExpirationTime, ab as fetchDidDocument, ac as formatSchemaUid, ad as formatTransferAmount, ae as getAttestation, af as getAttestationsByAttester, ag as getAttestationsForDid, ah as getChainConstants, ai as getExplorerAddressUrl, aj as getExplorerTxUrl, ak as getLatestAttestations, al as getMajorVersion, am as getOmaTrustProofEip712Types, an as getSchemaDetails, ao as getSupportedChainIds, ap as hashSeed, aq as isChainSupported, ar as listAttestations, as as normalizeSchema, at as parseDnsTxtRecord, au as prepareDelegatedAttestation, av as revokeAttestation, aw as schemaToString, ax as splitSignature, ay as submitAttestation, az as submitDelegatedAttestation, aA as validateAttestationData, aB as verifyAttestation, aC as verifyDidDocumentControllerDid, aD as verifyDidJsonControllerDid, aE as verifyDidPkhOwnership, aF as verifyDidWebOwnership, aG as verifyEip712Signature, aH as verifyProof, aI as verifySchemaExists, aJ as verifySubjectOwnership } from './subject-ownership-CXvzEjpH.js';
2
+
3
+ interface VerifyDnsTxtControllerDidOptions {
4
+ resolveTxt?: (host: string) => Promise<string[][]>;
5
+ recordPrefix?: string;
6
+ }
7
+ declare function verifyDnsTxtControllerDid(domain: string, expectedControllerDid: Did, options?: VerifyDnsTxtControllerDidOptions): Promise<{
8
+ valid: boolean;
9
+ record?: string;
10
+ reason?: string;
11
+ }>;
12
+
13
+ declare const index_AttestationQueryResult: typeof AttestationQueryResult;
14
+ declare const index_AttestationValidationError: typeof AttestationValidationError;
15
+ declare const index_BuildDelegatedTypedDataFromEncodedParams: typeof BuildDelegatedTypedDataFromEncodedParams;
16
+ declare const index_CallControllerWitnessParams: typeof CallControllerWitnessParams;
17
+ declare const index_CallControllerWitnessResult: typeof CallControllerWitnessResult;
18
+ declare const index_ChainConstants: typeof ChainConstants;
19
+ declare const index_CreatePopEip712ProofParams: typeof CreatePopEip712ProofParams;
20
+ declare const index_CreatePopJwsProofParams: typeof CreatePopJwsProofParams;
21
+ declare const index_Did: typeof Did;
22
+ declare const index_EvidencePointerProof: typeof EvidencePointerProof;
23
+ declare const index_EvmOwnershipProvider: typeof EvmOwnershipProvider;
24
+ declare const index_GetAttestationParams: typeof GetAttestationParams;
25
+ declare const index_GetAttestationsByAttesterParams: typeof GetAttestationsByAttesterParams;
26
+ declare const index_GetLatestAttestationsParams: typeof GetLatestAttestationsParams;
27
+ declare const index_Hex: typeof Hex;
28
+ declare const index_ListAttestationsParams: typeof ListAttestationsParams;
29
+ declare const index_PopEip712Proof: typeof PopEip712Proof;
30
+ declare const index_PopJwsProof: typeof PopJwsProof;
31
+ declare const index_PrepareDelegatedAttestationParams: typeof PrepareDelegatedAttestationParams;
32
+ declare const index_PrepareDelegatedAttestationResult: typeof PrepareDelegatedAttestationResult;
33
+ declare const index_ProofPurpose: typeof ProofPurpose;
34
+ declare const index_ProofType: typeof ProofType;
35
+ declare const index_ProofWrapper: typeof ProofWrapper;
36
+ declare const index_RevokeAttestationParams: typeof RevokeAttestationParams;
37
+ declare const index_RevokeAttestationResult: typeof RevokeAttestationResult;
38
+ declare const index_SchemaField: typeof SchemaField;
39
+ declare const index_SubjectOwnershipVerificationMethod: typeof SubjectOwnershipVerificationMethod;
40
+ declare const index_SubjectOwnershipVerificationResult: typeof SubjectOwnershipVerificationResult;
41
+ declare const index_SubmitAttestationParams: typeof SubmitAttestationParams;
42
+ declare const index_SubmitAttestationResult: typeof SubmitAttestationResult;
43
+ declare const index_SubmitDelegatedAttestationParams: typeof SubmitDelegatedAttestationParams;
44
+ declare const index_SubmitDelegatedAttestationResult: typeof SubmitDelegatedAttestationResult;
45
+ declare const index_TxEncodedValueProof: typeof TxEncodedValueProof;
46
+ declare const index_TxInteractionProof: typeof TxInteractionProof;
47
+ declare const index_VerifyAttestationParams: typeof VerifyAttestationParams;
48
+ declare const index_VerifyAttestationResult: typeof VerifyAttestationResult;
49
+ declare const index_VerifyDidJsonControllerDidOptions: typeof VerifyDidJsonControllerDidOptions;
50
+ declare const index_VerifyDidPkhOwnershipParams: typeof VerifyDidPkhOwnershipParams;
51
+ declare const index_VerifyDidWebOwnershipParams: typeof VerifyDidWebOwnershipParams;
52
+ type index_VerifyDnsTxtControllerDidOptions = VerifyDnsTxtControllerDidOptions;
53
+ declare const index_VerifyProofParams: typeof VerifyProofParams;
54
+ declare const index_VerifyProofResult: typeof VerifyProofResult;
55
+ declare const index_VerifySubjectOwnershipParams: typeof VerifySubjectOwnershipParams;
56
+ declare const index_X402OfferProof: typeof X402OfferProof;
57
+ declare const index_X402ReceiptProof: typeof X402ReceiptProof;
58
+ declare const index_buildDelegatedAttestationTypedData: typeof buildDelegatedAttestationTypedData;
59
+ declare const index_buildDelegatedTypedDataFromEncoded: typeof buildDelegatedTypedDataFromEncoded;
60
+ declare const index_buildDnsTxtRecord: typeof buildDnsTxtRecord;
61
+ declare const index_buildEip712Domain: typeof buildEip712Domain;
62
+ declare const index_calculateAverageUserReviewRating: typeof calculateAverageUserReviewRating;
63
+ declare const index_calculateTransferAmount: typeof calculateTransferAmount;
64
+ declare const index_calculateTransferAmountFromAddresses: typeof calculateTransferAmountFromAddresses;
65
+ declare const index_callControllerWitness: typeof callControllerWitness;
66
+ declare const index_constructSeed: typeof constructSeed;
67
+ declare const index_createEvidencePointerProof: typeof createEvidencePointerProof;
68
+ declare const index_createPopEip712Proof: typeof createPopEip712Proof;
69
+ declare const index_createPopJwsProof: typeof createPopJwsProof;
70
+ declare const index_createTxEncodedValueProof: typeof createTxEncodedValueProof;
71
+ declare const index_createTxInteractionProof: typeof createTxInteractionProof;
72
+ declare const index_createX402OfferProof: typeof createX402OfferProof;
73
+ declare const index_createX402ReceiptProof: typeof createX402ReceiptProof;
74
+ declare const index_decodeAttestationData: typeof decodeAttestationData;
75
+ declare const index_deduplicateReviews: typeof deduplicateReviews;
76
+ declare const index_encodeAttestationData: typeof encodeAttestationData;
77
+ declare const index_extractAddressesFromDidDocument: typeof extractAddressesFromDidDocument;
78
+ declare const index_extractExpirationTime: typeof extractExpirationTime;
79
+ declare const index_fetchDidDocument: typeof fetchDidDocument;
80
+ declare const index_formatSchemaUid: typeof formatSchemaUid;
81
+ declare const index_formatTransferAmount: typeof formatTransferAmount;
82
+ declare const index_getAttestation: typeof getAttestation;
83
+ declare const index_getAttestationsByAttester: typeof getAttestationsByAttester;
84
+ declare const index_getAttestationsForDid: typeof getAttestationsForDid;
85
+ declare const index_getChainConstants: typeof getChainConstants;
86
+ declare const index_getExplorerAddressUrl: typeof getExplorerAddressUrl;
87
+ declare const index_getExplorerTxUrl: typeof getExplorerTxUrl;
88
+ declare const index_getLatestAttestations: typeof getLatestAttestations;
89
+ declare const index_getMajorVersion: typeof getMajorVersion;
90
+ declare const index_getOmaTrustProofEip712Types: typeof getOmaTrustProofEip712Types;
91
+ declare const index_getSchemaDetails: typeof getSchemaDetails;
92
+ declare const index_getSupportedChainIds: typeof getSupportedChainIds;
93
+ declare const index_hashSeed: typeof hashSeed;
94
+ declare const index_isChainSupported: typeof isChainSupported;
95
+ declare const index_listAttestations: typeof listAttestations;
96
+ declare const index_normalizeSchema: typeof normalizeSchema;
97
+ declare const index_parseDnsTxtRecord: typeof parseDnsTxtRecord;
98
+ declare const index_prepareDelegatedAttestation: typeof prepareDelegatedAttestation;
99
+ declare const index_revokeAttestation: typeof revokeAttestation;
100
+ declare const index_schemaToString: typeof schemaToString;
101
+ declare const index_splitSignature: typeof splitSignature;
102
+ declare const index_submitAttestation: typeof submitAttestation;
103
+ declare const index_submitDelegatedAttestation: typeof submitDelegatedAttestation;
104
+ declare const index_validateAttestationData: typeof validateAttestationData;
105
+ declare const index_verifyAttestation: typeof verifyAttestation;
106
+ declare const index_verifyDidDocumentControllerDid: typeof verifyDidDocumentControllerDid;
107
+ declare const index_verifyDidJsonControllerDid: typeof verifyDidJsonControllerDid;
108
+ declare const index_verifyDidPkhOwnership: typeof verifyDidPkhOwnership;
109
+ declare const index_verifyDidWebOwnership: typeof verifyDidWebOwnership;
110
+ declare const index_verifyDnsTxtControllerDid: typeof verifyDnsTxtControllerDid;
111
+ declare const index_verifyEip712Signature: typeof verifyEip712Signature;
112
+ declare const index_verifyProof: typeof verifyProof;
113
+ declare const index_verifySchemaExists: typeof verifySchemaExists;
114
+ declare const index_verifySubjectOwnership: typeof verifySubjectOwnership;
115
+ declare namespace index {
116
+ export { index_AttestationQueryResult as AttestationQueryResult, index_AttestationValidationError as AttestationValidationError, index_BuildDelegatedTypedDataFromEncodedParams as BuildDelegatedTypedDataFromEncodedParams, index_CallControllerWitnessParams as CallControllerWitnessParams, index_CallControllerWitnessResult as CallControllerWitnessResult, index_ChainConstants as ChainConstants, index_CreatePopEip712ProofParams as CreatePopEip712ProofParams, index_CreatePopJwsProofParams as CreatePopJwsProofParams, index_Did as Did, index_EvidencePointerProof as EvidencePointerProof, index_EvmOwnershipProvider as EvmOwnershipProvider, index_GetAttestationParams as GetAttestationParams, index_GetAttestationsByAttesterParams as GetAttestationsByAttesterParams, index_GetLatestAttestationsParams as GetLatestAttestationsParams, index_Hex as Hex, index_ListAttestationsParams as ListAttestationsParams, index_PopEip712Proof as PopEip712Proof, index_PopJwsProof as PopJwsProof, index_PrepareDelegatedAttestationParams as PrepareDelegatedAttestationParams, index_PrepareDelegatedAttestationResult as PrepareDelegatedAttestationResult, index_ProofPurpose as ProofPurpose, index_ProofType as ProofType, index_ProofWrapper as ProofWrapper, index_RevokeAttestationParams as RevokeAttestationParams, index_RevokeAttestationResult as RevokeAttestationResult, index_SchemaField as SchemaField, index_SubjectOwnershipVerificationMethod as SubjectOwnershipVerificationMethod, index_SubjectOwnershipVerificationResult as SubjectOwnershipVerificationResult, index_SubmitAttestationParams as SubmitAttestationParams, index_SubmitAttestationResult as SubmitAttestationResult, index_SubmitDelegatedAttestationParams as SubmitDelegatedAttestationParams, index_SubmitDelegatedAttestationResult as SubmitDelegatedAttestationResult, index_TxEncodedValueProof as TxEncodedValueProof, index_TxInteractionProof as TxInteractionProof, index_VerifyAttestationParams as VerifyAttestationParams, index_VerifyAttestationResult as VerifyAttestationResult, index_VerifyDidJsonControllerDidOptions as VerifyDidJsonControllerDidOptions, index_VerifyDidPkhOwnershipParams as VerifyDidPkhOwnershipParams, index_VerifyDidWebOwnershipParams as VerifyDidWebOwnershipParams, type index_VerifyDnsTxtControllerDidOptions as VerifyDnsTxtControllerDidOptions, index_VerifyProofParams as VerifyProofParams, index_VerifyProofResult as VerifyProofResult, index_VerifySubjectOwnershipParams as VerifySubjectOwnershipParams, index_X402OfferProof as X402OfferProof, index_X402ReceiptProof as X402ReceiptProof, index_buildDelegatedAttestationTypedData as buildDelegatedAttestationTypedData, index_buildDelegatedTypedDataFromEncoded as buildDelegatedTypedDataFromEncoded, index_buildDnsTxtRecord as buildDnsTxtRecord, index_buildEip712Domain as buildEip712Domain, index_calculateAverageUserReviewRating as calculateAverageUserReviewRating, index_calculateTransferAmount as calculateTransferAmount, index_calculateTransferAmountFromAddresses as calculateTransferAmountFromAddresses, index_callControllerWitness as callControllerWitness, index_constructSeed as constructSeed, index_createEvidencePointerProof as createEvidencePointerProof, index_createPopEip712Proof as createPopEip712Proof, index_createPopJwsProof as createPopJwsProof, index_createTxEncodedValueProof as createTxEncodedValueProof, index_createTxInteractionProof as createTxInteractionProof, index_createX402OfferProof as createX402OfferProof, index_createX402ReceiptProof as createX402ReceiptProof, index_decodeAttestationData as decodeAttestationData, index_deduplicateReviews as deduplicateReviews, index_encodeAttestationData as encodeAttestationData, index_extractAddressesFromDidDocument as extractAddressesFromDidDocument, index_extractExpirationTime as extractExpirationTime, index_fetchDidDocument as fetchDidDocument, index_formatSchemaUid as formatSchemaUid, index_formatTransferAmount as formatTransferAmount, index_getAttestation as getAttestation, index_getAttestationsByAttester as getAttestationsByAttester, index_getAttestationsForDid as getAttestationsForDid, index_getChainConstants as getChainConstants, index_getExplorerAddressUrl as getExplorerAddressUrl, index_getExplorerTxUrl as getExplorerTxUrl, index_getLatestAttestations as getLatestAttestations, index_getMajorVersion as getMajorVersion, index_getOmaTrustProofEip712Types as getOmaTrustProofEip712Types, index_getSchemaDetails as getSchemaDetails, index_getSupportedChainIds as getSupportedChainIds, index_hashSeed as hashSeed, index_isChainSupported as isChainSupported, index_listAttestations as listAttestations, index_normalizeSchema as normalizeSchema, index_parseDnsTxtRecord as parseDnsTxtRecord, index_prepareDelegatedAttestation as prepareDelegatedAttestation, index_revokeAttestation as revokeAttestation, index_schemaToString as schemaToString, index_splitSignature as splitSignature, index_submitAttestation as submitAttestation, index_submitDelegatedAttestation as submitDelegatedAttestation, index_validateAttestationData as validateAttestationData, index_verifyAttestation as verifyAttestation, index_verifyDidDocumentControllerDid as verifyDidDocumentControllerDid, index_verifyDidJsonControllerDid as verifyDidJsonControllerDid, index_verifyDidPkhOwnership as verifyDidPkhOwnership, index_verifyDidWebOwnership as verifyDidWebOwnership, index_verifyDnsTxtControllerDid as verifyDnsTxtControllerDid, index_verifyEip712Signature as verifyEip712Signature, index_verifyProof as verifyProof, index_verifySchemaExists as verifySchemaExists, index_verifySubjectOwnership as verifySubjectOwnership };
117
+ }
118
+
119
+ export { type VerifyDnsTxtControllerDidOptions as V, index as i, verifyDnsTxtControllerDid as v };