@thurinlabs/identity-kit 0.1.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.
@@ -0,0 +1,204 @@
1
+ import * as react_jsx_runtime from 'react/jsx-runtime';
2
+ import { ReactNode } from 'react';
3
+
4
+ interface SignetClaim {
5
+ index: number;
6
+ fingerprint: string;
7
+ createdAt: number;
8
+ revoked: boolean;
9
+ pgpSignature: string | null;
10
+ pgpPublicKey: string | null;
11
+ txHash: string | null;
12
+ verification: PGPVerification | null;
13
+ }
14
+ interface PGPVerification {
15
+ verified: boolean;
16
+ reason?: string;
17
+ }
18
+ interface PGPKeyInfo {
19
+ fingerprint: string;
20
+ userIDs: string[];
21
+ algorithm: string;
22
+ created: string | null;
23
+ expires: string | null;
24
+ notations: Notation[];
25
+ subkeys: SubkeyInfo[];
26
+ }
27
+ interface SubkeyInfo {
28
+ algorithm: string;
29
+ created: string | null;
30
+ fingerprint: string;
31
+ }
32
+ interface Notation {
33
+ name: string;
34
+ value: string;
35
+ }
36
+ interface Proof {
37
+ provider: string;
38
+ label: string;
39
+ url: string;
40
+ user?: string;
41
+ instance?: string;
42
+ repo?: string;
43
+ gistId?: string;
44
+ castHash?: string;
45
+ domain?: string;
46
+ }
47
+ interface ProofResult {
48
+ provider: string;
49
+ label: string;
50
+ url: string;
51
+ displayUrl: string;
52
+ href: string | null;
53
+ secondaryHref: string | null;
54
+ status: 'verified' | 'unverified' | 'pending' | 'skipped';
55
+ reason?: string;
56
+ }
57
+ interface EFPGraph {
58
+ followers: number;
59
+ following: number;
60
+ top8: string[];
61
+ hasEfp: boolean;
62
+ }
63
+ interface ScryIdentity {
64
+ address: string | null;
65
+ ensName: string | null;
66
+ ensAvatar: string | null;
67
+ claims: SignetClaim[];
68
+ totalClaims: number;
69
+ activeClaims: number;
70
+ currentFingerprint: string | null;
71
+ pgpKeyInfo: PGPKeyInfo | null;
72
+ proofs: ProofResult[];
73
+ efp: EFPGraph | null;
74
+ isLoading: boolean;
75
+ error: Error | null;
76
+ }
77
+ type Theme = 'thurin' | 'dark' | 'light';
78
+ interface IdentityKitConfig {
79
+ rpcUrl?: string;
80
+ neynarApiKey?: string;
81
+ scryBaseUrl?: string;
82
+ }
83
+
84
+ interface IdentityKitProviderProps extends IdentityKitConfig {
85
+ children: ReactNode;
86
+ }
87
+ declare function IdentityKitProvider({ children, rpcUrl, neynarApiKey, scryBaseUrl, }: IdentityKitProviderProps): react_jsx_runtime.JSX.Element;
88
+
89
+ interface ScryCardProps {
90
+ ens?: string;
91
+ address?: string;
92
+ theme?: Theme;
93
+ }
94
+ declare function ScryCard({ ens, address, theme }: ScryCardProps): react_jsx_runtime.JSX.Element;
95
+
96
+ declare function useScryIdentity(ensOrAddress: string | undefined | null): ScryIdentity;
97
+
98
+ declare function useSignetClaims(address: string | undefined | null): {
99
+ claims: SignetClaim[];
100
+ totalClaims: number;
101
+ activeClaims: number;
102
+ currentFingerprint: string | null;
103
+ isLoading: boolean;
104
+ };
105
+
106
+ declare function useEFPGraph(address: string | undefined | null): {
107
+ efp: EFPGraph | null;
108
+ isLoading: boolean;
109
+ };
110
+
111
+ declare function usePGPProofs(fingerprint: string | undefined | null): {
112
+ keyInfo: PGPKeyInfo | null;
113
+ proofs: ProofResult[];
114
+ isLoading: boolean;
115
+ };
116
+
117
+ declare function identifyProof(notation: Notation): Proof | null;
118
+ declare function displayUrl(proof: Proof): string;
119
+ declare function proofHref(proof: Proof): string | null;
120
+ declare function proofSecondaryHref(proof: Proof): string | null;
121
+ declare function verifyProof(proof: Proof, fingerprint: string, neynarApiKey?: string): Promise<PGPVerification>;
122
+
123
+ declare function parsePgpKey(armoredKey: string): Promise<PGPKeyInfo | null>;
124
+ declare function verifyAttestation({ pgpPublicKey, pgpSignature, fingerprint, ethAddress, }: {
125
+ pgpPublicKey: string | null;
126
+ pgpSignature: string | null;
127
+ fingerprint: string;
128
+ ethAddress: string;
129
+ }): Promise<PGPVerification>;
130
+ declare function fetchKeyByFingerprint(fingerprint: string): Promise<string | null>;
131
+ declare function fetchKeyByKeyId(keyId: string): Promise<string | null>;
132
+
133
+ declare function fetchEFPGraph(address: string): Promise<EFPGraph | null>;
134
+
135
+ declare const REGISTRY_ADDRESS: "0xf7a45BC662A78a6fb417ED5f52b3766cbf13EbBb";
136
+ declare const CONTRACT_DEPLOY_BLOCK = 24515891n;
137
+ declare const REGISTRY_ABI: readonly [{
138
+ readonly name: "Attested";
139
+ readonly type: "event";
140
+ readonly inputs: readonly [{
141
+ readonly name: "ethAddress";
142
+ readonly type: "address";
143
+ readonly indexed: true;
144
+ }, {
145
+ readonly name: "fingerprintHash";
146
+ readonly type: "string";
147
+ readonly indexed: true;
148
+ }, {
149
+ readonly name: "fingerprint";
150
+ readonly type: "string";
151
+ readonly indexed: false;
152
+ }, {
153
+ readonly name: "pgpSignature";
154
+ readonly type: "string";
155
+ readonly indexed: false;
156
+ }, {
157
+ readonly name: "pgpPublicKey";
158
+ readonly type: "string";
159
+ readonly indexed: false;
160
+ }, {
161
+ readonly name: "index";
162
+ readonly type: "uint256";
163
+ readonly indexed: false;
164
+ }, {
165
+ readonly name: "timestamp";
166
+ readonly type: "uint256";
167
+ readonly indexed: false;
168
+ }];
169
+ }, {
170
+ readonly name: "attestationCount";
171
+ readonly type: "function";
172
+ readonly stateMutability: "view";
173
+ readonly inputs: readonly [{
174
+ readonly name: "addr";
175
+ readonly type: "address";
176
+ }];
177
+ readonly outputs: readonly [{
178
+ readonly name: "";
179
+ readonly type: "uint256";
180
+ }];
181
+ }, {
182
+ readonly name: "getAttestation";
183
+ readonly type: "function";
184
+ readonly stateMutability: "view";
185
+ readonly inputs: readonly [{
186
+ readonly name: "addr";
187
+ readonly type: "address";
188
+ }, {
189
+ readonly name: "index";
190
+ readonly type: "uint256";
191
+ }];
192
+ readonly outputs: readonly [{
193
+ readonly name: "fingerprint";
194
+ readonly type: "string";
195
+ }, {
196
+ readonly name: "createdAt";
197
+ readonly type: "uint256";
198
+ }, {
199
+ readonly name: "revoked";
200
+ readonly type: "bool";
201
+ }];
202
+ }];
203
+
204
+ export { CONTRACT_DEPLOY_BLOCK, type EFPGraph, type IdentityKitConfig, IdentityKitProvider, type IdentityKitProviderProps, type Notation, type PGPKeyInfo, type PGPVerification, type Proof, type ProofResult, REGISTRY_ABI, REGISTRY_ADDRESS, ScryCard, type ScryCardProps, type ScryIdentity, type SignetClaim, type SubkeyInfo, type Theme, displayUrl, fetchEFPGraph, fetchKeyByFingerprint, fetchKeyByKeyId, identifyProof, parsePgpKey, proofHref, proofSecondaryHref, useEFPGraph, usePGPProofs, useScryIdentity, useSignetClaims, verifyAttestation, verifyProof };