@rash2x/bridge-widget 0.1.20 → 0.1.21
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 +12 -10
- package/dist/evaa-bridge.cjs.map +1 -1
- package/dist/evaa-bridge.mjs +12 -10
- package/dist/evaa-bridge.mjs.map +1 -1
- package/package.json +1 -1
package/dist/evaa-bridge.cjs
CHANGED
|
@@ -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" })
|
|
@@ -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) {
|