@oydual31/more-vaults-sdk 1.1.20 → 1.1.21
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/ethers/index.cjs +8 -3
- package/dist/ethers/index.cjs.map +1 -1
- package/dist/ethers/index.js +8 -3
- package/dist/ethers/index.js.map +1 -1
- package/dist/react/index.cjs +5 -2
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.js +5 -2
- package/dist/react/index.js.map +1 -1
- package/dist/viem/index.cjs +5 -2
- package/dist/viem/index.cjs.map +1 -1
- package/dist/viem/index.js +5 -2
- package/dist/viem/index.js.map +1 -1
- package/package.json +1 -1
- package/src/ethers/utils.ts +23 -8
- package/src/viem/utils.ts +18 -7
package/dist/viem/index.cjs
CHANGED
|
@@ -1517,7 +1517,8 @@ async function getVaultStatus(publicClient, vault) {
|
|
|
1517
1517
|
{ address: v, abi: VAULT_ABI, functionName: "asset" },
|
|
1518
1518
|
{ address: v, abi: VAULT_ABI, functionName: "totalAssets" },
|
|
1519
1519
|
{ address: v, abi: VAULT_ABI, functionName: "totalSupply" },
|
|
1520
|
-
{ address: v, abi: METADATA_ABI, functionName: "decimals" }
|
|
1520
|
+
{ address: v, abi: METADATA_ABI, functionName: "decimals" },
|
|
1521
|
+
{ address: v, abi: ADMIN_CONFIG_ABI, functionName: "depositCapacity" }
|
|
1521
1522
|
],
|
|
1522
1523
|
allowFailure: true
|
|
1523
1524
|
});
|
|
@@ -1533,6 +1534,7 @@ async function getVaultStatus(publicClient, vault) {
|
|
|
1533
1534
|
const totalAssets = b1[9].status === "success" ? b1[9].result : 0n;
|
|
1534
1535
|
const totalSupply = b1[10].status === "success" ? b1[10].result : 0n;
|
|
1535
1536
|
const decimals = b1[11].status === "success" ? Number(b1[11].result) : 18;
|
|
1537
|
+
const depositCapacity = b1[12].status === "success" ? b1[12].result : 0n;
|
|
1536
1538
|
const oneShare = 10n ** BigInt(decimals);
|
|
1537
1539
|
const b2 = await publicClient.multicall({
|
|
1538
1540
|
contracts: [
|
|
@@ -1548,10 +1550,11 @@ async function getVaultStatus(publicClient, vault) {
|
|
|
1548
1550
|
const isCrossChainAsync = isHub && !oraclesEnabled;
|
|
1549
1551
|
const depositAccessRestricted = maxDepositRaw === null && !isCrossChainAsync;
|
|
1550
1552
|
const effectiveCapacity = maxDepositRaw === null ? MAX_UINT256 : maxDepositRaw;
|
|
1553
|
+
const isTrulyFull = effectiveCapacity === 0n && !isCrossChainAsync && (depositCapacity > 0n && totalAssets >= depositCapacity);
|
|
1551
1554
|
let mode;
|
|
1552
1555
|
if (isPaused) {
|
|
1553
1556
|
mode = "paused";
|
|
1554
|
-
} else if (
|
|
1557
|
+
} else if (isTrulyFull) {
|
|
1555
1558
|
mode = "full";
|
|
1556
1559
|
} else if (!isHub) {
|
|
1557
1560
|
mode = "local";
|