@morpho-org/morpho-sdk 6.1.0 → 6.3.0

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.
Files changed (57) hide show
  1. package/lib/cjs/blue/errors.d.ts +1 -1
  2. package/lib/cjs/blue/errors.js +2 -1
  3. package/lib/cjs/constants.d.ts +1 -1
  4. package/lib/cjs/constants.js +2 -1
  5. package/lib/cjs/entities/blue/blue.d.ts +14 -2
  6. package/lib/cjs/entities/blue/blue.js +7 -1
  7. package/lib/cjs/entities/requirements/getVaultBundlesSharesRequirements.js +1 -0
  8. package/lib/cjs/entities/vaultV1/vaultV1.js +1 -0
  9. package/lib/cjs/entities/vaultV2BlueReallocationData.d.ts +34 -9
  10. package/lib/cjs/entities/vaultV2BlueReallocationData.js +167 -47
  11. package/lib/cjs/errors.d.ts +1 -1
  12. package/lib/cjs/errors.js +3 -2
  13. package/lib/cjs/helpers/constant.d.ts +8 -0
  14. package/lib/cjs/helpers/constant.js +10 -1
  15. package/lib/cjs/helpers/encodeDeallocation.d.ts +1 -0
  16. package/lib/cjs/helpers/encodeDeallocation.js +1 -0
  17. package/lib/cjs/helpers/index.d.ts +1 -1
  18. package/lib/cjs/helpers/index.js +2 -1
  19. package/lib/cjs/helpers/metadata.d.ts +13 -0
  20. package/lib/cjs/helpers/metadata.js +13 -0
  21. package/lib/cjs/helpers/utilization.d.ts +13 -0
  22. package/lib/cjs/helpers/utilization.js +19 -1
  23. package/lib/cjs/helpers/validate.d.ts +0 -2
  24. package/lib/cjs/helpers/validate.js +2 -3
  25. package/lib/cjs/types/data.d.ts +3 -0
  26. package/lib/cjs/types/entity.d.ts +3 -0
  27. package/lib/cjs/types/metadata.d.ts +6 -0
  28. package/lib/cjs/types/sharedLiquidity.d.ts +19 -1
  29. package/lib/esm/blue/errors.d.ts +1 -1
  30. package/lib/esm/blue/errors.js +1 -1
  31. package/lib/esm/constants.d.ts +1 -1
  32. package/lib/esm/constants.js +1 -1
  33. package/lib/esm/entities/blue/blue.d.ts +14 -2
  34. package/lib/esm/entities/blue/blue.js +7 -1
  35. package/lib/esm/entities/requirements/getVaultBundlesSharesRequirements.js +1 -0
  36. package/lib/esm/entities/vaultV1/vaultV1.js +1 -0
  37. package/lib/esm/entities/vaultV2BlueReallocationData.d.ts +34 -9
  38. package/lib/esm/entities/vaultV2BlueReallocationData.js +168 -48
  39. package/lib/esm/errors.d.ts +1 -1
  40. package/lib/esm/errors.js +1 -1
  41. package/lib/esm/helpers/constant.d.ts +8 -0
  42. package/lib/esm/helpers/constant.js +9 -0
  43. package/lib/esm/helpers/encodeDeallocation.d.ts +1 -0
  44. package/lib/esm/helpers/encodeDeallocation.js +1 -0
  45. package/lib/esm/helpers/index.d.ts +1 -1
  46. package/lib/esm/helpers/index.js +1 -1
  47. package/lib/esm/helpers/metadata.d.ts +13 -0
  48. package/lib/esm/helpers/metadata.js +13 -0
  49. package/lib/esm/helpers/utilization.d.ts +13 -0
  50. package/lib/esm/helpers/utilization.js +18 -1
  51. package/lib/esm/helpers/validate.d.ts +0 -2
  52. package/lib/esm/helpers/validate.js +1 -1
  53. package/lib/esm/types/data.d.ts +3 -0
  54. package/lib/esm/types/entity.d.ts +3 -0
  55. package/lib/esm/types/metadata.d.ts +6 -0
  56. package/lib/esm/types/sharedLiquidity.d.ts +19 -1
  57. package/package.json +4 -4
@@ -1,5 +1,8 @@
1
1
  import type { Address } from "viem";
2
+ /** Identifies a vault and its underlying asset. */
2
3
  export interface VaultParams {
4
+ /** The vault contract address. */
3
5
  vault: Address;
6
+ /** The address of the vault's underlying asset. */
4
7
  asset: Address;
5
8
  }
@@ -1,4 +1,10 @@
1
+ /** Analytics metadata appended to transaction calldata. */
1
2
  export interface Metadata {
3
+ /**
4
+ * Raw or 0x-prefixed hex origin of at most four bytes (eight hex characters) and even length.
5
+ * Invalid values are dropped with a console warning.
6
+ */
2
7
  origin: string;
8
+ /** When true, append the current Unix timestamp as four bytes before the origin. */
3
9
  timestamp?: boolean;
4
10
  }
@@ -4,8 +4,26 @@ import type { Address } from "viem";
4
4
  export interface VaultV2BluePublicAllocatorOptions {
5
5
  /** Whether Vault V2 public allocator discovery is enabled. */
6
6
  readonly enabled?: boolean;
7
- /** Timestamp at which market and Vault V2 interest is evaluated. */
7
+ /**
8
+ * Timestamp at which market and Vault V2 state is evaluated. Canonical state
9
+ * and the returned post-state stay at this timestamp; only target-market cap
10
+ * checks reserve interest on the vault's existing allocation through this
11
+ * timestamp plus `capAccrualBuffer`. For market-source reallocations the
12
+ * source position's interest is also reserved on cap ids shared with the
13
+ * target, and reserves persist across every leg of a plan.
14
+ */
8
15
  readonly timestamp?: BigIntish;
16
+ /**
17
+ * Seconds beyond `timestamp` through which target-market cap checks reserve
18
+ * interest on the vault's existing allocation. For market-source
19
+ * reallocations the source position's interest is also reserved on cap ids
20
+ * shared with the target, and reserves persist across every leg of a plan.
21
+ * Market and Vault V2 state, including the returned post-state, stay at
22
+ * `timestamp`. Set to `0n` to disable.
23
+ *
24
+ * @default DEFAULT_CAP_ACCRUAL_BUFFER (2h)
25
+ */
26
+ readonly capAccrualBuffer?: BigIntish;
9
27
  /**
10
28
  * Vault V2 addresses to consider. Arrays, readonly arrays, sets, and other
11
29
  * iterables are accepted. Defaults to every vault in the reallocation data.
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@morpho-org/morpho-sdk",
3
3
  "description": "Abstraction layer for Morpho's complexity.",
4
- "version": "6.1.0",
4
+ "version": "6.3.0",
5
5
  "author": "Morpho Association <contact@morpho.org>",
6
6
  "repository": {
7
7
  "type": "git",
@@ -150,9 +150,8 @@
150
150
  "MIGRATION-v5-to-v6.md"
151
151
  ],
152
152
  "dependencies": {
153
- "zod": "^4.4.3",
154
153
  "@morpho-org/blue-sdk": "^7.1.0",
155
- "@morpho-org/blue-sdk-viem": "^6.0.0",
154
+ "@morpho-org/blue-sdk-viem": "^6.1.0",
156
155
  "@morpho-org/midnight-sdk": "^1.8.0",
157
156
  "@morpho-org/morpho-ts": "^3.1.0"
158
157
  },
@@ -160,12 +159,13 @@
160
159
  "viem": "^2.0.0"
161
160
  },
162
161
  "devDependencies": {
162
+ "@morpho-org/test": "^2.10.0",
163
163
  "dotenv": "^17.4.2",
164
164
  "fast-check": "^4.9.0",
165
165
  "typescript": "7.0.2",
166
166
  "viem": "^2.55.10",
167
167
  "vitest": "^4.1.11",
168
- "@morpho-org/test": "^2.10.0"
168
+ "zod": "^4.4.3"
169
169
  },
170
170
  "scripts": {
171
171
  "prepublish": "pnpm build",