@oydual31/more-vaults-sdk 0.4.2 → 0.6.0

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.
Files changed (38) hide show
  1. package/README.md +94 -0
  2. package/dist/{spokeRoutes-B8Lnk-t4.d.cts → curatorBridge-CNs59kT9.d.cts} +222 -1
  3. package/dist/{spokeRoutes-B8Lnk-t4.d.ts → curatorBridge-CNs59kT9.d.ts} +222 -1
  4. package/dist/ethers/index.cjs +328 -3
  5. package/dist/ethers/index.cjs.map +1 -1
  6. package/dist/ethers/index.d.cts +279 -1
  7. package/dist/ethers/index.d.ts +279 -1
  8. package/dist/ethers/index.js +318 -5
  9. package/dist/ethers/index.js.map +1 -1
  10. package/dist/react/index.cjs +375 -0
  11. package/dist/react/index.cjs.map +1 -1
  12. package/dist/react/index.d.cts +266 -2
  13. package/dist/react/index.d.ts +266 -2
  14. package/dist/react/index.js +372 -2
  15. package/dist/react/index.js.map +1 -1
  16. package/dist/viem/index.cjs +377 -0
  17. package/dist/viem/index.cjs.map +1 -1
  18. package/dist/viem/index.d.cts +261 -3
  19. package/dist/viem/index.d.ts +261 -3
  20. package/dist/viem/index.js +367 -2
  21. package/dist/viem/index.js.map +1 -1
  22. package/package.json +1 -1
  23. package/src/ethers/abis.ts +24 -0
  24. package/src/ethers/curatorBridge.ts +235 -0
  25. package/src/ethers/curatorSubVaults.ts +443 -0
  26. package/src/ethers/index.ts +26 -0
  27. package/src/ethers/types.ts +99 -0
  28. package/src/react/index.ts +14 -0
  29. package/src/react/useCuratorBridgeQuote.ts +43 -0
  30. package/src/react/useERC7540RequestStatus.ts +43 -0
  31. package/src/react/useExecuteBridge.ts +50 -0
  32. package/src/react/useSubVaultPositions.ts +35 -0
  33. package/src/react/useVaultPortfolio.ts +35 -0
  34. package/src/viem/abis.ts +24 -0
  35. package/src/viem/curatorBridge.ts +288 -0
  36. package/src/viem/curatorSubVaults.ts +514 -0
  37. package/src/viem/index.ts +23 -0
  38. package/src/viem/types.ts +100 -0
@@ -1,5 +1,5 @@
1
- import { V as VaultAddresses, A as AsyncRequestResult, D as DepositResult, S as SpokeDepositResult, C as ComposeData, R as RedeemResult, a as CuratorVaultStatus, P as PendingAction, b as VaultAnalysis, c as VaultAssetBreakdown, d as CuratorAction, e as SubmitActionsResult } from '../spokeRoutes-B8Lnk-t4.cjs';
2
- export { f as ActionType, g as ActionTypeValue, h as AssetBalance, i as AssetInfo, j as AsyncRequestFinalResult, k as AsyncRequestStatus, l as AsyncRequestStatusInfo, B as BatchSwapParams, m as BridgeParams, n as CrossChainRequestInfo, o as DepositBlockReason, p as DepositEligibility, I as InboundRoute, q as InboundRouteWithBalance, M as MaxWithdrawable, r as MultiChainUserPosition, N as NATIVE_SYMBOL, O as OMNI_FACTORY_ADDRESS, s as OutboundRoute, t as SpokeBalance, u as SwapParams, U as UserBalances, v as UserPosition, w as VaultDistribution, x as VaultMetadata, y as VaultMode, z as VaultStatus, E as VaultSummary, F as VaultTopology, G as canDeposit, H as detectStargateOft, J as discoverVaultTopology, K as ensureAllowance, L as getAllVaultChainIds, Q as getAsyncRequestStatus, T as getAsyncRequestStatusLabel, W as getFullVaultTopology, X as getInboundRoutes, Y as getMaxWithdrawable, Z as getOutboundRoutes, _ as getUserBalances, $ as getUserBalancesForRoutes, a0 as getUserPosition, a1 as getUserPositionMultiChain, a2 as getVaultDistribution, a3 as getVaultDistributionWithTopology, a4 as getVaultMetadata, a5 as getVaultStatus, a6 as getVaultSummary, a7 as getVaultTopology, a8 as isAsyncMode, a9 as isOnHubChain, aa as previewDeposit, ab as previewRedeem, ac as quoteLzFee, ad as quoteRouteDepositFee, ae as waitForAsyncRequest, af as waitForTx } from '../spokeRoutes-B8Lnk-t4.cjs';
1
+ import { V as VaultAddresses, A as AsyncRequestResult, D as DepositResult, S as SpokeDepositResult, C as ComposeData, R as RedeemResult, a as CuratorVaultStatus, P as PendingAction, b as VaultAnalysis, c as VaultAssetBreakdown, d as CuratorAction, e as SubmitActionsResult, E as ERC7540RequestStatus, f as SubVaultInfo, g as SubVaultPosition, h as VaultPortfolio } from '../curatorBridge-CNs59kT9.cjs';
2
+ export { i as ActionType, j as ActionTypeValue, k as AssetBalance, l as AssetInfo, m as AsyncRequestFinalResult, n as AsyncRequestStatus, o as AsyncRequestStatusInfo, B as BatchSwapParams, p as BridgeParams, q as CrossChainRequestInfo, r as CuratorBridgeParams, s as DepositBlockReason, t as DepositEligibility, I as InboundRoute, u as InboundRouteWithBalance, M as MaxWithdrawable, v as MultiChainUserPosition, N as NATIVE_SYMBOL, O as OMNI_FACTORY_ADDRESS, w as OutboundRoute, x as SpokeBalance, y as SwapParams, U as UserBalances, z as UserPosition, F as VaultDistribution, G as VaultMetadata, H as VaultMode, J as VaultStatus, K as VaultSummary, L as VaultTopology, Q as canDeposit, T as detectStargateOft, W as discoverVaultTopology, X as encodeBridgeParams, Y as ensureAllowance, Z as executeCuratorBridge, _ as findBridgeRoute, $ as getAllVaultChainIds, a0 as getAsyncRequestStatus, a1 as getAsyncRequestStatusLabel, a2 as getFullVaultTopology, a3 as getInboundRoutes, a4 as getMaxWithdrawable, a5 as getOutboundRoutes, a6 as getUserBalances, a7 as getUserBalancesForRoutes, a8 as getUserPosition, a9 as getUserPositionMultiChain, aa as getVaultDistribution, ab as getVaultDistributionWithTopology, ac as getVaultMetadata, ad as getVaultStatus, ae as getVaultSummary, af as getVaultTopology, ag as isAsyncMode, ah as isOnHubChain, ai as previewDeposit, aj as previewRedeem, ak as quoteCuratorBridgeFee, al as quoteLzFee, am as quoteRouteDepositFee, an as waitForAsyncRequest, ao as waitForTx } from '../curatorBridge-CNs59kT9.cjs';
3
3
  import { WalletClient, PublicClient, Address, Hash } from 'viem';
4
4
  export { PublicClient as SdkPublicClient } from 'viem';
5
5
 
@@ -1563,6 +1563,167 @@ declare const REGISTRY_ABI: readonly [{
1563
1563
  }];
1564
1564
  readonly stateMutability: "view";
1565
1565
  }];
1566
+ /**
1567
+ * Sub-vault ABI — reads for ERC4626/ERC7540 sub-vaults and ConfigurationFacet extensions.
1568
+ * Used by curator sub-vault portfolio helpers (Phase 5).
1569
+ */
1570
+ declare const SUB_VAULT_ABI: readonly [{
1571
+ readonly type: "function";
1572
+ readonly name: "tokensHeld";
1573
+ readonly inputs: readonly [{
1574
+ readonly name: "id";
1575
+ readonly type: "bytes32";
1576
+ }];
1577
+ readonly outputs: readonly [{
1578
+ readonly name: "";
1579
+ readonly type: "address[]";
1580
+ }];
1581
+ readonly stateMutability: "view";
1582
+ }, {
1583
+ readonly type: "function";
1584
+ readonly name: "lockedTokensAmountOfAsset";
1585
+ readonly inputs: readonly [{
1586
+ readonly name: "asset";
1587
+ readonly type: "address";
1588
+ }];
1589
+ readonly outputs: readonly [{
1590
+ readonly name: "";
1591
+ readonly type: "uint256";
1592
+ }];
1593
+ readonly stateMutability: "view";
1594
+ }, {
1595
+ readonly type: "function";
1596
+ readonly name: "convertToAssets";
1597
+ readonly inputs: readonly [{
1598
+ readonly name: "shares";
1599
+ readonly type: "uint256";
1600
+ }];
1601
+ readonly outputs: readonly [{
1602
+ readonly name: "";
1603
+ readonly type: "uint256";
1604
+ }];
1605
+ readonly stateMutability: "view";
1606
+ }, {
1607
+ readonly type: "function";
1608
+ readonly name: "convertToShares";
1609
+ readonly inputs: readonly [{
1610
+ readonly name: "assets";
1611
+ readonly type: "uint256";
1612
+ }];
1613
+ readonly outputs: readonly [{
1614
+ readonly name: "";
1615
+ readonly type: "uint256";
1616
+ }];
1617
+ readonly stateMutability: "view";
1618
+ }, {
1619
+ readonly type: "function";
1620
+ readonly name: "previewDeposit";
1621
+ readonly inputs: readonly [{
1622
+ readonly name: "assets";
1623
+ readonly type: "uint256";
1624
+ }];
1625
+ readonly outputs: readonly [{
1626
+ readonly name: "";
1627
+ readonly type: "uint256";
1628
+ }];
1629
+ readonly stateMutability: "view";
1630
+ }, {
1631
+ readonly type: "function";
1632
+ readonly name: "previewRedeem";
1633
+ readonly inputs: readonly [{
1634
+ readonly name: "shares";
1635
+ readonly type: "uint256";
1636
+ }];
1637
+ readonly outputs: readonly [{
1638
+ readonly name: "";
1639
+ readonly type: "uint256";
1640
+ }];
1641
+ readonly stateMutability: "view";
1642
+ }, {
1643
+ readonly type: "function";
1644
+ readonly name: "maxDeposit";
1645
+ readonly inputs: readonly [{
1646
+ readonly name: "receiver";
1647
+ readonly type: "address";
1648
+ }];
1649
+ readonly outputs: readonly [{
1650
+ readonly name: "";
1651
+ readonly type: "uint256";
1652
+ }];
1653
+ readonly stateMutability: "view";
1654
+ }, {
1655
+ readonly type: "function";
1656
+ readonly name: "maxRedeem";
1657
+ readonly inputs: readonly [{
1658
+ readonly name: "owner";
1659
+ readonly type: "address";
1660
+ }];
1661
+ readonly outputs: readonly [{
1662
+ readonly name: "";
1663
+ readonly type: "uint256";
1664
+ }];
1665
+ readonly stateMutability: "view";
1666
+ }, {
1667
+ readonly type: "function";
1668
+ readonly name: "pendingDepositRequest";
1669
+ readonly inputs: readonly [{
1670
+ readonly name: "requestId";
1671
+ readonly type: "uint256";
1672
+ }, {
1673
+ readonly name: "controller";
1674
+ readonly type: "address";
1675
+ }];
1676
+ readonly outputs: readonly [{
1677
+ readonly name: "";
1678
+ readonly type: "uint256";
1679
+ }];
1680
+ readonly stateMutability: "view";
1681
+ }, {
1682
+ readonly type: "function";
1683
+ readonly name: "claimableDepositRequest";
1684
+ readonly inputs: readonly [{
1685
+ readonly name: "requestId";
1686
+ readonly type: "uint256";
1687
+ }, {
1688
+ readonly name: "controller";
1689
+ readonly type: "address";
1690
+ }];
1691
+ readonly outputs: readonly [{
1692
+ readonly name: "";
1693
+ readonly type: "uint256";
1694
+ }];
1695
+ readonly stateMutability: "view";
1696
+ }, {
1697
+ readonly type: "function";
1698
+ readonly name: "pendingRedeemRequest";
1699
+ readonly inputs: readonly [{
1700
+ readonly name: "requestId";
1701
+ readonly type: "uint256";
1702
+ }, {
1703
+ readonly name: "controller";
1704
+ readonly type: "address";
1705
+ }];
1706
+ readonly outputs: readonly [{
1707
+ readonly name: "";
1708
+ readonly type: "uint256";
1709
+ }];
1710
+ readonly stateMutability: "view";
1711
+ }, {
1712
+ readonly type: "function";
1713
+ readonly name: "claimableRedeemRequest";
1714
+ readonly inputs: readonly [{
1715
+ readonly name: "requestId";
1716
+ readonly type: "uint256";
1717
+ }, {
1718
+ readonly name: "controller";
1719
+ readonly type: "address";
1720
+ }];
1721
+ readonly outputs: readonly [{
1722
+ readonly name: "";
1723
+ readonly type: "uint256";
1724
+ }];
1725
+ readonly stateMutability: "view";
1726
+ }];
1566
1727
  /**
1567
1728
  * Minimal LZ Endpoint V2 ABI for compose queue management.
1568
1729
  * Used by the Stargate 2-TX flow to check compose status and execute pending composes.
@@ -2503,6 +2664,103 @@ declare function buildUniswapV3Swap(params: {
2503
2664
  recipient: Address;
2504
2665
  }): CuratorAction;
2505
2666
 
2667
+ /**
2668
+ * Curator sub-vault read helpers for the MoreVaults SDK (Phase 5).
2669
+ *
2670
+ * Provides portfolio views and sub-vault analysis for curator dashboards.
2671
+ * Supports both ERC4626 (synchronous) and ERC7540 (asynchronous) sub-vaults.
2672
+ *
2673
+ * All functions are read-only (no wallet needed) and use multicall for
2674
+ * batched RPC efficiency.
2675
+ */
2676
+
2677
+ /**
2678
+ * Get active sub-vault positions held by the vault.
2679
+ *
2680
+ * Queries the vault's `tokensHeld` for ERC4626 and ERC7540 type IDs, then
2681
+ * fetches balances, underlying values, and token metadata for each sub-vault
2682
+ * in a single multicall round. Sub-vaults with zero share balance are excluded.
2683
+ *
2684
+ * @param publicClient Viem public client (must be on the vault's chain)
2685
+ * @param vault Vault address (diamond proxy)
2686
+ * @returns Array of active SubVaultPosition objects
2687
+ */
2688
+ declare function getSubVaultPositions(publicClient: PublicClient, vault: Address): Promise<SubVaultPosition[]>;
2689
+ /**
2690
+ * Detect whether a contract is an ERC7540, ERC4626, or unknown vault type.
2691
+ *
2692
+ * Tries to call ERC7540-specific functions first (pendingDepositRequest /
2693
+ * claimableDepositRequest). If those revert, falls back to ERC4626
2694
+ * convertToAssets(0). Returns null if neither succeeds.
2695
+ *
2696
+ * @param publicClient Viem public client (must be on the same chain as subVault)
2697
+ * @param subVault Sub-vault contract address to probe
2698
+ * @returns 'erc7540' | 'erc4626' | null
2699
+ */
2700
+ declare function detectSubVaultType(publicClient: PublicClient, subVault: Address): Promise<'erc4626' | 'erc7540' | null>;
2701
+ /**
2702
+ * Analyse a specific sub-vault to understand deposit limits, metadata, type,
2703
+ * and global-registry whitelist status.
2704
+ *
2705
+ * Useful for curators deciding whether to invest vault funds into a given
2706
+ * ERC4626 or ERC7540 protocol.
2707
+ *
2708
+ * @param publicClient Viem public client (must be on the vault's chain)
2709
+ * @param vault Vault address (diamond proxy) — used to check maxDeposit
2710
+ * @param subVault Sub-vault address to analyse
2711
+ * @returns SubVaultInfo snapshot
2712
+ */
2713
+ declare function getSubVaultInfo(publicClient: PublicClient, vault: Address, subVault: Address): Promise<SubVaultInfo>;
2714
+ /**
2715
+ * Get the ERC7540 async request status for a specific sub-vault and vault controller.
2716
+ *
2717
+ * Queries pendingDepositRequest, claimableDepositRequest, pendingRedeemRequest,
2718
+ * and claimableRedeemRequest using requestId = 0 (the standard default).
2719
+ *
2720
+ * @param publicClient Viem public client (must be on the vault's chain)
2721
+ * @param vault Vault address acting as controller in the sub-vault
2722
+ * @param subVault ERC7540 sub-vault address
2723
+ * @returns ERC7540RequestStatus with canFinalize flags
2724
+ */
2725
+ declare function getERC7540RequestStatus(publicClient: PublicClient, vault: Address, subVault: Address): Promise<ERC7540RequestStatus>;
2726
+ /**
2727
+ * Preview how many shares the vault would receive for a given asset deposit
2728
+ * into a sub-vault.
2729
+ *
2730
+ * Calls `previewDeposit(assets)` on the sub-vault contract.
2731
+ *
2732
+ * @param publicClient Viem public client
2733
+ * @param subVault Sub-vault address (ERC4626 or ERC7540)
2734
+ * @param assets Amount of underlying assets to preview
2735
+ * @returns Expected shares to be minted
2736
+ */
2737
+ declare function previewSubVaultDeposit(publicClient: PublicClient, subVault: Address, assets: bigint): Promise<bigint>;
2738
+ /**
2739
+ * Preview how many underlying assets the vault would receive for redeeming
2740
+ * a given number of shares from a sub-vault.
2741
+ *
2742
+ * Calls `previewRedeem(shares)` on the sub-vault contract.
2743
+ *
2744
+ * @param publicClient Viem public client
2745
+ * @param subVault Sub-vault address (ERC4626 or ERC7540)
2746
+ * @param shares Number of shares to preview redemption for
2747
+ * @returns Expected underlying assets to be returned
2748
+ */
2749
+ declare function previewSubVaultRedeem(publicClient: PublicClient, subVault: Address, shares: bigint): Promise<bigint>;
2750
+ /**
2751
+ * Get the complete portfolio view for a vault, combining liquid asset balances
2752
+ * with active sub-vault positions and locked ERC7540 assets.
2753
+ *
2754
+ * Liquid assets that are also sub-vault share tokens are deduplicated to avoid
2755
+ * double-counting (the sub-vault's underlying value is already captured via
2756
+ * convertToAssets).
2757
+ *
2758
+ * @param publicClient Viem public client (must be on the vault's hub chain)
2759
+ * @param vault Vault address (diamond proxy)
2760
+ * @returns VaultPortfolio with full breakdown
2761
+ */
2762
+ declare function getVaultPortfolio(publicClient: PublicClient, vault: Address): Promise<VaultPortfolio>;
2763
+
2506
2764
  /**
2507
2765
  * Cast a wagmi PublicClient to the SDK's expected type.
2508
2766
  * Use this in React components to avoid `as any` casts:
@@ -2517,4 +2775,4 @@ declare function buildUniswapV3Swap(params: {
2517
2775
  */
2518
2776
  declare function asSdkClient(client: unknown): PublicClient;
2519
2777
 
2520
- export { AsyncRequestResult, BRIDGE_ABI, BRIDGE_FACET_ABI, CCManagerNotConfiguredError, CHAIN_IDS, CHAIN_ID_TO_EID, CONFIG_ABI, CURATOR_CONFIG_ABI, CapacityFullError, ComposeData, CuratorAction, CuratorVaultStatus, DEX_ABI, DepositResult, EID_TO_CHAIN_ID, ERC20_ABI, ERC4626_FACET_ABI, ERC7540_FACET_ABI, EscrowNotConfiguredError, InsufficientLiquidityError, LZ_ADAPTER_ABI, LZ_EIDS, LZ_ENDPOINT_ABI, LZ_TIMEOUTS, METADATA_ABI, MULTICALL_ABI, MissingEscrowAddressError, MoreVaultsError, NotHubVaultError, NotWhitelistedError, OFT_ABI, OFT_ROUTES, PendingAction, REGISTRY_ABI, RedeemResult, STARGATE_TAXI_CMD, SpokeDepositResult, type SpokeRedeemRoute, SubmitActionsResult, UNISWAP_V3_ROUTERS, USDC_STARGATE_OFT, USDC_TOKEN, VAULT_ABI, VAULT_ANALYSIS_ABI, VaultAddresses, VaultAnalysis, VaultAssetBreakdown, VaultPausedError, WrongChainError, asSdkClient, bridgeAssetsToSpoke, bridgeSharesToHub, buildCuratorBatch, buildUniswapV3Swap, checkProtocolWhitelist, depositAsync, depositSimple as depositCrossChainOracleOn, depositFromSpoke, depositFromSpoke as depositFromSpokeAsync, depositMultiAsset, depositSimple, encodeCuratorAction, encodeUniswapV3SwapCalldata, executeActions, executeCompose, getCuratorVaultStatus, getPendingActions, getVaultAnalysis, getVaultAssetBreakdown, getWithdrawalRequest, isCurator, mintAsync, preflightAsync, preflightRedeemLiquidity, preflightSpokeDeposit, preflightSpokeRedeem, preflightSync, quoteComposeFee, quoteDepositFromSpokeFee, quoteShareBridgeFee, redeemAsync, redeemShares, requestRedeem, resolveRedeemAddresses, smartDeposit, smartRedeem, submitActions, vetoActions, waitForCompose, withdrawAssets };
2778
+ export { AsyncRequestResult, BRIDGE_ABI, BRIDGE_FACET_ABI, CCManagerNotConfiguredError, CHAIN_IDS, CHAIN_ID_TO_EID, CONFIG_ABI, CURATOR_CONFIG_ABI, CapacityFullError, ComposeData, CuratorAction, CuratorVaultStatus, DEX_ABI, DepositResult, EID_TO_CHAIN_ID, ERC20_ABI, ERC4626_FACET_ABI, ERC7540RequestStatus, ERC7540_FACET_ABI, EscrowNotConfiguredError, InsufficientLiquidityError, LZ_ADAPTER_ABI, LZ_EIDS, LZ_ENDPOINT_ABI, LZ_TIMEOUTS, METADATA_ABI, MULTICALL_ABI, MissingEscrowAddressError, MoreVaultsError, NotHubVaultError, NotWhitelistedError, OFT_ABI, OFT_ROUTES, PendingAction, REGISTRY_ABI, RedeemResult, STARGATE_TAXI_CMD, SUB_VAULT_ABI, SpokeDepositResult, type SpokeRedeemRoute, SubVaultInfo, SubVaultPosition, SubmitActionsResult, UNISWAP_V3_ROUTERS, USDC_STARGATE_OFT, USDC_TOKEN, VAULT_ABI, VAULT_ANALYSIS_ABI, VaultAddresses, VaultAnalysis, VaultAssetBreakdown, VaultPausedError, VaultPortfolio, WrongChainError, asSdkClient, bridgeAssetsToSpoke, bridgeSharesToHub, buildCuratorBatch, buildUniswapV3Swap, checkProtocolWhitelist, depositAsync, depositSimple as depositCrossChainOracleOn, depositFromSpoke, depositFromSpoke as depositFromSpokeAsync, depositMultiAsset, depositSimple, detectSubVaultType, encodeCuratorAction, encodeUniswapV3SwapCalldata, executeActions, executeCompose, getCuratorVaultStatus, getERC7540RequestStatus, getPendingActions, getSubVaultInfo, getSubVaultPositions, getVaultAnalysis, getVaultAssetBreakdown, getVaultPortfolio, getWithdrawalRequest, isCurator, mintAsync, preflightAsync, preflightRedeemLiquidity, preflightSpokeDeposit, preflightSpokeRedeem, preflightSync, previewSubVaultDeposit, previewSubVaultRedeem, quoteComposeFee, quoteDepositFromSpokeFee, quoteShareBridgeFee, redeemAsync, redeemShares, requestRedeem, resolveRedeemAddresses, smartDeposit, smartRedeem, submitActions, vetoActions, waitForCompose, withdrawAssets };
@@ -1,5 +1,5 @@
1
- import { V as VaultAddresses, A as AsyncRequestResult, D as DepositResult, S as SpokeDepositResult, C as ComposeData, R as RedeemResult, a as CuratorVaultStatus, P as PendingAction, b as VaultAnalysis, c as VaultAssetBreakdown, d as CuratorAction, e as SubmitActionsResult } from '../spokeRoutes-B8Lnk-t4.js';
2
- export { f as ActionType, g as ActionTypeValue, h as AssetBalance, i as AssetInfo, j as AsyncRequestFinalResult, k as AsyncRequestStatus, l as AsyncRequestStatusInfo, B as BatchSwapParams, m as BridgeParams, n as CrossChainRequestInfo, o as DepositBlockReason, p as DepositEligibility, I as InboundRoute, q as InboundRouteWithBalance, M as MaxWithdrawable, r as MultiChainUserPosition, N as NATIVE_SYMBOL, O as OMNI_FACTORY_ADDRESS, s as OutboundRoute, t as SpokeBalance, u as SwapParams, U as UserBalances, v as UserPosition, w as VaultDistribution, x as VaultMetadata, y as VaultMode, z as VaultStatus, E as VaultSummary, F as VaultTopology, G as canDeposit, H as detectStargateOft, J as discoverVaultTopology, K as ensureAllowance, L as getAllVaultChainIds, Q as getAsyncRequestStatus, T as getAsyncRequestStatusLabel, W as getFullVaultTopology, X as getInboundRoutes, Y as getMaxWithdrawable, Z as getOutboundRoutes, _ as getUserBalances, $ as getUserBalancesForRoutes, a0 as getUserPosition, a1 as getUserPositionMultiChain, a2 as getVaultDistribution, a3 as getVaultDistributionWithTopology, a4 as getVaultMetadata, a5 as getVaultStatus, a6 as getVaultSummary, a7 as getVaultTopology, a8 as isAsyncMode, a9 as isOnHubChain, aa as previewDeposit, ab as previewRedeem, ac as quoteLzFee, ad as quoteRouteDepositFee, ae as waitForAsyncRequest, af as waitForTx } from '../spokeRoutes-B8Lnk-t4.js';
1
+ import { V as VaultAddresses, A as AsyncRequestResult, D as DepositResult, S as SpokeDepositResult, C as ComposeData, R as RedeemResult, a as CuratorVaultStatus, P as PendingAction, b as VaultAnalysis, c as VaultAssetBreakdown, d as CuratorAction, e as SubmitActionsResult, E as ERC7540RequestStatus, f as SubVaultInfo, g as SubVaultPosition, h as VaultPortfolio } from '../curatorBridge-CNs59kT9.js';
2
+ export { i as ActionType, j as ActionTypeValue, k as AssetBalance, l as AssetInfo, m as AsyncRequestFinalResult, n as AsyncRequestStatus, o as AsyncRequestStatusInfo, B as BatchSwapParams, p as BridgeParams, q as CrossChainRequestInfo, r as CuratorBridgeParams, s as DepositBlockReason, t as DepositEligibility, I as InboundRoute, u as InboundRouteWithBalance, M as MaxWithdrawable, v as MultiChainUserPosition, N as NATIVE_SYMBOL, O as OMNI_FACTORY_ADDRESS, w as OutboundRoute, x as SpokeBalance, y as SwapParams, U as UserBalances, z as UserPosition, F as VaultDistribution, G as VaultMetadata, H as VaultMode, J as VaultStatus, K as VaultSummary, L as VaultTopology, Q as canDeposit, T as detectStargateOft, W as discoverVaultTopology, X as encodeBridgeParams, Y as ensureAllowance, Z as executeCuratorBridge, _ as findBridgeRoute, $ as getAllVaultChainIds, a0 as getAsyncRequestStatus, a1 as getAsyncRequestStatusLabel, a2 as getFullVaultTopology, a3 as getInboundRoutes, a4 as getMaxWithdrawable, a5 as getOutboundRoutes, a6 as getUserBalances, a7 as getUserBalancesForRoutes, a8 as getUserPosition, a9 as getUserPositionMultiChain, aa as getVaultDistribution, ab as getVaultDistributionWithTopology, ac as getVaultMetadata, ad as getVaultStatus, ae as getVaultSummary, af as getVaultTopology, ag as isAsyncMode, ah as isOnHubChain, ai as previewDeposit, aj as previewRedeem, ak as quoteCuratorBridgeFee, al as quoteLzFee, am as quoteRouteDepositFee, an as waitForAsyncRequest, ao as waitForTx } from '../curatorBridge-CNs59kT9.js';
3
3
  import { WalletClient, PublicClient, Address, Hash } from 'viem';
4
4
  export { PublicClient as SdkPublicClient } from 'viem';
5
5
 
@@ -1563,6 +1563,167 @@ declare const REGISTRY_ABI: readonly [{
1563
1563
  }];
1564
1564
  readonly stateMutability: "view";
1565
1565
  }];
1566
+ /**
1567
+ * Sub-vault ABI — reads for ERC4626/ERC7540 sub-vaults and ConfigurationFacet extensions.
1568
+ * Used by curator sub-vault portfolio helpers (Phase 5).
1569
+ */
1570
+ declare const SUB_VAULT_ABI: readonly [{
1571
+ readonly type: "function";
1572
+ readonly name: "tokensHeld";
1573
+ readonly inputs: readonly [{
1574
+ readonly name: "id";
1575
+ readonly type: "bytes32";
1576
+ }];
1577
+ readonly outputs: readonly [{
1578
+ readonly name: "";
1579
+ readonly type: "address[]";
1580
+ }];
1581
+ readonly stateMutability: "view";
1582
+ }, {
1583
+ readonly type: "function";
1584
+ readonly name: "lockedTokensAmountOfAsset";
1585
+ readonly inputs: readonly [{
1586
+ readonly name: "asset";
1587
+ readonly type: "address";
1588
+ }];
1589
+ readonly outputs: readonly [{
1590
+ readonly name: "";
1591
+ readonly type: "uint256";
1592
+ }];
1593
+ readonly stateMutability: "view";
1594
+ }, {
1595
+ readonly type: "function";
1596
+ readonly name: "convertToAssets";
1597
+ readonly inputs: readonly [{
1598
+ readonly name: "shares";
1599
+ readonly type: "uint256";
1600
+ }];
1601
+ readonly outputs: readonly [{
1602
+ readonly name: "";
1603
+ readonly type: "uint256";
1604
+ }];
1605
+ readonly stateMutability: "view";
1606
+ }, {
1607
+ readonly type: "function";
1608
+ readonly name: "convertToShares";
1609
+ readonly inputs: readonly [{
1610
+ readonly name: "assets";
1611
+ readonly type: "uint256";
1612
+ }];
1613
+ readonly outputs: readonly [{
1614
+ readonly name: "";
1615
+ readonly type: "uint256";
1616
+ }];
1617
+ readonly stateMutability: "view";
1618
+ }, {
1619
+ readonly type: "function";
1620
+ readonly name: "previewDeposit";
1621
+ readonly inputs: readonly [{
1622
+ readonly name: "assets";
1623
+ readonly type: "uint256";
1624
+ }];
1625
+ readonly outputs: readonly [{
1626
+ readonly name: "";
1627
+ readonly type: "uint256";
1628
+ }];
1629
+ readonly stateMutability: "view";
1630
+ }, {
1631
+ readonly type: "function";
1632
+ readonly name: "previewRedeem";
1633
+ readonly inputs: readonly [{
1634
+ readonly name: "shares";
1635
+ readonly type: "uint256";
1636
+ }];
1637
+ readonly outputs: readonly [{
1638
+ readonly name: "";
1639
+ readonly type: "uint256";
1640
+ }];
1641
+ readonly stateMutability: "view";
1642
+ }, {
1643
+ readonly type: "function";
1644
+ readonly name: "maxDeposit";
1645
+ readonly inputs: readonly [{
1646
+ readonly name: "receiver";
1647
+ readonly type: "address";
1648
+ }];
1649
+ readonly outputs: readonly [{
1650
+ readonly name: "";
1651
+ readonly type: "uint256";
1652
+ }];
1653
+ readonly stateMutability: "view";
1654
+ }, {
1655
+ readonly type: "function";
1656
+ readonly name: "maxRedeem";
1657
+ readonly inputs: readonly [{
1658
+ readonly name: "owner";
1659
+ readonly type: "address";
1660
+ }];
1661
+ readonly outputs: readonly [{
1662
+ readonly name: "";
1663
+ readonly type: "uint256";
1664
+ }];
1665
+ readonly stateMutability: "view";
1666
+ }, {
1667
+ readonly type: "function";
1668
+ readonly name: "pendingDepositRequest";
1669
+ readonly inputs: readonly [{
1670
+ readonly name: "requestId";
1671
+ readonly type: "uint256";
1672
+ }, {
1673
+ readonly name: "controller";
1674
+ readonly type: "address";
1675
+ }];
1676
+ readonly outputs: readonly [{
1677
+ readonly name: "";
1678
+ readonly type: "uint256";
1679
+ }];
1680
+ readonly stateMutability: "view";
1681
+ }, {
1682
+ readonly type: "function";
1683
+ readonly name: "claimableDepositRequest";
1684
+ readonly inputs: readonly [{
1685
+ readonly name: "requestId";
1686
+ readonly type: "uint256";
1687
+ }, {
1688
+ readonly name: "controller";
1689
+ readonly type: "address";
1690
+ }];
1691
+ readonly outputs: readonly [{
1692
+ readonly name: "";
1693
+ readonly type: "uint256";
1694
+ }];
1695
+ readonly stateMutability: "view";
1696
+ }, {
1697
+ readonly type: "function";
1698
+ readonly name: "pendingRedeemRequest";
1699
+ readonly inputs: readonly [{
1700
+ readonly name: "requestId";
1701
+ readonly type: "uint256";
1702
+ }, {
1703
+ readonly name: "controller";
1704
+ readonly type: "address";
1705
+ }];
1706
+ readonly outputs: readonly [{
1707
+ readonly name: "";
1708
+ readonly type: "uint256";
1709
+ }];
1710
+ readonly stateMutability: "view";
1711
+ }, {
1712
+ readonly type: "function";
1713
+ readonly name: "claimableRedeemRequest";
1714
+ readonly inputs: readonly [{
1715
+ readonly name: "requestId";
1716
+ readonly type: "uint256";
1717
+ }, {
1718
+ readonly name: "controller";
1719
+ readonly type: "address";
1720
+ }];
1721
+ readonly outputs: readonly [{
1722
+ readonly name: "";
1723
+ readonly type: "uint256";
1724
+ }];
1725
+ readonly stateMutability: "view";
1726
+ }];
1566
1727
  /**
1567
1728
  * Minimal LZ Endpoint V2 ABI for compose queue management.
1568
1729
  * Used by the Stargate 2-TX flow to check compose status and execute pending composes.
@@ -2503,6 +2664,103 @@ declare function buildUniswapV3Swap(params: {
2503
2664
  recipient: Address;
2504
2665
  }): CuratorAction;
2505
2666
 
2667
+ /**
2668
+ * Curator sub-vault read helpers for the MoreVaults SDK (Phase 5).
2669
+ *
2670
+ * Provides portfolio views and sub-vault analysis for curator dashboards.
2671
+ * Supports both ERC4626 (synchronous) and ERC7540 (asynchronous) sub-vaults.
2672
+ *
2673
+ * All functions are read-only (no wallet needed) and use multicall for
2674
+ * batched RPC efficiency.
2675
+ */
2676
+
2677
+ /**
2678
+ * Get active sub-vault positions held by the vault.
2679
+ *
2680
+ * Queries the vault's `tokensHeld` for ERC4626 and ERC7540 type IDs, then
2681
+ * fetches balances, underlying values, and token metadata for each sub-vault
2682
+ * in a single multicall round. Sub-vaults with zero share balance are excluded.
2683
+ *
2684
+ * @param publicClient Viem public client (must be on the vault's chain)
2685
+ * @param vault Vault address (diamond proxy)
2686
+ * @returns Array of active SubVaultPosition objects
2687
+ */
2688
+ declare function getSubVaultPositions(publicClient: PublicClient, vault: Address): Promise<SubVaultPosition[]>;
2689
+ /**
2690
+ * Detect whether a contract is an ERC7540, ERC4626, or unknown vault type.
2691
+ *
2692
+ * Tries to call ERC7540-specific functions first (pendingDepositRequest /
2693
+ * claimableDepositRequest). If those revert, falls back to ERC4626
2694
+ * convertToAssets(0). Returns null if neither succeeds.
2695
+ *
2696
+ * @param publicClient Viem public client (must be on the same chain as subVault)
2697
+ * @param subVault Sub-vault contract address to probe
2698
+ * @returns 'erc7540' | 'erc4626' | null
2699
+ */
2700
+ declare function detectSubVaultType(publicClient: PublicClient, subVault: Address): Promise<'erc4626' | 'erc7540' | null>;
2701
+ /**
2702
+ * Analyse a specific sub-vault to understand deposit limits, metadata, type,
2703
+ * and global-registry whitelist status.
2704
+ *
2705
+ * Useful for curators deciding whether to invest vault funds into a given
2706
+ * ERC4626 or ERC7540 protocol.
2707
+ *
2708
+ * @param publicClient Viem public client (must be on the vault's chain)
2709
+ * @param vault Vault address (diamond proxy) — used to check maxDeposit
2710
+ * @param subVault Sub-vault address to analyse
2711
+ * @returns SubVaultInfo snapshot
2712
+ */
2713
+ declare function getSubVaultInfo(publicClient: PublicClient, vault: Address, subVault: Address): Promise<SubVaultInfo>;
2714
+ /**
2715
+ * Get the ERC7540 async request status for a specific sub-vault and vault controller.
2716
+ *
2717
+ * Queries pendingDepositRequest, claimableDepositRequest, pendingRedeemRequest,
2718
+ * and claimableRedeemRequest using requestId = 0 (the standard default).
2719
+ *
2720
+ * @param publicClient Viem public client (must be on the vault's chain)
2721
+ * @param vault Vault address acting as controller in the sub-vault
2722
+ * @param subVault ERC7540 sub-vault address
2723
+ * @returns ERC7540RequestStatus with canFinalize flags
2724
+ */
2725
+ declare function getERC7540RequestStatus(publicClient: PublicClient, vault: Address, subVault: Address): Promise<ERC7540RequestStatus>;
2726
+ /**
2727
+ * Preview how many shares the vault would receive for a given asset deposit
2728
+ * into a sub-vault.
2729
+ *
2730
+ * Calls `previewDeposit(assets)` on the sub-vault contract.
2731
+ *
2732
+ * @param publicClient Viem public client
2733
+ * @param subVault Sub-vault address (ERC4626 or ERC7540)
2734
+ * @param assets Amount of underlying assets to preview
2735
+ * @returns Expected shares to be minted
2736
+ */
2737
+ declare function previewSubVaultDeposit(publicClient: PublicClient, subVault: Address, assets: bigint): Promise<bigint>;
2738
+ /**
2739
+ * Preview how many underlying assets the vault would receive for redeeming
2740
+ * a given number of shares from a sub-vault.
2741
+ *
2742
+ * Calls `previewRedeem(shares)` on the sub-vault contract.
2743
+ *
2744
+ * @param publicClient Viem public client
2745
+ * @param subVault Sub-vault address (ERC4626 or ERC7540)
2746
+ * @param shares Number of shares to preview redemption for
2747
+ * @returns Expected underlying assets to be returned
2748
+ */
2749
+ declare function previewSubVaultRedeem(publicClient: PublicClient, subVault: Address, shares: bigint): Promise<bigint>;
2750
+ /**
2751
+ * Get the complete portfolio view for a vault, combining liquid asset balances
2752
+ * with active sub-vault positions and locked ERC7540 assets.
2753
+ *
2754
+ * Liquid assets that are also sub-vault share tokens are deduplicated to avoid
2755
+ * double-counting (the sub-vault's underlying value is already captured via
2756
+ * convertToAssets).
2757
+ *
2758
+ * @param publicClient Viem public client (must be on the vault's hub chain)
2759
+ * @param vault Vault address (diamond proxy)
2760
+ * @returns VaultPortfolio with full breakdown
2761
+ */
2762
+ declare function getVaultPortfolio(publicClient: PublicClient, vault: Address): Promise<VaultPortfolio>;
2763
+
2506
2764
  /**
2507
2765
  * Cast a wagmi PublicClient to the SDK's expected type.
2508
2766
  * Use this in React components to avoid `as any` casts:
@@ -2517,4 +2775,4 @@ declare function buildUniswapV3Swap(params: {
2517
2775
  */
2518
2776
  declare function asSdkClient(client: unknown): PublicClient;
2519
2777
 
2520
- export { AsyncRequestResult, BRIDGE_ABI, BRIDGE_FACET_ABI, CCManagerNotConfiguredError, CHAIN_IDS, CHAIN_ID_TO_EID, CONFIG_ABI, CURATOR_CONFIG_ABI, CapacityFullError, ComposeData, CuratorAction, CuratorVaultStatus, DEX_ABI, DepositResult, EID_TO_CHAIN_ID, ERC20_ABI, ERC4626_FACET_ABI, ERC7540_FACET_ABI, EscrowNotConfiguredError, InsufficientLiquidityError, LZ_ADAPTER_ABI, LZ_EIDS, LZ_ENDPOINT_ABI, LZ_TIMEOUTS, METADATA_ABI, MULTICALL_ABI, MissingEscrowAddressError, MoreVaultsError, NotHubVaultError, NotWhitelistedError, OFT_ABI, OFT_ROUTES, PendingAction, REGISTRY_ABI, RedeemResult, STARGATE_TAXI_CMD, SpokeDepositResult, type SpokeRedeemRoute, SubmitActionsResult, UNISWAP_V3_ROUTERS, USDC_STARGATE_OFT, USDC_TOKEN, VAULT_ABI, VAULT_ANALYSIS_ABI, VaultAddresses, VaultAnalysis, VaultAssetBreakdown, VaultPausedError, WrongChainError, asSdkClient, bridgeAssetsToSpoke, bridgeSharesToHub, buildCuratorBatch, buildUniswapV3Swap, checkProtocolWhitelist, depositAsync, depositSimple as depositCrossChainOracleOn, depositFromSpoke, depositFromSpoke as depositFromSpokeAsync, depositMultiAsset, depositSimple, encodeCuratorAction, encodeUniswapV3SwapCalldata, executeActions, executeCompose, getCuratorVaultStatus, getPendingActions, getVaultAnalysis, getVaultAssetBreakdown, getWithdrawalRequest, isCurator, mintAsync, preflightAsync, preflightRedeemLiquidity, preflightSpokeDeposit, preflightSpokeRedeem, preflightSync, quoteComposeFee, quoteDepositFromSpokeFee, quoteShareBridgeFee, redeemAsync, redeemShares, requestRedeem, resolveRedeemAddresses, smartDeposit, smartRedeem, submitActions, vetoActions, waitForCompose, withdrawAssets };
2778
+ export { AsyncRequestResult, BRIDGE_ABI, BRIDGE_FACET_ABI, CCManagerNotConfiguredError, CHAIN_IDS, CHAIN_ID_TO_EID, CONFIG_ABI, CURATOR_CONFIG_ABI, CapacityFullError, ComposeData, CuratorAction, CuratorVaultStatus, DEX_ABI, DepositResult, EID_TO_CHAIN_ID, ERC20_ABI, ERC4626_FACET_ABI, ERC7540RequestStatus, ERC7540_FACET_ABI, EscrowNotConfiguredError, InsufficientLiquidityError, LZ_ADAPTER_ABI, LZ_EIDS, LZ_ENDPOINT_ABI, LZ_TIMEOUTS, METADATA_ABI, MULTICALL_ABI, MissingEscrowAddressError, MoreVaultsError, NotHubVaultError, NotWhitelistedError, OFT_ABI, OFT_ROUTES, PendingAction, REGISTRY_ABI, RedeemResult, STARGATE_TAXI_CMD, SUB_VAULT_ABI, SpokeDepositResult, type SpokeRedeemRoute, SubVaultInfo, SubVaultPosition, SubmitActionsResult, UNISWAP_V3_ROUTERS, USDC_STARGATE_OFT, USDC_TOKEN, VAULT_ABI, VAULT_ANALYSIS_ABI, VaultAddresses, VaultAnalysis, VaultAssetBreakdown, VaultPausedError, VaultPortfolio, WrongChainError, asSdkClient, bridgeAssetsToSpoke, bridgeSharesToHub, buildCuratorBatch, buildUniswapV3Swap, checkProtocolWhitelist, depositAsync, depositSimple as depositCrossChainOracleOn, depositFromSpoke, depositFromSpoke as depositFromSpokeAsync, depositMultiAsset, depositSimple, detectSubVaultType, encodeCuratorAction, encodeUniswapV3SwapCalldata, executeActions, executeCompose, getCuratorVaultStatus, getERC7540RequestStatus, getPendingActions, getSubVaultInfo, getSubVaultPositions, getVaultAnalysis, getVaultAssetBreakdown, getVaultPortfolio, getWithdrawalRequest, isCurator, mintAsync, preflightAsync, preflightRedeemLiquidity, preflightSpokeDeposit, preflightSpokeRedeem, preflightSync, previewSubVaultDeposit, previewSubVaultRedeem, quoteComposeFee, quoteDepositFromSpokeFee, quoteShareBridgeFee, redeemAsync, redeemShares, requestRedeem, resolveRedeemAddresses, smartDeposit, smartRedeem, submitActions, vetoActions, waitForCompose, withdrawAssets };