@metamask/snaps-simulation
Version:
A simulation framework for MetaMask Snaps, enabling headless testing of Snaps in a controlled environment
24 lines • 1.17 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getGetInterfaceImplementation = exports.getCreateInterfaceImplementation = void 0;
/**
* Get the implementation of the `createInterface` hook.
*
* @param controllerMessenger - The controller messenger used to call actions.
* @returns The implementation of the `createInterface` hook.
*/
function getCreateInterfaceImplementation(controllerMessenger) {
return async (snapId, content, context, contentType) => controllerMessenger.call('SnapInterfaceController:createInterface', snapId, content, context, contentType);
}
exports.getCreateInterfaceImplementation = getCreateInterfaceImplementation;
/**
* Get the implementation of the `getInterface` hook.
*
* @param controllerMessenger - The controller messenger used to call actions.
* @returns The implementation of the `getInterface` hook.
*/
function getGetInterfaceImplementation(controllerMessenger) {
return (snapId, id) => controllerMessenger.call('SnapInterfaceController:getInterface', snapId, id);
}
exports.getGetInterfaceImplementation = getGetInterfaceImplementation;
//# sourceMappingURL=interface.cjs.map