@jup-ag/lend 0.0.107-beta.0 → 0.0.107-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/borrow/index.mjs +15 -8
- package/dist/index.mjs +1 -1
- package/package.json +1 -1
package/dist/borrow/index.mjs
CHANGED
|
@@ -45,14 +45,21 @@ const getAllLiquidations = async (params) => {
|
|
|
45
45
|
const { nextVaultId: totalVaults } = await program.account.vaultAdmin.fetch(
|
|
46
46
|
getVaultAdmin()
|
|
47
47
|
);
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
)
|
|
54
|
-
|
|
55
|
-
|
|
48
|
+
const vaultIds = Array.from({ length: totalVaults - 1 }, (_, i) => i + 1);
|
|
49
|
+
const results = [];
|
|
50
|
+
for (let i = 0; i < vaultIds.length; i += 20) {
|
|
51
|
+
const chunk = vaultIds.slice(i, i + 20);
|
|
52
|
+
const chunkResults = await Promise.all(
|
|
53
|
+
chunk.map(async (vaultId) => ({
|
|
54
|
+
vaultId,
|
|
55
|
+
liquidations: await getLiquidations({ ...params, vaultId }).catch(
|
|
56
|
+
() => []
|
|
57
|
+
)
|
|
58
|
+
}))
|
|
59
|
+
);
|
|
60
|
+
results.push(...chunkResults);
|
|
61
|
+
}
|
|
62
|
+
return results;
|
|
56
63
|
};
|
|
57
64
|
function parseVaultLiquidations(logs) {
|
|
58
65
|
const results = [];
|
package/dist/index.mjs
CHANGED