import { Node } from "@counterfactual/types" ; import { jsonRpcMethod } from "rpc-server" ; import { StateChannel } from "../../../models" ; import { RequestHandler } from "../../../request-handler" ; import { NodeController } from "../../controller" ; import { install } from "./operation" ; param params export default class InstallController extends NodeController { @ jsonRpcMethod ( Node . RpcMethodName . INSTALL ) public executeMethod = super . executeMethod ; protected async getRequiredLockNames ( requestHandler , params ) { const { store } = requestHandler ; const { appInstanceId } = params ; const sc = await store . getChannelFromAppInstanceID ( appInstanceId ) ; return [ sc . multisigAddress ] ; } protected async executeMethodImplementation ( requestHandler , params ) { const { store , protocolRunner } = requestHandler ; const appInstanceProposal = await install ( store , protocolRunner , params ) ; return { appInstance : ( await store . getAppInstance ( appInstanceProposal . identityHash ) ) . toJson ( ) } ; } }