web3bio-profile-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.
- package/README.md +256 -0
- package/dist/hooks/index.d.ts +6 -0
- package/dist/hooks/useBaseQuery.d.ts +6 -0
- package/dist/hooks/useDomain.d.ts +16 -0
- package/dist/hooks/useNS.d.ts +16 -0
- package/dist/hooks/useProfile.d.ts +16 -0
- package/dist/hooks/useUniversalNS.d.ts +16 -0
- package/dist/hooks/useUniversalProfile.d.ts +16 -0
- package/dist/index.d.ts +216 -0
- package/dist/index.esm.js +344 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.js +354 -0
- package/dist/index.js.map +1 -0
- package/dist/setupTests.d.ts +1 -0
- package/dist/utils/constants.d.ts +36 -0
- package/dist/utils/helpers.d.ts +23 -0
- package/dist/utils/types.d.ts +97 -0
- package/package.json +56 -0
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
import { useState, useEffect } from 'react';
|
|
2
|
+
|
|
3
|
+
const API_ENDPOINT = "https://api.web3.bio";
|
|
4
|
+
var ErrorMessages;
|
|
5
|
+
(function (ErrorMessages) {
|
|
6
|
+
ErrorMessages["NOT_FOUND"] = "Not Found";
|
|
7
|
+
ErrorMessages["INVALID_RESOLVER"] = "Invalid Resolver Address";
|
|
8
|
+
ErrorMessages["INVALID_RESOLVED"] = "Invalid Resolved Address";
|
|
9
|
+
ErrorMessages["NOT_EXIST"] = "Does Not Exist";
|
|
10
|
+
ErrorMessages["INVALID_IDENTITY"] = "Invalid Identity or Domain";
|
|
11
|
+
ErrorMessages["INVALID_ADDRESS"] = "Invalid Address";
|
|
12
|
+
ErrorMessages["UNKNOWN_ERROR"] = "Unknown Error Occurred";
|
|
13
|
+
ErrorMessages["NETWORK_ERROR"] = "Network Error";
|
|
14
|
+
})(ErrorMessages || (ErrorMessages = {}));
|
|
15
|
+
var QueryEndpoint;
|
|
16
|
+
(function (QueryEndpoint) {
|
|
17
|
+
QueryEndpoint["NS"] = "ns";
|
|
18
|
+
QueryEndpoint["PROFILE"] = "profile";
|
|
19
|
+
QueryEndpoint["DOMAIN"] = "domain";
|
|
20
|
+
})(QueryEndpoint || (QueryEndpoint = {}));
|
|
21
|
+
// Regular expressions for identity detection
|
|
22
|
+
const REGEX = {
|
|
23
|
+
ENS: /^.+\.(eth|xyz|bio|app|luxe|kred|art|ceo|club|box)$/i,
|
|
24
|
+
BASENAMES: /^.+\.base(\.eth)?$/i,
|
|
25
|
+
LINEA: /^.+\.linea(\.eth)?$/i,
|
|
26
|
+
FARCASTER: /^(?:[A-Za-z0-9_-]{1,61}(?:(?:\.eth)?(?:\.farcaster|\.fcast\.id|\.farcaster\.eth)?)?|farcaster,#\d+)$/i,
|
|
27
|
+
LENS: /^(?:.+\.lens)$/i,
|
|
28
|
+
CLUSTER: /^[\w-]+\/[\w-]+$/,
|
|
29
|
+
SPACE_ID: /^.+\.(bnb|arb)$/i,
|
|
30
|
+
GENOME: /^.+\.gno$/i,
|
|
31
|
+
UNSTOPPABLE_DOMAINS: /^.+\.(crypto|888|nft|blockchain|bitcoin|dao|x|klever|hi|zil|kresus|polygon|wallet|binanceus|anime|go|manga|eth)$/i,
|
|
32
|
+
CROSSBELL: /^.+\.csb$/i,
|
|
33
|
+
DOTBIT: /^.+\.bit$/i,
|
|
34
|
+
SNS: /^.+\.sol$/i,
|
|
35
|
+
ETH_ADDRESS: /^0x[a-fA-F0-9]{40}$/i,
|
|
36
|
+
BTC_ADDRESS: /\b([13][a-km-zA-HJ-NP-Z1-9]{25,34}|bc1[qp][a-z0-9]{11,71})\b/,
|
|
37
|
+
SOLANA_ADDRESS: /^[1-9A-HJ-NP-Za-km-z]{32,44}$/,
|
|
38
|
+
LOWERCASE_EXEMPT: /\b(?:(?:[13][a-km-zA-HJ-NP-Z1-9]{25,34}|bc1[qp][a-z0-9]{11,71})|(?:[1-9A-HJ-NP-Za-km-z]{32,44}))\b/,
|
|
39
|
+
TWITTER: /^[A-Za-z0-9_]{1,15}(?:\.twitter)?$/i,
|
|
40
|
+
NEXT_ID: /^0x[a-f0-9]{66}(?:\.nextid)?$/i,
|
|
41
|
+
};
|
|
42
|
+
|
|
43
|
+
var PlatformType;
|
|
44
|
+
(function (PlatformType) {
|
|
45
|
+
PlatformType["ens"] = "ens";
|
|
46
|
+
PlatformType["farcaster"] = "farcaster";
|
|
47
|
+
PlatformType["lens"] = "lens";
|
|
48
|
+
PlatformType["ethereum"] = "ethereum";
|
|
49
|
+
PlatformType["twitter"] = "twitter";
|
|
50
|
+
PlatformType["github"] = "github";
|
|
51
|
+
PlatformType["bitcoin"] = "bitcoin";
|
|
52
|
+
PlatformType["unstoppableDomains"] = "unstoppabledomains";
|
|
53
|
+
PlatformType["basenames"] = "basenames";
|
|
54
|
+
PlatformType["linea"] = "linea";
|
|
55
|
+
PlatformType["space_id"] = "space_id";
|
|
56
|
+
PlatformType["solana"] = "solana";
|
|
57
|
+
PlatformType["sns"] = "sns";
|
|
58
|
+
PlatformType["nextid"] = "nextid";
|
|
59
|
+
PlatformType["dotbit"] = "dotbit";
|
|
60
|
+
})(PlatformType || (PlatformType = {}));
|
|
61
|
+
var SourceType;
|
|
62
|
+
(function (SourceType) {
|
|
63
|
+
SourceType["ethereum"] = "ethereum";
|
|
64
|
+
SourceType["ens"] = "ens";
|
|
65
|
+
SourceType["twitter"] = "twitter";
|
|
66
|
+
SourceType["nextid"] = "nextid";
|
|
67
|
+
SourceType["dotbit"] = "dotbit";
|
|
68
|
+
SourceType["unstoppabledomains"] = "unstoppabledomains";
|
|
69
|
+
SourceType["lens"] = "lens";
|
|
70
|
+
SourceType["farcaster"] = "farcaster";
|
|
71
|
+
SourceType["space_id"] = "space_id";
|
|
72
|
+
SourceType["solana"] = "solana";
|
|
73
|
+
SourceType["sns"] = "sns";
|
|
74
|
+
})(SourceType || (SourceType = {}));
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* Resolves an identity string to a platform and identifier
|
|
78
|
+
* @param input The identity to resolve
|
|
79
|
+
* @returns A formatted identity string or null if invalid
|
|
80
|
+
*/
|
|
81
|
+
const resolveIdentity = (input) => {
|
|
82
|
+
if (!input)
|
|
83
|
+
return null;
|
|
84
|
+
const parts = input.split(",");
|
|
85
|
+
let platform;
|
|
86
|
+
let identity;
|
|
87
|
+
if (parts.length === 2) {
|
|
88
|
+
// Format is already "platform,identity"
|
|
89
|
+
platform = parts[0];
|
|
90
|
+
identity = prettify(parts[1]);
|
|
91
|
+
}
|
|
92
|
+
else if (parts.length === 1) {
|
|
93
|
+
// Auto-detect platform from the identity string
|
|
94
|
+
platform = detectPlatform(input);
|
|
95
|
+
identity = prettify(input);
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
return null;
|
|
99
|
+
}
|
|
100
|
+
if (!isSupportedPlatform(platform) || !identity)
|
|
101
|
+
return null;
|
|
102
|
+
// Normalize case except for case-sensitive identities
|
|
103
|
+
const normalizedIdentity = REGEX.LOWERCASE_EXEMPT.test(identity)
|
|
104
|
+
? identity
|
|
105
|
+
: identity.toLowerCase();
|
|
106
|
+
return `${platform},${normalizedIdentity}`;
|
|
107
|
+
};
|
|
108
|
+
/**
|
|
109
|
+
* Clean up and standardize identity format
|
|
110
|
+
*/
|
|
111
|
+
const prettify = (input) => {
|
|
112
|
+
if (!input)
|
|
113
|
+
return "";
|
|
114
|
+
if (input.endsWith(".twitter"))
|
|
115
|
+
return input.replace(".twitter", "");
|
|
116
|
+
if (input.endsWith(".nextid"))
|
|
117
|
+
return input.replace(".nextid", "");
|
|
118
|
+
if (input.startsWith("farcaster,#"))
|
|
119
|
+
return input.replace(/^(farcaster),/, "");
|
|
120
|
+
if (input.endsWith(".farcaster") ||
|
|
121
|
+
input.endsWith(".fcast.id") ||
|
|
122
|
+
input.endsWith(".farcaster.eth")) {
|
|
123
|
+
return input.replace(/(\.farcaster|\.fcast\.id|\.farcaster\.eth)$/, "");
|
|
124
|
+
}
|
|
125
|
+
if (input.endsWith(".base") || input.endsWith(".linea")) {
|
|
126
|
+
return input.split(".")[0] + "." + input.split(".").pop() + ".eth";
|
|
127
|
+
}
|
|
128
|
+
return input;
|
|
129
|
+
};
|
|
130
|
+
/**
|
|
131
|
+
* Check if the platform is supported for API queries
|
|
132
|
+
*/
|
|
133
|
+
const isSupportedPlatform = (platform) => {
|
|
134
|
+
if (!platform)
|
|
135
|
+
return false;
|
|
136
|
+
return Object.values(PlatformType).includes(platform);
|
|
137
|
+
};
|
|
138
|
+
/**
|
|
139
|
+
* Detect platform from identity string based on regex patterns
|
|
140
|
+
*/
|
|
141
|
+
const detectPlatform = (term) => {
|
|
142
|
+
if (term.endsWith(".farcaster.eth"))
|
|
143
|
+
return PlatformType.farcaster;
|
|
144
|
+
const platformMap = [
|
|
145
|
+
[REGEX.BASENAMES, PlatformType.basenames],
|
|
146
|
+
[REGEX.LINEA, PlatformType.linea],
|
|
147
|
+
[REGEX.ENS, PlatformType.ens],
|
|
148
|
+
[REGEX.ETH_ADDRESS, PlatformType.ethereum],
|
|
149
|
+
[REGEX.LENS, PlatformType.lens],
|
|
150
|
+
[REGEX.UNSTOPPABLE_DOMAINS, PlatformType.unstoppableDomains],
|
|
151
|
+
[REGEX.SPACE_ID, PlatformType.space_id],
|
|
152
|
+
[REGEX.DOTBIT, PlatformType.dotbit],
|
|
153
|
+
[REGEX.SNS, PlatformType.sns],
|
|
154
|
+
[REGEX.BTC_ADDRESS, PlatformType.bitcoin],
|
|
155
|
+
[REGEX.SOLANA_ADDRESS, PlatformType.solana],
|
|
156
|
+
[REGEX.FARCASTER, PlatformType.farcaster],
|
|
157
|
+
[REGEX.TWITTER, PlatformType.twitter],
|
|
158
|
+
[REGEX.NEXT_ID, PlatformType.nextid],
|
|
159
|
+
];
|
|
160
|
+
for (const [regex, platformType] of platformMap) {
|
|
161
|
+
if (regex.test(term)) {
|
|
162
|
+
return platformType;
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
// Default fallback
|
|
166
|
+
return term.includes(".") ? PlatformType.ens : PlatformType.farcaster;
|
|
167
|
+
};
|
|
168
|
+
/**
|
|
169
|
+
* Get API key from various environment sources or user provided value
|
|
170
|
+
*/
|
|
171
|
+
const getApiKey = (userProvidedKey) => {
|
|
172
|
+
return (userProvidedKey ||
|
|
173
|
+
process.env.WEB3BIO_API_KEY ||
|
|
174
|
+
process.env.REACT_APP_WEB3BIO_API_KEY ||
|
|
175
|
+
process.env.NEXT_PUBLIC_WEB3BIO_API_KEY ||
|
|
176
|
+
process.env.VITE_WEB3BIO_API_KEY);
|
|
177
|
+
};
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* Constructs the API URL based on query parameters
|
|
181
|
+
*/
|
|
182
|
+
const buildApiUrl = (identity, endpoint, universal) => {
|
|
183
|
+
// Handle batch queries (array of identities)
|
|
184
|
+
if (Array.isArray(identity)) {
|
|
185
|
+
return `${API_ENDPOINT}/${endpoint}/batch/${JSON.stringify(identity)}`;
|
|
186
|
+
}
|
|
187
|
+
// Handle single identity query
|
|
188
|
+
if (universal) {
|
|
189
|
+
return `${API_ENDPOINT}/${endpoint}/${identity}`;
|
|
190
|
+
}
|
|
191
|
+
else {
|
|
192
|
+
const resolvedId = resolveIdentity(identity);
|
|
193
|
+
if (!resolvedId)
|
|
194
|
+
return null;
|
|
195
|
+
const [platform, handle] = resolvedId.split(",");
|
|
196
|
+
return `${API_ENDPOINT}/${endpoint}/${platform}/${handle}`;
|
|
197
|
+
}
|
|
198
|
+
};
|
|
199
|
+
/**
|
|
200
|
+
* Core hook for querying Web3.bio Profile API
|
|
201
|
+
*/
|
|
202
|
+
function useBaseQuery(identity, endpoint, universal = false, options = {}) {
|
|
203
|
+
const { apiKey: userApiKey, enabled = true } = options;
|
|
204
|
+
const apiKey = getApiKey(userApiKey);
|
|
205
|
+
const [data, setData] = useState(null);
|
|
206
|
+
const [isLoading, setIsLoading] = useState(false);
|
|
207
|
+
const [error, setError] = useState(null);
|
|
208
|
+
useEffect(() => {
|
|
209
|
+
// Don't run the query if disabled or no identity
|
|
210
|
+
if (!enabled || !identity)
|
|
211
|
+
return;
|
|
212
|
+
const controller = new AbortController();
|
|
213
|
+
setIsLoading(true);
|
|
214
|
+
setError(null);
|
|
215
|
+
const fetchData = async () => {
|
|
216
|
+
try {
|
|
217
|
+
const url = buildApiUrl(identity, endpoint, universal);
|
|
218
|
+
if (!url) {
|
|
219
|
+
throw new Error(ErrorMessages.INVALID_IDENTITY);
|
|
220
|
+
}
|
|
221
|
+
const headers = apiKey ? { "x-api-key": apiKey } : {};
|
|
222
|
+
const response = await fetch(url, {
|
|
223
|
+
method: "GET",
|
|
224
|
+
headers,
|
|
225
|
+
signal: controller.signal,
|
|
226
|
+
});
|
|
227
|
+
if (!response.ok) {
|
|
228
|
+
throw new Error(`API error: ${response.status}`);
|
|
229
|
+
}
|
|
230
|
+
const responseData = await response.json();
|
|
231
|
+
if (responseData === null || responseData === void 0 ? void 0 : responseData.error) {
|
|
232
|
+
throw new Error(responseData.error);
|
|
233
|
+
}
|
|
234
|
+
setData(responseData);
|
|
235
|
+
}
|
|
236
|
+
catch (err) {
|
|
237
|
+
if (err instanceof Error && err.name === "AbortError")
|
|
238
|
+
return;
|
|
239
|
+
setError(err instanceof Error ? err : new Error(String(err)));
|
|
240
|
+
}
|
|
241
|
+
finally {
|
|
242
|
+
setIsLoading(false);
|
|
243
|
+
}
|
|
244
|
+
};
|
|
245
|
+
fetchData();
|
|
246
|
+
return () => {
|
|
247
|
+
controller.abort();
|
|
248
|
+
};
|
|
249
|
+
}, [identity, apiKey, enabled, endpoint, universal]);
|
|
250
|
+
return { data, isLoading, error };
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* Hook to query Web3.bio profile data by identity
|
|
255
|
+
*
|
|
256
|
+
* @param identity - Identity string or array of identities to query
|
|
257
|
+
* @param options - Optional configuration options
|
|
258
|
+
* @returns Object containing profile data, loading state, and any errors
|
|
259
|
+
*
|
|
260
|
+
* @example
|
|
261
|
+
* // Query by ENS name
|
|
262
|
+
* const { data, isLoading, error } = useProfile("vitalik.eth");
|
|
263
|
+
*
|
|
264
|
+
* // Query with platform specification
|
|
265
|
+
* const { data } = useProfile("farcaster,dwr");
|
|
266
|
+
*/
|
|
267
|
+
function useProfile(identity, options = {}) {
|
|
268
|
+
return useBaseQuery(identity, QueryEndpoint.PROFILE, false, options);
|
|
269
|
+
}
|
|
270
|
+
|
|
271
|
+
/**
|
|
272
|
+
* Hook to query Web3.bio name service (NS) data by identity
|
|
273
|
+
*
|
|
274
|
+
* @param identity - Identity string or array of identities to query
|
|
275
|
+
* @param options - Optional configuration options
|
|
276
|
+
* @returns Object containing NS data, loading state, and any errors
|
|
277
|
+
*
|
|
278
|
+
* @example
|
|
279
|
+
* // Query by ENS name
|
|
280
|
+
* const { data, isLoading, error } = useNS("vitalik.eth");
|
|
281
|
+
*
|
|
282
|
+
* // Query by Ethereum address
|
|
283
|
+
* const { data } = useNS("0x123...");
|
|
284
|
+
*/
|
|
285
|
+
function useNS(identity, options = {}) {
|
|
286
|
+
return useBaseQuery(identity, QueryEndpoint.NS, false, options);
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* Hook to query Web3.bio domain data by identity
|
|
291
|
+
*
|
|
292
|
+
* @param identity - Identity string or array of identities to query
|
|
293
|
+
* @param options - Optional configuration options
|
|
294
|
+
* @returns Object containing domain data, loading state, and any errors
|
|
295
|
+
*
|
|
296
|
+
* @example
|
|
297
|
+
* // Query by ENS name
|
|
298
|
+
* const { data, isLoading, error } = useDomain("vitalik.eth");
|
|
299
|
+
*
|
|
300
|
+
* // Query by domain name with platform
|
|
301
|
+
* const { data } = useDomain("ens,vitalik.eth");
|
|
302
|
+
*/
|
|
303
|
+
function useDomain(identity, options = {}) {
|
|
304
|
+
return useBaseQuery(identity, QueryEndpoint.DOMAIN, false, options);
|
|
305
|
+
}
|
|
306
|
+
|
|
307
|
+
/**
|
|
308
|
+
* Hook to query Web3.bio profile data using universal identity lookup
|
|
309
|
+
*
|
|
310
|
+
* @param identity - Identity string or array of identities to query
|
|
311
|
+
* @param options - Optional configuration options
|
|
312
|
+
* @returns Object containing profile data, loading state, and any errors
|
|
313
|
+
*
|
|
314
|
+
* @example
|
|
315
|
+
* // Query by ENS name with universal lookup
|
|
316
|
+
* const { data, isLoading, error } = useUniversalProfile("vitalik.eth");
|
|
317
|
+
*
|
|
318
|
+
* // Query by any identity type with universal lookup
|
|
319
|
+
* const { data } = useUniversalProfile("dwr.farcaster");
|
|
320
|
+
*/
|
|
321
|
+
function useUniversalProfile(identity, options = {}) {
|
|
322
|
+
return useBaseQuery(identity, QueryEndpoint.PROFILE, true, options);
|
|
323
|
+
}
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* Hook to query Web3.bio name service (NS) data using universal identity lookup
|
|
327
|
+
*
|
|
328
|
+
* @param identity - Identity string or array of identities to query
|
|
329
|
+
* @param options - Optional configuration options
|
|
330
|
+
* @returns Object containing NS data, loading state, and any errors
|
|
331
|
+
*
|
|
332
|
+
* @example
|
|
333
|
+
* // Query by ENS name with universal lookup
|
|
334
|
+
* const { data, isLoading, error } = useUniversalNS("vitalik.eth");
|
|
335
|
+
*
|
|
336
|
+
* // Query by any identity type with universal lookup
|
|
337
|
+
* const { data } = useUniversalNS("dwr.farcaster");
|
|
338
|
+
*/
|
|
339
|
+
function useUniversalNS(identity, options = {}) {
|
|
340
|
+
return useBaseQuery(identity, QueryEndpoint.NS, true, options);
|
|
341
|
+
}
|
|
342
|
+
|
|
343
|
+
export { API_ENDPOINT, ErrorMessages, PlatformType, QueryEndpoint, REGEX, SourceType, useDomain, useNS, useProfile, useUniversalNS, useUniversalProfile };
|
|
344
|
+
//# sourceMappingURL=index.esm.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.esm.js","sources":["../src/utils/constants.ts","../src/utils/types.ts","../src/utils/helpers.ts","../src/hooks/useBaseQuery.ts","../src/hooks/useProfile.ts","../src/hooks/useNS.ts","../src/hooks/useDomain.ts","../src/hooks/useUniversalProfile.ts","../src/hooks/useUniversalNS.ts"],"sourcesContent":["export const API_ENDPOINT = \"https://api.web3.bio\";\n\nexport enum ErrorMessages {\n NOT_FOUND = \"Not Found\",\n INVALID_RESOLVER = \"Invalid Resolver Address\",\n INVALID_RESOLVED = \"Invalid Resolved Address\",\n NOT_EXIST = \"Does Not Exist\",\n INVALID_IDENTITY = \"Invalid Identity or Domain\",\n INVALID_ADDRESS = \"Invalid Address\",\n UNKNOWN_ERROR = \"Unknown Error Occurred\",\n NETWORK_ERROR = \"Network Error\",\n}\n\nexport enum QueryEndpoint {\n NS = \"ns\",\n PROFILE = \"profile\",\n DOMAIN = \"domain\",\n}\n\n// Regular expressions for identity detection\nexport const REGEX = {\n ENS: /^.+\\.(eth|xyz|bio|app|luxe|kred|art|ceo|club|box)$/i,\n BASENAMES: /^.+\\.base(\\.eth)?$/i,\n LINEA: /^.+\\.linea(\\.eth)?$/i,\n FARCASTER: /^(?:[A-Za-z0-9_-]{1,61}(?:(?:\\.eth)?(?:\\.farcaster|\\.fcast\\.id|\\.farcaster\\.eth)?)?|farcaster,#\\d+)$/i,\n LENS: /^(?:.+\\.lens)$/i,\n CLUSTER: /^[\\w-]+\\/[\\w-]+$/,\n SPACE_ID: /^.+\\.(bnb|arb)$/i,\n GENOME: /^.+\\.gno$/i,\n UNSTOPPABLE_DOMAINS: /^.+\\.(crypto|888|nft|blockchain|bitcoin|dao|x|klever|hi|zil|kresus|polygon|wallet|binanceus|anime|go|manga|eth)$/i,\n CROSSBELL: /^.+\\.csb$/i,\n DOTBIT: /^.+\\.bit$/i,\n SNS: /^.+\\.sol$/i,\n ETH_ADDRESS: /^0x[a-fA-F0-9]{40}$/i,\n BTC_ADDRESS: /\\b([13][a-km-zA-HJ-NP-Z1-9]{25,34}|bc1[qp][a-z0-9]{11,71})\\b/,\n SOLANA_ADDRESS: /^[1-9A-HJ-NP-Za-km-z]{32,44}$/,\n LOWERCASE_EXEMPT: /\\b(?:(?:[13][a-km-zA-HJ-NP-Z1-9]{25,34}|bc1[qp][a-z0-9]{11,71})|(?:[1-9A-HJ-NP-Za-km-z]{32,44}))\\b/,\n TWITTER: /^[A-Za-z0-9_]{1,15}(?:\\.twitter)?$/i,\n NEXT_ID: /^0x[a-f0-9]{66}(?:\\.nextid)?$/i,\n};","export enum PlatformType {\n ens = \"ens\",\n farcaster = \"farcaster\",\n lens = \"lens\",\n ethereum = \"ethereum\",\n twitter = \"twitter\",\n github = \"github\",\n bitcoin = \"bitcoin\",\n unstoppableDomains = \"unstoppabledomains\",\n basenames = \"basenames\",\n linea = \"linea\",\n space_id = \"space_id\",\n solana = \"solana\",\n sns = \"sns\",\n nextid = \"nextid\",\n dotbit = \"dotbit\",\n}\n\nexport enum SourceType {\n ethereum = \"ethereum\",\n ens = \"ens\",\n twitter = \"twitter\",\n nextid = \"nextid\",\n dotbit = \"dotbit\",\n unstoppabledomains = \"unstoppabledomains\",\n lens = \"lens\",\n farcaster = \"farcaster\",\n space_id = \"space_id\",\n solana = \"solana\",\n sns = \"sns\",\n}\n\nexport type SocialLinksItem = {\n link: string | null;\n handle: string | null;\n sources: SourceType[];\n};\n\nexport type SocialLinks = Record<string, SocialLinksItem>;\n\nexport interface ProfileResponse {\n identity: string;\n address: string | null;\n avatar: string | null;\n description: string | null;\n platform: string;\n displayName: string | null;\n email: string | null;\n contenthash: string | null;\n header: string | null;\n location: string | null;\n createdAt: string | null;\n status: string | null;\n error?: string;\n links: SocialLinks;\n social:\n | {\n uid: number | null;\n follower: number;\n following: number;\n }\n | {};\n}\n\nexport interface NSResponse {\n identity: string;\n address: string | null;\n avatar: string | null;\n description: string | null;\n platform: string;\n displayName: string | null;\n}\n\nexport interface DomainResponse {\n identity: string;\n platform: PlatformType;\n resolvedAddress: string | null;\n ownerAddress: string | null;\n managerAddress: string | null;\n displayName: string | null;\n isPrimary: boolean;\n status: string;\n createdAt: string | null;\n updatedAt: string | null;\n expiredAt: string | null;\n contenthash: string | null;\n texts: Record<string, string>;\n addresses: Record<string, string>;\n}\n\nexport type QueryOptions = {\n /** API Key for authentication */\n apiKey?: string;\n /** Whether the query should execute */\n enabled?: boolean;\n};\n\nexport type IdentityString = string | `${PlatformType},${string}`;\nexport type Identity = IdentityString | IdentityString[];\n\nexport type QueryResult<T> = {\n data: T | null;\n isLoading: boolean;\n error: Error | null;\n};\n\n// Query-specific result types for better type safety\nexport type ProfileQueryResult = QueryResult<ProfileResponse>;\nexport type NSQueryResult = QueryResult<NSResponse>;\nexport type DomainQueryResult = QueryResult<DomainResponse>;\n","import { REGEX } from \"./constants\";\nimport { PlatformType, Identity } from \"./types\";\n\n/**\n * Resolves an identity string to a platform and identifier\n * @param input The identity to resolve\n * @returns A formatted identity string or null if invalid\n */\nexport const resolveIdentity = (input: string): string | null => {\n if (!input) return null;\n\n const parts = input.split(\",\");\n\n let platform: PlatformType;\n let identity: string;\n\n if (parts.length === 2) {\n // Format is already \"platform,identity\"\n platform = parts[0] as PlatformType;\n identity = prettify(parts[1]);\n } else if (parts.length === 1) {\n // Auto-detect platform from the identity string\n platform = detectPlatform(input);\n identity = prettify(input);\n } else {\n return null;\n }\n\n if (!isSupportedPlatform(platform) || !identity) return null;\n\n // Normalize case except for case-sensitive identities\n const normalizedIdentity = REGEX.LOWERCASE_EXEMPT.test(identity)\n ? identity\n : identity.toLowerCase();\n\n return `${platform},${normalizedIdentity}`;\n};\n\n/**\n * Clean up and standardize identity format\n */\nexport const prettify = (input: string): string => {\n if (!input) return \"\";\n if (input.endsWith(\".twitter\")) return input.replace(\".twitter\", \"\");\n if (input.endsWith(\".nextid\")) return input.replace(\".nextid\", \"\");\n if (input.startsWith(\"farcaster,#\"))\n return input.replace(/^(farcaster),/, \"\");\n if (\n input.endsWith(\".farcaster\") ||\n input.endsWith(\".fcast.id\") ||\n input.endsWith(\".farcaster.eth\")\n ) {\n return input.replace(/(\\.farcaster|\\.fcast\\.id|\\.farcaster\\.eth)$/, \"\");\n }\n if (input.endsWith(\".base\") || input.endsWith(\".linea\")) {\n return input.split(\".\")[0] + \".\" + input.split(\".\").pop() + \".eth\";\n }\n return input;\n};\n\n/**\n * Check if the platform is supported for API queries\n */\nexport const isSupportedPlatform = (\n platform?: PlatformType | null,\n): boolean => {\n if (!platform) return false;\n return Object.values(PlatformType).includes(platform as PlatformType);\n};\n\n/**\n * Detect platform from identity string based on regex patterns\n */\nexport const detectPlatform = (term: string): PlatformType => {\n if (term.endsWith(\".farcaster.eth\")) return PlatformType.farcaster;\n\n const platformMap: [RegExp, PlatformType][] = [\n [REGEX.BASENAMES, PlatformType.basenames],\n [REGEX.LINEA, PlatformType.linea],\n [REGEX.ENS, PlatformType.ens],\n [REGEX.ETH_ADDRESS, PlatformType.ethereum],\n [REGEX.LENS, PlatformType.lens],\n [REGEX.UNSTOPPABLE_DOMAINS, PlatformType.unstoppableDomains],\n [REGEX.SPACE_ID, PlatformType.space_id],\n [REGEX.DOTBIT, PlatformType.dotbit],\n [REGEX.SNS, PlatformType.sns],\n [REGEX.BTC_ADDRESS, PlatformType.bitcoin],\n [REGEX.SOLANA_ADDRESS, PlatformType.solana],\n [REGEX.FARCASTER, PlatformType.farcaster],\n [REGEX.TWITTER, PlatformType.twitter],\n [REGEX.NEXT_ID, PlatformType.nextid],\n ];\n\n for (const [regex, platformType] of platformMap) {\n if (regex.test(term)) {\n return platformType;\n }\n }\n\n // Default fallback\n return term.includes(\".\") ? PlatformType.ens : PlatformType.farcaster;\n};\n\n/**\n * Get API key from various environment sources or user provided value\n */\nexport const getApiKey = (userProvidedKey?: string): string | undefined => {\n return (\n userProvidedKey ||\n process.env.WEB3BIO_API_KEY ||\n process.env.REACT_APP_WEB3BIO_API_KEY ||\n process.env.NEXT_PUBLIC_WEB3BIO_API_KEY ||\n process.env.VITE_WEB3BIO_API_KEY\n );\n};\n","import { useState, useEffect } from \"react\";\nimport { API_ENDPOINT, ErrorMessages, QueryEndpoint } from \"../utils/constants\";\nimport { getApiKey, resolveIdentity } from \"../utils/helpers\";\nimport { Identity, QueryOptions, QueryResult } from \"../utils/types\";\n\n/**\n * Constructs the API URL based on query parameters\n */\nconst buildApiUrl = (\n identity: Identity,\n endpoint: QueryEndpoint,\n universal: boolean,\n): string | null => {\n // Handle batch queries (array of identities)\n if (Array.isArray(identity)) {\n return `${API_ENDPOINT}/${endpoint}/batch/${JSON.stringify(identity)}`;\n }\n\n // Handle single identity query\n if (universal) {\n return `${API_ENDPOINT}/${endpoint}/${identity}`;\n } else {\n const resolvedId = resolveIdentity(identity);\n if (!resolvedId) return null;\n\n const [platform, handle] = resolvedId.split(\",\");\n return `${API_ENDPOINT}/${endpoint}/${platform}/${handle}`;\n }\n};\n\n/**\n * Core hook for querying Web3.bio Profile API\n */\nexport function useBaseQuery<T>(\n identity: Identity,\n endpoint: QueryEndpoint,\n universal: boolean = false,\n options: QueryOptions = {},\n): QueryResult<T> {\n const { apiKey: userApiKey, enabled = true } = options;\n const apiKey = getApiKey(userApiKey);\n\n const [data, setData] = useState<T | null>(null);\n const [isLoading, setIsLoading] = useState<boolean>(false);\n const [error, setError] = useState<Error | null>(null);\n\n useEffect(() => {\n // Don't run the query if disabled or no identity\n if (!enabled || !identity) return;\n\n const controller = new AbortController();\n setIsLoading(true);\n setError(null);\n\n const fetchData = async () => {\n try {\n const url = buildApiUrl(identity, endpoint, universal);\n\n if (!url) {\n throw new Error(ErrorMessages.INVALID_IDENTITY);\n }\n\n const headers: HeadersInit = apiKey ? { \"x-api-key\": apiKey } : {};\n\n const response = await fetch(url, {\n method: \"GET\",\n headers,\n signal: controller.signal,\n });\n\n if (!response.ok) {\n throw new Error(`API error: ${response.status}`);\n }\n\n const responseData = await response.json();\n\n if (responseData?.error) {\n throw new Error(responseData.error);\n }\n\n setData(responseData as T);\n } catch (err) {\n if (err instanceof Error && err.name === \"AbortError\") return;\n setError(err instanceof Error ? err : new Error(String(err)));\n } finally {\n setIsLoading(false);\n }\n };\n\n fetchData();\n\n return () => {\n controller.abort();\n };\n }, [identity, apiKey, enabled, endpoint, universal]);\n\n return { data, isLoading, error };\n}\n","import { QueryEndpoint } from \"../utils/constants\";\nimport { Identity, ProfileQueryResult, ProfileResponse, QueryOptions } from \"../utils/types\";\nimport { useBaseQuery } from \"./useBaseQuery\";\n\n/**\n * Hook to query Web3.bio profile data by identity\n * \n * @param identity - Identity string or array of identities to query\n * @param options - Optional configuration options\n * @returns Object containing profile data, loading state, and any errors\n * \n * @example\n * // Query by ENS name\n * const { data, isLoading, error } = useProfile(\"vitalik.eth\");\n * \n * // Query with platform specification\n * const { data } = useProfile(\"farcaster,dwr\");\n */\nexport function useProfile(\n identity: Identity,\n options: QueryOptions = {}\n): ProfileQueryResult {\n return useBaseQuery<ProfileResponse>(identity, QueryEndpoint.PROFILE, false, options);\n}","import { QueryEndpoint } from \"../utils/constants\";\nimport { Identity, NSResponse, NSQueryResult, QueryOptions } from \"../utils/types\";\nimport { useBaseQuery } from \"./useBaseQuery\";\n\n/**\n * Hook to query Web3.bio name service (NS) data by identity\n * \n * @param identity - Identity string or array of identities to query\n * @param options - Optional configuration options\n * @returns Object containing NS data, loading state, and any errors\n * \n * @example\n * // Query by ENS name\n * const { data, isLoading, error } = useNS(\"vitalik.eth\");\n * \n * // Query by Ethereum address\n * const { data } = useNS(\"0x123...\");\n */\nexport function useNS(\n identity: Identity,\n options: QueryOptions = {}\n): NSQueryResult {\n return useBaseQuery<NSResponse>(identity, QueryEndpoint.NS, false, options);\n}","import { QueryEndpoint } from \"../utils/constants\";\nimport { DomainQueryResult, DomainResponse, Identity, QueryOptions } from \"../utils/types\";\nimport { useBaseQuery } from \"./useBaseQuery\";\n\n/**\n * Hook to query Web3.bio domain data by identity\n * \n * @param identity - Identity string or array of identities to query\n * @param options - Optional configuration options\n * @returns Object containing domain data, loading state, and any errors\n * \n * @example\n * // Query by ENS name\n * const { data, isLoading, error } = useDomain(\"vitalik.eth\");\n * \n * // Query by domain name with platform\n * const { data } = useDomain(\"ens,vitalik.eth\");\n */\nexport function useDomain(\n identity: Identity,\n options: QueryOptions = {}\n): DomainQueryResult {\n return useBaseQuery<DomainResponse>(identity, QueryEndpoint.DOMAIN, false, options);\n}","import { QueryEndpoint } from \"../utils/constants\";\nimport { Identity, ProfileQueryResult, ProfileResponse, QueryOptions } from \"../utils/types\";\nimport { useBaseQuery } from \"./useBaseQuery\";\n\n/**\n * Hook to query Web3.bio profile data using universal identity lookup\n * \n * @param identity - Identity string or array of identities to query\n * @param options - Optional configuration options\n * @returns Object containing profile data, loading state, and any errors\n * \n * @example\n * // Query by ENS name with universal lookup\n * const { data, isLoading, error } = useUniversalProfile(\"vitalik.eth\");\n * \n * // Query by any identity type with universal lookup\n * const { data } = useUniversalProfile(\"dwr.farcaster\");\n */\nexport function useUniversalProfile(\n identity: Identity,\n options: QueryOptions = {}\n): ProfileQueryResult {\n return useBaseQuery<ProfileResponse>(identity, QueryEndpoint.PROFILE, true, options);\n}","import { QueryEndpoint } from \"../utils/constants\";\nimport { Identity, NSResponse, NSQueryResult, QueryOptions } from \"../utils/types\";\nimport { useBaseQuery } from \"./useBaseQuery\";\n\n/**\n * Hook to query Web3.bio name service (NS) data using universal identity lookup\n * \n * @param identity - Identity string or array of identities to query\n * @param options - Optional configuration options\n * @returns Object containing NS data, loading state, and any errors\n * \n * @example\n * // Query by ENS name with universal lookup\n * const { data, isLoading, error } = useUniversalNS(\"vitalik.eth\");\n * \n * // Query by any identity type with universal lookup\n * const { data } = useUniversalNS(\"dwr.farcaster\");\n */\nexport function useUniversalNS(\n identity: Identity,\n options: QueryOptions = {}\n): NSQueryResult {\n return useBaseQuery<NSResponse>(identity, QueryEndpoint.NS, true, options);\n}"],"names":[],"mappings":";;AAAO,MAAM,YAAY,GAAG,uBAAuB;IAEvC,cASX;AATD,CAAA,UAAY,aAAa,EAAA;AACvB,IAAA,aAAA,CAAA,WAAA,CAAA,GAAA,WAAuB,CAAA;AACvB,IAAA,aAAA,CAAA,kBAAA,CAAA,GAAA,0BAA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