@agoric/zoe 0.26.3-dev-ecf2d8e.0 → 0.26.3-other-dev-70beeb7.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/CHANGELOG.md +1179 -0
- package/README.md +7 -7
- package/bundles/bundle-contractFacet-js-meta.json +319 -543
- package/bundles/bundle-contractFacet.d.ts +3 -3
- package/bundles/bundle-contractFacet.js +1 -1
- package/exported.js +1 -1
- package/package.json +23 -30
- package/src/cleanProposal.js +2 -2
- package/src/contractFacet/internal-types.d.ts +2 -2
- package/src/contractFacet/internal-types.d.ts.map +1 -1
- package/src/contractFacet/internal-types.js +1 -1
- package/src/contractFacet/types.d.ts +191 -0
- package/src/contractFacet/types.d.ts.map +1 -0
- package/src/contractFacet/types.js +256 -0
- package/src/contractFacet/vatRoot.d.ts +1 -1
- package/src/contractFacet/vatRoot.d.ts.map +1 -1
- package/src/contractFacet/zcfMint.d.ts +1 -1
- package/src/contractFacet/zcfMint.d.ts.map +1 -1
- package/src/contractFacet/zcfMint.js +1 -2
- package/src/contractFacet/zcfSeat.d.ts.map +1 -1
- package/src/contractFacet/zcfSeat.js +3 -105
- package/src/contractFacet/zcfZygote.d.ts +1 -1
- package/src/contractFacet/zcfZygote.d.ts.map +1 -1
- package/src/contractFacet/zcfZygote.js +33 -78
- package/src/contractSupport/atomicTransfer.d.ts +6 -0
- package/src/contractSupport/atomicTransfer.d.ts.map +1 -1
- package/src/contractSupport/atomicTransfer.js +90 -5
- package/src/contractSupport/bondingCurves.js +2 -2
- package/src/contractSupport/durability.d.ts +2 -2
- package/src/contractSupport/durability.d.ts.map +1 -1
- package/src/contractSupport/durability.js +3 -3
- package/src/contractSupport/priceAuthority.d.ts +1 -16
- package/src/contractSupport/priceAuthority.d.ts.map +1 -1
- package/src/contractSupport/priceAuthority.js +1 -3
- package/src/contractSupport/priceAuthorityInitial.d.ts.map +1 -1
- package/src/contractSupport/priceAuthorityInitial.js +0 -1
- package/src/contractSupport/priceAuthorityQuoteMint.d.ts +1 -1
- package/src/contractSupport/priceAuthorityQuoteMint.d.ts.map +1 -1
- package/src/contractSupport/priceAuthorityTransform.d.ts.map +1 -1
- package/src/contractSupport/priceAuthorityTransform.js +3 -2
- package/src/contractSupport/recorder.d.ts +4 -4
- package/src/contractSupport/recorder.d.ts.map +1 -1
- package/src/contractSupport/safeMath.d.ts +7 -7
- package/src/contractSupport/safeMath.d.ts.map +1 -1
- package/src/contractSupport/topics.d.ts +1 -1
- package/src/contractSupport/topics.d.ts.map +1 -1
- package/src/contractSupport/zoeHelpers.d.ts +1 -1
- package/src/contractSupport/zoeHelpers.d.ts.map +1 -1
- package/src/contractSupport/zoeHelpers.js +11 -5
- package/src/contracts/atomicSwap.d.ts +1 -1
- package/src/contracts/auction/firstPriceLogic.d.ts.map +1 -1
- package/src/contracts/auction/firstPriceLogic.js +7 -5
- package/src/contracts/auction/index.d.ts +23 -1
- package/src/contracts/auction/index.d.ts.map +1 -1
- package/src/contracts/auction/index.js +0 -1
- package/src/contracts/auction/secondPriceLogic.d.ts.map +1 -1
- package/src/contracts/auction/secondPriceLogic.js +3 -1
- package/src/contracts/automaticRefund.d.ts +3 -3
- package/src/contracts/autoswap.d.ts.map +1 -1
- package/src/contracts/autoswap.js +7 -4
- package/src/contracts/barterExchange.d.ts +2 -2
- package/src/contracts/barterExchange.d.ts.map +1 -1
- package/src/contracts/barterExchange.js +3 -2
- package/src/contracts/callSpread/calculateShares.d.ts +7 -0
- package/src/contracts/callSpread/calculateShares.d.ts.map +1 -1
- package/src/contracts/callSpread/fundedCallSpread.d.ts +1 -1
- package/src/contracts/callSpread/fundedCallSpread.d.ts.map +1 -1
- package/src/contracts/callSpread/fundedCallSpread.js +3 -1
- package/src/contracts/callSpread/payoffHandler.d.ts.map +1 -1
- package/src/contracts/callSpread/payoffHandler.js +0 -1
- package/src/contracts/callSpread/percent.d.ts +2 -0
- package/src/contracts/callSpread/percent.d.ts.map +1 -1
- package/src/contracts/callSpread/pricedCallSpread.d.ts +4 -4
- package/src/contracts/callSpread/pricedCallSpread.d.ts.map +1 -1
- package/src/contracts/callSpread/pricedCallSpread.js +3 -2
- package/src/contracts/coveredCall-durable.d.ts +3 -3
- package/src/contracts/coveredCall.d.ts +1 -1
- package/src/contracts/loan/borrow.d.ts.map +1 -1
- package/src/contracts/loan/borrow.js +3 -1
- package/src/contracts/loan/close.d.ts.map +1 -1
- package/src/contracts/loan/close.js +6 -2
- package/src/contracts/loan/index.d.ts +1 -1
- package/src/contracts/loan/liquidate.d.ts +12 -1
- package/src/contracts/loan/liquidate.d.ts.map +1 -1
- package/src/contracts/loan/liquidate.js +1 -3
- package/src/contracts/loan/scheduleLiquidation.d.ts.map +1 -1
- package/src/contracts/loan/scheduleLiquidation.js +0 -1
- package/src/contracts/loan/types.d.ts +1 -0
- package/src/contracts/loan/types.d.ts.map +1 -1
- package/src/contracts/loan/types.js +7 -0
- package/src/contracts/mintPayments.d.ts +6 -14
- package/src/contracts/mintPayments.d.ts.map +1 -1
- package/src/contracts/mintPayments.js +1 -1
- package/src/contracts/oracle.d.ts +2 -2
- package/src/contracts/oracle.d.ts.map +1 -1
- package/src/contracts/oracle.js +0 -3
- package/src/contracts/priceAggregator.d.ts +12 -2
- package/src/contracts/priceAggregator.d.ts.map +1 -1
- package/src/contracts/priceAggregator.js +2 -3
- package/src/contracts/scaledPriceAuthority.d.ts +1 -1
- package/src/contracts/scaledPriceAuthority.d.ts.map +1 -1
- package/src/contracts/scaledPriceAuthority.js +0 -2
- package/src/contracts/sellItems.d.ts +1 -1
- package/src/contracts/sellItems.d.ts.map +1 -1
- package/src/contracts/sellItems.js +3 -2
- package/src/contracts/simpleExchange.d.ts +2 -2
- package/src/instanceRecordStorage.d.ts +1 -1
- package/src/instanceRecordStorage.d.ts.map +1 -1
- package/src/internal-types.d.ts +3 -3
- package/src/internal-types.d.ts.map +1 -1
- package/src/internal-types.js +1 -1
- package/src/issuerStorage.d.ts +1 -1
- package/src/makeHandle.d.ts +1 -1
- package/src/makeHandle.d.ts.map +1 -1
- package/src/typeGuards.d.ts +20 -118
- package/src/typeGuards.d.ts.map +1 -1
- package/src/typeGuards.js +1 -7
- package/src/zoeService/escrowStorage.d.ts +1 -1
- package/src/zoeService/feeMint.d.ts +5 -5
- package/src/zoeService/feeMint.d.ts.map +1 -1
- package/src/zoeService/installationStorage.d.ts +1 -1
- package/src/zoeService/instanceAdminStorage.d.ts +2 -2
- package/src/zoeService/instanceAdminStorage.d.ts.map +1 -1
- package/src/zoeService/instanceAdminStorage.js +0 -1
- package/src/zoeService/internal-types.d.ts +2 -2
- package/src/zoeService/internal-types.d.ts.map +1 -1
- package/src/zoeService/internal-types.js +1 -1
- package/src/zoeService/makeInvitation.d.ts +1 -1
- package/src/zoeService/makeInvitation.d.ts.map +1 -1
- package/src/zoeService/offer/offer.d.ts.map +1 -1
- package/src/zoeService/offer/offer.js +3 -2
- package/src/zoeService/startInstance.d.ts +1 -1
- package/src/zoeService/startInstance.d.ts.map +1 -1
- package/src/zoeService/startInstance.js +23 -20
- package/src/zoeService/types.d.ts +1 -1
- package/src/zoeService/types.d.ts.map +1 -1
- package/src/zoeService/utils.d.ts +2 -2
- package/src/zoeService/zoe.d.ts +1 -11
- package/src/zoeService/zoe.d.ts.map +1 -1
- package/src/zoeService/zoe.js +1 -24
- package/src/zoeService/zoeSeat.d.ts +1 -1
- package/src/zoeService/zoeSeat.d.ts.map +1 -1
- package/src/zoeService/zoeSeat.js +0 -1
- package/src/zoeService/zoeStorageManager.d.ts +1 -1
- package/src/zoeService/zoeStorageManager.d.ts.map +1 -1
- package/src/zoeService/zoeStorageManager.js +2 -7
- package/tools/fakePriceAuthority.d.ts.map +1 -1
- package/tools/fakePriceAuthority.js +2 -0
- package/tools/manualPriceAuthority.d.ts.map +1 -1
- package/tools/manualPriceAuthority.js +0 -1
- package/tools/manualTimer.js +1 -1
- package/tools/prepare-test-env.js +1 -1
- package/tools/priceAuthorityRegistry.d.ts +1 -1
- package/tools/priceAuthorityRegistry.d.ts.map +1 -1
- package/tools/scriptedOracle.d.ts +2 -2
- package/tools/scriptedPriceAuthority.d.ts.map +1 -1
- package/tools/scriptedPriceAuthority.js +0 -1
- package/tools/setup-zoe.d.ts +0 -5
- package/tools/setup-zoe.d.ts.map +1 -1
- package/src/contractFacet/reallocate.d.ts +0 -3
- package/src/contractFacet/reallocate.d.ts.map +0 -1
- package/src/contractFacet/reallocate.js +0 -94
- package/src/contractFacet/types-ambient.d.ts +0 -247
- package/src/contractFacet/types-ambient.js +0 -1
|
@@ -35,7 +35,7 @@ type ZoeInstanceStorageManager = {
|
|
|
35
35
|
getTerms: InstanceStateGetTerms;
|
|
36
36
|
getIssuers: InstanceRecordGetIssuers;
|
|
37
37
|
getBrands: InstanceRecordGetBrands;
|
|
38
|
-
saveIssuer:
|
|
38
|
+
saveIssuer: SaveIssuer;
|
|
39
39
|
makeZoeMint: MakeZoeMint;
|
|
40
40
|
registerFeeMint: RegisterFeeMint;
|
|
41
41
|
getInstanceRecord: GetInstanceRecord;
|
|
@@ -59,7 +59,7 @@ type ZoeInstanceStorageManager = {
|
|
|
59
59
|
* issuerStorage and escrowStorage from Zoe, and stores the
|
|
60
60
|
* instance-specific terms
|
|
61
61
|
*/
|
|
62
|
-
type MakeZoeInstanceStorageManager = (instanceBaggage: MapStore<string,
|
|
62
|
+
type MakeZoeInstanceStorageManager = (instanceBaggage: MapStore<string, unknown>, installation: Installation, customTerms: object, uncleanIssuerKeywordRecord: IssuerKeywordRecord, instance: Instance, contractBundleCap: BundleCap, instanceLabel: string) => Promise<ZoeInstanceStorageManager>;
|
|
63
63
|
type GetBundleCapForID = (id: BundleID) => Promise<BundleCap>;
|
|
64
64
|
type GetProposalShapeForInvitation = (invitationHandle: InvitationHandle) => Pattern | undefined;
|
|
65
65
|
type ZoeStorageManager = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal-types.d.ts","sourceRoot":"","sources":["internal-types.js"],"names":[],"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M,OAAO,sBAAsB,EAAE,aAAa;;;;;;;;gGAWrD,YAAY,eACZ,MAAM,8BACN,mBAAmB,YACnB,QAAQ,qBACR,SAAS,iBACT,MAAM,KACJ,QAAQ,yBAAyB,CAAC;8BAKpC,QAAQ,KACN,QAAQ,SAAS,CAAC;wDAKpB,gBAAgB,KACd,OAAO,GAAG,SAAS;;mCAKlB,6BAA6B;yBAC7B,mBAAmB;qBACnB,eAAe;sBACf,OAAO,KAAK,CAAC;mBACb,aAAa;qBACb,eAAe;iCACf,2BAA2B;oBAC3B,OAAO,YAAY,EAAE,cAAc;eACnC,SAAS;gBACT,UAAU;cACV,OAAO,SAAS,EAAE,QAAQ;oBAC1B,cAAc;oBACd,cAAc;gCACd,0BAA0B;sBAC1B,gBAAgB;wBAChB,kBAAkB;mCAClB,6BAA6B;;;;;;wCAQhC,SAAS,iBACT,MAAM,KACJ,QAAQ,OAAO,sBAAsB,EAAE,gBAAgB,CAAC;uCAK1D,aAAa,KACX,UAAU,KAAK,CAAC"}
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
* @property {InstanceStateGetTerms} getTerms
|
|
80
80
|
* @property {InstanceRecordGetIssuers} getIssuers
|
|
81
81
|
* @property {InstanceRecordGetBrands} getBrands
|
|
82
|
-
* @property {
|
|
82
|
+
* @property {SaveIssuer} saveIssuer
|
|
83
83
|
* @property {MakeZoeMint} makeZoeMint
|
|
84
84
|
* @property {RegisterFeeMint} registerFeeMint
|
|
85
85
|
* @property {GetInstanceRecord} getInstanceRecord
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export function prepareInvitationKit(baggage: MapStore<string,
|
|
1
|
+
export function prepareInvitationKit(baggage: MapStore<string, unknown>, shutdownZoeVat?: ShutdownWithFailure | undefined): {
|
|
2
2
|
invitationIssuer: Issuer<"set">;
|
|
3
3
|
invitationKit: IssuerKit<"set">;
|
|
4
4
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"makeInvitation.d.ts","sourceRoot":"","sources":["makeInvitation.js"],"names":[],"mappings":"AAgBO,
|
|
1
|
+
{"version":3,"file":"makeInvitation.d.ts","sourceRoot":"","sources":["makeInvitation.js"],"names":[],"mappings":"AAgBO,0FAFI,mBAAmB,GAAG,SAAS;;;EA4BzC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"offer.d.ts","sourceRoot":"","sources":["offer.js"],"names":[],"mappings":"AAgBO,
|
|
1
|
+
{"version":3,"file":"offer.d.ts","sourceRoot":"","sources":["offer.js"],"names":[],"mappings":"AAgBO,6DA2DN"}
|
|
@@ -24,8 +24,9 @@ export const makeOfferMethod = offerDataAccess => {
|
|
|
24
24
|
) => {
|
|
25
25
|
const invitationIssuer = offerDataAccess.getInvitationIssuer();
|
|
26
26
|
const query = makeInvitationQueryFns(invitationIssuer);
|
|
27
|
-
const { instance, description } =
|
|
28
|
-
|
|
27
|
+
const { instance, description } = await query.getInvitationDetails(
|
|
28
|
+
invitation,
|
|
29
|
+
);
|
|
29
30
|
// AWAIT ///
|
|
30
31
|
|
|
31
32
|
const instanceAdmin = await offerDataAccess.getInstanceAdmin(instance);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export function makeStartInstance(startInstanceAccess: Pick<ZoeStorageManager, 'makeZoeInstanceStorageManager' | 'unwrapInstallation'>, getZcfBundleCapP: () => ERef<BundleCap>, getBundleCapByIdNow: (id: string) => BundleCap, zoeBaggage: MapStore<string,
|
|
1
|
+
export function makeStartInstance(startInstanceAccess: Pick<ZoeStorageManager, 'makeZoeInstanceStorageManager' | 'unwrapInstallation'>, getZcfBundleCapP: () => ERef<BundleCap>, getBundleCapByIdNow: (id: string) => BundleCap, zoeBaggage: MapStore<string, unknown>): import('./utils').StartInstance;
|
|
2
2
|
export type Baggage = import('@agoric/vat-data').Baggage;
|
|
3
3
|
export type BundleCap = import('@agoric/swingset-vat').BundleCap;
|
|
4
4
|
//# sourceMappingURL=startInstance.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"startInstance.d.ts","sourceRoot":"","sources":["startInstance.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"startInstance.d.ts","sourceRoot":"","sources":["startInstance.js"],"names":[],"mappings":"AA0BO,uDANI,KAAK,iBAAiB,EAAE,+BAA+B,GAAG,oBAAoB,CAAC,oBAC/E,MAAM,KAAK,SAAS,CAAC,4BAChB,MAAM,KAAK,SAAS,0CAEvB,OAAO,SAAS,EAAE,aAAa,CAmU3C;sBA7Ua,OAAO,kBAAkB,EAAE,OAAO;wBACjC,OAAO,sBAAsB,EAAE,SAAS"}
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
/* eslint @typescript-eslint/no-floating-promises: "warn" */
|
|
2
1
|
import { E } from '@endo/eventual-send';
|
|
3
2
|
import { passStyleOf } from '@endo/marshal';
|
|
4
3
|
import {
|
|
@@ -44,12 +43,6 @@ export const makeStartInstance = (
|
|
|
44
43
|
seatHandleToZoeSeatAdmin,
|
|
45
44
|
);
|
|
46
45
|
|
|
47
|
-
const getFreshZcfBundleCap = async () => {
|
|
48
|
-
const settledBundleCap = await getZcfBundleCapP();
|
|
49
|
-
settledBundleCap !== undefined || Fail`the ZCF bundle cap was broken`;
|
|
50
|
-
return settledBundleCap;
|
|
51
|
-
};
|
|
52
|
-
|
|
53
46
|
const InstanceAdminStateShape = harden({
|
|
54
47
|
instanceStorage: M.remotable('ZoeInstanceStorageManager'),
|
|
55
48
|
instanceAdmin: M.remotable('InstanceAdmin'),
|
|
@@ -185,10 +178,12 @@ export const makeStartInstance = (
|
|
|
185
178
|
/**
|
|
186
179
|
*
|
|
187
180
|
* @param {import('@agoric/swingset-vat').VatAdminFacet} adminNode
|
|
181
|
+
* @param {*} zcfBundleCap
|
|
188
182
|
* @param {*} contractBundleCap
|
|
189
183
|
*/
|
|
190
|
-
(adminNode, contractBundleCap) => ({
|
|
184
|
+
(adminNode, zcfBundleCap, contractBundleCap) => ({
|
|
191
185
|
adminNode,
|
|
186
|
+
zcfBundleCap,
|
|
192
187
|
contractBundleCap,
|
|
193
188
|
}),
|
|
194
189
|
{
|
|
@@ -205,22 +200,22 @@ export const makeStartInstance = (
|
|
|
205
200
|
privateArgs: newPrivateArgs,
|
|
206
201
|
};
|
|
207
202
|
|
|
208
|
-
return E.
|
|
209
|
-
|
|
210
|
-
);
|
|
203
|
+
return E(state.adminNode).upgrade(state.zcfBundleCap, {
|
|
204
|
+
vatParameters,
|
|
205
|
+
});
|
|
211
206
|
},
|
|
212
207
|
async upgradeContract(contractBundleId, newPrivateArgs = undefined) {
|
|
213
208
|
const { state } = this;
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
209
|
+
const newContractBundleCap = await getBundleCapByIdNow(
|
|
210
|
+
contractBundleId,
|
|
211
|
+
);
|
|
217
212
|
const vatParameters = {
|
|
218
213
|
contractBundleCap: newContractBundleCap,
|
|
219
214
|
privateArgs: newPrivateArgs,
|
|
220
215
|
};
|
|
221
|
-
return E.
|
|
222
|
-
|
|
223
|
-
);
|
|
216
|
+
return E(state.adminNode).upgrade(state.zcfBundleCap, {
|
|
217
|
+
vatParameters,
|
|
218
|
+
});
|
|
224
219
|
},
|
|
225
220
|
},
|
|
226
221
|
);
|
|
@@ -232,8 +227,9 @@ export const makeStartInstance = (
|
|
|
232
227
|
privateArgs = undefined,
|
|
233
228
|
instanceLabel = '',
|
|
234
229
|
) => {
|
|
235
|
-
const { installation, bundle, bundleCap } =
|
|
236
|
-
|
|
230
|
+
const { installation, bundle, bundleCap } = await E(
|
|
231
|
+
startInstanceAccess,
|
|
232
|
+
).unwrapInstallation(installationP);
|
|
237
233
|
// AWAIT ///
|
|
238
234
|
|
|
239
235
|
const contractBundleCap = bundle || bundleCap;
|
|
@@ -310,6 +306,9 @@ export const makeStartInstance = (
|
|
|
310
306
|
|
|
311
307
|
instanceAdmin.initDelayedState(handleOfferObj, publicFacet);
|
|
312
308
|
|
|
309
|
+
const settledBundleCap = await getZcfBundleCapP();
|
|
310
|
+
settledBundleCap !== undefined || Fail`the bundle cap was broken`;
|
|
311
|
+
|
|
313
312
|
// creatorInvitation can be undefined, but if it is defined,
|
|
314
313
|
// let's make sure it is an invitation.
|
|
315
314
|
return E.when(
|
|
@@ -325,7 +324,11 @@ export const makeStartInstance = (
|
|
|
325
324
|
isLiveResult ||
|
|
326
325
|
Fail`The contract did not correctly return a creatorInvitation`;
|
|
327
326
|
|
|
328
|
-
const adminFacet = makeAdminFacet(
|
|
327
|
+
const adminFacet = makeAdminFacet(
|
|
328
|
+
adminNode,
|
|
329
|
+
harden(settledBundleCap),
|
|
330
|
+
contractBundleCap,
|
|
331
|
+
);
|
|
329
332
|
|
|
330
333
|
// Actually returned to the user.
|
|
331
334
|
return harden({
|
|
@@ -85,7 +85,7 @@ type GetBundleIDFromInstallation = (allegedInstallation: ERef<Installation>) =>
|
|
|
85
85
|
* values are the actual payments to be escrowed. A payment is
|
|
86
86
|
* expected for every rule under `give`.
|
|
87
87
|
*/
|
|
88
|
-
type Offer = <Args, Result>(invitation: ERef<Invitation<
|
|
88
|
+
type Offer = <Args, Result>(invitation: ERef<Invitation<Result, Args>>, proposal?: Proposal, paymentKeywordRecord?: PaymentPKeywordRecord, offerArgs?: Args | undefined) => Promise<UserSeat<Result>>;
|
|
89
89
|
/**
|
|
90
90
|
* Zoe uses seats to access or manipulate offers. They let contracts and users
|
|
91
91
|
* interact with them. Zoe has two kinds of seats. ZCFSeats are used within
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;yBAmBc,mBAAmB;aASnB,aAAa;qBACb,eAAe;mBACf,OAAO,SAAS,EAAE,aAAa;WAC/B,KAAK;oBACL,OAAO,SAAS,EAAE,cAAc;gBAChC,UAAU;eACV,SAAS;cACT,OAAO,SAAS,EAAE,QAAQ;oBAC1B,cAAc;gCACd,0BAA0B;iBAC1B,WAAW;qB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,WAAW;;;uBAKX,QAAQ;;qBAIT,OAAO,eAAe,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { Callable } from '@agoric/internal/src/utils.js';
|
|
2
|
-
import
|
|
3
|
-
import
|
|
2
|
+
import { VatUpgradeResults } from '@agoric/swingset-vat';
|
|
3
|
+
import { Baggage } from '@agoric/vat-data';
|
|
4
4
|
|
|
5
5
|
import type { IssuerKeywordRecord, Payment } from './types.js';
|
|
6
6
|
|
package/src/zoeService/zoe.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export type Baggage = import('@agoric/vat-data').Baggage;
|
|
2
2
|
export type ZoeKit = ReturnType<typeof makeDurableZoeKit>;
|
|
3
3
|
/**
|
|
4
|
-
* Create
|
|
4
|
+
* Create an durable instance of Zoe.
|
|
5
5
|
*
|
|
6
6
|
* @param {object} options
|
|
7
7
|
* @param {Baggage} options.zoeBaggage - the baggage for Zoe durability. Must be provided by caller
|
|
@@ -22,11 +22,6 @@ export function makeDurableZoeKit({ zoeBaggage, vatAdminSvc, shutdownZoeVat, fee
|
|
|
22
22
|
zcfSpec?: ZCFSpec | undefined;
|
|
23
23
|
}): {
|
|
24
24
|
zoeService: ZoeService;
|
|
25
|
-
zoeConfigFacet: {
|
|
26
|
-
updateZcfBundleId(bundleId: any): void;
|
|
27
|
-
} & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
28
|
-
updateZcfBundleId(bundleId: any): void;
|
|
29
|
-
}>;
|
|
30
25
|
/** @type {FeeMintAccess} */
|
|
31
26
|
feeMintAccess: FeeMintAccess;
|
|
32
27
|
setVatAdminService: ((lateVatAdminSvc: any) => void) & import("@endo/eventual-send").RemotableBrand<{}, (lateVatAdminSvc: any) => void>;
|
|
@@ -49,11 +44,6 @@ export function makeDurableZoeKit({ zoeBaggage, vatAdminSvc, shutdownZoeVat, fee
|
|
|
49
44
|
*/
|
|
50
45
|
export function makeZoeKit(vatAdminSvc?: import("@agoric/swingset-vat").VatAdminSvc | Promise<import("@agoric/swingset-vat").VatAdminSvc> | undefined, shutdownZoeVat?: import("@agoric/swingset-vat").ShutdownWithFailure | undefined, feeIssuerConfig?: FeeIssuerConfig | undefined, zcfSpec?: ZCFSpec | undefined): {
|
|
51
46
|
zoeService: ZoeService;
|
|
52
|
-
zoeConfigFacet: {
|
|
53
|
-
updateZcfBundleId(bundleId: any): void;
|
|
54
|
-
} & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
55
|
-
updateZcfBundleId(bundleId: any): void;
|
|
56
|
-
}>;
|
|
57
47
|
/** @type {FeeMintAccess} */
|
|
58
48
|
feeMintAccess: FeeMintAccess;
|
|
59
49
|
setVatAdminService: ((lateVatAdminSvc: any) => void) & import("@endo/eventual-send").RemotableBrand<{}, (lateVatAdminSvc: any) => void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zoe.d.ts","sourceRoot":"","sources":["zoe.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"zoe.d.ts","sourceRoot":"","sources":["zoe.js"],"names":[],"mappings":"sBA6Bc,OAAO,kBAAkB,EAAE,OAAO;qBAwOnC,WAAW,wBAAwB,CAAC;AApOjD;;;;;;;;;;;;;GAaG;AACH;IAV4B,UAAU,EAA3B,OAAO;IACsC,WAAW;IAG1B,cAAc;IAGlB,eAAe;IACvB,OAAO;;;IAoLhC,4BAA4B;mBAAjB,aAAa;;EAK3B;AAED;;;;;;;;;;;;;;;GAeG;AACH;;IAvBI,4BAA4B;mBAAjB,aAAa;;EA8BxB"}
|
package/src/zoeService/zoe.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
// @jessie-check
|
|
2
|
-
/* eslint @typescript-eslint/no-floating-promises: "warn" */
|
|
3
2
|
|
|
4
3
|
/**
|
|
5
4
|
* Zoe uses ERTP, the Electronic Rights Transfer Protocol
|
|
@@ -19,7 +18,6 @@ import '../internal-types.js';
|
|
|
19
18
|
import { E } from '@endo/eventual-send';
|
|
20
19
|
import { Far } from '@endo/marshal';
|
|
21
20
|
import { makeScalarBigMapStore, prepareExo } from '@agoric/vat-data';
|
|
22
|
-
import { M } from '@agoric/store';
|
|
23
21
|
|
|
24
22
|
import { makeZoeStorageManager } from './zoeStorageManager.js';
|
|
25
23
|
import { makeStartInstance } from './startInstance.js';
|
|
@@ -34,7 +32,7 @@ import { ZoeServiceI } from '../typeGuards.js';
|
|
|
34
32
|
const { Fail } = assert;
|
|
35
33
|
|
|
36
34
|
/**
|
|
37
|
-
* Create
|
|
35
|
+
* Create an durable instance of Zoe.
|
|
38
36
|
*
|
|
39
37
|
* @param {object} options
|
|
40
38
|
* @param {Baggage} options.zoeBaggage - the baggage for Zoe durability. Must be provided by caller
|
|
@@ -54,7 +52,6 @@ const makeDurableZoeKit = ({
|
|
|
54
52
|
feeIssuerConfig = defaultFeeIssuerConfig,
|
|
55
53
|
zcfSpec = { name: 'zcf' },
|
|
56
54
|
}) => {
|
|
57
|
-
/** @type {BundleCap} */
|
|
58
55
|
let zcfBundleCap;
|
|
59
56
|
|
|
60
57
|
const saveBundleCap = () => {
|
|
@@ -171,25 +168,6 @@ const makeDurableZoeKit = ({
|
|
|
171
168
|
});
|
|
172
169
|
};
|
|
173
170
|
|
|
174
|
-
const ZoeConfigI = M.interface('ZoeConfigFacet', {
|
|
175
|
-
updateZcfBundleId: M.call(M.string()).returns(),
|
|
176
|
-
});
|
|
177
|
-
|
|
178
|
-
const zoeConfigFacet = prepareExo(zoeBaggage, 'ZoeConfigFacet', ZoeConfigI, {
|
|
179
|
-
updateZcfBundleId(bundleId) {
|
|
180
|
-
E.when(
|
|
181
|
-
getZcfBundleCap({ id: bundleId }, vatAdminSvc),
|
|
182
|
-
bundleCap => {
|
|
183
|
-
zcfBundleCap = bundleCap;
|
|
184
|
-
},
|
|
185
|
-
e => {
|
|
186
|
-
console.error(`'🚨 unable to update ZCF Bundle: `, e);
|
|
187
|
-
throw e;
|
|
188
|
-
},
|
|
189
|
-
);
|
|
190
|
-
},
|
|
191
|
-
});
|
|
192
|
-
|
|
193
171
|
/** @type {ZoeService} */
|
|
194
172
|
const zoeService = prepareExo(zoeBaggage, 'ZoeService', ZoeServiceI, {
|
|
195
173
|
install(bundleId, bundleLabel) {
|
|
@@ -245,7 +223,6 @@ const makeDurableZoeKit = ({
|
|
|
245
223
|
|
|
246
224
|
return harden({
|
|
247
225
|
zoeService,
|
|
248
|
-
zoeConfigFacet,
|
|
249
226
|
/** @type {FeeMintAccess} */
|
|
250
227
|
// @ts-expect-error cast
|
|
251
228
|
feeMintAccess: feeMintKit.feeMintAccess,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export function makeZoeSeatAdminFactory(baggage: MapStore<string,
|
|
1
|
+
export function makeZoeSeatAdminFactory(baggage: MapStore<string, unknown>): (initialAllocation: AmountKeywordRecord, proposal: ProposalRecord, instanceAdminHelper: InstanceAdminHelper, withdrawFacet: WithdrawFacet, exitObj?: ERef<ExitObj> | undefined, offerResultIsUndefined?: boolean | undefined) => {
|
|
2
2
|
zoeSeatAdmin: {
|
|
3
3
|
replaceAllocation(replacementAllocation: any): void;
|
|
4
4
|
exit(completion: any): void;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zoeSeat.d.ts","sourceRoot":"","sources":["zoeSeat.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"zoeSeat.d.ts","sourceRoot":"","sources":["zoeSeat.js"],"names":[],"mappings":"AAiEO;;;;;QAgIC,wCAAwC;8DAA5B,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;QAA7B,wCAAwC;8DAA5B,iBAAiB;;;;;;;;;;;;;;;;;;;;;GAmJpC"}
|
|
@@ -2,7 +2,7 @@ export function makeZoeStorageManager(createZCFVat: CreateZCFVat, getBundleCapFo
|
|
|
2
2
|
getFeeIssuerKit: GetFeeIssuerKit;
|
|
3
3
|
getFeeIssuer: () => Issuer;
|
|
4
4
|
getFeeBrand: () => Brand;
|
|
5
|
-
}, zoeBaggage: MapStore<string,
|
|
5
|
+
}, zoeBaggage: MapStore<string, unknown>): {
|
|
6
6
|
zoeServiceDataAccess: {
|
|
7
7
|
getInvitationIssuer: () => Issuer<"set">;
|
|
8
8
|
getBundleIDFromInstallation(allegedInstallation: any): any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zoeStorageManager.d.ts","sourceRoot":"","sources":["zoeStorageManager.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"zoeStorageManager.d.ts","sourceRoot":"","sources":["zoeStorageManager.js"],"names":[],"mappings":"AAmDO,oDAXI,YAAY,qBAEZ,iBAAiB,kBACjB,mBAAmB,WACnB;IACV,eAAoB,EAAE,eAAe,CAAC;IACtC,YAAiB,EAAE,MAAM,MAAM,CAAC;IAChC,WAAgB,EAAE,MAAM,KAAK,CAAC;CAC3B;;;;;;;;;;;;;;;;;;;;;;;QA+ZI,iCAAiC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAAjC,iCAAiC;;;;;;;;;;;GAYxC;sBAjca,OAAO,kBAAkB,EAAE,OAAO"}
|
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import { E } from '@endo/far';
|
|
2
|
-
import {
|
|
3
|
-
AssetKind,
|
|
4
|
-
makeDurableIssuerKit,
|
|
5
|
-
AmountMath,
|
|
6
|
-
prepareIssuerKit,
|
|
7
|
-
} from '@agoric/ertp';
|
|
2
|
+
import { AssetKind, makeDurableIssuerKit, AmountMath } from '@agoric/ertp';
|
|
8
3
|
import {
|
|
9
4
|
makeScalarBigMapStore,
|
|
10
5
|
provideDurableWeakMapStore,
|
|
@@ -122,7 +117,7 @@ export const makeZoeStorageManager = (
|
|
|
122
117
|
'zoeMintBaggageSet',
|
|
123
118
|
);
|
|
124
119
|
for (const issuerBaggage of zoeMintBaggageSet.values()) {
|
|
125
|
-
|
|
120
|
+
zoeMintBaggageSet(issuerBaggage);
|
|
126
121
|
}
|
|
127
122
|
|
|
128
123
|
const makeZoeMint = prepareExoClass(
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fakePriceAuthority.d.ts","sourceRoot":"","sources":["fakePriceAuthority.js"],"names":[],"mappings":"AAsBA;;;;;;;;;;GAUG;AAEH;;;;;;GAMG;AACH,gDAHW,yBAAyB,GACvB,QAAQ,cAAc,CAAC,
|
|
1
|
+
{"version":3,"file":"fakePriceAuthority.d.ts","sourceRoot":"","sources":["fakePriceAuthority.js"],"names":[],"mappings":"AAsBA;;;;;;;;;;GAUG;AAEH;;;;;;GAMG;AACH,gDAHW,yBAAyB,GACvB,QAAQ,cAAc,CAAC,CAsSnC;;mBArTa,MAAM,KAAK,CAAC;oBACZ,MAAM,KAAK,CAAC;;;WAGZ,KAAK,OAAO,wBAAwB,EAAE,YAAY,CAAC"}
|
|
@@ -254,8 +254,10 @@ export async function makeFakePriceAuthority(options) {
|
|
|
254
254
|
async function* generateQuotes(amountIn, brandOut) {
|
|
255
255
|
let record = await ticker.getUpdateSince();
|
|
256
256
|
while (record.updateCount !== undefined) {
|
|
257
|
+
// eslint-disable-next-line no-await-in-loop
|
|
257
258
|
const { value: timestamp } = record; // = await E(timer).getCurrentTimestamp();
|
|
258
259
|
yield priceInQuote(amountIn, brandOut, timestamp);
|
|
260
|
+
// eslint-disable-next-line no-await-in-loop
|
|
259
261
|
record = await ticker.getUpdateSince(record.updateCount);
|
|
260
262
|
}
|
|
261
263
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manualPriceAuthority.d.ts","sourceRoot":"","sources":["manualPriceAuthority.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"manualPriceAuthority.d.ts","sourceRoot":"","sources":["manualPriceAuthority.js"],"names":[],"mappings":"AAYA;;;;;;;;GAQG;AACH;IAPiC,aAAa,EAAnC,MAAM,KAAK,CAAC;IACU,cAAc,EAApC,MAAM,KAAK,CAAC;IACG,YAAY,EAA3B,KAAK;IACkD,KAAK,EAA5D,OAAO,wBAAwB,EAAE,YAAY;IAClB,cAAc;;8BACC,IAAI;EAsExD;mCACa,WAAW,+BAA+B,CAAC"}
|
package/tools/manualTimer.js
CHANGED
|
@@ -94,8 +94,8 @@ const buildManualTimer = (log = nolog, startValue = 0n, options = {}) => {
|
|
|
94
94
|
|
|
95
95
|
const tickN = async (nTimes, msg) => {
|
|
96
96
|
nTimes >= 1 || Fail`invariant nTimes >= 1`;
|
|
97
|
-
await null;
|
|
98
97
|
for (let i = 0; i < nTimes; i += 1) {
|
|
98
|
+
// eslint-disable-next-line no-await-in-loop
|
|
99
99
|
await tick(msg);
|
|
100
100
|
}
|
|
101
101
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"priceAuthorityRegistry.d.ts","sourceRoot":"","sources":["priceAuthorityRegistry.js"],"names":[],"mappings":"AA0CO
|
|
1
|
+
{"version":3,"file":"priceAuthorityRegistry.d.ts","sourceRoot":"","sources":["priceAuthorityRegistry.js"],"names":[],"mappings":"AA0CO,mFAFM,sBAAsB,CAwKlC;;YAhMa,MAAM,IAAI;;;;;;iCAKL,KAAK,cAAc,CAAC,WACf,KAAK,YACJ,KAAK,UACP,OAAO,KAAK,QAAQ,OAAO,CAAC;;;;;;;;oBAQrC,cAAc;gBACd,2BAA2B"}
|
|
@@ -17,10 +17,10 @@
|
|
|
17
17
|
export function makeScriptedOracle(script: Record<string, any>, oracleInstallation: Installation<import('../src/contracts/oracle.js').OracleStart>, timer: import('@agoric/time/src/types').TimerService, zoe: ZoeService, feeIssuer: Issuer): Promise<{
|
|
18
18
|
publicFacet: {
|
|
19
19
|
query(query: OracleQuery): Promise<unknown>;
|
|
20
|
-
makeQueryInvitation(query: OracleQuery): Promise<Invitation<
|
|
20
|
+
makeQueryInvitation(query: OracleQuery): Promise<Invitation<unknown, never>>;
|
|
21
21
|
} & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
22
22
|
query(query: OracleQuery): Promise<unknown>;
|
|
23
|
-
makeQueryInvitation(query: OracleQuery): Promise<Invitation<
|
|
23
|
+
makeQueryInvitation(query: OracleQuery): Promise<Invitation<unknown, never>>;
|
|
24
24
|
}>;
|
|
25
25
|
creatorFacet: OracleCreatorFacet;
|
|
26
26
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scriptedPriceAuthority.d.ts","sourceRoot":"","sources":["scriptedPriceAuthority.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"scriptedPriceAuthority.d.ts","sourceRoot":"","sources":["scriptedPriceAuthority.js"],"names":[],"mappings":"AAUA,yEAoFC"}
|
package/tools/setup-zoe.d.ts
CHANGED
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
export function makeZoeKitForTest(vatAdminSvc?: import("@agoric/swingset-vat").VatAdminSvc | undefined): {
|
|
2
2
|
zoeService: ZoeService;
|
|
3
|
-
zoeConfigFacet: {
|
|
4
|
-
updateZcfBundleId(bundleId: any): void;
|
|
5
|
-
} & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
6
|
-
updateZcfBundleId(bundleId: any): void;
|
|
7
|
-
}>;
|
|
8
3
|
feeMintAccess: FeeMintAccess;
|
|
9
4
|
setVatAdminService: ((lateVatAdminSvc: any) => void) & import("@endo/eventual-send").RemotableBrand<{}, (lateVatAdminSvc: any) => void>;
|
|
10
5
|
};
|
package/tools/setup-zoe.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup-zoe.d.ts","sourceRoot":"","sources":["setup-zoe.js"],"names":[],"mappings":"AASO
|
|
1
|
+
{"version":3,"file":"setup-zoe.d.ts","sourceRoot":"","sources":["setup-zoe.js"],"names":[],"mappings":"AASO;;;;EAKN;AAKM,iHACoC;AAYpC;IAL+B,MAAM,gBAArB,IAAI;IACU,eAAe;IACnB,WAAW;IACf,aAAa;;;;;;;;;;;;;;;;;;GA+BzC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"reallocate.d.ts","sourceRoot":"","sources":["reallocate.js"],"names":[],"mappings":"AAiBO,6CAHI,mBAAmB,GACjB,CAAC,OAAO,EAAE,mBAAmB,CAAC,EAAE,CA8E5C;8BAtFa,MAAM,mBAAmB,CAAC"}
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import { makeScalarMapStore } from '@agoric/vat-data';
|
|
2
|
-
|
|
3
|
-
import { assertRightsConserved } from './rightsConservation.js';
|
|
4
|
-
import { addToAllocation, subtractFromAllocation } from './allocationMath.js';
|
|
5
|
-
|
|
6
|
-
const { Fail } = assert;
|
|
7
|
-
|
|
8
|
-
/** @typedef {Array<AmountKeywordRecord>} TransactionList */
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Convert from a list of transfer descriptions ([fromSeat, toSeat, fromAmount,
|
|
12
|
-
* toAmount], with many parts optional) to a list of resulting allocations for
|
|
13
|
-
* each of the seats mentioned.
|
|
14
|
-
*
|
|
15
|
-
* @param {Array<TransferPart>} transfers
|
|
16
|
-
* @returns {[ZCFSeat, AmountKeywordRecord][]}
|
|
17
|
-
*/
|
|
18
|
-
export const makeAllocationMap = transfers => {
|
|
19
|
-
/** @type {MapStore<ZCFSeat, [TransactionList, TransactionList]>} */
|
|
20
|
-
const allocations = makeScalarMapStore();
|
|
21
|
-
|
|
22
|
-
const getAllocations = seat => {
|
|
23
|
-
if (allocations.has(seat)) {
|
|
24
|
-
return allocations.get(seat);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
/** @type {[TransactionList, TransactionList]} */
|
|
28
|
-
const pair = [[], []];
|
|
29
|
-
allocations.init(seat, pair);
|
|
30
|
-
return pair;
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
const decrementAllocation = (seat, decrement) => {
|
|
34
|
-
const [incr, decr] = getAllocations(seat);
|
|
35
|
-
|
|
36
|
-
const newDecr = [...decr, decrement];
|
|
37
|
-
allocations.set(seat, [incr, newDecr]);
|
|
38
|
-
};
|
|
39
|
-
|
|
40
|
-
const incrementAllocation = (seat, increment) => {
|
|
41
|
-
const [incr, decr] = getAllocations(seat);
|
|
42
|
-
|
|
43
|
-
const newIncr = [...incr, increment];
|
|
44
|
-
allocations.set(seat, [newIncr, decr]);
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
for (const [fromSeat, toSeat, fromAmounts, toAmounts] of transfers) {
|
|
48
|
-
if (fromSeat) {
|
|
49
|
-
if (!fromAmounts) {
|
|
50
|
-
throw Fail`Transfer from ${fromSeat} must say how much`;
|
|
51
|
-
}
|
|
52
|
-
decrementAllocation(fromSeat, fromAmounts);
|
|
53
|
-
if (toSeat) {
|
|
54
|
-
// Conserved transfer between seats
|
|
55
|
-
if (toAmounts) {
|
|
56
|
-
// distinct amounts, so we check conservation.
|
|
57
|
-
assertRightsConserved(
|
|
58
|
-
Object.values(fromAmounts),
|
|
59
|
-
Object.values(toAmounts),
|
|
60
|
-
);
|
|
61
|
-
incrementAllocation(toSeat, toAmounts);
|
|
62
|
-
} else {
|
|
63
|
-
// fromAmounts will be used for toAmounts as well
|
|
64
|
-
incrementAllocation(toSeat, fromAmounts);
|
|
65
|
-
}
|
|
66
|
-
} else {
|
|
67
|
-
// Transfer only from fromSeat
|
|
68
|
-
!toAmounts ||
|
|
69
|
-
Fail`Transfer without toSeat cannot have toAmounts ${toAmounts}`;
|
|
70
|
-
}
|
|
71
|
-
} else {
|
|
72
|
-
toSeat || Fail`Transfer must have at least one of fromSeat or toSeat`;
|
|
73
|
-
// Transfer only to toSeat
|
|
74
|
-
!fromAmounts ||
|
|
75
|
-
Fail`Transfer without fromSeat cannot have fromAmounts ${fromAmounts}`;
|
|
76
|
-
toAmounts || Fail`Transfer to ${toSeat} must say how much`;
|
|
77
|
-
incrementAllocation(toSeat, toAmounts);
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/** @type {[ZCFSeat,AmountKeywordRecord][]} */
|
|
82
|
-
const resultingAllocations = [];
|
|
83
|
-
for (const [seat, [incrList, decrList]] of allocations.entries()) {
|
|
84
|
-
let newAlloc = seat.getCurrentAllocation();
|
|
85
|
-
for (const incr of incrList) {
|
|
86
|
-
newAlloc = addToAllocation(newAlloc, incr);
|
|
87
|
-
}
|
|
88
|
-
for (const decr of decrList) {
|
|
89
|
-
newAlloc = subtractFromAllocation(newAlloc, decr);
|
|
90
|
-
}
|
|
91
|
-
resultingAllocations.push([seat, newAlloc]);
|
|
92
|
-
}
|
|
93
|
-
return resultingAllocations;
|
|
94
|
-
};
|