@oydual31/more-vaults-sdk 0.2.7 → 0.2.8

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.
@@ -1775,6 +1775,7 @@ async function getUserPositionMultiChain(vault, user) {
1775
1775
  });
1776
1776
  const [withdrawShares, timelockEndsAt] = withdrawalRequest;
1777
1777
  const spokeShares = {};
1778
+ const rawSpokeShares = {};
1778
1779
  if (topo.spokeChainIds.length > 0) {
1779
1780
  let hubShareOft = null;
1780
1781
  try {
@@ -1797,7 +1798,7 @@ async function getUserPositionMultiChain(vault, user) {
1797
1798
  const spokePromises = topo.spokeChainIds.map(async (spokeChainId) => {
1798
1799
  try {
1799
1800
  const spokeEid = CHAIN_ID_TO_EID[spokeChainId];
1800
- if (!spokeEid) return { chainId: spokeChainId, balance: 0n };
1801
+ if (!spokeEid) return { chainId: spokeChainId, balance: 0n, rawBalance: 0n };
1801
1802
  const spokeOftBytes32 = await hubClient.readContract({
1802
1803
  address: hubShareOft,
1803
1804
  abi: OFT_ABI,
@@ -1806,10 +1807,10 @@ async function getUserPositionMultiChain(vault, user) {
1806
1807
  });
1807
1808
  const spokeOft = viem.getAddress(`0x${spokeOftBytes32.slice(-40)}`);
1808
1809
  if (spokeOft === "0x0000000000000000000000000000000000000000") {
1809
- return { chainId: spokeChainId, balance: 0n };
1810
+ return { chainId: spokeChainId, balance: 0n, rawBalance: 0n };
1810
1811
  }
1811
1812
  const spokeClient = createChainClient(spokeChainId);
1812
- if (!spokeClient) return { chainId: spokeChainId, balance: 0n };
1813
+ if (!spokeClient) return { chainId: spokeChainId, balance: 0n, rawBalance: 0n };
1813
1814
  const [rawBalance, spokeOftDecimals] = await spokeClient.multicall({
1814
1815
  contracts: [
1815
1816
  { address: spokeOft, abi: ERC20_ABI, functionName: "balanceOf", args: [u] },
@@ -1825,14 +1826,15 @@ async function getUserPositionMultiChain(vault, user) {
1825
1826
  } else {
1826
1827
  balance = rawBalance;
1827
1828
  }
1828
- return { chainId: spokeChainId, balance };
1829
+ return { chainId: spokeChainId, balance, rawBalance };
1829
1830
  } catch {
1830
- return { chainId: spokeChainId, balance: 0n };
1831
+ return { chainId: spokeChainId, balance: 0n, rawBalance: 0n };
1831
1832
  }
1832
1833
  });
1833
1834
  const results = await Promise.all(spokePromises);
1834
- for (const { chainId, balance } of results) {
1835
+ for (const { chainId, balance, rawBalance } of results) {
1835
1836
  spokeShares[chainId] = balance;
1837
+ rawSpokeShares[chainId] = rawBalance;
1836
1838
  }
1837
1839
  }
1838
1840
  }
@@ -1852,6 +1854,7 @@ async function getUserPositionMultiChain(vault, user) {
1852
1854
  return {
1853
1855
  hubShares,
1854
1856
  spokeShares,
1857
+ rawSpokeShares,
1855
1858
  totalShares,
1856
1859
  estimatedAssets,
1857
1860
  sharePrice,