@babylonlabs-io/wallet-connector 0.6.8 → 0.6.10
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/index.cjs.js +2 -2
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.es.js +16 -35
- package/dist/index.es.js.map +1 -1
- package/package.json +1 -1
package/dist/index.es.js
CHANGED
|
@@ -89937,7 +89937,9 @@ const defaultWalletGetter = (e) => (t) => t[e], createWallet = async ({ metadata
|
|
|
89937
89937
|
config: n
|
|
89938
89938
|
})
|
|
89939
89939
|
);
|
|
89940
|
-
const u = s.find((d) => d.id === "injectable" && d.installed), p = s.filter(
|
|
89940
|
+
const u = s.find((d) => d.id === "injectable" && d.installed), p = s.filter(
|
|
89941
|
+
(d) => d.name.toLowerCase() !== (u == null ? void 0 : u.name.toLowerCase()) || d.id === "injectable"
|
|
89942
|
+
), c = new WalletConnector(t.chain, t.name, t.icon, p, n);
|
|
89941
89943
|
return a && s.some((d) => d.id === a) && await c.connect(a), c;
|
|
89942
89944
|
}, icon$1 = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20id='Layer_1'%20xmlns='http://www.w3.org/2000/svg'%20viewBox='0%200%20800%20800'%3e%3cdefs%3e%3cstyle%3e.cls-1{fill:%23ce6533;fill-rule:evenodd;}%3c/style%3e%3c/defs%3e%3cpath%20class='cls-1'%20d='M66.5,198.56c-3.27-8.85-1.09-18.79,5.58-25.47l90.82-90.82c6.67-6.67,16.62-8.85,25.46-5.59l193.65,71.14c4.76,1.75,7.92,6.28,7.92,11.35v42.4c0,3.21-1.27,6.28-3.54,8.55l-47.14,47.13c-3.33,3.34-8.3,4.43-12.73,2.79l-52.02-19.18-57.16-21.09c-4.83-1.79-9.55,2.92-7.76,7.76l40.27,109.18c1.63,4.43,.55,9.4-2.79,12.73l-41.91,41.89c-4.72,4.72-4.72,12.38,0,17.1l42.13,42.13c3.34,3.34,4.43,8.31,2.79,12.73l-40.27,109.17c-1.79,4.84,2.92,9.55,7.76,7.76l109.18-40.28c4.43-1.63,9.4-.54,12.73,2.79l46.91,46.91c2.27,2.27,3.54,5.34,3.54,8.55v42.41c0,5.06-3.15,9.59-7.9,11.34l-193.42,71.36c-8.85,3.27-18.8,1.08-25.47-5.59l-90.83-90.83c-6.67-6.67-8.85-16.61-5.58-25.47l71.11-192.77c1.99-5.4,1.99-11.34,0-16.74L66.5,198.56Z'/%3e%3cpath%20class='cls-1'%20d='M733.5,601.44c3.27,8.85,1.09,18.79-5.58,25.47l-90.82,90.83c-6.67,6.67-16.61,8.85-25.46,5.59l-193.65-71.14c-4.76-1.75-7.92-6.28-7.92-11.35v-42.4c0-3.21,1.27-6.28,3.54-8.55l47.14-47.13c3.33-3.34,8.3-4.43,12.73-2.79l52.02,19.18,57.16,21.09c4.83,1.79,9.54-2.92,7.76-7.76l-40.27-109.18c-1.63-4.43-.55-9.4,2.79-12.73l41.91-41.89c4.72-4.72,4.72-12.38,0-17.1l-42.13-42.13c-3.34-3.34-4.43-8.31-2.79-12.73l40.27-109.17c1.79-4.84-2.92-9.55-7.76-7.76l-109.18,40.28c-4.43,1.63-9.4,.54-12.73-2.79l-46.91-46.91c-2.27-2.27-3.54-5.34-3.54-8.55v-42.41c0-5.06,3.15-9.59,7.9-11.34l193.42-71.36c8.85-3.27,18.79-1.08,25.47,5.59l90.82,90.83c6.68,6.67,8.86,16.61,5.59,25.47l-71.11,192.77c-2,5.4-2,11.34,0,16.74l71.34,193.37h0Z'/%3e%3c/svg%3e", metadata$b = {
|
|
89943
89945
|
id: "injectable",
|
|
@@ -96625,7 +96627,7 @@ function useWalletConnectors({ persistent: e, accountStorage: t, onError: r }) {
|
|
|
96625
96627
|
}
|
|
96626
96628
|
D();
|
|
96627
96629
|
} catch (D) {
|
|
96628
|
-
r == null || r(D);
|
|
96630
|
+
Z.disconnect(), a == null || a(Z.id), p == null || p(), r == null || r(D);
|
|
96629
96631
|
}
|
|
96630
96632
|
},
|
|
96631
96633
|
BBN: (Z) => (y) => {
|
|
@@ -97076,10 +97078,7 @@ function WalletButton({
|
|
|
97076
97078
|
}
|
|
97077
97079
|
const Wallets = memo(({ chain: e, className: t, append: r, onClose: n, onBack: o, onSelectWallet: s }) => {
|
|
97078
97080
|
const a = useMemo(
|
|
97079
|
-
() => e.wallets.
|
|
97080
|
-
[e]
|
|
97081
|
-
), u = useMemo(() => e.wallets.filter((c) => c.id !== "injectable"), [e]), p = useMemo(
|
|
97082
|
-
() => e.wallets.filter((c) => c.id !== "injectable" || c.installed).length,
|
|
97081
|
+
() => e.wallets.filter((u) => u.id === "injectable" ? u.installed : !0),
|
|
97083
97082
|
[e]
|
|
97084
97083
|
);
|
|
97085
97084
|
return /* @__PURE__ */ jsxs("div", { className: twMerge("flex flex-1 flex-col", t), children: [
|
|
@@ -97089,36 +97088,18 @@ const Wallets = memo(({ chain: e, className: t, append: r, onClose: n, onBack: o
|
|
|
97089
97088
|
" Wallet"
|
|
97090
97089
|
] }) }),
|
|
97091
97090
|
/* @__PURE__ */ jsxs(DialogBody, { children: [
|
|
97092
|
-
/* @__PURE__ */
|
|
97093
|
-
|
|
97091
|
+
/* @__PURE__ */ jsx("div", { className: twMerge("grid gap-6", a.length > 1 ? "grid-cols-1 md:grid-cols-2" : "grid-cols-1"), children: a.map((u) => /* @__PURE__ */ jsx(
|
|
97092
|
+
WalletButton,
|
|
97094
97093
|
{
|
|
97095
|
-
|
|
97096
|
-
|
|
97097
|
-
|
|
97098
|
-
|
|
97099
|
-
|
|
97100
|
-
|
|
97101
|
-
|
|
97102
|
-
|
|
97103
|
-
|
|
97104
|
-
onClick: () => s == null ? void 0 : s(e, a)
|
|
97105
|
-
}
|
|
97106
|
-
),
|
|
97107
|
-
u.map((c) => /* @__PURE__ */ jsx(
|
|
97108
|
-
WalletButton,
|
|
97109
|
-
{
|
|
97110
|
-
installed: c.installed,
|
|
97111
|
-
name: c.name,
|
|
97112
|
-
logo: c.icon,
|
|
97113
|
-
label: c.label,
|
|
97114
|
-
fallbackLink: c.docs,
|
|
97115
|
-
onClick: () => s == null ? void 0 : s(e, c)
|
|
97116
|
-
},
|
|
97117
|
-
c.id
|
|
97118
|
-
))
|
|
97119
|
-
]
|
|
97120
|
-
}
|
|
97121
|
-
),
|
|
97094
|
+
installed: u.installed,
|
|
97095
|
+
name: u.name,
|
|
97096
|
+
logo: u.icon,
|
|
97097
|
+
label: u.label,
|
|
97098
|
+
fallbackLink: u.docs,
|
|
97099
|
+
onClick: () => s == null ? void 0 : s(e, u)
|
|
97100
|
+
},
|
|
97101
|
+
u.id
|
|
97102
|
+
)) }),
|
|
97122
97103
|
r
|
|
97123
97104
|
] }),
|
|
97124
97105
|
/* @__PURE__ */ jsx(DialogFooter, { className: "mt-auto pt-10", children: /* @__PURE__ */ jsx(Button, { variant: "outlined", fluid: !0, onClick: o, children: "Back" }) })
|