UNPKG

@metamask/snaps-simulation

Version:

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

24 lines 850 B
/** * A mock handler for metamask_getProviderState 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 getProviderStateHandler(_request, response, _next, end) { // For now this will return a mocked result, this should probably match // whatever network the simulation is using. response.result = { isUnlocked: true, chainId: '0x01', networkVersion: '0x01', accounts: [], }; return end(); } //# sourceMappingURL=provider-state.mjs.map