web3bio-profile-kit 0.1.2 → 0.1.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/README.md +14 -6
- package/dist/hooks/index.cjs +21 -0
- package/dist/hooks/index.js +8 -0
- package/dist/hooks/useBaseQuery.cjs +129 -0
- package/dist/{types/hooks → hooks}/useBaseQuery.d.ts +1 -2
- package/dist/hooks/useBaseQuery.js +127 -0
- package/dist/hooks/useBatchNS.cjs +25 -0
- package/dist/{types/hooks → hooks}/useBatchNS.d.ts +1 -1
- package/dist/hooks/useBatchNS.js +23 -0
- package/dist/hooks/useBatchProfile.cjs +25 -0
- package/dist/{types/hooks → hooks}/useBatchProfile.d.ts +1 -1
- package/dist/hooks/useBatchProfile.js +23 -0
- package/dist/hooks/useDomain.cjs +28 -0
- package/dist/{types/hooks → hooks}/useDomain.d.ts +1 -1
- package/dist/hooks/useDomain.js +26 -0
- package/dist/hooks/useNS.cjs +28 -0
- package/dist/{types/hooks → hooks}/useNS.d.ts +1 -1
- package/dist/hooks/useNS.js +26 -0
- package/dist/hooks/useProfile.cjs +28 -0
- package/dist/{types/hooks → hooks}/useProfile.d.ts +1 -1
- package/dist/hooks/useProfile.js +26 -0
- package/dist/hooks/useUniversalNS.cjs +28 -0
- package/dist/{types/hooks → hooks}/useUniversalNS.d.ts +1 -1
- package/dist/hooks/useUniversalNS.js +26 -0
- package/dist/hooks/useUniversalProfile.cjs +28 -0
- package/dist/{types/hooks → hooks}/useUniversalProfile.d.ts +1 -1
- package/dist/hooks/useUniversalProfile.js +26 -0
- package/dist/index.cjs +71 -0
- package/dist/index.d.ts +3 -247
- package/dist/index.js +18 -425
- package/dist/types/cointype.cjs +29 -0
- package/dist/types/cointype.d.ts +26 -0
- package/dist/types/cointype.js +29 -0
- package/dist/types/hook.cjs +38 -0
- package/dist/types/hook.d.ts +195 -0
- package/dist/types/hook.js +38 -0
- package/dist/types/index.cjs +38 -0
- package/dist/types/index.d.ts +5 -3
- package/dist/types/index.js +5 -0
- package/dist/types/network.cjs +41 -0
- package/dist/types/network.d.ts +55 -0
- package/dist/types/network.js +41 -0
- package/dist/types/platform.cjs +110 -0
- package/dist/types/platform.d.ts +122 -0
- package/dist/types/platform.js +110 -0
- package/dist/types/source.cjs +44 -0
- package/dist/types/source.d.ts +49 -0
- package/dist/types/source.js +44 -0
- package/dist/utils/helpers.cjs +119 -0
- package/dist/{types/utils → utils}/helpers.d.ts +4 -3
- package/dist/utils/helpers.js +112 -0
- package/dist/utils/index.cjs +27 -0
- package/dist/utils/index.d.ts +6 -0
- package/dist/utils/index.js +6 -0
- package/dist/utils/network.cjs +355 -0
- package/dist/utils/network.d.ts +4 -0
- package/dist/utils/network.js +353 -0
- package/dist/utils/platform.cjs +983 -0
- package/dist/utils/platform.d.ts +18 -0
- package/dist/utils/platform.js +979 -0
- package/dist/utils/regex.cjs +34 -0
- package/dist/utils/regex.d.ts +30 -0
- package/dist/utils/regex.js +32 -0
- package/dist/utils/source.cjs +144 -0
- package/dist/utils/source.d.ts +2 -0
- package/dist/utils/source.js +142 -0
- package/package.json +32 -12
- package/dist/index.esm.js +0 -415
- package/dist/index.esm.js.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/types/utils/constants.d.ts +0 -36
- package/dist/types/utils/types.d.ts +0 -102
- /package/dist/{types/hooks → hooks}/index.d.ts +0 -0
- /package/dist/{types/setupTests.d.ts → setupTests.d.ts} +0 -0
package/dist/index.esm.js
DELETED
|
@@ -1,415 +0,0 @@
|
|
|
1
|
-
import { useState, useRef, 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 requests
|
|
184
|
-
if (Array.isArray(identity)) {
|
|
185
|
-
return `${API_ENDPOINT}/${endpoint}/batch/${encodeURIComponent(JSON.stringify(identity))}`;
|
|
186
|
-
}
|
|
187
|
-
// Handle universal queries
|
|
188
|
-
if (universal) {
|
|
189
|
-
return `${API_ENDPOINT}/${endpoint}/${identity}`;
|
|
190
|
-
}
|
|
191
|
-
// Handle platform-specific queries
|
|
192
|
-
const resolvedId = resolveIdentity(identity);
|
|
193
|
-
if (!resolvedId)
|
|
194
|
-
return null;
|
|
195
|
-
// Domain endpoint uses resolved ID directly
|
|
196
|
-
if (endpoint === QueryEndpoint.DOMAIN) {
|
|
197
|
-
return `${API_ENDPOINT}/${endpoint}/${resolvedId}`;
|
|
198
|
-
}
|
|
199
|
-
// Other endpoints need platform/handle split
|
|
200
|
-
const [platform, handle] = resolvedId.split(",");
|
|
201
|
-
return `${API_ENDPOINT}/${endpoint}/${platform}/${handle}`;
|
|
202
|
-
};
|
|
203
|
-
// Generate a stable cache key for this request
|
|
204
|
-
const getCacheKey = (identity, endpoint, universal) => {
|
|
205
|
-
return JSON.stringify({
|
|
206
|
-
identity,
|
|
207
|
-
endpoint,
|
|
208
|
-
universal,
|
|
209
|
-
});
|
|
210
|
-
};
|
|
211
|
-
// Create a cache to store results across component instances and re-renders
|
|
212
|
-
const globalRequestCache = new Map();
|
|
213
|
-
/**
|
|
214
|
-
* Core hook for querying Web3.bio Profile API
|
|
215
|
-
*/
|
|
216
|
-
function useBaseQuery(identity, endpoint, universal = false, options = {}) {
|
|
217
|
-
const { apiKey: userApiKey, enabled = true } = options;
|
|
218
|
-
const apiKey = getApiKey(userApiKey);
|
|
219
|
-
const [data, setData] = useState(() => {
|
|
220
|
-
// Initialize state from cache if available
|
|
221
|
-
const cacheKey = getCacheKey(identity, endpoint, universal);
|
|
222
|
-
return globalRequestCache.get(cacheKey) || null;
|
|
223
|
-
});
|
|
224
|
-
const [isLoading, setIsLoading] = useState(false);
|
|
225
|
-
const [error, setError] = useState(null);
|
|
226
|
-
// Use ref to track in-flight requests and prevent race conditions
|
|
227
|
-
const requestIdRef = useRef(0);
|
|
228
|
-
const prevParamsRef = useRef("");
|
|
229
|
-
// Current request parameters as a string for comparison
|
|
230
|
-
const currentParams = JSON.stringify({
|
|
231
|
-
identity,
|
|
232
|
-
endpoint,
|
|
233
|
-
universal,
|
|
234
|
-
});
|
|
235
|
-
useEffect(() => {
|
|
236
|
-
// Don't run the query if disabled or no identity
|
|
237
|
-
if (!enabled || !identity)
|
|
238
|
-
return;
|
|
239
|
-
// Skip if parameters haven't changed
|
|
240
|
-
if (currentParams === prevParamsRef.current && data !== null) {
|
|
241
|
-
return;
|
|
242
|
-
}
|
|
243
|
-
// Update previous parameters
|
|
244
|
-
prevParamsRef.current = currentParams;
|
|
245
|
-
// Generate cache key
|
|
246
|
-
const cacheKey = getCacheKey(identity, endpoint, universal);
|
|
247
|
-
// Check if we already have cached data
|
|
248
|
-
const cachedData = globalRequestCache.get(cacheKey);
|
|
249
|
-
if (cachedData) {
|
|
250
|
-
setData(cachedData);
|
|
251
|
-
return;
|
|
252
|
-
}
|
|
253
|
-
// Increment request ID to track the latest request
|
|
254
|
-
const requestId = ++requestIdRef.current;
|
|
255
|
-
setIsLoading(true);
|
|
256
|
-
setError(null);
|
|
257
|
-
const fetchData = async () => {
|
|
258
|
-
try {
|
|
259
|
-
const url = buildApiUrl(identity, endpoint, universal);
|
|
260
|
-
if (!url) {
|
|
261
|
-
throw new Error(ErrorMessages.INVALID_IDENTITY);
|
|
262
|
-
}
|
|
263
|
-
const headers = apiKey ? { "x-api-key": apiKey } : {};
|
|
264
|
-
const fetchOptions = {
|
|
265
|
-
method: "GET",
|
|
266
|
-
headers,
|
|
267
|
-
};
|
|
268
|
-
const response = await fetch(url, fetchOptions);
|
|
269
|
-
if (!response.ok) {
|
|
270
|
-
throw new Error(`API error: ${response.status}`);
|
|
271
|
-
}
|
|
272
|
-
const responseData = await response.json();
|
|
273
|
-
if (responseData === null || responseData === void 0 ? void 0 : responseData.error) {
|
|
274
|
-
throw new Error(responseData.error);
|
|
275
|
-
}
|
|
276
|
-
if (requestId === requestIdRef.current) {
|
|
277
|
-
globalRequestCache.set(cacheKey, responseData);
|
|
278
|
-
setData(responseData);
|
|
279
|
-
setIsLoading(false);
|
|
280
|
-
}
|
|
281
|
-
}
|
|
282
|
-
catch (err) {
|
|
283
|
-
if (requestId === requestIdRef.current) {
|
|
284
|
-
setError(err instanceof Error ? err : new Error(String(err)));
|
|
285
|
-
setIsLoading(false);
|
|
286
|
-
}
|
|
287
|
-
}
|
|
288
|
-
};
|
|
289
|
-
fetchData();
|
|
290
|
-
}, [currentParams, enabled]);
|
|
291
|
-
return { data, isLoading, error };
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
/**
|
|
295
|
-
* Hook to query Web3.bio profile data by identity
|
|
296
|
-
*
|
|
297
|
-
* @param identity - Identity string
|
|
298
|
-
* @param options - Optional configuration options
|
|
299
|
-
* @returns Object containing profile data, loading state, and any errors
|
|
300
|
-
*
|
|
301
|
-
* @example
|
|
302
|
-
* // Query by ENS name
|
|
303
|
-
* const { data, isLoading, error } = useProfile("vitalik.eth");
|
|
304
|
-
*
|
|
305
|
-
* // Query with platform specification
|
|
306
|
-
* const { data } = useProfile("farcaster,dwr");
|
|
307
|
-
*/
|
|
308
|
-
function useProfile(identity, options = {}) {
|
|
309
|
-
return useBaseQuery(identity, QueryEndpoint.PROFILE, false, options);
|
|
310
|
-
}
|
|
311
|
-
|
|
312
|
-
/**
|
|
313
|
-
* Hook to query Web3.bio name service (NS) data by identity
|
|
314
|
-
*
|
|
315
|
-
* @param identity - Identity string
|
|
316
|
-
* @param options - Optional configuration options
|
|
317
|
-
* @returns Object containing NS data, loading state, and any errors
|
|
318
|
-
*
|
|
319
|
-
* @example
|
|
320
|
-
* // Query by ENS name
|
|
321
|
-
* const { data, isLoading, error } = useNS("vitalik.eth");
|
|
322
|
-
*
|
|
323
|
-
* // Query by Ethereum address
|
|
324
|
-
* const { data } = useNS("0x123...");
|
|
325
|
-
*/
|
|
326
|
-
function useNS(identity, options = {}) {
|
|
327
|
-
return useBaseQuery(identity, QueryEndpoint.NS, false, options);
|
|
328
|
-
}
|
|
329
|
-
|
|
330
|
-
/**
|
|
331
|
-
* Hook to query Web3.bio profile data using universal identity lookup
|
|
332
|
-
*
|
|
333
|
-
* @param identity - Identity string
|
|
334
|
-
* @param options - Optional configuration options
|
|
335
|
-
* @returns Object containing profile data, loading state, and any errors
|
|
336
|
-
*
|
|
337
|
-
* @example
|
|
338
|
-
* // Query by ENS name with universal lookup
|
|
339
|
-
* const { data, isLoading, error } = useUniversalProfile("vitalik.eth");
|
|
340
|
-
*
|
|
341
|
-
* // Query by any identity type with universal lookup
|
|
342
|
-
* const { data } = useUniversalProfile("dwr.farcaster");
|
|
343
|
-
*/
|
|
344
|
-
function useUniversalProfile(identity, options = {}) {
|
|
345
|
-
return useBaseQuery(identity, QueryEndpoint.PROFILE, true, options);
|
|
346
|
-
}
|
|
347
|
-
|
|
348
|
-
/**
|
|
349
|
-
* Hook to query Web3.bio name service (NS) data using universal identity lookup
|
|
350
|
-
*
|
|
351
|
-
* @param identity - Identity string
|
|
352
|
-
* @param options - Optional configuration options
|
|
353
|
-
* @returns Object containing NS data, loading state, and any errors
|
|
354
|
-
*
|
|
355
|
-
* @example
|
|
356
|
-
* // Query by ENS name with universal lookup
|
|
357
|
-
* const { data, isLoading, error } = useUniversalNS("vitalik.eth");
|
|
358
|
-
*
|
|
359
|
-
* // Query by any identity type with universal lookup
|
|
360
|
-
* const { data } = useUniversalNS("dwr.farcaster");
|
|
361
|
-
*/
|
|
362
|
-
function useUniversalNS(identity, options = {}) {
|
|
363
|
-
return useBaseQuery(identity, QueryEndpoint.NS, true, options);
|
|
364
|
-
}
|
|
365
|
-
|
|
366
|
-
/**
|
|
367
|
-
* Hook to query Web3.bio profile data using batch identity lookup
|
|
368
|
-
*
|
|
369
|
-
* @param identity - array of Identity string
|
|
370
|
-
* @param options - Optional configuration options
|
|
371
|
-
* @returns Object containing profile data, loading state, and any errors
|
|
372
|
-
*
|
|
373
|
-
* @example
|
|
374
|
-
* // Query by any identity type with batch lookup
|
|
375
|
-
* const { data } = useBatchProfile(["dwr.farcaster","ens,vitalik.eth","sujiyan.eth","stani.lens"]);
|
|
376
|
-
*/
|
|
377
|
-
function useBatchProfile(identity, options = {}) {
|
|
378
|
-
return useBaseQuery(identity, QueryEndpoint.PROFILE, false, options);
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
/**
|
|
382
|
-
* Hook to query Web3.bio profile data using batch(NS) identity lookup
|
|
383
|
-
*
|
|
384
|
-
* @param identity - array of Identity string
|
|
385
|
-
* @param options - Optional configuration options
|
|
386
|
-
* @returns Object containing profile data, loading state, and any errors
|
|
387
|
-
*
|
|
388
|
-
* @example
|
|
389
|
-
* // Query by any identity type with batch lookup
|
|
390
|
-
* const { data } = useBatchNS(["dwr.farcaster","ens,vitalik.eth","sujiyan.eth","stani.lens"]);
|
|
391
|
-
*/
|
|
392
|
-
function useBatchNS(identity, options = {}) {
|
|
393
|
-
return useBaseQuery(identity, QueryEndpoint.NS, false, options);
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
/**
|
|
397
|
-
* Hook to query Web3.bio domain data by identity
|
|
398
|
-
*
|
|
399
|
-
* @param identity - Identity string
|
|
400
|
-
* @param options - Optional configuration options
|
|
401
|
-
* @returns Object containing domain data, loading state, and any errors
|
|
402
|
-
*
|
|
403
|
-
* @example
|
|
404
|
-
* // Query by ENS name
|
|
405
|
-
* const { data, isLoading, error } = useDomain("vitalik.eth");
|
|
406
|
-
*
|
|
407
|
-
* // Query by domain name with platform
|
|
408
|
-
* const { data } = useDomain("ens,vitalik.eth");
|
|
409
|
-
*/
|
|
410
|
-
function useDomain(identity, options = {}) {
|
|
411
|
-
return useBaseQuery(identity, QueryEndpoint.DOMAIN, false, options);
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
export { API_ENDPOINT, ErrorMessages, PlatformType, QueryEndpoint, REGEX, SourceType, useBatchNS, useBatchProfile, useDomain, useNS, useProfile, useUniversalNS, useUniversalProfile };
|
|
415
|
-
//# sourceMappingURL=index.esm.js.map
|
package/dist/index.esm.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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/useUniversalProfile.ts","../src/hooks/useUniversalNS.ts","../src/hooks/useBatchProfile.ts","../src/hooks/useBatchNS.ts","../src/hooks/useDomain.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:\n /^(?:[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:\n /^.+\\.(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:\n /\\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};\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 aliases?: string[];\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 aliases?: string[];\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}`;\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 ProfileResult = QueryResult<ProfileResponse>;\nexport type NSResult = QueryResult<NSResponse>;\nexport type ProfileBatchResult = QueryResult<ProfileResponse[]>;\nexport type NSBatchResult = QueryResult<NSResponse[]>;\nexport type ProfileUniversalResult = QueryResult<ProfileResponse[]>;\nexport type NSUniversalResult = QueryResult<NSResponse[]>;\nexport type DomainResult = QueryResult<DomainResponse>;\n","import { REGEX } from \"./constants\";\nimport { PlatformType } 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 type { IdentityString, QueryOptions, QueryResult } from \"../utils/types\";\nimport { useState, useEffect, useRef } from \"react\";\nimport { API_ENDPOINT, ErrorMessages, QueryEndpoint } from \"../utils/constants\";\nimport { getApiKey, resolveIdentity } from \"../utils/helpers\";\n\n/**\n * Constructs the API URL based on query parameters\n */\nconst buildApiUrl = (\n identity: IdentityString | IdentityString[],\n endpoint: QueryEndpoint,\n universal: boolean,\n): string | null => {\n // Handle batch requests\n if (Array.isArray(identity)) {\n return `${API_ENDPOINT}/${endpoint}/batch/${encodeURIComponent(JSON.stringify(identity))}`;\n }\n\n // Handle universal queries\n if (universal) {\n return `${API_ENDPOINT}/${endpoint}/${identity}`;\n }\n\n // Handle platform-specific queries\n const resolvedId = resolveIdentity(identity);\n if (!resolvedId) return null;\n\n // Domain endpoint uses resolved ID directly\n if (endpoint === QueryEndpoint.DOMAIN) {\n return `${API_ENDPOINT}/${endpoint}/${resolvedId}`;\n }\n\n // Other endpoints need platform/handle split\n const [platform, handle] = resolvedId.split(\",\");\n return `${API_ENDPOINT}/${endpoint}/${platform}/${handle}`;\n};\n\n// Generate a stable cache key for this request\nconst getCacheKey = (\n identity: IdentityString | IdentityString[],\n endpoint: QueryEndpoint,\n universal: boolean,\n): string => {\n return JSON.stringify({\n identity,\n endpoint,\n universal,\n });\n};\n\n// Create a cache to store results across component instances and re-renders\nconst globalRequestCache = new Map<string, any>();\n\n/**\n * Core hook for querying Web3.bio Profile API\n */\nexport function useBaseQuery<T>(\n identity: IdentityString | IdentityString[],\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>(() => {\n // Initialize state from cache if available\n const cacheKey = getCacheKey(identity, endpoint, universal);\n return (globalRequestCache.get(cacheKey) as T) || null;\n });\n const [isLoading, setIsLoading] = useState<boolean>(false);\n const [error, setError] = useState<Error | null>(null);\n\n // Use ref to track in-flight requests and prevent race conditions\n const requestIdRef = useRef<number>(0);\n const prevParamsRef = useRef<string>(\"\");\n\n // Current request parameters as a string for comparison\n const currentParams = JSON.stringify({\n identity,\n endpoint,\n universal,\n });\n\n useEffect(() => {\n // Don't run the query if disabled or no identity\n if (!enabled || !identity) return;\n\n // Skip if parameters haven't changed\n if (currentParams === prevParamsRef.current && data !== null) {\n return;\n }\n\n // Update previous parameters\n prevParamsRef.current = currentParams;\n\n // Generate cache key\n const cacheKey = getCacheKey(identity, endpoint, universal);\n\n // Check if we already have cached data\n const cachedData = globalRequestCache.get(cacheKey) as T | undefined;\n if (cachedData) {\n setData(cachedData);\n return;\n }\n\n // Increment request ID to track the latest request\n const requestId = ++requestIdRef.current;\n\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 fetchOptions: RequestInit = {\n method: \"GET\",\n headers,\n };\n\n const response = await fetch(url, fetchOptions);\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 if (requestId === requestIdRef.current) {\n globalRequestCache.set(cacheKey, responseData);\n setData(responseData as T);\n setIsLoading(false);\n }\n } catch (err) {\n if (requestId === requestIdRef.current) {\n setError(err instanceof Error ? err : new Error(String(err)));\n setIsLoading(false);\n }\n }\n };\n\n fetchData();\n }, [currentParams, enabled]);\n\n return { data, isLoading, error };\n}\n","import type {\n IdentityString,\n ProfileResponse,\n ProfileResult,\n QueryOptions,\n} from \"../utils/types\";\nimport { QueryEndpoint } from \"../utils/constants\";\nimport { useBaseQuery } from \"./useBaseQuery\";\n\n/**\n * Hook to query Web3.bio profile data by identity\n *\n * @param identity - Identity string\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: IdentityString,\n options: QueryOptions = {},\n): ProfileResult {\n return useBaseQuery<ProfileResponse>(\n identity,\n QueryEndpoint.PROFILE,\n false,\n options,\n );\n}\n","import type {\n NSResponse,\n QueryOptions,\n IdentityString,\n NSResult,\n} from \"../utils/types\";\nimport { QueryEndpoint } from \"../utils/constants\";\nimport { useBaseQuery } from \"./useBaseQuery\";\n\n/**\n * Hook to query Web3.bio name service (NS) data by identity\n *\n * @param identity - Identity string\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: IdentityString,\n options: QueryOptions = {},\n): NSResult {\n return useBaseQuery<NSResponse>(identity, QueryEndpoint.NS, false, options);\n}\n","import type {\n IdentityString,\n ProfileResponse,\n ProfileUniversalResult,\n QueryOptions,\n} from \"../utils/types\";\nimport { QueryEndpoint } from \"../utils/constants\";\nimport { useBaseQuery } from \"./useBaseQuery\";\n\n/**\n * Hook to query Web3.bio profile data using universal identity lookup\n *\n * @param identity - Identity string\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: IdentityString,\n options: QueryOptions = {},\n): ProfileUniversalResult {\n return useBaseQuery<ProfileResponse[]>(\n identity,\n QueryEndpoint.PROFILE,\n true,\n options,\n );\n}\n","import type {\n NSResponse,\n QueryOptions,\n IdentityString,\n NSUniversalResult,\n} from \"../utils/types\";\nimport { QueryEndpoint } from \"../utils/constants\";\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\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: IdentityString,\n options: QueryOptions = {},\n): NSUniversalResult {\n return useBaseQuery<NSResponse[]>(identity, QueryEndpoint.NS, true, options);\n}\n","import type {\n IdentityString,\n ProfileBatchResult,\n ProfileResponse,\n QueryOptions,\n} from \"../utils/types\";\nimport { QueryEndpoint } from \"../utils/constants\";\nimport { useBaseQuery } from \"./useBaseQuery\";\n\n/**\n * Hook to query Web3.bio profile data using batch identity lookup\n *\n * @param identity - array of Identity string\n * @param options - Optional configuration options\n * @returns Object containing profile data, loading state, and any errors\n *\n * @example\n * // Query by any identity type with batch lookup\n * const { data } = useBatchProfile([\"dwr.farcaster\",\"ens,vitalik.eth\",\"sujiyan.eth\",\"stani.lens\"]);\n */\nexport function useBatchProfile(\n identity: IdentityString[],\n options: QueryOptions = {},\n): ProfileBatchResult {\n return useBaseQuery<ProfileResponse[]>(\n identity,\n QueryEndpoint.PROFILE,\n false,\n options,\n );\n}\n","import type {\n IdentityString,\n NSBatchResult,\n NSResponse,\n QueryOptions,\n} from \"../utils/types\";\nimport { QueryEndpoint } from \"../utils/constants\";\nimport { useBaseQuery } from \"./useBaseQuery\";\n\n/**\n * Hook to query Web3.bio profile data using batch(NS) identity lookup\n *\n * @param identity - array of Identity string\n * @param options - Optional configuration options\n * @returns Object containing profile data, loading state, and any errors\n *\n * @example\n * // Query by any identity type with batch lookup\n * const { data } = useBatchNS([\"dwr.farcaster\",\"ens,vitalik.eth\",\"sujiyan.eth\",\"stani.lens\"]);\n */\nexport function useBatchNS(\n identity: IdentityString[],\n options: QueryOptions = {},\n): NSBatchResult {\n return useBaseQuery<NSResponse[]>(identity, QueryEndpoint.NS, false, options);\n}\n","import type {\n DomainResponse,\n DomainResult,\n IdentityString,\n QueryOptions,\n} from \"../utils/types\";\nimport { QueryEndpoint } from \"../utils/constants\";\nimport { useBaseQuery } from \"./useBaseQuery\";\n\n/**\n * Hook to query Web3.bio domain data by identity\n *\n * @param identity - Identity string\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: IdentityString,\n options: QueryOptions = {},\n): DomainResult {\n return useBaseQuery<DomainResponse>(\n identity,\n QueryEndpoint.DOMAIN,\n false,\n options,\n );\n}\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,0BAA6C,CAAA;AAC7C,IAAA,aAAA,CAAA,kBAAA,CAAA,GAAA,0BAA6C,CAAA;AAC7C,IAAA,aAAA,CAAA,WAAA,CAAA,GAAA,gBAA4B,CAAA;AAC5B,IAAA,aAAA,CAAA,kBAAA,CAAA,GAAA,4BAA+C,CAAA;AAC/C,IAAA,aAAA,CAAA,iBAAA,CAAA,GAAA,iBAAmC,CAAA;AACnC,IAAA,aAAA,CAAA,eAAA,CAAA,GAAA,wBAAwC,CAAA;AACxC,IAAA,aAAA,CAAA,eAAA,CAAA,GAAA,eAA+B,CAAA;AACjC,CAAC,EATW,aAAa,KAAb,aAAa,GASxB,EAAA,CAAA,CAAA,CAAA;IAEW,cAIX;AAJD,CAAA,UAAY,aAAa,EAAA;AACvB,IAAA,a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AAO,YAAY,CACjB,QAAQ,EACR,aAAa,CAAC,OAAO,EACrB,IAAI,EACJ,OAAO,CACR,CAAC;AACJ;;ACxBA;;;;;;;;;;;;;AAaG;SACa,cAAc,CAC5B,QAAwB,EACxB,UAAwB,EAAE,EAAA;AAE1B,IAAA,OAAO,YAAY,CAAe,QAAQ,EAAE,aAAa,CAAC,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;AAC/E;;ACnBA;;;;;;;;;;AAUG;SACa,eAAe,CAC7B,QAA0B,EAC1B,UAAwB,EAAE,EAAA;AAE1B,IAAA,OAAO,YAAY,CACjB,QAAQ,EACR,aAAa,CAAC,OAAO,EACrB,KAAK,EACL,OAAO,CACR,CAAC;AACJ;;ACrBA;;;;;;;;;;AAUG;SACa,UAAU,CACxB,QAA0B,EAC1B,UAAwB,EAAE,EAAA;AAE1B,IAAA,OAAO,YAAY,CAAe,QAAQ,EAAE,aAAa,CAAC,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;AAChF;;AChBA;;;;;;;;;;;;;AAaG;SACa,SAAS,CACvB,QAAwB,EACxB,UAAwB,EAAE,EAAA;AAE1B,IAAA,OAAO,YAAY,CACjB,QAAQ,EACR,aAAa,CAAC,MAAM,EACpB,KAAK,EACL,OAAO,CACR,CAAC;AACJ;;;;"}
|
package/dist/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.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/useUniversalProfile.ts","../src/hooks/useUniversalNS.ts","../src/hooks/useBatchProfile.ts","../src/hooks/useBatchNS.ts","../src/hooks/useDomain.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:\n /^(?:[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:\n /^.+\\.(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:\n /\\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};\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 aliases?: string[];\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 aliases?: string[];\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}`;\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 ProfileResult = QueryResult<ProfileResponse>;\nexport type NSResult = QueryResult<NSResponse>;\nexport type ProfileBatchResult = QueryResult<ProfileResponse[]>;\nexport type NSBatchResult = QueryResult<NSResponse[]>;\nexport type ProfileUniversalResult = QueryResult<ProfileResponse[]>;\nexport type NSUniversalResult = QueryResult<NSResponse[]>;\nexport type DomainResult = QueryResult<DomainResponse>;\n","import { REGEX } from \"./constants\";\nimport { PlatformType } 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 type { IdentityString, QueryOptions, QueryResult } from \"../utils/types\";\nimport { useState, useEffect, useRef } from \"react\";\nimport { API_ENDPOINT, ErrorMessages, QueryEndpoint } from \"../utils/constants\";\nimport { getApiKey, resolveIdentity } from \"../utils/helpers\";\n\n/**\n * Constructs the API URL based on query parameters\n */\nconst buildApiUrl = (\n identity: IdentityString | IdentityString[],\n endpoint: QueryEndpoint,\n universal: boolean,\n): string | null => {\n // Handle batch requests\n if (Array.isArray(identity)) {\n return `${API_ENDPOINT}/${endpoint}/batch/${encodeURIComponent(JSON.stringify(identity))}`;\n }\n\n // Handle universal queries\n if (universal) {\n return `${API_ENDPOINT}/${endpoint}/${identity}`;\n }\n\n // Handle platform-specific queries\n const resolvedId = resolveIdentity(identity);\n if (!resolvedId) return null;\n\n // Domain endpoint uses resolved ID directly\n if (endpoint === QueryEndpoint.DOMAIN) {\n return `${API_ENDPOINT}/${endpoint}/${resolvedId}`;\n }\n\n // Other endpoints need platform/handle split\n const [platform, handle] = resolvedId.split(\",\");\n return `${API_ENDPOINT}/${endpoint}/${platform}/${handle}`;\n};\n\n// Generate a stable cache key for this request\nconst getCacheKey = (\n identity: IdentityString | IdentityString[],\n endpoint: QueryEndpoint,\n universal: boolean,\n): string => {\n return JSON.stringify({\n identity,\n endpoint,\n universal,\n });\n};\n\n// Create a cache to store results across component instances and re-renders\nconst globalRequestCache = new Map<string, any>();\n\n/**\n * Core hook for querying Web3.bio Profile API\n */\nexport function useBaseQuery<T>(\n identity: IdentityString | IdentityString[],\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>(() => {\n // Initialize state from cache if available\n const cacheKey = getCacheKey(identity, endpoint, universal);\n return (globalRequestCache.get(cacheKey) as T) || null;\n });\n const [isLoading, setIsLoading] = useState<boolean>(false);\n const [error, setError] = useState<Error | null>(null);\n\n // Use ref to track in-flight requests and prevent race conditions\n const requestIdRef = useRef<number>(0);\n const prevParamsRef = useRef<string>(\"\");\n\n // Current request parameters as a string for comparison\n const currentParams = JSON.stringify({\n identity,\n endpoint,\n universal,\n });\n\n useEffect(() => {\n // Don't run the query if disabled or no identity\n if (!enabled || !identity) return;\n\n // Skip if parameters haven't changed\n if (currentParams === prevParamsRef.current && data !== null) {\n return;\n }\n\n // Update previous parameters\n prevParamsRef.current = currentParams;\n\n // Generate cache key\n const cacheKey = getCacheKey(identity, endpoint, universal);\n\n // Check if we already have cached data\n const cachedData = globalRequestCache.get(cacheKey) as T | undefined;\n if (cachedData) {\n setData(cachedData);\n return;\n }\n\n // Increment request ID to track the latest request\n const requestId = ++requestIdRef.current;\n\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 fetchOptions: RequestInit = {\n method: \"GET\",\n headers,\n };\n\n const response = await fetch(url, fetchOptions);\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 if (requestId === requestIdRef.current) {\n globalRequestCache.set(cacheKey, responseData);\n setData(responseData as T);\n setIsLoading(false);\n }\n } catch (err) {\n if (requestId === requestIdRef.current) {\n setError(err instanceof Error ? err : new Error(String(err)));\n setIsLoading(false);\n }\n }\n };\n\n fetchData();\n }, [currentParams, enabled]);\n\n return { data, isLoading, error };\n}\n","import type {\n IdentityString,\n ProfileResponse,\n ProfileResult,\n QueryOptions,\n} from \"../utils/types\";\nimport { QueryEndpoint } from \"../utils/constants\";\nimport { useBaseQuery } from \"./useBaseQuery\";\n\n/**\n * Hook to query Web3.bio profile data by identity\n *\n * @param identity - Identity string\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: IdentityString,\n options: QueryOptions = {},\n): ProfileResult {\n return useBaseQuery<ProfileResponse>(\n identity,\n QueryEndpoint.PROFILE,\n false,\n options,\n );\n}\n","import type {\n NSResponse,\n QueryOptions,\n IdentityString,\n NSResult,\n} from \"../utils/types\";\nimport { QueryEndpoint } from \"../utils/constants\";\nimport { useBaseQuery } from \"./useBaseQuery\";\n\n/**\n * Hook to query Web3.bio name service (NS) data by identity\n *\n * @param identity - Identity string\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: IdentityString,\n options: QueryOptions = {},\n): NSResult {\n return useBaseQuery<NSResponse>(identity, QueryEndpoint.NS, false, options);\n}\n","import type {\n IdentityString,\n ProfileResponse,\n ProfileUniversalResult,\n QueryOptions,\n} from \"../utils/types\";\nimport { QueryEndpoint } from \"../utils/constants\";\nimport { useBaseQuery } from \"./useBaseQuery\";\n\n/**\n * Hook to query Web3.bio profile data using universal identity lookup\n *\n * @param identity - Identity string\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: IdentityString,\n options: QueryOptions = {},\n): ProfileUniversalResult {\n return useBaseQuery<ProfileResponse[]>(\n identity,\n QueryEndpoint.PROFILE,\n true,\n options,\n );\n}\n","import type {\n NSResponse,\n QueryOptions,\n IdentityString,\n NSUniversalResult,\n} from \"../utils/types\";\nimport { QueryEndpoint } from \"../utils/constants\";\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\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: IdentityString,\n options: QueryOptions = {},\n): NSUniversalResult {\n return useBaseQuery<NSResponse[]>(identity, QueryEndpoint.NS, true, options);\n}\n","import type {\n IdentityString,\n ProfileBatchResult,\n ProfileResponse,\n QueryOptions,\n} from \"../utils/types\";\nimport { QueryEndpoint } from \"../utils/constants\";\nimport { useBaseQuery } from \"./useBaseQuery\";\n\n/**\n * Hook to query Web3.bio profile data using batch identity lookup\n *\n * @param identity - array of Identity string\n * @param options - Optional configuration options\n * @returns Object containing profile data, loading state, and any errors\n *\n * @example\n * // Query by any identity type with batch lookup\n * const { data } = useBatchProfile([\"dwr.farcaster\",\"ens,vitalik.eth\",\"sujiyan.eth\",\"stani.lens\"]);\n */\nexport function useBatchProfile(\n identity: IdentityString[],\n options: QueryOptions = {},\n): ProfileBatchResult {\n return useBaseQuery<ProfileResponse[]>(\n identity,\n QueryEndpoint.PROFILE,\n false,\n options,\n );\n}\n","import type {\n IdentityString,\n NSBatchResult,\n NSResponse,\n QueryOptions,\n} from \"../utils/types\";\nimport { QueryEndpoint } from \"../utils/constants\";\nimport { useBaseQuery } from \"./useBaseQuery\";\n\n/**\n * Hook to query Web3.bio profile data using batch(NS) identity lookup\n *\n * @param identity - array of Identity string\n * @param options - Optional configuration options\n * @returns Object containing profile data, loading state, and any errors\n *\n * @example\n * // Query by any identity type with batch lookup\n * const { data } = useBatchNS([\"dwr.farcaster\",\"ens,vitalik.eth\",\"sujiyan.eth\",\"stani.lens\"]);\n */\nexport function useBatchNS(\n identity: IdentityString[],\n options: QueryOptions = {},\n): NSBatchResult {\n return useBaseQuery<NSResponse[]>(identity, QueryEndpoint.NS, false, options);\n}\n","import type {\n DomainResponse,\n DomainResult,\n IdentityString,\n QueryOptions,\n} from \"../utils/types\";\nimport { QueryEndpoint } from \"../utils/constants\";\nimport { useBaseQuery } from \"./useBaseQuery\";\n\n/**\n * Hook to query Web3.bio domain data by identity\n *\n * @param identity - Identity string\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: IdentityString,\n options: QueryOptions = {},\n): DomainResult {\n return useBaseQuery<DomainResponse>(\n identity,\n QueryEndpoint.DOMAIN,\n false,\n options,\n );\n}\n"],"names":["ErrorMessages","QueryEndpoint","PlatformType","SourceType","useState","useRef","useEffect"],"mappings":";;;;AAAO,MAAM,YAAY,GAAG,uBAAuB;AAEvCA,+BASX;AATD,CAAA,UAAY,aAAa,EAAA;AACvB,IAAA,aAAA,CAAA,WAAA,CAAA,GAAA,WAAuB,CAAA;AACvB,IAAA,aAAA,CAAA,kBAAA,CAAA,GAAA,0BAA6C,CAAA;AAC7C,IAAA,aAAA,CAAA,kBAAA,CAAA,GAAA,0BAA6C,CAAA;AAC7C,IAAA,aAAA,CAAA,WAAA,CAAA,GAAA,gBAA4B,CAAA;AAC5B,IAAA,aAAA,CAAA,kBAAA,CAAA,GAAA,4BAA+C,CAAA;AAC/C,IAAA,aAAA,CAAA,iBAAA,CAAA,GAAA,iBAAmC,CAAA;AACnC,IAAA,aAAA,CAAA,eAAA,CAAA,GAAA,wBAAwC,CAAA;AACxC,IAAA,aAAA,CAAA,eAAA,CAAA,GAAA,eAA+B,CAAA;AACjC,CAAC,EATWA,qBAAa,KAAbA,qBAAa,GASxB,EAAA,CAAA,CAAA,CAAA;AAEWC,+BAIX;AAJD,CAAA,UAAY,aAAa,EAAA;AACvB,IAAA,aAAA,CAAA,IAAA,CAAA,GAAA,IAAS,CAAA;AACT,IAAA,aAAA,CAAA,SAAA,CAAA,GAAA,SAAmB,CAAA;AACnB,IAAA,aAAA,CAA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C,OAAO,EACrB,IAAI,EACJ,OAAO,CACR,CAAC;AACJ;;ACxBA;;;;;;;;;;;;;AAaG;SACa,cAAc,CAC5B,QAAwB,EACxB,UAAwB,EAAE,EAAA;AAE1B,IAAA,OAAO,YAAY,CAAe,QAAQ,EAAEA,qBAAa,CAAC,EAAE,EAAE,IAAI,EAAE,OAAO,CAAC,CAAC;AAC/E;;ACnBA;;;;;;;;;;AAUG;SACa,eAAe,CAC7B,QAA0B,EAC1B,UAAwB,EAAE,EAAA;AAE1B,IAAA,OAAO,YAAY,CACjB,QAAQ,EACRA,qBAAa,CAAC,OAAO,EACrB,KAAK,EACL,OAAO,CACR,CAAC;AACJ;;ACrBA;;;;;;;;;;AAUG;SACa,UAAU,CACxB,QAA0B,EAC1B,UAAwB,EAAE,EAAA;AAE1B,IAAA,OAAO,YAAY,CAAe,QAAQ,EAAEA,qBAAa,CAAC,EAAE,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;AAChF;;AChBA;;;;;;;;;;;;;AAaG;SACa,SAAS,CACvB,QAAwB,EACxB,UAAwB,EAAE,EAAA;AAE1B,IAAA,OAAO,YAAY,CACjB,QAAQ,EACRA,qBAAa,CAAC,MAAM,EACpB,KAAK,EACL,OAAO,CACR,CAAC;AACJ;;;;;;;;;;;;"}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
export declare const API_ENDPOINT = "https://api.web3.bio";
|
|
2
|
-
export declare enum ErrorMessages {
|
|
3
|
-
NOT_FOUND = "Not Found",
|
|
4
|
-
INVALID_RESOLVER = "Invalid Resolver Address",
|
|
5
|
-
INVALID_RESOLVED = "Invalid Resolved Address",
|
|
6
|
-
NOT_EXIST = "Does Not Exist",
|
|
7
|
-
INVALID_IDENTITY = "Invalid Identity or Domain",
|
|
8
|
-
INVALID_ADDRESS = "Invalid Address",
|
|
9
|
-
UNKNOWN_ERROR = "Unknown Error Occurred",
|
|
10
|
-
NETWORK_ERROR = "Network Error"
|
|
11
|
-
}
|
|
12
|
-
export declare enum QueryEndpoint {
|
|
13
|
-
NS = "ns",
|
|
14
|
-
PROFILE = "profile",
|
|
15
|
-
DOMAIN = "domain"
|
|
16
|
-
}
|
|
17
|
-
export declare const REGEX: {
|
|
18
|
-
ENS: RegExp;
|
|
19
|
-
BASENAMES: RegExp;
|
|
20
|
-
LINEA: RegExp;
|
|
21
|
-
FARCASTER: RegExp;
|
|
22
|
-
LENS: RegExp;
|
|
23
|
-
CLUSTER: RegExp;
|
|
24
|
-
SPACE_ID: RegExp;
|
|
25
|
-
GENOME: RegExp;
|
|
26
|
-
UNSTOPPABLE_DOMAINS: RegExp;
|
|
27
|
-
CROSSBELL: RegExp;
|
|
28
|
-
DOTBIT: RegExp;
|
|
29
|
-
SNS: RegExp;
|
|
30
|
-
ETH_ADDRESS: RegExp;
|
|
31
|
-
BTC_ADDRESS: RegExp;
|
|
32
|
-
SOLANA_ADDRESS: RegExp;
|
|
33
|
-
LOWERCASE_EXEMPT: RegExp;
|
|
34
|
-
TWITTER: RegExp;
|
|
35
|
-
NEXT_ID: RegExp;
|
|
36
|
-
};
|