Skip to content

fix: prevent eth_getBalance when showBalance is disabled#2683

Open
minato32 wants to merge 1 commit into
rainbow-me:mainfrom
minato32:fix/2177-eth-getbalance-when-showbalance-disabled
Open

fix: prevent eth_getBalance when showBalance is disabled#2683
minato32 wants to merge 1 commit into
rainbow-me:mainfrom
minato32:fix/2177-eth-getbalance-when-showbalance-disabled

Conversation

@minato32

Copy link
Copy Markdown

Changes

  • useProfile now passes an explicit query.enabled to useBalance, gated on Boolean(includeBalance && address). Previously the hook disabled the query implicitly by passing address: undefined when includeBalance was false. Switching to an explicit enabled flag guarantees the underlying eth_getBalance RPC call is skipped whenever the consumer has opted out (via showBalance={false} on <ConnectButton />) or the account modal is closed.

What to test

  • With <ConnectButton showBalance={false} />, confirm eth_getBalance is not requested when <RainbowKitProvider /> mounts/re-renders.
  • With <AccountModal /> mounted but open={false}, confirm eth_getBalance is not requested.
  • With showBalance enabled (default or explicit), confirm the balance is fetched and displayed as before.

Closes #2177

@minato32 minato32 requested a review from a team as a code owner June 22, 2026 08:51
@vercel

vercel Bot commented Jun 22, 2026

Copy link
Copy Markdown

@minato32 is attempting to deploy a commit to the rainbowdotme Team on Vercel.

A member of the Team first needs to authorize it.

@changeset-bot

changeset-bot Bot commented Jun 22, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 72c77f0

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 18 packages
Name Type
@rainbow-me/rainbowkit Patch
example Patch
@rainbow-me/rainbow-button Patch
rainbowkit-next-app Patch
site Patch
with-create-react-app Patch
with-next-app-i18n Patch
with-next-app Patch
with-next-custom-button Patch
with-next-mint-nft Patch
with-next-siwe-iron-session Patch
with-next-siwe-next-auth Patch
with-next-wallet-button Patch
with-next Patch
with-react-router Patch
with-remix Patch
with-vite Patch
with-next-rainbow-button Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

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.

[bug] regression: eth_getBalance is requested when showBalance is disabled, again.

1 participant