UNPKG

@kiroboio/fct-core

Version:

Kirobo.io FCT Core library

39 lines 1.72 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Utils_oldVersion = void 0; const tslib_1 = require("tslib"); const ethers_1 = require("ethers"); const helpers_1 = require("../../../helpers"); const UtilsBase_1 = require("../bases/UtilsBase"); const FCT_BatchMultiSigCall_abi_json_1 = tslib_1.__importDefault(require("./abis/FCT_BatchMultiSigCall.abi.json")); const IBatchMultiSigCall = new ethers_1.ethers.utils.Interface(FCT_BatchMultiSigCall_abi_json_1.default); class Utils_oldVersion extends UtilsBase_1.UtilsBase { getCalldataForActuator({ signatures, purgedFCT = ethers_1.ethers.constants.HashZero, investor = ethers_1.ethers.constants.AddressZero, activator, externalSigners = [], variables = [], }) { if (!this.FCT) { throw new Error("FCT not found, should not be the case"); } const signedFCT = (0, helpers_1.deepMerge)(this.FCT?.export(), { signatures, externalSigners, variables }); return this.getCalldataForActuatorWithSignedFCT({ signedFCT, purgedFCT, investor, activator, version: this.FCT.version, }); } getCalldataForActuatorWithSignedFCT({ signedFCT, purgedFCT, investor, activator, version, }) { version = version.startsWith("0x") ? version : `0x${version}`; return IBatchMultiSigCall.encodeFunctionData("batchMultiSigCall", [ version.padEnd(66, "0"), signedFCT, purgedFCT, investor, activator, ]); } getBatchMultiSigCallABI() { return IBatchMultiSigCall; } } exports.Utils_oldVersion = Utils_oldVersion; //# sourceMappingURL=Utils.js.map