UNPKG

@moonwell-fi/moonwell-sdk

Version:

TypeScript Interface for Moonwell

16 lines 712 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getUserPositions = getUserPositions; const index_js_1 = require("../../../common/index.js"); const common_js_1 = require("./common.js"); async function getUserPositions(client, args) { const { userAddress } = args; const environments = (0, index_js_1.getEnvironmentsFromArgs)(client, args); const settled = await Promise.allSettled(environments.map((environment) => (0, common_js_1.getUserPositionData)({ environment, account: userAddress, }))); const result = settled.flatMap((s) => s.status === "fulfilled" ? s.value : []); return result; } //# sourceMappingURL=getUserPositions.js.map