PageSourceSearch

https://cattoverse.com/wallet-dist/ConnectorUtil-CSHNFmSy.js

js cattoverse.com collected 2026-10-09 00:19:55 UTC 5,608 bytes, 152 lines download raw bytes

1import { A as e, F as t, O as n, S as r, g as i, k as a, p as o, t as s, y as c } from "./ConstantsUtil-DK0kHQzU.js";
2//#region node_modules/@reown/appkit-utils/dist/esm/src/ConstantsUtil.js
3var l = {
4	METMASK_CONNECTOR_NAME: "MetaMask",
5	TRUST_CONNECTOR_NAME: "Trust Wallet",
6	SOLFLARE_CONNECTOR_NAME: "Solflare",
7	PHANTOM_CONNECTOR_NAME: "Phantom",
8	COIN98_CONNECTOR_NAME: "Coin98",
9	MAGIC_EDEN_CONNECTOR_NAME: "Magic Eden",
10	BACKPACK_CONNECTOR_NAME: "Backpack",
11	BITGET_CONNECTOR_NAME: "Bitget Wallet",
12	FRONTIER_CONNECTOR_NAME: "Frontier",
13	XVERSE_CONNECTOR_NAME: "Xverse Wallet",
14	LEATHER_CONNECTOR_NAME: "Leather",
15	EIP155: "eip155",
16	ADD_CHAIN_METHOD: "wallet_addEthereumChain",
17	EIP6963_ANNOUNCE_EVENT: "eip6963:announceProvider",
18	EIP6963_REQUEST_EVENT: "eip6963:requestProvider",
19	CONNECTOR_RDNS_MAP: {
20		coinbaseWallet: "com.coinbase.wallet",
21		coinbaseWalletSDK: "com.coinbase.wallet"
22	},
23	CONNECTOR_TYPE_EXTERNAL: "EXTERNAL",
24	CONNECTOR_TYPE_WALLET_CONNECT: "WALLET_CONNECT",
25	CONNECTOR_TYPE_INJECTED: "INJECTED",
26	CONNECTOR_TYPE_ANNOUNCED: "ANNOUNCED",
27	CONNECTOR_TYPE_AUTH: "AUTH",
28	CONNECTOR_TYPE_MULTI_CHAIN: "MULTI_CHAIN",
29	CONNECTOR_TYPE_W3M_AUTH: "ID_AUTH"
30}, u = {
31	getCaipTokens(e) {
32		if (!e) return;
33		let t = {};
34		return Object.entries(e).forEach(([e, n]) => {
35			t[`${l.EIP155}:${e}`] = n;
36		}), t;
37	},
38	isLowerCaseMatch(e, t) {
39		return e?.toLowerCase() === t?.toLowerCase();
40	}
41}, d = {
42	filterOutDuplicatesByRDNS(t) {
43		let r = n.state.enableEIP6963 ? c.state.connectors : [], i = e.getRecentWallets(), o = r.map((e) => e.info?.rdns).filter(Boolean), s = i.map((e) => e.rdns).filter(Boolean), l = o.concat(s);
44		if (l.includes("io.metamask.mobile") && a.isMobile()) {
45			let e = l.indexOf("io.metamask.mobile");
46			l[e] = "io.metamask";
47		}
48		return t.filter((e) => !l.includes(String(e?.rdns)));
49	},
50	filterOutDuplicatesByIds(t) {
51		let n = c.state.connectors.filter((e) => e.type === "ANNOUNCED" || e.type === "INJECTED"), r = e.getRecentWallets(), i = n.map((e) => e.explorerId), a = r.map((e) => e.id), o = i.concat(a);
52		return t.filter((e) => !o.includes(e?.id));
53	},
54	filterOutDuplicateWallets(e) {
55		let t = this.filterOutDuplicatesByRDNS(e);
56		return this.filterOutDuplicatesByIds(t);
57	},
58	markWalletsAsInstalled(e) {
59		let { connectors: t } = c.state, { featuredWalletIds: r } = n.state, i = t.filter((e) => e.type === "ANNOUNCED").reduce((e, t) => (t.info?.rdns && (e[t.info.rdns] = !0), e), {});
60		return e.map((e) => ({
61			...e,
62			installed: !!e.rdns && !!i[e.rdns ?? ""]
63		})).sort((e, t) => {
64			let n = Number(t.installed) - Number(e.installed);
65			if (n !== 0) return n;
66			if (r?.length) {
67				let n = r.indexOf(e.id), i = r.indexOf(t.id);
68				if (n !== -1 && i !== -1) return n - i;
69				if (n !== -1) return -1;
70				if (i !== -1) return 1;
71			}
72			return 0;
73		});
74	},
75	getConnectOrderMethod(e, t) {
76		let i = e?.connectMethodsOrder || n.state.features?.connectMethodsOrder, a = t || c.state.connectors;
77		if (i) return i;
78		let { injected: o, announced: l } = f.getConnectorsByType(a, r.state.recommended, r.state.featured), u = o.filter(f.showConnector), d = l.filter(f.showConnector);
79		return u.length || d.length ? [
80			"wallet",
81			"email",
82			"social"
83		] : s.DEFAULT_CONNECT_METHOD_ORDER;
84	},
85	isExcluded(e) {
86		let t = !!e.rdns && r.state.excludedWallets.some((t) => t.rdns === e.rdns), n = !!e.name && r.state.excludedWallets.some((t) => u.isLowerCaseMatch(t.name, e.name));
87		return t || n;
88	}
89}, f = {
90	getConnectorsByType(t, r, i) {
91		let { customWallets: a } = n.state, o = e.getRecentWallets(), s = d.filterOutDuplicateWallets(r), c = d.filterOutDuplicateWallets(i), l = t.filter((e) => e.type === "MULTI_CHAIN"), u = t.filter((e) => e.type === "ANNOUNCED"), f = t.filter((e) => e.type === "INJECTED");
92		return {
93			custom: a,
94			recent: o,
95			external: t.filter((e) => e.type === "EXTERNAL"),
96			multiChain: l,
97			announced: u,
98			injected: f,
99			recommended: s,
100			featured: c
101		};
102	},
103	showConnector(e) {
104		let t = e.info?.rdns, n = !!t && r.state.excludedWallets.some((e) => !!e.rdns && e.rdns === t), o = !!e.name && r.state.excludedWallets.some((t) => u.isLowerCaseMatch(t.name, e.name));
105		return !(e.type === "INJECTED" && (e.name === "Browser Wallet" && (!a.isMobile() || a.isMobile() && !t && !i.checkInstalled()) || n || o) || (e.type === "ANNOUNCED" || e.type === "EXT
105ERNAL") && (n || o));
106	},
107	getIsConnectedWithWC() {
108		return Array.from(o.state.chains.values()).some((e) => c.getConnectorId(e.namespace) === t.CONNECTOR_ID.WALLET_CONNECT);
109	},
110	getConnectorTypeOrder({ recommended: e, featured: t, custom: r, recent: i, announced: a, injected: o, multiChain: s, external: c, overriddenConnectors: l = n.state.features?.connectorTypeOrder ?? [] }) {
111		let u = f.getIsConnectedWithWC(), d = [
112			{
113				type: "walletConnect",
114				isEnabled: n.state.enableWalletConnect && !u
115			},
116			{
117				type: "recent",
118				isEnabled: i.length > 0
119			},
120			{
121				type: "injected",
122				isEnabled: [
123					...o,
124					...a,
125					...s
126				].length > 0
127			},
128			{
129				type: "featured",
130				isEnabled: t.length > 0
131			},
132			{
133				type: "custom",
134				isEnabled: r && r.length > 0
135			},
136			{
137				type: "external",
138				isEnabled: c.length > 0
139			},
140			{
141				type: "recommended",
142				isEnabled: e.length > 0
143			}
144		].filter((e) => e.isEnabled), p = new Set(d.map((e) => e.type)), m = l.filter((e) => p.has(e)).map((e) => ({
145			type: e,
146			isEnabled: !0
147		})), h = d.filter(({ type: e }) => !m.some(({ type: t }) => t === e));
148		return Array.from(new Set([...m, ...h].map(({ type: e }) => e)));
149	}
150};
151//#endregion
152export { l as i, d as n, u as r, f as t };

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.