@babylonlabs-io/wallet-connector 0.6.0 → 0.6.2

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.es.js CHANGED
@@ -94888,10 +94888,10 @@ const createProvider$1 = (e) => ({
94888
94888
  if (!d || !d.startsWith("tomo.")) return;
94889
94889
  const m = d.replace("tomo.", ""), w = n.find((v) => v.id === m);
94890
94890
  w && a(w);
94891
- }, [e, t]), useEffect(() => {
94891
+ }, [n, e, t]), useEffect(() => {
94892
94892
  p && o && c(p, o);
94893
94893
  }, [p, o, c]), useEffect(() => u ? u.on("disconnect", (m) => {
94894
- m.id === "tomo-bbn-connector" && s.disconnect();
94894
+ m.id.startsWith("tomo.") && s.disconnect();
94895
94895
  }) : void 0, [u, s]), null;
94896
94896
  });
94897
94897
  TomoBBNConnector.displayName = "TomoBBNConnector";
@@ -94936,10 +94936,10 @@ const createProvider = (e) => ({
94936
94936
  if (!d || !d.startsWith("tomo.")) return;
94937
94937
  const m = d.replace("tomo.", ""), w = n.find((v) => v.id === m);
94938
94938
  w && a(w);
94939
- }, [e, t]), useEffect(() => {
94939
+ }, [n, e, t]), useEffect(() => {
94940
94940
  p && o && c(p, o);
94941
94941
  }, [p, o, c]), useEffect(() => u ? u.on("disconnect", (m) => {
94942
- m.id === "tomo-btc-connector" && s.disconnect();
94942
+ m.id.startsWith("tomo.") && s.disconnect();
94943
94943
  }) : void 0, [u, s]), null;
94944
94944
  });
94945
94945
  TomoBTCConnector.displayName = "TomoBTCConnector";
@@ -95005,15 +95005,15 @@ function useWalletConnectors({ persistent: e, accountStorage: t, onError: r }) {
95005
95005
  );
95006
95006
  return () => H.forEach((Ie) => Ie());
95007
95007
  }, [o, u, n]), useEffect(() => {
95008
- if (!o) return;
95009
95008
  const F = Object.values(n).filter(Boolean), H = {
95010
95009
  BTC: (Z) => async (y) => {
95011
95010
  var S, P, Tr;
95012
95011
  try {
95013
- y && y.account && (s == null || s("BTC", y), e && t.set(Z.id, y.id), await (O == null ? void 0 : O({
95012
+ if (!y || !y.account || (s == null || s("BTC", y), e && t.set(Z.id, y.id), !o)) return;
95013
+ await (O == null ? void 0 : O({
95014
95014
  address: y.account.address,
95015
95015
  public_key: y.account.publicKeyHex
95016
- })));
95016
+ }));
95017
95017
  const D = () => void (C ? c == null ? void 0 : c() : p == null ? void 0 : p());
95018
95018
  if (!validateAddressWithPK(
95019
95019
  ((S = y.account) == null ? void 0 : S.address) ?? "",
@@ -95647,21 +95647,22 @@ const BBN_TESTNET_RPC_URL = "https://rpc-dapp.testnet.babylonlabs.io/", BBN_TEST
95647
95647
  features: ["cosmwasm"]
95648
95648
  }, ONE_HOUR = 60 * 60 * 1e3;
95649
95649
  Network.SIGNET, bbnTestnet.currencies[0].coinDenom, bbnTestnet.chainName, bbnTestnet.currencies[0].coinDenom, bbnTestnet.chainId;
95650
- const storage = createAccountStorage(ONE_HOUR);
95651
95650
  function WalletProvider({
95652
- persistent: e = !1,
95653
- theme: t,
95654
- lifecycleHooks: r,
95655
- children: n,
95656
- config: o,
95657
- context: s = window,
95658
- onError: a
95651
+ ttl: e = ONE_HOUR,
95652
+ persistent: t = !1,
95653
+ theme: r,
95654
+ lifecycleHooks: n,
95655
+ children: o,
95656
+ config: s,
95657
+ context: a = window,
95658
+ onError: u
95659
95659
  }) {
95660
- return /* @__PURE__ */ jsx(TomoConnectionProvider, { theme: t, config: o, children: /* @__PURE__ */ jsx(LifeCycleHooksProvider, { value: r, children: /* @__PURE__ */ jsxs(ChainProvider, { persistent: e, storage, context: s, config: o, onError: a, children: [
95661
- n,
95662
- /* @__PURE__ */ jsx(TomoBTCConnector, { persistent: e, storage }),
95663
- /* @__PURE__ */ jsx(TomoBBNConnector, { persistent: e, storage }),
95664
- /* @__PURE__ */ jsx(WalletDialog, { persistent: e, storage, config: o, onError: a })
95660
+ const p = useMemo(() => createAccountStorage(e), [e]);
95661
+ return /* @__PURE__ */ jsx(TomoConnectionProvider, { theme: r, config: s, children: /* @__PURE__ */ jsx(LifeCycleHooksProvider, { value: n, children: /* @__PURE__ */ jsxs(ChainProvider, { persistent: t, storage: p, context: a, config: s, onError: u, children: [
95662
+ o,
95663
+ /* @__PURE__ */ jsx(TomoBTCConnector, { persistent: t, storage: p }),
95664
+ /* @__PURE__ */ jsx(TomoBBNConnector, { persistent: t, storage: p }),
95665
+ /* @__PURE__ */ jsx(WalletDialog, { persistent: t, storage: p, config: s, onError: u })
95665
95666
  ] }) }) });
95666
95667
  }
95667
95668
  export {