@moonwell-fi/moonwell-sdk
Version:
TypeScript Interface for Moonwell
21 lines • 714 B
JavaScript
import lodash from "lodash";
const { first } = lodash;
import { getEnvironmentFromArgs } from "../../../common/index.js";
import { getMorphoMarketsData } from "./common.js";
export async function getMorphoMarket(client, args) {
const environment = getEnvironmentFromArgs(client, args);
if (!environment) {
return undefined;
}
let { marketId, market } = args;
if (!marketId) {
marketId = environment.config.morphoMarkets[market].id;
}
const markets = await getMorphoMarketsData({
environments: [environment],
markets: [marketId],
includeRewards: args.includeRewards,
});
return first(markets);
}
//# sourceMappingURL=getMorphoMarket.js.map