@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.mjs
CHANGED
|
@@ -2176,7 +2176,9 @@ const SwapButton = () => {
|
|
|
2176
2176
|
};
|
|
2177
2177
|
const WalletBalance = (props) => {
|
|
2178
2178
|
const { value, isLoading = false } = props;
|
|
2179
|
-
|
|
2179
|
+
const hasNoData = !value || value === "0" || value === "0.00" || value === "0.0";
|
|
2180
|
+
const shouldShowSkeleton = isLoading && hasNoData;
|
|
2181
|
+
if (shouldShowSkeleton) {
|
|
2180
2182
|
return /* @__PURE__ */ jsxs("div", { className: "flex gap-2 items-center", children: [
|
|
2181
2183
|
/* @__PURE__ */ jsx(WalletIcon, { className: "text-muted-foreground" }),
|
|
2182
2184
|
/* @__PURE__ */ jsx(Skeleton, { className: "h-4 w-16 rounded-md" })
|
|
@@ -5896,13 +5898,11 @@ async function getEvmBalances(publicClient, address, tokens, priorityToken) {
|
|
|
5896
5898
|
}
|
|
5897
5899
|
const nativeTokens = tokens.filter((t2) => isNativeAddress(t2.address));
|
|
5898
5900
|
const erc20Tokens = tokens.filter(
|
|
5899
|
-
(t2) => !isNativeAddress(t2.address) && isAddress(t2.address)
|
|
5901
|
+
(t2) => !isNativeAddress(t2.address) && isAddress(t2.address) && (!priorityToken || t2.address !== priorityToken.address)
|
|
5900
5902
|
);
|
|
5901
5903
|
if (priorityToken) {
|
|
5902
5904
|
try {
|
|
5903
5905
|
const isPriorityNative = isNativeAddress(priorityToken.address);
|
|
5904
|
-
console.log(priorityToken);
|
|
5905
|
-
console.log(isPriorityNative);
|
|
5906
5906
|
if (isPriorityNative) {
|
|
5907
5907
|
const ethBalance = await publicClient.getBalance({
|
|
5908
5908
|
address
|
|
@@ -5928,20 +5928,22 @@ async function getEvmBalances(publicClient, address, tokens, priorityToken) {
|
|
|
5928
5928
|
functionName: "balanceOf",
|
|
5929
5929
|
args: [address]
|
|
5930
5930
|
});
|
|
5931
|
-
console.log(tokenBalance);
|
|
5932
5931
|
const balance = parseFloat(
|
|
5933
5932
|
formatUnits(tokenBalance, priorityToken.decimals)
|
|
5934
5933
|
);
|
|
5935
|
-
console.log(balance);
|
|
5936
5934
|
if (balance > 0) {
|
|
5937
5935
|
balances[priorityToken.symbol] = { balance, address };
|
|
5938
5936
|
}
|
|
5939
5937
|
}
|
|
5940
5938
|
} catch (error) {
|
|
5941
|
-
|
|
5942
|
-
|
|
5943
|
-
|
|
5944
|
-
|
|
5939
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
5940
|
+
const isZeroDataError = errorMessage.includes('returned no data ("0x")');
|
|
5941
|
+
if (!isZeroDataError) {
|
|
5942
|
+
console.debug(
|
|
5943
|
+
`Failed to get priority token balance for ${priorityToken.symbol}:`,
|
|
5944
|
+
error
|
|
5945
|
+
);
|
|
5946
|
+
}
|
|
5945
5947
|
}
|
|
5946
5948
|
}
|
|
5947
5949
|
for (const token of nativeTokens) {
|