@moonwell-fi/moonwell-sdk
Version:
TypeScript Interface for Moonwell
18 lines • 780 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getMorphoUserRewards = getMorphoUserRewards;
const index_js_1 = require("../../../common/index.js");
const common_js_1 = require("./common.js");
async function getMorphoUserRewards(client, args) {
const environments = (0, index_js_1.getEnvironmentsFromArgs)(client, args);
const environmentsUserRewards = await Promise.all(environments
.filter((environment) => environment.contracts.morphoViews !== undefined)
.map((environment) => {
return (0, common_js_1.getUserMorphoRewardsData)({
environment,
account: args.userAddress,
});
}));
return environmentsUserRewards.flat();
}
//# sourceMappingURL=getMorphoUserRewards.js.map