@1hive/connect-core
Version:
Access and interact with Aragon Organizations and their apps.
28 lines • 1.35 kB
JavaScript
;
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.getForwardingPath = void 0;
const calculatePath_1 = require("./calculatePath");
const ForwardingPath_1 = __importDefault(require("../../entities/ForwardingPath"));
/**
* Calculate the transaction path for a transaction to `destination`
* that invokes `methodSignature` with `params`.
*
* @param {string} destination
* @param {string} methodSignature
* @param {Array<*>} params
* @param {string} [finalForwarder] Address of the final forwarder that can perfom the action
* @return {Promise<Array<Object>>} An array of Ethereum transactions that describe each step in the path
*/
async function getForwardingPath(sender, destinationApp, methodSignature, params, installedApps, provider, finalForwarder) {
const { path, transactions } = await calculatePath_1.calculateTransactionPath(sender, destinationApp, methodSignature, params, installedApps, provider, finalForwarder);
return new ForwardingPath_1.default({
destination: destinationApp,
path,
transactions,
}, installedApps, provider);
}
exports.getForwardingPath = getForwardingPath;
//# sourceMappingURL=getForwardingPath.js.map