@thurinlabs/identity-kit 1.0.3 → 1.0.4
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/embed.global.js +19 -16
- package/dist/embed.global.js.map +1 -1
- package/dist/index.cjs +19 -16
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +6 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +19 -16
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1599,25 +1599,28 @@ function useAttestations(address) {
|
|
|
1599
1599
|
var EFP_API = "https://api.ethfollow.xyz/api/v1";
|
|
1600
1600
|
async function fetchEFPGraph(address) {
|
|
1601
1601
|
try {
|
|
1602
|
-
const listsResp = await
|
|
1603
|
-
if (!listsResp.ok) return null;
|
|
1604
|
-
const listsData = await listsResp.json();
|
|
1605
|
-
const listId = listsData.primary_list;
|
|
1606
|
-
if (!listId) return null;
|
|
1607
|
-
const [followingResp, statsResp, top8Resp] = await Promise.all([
|
|
1608
|
-
fetch(`${EFP_API}/lists/${listId}/following?limit=100`),
|
|
1602
|
+
const [statsResp, listsResp] = await Promise.all([
|
|
1609
1603
|
fetch(`${EFP_API}/users/${address}/stats`),
|
|
1610
|
-
fetch(`${EFP_API}/
|
|
1604
|
+
fetch(`${EFP_API}/users/${address}/lists`)
|
|
1611
1605
|
]);
|
|
1612
|
-
|
|
1606
|
+
if (!statsResp.ok && !listsResp.ok) return null;
|
|
1613
1607
|
const statsData = statsResp.ok ? await statsResp.json() : {};
|
|
1614
|
-
const
|
|
1615
|
-
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1608
|
+
const listsData = listsResp.ok ? await listsResp.json() : {};
|
|
1609
|
+
const followers = parseInt(statsData.followers_count) || 0;
|
|
1610
|
+
const listId = listsData.primary_list;
|
|
1611
|
+
let following = 0;
|
|
1612
|
+
let top8 = [];
|
|
1613
|
+
if (listId) {
|
|
1614
|
+
const [followingResp, top8Resp] = await Promise.all([
|
|
1615
|
+
fetch(`${EFP_API}/lists/${listId}/following?limit=100`),
|
|
1616
|
+
fetch(`${EFP_API}/lists/${listId}/following?limit=8&tags=top8`)
|
|
1617
|
+
]);
|
|
1618
|
+
const followingData = followingResp.ok ? await followingResp.json() : { following: [] };
|
|
1619
|
+
const top8Data = top8Resp.ok ? await top8Resp.json() : { following: [] };
|
|
1620
|
+
following = (followingData.following || []).length;
|
|
1621
|
+
top8 = (top8Data.following || []).map((f) => f.data);
|
|
1622
|
+
}
|
|
1623
|
+
return { followers, following, top8, hasEfp: !!listId || followers > 0 };
|
|
1621
1624
|
} catch (e10) {
|
|
1622
1625
|
return null;
|
|
1623
1626
|
}
|