import { assetGroupTransactions } from "../constants/transactions.js";
export function isAssetGroupTransactionType(type) {
    return assetGroupTransactions.includes(type);
}
export function isFixedIncomeAsset(asset) {
    if (!asset)
        return false;
    if (asset.type === "FixedIncome")
        return true;
    if ("fixedIncomeId" in asset)
        return true;
    return false;
}
export function isCashAsset(asset) {
    if (!asset)
        return false;
    if (asset.type === "Cash")
        return true;
    if ("currency" in asset)
        return true;
    return false;
}
export function getFixedIncomeAssets(portfolio) {
    return portfolio.filter((a) => isFixedIncomeAsset(a));
}
export function getCashAsset(portfolio) {
    const cashAsset = portfolio.find((a) => isCashAsset(a));
    if (!cashAsset) {
        throw new Error("Cash asset not found");
    }
    return cashAsset;
}
//# sourceMappingURL=validators.js.map