@thurinlabs/identity-kit 0.7.5 → 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 +44 -28
- package/dist/embed.global.js +52 -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/README.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
# @thurinlabs/identity-kit
|
|
2
2
|
|
|
3
|
-
The shared library for Thurin identity — the single source of truth for looking up and **verifying** on-chain identity claims, PGP key proofs, social proofs, and EFP social graph data. It powers both the [
|
|
3
|
+
The shared library for Thurin identity — the single source of truth for looking up and **verifying** on-chain identity claims, PGP key proofs, social proofs, and EFP social graph data. It powers both the [thurin.id](https://thurin.id) explorer and the embeddable `ThurinCard`, so a "verified" result means the same thing everywhere.
|
|
4
4
|
|
|
5
5
|
Three layers — use whichever fits:
|
|
6
6
|
|
|
7
7
|
- **Core** — framework-agnostic functions (verify proofs, parse PGP keys, fetch EFP/claims). No React required.
|
|
8
8
|
- **Hooks** — thin React wrappers around the core.
|
|
9
|
-
- **
|
|
9
|
+
- **ThurinCard** — a drop-in identity card UI built on the hooks.
|
|
10
10
|
|
|
11
11
|
A [Thurin Labs](https://thurin.id) project.
|
|
12
12
|
|
|
@@ -21,25 +21,25 @@ Peer dependencies: `react`, `react-dom`, `wagmi`, `viem`, `@tanstack/react-query
|
|
|
21
21
|
## Quick Start
|
|
22
22
|
|
|
23
23
|
```tsx
|
|
24
|
-
import { IdentityKitProvider,
|
|
24
|
+
import { IdentityKitProvider, ThurinCard } from '@thurinlabs/identity-kit'
|
|
25
25
|
import '@thurinlabs/identity-kit/styles'
|
|
26
26
|
|
|
27
27
|
function App() {
|
|
28
28
|
return (
|
|
29
29
|
<IdentityKitProvider>
|
|
30
|
-
<
|
|
30
|
+
<ThurinCard ens="vitalik.eth" theme="thurin" />
|
|
31
31
|
</IdentityKitProvider>
|
|
32
32
|
)
|
|
33
33
|
}
|
|
34
34
|
```
|
|
35
35
|
|
|
36
|
-
##
|
|
36
|
+
## ThurinCard
|
|
37
37
|
|
|
38
38
|
A self-contained identity card that fetches and displays all available identity data.
|
|
39
39
|
|
|
40
40
|
```tsx
|
|
41
|
-
<
|
|
42
|
-
<
|
|
41
|
+
<ThurinCard ens="vitalik.eth" theme="thurin" />
|
|
42
|
+
<ThurinCard address="0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045" theme="dark" />
|
|
43
43
|
```
|
|
44
44
|
|
|
45
45
|
**Props:**
|
|
@@ -50,7 +50,7 @@ A self-contained identity card that fetches and displays all available identity
|
|
|
50
50
|
| `address` | `string` | — | ETH address to look up |
|
|
51
51
|
| `theme` | `'thurin' \| 'dark' \| 'light'` | `'thurin'` | Visual theme |
|
|
52
52
|
|
|
53
|
-
**Displays:** ENS avatar, name, address,
|
|
53
|
+
**Displays:** ENS avatar, name, address, on-chain attestation count, verified proof count, EFP follower count, proof provider badges, and a link to the full [thurin.id](https://thurin.id) profile.
|
|
54
54
|
|
|
55
55
|
## Provider
|
|
56
56
|
|
|
@@ -59,16 +59,16 @@ Wrap your app (or just the part using identity-kit) in `IdentityKitProvider`. If
|
|
|
59
59
|
```tsx
|
|
60
60
|
// Zero config — uses public RPC, no Farcaster verification
|
|
61
61
|
<IdentityKitProvider>
|
|
62
|
-
<
|
|
62
|
+
<ThurinCard ens="vitalik.eth" />
|
|
63
63
|
</IdentityKitProvider>
|
|
64
64
|
|
|
65
65
|
// With options
|
|
66
66
|
<IdentityKitProvider
|
|
67
67
|
rpcUrl="https://eth-mainnet.g.alchemy.com/v2/YOUR_KEY"
|
|
68
68
|
neynarApiKey="YOUR_NEYNAR_KEY"
|
|
69
|
-
|
|
69
|
+
baseUrl="https://thurin.id"
|
|
70
70
|
>
|
|
71
|
-
<
|
|
71
|
+
<ThurinCard ens="vitalik.eth" />
|
|
72
72
|
</IdentityKitProvider>
|
|
73
73
|
```
|
|
74
74
|
|
|
@@ -76,31 +76,31 @@ Wrap your app (or just the part using identity-kit) in `IdentityKitProvider`. If
|
|
|
76
76
|
|------|------|---------|-------------|
|
|
77
77
|
| `rpcUrl` | `string` | publicnode | Ethereum RPC endpoint |
|
|
78
78
|
| `neynarApiKey` | `string` | — | Neynar API key for Farcaster proof verification |
|
|
79
|
-
| `
|
|
79
|
+
| `baseUrl` | `string` | `https://thurin.id` | Base URL for "View on Thurin" links |
|
|
80
80
|
|
|
81
81
|
## Hooks
|
|
82
82
|
|
|
83
|
-
For custom UI, use the hooks directly instead of `
|
|
83
|
+
For custom UI, use the hooks directly instead of `ThurinCard`.
|
|
84
84
|
|
|
85
|
-
###
|
|
85
|
+
### useThurinIdentity
|
|
86
86
|
|
|
87
|
-
Combined identity data — ENS,
|
|
87
|
+
Combined identity data — ENS, on-chain attestations, PGP proofs, and EFP social graph.
|
|
88
88
|
|
|
89
89
|
```tsx
|
|
90
|
-
const identity =
|
|
90
|
+
const identity = useThurinIdentity('vitalik.eth')
|
|
91
91
|
// or
|
|
92
|
-
const identity =
|
|
92
|
+
const identity = useThurinIdentity('0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045')
|
|
93
93
|
```
|
|
94
94
|
|
|
95
|
-
Returns: `
|
|
95
|
+
Returns: `ThurinIdentity` with `address`, `ensName`, `ensAvatar`, `claims`, `totalClaims`, `activeClaims`, `currentFingerprint`, `pgpKeyInfo`, `proofs`, `efp`, `isLoading`, `error`.
|
|
96
96
|
|
|
97
|
-
###
|
|
97
|
+
### useAttestations
|
|
98
98
|
|
|
99
99
|
On-chain attestation data from the PGPRegistry contract.
|
|
100
100
|
|
|
101
101
|
```tsx
|
|
102
102
|
const { claims, totalClaims, activeClaims, currentFingerprint, isLoading } =
|
|
103
|
-
|
|
103
|
+
useAttestations('0xd8dA...')
|
|
104
104
|
```
|
|
105
105
|
|
|
106
106
|
### useEFPGraph
|
|
@@ -123,7 +123,7 @@ const { keyInfo, proofs, isLoading } = usePGPProofs('03E53D807CE38C...')
|
|
|
123
123
|
|
|
124
124
|
## Core utilities (no React)
|
|
125
125
|
|
|
126
|
-
The verification and data logic is exported as plain functions — no React, no provider. This is the layer the
|
|
126
|
+
The verification and data logic is exported as plain functions — no React, no provider. This is the layer the thurin.id explorer and the hooks both build on; use it directly when you need the validated data behind your own UI.
|
|
127
127
|
|
|
128
128
|
### Proofs
|
|
129
129
|
|
|
@@ -168,13 +168,13 @@ const graph = await fetchEFPGraph(address)
|
|
|
168
168
|
import { REGISTRY_ADDRESS, REGISTRY_ABI, CONTRACT_DEPLOY_BLOCK } from '@thurinlabs/identity-kit'
|
|
169
169
|
```
|
|
170
170
|
|
|
171
|
-
Note `REGISTRY_ABI` here is read-only (events + `attestationCount` + `getAttestation`). Apps that write claims (the
|
|
171
|
+
Note `REGISTRY_ABI` here is read-only (events + `attestationCount` + `getAttestation`). Apps that write claims (the attestation flow at thurin.id/attest) need their own ABI with the `attest`/`revoke` functions.
|
|
172
172
|
|
|
173
173
|
## Themes
|
|
174
174
|
|
|
175
|
-
Three built-in themes: `thurin`, `dark`, `light`. All styles are scoped under `[data-
|
|
175
|
+
Three built-in themes: `thurin`, `dark`, `light`. All styles are scoped under `[data-thurin-theme]` with `thurin-` prefixed class names to avoid conflicts with your app's styles.
|
|
176
176
|
|
|
177
|
-
Import styles when using `
|
|
177
|
+
Import styles when using `ThurinCard`:
|
|
178
178
|
|
|
179
179
|
```tsx
|
|
180
180
|
import '@thurinlabs/identity-kit/styles'
|
|
@@ -188,7 +188,7 @@ For static sites, Jekyll blogs, WordPress, or any HTML page — use the standalo
|
|
|
188
188
|
|
|
189
189
|
```html
|
|
190
190
|
<div
|
|
191
|
-
data-
|
|
191
|
+
data-thurin-card="bendoubleu.eth"
|
|
192
192
|
data-theme="thurin"
|
|
193
193
|
data-rpc-url="https://eth-mainnet.g.alchemy.com/v2/YOUR_KEY"
|
|
194
194
|
></div>
|
|
@@ -198,7 +198,7 @@ For static sites, Jekyll blogs, WordPress, or any HTML page — use the standalo
|
|
|
198
198
|
|
|
199
199
|
| Attribute | Description |
|
|
200
200
|
|-----------|-------------|
|
|
201
|
-
| `data-
|
|
201
|
+
| `data-thurin-card` | ENS name or ETH address to look up (required) |
|
|
202
202
|
| `data-theme` | `thurin`, `dark`, or `light` (default: `thurin`) |
|
|
203
203
|
| `data-rpc-url` | An Ethereum RPC that supports `eth_getLogs` — required to verify on-chain claims. The card reads the chain directly, so use your own node or any provider. (Public fallback RPCs throttle `getLogs`.) |
|
|
204
204
|
| `data-neynar-key` | Optional. A Neynar API key, only to verify Farcaster proofs. Without it, Farcaster shows as unverified. |
|
|
@@ -215,6 +215,22 @@ The card talks directly to Ethereum, keys.openpgp.org, and each proof platform
|
|
|
215
215
|
| Codeberg | Repository description |
|
|
216
216
|
| Mastodon | Profile metadata |
|
|
217
217
|
|
|
218
|
+
## Migrating from 0.7.x
|
|
219
|
+
|
|
220
|
+
0.8.0 collapses the Scry / Signet sub-brands into Thurin. Renames only — no behaviour changed, and existing on-chain attestations verify exactly as before.
|
|
221
|
+
|
|
222
|
+
| 0.7.x | 0.8.0 |
|
|
223
|
+
|-------|-------|
|
|
224
|
+
| `ScryCard` / `ScryCardProps` | `ThurinCard` / `ThurinCardProps` |
|
|
225
|
+
| `useScryIdentity` | `useThurinIdentity` |
|
|
226
|
+
| `useSignetClaims` | `useAttestations` |
|
|
227
|
+
| `ScryIdentity` (type) | `ThurinIdentity` |
|
|
228
|
+
| `SignetClaim` (type) | `Attestation` |
|
|
229
|
+
| `scryBaseUrl` (provider prop) | `baseUrl` |
|
|
230
|
+
| `data-scry-card` (embed) | `data-thurin-card` |
|
|
231
|
+
| `[data-scry-theme]`, `.scry-*`, `--scry-*` | `[data-thurin-theme]`, `.thurin-*`, `--thurin-*` |
|
|
232
|
+
| `ScryEmbed` (IIFE global) | `ThurinEmbed` |
|
|
233
|
+
|
|
218
234
|
## Development
|
|
219
235
|
|
|
220
236
|
```bash
|
|
@@ -225,8 +241,8 @@ npm test
|
|
|
225
241
|
|
|
226
242
|
## Links
|
|
227
243
|
|
|
228
|
-
- [
|
|
229
|
-
- [
|
|
244
|
+
- [Thurin](https://thurin.id) — Identity explorer
|
|
245
|
+
- [Attest](https://thurin.id/attest) — Create identity claims
|
|
230
246
|
- [Documentation](https://docs.thurin.id)
|
|
231
247
|
- [GitHub](https://github.com/thurinlabs/identity-kit)
|
|
232
248
|
- [Codeberg](https://codeberg.org/thurinlabs/identity-kit)
|
package/dist/embed.global.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var
|
|
2
|
+
var ThurinEmbed = (() => {
|
|
3
3
|
var __create = Object.create;
|
|
4
4
|
var __defProp = Object.defineProperty;
|
|
5
5
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -38442,7 +38442,7 @@ ${prettyStateOverride(stateOverride)}`;
|
|
|
38442
38442
|
// src/context.ts
|
|
38443
38443
|
var import_react6 = __toESM(require_react(), 1);
|
|
38444
38444
|
var defaultConfig = {
|
|
38445
|
-
|
|
38445
|
+
baseUrl: "https://thurin.id"
|
|
38446
38446
|
};
|
|
38447
38447
|
var IdentityKitContext = (0, import_react6.createContext)(defaultConfig);
|
|
38448
38448
|
function useIdentityKitConfig() {
|
|
@@ -38484,11 +38484,11 @@ ${prettyStateOverride(stateOverride)}`;
|
|
|
38484
38484
|
children,
|
|
38485
38485
|
rpcUrl,
|
|
38486
38486
|
neynarApiKey,
|
|
38487
|
-
|
|
38487
|
+
baseUrl = "https://thurin.id"
|
|
38488
38488
|
}) {
|
|
38489
38489
|
const config = (0, import_react7.useMemo)(
|
|
38490
|
-
() => ({ rpcUrl, neynarApiKey,
|
|
38491
|
-
[rpcUrl, neynarApiKey,
|
|
38490
|
+
() => ({ rpcUrl, neynarApiKey, baseUrl }),
|
|
38491
|
+
[rpcUrl, neynarApiKey, baseUrl]
|
|
38492
38492
|
);
|
|
38493
38493
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(IdentityKitContext.Provider, { value: config, children: /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(WagmiDetector, { rpcUrl, children }) });
|
|
38494
38494
|
}
|
|
@@ -39442,8 +39442,8 @@ ${prettyStateOverride(stateOverride)}`;
|
|
|
39442
39442
|
}
|
|
39443
39443
|
}
|
|
39444
39444
|
|
|
39445
|
-
// src/hooks/
|
|
39446
|
-
function
|
|
39445
|
+
// src/hooks/useAttestations.ts
|
|
39446
|
+
function useAttestations(address) {
|
|
39447
39447
|
const config = useIdentityKitConfig();
|
|
39448
39448
|
const { data: count, isLoading: countLoading } = useReadContract({
|
|
39449
39449
|
address: REGISTRY_ADDRESS,
|
|
@@ -39466,7 +39466,7 @@ ${prettyStateOverride(stateOverride)}`;
|
|
|
39466
39466
|
query: { enabled: contracts.length > 0 }
|
|
39467
39467
|
});
|
|
39468
39468
|
const { data: eventData } = useQuery({
|
|
39469
|
-
queryKey: ["
|
|
39469
|
+
queryKey: ["attestation-logs", address],
|
|
39470
39470
|
queryFn: async () => {
|
|
39471
39471
|
if (!address) return [];
|
|
39472
39472
|
const client = createPublicClient({
|
|
@@ -39488,7 +39488,7 @@ ${prettyStateOverride(stateOverride)}`;
|
|
|
39488
39488
|
staleTime: 3e5
|
|
39489
39489
|
});
|
|
39490
39490
|
const { data: claims, isLoading: verifyLoading } = useQuery({
|
|
39491
|
-
queryKey: ["
|
|
39491
|
+
queryKey: ["attestations", address, attestationCount, !!eventData],
|
|
39492
39492
|
queryFn: async () => {
|
|
39493
39493
|
if (!attestations || !address) return [];
|
|
39494
39494
|
const results = [];
|
|
@@ -39845,7 +39845,7 @@ ${prettyStateOverride(stateOverride)}`;
|
|
|
39845
39845
|
};
|
|
39846
39846
|
}
|
|
39847
39847
|
|
|
39848
|
-
// src/hooks/
|
|
39848
|
+
// src/hooks/useThurinIdentity.ts
|
|
39849
39849
|
function isAddress2(value) {
|
|
39850
39850
|
return /^0x[0-9a-fA-F]{40}$/.test(value);
|
|
39851
39851
|
}
|
|
@@ -39856,7 +39856,7 @@ ${prettyStateOverride(stateOverride)}`;
|
|
|
39856
39856
|
return void 0;
|
|
39857
39857
|
}
|
|
39858
39858
|
}
|
|
39859
|
-
function
|
|
39859
|
+
function useThurinIdentity(ensOrAddress) {
|
|
39860
39860
|
const isAddr = ensOrAddress ? isAddress2(ensOrAddress) : false;
|
|
39861
39861
|
const ensInput = ensOrAddress && !isAddr ? safeNormalize(ensOrAddress) : void 0;
|
|
39862
39862
|
const { data: resolvedAddress } = useEnsAddress({
|
|
@@ -39882,7 +39882,7 @@ ${prettyStateOverride(stateOverride)}`;
|
|
|
39882
39882
|
activeClaims,
|
|
39883
39883
|
currentFingerprint,
|
|
39884
39884
|
isLoading: claimsLoading
|
|
39885
|
-
} =
|
|
39885
|
+
} = useAttestations(address);
|
|
39886
39886
|
const {
|
|
39887
39887
|
keyInfo: pgpKeyInfo,
|
|
39888
39888
|
proofs,
|
|
@@ -39905,101 +39905,101 @@ ${prettyStateOverride(stateOverride)}`;
|
|
|
39905
39905
|
};
|
|
39906
39906
|
}
|
|
39907
39907
|
|
|
39908
|
-
// src/components/
|
|
39908
|
+
// src/components/ThurinCard/ThurinCard.tsx
|
|
39909
39909
|
var import_jsx_runtime4 = __toESM(require_jsx_runtime(), 1);
|
|
39910
39910
|
function ThurinLogo() {
|
|
39911
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("svg", { className: "
|
|
39912
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("circle", { cx: "50", cy: "50", r: "50", fill: "var(--
|
|
39911
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("svg", { className: "thurin-card-avatar-placeholder", viewBox: "0 0 100 100", xmlns: "http://www.w3.org/2000/svg", children: [
|
|
39912
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("circle", { cx: "50", cy: "50", r: "50", fill: "var(--thurin-surface-deep)" }),
|
|
39913
39913
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M25 80 Q25 25 50 25 Q75 25 75 50", fill: "none", stroke: "#7c9a3e", strokeWidth: "4", strokeLinecap: "round" }),
|
|
39914
39914
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M33 75 Q33 35 50 35 Q67 35 67 52", fill: "none", stroke: "#7c9a3e", strokeWidth: "4", strokeLinecap: "round" }),
|
|
39915
39915
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M41 70 Q41 45 50 45 Q59 45 59 55", fill: "none", stroke: "#c9a227", strokeWidth: "4", strokeLinecap: "round" }),
|
|
39916
39916
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("path", { d: "M50 65 L50 53", fill: "none", stroke: "#c9a227", strokeWidth: "4", strokeLinecap: "round" })
|
|
39917
39917
|
] });
|
|
39918
39918
|
}
|
|
39919
|
-
function
|
|
39919
|
+
function ThurinCard({ ens, address, theme = "thurin" }) {
|
|
39920
39920
|
const input = ens || address;
|
|
39921
|
-
const identity =
|
|
39921
|
+
const identity = useThurinIdentity(input);
|
|
39922
39922
|
const config = useIdentityKitConfig();
|
|
39923
|
-
const
|
|
39923
|
+
const profileUrl = identity.address ? `${config.baseUrl}/eth/${identity.address}` : ens ? `${config.baseUrl}/ens/${ens}` : null;
|
|
39924
39924
|
if (identity.isLoading) {
|
|
39925
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "
|
|
39925
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "thurin-card", "data-thurin-theme": theme, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "thurin-card-loading", children: "Loading identity..." }) });
|
|
39926
39926
|
}
|
|
39927
39927
|
const displayAddress = identity.address || null;
|
|
39928
39928
|
const verifiedProofs = identity.proofs.filter((p2) => p2.status === "verified").length;
|
|
39929
39929
|
const hasVerifiedPgp = identity.claims.some((c2) => c2.verification?.verified && !c2.revoked);
|
|
39930
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "
|
|
39931
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("a", { className: "
|
|
39930
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "thurin-card", "data-thurin-theme": theme, children: [
|
|
39931
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("a", { className: "thurin-card-header", href: profileUrl || void 0, target: "_blank", rel: "noopener noreferrer", children: [
|
|
39932
39932
|
identity.ensAvatar ? /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
39933
39933
|
"img",
|
|
39934
39934
|
{
|
|
39935
|
-
className: "
|
|
39935
|
+
className: "thurin-card-avatar",
|
|
39936
39936
|
src: identity.ensAvatar,
|
|
39937
39937
|
alt: identity.ensName || ""
|
|
39938
39938
|
}
|
|
39939
39939
|
) : /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(ThurinLogo, {}),
|
|
39940
39940
|
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { children: [
|
|
39941
|
-
identity.ensName && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "
|
|
39942
|
-
displayAddress && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "
|
|
39941
|
+
identity.ensName && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "thurin-card-name", children: identity.ensName }),
|
|
39942
|
+
displayAddress && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("div", { className: "thurin-card-address", children: displayAddress })
|
|
39943
39943
|
] })
|
|
39944
39944
|
] }),
|
|
39945
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "
|
|
39946
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "
|
|
39947
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "
|
|
39948
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "
|
|
39945
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "thurin-card-stats", children: [
|
|
39946
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "thurin-card-stat", children: [
|
|
39947
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "thurin-card-stat-value", children: identity.activeClaims }),
|
|
39948
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "thurin-card-stat-label", children: "Attestations" })
|
|
39949
39949
|
] }),
|
|
39950
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "
|
|
39951
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "
|
|
39952
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "
|
|
39950
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "thurin-card-stat", children: [
|
|
39951
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "thurin-card-stat-value", children: verifiedProofs }),
|
|
39952
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "thurin-card-stat-label", children: "Proofs" })
|
|
39953
39953
|
] }),
|
|
39954
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "
|
|
39955
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "
|
|
39956
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "
|
|
39954
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "thurin-card-stat", children: [
|
|
39955
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "thurin-card-stat-value", children: identity.efp?.followers ?? 0 }),
|
|
39956
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "thurin-card-stat-label", children: "Followers" })
|
|
39957
39957
|
] })
|
|
39958
39958
|
] }),
|
|
39959
|
-
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "
|
|
39960
|
-
hasVerifiedPgp && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "
|
|
39961
|
-
identity.efp?.hasEfp && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "
|
|
39959
|
+
/* @__PURE__ */ (0, import_jsx_runtime4.jsxs)("div", { className: "thurin-card-badges", children: [
|
|
39960
|
+
hasVerifiedPgp && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "thurin-card-badge thurin-card-badge--verified", children: "PGP Verified" }),
|
|
39961
|
+
identity.efp?.hasEfp && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)("span", { className: "thurin-card-badge thurin-card-badge--verified", children: "EFP" }),
|
|
39962
39962
|
identity.proofs.map((p2, i2) => /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
39963
39963
|
"span",
|
|
39964
39964
|
{
|
|
39965
|
-
className: `
|
|
39965
|
+
className: `thurin-card-badge thurin-card-badge--${p2.status === "verified" ? "verified" : "unverified"}`,
|
|
39966
39966
|
children: p2.label
|
|
39967
39967
|
},
|
|
39968
39968
|
i2
|
|
39969
39969
|
))
|
|
39970
39970
|
] }),
|
|
39971
|
-
|
|
39971
|
+
profileUrl && /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(
|
|
39972
39972
|
"a",
|
|
39973
39973
|
{
|
|
39974
|
-
className: "
|
|
39975
|
-
href:
|
|
39974
|
+
className: "thurin-card-link",
|
|
39975
|
+
href: profileUrl,
|
|
39976
39976
|
target: "_blank",
|
|
39977
39977
|
rel: "noopener noreferrer",
|
|
39978
|
-
children: "View on
|
|
39978
|
+
children: "View on Thurin"
|
|
39979
39979
|
}
|
|
39980
39980
|
)
|
|
39981
39981
|
] });
|
|
39982
39982
|
}
|
|
39983
39983
|
|
|
39984
39984
|
// src/themes/index.css?raw
|
|
39985
|
-
var themes_default = '[data-
|
|
39985
|
+
var themes_default = '[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';
|
|
39986
39986
|
|
|
39987
|
-
// src/components/
|
|
39988
|
-
var
|
|
39987
|
+
// src/components/ThurinCard/ThurinCard.css?raw
|
|
39988
|
+
var ThurinCard_default = ".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";
|
|
39989
39989
|
|
|
39990
39990
|
// src/embed.tsx
|
|
39991
39991
|
var import_jsx_runtime5 = __toESM(require_jsx_runtime(), 1);
|
|
39992
|
-
var EMBED_CSS = themes_default + "\n" +
|
|
39992
|
+
var EMBED_CSS = themes_default + "\n" + ThurinCard_default;
|
|
39993
39993
|
function isAddress3(value) {
|
|
39994
39994
|
return /^0x[0-9a-fA-F]{40}$/.test(value);
|
|
39995
39995
|
}
|
|
39996
39996
|
function renderCards() {
|
|
39997
|
-
const elements = document.querySelectorAll("[data-
|
|
39997
|
+
const elements = document.querySelectorAll("[data-thurin-card]");
|
|
39998
39998
|
if (elements.length === 0) return;
|
|
39999
39999
|
elements.forEach((el2) => {
|
|
40000
|
-
if (el2.dataset.
|
|
40001
|
-
el2.dataset.
|
|
40002
|
-
const value = el2.dataset.
|
|
40000
|
+
if (el2.dataset.thurinRendered) return;
|
|
40001
|
+
el2.dataset.thurinRendered = "true";
|
|
40002
|
+
const value = el2.dataset.thurinCard;
|
|
40003
40003
|
const theme = el2.dataset.theme || "thurin";
|
|
40004
40004
|
const rpcUrl = el2.dataset.rpcUrl;
|
|
40005
40005
|
const neynarApiKey = el2.dataset.neynarKey;
|
|
@@ -40012,7 +40012,7 @@ ${prettyStateOverride(stateOverride)}`;
|
|
|
40012
40012
|
shadow.appendChild(container);
|
|
40013
40013
|
const root = (0, import_client.createRoot)(container);
|
|
40014
40014
|
root.render(
|
|
40015
|
-
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(IdentityKitProvider, { rpcUrl, neynarApiKey, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(
|
|
40015
|
+
/* @__PURE__ */ (0, import_jsx_runtime5.jsx)(IdentityKitProvider, { rpcUrl, neynarApiKey, children: /* @__PURE__ */ (0, import_jsx_runtime5.jsx)(ThurinCard, { ...props, theme }) })
|
|
40016
40016
|
);
|
|
40017
40017
|
});
|
|
40018
40018
|
}
|
|
@@ -40025,7 +40025,7 @@ ${prettyStateOverride(stateOverride)}`;
|
|
|
40025
40025
|
for (const mutation of mutations) {
|
|
40026
40026
|
for (const node of mutation.addedNodes) {
|
|
40027
40027
|
if (node instanceof HTMLElement) {
|
|
40028
|
-
if (node.dataset.
|
|
40028
|
+
if (node.dataset.thurinCard || node.querySelector("[data-thurin-card]")) {
|
|
40029
40029
|
renderCards();
|
|
40030
40030
|
return;
|
|
40031
40031
|
}
|