@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.
- package/lib/cjs/blue/errors.d.ts +1 -1
- package/lib/cjs/blue/errors.js +2 -1
- package/lib/cjs/constants.d.ts +1 -1
- package/lib/cjs/constants.js +2 -1
- package/lib/cjs/entities/blue/blue.d.ts +14 -2
- package/lib/cjs/entities/blue/blue.js +7 -1
- package/lib/cjs/entities/requirements/getVaultBundlesSharesRequirements.js +1 -0
- package/lib/cjs/entities/vaultV1/vaultV1.js +1 -0
- package/lib/cjs/entities/vaultV2BlueReallocationData.d.ts +34 -9
- package/lib/cjs/entities/vaultV2BlueReallocationData.js +167 -47
- package/lib/cjs/errors.d.ts +1 -1
- package/lib/cjs/errors.js +3 -2
- package/lib/cjs/helpers/constant.d.ts +8 -0
- package/lib/cjs/helpers/constant.js +10 -1
- package/lib/cjs/helpers/encodeDeallocation.d.ts +1 -0
- package/lib/cjs/helpers/encodeDeallocation.js +1 -0
- package/lib/cjs/helpers/index.d.ts +1 -1
- package/lib/cjs/helpers/index.js +2 -1
- package/lib/cjs/helpers/metadata.d.ts +13 -0
- package/lib/cjs/helpers/metadata.js +13 -0
- package/lib/cjs/helpers/utilization.d.ts +13 -0
- package/lib/cjs/helpers/utilization.js +19 -1
- package/lib/cjs/helpers/validate.d.ts +0 -2
- package/lib/cjs/helpers/validate.js +2 -3
- package/lib/cjs/types/data.d.ts +3 -0
- package/lib/cjs/types/entity.d.ts +3 -0
- package/lib/cjs/types/metadata.d.ts +6 -0
- package/lib/cjs/types/sharedLiquidity.d.ts +19 -1
- package/lib/esm/blue/errors.d.ts +1 -1
- package/lib/esm/blue/errors.js +1 -1
- package/lib/esm/constants.d.ts +1 -1
- package/lib/esm/constants.js +1 -1
- package/lib/esm/entities/blue/blue.d.ts +14 -2
- package/lib/esm/entities/blue/blue.js +7 -1
- package/lib/esm/entities/requirements/getVaultBundlesSharesRequirements.js +1 -0
- package/lib/esm/entities/vaultV1/vaultV1.js +1 -0
- package/lib/esm/entities/vaultV2BlueReallocationData.d.ts +34 -9
- package/lib/esm/entities/vaultV2BlueReallocationData.js +168 -48
- package/lib/esm/errors.d.ts +1 -1
- package/lib/esm/errors.js +1 -1
- package/lib/esm/helpers/constant.d.ts +8 -0
- package/lib/esm/helpers/constant.js +9 -0
- package/lib/esm/helpers/encodeDeallocation.d.ts +1 -0
- package/lib/esm/helpers/encodeDeallocation.js +1 -0
- package/lib/esm/helpers/index.d.ts +1 -1
- package/lib/esm/helpers/index.js +1 -1
- package/lib/esm/helpers/metadata.d.ts +13 -0
- package/lib/esm/helpers/metadata.js +13 -0
- package/lib/esm/helpers/utilization.d.ts +13 -0
- package/lib/esm/helpers/utilization.js +18 -1
- package/lib/esm/helpers/validate.d.ts +0 -2
- package/lib/esm/helpers/validate.js +1 -1
- package/lib/esm/types/data.d.ts +3 -0
- package/lib/esm/types/entity.d.ts +3 -0
- package/lib/esm/types/metadata.d.ts +6 -0
- package/lib/esm/types/sharedLiquidity.d.ts +19 -1
- package/package.json +4 -4
|
@@ -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
|
-
/**
|
|
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.
|
|
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.
|
|
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
|
-
"
|
|
168
|
+
"zod": "^4.4.3"
|
|
169
169
|
},
|
|
170
170
|
"scripts": {
|
|
171
171
|
"prepublish": "pnpm build",
|