You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Arbitrum RPC calls in TokenSelect hit hardcoded LI.FI default instead of configured transport #469
Selecting Arbitrum in the TokenSelect component causes useTokens to fail with a CORS error followed by 429 Too Many Requests. No balances load. Other chains using the publicnode fallback configured in src/lib/networks.config.ts work correctly.
Console output:
Access to fetch at 'https://arb1.arbitrum.io/rpc' from origin 'http://localhost:5173' has been blocked by CORS policy: The 'Access-Control-Allow-Origin' header contains multiple values '*,*', but only one is allowed.
POST https://arb1.arbitrum.io/rpc net::ERR_FAILED 429 (Too Many Requests)
at queryFn (useTokens.ts:115)
Steps to reproduce
Run pnpm dev.
Open a page that renders TokenSelect (e.g. the TokenInput demo).
Open the network dropdown and switch to Arbitrum.
Observe console errors from arb1.arbitrum.io/rpc.
Expected vs actual behavior
Expected: Token balances load on Arbitrum using the publicnode RPC fallback configured for viem/wagmi in src/lib/networks.config.ts.
Actual: CORS block (Access-Control-Allow-Origin: *,*) and HTTP 429 from arb1.arbitrum.io/rpc. Nothing loads.
Environment
OS: macOS (darwin 25.2.0)
Node: 24.x
Dev server: http://localhost:5173
Reproduces on: main and fix/465
Additional context
Root cause. LI.FI's EVM() provider at src/hooks/useTokens.ts:25-28 is constructed with no client/transport arguments:
Without an explicit client, the LI.FI SDK uses its bundled default RPCs (hardcoded arb1.arbitrum.io for Arbitrum) rather than the transports defined in src/lib/networks.config.ts:21-22. PUBLIC_RPC_ARBITRUM does not fix this because that env var is only wired into the viem/wagmi transports, not LI.FI. There is no user-side workaround, hence severity: high.
The failure surfaces from useTokens.ts:115 where the queryFn calls LI.FI's getTokenBalances().
Suggested direction (non-binding): pass the project's wagmi config / viem publicClient factory into LI.FI's EVM() provider (or equivalent per the current LI.FI SDK version) so RPC calls route through the configured transports. Verify against the LI.FI SDK version pinned in package.json.
Related:#441 fixed the same class of CORS issue for viem/wagmi transports but did not cover LI.FI.
Activity