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
That issue turned out not to be an SDK defect — CoFHE never resolves a provider itself, it signs with whatever walletClient the app passes to connect() / CofheProvider. The wallet that ends up signing is whichever one the app's connector bound to, which is where the reported OKX/MetaMask collision actually happens.
Nothing in the repo said so, though, so this adds a short Wallet selection section to packages/react/README.md, after the Quick Start provider setup. It covers:
CoFHE signs with the supplied walletClient and does not read window.ethereum or pick a wallet
Multi-wallet disambiguation is therefore a connector-layer concern in the app, handled by targeting a provider explicitly
EIP-6963 noted as the emerging discovery standard, not presented as the current mechanism
A caveat that a direct property read of an injected provider's identity flag can return undefined while the same flag reads true when the object is enumerated, so a naive provider.isX !== true guard passes silently — enumerate, or compare provider identity
The caveat is written as general guidance rather than tied to any one wallet, since the underlying behaviour isn't specific to OKX and the docs should outlive any single connector implementation. Credit to @pplmaverick for surfacing it in #276.
Scope
Documentation only. @pplmaverick has a working connector implementation verified against real extensions; that's a separate change and stays with him.
Notes
No changeset: @cofhe/react is in the fixed group, so a changeset on a README-only edit would trigger a synchronized version bump and release across all nine packages. Happy to add an empty one (pnpm changeset --empty) if you'd rather have the paper trail.
prettier --check "**/*.{ts,tsx,md}" passes on the edited file.
Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.
This PR includes no changesets
When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types
Complements #309 — that one implements the connector-side resolution, this documents why the SDK doesn't do it.
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
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.
Follows up on #276.
That issue turned out not to be an SDK defect — CoFHE never resolves a provider itself, it signs with whatever
walletClientthe app passes toconnect()/CofheProvider. The wallet that ends up signing is whichever one the app's connector bound to, which is where the reported OKX/MetaMask collision actually happens.Nothing in the repo said so, though, so this adds a short Wallet selection section to
packages/react/README.md, after the Quick Start provider setup. It covers:walletClientand does not readwindow.ethereumor pick a walletundefinedwhile the same flag readstruewhen the object is enumerated, so a naiveprovider.isX !== trueguard passes silently — enumerate, or compare provider identityThe caveat is written as general guidance rather than tied to any one wallet, since the underlying behaviour isn't specific to OKX and the docs should outlive any single connector implementation. Credit to @pplmaverick for surfacing it in #276.
Scope
Documentation only. @pplmaverick has a working connector implementation verified against real extensions; that's a separate change and stays with him.
Notes
@cofhe/reactis in the fixed group, so a changeset on a README-only edit would trigger a synchronized version bump and release across all nine packages. Happy to add an empty one (pnpm changeset --empty) if you'd rather have the paper trail.prettier --check "**/*.{ts,tsx,md}"passes on the edited file.