@moonwell-fi/moonwell-sdk
Version:
TypeScript Interface for Moonwell
18 lines • 702 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getMarket = getMarket;
const index_js_1 = require("../../../common/index.js");
const common_js_1 = require("./common.js");
async function getMarket(client, args) {
let { marketAddress, market } = args;
const environment = (0, index_js_1.getEnvironmentFromArgs)(client, args);
if (!environment) {
return undefined;
}
if (!marketAddress) {
marketAddress = environment.markets[market].address;
}
const markets = await (0, common_js_1.getMarketsData)(environment);
return markets.find((m) => m.marketToken.address === marketAddress);
}
//# sourceMappingURL=getMarket.js.map