@oydual31/more-vaults-sdk 0.2.6 → 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 +14 -5
- package/dist/viem/index.cjs.map +1 -1
- package/dist/viem/index.js +14 -5
- package/dist/viem/index.js.map +1 -1
- package/package.json +1 -1
- package/src/viem/userHelpers.ts +18 -6
package/dist/viem/index.cjs
CHANGED
|
@@ -3055,12 +3055,21 @@ async function getUserPositionMultiChain(vault, user) {
|
|
|
3055
3055
|
}
|
|
3056
3056
|
const spokeClient = createChainClient(spokeChainId);
|
|
3057
3057
|
if (!spokeClient) return { chainId: spokeChainId, balance: 0n };
|
|
3058
|
-
const
|
|
3059
|
-
|
|
3060
|
-
|
|
3061
|
-
|
|
3062
|
-
|
|
3058
|
+
const [rawBalance, spokeOftDecimals] = await spokeClient.multicall({
|
|
3059
|
+
contracts: [
|
|
3060
|
+
{ address: spokeOft, abi: ERC20_ABI, functionName: "balanceOf", args: [u] },
|
|
3061
|
+
{ address: spokeOft, abi: METADATA_ABI, functionName: "decimals" }
|
|
3062
|
+
],
|
|
3063
|
+
allowFailure: false
|
|
3063
3064
|
});
|
|
3065
|
+
let balance;
|
|
3066
|
+
if (spokeOftDecimals > decimals) {
|
|
3067
|
+
balance = rawBalance / 10n ** BigInt(spokeOftDecimals - decimals);
|
|
3068
|
+
} else if (spokeOftDecimals < decimals) {
|
|
3069
|
+
balance = rawBalance * 10n ** BigInt(decimals - spokeOftDecimals);
|
|
3070
|
+
} else {
|
|
3071
|
+
balance = rawBalance;
|
|
3072
|
+
}
|
|
3064
3073
|
return { chainId: spokeChainId, balance };
|
|
3065
3074
|
} catch {
|
|
3066
3075
|
return { chainId: spokeChainId, balance: 0n };
|