@morpho-org/bundler-sdk-viem 3.1.3 → 3.1.4
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/lib/operations.js +4 -6
- package/package.json +8 -8
package/lib/operations.js
CHANGED
|
@@ -624,13 +624,11 @@ const simulateRequiredTokenAmounts = (operations, data) => {
|
|
|
624
624
|
});
|
|
625
625
|
// Simulate the operations to calculate the required token amounts.
|
|
626
626
|
const steps = (0, simulation_sdk_1.simulateOperations)(operations, virtualBundlerData);
|
|
627
|
-
return (0, morpho_ts_1.entries)((0, morpho_ts_1.getLast)(steps).holdings[generalAdapter1] ?? {})
|
|
628
|
-
.map(([token, holding]) => ({
|
|
629
|
-
token,
|
|
627
|
+
return ((0, morpho_ts_1.entries)((0, morpho_ts_1.getLast)(steps).holdings[generalAdapter1] ?? {})
|
|
630
628
|
// Safe cast because the holding was transformed to a VirtualHolding.
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
.filter(({ required }) => required > 0n);
|
|
629
|
+
.filter((entry) => entry[1] != null)
|
|
630
|
+
.map(([token, { required }]) => ({ token, required }))
|
|
631
|
+
.filter(({ required }) => required > 0n));
|
|
634
632
|
};
|
|
635
633
|
exports.simulateRequiredTokenAmounts = simulateRequiredTokenAmounts;
|
|
636
634
|
const getSimulatedBundlerOperation = (operation, { slippage } = {}) => {
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@morpho-org/bundler-sdk-viem",
|
|
3
3
|
"description": "Viem-based extension of `@morpho-org/simulation-sdk` that exports utilities to transform simple interactions on Morpho (such as `Blue_Borrow`) and Morpho Vaults (such as `MetaMorpho_Deposit`) into the required bundles (with ERC20 approvals, transfers, etc) to submit to the bundler onchain.",
|
|
4
|
-
"version": "3.1.
|
|
4
|
+
"version": "3.1.4",
|
|
5
5
|
"author": "Morpho Association <contact@morpho.org>",
|
|
6
6
|
"contributors": [
|
|
7
7
|
"Rubilmax <rmilon@gmail.com>"
|
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
],
|
|
20
20
|
"peerDependencies": {
|
|
21
21
|
"viem": "^2.0.0",
|
|
22
|
-
"@morpho-org/blue-sdk": "^3.
|
|
23
|
-
"@morpho-org/
|
|
22
|
+
"@morpho-org/blue-sdk-viem": "^3.1.1",
|
|
23
|
+
"@morpho-org/morpho-ts": "^2.3.0",
|
|
24
24
|
"@morpho-org/simulation-sdk": "^3.0.1",
|
|
25
|
-
"@morpho-org/
|
|
25
|
+
"@morpho-org/blue-sdk": "^3.0.9"
|
|
26
26
|
},
|
|
27
27
|
"devDependencies": {
|
|
28
28
|
"@tanstack/query-core": "^5.62.16",
|
|
@@ -34,13 +34,13 @@
|
|
|
34
34
|
"typescript": "^5.7.2",
|
|
35
35
|
"viem": "^2.23.0",
|
|
36
36
|
"vitest": "^3.0.5",
|
|
37
|
-
"@morpho-org/blue-sdk
|
|
38
|
-
"@morpho-org/blue-sdk": "^3.
|
|
39
|
-
"@morpho-org/morpho-ts": "^2.3.0",
|
|
37
|
+
"@morpho-org/blue-sdk": "^3.0.9",
|
|
38
|
+
"@morpho-org/blue-sdk-viem": "^3.1.1",
|
|
40
39
|
"@morpho-org/morpho-test": "^2.3.0",
|
|
41
40
|
"@morpho-org/simulation-sdk": "^3.0.1",
|
|
42
|
-
"@morpho-org/
|
|
41
|
+
"@morpho-org/morpho-ts": "^2.3.0",
|
|
43
42
|
"@morpho-org/simulation-sdk-wagmi": "^3.0.1",
|
|
43
|
+
"@morpho-org/test": "^2.1.3",
|
|
44
44
|
"@morpho-org/test-wagmi": "^2.0.4"
|
|
45
45
|
},
|
|
46
46
|
"scripts": {
|