Skip to content

Conversation

@FrederikBolding
Copy link
Member

@FrederikBolding FrederikBolding commented Dec 1, 2025

Adds support for using the multichain API in Snaps. This is accomplished by setting up a separate provider and substream called metamask-multichain-provider. When snap.request is called with a multichain request, this provider and substream is used. The clients will need to route to the proper JSON-RPC pipeline based on the substream and verify that the Snap has the proper permission (TBD).

Additionally this PR adds a example Snap for usage of this API, that can leverage Ethereum and Solana APIs at once. It also adds limited simulation support for the multichain API. The simulation framework implements a basic version of the multichain API where sessions are tracked and requests are routed to supported EVM providers. There are no underlying providers for non-EVM request, but they can be mocked.

TODO:

  • wallet_revokeSession support
  • RPC method parameter validation
  • Figure out how to enforce the permission
  • Tests

@socket-security
Copy link

socket-security bot commented Dec 1, 2025

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Added@​metamask/​chain-agnostic-permission@​1.4.01001007895100
Addedpackages%2Fexamples%2Fpackages%2Fmultichain-provider@​0.0.0-use.local100100100100100

View full report

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.

2 participants