Commit 7f6cdfa
## Explanation
Currently it is possible for the window.ethereum provider to grant
solana accounts and scopes in its permission requests. Whether or not
that should be allowed UX is up for debate. Regardless, it causes an
issue where if Solana accounts and scopes are granted AND a dapp also
uses our solana provider, the dapp will be unable to use the solana
provider to make requests without first re-requesting solana accounts
from the solana provider (not the EVM provider). This is because the
permission granted via window.ethereum has `isMultichainOrigin: false`
where as the solana provider's granted permissions go through the
multichain api which will have them set `true` which then gets caught in
this `isMultichainOrigin` guard in `wallet_invokeMethod` handler.
The original purpose of this guard was to make the multichain api
granted permissions equivalent to a window.ethereum set of permissions,
but not the other way around. Trying to encourage multichain api usage
over window.ethereum usage in this manner doesn't really make sense / is
not worth this hassle anymore.
## References
<!--
Are there any issues that this pull request is tied to?
Are there other links that reviewers should consult to understand these
changes better?
Are there client or consumer pull requests to adopt any breaking
changes?
For example:
* Fixes #12345
* Related to #67890
-->
## Checklist
- [ ] I've updated the test suite for new or updated code as appropriate
- [ ] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [ ] I've communicated my changes to consumers by [updating changelogs
for packages I've
changed](https://github.com/MetaMask/core/tree/main/docs/contributing.md#updating-changelogs),
highlighting breaking changes as necessary
- [ ] I've prepared draft pull requests for clients and consumer
packages to resolve any breaking changes
---------
Co-authored-by: Alex Donesky <adonesky@gmail.com>
1 parent 7d78f3d commit 7f6cdfa
File tree
3 files changed
+5
-13
lines changed- packages/multichain-api-middleware
- src/handlers
3 files changed
+5
-13
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
10 | 14 | | |
11 | 15 | | |
12 | 16 | | |
| |||
Lines changed: 0 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
168 | | - | |
169 | | - | |
170 | | - | |
171 | | - | |
172 | | - | |
173 | | - | |
174 | | - | |
175 | | - | |
176 | | - | |
177 | | - | |
178 | | - | |
179 | | - | |
180 | 168 | | |
181 | 169 | | |
182 | 170 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
80 | 80 | | |
81 | 81 | | |
82 | 82 | | |
83 | | - | |
| 83 | + | |
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| |||
0 commit comments