"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getStablecoinYieldSetting = exports.stakeProgramsToEarnParam = void 0;
const stakeProgramsToEarnParam = (stakePrograms) => {
    const list = stakePrograms?.params?.list ?? [];
    const redirects = stakePrograms?.params?.redirects ?? {};
    const result = {};
    const keys = Object.keys(redirects);
    if (keys.length === 0) {
        return { stakeProgramsParam: undefined, stakeCurrenciesParam: [] };
    }
    keys.forEach(key => {
        result[key] = redirects[key].platform;
    });
    return { stakeProgramsParam: result, stakeCurrenciesParam: list };
};
exports.stakeProgramsToEarnParam = stakeProgramsToEarnParam;
const getStablecoinYieldSetting = (stakePrograms) => {
    /** Tether USDT provider is proxy for stablecoin flow rollout.  */
    const usdtProvider = !stakePrograms?.enabled || !stakePrograms?.params?.redirects
        ? undefined
        : stakePrograms?.params?.redirects["ethereum/erc20/usd_tether__erc20_"]?.platform;
    return !usdtProvider ? "inactive" : usdtProvider === "earn" ? "api" : "dapp";
};
exports.getStablecoinYieldSetting = getStablecoinYieldSetting;
//# sourceMappingURL=index.js.map