UNPKG

@metamask/snaps-simulation

Version:

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

1 lines 1.25 kB
{"version":3,"file":"switch-ethereum-chain.cjs","sourceRoot":"","sources":["../../../src/middleware/internal-methods/switch-ethereum-chain.ts"],"names":[],"mappings":";;;AAMA;;;;;;;;;;;GAWG;AACI,KAAK,UAAU,6BAA6B,CACjD,QAAwB,EACxB,QAAgC,EAChC,KAAgC,EAChC,GAA6B;IAE7B,QAAQ,CAAC,MAAM,GAAG,IAAI,CAAC;IACvB,OAAO,GAAG,EAAE,CAAC;AACf,CAAC;AARD,sEAQC","sourcesContent":["import type {\n JsonRpcEngineEndCallback,\n JsonRpcEngineNextCallback,\n} from '@metamask/json-rpc-engine';\nimport type { JsonRpcRequest, PendingJsonRpcResponse } from '@metamask/utils';\n\n/**\n * A mock handler for the `wallet_switchEthereumChain` method that always\n * returns `null`.\n *\n * @param _request - Incoming JSON-RPC request. This is ignored for this\n * specific handler.\n * @param response - The outgoing JSON-RPC response, modified to return the\n * result.\n * @param _next - The `json-rpc-engine` middleware next handler.\n * @param end - The `json-rpc-engine` middleware end handler.\n * @returns The response.\n */\nexport async function getSwitchEthereumChainHandler(\n _request: JsonRpcRequest,\n response: PendingJsonRpcResponse,\n _next: JsonRpcEngineNextCallback,\n end: JsonRpcEngineEndCallback,\n) {\n response.result = null;\n return end();\n}\n"]}