fix(wallet): remove broken isKeplr guard rejecting real Keplr#156
Merged
Conversation
The isKeplr === true strict-equality guard added in #155 rejected real Keplr as "not installed" on app-dev. Root cause: isKeplr is declared on Keplr's EthereumProvider interface (the EVM bridge), NOT on the main Cosmos Keplr interface that window.keplr resolves to. Pattern-matching from the isPhantom/isSolflare guards on Solana wallets does not generalise — Keplr's Cosmos provider exposes no equivalent identity flag. Restores the original window.keplr-existence check. Adds a comment block explaining the asymmetry so a future contributor does not re-add a marker check without a verified Cosmos-side signal.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Removes the
window.keplr.isKeplr === truestrict-equality guard added toWalletUtils.getKeplrExtensionin #155. The guard rejected real Keplr as "not installed" on app-dev; restoring the originalif (w.keplr)semantics that worked pre-#155 unblocks Keplr connect immediately.Root cause
The guard pattern-matched the
isPhantom/isSolflaredefenses on the Solana wallets (PR #155). It does not generalise to Keplr:isKeplris declared in@keplr-wallet/typesonly onEthereumProvider(node_modules/@keplr-wallet/types/build/wallet/ethereum.d.ts:7) — Keplr's EVM bridge that competes with MetaMask. The main CosmosKeplrinterface thatwindow.keplrresolves to does not expose that flag, so the strict-equality check rejected every real Keplr extension.Changes
src/common/utils/WalletUtils.ts— dropisRealKeplrhelper; restore the originalif (w.keplr) return Promise.resolve(w.keplr)paths. Add a comment block above the function explaining why a Cosmos-sideisKeplrcheck is not viable, so a future contributor does not re-add it.src/common/utils/WalletUtils.test.ts— drop the two test cases that asserted the guard's behaviour; restore the original test fixtures (marker: "keplr-instance").The Phantom and Solflare guards are unaffected and remain in place — those wallets do expose
isPhantom/isSolflareon their Solana providers.Verification
npx tsc --noEmitclean.npm run lintclean.npx vitest run— 760/760 passing (was 762; the two dropped tests targeted the removed guard).npm run buildclean.Error: Keplr wallet is not installed.) and traced it togetKeplrExtensionreturning undefined for a real Keplr lacking the marker.Follow-ups
window.keplrshape.