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
* feat(dapp): gate non-custodial flow behind VITE_ENABLE_NON_CUSTODIAL; add dApp to release-please
v1.0 ships custodial-only. Non-custodial code stays in the bundle behind
a build-time flag so a flag-flipped build re-enables the full flow
without code changes.
Gating (UI-only — dashboard/transfer/balances already branch on
profile.keyMode, so they need no changes):
- New helper packages/dapp/src/lib/features.ts exports
NON_CUSTODIAL_ENABLED = (import.meta.env.VITE_ENABLE_NON_CUSTODIAL === "true").
- App.tsx routes new users straight to custodial-pending instead of the
registration-choice screen when the flag is off. The choice page and
the two non-custodial registration pages still exist but their
renderers are guarded by the flag so they're unreachable.
- CustodialRegistrationPage.onBack is now optional; when omitted (flag
off) the "← Back to registration" link and the inline "Cancel" button
are hidden, since there's nowhere to go back to.
- Bundle: 273 KB with flag off vs 283 KB with flag on — Vite tree-shakes
the dead non-custodial branches.
release-please:
- Add packages/dapp to release-please-config.json with component=dapp.
- Add packages/dapp: 0.1.0 to .release-please-manifest.json.
- No publish step: only the snap is on npm; the dApp gets a tag +
GitHub release + CHANGELOG entry on each user-facing dApp commit.
Regular CI on the release PR validates the dApp builds.
* fix(dapp): skip wallet_getSnaps probe when non-custodial is disabled
useSnap()'s mount effect called wallet_getSnaps unconditionally to
detect a previously-installed snap. Standard MetaMask doesn't support
that method and rejects with RPC 4100. The error was caught (returns
null), so behavior was correct, but MetaMask logs the error before
returning the rejection, and the failed RPC also showed up as
'StreamMiddleware - Unknown response id' noise.
useRegistration() mounts useSnap() unconditionally, so even the
custodial flow triggered the probe. Now the effect is gated on
NON_CUSTODIAL_ENABLED — custodial-only builds never call any snap RPC,
console stays clean, and standard MetaMask is fully supported.
* fix(dapp): switch-first chain handling so wallet_addEthereumChain doesn't reject stale chains
ensureChainAdded() unconditionally called wallet_addEthereumChain when MM
wasn't already on the target chainId. If MM had previously stored that
chainId with a different nativeCurrency.symbol (e.g. an older dApp build
that used a different name), MM returns -32602:
'nativeCurrency.symbol does not match currency symbol for a network the
user already has added with the same chainId'.
EIP-3326 covers this: switch first, fall back to add only on 4902
(chain not added). Switch tolerates symbol/name drift because it
doesn't try to mutate the existing entry. Add still runs cleanly for a
genuinely-unknown chain.
* fix(dapp): route TransferPage chain check through ensureChainAdded
handleMetaMaskSign called addEthChain directly, bypassing the
switch-first pattern in ensureChainAdded. If MM had the chain stored
with even minor metadata drift (e.g. a previous Canton Devnet entry
using a different nativeCurrency.symbol), every transfer attempt would
hit -32602 'nativeCurrency.symbol does not match'.
ensureChainAdded already does the right thing: switch first, fall back
to add only on 4902. Drop the inline addEthChain + ethChainId calls
and use the shared helper.
* feat(dapp): remove bridge tab + persist dashboard tab in URL hash
Bridge: drop the Bridge sidebar entry (was disabled), the BridgeIcon
component, the 'Bridge assets' quick-action button on the profile
page, and the Transfers/Bridge sub-tab toggle on the activity page
along with its associated CSS. Activity now just shows transfers.
Tab persistence: dashboardTab now syncs with window.location.hash, so
refreshing on /#balances stays on Balances instead of snapping back to
Profile. Hash updates use history.replaceState so back/forward across
tabs works without polluting history with intermediate entries. The
hash is only written while on the dashboard — landing/registration
don't touch it.
* refactor(dapp): dedupe custodial entry; hide snap status on custodial profile
- Gemini review: handleCustodial is now a useCallback, and goRegister
calls it instead of duplicating the setMode/setPage pair.
- Self-review: the Profile page's 'CANTON SNAP — Not installed' block
is now hidden for custodial users entirely. The block was always
meaningless for them and looked like a warning in the v1.0 custodial-
only build where useSnap's probe is also skipped.
* fix: format
0 commit comments