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:
- Which Snap APIs are used to intercept or handle transactions initiated from Remix?
- How can I prevent MetaMask from sending the transaction itself, and instead delegate it to the Snap?
- Which permissions are required in the snap.manifest.json for:
- Reading the transaction data.
- Sending HTTP requests to a custom RPC endpoint.
- 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!