@babylonlabs-io/wallet-connector 2.0.16 → 2.0.17

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.
@@ -1,15 +1,15 @@
1
1
  var Ht = Object.defineProperty;
2
2
  var Ft = (t, e, n) => e in t ? Ht(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
3
3
  var O = (t, e, n) => Ft(t, typeof e != "symbol" ? e + "" : e, n);
4
- import { parseEther as Qe, http as Mt } from "viem";
5
- import { getAccount as q, watchAccount as Je, watchChainId as Kt, connect as Ut, disconnect as kt, signMessage as Gt, signTypedData as jt, sendTransaction as zt, estimateGas as $t, switchChain as Yt, getBalance as Xt, getTransactionCount as Zt } from "wagmi/actions";
4
+ import { parseEther as Ve, http as Mt } from "viem";
5
+ import { getAccount as q, watchAccount as Qe, watchChainId as Kt, connect as Ut, disconnect as kt, signMessage as Gt, signTypedData as jt, sendTransaction as zt, estimateGas as $t, switchChain as Yt, getBalance as Xt, getTransactionCount as Zt } from "wagmi/actions";
6
6
  import { walletConnect as Vt, baseAccount as Qt } from "wagmi/connectors";
7
7
  import { WagmiAdapter as Jt } from "@reown/appkit-adapter-wagmi";
8
8
  import { modal as qt, createAppKit as en } from "@reown/appkit/react";
9
9
  import { createStorage as tn, cookieStorage as nn } from "wagmi";
10
10
  import { useRef as W, useEffect as H, useState as oe, createContext as he, useContext as pe, useMemo as k, useInsertionEffect as rn, useCallback as M, useLayoutEffect as ce, memo as ze } from "react";
11
- import { jsx as m, Fragment as $e, jsxs as P } from "react/jsx-runtime";
12
- import { Text as ne, Avatar as qe, useCopy as on, WalletIcon as ht, CheckIcon as cn, CopyIcon as sn, Heading as De, Button as Fe, DialogBody as an, DialogFooter as dn, Loader as ln, Chip as un, FullScreenDialog as fn } from "@babylonlabs-io/core-ui";
11
+ import { jsx as m, Fragment as ft, jsxs as P } from "react/jsx-runtime";
12
+ import { Text as ne, Avatar as Je, useCopy as on, WalletIcon as ht, CheckIcon as cn, CopyIcon as sn, Heading as De, Button as Fe, DialogBody as an, DialogFooter as dn, Loader as ln, Chip as un, FullScreenDialog as fn } from "@babylonlabs-io/core-ui";
13
13
  import { twMerge as X } from "tailwind-merge";
14
14
  function hn(t) {
15
15
  return t && t.__esModule && Object.prototype.hasOwnProperty.call(t, "default") ? t.default : t;
@@ -312,7 +312,7 @@ function nr(t) {
312
312
  function Pe(t) {
313
313
  return t instanceof me && t.code === Ee.SHARED_SESSION_DISCONNECT_REFUSED;
314
314
  }
315
- class Ye {
315
+ class $e {
316
316
  constructor(e, n, i, r, o) {
317
317
  O(this, "_connectedWallet", null);
318
318
  O(this, "_connectionGeneration", 0);
@@ -350,7 +350,7 @@ class Ye {
350
350
  this._connectedWallet !== n || this._connectionGeneration !== i || (this._connectedWallet = null, this._ee.emit("disconnect", n));
351
351
  }
352
352
  clone() {
353
- return new Ye(this.id, this.name, this.icon, this.wallets, this.config);
353
+ return new $e(this.id, this.name, this.icon, this.wallets, this.config);
354
354
  }
355
355
  on(e, n) {
356
356
  return this._ee.on(e, n);
@@ -414,7 +414,7 @@ const Cn = (t) => (e) => e[t], Nn = async ({ metadata: t, context: e, config: n
414
414
  );
415
415
  const d = s.find((l) => l.id === "injectable" && l.installed), p = s.filter(
416
416
  (l) => l.name.toLowerCase() !== (d == null ? void 0 : d.name.toLowerCase()) || l.id === "injectable"
417
- ), u = new Ye(e.chain, e.name, e.icon, p, i);
417
+ ), u = new $e(e.chain, e.name, e.icon, p, i);
418
418
  return e.chain !== "ETH" && c && s.some((l) => l.id === c && l.installed) && u.connect(c).catch((l) => {
419
419
  console.error("Auto-reconnect failed:", l instanceof Error ? l.message : "Unknown error");
420
420
  }), u;
@@ -435,7 +435,7 @@ function An({
435
435
  }
436
436
  return o;
437
437
  }
438
- const et = "unisat#initialized", yn = 3e3;
438
+ const qe = "unisat#initialized", yn = 3e3;
439
439
  function _n({
440
440
  connectors: t,
441
441
  setConnectors: e,
@@ -523,8 +523,8 @@ function _n({
523
523
  l.delete(v.id), _ && f.delete(v.id);
524
524
  }).catch(() => l.delete(v.id)));
525
525
  }, y = () => void h(!0), E = () => void h(!1), C = setTimeout(y, yn), w = typeof window < "u";
526
- return w && (window.addEventListener(et, y, { once: !0 }), window.addEventListener(Ue, E)), () => {
527
- a = !0, clearTimeout(C), w && (window.removeEventListener(et, y), window.removeEventListener(Ue, E));
526
+ return w && (window.addEventListener(qe, y, { once: !0 }), window.addEventListener(Ue, E)), () => {
527
+ a = !0, clearTimeout(C), w && (window.removeEventListener(qe, y), window.removeEventListener(Ue, E));
528
528
  };
529
529
  }, [p, n, i, r, o, e, s, c]);
530
530
  }
@@ -852,7 +852,7 @@ function ve() {
852
852
  return console.error("[account-storage] Failed to parse accounts map, clearing corrupted entry:", e), localStorage.removeItem(fe), {};
853
853
  }
854
854
  }
855
- function tt(t) {
855
+ function et(t) {
856
856
  try {
857
857
  localStorage.setItem(fe, JSON.stringify(t));
858
858
  } catch (e) {
@@ -882,23 +882,23 @@ const cr = (t, e) => {
882
882
  },
883
883
  set: (r, o) => {
884
884
  const s = ve(), c = _e(r, e), d = n(s);
885
- s[c] = o, s._timestamps = { ...d, [c]: Date.now() }, tt(s);
885
+ s[c] = o, s._timestamps = { ...d, [c]: Date.now() }, et(s);
886
886
  },
887
887
  delete: (r) => {
888
888
  const o = ve(), s = _e(r, e), c = n(o), d = Reflect.deleteProperty(o, s);
889
- return delete c[s], o._timestamps = c, tt(o), d;
889
+ return delete c[s], o._timestamps = c, et(o), d;
890
890
  }
891
891
  };
892
- }, Wn = "#000000", sr = "#1FE121", Bn = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='225px'%20height='224px'%20viewBox='0%200%20225%20224'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eokx%3c/title%3e%3cg%20id='Page-1'%20stroke='none'%20strokeWidth='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='okx'%20transform='translate(0.401000,%200.006000)'%20fill='%23FFFFFF'%20fill-rule='nonzero'%3e%3cpath%20d='M144.382,74.667%20L79.673,74.667%20C76.924,74.667%2074.695,76.895%2074.695,79.644%20L74.695,144.354%20C74.695,147.103%2076.924,149.332%2079.673,149.332%20L144.382,149.332%20C147.131,149.332%20149.36,147.103%20149.36,144.354%20L149.36,79.644%20C149.36,76.895%20147.131,74.667%20144.382,74.667%20Z'%20id='Path'%3e%3c/path%3e%3cpath%20d='M69.687,0%20L4.978,0%20C2.229,0%200,2.228%200,4.978%20L0,69.687%20C0,72.436%202.229,74.665%204.978,74.665%20L69.687,74.665%20C72.437,74.665%2074.665,72.436%2074.665,69.687%20L74.665,4.978%20C74.665,2.228%2072.437,0%2069.687,0%20Z'%20id='Path'%3e%3c/path%3e%3cpath%20d='M219.017,0%20L154.307,0%20C151.558,0%20149.329,2.228%20149.329,4.978%20L149.329,69.687%20C149.329,72.436%20151.558,74.665%20154.307,74.665%20L219.017,74.665%20C221.766,74.665%20223.994,72.436%20223.994,69.687%20L223.994,4.978%20C223.994,2.228%20221.766,0%20219.017,0%20Z'%20id='Path'%3e%3c/path%3e%3cpath%20d='M69.687,149.328%20L4.978,149.328%20C2.229,149.328%200,151.556%200,154.305%20L0,219.015%20C0,221.764%202.229,223.993%204.978,223.993%20L69.687,223.993%20C72.437,223.993%2074.665,221.764%2074.665,219.015%20L74.665,154.305%20C74.665,151.556%2072.437,149.328%2069.687,149.328%20Z'%20id='Path'%3e%3c/path%3e%3cpath%20d='M219.017,149.328%20L154.307,149.328%20C151.558,149.328%20149.329,151.556%20149.329,154.305%20L149.329,219.015%20C149.329,221.764%20151.558,223.993%20154.307,223.993%20L219.017,223.993%20C221.766,223.993%20223.994,221.764%20223.994,219.015%20L223.994,154.305%20C223.994,151.556%20221.766,149.328%20219.017,149.328%20Z'%20id='Path'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/svg%3e", Se = "babylon:open-appkit", Lt = "appkit-eth-connector", Hn = "appkit-btc-connector", nt = "bigint", it = "function", Fn = "AppKit configuration cannot be serialized.", Mn = 1, rt = /* @__PURE__ */ new WeakMap();
892
+ }, Wn = "#000000", sr = "#1FE121", Bn = "data:image/svg+xml,%3c?xml%20version='1.0'%20encoding='UTF-8'?%3e%3csvg%20width='225px'%20height='224px'%20viewBox='0%200%20225%20224'%20version='1.1'%20xmlns='http://www.w3.org/2000/svg'%20xmlns:xlink='http://www.w3.org/1999/xlink'%3e%3ctitle%3eokx%3c/title%3e%3cg%20id='Page-1'%20stroke='none'%20strokeWidth='1'%20fill='none'%20fill-rule='evenodd'%3e%3cg%20id='okx'%20transform='translate(0.401000,%200.006000)'%20fill='%23FFFFFF'%20fill-rule='nonzero'%3e%3cpath%20d='M144.382,74.667%20L79.673,74.667%20C76.924,74.667%2074.695,76.895%2074.695,79.644%20L74.695,144.354%20C74.695,147.103%2076.924,149.332%2079.673,149.332%20L144.382,149.332%20C147.131,149.332%20149.36,147.103%20149.36,144.354%20L149.36,79.644%20C149.36,76.895%20147.131,74.667%20144.382,74.667%20Z'%20id='Path'%3e%3c/path%3e%3cpath%20d='M69.687,0%20L4.978,0%20C2.229,0%200,2.228%200,4.978%20L0,69.687%20C0,72.436%202.229,74.665%204.978,74.665%20L69.687,74.665%20C72.437,74.665%2074.665,72.436%2074.665,69.687%20L74.665,4.978%20C74.665,2.228%2072.437,0%2069.687,0%20Z'%20id='Path'%3e%3c/path%3e%3cpath%20d='M219.017,0%20L154.307,0%20C151.558,0%20149.329,2.228%20149.329,4.978%20L149.329,69.687%20C149.329,72.436%20151.558,74.665%20154.307,74.665%20L219.017,74.665%20C221.766,74.665%20223.994,72.436%20223.994,69.687%20L223.994,4.978%20C223.994,2.228%20221.766,0%20219.017,0%20Z'%20id='Path'%3e%3c/path%3e%3cpath%20d='M69.687,149.328%20L4.978,149.328%20C2.229,149.328%200,151.556%200,154.305%20L0,219.015%20C0,221.764%202.229,223.993%204.978,223.993%20L69.687,223.993%20C72.437,223.993%2074.665,221.764%2074.665,219.015%20L74.665,154.305%20C74.665,151.556%2072.437,149.328%2069.687,149.328%20Z'%20id='Path'%3e%3c/path%3e%3cpath%20d='M219.017,149.328%20L154.307,149.328%20C151.558,149.328%20149.329,151.556%20149.329,154.305%20L149.329,219.015%20C149.329,221.764%20151.558,223.993%20154.307,223.993%20L219.017,223.993%20C221.766,223.993%20223.994,221.764%20223.994,219.015%20L223.994,154.305%20C223.994,151.556%20221.766,149.328%20219.017,149.328%20Z'%20id='Path'%3e%3c/path%3e%3c/g%3e%3c/g%3e%3c/svg%3e", Se = "babylon:open-appkit", Lt = "appkit-eth-connector", Hn = "appkit-btc-connector", tt = "bigint", nt = "function", Fn = "AppKit configuration cannot be serialized.", Mn = 1, it = /* @__PURE__ */ new WeakMap();
893
893
  let Kn = Mn;
894
894
  function Un(t) {
895
- const e = rt.get(t);
895
+ const e = it.get(t);
896
896
  if (e) return e;
897
897
  const n = Kn++;
898
- return rt.set(t, n), n;
898
+ return it.set(t, n), n;
899
899
  }
900
- function ot(t) {
901
- const e = JSON.stringify(t, (n, i) => typeof i === nt ? { type: nt, value: i.toString() } : typeof i === it ? { type: it, value: Un(i) } : i && typeof i == "object" && !Array.isArray(i) ? Object.fromEntries(
900
+ function rt(t) {
901
+ const e = JSON.stringify(t, (n, i) => typeof i === tt ? { type: tt, value: i.toString() } : typeof i === nt ? { type: nt, value: Un(i) } : i && typeof i == "object" && !Array.isArray(i) ? Object.fromEntries(
902
902
  Object.entries(i).sort(([r], [o]) => r < o ? -1 : r > o ? 1 : 0)
903
903
  ) : i);
904
904
  if (e === void 0)
@@ -913,8 +913,8 @@ function kn({
913
913
  }) {
914
914
  return Object.freeze({
915
915
  projectId: t,
916
- metadataFingerprint: ot(e),
917
- ethFingerprint: n ? ot(n) : void 0,
916
+ metadataFingerprint: rt(e),
917
+ ethFingerprint: n ? rt(n) : void 0,
918
918
  btcNetwork: i
919
919
  });
920
920
  }
@@ -923,7 +923,7 @@ const Le = /* @__PURE__ */ new Set();
923
923
  function U(t, e) {
924
924
  throw new me({ code: Ee.WALLET_INITIALIZATION_FAILED, message: t, chainId: e });
925
925
  }
926
- function Xe() {
926
+ function Ye() {
927
927
  return Q;
928
928
  }
929
929
  function Oe() {
@@ -966,7 +966,7 @@ function ar(t) {
966
966
  Gn(Yn), ae && ae !== t && console.warn(Xn), ae = t;
967
967
  }
968
968
  function Dt() {
969
- const t = Xe();
969
+ const t = Ye();
970
970
  if (t)
971
971
  return t.wagmiConfig || U(
972
972
  "AppKit was initialized without Ethereum support. Initialize it with Ethereum support.",
@@ -979,7 +979,7 @@ function Dt() {
979
979
  return ae;
980
980
  }
981
981
  function He() {
982
- const t = Xe();
982
+ const t = Ye();
983
983
  return t ? t.wagmiConfig !== void 0 : ae !== null;
984
984
  }
985
985
  function bt() {
@@ -987,7 +987,7 @@ function bt() {
987
987
  const t = Oe();
988
988
  return (t == null ? void 0 : t.getProviderType("eip155")) === "WALLET_CONNECT" && ((n = t == null ? void 0 : t.getAccount("bip122")) == null ? void 0 : n.isConnected) === !0;
989
989
  }
990
- const Zn = 1500, ct = "Wallet not connected", Vn = "Ethereum Wallet", Qn = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHZpZXdCb3g9IjAgMCAzMiAzMiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8Y2lyY2xlIGN4PSIxNiIgY3k9IjE2IiByPSIxNiIgZmlsbD0iIzYyN0VFQSIvPgogIDxwYXRoIGQ9Ik0xNiA0TDcuNSAxNi4yNUwxNiAyMkwyNC41IDE2LjI1TDE2IDR6IiBmaWxsPSJ3aGl0ZSIvPgogIDxwYXRoIGQ9Ik0xNiAyMi43NUw3LjUgMTdMMTYgMjhMMjQuNSAxN0wxNiAyMi43NXoiIGZpbGw9IndoaXRlIiBmaWxsLW9wYWNpdHk9IjAuNiIvPgo8L3N2Zz4=";
990
+ const Zn = 1500, ot = "Wallet not connected", Vn = "Ethereum Wallet", Qn = "data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMzIiIGhlaWdodD0iMzIiIHZpZXdCb3g9IjAgMCAzMiAzMiIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KICA8Y2lyY2xlIGN4PSIxNiIgY3k9IjE2IiByPSIxNiIgZmlsbD0iIzYyN0VFQSIvPgogIDxwYXRoIGQ9Ik0xNiA0TDcuNSAxNi4yNUwxNiAyMkwyNC41IDE2LjI1TDE2IDR6IiBmaWxsPSJ3aGl0ZSIvPgogIDxwYXRoIGQ9Ik0xNiAyMi43NUw3LjUgMTdMMTYgMjhMMjQuNSAxN0wxNiAyMi43NXoiIGZpbGw9IndoaXRlIiBmaWxsLW9wYWNpdHk9IjAuNiIvPgo8L3N2Zz4=";
991
991
  class Jn {
992
992
  constructor(e) {
993
993
  O(this, "config");
@@ -1025,7 +1025,7 @@ class Jn {
1025
1025
  n.address && n.status === "connected" && (this.address = n.address, this.chainId = n.chainId, setTimeout(() => {
1026
1026
  this.emit("accountsChanged", [n.address]);
1027
1027
  }, 100));
1028
- const i = Je(e, {
1028
+ const i = Qe(e, {
1029
1029
  onChange: (o) => {
1030
1030
  const s = this.address;
1031
1031
  this.address = o.address, this.chainId = o.chainId, s !== o.address && this.emit("accountsChanged", o.address ? [o.address] : []);
@@ -1058,7 +1058,7 @@ class Jn {
1058
1058
  clearTimeout(l), u && clearTimeout(u), f(), g == null || g();
1059
1059
  }, l = setTimeout(() => {
1060
1060
  a(), d(new Error("Connection timeout"));
1061
- }, 6e4), f = Je(e, {
1061
+ }, 6e4), f = Qe(e, {
1062
1062
  onChange: (y) => {
1063
1063
  y.address && (this.address = y.address, this.chainId = y.chainId, a(), c());
1064
1064
  }
@@ -1114,7 +1114,7 @@ class Jn {
1114
1114
  return this.address = n.address, this.chainId = n.chainId, this.address;
1115
1115
  if (this.address)
1116
1116
  return this.address;
1117
- throw new Error(ct);
1117
+ throw new Error(ot);
1118
1118
  }
1119
1119
  async getPublicKeyHex() {
1120
1120
  return this.getAddress();
@@ -1154,7 +1154,7 @@ class Jn {
1154
1154
  return await zt(n, {
1155
1155
  account: i,
1156
1156
  to: e.to,
1157
- value: e.value ? Qe(e.value) : void 0,
1157
+ value: e.value ? Ve(e.value) : void 0,
1158
1158
  data: e.data,
1159
1159
  gas: e.gasLimit,
1160
1160
  maxFeePerGas: e.maxFeePerGas,
@@ -1171,7 +1171,7 @@ class Jn {
1171
1171
  return await $t(n, {
1172
1172
  account: i,
1173
1173
  to: e.to,
1174
- value: e.value ? Qe(e.value) : void 0,
1174
+ value: e.value ? Ve(e.value) : void 0,
1175
1175
  data: e.data
1176
1176
  });
1177
1177
  } catch (n) {
@@ -1184,7 +1184,7 @@ class Jn {
1184
1184
  const e = this.getWagmiConfig(), n = q(e);
1185
1185
  if (n.chainId)
1186
1186
  return this.chainId = n.chainId, this.chainId;
1187
- throw new Error(ct);
1187
+ throw new Error(ot);
1188
1188
  }
1189
1189
  async switchChain(e) {
1190
1190
  try {
@@ -1311,7 +1311,7 @@ function lr(t) {
1311
1311
  projectId: t.projectId,
1312
1312
  metadata: t.metadata,
1313
1313
  ethChain: e
1314
- }), i = Xe();
1314
+ }), i = Ye();
1315
1315
  if (i)
1316
1316
  return $n(i, n), { modal: i.modal, wagmiConfig: Dt() };
1317
1317
  qt && U("Reown AppKit was initialized outside this package. Use only this package to initialize it.");
@@ -1347,7 +1347,7 @@ function oi(t) {
1347
1347
  return ri.find(({ match: e }) => e.test(t));
1348
1348
  }
1349
1349
  const de = () => pe(_t);
1350
- async function st(t) {
1350
+ async function ct(t) {
1351
1351
  const e = t.provider;
1352
1352
  if (!(e != null && e.getWalletProviderName) || !(e != null && e.getWalletProviderIcon)) return t;
1353
1353
  const [n, i] = await Promise.all([e.getWalletProviderName(), e.getWalletProviderIcon()]), r = oi(n || t.name);
@@ -1458,7 +1458,7 @@ function si({ persistent: t, accountStorage: e, onError: n, btcValidation: i })
1458
1458
  },
1459
1459
  ETH: (I) => async (T) => {
1460
1460
  var G;
1461
- T && (d == null || d(I.id, await st(T)), t && ((G = T.account) != null && G.address) && e.set(I.id, T.id)), a == null || a();
1461
+ T && (d == null || d(I.id, await ct(T)), t && ((G = T.account) != null && G.address) && e.set(I.id, T.id)), a == null || a();
1462
1462
  }
1463
1463
  }, N = _.map(
1464
1464
  (I) => {
@@ -1469,7 +1469,7 @@ function si({ persistent: t, accountStorage: e, onError: n, btcValidation: i })
1469
1469
  return _.forEach((I) => {
1470
1470
  const T = L.current.has(I.id) ? null : I.connectedWallet;
1471
1471
  if (I.id === "ETH" && T) {
1472
- st(T).then((G) => d == null ? void 0 : d(I.id, G));
1472
+ ct(T).then((G) => d == null ? void 0 : d(I.id, G));
1473
1473
  return;
1474
1474
  }
1475
1475
  d == null || d(I.id, T);
@@ -1595,7 +1595,7 @@ function si({ persistent: t, accountStorage: e, onError: n, btcValidation: i })
1595
1595
  }
1596
1596
  function ai(t, e, n) {
1597
1597
  const i = M(
1598
- (r, o) => /* @__PURE__ */ m($e, { children: o.map(({ id: s, widget: c }) => /* @__PURE__ */ m(
1598
+ (r, o) => /* @__PURE__ */ m(ft, { children: o.map(({ id: s, widget: c }) => /* @__PURE__ */ m(
1599
1599
  c,
1600
1600
  {
1601
1601
  id: s,
@@ -1670,7 +1670,7 @@ function Pt() {
1670
1670
  };
1671
1671
  }
1672
1672
  function di({ className: t, alt: e, logo: n, title: i, children: r, onClick: o }) {
1673
- const s = typeof n == "string" ? /* @__PURE__ */ m(qe, { url: n, alt: e }) : /* @__PURE__ */ m(qe, { children: n }), c = () => {
1673
+ const s = typeof n == "string" ? /* @__PURE__ */ m(Je, { url: n, alt: e }) : /* @__PURE__ */ m(Je, { children: n }), c = () => {
1674
1674
  if (typeof i == "string") {
1675
1675
  if (i.includes("Bitcoin")) return "select-bitcoin-wallet-button";
1676
1676
  if (i.includes("Ethereum")) return "select-ethereum-wallet-button";
@@ -1716,9 +1716,9 @@ function di({ className: t, alt: e, logo: n, title: i, children: r, onClick: o }
1716
1716
  }
1717
1717
  );
1718
1718
  }
1719
- const li = 36, at = 14;
1719
+ const li = 36, st = 14;
1720
1720
  function ui(t) {
1721
- return t.length <= li ? t : `${t.slice(0, at)}…${t.slice(-at)}`;
1721
+ return t.length <= li ? t : `${t.slice(0, st)}…${t.slice(-st)}`;
1722
1722
  }
1723
1723
  const fi = ze(({ className: t, logo: e, logoBackground: n, address: i }) => {
1724
1724
  const { isCopied: r, copyToClipboard: o } = on(), s = r(i), c = (d) => {
@@ -1889,7 +1889,7 @@ function Ni({
1889
1889
  title: n,
1890
1890
  description: i,
1891
1891
  cancelButton: r = "Cancel",
1892
- submitButton: o = /* @__PURE__ */ P($e, { children: [
1892
+ submitButton: o = /* @__PURE__ */ P(ft, { children: [
1893
1893
  "Continue ",
1894
1894
  /* @__PURE__ */ m("span", { className: "hidden md:inline", children: "Anyway" })
1895
1895
  ] }),
@@ -1986,9 +1986,9 @@ const Li = {
1986
1986
  [Z.MAINNET]: "bc1p",
1987
1987
  [Z.TESTNET]: "tb1p",
1988
1988
  [Z.SIGNET]: "tb1p"
1989
- }, Oi = "https://tbv-faucet.testnet.babylonlabs.io/", dt = (t) => t.installed && !t.hardware ? 0 : t.hardware ? 1 : 2, Di = ze(({ chain: t, className: e, append: n, onSelectWallet: i }) => {
1989
+ }, Oi = "https://tbv-faucet.testnet.babylonlabs.io/", at = (t) => t.installed && !t.hardware ? 0 : t.hardware ? 1 : 2, Di = ze(({ chain: t, className: e, append: n, onSelectWallet: i }) => {
1990
1990
  const r = k(
1991
- () => t.wallets.filter((c) => c.id === "injectable" ? c.installed : !0).sort((c, d) => dt(c) - dt(d)),
1991
+ () => t.wallets.filter((c) => c.id === "injectable" ? c.installed : !0).sort((c, d) => at(c) - at(d)),
1992
1992
  [t]
1993
1993
  ), o = k(() => {
1994
1994
  var p;
@@ -2008,7 +2008,7 @@ const Li = {
2008
2008
  `To continue, connect a ${t.name} wallet with a `,
2009
2009
  /* @__PURE__ */ m("span", { className: "text-accent-primary", children: `${o.prefix} (Taproot)` }),
2010
2010
  " address.",
2011
- o.showFaucet && /* @__PURE__ */ P($e, { children: [
2011
+ o.showFaucet && /* @__PURE__ */ P("span", { className: "block", children: [
2012
2012
  " Don't have testnet BTC yet? Get it from ",
2013
2013
  /* @__PURE__ */ m(
2014
2014
  "a",
@@ -2024,7 +2024,7 @@ const Li = {
2024
2024
  ] })
2025
2025
  ] })
2026
2026
  ] }),
2027
- /* @__PURE__ */ P("div", { className: "flex flex-col gap-4 p-6", children: [
2027
+ /* @__PURE__ */ P("div", { className: "flex flex-col gap-2 p-6", children: [
2028
2028
  r.map((c) => /* @__PURE__ */ m(
2029
2029
  Si,
2030
2030
  {
@@ -2048,7 +2048,7 @@ function bi({ widgets: t = {}, ...e }) {
2048
2048
  const { chains: n, screen: i } = de(), r = ((c = i.params) == null ? void 0 : c.chain) ?? "", o = n == null ? void 0 : n[r], s = t == null ? void 0 : t[r];
2049
2049
  return /* @__PURE__ */ m(Di, { append: s, chain: o, ...e });
2050
2050
  }
2051
- const lt = {
2051
+ const dt = {
2052
2052
  CHAINS: ({ onConfirm: t }) => /* @__PURE__ */ m(wi, { onConfirm: t }),
2053
2053
  WALLETS: ({ widgets: t, onSelectWallet: e }) => /* @__PURE__ */ m(bi, { widgets: t, onSelectWallet: e }),
2054
2054
  LOADER: ({ current: t }) => {
@@ -2059,7 +2059,7 @@ const lt = {
2059
2059
  EMPTY: () => /* @__PURE__ */ m("div", {})
2060
2060
  };
2061
2061
  function Pi(t) {
2062
- const e = lt[t.current.type] ?? lt.EMPTY;
2062
+ const e = dt[t.current.type] ?? dt.EMPTY;
2063
2063
  return /* @__PURE__ */ m(e, { ...t });
2064
2064
  }
2065
2065
  const re = "Wallet changed while confirming", xi = "Wallet did not report its network", Wi = "Wallet network does not match the configured network", Bi = "Connected wallet has no provider";
@@ -2076,7 +2076,7 @@ function je(t) {
2076
2076
  return i != null && i.account ? [{ chain: e, wallet: i, account: { ...i.account } }] : [];
2077
2077
  });
2078
2078
  }
2079
- function ut(t) {
2079
+ function lt(t) {
2080
2080
  return t.map(({ chain: e, wallet: n, account: i }) => {
2081
2081
  const r = { ...i }, o = {
2082
2082
  id: n.id,
@@ -2099,7 +2099,7 @@ function Fi(t, e, n) {
2099
2099
  return c ? c.wallet === r && c.provider === o && c.receipt === s : !n.includes(i);
2100
2100
  });
2101
2101
  }
2102
- async function ft(t, e, n) {
2102
+ async function ut(t, e, n) {
2103
2103
  const i = t(), r = je(i).map((l) => ({
2104
2104
  connection: l,
2105
2105
  provider: l.wallet.provider,
@@ -2193,15 +2193,15 @@ function fr({
2193
2193
  I(), e.delete(Y), h == null || h();
2194
2194
  }
2195
2195
  );
2196
- let Ze = !0;
2196
+ let Xe = !0;
2197
2197
  if (j = () => {
2198
- Ze && (Ze = !1, Wt());
2198
+ Xe && (Xe = !1, Wt());
2199
2199
  }, !F()) {
2200
2200
  j();
2201
2201
  return;
2202
2202
  }
2203
2203
  v.current = j;
2204
- const Te = await ft(
2204
+ const Te = await ut(
2205
2205
  () => b.current,
2206
2206
  a,
2207
2207
  i
@@ -2212,9 +2212,9 @@ function fr({
2212
2212
  throw new Error(
2213
2213
  `No connected account for required chain${We.length > 1 ? "s" : ""}: ${We.join(", ")}`
2214
2214
  );
2215
- const ye = Hi(Ae, a), Ve = async () => {
2215
+ const ye = Hi(Ae, a), Ze = async () => {
2216
2216
  if (!F()) return !1;
2217
- const Be = await ft(
2217
+ const Be = await ut(
2218
2218
  () => b.current,
2219
2219
  a,
2220
2220
  i
@@ -2228,8 +2228,8 @@ function fr({
2228
2228
  address: ye.account.address,
2229
2229
  public_key: ye.account.publicKeyHex,
2230
2230
  chain: ye.chain,
2231
- connections: ut(Ae)
2232
- })), !await Ve()) || (await (C == null ? void 0 : C(ut(Ae))), !await Ve()) || (t && e.set(Y, Te.receipt), !F()) || (f == null || f(Te.receipt), !F())) return;
2231
+ connections: lt(Ae)
2232
+ })), !await Ze()) || (await (C == null ? void 0 : C(lt(Ae))), !await Ze()) || (t && e.set(Y, Te.receipt), !F()) || (f == null || f(Te.receipt), !F())) return;
2233
2233
  Ne = !!f;
2234
2234
  }
2235
2235
  if (!F()) return;
@@ -2457,7 +2457,7 @@ export {
2457
2457
  er as d,
2458
2458
  kn as e,
2459
2459
  U as f,
2460
- Xe as g,
2460
+ Ye as g,
2461
2461
  ni as h,
2462
2462
  Qi as i,
2463
2463
  $n as j,
@@ -2478,4 +2478,4 @@ export {
2478
2478
  In as y,
2479
2479
  Mi as z
2480
2480
  };
2481
- //# sourceMappingURL=ETHWalletProvider-Dq5EwVtB.js.map
2481
+ //# sourceMappingURL=ETHWalletProvider-BBXEXYvk.js.map