UNPKG

@metamask/snaps-simulation

Version:

A simulation framework for MetaMask Snaps, enabling headless testing of Snaps in a controlled environment

19 lines 718 B
/** * A mock handler for eth_chainId that always returns a specific * hardcoded result. * * @param _request - Incoming JSON-RPC request. Ignored for this specific * handler. * @param response - The outgoing JSON-RPC response, modified to return the * result. * @param _next - The `json-rpc-engine` middleware next handler. * @param end - The `json-rpc-engine` middleware end handler. * @returns The JSON-RPC response. */ export async function getChainIdHandler(_request, response, _next, end) { // For now this will return a mocked result, this should probably match // whatever network the simulation is using. response.result = '0x01'; return end(); } //# sourceMappingURL=chain-id.mjs.map