web3bio-profile-kit 0.1.3 → 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.
Files changed (74) hide show
  1. package/dist/hooks/index.cjs +21 -0
  2. package/dist/hooks/index.js +8 -0
  3. package/dist/hooks/useBaseQuery.cjs +129 -0
  4. package/dist/{types/hooks → hooks}/useBaseQuery.d.ts +1 -2
  5. package/dist/hooks/useBaseQuery.js +127 -0
  6. package/dist/hooks/useBatchNS.cjs +25 -0
  7. package/dist/{types/hooks → hooks}/useBatchNS.d.ts +1 -1
  8. package/dist/hooks/useBatchNS.js +23 -0
  9. package/dist/hooks/useBatchProfile.cjs +25 -0
  10. package/dist/{types/hooks → hooks}/useBatchProfile.d.ts +1 -1
  11. package/dist/hooks/useBatchProfile.js +23 -0
  12. package/dist/hooks/useDomain.cjs +28 -0
  13. package/dist/{types/hooks → hooks}/useDomain.d.ts +1 -1
  14. package/dist/hooks/useDomain.js +26 -0
  15. package/dist/hooks/useNS.cjs +28 -0
  16. package/dist/{types/hooks → hooks}/useNS.d.ts +1 -1
  17. package/dist/hooks/useNS.js +26 -0
  18. package/dist/hooks/useProfile.cjs +28 -0
  19. package/dist/{types/hooks → hooks}/useProfile.d.ts +1 -1
  20. package/dist/hooks/useProfile.js +26 -0
  21. package/dist/hooks/useUniversalNS.cjs +28 -0
  22. package/dist/{types/hooks → hooks}/useUniversalNS.d.ts +1 -1
  23. package/dist/hooks/useUniversalNS.js +26 -0
  24. package/dist/hooks/useUniversalProfile.cjs +28 -0
  25. package/dist/{types/hooks → hooks}/useUniversalProfile.d.ts +1 -1
  26. package/dist/hooks/useUniversalProfile.js +26 -0
  27. package/dist/index.cjs +71 -0
  28. package/dist/index.d.ts +3 -441
  29. package/dist/index.js +18 -2038
  30. package/dist/types/cointype.cjs +29 -0
  31. package/dist/types/cointype.d.ts +26 -0
  32. package/dist/types/cointype.js +29 -0
  33. package/dist/types/hook.cjs +38 -0
  34. package/dist/types/hook.d.ts +195 -0
  35. package/dist/types/hook.js +38 -0
  36. package/dist/types/index.cjs +38 -0
  37. package/dist/types/index.d.ts +5 -7
  38. package/dist/types/index.js +5 -0
  39. package/dist/types/network.cjs +41 -0
  40. package/dist/types/{utils/network.d.ts → network.d.ts} +9 -4
  41. package/dist/types/network.js +41 -0
  42. package/dist/types/platform.cjs +110 -0
  43. package/dist/types/{utils/platform.d.ts → platform.d.ts} +19 -5
  44. package/dist/types/platform.js +110 -0
  45. package/dist/types/source.cjs +44 -0
  46. package/dist/types/{utils/source.d.ts → source.d.ts} +11 -3
  47. package/dist/types/source.js +44 -0
  48. package/dist/utils/helpers.cjs +119 -0
  49. package/dist/{types/utils → utils}/helpers.d.ts +4 -3
  50. package/dist/utils/helpers.js +112 -0
  51. package/dist/utils/index.cjs +27 -0
  52. package/dist/utils/index.d.ts +6 -0
  53. package/dist/utils/index.js +6 -0
  54. package/dist/utils/network.cjs +355 -0
  55. package/dist/utils/network.d.ts +4 -0
  56. package/dist/utils/network.js +353 -0
  57. package/dist/utils/platform.cjs +983 -0
  58. package/dist/utils/platform.d.ts +18 -0
  59. package/dist/utils/platform.js +979 -0
  60. package/dist/utils/regex.cjs +34 -0
  61. package/dist/utils/regex.d.ts +30 -0
  62. package/dist/utils/regex.js +32 -0
  63. package/dist/utils/source.cjs +144 -0
  64. package/dist/utils/source.d.ts +2 -0
  65. package/dist/utils/source.js +142 -0
  66. package/package.json +32 -12
  67. package/dist/index.esm.js +0 -2023
  68. package/dist/index.esm.js.map +0 -1
  69. package/dist/index.js.map +0 -1
  70. package/dist/types/utils/cointype.d.ts +0 -22
  71. package/dist/types/utils/constants.d.ts +0 -36
  72. package/dist/types/utils/types.d.ts +0 -74
  73. /package/dist/{types/hooks → hooks}/index.d.ts +0 -0
  74. /package/dist/{types/setupTests.d.ts → setupTests.d.ts} +0 -0
package/dist/index.esm.js DELETED
@@ -1,2023 +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|uni\.eth|cb\.id)$/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}$/,
36
- BTC_ADDRESS: /^(?:[13][a-km-zA-HJ-NP-Z1-9]{25,34}|bc1[qp][a-z0-9]{11,71})$/,
37
- SOLANA_ADDRESS: /^[1-9A-HJ-NP-Za-km-z]{32,44}$/,
38
- LOWERCASE_EXEMPT: /^(?:[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})$/,
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["dotbit"] = "dotbit";
47
- PlatformType["lens"] = "lens";
48
- PlatformType["box"] = "box";
49
- PlatformType["ethereum"] = "ethereum";
50
- PlatformType["twitter"] = "twitter";
51
- PlatformType["nextid"] = "nextid";
52
- PlatformType["bitcoin"] = "bitcoin";
53
- PlatformType["keybase"] = "keybase";
54
- PlatformType["reddit"] = "reddit";
55
- PlatformType["github"] = "github";
56
- PlatformType["unstoppableDomains"] = "unstoppabledomains";
57
- PlatformType["basenames"] = "basenames";
58
- PlatformType["linea"] = "linea";
59
- PlatformType["ckb"] = "ckb";
60
- PlatformType["farcaster"] = "farcaster";
61
- PlatformType["space_id"] = "space_id";
62
- PlatformType["telegram"] = "telegram";
63
- PlatformType["instagram"] = "instagram";
64
- PlatformType["cyberconnect"] = "cyberconnect";
65
- PlatformType["opensea"] = "opensea";
66
- PlatformType["discord"] = "discord";
67
- PlatformType["calendly"] = "calendly";
68
- PlatformType["url"] = "url";
69
- PlatformType["website"] = "website";
70
- PlatformType["linkedin"] = "linkedin";
71
- PlatformType["dns"] = "dns";
72
- PlatformType["tron"] = "tron";
73
- PlatformType["hey"] = "hey";
74
- PlatformType["facebook"] = "facebook";
75
- PlatformType["threads"] = "threads";
76
- PlatformType["whatsapp"] = "whatsapp";
77
- PlatformType["weibo"] = "weibo";
78
- PlatformType["youtube"] = "youtube";
79
- PlatformType["tiktok"] = "tiktok";
80
- PlatformType["bilibili"] = "bilibili";
81
- PlatformType["medium"] = "medium";
82
- PlatformType["mirror"] = "mirror";
83
- PlatformType["zerion"] = "zerion";
84
- PlatformType["aave"] = "aave";
85
- PlatformType["rainbow"] = "rainbow";
86
- PlatformType["bluesky"] = "bluesky";
87
- PlatformType["nostr"] = "nostr";
88
- PlatformType["poap"] = "poap";
89
- PlatformType["uniswap"] = "uniswap";
90
- PlatformType["degenscore"] = "degenscore";
91
- PlatformType["firefly"] = "firefly";
92
- PlatformType["solana"] = "solana";
93
- PlatformType["sns"] = "sns";
94
- PlatformType["mstdnjp"] = "mstdnjp";
95
- PlatformType["lobsters"] = "lobsters";
96
- PlatformType["hackernews"] = "hackernews";
97
- PlatformType["crossbell"] = "crossbell";
98
- PlatformType["minds"] = "minds";
99
- PlatformType["paragraph"] = "paragraph";
100
- PlatformType["genome"] = "genome";
101
- PlatformType["gnosis"] = "gnosis";
102
- PlatformType["webacy"] = "webacy";
103
- PlatformType["clusters"] = "clusters";
104
- PlatformType["guild"] = "guild";
105
- PlatformType["ton"] = "ton";
106
- PlatformType["snapshot"] = "snapshot";
107
- PlatformType["coingecko"] = "coingecko";
108
- PlatformType["gitcoin"] = "gitcoin";
109
- PlatformType["humanpassport"] = "humanpassport";
110
- PlatformType["talent"] = "talentprotocol";
111
- PlatformType["doge"] = "doge";
112
- PlatformType["bsc"] = "bsc";
113
- PlatformType["aptos"] = "aptos";
114
- PlatformType["near"] = "near";
115
- PlatformType["stacks"] = "stacks";
116
- PlatformType["cosmos"] = "cosmos";
117
- PlatformType["zeta"] = "zeta";
118
- PlatformType["mode"] = "mode";
119
- PlatformType["arbitrum"] = "arbitrum";
120
- PlatformType["scroll"] = "scroll";
121
- PlatformType["taiko"] = "taiko";
122
- PlatformType["mint"] = "mint";
123
- PlatformType["zkfair"] = "zkfair";
124
- PlatformType["manta"] = "manta";
125
- PlatformType["lightlink"] = "lightlink";
126
- PlatformType["merlin"] = "merlin";
127
- PlatformType["alienx"] = "alienx";
128
- PlatformType["edgeless"] = "edgeless";
129
- PlatformType["tomo"] = "tomo";
130
- PlatformType["ailayer"] = "ailayer";
131
- PlatformType["philand"] = "philand";
132
- PlatformType["efp"] = "efp";
133
- PlatformType["gravity"] = "gravity";
134
- })(PlatformType || (PlatformType = {}));
135
- var PlatformSystem;
136
- (function (PlatformSystem) {
137
- PlatformSystem[PlatformSystem["web2"] = 0] = "web2";
138
- PlatformSystem[PlatformSystem["web3"] = 1] = "web3";
139
- })(PlatformSystem || (PlatformSystem = {}));
140
- const DEFAULT_PLATFORM = {
141
- color: "#000000",
142
- icon: "",
143
- label: "",
144
- description: "",
145
- urlPrefix: "",
146
- ensText: [],
147
- registerlink: "",
148
- editUrlPrefix: "",
149
- system: PlatformSystem.web3,
150
- };
151
- const PLATFORM_DATA = new Map([
152
- [
153
- PlatformType.twitter,
154
- {
155
- color: "#000000",
156
- icon: "icons/icon-x.svg",
157
- label: "Twitter (X)",
158
- urlPrefix: "https://x.com/",
159
- ensText: ["com.twitter", "com.x", "vnd.twitter", "twitter"],
160
- system: PlatformSystem.web2,
161
- },
162
- ],
163
- [
164
- PlatformType.ens,
165
- {
166
- color: "#0080bc",
167
- icon: "icons/icon-ens.svg",
168
- label: "ENS",
169
- description: "Ethereum Name Service (ENS and .eth domain)",
170
- urlPrefix: "https://app.ens.domains/",
171
- registerlink: "https://app.ens.domains/{name}",
172
- editUrlPrefix: "https://app.ens.domains/{name}",
173
- system: PlatformSystem.web3,
174
- },
175
- ],
176
- [
177
- PlatformType.ethereum,
178
- {
179
- color: "#3741ba",
180
- icon: "icons/icon-ethereum.svg",
181
- label: "Ethereum",
182
- urlPrefix: "https://etherscan.io/address/",
183
- editUrlPrefix: "https://app.ens.domains/{name}",
184
- system: PlatformSystem.web3,
185
- },
186
- ],
187
- [
188
- PlatformType.farcaster,
189
- {
190
- color: "#432C8D",
191
- icon: "icons/icon-farcaster.svg",
192
- label: "Farcaster",
193
- description: "Farcaster social identity (Fname handle)",
194
- urlPrefix: "https://farcaster.xyz/",
195
- editUrlPrefix: "https://farcaster.xyz/~/settings",
196
- ensText: ["farcaster", "xyz.farcaster"],
197
- registerlink: "https://farcaster.xyz/~/invite-page/1000?id=8ebad588&name={name}",
198
- system: PlatformSystem.web2,
199
- },
200
- ],
201
- [
202
- PlatformType.github,
203
- {
204
- color: "#000000",
205
- icon: "icons/icon-github.svg",
206
- label: "GitHub",
207
- urlPrefix: "https://github.com/",
208
- ensText: ["com.github", "vnd.github", "github"],
209
- system: PlatformSystem.web2,
210
- },
211
- ],
212
- [
213
- PlatformType.keybase,
214
- {
215
- color: "#4162E2",
216
- icon: "icons/icon-keybase.svg",
217
- label: "Keybase",
218
- urlPrefix: "https://keybase.io/",
219
- ensText: ["io.keybase", "keybase"],
220
- system: PlatformSystem.web2,
221
- },
222
- ],
223
- [
224
- PlatformType.lens,
225
- {
226
- color: "#2CC256",
227
- icon: "icons/icon-lens.svg",
228
- label: "Lens",
229
- description: "Lens social identity (.lens handle)",
230
- urlPrefix: "https://hey.xyz/u/",
231
- editUrlPrefix: "https://hey.xyz/settings",
232
- ensText: ["lens"],
233
- registerlink: "https://www.lens.xyz/mint?name={name}",
234
- system: PlatformSystem.web2,
235
- },
236
- ],
237
- [
238
- PlatformType.box,
239
- {
240
- color: "#1a1a1a",
241
- icon: "icons/icon-box.svg",
242
- label: "Box",
243
- registerlink: "https://my.box/buy/configure?domain={name}&ref=web3bio",
244
- system: PlatformSystem.web3,
245
- },
246
- ],
247
- [
248
- PlatformType.nextid,
249
- {
250
- color: "#000000",
251
- icon: "icons/icon-nextid.svg",
252
- label: "Next.ID",
253
- urlPrefix: "https://web3.bio/",
254
- system: PlatformSystem.web3,
255
- },
256
- ],
257
- [
258
- PlatformType.bitcoin,
259
- {
260
- color: "#F7931A",
261
- icon: "icons/icon-bitcoin.svg",
262
- label: "Bitcoin",
263
- urlPrefix: "https://explorer.cloverpool.com/btc/address/",
264
- system: PlatformSystem.web3,
265
- },
266
- ],
267
- [
268
- PlatformType.reddit,
269
- {
270
- color: "#ff4500",
271
- icon: "icons/icon-reddit.svg",
272
- label: "Reddit",
273
- urlPrefix: "https://www.reddit.com/user/",
274
- ensText: ["com.reddit"],
275
- system: PlatformSystem.web2,
276
- },
277
- ],
278
- [
279
- PlatformType.space_id,
280
- {
281
- color: "#71EBAA",
282
- icon: "icons/icon-spaceid.svg",
283
- label: "SPACE ID",
284
- registerlink: "https://space.id/search?query={name}",
285
- urlPrefix: "https://web3.bio/?s=",
286
- system: PlatformSystem.web3,
287
- },
288
- ],
289
- [
290
- PlatformType.unstoppableDomains,
291
- {
292
- color: "#2E65F5",
293
- icon: "icons/icon-unstoppabledomains.svg",
294
- label: "Unstoppable Domains",
295
- description: "Unstoppable Domains (.x, .crypto and other Web3 domains), and ud.me Unstoppable Profiles",
296
- urlPrefix: "https://web3.bio/",
297
- editUrlPrefix: "https://unstoppabledomains.com/d/{name}",
298
- registerlink: "https://unstoppabledomains.com/search?searchTerm={name}",
299
- system: PlatformSystem.web3,
300
- },
301
- ],
302
- [
303
- PlatformType.basenames,
304
- {
305
- color: "#0052ff",
306
- icon: "icons/icon-base.svg",
307
- label: "Basenames",
308
- description: "Basenames (.base.eth domains) based on ENS",
309
- urlPrefix: "https://www.base.org/name/",
310
- editUrlPrefix: "https://www.base.org/name/{name}",
311
- registerlink: "https://www.base.org/names?claim={name}",
312
- system: PlatformSystem.web3,
313
- },
314
- ],
315
- [
316
- PlatformType.linea,
317
- {
318
- color: "#591FE6",
319
- icon: "icons/icon-linea.svg",
320
- label: "Linea Name Service",
321
- description: "Linea Name Service (.linea.eth domains) based on ENS",
322
- urlPrefix: "https://names.linea.build/",
323
- editUrlPrefix: "https://names.linea.build/{name}",
324
- registerlink: "https://names.linea.build/{name}/register",
325
- system: PlatformSystem.web3,
326
- },
327
- ],
328
- [
329
- PlatformType.ckb,
330
- {
331
- color: "#000000",
332
- icon: "icons/icon-ckb.svg",
333
- label: "Nervos",
334
- urlPrefix: "https://explorer.nervos.org/address/",
335
- system: PlatformSystem.web3,
336
- },
337
- ],
338
- [
339
- PlatformType.telegram,
340
- {
341
- color: "#0088cc",
342
- icon: "icons/icon-telegram.svg",
343
- label: "Telegram",
344
- ensText: ["org.telegram", "vnd.telegram", "telegram"],
345
- urlPrefix: "https://t.me/",
346
- system: PlatformSystem.web2,
347
- },
348
- ],
349
- [
350
- PlatformType.instagram,
351
- {
352
- color: "#E1306C",
353
- icon: "icons/icon-instagram.svg",
354
- label: "Instagram",
355
- ensText: ["com.instagram", "instagram"],
356
- urlPrefix: "https://www.instagram.com/",
357
- system: PlatformSystem.web2,
358
- },
359
- ],
360
- [
361
- PlatformType.weibo,
362
- {
363
- color: "#df2029",
364
- label: "Weibo",
365
- urlPrefix: "https://weibo.com/",
366
- system: PlatformSystem.web2,
367
- },
368
- ],
369
- [
370
- PlatformType.dotbit,
371
- {
372
- color: "#0e7dff",
373
- icon: "icons/icon-dotbit.svg",
374
- label: ".bit",
375
- urlPrefix: "https://d.id/",
376
- registerlink: "https://d.id/bit/account/create/{name}",
377
- system: PlatformSystem.web3,
378
- },
379
- ],
380
- [
381
- PlatformType.cyberconnect,
382
- {
383
- color: "#000000",
384
- icon: "icons/icon-cyberconnect.svg",
385
- label: "CyberConnect",
386
- urlPrefix: "https://link3.to/",
387
- registerlink: "",
388
- system: PlatformSystem.web3,
389
- },
390
- ],
391
- [
392
- PlatformType.opensea,
393
- {
394
- color: "#407FDB",
395
- icon: "icons/icon-opensea.svg",
396
- label: "OpenSea",
397
- urlPrefix: "https://opensea.io/",
398
- system: PlatformSystem.web3,
399
- },
400
- ],
401
- [
402
- PlatformType.discord,
403
- {
404
- color: "#5865f2",
405
- icon: "icons/icon-discord.svg",
406
- label: "Discord",
407
- urlPrefix: "",
408
- ensText: ["discord", "com.discord"],
409
- system: PlatformSystem.web2,
410
- },
411
- ],
412
- [
413
- PlatformType.calendly,
414
- {
415
- color: "#2F69F6",
416
- icon: "icons/icon-calendly.svg",
417
- label: "Calendly",
418
- urlPrefix: "https://calendly.com/",
419
- ensText: ["calendly", "com.calendly"],
420
- system: PlatformSystem.web2,
421
- },
422
- ],
423
- [
424
- PlatformType.url,
425
- {
426
- color: "#121212",
427
- icon: "icons/icon-web.svg",
428
- label: "Website",
429
- urlPrefix: "",
430
- system: PlatformSystem.web2,
431
- },
432
- ],
433
- [
434
- PlatformType.website,
435
- {
436
- color: "#121212",
437
- icon: "icons/icon-web.svg",
438
- label: "Website",
439
- urlPrefix: "",
440
- ensText: ["url", "website"],
441
- system: PlatformSystem.web2,
442
- },
443
- ],
444
- [
445
- PlatformType.linkedin,
446
- {
447
- color: "#195DB4",
448
- icon: "icons/icon-linkedin.svg",
449
- label: "LinkedIn",
450
- ensText: ["com.linkedin", "linkedin"],
451
- urlPrefix: "https://www.linkedin.com/in/",
452
- system: PlatformSystem.web2,
453
- },
454
- ],
455
- [
456
- PlatformType.dns,
457
- {
458
- color: "#000000",
459
- icon: "icons/icon-web.svg",
460
- label: "DNS",
461
- urlPrefix: "https://",
462
- system: PlatformSystem.web2,
463
- },
464
- ],
465
- [
466
- PlatformType.tron,
467
- {
468
- color: "#EB0029",
469
- icon: "icons/icon-tron.svg",
470
- label: "Tron",
471
- urlPrefix: "https://tronscan.org/#/address/",
472
- system: PlatformSystem.web3,
473
- },
474
- ],
475
- [
476
- PlatformType.hey,
477
- {
478
- color: "#E84F64",
479
- icon: "icons/icon-hey.svg",
480
- label: "Hey",
481
- urlPrefix: "https://hey.xyz/u/",
482
- system: PlatformSystem.web3,
483
- },
484
- ],
485
- [
486
- PlatformType.facebook,
487
- {
488
- color: "#385898",
489
- icon: "icons/icon-facebook.svg",
490
- label: "Facebook",
491
- urlPrefix: "https://www.facebook.com/",
492
- ensText: ["com.facebook", "facebook"],
493
- system: PlatformSystem.web2,
494
- },
495
- ],
496
- [
497
- PlatformType.threads,
498
- {
499
- color: "#000000",
500
- icon: "icons/icon-threads.svg",
501
- label: "Threads",
502
- urlPrefix: "https://www.threads.net/",
503
- system: PlatformSystem.web2,
504
- },
505
- ],
506
- [
507
- PlatformType.whatsapp,
508
- {
509
- color: "#25d366",
510
- icon: "icons/icon-whatsapp.svg",
511
- label: "WhatsApp",
512
- urlPrefix: "https://wa.me/",
513
- ensText: ["com.whatsapp", "whatsapp"],
514
- system: PlatformSystem.web2,
515
- },
516
- ],
517
- [
518
- PlatformType.youtube,
519
- {
520
- color: "#FF0000",
521
- icon: "icons/icon-youtube.svg",
522
- label: "Youtube",
523
- urlPrefix: "https://www.youtube.com/",
524
- ensText: ["com.youtube", "youtube"],
525
- system: PlatformSystem.web2,
526
- },
527
- ],
528
- [
529
- PlatformType.tiktok,
530
- {
531
- color: "#000000",
532
- icon: "icons/icon-tiktok.svg",
533
- label: "TikTok",
534
- urlPrefix: "https://www.tiktok.com/@",
535
- system: PlatformSystem.web2,
536
- },
537
- ],
538
- [
539
- PlatformType.bilibili,
540
- {
541
- color: "#00aeec",
542
- icon: "icons/icon-bilibili.svg",
543
- label: "Bilibili",
544
- urlPrefix: "https://www.bilibili.com/",
545
- system: PlatformSystem.web2,
546
- },
547
- ],
548
- [
549
- PlatformType.medium,
550
- {
551
- color: "#000000",
552
- icon: "icons/icon-medium.svg",
553
- label: "Medium",
554
- urlPrefix: "https://medium.com/",
555
- system: PlatformSystem.web2,
556
- },
557
- ],
558
- [
559
- PlatformType.mirror,
560
- {
561
- color: "#007aff",
562
- icon: "icons/icon-mirror.svg",
563
- label: "Mirror",
564
- urlPrefix: "https://mirror.xyz/",
565
- system: PlatformSystem.web3,
566
- },
567
- ],
568
- [
569
- PlatformType.zerion,
570
- {
571
- color: "#3560E5",
572
- icon: "icons/icon-zerion.svg",
573
- label: "Zerion",
574
- system: PlatformSystem.web3,
575
- },
576
- ],
577
- [
578
- PlatformType.aave,
579
- {
580
- color: "#9896FF",
581
- icon: "icons/icon-aave.svg",
582
- label: "AAVE",
583
- system: PlatformSystem.web3,
584
- },
585
- ],
586
- [
587
- PlatformType.rainbow,
588
- {
589
- color: "#000000",
590
- icon: "icons/icon-rainbow.svg",
591
- label: "Rainbow",
592
- system: PlatformSystem.web3,
593
- },
594
- ],
595
- [
596
- PlatformType.bluesky,
597
- {
598
- color: "#0085ff",
599
- icon: "icons/icon-bluesky.svg",
600
- label: "Bluesky",
601
- urlPrefix: "https://bsky.app/profile/",
602
- ensText: ["app.bsky", "bluesky"],
603
- system: PlatformSystem.web3,
604
- },
605
- ],
606
- [
607
- PlatformType.nostr,
608
- {
609
- color: "#5E287D",
610
- icon: "icons/icon-nostr.svg",
611
- label: "Nostr",
612
- urlPrefix: "https://app.coracle.social/",
613
- ensText: ["nostr"],
614
- system: PlatformSystem.web2,
615
- },
616
- ],
617
- [
618
- PlatformType.poap,
619
- {
620
- color: "#5E58A5",
621
- icon: "icons/icon-poap.svg",
622
- label: "POAP",
623
- urlPrefix: "https://app.poap.xyz/scan/",
624
- system: PlatformSystem.web3,
625
- },
626
- ],
627
- [
628
- PlatformType.uniswap,
629
- {
630
- color: "#ff007a",
631
- icon: "icons/icon-uniswap.svg",
632
- label: "Uniswap",
633
- urlPrefix: "https://uniswap.org/",
634
- system: PlatformSystem.web3,
635
- },
636
- ],
637
- [
638
- PlatformType.degenscore,
639
- {
640
- color: "#a855f7",
641
- icon: "icons/icon-degenscore.svg",
642
- label: "DegenScore",
643
- urlPrefix: "https://degenscore.com/beacon/",
644
- system: PlatformSystem.web3,
645
- },
646
- ],
647
- [
648
- PlatformType.webacy,
649
- {
650
- color: "#000000",
651
- icon: "icons/icon-webacy.svg",
652
- label: "Webacy",
653
- urlPrefix: "https://dapp.webacy.com/",
654
- system: PlatformSystem.web3,
655
- },
656
- ],
657
- [
658
- PlatformType.firefly,
659
- {
660
- color: "#1A183D",
661
- icon: "icons/icon-firefly.svg",
662
- label: "Firefly",
663
- urlPrefix: "https://firefly.social/",
664
- system: PlatformSystem.web3,
665
- },
666
- ],
667
- [
668
- PlatformType.solana,
669
- {
670
- color: "#9945FF",
671
- icon: "icons/icon-solana.svg",
672
- label: "Solana",
673
- urlPrefix: "https://solscan.io/address/",
674
- editUrlPrefix: "https://www.sns.id/domain?domain={name}",
675
- system: PlatformSystem.web3,
676
- },
677
- ],
678
- [
679
- PlatformType.sns,
680
- {
681
- color: "#6363E1",
682
- icon: "icons/icon-sns.svg",
683
- label: "SNS",
684
- description: "Solana Name Service (SNS and .sol domain)",
685
- urlPrefix: "https://www.sns.id/search?search=",
686
- registerlink: "https://www.sns.id/search?search={name}",
687
- editUrlPrefix: "https://www.sns.id/domain?domain={name}",
688
- system: PlatformSystem.web3,
689
- },
690
- ],
691
- [
692
- PlatformType.mstdnjp,
693
- {
694
- color: "#595aff",
695
- icon: "icons/icon-mastodon.svg",
696
- label: "mstdn.jp",
697
- urlPrefix: "https://mstdn.jp/@",
698
- system: PlatformSystem.web3,
699
- },
700
- ],
701
- [
702
- PlatformType.lobsters,
703
- {
704
- color: "#ac130d",
705
- icon: "icons/icon-lobsters.svg",
706
- label: "Lobsters",
707
- urlPrefix: "https://lobste.rs/~",
708
- system: PlatformSystem.web2,
709
- },
710
- ],
711
- [
712
- PlatformType.hackernews,
713
- {
714
- color: "#ff6600",
715
- icon: "icons/icon-hackernews.svg",
716
- label: "Hacker News",
717
- urlPrefix: "https://news.ycombinator.com/user?id=",
718
- system: PlatformSystem.web2,
719
- },
720
- ],
721
- [
722
- PlatformType.crossbell,
723
- {
724
- color: "#FFCF55",
725
- icon: "icons/icon-crossbell.svg",
726
- label: "Crossbell",
727
- urlPrefix: "https://crossbell.io/@",
728
- registerlink: "https://crossbell.io",
729
- system: PlatformSystem.web3,
730
- },
731
- ],
732
- [
733
- PlatformType.minds,
734
- {
735
- color: "#f7d354",
736
- icon: "icons/icon-minds.svg",
737
- label: "Minds",
738
- urlPrefix: "https://www.minds.com/",
739
- system: PlatformSystem.web2,
740
- },
741
- ],
742
- [
743
- PlatformType.paragraph,
744
- {
745
- color: "#2563eb",
746
- icon: "icons/icon-paragraph.svg",
747
- label: "Paragraph",
748
- urlPrefix: "https://paragraph.xyz/",
749
- system: PlatformSystem.web3,
750
- },
751
- ],
752
- [
753
- PlatformType.genome,
754
- {
755
- color: "#6DD85D",
756
- icon: "icons/icon-gnosis.svg",
757
- label: "Genome",
758
- urlPrefix: "https://genomedomains.com/name/",
759
- registerlink: "https://space.id/tld/14/domains?query={name}",
760
- system: PlatformSystem.web3,
761
- },
762
- ],
763
- [
764
- PlatformType.gnosis,
765
- {
766
- color: "#1c352a",
767
- icon: "icons/icon-gnosis.svg",
768
- label: "Gnosis",
769
- urlPrefix: "https://gnosisscan.io/address/",
770
- system: PlatformSystem.web3,
771
- },
772
- ],
773
- [
774
- PlatformType.clusters,
775
- {
776
- color: "#f0555d",
777
- icon: "icons/icon-clusters.svg",
778
- label: "Clusters",
779
- urlPrefix: "https://clusters.xyz/",
780
- registerlink: "https://clusters.xyz/register/{name}",
781
- system: PlatformSystem.web3,
782
- },
783
- ],
784
- [
785
- PlatformType.guild,
786
- {
787
- color: "#6062eb",
788
- icon: "icons/icon-guild.svg",
789
- label: "Guild",
790
- urlPrefix: "https://guild.xyz/",
791
- system: PlatformSystem.web2,
792
- },
793
- ],
794
- [
795
- PlatformType.ton,
796
- {
797
- color: "#0098EA",
798
- icon: "icons/icon-ton.svg",
799
- label: "TON",
800
- urlPrefix: "https://tonscan.org/address/",
801
- system: PlatformSystem.web3,
802
- },
803
- ],
804
- [
805
- PlatformType.snapshot,
806
- {
807
- color: "#ffb503",
808
- icon: "icons/icon-snapshot.svg",
809
- label: "Snapshot",
810
- urlPrefix: "https://snapshot.org/",
811
- system: PlatformSystem.web3,
812
- },
813
- ],
814
- [
815
- PlatformType.coingecko,
816
- {
817
- color: "#4BCC00",
818
- icon: "icons/icon-coingecko.svg",
819
- label: "CoinGecko",
820
- urlPrefix: "https://www.coingecko.com/en/coins/",
821
- system: PlatformSystem.web2,
822
- },
823
- ],
824
- [
825
- PlatformType.gitcoin,
826
- {
827
- color: "#4A47D3",
828
- icon: "icons/icon-gitcoin.svg",
829
- label: "Gitcoin Passport",
830
- urlPrefix: "https://passport.gitcoin.co/",
831
- system: PlatformSystem.web3,
832
- },
833
- ],
834
- [
835
- PlatformType.humanpassport,
836
- {
837
- color: "#006b57",
838
- icon: "icons/icon-humanpassport.svg",
839
- label: "Human Passport",
840
- urlPrefix: "https://passport.human.tech/",
841
- system: PlatformSystem.web3,
842
- },
843
- ],
844
- [
845
- PlatformType.talent,
846
- {
847
- color: "#715AE4",
848
- icon: "icons/icon-talent.svg",
849
- label: "Talent",
850
- urlPrefix: "https://passport.talentprotocol.com/profile/",
851
- system: PlatformSystem.web3,
852
- },
853
- ],
854
- [
855
- PlatformType.doge,
856
- {
857
- color: "#dfc66d",
858
- icon: "icons/icon-doge.svg",
859
- label: "Dogecoin",
860
- urlPrefix: "https://dogechain.info/address/",
861
- system: PlatformSystem.web3,
862
- },
863
- ],
864
- [
865
- PlatformType.bsc,
866
- {
867
- color: "#f0b90b",
868
- icon: "icons/icon-bsc.svg",
869
- label: "Binance Smart Chain",
870
- urlPrefix: "https://bscscan.com/address/",
871
- system: PlatformSystem.web3,
872
- },
873
- ],
874
- [
875
- PlatformType.aptos,
876
- {
877
- color: "#6fe0b2",
878
- icon: "icons/icon-aptos.svg",
879
- label: "Aptos",
880
- urlPrefix: "https://explorer.aptoslabs.com/account/",
881
- system: PlatformSystem.web3,
882
- },
883
- ],
884
- [
885
- PlatformType.near,
886
- {
887
- color: "#000000",
888
- icon: "icons/icon-near.svg",
889
- label: "NEAR Protocol",
890
- urlPrefix: "https://nearblocks.io/address/",
891
- registerlink: "https://app.mynearwallet.com/create/?name={name}",
892
- system: PlatformSystem.web3,
893
- },
894
- ],
895
- [
896
- PlatformType.stacks,
897
- {
898
- color: "#725DF6",
899
- icon: "icons/icon-stacks.svg",
900
- label: "Stacks",
901
- urlPrefix: "https://explorer.hiro.so/address/",
902
- system: PlatformSystem.web3,
903
- },
904
- ],
905
- [
906
- PlatformType.cosmos,
907
- {
908
- color: "#000000",
909
- icon: "icons/icon-cosmos.svg",
910
- label: "Cosmos",
911
- urlPrefix: "https://www.mintscan.io/cosmos/account/",
912
- system: PlatformSystem.web3,
913
- },
914
- ],
915
- [
916
- PlatformType.zeta,
917
- {
918
- color: "#005741",
919
- icon: "icons/icon-zeta.svg",
920
- label: "Zeta Name Service",
921
- urlPrefix: "https://explorer.zetachain.com/address/",
922
- registerlink: "https://space.id/tld/11/domains?query={name}",
923
- system: PlatformSystem.web3,
924
- },
925
- ],
926
- [
927
- PlatformType.mode,
928
- {
929
- color: "#E5FD52",
930
- icon: "icons/icon-mode.svg",
931
- label: "Mode Name Service",
932
- urlPrefix: "https://explorer.mode.network/address/",
933
- registerlink: "https://space.id/tld/6/domains?query={name}",
934
- system: PlatformSystem.web3,
935
- },
936
- ],
937
- [
938
- PlatformType.arbitrum,
939
- {
940
- color: "#2949d4",
941
- icon: "icons/icon-arbitrum.svg",
942
- label: ".arb Name Service",
943
- urlPrefix: "https://arbiscan.io/address/",
944
- registerlink: "https://space.id/tld/2/domains?query={name}",
945
- system: PlatformSystem.web3,
946
- },
947
- ],
948
- [
949
- PlatformType.scroll,
950
- {
951
- color: "#b78544",
952
- icon: "icons/icon-scroll.svg",
953
- label: "Scroll",
954
- urlPrefix: "https://scrollscan.com/address/",
955
- system: PlatformSystem.web3,
956
- },
957
- ],
958
- [
959
- PlatformType.taiko,
960
- {
961
- color: "#E81899",
962
- icon: "icons/icon-taiko.svg",
963
- label: "DotTaiko Name Service",
964
- urlPrefix: "https://taikoscan.io/address/",
965
- registerlink: "https://space.id/tld/16/domains?query={name}",
966
- system: PlatformSystem.web3,
967
- },
968
- ],
969
- [
970
- PlatformType.mint,
971
- {
972
- color: "#00A57C",
973
- icon: "icons/icon-mint.svg",
974
- label: "Mint Name Service",
975
- urlPrefix: "https://explorer.mintchain.io/address/",
976
- registerlink: "https://space.id/tld/18/domains?query={name}",
977
- system: PlatformSystem.web3,
978
- },
979
- ],
980
- [
981
- PlatformType.zkfair,
982
- {
983
- color: "#D43F36",
984
- icon: "icons/icon-zkfair.svg",
985
- label: "zkFair",
986
- urlPrefix: "https://scan.zkfair.io/address/",
987
- registerlink: "https://space.id/tld/8/domains?query={name}",
988
- system: PlatformSystem.web3,
989
- },
990
- ],
991
- [
992
- PlatformType.manta,
993
- {
994
- color: "#0091ff",
995
- icon: "icons/icon-manta.svg",
996
- label: "Manta Name Service",
997
- urlPrefix: "https://pacific-explorer.manta.network/address/",
998
- registerlink: "https://space.id/tld/3/domains?query={name}",
999
- system: PlatformSystem.web3,
1000
- },
1001
- ],
1002
- [
1003
- PlatformType.lightlink,
1004
- {
1005
- color: "#00BFFF",
1006
- icon: "icons/icon-lightlink.svg",
1007
- label: "LightLink Name Service",
1008
- urlPrefix: "https://phoenix.lightlink.io/address/",
1009
- registerlink: "https://space.id/tld/9/domains?query={name}",
1010
- system: PlatformSystem.web3,
1011
- },
1012
- ],
1013
- [
1014
- PlatformType.merlin,
1015
- {
1016
- color: "#5A32A3",
1017
- icon: "icons/icon-merlin.svg",
1018
- label: "Merlin Name Service",
1019
- urlPrefix: "https://scan.merlinchain.io/address/",
1020
- registerlink: "https://space.id/tld/12/domains?query={name}",
1021
- system: PlatformSystem.web3,
1022
- },
1023
- ],
1024
- [
1025
- PlatformType.alienx,
1026
- {
1027
- color: "#D5F462",
1028
- icon: "icons/icon-alienx.svg",
1029
- label: "AlienX Name Service",
1030
- urlPrefix: "https://explorer.alienxchain.io/address/",
1031
- registerlink: "https://space.id/tld/17/domains?query={name}",
1032
- system: PlatformSystem.web3,
1033
- },
1034
- ],
1035
- [
1036
- PlatformType.edgeless,
1037
- {
1038
- color: "#a0eb67",
1039
- icon: "icons/icon-edgeless.svg",
1040
- label: "Edgeless",
1041
- urlPrefix: "https://explorer.edgeless.network/address/",
1042
- registerlink: "",
1043
- system: PlatformSystem.web3,
1044
- },
1045
- ],
1046
- [
1047
- PlatformType.tomo,
1048
- {
1049
- color: "#DE3A7E",
1050
- icon: "icons/icon-tomo.svg",
1051
- label: "Tomo Name Service",
1052
- registerlink: "https://space.id/tld/10/domains?query={name}",
1053
- system: PlatformSystem.web3,
1054
- },
1055
- ],
1056
- [
1057
- PlatformType.ailayer,
1058
- {
1059
- color: "#A283FF",
1060
- icon: "icons/icon-ailayer.svg",
1061
- label: "AILayer Name Service",
1062
- urlPrefix: "https://mainnet-explorer.ailayer.xyz/address/",
1063
- registerlink: "https://space.id/tld/19/domains?query={name}",
1064
- system: PlatformSystem.web3,
1065
- },
1066
- ],
1067
- [
1068
- PlatformType.philand,
1069
- {
1070
- color: "#8080F7",
1071
- icon: "icons/icon-phi.svg",
1072
- label: "Phi",
1073
- urlPrefix: "https://land.philand.xyz/",
1074
- system: PlatformSystem.web3,
1075
- },
1076
- ],
1077
- [
1078
- PlatformType.efp,
1079
- {
1080
- color: "#FFE067",
1081
- icon: "icons/icon-efp.svg",
1082
- label: "Ethereum Follow Protocol",
1083
- urlPrefix: "https://ethfollow.xyz/",
1084
- system: PlatformSystem.web3,
1085
- },
1086
- ],
1087
- [
1088
- PlatformType.gravity,
1089
- {
1090
- color: "#FFAC43",
1091
- icon: "icons/icon-gravity.svg",
1092
- label: "Gravity Name Service",
1093
- registerlink: "https://space.id/tld/23/domains?query={name}",
1094
- system: PlatformSystem.web3,
1095
- },
1096
- ],
1097
- ]);
1098
-
1099
- /**
1100
- * Resolves an identity string to a platform and identifier
1101
- * @param input The identity to resolve
1102
- * @returns A formatted identity string or null if invalid
1103
- */
1104
- const resolveIdentity = (input) => {
1105
- if (!input)
1106
- return null;
1107
- const parts = input.split(",");
1108
- let platform;
1109
- let identity;
1110
- if (parts.length === 2) {
1111
- // Format is already "platform,identity"
1112
- platform = parts[0];
1113
- identity = prettify(parts[1]);
1114
- }
1115
- else if (parts.length === 1) {
1116
- // Auto-detect platform from the identity string
1117
- platform = detectPlatform(input);
1118
- identity = prettify(input);
1119
- }
1120
- else {
1121
- return null;
1122
- }
1123
- if (!isSupportedPlatform(platform) || !identity)
1124
- return null;
1125
- // Normalize case except for case-sensitive identities
1126
- const normalizedIdentity = REGEX.LOWERCASE_EXEMPT.test(identity)
1127
- ? identity
1128
- : identity.toLowerCase();
1129
- return `${platform},${normalizedIdentity}`;
1130
- };
1131
- /**
1132
- * Clean up and standardize identity format
1133
- */
1134
- const prettify = (input) => {
1135
- if (!input)
1136
- return "";
1137
- if (input.endsWith(".twitter"))
1138
- return input.replace(".twitter", "");
1139
- if (input.endsWith(".nextid"))
1140
- return input.replace(".nextid", "");
1141
- if (input.startsWith("farcaster,#"))
1142
- return input.replace(/^(farcaster),/, "");
1143
- if (input.endsWith(".farcaster") ||
1144
- input.endsWith(".fcast.id") ||
1145
- input.endsWith(".farcaster.eth")) {
1146
- return input.replace(/(\.farcaster|\.fcast\.id|\.farcaster\.eth)$/, "");
1147
- }
1148
- if (input.endsWith(".base") || input.endsWith(".linea")) {
1149
- return input.split(".")[0] + "." + input.split(".").pop() + ".eth";
1150
- }
1151
- return input;
1152
- };
1153
- /**
1154
- * Check if the platform is supported for API queries
1155
- */
1156
- const isSupportedPlatform = (platform) => {
1157
- if (!platform)
1158
- return false;
1159
- return Object.values(PlatformType).includes(platform);
1160
- };
1161
- /**
1162
- * Detect platform from identity string based on regex patterns
1163
- */
1164
- const detectPlatform = (term) => {
1165
- if (term.endsWith(".farcaster.eth"))
1166
- return PlatformType.farcaster;
1167
- const platformMap = [
1168
- [REGEX.BASENAMES, PlatformType.basenames],
1169
- [REGEX.LINEA, PlatformType.linea],
1170
- [REGEX.ENS, PlatformType.ens],
1171
- [REGEX.ETH_ADDRESS, PlatformType.ethereum],
1172
- [REGEX.LENS, PlatformType.lens],
1173
- [REGEX.UNSTOPPABLE_DOMAINS, PlatformType.unstoppableDomains],
1174
- [REGEX.SPACE_ID, PlatformType.space_id],
1175
- [REGEX.DOTBIT, PlatformType.dotbit],
1176
- [REGEX.SNS, PlatformType.sns],
1177
- [REGEX.BTC_ADDRESS, PlatformType.bitcoin],
1178
- [REGEX.SOLANA_ADDRESS, PlatformType.solana],
1179
- [REGEX.FARCASTER, PlatformType.farcaster],
1180
- [REGEX.TWITTER, PlatformType.twitter],
1181
- [REGEX.NEXT_ID, PlatformType.nextid],
1182
- ];
1183
- for (const [regex, platformType] of platformMap) {
1184
- if (regex.test(term)) {
1185
- return platformType;
1186
- }
1187
- }
1188
- // Default fallback
1189
- return term.includes(".") ? PlatformType.ens : PlatformType.farcaster;
1190
- };
1191
- /**
1192
- * Get API key from various environment sources or user provided value
1193
- */
1194
- const getApiKey = (userProvidedKey) => {
1195
- return (userProvidedKey ||
1196
- process.env.WEB3BIO_API_KEY ||
1197
- process.env.REACT_APP_WEB3BIO_API_KEY ||
1198
- process.env.NEXT_PUBLIC_WEB3BIO_API_KEY ||
1199
- process.env.VITE_WEB3BIO_API_KEY);
1200
- };
1201
-
1202
- /**
1203
- * Constructs the API URL based on query parameters
1204
- */
1205
- const buildApiUrl = (identity, endpoint, universal) => {
1206
- // Handle batch requests
1207
- if (Array.isArray(identity)) {
1208
- return `${API_ENDPOINT}/${endpoint}/batch/${encodeURIComponent(JSON.stringify(identity))}`;
1209
- }
1210
- // Handle universal queries
1211
- if (universal) {
1212
- return `${API_ENDPOINT}/${endpoint}/${identity}`;
1213
- }
1214
- // Handle platform-specific queries
1215
- const resolvedId = resolveIdentity(identity);
1216
- if (!resolvedId)
1217
- return null;
1218
- // Domain endpoint uses resolved ID directly
1219
- if (endpoint === QueryEndpoint.DOMAIN) {
1220
- return `${API_ENDPOINT}/${endpoint}/${resolvedId}`;
1221
- }
1222
- // Other endpoints need platform/handle split
1223
- const [platform, handle] = resolvedId.split(",");
1224
- return `${API_ENDPOINT}/${endpoint}/${platform}/${handle}`;
1225
- };
1226
- // Generate a stable cache key for this request
1227
- const getCacheKey = (identity, endpoint, universal) => {
1228
- return JSON.stringify({
1229
- identity,
1230
- endpoint,
1231
- universal,
1232
- });
1233
- };
1234
- // Create a cache to store results across component instances and re-renders
1235
- const globalRequestCache = new Map();
1236
- /**
1237
- * Core hook for querying Web3.bio Profile API
1238
- */
1239
- function useBaseQuery(identity, endpoint, universal = false, options = {}) {
1240
- const { apiKey: userApiKey, enabled = true } = options;
1241
- const apiKey = getApiKey(userApiKey);
1242
- const [data, setData] = useState(() => {
1243
- // Initialize state from cache if available
1244
- const cacheKey = getCacheKey(identity, endpoint, universal);
1245
- return globalRequestCache.get(cacheKey) || null;
1246
- });
1247
- const [isLoading, setIsLoading] = useState(false);
1248
- const [error, setError] = useState(null);
1249
- // Use ref to track in-flight requests and prevent race conditions
1250
- const requestIdRef = useRef(0);
1251
- const prevParamsRef = useRef("");
1252
- // Current request parameters as a string for comparison
1253
- const currentParams = JSON.stringify({
1254
- identity,
1255
- endpoint,
1256
- universal,
1257
- });
1258
- useEffect(() => {
1259
- // Don't run the query if disabled or no identity
1260
- if (!enabled || !identity)
1261
- return;
1262
- // Skip if parameters haven't changed
1263
- if (currentParams === prevParamsRef.current && data !== null) {
1264
- return;
1265
- }
1266
- // Update previous parameters
1267
- prevParamsRef.current = currentParams;
1268
- // Generate cache key
1269
- const cacheKey = getCacheKey(identity, endpoint, universal);
1270
- // Check if we already have cached data
1271
- const cachedData = globalRequestCache.get(cacheKey);
1272
- if (cachedData) {
1273
- setData(cachedData);
1274
- return;
1275
- }
1276
- // Increment request ID to track the latest request
1277
- const requestId = ++requestIdRef.current;
1278
- setIsLoading(true);
1279
- setError(null);
1280
- const fetchData = async () => {
1281
- try {
1282
- const url = buildApiUrl(identity, endpoint, universal);
1283
- if (!url) {
1284
- throw new Error(ErrorMessages.INVALID_IDENTITY);
1285
- }
1286
- const headers = apiKey ? { "x-api-key": apiKey } : {};
1287
- const fetchOptions = {
1288
- method: "GET",
1289
- headers,
1290
- };
1291
- const response = await fetch(url, fetchOptions);
1292
- if (!response.ok) {
1293
- throw new Error(`API error: ${response.status}`);
1294
- }
1295
- const responseData = await response.json();
1296
- if (responseData === null || responseData === void 0 ? void 0 : responseData.error) {
1297
- throw new Error(responseData.error);
1298
- }
1299
- if (requestId === requestIdRef.current) {
1300
- globalRequestCache.set(cacheKey, responseData);
1301
- setData(responseData);
1302
- setIsLoading(false);
1303
- }
1304
- }
1305
- catch (err) {
1306
- if (requestId === requestIdRef.current) {
1307
- setError(err instanceof Error ? err : new Error(String(err)));
1308
- setIsLoading(false);
1309
- }
1310
- }
1311
- };
1312
- fetchData();
1313
- }, [currentParams, enabled]);
1314
- return { data, isLoading, error };
1315
- }
1316
-
1317
- /**
1318
- * Hook to query Web3.bio profile data by identity
1319
- *
1320
- * @param identity - Identity string
1321
- * @param options - Optional configuration options
1322
- * @returns Object containing profile data, loading state, and any errors
1323
- *
1324
- * @example
1325
- * // Query by ENS name
1326
- * const { data, isLoading, error } = useProfile("vitalik.eth");
1327
- *
1328
- * // Query with platform specification
1329
- * const { data } = useProfile("farcaster,dwr");
1330
- */
1331
- function useProfile(identity, options = {}) {
1332
- return useBaseQuery(identity, QueryEndpoint.PROFILE, false, options);
1333
- }
1334
-
1335
- /**
1336
- * Hook to query Web3.bio name service (NS) data by identity
1337
- *
1338
- * @param identity - Identity string
1339
- * @param options - Optional configuration options
1340
- * @returns Object containing NS data, loading state, and any errors
1341
- *
1342
- * @example
1343
- * // Query by ENS name
1344
- * const { data, isLoading, error } = useNS("vitalik.eth");
1345
- *
1346
- * // Query by Ethereum address
1347
- * const { data } = useNS("0x123...");
1348
- */
1349
- function useNS(identity, options = {}) {
1350
- return useBaseQuery(identity, QueryEndpoint.NS, false, options);
1351
- }
1352
-
1353
- /**
1354
- * Hook to query Web3.bio profile data using universal identity lookup
1355
- *
1356
- * @param identity - Identity string
1357
- * @param options - Optional configuration options
1358
- * @returns Object containing profile data, loading state, and any errors
1359
- *
1360
- * @example
1361
- * // Query by ENS name with universal lookup
1362
- * const { data, isLoading, error } = useUniversalProfile("vitalik.eth");
1363
- *
1364
- * // Query by any identity type with universal lookup
1365
- * const { data } = useUniversalProfile("dwr.farcaster");
1366
- */
1367
- function useUniversalProfile(identity, options = {}) {
1368
- return useBaseQuery(identity, QueryEndpoint.PROFILE, true, options);
1369
- }
1370
-
1371
- /**
1372
- * Hook to query Web3.bio name service (NS) data using universal identity lookup
1373
- *
1374
- * @param identity - Identity string
1375
- * @param options - Optional configuration options
1376
- * @returns Object containing NS data, loading state, and any errors
1377
- *
1378
- * @example
1379
- * // Query by ENS name with universal lookup
1380
- * const { data, isLoading, error } = useUniversalNS("vitalik.eth");
1381
- *
1382
- * // Query by any identity type with universal lookup
1383
- * const { data } = useUniversalNS("dwr.farcaster");
1384
- */
1385
- function useUniversalNS(identity, options = {}) {
1386
- return useBaseQuery(identity, QueryEndpoint.NS, true, options);
1387
- }
1388
-
1389
- /**
1390
- * Hook to query Web3.bio profile data using batch identity lookup
1391
- *
1392
- * @param identity - array of Identity string
1393
- * @param options - Optional configuration options
1394
- * @returns Object containing profile data, loading state, and any errors
1395
- *
1396
- * @example
1397
- * // Query by any identity type with batch lookup
1398
- * const { data } = useBatchProfile(["dwr.farcaster","ens,vitalik.eth","sujiyan.eth","stani.lens"]);
1399
- */
1400
- function useBatchProfile(identity, options = {}) {
1401
- return useBaseQuery(identity, QueryEndpoint.PROFILE, false, options);
1402
- }
1403
-
1404
- /**
1405
- * Hook to query Web3.bio profile data using batch(NS) identity lookup
1406
- *
1407
- * @param identity - array of Identity string
1408
- * @param options - Optional configuration options
1409
- * @returns Object containing profile data, loading state, and any errors
1410
- *
1411
- * @example
1412
- * // Query by any identity type with batch lookup
1413
- * const { data } = useBatchNS(["dwr.farcaster","ens,vitalik.eth","sujiyan.eth","stani.lens"]);
1414
- */
1415
- function useBatchNS(identity, options = {}) {
1416
- return useBaseQuery(identity, QueryEndpoint.NS, false, options);
1417
- }
1418
-
1419
- /**
1420
- * Hook to query Web3.bio domain data by identity
1421
- *
1422
- * @param identity - Identity string
1423
- * @param options - Optional configuration options
1424
- * @returns Object containing domain data, loading state, and any errors
1425
- *
1426
- * @example
1427
- * // Query by ENS name
1428
- * const { data, isLoading, error } = useDomain("vitalik.eth");
1429
- *
1430
- * // Query by domain name with platform
1431
- * const { data } = useDomain("ens,vitalik.eth");
1432
- */
1433
- function useDomain(identity, options = {}) {
1434
- return useBaseQuery(identity, QueryEndpoint.DOMAIN, false, options);
1435
- }
1436
-
1437
- var SourceType;
1438
- (function (SourceType) {
1439
- SourceType["ethereum"] = "ethereum";
1440
- SourceType["ens"] = "ens";
1441
- SourceType["twitter"] = "twitter";
1442
- SourceType["keybase"] = "keybase";
1443
- SourceType["nextid"] = "nextid";
1444
- SourceType["rss3"] = "rss3";
1445
- SourceType["dotbit"] = "dotbit";
1446
- SourceType["unstoppabledomains"] = "unstoppabledomains";
1447
- SourceType["lens"] = "lens";
1448
- SourceType["farcaster"] = "farcaster";
1449
- SourceType["space_id"] = "space_id";
1450
- SourceType["crossbell"] = "crossbell";
1451
- SourceType["clusters"] = "clusters";
1452
- SourceType["solana"] = "solana";
1453
- SourceType["sns"] = "sns";
1454
- SourceType["opensea"] = "opensea";
1455
- SourceType["firefly"] = "firefly";
1456
- SourceType["basenames"] = "basenames";
1457
- SourceType["dentity"] = "dentity";
1458
- SourceType["nftd"] = "nftd";
1459
- SourceType["mirror"] = "mirror";
1460
- SourceType["paragraph"] = "paragraph";
1461
- SourceType["foundation"] = "foundation";
1462
- SourceType["rarible"] = "rarible";
1463
- SourceType["soundxyz"] = "soundxyz";
1464
- SourceType["gravity"] = "gravity";
1465
- SourceType["linea"] = "linea";
1466
- SourceType["gmgn"] = "gmgn";
1467
- SourceType["nostr"] = "nostr";
1468
- SourceType["talentprotocol"] = "talentprotocol";
1469
- SourceType["crowdsourcing"] = "crowdsourcing";
1470
- SourceType["particle"] = "particle";
1471
- SourceType["tally"] = "tally";
1472
- SourceType["icebreaker"] = "icebreaker";
1473
- })(SourceType || (SourceType = {}));
1474
- const SOURCE_DATA = {
1475
- [SourceType.ethereum]: {
1476
- name: "Ethereum",
1477
- description: "Ethereum",
1478
- },
1479
- [SourceType.ens]: {
1480
- name: "ENS",
1481
- description: "Ethereum Name Service",
1482
- },
1483
- [SourceType.twitter]: {
1484
- name: "Twitter (X)",
1485
- description: "Twitter (X) social platform",
1486
- },
1487
- [SourceType.keybase]: {
1488
- name: "Keybase",
1489
- description: "Secure messaging and file-sharing",
1490
- },
1491
- [SourceType.nextid]: {
1492
- name: "Next.ID",
1493
- description: "Decentralized identity protocol",
1494
- },
1495
- [SourceType.rss3]: {
1496
- name: "RSS3",
1497
- description: "Open information syndication protocol",
1498
- },
1499
- [SourceType.dotbit]: {
1500
- name: ".bit",
1501
- description: "Decentralized cross-chain identity system",
1502
- },
1503
- [SourceType.unstoppabledomains]: {
1504
- name: "Unstoppable Domains",
1505
- description: "Blockchain domain name provider",
1506
- },
1507
- [SourceType.lens]: {
1508
- name: "Lens",
1509
- description: "Web3 social graph protocol",
1510
- },
1511
- [SourceType.farcaster]: {
1512
- name: "Farcaster",
1513
- description: "Decentralized social network protocol",
1514
- },
1515
- [SourceType.space_id]: {
1516
- name: "SpaceID",
1517
- description: "Multi-chain name service",
1518
- },
1519
- [SourceType.gravity]: {
1520
- name: "Gravity",
1521
- description: "Gravity alpha mainnet name service",
1522
- },
1523
- [SourceType.crossbell]: {
1524
- name: "Crossbell",
1525
- description: "Decentralized publishing protocol",
1526
- },
1527
- [SourceType.clusters]: {
1528
- name: "Clusters",
1529
- description: "On-chain social protocol",
1530
- },
1531
- [SourceType.solana]: {
1532
- name: "Solana",
1533
- description: "High-performance blockchain",
1534
- },
1535
- [SourceType.sns]: {
1536
- name: "SNS",
1537
- description: "Solana Name Service",
1538
- },
1539
- [SourceType.opensea]: {
1540
- name: "OpenSea",
1541
- description: "NFT marketplace",
1542
- },
1543
- [SourceType.firefly]: {
1544
- name: "Firefly",
1545
- description: "Web3 social platform",
1546
- },
1547
- [SourceType.basenames]: {
1548
- name: "Basenames",
1549
- description: "The domain system on Base",
1550
- },
1551
- [SourceType.dentity]: {
1552
- name: "Dentity",
1553
- description: "Digital Credentials",
1554
- },
1555
- [SourceType.nftd]: {
1556
- name: "NF.TD",
1557
- description: "Be your own checkmark",
1558
- },
1559
- [SourceType.mirror]: {
1560
- name: "Mirror",
1561
- description: "Decentralized publishing protocol",
1562
- },
1563
- [SourceType.paragraph]: {
1564
- name: "Paragraph",
1565
- description: "Decentralized publishing protocol",
1566
- },
1567
- [SourceType.foundation]: {
1568
- name: "Foundation",
1569
- description: "NFT marketplace",
1570
- },
1571
- [SourceType.rarible]: {
1572
- name: "Rarible",
1573
- description: "NFT marketplace",
1574
- },
1575
- [SourceType.soundxyz]: {
1576
- name: "Sound.xyz",
1577
- description: "Decentralized audio platform",
1578
- },
1579
- [SourceType.linea]: {
1580
- name: "Linea",
1581
- description: "L2 based on ZK",
1582
- },
1583
- [SourceType.gmgn]: {
1584
- name: "GMGN",
1585
- description: "Web3 social platform",
1586
- },
1587
- [SourceType.nostr]: {
1588
- name: "Nostr",
1589
- description: "Web3 social platform",
1590
- },
1591
- [SourceType.talentprotocol]: {
1592
- name: "Talent",
1593
- description: "Decentralized onchain passport",
1594
- },
1595
- [SourceType.crowdsourcing]: {
1596
- name: "Crowdsourcing",
1597
- description: "Crowdsourcing",
1598
- },
1599
- [SourceType.particle]: {
1600
- name: "Particle",
1601
- description: "Particle",
1602
- },
1603
- [SourceType.tally]: {
1604
- name: "Tally",
1605
- description: "Launch, manage, and grow the value of your token",
1606
- },
1607
- [SourceType.icebreaker]: {
1608
- name: "Icebreaker",
1609
- description: "Open professional network",
1610
- },
1611
- };
1612
-
1613
- // referer SLIP-0044: https://github.com/satoshilabs/slips/blob/master/slip-0044.md
1614
- const CoinType = {
1615
- btc: 0,
1616
- ltc: 2,
1617
- doge: 3,
1618
- dash: 5,
1619
- monacoin: 22,
1620
- eth: 60,
1621
- etc: 61,
1622
- xrp: 145,
1623
- atom: 118,
1624
- rootstock: 137,
1625
- ripple: 144,
1626
- bch: 145,
1627
- bnb: 714,
1628
- xlm: 148,
1629
- rsk: 137,
1630
- eos: 194,
1631
- xem: 43,
1632
- trx: 195,
1633
- xdai: 700,
1634
- matic: 2147483785,
1635
- };
1636
-
1637
- var Network;
1638
- (function (Network) {
1639
- Network["aptos"] = "aptos";
1640
- Network["arbitrum"] = "arbitrum";
1641
- Network["arbitrum_nova"] = "arbitrum_nova";
1642
- Network["arbitrum_one"] = "arbitrum_one";
1643
- Network["apechain"] = "apechain";
1644
- Network["arweave"] = "arweave";
1645
- Network["avalanche"] = "avalanche";
1646
- Network["base"] = "base";
1647
- Network["bitcoin"] = "bitcoin";
1648
- Network["binanceSmartChain"] = "binance-smart-chain";
1649
- Network["bsc"] = "bsc";
1650
- Network["conflux"] = "conflux";
1651
- Network["crossbell"] = "crossbell";
1652
- Network["erc1577"] = "erc1577";
1653
- Network["ethereum"] = "ethereum";
1654
- Network["fantom"] = "fantom";
1655
- Network["farcaster"] = "farcaster";
1656
- Network["flow"] = "flow";
1657
- Network["gnosis"] = "gnosis";
1658
- Network["lens"] = "lens";
1659
- Network["linea"] = "linea";
1660
- Network["mastodon"] = "mastodon";
1661
- Network["optimism"] = "optimism";
1662
- Network["polygon"] = "polygon";
1663
- Network["scroll"] = "scroll";
1664
- Network["snapshot"] = "snapshot";
1665
- Network["solana"] = "solana";
1666
- Network["vsl"] = "vsl";
1667
- Network["xLayer"] = "x-layer";
1668
- Network["zksync_era"] = "zksync_era";
1669
- Network["zora"] = "zora";
1670
- Network["unichain"] = "unichain";
1671
- })(Network || (Network = {}));
1672
- const NETWORK_DATA = {
1673
- [Network.ethereum]: {
1674
- assetPrefix: "https://app.zerion.io/",
1675
- bgColor: "#ebecf8",
1676
- chainId: 1,
1677
- icon: "icons/icon-ethereum.svg",
1678
- key: Network.ethereum,
1679
- label: "Ethereum",
1680
- primaryColor: "#3741ba",
1681
- scanLabel: "Etherscan",
1682
- scanPrefix: "https://etherscan.io/address/",
1683
- scanPrefixTx: "https://etherscan.io/tx/",
1684
- short: "eth",
1685
- },
1686
- [Network.polygon]: {
1687
- bgColor: "#ece5fa",
1688
- chainId: 137,
1689
- icon: "icons/icon-polygon.svg",
1690
- key: Network.polygon,
1691
- label: "Polygon",
1692
- primaryColor: "#7a4add",
1693
- scanLabel: "Polygonscan",
1694
- scanPrefix: "https://polygonscan.com/address/",
1695
- scanPrefixTx: "https://polygonscan.com/tx/",
1696
- short: "matic",
1697
- },
1698
- [Network.avalanche]: {
1699
- bgColor: "#ffefef",
1700
- chainId: 43114,
1701
- icon: "icons/icon-avalanche.svg",
1702
- key: Network.avalanche,
1703
- label: "Avalanche",
1704
- primaryColor: "#e84142",
1705
- scanLabel: "AVASCAN",
1706
- scanPrefix: "https://avascan.info/blockchain/dfk/address/",
1707
- scanPrefixTx: "https://avascan.info/blockchain/x/tx/",
1708
- short: "avax",
1709
- },
1710
- [Network.aptos]: {
1711
- bgColor: "#e9faf3",
1712
- icon: "icons/icon-aptos.svg",
1713
- key: Network.aptos,
1714
- label: "Aptos",
1715
- primaryColor: "#6fe0b2",
1716
- scanLabel: "Aptoscan",
1717
- scanPrefix: "https://aptoscan.com/account/",
1718
- scanPrefixTx: "https://aptoscan.com/transaction/",
1719
- },
1720
- [Network.arbitrum]: {
1721
- bgColor: "#eaedfb",
1722
- chainId: 42161,
1723
- icon: "icons/icon-arbitrum.svg",
1724
- key: Network.arbitrum,
1725
- label: "Arbitrum",
1726
- primaryColor: "#2949d4",
1727
- scanLabel: "Arbitrum One Explorer",
1728
- scanPrefix: "https://arbiscan.io/address/",
1729
- scanPrefixTx: "https://arbiscan.io/tx/",
1730
- short: "arb",
1731
- },
1732
- [Network.arbitrum_one]: {
1733
- bgColor: "#eaedfb",
1734
- chainId: 42161,
1735
- icon: "icons/icon-arbitrum.svg",
1736
- key: Network.arbitrum_one,
1737
- label: "Arbitrum One",
1738
- primaryColor: "#2949d4",
1739
- scanLabel: "Arbitrum One Explorer",
1740
- scanPrefix: "https://arbiscan.io/address/",
1741
- scanPrefixTx: "https://arbiscan.io/tx/",
1742
- short: "arb",
1743
- },
1744
- [Network.arbitrum_nova]: {
1745
- bgColor: "#fdf2ea",
1746
- chainId: 42170,
1747
- icon: "icons/icon-arbitrum.svg",
1748
- key: Network.arbitrum_nova,
1749
- label: "Arbitrum Nova",
1750
- primaryColor: "#ee7c31",
1751
- scanLabel: "Arbitrum Nova Explorer",
1752
- scanPrefix: "https://nova.arbiscan.io/address/",
1753
- scanPrefixTx: "https://nova.arbiscan.io/tx/",
1754
- short: "arb",
1755
- },
1756
- [Network.apechain]: {
1757
- bgColor: "#DEE5FD",
1758
- icon: "icons/icon-apechain.svg",
1759
- key: Network.apechain,
1760
- label: "ApeChain",
1761
- primaryColor: "#2253F1",
1762
- scanLabel: "ApeChain Explorer",
1763
- scanPrefix: "https://apescan.io/address/",
1764
- scanPrefixTx: "https://apescan.io/tx/",
1765
- short: "apechain-mainnet",
1766
- },
1767
- [Network.arweave]: {
1768
- bgColor: "#e1e1e1",
1769
- icon: "icons/icon-arweave.svg",
1770
- key: Network.arweave,
1771
- label: "Arweave",
1772
- primaryColor: "#222326",
1773
- scanLabel: "Arweave Explorer",
1774
- scanPrefix: "https://viewblock.io/arweave/address/",
1775
- scanPrefixTx: "https://viewblock.io/arweave/tx/",
1776
- },
1777
- [Network.bsc]: {
1778
- bgColor: "#fdf3d4",
1779
- chainId: 56,
1780
- icon: "icons/icon-bsc.svg",
1781
- key: Network.bsc,
1782
- label: "BNB Chain",
1783
- primaryColor: "#f0b90b",
1784
- scanLabel: "BscScan",
1785
- scanPrefix: "https://bscscan.com/address/",
1786
- scanPrefixTx: "https://bscscan.com/tx/",
1787
- short: "bsc",
1788
- },
1789
- [Network.binanceSmartChain]: {
1790
- bgColor: "#fdf3d4",
1791
- chainId: 56,
1792
- icon: "icons/icon-bsc.svg",
1793
- key: Network.binanceSmartChain,
1794
- label: "BNB Chain",
1795
- primaryColor: "#f0b90b",
1796
- scanLabel: "BscScan",
1797
- scanPrefix: "https://bscscan.com/address/",
1798
- scanPrefixTx: "https://bscscan.com/tx/",
1799
- short: "bsc",
1800
- },
1801
- [Network.base]: {
1802
- bgColor: "#e9eefe",
1803
- chainId: 8453,
1804
- icon: "icons/icon-base.svg",
1805
- key: Network.base,
1806
- label: "Base",
1807
- primaryColor: "#2151f5",
1808
- scanLabel: "BaseScan",
1809
- scanPrefix: "https://basescan.org/address/",
1810
- scanPrefixTx: "https://basescan.org/tx/",
1811
- short: "base",
1812
- },
1813
- [Network.flow]: {
1814
- bgColor: "#e5fdf3",
1815
- icon: "icons/icon-flow.svg",
1816
- key: Network.flow,
1817
- label: "Flow",
1818
- primaryColor: "#00ef8b",
1819
- scanLabel: "Flow Explorer",
1820
- scanPrefix: "https://evm.flowscan.io/address/",
1821
- scanPrefixTx: "https://evm.flowscan.io/tx/",
1822
- },
1823
- [Network.conflux]: {
1824
- bgColor: "#e8e8ea",
1825
- chainId: 1030,
1826
- icon: "icons/icon-conflux.svg",
1827
- key: Network.conflux,
1828
- label: "Conflux",
1829
- primaryColor: "#1e1e2b",
1830
- scanLabel: "ConfluxScan",
1831
- scanPrefix: "https://www.confluxscan.io/address/cfx:",
1832
- scanPrefixTx: "https://www.confluxscan.io/transaction/",
1833
- },
1834
- [Network.crossbell]: {
1835
- bgColor: "#fef8e9",
1836
- chainId: 3737,
1837
- icon: "icons/icon-crossbell.svg",
1838
- key: Network.crossbell,
1839
- label: "Crossbell",
1840
- primaryColor: "#f7d16a",
1841
- scanLabel: "Crossbell Explorer",
1842
- scanPrefix: "https://scan.crossbell.io/address/",
1843
- scanPrefixTx: "https://scan.crossbell.io/tx/",
1844
- },
1845
- [Network.fantom]: {
1846
- bgColor: "#e6e7fd",
1847
- chainId: 250,
1848
- icon: "icons/icon-fantom.svg",
1849
- key: Network.fantom,
1850
- label: "Fantom",
1851
- primaryColor: "#0810ef",
1852
- scanLabel: "FTMScan",
1853
- scanPrefix: "https://ftmscan.com/address/",
1854
- scanPrefixTx: "https://ftmscan.com/tx/",
1855
- },
1856
- [Network.farcaster]: {
1857
- bgColor: "#efeaf8",
1858
- icon: "icons/icon-farcaster.svg",
1859
- key: Network.farcaster,
1860
- label: "Farcaster",
1861
- primaryColor: "#432C8D",
1862
- scanPrefix: "",
1863
- },
1864
- [Network.optimism]: {
1865
- bgColor: "#fdebea",
1866
- chainId: 10,
1867
- icon: "icons/icon-optimism.svg",
1868
- key: Network.optimism,
1869
- label: "Optimism",
1870
- primaryColor: "#ea3431",
1871
- scanLabel: "OP Explorer",
1872
- scanPrefix: "https://optimistic.etherscan.io/address/",
1873
- scanPrefixTx: "https://optimistic.etherscan.io/tx/",
1874
- short: "op",
1875
- },
1876
- [Network.zksync_era]: {
1877
- bgColor: "#ebf0fe",
1878
- chainId: 324,
1879
- icon: "icons/icon-zksync.svg",
1880
- key: Network.zksync_era,
1881
- label: "zkSync Era",
1882
- primaryColor: "#3567f6",
1883
- scanLabel: "zkSync Era Explorer",
1884
- scanPrefix: "https://explorer.zksync.io/address/",
1885
- scanPrefixTx: "https://explorer.zksync.io/tx/",
1886
- },
1887
- [Network.gnosis]: {
1888
- bgColor: "#e8ebea",
1889
- chainId: 100,
1890
- icon: "icons/icon-gnosis.svg",
1891
- key: Network.gnosis,
1892
- label: "Gnosis",
1893
- primaryColor: "#1c352a",
1894
- scanLabel: "GnosisScan",
1895
- scanPrefix: "https://gnosisscan.io/address/",
1896
- scanPrefixTx: "https://gnosisscan.io/tx/",
1897
- short: "xdai",
1898
- },
1899
- [Network.scroll]: {
1900
- bgColor: "#f1e7db",
1901
- chainId: 534352,
1902
- icon: "icons/icon-scroll.svg",
1903
- key: Network.scroll,
1904
- label: "Scroll",
1905
- primaryColor: "#b78544",
1906
- scanLabel: "Scrollscan",
1907
- scanPrefix: "https://scrollscan.com/address/",
1908
- scanPrefixTx: "https://scrollscan.com/tx/",
1909
- },
1910
- [Network.solana]: {
1911
- assetPrefix: "https://portfolio.jup.ag/portfolio/",
1912
- bgColor: "#F0E3FF",
1913
- chainId: 534352,
1914
- icon: "icons/icon-solana.svg",
1915
- key: Network.solana,
1916
- label: "Solana",
1917
- primaryColor: "#9945FF",
1918
- scanLabel: "Solscan",
1919
- scanPrefix: "https://solscan.io/account/",
1920
- scanPrefixTx: "https://solscan.io/tx/",
1921
- },
1922
- [Network.zora]: {
1923
- bgColor: "#efefef",
1924
- chainId: 7777777,
1925
- icon: "icons/icon-zora.svg",
1926
- key: Network.zora,
1927
- label: "Zora",
1928
- primaryColor: "#141414",
1929
- scanLabel: "Zora Explorer",
1930
- scanPrefix: "https://explorer.zora.energy/address/",
1931
- scanPrefixTx: "https://explorer.zora.energy/tx/",
1932
- short: "zora",
1933
- },
1934
- [Network.mastodon]: {
1935
- bgColor: "#e8e8fe",
1936
- icon: "icons/icon-mastodon.svg",
1937
- key: Network.mastodon,
1938
- label: "Mastodon",
1939
- primaryColor: "#6364f6",
1940
- scanPrefix: "",
1941
- },
1942
- [Network.lens]: {
1943
- bgColor: "#d9f1dc",
1944
- chainId: 137,
1945
- icon: "icons/icon-lens.svg",
1946
- key: Network.lens,
1947
- label: "Lens",
1948
- primaryColor: "#2CC256",
1949
- scanPrefix: "https://momoka.lens.xyz/",
1950
- },
1951
- [Network.linea]: {
1952
- bgColor: "#efefef",
1953
- icon: "icons/icon-linea.svg",
1954
- key: Network.linea,
1955
- label: "Linea",
1956
- primaryColor: "#000000",
1957
- scanLabel: "Linea Explorer",
1958
- scanPrefix: "https://lineascan.build/address/",
1959
- scanPrefixTx: "https://lineascan.build/tx/",
1960
- },
1961
- [Network.snapshot]: {
1962
- bgColor: "#fef7ed",
1963
- icon: "icons/icon-snapshot.svg",
1964
- key: Network.snapshot,
1965
- label: "Snapshot",
1966
- primaryColor: "#f3b04e",
1967
- scanPrefix: "",
1968
- },
1969
- [Network.erc1577]: {
1970
- bgColor: "#ebecf8",
1971
- icon: "icons/icon-ethereum.svg",
1972
- key: Network.erc1577,
1973
- label: "ERC-1577",
1974
- primaryColor: "#3741ba",
1975
- scanPrefix: "",
1976
- },
1977
- [Network.bitcoin]: {
1978
- bgColor: "#FDE9D1",
1979
- icon: "icons/icon-bitcoin.svg",
1980
- key: Network.bitcoin,
1981
- label: "Bitcoin",
1982
- primaryColor: "#F7931A",
1983
- scanLabel: "Bitcoin Explorer",
1984
- scanPrefix: "https://www.blockchain.com/explorer/addresses/btc/",
1985
- scanPrefixTx: "https://www.blockchain.com/explorer/transactions/btc/",
1986
- },
1987
- [Network.vsl]: {
1988
- bgColor: "#ebecf8",
1989
- chainId: 12553,
1990
- icon: "icons/icon-vsl.svg",
1991
- key: Network.vsl,
1992
- label: "RSS3 VSL Mainnet",
1993
- primaryColor: "#1477F9",
1994
- scanLabel: "VSL Scan",
1995
- scanPrefix: "https://scan.rss3.io/address/",
1996
- scanPrefixTx: "https://scan.rss3.io/tx/",
1997
- },
1998
- [Network.xLayer]: {
1999
- bgColor: "#efefef",
2000
- chainId: 196,
2001
- icon: "icons/icon-xlayer.svg",
2002
- key: Network.xLayer,
2003
- label: "X Layer",
2004
- primaryColor: "#000000",
2005
- scanLabel: "X Layer Explorer",
2006
- scanPrefix: "https://www.okx.com/web3/explorer/xlayer/address/",
2007
- scanPrefixTx: "https://www.okx.com/web3/explorer/xlayer/tx/",
2008
- },
2009
- [Network.unichain]: {
2010
- bgColor: "#FEAFF0",
2011
- chainId: 130,
2012
- icon: "icons/icon-unichain.svg",
2013
- key: Network.unichain,
2014
- label: "Unichain",
2015
- primaryColor: "#F50DB4",
2016
- scanLabel: "Unichain Explorer",
2017
- scanPrefix: "https://uniscan.xyz/address/",
2018
- scanPrefixTx: "https://uniscan.xyz/tx/",
2019
- },
2020
- };
2021
-
2022
- export { API_ENDPOINT, CoinType, DEFAULT_PLATFORM, ErrorMessages, NETWORK_DATA, Network, PLATFORM_DATA, PlatformSystem, PlatformType, QueryEndpoint, REGEX, SOURCE_DATA, SourceType, useBatchNS, useBatchProfile, useDomain, useNS, useProfile, useUniversalNS, useUniversalProfile };
2023
- //# sourceMappingURL=index.esm.js.map