@thurinlabs/identity-kit 1.2.0 → 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.cts CHANGED
@@ -1305,66 +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
- declare function fetchKeyByFingerprint(fingerprint: string): Promise<string | null>;
1341
- declare function fetchKeyByKeyId(keyId: string): Promise<string | null>;
1342
-
1343
- /**
1344
- * EFP social graph for an address. Followers are counted by EFP for any address,
1345
- * whether or not it has published a list of its own; following and top-8 exist
1346
- * only when it has (its "primary list"). An address with followers but no list
1347
- * — a project account that has never followed anyone — is still on EFP.
1348
- */
1349
- declare function fetchEFPGraph(address: string): Promise<EFPGraph | null>;
1350
-
1351
- /** Normalize a fingerprint to lowercase hex with no prefix or spaces. Returns null if malformed. */
1352
- declare function normalizeFingerprint(input: string): string | null;
1353
- /** Fingerprint → the raw `bytes` argument the v2 registry takes (0x-prefixed, 20 or 32 bytes). */
1354
- declare function fingerprintToBytes(fingerprint: string): Hex;
1355
- /** Raw `bytes` from the registry → lowercase hex fingerprint without 0x. */
1356
- declare function bytesToFingerprint(bytes: Hex | string): string;
1357
- /** keccak256 of the raw fingerprint bytes — the `fingerprintHash` the registry indexes by. */
1358
- declare function fingerprintHash(fingerprint: string): Hex;
1359
- /**
1360
- * The long key ID as the `bytes8` the registry indexes by. Per RFC 9580 §5.5.4 it is the
1361
- * low-order 8 bytes of a v4 (20-byte) fingerprint and the high-order 8 bytes of a v6
1362
- * (32-byte) fingerprint — the same value `gpg --keyid-format long` prints.
1363
- */
1364
- declare function keyIdOf(fingerprint: string): Hex;
1365
- /** A 16-hex long key ID (spaces/0x tolerated) → `bytes8`. */
1366
- declare function keyIdToBytes(keyId: string): Hex | null;
1367
-
1368
1308
  /**
1369
1309
  * EIP-712 authorizations for the registry's relayed writes (`attestFor`, `reattestFor`,
1370
1310
  * `updateKeyFor`, `revokeFor`, `setRecordFor`). The owner signs one of these typed
@@ -1661,4 +1601,159 @@ declare function authorizationDigest(typedData: ReturnType<typeof attestTypedDat
1661
1601
  /** `bytes32 kind` for a record from a human-readable name, e.g. recordKind('thurin.vouch'). */
1662
1602
  declare function recordKind(name: string): Hex;
1663
1603
 
1664
- 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, fetchKeyByFingerprint, fetchKeyByKeyId, 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.d.ts CHANGED
@@ -1305,66 +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
- declare function fetchKeyByFingerprint(fingerprint: string): Promise<string | null>;
1341
- declare function fetchKeyByKeyId(keyId: string): Promise<string | null>;
1342
-
1343
- /**
1344
- * EFP social graph for an address. Followers are counted by EFP for any address,
1345
- * whether or not it has published a list of its own; following and top-8 exist
1346
- * only when it has (its "primary list"). An address with followers but no list
1347
- * — a project account that has never followed anyone — is still on EFP.
1348
- */
1349
- declare function fetchEFPGraph(address: string): Promise<EFPGraph | null>;
1350
-
1351
- /** Normalize a fingerprint to lowercase hex with no prefix or spaces. Returns null if malformed. */
1352
- declare function normalizeFingerprint(input: string): string | null;
1353
- /** Fingerprint → the raw `bytes` argument the v2 registry takes (0x-prefixed, 20 or 32 bytes). */
1354
- declare function fingerprintToBytes(fingerprint: string): Hex;
1355
- /** Raw `bytes` from the registry → lowercase hex fingerprint without 0x. */
1356
- declare function bytesToFingerprint(bytes: Hex | string): string;
1357
- /** keccak256 of the raw fingerprint bytes — the `fingerprintHash` the registry indexes by. */
1358
- declare function fingerprintHash(fingerprint: string): Hex;
1359
- /**
1360
- * The long key ID as the `bytes8` the registry indexes by. Per RFC 9580 §5.5.4 it is the
1361
- * low-order 8 bytes of a v4 (20-byte) fingerprint and the high-order 8 bytes of a v6
1362
- * (32-byte) fingerprint — the same value `gpg --keyid-format long` prints.
1363
- */
1364
- declare function keyIdOf(fingerprint: string): Hex;
1365
- /** A 16-hex long key ID (spaces/0x tolerated) → `bytes8`. */
1366
- declare function keyIdToBytes(keyId: string): Hex | null;
1367
-
1368
1308
  /**
1369
1309
  * EIP-712 authorizations for the registry's relayed writes (`attestFor`, `reattestFor`,
1370
1310
  * `updateKeyFor`, `revokeFor`, `setRecordFor`). The owner signs one of these typed
@@ -1661,4 +1601,159 @@ declare function authorizationDigest(typedData: ReturnType<typeof attestTypedDat
1661
1601
  /** `bytes32 kind` for a record from a human-readable name, e.g. recordKind('thurin.vouch'). */
1662
1602
  declare function recordKind(name: string): Hex;
1663
1603
 
1664
- 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, fetchKeyByFingerprint, fetchKeyByKeyId, 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,21 +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,
20
- fetchKeyByFingerprint,
21
- fetchKeyByKeyId,
26
+ fetchRecords,
22
27
  fingerprintHash,
23
28
  fingerprintToBytes,
24
29
  getRegistry,
@@ -27,41 +32,50 @@ import {
27
32
  isNetworkName,
28
33
  keyIdOf,
29
34
  keyIdToBytes,
35
+ kindName,
30
36
  normalizeFingerprint,
31
37
  parsePgpKey,
38
+ parsePointer,
39
+ parseRecord,
32
40
  proofHref,
33
41
  proofSecondaryHref,
34
42
  reattestTypedData,
35
43
  recordKind,
36
44
  registryDomain,
45
+ renderPointer,
37
46
  revokeTypedData,
38
47
  setRecordTypedData,
39
48
  stripEmailUserIDs,
40
49
  updateKeyTypedData,
41
50
  verifyAttestation,
42
51
  verifyProof
43
- } from "./chunk-Y4E5MMGR.js";
52
+ } from "./chunk-4H57JHDJ.js";
44
53
  export {
45
54
  AUTHORIZATION_TYPES,
46
55
  EIP712_NAME,
47
56
  EIP712_VERSION,
48
57
  ENS_HINT_KEY,
49
58
  ENS_TEXT_RESOLVER_ABI,
59
+ IDENTITY_KINDS,
60
+ KNOWN_KINDS,
61
+ MAX_RECORD_BYTES,
50
62
  NETWORKS,
51
63
  REGISTRY_ABI,
52
64
  REGISTRY_ADDRESS,
65
+ addPointer,
53
66
  attestTypedData,
54
67
  authorizationDigest,
55
68
  bytesToFingerprint,
56
69
  chainFor,
70
+ decodeRecord,
57
71
  displayUrl,
72
+ encodeRecord,
58
73
  ensHintFor,
59
74
  ensHintValue,
60
75
  ensHintWrite,
61
76
  fetchEFPGraph,
62
77
  fetchEnsHint,
63
- fetchKeyByFingerprint,
64
- fetchKeyByKeyId,
78
+ fetchRecords,
65
79
  fingerprintHash,
66
80
  fingerprintToBytes,
67
81
  getRegistry,
@@ -70,13 +84,17 @@ export {
70
84
  isNetworkName,
71
85
  keyIdOf,
72
86
  keyIdToBytes,
87
+ kindName,
73
88
  normalizeFingerprint,
74
89
  parsePgpKey,
90
+ parsePointer,
91
+ parseRecord,
75
92
  proofHref,
76
93
  proofSecondaryHref,
77
94
  reattestTypedData,
78
95
  recordKind,
79
96
  registryDomain,
97
+ renderPointer,
80
98
  revokeTypedData,
81
99
  setRecordTypedData,
82
100
  stripEmailUserIDs,