@rash2x/bridge-widget 0.1.20 → 0.1.22
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 +29 -27
- package/dist/evaa-bridge.cjs.map +1 -1
- package/dist/evaa-bridge.mjs +29 -27
- package/dist/evaa-bridge.mjs.map +1 -1
- package/dist/styles.css +1 -1
- package/package.json +1 -1
package/dist/evaa-bridge.cjs
CHANGED
|
@@ -935,7 +935,7 @@ const SettingModal = ({ isOpen, onClose }) => {
|
|
|
935
935
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between items-center", children: [
|
|
936
936
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
937
937
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground text-sm font-medium leading-4", children: t("settings.gasOnDestination") }),
|
|
938
|
-
/* @__PURE__ */ jsxRuntime.jsx(Tip, { text: t("settings.gasOnDestination"), children: /* @__PURE__ */ jsxRuntime.jsx(TipIcon, { className: "
|
|
938
|
+
/* @__PURE__ */ jsxRuntime.jsx(Tip, { text: t("settings.gasOnDestination"), children: /* @__PURE__ */ jsxRuntime.jsx(TipIcon, { className: "w-4 h-4 text-muted-foreground" }) })
|
|
939
939
|
] }),
|
|
940
940
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-foreground text-sm font-medium leading-4", children: formatUsd(gasUsdValue) })
|
|
941
941
|
] }),
|
|
@@ -972,7 +972,7 @@ const SettingModal = ({ isOpen, onClose }) => {
|
|
|
972
972
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between items-center", children: [
|
|
973
973
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
974
974
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground text-sm font-medium leading-4", children: t("settings.slippageTolerance") }),
|
|
975
|
-
/* @__PURE__ */ jsxRuntime.jsx(Tip, { text: t("settings.slippageTolerance"), children: /* @__PURE__ */ jsxRuntime.jsx(TipIcon, { className: "
|
|
975
|
+
/* @__PURE__ */ jsxRuntime.jsx(Tip, { text: t("settings.slippageTolerance"), children: /* @__PURE__ */ jsxRuntime.jsx(TipIcon, { className: "w-4 h-4 text-muted-foreground" }) })
|
|
976
976
|
] }),
|
|
977
977
|
slippageBps >= 500 && /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-destructive text-xs font-medium", children: t("settings.highSlippageWarning", {
|
|
978
978
|
defaultValue: "High slippage warning"
|
|
@@ -1001,7 +1001,7 @@ const SettingModal = ({ isOpen, onClose }) => {
|
|
|
1001
1001
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col gap-5", children: [
|
|
1002
1002
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex justify-between items-center", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
1003
1003
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground text-sm font-medium leading-4", children: t("settings.routePriority") }),
|
|
1004
|
-
/* @__PURE__ */ jsxRuntime.jsx(Tip, { text: t("settings.routePriority"), children: /* @__PURE__ */ jsxRuntime.jsx(TipIcon, { className: "
|
|
1004
|
+
/* @__PURE__ */ jsxRuntime.jsx(Tip, { text: t("settings.routePriority"), children: /* @__PURE__ */ jsxRuntime.jsx(TipIcon, { className: "w-4 h-4 text-muted-foreground" }) })
|
|
1005
1005
|
] }) }),
|
|
1006
1006
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center justify-end gap-2", children: routePresets.map((r) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1007
1007
|
badge.Badge,
|
|
@@ -1184,7 +1184,7 @@ const SearchInput = ({
|
|
|
1184
1184
|
containerClassName
|
|
1185
1185
|
),
|
|
1186
1186
|
children: [
|
|
1187
|
-
/* @__PURE__ */ jsxRuntime.jsx(SearchIcon, { className: "
|
|
1187
|
+
/* @__PURE__ */ jsxRuntime.jsx(SearchIcon, { className: "w-6 h-6 text-input-icon" }),
|
|
1188
1188
|
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1189
1189
|
input.Input,
|
|
1190
1190
|
{
|
|
@@ -1224,7 +1224,7 @@ const TokenRow = ({
|
|
|
1224
1224
|
TokenSymbol,
|
|
1225
1225
|
{
|
|
1226
1226
|
symbol,
|
|
1227
|
-
className: "
|
|
1227
|
+
className: "w-8 h-8 rounded-full",
|
|
1228
1228
|
alt: symbol
|
|
1229
1229
|
}
|
|
1230
1230
|
),
|
|
@@ -1581,7 +1581,7 @@ const SelectTokenButton = ({
|
|
|
1581
1581
|
),
|
|
1582
1582
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-secondary-foreground text-sm font-semibold", children: label })
|
|
1583
1583
|
] }),
|
|
1584
|
-
/* @__PURE__ */ jsxRuntime.jsx(ArrowDownIcon, { className: "
|
|
1584
|
+
/* @__PURE__ */ jsxRuntime.jsx(ArrowDownIcon, { className: "w-4 h-4 text-secondary-foreground" })
|
|
1585
1585
|
]
|
|
1586
1586
|
}
|
|
1587
1587
|
);
|
|
@@ -2199,7 +2199,9 @@ const SwapButton = () => {
|
|
|
2199
2199
|
};
|
|
2200
2200
|
const WalletBalance = (props) => {
|
|
2201
2201
|
const { value, isLoading = false } = props;
|
|
2202
|
-
|
|
2202
|
+
const hasNoData = !value || value === "0" || value === "0.00" || value === "0.0";
|
|
2203
|
+
const shouldShowSkeleton = isLoading && hasNoData;
|
|
2204
|
+
if (shouldShowSkeleton) {
|
|
2203
2205
|
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex gap-2 items-center", children: [
|
|
2204
2206
|
/* @__PURE__ */ jsxRuntime.jsx(WalletIcon, { className: "text-muted-foreground" }),
|
|
2205
2207
|
/* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-4 w-16 rounded-md" })
|
|
@@ -2248,7 +2250,7 @@ const SelectNetworkButton = ({
|
|
|
2248
2250
|
),
|
|
2249
2251
|
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-secondary-foreground text-sm leading-5 font-semibold ", children: label })
|
|
2250
2252
|
] }),
|
|
2251
|
-
/* @__PURE__ */ jsxRuntime.jsx(ArrowDownIcon, { className: "
|
|
2253
|
+
/* @__PURE__ */ jsxRuntime.jsx(ArrowDownIcon, { className: "w-4 h-4 text-secondary-foreground" })
|
|
2252
2254
|
]
|
|
2253
2255
|
}
|
|
2254
2256
|
);
|
|
@@ -2436,9 +2438,9 @@ function short$1(addr) {
|
|
|
2436
2438
|
return addr.slice(0, 4) + "…" + addr.slice(-4);
|
|
2437
2439
|
}
|
|
2438
2440
|
const prefixIcons = {
|
|
2439
|
-
tronlink: /* @__PURE__ */ jsxRuntime.jsx(TronLinkIcon, { className: "
|
|
2440
|
-
metamask: /* @__PURE__ */ jsxRuntime.jsx(MetaMaskIcon, { className: "
|
|
2441
|
-
ton: /* @__PURE__ */ jsxRuntime.jsx(TonKeeperIcon, { className: "
|
|
2441
|
+
tronlink: /* @__PURE__ */ jsxRuntime.jsx(TronLinkIcon, { className: "w-5 h-5" }),
|
|
2442
|
+
metamask: /* @__PURE__ */ jsxRuntime.jsx(MetaMaskIcon, { className: "w-5 h-5" }),
|
|
2443
|
+
ton: /* @__PURE__ */ jsxRuntime.jsx(TonKeeperIcon, { className: "w-5 h-5" })
|
|
2442
2444
|
};
|
|
2443
2445
|
const mapWalletToType = (wallet) => {
|
|
2444
2446
|
switch (wallet) {
|
|
@@ -2723,9 +2725,9 @@ const AnotherAddress = () => {
|
|
|
2723
2725
|
{
|
|
2724
2726
|
variant: "ghost",
|
|
2725
2727
|
size: "sm",
|
|
2726
|
-
className: "rounded-full p-0
|
|
2728
|
+
className: "rounded-full p-0 w-5 h-5 self-start",
|
|
2727
2729
|
onClick: () => setValue(""),
|
|
2728
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "
|
|
2730
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.X, { className: "w-4 h-4" })
|
|
2729
2731
|
}
|
|
2730
2732
|
)
|
|
2731
2733
|
]
|
|
@@ -2900,7 +2902,7 @@ const Details = () => {
|
|
|
2900
2902
|
{
|
|
2901
2903
|
label: t("transaction.route"),
|
|
2902
2904
|
value: /* @__PURE__ */ jsxRuntime.jsxs("strong", { className: "flex items-center gap-2", children: [
|
|
2903
|
-
/* @__PURE__ */ jsxRuntime.jsx(StargateIcon, { className: "
|
|
2905
|
+
/* @__PURE__ */ jsxRuntime.jsx(StargateIcon, { className: "w-4 h-4" }),
|
|
2904
2906
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "", children: routeText })
|
|
2905
2907
|
] })
|
|
2906
2908
|
}
|
|
@@ -2941,7 +2943,7 @@ const DetailsRow = ({
|
|
|
2941
2943
|
}) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex justify-between items-center", children: [
|
|
2942
2944
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
2943
2945
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-sm text-priority font-normal", children: label }),
|
|
2944
|
-
/* @__PURE__ */ jsxRuntime.jsx(Tip, { text: label, children: /* @__PURE__ */ jsxRuntime.jsx(TipIcon, { className: "
|
|
2946
|
+
/* @__PURE__ */ jsxRuntime.jsx(Tip, { text: label, children: /* @__PURE__ */ jsxRuntime.jsx(TipIcon, { className: "w-4 h-4 text-receive-icon" }) })
|
|
2945
2947
|
] }),
|
|
2946
2948
|
isLoading ? /* @__PURE__ */ jsxRuntime.jsx(skeleton.Skeleton, { className: "h-4 w-16 rounded-md" }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-foreground text-sm", children: value ?? "—" })
|
|
2947
2949
|
] });
|
|
@@ -3706,7 +3708,7 @@ const WalletSelectModal = () => {
|
|
|
3706
3708
|
const IconComponent = wallet.icon;
|
|
3707
3709
|
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "-mx-5", children: /* @__PURE__ */ jsxRuntime.jsxs(button.Button, { className: "w-full cursor-pointer bg-transparent flex shadow-none items-center justify-between gap-3 px-5 py-3 hover:bg-muted h-auto rounded-md transition-[300]", children: [
|
|
3708
3710
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-3 min-w-0", children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3", children: [
|
|
3709
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "
|
|
3711
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-8 h-8 flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(IconComponent, { className: "w-8 h-8" }) }),
|
|
3710
3712
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-start min-w-0", children: [
|
|
3711
3713
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "font-extrabold text-foreground text-sm leading-4 truncate", children: short(wallet.address) }),
|
|
3712
3714
|
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs leading-3 font-semibold text-muted-foreground", children: wallet.name })
|
|
@@ -3720,7 +3722,7 @@ const WalletSelectModal = () => {
|
|
|
3720
3722
|
onClose();
|
|
3721
3723
|
},
|
|
3722
3724
|
className: "text-sm font-medium text-muted-foreground",
|
|
3723
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(ExitIcon, { className: "text-[#808080]
|
|
3725
|
+
children: /* @__PURE__ */ jsxRuntime.jsx(ExitIcon, { className: "text-[#808080] w-6 h-6" })
|
|
3724
3726
|
}
|
|
3725
3727
|
)
|
|
3726
3728
|
] }) }, wallet.id);
|
|
@@ -3747,7 +3749,7 @@ const WalletSelectModal = () => {
|
|
|
3747
3749
|
disabled: isEvmConnector ? isPending : !wallet.enabled,
|
|
3748
3750
|
className: "w-full cursor-pointer bg-transparent flex shadow-none items-center justify-between gap-3 px-5 py-3 hover:bg-muted h-auto rounded-md transition-[300] disabled:opacity-50 disabled:cursor-not-allowed",
|
|
3749
3751
|
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-3 min-w-0", children: [
|
|
3750
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-8 flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(IconComponent, { className: "
|
|
3752
|
+
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "w-8 flex items-center justify-center", children: /* @__PURE__ */ jsxRuntime.jsx(IconComponent, { className: "w-8 h-8" }) }),
|
|
3751
3753
|
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex flex-col items-start min-w-0", children: [
|
|
3752
3754
|
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "font-extrabold text-foreground text-sm leading-4 truncate", children: wallet.name }),
|
|
3753
3755
|
wallet.comingSoon ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs leading-3 font-semibold text-muted-foreground", children: t("wallets.comingSoon") }) : /* @__PURE__ */ jsxRuntime.jsx("div", { className: "text-xs leading-3 font-semibold text-muted-foreground", children: t("wallets.connect") })
|
|
@@ -5919,13 +5921,11 @@ async function getEvmBalances(publicClient, address, tokens, priorityToken) {
|
|
|
5919
5921
|
}
|
|
5920
5922
|
const nativeTokens = tokens.filter((t) => isNativeAddress(t.address));
|
|
5921
5923
|
const erc20Tokens = tokens.filter(
|
|
5922
|
-
(t) => !isNativeAddress(t.address) && viem.isAddress(t.address)
|
|
5924
|
+
(t) => !isNativeAddress(t.address) && viem.isAddress(t.address) && (!priorityToken || t.address !== priorityToken.address)
|
|
5923
5925
|
);
|
|
5924
5926
|
if (priorityToken) {
|
|
5925
5927
|
try {
|
|
5926
5928
|
const isPriorityNative = isNativeAddress(priorityToken.address);
|
|
5927
|
-
console.log(priorityToken);
|
|
5928
|
-
console.log(isPriorityNative);
|
|
5929
5929
|
if (isPriorityNative) {
|
|
5930
5930
|
const ethBalance = await publicClient.getBalance({
|
|
5931
5931
|
address
|
|
@@ -5951,20 +5951,22 @@ async function getEvmBalances(publicClient, address, tokens, priorityToken) {
|
|
|
5951
5951
|
functionName: "balanceOf",
|
|
5952
5952
|
args: [address]
|
|
5953
5953
|
});
|
|
5954
|
-
console.log(tokenBalance);
|
|
5955
5954
|
const balance = parseFloat(
|
|
5956
5955
|
viem.formatUnits(tokenBalance, priorityToken.decimals)
|
|
5957
5956
|
);
|
|
5958
|
-
console.log(balance);
|
|
5959
5957
|
if (balance > 0) {
|
|
5960
5958
|
balances[priorityToken.symbol] = { balance, address };
|
|
5961
5959
|
}
|
|
5962
5960
|
}
|
|
5963
5961
|
} catch (error) {
|
|
5964
|
-
|
|
5965
|
-
|
|
5966
|
-
|
|
5967
|
-
|
|
5962
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
5963
|
+
const isZeroDataError = errorMessage.includes('returned no data ("0x")');
|
|
5964
|
+
if (!isZeroDataError) {
|
|
5965
|
+
console.debug(
|
|
5966
|
+
`Failed to get priority token balance for ${priorityToken.symbol}:`,
|
|
5967
|
+
error
|
|
5968
|
+
);
|
|
5969
|
+
}
|
|
5968
5970
|
}
|
|
5969
5971
|
}
|
|
5970
5972
|
for (const token of nativeTokens) {
|