Skip to content

Instantly share code, notes, and snippets.

@0xBigBoss
Last active December 31, 2024 20:55
Show Gist options
  • Select an option

  • Save 0xBigBoss/bf71f36b61cfef8f74d010e596d181e7 to your computer and use it in GitHub Desktop.

Select an option

Save 0xBigBoss/bf71f36b61cfef8f74d010e596d181e7 to your computer and use it in GitHub Desktop.
Call the AA Bundler RPC Method
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