web3bio-profile-kit 0.2.7 → 0.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/types/platform.cjs +2 -15
- package/dist/types/platform.d.ts +2 -15
- package/dist/types/platform.js +2 -15
- package/dist/utils/helpers.cjs +45 -45
- package/dist/utils/helpers.js +46 -46
- package/dist/utils/ipfs.cjs +19 -11
- package/dist/utils/ipfs.js +19 -11
- package/dist/utils/network.cjs +22 -20
- package/dist/utils/network.js +22 -20
- package/dist/utils/platform.cjs +20 -145
- package/dist/utils/platform.js +20 -145
- package/dist/utils/resolver.cjs +3 -2
- package/dist/utils/resolver.js +3 -2
- package/dist/utils/source.cjs +1 -1
- package/dist/utils/source.js +1 -1
- package/package.json +1 -1
package/dist/utils/network.cjs
CHANGED
|
@@ -371,6 +371,21 @@ const NETWORK_DATA = {
|
|
|
371
371
|
short: "zora",
|
|
372
372
|
},
|
|
373
373
|
};
|
|
374
|
+
const NETWORK_VALUES = Object.values(NETWORK_DATA);
|
|
375
|
+
const NETWORK_BY_CHAIN_ID = new Map(NETWORK_VALUES
|
|
376
|
+
.filter((network) => typeof network.chainId === "number")
|
|
377
|
+
.map((network) => [network.chainId, network]));
|
|
378
|
+
const NETWORK_BY_SHORT = new Map(NETWORK_VALUES
|
|
379
|
+
.filter((network) => typeof network.short === "string" && network.short.length > 0)
|
|
380
|
+
.map((network) => [network.short, network]));
|
|
381
|
+
const toFallbackNetwork = (networkIdentifier) => ({
|
|
382
|
+
key: String(networkIdentifier),
|
|
383
|
+
icon: "",
|
|
384
|
+
label: String(networkIdentifier),
|
|
385
|
+
primaryColor: "#000000",
|
|
386
|
+
bgColor: "#efefef",
|
|
387
|
+
scanPrefix: "",
|
|
388
|
+
});
|
|
374
389
|
/**
|
|
375
390
|
* Gets network metadata for a given network identifier
|
|
376
391
|
* Supports lookup by network key, network short name, or chainId
|
|
@@ -379,28 +394,15 @@ const NETWORK_DATA = {
|
|
|
379
394
|
* @returns Network metadata object
|
|
380
395
|
*/
|
|
381
396
|
const getNetwork = (networkIdentifier) => {
|
|
382
|
-
const
|
|
397
|
+
const numericIdentifier = Number(networkIdentifier);
|
|
398
|
+
const isNumberParam = !Number.isNaN(numericIdentifier);
|
|
383
399
|
if (isNumberParam) {
|
|
384
|
-
|
|
385
|
-
if (networkByChainId)
|
|
386
|
-
return networkByChainId;
|
|
400
|
+
return NETWORK_BY_CHAIN_ID.get(numericIdentifier) || toFallbackNetwork(networkIdentifier);
|
|
387
401
|
}
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
if (networkByShort) {
|
|
393
|
-
return networkByShort;
|
|
394
|
-
}
|
|
395
|
-
}
|
|
396
|
-
return {
|
|
397
|
-
key: String(networkIdentifier),
|
|
398
|
-
icon: "",
|
|
399
|
-
label: String(networkIdentifier),
|
|
400
|
-
primaryColor: "#000000",
|
|
401
|
-
bgColor: "#efefef",
|
|
402
|
-
scanPrefix: "",
|
|
403
|
-
};
|
|
402
|
+
const networkKey = networkIdentifier;
|
|
403
|
+
if (NETWORK_DATA[networkKey])
|
|
404
|
+
return NETWORK_DATA[networkKey];
|
|
405
|
+
return NETWORK_BY_SHORT.get(String(networkIdentifier)) || toFallbackNetwork(networkIdentifier);
|
|
404
406
|
};
|
|
405
407
|
|
|
406
408
|
exports.NETWORK_DATA = NETWORK_DATA;
|
package/dist/utils/network.js
CHANGED
|
@@ -369,6 +369,21 @@ const NETWORK_DATA = {
|
|
|
369
369
|
short: "zora",
|
|
370
370
|
},
|
|
371
371
|
};
|
|
372
|
+
const NETWORK_VALUES = Object.values(NETWORK_DATA);
|
|
373
|
+
const NETWORK_BY_CHAIN_ID = new Map(NETWORK_VALUES
|
|
374
|
+
.filter((network) => typeof network.chainId === "number")
|
|
375
|
+
.map((network) => [network.chainId, network]));
|
|
376
|
+
const NETWORK_BY_SHORT = new Map(NETWORK_VALUES
|
|
377
|
+
.filter((network) => typeof network.short === "string" && network.short.length > 0)
|
|
378
|
+
.map((network) => [network.short, network]));
|
|
379
|
+
const toFallbackNetwork = (networkIdentifier) => ({
|
|
380
|
+
key: String(networkIdentifier),
|
|
381
|
+
icon: "",
|
|
382
|
+
label: String(networkIdentifier),
|
|
383
|
+
primaryColor: "#000000",
|
|
384
|
+
bgColor: "#efefef",
|
|
385
|
+
scanPrefix: "",
|
|
386
|
+
});
|
|
372
387
|
/**
|
|
373
388
|
* Gets network metadata for a given network identifier
|
|
374
389
|
* Supports lookup by network key, network short name, or chainId
|
|
@@ -377,28 +392,15 @@ const NETWORK_DATA = {
|
|
|
377
392
|
* @returns Network metadata object
|
|
378
393
|
*/
|
|
379
394
|
const getNetwork = (networkIdentifier) => {
|
|
380
|
-
const
|
|
395
|
+
const numericIdentifier = Number(networkIdentifier);
|
|
396
|
+
const isNumberParam = !Number.isNaN(numericIdentifier);
|
|
381
397
|
if (isNumberParam) {
|
|
382
|
-
|
|
383
|
-
if (networkByChainId)
|
|
384
|
-
return networkByChainId;
|
|
398
|
+
return NETWORK_BY_CHAIN_ID.get(numericIdentifier) || toFallbackNetwork(networkIdentifier);
|
|
385
399
|
}
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
if (networkByShort) {
|
|
391
|
-
return networkByShort;
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
|
-
return {
|
|
395
|
-
key: String(networkIdentifier),
|
|
396
|
-
icon: "",
|
|
397
|
-
label: String(networkIdentifier),
|
|
398
|
-
primaryColor: "#000000",
|
|
399
|
-
bgColor: "#efefef",
|
|
400
|
-
scanPrefix: "",
|
|
401
|
-
};
|
|
400
|
+
const networkKey = networkIdentifier;
|
|
401
|
+
if (NETWORK_DATA[networkKey])
|
|
402
|
+
return NETWORK_DATA[networkKey];
|
|
403
|
+
return NETWORK_BY_SHORT.get(String(networkIdentifier)) || toFallbackNetwork(networkIdentifier);
|
|
402
404
|
};
|
|
403
405
|
|
|
404
406
|
export { NETWORK_DATA, getNetwork };
|
package/dist/utils/platform.cjs
CHANGED
|
@@ -18,6 +18,7 @@ const WEB2_PLATFORMS = [
|
|
|
18
18
|
platform.Platform.keybase,
|
|
19
19
|
platform.Platform.linkedin,
|
|
20
20
|
platform.Platform.lobsters,
|
|
21
|
+
platform.Platform.mastodon,
|
|
21
22
|
platform.Platform.minds,
|
|
22
23
|
platform.Platform.mstdnjp,
|
|
23
24
|
platform.Platform.nostr,
|
|
@@ -26,6 +27,7 @@ const WEB2_PLATFORMS = [
|
|
|
26
27
|
platform.Platform.telegram,
|
|
27
28
|
platform.Platform.threads,
|
|
28
29
|
platform.Platform.tiktok,
|
|
30
|
+
platform.Platform.twitch,
|
|
29
31
|
platform.Platform.twitter,
|
|
30
32
|
platform.Platform.v2ex,
|
|
31
33
|
platform.Platform.weibo,
|
|
@@ -38,9 +40,7 @@ const WEB2_PLATFORM_SET = new Set(WEB2_PLATFORMS);
|
|
|
38
40
|
* @public
|
|
39
41
|
*/
|
|
40
42
|
const isWeb2Platform = (platform) => {
|
|
41
|
-
|
|
42
|
-
return false;
|
|
43
|
-
return WEB2_PLATFORM_SET.has(platform);
|
|
43
|
+
return !!platform && WEB2_PLATFORM_SET.has(platform);
|
|
44
44
|
};
|
|
45
45
|
/**
|
|
46
46
|
* Default data
|
|
@@ -61,26 +61,6 @@ const DEFAULT_PLATFORM = {
|
|
|
61
61
|
* @public
|
|
62
62
|
*/
|
|
63
63
|
const PLATFORM_DATA = new Map([
|
|
64
|
-
[
|
|
65
|
-
platform.Platform.ailayer,
|
|
66
|
-
{
|
|
67
|
-
color: "#A283FF",
|
|
68
|
-
icon: "icons/icon-ailayer.svg",
|
|
69
|
-
label: "AILayer Name Service",
|
|
70
|
-
urlPrefix: "https://mainnet-explorer.ailayer.xyz/address/",
|
|
71
|
-
registerlink: "https://space.id/tld/19/domains?query={name}",
|
|
72
|
-
},
|
|
73
|
-
],
|
|
74
|
-
[
|
|
75
|
-
platform.Platform.alienx,
|
|
76
|
-
{
|
|
77
|
-
color: "#D5F462",
|
|
78
|
-
icon: "icons/icon-alienx.svg",
|
|
79
|
-
label: "AlienX Name Service",
|
|
80
|
-
urlPrefix: "https://explorer.alienxchain.io/address/",
|
|
81
|
-
registerlink: "https://space.id/tld/17/domains?query={name}",
|
|
82
|
-
},
|
|
83
|
-
],
|
|
84
64
|
[
|
|
85
65
|
platform.Platform.aptos,
|
|
86
66
|
{
|
|
@@ -212,33 +192,6 @@ const PLATFORM_DATA = new Map([
|
|
|
212
192
|
urlPrefix: "https://www.coingecko.com/en/coins/",
|
|
213
193
|
},
|
|
214
194
|
],
|
|
215
|
-
[
|
|
216
|
-
platform.Platform.cosmos,
|
|
217
|
-
{
|
|
218
|
-
color: "#000000",
|
|
219
|
-
icon: "icons/icon-cosmos.svg",
|
|
220
|
-
label: "Cosmos",
|
|
221
|
-
urlPrefix: "https://www.mintscan.io/cosmos/account/",
|
|
222
|
-
},
|
|
223
|
-
],
|
|
224
|
-
[
|
|
225
|
-
platform.Platform.cyberconnect,
|
|
226
|
-
{
|
|
227
|
-
color: "#000000",
|
|
228
|
-
icon: "icons/icon-cyberconnect.svg",
|
|
229
|
-
label: "CyberConnect",
|
|
230
|
-
urlPrefix: "https://link3.to/",
|
|
231
|
-
},
|
|
232
|
-
],
|
|
233
|
-
[
|
|
234
|
-
platform.Platform.deepdao,
|
|
235
|
-
{
|
|
236
|
-
color: "#337bff",
|
|
237
|
-
icon: "icons/icon-deepdao.svg",
|
|
238
|
-
label: "DeepDAO",
|
|
239
|
-
urlPrefix: "https://deepdao.io/user/",
|
|
240
|
-
},
|
|
241
|
-
],
|
|
242
195
|
[
|
|
243
196
|
platform.Platform.degenscore,
|
|
244
197
|
{
|
|
@@ -302,15 +255,6 @@ const PLATFORM_DATA = new Map([
|
|
|
302
255
|
registerlink: "https://www.ethcomments.xyz/",
|
|
303
256
|
},
|
|
304
257
|
],
|
|
305
|
-
[
|
|
306
|
-
platform.Platform.edgeless,
|
|
307
|
-
{
|
|
308
|
-
color: "#a0eb67",
|
|
309
|
-
icon: "icons/icon-edgeless.svg",
|
|
310
|
-
label: "Edgeless",
|
|
311
|
-
urlPrefix: "https://explorer.edgeless.network/address/",
|
|
312
|
-
},
|
|
313
|
-
],
|
|
314
258
|
[
|
|
315
259
|
platform.Platform.efp,
|
|
316
260
|
{
|
|
@@ -516,16 +460,6 @@ const PLATFORM_DATA = new Map([
|
|
|
516
460
|
registerlink: "https://www.lens.xyz/mint?name={name}",
|
|
517
461
|
},
|
|
518
462
|
],
|
|
519
|
-
[
|
|
520
|
-
platform.Platform.lightlink,
|
|
521
|
-
{
|
|
522
|
-
color: "#00BFFF",
|
|
523
|
-
icon: "icons/icon-lightlink.svg",
|
|
524
|
-
label: "LightLink Name Service",
|
|
525
|
-
urlPrefix: "https://phoenix.lightlink.io/address/",
|
|
526
|
-
registerlink: "https://space.id/tld/9/domains?query={name}",
|
|
527
|
-
},
|
|
528
|
-
],
|
|
529
463
|
[
|
|
530
464
|
platform.Platform.linea,
|
|
531
465
|
{
|
|
@@ -558,13 +492,13 @@ const PLATFORM_DATA = new Map([
|
|
|
558
492
|
},
|
|
559
493
|
],
|
|
560
494
|
[
|
|
561
|
-
platform.Platform.
|
|
495
|
+
platform.Platform.mastodon,
|
|
562
496
|
{
|
|
563
|
-
color: "#
|
|
564
|
-
icon: "icons/icon-
|
|
565
|
-
label: "
|
|
566
|
-
urlPrefix: "https://
|
|
567
|
-
|
|
497
|
+
color: "#6364FF",
|
|
498
|
+
icon: "icons/icon-mastodon.svg",
|
|
499
|
+
label: "Mastodon",
|
|
500
|
+
urlPrefix: "https://mastodon.social/@",
|
|
501
|
+
ensText: ["mastodon", "social.mastodon"],
|
|
568
502
|
},
|
|
569
503
|
],
|
|
570
504
|
[
|
|
@@ -585,16 +519,6 @@ const PLATFORM_DATA = new Map([
|
|
|
585
519
|
urlPrefix: "https://medium.com/",
|
|
586
520
|
},
|
|
587
521
|
],
|
|
588
|
-
[
|
|
589
|
-
platform.Platform.merlin,
|
|
590
|
-
{
|
|
591
|
-
color: "#5A32A3",
|
|
592
|
-
icon: "icons/icon-merlin.svg",
|
|
593
|
-
label: "Merlin Name Service",
|
|
594
|
-
urlPrefix: "https://scan.merlinchain.io/address/",
|
|
595
|
-
registerlink: "https://space.id/tld/12/domains?query={name}",
|
|
596
|
-
},
|
|
597
|
-
],
|
|
598
522
|
[
|
|
599
523
|
platform.Platform.minds,
|
|
600
524
|
{
|
|
@@ -604,26 +528,6 @@ const PLATFORM_DATA = new Map([
|
|
|
604
528
|
urlPrefix: "https://www.minds.com/",
|
|
605
529
|
},
|
|
606
530
|
],
|
|
607
|
-
[
|
|
608
|
-
platform.Platform.mint,
|
|
609
|
-
{
|
|
610
|
-
color: "#00A57C",
|
|
611
|
-
icon: "icons/icon-mint.svg",
|
|
612
|
-
label: "Mint Name Service",
|
|
613
|
-
urlPrefix: "https://explorer.mintchain.io/address/",
|
|
614
|
-
registerlink: "https://space.id/tld/18/domains?query={name}",
|
|
615
|
-
},
|
|
616
|
-
],
|
|
617
|
-
[
|
|
618
|
-
platform.Platform.mode,
|
|
619
|
-
{
|
|
620
|
-
color: "#E5FD52",
|
|
621
|
-
icon: "icons/icon-mode.svg",
|
|
622
|
-
label: "Mode Name Service",
|
|
623
|
-
urlPrefix: "https://explorer.mode.network/address/",
|
|
624
|
-
registerlink: "https://space.id/tld/6/domains?query={name}",
|
|
625
|
-
},
|
|
626
|
-
],
|
|
627
531
|
[
|
|
628
532
|
platform.Platform.mstdnjp,
|
|
629
533
|
{
|
|
@@ -829,16 +733,6 @@ const PLATFORM_DATA = new Map([
|
|
|
829
733
|
urlPrefix: "https://substack.com/@",
|
|
830
734
|
},
|
|
831
735
|
],
|
|
832
|
-
[
|
|
833
|
-
platform.Platform.taiko,
|
|
834
|
-
{
|
|
835
|
-
color: "#E81899",
|
|
836
|
-
icon: "icons/icon-taiko.svg",
|
|
837
|
-
label: "DotTaiko Name Service",
|
|
838
|
-
urlPrefix: "https://taikoscan.io/address/",
|
|
839
|
-
registerlink: "https://space.id/tld/16/domains?query={name}",
|
|
840
|
-
},
|
|
841
|
-
],
|
|
842
736
|
[
|
|
843
737
|
platform.Platform.talent,
|
|
844
738
|
{
|
|
@@ -885,15 +779,6 @@ const PLATFORM_DATA = new Map([
|
|
|
885
779
|
urlPrefix: "https://www.tiktok.com/@",
|
|
886
780
|
},
|
|
887
781
|
],
|
|
888
|
-
[
|
|
889
|
-
platform.Platform.tomo,
|
|
890
|
-
{
|
|
891
|
-
color: "#DE3A7E",
|
|
892
|
-
icon: "icons/icon-tomo.svg",
|
|
893
|
-
label: "Tomo Name Service",
|
|
894
|
-
registerlink: "https://space.id/tld/10/domains?query={name}",
|
|
895
|
-
},
|
|
896
|
-
],
|
|
897
782
|
[
|
|
898
783
|
platform.Platform.ton,
|
|
899
784
|
{
|
|
@@ -912,6 +797,15 @@ const PLATFORM_DATA = new Map([
|
|
|
912
797
|
urlPrefix: "https://tronscan.org/#/address/",
|
|
913
798
|
},
|
|
914
799
|
],
|
|
800
|
+
[
|
|
801
|
+
platform.Platform.twitch,
|
|
802
|
+
{
|
|
803
|
+
color: "#9246FF",
|
|
804
|
+
icon: "icons/icon-twitch.svg",
|
|
805
|
+
label: "Twitch",
|
|
806
|
+
urlPrefix: "https://www.twitch.tv/",
|
|
807
|
+
},
|
|
808
|
+
],
|
|
915
809
|
[
|
|
916
810
|
platform.Platform.twitter,
|
|
917
811
|
{
|
|
@@ -1024,26 +918,6 @@ const PLATFORM_DATA = new Map([
|
|
|
1024
918
|
ensText: ["com.youtube", "youtube"],
|
|
1025
919
|
},
|
|
1026
920
|
],
|
|
1027
|
-
[
|
|
1028
|
-
platform.Platform.zeta,
|
|
1029
|
-
{
|
|
1030
|
-
color: "#005741",
|
|
1031
|
-
icon: "icons/icon-zeta.svg",
|
|
1032
|
-
label: "Zeta Name Service",
|
|
1033
|
-
urlPrefix: "https://explorer.zetachain.com/address/",
|
|
1034
|
-
registerlink: "https://space.id/tld/11/domains?query={name}",
|
|
1035
|
-
},
|
|
1036
|
-
],
|
|
1037
|
-
[
|
|
1038
|
-
platform.Platform.zkfair,
|
|
1039
|
-
{
|
|
1040
|
-
color: "#D43F36",
|
|
1041
|
-
icon: "icons/icon-zkfair.svg",
|
|
1042
|
-
label: "zkFair",
|
|
1043
|
-
urlPrefix: "https://scan.zkfair.io/address/",
|
|
1044
|
-
registerlink: "https://space.id/tld/8/domains?query={name}",
|
|
1045
|
-
},
|
|
1046
|
-
],
|
|
1047
921
|
[
|
|
1048
922
|
platform.Platform.zkme,
|
|
1049
923
|
{
|
|
@@ -1067,7 +941,8 @@ const PLATFORM_DATA = new Map([
|
|
|
1067
941
|
* @public
|
|
1068
942
|
*/
|
|
1069
943
|
const getPlatform = (platform) => {
|
|
1070
|
-
|
|
944
|
+
var _a;
|
|
945
|
+
return (_a = PLATFORM_DATA.get(platform)) !== null && _a !== void 0 ? _a : { ...DEFAULT_PLATFORM, label: platform };
|
|
1071
946
|
};
|
|
1072
947
|
|
|
1073
948
|
exports.DEFAULT_PLATFORM = DEFAULT_PLATFORM;
|
package/dist/utils/platform.js
CHANGED
|
@@ -16,6 +16,7 @@ const WEB2_PLATFORMS = [
|
|
|
16
16
|
Platform.keybase,
|
|
17
17
|
Platform.linkedin,
|
|
18
18
|
Platform.lobsters,
|
|
19
|
+
Platform.mastodon,
|
|
19
20
|
Platform.minds,
|
|
20
21
|
Platform.mstdnjp,
|
|
21
22
|
Platform.nostr,
|
|
@@ -24,6 +25,7 @@ const WEB2_PLATFORMS = [
|
|
|
24
25
|
Platform.telegram,
|
|
25
26
|
Platform.threads,
|
|
26
27
|
Platform.tiktok,
|
|
28
|
+
Platform.twitch,
|
|
27
29
|
Platform.twitter,
|
|
28
30
|
Platform.v2ex,
|
|
29
31
|
Platform.weibo,
|
|
@@ -36,9 +38,7 @@ const WEB2_PLATFORM_SET = new Set(WEB2_PLATFORMS);
|
|
|
36
38
|
* @public
|
|
37
39
|
*/
|
|
38
40
|
const isWeb2Platform = (platform) => {
|
|
39
|
-
|
|
40
|
-
return false;
|
|
41
|
-
return WEB2_PLATFORM_SET.has(platform);
|
|
41
|
+
return !!platform && WEB2_PLATFORM_SET.has(platform);
|
|
42
42
|
};
|
|
43
43
|
/**
|
|
44
44
|
* Default data
|
|
@@ -59,26 +59,6 @@ const DEFAULT_PLATFORM = {
|
|
|
59
59
|
* @public
|
|
60
60
|
*/
|
|
61
61
|
const PLATFORM_DATA = new Map([
|
|
62
|
-
[
|
|
63
|
-
Platform.ailayer,
|
|
64
|
-
{
|
|
65
|
-
color: "#A283FF",
|
|
66
|
-
icon: "icons/icon-ailayer.svg",
|
|
67
|
-
label: "AILayer Name Service",
|
|
68
|
-
urlPrefix: "https://mainnet-explorer.ailayer.xyz/address/",
|
|
69
|
-
registerlink: "https://space.id/tld/19/domains?query={name}",
|
|
70
|
-
},
|
|
71
|
-
],
|
|
72
|
-
[
|
|
73
|
-
Platform.alienx,
|
|
74
|
-
{
|
|
75
|
-
color: "#D5F462",
|
|
76
|
-
icon: "icons/icon-alienx.svg",
|
|
77
|
-
label: "AlienX Name Service",
|
|
78
|
-
urlPrefix: "https://explorer.alienxchain.io/address/",
|
|
79
|
-
registerlink: "https://space.id/tld/17/domains?query={name}",
|
|
80
|
-
},
|
|
81
|
-
],
|
|
82
62
|
[
|
|
83
63
|
Platform.aptos,
|
|
84
64
|
{
|
|
@@ -210,33 +190,6 @@ const PLATFORM_DATA = new Map([
|
|
|
210
190
|
urlPrefix: "https://www.coingecko.com/en/coins/",
|
|
211
191
|
},
|
|
212
192
|
],
|
|
213
|
-
[
|
|
214
|
-
Platform.cosmos,
|
|
215
|
-
{
|
|
216
|
-
color: "#000000",
|
|
217
|
-
icon: "icons/icon-cosmos.svg",
|
|
218
|
-
label: "Cosmos",
|
|
219
|
-
urlPrefix: "https://www.mintscan.io/cosmos/account/",
|
|
220
|
-
},
|
|
221
|
-
],
|
|
222
|
-
[
|
|
223
|
-
Platform.cyberconnect,
|
|
224
|
-
{
|
|
225
|
-
color: "#000000",
|
|
226
|
-
icon: "icons/icon-cyberconnect.svg",
|
|
227
|
-
label: "CyberConnect",
|
|
228
|
-
urlPrefix: "https://link3.to/",
|
|
229
|
-
},
|
|
230
|
-
],
|
|
231
|
-
[
|
|
232
|
-
Platform.deepdao,
|
|
233
|
-
{
|
|
234
|
-
color: "#337bff",
|
|
235
|
-
icon: "icons/icon-deepdao.svg",
|
|
236
|
-
label: "DeepDAO",
|
|
237
|
-
urlPrefix: "https://deepdao.io/user/",
|
|
238
|
-
},
|
|
239
|
-
],
|
|
240
193
|
[
|
|
241
194
|
Platform.degenscore,
|
|
242
195
|
{
|
|
@@ -300,15 +253,6 @@ const PLATFORM_DATA = new Map([
|
|
|
300
253
|
registerlink: "https://www.ethcomments.xyz/",
|
|
301
254
|
},
|
|
302
255
|
],
|
|
303
|
-
[
|
|
304
|
-
Platform.edgeless,
|
|
305
|
-
{
|
|
306
|
-
color: "#a0eb67",
|
|
307
|
-
icon: "icons/icon-edgeless.svg",
|
|
308
|
-
label: "Edgeless",
|
|
309
|
-
urlPrefix: "https://explorer.edgeless.network/address/",
|
|
310
|
-
},
|
|
311
|
-
],
|
|
312
256
|
[
|
|
313
257
|
Platform.efp,
|
|
314
258
|
{
|
|
@@ -514,16 +458,6 @@ const PLATFORM_DATA = new Map([
|
|
|
514
458
|
registerlink: "https://www.lens.xyz/mint?name={name}",
|
|
515
459
|
},
|
|
516
460
|
],
|
|
517
|
-
[
|
|
518
|
-
Platform.lightlink,
|
|
519
|
-
{
|
|
520
|
-
color: "#00BFFF",
|
|
521
|
-
icon: "icons/icon-lightlink.svg",
|
|
522
|
-
label: "LightLink Name Service",
|
|
523
|
-
urlPrefix: "https://phoenix.lightlink.io/address/",
|
|
524
|
-
registerlink: "https://space.id/tld/9/domains?query={name}",
|
|
525
|
-
},
|
|
526
|
-
],
|
|
527
461
|
[
|
|
528
462
|
Platform.linea,
|
|
529
463
|
{
|
|
@@ -556,13 +490,13 @@ const PLATFORM_DATA = new Map([
|
|
|
556
490
|
},
|
|
557
491
|
],
|
|
558
492
|
[
|
|
559
|
-
Platform.
|
|
493
|
+
Platform.mastodon,
|
|
560
494
|
{
|
|
561
|
-
color: "#
|
|
562
|
-
icon: "icons/icon-
|
|
563
|
-
label: "
|
|
564
|
-
urlPrefix: "https://
|
|
565
|
-
|
|
495
|
+
color: "#6364FF",
|
|
496
|
+
icon: "icons/icon-mastodon.svg",
|
|
497
|
+
label: "Mastodon",
|
|
498
|
+
urlPrefix: "https://mastodon.social/@",
|
|
499
|
+
ensText: ["mastodon", "social.mastodon"],
|
|
566
500
|
},
|
|
567
501
|
],
|
|
568
502
|
[
|
|
@@ -583,16 +517,6 @@ const PLATFORM_DATA = new Map([
|
|
|
583
517
|
urlPrefix: "https://medium.com/",
|
|
584
518
|
},
|
|
585
519
|
],
|
|
586
|
-
[
|
|
587
|
-
Platform.merlin,
|
|
588
|
-
{
|
|
589
|
-
color: "#5A32A3",
|
|
590
|
-
icon: "icons/icon-merlin.svg",
|
|
591
|
-
label: "Merlin Name Service",
|
|
592
|
-
urlPrefix: "https://scan.merlinchain.io/address/",
|
|
593
|
-
registerlink: "https://space.id/tld/12/domains?query={name}",
|
|
594
|
-
},
|
|
595
|
-
],
|
|
596
520
|
[
|
|
597
521
|
Platform.minds,
|
|
598
522
|
{
|
|
@@ -602,26 +526,6 @@ const PLATFORM_DATA = new Map([
|
|
|
602
526
|
urlPrefix: "https://www.minds.com/",
|
|
603
527
|
},
|
|
604
528
|
],
|
|
605
|
-
[
|
|
606
|
-
Platform.mint,
|
|
607
|
-
{
|
|
608
|
-
color: "#00A57C",
|
|
609
|
-
icon: "icons/icon-mint.svg",
|
|
610
|
-
label: "Mint Name Service",
|
|
611
|
-
urlPrefix: "https://explorer.mintchain.io/address/",
|
|
612
|
-
registerlink: "https://space.id/tld/18/domains?query={name}",
|
|
613
|
-
},
|
|
614
|
-
],
|
|
615
|
-
[
|
|
616
|
-
Platform.mode,
|
|
617
|
-
{
|
|
618
|
-
color: "#E5FD52",
|
|
619
|
-
icon: "icons/icon-mode.svg",
|
|
620
|
-
label: "Mode Name Service",
|
|
621
|
-
urlPrefix: "https://explorer.mode.network/address/",
|
|
622
|
-
registerlink: "https://space.id/tld/6/domains?query={name}",
|
|
623
|
-
},
|
|
624
|
-
],
|
|
625
529
|
[
|
|
626
530
|
Platform.mstdnjp,
|
|
627
531
|
{
|
|
@@ -827,16 +731,6 @@ const PLATFORM_DATA = new Map([
|
|
|
827
731
|
urlPrefix: "https://substack.com/@",
|
|
828
732
|
},
|
|
829
733
|
],
|
|
830
|
-
[
|
|
831
|
-
Platform.taiko,
|
|
832
|
-
{
|
|
833
|
-
color: "#E81899",
|
|
834
|
-
icon: "icons/icon-taiko.svg",
|
|
835
|
-
label: "DotTaiko Name Service",
|
|
836
|
-
urlPrefix: "https://taikoscan.io/address/",
|
|
837
|
-
registerlink: "https://space.id/tld/16/domains?query={name}",
|
|
838
|
-
},
|
|
839
|
-
],
|
|
840
734
|
[
|
|
841
735
|
Platform.talent,
|
|
842
736
|
{
|
|
@@ -883,15 +777,6 @@ const PLATFORM_DATA = new Map([
|
|
|
883
777
|
urlPrefix: "https://www.tiktok.com/@",
|
|
884
778
|
},
|
|
885
779
|
],
|
|
886
|
-
[
|
|
887
|
-
Platform.tomo,
|
|
888
|
-
{
|
|
889
|
-
color: "#DE3A7E",
|
|
890
|
-
icon: "icons/icon-tomo.svg",
|
|
891
|
-
label: "Tomo Name Service",
|
|
892
|
-
registerlink: "https://space.id/tld/10/domains?query={name}",
|
|
893
|
-
},
|
|
894
|
-
],
|
|
895
780
|
[
|
|
896
781
|
Platform.ton,
|
|
897
782
|
{
|
|
@@ -910,6 +795,15 @@ const PLATFORM_DATA = new Map([
|
|
|
910
795
|
urlPrefix: "https://tronscan.org/#/address/",
|
|
911
796
|
},
|
|
912
797
|
],
|
|
798
|
+
[
|
|
799
|
+
Platform.twitch,
|
|
800
|
+
{
|
|
801
|
+
color: "#9246FF",
|
|
802
|
+
icon: "icons/icon-twitch.svg",
|
|
803
|
+
label: "Twitch",
|
|
804
|
+
urlPrefix: "https://www.twitch.tv/",
|
|
805
|
+
},
|
|
806
|
+
],
|
|
913
807
|
[
|
|
914
808
|
Platform.twitter,
|
|
915
809
|
{
|
|
@@ -1022,26 +916,6 @@ const PLATFORM_DATA = new Map([
|
|
|
1022
916
|
ensText: ["com.youtube", "youtube"],
|
|
1023
917
|
},
|
|
1024
918
|
],
|
|
1025
|
-
[
|
|
1026
|
-
Platform.zeta,
|
|
1027
|
-
{
|
|
1028
|
-
color: "#005741",
|
|
1029
|
-
icon: "icons/icon-zeta.svg",
|
|
1030
|
-
label: "Zeta Name Service",
|
|
1031
|
-
urlPrefix: "https://explorer.zetachain.com/address/",
|
|
1032
|
-
registerlink: "https://space.id/tld/11/domains?query={name}",
|
|
1033
|
-
},
|
|
1034
|
-
],
|
|
1035
|
-
[
|
|
1036
|
-
Platform.zkfair,
|
|
1037
|
-
{
|
|
1038
|
-
color: "#D43F36",
|
|
1039
|
-
icon: "icons/icon-zkfair.svg",
|
|
1040
|
-
label: "zkFair",
|
|
1041
|
-
urlPrefix: "https://scan.zkfair.io/address/",
|
|
1042
|
-
registerlink: "https://space.id/tld/8/domains?query={name}",
|
|
1043
|
-
},
|
|
1044
|
-
],
|
|
1045
919
|
[
|
|
1046
920
|
Platform.zkme,
|
|
1047
921
|
{
|
|
@@ -1065,7 +939,8 @@ const PLATFORM_DATA = new Map([
|
|
|
1065
939
|
* @public
|
|
1066
940
|
*/
|
|
1067
941
|
const getPlatform = (platform) => {
|
|
1068
|
-
|
|
942
|
+
var _a;
|
|
943
|
+
return (_a = PLATFORM_DATA.get(platform)) !== null && _a !== void 0 ? _a : { ...DEFAULT_PLATFORM, label: platform };
|
|
1069
944
|
};
|
|
1070
945
|
|
|
1071
946
|
export { DEFAULT_PLATFORM, PLATFORM_DATA, WEB2_PLATFORMS, getPlatform, isWeb2Platform };
|
package/dist/utils/resolver.cjs
CHANGED
|
@@ -2,11 +2,12 @@
|
|
|
2
2
|
|
|
3
3
|
var ipfs = require('./ipfs.cjs');
|
|
4
4
|
|
|
5
|
+
const DIRECT_MEDIA_PREFIXES = ["data:", "https:"];
|
|
5
6
|
const resolveMediaURL = (url) => {
|
|
6
7
|
if (!url)
|
|
7
8
|
return "";
|
|
8
|
-
// Fast path for common protocols
|
|
9
|
-
if (
|
|
9
|
+
// Fast path for common protocols.
|
|
10
|
+
if (DIRECT_MEDIA_PREFIXES.some((prefix) => url.startsWith(prefix))) {
|
|
10
11
|
return url;
|
|
11
12
|
}
|
|
12
13
|
// Handle Arweave
|
package/dist/utils/resolver.js
CHANGED
|
@@ -1,10 +1,11 @@
|
|
|
1
1
|
import { isIPFS, resolveIPFS_URL } from './ipfs.js';
|
|
2
2
|
|
|
3
|
+
const DIRECT_MEDIA_PREFIXES = ["data:", "https:"];
|
|
3
4
|
const resolveMediaURL = (url) => {
|
|
4
5
|
if (!url)
|
|
5
6
|
return "";
|
|
6
|
-
// Fast path for common protocols
|
|
7
|
-
if (
|
|
7
|
+
// Fast path for common protocols.
|
|
8
|
+
if (DIRECT_MEDIA_PREFIXES.some((prefix) => url.startsWith(prefix))) {
|
|
8
9
|
return url;
|
|
9
10
|
}
|
|
10
11
|
// Handle Arweave
|
package/dist/utils/source.cjs
CHANGED
|
@@ -268,7 +268,7 @@ const SOURCE_DATA = {
|
|
|
268
268
|
* @returns Source metadata including name and description
|
|
269
269
|
* @public
|
|
270
270
|
*/
|
|
271
|
-
const getSource = (sourceKey) => SOURCE_DATA[sourceKey]
|
|
271
|
+
const getSource = (sourceKey) => { var _a; return (_a = SOURCE_DATA[sourceKey]) !== null && _a !== void 0 ? _a : { name: sourceKey, description: "Unknown source" }; };
|
|
272
272
|
|
|
273
273
|
exports.SOURCE_DATA = SOURCE_DATA;
|
|
274
274
|
exports.getSource = getSource;
|