Commit 246f056
fix(controllers): scope one-click auth chains to the connector's namespace
`WalletConnectConnector.authenticate()` passed `this.chains` to
`SIWXUtil.universalProviderAuthenticate`. That getter resolves to
`ChainController.getCaipNetworks()` with no namespace argument, i.e.
`getAllRequestedCaipNetworks()` — every registered namespace rather than
the connector's own, even though the connector is constructed per
namespace and already stores it as `this.chain`.
`universalProviderAuthenticate` then bails early:
const namespaces = new Set(chains.map(chain => chain.split(':')[0]))
if (!siwx || namespaces.size !== 1 || !namespaces.has('eip155')) {
return false
}
So registering any second namespace alongside EVM — Solana, for example —
made that set `{eip155, solana}` and silently disabled one-click auth for
every wallet. `connectWalletConnect()` fell back to `provider.connect()`
followed by a separate `personal_sign` round trip on every login, which is
markedly less reliable on mobile wallets; it reproduces as "Error signing
message" on Trust Wallet.
`getCaipNetworks()` already accepts a namespace, so pass `this.chain`.
Single-namespace apps are unaffected: the set was already of size one.
Scoped in `authenticate()` rather than in the `chains` getter because
`chains` is part of the public `ChainAdapterConnector` surface — the
bitcoin, tron and ton adapters read `connector.chains[0]` — so narrowing it
deserves its own change.
Added a regression test covering both an eip155 and a non-eip155 connector
while two namespaces are registered.
Co-Authored-By: Claude <noreply@anthropic.com>1 parent 12ad5be commit 246f056
3 files changed
Lines changed: 87 additions & 1 deletion
File tree
- .changeset
- packages/controllers
- src/controllers/AdapterController
- tests/controllers
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
59 | | - | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
60 | 66 | | |
61 | 67 | | |
62 | 68 | | |
| |||
Lines changed: 73 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
0 commit comments