@agoric/portfolio-api 0.1.1-dev-5557f72.0.5557f72 → 0.1.1-dev-26e3caa.0.26e3caa

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-5557f72.0.5557f72",
3
+ "version": "0.1.1-dev-26e3caa.0.26e3caa",
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-5557f72.0.5557f72",
50
- "@agoric/orchestration": "0.1.1-dev-5557f72.0.5557f72",
49
+ "@agoric/internal": "0.3.3-dev-26e3caa.0.26e3caa",
50
+ "@agoric/orchestration": "0.1.1-dev-26e3caa.0.26e3caa",
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": "5557f72dfafe087888823d9caa42b0e1d9064cb8"
76
+ "gitHead": "26e3caa298776bab11a4ac596eac73cdb5bb4ebf"
77
77
  }
@@ -15,6 +15,15 @@ export type YmaxOperationDetails<T extends OperationTypeNames = OperationTypeNam
15
15
  [P in T]: {
16
16
  operation: P;
17
17
  domain: YmaxFullDomain;
18
+ /**
19
+ * A *lower bound* on the runtime shape, not an exact description: since
20
+ * `extractOperationDetailsFromStandaloneData` /
21
+ * `extractOperationDetailsFromPermit2WitnessData` keep (rather than
22
+ * drop) genuinely-signed fields this version doesn't recognize, `data`
23
+ * can carry extra properties beyond `YmaxOperationType<P>` at runtime.
24
+ * Consumers that must reject such fields (e.g. permission records)
25
+ * need to validate that themselves against a closed shape.
26
+ */
18
27
  data: YmaxOperationType<P>;
19
28
  };
20
29
  }[T];
@@ -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,EAExB,MAAM,YAAY,CAAC;AAGpB,OAAO,KAAK,EACV,UAAU,EACV,aAAa,EACd,MAAM,yCAAyC,CAAC;AACjD,OAAO,EAML,KAAK,aAAa,EAClB,KAAK,wCAAwC,EAC9C,MAAM,4CAA4C,CAAC;AACpD,OAAO,EACL,KAAK,kBAAkB,EACvB,KAAK,2BAA2B,EAChC,KAAK,iCAAiC,EACtC,KAAK,iBAAiB,EAKtB,KAAK,cAAc,EACpB,MAAM,sBAAsB,CAAC;AAE9B,MAAM,MAAM,oBAAoB,CAC9B,CAAC,SAAS,kBAAkB,GAAG,kBAAkB,IAC/C;KACD,CAAC,IAAI,CAAC,GAAG;QACR,SAAS,EAAE,CAAC,CAAC;QACb,MAAM,EAAE,cAAc,CAAC;QACvB,IAAI,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC;KAC5B;CACF,CAAC,CAAC,CAAC,CAAC;AAEL,MAAM,MAAM,gCAAgC,GAAG,2BAA2B,CAAC;IACzE,IAAI,EAAE,OAAO,CAAC;IACd,UAAU,EAAE,OAAO,wCAAwC,CAAC;CAC7D,CAAC,CAAC;AAEH,MAAM,MAAM,aAAa,GAAG;IAC1B,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC;IACf,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,EAAE,OAAO,CAAC;IACjB,cAAc,EAAE,IAAI,CAAC,gCAAgC,EAAE,iBAAiB,CAAC,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KACA,kBAAkB,CAAC,CAAC,CAAC;4CAmHtB,CAAC,SAAS,kBAAkB,0LAEhB,aAAa,CACvB,iCAAiC,CAAC,CAAC,CAAC,GAAG,2BAA2B,CAAC,CAAC,CAAC,CACtE,GAAG;QAAE,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE,6CACkB,OAAO,CAChD,MAAM,CAAC,MAAM,GAAG,MAAM,EAAE,OAAO,CAAC,CACjC,KACA,OAAO,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC;CA0BlC,CAAC"}
@@ -47,6 +47,15 @@ import {
47
47
 
48
48
 
49
49
 
50
+
51
+
52
+
53
+
54
+
55
+
56
+
57
+
58
+
50
59
 
51
60
 
52
61
 
@@ -115,15 +124,19 @@ export const makeEVMHandlerUtils = (viemUtils
115
124
  * By the time this is called, `data.message` has already been through the
116
125
  * "reject anything unsigned" normalize pass (see
117
126
  * `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).
127
+ * actually part of what was signed. This function normalizes it a second
128
+ * time against the types this (possibly older) version of the code
129
+ * expects for the operation, resolving any `optional` field based on
130
+ * whether it's actually present in the message, but *keeps* rather than
131
+ * drops fields the signer's client signed that this version doesn't know
132
+ * about yet: dropping them would let a permissions-bearing field silently
133
+ * disappear (e.g. a not-yet-understood attenuation on a `Grant`), turning
134
+ * an attenuated grant into an unconstrained one. The returned `data` can
135
+ * therefore be a superset of the expected shape; it is guaranteed to
136
+ * satisfy the expected types (required fields present, values of the
137
+ * right shape/range), but consumers that must reject unrecognized fields
138
+ * (e.g. permission records) need to validate that themselves against a
139
+ * closed shape.
127
140
  *
128
141
  * Assumes the domain has the expected shape of a Ymax domain.
129
142
  *
@@ -159,7 +172,7 @@ export const makeEVMHandlerUtils = (viemUtils
159
172
  types: getYmaxOperationTypes(operation),
160
173
  primaryType: operation,
161
174
  },
162
- { onExtraField: 'drop' },
175
+ { onExtraField: 'keep' },
163
176
  );
164
177
  return {
165
178
  operation,
@@ -176,15 +189,18 @@ export const makeEVMHandlerUtils = (viemUtils
176
189
  * through the "reject anything unsigned" normalize pass (see
177
190
  * `extractOperationDetailsFromDataWithAddress`), so any field in the
178
191
  * 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).
192
+ * normalizes it a second time against the types this (possibly older)
193
+ * version of the code expects for the operation, resolving any `optional`
194
+ * field based on whether it's actually present in the witness data, but
195
+ * *keeps* rather than drops fields the signer's client signed that this
196
+ * version doesn't know about yet: dropping them would let a
197
+ * permissions-bearing field silently disappear (e.g. a not-yet-understood
198
+ * attenuation on a `Grant`), turning an attenuated grant into an
199
+ * unconstrained one. The returned `data` can therefore be a superset of
200
+ * the expected shape; it is guaranteed to satisfy the expected types
201
+ * (required fields present, values of the right shape/range), but
202
+ * consumers that must reject unrecognized fields (e.g. permission
203
+ * records) need to validate that themselves against a closed shape.
188
204
  *
189
205
  * Assumes the message has already been validated against the types from the data.
190
206
  * Assumes the domain has the expected shape of a permit2 domain.
@@ -216,7 +232,7 @@ export const makeEVMHandlerUtils = (viemUtils
216
232
  types: getYmaxOperationTypes(operation),
217
233
  primaryType: operation,
218
234
  },
219
- { onExtraField: 'drop' },
235
+ { onExtraField: 'keep' },
220
236
  );
221
237
  const spender = permitData.message.spender;
222
238
  return {
@@ -341,10 +357,15 @@ export const makeEVMHandlerUtils = (viemUtils
341
357
  * the same way, separately (its values live outside `message`).
342
358
  * A *different*, later normalize pass (in
343
359
  * `extractOperationDetailsFromStandaloneData` /
344
- * `extractOperationDetailsFromPermit2WitnessData`) drops -- rather than
360
+ * `extractOperationDetailsFromPermit2WitnessData`) keeps -- rather than
345
361
  * 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.
362
+ * this version's generated operation types: they were legitimately
363
+ * signed, merely not (yet) understood by this version. They are not
364
+ * dropped, because a permissions-bearing field this version doesn't
365
+ * understand yet must not silently vanish and be treated as absent (that
366
+ * would turn an attenuated grant into an unconstrained one); instead,
367
+ * downstream permission consumers validate against a closed shape and
368
+ * reject any field they don't recognize.
348
369
  *
349
370
  * @param data The operation data with an `address` field of the signing owner.
350
371
  * @param contractAddresses Optionally, a set of valid contract addresses to validate against