feat(wallet): bundle a default WalletConnect project ID (v0.17.1) - #40
Merged
Conversation
A WalletConnect project ID is a per-application, public client identifier (a dapp ships one for all its users; it's in browser bundles, not a secret) — not a per-user secret. clawmes previously required every user to create their own and set WALLETCONNECT_PROJECT_ID before WalletConnect would work at all. Bundle a default (Clawnch's Reown project ID) so /connect and clawnchconnect(mode=walletconnect) work out of the box: * bridges/wc_client.py: new _bridge_env() injects WALLETCONNECT_PROJECT_ID into the WC bridge subprocess env — the env var wins when set+non-empty, else the bundled default (an explicitly-empty value also falls back). * commands/doctor.py: WC project ID now reports [ok] by default, noting when the bundled default is in use. Override with your own WALLETCONNECT_PROJECT_ID (e.g. in ~/.hermes/.env) to use a separate Reown relay quota / analytics. Verification: 4580 passed, 8 skipped; 100% line coverage (16,255 stmts, 0 missing); ruff check + format clean; plugin.yaml byte-identical.
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.
Why
You asked the right question: a WalletConnect project ID should be project-level, not per-user. Correct — a WC project ID is a per-application, public client identifier (dapps embed a single one for all users; it ships in browser bundles and isn't a secret). clawmes was wrongly requiring every user to create their own and set
WALLETCONNECT_PROJECT_IDbefore WalletConnect would work.Change
Bundle Clawnch's Reown project ID as the default so
/connectandclawnchconnect(mode=walletconnect)work out of the box:bridges/wc_client.py: new_bridge_env()injectsWALLETCONNECT_PROJECT_IDinto the WC bridge subprocess env. The env var wins when set + non-empty; otherwise the bundled default is used (an explicitly-empty value also falls back).commands/doctor.py: WC project ID now shows[ok]by default and notes when the bundled default is in use.Override with your own
WALLETCONNECT_PROJECT_ID(e.g. in~/.hermes/.env) to use a separate Reown relay quota / analytics.Tradeoff (documented)
All default-id traffic counts against one shared Reown relay quota (Reown free tier has connection caps; a single shared ID is also a single point of failure if it gets rate-limited). Mitigations: monitor usage / upgrade the Reown plan, and the env override lets heavy users split off. It's a public identifier, so bundling it in the repo is fine; consider adding allowed-origins in the Reown dashboard if abuse appears.
Verification
ruff check+ruff format --checkcleanplugin.yamlbyte-identical