UNPKG

@admin-jigsaw/jigsaw-sdk

Version:

Returns predefined data for Jigsaw platform and exposes functionality to retrieve the necessary data

19 lines (18 loc) 816 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getProtocolByStrategy = getProtocolByStrategy; var strategiesConstants_1 = require("../constants/strategiesConstants"); /** * Returns the protocol name based on the provided strategy address. * @param {Address} stratAddress - The strategy address to look up. * @returns {string | null} - The corresponding protocol name or null if not found. */ function getProtocolByStrategy(stratAddress) { for (var _i = 0, _a = Object.entries(strategiesConstants_1.PROTOCOL_STRATEGY_MAP); _i < _a.length; _i++) { var _b = _a[_i], protocol = _b[0], strategies = _b[1]; if (strategies.includes(stratAddress)) { return protocol; } } return null; // Return null if no matching strategy is found }