Skip to content

docs(react): document wallet selection and provider disambiguation - #310

Open
erhnysr wants to merge 1 commit into
FhenixProtocol:masterfrom
erhnysr:docs/react-wallet-selection
Open

docs(react): document wallet selection and provider disambiguation#310
erhnysr wants to merge 1 commit into
FhenixProtocol:masterfrom
erhnysr:docs/react-wallet-selection

Conversation

@erhnysr

@erhnysr erhnysr commented Aug 10, 2026

Copy link
Copy Markdown

Follows up on #276.

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.

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@changeset-bot

changeset-bot Bot commented Aug 10, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: e48e990

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

Click here to learn what changesets are, and how to add one.

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

@vercel

vercel Bot commented Aug 10, 2026

Copy link
Copy Markdown

@erhnysr is attempting to deploy a commit to the alexs-6860's projects Team on Vercel.

A member of the Team first needs to authorize it.

@vercel

vercel Bot commented Aug 10, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

1 Skipped Deployment
Project Deployment Actions Updated (UTC)
cofhesdk-docs Ignored Ignored Aug 10, 2026 5:54pm

Request Review

@erhnysr

erhnysr commented Aug 11, 2026

Copy link
Copy Markdown
Author

Complements #309 — that one implements the connector-side resolution, this documents why the SDK doesn't do it.

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