@thurinlabs/identity-kit 0.7.4 → 0.8.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/README.md +52 -31
- package/dist/embed.global.js +54 -52
- package/dist/embed.global.js.map +1 -1
- package/dist/index.cjs +44 -44
- package/dist/index.cjs.map +1 -1
- package/dist/index.css +79 -79
- package/dist/index.css.map +1 -1
- package/dist/index.d.cts +11 -11
- package/dist/index.d.ts +11 -11
- package/dist/index.js +46 -46
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.css
CHANGED
|
@@ -1,65 +1,65 @@
|
|
|
1
1
|
/* src/themes/index.css */
|
|
2
|
-
[data-
|
|
3
|
-
--
|
|
4
|
-
--
|
|
5
|
-
--
|
|
6
|
-
--
|
|
7
|
-
--
|
|
8
|
-
--
|
|
9
|
-
--
|
|
10
|
-
--
|
|
11
|
-
--
|
|
12
|
-
--
|
|
13
|
-
--
|
|
14
|
-
--
|
|
15
|
-
}
|
|
16
|
-
[data-
|
|
17
|
-
--
|
|
18
|
-
--
|
|
19
|
-
--
|
|
20
|
-
--
|
|
21
|
-
--
|
|
22
|
-
--
|
|
23
|
-
--
|
|
24
|
-
--
|
|
25
|
-
--
|
|
26
|
-
--
|
|
27
|
-
--
|
|
28
|
-
--
|
|
29
|
-
}
|
|
30
|
-
[data-
|
|
31
|
-
--
|
|
32
|
-
--
|
|
33
|
-
--
|
|
34
|
-
--
|
|
35
|
-
--
|
|
36
|
-
--
|
|
37
|
-
--
|
|
38
|
-
--
|
|
39
|
-
--
|
|
40
|
-
--
|
|
41
|
-
--
|
|
42
|
-
--
|
|
2
|
+
[data-thurin-theme=thurin] {
|
|
3
|
+
--thurin-bg: #1a1a12;
|
|
4
|
+
--thurin-surface: #252518;
|
|
5
|
+
--thurin-surface-deep: #151510;
|
|
6
|
+
--thurin-border: #3a3a2a;
|
|
7
|
+
--thurin-text: #faf9f5;
|
|
8
|
+
--thurin-text-muted: #a8a598;
|
|
9
|
+
--thurin-heading: #7c9a3e;
|
|
10
|
+
--thurin-primary: #7c9a3e;
|
|
11
|
+
--thurin-primary-dim: #5c7a2e;
|
|
12
|
+
--thurin-secondary: #c9a227;
|
|
13
|
+
--thurin-success: #7c9a3e;
|
|
14
|
+
--thurin-error: #d44a4a;
|
|
15
|
+
}
|
|
16
|
+
[data-thurin-theme=dark] {
|
|
17
|
+
--thurin-bg: #141010;
|
|
18
|
+
--thurin-surface: #1e1918;
|
|
19
|
+
--thurin-surface-deep: #110e0c;
|
|
20
|
+
--thurin-border: #352a22;
|
|
21
|
+
--thurin-text: #ede5d8;
|
|
22
|
+
--thurin-text-muted: #a09080;
|
|
23
|
+
--thurin-heading: #f0ece4;
|
|
24
|
+
--thurin-primary: #c9a227;
|
|
25
|
+
--thurin-primary-dim: #8a7020;
|
|
26
|
+
--thurin-secondary: #d4a04a;
|
|
27
|
+
--thurin-success: #7c9a3e;
|
|
28
|
+
--thurin-error: #d44a4a;
|
|
29
|
+
}
|
|
30
|
+
[data-thurin-theme=light] {
|
|
31
|
+
--thurin-bg: #faf9f5;
|
|
32
|
+
--thurin-surface: #f0efe8;
|
|
33
|
+
--thurin-surface-deep: #e8e7e0;
|
|
34
|
+
--thurin-border: #d0cfc4;
|
|
35
|
+
--thurin-text: #2a2a22;
|
|
36
|
+
--thurin-text-muted: #6b6960;
|
|
37
|
+
--thurin-heading: #5a7228;
|
|
38
|
+
--thurin-primary: #5a7228;
|
|
39
|
+
--thurin-primary-dim: #7c9a3e;
|
|
40
|
+
--thurin-secondary: #a8861e;
|
|
41
|
+
--thurin-success: #5a7228;
|
|
42
|
+
--thurin-error: #b83a3a;
|
|
43
43
|
}
|
|
44
44
|
|
|
45
|
-
/* src/components/
|
|
46
|
-
.
|
|
45
|
+
/* src/components/ThurinCard/ThurinCard.css */
|
|
46
|
+
.thurin-card {
|
|
47
47
|
font-family:
|
|
48
48
|
"Crimson Pro",
|
|
49
49
|
Georgia,
|
|
50
50
|
serif;
|
|
51
|
-
background: var(--
|
|
52
|
-
border: 1px solid var(--
|
|
51
|
+
background: var(--thurin-surface);
|
|
52
|
+
border: 1px solid var(--thurin-border);
|
|
53
53
|
border-radius: 8px;
|
|
54
54
|
padding: 20px;
|
|
55
|
-
color: var(--
|
|
55
|
+
color: var(--thurin-text);
|
|
56
56
|
max-width: 380px;
|
|
57
57
|
width: 100%;
|
|
58
58
|
}
|
|
59
|
-
.
|
|
59
|
+
.thurin-card * {
|
|
60
60
|
box-sizing: border-box;
|
|
61
61
|
}
|
|
62
|
-
.
|
|
62
|
+
.thurin-card-header {
|
|
63
63
|
display: flex;
|
|
64
64
|
align-items: center;
|
|
65
65
|
gap: 12px;
|
|
@@ -68,100 +68,100 @@
|
|
|
68
68
|
color: inherit;
|
|
69
69
|
cursor: pointer;
|
|
70
70
|
}
|
|
71
|
-
.
|
|
72
|
-
color: var(--
|
|
71
|
+
.thurin-card-header:hover .thurin-card-name {
|
|
72
|
+
color: var(--thurin-primary);
|
|
73
73
|
}
|
|
74
|
-
.
|
|
74
|
+
.thurin-card-avatar {
|
|
75
75
|
width: 48px;
|
|
76
76
|
height: 48px;
|
|
77
77
|
border-radius: 50%;
|
|
78
|
-
border: 2px solid var(--
|
|
78
|
+
border: 2px solid var(--thurin-border);
|
|
79
79
|
object-fit: cover;
|
|
80
80
|
flex-shrink: 0;
|
|
81
81
|
}
|
|
82
|
-
.
|
|
82
|
+
.thurin-card-avatar-placeholder {
|
|
83
83
|
width: 48px;
|
|
84
84
|
height: 48px;
|
|
85
85
|
border-radius: 50%;
|
|
86
|
-
border: 2px solid var(--
|
|
86
|
+
border: 2px solid var(--thurin-border);
|
|
87
87
|
flex-shrink: 0;
|
|
88
88
|
overflow: hidden;
|
|
89
89
|
}
|
|
90
|
-
.
|
|
90
|
+
.thurin-card-name {
|
|
91
91
|
font-family: "Cinzel", serif;
|
|
92
92
|
font-size: 18px;
|
|
93
93
|
font-weight: 700;
|
|
94
|
-
color: var(--
|
|
94
|
+
color: var(--thurin-heading);
|
|
95
95
|
line-height: 1.2;
|
|
96
96
|
}
|
|
97
|
-
.
|
|
97
|
+
.thurin-card-address {
|
|
98
98
|
font-family: "Share Tech Mono", monospace;
|
|
99
99
|
font-size: 11px;
|
|
100
|
-
color: var(--
|
|
100
|
+
color: var(--thurin-text-muted);
|
|
101
101
|
margin-top: 2px;
|
|
102
102
|
word-break: break-all;
|
|
103
103
|
}
|
|
104
|
-
.
|
|
104
|
+
.thurin-card-stats {
|
|
105
105
|
display: grid;
|
|
106
106
|
grid-template-columns: repeat(3, 1fr);
|
|
107
107
|
gap: 8px;
|
|
108
108
|
margin-bottom: 16px;
|
|
109
109
|
}
|
|
110
|
-
.
|
|
110
|
+
.thurin-card-stat {
|
|
111
111
|
text-align: center;
|
|
112
112
|
padding: 8px 4px;
|
|
113
|
-
background: var(--
|
|
113
|
+
background: var(--thurin-surface-deep);
|
|
114
114
|
border-radius: 4px;
|
|
115
115
|
}
|
|
116
|
-
.
|
|
116
|
+
.thurin-card-stat-value {
|
|
117
117
|
font-family: "Cinzel", serif;
|
|
118
118
|
font-size: 20px;
|
|
119
119
|
font-weight: 700;
|
|
120
|
-
color: var(--
|
|
120
|
+
color: var(--thurin-heading);
|
|
121
121
|
display: block;
|
|
122
122
|
}
|
|
123
|
-
.
|
|
123
|
+
.thurin-card-stat-label {
|
|
124
124
|
font-family: "Share Tech Mono", monospace;
|
|
125
125
|
font-size: 10px;
|
|
126
|
-
color: var(--
|
|
126
|
+
color: var(--thurin-text-muted);
|
|
127
127
|
text-transform: uppercase;
|
|
128
128
|
letter-spacing: 0.5px;
|
|
129
129
|
}
|
|
130
|
-
.
|
|
130
|
+
.thurin-card-badges {
|
|
131
131
|
display: flex;
|
|
132
132
|
flex-wrap: wrap;
|
|
133
133
|
gap: 6px;
|
|
134
134
|
margin-bottom: 16px;
|
|
135
135
|
}
|
|
136
|
-
.
|
|
136
|
+
.thurin-card-badge {
|
|
137
137
|
font-family: "Share Tech Mono", monospace;
|
|
138
138
|
font-size: 11px;
|
|
139
139
|
padding: 3px 8px;
|
|
140
140
|
border-radius: 3px;
|
|
141
141
|
border: 1px solid;
|
|
142
142
|
}
|
|
143
|
-
.
|
|
144
|
-
color: var(--
|
|
145
|
-
border-color: var(--
|
|
143
|
+
.thurin-card-badge--verified {
|
|
144
|
+
color: var(--thurin-success);
|
|
145
|
+
border-color: var(--thurin-success);
|
|
146
146
|
}
|
|
147
|
-
.
|
|
148
|
-
color: var(--
|
|
149
|
-
border-color: var(--
|
|
147
|
+
.thurin-card-badge--unverified {
|
|
148
|
+
color: var(--thurin-text-muted);
|
|
149
|
+
border-color: var(--thurin-border);
|
|
150
150
|
}
|
|
151
|
-
.
|
|
151
|
+
.thurin-card-link {
|
|
152
152
|
display: block;
|
|
153
153
|
text-align: right;
|
|
154
154
|
font-size: 12px;
|
|
155
|
-
color: var(--
|
|
155
|
+
color: var(--thurin-text-muted);
|
|
156
156
|
text-decoration: none;
|
|
157
157
|
}
|
|
158
|
-
.
|
|
159
|
-
color: var(--
|
|
158
|
+
.thurin-card-link:hover {
|
|
159
|
+
color: var(--thurin-primary);
|
|
160
160
|
}
|
|
161
|
-
.
|
|
161
|
+
.thurin-card-loading {
|
|
162
162
|
text-align: center;
|
|
163
163
|
padding: 24px;
|
|
164
|
-
color: var(--
|
|
164
|
+
color: var(--thurin-text-muted);
|
|
165
165
|
font-size: 14px;
|
|
166
166
|
}
|
|
167
167
|
/*# sourceMappingURL=index.css.map */
|
package/dist/index.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/themes/index.css","../src/components/
|
|
1
|
+
{"version":3,"sources":["../src/themes/index.css","../src/components/ThurinCard/ThurinCard.css"],"sourcesContent":["[data-thurin-theme=\"thurin\"] {\n --thurin-bg: #1a1a12;\n --thurin-surface: #252518;\n --thurin-surface-deep: #151510;\n --thurin-border: #3a3a2a;\n --thurin-text: #faf9f5;\n --thurin-text-muted: #a8a598;\n --thurin-heading: #7c9a3e;\n --thurin-primary: #7c9a3e;\n --thurin-primary-dim: #5c7a2e;\n --thurin-secondary: #c9a227;\n --thurin-success: #7c9a3e;\n --thurin-error: #d44a4a;\n}\n\n[data-thurin-theme=\"dark\"] {\n --thurin-bg: #141010;\n --thurin-surface: #1e1918;\n --thurin-surface-deep: #110e0c;\n --thurin-border: #352a22;\n --thurin-text: #ede5d8;\n --thurin-text-muted: #a09080;\n --thurin-heading: #f0ece4;\n --thurin-primary: #c9a227;\n --thurin-primary-dim: #8a7020;\n --thurin-secondary: #d4a04a;\n --thurin-success: #7c9a3e;\n --thurin-error: #d44a4a;\n}\n\n[data-thurin-theme=\"light\"] {\n --thurin-bg: #faf9f5;\n --thurin-surface: #f0efe8;\n --thurin-surface-deep: #e8e7e0;\n --thurin-border: #d0cfc4;\n --thurin-text: #2a2a22;\n --thurin-text-muted: #6b6960;\n --thurin-heading: #5a7228;\n --thurin-primary: #5a7228;\n --thurin-primary-dim: #7c9a3e;\n --thurin-secondary: #a8861e;\n --thurin-success: #5a7228;\n --thurin-error: #b83a3a;\n}\n",".thurin-card {\n font-family: 'Crimson Pro', Georgia, serif;\n background: var(--thurin-surface);\n border: 1px solid var(--thurin-border);\n border-radius: 8px;\n padding: 20px;\n color: var(--thurin-text);\n max-width: 380px;\n width: 100%;\n}\n\n.thurin-card * {\n box-sizing: border-box;\n}\n\n.thurin-card-header {\n display: flex;\n align-items: center;\n gap: 12px;\n margin-bottom: 16px;\n text-decoration: none;\n color: inherit;\n cursor: pointer;\n}\n\n.thurin-card-header:hover .thurin-card-name {\n color: var(--thurin-primary);\n}\n\n.thurin-card-avatar {\n width: 48px;\n height: 48px;\n border-radius: 50%;\n border: 2px solid var(--thurin-border);\n object-fit: cover;\n flex-shrink: 0;\n}\n\n.thurin-card-avatar-placeholder {\n width: 48px;\n height: 48px;\n border-radius: 50%;\n border: 2px solid var(--thurin-border);\n flex-shrink: 0;\n overflow: hidden;\n}\n\n.thurin-card-name {\n font-family: 'Cinzel', serif;\n font-size: 18px;\n font-weight: 700;\n color: var(--thurin-heading);\n line-height: 1.2;\n}\n\n.thurin-card-address {\n font-family: 'Share Tech Mono', monospace;\n font-size: 11px;\n color: var(--thurin-text-muted);\n margin-top: 2px;\n word-break: break-all;\n}\n\n.thurin-card-stats {\n display: grid;\n grid-template-columns: repeat(3, 1fr);\n gap: 8px;\n margin-bottom: 16px;\n}\n\n.thurin-card-stat {\n text-align: center;\n padding: 8px 4px;\n background: var(--thurin-surface-deep);\n border-radius: 4px;\n}\n\n.thurin-card-stat-value {\n font-family: 'Cinzel', serif;\n font-size: 20px;\n font-weight: 700;\n color: var(--thurin-heading);\n display: block;\n}\n\n.thurin-card-stat-label {\n font-family: 'Share Tech Mono', monospace;\n font-size: 10px;\n color: var(--thurin-text-muted);\n text-transform: uppercase;\n letter-spacing: 0.5px;\n}\n\n.thurin-card-badges {\n display: flex;\n flex-wrap: wrap;\n gap: 6px;\n margin-bottom: 16px;\n}\n\n.thurin-card-badge {\n font-family: 'Share Tech Mono', monospace;\n font-size: 11px;\n padding: 3px 8px;\n border-radius: 3px;\n border: 1px solid;\n}\n\n.thurin-card-badge--verified {\n color: var(--thurin-success);\n border-color: var(--thurin-success);\n}\n\n.thurin-card-badge--unverified {\n color: var(--thurin-text-muted);\n border-color: var(--thurin-border);\n}\n\n.thurin-card-link {\n display: block;\n text-align: right;\n font-size: 12px;\n color: var(--thurin-text-muted);\n text-decoration: none;\n}\n\n.thurin-card-link:hover {\n color: var(--thurin-primary);\n}\n\n.thurin-card-loading {\n text-align: center;\n padding: 24px;\n color: var(--thurin-text-muted);\n font-size: 14px;\n}\n"],"mappings":";AAAA,CAAC;AACC,eAAa;AACb,oBAAkB;AAClB,yBAAuB;AACvB,mBAAiB;AACjB,iBAAe;AACf,uBAAqB;AACrB,oBAAkB;AAClB,oBAAkB;AAClB,wBAAsB;AACtB,sBAAoB;AACpB,oBAAkB;AAClB,kBAAgB;AAClB;AAEA,CAAC;AACC,eAAa;AACb,oBAAkB;AAClB,yBAAuB;AACvB,mBAAiB;AACjB,iBAAe;AACf,uBAAqB;AACrB,oBAAkB;AAClB,oBAAkB;AAClB,wBAAsB;AACtB,sBAAoB;AACpB,oBAAkB;AAClB,kBAAgB;AAClB;AAEA,CAAC;AACC,eAAa;AACb,oBAAkB;AAClB,yBAAuB;AACvB,mBAAiB;AACjB,iBAAe;AACf,uBAAqB;AACrB,oBAAkB;AAClB,oBAAkB;AAClB,wBAAsB;AACtB,sBAAoB;AACpB,oBAAkB;AAClB,kBAAgB;AAClB;;;AC3CA,CAAC;AACC;AAAA,IAAa,aAAa;AAAA,IAAE,OAAO;AAAA,IAAE;AACrC,cAAY,IAAI;AAChB,UAAQ,IAAI,MAAM,IAAI;AACtB,iBAAe;AACf,WAAS;AACT,SAAO,IAAI;AACX,aAAW;AACX,SAAO;AACT;AAEA,CAXC,YAWY;AACX,cAAY;AACd;AAEA,CAAC;AACC,WAAS;AACT,eAAa;AACb,OAAK;AACL,iBAAe;AACf,mBAAiB;AACjB,SAAO;AACP,UAAQ;AACV;AAEA,CAVC,kBAUkB,OAAO,CAAC;AACzB,SAAO,IAAI;AACb;AAEA,CAAC;AACC,SAAO;AACP,UAAQ;AACR,iBAAe;AACf,UAAQ,IAAI,MAAM,IAAI;AACtB,cAAY;AACZ,eAAa;AACf;AAEA,CAAC;AACC,SAAO;AACP,UAAQ;AACR,iBAAe;AACf,UAAQ,IAAI,MAAM,IAAI;AACtB,eAAa;AACb,YAAU;AACZ;AAEA,CAtB2B;AAuBzB,eAAa,QAAQ,EAAE;AACvB,aAAW;AACX,eAAa;AACb,SAAO,IAAI;AACX,eAAa;AACf;AAEA,CAAC;AACC,eAAa,iBAAiB,EAAE;AAChC,aAAW;AACX,SAAO,IAAI;AACX,cAAY;AACZ,cAAY;AACd;AAEA,CAAC;AACC,WAAS;AACT,yBAAuB,OAAO,CAAC,EAAE;AACjC,OAAK;AACL,iBAAe;AACjB;AAEA,CAAC;AACC,cAAY;AACZ,WAAS,IAAI;AACb,cAAY,IAAI;AAChB,iBAAe;AACjB;AAEA,CAAC;AACC,eAAa,QAAQ,EAAE;AACvB,aAAW;AACX,eAAa;AACb,SAAO,IAAI;AACX,WAAS;AACX;AAEA,CAAC;AACC,eAAa,iBAAiB,EAAE;AAChC,aAAW;AACX,SAAO,IAAI;AACX,kBAAgB;AAChB,kBAAgB;AAClB;AAEA,CAAC;AACC,WAAS;AACT,aAAW;AACX,OAAK;AACL,iBAAe;AACjB;AAEA,CAAC;AACC,eAAa,iBAAiB,EAAE;AAChC,aAAW;AACX,WAAS,IAAI;AACb,iBAAe;AACf,UAAQ,IAAI;AACd;AAEA,CAAC;AACC,SAAO,IAAI;AACX,gBAAc,IAAI;AACpB;AAEA,CAAC;AACC,SAAO,IAAI;AACX,gBAAc,IAAI;AACpB;AAEA,CAAC;AACC,WAAS;AACT,cAAY;AACZ,aAAW;AACX,SAAO,IAAI;AACX,mBAAiB;AACnB;AAEA,CARC,gBAQgB;AACf,SAAO,IAAI;AACb;AAEA,CAAC;AACC,cAAY;AACZ,WAAS;AACT,SAAO,IAAI;AACX,aAAW;AACb;","names":[]}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
|
|
4
|
-
interface
|
|
4
|
+
interface Attestation {
|
|
5
5
|
index: number;
|
|
6
6
|
fingerprint: string;
|
|
7
7
|
createdAt: number;
|
|
@@ -60,11 +60,11 @@ interface EFPGraph {
|
|
|
60
60
|
top8: string[];
|
|
61
61
|
hasEfp: boolean;
|
|
62
62
|
}
|
|
63
|
-
interface
|
|
63
|
+
interface ThurinIdentity {
|
|
64
64
|
address: string | null;
|
|
65
65
|
ensName: string | null;
|
|
66
66
|
ensAvatar: string | null;
|
|
67
|
-
claims:
|
|
67
|
+
claims: Attestation[];
|
|
68
68
|
totalClaims: number;
|
|
69
69
|
activeClaims: number;
|
|
70
70
|
currentFingerprint: string | null;
|
|
@@ -78,25 +78,25 @@ type Theme = 'thurin' | 'dark' | 'light';
|
|
|
78
78
|
interface IdentityKitConfig {
|
|
79
79
|
rpcUrl?: string;
|
|
80
80
|
neynarApiKey?: string;
|
|
81
|
-
|
|
81
|
+
baseUrl?: string;
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
interface IdentityKitProviderProps extends IdentityKitConfig {
|
|
85
85
|
children: ReactNode;
|
|
86
86
|
}
|
|
87
|
-
declare function IdentityKitProvider({ children, rpcUrl, neynarApiKey,
|
|
87
|
+
declare function IdentityKitProvider({ children, rpcUrl, neynarApiKey, baseUrl, }: IdentityKitProviderProps): react_jsx_runtime.JSX.Element;
|
|
88
88
|
|
|
89
|
-
interface
|
|
89
|
+
interface ThurinCardProps {
|
|
90
90
|
ens?: string;
|
|
91
91
|
address?: string;
|
|
92
92
|
theme?: Theme;
|
|
93
93
|
}
|
|
94
|
-
declare function
|
|
94
|
+
declare function ThurinCard({ ens, address, theme }: ThurinCardProps): react_jsx_runtime.JSX.Element;
|
|
95
95
|
|
|
96
|
-
declare function
|
|
96
|
+
declare function useThurinIdentity(ensOrAddress: string | undefined | null): ThurinIdentity;
|
|
97
97
|
|
|
98
|
-
declare function
|
|
99
|
-
claims:
|
|
98
|
+
declare function useAttestations(address: string | undefined | null): {
|
|
99
|
+
claims: Attestation[];
|
|
100
100
|
totalClaims: number;
|
|
101
101
|
activeClaims: number;
|
|
102
102
|
currentFingerprint: string | null;
|
|
@@ -201,4 +201,4 @@ declare const REGISTRY_ABI: readonly [{
|
|
|
201
201
|
}];
|
|
202
202
|
}];
|
|
203
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,
|
|
204
|
+
export { type Attestation, CONTRACT_DEPLOY_BLOCK, type EFPGraph, type IdentityKitConfig, IdentityKitProvider, type IdentityKitProviderProps, type Notation, type PGPKeyInfo, type PGPVerification, type Proof, type ProofResult, REGISTRY_ABI, REGISTRY_ADDRESS, type SubkeyInfo, type Theme, ThurinCard, type ThurinCardProps, type ThurinIdentity, displayUrl, fetchEFPGraph, fetchKeyByFingerprint, fetchKeyByKeyId, identifyProof, parsePgpKey, proofHref, proofSecondaryHref, useAttestations, useEFPGraph, usePGPProofs, useThurinIdentity, verifyAttestation, verifyProof };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { ReactNode } from 'react';
|
|
3
3
|
|
|
4
|
-
interface
|
|
4
|
+
interface Attestation {
|
|
5
5
|
index: number;
|
|
6
6
|
fingerprint: string;
|
|
7
7
|
createdAt: number;
|
|
@@ -60,11 +60,11 @@ interface EFPGraph {
|
|
|
60
60
|
top8: string[];
|
|
61
61
|
hasEfp: boolean;
|
|
62
62
|
}
|
|
63
|
-
interface
|
|
63
|
+
interface ThurinIdentity {
|
|
64
64
|
address: string | null;
|
|
65
65
|
ensName: string | null;
|
|
66
66
|
ensAvatar: string | null;
|
|
67
|
-
claims:
|
|
67
|
+
claims: Attestation[];
|
|
68
68
|
totalClaims: number;
|
|
69
69
|
activeClaims: number;
|
|
70
70
|
currentFingerprint: string | null;
|
|
@@ -78,25 +78,25 @@ type Theme = 'thurin' | 'dark' | 'light';
|
|
|
78
78
|
interface IdentityKitConfig {
|
|
79
79
|
rpcUrl?: string;
|
|
80
80
|
neynarApiKey?: string;
|
|
81
|
-
|
|
81
|
+
baseUrl?: string;
|
|
82
82
|
}
|
|
83
83
|
|
|
84
84
|
interface IdentityKitProviderProps extends IdentityKitConfig {
|
|
85
85
|
children: ReactNode;
|
|
86
86
|
}
|
|
87
|
-
declare function IdentityKitProvider({ children, rpcUrl, neynarApiKey,
|
|
87
|
+
declare function IdentityKitProvider({ children, rpcUrl, neynarApiKey, baseUrl, }: IdentityKitProviderProps): react_jsx_runtime.JSX.Element;
|
|
88
88
|
|
|
89
|
-
interface
|
|
89
|
+
interface ThurinCardProps {
|
|
90
90
|
ens?: string;
|
|
91
91
|
address?: string;
|
|
92
92
|
theme?: Theme;
|
|
93
93
|
}
|
|
94
|
-
declare function
|
|
94
|
+
declare function ThurinCard({ ens, address, theme }: ThurinCardProps): react_jsx_runtime.JSX.Element;
|
|
95
95
|
|
|
96
|
-
declare function
|
|
96
|
+
declare function useThurinIdentity(ensOrAddress: string | undefined | null): ThurinIdentity;
|
|
97
97
|
|
|
98
|
-
declare function
|
|
99
|
-
claims:
|
|
98
|
+
declare function useAttestations(address: string | undefined | null): {
|
|
99
|
+
claims: Attestation[];
|
|
100
100
|
totalClaims: number;
|
|
101
101
|
activeClaims: number;
|
|
102
102
|
currentFingerprint: string | null;
|
|
@@ -201,4 +201,4 @@ declare const REGISTRY_ABI: readonly [{
|
|
|
201
201
|
}];
|
|
202
202
|
}];
|
|
203
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,
|
|
204
|
+
export { type Attestation, CONTRACT_DEPLOY_BLOCK, type EFPGraph, type IdentityKitConfig, IdentityKitProvider, type IdentityKitProviderProps, type Notation, type PGPKeyInfo, type PGPVerification, type Proof, type ProofResult, REGISTRY_ABI, REGISTRY_ADDRESS, type SubkeyInfo, type Theme, ThurinCard, type ThurinCardProps, type ThurinIdentity, displayUrl, fetchEFPGraph, fetchKeyByFingerprint, fetchKeyByKeyId, identifyProof, parsePgpKey, proofHref, proofSecondaryHref, useAttestations, useEFPGraph, usePGPProofs, useThurinIdentity, verifyAttestation, verifyProof };
|
package/dist/index.js
CHANGED
|
@@ -7,7 +7,7 @@ import { QueryClient, QueryClientProvider } from "@tanstack/react-query";
|
|
|
7
7
|
// src/context.ts
|
|
8
8
|
import { createContext, useContext } from "react";
|
|
9
9
|
var defaultConfig = {
|
|
10
|
-
|
|
10
|
+
baseUrl: "https://thurin.id"
|
|
11
11
|
};
|
|
12
12
|
var IdentityKitContext = createContext(defaultConfig);
|
|
13
13
|
function useIdentityKitConfig() {
|
|
@@ -49,21 +49,21 @@ function IdentityKitProvider({
|
|
|
49
49
|
children,
|
|
50
50
|
rpcUrl,
|
|
51
51
|
neynarApiKey,
|
|
52
|
-
|
|
52
|
+
baseUrl = "https://thurin.id"
|
|
53
53
|
}) {
|
|
54
54
|
const config = useMemo(
|
|
55
|
-
() => ({ rpcUrl, neynarApiKey,
|
|
56
|
-
[rpcUrl, neynarApiKey,
|
|
55
|
+
() => ({ rpcUrl, neynarApiKey, baseUrl }),
|
|
56
|
+
[rpcUrl, neynarApiKey, baseUrl]
|
|
57
57
|
);
|
|
58
58
|
return /* @__PURE__ */ jsx(IdentityKitContext.Provider, { value: config, children: /* @__PURE__ */ jsx(WagmiDetector, { rpcUrl, children }) });
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
// src/hooks/
|
|
61
|
+
// src/hooks/useThurinIdentity.ts
|
|
62
62
|
import { useEnsAddress, useEnsName, useEnsAvatar } from "wagmi";
|
|
63
63
|
import { mainnet as mainnet3 } from "wagmi/chains";
|
|
64
64
|
import { normalize } from "viem/ens";
|
|
65
65
|
|
|
66
|
-
// src/hooks/
|
|
66
|
+
// src/hooks/useAttestations.ts
|
|
67
67
|
import { useReadContract, useReadContracts } from "wagmi";
|
|
68
68
|
import { mainnet as mainnet2 } from "wagmi/chains";
|
|
69
69
|
import { useQuery } from "@tanstack/react-query";
|
|
@@ -232,8 +232,8 @@ async function fetchKeyByKeyId(keyId) {
|
|
|
232
232
|
}
|
|
233
233
|
}
|
|
234
234
|
|
|
235
|
-
// src/hooks/
|
|
236
|
-
function
|
|
235
|
+
// src/hooks/useAttestations.ts
|
|
236
|
+
function useAttestations(address) {
|
|
237
237
|
const config = useIdentityKitConfig();
|
|
238
238
|
const { data: count, isLoading: countLoading } = useReadContract({
|
|
239
239
|
address: REGISTRY_ADDRESS,
|
|
@@ -256,7 +256,7 @@ function useSignetClaims(address) {
|
|
|
256
256
|
query: { enabled: contracts.length > 0 }
|
|
257
257
|
});
|
|
258
258
|
const { data: eventData } = useQuery({
|
|
259
|
-
queryKey: ["
|
|
259
|
+
queryKey: ["attestation-logs", address],
|
|
260
260
|
queryFn: async () => {
|
|
261
261
|
if (!address) return [];
|
|
262
262
|
const client = createPublicClient({
|
|
@@ -278,7 +278,7 @@ function useSignetClaims(address) {
|
|
|
278
278
|
staleTime: 3e5
|
|
279
279
|
});
|
|
280
280
|
const { data: claims, isLoading: verifyLoading } = useQuery({
|
|
281
|
-
queryKey: ["
|
|
281
|
+
queryKey: ["attestations", address, attestationCount, !!eventData],
|
|
282
282
|
queryFn: async () => {
|
|
283
283
|
if (!attestations || !address) return [];
|
|
284
284
|
const results = [];
|
|
@@ -641,7 +641,7 @@ function usePGPProofs(fingerprint) {
|
|
|
641
641
|
};
|
|
642
642
|
}
|
|
643
643
|
|
|
644
|
-
// src/hooks/
|
|
644
|
+
// src/hooks/useThurinIdentity.ts
|
|
645
645
|
function isAddress(value) {
|
|
646
646
|
return /^0x[0-9a-fA-F]{40}$/.test(value);
|
|
647
647
|
}
|
|
@@ -652,7 +652,7 @@ function safeNormalize(name) {
|
|
|
652
652
|
return void 0;
|
|
653
653
|
}
|
|
654
654
|
}
|
|
655
|
-
function
|
|
655
|
+
function useThurinIdentity(ensOrAddress) {
|
|
656
656
|
const isAddr = ensOrAddress ? isAddress(ensOrAddress) : false;
|
|
657
657
|
const ensInput = ensOrAddress && !isAddr ? safeNormalize(ensOrAddress) : void 0;
|
|
658
658
|
const { data: resolvedAddress } = useEnsAddress({
|
|
@@ -678,7 +678,7 @@ function useScryIdentity(ensOrAddress) {
|
|
|
678
678
|
activeClaims,
|
|
679
679
|
currentFingerprint,
|
|
680
680
|
isLoading: claimsLoading
|
|
681
|
-
} =
|
|
681
|
+
} = useAttestations(address);
|
|
682
682
|
const {
|
|
683
683
|
keyInfo: pgpKeyInfo,
|
|
684
684
|
proofs,
|
|
@@ -701,77 +701,77 @@ function useScryIdentity(ensOrAddress) {
|
|
|
701
701
|
};
|
|
702
702
|
}
|
|
703
703
|
|
|
704
|
-
// src/components/
|
|
704
|
+
// src/components/ThurinCard/ThurinCard.tsx
|
|
705
705
|
import { jsx as jsx2, jsxs } from "react/jsx-runtime";
|
|
706
706
|
function ThurinLogo() {
|
|
707
|
-
return /* @__PURE__ */ jsxs("svg", { className: "
|
|
708
|
-
/* @__PURE__ */ jsx2("circle", { cx: "50", cy: "50", r: "50", fill: "var(--
|
|
707
|
+
return /* @__PURE__ */ jsxs("svg", { className: "thurin-card-avatar-placeholder", viewBox: "0 0 100 100", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
708
|
+
/* @__PURE__ */ jsx2("circle", { cx: "50", cy: "50", r: "50", fill: "var(--thurin-surface-deep)" }),
|
|
709
709
|
/* @__PURE__ */ jsx2("path", { d: "M25 80 Q25 25 50 25 Q75 25 75 50", fill: "none", stroke: "#7c9a3e", strokeWidth: "4", strokeLinecap: "round" }),
|
|
710
710
|
/* @__PURE__ */ jsx2("path", { d: "M33 75 Q33 35 50 35 Q67 35 67 52", fill: "none", stroke: "#7c9a3e", strokeWidth: "4", strokeLinecap: "round" }),
|
|
711
711
|
/* @__PURE__ */ jsx2("path", { d: "M41 70 Q41 45 50 45 Q59 45 59 55", fill: "none", stroke: "#c9a227", strokeWidth: "4", strokeLinecap: "round" }),
|
|
712
712
|
/* @__PURE__ */ jsx2("path", { d: "M50 65 L50 53", fill: "none", stroke: "#c9a227", strokeWidth: "4", strokeLinecap: "round" })
|
|
713
713
|
] });
|
|
714
714
|
}
|
|
715
|
-
function
|
|
715
|
+
function ThurinCard({ ens, address, theme = "thurin" }) {
|
|
716
716
|
const input = ens || address;
|
|
717
|
-
const identity =
|
|
717
|
+
const identity = useThurinIdentity(input);
|
|
718
718
|
const config = useIdentityKitConfig();
|
|
719
|
-
const
|
|
719
|
+
const profileUrl = identity.address ? `${config.baseUrl}/eth/${identity.address}` : ens ? `${config.baseUrl}/ens/${ens}` : null;
|
|
720
720
|
if (identity.isLoading) {
|
|
721
|
-
return /* @__PURE__ */ jsx2("div", { className: "
|
|
721
|
+
return /* @__PURE__ */ jsx2("div", { className: "thurin-card", "data-thurin-theme": theme, children: /* @__PURE__ */ jsx2("div", { className: "thurin-card-loading", children: "Loading identity..." }) });
|
|
722
722
|
}
|
|
723
723
|
const displayAddress = identity.address || null;
|
|
724
724
|
const verifiedProofs = identity.proofs.filter((p) => p.status === "verified").length;
|
|
725
725
|
const hasVerifiedPgp = identity.claims.some((c) => c.verification?.verified && !c.revoked);
|
|
726
|
-
return /* @__PURE__ */ jsxs("div", { className: "
|
|
727
|
-
/* @__PURE__ */ jsxs("a", { className: "
|
|
726
|
+
return /* @__PURE__ */ jsxs("div", { className: "thurin-card", "data-thurin-theme": theme, children: [
|
|
727
|
+
/* @__PURE__ */ jsxs("a", { className: "thurin-card-header", href: profileUrl || void 0, target: "_blank", rel: "noopener noreferrer", children: [
|
|
728
728
|
identity.ensAvatar ? /* @__PURE__ */ jsx2(
|
|
729
729
|
"img",
|
|
730
730
|
{
|
|
731
|
-
className: "
|
|
731
|
+
className: "thurin-card-avatar",
|
|
732
732
|
src: identity.ensAvatar,
|
|
733
733
|
alt: identity.ensName || ""
|
|
734
734
|
}
|
|
735
735
|
) : /* @__PURE__ */ jsx2(ThurinLogo, {}),
|
|
736
736
|
/* @__PURE__ */ jsxs("div", { children: [
|
|
737
|
-
identity.ensName && /* @__PURE__ */ jsx2("div", { className: "
|
|
738
|
-
displayAddress && /* @__PURE__ */ jsx2("div", { className: "
|
|
737
|
+
identity.ensName && /* @__PURE__ */ jsx2("div", { className: "thurin-card-name", children: identity.ensName }),
|
|
738
|
+
displayAddress && /* @__PURE__ */ jsx2("div", { className: "thurin-card-address", children: displayAddress })
|
|
739
739
|
] })
|
|
740
740
|
] }),
|
|
741
|
-
/* @__PURE__ */ jsxs("div", { className: "
|
|
742
|
-
/* @__PURE__ */ jsxs("div", { className: "
|
|
743
|
-
/* @__PURE__ */ jsx2("span", { className: "
|
|
744
|
-
/* @__PURE__ */ jsx2("span", { className: "
|
|
741
|
+
/* @__PURE__ */ jsxs("div", { className: "thurin-card-stats", children: [
|
|
742
|
+
/* @__PURE__ */ jsxs("div", { className: "thurin-card-stat", children: [
|
|
743
|
+
/* @__PURE__ */ jsx2("span", { className: "thurin-card-stat-value", children: identity.activeClaims }),
|
|
744
|
+
/* @__PURE__ */ jsx2("span", { className: "thurin-card-stat-label", children: "Attestations" })
|
|
745
745
|
] }),
|
|
746
|
-
/* @__PURE__ */ jsxs("div", { className: "
|
|
747
|
-
/* @__PURE__ */ jsx2("span", { className: "
|
|
748
|
-
/* @__PURE__ */ jsx2("span", { className: "
|
|
746
|
+
/* @__PURE__ */ jsxs("div", { className: "thurin-card-stat", children: [
|
|
747
|
+
/* @__PURE__ */ jsx2("span", { className: "thurin-card-stat-value", children: verifiedProofs }),
|
|
748
|
+
/* @__PURE__ */ jsx2("span", { className: "thurin-card-stat-label", children: "Proofs" })
|
|
749
749
|
] }),
|
|
750
|
-
/* @__PURE__ */ jsxs("div", { className: "
|
|
751
|
-
/* @__PURE__ */ jsx2("span", { className: "
|
|
752
|
-
/* @__PURE__ */ jsx2("span", { className: "
|
|
750
|
+
/* @__PURE__ */ jsxs("div", { className: "thurin-card-stat", children: [
|
|
751
|
+
/* @__PURE__ */ jsx2("span", { className: "thurin-card-stat-value", children: identity.efp?.followers ?? 0 }),
|
|
752
|
+
/* @__PURE__ */ jsx2("span", { className: "thurin-card-stat-label", children: "Followers" })
|
|
753
753
|
] })
|
|
754
754
|
] }),
|
|
755
|
-
/* @__PURE__ */ jsxs("div", { className: "
|
|
756
|
-
hasVerifiedPgp && /* @__PURE__ */ jsx2("span", { className: "
|
|
757
|
-
identity.efp?.hasEfp && /* @__PURE__ */ jsx2("span", { className: "
|
|
755
|
+
/* @__PURE__ */ jsxs("div", { className: "thurin-card-badges", children: [
|
|
756
|
+
hasVerifiedPgp && /* @__PURE__ */ jsx2("span", { className: "thurin-card-badge thurin-card-badge--verified", children: "PGP Verified" }),
|
|
757
|
+
identity.efp?.hasEfp && /* @__PURE__ */ jsx2("span", { className: "thurin-card-badge thurin-card-badge--verified", children: "EFP" }),
|
|
758
758
|
identity.proofs.map((p, i) => /* @__PURE__ */ jsx2(
|
|
759
759
|
"span",
|
|
760
760
|
{
|
|
761
|
-
className: `
|
|
761
|
+
className: `thurin-card-badge thurin-card-badge--${p.status === "verified" ? "verified" : "unverified"}`,
|
|
762
762
|
children: p.label
|
|
763
763
|
},
|
|
764
764
|
i
|
|
765
765
|
))
|
|
766
766
|
] }),
|
|
767
|
-
|
|
767
|
+
profileUrl && /* @__PURE__ */ jsx2(
|
|
768
768
|
"a",
|
|
769
769
|
{
|
|
770
|
-
className: "
|
|
771
|
-
href:
|
|
770
|
+
className: "thurin-card-link",
|
|
771
|
+
href: profileUrl,
|
|
772
772
|
target: "_blank",
|
|
773
773
|
rel: "noopener noreferrer",
|
|
774
|
-
children: "View on
|
|
774
|
+
children: "View on Thurin"
|
|
775
775
|
}
|
|
776
776
|
)
|
|
777
777
|
] });
|
|
@@ -781,7 +781,7 @@ export {
|
|
|
781
781
|
IdentityKitProvider,
|
|
782
782
|
REGISTRY_ABI,
|
|
783
783
|
REGISTRY_ADDRESS,
|
|
784
|
-
|
|
784
|
+
ThurinCard,
|
|
785
785
|
displayUrl,
|
|
786
786
|
fetchEFPGraph,
|
|
787
787
|
fetchKeyByFingerprint,
|
|
@@ -790,10 +790,10 @@ export {
|
|
|
790
790
|
parsePgpKey,
|
|
791
791
|
proofHref,
|
|
792
792
|
proofSecondaryHref,
|
|
793
|
+
useAttestations,
|
|
793
794
|
useEFPGraph,
|
|
794
795
|
usePGPProofs,
|
|
795
|
-
|
|
796
|
-
useSignetClaims,
|
|
796
|
+
useThurinIdentity,
|
|
797
797
|
verifyAttestation,
|
|
798
798
|
verifyProof
|
|
799
799
|
};
|