Skip to content

fix(chain-adapter): add error logging for EVM balance queries - #162

Closed
Gaubee wants to merge 1 commit into
mainfrom
fix/evm-balance-debug
Closed

Gaubee wants to merge 1 commit into
mainfrom
fix/evm-balance-debug

Conversation

@Gaubee

@Gaubee Gaubee commented Jan 4, 2026

Copy link
Copy Markdown
Contributor

Problem

Customer reports external chain assets (ETH/BSC) not showing in the wallet.

Investigation revealed that the EVM asset service silently swallows errors:

} catch {
  return { amount: Amount.fromRaw('0', ...), symbol: ... }
}

This makes debugging impossible - we don't know if the RPC failed, returned an error, or what went wrong.

Changes

  • Add console.error logging when balance queries fail (includes chain, address, RPC URL)
  • Add console.debug logging in DEV mode to trace query execution
  • No behavior change - still returns 0 balance on error, but now we can see why

Testing

  • pnpm turbo run lint:run typecheck:run - passes
  • pnpm turbo run test:run - all 69+ tests pass

Next Steps

After merging, customer can:

  1. Open browser DevTools console
  2. Try to view their wallet
  3. Share any error logs so we can diagnose the actual issue

Previously, errors in getNativeBalance and getTokenBalance were silently
swallowed and returned 0 balance. This made debugging impossible.

Changes:
- Log errors to console.error with chain, address, and RPC URL info
- Add debug logging in DEV mode for tracing balance queries
- This will help diagnose why customer assets are not showing
@Gaubee Gaubee closed this Jan 4, 2026
@Gaubee
Gaubee deleted the fix/evm-balance-debug branch January 5, 2026 02:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant