@rash2x/bridge-widget 0.8.10 → 0.8.11

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.
@@ -3256,6 +3256,11 @@ function isEvmBalanceDebugEnabled() {
3256
3256
  const flag = window.localStorage.getItem("evaa.debugBalances");
3257
3257
  return flag === "1" || flag === "true";
3258
3258
  }
3259
+ function isRpcTransportError(error) {
3260
+ const message = error instanceof Error ? error.message : String(error ?? "");
3261
+ const normalized = message.toLowerCase();
3262
+ return normalized.includes("err_name_not_resolved") || normalized.includes("dns") || normalized.includes("failed to fetch") || normalized.includes("fetch failed") || normalized.includes("networkerror") || normalized.includes("timeout");
3263
+ }
3259
3264
  async function getEvmBalances(publicClient, address, tokens) {
3260
3265
  const balances = {};
3261
3266
  const debugRows = [];
@@ -3273,7 +3278,7 @@ async function getEvmBalances(publicClient, address, tokens) {
3273
3278
  const chainNative = publicClient.chain?.nativeCurrency;
3274
3279
  const nativeSymbol = chainNative?.symbol ?? "ETH";
3275
3280
  const nativeDecimals = chainNative?.decimals ?? 18;
3276
- const maxAttempts = 2;
3281
+ const maxAttempts = 1;
3277
3282
  for (let attempt = 1; attempt <= maxAttempts; attempt++) {
3278
3283
  try {
3279
3284
  const nativeBalance = await publicClient.getBalance({
@@ -3425,6 +3430,12 @@ async function getEvmBalances(publicClient, address, tokens) {
3425
3430
  "Multicall failed, falling back to individual calls:",
3426
3431
  error
3427
3432
  );
3433
+ if (isRpcTransportError(error)) {
3434
+ console.warn(
3435
+ "Skipping per-token fallback because RPC transport is unavailable"
3436
+ );
3437
+ return balances;
3438
+ }
3428
3439
  for (const token of erc20Tokens) {
3429
3440
  try {
3430
3441
  const tokenBalance = await publicClient.readContract({
@@ -3657,6 +3668,7 @@ function useBalances(chainKey, address) {
3657
3668
  enabled: !!address && !!chainKey && !!assetMatrix && tokensOnChain.length > 0 && isAddressValidForChain(chainKey, address),
3658
3669
  staleTime: 6e4,
3659
3670
  gcTime: 5 * 6e4,
3671
+ retry: false,
3660
3672
  refetchOnWindowFocus: false,
3661
3673
  refetchInterval: 6e4,
3662
3674
  refetchIntervalInBackground: false
@@ -26809,7 +26821,7 @@ class WalletConnectModal {
26809
26821
  }
26810
26822
  async initUi() {
26811
26823
  if (typeof window !== "undefined") {
26812
- await Promise.resolve().then(() => require("./index-D4aCX9t_.cjs"));
26824
+ await Promise.resolve().then(() => require("./index-Cm-9-5dT.cjs"));
26813
26825
  const modal = document.createElement("wcm-modal");
26814
26826
  document.body.insertAdjacentElement("beforeend", modal);
26815
26827
  OptionsCtrl.setIsUiLoaded(true);
@@ -27731,4 +27743,4 @@ exports.useSettingsStore = useSettingsStore;
27731
27743
  exports.useSwapModel = useSwapModel;
27732
27744
  exports.useTokensStore = useTokensStore;
27733
27745
  exports.useTransactionStore = useTransactionStore;
27734
- //# sourceMappingURL=index-CEYZ1mEJ.cjs.map
27746
+ //# sourceMappingURL=index-CdXk0Wlz.cjs.map