@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/react/index.js
CHANGED
|
@@ -1323,7 +1323,8 @@ async function getVaultStatus(publicClient, vault) {
|
|
|
1323
1323
|
{ address: v, abi: VAULT_ABI, functionName: "asset" },
|
|
1324
1324
|
{ address: v, abi: VAULT_ABI, functionName: "totalAssets" },
|
|
1325
1325
|
{ address: v, abi: VAULT_ABI, functionName: "totalSupply" },
|
|
1326
|
-
{ address: v, abi: METADATA_ABI, functionName: "decimals" }
|
|
1326
|
+
{ address: v, abi: METADATA_ABI, functionName: "decimals" },
|
|
1327
|
+
{ address: v, abi: ADMIN_CONFIG_ABI, functionName: "depositCapacity" }
|
|
1327
1328
|
],
|
|
1328
1329
|
allowFailure: true
|
|
1329
1330
|
});
|
|
@@ -1339,6 +1340,7 @@ async function getVaultStatus(publicClient, vault) {
|
|
|
1339
1340
|
const totalAssets = b1[9].status === "success" ? b1[9].result : 0n;
|
|
1340
1341
|
const totalSupply = b1[10].status === "success" ? b1[10].result : 0n;
|
|
1341
1342
|
const decimals = b1[11].status === "success" ? Number(b1[11].result) : 18;
|
|
1343
|
+
const depositCapacity = b1[12].status === "success" ? b1[12].result : 0n;
|
|
1342
1344
|
const oneShare = 10n ** BigInt(decimals);
|
|
1343
1345
|
const b2 = await publicClient.multicall({
|
|
1344
1346
|
contracts: [
|
|
@@ -1354,10 +1356,11 @@ async function getVaultStatus(publicClient, vault) {
|
|
|
1354
1356
|
const isCrossChainAsync = isHub && !oraclesEnabled;
|
|
1355
1357
|
const depositAccessRestricted = maxDepositRaw === null && !isCrossChainAsync;
|
|
1356
1358
|
const effectiveCapacity = maxDepositRaw === null ? MAX_UINT256 : maxDepositRaw;
|
|
1359
|
+
const isTrulyFull = effectiveCapacity === 0n && !isCrossChainAsync && (depositCapacity > 0n && totalAssets >= depositCapacity);
|
|
1357
1360
|
let mode;
|
|
1358
1361
|
if (isPaused) {
|
|
1359
1362
|
mode = "paused";
|
|
1360
|
-
} else if (
|
|
1363
|
+
} else if (isTrulyFull) {
|
|
1361
1364
|
mode = "full";
|
|
1362
1365
|
} else if (!isHub) {
|
|
1363
1366
|
mode = "local";
|