@babylonlabs-io/wallet-connector 1.0.5 → 1.0.6

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
@@ -97751,7 +97751,7 @@ class OKXProvider {
97751
97751
  throw new Error(`BTC ${this.config.network} is not enabled in OKX Wallet`);
97752
97752
  }
97753
97753
  const { address: r, compressedPublicKey: n } = t;
97754
- if (validateAddress(this.config.network, r), n && r)
97754
+ if (n && r)
97755
97755
  this.walletInfo = {
97756
97756
  publicKeyHex: n,
97757
97757
  address: r
@@ -97854,9 +97854,7 @@ class OneKeyProvider {
97854
97854
  } catch (o) {
97855
97855
  throw (n = o == null ? void 0 : o.message) != null && n.includes("rejected") ? new Error("Connection to OneKey Wallet was rejected") : new Error(o == null ? void 0 : o.message);
97856
97856
  }
97857
- const t = await this.provider.getAddress();
97858
- validateAddress(this.config.network, t);
97859
- const r = await this.provider.getPublicKeyHex();
97857
+ const t = await this.provider.getAddress(), r = await this.provider.getPublicKeyHex();
97860
97858
  if (r && t)
97861
97859
  this.walletInfo = {
97862
97860
  publicKeyHex: r,
@@ -97962,9 +97960,7 @@ class UnisatProvider {
97962
97960
  } catch (s) {
97963
97961
  throw (o = s == null ? void 0 : s.message) != null && o.includes("rejected") ? new Error("Connection to Unisat Wallet was rejected") : new Error(s == null ? void 0 : s.message);
97964
97962
  }
97965
- const r = t[0];
97966
- validateAddress(this.config.network, r);
97967
- const n = await this.provider.getPublicKey();
97963
+ const r = t[0], n = await this.provider.getPublicKey();
97968
97964
  if (n && r)
97969
97965
  this.walletInfo = {
97970
97966
  publicKeyHex: n,
@@ -98469,7 +98465,7 @@ function useWalletConnectors({ persistent: e, accountStorage: t, onError: r }) {
98469
98465
  var T, D, G;
98470
98466
  try {
98471
98467
  if (!y || !y.account || (s == null || s("BTC", y), e && t.set(F.id, y.id), !o)) return;
98472
- await (x == null ? void 0 : x({
98468
+ validateAddress(F.config.network, y.account.publicKeyHex), await (x == null ? void 0 : x({
98473
98469
  address: y.account.address,
98474
98470
  public_key: y.account.publicKeyHex
98475
98471
  }));
@@ -98503,7 +98499,15 @@ function useWalletConnectors({ persistent: e, accountStorage: t, onError: r }) {
98503
98499
  }
98504
98500
  C();
98505
98501
  } catch (C) {
98506
- F.disconnect(), a == null || a(F.id), p == null || p(), r == null || r(C);
98502
+ F.disconnect(), a == null || a(F.id), c == null || c({
98503
+ title: "Connection Failed",
98504
+ description: C.message,
98505
+ submitButton: "",
98506
+ cancelButton: "Done",
98507
+ onCancel: async () => {
98508
+ p == null || p();
98509
+ }
98510
+ });
98507
98511
  }
98508
98512
  },
98509
98513
  BBN: (F) => (y) => {