Skip to content

How to intercept Remix-initiated transactions in MetaMask Snap and broadcast to a custom blockchain RPC? #3358

@havannaa

Description

@havannaa

I'm building a MetaMask Snap and I need help with the following use case:

  • A user deploys a smart contract using Remix IDE.
  • Instead of MetaMask directly sending the transaction to the default Ethereum RPC,
    I want the Snap to intercept the transaction.
  • Then, the Snap should broadcast the transaction to a custom blockchain RPC URL (not the default Ethereum network).

My questions are:

  1. Which Snap APIs are used to intercept or handle transactions initiated from Remix?
  2. How can I prevent MetaMask from sending the transaction itself, and instead delegate it to the Snap?
  3. Which permissions are required in the snap.manifest.json for:
    • Reading the transaction data.
    • Sending HTTP requests to a custom RPC endpoint.
  4. Are there example code snippets or best practices for implementing this kind of custom transaction broadcasting logic inside a Snap?

Things I have found:

  • I know Snaps can request endowment:network-access to make HTTP requests.
  • I know about wallet_snap methods for invoking custom Snap methods.
  • But I couldn't find clear docs about intercepting Remix deployments (or eth_sendTransaction) specifically.

Any help or examples would be really appreciated!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions