@morpho-org/consumer-sdk 0.1.2 → 0.1.3
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.
|
@@ -15,13 +15,17 @@ class MorphoVaultV2 {
|
|
|
15
15
|
this.chainId = chainId;
|
|
16
16
|
}
|
|
17
17
|
async getData() {
|
|
18
|
-
return (0, blue_sdk_viem_1.fetchAccrualVaultV2)(this.vault, this.client.viemClient
|
|
18
|
+
return (0, blue_sdk_viem_1.fetchAccrualVaultV2)(this.vault, this.client.viemClient, {
|
|
19
|
+
chainId: this.chainId,
|
|
20
|
+
});
|
|
19
21
|
}
|
|
20
22
|
async deposit({ assets, userAddress, slippageTolerance = blue_sdk_1.DEFAULT_SLIPPAGE_TOLERANCE, }) {
|
|
21
23
|
if (this.client.viemClient.chain?.id !== this.chainId) {
|
|
22
24
|
throw new types_1.ChainIdMismatchError(this.client.viemClient.chain?.id, this.chainId);
|
|
23
25
|
}
|
|
24
|
-
const vaultData = await (0, blue_sdk_viem_1.fetchVaultV2)(this.vault, this.client.viemClient
|
|
26
|
+
const vaultData = await (0, blue_sdk_viem_1.fetchVaultV2)(this.vault, this.client.viemClient, {
|
|
27
|
+
chainId: this.chainId,
|
|
28
|
+
});
|
|
25
29
|
const maxSharePrice = blue_sdk_1.MathLib.min(blue_sdk_1.MathLib.mulDivUp(assets, blue_sdk_1.MathLib.wToRay(blue_sdk_1.MathLib.WAD + slippageTolerance), vaultData.toShares(assets)), blue_sdk_1.MathLib.RAY * 100n);
|
|
26
30
|
return {
|
|
27
31
|
getRequirements: async () => await (0, actions_1.getRequirements)(this.client.viemClient, {
|
package/package.json
CHANGED