@rash2x/bridge-widget 0.4.5 → 0.4.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.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const index = require("./index-CqOdLtGY.cjs");
3
+ const index = require("./index-kqLPlOw1.cjs");
4
4
  exports.DEFAULT_SLIPPAGE_BPS = index.DEFAULT_SLIPPAGE_BPS;
5
5
  exports.EvaaBridge = index.EvaaBridge;
6
6
  exports.RoutePriority = index.RoutePriority;
@@ -1,4 +1,4 @@
1
- import { S, d, f, e, H, B, F, W, L, z, _, G, A, D, Y, w, s, v, r, p, q, K, a1, a8, a3, a5, x, I, y, a4, a2, a6, a7, X, V, N, Z, a0, a9, P, Q, $, J, U, t, i, u, l, m, j, n, h, k, o } from "./index-D8wi96xC.js";
1
+ import { S, d, f, e, H, B, F, W, L, z, _, G, A, D, Y, w, s, v, r, p, q, K, a1, a8, a3, a5, x, I, y, a4, a2, a6, a7, X, V, N, Z, a0, a9, P, Q, $, J, U, t, i, u, l, m, j, n, h, k, o } from "./index-BG-E-qt2.js";
2
2
  export {
3
3
  S as DEFAULT_SLIPPAGE_BPS,
4
4
  d as EvaaBridge,
@@ -22748,7 +22748,7 @@ class WalletConnectModal {
22748
22748
  }
22749
22749
  async initUi() {
22750
22750
  if (typeof window !== "undefined") {
22751
- await import("./index-Byi5_0tY.js");
22751
+ await import("./index-DqeErSqM.js");
22752
22752
  const modal = document.createElement("wcm-modal");
22753
22753
  document.body.insertAdjacentElement("beforeend", modal);
22754
22754
  OptionsCtrl.setIsUiLoaded(true);
@@ -23055,13 +23055,17 @@ const WalletSelectModal = () => {
23055
23055
  const connectedWallets = walletConfigs.reduce((acc, { strategy, walletId, name, icon }) => {
23056
23056
  const account = strategy?.getAccount();
23057
23057
  if (strategy?.isConnected() && account) {
23058
- acc.push({
23059
- id: walletId,
23060
- name,
23061
- icon,
23062
- address: account,
23063
- onDisconnect: () => strategy.disconnect()
23064
- });
23058
+ if (walletId === "tronlink" && tronWalletConnect.isConnected) {
23059
+ return acc;
23060
+ } else {
23061
+ acc.push({
23062
+ id: walletId,
23063
+ name,
23064
+ icon,
23065
+ address: account,
23066
+ onDisconnect: () => strategy.disconnect()
23067
+ });
23068
+ }
23065
23069
  }
23066
23070
  return acc;
23067
23071
  }, []);
@@ -23079,7 +23083,7 @@ const WalletSelectModal = () => {
23079
23083
  if (isEvmConnector && metaMaskWallet?.isConnected()) {
23080
23084
  return true;
23081
23085
  }
23082
- if (walletId === "tronwc" && tronWalletConnect.isConnected) {
23086
+ if ((walletId === "tronwc" || walletId === "tronlink") && tronWalletConnect.isConnected) {
23083
23087
  return true;
23084
23088
  }
23085
23089
  return connectedWallets.some((w2) => w2.id === walletId);
@@ -25107,6 +25111,7 @@ function ChainStrategyProvider({
25107
25111
  () => new TronChainStrategy({
25108
25112
  tronAddress: tronWallet.address,
25109
25113
  tronConnected: tronWallet.connected,
25114
+ isWalletConnect: tronWallet.isWalletConnect,
25110
25115
  tronSelect: tronWallet.select,
25111
25116
  tronConnect: tronWallet.connect,
25112
25117
  tronDisconnect: tronWallet.disconnect
@@ -25114,6 +25119,7 @@ function ChainStrategyProvider({
25114
25119
  [
25115
25120
  tronWallet.address,
25116
25121
  tronWallet.connected,
25122
+ tronWallet.isWalletConnect,
25117
25123
  tronWallet.select,
25118
25124
  tronWallet.connect,
25119
25125
  tronWallet.disconnect
@@ -25781,6 +25787,9 @@ const EvaaBridgeWithProviders = (props) => {
25781
25787
  connect: tronConnect,
25782
25788
  disconnect: tronDisconnect
25783
25789
  } = useWallet();
25790
+ const tronWalletConnect = useTronWalletConnectContext();
25791
+ const isTronConnected = tronConnected || tronWalletConnect.isConnected;
25792
+ const tronWalletAddress = tronAddress || tronWalletConnect.address;
25784
25793
  const { setTonConnected, setMetaMaskConnected, setTronConnected } = useConnectedWalletsStore();
25785
25794
  useEffect(() => {
25786
25795
  setTonConnected(!!tonAddress);
@@ -25789,11 +25798,11 @@ const EvaaBridgeWithProviders = (props) => {
25789
25798
  setMetaMaskConnected(!!evmIsConnected);
25790
25799
  }, [evmIsConnected, setMetaMaskConnected]);
25791
25800
  useEffect(() => {
25792
- setTronConnected(!!tronConnected);
25793
- }, [tronConnected, setTronConnected]);
25801
+ setTronConnected(!!isTronConnected);
25802
+ }, [isTronConnected, setTronConnected]);
25794
25803
  useAutoSelectNetwork({
25795
25804
  tonAddress,
25796
- tronConnected,
25805
+ tronConnected: isTronConnected,
25797
25806
  evmIsConnected
25798
25807
  });
25799
25808
  return /* @__PURE__ */ jsx(BridgeI18nProvider, { defaultLanguage: props.defaultLanguage, children: /* @__PURE__ */ jsx(
@@ -25811,8 +25820,8 @@ const EvaaBridgeWithProviders = (props) => {
25811
25820
  address: tonAddress
25812
25821
  },
25813
25822
  tronWallet: {
25814
- address: tronAddress,
25815
- connected: tronConnected,
25823
+ address: tronWalletAddress,
25824
+ connected: isTronConnected,
25816
25825
  select: tronSelect,
25817
25826
  connect: tronConnect,
25818
25827
  disconnect: tronDisconnect
@@ -26093,4 +26102,4 @@ export {
26093
26102
  getQuoteFees as y,
26094
26103
  calculateMinReceived as z
26095
26104
  };
26096
- //# sourceMappingURL=index-D8wi96xC.js.map
26105
+ //# sourceMappingURL=index-BG-E-qt2.js.map