@thurinlabs/identity-kit 1.2.1 → 1.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/core.d.ts CHANGED
@@ -1305,64 +1305,6 @@ interface EnsTextReader {
1305
1305
  /** Read a name's `id.thurin` record and compare it with the verified fingerprint. */
1306
1306
  declare function fetchEnsHint(client: EnsTextReader, name: string, verifiedFingerprint: string | null | undefined): Promise<EnsHint>;
1307
1307
 
1308
- declare function identifyProof(notation: Notation): Proof | null;
1309
- declare function displayUrl(proof: Proof): string;
1310
- declare function proofHref(proof: Proof): string | null;
1311
- declare function proofSecondaryHref(proof: Proof): string | null;
1312
- declare function verifyProof(proof: Proof, fingerprint: string, neynarApiKey?: string): Promise<PGPVerification>;
1313
-
1314
- declare function parsePgpKey(armoredKey: string): Promise<PGPKeyInfo | null>;
1315
- declare function verifyAttestation({ pgpPublicKey, pgpSignature, fingerprint, ethAddress, }: {
1316
- pgpPublicKey: string | null;
1317
- pgpSignature: string | null;
1318
- fingerprint: string;
1319
- ethAddress: string;
1320
- }): Promise<PGPVerification>;
1321
- interface StrippedKey {
1322
- /** Armored public key containing only the non-email user IDs. */
1323
- armored: string;
1324
- /** User IDs kept (no `@`). */
1325
- kept: string[];
1326
- /** User IDs removed (contained an `@`). */
1327
- removed: string[];
1328
- }
1329
- /**
1330
- * Remove every user ID that contains an email address, keeping the rest (and
1331
- * their self-certifications, so proof notations on a non-email user ID survive).
1332
- * Returns null when nothing would remain — openpgp needs at least one
1333
- * self-certified user ID to verify signatures, so such a key must not be
1334
- * published. The key material and subkeys are untouched; the fingerprint is
1335
- * unchanged.
1336
- */
1337
- declare function stripEmailUserIDs(armoredKey: string): Promise<StrippedKey | null>;
1338
- /** True when any user ID on the key contains an email address. */
1339
- declare function hasEmailUserID(armoredKey: string): Promise<boolean>;
1340
-
1341
- /**
1342
- * EFP social graph for an address. Followers are counted by EFP for any address,
1343
- * whether or not it has published a list of its own; following and top-8 exist
1344
- * only when it has (its "primary list"). An address with followers but no list
1345
- * — a project account that has never followed anyone — is still on EFP.
1346
- */
1347
- declare function fetchEFPGraph(address: string): Promise<EFPGraph | null>;
1348
-
1349
- /** Normalize a fingerprint to lowercase hex with no prefix or spaces. Returns null if malformed. */
1350
- declare function normalizeFingerprint(input: string): string | null;
1351
- /** Fingerprint → the raw `bytes` argument the v2 registry takes (0x-prefixed, 20 or 32 bytes). */
1352
- declare function fingerprintToBytes(fingerprint: string): Hex;
1353
- /** Raw `bytes` from the registry → lowercase hex fingerprint without 0x. */
1354
- declare function bytesToFingerprint(bytes: Hex | string): string;
1355
- /** keccak256 of the raw fingerprint bytes — the `fingerprintHash` the registry indexes by. */
1356
- declare function fingerprintHash(fingerprint: string): Hex;
1357
- /**
1358
- * The long key ID as the `bytes8` the registry indexes by. Per RFC 9580 §5.5.4 it is the
1359
- * low-order 8 bytes of a v4 (20-byte) fingerprint and the high-order 8 bytes of a v6
1360
- * (32-byte) fingerprint — the same value `gpg --keyid-format long` prints.
1361
- */
1362
- declare function keyIdOf(fingerprint: string): Hex;
1363
- /** A 16-hex long key ID (spaces/0x tolerated) → `bytes8`. */
1364
- declare function keyIdToBytes(keyId: string): Hex | null;
1365
-
1366
1308
  /**
1367
1309
  * EIP-712 authorizations for the registry's relayed writes (`attestFor`, `reattestFor`,
1368
1310
  * `updateKeyFor`, `revokeFor`, `setRecordFor`). The owner signs one of these typed
@@ -1659,4 +1601,159 @@ declare function authorizationDigest(typedData: ReturnType<typeof attestTypedDat
1659
1601
  /** `bytes32 kind` for a record from a human-readable name, e.g. recordKind('thurin.vouch'). */
1660
1602
  declare function recordKind(name: string): Hex;
1661
1603
 
1662
- export { AUTHORIZATION_TYPES, type AttestAuthorization, type Attestation, type AuthorizationAction, type EFPGraph, EIP712_NAME, EIP712_VERSION, ENS_HINT_KEY, ENS_TEXT_RESOLVER_ABI, type EnsHint, type EnsHintState, type EnsTextReader, type IdentityKitConfig, NETWORKS, type NetworkName, type Notation, type PGPKeyInfo, type PGPVerification, type Proof, type ProofResult, REGISTRY_ABI, REGISTRY_ADDRESS, type ReattestAuthorization, type RegistryDeployment, type RevokeAuthorization, type SetRecordAuthorization, type StrippedKey, type SubkeyInfo, type Theme, type ThurinIdentity, type UpdateKeyAuthorization, attestTypedData, authorizationDigest, bytesToFingerprint, chainFor, displayUrl, ensHintFor, ensHintValue, ensHintWrite, fetchEFPGraph, fetchEnsHint, fingerprintHash, fingerprintToBytes, getRegistry, hasEmailUserID, identifyProof, isNetworkName, keyIdOf, keyIdToBytes, normalizeFingerprint, parsePgpKey, proofHref, proofSecondaryHref, reattestTypedData, recordKind, registryDomain, revokeTypedData, setRecordTypedData, stripEmailUserIDs, updateKeyTypedData, verifyAttestation, verifyProof };
1604
+ /**
1605
+ * Records: one small value per claim per kind, set only by the owner (or by anyone holding
1606
+ * the owner's `setRecordFor` authorization), readable by anyone, clearable. The contract looks
1607
+ * a record up by kind and cannot list them, so readers ask for the kinds they know.
1608
+ *
1609
+ * Conventions: kind = keccak256("thurin.<name>"); simple kinds are UTF-8 text, structured
1610
+ * kinds small JSON with a `v`, encrypted kinds an armored PGP message; readers ignore unknown
1611
+ * fields. Third parties use reverse-dot names (`com.example.thing`) without asking. 1 KB max.
1612
+ */
1613
+ declare const MAX_RECORD_BYTES = 1024;
1614
+ /** `thurin.` is the default namespace: kindName('canary') === 'thurin.canary'. Dotted names pass through. */
1615
+ declare function kindName(input: string): string;
1616
+ /** Every kind Thurin defines. `thurin.pointer` is the Thurin Labs release list (CLI only; not shown on identity pages). */
1617
+ declare const KNOWN_KINDS: readonly ["thurin.railgun", "thurin.security", "thurin.successor", "thurin.affiliation", "thurin.canary", "thurin.private", "thurin.disclosure", "thurin.pointer"];
1618
+ type KnownKind = (typeof KNOWN_KINDS)[number];
1619
+ /** The kinds an identity page shows, in display order. */
1620
+ declare const IDENTITY_KINDS: readonly KnownKind[];
1621
+ declare function encodeRecord(value: string): Hex;
1622
+ declare function decodeRecord(hex: Hex): string;
1623
+ interface PointerEntry {
1624
+ name: string;
1625
+ sha256: string;
1626
+ date: string;
1627
+ url?: string;
1628
+ }
1629
+ interface PointerRecord {
1630
+ v: 1;
1631
+ releases: PointerEntry[];
1632
+ }
1633
+ declare function parsePointer(text: string): PointerRecord;
1634
+ /** Add a release, newest first; drop the oldest until it fits the 1 KB slot. */
1635
+ declare function addPointer(existing: PointerRecord | null, entry: PointerEntry): {
1636
+ record: PointerRecord;
1637
+ dropped: PointerEntry[];
1638
+ };
1639
+ declare function renderPointer(p: PointerRecord): string;
1640
+ /** A record as the identity page shows it: what was stored, and what it means if it parses. */
1641
+ interface ParsedRecord {
1642
+ kind: string;
1643
+ /** The raw UTF-8 value. */
1644
+ text: string;
1645
+ bytes: number;
1646
+ /** True when the value has the shape the kind defines. A malformed record is still shown, as text. */
1647
+ valid: boolean;
1648
+ /** Why it is not valid, when it is not. */
1649
+ reason?: string;
1650
+ /** Kind-specific fields, when valid. */
1651
+ data: RecordData;
1652
+ }
1653
+ type RecordData = {
1654
+ type: 'railgun';
1655
+ address: string;
1656
+ } | {
1657
+ type: 'security';
1658
+ contact: string;
1659
+ url: string | null;
1660
+ } | {
1661
+ type: 'successor';
1662
+ fingerprint: string;
1663
+ } | {
1664
+ type: 'affiliation';
1665
+ with: string;
1666
+ role: string | null;
1667
+ } | {
1668
+ type: 'canary';
1669
+ date: string;
1670
+ statement: string;
1671
+ clearsigned: boolean;
1672
+ } | {
1673
+ type: 'encrypted';
1674
+ recipients: number | null;
1675
+ } | {
1676
+ type: 'pointer';
1677
+ releases: PointerEntry[];
1678
+ } | {
1679
+ type: 'text';
1680
+ };
1681
+ /**
1682
+ * Parse a record of a known kind. Never throws: a value that does not fit its kind comes back
1683
+ * with `valid: false` and a reason, so a page can still show what is there.
1684
+ */
1685
+ declare function parseRecord(kind: string, text: string): Promise<ParsedRecord>;
1686
+ /** Minimal client shape: viem's PublicClient has it. */
1687
+ interface RecordReader {
1688
+ readContract(args: {
1689
+ address: `0x${string}`;
1690
+ abi: unknown;
1691
+ functionName: 'record';
1692
+ args: readonly [`0x${string}`, bigint, Hex];
1693
+ }): Promise<unknown>;
1694
+ }
1695
+ /**
1696
+ * Read and parse the given kinds on one claim. Kinds with no record are left out.
1697
+ * `registry` is the contract address; pass the kit's REGISTRY_ABI.
1698
+ */
1699
+ declare function fetchRecords(client: RecordReader, registry: `0x${string}`, abi: unknown, owner: `0x${string}`, index: number | bigint, kinds?: readonly string[]): Promise<ParsedRecord[]>;
1700
+
1701
+ declare function identifyProof(notation: Notation): Proof | null;
1702
+ declare function displayUrl(proof: Proof): string;
1703
+ declare function proofHref(proof: Proof): string | null;
1704
+ declare function proofSecondaryHref(proof: Proof): string | null;
1705
+ declare function verifyProof(proof: Proof, fingerprint: string, neynarApiKey?: string): Promise<PGPVerification>;
1706
+
1707
+ declare function parsePgpKey(armoredKey: string): Promise<PGPKeyInfo | null>;
1708
+ declare function verifyAttestation({ pgpPublicKey, pgpSignature, fingerprint, ethAddress, }: {
1709
+ pgpPublicKey: string | null;
1710
+ pgpSignature: string | null;
1711
+ fingerprint: string;
1712
+ ethAddress: string;
1713
+ }): Promise<PGPVerification>;
1714
+ interface StrippedKey {
1715
+ /** Armored public key containing only the non-email user IDs. */
1716
+ armored: string;
1717
+ /** User IDs kept (no `@`). */
1718
+ kept: string[];
1719
+ /** User IDs removed (contained an `@`). */
1720
+ removed: string[];
1721
+ }
1722
+ /**
1723
+ * Remove every user ID that contains an email address, keeping the rest (and
1724
+ * their self-certifications, so proof notations on a non-email user ID survive).
1725
+ * Returns null when nothing would remain — openpgp needs at least one
1726
+ * self-certified user ID to verify signatures, so such a key must not be
1727
+ * published. The key material and subkeys are untouched; the fingerprint is
1728
+ * unchanged.
1729
+ */
1730
+ declare function stripEmailUserIDs(armoredKey: string): Promise<StrippedKey | null>;
1731
+ /** True when any user ID on the key contains an email address. */
1732
+ declare function hasEmailUserID(armoredKey: string): Promise<boolean>;
1733
+
1734
+ /**
1735
+ * EFP social graph for an address. Followers are counted by EFP for any address,
1736
+ * whether or not it has published a list of its own; following and top-8 exist
1737
+ * only when it has (its "primary list"). An address with followers but no list
1738
+ * — a project account that has never followed anyone — is still on EFP.
1739
+ */
1740
+ declare function fetchEFPGraph(address: string): Promise<EFPGraph | null>;
1741
+
1742
+ /** Normalize a fingerprint to lowercase hex with no prefix or spaces. Returns null if malformed. */
1743
+ declare function normalizeFingerprint(input: string): string | null;
1744
+ /** Fingerprint → the raw `bytes` argument the v2 registry takes (0x-prefixed, 20 or 32 bytes). */
1745
+ declare function fingerprintToBytes(fingerprint: string): Hex;
1746
+ /** Raw `bytes` from the registry → lowercase hex fingerprint without 0x. */
1747
+ declare function bytesToFingerprint(bytes: Hex | string): string;
1748
+ /** keccak256 of the raw fingerprint bytes — the `fingerprintHash` the registry indexes by. */
1749
+ declare function fingerprintHash(fingerprint: string): Hex;
1750
+ /**
1751
+ * The long key ID as the `bytes8` the registry indexes by. Per RFC 9580 §5.5.4 it is the
1752
+ * low-order 8 bytes of a v4 (20-byte) fingerprint and the high-order 8 bytes of a v6
1753
+ * (32-byte) fingerprint — the same value `gpg --keyid-format long` prints.
1754
+ */
1755
+ declare function keyIdOf(fingerprint: string): Hex;
1756
+ /** A 16-hex long key ID (spaces/0x tolerated) → `bytes8`. */
1757
+ declare function keyIdToBytes(keyId: string): Hex | null;
1758
+
1759
+ export { AUTHORIZATION_TYPES, type AttestAuthorization, type Attestation, type AuthorizationAction, type EFPGraph, EIP712_NAME, EIP712_VERSION, ENS_HINT_KEY, ENS_TEXT_RESOLVER_ABI, type EnsHint, type EnsHintState, type EnsTextReader, IDENTITY_KINDS, type IdentityKitConfig, KNOWN_KINDS, type KnownKind, MAX_RECORD_BYTES, NETWORKS, type NetworkName, type Notation, type PGPKeyInfo, type PGPVerification, type ParsedRecord, type PointerEntry, type PointerRecord, type Proof, type ProofResult, REGISTRY_ABI, REGISTRY_ADDRESS, type ReattestAuthorization, type RecordData, type RecordReader, type RegistryDeployment, type RevokeAuthorization, type SetRecordAuthorization, type StrippedKey, type SubkeyInfo, type Theme, type ThurinIdentity, type UpdateKeyAuthorization, addPointer, attestTypedData, authorizationDigest, bytesToFingerprint, chainFor, decodeRecord, displayUrl, encodeRecord, ensHintFor, ensHintValue, ensHintWrite, fetchEFPGraph, fetchEnsHint, fetchRecords, fingerprintHash, fingerprintToBytes, getRegistry, hasEmailUserID, identifyProof, isNetworkName, keyIdOf, keyIdToBytes, kindName, normalizeFingerprint, parsePgpKey, parsePointer, parseRecord, proofHref, proofSecondaryHref, reattestTypedData, recordKind, registryDomain, renderPointer, revokeTypedData, setRecordTypedData, stripEmailUserIDs, updateKeyTypedData, verifyAttestation, verifyProof };
package/dist/core.js CHANGED
@@ -4,19 +4,26 @@ import {
4
4
  EIP712_VERSION,
5
5
  ENS_HINT_KEY,
6
6
  ENS_TEXT_RESOLVER_ABI,
7
+ IDENTITY_KINDS,
8
+ KNOWN_KINDS,
9
+ MAX_RECORD_BYTES,
7
10
  NETWORKS,
8
11
  REGISTRY_ABI,
9
12
  REGISTRY_ADDRESS,
13
+ addPointer,
10
14
  attestTypedData,
11
15
  authorizationDigest,
12
16
  bytesToFingerprint,
13
17
  chainFor,
18
+ decodeRecord,
14
19
  displayUrl,
20
+ encodeRecord,
15
21
  ensHintFor,
16
22
  ensHintValue,
17
23
  ensHintWrite,
18
24
  fetchEFPGraph,
19
25
  fetchEnsHint,
26
+ fetchRecords,
20
27
  fingerprintHash,
21
28
  fingerprintToBytes,
22
29
  getRegistry,
@@ -25,39 +32,50 @@ import {
25
32
  isNetworkName,
26
33
  keyIdOf,
27
34
  keyIdToBytes,
35
+ kindName,
28
36
  normalizeFingerprint,
29
37
  parsePgpKey,
38
+ parsePointer,
39
+ parseRecord,
30
40
  proofHref,
31
41
  proofSecondaryHref,
32
42
  reattestTypedData,
33
43
  recordKind,
34
44
  registryDomain,
45
+ renderPointer,
35
46
  revokeTypedData,
36
47
  setRecordTypedData,
37
48
  stripEmailUserIDs,
38
49
  updateKeyTypedData,
39
50
  verifyAttestation,
40
51
  verifyProof
41
- } from "./chunk-FN5VSB3U.js";
52
+ } from "./chunk-4H57JHDJ.js";
42
53
  export {
43
54
  AUTHORIZATION_TYPES,
44
55
  EIP712_NAME,
45
56
  EIP712_VERSION,
46
57
  ENS_HINT_KEY,
47
58
  ENS_TEXT_RESOLVER_ABI,
59
+ IDENTITY_KINDS,
60
+ KNOWN_KINDS,
61
+ MAX_RECORD_BYTES,
48
62
  NETWORKS,
49
63
  REGISTRY_ABI,
50
64
  REGISTRY_ADDRESS,
65
+ addPointer,
51
66
  attestTypedData,
52
67
  authorizationDigest,
53
68
  bytesToFingerprint,
54
69
  chainFor,
70
+ decodeRecord,
55
71
  displayUrl,
72
+ encodeRecord,
56
73
  ensHintFor,
57
74
  ensHintValue,
58
75
  ensHintWrite,
59
76
  fetchEFPGraph,
60
77
  fetchEnsHint,
78
+ fetchRecords,
61
79
  fingerprintHash,
62
80
  fingerprintToBytes,
63
81
  getRegistry,
@@ -66,13 +84,17 @@ export {
66
84
  isNetworkName,
67
85
  keyIdOf,
68
86
  keyIdToBytes,
87
+ kindName,
69
88
  normalizeFingerprint,
70
89
  parsePgpKey,
90
+ parsePointer,
91
+ parseRecord,
71
92
  proofHref,
72
93
  proofSecondaryHref,
73
94
  reattestTypedData,
74
95
  recordKind,
75
96
  registryDomain,
97
+ renderPointer,
76
98
  revokeTypedData,
77
99
  setRecordTypedData,
78
100
  stripEmailUserIDs,
package/dist/index.cjs CHANGED
@@ -38,7 +38,18 @@
38
38
 
39
39
 
40
40
 
41
- var _chunkDC72HPXJcjs = require('./chunk-DC72HPXJ.cjs');
41
+
42
+
43
+
44
+
45
+
46
+
47
+
48
+
49
+
50
+
51
+
52
+ var _chunkMYKKWPBYcjs = require('./chunk-MYKKWPBY.cjs');
42
53
 
43
54
  // src/provider.tsx
44
55
  var _react = require('react');
@@ -68,7 +79,7 @@ var defaultQueryClient = new (0, _reactquery.QueryClient)({
68
79
  }
69
80
  });
70
81
  function createDefaultWagmiConfig(rpcUrl, network) {
71
- const url = rpcUrl || _chunkDC72HPXJcjs.getRegistry.call(void 0, network).defaultRpcUrl;
82
+ const url = rpcUrl || _chunkMYKKWPBYcjs.getRegistry.call(void 0, network).defaultRpcUrl;
72
83
  if (network === "sepolia") return _wagmi.createConfig.call(void 0, { chains: [_chains.sepolia], transports: { [_chains.sepolia.id]: _wagmi.http.call(void 0, url) } });
73
84
  if (network === "local") return _wagmi.createConfig.call(void 0, { chains: [_chains.foundry], transports: { [_chains.foundry.id]: _wagmi.http.call(void 0, url) } });
74
85
  return _wagmi.createConfig.call(void 0, { chains: [_chains.mainnet], transports: { [_chains.mainnet.id]: _wagmi.http.call(void 0, url) } });
@@ -111,12 +122,12 @@ var _ens = require('viem/ens');
111
122
  var _viem = require('viem');
112
123
  function useAttestations(address) {
113
124
  const config = useIdentityKitConfig();
114
- const registry = _chunkDC72HPXJcjs.getRegistry.call(void 0, config.network, config.registryAddress);
115
- const chain = _chunkDC72HPXJcjs.chainFor.call(void 0, config.network);
125
+ const registry = _chunkMYKKWPBYcjs.getRegistry.call(void 0, config.network, config.registryAddress);
126
+ const chain = _chunkMYKKWPBYcjs.chainFor.call(void 0, config.network);
116
127
  const owner = address;
117
128
  const { data: rows, isLoading: rowsLoading } = _wagmi.useReadContract.call(void 0, {
118
129
  address: registry.address,
119
- abi: _chunkDC72HPXJcjs.REGISTRY_ABI,
130
+ abi: _chunkMYKKWPBYcjs.REGISTRY_ABI,
120
131
  functionName: "attestationsOf",
121
132
  args: owner ? [owner] : void 0,
122
133
  chainId: chain.id,
@@ -125,7 +136,7 @@ function useAttestations(address) {
125
136
  const count = _nullishCoalesce(_optionalChain([rows, 'optionalAccess', _2 => _2.length]), () => ( 0));
126
137
  const contracts = owner && rows ? rows.map((_, i) => ({
127
138
  address: registry.address,
128
- abi: _chunkDC72HPXJcjs.REGISTRY_ABI,
139
+ abi: _chunkMYKKWPBYcjs.REGISTRY_ABI,
129
140
  functionName: "getPayload",
130
141
  args: [owner, BigInt(i)],
131
142
  chainId: chain.id
@@ -150,8 +161,8 @@ function useAttestations(address) {
150
161
  pgpSignature = _viem.hexToString.call(void 0, sigHex);
151
162
  pgpPublicKey = _viem.hexToString.call(void 0, keyHex);
152
163
  }
153
- const fingerprint = _chunkDC72HPXJcjs.bytesToFingerprint.call(void 0, row.fingerprint);
154
- const verification = pgpPublicKey && pgpSignature ? await _chunkDC72HPXJcjs.verifyAttestation.call(void 0, { pgpPublicKey, pgpSignature, fingerprint, ethAddress: address }) : null;
164
+ const fingerprint = _chunkMYKKWPBYcjs.bytesToFingerprint.call(void 0, row.fingerprint);
165
+ const verification = pgpPublicKey && pgpSignature ? await _chunkMYKKWPBYcjs.verifyAttestation.call(void 0, { pgpPublicKey, pgpSignature, fingerprint, ethAddress: address }) : null;
155
166
  const revokedAt = Number(row.revokedAt);
156
167
  results.push({
157
168
  index: i,
@@ -188,7 +199,7 @@ function useAttestations(address) {
188
199
  function useEFPGraph(address) {
189
200
  const { data, isLoading } = _reactquery.useQuery.call(void 0, {
190
201
  queryKey: ["efp-graph", address],
191
- queryFn: () => _chunkDC72HPXJcjs.fetchEFPGraph.call(void 0, address),
202
+ queryFn: () => _chunkMYKKWPBYcjs.fetchEFPGraph.call(void 0, address),
192
203
  enabled: !!address,
193
204
  staleTime: 3e5
194
205
  });
@@ -208,19 +219,19 @@ function usePGPProofs(fingerprint, armoredKey) {
208
219
  queryKey: ["pgp-proofs", fingerprint, _nullishCoalesce(_optionalChain([armoredKey, 'optionalAccess', _6 => _6.length]), () => ( 0))],
209
220
  queryFn: async () => {
210
221
  if (!fingerprint || !armoredKey) return { keyInfo: null, proofs: [] };
211
- const keyInfo = await _chunkDC72HPXJcjs.parsePgpKey.call(void 0, armoredKey);
222
+ const keyInfo = await _chunkMYKKWPBYcjs.parsePgpKey.call(void 0, armoredKey);
212
223
  if (!keyInfo) return { keyInfo: null, proofs: [] };
213
- const identified = keyInfo.notations.map((n) => _chunkDC72HPXJcjs.identifyProof.call(void 0, n)).filter((p) => p !== null && p.provider !== "unknown");
224
+ const identified = keyInfo.notations.map((n) => _chunkMYKKWPBYcjs.identifyProof.call(void 0, n)).filter((p) => p !== null && p.provider !== "unknown");
214
225
  const proofs = await Promise.all(
215
226
  identified.map(async (proof) => {
216
- const result = await _chunkDC72HPXJcjs.verifyProof.call(void 0, proof, fingerprint, config.neynarApiKey);
227
+ const result = await _chunkMYKKWPBYcjs.verifyProof.call(void 0, proof, fingerprint, config.neynarApiKey);
217
228
  return {
218
229
  provider: proof.provider,
219
230
  label: proof.label,
220
231
  url: proof.url,
221
- displayUrl: _chunkDC72HPXJcjs.displayUrl.call(void 0, proof),
222
- href: _chunkDC72HPXJcjs.proofHref.call(void 0, proof),
223
- secondaryHref: _chunkDC72HPXJcjs.proofSecondaryHref.call(void 0, proof),
232
+ displayUrl: _chunkMYKKWPBYcjs.displayUrl.call(void 0, proof),
233
+ href: _chunkMYKKWPBYcjs.proofHref.call(void 0, proof),
234
+ secondaryHref: _chunkMYKKWPBYcjs.proofSecondaryHref.call(void 0, proof),
224
235
  status: result.verified ? "verified" : "unverified",
225
236
  reason: result.reason
226
237
  };
@@ -262,7 +273,7 @@ function safeNormalize(name) {
262
273
  }
263
274
  }
264
275
  function useThurinIdentity(ensOrAddress) {
265
- const chain = _chunkDC72HPXJcjs.chainFor.call(void 0, useIdentityKitConfig().network);
276
+ const chain = _chunkMYKKWPBYcjs.chainFor.call(void 0, useIdentityKitConfig().network);
266
277
  const isAddr = ensOrAddress ? isAddress(ensOrAddress) : false;
267
278
  const ensInput = ensOrAddress && !isAddr ? safeNormalize(ensOrAddress) : void 0;
268
279
  const { data: resolvedAddress } = _wagmi.useEnsAddress.call(void 0, {
@@ -401,15 +412,41 @@ function safeNormalize2(name) {
401
412
  }
402
413
  }
403
414
  function useEnsHint(name, verifiedFingerprint) {
404
- const chain = _chunkDC72HPXJcjs.chainFor.call(void 0, useIdentityKitConfig().network);
415
+ const chain = _chunkMYKKWPBYcjs.chainFor.call(void 0, useIdentityKitConfig().network);
405
416
  const ensName = name ? safeNormalize2(name) : void 0;
406
417
  const { data, isLoading, refetch } = _wagmi.useEnsText.call(void 0, {
407
418
  name: ensName,
408
- key: _chunkDC72HPXJcjs.ENS_HINT_KEY,
419
+ key: _chunkMYKKWPBYcjs.ENS_HINT_KEY,
409
420
  chainId: chain.id,
410
421
  query: { enabled: !!ensName }
411
422
  });
412
- return { ..._chunkDC72HPXJcjs.ensHintFor.call(void 0, _nullishCoalesce(data, () => ( null)), verifiedFingerprint), isLoading: !!ensName && isLoading, refetch: () => {
423
+ return { ..._chunkMYKKWPBYcjs.ensHintFor.call(void 0, _nullishCoalesce(data, () => ( null)), verifiedFingerprint), isLoading: !!ensName && isLoading, refetch: () => {
424
+ void refetch();
425
+ } };
426
+ }
427
+
428
+ // src/hooks/useRecords.ts
429
+
430
+
431
+ function useRecords(address, index, kinds = _chunkMYKKWPBYcjs.IDENTITY_KINDS) {
432
+ const config = useIdentityKitConfig();
433
+ const registry = _chunkMYKKWPBYcjs.getRegistry.call(void 0, config.network, config.registryAddress);
434
+ const chain = _chunkMYKKWPBYcjs.chainFor.call(void 0, config.network);
435
+ const owner = address;
436
+ const enabled = !!owner && index !== void 0 && index !== null;
437
+ const contracts = enabled ? kinds.map((kind) => ({ address: registry.address, abi: _chunkMYKKWPBYcjs.REGISTRY_ABI, functionName: "record", args: [owner, BigInt(index), _chunkMYKKWPBYcjs.recordKind.call(void 0, kind)], chainId: chain.id })) : [];
438
+ const { data: raw, isLoading: readLoading, refetch } = _wagmi.useReadContracts.call(void 0, { contracts, query: { enabled: contracts.length > 0 } });
439
+ const texts = (_nullishCoalesce(raw, () => ( []))).map((r) => r.status === "success" ? _chunkMYKKWPBYcjs.decodeRecord.call(void 0, r.result) : "");
440
+ const { data: records, isLoading: parseLoading } = _reactquery.useQuery.call(void 0, {
441
+ queryKey: ["records", config.network, registry.address, address, index, kinds.join(","), texts.join(" ")],
442
+ queryFn: async () => {
443
+ const out = [];
444
+ for (let i = 0; i < kinds.length; i++) if (texts[i]) out.push(await _chunkMYKKWPBYcjs.parseRecord.call(void 0, kinds[i], texts[i]));
445
+ return out;
446
+ },
447
+ enabled: enabled && raw !== void 0
448
+ });
449
+ return { records: _nullishCoalesce(records, () => ( [])), isLoading: enabled && (readLoading || parseLoading), refetch: () => {
413
450
  void refetch();
414
451
  } };
415
452
  }
@@ -460,5 +497,17 @@ function useEnsHint(name, verifiedFingerprint) {
460
497
 
461
498
 
462
499
 
463
- exports.AUTHORIZATION_TYPES = _chunkDC72HPXJcjs.AUTHORIZATION_TYPES; exports.EIP712_NAME = _chunkDC72HPXJcjs.EIP712_NAME; exports.EIP712_VERSION = _chunkDC72HPXJcjs.EIP712_VERSION; exports.ENS_HINT_KEY = _chunkDC72HPXJcjs.ENS_HINT_KEY; exports.ENS_TEXT_RESOLVER_ABI = _chunkDC72HPXJcjs.ENS_TEXT_RESOLVER_ABI; exports.IdentityKitProvider = IdentityKitProvider; exports.NETWORKS = _chunkDC72HPXJcjs.NETWORKS; exports.REGISTRY_ABI = _chunkDC72HPXJcjs.REGISTRY_ABI; exports.REGISTRY_ADDRESS = _chunkDC72HPXJcjs.REGISTRY_ADDRESS; exports.ThurinCard = ThurinCard; exports.attestTypedData = _chunkDC72HPXJcjs.attestTypedData; exports.authorizationDigest = _chunkDC72HPXJcjs.authorizationDigest; exports.bytesToFingerprint = _chunkDC72HPXJcjs.bytesToFingerprint; exports.chainFor = _chunkDC72HPXJcjs.chainFor; exports.displayUrl = _chunkDC72HPXJcjs.displayUrl; exports.ensHintFor = _chunkDC72HPXJcjs.ensHintFor; exports.ensHintValue = _chunkDC72HPXJcjs.ensHintValue; exports.ensHintWrite = _chunkDC72HPXJcjs.ensHintWrite; exports.fetchEFPGraph = _chunkDC72HPXJcjs.fetchEFPGraph; exports.fetchEnsHint = _chunkDC72HPXJcjs.fetchEnsHint; exports.fingerprintHash = _chunkDC72HPXJcjs.fingerprintHash; exports.fingerprintToBytes = _chunkDC72HPXJcjs.fingerprintToBytes; exports.getRegistry = _chunkDC72HPXJcjs.getRegistry; exports.hasEmailUserID = _chunkDC72HPXJcjs.hasEmailUserID; exports.identifyProof = _chunkDC72HPXJcjs.identifyProof; exports.isNetworkName = _chunkDC72HPXJcjs.isNetworkName; exports.keyIdOf = _chunkDC72HPXJcjs.keyIdOf; exports.keyIdToBytes = _chunkDC72HPXJcjs.keyIdToBytes; exports.normalizeFingerprint = _chunkDC72HPXJcjs.normalizeFingerprint; exports.parsePgpKey = _chunkDC72HPXJcjs.parsePgpKey; exports.proofHref = _chunkDC72HPXJcjs.proofHref; exports.proofSecondaryHref = _chunkDC72HPXJcjs.proofSecondaryHref; exports.reattestTypedData = _chunkDC72HPXJcjs.reattestTypedData; exports.recordKind = _chunkDC72HPXJcjs.recordKind; exports.registryDomain = _chunkDC72HPXJcjs.registryDomain; exports.revokeTypedData = _chunkDC72HPXJcjs.revokeTypedData; exports.setRecordTypedData = _chunkDC72HPXJcjs.setRecordTypedData; exports.stripEmailUserIDs = _chunkDC72HPXJcjs.stripEmailUserIDs; exports.updateKeyTypedData = _chunkDC72HPXJcjs.updateKeyTypedData; exports.useAttestations = useAttestations; exports.useEFPGraph = useEFPGraph; exports.useEnsHint = useEnsHint; exports.usePGPProofs = usePGPProofs; exports.useThurinIdentity = useThurinIdentity; exports.verifyAttestation = _chunkDC72HPXJcjs.verifyAttestation; exports.verifyProof = _chunkDC72HPXJcjs.verifyProof;
500
+
501
+
502
+
503
+
504
+
505
+
506
+
507
+
508
+
509
+
510
+
511
+
512
+ exports.AUTHORIZATION_TYPES = _chunkMYKKWPBYcjs.AUTHORIZATION_TYPES; exports.EIP712_NAME = _chunkMYKKWPBYcjs.EIP712_NAME; exports.EIP712_VERSION = _chunkMYKKWPBYcjs.EIP712_VERSION; exports.ENS_HINT_KEY = _chunkMYKKWPBYcjs.ENS_HINT_KEY; exports.ENS_TEXT_RESOLVER_ABI = _chunkMYKKWPBYcjs.ENS_TEXT_RESOLVER_ABI; exports.IDENTITY_KINDS = _chunkMYKKWPBYcjs.IDENTITY_KINDS; exports.IdentityKitProvider = IdentityKitProvider; exports.KNOWN_KINDS = _chunkMYKKWPBYcjs.KNOWN_KINDS; exports.MAX_RECORD_BYTES = _chunkMYKKWPBYcjs.MAX_RECORD_BYTES; exports.NETWORKS = _chunkMYKKWPBYcjs.NETWORKS; exports.REGISTRY_ABI = _chunkMYKKWPBYcjs.REGISTRY_ABI; exports.REGISTRY_ADDRESS = _chunkMYKKWPBYcjs.REGISTRY_ADDRESS; exports.ThurinCard = ThurinCard; exports.addPointer = _chunkMYKKWPBYcjs.addPointer; exports.attestTypedData = _chunkMYKKWPBYcjs.attestTypedData; exports.authorizationDigest = _chunkMYKKWPBYcjs.authorizationDigest; exports.bytesToFingerprint = _chunkMYKKWPBYcjs.bytesToFingerprint; exports.chainFor = _chunkMYKKWPBYcjs.chainFor; exports.decodeRecord = _chunkMYKKWPBYcjs.decodeRecord; exports.displayUrl = _chunkMYKKWPBYcjs.displayUrl; exports.encodeRecord = _chunkMYKKWPBYcjs.encodeRecord; exports.ensHintFor = _chunkMYKKWPBYcjs.ensHintFor; exports.ensHintValue = _chunkMYKKWPBYcjs.ensHintValue; exports.ensHintWrite = _chunkMYKKWPBYcjs.ensHintWrite; exports.fetchEFPGraph = _chunkMYKKWPBYcjs.fetchEFPGraph; exports.fetchEnsHint = _chunkMYKKWPBYcjs.fetchEnsHint; exports.fetchRecords = _chunkMYKKWPBYcjs.fetchRecords; exports.fingerprintHash = _chunkMYKKWPBYcjs.fingerprintHash; exports.fingerprintToBytes = _chunkMYKKWPBYcjs.fingerprintToBytes; exports.getRegistry = _chunkMYKKWPBYcjs.getRegistry; exports.hasEmailUserID = _chunkMYKKWPBYcjs.hasEmailUserID; exports.identifyProof = _chunkMYKKWPBYcjs.identifyProof; exports.isNetworkName = _chunkMYKKWPBYcjs.isNetworkName; exports.keyIdOf = _chunkMYKKWPBYcjs.keyIdOf; exports.keyIdToBytes = _chunkMYKKWPBYcjs.keyIdToBytes; exports.kindName = _chunkMYKKWPBYcjs.kindName; exports.normalizeFingerprint = _chunkMYKKWPBYcjs.normalizeFingerprint; exports.parsePgpKey = _chunkMYKKWPBYcjs.parsePgpKey; exports.parsePointer = _chunkMYKKWPBYcjs.parsePointer; exports.parseRecord = _chunkMYKKWPBYcjs.parseRecord; exports.proofHref = _chunkMYKKWPBYcjs.proofHref; exports.proofSecondaryHref = _chunkMYKKWPBYcjs.proofSecondaryHref; exports.reattestTypedData = _chunkMYKKWPBYcjs.reattestTypedData; exports.recordKind = _chunkMYKKWPBYcjs.recordKind; exports.registryDomain = _chunkMYKKWPBYcjs.registryDomain; exports.renderPointer = _chunkMYKKWPBYcjs.renderPointer; exports.revokeTypedData = _chunkMYKKWPBYcjs.revokeTypedData; exports.setRecordTypedData = _chunkMYKKWPBYcjs.setRecordTypedData; exports.stripEmailUserIDs = _chunkMYKKWPBYcjs.stripEmailUserIDs; exports.updateKeyTypedData = _chunkMYKKWPBYcjs.updateKeyTypedData; exports.useAttestations = useAttestations; exports.useEFPGraph = useEFPGraph; exports.useEnsHint = useEnsHint; exports.usePGPProofs = usePGPProofs; exports.useRecords = useRecords; exports.useThurinIdentity = useThurinIdentity; exports.verifyAttestation = _chunkMYKKWPBYcjs.verifyAttestation; exports.verifyProof = _chunkMYKKWPBYcjs.verifyProof;
464
513
  //# sourceMappingURL=index.cjs.map