@rash2x/bridge-widget 0.6.13 → 0.6.16

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.
@@ -4096,6 +4096,7 @@ const WalletSelectModal = () => {
4096
4096
  const { t: t2 } = useBridgeTranslation();
4097
4097
  const { isOpen, onClose } = useWalletSelectModal();
4098
4098
  const { connectors } = wagmi.useConnect();
4099
+ const { address: evmAddress, connector: connectedConnector } = wagmi.useAccount();
4099
4100
  const { chainRegistry } = useChainStrategies();
4100
4101
  const tonWallet = chainRegistry.getStrategyByType(CHAIN_TYPES.TON);
4101
4102
  const metaMaskWallet = chainRegistry.getStrategyByType(CHAIN_TYPES.EVM);
@@ -4117,6 +4118,9 @@ const WalletSelectModal = () => {
4117
4118
  }
4118
4119
  ];
4119
4120
  const connectedWallets = walletConfigs.reduce((acc, { strategy, walletId, name, icon }) => {
4121
+ if (walletId === "metamask" && evmAddress && connectedConnector) {
4122
+ return acc;
4123
+ }
4120
4124
  const account = strategy?.getAccount();
4121
4125
  if (strategy?.isConnected() && account) {
4122
4126
  acc.push({
@@ -4129,6 +4133,19 @@ const WalletSelectModal = () => {
4129
4133
  }
4130
4134
  return acc;
4131
4135
  }, []);
4136
+ if (evmAddress && connectedConnector) {
4137
+ const iconMap = {
4138
+ metaMaskSDK: MetaMaskIcon,
4139
+ walletConnect: WalletConnectIcon
4140
+ };
4141
+ connectedWallets.push({
4142
+ id: connectedConnector.id,
4143
+ name: connectedConnector.name,
4144
+ icon: iconMap[connectedConnector.id] || WalletConnectIcon,
4145
+ address: evmAddress,
4146
+ onDisconnect: () => metaMaskWallet?.disconnect()
4147
+ });
4148
+ }
4132
4149
  tronConnections.forEach((connection) => {
4133
4150
  if (!connection.connected || !connection.address) return;
4134
4151
  const isWalletConnect = connection.provider === "walletconnect";
@@ -5560,7 +5577,6 @@ class TronChainStrategy {
5560
5577
  }
5561
5578
  async connect(options) {
5562
5579
  const provider = this.resolveProvider(options?.provider);
5563
- console.log(provider);
5564
5580
  if (provider === "walletconnect") {
5565
5581
  const walletConnect = this.config.walletConnect;
5566
5582
  if (!walletConnect?.connect) {
@@ -6529,16 +6545,16 @@ const TokenRow = ({
6529
6545
  }
6530
6546
  ),
6531
6547
  /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-start gap-1", children: [
6532
- /* @__PURE__ */ jsxRuntime.jsx("p", { className: "font-semibold text-foreground text-sm leading-4 truncate flex items-center gap-1", children: symbol }),
6533
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs leading-3 text-muted-foreground truncate", children: name })
6548
+ /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-foreground font-extrabold text-sm leading-4 truncate flex items-center gap-1", children: symbol }),
6549
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs font-semibold leading-3 text-muted-foreground truncate", children: name })
6534
6550
  ] })
6535
6551
  ] }),
6536
6552
  /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-right space-y-1", children: isBalanceLoading && hasAnyWallet ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-end gap-1", children: [
6537
6553
  /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-5 w-16 rounded-md" }),
6538
6554
  /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-3 w-12 rounded-md" })
6539
6555
  ] }) : /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
6540
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "font-semibold text-foreground text-sm leading-4 truncate", children: hasAnyWallet ? formatBalance(balance) : "—" }),
6541
- /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs leading-3 text-muted-foreground/50", children: hasAnyWallet && balance > 0 && usdValue > 0 ? formatUsd(usdValue) : "—" })
6556
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-foreground font-extrabold text-sm leading-4 truncate", children: hasAnyWallet ? formatBalance(balance) : "—" }),
6557
+ /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs font-semibold leading-3 text-muted-foreground", children: hasAnyWallet && balance > 0 && usdValue > 0 ? formatUsd(usdValue) : "—" })
6542
6558
  ] }) })
6543
6559
  ]
6544
6560
  }
@@ -25922,7 +25938,7 @@ class WalletConnectModal {
25922
25938
  }
25923
25939
  async initUi() {
25924
25940
  if (typeof window !== "undefined") {
25925
- await Promise.resolve().then(() => require("./index-B7J9ZWjf.cjs"));
25941
+ await Promise.resolve().then(() => require("./index-Cju6YF5r.cjs"));
25926
25942
  const modal = document.createElement("wcm-modal");
25927
25943
  document.body.insertAdjacentElement("beforeend", modal);
25928
25944
  OptionsCtrl.setIsUiLoaded(true);
@@ -26671,4 +26687,4 @@ exports.useSettingsStore = useSettingsStore;
26671
26687
  exports.useSwapModel = useSwapModel;
26672
26688
  exports.useTokensStore = useTokensStore;
26673
26689
  exports.useTransactionStore = useTransactionStore;
26674
- //# sourceMappingURL=index-C6a8cU4O.cjs.map
26690
+ //# sourceMappingURL=index-DOJM0lwX.cjs.map