@morpho-org/evm-simulation 4.2.0 → 4.2.1

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.
@@ -19,11 +19,18 @@ interface RetainedAsset {
19
19
  token: string | undefined;
20
20
  netRetained: string;
21
21
  }
22
- /** Funds would flow to restricted standalone bundles contract addresses. Never bypassable. */
22
+ /**
23
+ * Thrown when net value above the dust threshold is retained by a restricted bundles contract
24
+ * (VaultExitBundlesV1, VaultBundlesV1, BlueBundlesV1 or MidnightBundlesV1) after simulation;
25
+ * pass-through flows and net outflows are allowed. Never bypassable.
26
+ */
23
27
  export declare class BlacklistViolationError extends SimulationPackageError {
28
+ /** Per-asset net retained amounts keyed by restricted contract and token. */
24
29
  readonly assetChanges?: RetainedAsset[] | undefined;
25
30
  readonly code = "BLACKLIST_ERROR";
26
- constructor(message: string, assetChanges?: RetainedAsset[] | undefined);
31
+ constructor(message: string,
32
+ /** Per-asset net retained amounts keyed by restricted contract and token. */
33
+ assetChanges?: RetainedAsset[] | undefined);
27
34
  }
28
35
  /** Tenderly or RPC service is down. Bypassable — user can proceed. */
29
36
  export declare class ExternalServiceError extends SimulationPackageError {
package/lib/cjs/errors.js CHANGED
@@ -24,11 +24,17 @@ class SimulationRevertedError extends SimulationPackageError {
24
24
  }
25
25
  }
26
26
  exports.SimulationRevertedError = SimulationRevertedError;
27
- /** Funds would flow to restricted standalone bundles contract addresses. Never bypassable. */
27
+ /**
28
+ * Thrown when net value above the dust threshold is retained by a restricted bundles contract
29
+ * (VaultExitBundlesV1, VaultBundlesV1, BlueBundlesV1 or MidnightBundlesV1) after simulation;
30
+ * pass-through flows and net outflows are allowed. Never bypassable.
31
+ */
28
32
  class BlacklistViolationError extends SimulationPackageError {
29
33
  assetChanges;
30
34
  code = "BLACKLIST_ERROR";
31
- constructor(message, assetChanges) {
35
+ constructor(message,
36
+ /** Per-asset net retained amounts keyed by restricted contract and token. */
37
+ assetChanges) {
32
38
  super(message);
33
39
  this.assetChanges = assetChanges;
34
40
  }
@@ -7,7 +7,8 @@ import type { SimulateParams, SimulationConfig, SimulationResult } from "../type
7
7
  * budget → parses ERC20 transfers and WETH9 events from per-tx logs, restricting WETH9
8
8
  * events to the registered wrapped-native token, rejecting them on known tokenless chains,
9
9
  * and retaining signature-based parsing for unknown chains → asserts no funds are retained
10
- * by standalone `bundles` periphery contracts → returns the full result
10
+ * by the restricted standalone bundles contracts (VaultExitBundlesV1, VaultBundlesV1,
11
+ * BlueBundlesV1, MidnightBundlesV1) → returns the full result
11
12
  * set. The caller reads whichever fields they need:
12
13
  *
13
14
  * - `transfers` → user-facing preview / server-side verification.
@@ -35,7 +36,7 @@ import type { SimulateParams, SimulationConfig, SimulationResult } from "../type
35
36
  * @throws {SimulationRevertedError} when the bundle reverts on either backend.
36
37
  * @throws {BlacklistViolationError} when the simulation leaves value retained beyond
37
38
  * the dust threshold by a `bundles` periphery contract (VaultExitBundlesV1,
38
- * VaultBundlesV1, BlueBundlesV1). Never bypassable.
39
+ * VaultBundlesV1, BlueBundlesV1, MidnightBundlesV1). Never bypassable.
39
40
  * @throws {ExternalServiceError} (a) when both backends are unavailable within the
40
41
  * timeout budget, or (b) when a backend returns a `calls` array whose length does
41
42
  * not match the resolved `simulationTxs` — refusing to map transfers with mismatched
@@ -13,7 +13,8 @@ const index_js_2 = require("./pipeline/index.js");
13
13
  * budget → parses ERC20 transfers and WETH9 events from per-tx logs, restricting WETH9
14
14
  * events to the registered wrapped-native token, rejecting them on known tokenless chains,
15
15
  * and retaining signature-based parsing for unknown chains → asserts no funds are retained
16
- * by standalone `bundles` periphery contracts → returns the full result
16
+ * by the restricted standalone bundles contracts (VaultExitBundlesV1, VaultBundlesV1,
17
+ * BlueBundlesV1, MidnightBundlesV1) → returns the full result
17
18
  * set. The caller reads whichever fields they need:
18
19
  *
19
20
  * - `transfers` → user-facing preview / server-side verification.
@@ -41,7 +42,7 @@ const index_js_2 = require("./pipeline/index.js");
41
42
  * @throws {SimulationRevertedError} when the bundle reverts on either backend.
42
43
  * @throws {BlacklistViolationError} when the simulation leaves value retained beyond
43
44
  * the dust threshold by a `bundles` periphery contract (VaultExitBundlesV1,
44
- * VaultBundlesV1, BlueBundlesV1). Never bypassable.
45
+ * VaultBundlesV1, BlueBundlesV1, MidnightBundlesV1). Never bypassable.
45
46
  * @throws {ExternalServiceError} (a) when both backends are unavailable within the
46
47
  * timeout budget, or (b) when a backend returns a `calls` array whose length does
47
48
  * not match the resolved `simulationTxs` — refusing to map transfers with mismatched
@@ -19,11 +19,18 @@ interface RetainedAsset {
19
19
  token: string | undefined;
20
20
  netRetained: string;
21
21
  }
22
- /** Funds would flow to restricted standalone bundles contract addresses. Never bypassable. */
22
+ /**
23
+ * Thrown when net value above the dust threshold is retained by a restricted bundles contract
24
+ * (VaultExitBundlesV1, VaultBundlesV1, BlueBundlesV1 or MidnightBundlesV1) after simulation;
25
+ * pass-through flows and net outflows are allowed. Never bypassable.
26
+ */
23
27
  export declare class BlacklistViolationError extends SimulationPackageError {
28
+ /** Per-asset net retained amounts keyed by restricted contract and token. */
24
29
  readonly assetChanges?: RetainedAsset[] | undefined;
25
30
  readonly code = "BLACKLIST_ERROR";
26
- constructor(message: string, assetChanges?: RetainedAsset[] | undefined);
31
+ constructor(message: string,
32
+ /** Per-asset net retained amounts keyed by restricted contract and token. */
33
+ assetChanges?: RetainedAsset[] | undefined);
27
34
  }
28
35
  /** Tenderly or RPC service is down. Bypassable — user can proceed. */
29
36
  export declare class ExternalServiceError extends SimulationPackageError {
package/lib/esm/errors.js CHANGED
@@ -19,11 +19,17 @@ export class SimulationRevertedError extends SimulationPackageError {
19
19
  this.details = details;
20
20
  }
21
21
  }
22
- /** Funds would flow to restricted standalone bundles contract addresses. Never bypassable. */
22
+ /**
23
+ * Thrown when net value above the dust threshold is retained by a restricted bundles contract
24
+ * (VaultExitBundlesV1, VaultBundlesV1, BlueBundlesV1 or MidnightBundlesV1) after simulation;
25
+ * pass-through flows and net outflows are allowed. Never bypassable.
26
+ */
23
27
  export class BlacklistViolationError extends SimulationPackageError {
24
28
  assetChanges;
25
29
  code = "BLACKLIST_ERROR";
26
- constructor(message, assetChanges) {
30
+ constructor(message,
31
+ /** Per-asset net retained amounts keyed by restricted contract and token. */
32
+ assetChanges) {
27
33
  super(message);
28
34
  this.assetChanges = assetChanges;
29
35
  }
@@ -7,7 +7,8 @@ import type { SimulateParams, SimulationConfig, SimulationResult } from "../type
7
7
  * budget → parses ERC20 transfers and WETH9 events from per-tx logs, restricting WETH9
8
8
  * events to the registered wrapped-native token, rejecting them on known tokenless chains,
9
9
  * and retaining signature-based parsing for unknown chains → asserts no funds are retained
10
- * by standalone `bundles` periphery contracts → returns the full result
10
+ * by the restricted standalone bundles contracts (VaultExitBundlesV1, VaultBundlesV1,
11
+ * BlueBundlesV1, MidnightBundlesV1) → returns the full result
11
12
  * set. The caller reads whichever fields they need:
12
13
  *
13
14
  * - `transfers` → user-facing preview / server-side verification.
@@ -35,7 +36,7 @@ import type { SimulateParams, SimulationConfig, SimulationResult } from "../type
35
36
  * @throws {SimulationRevertedError} when the bundle reverts on either backend.
36
37
  * @throws {BlacklistViolationError} when the simulation leaves value retained beyond
37
38
  * the dust threshold by a `bundles` periphery contract (VaultExitBundlesV1,
38
- * VaultBundlesV1, BlueBundlesV1). Never bypassable.
39
+ * VaultBundlesV1, BlueBundlesV1, MidnightBundlesV1). Never bypassable.
39
40
  * @throws {ExternalServiceError} (a) when both backends are unavailable within the
40
41
  * timeout budget, or (b) when a backend returns a `calls` array whose length does
41
42
  * not match the resolved `simulationTxs` — refusing to map transfers with mismatched
@@ -10,7 +10,8 @@ import { assertNoBundlesRetention, buildSimulationTxs, executeSimulation, valida
10
10
  * budget → parses ERC20 transfers and WETH9 events from per-tx logs, restricting WETH9
11
11
  * events to the registered wrapped-native token, rejecting them on known tokenless chains,
12
12
  * and retaining signature-based parsing for unknown chains → asserts no funds are retained
13
- * by standalone `bundles` periphery contracts → returns the full result
13
+ * by the restricted standalone bundles contracts (VaultExitBundlesV1, VaultBundlesV1,
14
+ * BlueBundlesV1, MidnightBundlesV1) → returns the full result
14
15
  * set. The caller reads whichever fields they need:
15
16
  *
16
17
  * - `transfers` → user-facing preview / server-side verification.
@@ -38,7 +39,7 @@ import { assertNoBundlesRetention, buildSimulationTxs, executeSimulation, valida
38
39
  * @throws {SimulationRevertedError} when the bundle reverts on either backend.
39
40
  * @throws {BlacklistViolationError} when the simulation leaves value retained beyond
40
41
  * the dust threshold by a `bundles` periphery contract (VaultExitBundlesV1,
41
- * VaultBundlesV1, BlueBundlesV1). Never bypassable.
42
+ * VaultBundlesV1, BlueBundlesV1, MidnightBundlesV1). Never bypassable.
42
43
  * @throws {ExternalServiceError} (a) when both backends are unavailable within the
43
44
  * timeout budget, or (b) when a backend returns a `calls` array whose length does
44
45
  * not match the resolved `simulationTxs` — refusing to map transfers with mismatched
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@morpho-org/evm-simulation",
3
3
  "description": "EVM simulation engine for Morpho transactions.",
4
- "version": "4.2.0",
4
+ "version": "4.2.1",
5
5
  "author": "Morpho Association <contact@morpho.org>",
6
6
  "repository": {
7
7
  "type": "git",
@@ -22,8 +22,8 @@
22
22
  ],
23
23
  "dependencies": {
24
24
  "zod": "^4.4.3",
25
- "@morpho-org/blue-sdk": "^7.0.0",
26
- "@morpho-org/morpho-ts": "^3.0.0"
25
+ "@morpho-org/blue-sdk": "^7.1.0",
26
+ "@morpho-org/morpho-ts": "^3.1.0"
27
27
  },
28
28
  "peerDependencies": {
29
29
  "viem": "^2.0.0"