Last active
December 31, 2024 20:55
-
-
Save 0xBigBoss/bf71f36b61cfef8f74d010e596d181e7 to your computer and use it in GitHub Desktop.
Call the AA Bundler RPC Method
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| async function callDebugRpcMethod(method: string, params: any[]) { | |
| const response = await fetch("http://localhost:3030/rpc", { | |
| headers: { | |
| "content-type": "application/json", | |
| }, | |
| referrer: "http://localhost:3000/", | |
| body: JSON.stringify({ | |
| jsonrpc: "2.0", | |
| id: 1, | |
| method: method, | |
| params: params | |
| }), | |
| method: "POST", | |
| }); | |
| const result = await response.json(); | |
| return result; | |
| } | |
| // Example usage: | |
| callDebugRpcMethod('debug_bundler_dumpMempool', []).then(console.log); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment