@agoric/portfolio-api 0.1.1-dev-94f7dd3.0.94f7dd3 → 0.1.1-dev-a98a0f0.0.a98a0f0

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agoric/portfolio-api",
3
- "version": "0.1.1-dev-94f7dd3.0.94f7dd3",
3
+ "version": "0.1.1-dev-a98a0f0.0.a98a0f0",
4
4
  "description": "API for Portfolio management",
5
5
  "repository": {
6
6
  "type": "git",
@@ -46,8 +46,8 @@
46
46
  "generate:ymax-machine": "npx tsx scripts/gen-ymax-machine.mts"
47
47
  },
48
48
  "dependencies": {
49
- "@agoric/internal": "0.3.3-dev-94f7dd3.0.94f7dd3",
50
- "@agoric/orchestration": "0.1.1-dev-94f7dd3.0.94f7dd3",
49
+ "@agoric/internal": "0.3.3-dev-a98a0f0.0.a98a0f0",
50
+ "@agoric/orchestration": "0.1.1-dev-a98a0f0.0.a98a0f0",
51
51
  "@endo/common": "^1.4.0",
52
52
  "@endo/errors": "^1.3.1",
53
53
  "@endo/patterns": "^1.9.1"
@@ -73,5 +73,5 @@
73
73
  "engines": {
74
74
  "node": "^22.11 || ^24.14"
75
75
  },
76
- "gitHead": "94f7dd333365233251880bd61ef8c803433ecf4d"
76
+ "gitHead": "a98a0f0d9930b1875bea2f51b43f5daeeada23c8"
77
77
  }
@@ -9,9 +9,9 @@
9
9
  * Currently all types and helpers are built around a hard-coded Ymax product
10
10
  * name but with some effort this could be parametrizable
11
11
  */
12
- import type { Address, TypedDataDomain, TypedDataToPrimitiveTypes } from 'abitype';
12
+ import type { Address, TypedDataDomain } from 'abitype';
13
13
  import type { TypedDataDefinition } from 'viem';
14
- import type { TypedDataParameter } from '@agoric/orchestration/src/utils/abitype.js';
14
+ import type { TypedDataParameter, TypedDataToStructType } from '@agoric/orchestration/src/utils/abitype.js';
15
15
  import { type Witness, type getPermitWitnessTransferFromData, type getPermitBatchWitnessTransferFromData } from '@agoric/orchestration/src/utils/permit2.js';
16
16
  declare const YMAX_DOMAIN_NAME = "Ymax";
17
17
  declare const YMAX_DOMAIN_VERSION = "1";
@@ -52,10 +52,39 @@ declare const PortfolioStandaloneTypeParams: [{
52
52
  * The set of portfolio operations supported by EVM Wallets, and their associated params
53
53
  */
54
54
  declare const OperationTypes: {
55
+ /**
56
+ * Open a portfolio, optionally in the same signed message enabling
57
+ * auto-features and/or granting portfolio permissions to an automation
58
+ * agent's Agoric address, now that `features`/`grantee` can be marked
59
+ * `optional` in the EIP-712 type definition. This is the preferred,
60
+ * general form of the former separate {@link OpenPortfolioWithAutoFeatures}
61
+ * / {@link OpenPortfolioWithGrant} operations, which remain supported as
62
+ * distinct operation types for backward compatibility with existing
63
+ * clients/messages, but should not be needed for new callers. Granting
64
+ * delivers the delegation to `grantee.address`, exactly as a standalone
65
+ * {@link Grant} would; enabling auto-features behaves exactly as a
66
+ * standalone {@link SetAutoFeatures} would.
67
+ *
68
+ * - allocations: initial target allocation across instruments
69
+ * - features: auto-features to enable on open, if any
70
+ * - grantee: delegation recipient and encoded portfolio permissions, if any
71
+ */
55
72
  readonly OpenPortfolio: readonly [{
56
73
  readonly name: "allocations";
57
74
  readonly type: "Allocation[]";
75
+ }, {
76
+ readonly name: "features";
77
+ readonly type: "PortfolioAutoFeatures";
78
+ readonly optional: true;
79
+ }, {
80
+ readonly name: "grantee";
81
+ readonly type: "DelegationGrantee";
82
+ readonly optional: true;
58
83
  }];
84
+ /**
85
+ * @deprecated prefer {@link OpenPortfolio} with its optional `features`
86
+ * field. Kept as a distinct operation type for backward compatibility.
87
+ */
59
88
  readonly OpenPortfolioWithAutoFeatures: readonly [{
60
89
  readonly name: "allocations";
61
90
  readonly type: "Allocation[]";
@@ -64,18 +93,8 @@ declare const OperationTypes: {
64
93
  readonly type: "PortfolioAutoFeatures";
65
94
  }];
66
95
  /**
67
- * Open a portfolio and, in the same signed message, grant portfolio
68
- * permissions to an automation agent's Agoric address. This collapses the
69
- * former two-step "create portfolio" + "Grant" flow into a single user
70
- * signature: the contract creates the portfolio with the given allocations
71
- * and then delivers the delegation to `grantee.address`, exactly as a
72
- * standalone {@link Grant} would.
73
- *
74
- * Like {@link OpenPortfolio}, this is a permit2-wrapped (funds-bearing)
75
- * operation; the accompanying Permit2 supplies the initial deposit.
76
- *
77
- * - allocations: initial target allocation across instruments
78
- * - grantee: delegation recipient and encoded portfolio permissions
96
+ * @deprecated prefer {@link OpenPortfolio} with its optional `grantee`
97
+ * field. Kept as a distinct operation type for backward compatibility.
79
98
  */
80
99
  readonly OpenPortfolioWithGrant: readonly [{
81
100
  readonly name: "allocations";
@@ -164,6 +183,14 @@ declare const OperationSubTypes: {
164
183
  readonly PortfolioPermissions: readonly [{
165
184
  readonly name: "allocation";
166
185
  readonly type: "bool";
186
+ }, {
187
+ readonly name: "rebalance";
188
+ readonly type: "bool";
189
+ readonly optional: true;
190
+ }, {
191
+ readonly name: "claimRewards";
192
+ readonly type: "bool";
193
+ readonly optional: true;
167
194
  }];
168
195
  readonly DelegationGrantee: readonly [{
169
196
  readonly name: "address";
@@ -172,10 +199,20 @@ declare const OperationSubTypes: {
172
199
  readonly name: "permissions";
173
200
  readonly type: "PortfolioPermissions";
174
201
  }];
175
- /** @see {@link PortfolioAutoFeatures} */
202
+ /**
203
+ * @see {@link PortfolioAutoFeatures}
204
+ *
205
+ * Both fields are `optional` so a `SetAutoFeatures` message can flip a
206
+ * single feature while leaving the other at its current on-chain value.
207
+ */
176
208
  readonly PortfolioAutoFeatures: readonly [{
177
209
  readonly name: "rebalance";
178
210
  readonly type: "bool";
211
+ readonly optional: true;
212
+ }, {
213
+ readonly name: "claimRewards";
214
+ readonly type: "bool";
215
+ readonly optional: true;
179
216
  }];
180
217
  };
181
218
  /**
@@ -187,9 +224,9 @@ declare const OperationSubTypes: {
187
224
  * - [{instrument: 'A', portion: 60}, {instrument: 'B', portion: 40}] => 60:40 ratio
188
225
  * - [{instrument: 'A', portion: 6}, {instrument: 'B', portion: 4}] => 6:4 ratio (same as 60:40)
189
226
  */
190
- export type TargetAllocation = TypedDataToPrimitiveTypes<typeof OperationSubTypes>['Allocation'];
191
- export type PortfolioPermissionsEIP712 = TypedDataToPrimitiveTypes<typeof OperationSubTypes>['PortfolioPermissions'];
192
- export type PortfolioAutoFeaturesEIP712 = TypedDataToPrimitiveTypes<typeof OperationSubTypes>['PortfolioAutoFeatures'];
227
+ export type TargetAllocation = TypedDataToStructType<typeof OperationSubTypes, 'Allocation'>;
228
+ export type PortfolioPermissionsEIP712 = TypedDataToStructType<typeof OperationSubTypes, 'PortfolioPermissions'>;
229
+ export type PortfolioAutoFeaturesEIP712 = TypedDataToStructType<typeof OperationSubTypes, 'PortfolioAutoFeatures'>;
193
230
  /**
194
231
  * In the wrapped case, the domain is fixed by permit2, so we can't choose name/version there.
195
232
  * so we put the ymax-specifc domain name and version in the type name.
@@ -216,14 +253,43 @@ type YmaxStandaloneOperationTypes<T extends OperationTypeNames = OperationTypeNa
216
253
  type YmaxStandaloneTypes<T extends OperationTypeNames = OperationTypeNames> = YmaxStandaloneOperationTypes<T> & typeof OperationSubTypes & {
217
254
  EIP712Domain: typeof StandaloneDomainTypeParams;
218
255
  };
219
- export type YmaxOperationType<T extends OperationTypeNames> = TypedDataToPrimitiveTypes<OperationTypes & typeof OperationSubTypes>[T];
220
- type YmaxWitnessData<T extends OperationTypeNames> = TypedDataToPrimitiveTypes<YmaxWitnessTypes<T>>[YmaxWitnessTypeParam<T>['type']];
221
- type YmaxStandaloneData<T extends OperationTypeNames> = TypedDataToPrimitiveTypes<YmaxStandaloneTypes<T>>[T];
256
+ export type YmaxOperationType<T extends OperationTypeNames> = TypedDataToStructType<OperationTypes & typeof OperationSubTypes, T>;
257
+ type YmaxWitnessData<T extends OperationTypeNames> = TypedDataToStructType<YmaxWitnessTypes<T>, YmaxWitnessTypeParam<T>['type']>;
258
+ type YmaxStandaloneData<T extends OperationTypeNames> = TypedDataToStructType<YmaxStandaloneTypes<T>, T>;
222
259
  export declare const getYmaxOperationTypes: <T extends OperationTypeNames>(operation: T) => { [K in T]: {
260
+ /**
261
+ * Open a portfolio, optionally in the same signed message enabling
262
+ * auto-features and/or granting portfolio permissions to an automation
263
+ * agent's Agoric address, now that `features`/`grantee` can be marked
264
+ * `optional` in the EIP-712 type definition. This is the preferred,
265
+ * general form of the former separate {@link OpenPortfolioWithAutoFeatures}
266
+ * / {@link OpenPortfolioWithGrant} operations, which remain supported as
267
+ * distinct operation types for backward compatibility with existing
268
+ * clients/messages, but should not be needed for new callers. Granting
269
+ * delivers the delegation to `grantee.address`, exactly as a standalone
270
+ * {@link Grant} would; enabling auto-features behaves exactly as a
271
+ * standalone {@link SetAutoFeatures} would.
272
+ *
273
+ * - allocations: initial target allocation across instruments
274
+ * - features: auto-features to enable on open, if any
275
+ * - grantee: delegation recipient and encoded portfolio permissions, if any
276
+ */
223
277
  readonly OpenPortfolio: readonly [{
224
278
  readonly name: "allocations";
225
279
  readonly type: "Allocation[]";
280
+ }, {
281
+ readonly name: "features";
282
+ readonly type: "PortfolioAutoFeatures";
283
+ readonly optional: true;
284
+ }, {
285
+ readonly name: "grantee";
286
+ readonly type: "DelegationGrantee";
287
+ readonly optional: true;
226
288
  }];
289
+ /**
290
+ * @deprecated prefer {@link OpenPortfolio} with its optional `features`
291
+ * field. Kept as a distinct operation type for backward compatibility.
292
+ */
227
293
  readonly OpenPortfolioWithAutoFeatures: readonly [{
228
294
  readonly name: "allocations";
229
295
  readonly type: "Allocation[]";
@@ -232,18 +298,8 @@ export declare const getYmaxOperationTypes: <T extends OperationTypeNames>(opera
232
298
  readonly type: "PortfolioAutoFeatures";
233
299
  }];
234
300
  /**
235
- * Open a portfolio and, in the same signed message, grant portfolio
236
- * permissions to an automation agent's Agoric address. This collapses the
237
- * former two-step "create portfolio" + "Grant" flow into a single user
238
- * signature: the contract creates the portfolio with the given allocations
239
- * and then delivers the delegation to `grantee.address`, exactly as a
240
- * standalone {@link Grant} would.
241
- *
242
- * Like {@link OpenPortfolio}, this is a permit2-wrapped (funds-bearing)
243
- * operation; the accompanying Permit2 supplies the initial deposit.
244
- *
245
- * - allocations: initial target allocation across instruments
246
- * - grantee: delegation recipient and encoded portfolio permissions
301
+ * @deprecated prefer {@link OpenPortfolio} with its optional `grantee`
302
+ * field. Kept as a distinct operation type for backward compatibility.
247
303
  */
248
304
  readonly OpenPortfolioWithGrant: readonly [{
249
305
  readonly name: "allocations";
@@ -329,6 +385,14 @@ export declare const getYmaxOperationTypes: <T extends OperationTypeNames>(opera
329
385
  readonly PortfolioPermissions: readonly [{
330
386
  readonly name: "allocation";
331
387
  readonly type: "bool";
388
+ }, {
389
+ readonly name: "rebalance";
390
+ readonly type: "bool";
391
+ readonly optional: true;
392
+ }, {
393
+ readonly name: "claimRewards";
394
+ readonly type: "bool";
395
+ readonly optional: true;
332
396
  }];
333
397
  readonly DelegationGrantee: readonly [{
334
398
  readonly name: "address";
@@ -337,10 +401,20 @@ export declare const getYmaxOperationTypes: <T extends OperationTypeNames>(opera
337
401
  readonly name: "permissions";
338
402
  readonly type: "PortfolioPermissions";
339
403
  }];
340
- /** @see {@link PortfolioAutoFeatures} */
404
+ /**
405
+ * @see {@link PortfolioAutoFeatures}
406
+ *
407
+ * Both fields are `optional` so a `SetAutoFeatures` message can flip a
408
+ * single feature while leaving the other at its current on-chain value.
409
+ */
341
410
  readonly PortfolioAutoFeatures: readonly [{
342
411
  readonly name: "rebalance";
343
412
  readonly type: "bool";
413
+ readonly optional: true;
414
+ }, {
415
+ readonly name: "claimRewards";
416
+ readonly type: "bool";
417
+ readonly optional: true;
344
418
  }];
345
419
  };
346
420
  export declare const getYmaxWitness: <T extends OperationTypeNames>(operation: T, data: NoInfer<YmaxWitnessData<T>>) => Witness<YmaxWitnessTypes<T>, YmaxWitnessTypeParam<T>>;
@@ -1 +1 @@
1
- {"version":3,"file":"eip712-messages.d.ts","sourceRoot":"","sources":["eip712-messages.ts"],"names":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BAAsB,CACpC,MAAM,EAAE,eAAe,GACtB,OAAO,CAAC,MAAM,IAAI,OAAO,wBAAwB,CAWnD;AAED,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,eAAe,EACvB,sBAAsB,CAAC,EACnB,OAAO,CAAC,MAAM,CAAC,MAAM,GAAG,MAAM,EAAE,OAAO,CAAC,CAAC,GACzC,SAAS,GACZ,OAAO,CAAC,MAAM,IAAI,cAAc,CAiClC;AAED,wBAAgB,6BAA6B,CAAC,CAAC,SAAS,kBAAkB,EACxE,QAAQ,EAAE,MAAM,GACf,OAAO,CAAC,QAAQ,IAAI,CAAC,CAMvB;AAED,eAAO,MAAM,qBAAqB,GAAI,CAAC,SAAS,kBAAkB,EAChE,WAAW,GAAG,OAAO,gBAAgB,IAAI,OAAO,mBAAmB,GAAG,CAAC,EAAE;;;;;;CAqB1E,CAAC"}
@@ -10,14 +10,12 @@
10
10
  * name but with some effort this could be parametrizable
11
11
  */
12
12
 
13
-
14
-
15
-
16
-
17
-
18
-
13
+
19
14
 
20
-
15
+
16
+
17
+
18
+
21
19
  import {
22
20
 
23
21
 
@@ -26,6 +24,7 @@ import {
26
24
  TokenPermissionsComponents,
27
25
  } from '@agoric/orchestration/src/utils/permit2.js';
28
26
  import { sameEvmAddress } from '@agoric/orchestration/src/utils/address.js';
27
+ import { normalizeAndValidateEIP712Data } from '@agoric/orchestration/src/utils/viem-utils/eip712-normalize.js';
29
28
 
30
29
  const YMAX_DOMAIN_NAME = 'Ymax';
31
30
  const YMAX_DOMAIN_VERSION = '1';
@@ -70,24 +69,39 @@ const PortfolioStandaloneTypeParams = [
70
69
  * The set of portfolio operations supported by EVM Wallets, and their associated params
71
70
  */
72
71
  const OperationTypes = {
73
- OpenPortfolio: [{ name: 'allocations', type: 'Allocation[]' }],
72
+ /**
73
+ * Open a portfolio, optionally in the same signed message enabling
74
+ * auto-features and/or granting portfolio permissions to an automation
75
+ * agent's Agoric address, now that `features`/`grantee` can be marked
76
+ * `optional` in the EIP-712 type definition. This is the preferred,
77
+ * general form of the former separate {@link OpenPortfolioWithAutoFeatures}
78
+ * / {@link OpenPortfolioWithGrant} operations, which remain supported as
79
+ * distinct operation types for backward compatibility with existing
80
+ * clients/messages, but should not be needed for new callers. Granting
81
+ * delivers the delegation to `grantee.address`, exactly as a standalone
82
+ * {@link Grant} would; enabling auto-features behaves exactly as a
83
+ * standalone {@link SetAutoFeatures} would.
84
+ *
85
+ * - allocations: initial target allocation across instruments
86
+ * - features: auto-features to enable on open, if any
87
+ * - grantee: delegation recipient and encoded portfolio permissions, if any
88
+ */
89
+ OpenPortfolio: [
90
+ { name: 'allocations', type: 'Allocation[]' },
91
+ { name: 'features', type: 'PortfolioAutoFeatures', optional: true },
92
+ { name: 'grantee', type: 'DelegationGrantee', optional: true },
93
+ ],
94
+ /**
95
+ * @deprecated prefer {@link OpenPortfolio} with its optional `features`
96
+ * field. Kept as a distinct operation type for backward compatibility.
97
+ */
74
98
  OpenPortfolioWithAutoFeatures: [
75
99
  { name: 'allocations', type: 'Allocation[]' },
76
100
  { name: 'features', type: 'PortfolioAutoFeatures' },
77
101
  ],
78
102
  /**
79
- * Open a portfolio and, in the same signed message, grant portfolio
80
- * permissions to an automation agent's Agoric address. This collapses the
81
- * former two-step "create portfolio" + "Grant" flow into a single user
82
- * signature: the contract creates the portfolio with the given allocations
83
- * and then delivers the delegation to `grantee.address`, exactly as a
84
- * standalone {@link Grant} would.
85
- *
86
- * Like {@link OpenPortfolio}, this is a permit2-wrapped (funds-bearing)
87
- * operation; the accompanying Permit2 supplies the initial deposit.
88
- *
89
- * - allocations: initial target allocation across instruments
90
- * - grantee: delegation recipient and encoded portfolio permissions
103
+ * @deprecated prefer {@link OpenPortfolio} with its optional `grantee`
104
+ * field. Kept as a distinct operation type for backward compatibility.
91
105
  */
92
106
  OpenPortfolioWithGrant: [
93
107
  { name: 'allocations', type: 'Allocation[]' },
@@ -128,7 +142,15 @@ const OperationTypes = {
128
142
  { name: 'features', type: 'PortfolioAutoFeatures' },
129
143
  PortfolioIdParam,
130
144
  ],
131
- } ;
145
+ // `satisfies Record<string, readonly TypedDataParameter[]>` rather than
146
+ // abitype's own `TypedData` (whose `TypedDataParameter` is strictly
147
+ // `{name, type}`) so struct fields here can carry the repo-local `optional`
148
+ // marker without tripping excess-property checks on this literal. Downstream
149
+ // consumption (e.g. `satisfies TypedData` on values derived from `typeof
150
+ // OperationTypes`) is unaffected: those check a type reference structurally,
151
+ // and an extra optional `optional?` property doesn't break assignability to
152
+ // abitype's `TypedData`.
153
+ } ;
132
154
  ;
133
155
  ;
134
156
 
@@ -139,14 +161,26 @@ const OperationSubTypes = {
139
161
  ],
140
162
  Asset: TokenPermissionsComponents,
141
163
  /** @see {@link PortfolioPermissions} */
142
- PortfolioPermissions: [{ name: 'allocation', type: 'bool' }],
164
+ PortfolioPermissions: [
165
+ { name: 'allocation', type: 'bool' },
166
+ { name: 'rebalance', type: 'bool', optional: true },
167
+ { name: 'claimRewards', type: 'bool', optional: true },
168
+ ],
143
169
  DelegationGrantee: [
144
170
  { name: 'address', type: 'string' },
145
171
  { name: 'permissions', type: 'PortfolioPermissions' },
146
172
  ],
147
- /** @see {@link PortfolioAutoFeatures} */
148
- PortfolioAutoFeatures: [{ name: 'rebalance', type: 'bool' }],
149
- } ;
173
+ /**
174
+ * @see {@link PortfolioAutoFeatures}
175
+ *
176
+ * Both fields are `optional` so a `SetAutoFeatures` message can flip a
177
+ * single feature while leaving the other at its current on-chain value.
178
+ */
179
+ PortfolioAutoFeatures: [
180
+ { name: 'rebalance', type: 'bool', optional: true },
181
+ { name: 'claimRewards', type: 'bool', optional: true },
182
+ ],
183
+ } ;
150
184
 
151
185
  /**
152
186
  * Target allocation for portfolio positions.
@@ -157,9 +191,10 @@ const OperationSubTypes = {
157
191
  * - [{instrument: 'A', portion: 60}, {instrument: 'B', portion: 40}] => 60:40 ratio
158
192
  * - [{instrument: 'A', portion: 6}, {instrument: 'B', portion: 4}] => 6:4 ratio (same as 60:40)
159
193
  */
160
- ;
161
-
162
-
194
+ ;
195
+
196
+
197
+
163
198
  ;
164
199
 
165
200
 
@@ -167,13 +202,15 @@ const OperationSubTypes = {
167
202
 
168
203
 
169
204
 
170
- ;
171
-
172
-
205
+ ;
206
+
207
+
208
+
173
209
 
174
- ;
175
-
210
+ ;
176
211
 
212
+
213
+
177
214
 
178
215
  /**
179
216
  * In the wrapped case, the domain is fixed by permit2, so we can't choose name/version there.
@@ -234,13 +271,16 @@ const getYmaxWitnessTypeParam = (
234
271
 
235
272
 
236
273
  ;
237
-
274
+
238
275
 
239
- ;
240
-
241
-
242
- ;
243
-
276
+ ;
277
+
278
+
279
+
280
+ ;
281
+
282
+
283
+
244
284
 
245
285
  const getYmaxOperationAndSubTypes = (
246
286
 
@@ -280,12 +320,24 @@ export const getYmaxOperationTypes = (
280
320
  export const getYmaxWitness = (
281
321
  operation ,
282
322
  data ,
283
- ) =>
284
- makeWitness (
285
- data,
286
- getYmaxWitnessTypes(operation),
287
- getYmaxWitnessTypeParam(operation),
323
+ ) => {
324
+ const witnessTypeParam = getYmaxWitnessTypeParam(operation);
325
+ // Normalize away unused `optional` fields (and their now-unreferenced
326
+ // types) so that e.g. omitting `grantee`/`features` on `OpenPortfolio`
327
+ // produces a `types`/`message` pair that real EIP-712 hashing can encode.
328
+ // This is the authoring side, not adversarial input, so extra fields are
329
+ // dropped rather than rejected.
330
+ const { message, types } = normalizeAndValidateEIP712Data({
331
+ message: data ,
332
+ types: getYmaxWitnessTypes(operation),
333
+ primaryType: witnessTypeParam.type,
334
+ });
335
+ return makeWitness (
336
+ message ,
337
+ types ,
338
+ witnessTypeParam,
288
339
  );
340
+ };
289
341
 
290
342
  export const getYmaxStandaloneDomain = (
291
343
  chainId ,
@@ -304,13 +356,22 @@ export const getYmaxStandaloneOperationData = (
304
356
 
305
357
 
306
358
  ) => {
307
- const types = getYmaxStandaloneTypes(operation);
359
+ // Normalize away unused `optional` fields (and their now-unreferenced
360
+ // types) so that e.g. omitting unchanged `features` on `SetAutoFeatures`
361
+ // produces a `types`/`message` pair that real EIP-712 hashing can encode.
362
+ // This is the authoring side, not adversarial input, so extra fields are
363
+ // dropped rather than rejected.
364
+ const { message, types } = normalizeAndValidateEIP712Data({
365
+ message: data ,
366
+ types: getYmaxStandaloneTypes(operation),
367
+ primaryType: operation,
368
+ });
308
369
 
309
370
  return {
310
371
  domain: getYmaxStandaloneDomain(chainId, verifyingContract),
311
372
  types,
312
373
  primaryType: operation,
313
- message: data ,
374
+ message: message ,
314
375
  }
315
376
 
316
377
  ;
@@ -359,36 +420,38 @@ export function validateYmaxDomain(
359
420
 
360
421
  ,
361
422
  ) {
362
- const baseDomain = domain;
363
- validateYmaxDomainBase(baseDomain);
423
+ // Destructure before narrowing `domain` below, so `chainId`/`verifyingContract`
424
+ // remain accessible as independent bindings afterward.
425
+ // eslint-disable-next-line @typescript-eslint/no-unused-vars
426
+ const { name, version, chainId, verifyingContract, ...extra } = domain;
427
+ validateYmaxDomainBase(domain);
364
428
 
365
- if (
366
- typeof domain.chainId !== 'bigint' ||
367
- domain.verifyingContract === undefined
368
- ) {
429
+ if (typeof chainId !== 'bigint' || verifyingContract === undefined) {
369
430
  throw new Error(`Ymax domain must include chain ID and verifying contract`);
370
431
  }
371
432
 
372
433
  if (validContractAddresses) {
373
- const chainIdStr = String(domain.chainId);
434
+ const chainIdStr = String(chainId);
374
435
 
375
436
  if (!(chainIdStr in validContractAddresses)) {
376
- throw new Error(`Unknown chain ID in Ymax domain: ${domain.chainId}`);
437
+ throw new Error(`Unknown chain ID in Ymax domain: ${chainId}`);
377
438
  }
378
439
 
379
440
  if (
380
- !sameEvmAddress(
381
- domain.verifyingContract,
382
- validContractAddresses[chainIdStr],
383
- )
441
+ !sameEvmAddress(verifyingContract, validContractAddresses[chainIdStr])
384
442
  ) {
385
443
  throw new Error(
386
- `Invalid verifying contract for chain ID ${domain.chainId}: ${domain.verifyingContract} (expected ${validContractAddresses[chainIdStr]})`,
444
+ `Invalid verifying contract for chain ID ${chainId}: ${verifyingContract} (expected ${validContractAddresses[chainIdStr]})`,
387
445
  );
388
446
  }
389
447
  }
390
448
 
391
- // XXX: check no extra fields?
449
+ const extraKeys = Object.keys(extra);
450
+ if (extraKeys.length) {
451
+ throw new Error(
452
+ `Unexpected field(s) in Ymax domain: ${extraKeys.join(', ')}`,
453
+ );
454
+ }
392
455
  }
393
456
 
394
457
  export function validateYmaxOperationTypeName (
@@ -7,7 +7,7 @@
7
7
  */
8
8
  import type { AbiParameterToPrimitiveType, Address } from 'abitype';
9
9
  import type { getTypesForEIP712Domain } from 'viem';
10
- import type { hashStruct, isHex, recoverTypedDataAddress, validateTypedData } from 'viem/utils';
10
+ import type { hashStruct, isHex, recoverTypedDataAddress } from 'viem/utils';
11
11
  import type { encodeType, WithSignature } from '@agoric/orchestration/src/utils/viem.js';
12
12
  import { type Permit2Domain, type PermitWitnessTransferFromInputComponents } from '@agoric/orchestration/src/utils/permit2.js';
13
13
  import { type OperationTypeNames, type YmaxStandaloneOperationData, type YmaxPermitWitnessTransferFromData, type YmaxOperationType, type YmaxFullDomain } from './eip712-messages.js';
@@ -44,7 +44,6 @@ export declare const makeEVMHandlerUtils: (viemUtils: {
44
44
  isHex: typeof isHex;
45
45
  hashStruct: typeof hashStruct;
46
46
  recoverTypedDataAddress: typeof recoverTypedDataAddress;
47
- validateTypedData: typeof validateTypedData;
48
47
  encodeType: typeof encodeType;
49
48
  getTypesForEIP712Domain: typeof getTypesForEIP712Domain;
50
49
  }) => {
@@ -1 +1 @@
1
- {"version":3,"file":"message-handler-helpers.d.ts","sourceRoot":"","sources":["message-handler-helpers.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,KAAK,EAAE,2BAA2B,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AACpE,OAAO,KAAK,EAAE,uBAAuB,EAAE,MAAM,MAAM,CAAC;AACpD,OAAO,KAAK,EACV,UAAU,EACV,KAAK,EACL,uBAAuB,EAEvB,iBAA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AC,CAAC;CA0BlC,CAAC"}
@@ -14,8 +14,8 @@
14
14
 
15
15
 
16
16
 
17
-
18
17
  import { sameEvmAddress } from '@agoric/orchestration/src/utils/address.js';
18
+ import { normalizeAndValidateEIP712Data } from '@agoric/orchestration/src/utils/viem-utils/eip712-normalize.js';
19
19
  ;
20
20
 
21
21
 
@@ -82,7 +82,6 @@ export const makeEVMHandlerUtils = (viemUtils
82
82
 
83
83
 
84
84
 
85
-
86
85
 
87
86
 
88
87
  ) => {
@@ -90,21 +89,19 @@ export const makeEVMHandlerUtils = (viemUtils
90
89
  isHex,
91
90
  hashStruct,
92
91
  recoverTypedDataAddress,
93
- validateTypedData,
94
92
  encodeType,
95
93
  getTypesForEIP712Domain,
96
94
  } = viemUtils;
97
95
 
98
- for (const util of [
96
+ for (const [utilName, util] of Object.entries({
99
97
  isHex,
100
98
  hashStruct,
101
99
  recoverTypedDataAddress,
102
- validateTypedData,
103
100
  encodeType,
104
101
  getTypesForEIP712Domain,
105
- ]) {
102
+ })) {
106
103
  if (typeof util !== 'function') {
107
- throw new Error(`Expected viemUtils.${util} to be a function`);
104
+ throw new Error(`Expected viemUtils.${utilName} to be a function`);
108
105
  }
109
106
  }
110
107
 
@@ -114,10 +111,19 @@ export const makeEVMHandlerUtils = (viemUtils
114
111
 
115
112
  /**
116
113
  * Extract operation type name and data from an EIP-712 standalone Ymax typed data.
117
- * Validates that the message data satisfies the expected types for the operation,
118
- * but does not validate that the supplied data types exactly match the expected
119
- * types. In particular the message data may be a superset of the expected types,
120
- * and extra fields are included in the returned extracted details.
114
+ *
115
+ * By the time this is called, `data.message` has already been through the
116
+ * "reject anything unsigned" normalize pass (see
117
+ * `extractOperationDetailsFromDataWithAddress`), so any field here was
118
+ * actually part of what was signed. This function normalizes *and
119
+ * validates* it a second time against the types this (possibly older)
120
+ * version of the code expects for the operation: any field the signer's
121
+ * client signed but this version doesn't know about is dropped (not
122
+ * rejected -- it was signed, just not supported yet), and any `optional`
123
+ * field is resolved based on whether it's actually present in the
124
+ * message. The returned `data` is exactly the normalized/expected shape,
125
+ * never a superset of it, and is guaranteed to satisfy the expected types
126
+ * (required fields present, values of the right shape/range).
121
127
  *
122
128
  * Assumes the domain has the expected shape of a Ymax domain.
123
129
  *
@@ -145,24 +151,40 @@ export const makeEVMHandlerUtils = (viemUtils
145
151
  // eslint-disable-next-line @typescript-eslint/no-unused-vars
146
152
  const { nonce, deadline, ..._operationData } =
147
153
  standaloneData.message ;
148
- const operationData = _operationData ;
154
+ const operationData = _operationData ;
149
155
  const operation = standaloneData.primaryType;
150
- // @ts-expect-error inference issue
151
- validateTypedData({
152
- types: getYmaxOperationTypes(operation),
153
- message: operationData,
154
- primaryType: operation,
155
- });
156
- return { operation, domain, data: operationData };
156
+ const { message: normalizedData } = normalizeAndValidateEIP712Data(
157
+ {
158
+ message: operationData ,
159
+ types: getYmaxOperationTypes(operation),
160
+ primaryType: operation,
161
+ },
162
+ { onExtraField: 'drop' },
163
+ );
164
+ return {
165
+ operation,
166
+ domain,
167
+ data: normalizedData ,
168
+ };
157
169
  };
158
170
 
159
171
  /**
160
172
  * Extract operation type name and data from an EIP-712 Permit2 witness typed data.
161
173
  * Validates that the supplied types exactly match types of a permit2 message.
162
- * Validates that the witness data satisfies the expected types for the operation,
163
- * but does not validate that the supplied data types exactly match the expected
164
- * types. In particular the witness data may be a superset of the expected types,
165
- * and extra fields are included in the returned witness data.
174
+ *
175
+ * By the time this is called, `data.message`/`data.types` have already been
176
+ * through the "reject anything unsigned" normalize pass (see
177
+ * `extractOperationDetailsFromDataWithAddress`), so any field in the
178
+ * witness data here was actually part of what was signed. This function
179
+ * normalizes *and validates* it a second time against the types this
180
+ * (possibly older) version of the code expects for the operation: any
181
+ * field the signer's client signed but this version doesn't know about is
182
+ * dropped (not rejected -- it was signed, just not supported yet), and
183
+ * any `optional` field is resolved based on whether it's actually present
184
+ * in the witness data. The returned `data` is exactly the
185
+ * normalized/expected shape, never a superset of it, and is guaranteed to
186
+ * satisfy the expected types (required fields present, values of the
187
+ * right shape/range).
166
188
  *
167
189
  * Assumes the message has already been validated against the types from the data.
168
190
  * Assumes the domain has the expected shape of a permit2 domain.
@@ -183,23 +205,24 @@ export const makeEVMHandlerUtils = (viemUtils
183
205
  const witnessField = extractWitnessFieldFromTypes(permitData.types);
184
206
  const witnessData = permitData.message[
185
207
  witnessField.name
186
- ] ;
208
+ ] ;
187
209
  const { primaryType, domain } = splitWitnessFieldType(witnessField.type);
188
210
  const chainId = BigInt(data.domain.chainId);
189
211
  const operation = primaryType ;
190
212
 
191
- // Validates the witness data satisfies the expected types for the operation
192
- // @ts-expect-error inference issue
193
- validateTypedData({
194
- types: getYmaxOperationTypes(operation),
195
- message: witnessData,
196
- primaryType: operation,
197
- });
213
+ const { message: normalizedWitnessData } = normalizeAndValidateEIP712Data(
214
+ {
215
+ message: witnessData ,
216
+ types: getYmaxOperationTypes(operation),
217
+ primaryType: operation,
218
+ },
219
+ { onExtraField: 'drop' },
220
+ );
198
221
  const spender = permitData.message.spender;
199
222
  return {
200
223
  operation,
201
224
  domain: { ...domain, chainId, verifyingContract: spender },
202
- data: witnessData,
225
+ data: normalizedWitnessData ,
203
226
  };
204
227
  };
205
228
 
@@ -306,6 +329,23 @@ export const makeEVMHandlerUtils = (viemUtils
306
329
  * Validates the domain of the typed data, and optionally the verifying
307
330
  * contract and spender against the provided contract addresses.
308
331
  *
332
+ * Before anything else, the message is normalized *and validated* against
333
+ * its own (untrusted) wire-supplied `types`, rejecting any field not
334
+ * declared there: such a field was never part of the signed struct, so it
335
+ * never affected the EIP-712 hash and could have been added after signing
336
+ * without invalidating the signature. This is the AGO-874 defense. The
337
+ * same function also validates that the message actually satisfies those
338
+ * wire-supplied types (required fields present, values in range/shape),
339
+ * recursing correctly through arrays -- something real EIP-712 tooling
340
+ * (e.g. viem's `validateTypedData`) does not do. The domain is validated
341
+ * the same way, separately (its values live outside `message`).
342
+ * A *different*, later normalize pass (in
343
+ * `extractOperationDetailsFromStandaloneData` /
344
+ * `extractOperationDetailsFromPermit2WitnessData`) drops -- rather than
345
+ * rejects -- fields that were genuinely signed but aren't supported by
346
+ * this version's generated operation types; those are legitimate,
347
+ * merely unsupported (yet), not a security concern.
348
+ *
309
349
  * @param data The operation data with an `address` field of the signing owner.
310
350
  * @param contractAddresses Optionally, a set of valid contract addresses to validate against
311
351
  * @param contractAddresses.permit2 If provided, validates a permit2 based message's verifying contract
@@ -331,24 +371,42 @@ export const makeEVMHandlerUtils = (viemUtils
331
371
 
332
372
 
333
373
  ;
334
- const { nonce, deadline } = otherData.message;
335
374
 
336
375
  if (!domain) {
337
376
  throw new Error(`Missing domain in typed data`);
338
377
  }
339
- validateTypedData({
378
+
379
+ // Reject anything not part of the actual signed structure (see doc above).
380
+ const { message: signedMessage, types: signedTypes } =
381
+ normalizeAndValidateEIP712Data(
382
+ {
383
+ message: otherData.message ,
384
+ types: otherData.types,
385
+ primaryType: otherData.primaryType,
386
+ },
387
+ { onExtraField: 'throw' },
388
+ );
389
+ const signedData = {
340
390
  ...otherData,
341
- // @ts-expect-error inference issue
342
- domain,
343
- types: {
344
- ...otherData.types,
345
- // Do not trust the type definitions coming from the message for the domain
346
- EIP712Domain: getTypesForEIP712Domain({ domain }),
347
- },
391
+ message: signedMessage,
392
+ types: signedTypes,
393
+ };
394
+ const { nonce, deadline } =
395
+ signedMessage ;
396
+
397
+ // Do not trust type definitions coming from the message for the domain;
398
+ // derive them from `domain`'s own shape instead, then validate `domain`
399
+ // against that (e.g. `chainId` range, `verifyingContract` shape).
400
+ // Domain-specific checks (name/version/contract match) happen later, in
401
+ // `validateYmaxDomain`/`validatePermit2Domain`.
402
+ normalizeAndValidateEIP712Data({
403
+ message: domain ,
404
+ types: { EIP712Domain: getTypesForEIP712Domain({ domain }) },
405
+ primaryType: 'EIP712Domain',
348
406
  });
349
407
 
350
408
  if (isPermit2MessageType(data.primaryType)) {
351
- const { signature, ...permit2Data } = otherData
409
+ const { signature, ...permit2Data } = signedData
352
410
 
353
411
 
354
412
  ;
@@ -383,7 +441,7 @@ export const makeEVMHandlerUtils = (viemUtils
383
441
  deadline,
384
442
  };
385
443
  } else {
386
- const standaloneData = otherData
444
+ const standaloneData = signedData
387
445
 
388
446
 
389
447
  ;
@@ -12,6 +12,8 @@ export type PortfolioPermissions = {
12
12
  allocation?: boolean;
13
13
  /** whether the agent may trigger a rebalance using the current policy. */
14
14
  rebalance?: boolean;
15
+ /** whether the agent may trigger a claim of external protocol rewards. */
16
+ claimRewards?: boolean;
15
17
  };
16
18
  /**
17
19
  * Extensible app-level type for portfolio permissions.
@@ -35,6 +37,7 @@ export declare const PortfolioPermissionsExtShape: TypedPattern<PortfolioPermiss
35
37
  /** A set of auto-features that can be enabled for a portfolio. */
36
38
  export type PortfolioAutoFeatures = {
37
39
  rebalance?: boolean;
40
+ claimRewards?: boolean;
38
41
  };
39
42
  /**
40
43
  * Shape enforcing the current known auto-features accepted by the system.
@@ -1 +1 @@
1
- {"version":3,"file":"portfolio-permissions.d.ts","sourceRoot":"","sources":["portfolio-permissions.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,kBAAkB,CAAC;AAEnD,OAAO,KAAK,EACV,2BAA2B,EAC3B,0BAA0B,EAC3B,MAAM,iCAAiC,CAAC;AAEzC;;GAEG;AACH,MAAM,MAAM,oBAAoB,GAAG;IACjC;;;OAGG;IACH,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,0EAA0E;IAC1E,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF;;GAEG;AACH,MAAM,MAAM,uBAAuB,GAAG,oBAAoB,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC;AAE7E;;;;;GAKG;AACH,eAAO,MAAM,yBAAyB,EAAE,YAAY,CAAC,oBAAoB,CACG,CAAC;AAE7E,eAAO,MAAM,+BAA+B,EAAE,YAAY,CAAC,0BAA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AEJ;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,EAAE,YAAY,CAAC,uBAAuB,CAC9C,CAAC;AAElC,kEAAkE;AAClE,MAAM,MAAM,qBAAqB,GAAG;IAClC,SAAS,CAAC,EAAE,OAAO,CAAC;IACpB,YAAY,CAAC,EAAE,OAAO,CAAC;CACxB,CAAC;AAEF;;;GAGG;AACH,eAAO,MAAM,0BAA0B,EAAE,YAAY,CAAC,qBAAqB,CACG,CAAC;AAE/E,eAAO,MAAM,gCAAgC,EAAE,YAAY,CAAC,2BAA2B,CACT,CAAC;AAE/E,uEAAuE;AACvE,MAAM,MAAM,wBAAwB,GAAG,qBAAqB,GAAG,UAAU,CAAC,GAAG,CAAC,CAAC;AAE/E,mEAAmE;AACnE,eAAO,MAAM,6BAA6B,EAAE,YAAY,CAAC,wBAAwB,CAChD,CAAC"}
@@ -17,6 +17,8 @@ import { M } from '@endo/patterns';
17
17
 
18
18
 
19
19
 
20
+
21
+
20
22
 
21
23
 
22
24
  /**
@@ -31,10 +33,22 @@ import { M } from '@endo/patterns';
31
33
  * grant paths may still require specific permissions before creating a grant.
32
34
  */
33
35
  export const PortfolioPermissionsShape =
34
- M.splitRecord({}, { allocation: M.boolean(), rebalance: M.boolean() }, {});
36
+ M.splitRecord(
37
+ {},
38
+ {
39
+ allocation: M.boolean(),
40
+ rebalance: M.boolean(),
41
+ claimRewards: M.boolean(),
42
+ },
43
+ {},
44
+ );
35
45
 
36
46
  export const PortfolioPermissionsEIP712Shape =
37
- M.splitRecord({ allocation: M.boolean() });
47
+ M.splitRecord(
48
+ { allocation: M.boolean() },
49
+ { rebalance: M.boolean(), claimRewards: M.boolean() },
50
+ {},
51
+ );
38
52
 
39
53
  /**
40
54
  * Extensible app-level shape for portfolio permissions.
@@ -48,6 +62,7 @@ export const PortfolioPermissionsExtShape
48
62
  /** A set of auto-features that can be enabled for a portfolio. */
49
63
  ;
50
64
 
65
+
51
66
 
52
67
 
53
68
  /**
@@ -55,10 +70,10 @@ export const PortfolioPermissionsExtShape
55
70
  * Changes to this shape should be backward compatible.
56
71
  */
57
72
  export const PortfolioAutoFeaturesShape =
58
- M.splitRecord({}, { rebalance: M.boolean() }, {});
73
+ M.splitRecord({}, { rebalance: M.boolean(), claimRewards: M.boolean() }, {});
59
74
 
60
75
  export const PortfolioAutoFeaturesEIP712Shape =
61
- M.splitRecord({ rebalance: M.boolean() });
76
+ M.splitRecord({}, { rebalance: M.boolean(), claimRewards: M.boolean() }, {});
62
77
 
63
78
  /** Extensible type compatible with future auto-features definitions */
64
79
  ;
@@ -1,6 +1,6 @@
1
1
  import type { TypedPattern } from '@agoric/internal';
2
2
  import type { BeefyInstrumentId, ChainTokenMetadata, ERC4626InstrumentId, TokenMetadata } from './places.js';
3
- import type { DepositFromChainRef, LocalChainAccountRef, PortfolioAgentKey, InterChainAccountRef, WithdrawToChainRef } from './types.js';
3
+ import type { DepositFromChainRef, LocalChainAccountRef, PortfolioAgentKey, InterChainAccountRef, PortfolioDelegatedClaimRewardsParams, PortfolioDelegatedRebalanceParams, PortfolioSyncState, WithdrawToChainRef } from './types.js';
4
4
  export { isInstrumentId, makeTokenIdKey } from './places.js';
5
5
  export type { ChainTokenMetadata, ChainTokenMetadataEntry, TokenIdKey, TokenMetadata, } from './places.js';
6
6
  export declare const TokenUsageShape: import("@endo/patterns").MatcherOf<"or", ["swapFrom", "swapTo"]>;
@@ -44,4 +44,7 @@ export declare const isBeefyInstrumentId: (ref: string) => ref is BeefyInstrumen
44
44
  export declare const PortfolioAgentKeyShape: TypedPattern<PortfolioAgentKey>;
45
45
  /** The shape for the optional `agentMemo` field for flows started by an agent */
46
46
  export declare const PortfolioFlowAgentMemoShape: TypedPattern<string>;
47
+ export declare const PortfolioSyncStateShape: TypedPattern<PortfolioSyncState>;
48
+ export declare const PortfolioDelegatedRebalanceParamsShape: TypedPattern<PortfolioDelegatedRebalanceParams>;
49
+ export declare const PortfolioDelegatedClaimRewardsParamsShape: TypedPattern<PortfolioDelegatedClaimRewardsParams>;
47
50
  //# sourceMappingURL=type-guards.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"type-guards.d.ts","sourceRoot":"","sources":["type-guards.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AAErD,OAAO,KAAK,EACV,iBAAiB,EACjB,kBAAkB,EAClB,mBAAmB,EACnB,aAAa,EACd,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EACV,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,EACjB,oBAAoB,EACpB,kBAAkB,EACnB,MAAM,YAAY,CAAC;AAEpB,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;AAC7D,YAAY,EACV,kBAAkB,EAClB,uBAAuB,EACvB,UAAU,EACV,aAAa,GACd,MAAM,aAAa,CAAC;AAErB,eAAO,MAAM,eAAe,kEAA6B,CAAC;AAG1D,eAAO,MAAM,kBAAkB,EAAE,YAAY,CAAC,aAAa,CAW1D,CAAC;AAGF,eAAO,MAAM,uBAAuB,EAAE,YAAY,CAAC,kBAAkB,CAWlE,CAAC;AAGJ;;;GAGG;AACH,eAAO,MAAM,qBAAqB,GAChC,KAAK,MAAM,KACV,GAAG,IAAI,mBAA0C,CAAC;AAGrD;;;GAGG;AACH,eAAO,MAAM,sBAAsB,GACjC,KAAK,MAAM,KACV,GAAG,IAAI,oBAA2C,CAAC;AAGtD;;;GAGG;AACH,eAAO,MAAM,sBAAsB,GACjC,KAAK,MAAM,KACV,GAAG,IAAI,oBAA2C,CAAC;AAGtD;;;GAGG;AACH,eAAO,MAAM,oBAAoB,GAAI,KAAK,MAAM,KAAG,GAAG,IAAI,kBACrC,CAAC;AAGtB;;;GAGG;AACH,eAAO,MAAM,qBAAqB,GAChC,KAAK,MAAM,KACV,GAAG,IAAI,mBAAiD,CAAC;AAG5D;;;GAGG;AACH,eAAO,MAAM,2BAA2B,GACtC,KAAK,MAAM,KACV,GAAG,I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GAGG;AACH,eAAO,MAAM,oBAAoB,GAAI,KAAK,MAAM,KAAG,GAAG,IAAI,kBACrC,CAAC;AAGtB;;;GAGG;AACH,eAAO,MAAM,qBAAqB,GAChC,KAAK,MAAM,KACV,GAAG,IAAI,mBAAiD,CAAC;AAG5D;;;GAGG;AACH,eAAO,MAAM,2BAA2B,GACtC,KAAK,MAAM,KACV,GAAG,IAAI,mBAAuD,CAAC;AAGlE;;;GAGG;AACH,eAAO,MAAM,mBAAmB,GAAI,KAAK,MAAM,KAAG,GAAG,IAAI,iBAC/B,CAAC;AAG3B,eAAO,MAAM,sBAAsB,EAAE,YAAY,CAAC,iBAAiB,CACvD,CAAC;AAEb,iFAAiF;AACjF,eAAO,MAAM,2BAA2B,EAAE,YAAY,CAAC,MAAM,CAE3D,CAAC;AAEH,eAAO,MAAM,uBAAuB,EAAE,YAAY,CAAC,kBAAkB,CAIjE,CAAC;AAEL,eAAO,MAAM,sCAAsC,EAAE,YAAY,CAAC,iCAAiC,CAKhG,CAAC;AAEJ,eAAO,MAAM,yCAAyC,EAAE,YAAY,CAAC,oCAAoC,CAKtG,CAAC"}
@@ -11,6 +11,9 @@ import { M } from '@endo/patterns';
11
11
 
12
12
 
13
13
 
14
+
15
+
16
+
14
17
 
15
18
 
16
19
 
@@ -121,3 +124,23 @@ export const PortfolioAgentKeyShape =
121
124
  export const PortfolioFlowAgentMemoShape = M.string({
122
125
  stringLengthLimit: 64,
123
126
  });
127
+
128
+ export const PortfolioSyncStateShape =
129
+ M.splitRecord({
130
+ policyVersion: M.number(),
131
+ rebalanceCount: M.number(),
132
+ });
133
+
134
+ export const PortfolioDelegatedRebalanceParamsShape =
135
+ M.splitRecord(
136
+ { syncState: PortfolioSyncStateShape },
137
+ { agentMemo: PortfolioFlowAgentMemoShape },
138
+ {},
139
+ );
140
+
141
+ export const PortfolioDelegatedClaimRewardsParamsShape =
142
+ M.splitRecord(
143
+ { syncState: PortfolioSyncStateShape },
144
+ { agentMemo: PortfolioFlowAgentMemoShape },
145
+ {},
146
+ );
package/src/types.d.ts CHANGED
@@ -110,6 +110,10 @@ export type FlowDetail = {
110
110
  type: 'rebalance';
111
111
  agent?: PortfolioAgentKey;
112
112
  agentMemo?: string;
113
+ } | {
114
+ type: 'claimRewards';
115
+ agent?: PortfolioAgentKey;
116
+ agentMemo?: string;
113
117
  };
114
118
  /** linked list of concurrent failures, including dependencies */
115
119
  export type FlowErrors = {
@@ -384,6 +388,10 @@ export type PortfolioDelegatedRebalanceParams = {
384
388
  syncState: PortfolioSyncState;
385
389
  agentMemo?: string;
386
390
  };
391
+ export type PortfolioDelegatedClaimRewardsParams = {
392
+ syncState: PortfolioSyncState;
393
+ agentMemo?: string;
394
+ };
387
395
  export type PortfolioDelegatedSetTargetAllocationParams = {
388
396
  syncState: PortfolioSyncState;
389
397
  targetAllocation: TargetAllocation;
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAC9C,OAAO,EACL,KAAK,SAAS,EACd,KAAK,aAAa,EAClB,KAAK,WAAW,EAChB,KAAK,kBAAkB,EACvB,KAAK,YAAY,EAClB,MAAM,uBAAuB,CAAC;AAK/B,OAAO,KAAK,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,SAAS,CAAC;AACrD,OAAO,KAAK,EACV,WAAW,EACX,cAAc,EACd,aAAa,EACb,qBAAqB,IAAI,0BAA0B,EACpD,MAAM,gBAAgB,CAAC;AACxB,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,kBAAkB,CAAC;AACrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AACjD,OAAO,KAAK,EAAE,eAAe,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AACrE,OAAO,KAAK,EACV,wBAAwB,EACxB,uBAAuB,EACxB,MAAM,4BAA4B,CAAC;AAEpC;;GAEG;AACH,MA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