@oydual31/more-vaults-sdk 0.2.5 → 0.2.7
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/README.md +23 -8
- package/dist/react/index.cjs +14 -5
- package/dist/react/index.cjs.map +1 -1
- package/dist/react/index.js +14 -5
- package/dist/react/index.js.map +1 -1
- package/dist/viem/index.cjs +27 -6
- package/dist/viem/index.cjs.map +1 -1
- package/dist/viem/index.d.cts +1 -13
- package/dist/viem/index.d.ts +1 -13
- package/dist/viem/index.js +27 -6
- package/dist/viem/index.js.map +1 -1
- package/package.json +1 -1
- package/src/viem/crossChainFlows.ts +24 -2
- package/src/viem/userHelpers.ts +18 -6
package/dist/react/index.js
CHANGED
|
@@ -1808,12 +1808,21 @@ async function getUserPositionMultiChain(vault, user) {
|
|
|
1808
1808
|
}
|
|
1809
1809
|
const spokeClient = createChainClient(spokeChainId);
|
|
1810
1810
|
if (!spokeClient) return { chainId: spokeChainId, balance: 0n };
|
|
1811
|
-
const
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1815
|
-
|
|
1811
|
+
const [rawBalance, spokeOftDecimals] = await spokeClient.multicall({
|
|
1812
|
+
contracts: [
|
|
1813
|
+
{ address: spokeOft, abi: ERC20_ABI, functionName: "balanceOf", args: [u] },
|
|
1814
|
+
{ address: spokeOft, abi: METADATA_ABI, functionName: "decimals" }
|
|
1815
|
+
],
|
|
1816
|
+
allowFailure: false
|
|
1816
1817
|
});
|
|
1818
|
+
let balance;
|
|
1819
|
+
if (spokeOftDecimals > decimals) {
|
|
1820
|
+
balance = rawBalance / 10n ** BigInt(spokeOftDecimals - decimals);
|
|
1821
|
+
} else if (spokeOftDecimals < decimals) {
|
|
1822
|
+
balance = rawBalance * 10n ** BigInt(decimals - spokeOftDecimals);
|
|
1823
|
+
} else {
|
|
1824
|
+
balance = rawBalance;
|
|
1825
|
+
}
|
|
1817
1826
|
return { chainId: spokeChainId, balance };
|
|
1818
1827
|
} catch {
|
|
1819
1828
|
return { chainId: spokeChainId, balance: 0n };
|