@rash2x/bridge-widget 0.6.25 → 0.6.26
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/evaa-bridge.cjs +1 -1
- package/dist/evaa-bridge.mjs +1 -1
- package/dist/{index-iLZftI4u.cjs → index-B4by666d.cjs} +2 -2
- package/dist/{index-iLZftI4u.cjs.map → index-B4by666d.cjs.map} +1 -1
- package/dist/{index-H1giqtvx.js → index-BBQ7KZI-.js} +43 -5
- package/dist/index-BBQ7KZI-.js.map +1 -0
- package/dist/{index-ByappRml.js → index-CNrU6f88.js} +2 -2
- package/dist/{index-ByappRml.js.map → index-CNrU6f88.js.map} +1 -1
- package/dist/{index-aniFwPIk.cjs → index-Dv5nujkk.cjs} +43 -5
- package/dist/index-Dv5nujkk.cjs.map +1 -0
- package/package.json +1 -1
- package/dist/index-H1giqtvx.js.map +0 -1
- package/dist/index-aniFwPIk.cjs.map +0 -1
|
@@ -2738,7 +2738,8 @@ const EditIcon = (props) => {
|
|
|
2738
2738
|
const prefixIcons = {
|
|
2739
2739
|
tronlink: /* @__PURE__ */ jsxRuntime.jsx(TronLinkIcon, { className: "w-5 h-5" }),
|
|
2740
2740
|
metamask: /* @__PURE__ */ jsxRuntime.jsx(MetaMaskIcon, { className: "w-5 h-5" }),
|
|
2741
|
-
ton: /* @__PURE__ */ jsxRuntime.jsx(TonConnectIcon, { className: "w-5 h-5" })
|
|
2741
|
+
ton: /* @__PURE__ */ jsxRuntime.jsx(TonConnectIcon, { className: "w-5 h-5" }),
|
|
2742
|
+
walletconnect: /* @__PURE__ */ jsxRuntime.jsx(WalletConnectIcon, { className: "w-5 h-5" })
|
|
2742
2743
|
};
|
|
2743
2744
|
const mapWalletToType = (wallet) => {
|
|
2744
2745
|
switch (wallet) {
|
|
@@ -2755,6 +2756,7 @@ const WalletInlineButton = ({
|
|
|
2755
2756
|
addressType
|
|
2756
2757
|
}) => {
|
|
2757
2758
|
const { t: t2 } = useBridgeTranslation();
|
|
2759
|
+
const { connector: connectedEvmConnector } = wagmi.useAccount();
|
|
2758
2760
|
const { onOpen } = useWalletSelectModal();
|
|
2759
2761
|
const { chainRegistry } = useChainStrategies();
|
|
2760
2762
|
const isCustomAddressEnabled = useCustomAddressStore(
|
|
@@ -2767,6 +2769,23 @@ const WalletInlineButton = ({
|
|
|
2767
2769
|
const isConnecting = connection?.isConnecting();
|
|
2768
2770
|
const isInitialized = connection?.isInitialized() ?? true;
|
|
2769
2771
|
const error = connection?.getError();
|
|
2772
|
+
const availableConnections = react.useMemo(
|
|
2773
|
+
() => connection?.getAvailableConnections() ?? [],
|
|
2774
|
+
[connection]
|
|
2775
|
+
);
|
|
2776
|
+
const evmConnectorId = connectedEvmConnector?.id;
|
|
2777
|
+
const activeTronConnection = react.useMemo(() => {
|
|
2778
|
+
if (walletType !== "tron") return null;
|
|
2779
|
+
const tronWalletConnect = availableConnections.find(
|
|
2780
|
+
(conn) => conn.provider === "walletconnect" && conn.connected && !!conn.address
|
|
2781
|
+
);
|
|
2782
|
+
if (tronWalletConnect) return tronWalletConnect;
|
|
2783
|
+
const tronLink = availableConnections.find(
|
|
2784
|
+
(conn) => conn.provider === "tronlink" && conn.connected && !!conn.address
|
|
2785
|
+
);
|
|
2786
|
+
if (tronLink) return tronLink;
|
|
2787
|
+
return null;
|
|
2788
|
+
}, [availableConnections, walletType]);
|
|
2770
2789
|
const handleClick = react.useCallback(() => {
|
|
2771
2790
|
onOpen(addressType);
|
|
2772
2791
|
}, [onOpen, addressType]);
|
|
@@ -2779,6 +2798,22 @@ const WalletInlineButton = ({
|
|
|
2779
2798
|
if (wallet === "tronlink") return t2("wallets.addTronWallet");
|
|
2780
2799
|
return t2("wallets.addEvmWallet");
|
|
2781
2800
|
}, [wallet, isInitialized, isConnecting, isConnected, account, t2]);
|
|
2801
|
+
const connectedIcon = react.useMemo(() => {
|
|
2802
|
+
if (!isConnected) return null;
|
|
2803
|
+
if (walletType === "tron" && activeTronConnection) {
|
|
2804
|
+
return activeTronConnection.provider === "walletconnect" ? prefixIcons.walletconnect : prefixIcons.tronlink;
|
|
2805
|
+
}
|
|
2806
|
+
if (walletType === "evm") {
|
|
2807
|
+
if (evmConnectorId) {
|
|
2808
|
+
if (evmConnectorId === "metaMaskSDK") return prefixIcons.metamask;
|
|
2809
|
+
if (evmConnectorId === "walletConnect")
|
|
2810
|
+
return prefixIcons.walletconnect;
|
|
2811
|
+
return prefixIcons.walletconnect;
|
|
2812
|
+
}
|
|
2813
|
+
return prefixIcons.metamask;
|
|
2814
|
+
}
|
|
2815
|
+
return prefixIcons[wallet];
|
|
2816
|
+
}, [activeTronConnection, evmConnectorId, isConnected, wallet, walletType]);
|
|
2782
2817
|
const isButtonDisabled = (wallet === "metamask" || wallet === "tronlink") && !isInitialized || isConnecting || addressType === "dst" && isCustomAddressEnabled;
|
|
2783
2818
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "inline-flex flex-col items-start gap-1", children: [
|
|
2784
2819
|
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
@@ -2792,9 +2827,12 @@ const WalletInlineButton = ({
|
|
|
2792
2827
|
disabled: isButtonDisabled,
|
|
2793
2828
|
variant: "ghost",
|
|
2794
2829
|
size: "sm",
|
|
2795
|
-
className:
|
|
2830
|
+
className: utils$1.cn(
|
|
2831
|
+
"flex gap-1 cursor-pointer hover:opacity-60 hover:bg-transparent !px-0 pr-1 h-5",
|
|
2832
|
+
isButtonDisabled && "opacity-50 bg-transparent"
|
|
2833
|
+
),
|
|
2796
2834
|
children: [
|
|
2797
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children:
|
|
2835
|
+
/* @__PURE__ */ jsxRuntime.jsx("span", { children: connectedIcon }),
|
|
2798
2836
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "leading-3 text-sm border-b border-dotted border-bridge-link text-bridge-link", children: buttonText }),
|
|
2799
2837
|
isConnected && /* @__PURE__ */ jsxRuntime.jsx(EditIcon, { className: "text-bridge-link -ml-0.5" })
|
|
2800
2838
|
]
|
|
@@ -25997,7 +26035,7 @@ class WalletConnectModal {
|
|
|
25997
26035
|
}
|
|
25998
26036
|
async initUi() {
|
|
25999
26037
|
if (typeof window !== "undefined") {
|
|
26000
|
-
await Promise.resolve().then(() => require("./index-
|
|
26038
|
+
await Promise.resolve().then(() => require("./index-B4by666d.cjs"));
|
|
26001
26039
|
const modal = document.createElement("wcm-modal");
|
|
26002
26040
|
document.body.insertAdjacentElement("beforeend", modal);
|
|
26003
26041
|
OptionsCtrl.setIsUiLoaded(true);
|
|
@@ -26746,4 +26784,4 @@ exports.useSettingsStore = useSettingsStore;
|
|
|
26746
26784
|
exports.useSwapModel = useSwapModel;
|
|
26747
26785
|
exports.useTokensStore = useTokensStore;
|
|
26748
26786
|
exports.useTransactionStore = useTransactionStore;
|
|
26749
|
-
//# sourceMappingURL=index-
|
|
26787
|
+
//# sourceMappingURL=index-Dv5nujkk.cjs.map
|