@agoric/zoe 0.26.3-upgrade-14-dev-c8f9e7b.0 → 0.26.3-upgrade-16-dev-8879538.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/README.md +7 -7
- package/bundles/bundle-contractFacet-js-meta.json +622 -313
- package/bundles/bundle-contractFacet.d.ts +3 -3
- package/bundles/bundle-contractFacet.js +1 -1
- package/exported.js +1 -12
- package/package.json +75 -60
- package/src/cleanProposal.d.ts +2 -2
- package/src/cleanProposal.d.ts.map +1 -1
- package/src/cleanProposal.js +15 -12
- package/src/contractFacet/exit.d.ts.map +1 -1
- package/src/contractFacet/exit.js +1 -0
- 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/offerHandlerStorage.d.ts +4 -1
- package/src/contractFacet/offerHandlerStorage.d.ts.map +1 -1
- package/src/contractFacet/offerHandlerStorage.js +11 -3
- package/src/contractFacet/reallocate.d.ts +3 -0
- package/src/contractFacet/reallocate.d.ts.map +1 -0
- package/src/contractFacet/reallocate.js +94 -0
- package/src/contractFacet/rightsConservation.d.ts.map +1 -1
- package/src/contractFacet/rightsConservation.js +3 -0
- package/src/contractFacet/types-ambient.d.ts +259 -0
- package/src/contractFacet/types-ambient.js +1 -0
- package/src/contractFacet/vatRoot.d.ts +4 -4
- package/src/contractFacet/vatRoot.d.ts.map +1 -1
- package/src/contractFacet/zcfMint.d.ts +5 -3
- package/src/contractFacet/zcfMint.d.ts.map +1 -1
- package/src/contractFacet/zcfMint.js +4 -4
- package/src/contractFacet/zcfSeat.d.ts +4 -2
- package/src/contractFacet/zcfSeat.d.ts.map +1 -1
- package/src/contractFacet/zcfSeat.js +125 -5
- package/src/contractFacet/zcfZygote.d.ts +1 -2
- package/src/contractFacet/zcfZygote.d.ts.map +1 -1
- package/src/contractFacet/zcfZygote.js +95 -42
- package/src/contractSupport/atomicTransfer.d.ts +0 -6
- package/src/contractSupport/atomicTransfer.d.ts.map +1 -1
- package/src/contractSupport/atomicTransfer.js +5 -90
- package/src/contractSupport/bondingCurves.js +2 -2
- package/src/contractSupport/durability.d.ts +3 -3
- package/src/contractSupport/durability.d.ts.map +1 -1
- package/src/contractSupport/durability.js +5 -5
- package/src/contractSupport/index.d.ts +1 -0
- package/src/contractSupport/index.js +1 -0
- package/src/contractSupport/prepare-ownable.d.ts +11 -0
- package/src/contractSupport/prepare-ownable.d.ts.map +1 -0
- package/src/contractSupport/prepare-ownable.js +100 -0
- package/src/contractSupport/priceAuthority.d.ts +23 -15
- package/src/contractSupport/priceAuthority.d.ts.map +1 -1
- package/src/contractSupport/priceAuthority.js +32 -17
- package/src/contractSupport/priceAuthorityInitial.d.ts +3 -2
- package/src/contractSupport/priceAuthorityInitial.d.ts.map +1 -1
- package/src/contractSupport/priceAuthorityInitial.js +5 -2
- package/src/contractSupport/priceAuthorityQuoteMint.d.ts +2 -1
- package/src/contractSupport/priceAuthorityQuoteMint.d.ts.map +1 -1
- package/src/contractSupport/priceAuthorityQuoteMint.js +23 -27
- package/src/contractSupport/priceAuthorityTransform.d.ts +14 -12
- package/src/contractSupport/priceAuthorityTransform.d.ts.map +1 -1
- package/src/contractSupport/priceAuthorityTransform.js +10 -8
- package/src/contractSupport/priceQuote.d.ts +7 -5
- package/src/contractSupport/priceQuote.d.ts.map +1 -1
- package/src/contractSupport/priceQuote.js +5 -1
- package/src/contractSupport/ratio.d.ts +2 -2
- package/src/contractSupport/ratio.d.ts.map +1 -1
- package/src/contractSupport/ratio.js +19 -15
- package/src/contractSupport/recorder.d.ts +31 -117
- package/src/contractSupport/recorder.d.ts.map +1 -1
- package/src/contractSupport/recorder.js +21 -10
- package/src/contractSupport/safeMath.d.ts +7 -7
- package/src/contractSupport/safeMath.d.ts.map +1 -1
- package/src/contractSupport/statistics.d.ts +1 -1
- package/src/contractSupport/statistics.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/{types.d.ts → types-ambient.d.ts} +4 -4
- package/src/contractSupport/types-ambient.d.ts.map +1 -0
- package/src/contractSupport/{types.js → types-ambient.js} +1 -1
- package/src/contractSupport/zoeHelpers.d.ts +1 -1
- package/src/contractSupport/zoeHelpers.d.ts.map +1 -1
- package/src/contractSupport/zoeHelpers.js +5 -11
- package/src/contracts/auction/firstPriceLogic.d.ts.map +1 -1
- package/src/contracts/auction/firstPriceLogic.js +5 -8
- package/src/contracts/auction/index.d.ts +10 -10
- package/src/contracts/auction/index.d.ts.map +1 -1
- package/src/contracts/auction/index.js +2 -1
- package/src/contracts/auction/secondPriceLogic.d.ts.map +1 -1
- package/src/contracts/auction/secondPriceLogic.js +1 -4
- package/src/contracts/automaticRefund.d.ts +1 -1
- package/src/contracts/automaticRefund.d.ts.map +1 -1
- package/src/contracts/autoswap.d.ts.map +1 -1
- package/src/contracts/autoswap.js +8 -9
- package/src/contracts/barterExchange.d.ts +1 -1
- package/src/contracts/barterExchange.d.ts.map +1 -1
- package/src/contracts/barterExchange.js +2 -3
- package/src/contracts/callSpread/calculateShares.d.ts +1 -8
- package/src/contracts/callSpread/calculateShares.d.ts.map +1 -1
- package/src/contracts/callSpread/calculateShares.js +1 -1
- package/src/contracts/callSpread/fundedCallSpread.d.ts +4 -0
- package/src/contracts/callSpread/fundedCallSpread.d.ts.map +1 -1
- package/src/contracts/callSpread/fundedCallSpread.js +6 -4
- package/src/contracts/callSpread/payoffHandler.d.ts.map +1 -1
- package/src/contracts/callSpread/payoffHandler.js +2 -1
- package/src/contracts/callSpread/percent.d.ts +2 -4
- package/src/contracts/callSpread/percent.d.ts.map +1 -1
- package/src/contracts/callSpread/position.d.ts +2 -2
- package/src/contracts/callSpread/pricedCallSpread.d.ts +6 -5
- package/src/contracts/callSpread/pricedCallSpread.d.ts.map +1 -1
- package/src/contracts/callSpread/pricedCallSpread.js +8 -4
- package/src/contracts/callSpread/{types.d.ts → types-ambient.d.ts} +3 -3
- package/src/contracts/callSpread/types-ambient.d.ts.map +1 -0
- package/src/contracts/coveredCall-durable.d.ts +2 -4
- package/src/contracts/coveredCall-durable.d.ts.map +1 -1
- package/src/contracts/exported.js +3 -3
- package/src/contracts/loan/borrow.d.ts.map +1 -1
- package/src/contracts/loan/borrow.js +7 -4
- package/src/contracts/loan/close.d.ts.map +1 -1
- package/src/contracts/loan/close.js +3 -7
- package/src/contracts/loan/index.d.ts +5 -1
- package/src/contracts/loan/index.d.ts.map +1 -1
- package/src/contracts/loan/index.js +4 -0
- package/src/contracts/loan/liquidate.d.ts +1 -12
- package/src/contracts/loan/liquidate.d.ts.map +1 -1
- package/src/contracts/loan/liquidate.js +4 -2
- package/src/contracts/loan/scheduleLiquidation.d.ts.map +1 -1
- package/src/contracts/loan/scheduleLiquidation.js +1 -0
- package/src/contracts/loan/{types.d.ts → types-ambient.d.ts} +16 -17
- package/src/contracts/loan/types-ambient.d.ts.map +1 -0
- package/src/contracts/loan/{types.js → types-ambient.js} +11 -18
- package/src/contracts/loan/updateDebt.js +1 -1
- package/src/contracts/mintAndSellNFT.d.ts.map +1 -1
- package/src/contracts/mintPayments.d.ts +14 -6
- package/src/contracts/mintPayments.d.ts.map +1 -1
- package/src/contracts/mintPayments.js +1 -1
- package/src/contracts/oracle.d.ts +25 -3
- package/src/contracts/oracle.d.ts.map +1 -1
- package/src/contracts/oracle.js +7 -0
- package/src/contracts/otcDesk.d.ts +3 -3
- package/src/contracts/otcDesk.d.ts.map +1 -1
- package/src/contracts/otcDesk.js +1 -1
- package/src/contracts/priceAggregator.d.ts +112 -18
- package/src/contracts/priceAggregator.d.ts.map +1 -1
- package/src/contracts/priceAggregator.js +16 -18
- package/src/contracts/priceAggregatorTypes.d.ts +2 -2
- package/src/contracts/priceAggregatorTypes.d.ts.map +1 -1
- package/src/contracts/scaledPriceAuthority.d.ts +4 -5
- package/src/contracts/scaledPriceAuthority.d.ts.map +1 -1
- package/src/contracts/scaledPriceAuthority.js +6 -0
- package/src/contracts/sellItems.d.ts +2 -2
- package/src/contracts/sellItems.d.ts.map +1 -1
- package/src/contracts/sellItems.js +2 -3
- package/src/contracts/simpleExchange.d.ts +3 -3
- package/src/contracts/{types.d.ts → types-ambient.d.ts} +1 -1
- package/src/contracts/types-ambient.d.ts.map +1 -0
- package/src/handleWarning.d.ts.map +1 -1
- package/src/instanceRecordStorage.d.ts +1 -1
- package/src/instanceRecordStorage.d.ts.map +1 -1
- package/src/internal-types.d.ts +20 -32
- package/src/internal-types.d.ts.map +1 -1
- package/src/internal-types.js +18 -58
- package/src/issuerRecord.d.ts +2 -2
- package/src/issuerRecord.d.ts.map +1 -1
- package/src/issuerStorage.d.ts +4 -4
- package/src/issuerStorage.d.ts.map +1 -1
- package/src/issuerStorage.js +12 -28
- package/src/makeHandle.d.ts +2 -2
- package/src/makeHandle.d.ts.map +1 -1
- package/src/makeHandle.js +1 -1
- package/src/typeGuards.d.ts +119 -20
- package/src/typeGuards.d.ts.map +1 -1
- package/src/typeGuards.js +18 -9
- package/src/types-ambient.d.ts +41 -0
- package/src/types-ambient.d.ts.map +1 -0
- package/src/{types.js → types-ambient.js} +6 -14
- package/src/zoeService/escrowStorage.d.ts +1 -1
- package/src/zoeService/escrowStorage.d.ts.map +1 -1
- package/src/zoeService/escrowStorage.js +20 -27
- package/src/zoeService/feeMint.d.ts +9 -16
- package/src/zoeService/feeMint.d.ts.map +1 -1
- package/src/zoeService/feeMint.js +21 -15
- package/src/zoeService/installationStorage.d.ts +5 -20
- package/src/zoeService/installationStorage.d.ts.map +1 -1
- package/src/zoeService/installationStorage.js +11 -7
- package/src/zoeService/instanceAdminStorage.d.ts +22 -42
- package/src/zoeService/instanceAdminStorage.d.ts.map +1 -1
- package/src/zoeService/instanceAdminStorage.js +1 -0
- package/src/zoeService/internal-types.d.ts +16 -16
- package/src/zoeService/internal-types.d.ts.map +1 -1
- package/src/zoeService/internal-types.js +6 -6
- package/src/zoeService/invitationQueries.d.ts.map +1 -1
- package/src/zoeService/invitationQueries.js +7 -5
- package/src/zoeService/makeInvitation.d.ts +3 -3
- package/src/zoeService/makeInvitation.d.ts.map +1 -1
- package/src/zoeService/makeInvitation.js +25 -21
- package/src/zoeService/offer/burnInvitation.d.ts.map +1 -1
- package/src/zoeService/offer/offer.d.ts.map +1 -1
- package/src/zoeService/offer/offer.js +2 -5
- package/src/zoeService/originalZoeSeat.d.ts +34 -0
- package/src/zoeService/originalZoeSeat.d.ts.map +1 -0
- package/src/zoeService/originalZoeSeat.js +353 -0
- package/src/zoeService/startInstance.d.ts +3 -3
- package/src/zoeService/startInstance.d.ts.map +1 -1
- package/src/zoeService/startInstance.js +17 -11
- package/src/zoeService/{types.d.ts → types-ambient.d.ts} +26 -31
- package/src/zoeService/types-ambient.d.ts.map +1 -0
- package/src/zoeService/{types.js → types-ambient.js} +19 -32
- package/src/zoeService/utils.d.ts +54 -58
- package/src/zoeService/utils.test-d.d.ts +2 -0
- package/src/zoeService/utils.test-d.d.ts.map +1 -0
- package/src/zoeService/utils.test-d.ts +33 -0
- package/src/zoeService/zoe.d.ts +9 -13
- package/src/zoeService/zoe.d.ts.map +1 -1
- package/src/zoeService/zoe.js +7 -7
- package/src/zoeService/zoeSeat.d.ts +15 -45
- package/src/zoeService/zoeSeat.d.ts.map +1 -1
- package/src/zoeService/zoeSeat.js +214 -114
- package/src/zoeService/zoeStorageManager.d.ts +9 -43
- package/src/zoeService/zoeStorageManager.d.ts.map +1 -1
- package/src/zoeService/zoeStorageManager.js +8 -6
- package/tools/fakePriceAuthority.d.ts +9 -8
- package/tools/fakePriceAuthority.d.ts.map +1 -1
- package/tools/fakePriceAuthority.js +21 -17
- package/tools/fakeVatAdmin.d.ts +10 -10
- package/tools/manualPriceAuthority.d.ts +11 -6
- package/tools/manualPriceAuthority.d.ts.map +1 -1
- package/tools/manualPriceAuthority.js +15 -2
- package/tools/manualTimer.d.ts +21 -40
- package/tools/manualTimer.d.ts.map +1 -1
- package/tools/manualTimer.js +30 -16
- package/tools/prepare-test-env.js +1 -1
- package/tools/scriptedOracle.d.ts +3 -3
- package/tools/scriptedOracle.d.ts.map +1 -1
- package/tools/scriptedOracle.js +1 -1
- package/tools/scriptedPriceAuthority.d.ts +4 -0
- package/tools/scriptedPriceAuthority.d.ts.map +1 -1
- package/tools/scriptedPriceAuthority.js +6 -1
- package/tools/setup-zoe.d.ts +8 -9
- package/tools/setup-zoe.d.ts.map +1 -1
- package/tools/setup-zoe.js +16 -1
- package/tools/test-utils.d.ts +20 -0
- package/tools/test-utils.d.ts.map +1 -0
- package/tools/test-utils.js +26 -0
- package/tools/types.d.ts +21 -21
- package/tools/types.d.ts.map +1 -1
- package/tools/types.js +10 -10
- package/CHANGELOG.md +0 -1203
- package/src/contractFacet/types.d.ts +0 -191
- package/src/contractFacet/types.d.ts.map +0 -1
- package/src/contractFacet/types.js +0 -256
- package/src/contractSupport/types.d.ts.map +0 -1
- package/src/contracts/callSpread/types.d.ts.map +0 -1
- package/src/contracts/loan/types.d.ts.map +0 -1
- package/src/contracts/types.d.ts.map +0 -1
- package/src/objArrayConversion.d.ts +0 -5
- package/src/objArrayConversion.d.ts.map +0 -1
- package/src/objArrayConversion.js +0 -35
- package/src/types.d.ts +0 -45
- package/src/types.d.ts.map +0 -1
- package/src/zoeService/types.d.ts.map +0 -1
- package/tools/internal-types.d.ts +0 -12
- package/tools/internal-types.d.ts.map +0 -1
- package/tools/internal-types.js +0 -14
- package/tools/priceAuthorityRegistry.d.ts +0 -20
- package/tools/priceAuthorityRegistry.d.ts.map +0 -1
- package/tools/priceAuthorityRegistry.js +0 -209
- package/tools/types-ambient.d.ts +0 -142
- package/tools/types-ambient.d.ts.map +0 -1
- package/tools/types-ambient.js +0 -160
- /package/src/contracts/callSpread/{types.js → types-ambient.js} +0 -0
- /package/src/contracts/{types.js → types-ambient.js} +0 -0
|
@@ -1,54 +1,41 @@
|
|
|
1
|
-
|
|
1
|
+
/* eslint @typescript-eslint/no-floating-promises: "warn" */
|
|
2
|
+
import { prepareDurablePublishKit } from '@agoric/notifier';
|
|
2
3
|
import { E } from '@endo/eventual-send';
|
|
3
4
|
import { M, prepareExoClassKit } from '@agoric/vat-data';
|
|
4
5
|
import { deeplyFulfilled } from '@endo/marshal';
|
|
5
6
|
import { makePromiseKit } from '@endo/promise-kit';
|
|
6
7
|
|
|
7
8
|
import { satisfiesWant } from '../contractFacet/offerSafety.js';
|
|
8
|
-
import '../types.js';
|
|
9
|
+
import '../types-ambient.js';
|
|
9
10
|
import '../internal-types.js';
|
|
10
11
|
import {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
} from '
|
|
12
|
+
declareOldZoeSeatAdminKind,
|
|
13
|
+
OriginalZoeSeatIKit,
|
|
14
|
+
ZoeUserSeatShape,
|
|
15
|
+
coreUserSeatMethods,
|
|
16
|
+
} from './originalZoeSeat.js';
|
|
16
17
|
|
|
17
18
|
const { Fail } = assert;
|
|
18
19
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
getExitSubscriber: M.call().returns(SubscriberShape),
|
|
29
|
-
// The return promise is empty, but doExit relies on settlement as a signal
|
|
30
|
-
// that the payouts have settled. The exit publisher is notified after that.
|
|
31
|
-
finalPayouts: M.call(M.eref(PaymentPKeywordRecordShape)).returns(
|
|
32
|
-
M.promise(),
|
|
33
|
-
),
|
|
34
|
-
}),
|
|
35
|
-
userSeat: M.interface('UserSeat', {
|
|
36
|
-
getProposal: M.call().returns(M.promise()),
|
|
37
|
-
getPayouts: M.call().returns(M.promise()),
|
|
38
|
-
getPayout: M.call(KeywordShape).returns(M.promise()),
|
|
39
|
-
getOfferResult: M.call().returns(M.promise()),
|
|
40
|
-
hasExited: M.call().returns(M.promise()),
|
|
41
|
-
tryExit: M.call().returns(M.promise()),
|
|
42
|
-
numWantsSatisfied: M.call().returns(M.promise()),
|
|
43
|
-
getFinalAllocation: M.call().returns(M.promise()),
|
|
44
|
-
getExitSubscriber: M.call().returns(M.any()),
|
|
20
|
+
// ZoeSeatAdmin has the implementation of coreUserSeatMethods, but ZoeUserSeat
|
|
21
|
+
// is the facet shared with users. The latter transparently forwards to the
|
|
22
|
+
// former.
|
|
23
|
+
|
|
24
|
+
const ZoeSeatAdmin = harden({
|
|
25
|
+
userSeatAccess: M.interface('UserSeatAccess', {
|
|
26
|
+
...coreUserSeatMethods,
|
|
27
|
+
initExitObjectSetter: M.call(M.any()).returns(),
|
|
28
|
+
assertHasNotExited: M.call(M.string()).returns(),
|
|
45
29
|
}),
|
|
30
|
+
zoeSeatAdmin: OriginalZoeSeatIKit.zoeSeatAdmin,
|
|
46
31
|
});
|
|
47
32
|
|
|
48
|
-
const
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
33
|
+
const ZoeUserSeat = harden({
|
|
34
|
+
userSeat: ZoeUserSeatShape,
|
|
35
|
+
exitObjSetter: M.interface('exitObjSetter', {
|
|
36
|
+
setExitObject: M.call(M.or(M.remotable(), M.undefined())).returns(),
|
|
37
|
+
}),
|
|
38
|
+
});
|
|
52
39
|
|
|
53
40
|
/**
|
|
54
41
|
* makeZoeSeatAdminFactory returns a maker for an object that manages the state
|
|
@@ -69,6 +56,8 @@ export const makeZoeSeatAdminFactory = baggage => {
|
|
|
69
56
|
'zoe Seat publisher',
|
|
70
57
|
);
|
|
71
58
|
|
|
59
|
+
declareOldZoeSeatAdminKind(baggage, makeDurablePublishKit);
|
|
60
|
+
|
|
72
61
|
const doExit = (
|
|
73
62
|
zoeSeatAdmin,
|
|
74
63
|
currentAllocation,
|
|
@@ -96,17 +85,15 @@ export const makeZoeSeatAdminFactory = baggage => {
|
|
|
96
85
|
*/
|
|
97
86
|
const ephemeralOfferResultStore = new WeakMap();
|
|
98
87
|
|
|
99
|
-
|
|
88
|
+
const makeZoeSeatAdmin = prepareExoClassKit(
|
|
100
89
|
baggage,
|
|
101
|
-
'
|
|
102
|
-
|
|
90
|
+
'ZoeSeatAdmin',
|
|
91
|
+
ZoeSeatAdmin,
|
|
103
92
|
/**
|
|
104
|
-
*
|
|
105
93
|
* @param {Allocation} initialAllocation
|
|
106
94
|
* @param {ProposalRecord} proposal
|
|
107
95
|
* @param {InstanceAdminHelper} instanceAdminHelper
|
|
108
96
|
* @param {WithdrawFacet} withdrawFacet
|
|
109
|
-
* @param {ERef<ExitObj>} [exitObj]
|
|
110
97
|
* @param {boolean} [offerResultIsUndefined]
|
|
111
98
|
*/
|
|
112
99
|
(
|
|
@@ -114,7 +101,6 @@ export const makeZoeSeatAdminFactory = baggage => {
|
|
|
114
101
|
proposal,
|
|
115
102
|
instanceAdminHelper,
|
|
116
103
|
withdrawFacet,
|
|
117
|
-
exitObj = undefined,
|
|
118
104
|
// emptySeatKits start with offerResult validly undefined; others can set
|
|
119
105
|
// it to anything (including undefined) in resolveExitAndResult()
|
|
120
106
|
offerResultIsUndefined = false,
|
|
@@ -123,8 +109,7 @@ export const makeZoeSeatAdminFactory = baggage => {
|
|
|
123
109
|
return {
|
|
124
110
|
currentAllocation: initialAllocation,
|
|
125
111
|
proposal,
|
|
126
|
-
|
|
127
|
-
offerResult: undefined,
|
|
112
|
+
offerResult: /** @type {any} */ (undefined),
|
|
128
113
|
offerResultStored: offerResultIsUndefined,
|
|
129
114
|
instanceAdminHelper,
|
|
130
115
|
withdrawFacet,
|
|
@@ -132,14 +117,97 @@ export const makeZoeSeatAdminFactory = baggage => {
|
|
|
132
117
|
subscriber,
|
|
133
118
|
payouts: harden({}),
|
|
134
119
|
exiting: false,
|
|
120
|
+
/** @type {{ setExitObject: (exitObj: ExitObj | undefined) => void} | undefined} */
|
|
121
|
+
exitObjectSetter: undefined,
|
|
135
122
|
};
|
|
136
123
|
},
|
|
137
124
|
{
|
|
125
|
+
// methods for userSeat to call
|
|
126
|
+
userSeatAccess: {
|
|
127
|
+
async getProposal() {
|
|
128
|
+
const { state } = this;
|
|
129
|
+
return state.proposal;
|
|
130
|
+
},
|
|
131
|
+
async getPayouts() {
|
|
132
|
+
const { state } = this;
|
|
133
|
+
|
|
134
|
+
return E.when(
|
|
135
|
+
state.subscriber.subscribeAfter(),
|
|
136
|
+
() => state.payouts,
|
|
137
|
+
() => state.payouts,
|
|
138
|
+
);
|
|
139
|
+
},
|
|
140
|
+
async getPayout(keyword) {
|
|
141
|
+
const { state } = this;
|
|
142
|
+
|
|
143
|
+
// subscriber.subscribeAfter() only triggers after publisher.finish()
|
|
144
|
+
// in exit() or publisher.fail() in fail(). Both of those wait for
|
|
145
|
+
// doExit(), which ensures that finalPayouts() has set state.payouts.
|
|
146
|
+
return E.when(
|
|
147
|
+
state.subscriber.subscribeAfter(),
|
|
148
|
+
() => state.payouts[keyword],
|
|
149
|
+
() => state.payouts[keyword],
|
|
150
|
+
);
|
|
151
|
+
},
|
|
152
|
+
|
|
153
|
+
async getOfferResult() {
|
|
154
|
+
const { state, facets } = this;
|
|
155
|
+
|
|
156
|
+
if (state.offerResultStored) {
|
|
157
|
+
return state.offerResult;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
if (ephemeralOfferResultStore.has(facets.zoeSeatAdmin)) {
|
|
161
|
+
return ephemeralOfferResultStore.get(facets.zoeSeatAdmin).promise;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
const kit = makePromiseKit();
|
|
165
|
+
ephemeralOfferResultStore.set(facets.zoeSeatAdmin, kit);
|
|
166
|
+
return kit.promise;
|
|
167
|
+
},
|
|
168
|
+
async hasExited() {
|
|
169
|
+
const { state, facets } = this;
|
|
170
|
+
|
|
171
|
+
return (
|
|
172
|
+
state.exiting ||
|
|
173
|
+
state.instanceAdminHelper.hasExited(facets.zoeSeatAdmin)
|
|
174
|
+
);
|
|
175
|
+
},
|
|
176
|
+
async numWantsSatisfied() {
|
|
177
|
+
const { state } = this;
|
|
178
|
+
return E.when(
|
|
179
|
+
state.subscriber.subscribeAfter(),
|
|
180
|
+
() => satisfiesWant(state.proposal, state.currentAllocation),
|
|
181
|
+
() => satisfiesWant(state.proposal, state.currentAllocation),
|
|
182
|
+
);
|
|
183
|
+
},
|
|
184
|
+
getExitSubscriber() {
|
|
185
|
+
const { state } = this;
|
|
186
|
+
return state.subscriber;
|
|
187
|
+
},
|
|
188
|
+
getFinalAllocation() {
|
|
189
|
+
const { state } = this;
|
|
190
|
+
return E.when(
|
|
191
|
+
state.subscriber.subscribeAfter(),
|
|
192
|
+
() => state.currentAllocation,
|
|
193
|
+
() => state.currentAllocation,
|
|
194
|
+
);
|
|
195
|
+
},
|
|
196
|
+
initExitObjectSetter(setter) {
|
|
197
|
+
this.state.exitObjectSetter = setter;
|
|
198
|
+
},
|
|
199
|
+
assertHasNotExited(msg) {
|
|
200
|
+
const { state, facets } = this;
|
|
201
|
+
const { instanceAdminHelper } = state;
|
|
202
|
+
const hasExited1 = instanceAdminHelper.hasExited(facets.zoeSeatAdmin);
|
|
203
|
+
|
|
204
|
+
!hasExited1 || assert(!hasExited1, msg);
|
|
205
|
+
},
|
|
206
|
+
},
|
|
138
207
|
zoeSeatAdmin: {
|
|
139
208
|
replaceAllocation(replacementAllocation) {
|
|
140
|
-
const { state } = this;
|
|
141
|
-
assertHasNotExited(
|
|
142
|
-
this,
|
|
209
|
+
const { state, facets } = this;
|
|
210
|
+
facets.userSeatAccess.assertHasNotExited(
|
|
143
211
|
'Cannot replace allocation. Seat has already exited',
|
|
144
212
|
);
|
|
145
213
|
harden(replacementAllocation);
|
|
@@ -155,7 +223,9 @@ export const makeZoeSeatAdminFactory = baggage => {
|
|
|
155
223
|
if (state.exiting) {
|
|
156
224
|
return;
|
|
157
225
|
}
|
|
158
|
-
assertHasNotExited(
|
|
226
|
+
facets.userSeatAccess.assertHasNotExited(
|
|
227
|
+
'Cannot exit seat. Seat has already exited',
|
|
228
|
+
);
|
|
159
229
|
|
|
160
230
|
state.exiting = true;
|
|
161
231
|
E.when(
|
|
@@ -165,7 +235,13 @@ export const makeZoeSeatAdminFactory = baggage => {
|
|
|
165
235
|
state.withdrawFacet,
|
|
166
236
|
state.instanceAdminHelper,
|
|
167
237
|
),
|
|
168
|
-
() =>
|
|
238
|
+
() => {
|
|
239
|
+
if (state.exitObjectSetter) {
|
|
240
|
+
state.exitObjectSetter.setExitObject(undefined);
|
|
241
|
+
state.exitObjectSetter = undefined;
|
|
242
|
+
}
|
|
243
|
+
return state.publisher.finish(completion);
|
|
244
|
+
},
|
|
169
245
|
);
|
|
170
246
|
},
|
|
171
247
|
fail(reason) {
|
|
@@ -176,10 +252,12 @@ export const makeZoeSeatAdminFactory = baggage => {
|
|
|
176
252
|
return;
|
|
177
253
|
}
|
|
178
254
|
|
|
179
|
-
assertHasNotExited(
|
|
255
|
+
facets.userSeatAccess.assertHasNotExited(
|
|
256
|
+
'Cannot fail seat. Seat has already exited',
|
|
257
|
+
);
|
|
180
258
|
|
|
181
259
|
state.exiting = true;
|
|
182
|
-
E.when(
|
|
260
|
+
void E.when(
|
|
183
261
|
doExit(
|
|
184
262
|
facets.zoeSeatAdmin,
|
|
185
263
|
state.currentAllocation,
|
|
@@ -189,6 +267,11 @@ export const makeZoeSeatAdminFactory = baggage => {
|
|
|
189
267
|
() => state.publisher.fail(reason),
|
|
190
268
|
() => state.publisher.fail(reason),
|
|
191
269
|
);
|
|
270
|
+
|
|
271
|
+
if (state.exitObjectSetter) {
|
|
272
|
+
state.exitObjectSetter.setExitObject(undefined);
|
|
273
|
+
state.exitObjectSetter = undefined;
|
|
274
|
+
}
|
|
192
275
|
},
|
|
193
276
|
// called only for seats resulting from offers.
|
|
194
277
|
/** @param {HandleOfferResult} result */
|
|
@@ -198,15 +281,15 @@ export const makeZoeSeatAdminFactory = baggage => {
|
|
|
198
281
|
!state.offerResultStored ||
|
|
199
282
|
Fail`offerResultStored before offerResultPromise`;
|
|
200
283
|
|
|
201
|
-
if (!ephemeralOfferResultStore.has(facets.
|
|
284
|
+
if (!ephemeralOfferResultStore.has(facets.zoeSeatAdmin)) {
|
|
202
285
|
// this was called before getOfferResult
|
|
203
286
|
const kit = makePromiseKit();
|
|
204
287
|
kit.resolve(offerResultPromise);
|
|
205
|
-
ephemeralOfferResultStore.set(facets.
|
|
288
|
+
ephemeralOfferResultStore.set(facets.zoeSeatAdmin, kit);
|
|
206
289
|
}
|
|
207
290
|
|
|
208
|
-
const pKit = ephemeralOfferResultStore.get(facets.
|
|
209
|
-
E.when(
|
|
291
|
+
const pKit = ephemeralOfferResultStore.get(facets.zoeSeatAdmin);
|
|
292
|
+
void E.when(
|
|
210
293
|
offerResultPromise,
|
|
211
294
|
offerResult => {
|
|
212
295
|
// Resolve the ephemeral promise for offerResult
|
|
@@ -226,10 +309,11 @@ export const makeZoeSeatAdminFactory = baggage => {
|
|
|
226
309
|
// If it doesn't, then these lines won't be reached so the
|
|
227
310
|
// flag will stay false and the promise will stay in the heap
|
|
228
311
|
state.offerResultStored = true;
|
|
229
|
-
ephemeralOfferResultStore.delete(facets.
|
|
312
|
+
ephemeralOfferResultStore.delete(facets.zoeSeatAdmin);
|
|
230
313
|
} catch (err) {
|
|
231
314
|
console.warn(
|
|
232
|
-
|
|
315
|
+
'non-durable offer result will be lost upon zoe vat termination:',
|
|
316
|
+
offerResult,
|
|
233
317
|
);
|
|
234
318
|
}
|
|
235
319
|
},
|
|
@@ -244,7 +328,8 @@ export const makeZoeSeatAdminFactory = baggage => {
|
|
|
244
328
|
},
|
|
245
329
|
);
|
|
246
330
|
|
|
247
|
-
|
|
331
|
+
// @ts-expect-error exitObjectSetter is set at birth.
|
|
332
|
+
state.exitObjectSetter.setExitObject(exitObj);
|
|
248
333
|
},
|
|
249
334
|
getExitSubscriber() {
|
|
250
335
|
const { state } = this;
|
|
@@ -257,85 +342,100 @@ export const makeZoeSeatAdminFactory = baggage => {
|
|
|
257
342
|
state.payouts = settledPayouts;
|
|
258
343
|
},
|
|
259
344
|
},
|
|
345
|
+
},
|
|
346
|
+
);
|
|
347
|
+
|
|
348
|
+
const makeUserSeat = prepareExoClassKit(
|
|
349
|
+
baggage,
|
|
350
|
+
'ZoeUserSeat',
|
|
351
|
+
ZoeUserSeat,
|
|
352
|
+
(userSeatAccess, exitObj) => {
|
|
353
|
+
return {
|
|
354
|
+
userSeatAccess,
|
|
355
|
+
exitObj,
|
|
356
|
+
};
|
|
357
|
+
},
|
|
358
|
+
{
|
|
260
359
|
userSeat: {
|
|
261
360
|
async getProposal() {
|
|
262
|
-
|
|
263
|
-
return state.proposal;
|
|
361
|
+
return this.state.userSeatAccess.getProposal();
|
|
264
362
|
},
|
|
265
363
|
async getPayouts() {
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
return E.when(
|
|
269
|
-
state.subscriber.subscribeAfter(),
|
|
270
|
-
() => state.payouts,
|
|
271
|
-
() => state.payouts,
|
|
272
|
-
);
|
|
364
|
+
return this.state.userSeatAccess.getPayouts();
|
|
273
365
|
},
|
|
274
366
|
async getPayout(keyword) {
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
// subscriber.subscribeAfter() only triggers after publisher.finish()
|
|
278
|
-
// in exit() or publisher.fail() in fail(). Both of those wait for
|
|
279
|
-
// doExit(), which ensures that finalPayouts() has set state.payouts.
|
|
280
|
-
return E.when(
|
|
281
|
-
state.subscriber.subscribeAfter(),
|
|
282
|
-
() => state.payouts[keyword],
|
|
283
|
-
() => state.payouts[keyword],
|
|
284
|
-
);
|
|
367
|
+
return this.state.userSeatAccess.getPayout(keyword);
|
|
285
368
|
},
|
|
286
369
|
|
|
287
370
|
async getOfferResult() {
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
if (state.offerResultStored) {
|
|
291
|
-
return state.offerResult;
|
|
292
|
-
}
|
|
293
|
-
|
|
294
|
-
if (ephemeralOfferResultStore.has(facets.userSeat)) {
|
|
295
|
-
return ephemeralOfferResultStore.get(facets.userSeat).promise;
|
|
296
|
-
}
|
|
297
|
-
|
|
298
|
-
const kit = makePromiseKit();
|
|
299
|
-
ephemeralOfferResultStore.set(facets.userSeat, kit);
|
|
300
|
-
return kit.promise;
|
|
371
|
+
return this.state.userSeatAccess.getOfferResult();
|
|
301
372
|
},
|
|
302
373
|
async hasExited() {
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
return (
|
|
306
|
-
state.exiting ||
|
|
307
|
-
state.instanceAdminHelper.hasExited(facets.zoeSeatAdmin)
|
|
308
|
-
);
|
|
374
|
+
return this.state.userSeatAccess.hasExited();
|
|
309
375
|
},
|
|
310
376
|
async tryExit() {
|
|
311
377
|
const { state } = this;
|
|
378
|
+
|
|
379
|
+
state.userSeatAccess.assertHasNotExited(
|
|
380
|
+
'Cannot exit; seat has already exited',
|
|
381
|
+
);
|
|
312
382
|
if (!state.exitObj)
|
|
313
|
-
throw Fail`exitObj
|
|
314
|
-
|
|
383
|
+
throw Fail`exitObj not initialized or already nullified`;
|
|
384
|
+
|
|
385
|
+
const exitResult = E(state.exitObj).exit();
|
|
315
386
|
|
|
316
|
-
|
|
387
|
+
// unlink an un-collectible cycle.
|
|
388
|
+
state.exitObj = undefined;
|
|
389
|
+
|
|
390
|
+
return exitResult;
|
|
317
391
|
},
|
|
318
392
|
async numWantsSatisfied() {
|
|
319
|
-
|
|
320
|
-
return E.when(
|
|
321
|
-
state.subscriber.subscribeAfter(),
|
|
322
|
-
() => satisfiesWant(state.proposal, state.currentAllocation),
|
|
323
|
-
() => satisfiesWant(state.proposal, state.currentAllocation),
|
|
324
|
-
);
|
|
393
|
+
return this.state.userSeatAccess.numWantsSatisfied();
|
|
325
394
|
},
|
|
326
395
|
getExitSubscriber() {
|
|
327
|
-
|
|
328
|
-
return state.subscriber;
|
|
396
|
+
return this.state.userSeatAccess.getExitSubscriber();
|
|
329
397
|
},
|
|
330
398
|
getFinalAllocation() {
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
399
|
+
return this.state.userSeatAccess.getFinalAllocation();
|
|
400
|
+
},
|
|
401
|
+
},
|
|
402
|
+
exitObjSetter: {
|
|
403
|
+
setExitObject(exitObject) {
|
|
404
|
+
this.state.exitObj = exitObject;
|
|
337
405
|
},
|
|
338
406
|
},
|
|
339
407
|
},
|
|
340
408
|
);
|
|
409
|
+
|
|
410
|
+
/**
|
|
411
|
+
* @param {Allocation} initialAllocation
|
|
412
|
+
* @param {ProposalRecord} proposal
|
|
413
|
+
* @param {InstanceAdminHelper} instanceAdminHelper
|
|
414
|
+
* @param {WithdrawFacet} withdrawFacet
|
|
415
|
+
* @param {ERef<ExitObj>} [exitObj]
|
|
416
|
+
* @param {boolean} [offerResultIsUndefined]
|
|
417
|
+
*/
|
|
418
|
+
const makeZoeSeatAdminKit = (
|
|
419
|
+
initialAllocation,
|
|
420
|
+
proposal,
|
|
421
|
+
instanceAdminHelper,
|
|
422
|
+
withdrawFacet,
|
|
423
|
+
exitObj = undefined,
|
|
424
|
+
offerResultIsUndefined = false,
|
|
425
|
+
) => {
|
|
426
|
+
const { zoeSeatAdmin, userSeatAccess } = makeZoeSeatAdmin(
|
|
427
|
+
initialAllocation,
|
|
428
|
+
proposal,
|
|
429
|
+
instanceAdminHelper,
|
|
430
|
+
withdrawFacet,
|
|
431
|
+
offerResultIsUndefined,
|
|
432
|
+
);
|
|
433
|
+
const { userSeat, exitObjSetter } = makeUserSeat(userSeatAccess, exitObj);
|
|
434
|
+
userSeatAccess.initExitObjectSetter(exitObjSetter);
|
|
435
|
+
|
|
436
|
+
// The original makeZoeSeatAdminKit returned two facets of the same kind.
|
|
437
|
+
// This is returning two independent facets.
|
|
438
|
+
return { userSeat, zoeSeatAdmin };
|
|
439
|
+
};
|
|
440
|
+
return makeZoeSeatAdminKit;
|
|
341
441
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
export function makeZoeStorageManager(createZCFVat: CreateZCFVat, getBundleCapForID: GetBundleCapForID, shutdownZoeVat: ShutdownWithFailure, feeMint: {
|
|
1
|
+
export function makeZoeStorageManager(createZCFVat: CreateZCFVat, getBundleCapForID: GetBundleCapForID, shutdownZoeVat: import("@agoric/swingset-vat").ShutdownWithFailure, feeMint: {
|
|
2
2
|
getFeeIssuerKit: GetFeeIssuerKit;
|
|
3
3
|
getFeeIssuer: () => Issuer;
|
|
4
4
|
getFeeBrand: () => Brand;
|
|
5
|
-
}, zoeBaggage:
|
|
5
|
+
}, zoeBaggage: Baggage): import("@endo/exo").GuardedKit<{
|
|
6
6
|
zoeServiceDataAccess: {
|
|
7
|
-
getInvitationIssuer: () => Issuer<"set">;
|
|
7
|
+
getInvitationIssuer: () => globalThis.Issuer<"set", InvitationDetails>;
|
|
8
8
|
getBundleIDFromInstallation(allegedInstallation: any): any;
|
|
9
9
|
getPublicFacet(instance: any): any;
|
|
10
10
|
getBrands(instance: any): any;
|
|
@@ -14,19 +14,19 @@ export function makeZoeStorageManager(createZCFVat: CreateZCFVat, getBundleCapFo
|
|
|
14
14
|
getInstallation(instance: any): any;
|
|
15
15
|
getProposalShapeForInvitation: (invitationHandle: any) => any;
|
|
16
16
|
installBundle: (allegedBundle: any, bundleLabel: any) => any;
|
|
17
|
-
installBundleID(bundleID: any, bundleLabel: any): Promise<Installation<
|
|
17
|
+
installBundleID(bundleID: any, bundleLabel: any): Promise<Installation<unknown>>;
|
|
18
18
|
};
|
|
19
19
|
makeOfferAccess: {
|
|
20
20
|
getAssetKindByBrand: GetAssetKindByBrand;
|
|
21
21
|
getInstanceAdmin(instance: any): any;
|
|
22
22
|
getProposalShapeForInvitation: (invitationHandle: any) => any;
|
|
23
|
-
getInvitationIssuer: () => Issuer<"set">;
|
|
24
|
-
depositPayments(proposal: any, payments: any): Promise<
|
|
23
|
+
getInvitationIssuer: () => globalThis.Issuer<"set", InvitationDetails>;
|
|
24
|
+
depositPayments(proposal: any, payments: any): Promise<Allocation>;
|
|
25
25
|
};
|
|
26
26
|
startInstanceAccess: {
|
|
27
27
|
makeZoeInstanceStorageManager: MakeZoeInstanceStorageManager;
|
|
28
28
|
/** @type {UnwrapInstallation} */
|
|
29
|
-
unwrapInstallation(installationP: ERef<Installation
|
|
29
|
+
unwrapInstallation(installationP: ERef<Installation>): globalThis.ERef<{
|
|
30
30
|
bundle?: SourceBundle | undefined;
|
|
31
31
|
bundleCap?: any;
|
|
32
32
|
bundleID?: string | undefined;
|
|
@@ -34,42 +34,8 @@ export function makeZoeStorageManager(createZCFVat: CreateZCFVat, getBundleCapFo
|
|
|
34
34
|
}>;
|
|
35
35
|
};
|
|
36
36
|
invitationIssuerAccess: {
|
|
37
|
-
getInvitationIssuer: () => Issuer<"set">;
|
|
38
|
-
};
|
|
39
|
-
} & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
40
|
-
zoeServiceDataAccess: {
|
|
41
|
-
getInvitationIssuer: () => Issuer<"set">;
|
|
42
|
-
getBundleIDFromInstallation(allegedInstallation: any): any;
|
|
43
|
-
getPublicFacet(instance: any): any;
|
|
44
|
-
getBrands(instance: any): any;
|
|
45
|
-
getIssuers(instance: any): any;
|
|
46
|
-
getOfferFilter(instance: any): any;
|
|
47
|
-
getTerms(instance: any): any;
|
|
48
|
-
getInstallation(instance: any): any;
|
|
49
|
-
getProposalShapeForInvitation: (invitationHandle: any) => any;
|
|
50
|
-
installBundle: (allegedBundle: any, bundleLabel: any) => any;
|
|
51
|
-
installBundleID(bundleID: any, bundleLabel: any): Promise<Installation<any>>;
|
|
52
|
-
};
|
|
53
|
-
makeOfferAccess: {
|
|
54
|
-
getAssetKindByBrand: GetAssetKindByBrand;
|
|
55
|
-
getInstanceAdmin(instance: any): any;
|
|
56
|
-
getProposalShapeForInvitation: (invitationHandle: any) => any;
|
|
57
|
-
getInvitationIssuer: () => Issuer<"set">;
|
|
58
|
-
depositPayments(proposal: any, payments: any): Promise<AmountKeywordRecord>;
|
|
59
|
-
};
|
|
60
|
-
startInstanceAccess: {
|
|
61
|
-
makeZoeInstanceStorageManager: MakeZoeInstanceStorageManager;
|
|
62
|
-
/** @type {UnwrapInstallation} */
|
|
63
|
-
unwrapInstallation(installationP: ERef<Installation<any>>): ERef<{
|
|
64
|
-
bundle?: SourceBundle | undefined;
|
|
65
|
-
bundleCap?: any;
|
|
66
|
-
bundleID?: string | undefined;
|
|
67
|
-
installation: Installation<any>;
|
|
68
|
-
}>;
|
|
69
|
-
};
|
|
70
|
-
invitationIssuerAccess: {
|
|
71
|
-
getInvitationIssuer: () => Issuer<"set">;
|
|
37
|
+
getInvitationIssuer: () => globalThis.Issuer<"set", InvitationDetails>;
|
|
72
38
|
};
|
|
73
39
|
}>;
|
|
74
|
-
|
|
40
|
+
import type { Baggage } from '@agoric/vat-data';
|
|
75
41
|
//# sourceMappingURL=zoeStorageManager.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zoeStorageManager.d.ts","sourceRoot":"","sources":["zoeStorageManager.js"],"names":[],"mappings":"AAwDO,oDAXI,YAAY,qBAEZ,iBAAiB,kBACjB,mBAAmB,
|
|
1
|
+
{"version":3,"file":"zoeStorageManager.d.ts","sourceRoot":"","sources":["zoeStorageManager.js"],"names":[],"mappings":"AAwDO,oDAXI,YAAY,qBAEZ,iBAAiB,kBACjB,OAAO,sBAAsB,EAAE,mBAAmB,WAClD;IACV,eAAoB,EAAE,eAAe,CAAC;IACtC,YAAiB,EAAE,MAAM,MAAM,CAAC;IAChC,WAAgB,EAAE,MAAM,KAAK,CAAC;CAC3B;;;;;;;;;;;;;;;;;;;;;;;QAiaI,iCAAiC;0CA7agB,KAAM,YAC3D,CAAC;;;;;;;;;;GAwbJ;6BAnc0B,kBAAkB"}
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
AssetKind,
|
|
4
4
|
makeDurableIssuerKit,
|
|
5
5
|
AmountMath,
|
|
6
|
-
|
|
6
|
+
upgradeIssuerKit,
|
|
7
7
|
} from '@agoric/ertp';
|
|
8
8
|
import {
|
|
9
9
|
makeScalarBigMapStore,
|
|
@@ -21,7 +21,7 @@ import { prepareInvitationKit } from './makeInvitation.js';
|
|
|
21
21
|
import { makeInstanceAdminStorage } from './instanceAdminStorage.js';
|
|
22
22
|
import { makeInstallationStorage } from './installationStorage.js';
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
/// <reference path="./types.js" />
|
|
25
25
|
import './internal-types.js';
|
|
26
26
|
import {
|
|
27
27
|
InstanceStorageManagerIKit,
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
ZoeStorageManagerIKit,
|
|
30
30
|
} from '../typeGuards.js';
|
|
31
31
|
|
|
32
|
-
/** @
|
|
32
|
+
/** @import {Baggage} from '@agoric/vat-data' */
|
|
33
33
|
|
|
34
34
|
const { ownKeys } = Reflect;
|
|
35
35
|
|
|
@@ -46,7 +46,7 @@ const { ownKeys } = Reflect;
|
|
|
46
46
|
* @param {CreateZCFVat} createZCFVat - the ability to create a new
|
|
47
47
|
* ZCF Vat
|
|
48
48
|
* @param {GetBundleCapForID} getBundleCapForID
|
|
49
|
-
* @param {ShutdownWithFailure} shutdownZoeVat
|
|
49
|
+
* @param {import('@agoric/swingset-vat').ShutdownWithFailure} shutdownZoeVat
|
|
50
50
|
* @param {{
|
|
51
51
|
* getFeeIssuerKit: GetFeeIssuerKit,
|
|
52
52
|
* getFeeIssuer: () => Issuer,
|
|
@@ -122,7 +122,7 @@ export const makeZoeStorageManager = (
|
|
|
122
122
|
'zoeMintBaggageSet',
|
|
123
123
|
);
|
|
124
124
|
for (const issuerBaggage of zoeMintBaggageSet.values()) {
|
|
125
|
-
|
|
125
|
+
upgradeIssuerKit(issuerBaggage);
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
const makeZoeMint = prepareExoClass(
|
|
@@ -275,8 +275,9 @@ export const makeZoeStorageManager = (
|
|
|
275
275
|
ownKeys(customDetails).length >= 1
|
|
276
276
|
? harden({ customDetails })
|
|
277
277
|
: harden({});
|
|
278
|
+
/** @type {InvitationAmount} */
|
|
278
279
|
const invitationAmount = AmountMath.make(
|
|
279
|
-
invitationKit.brand,
|
|
280
|
+
/** @type {Brand<'set'>} */ (invitationKit.brand),
|
|
280
281
|
harden([
|
|
281
282
|
{
|
|
282
283
|
...extraProperties,
|
|
@@ -401,6 +402,7 @@ export const makeZoeStorageManager = (
|
|
|
401
402
|
contractBundleCap,
|
|
402
403
|
contractLabel,
|
|
403
404
|
);
|
|
405
|
+
// @ts-expect-error checked cast
|
|
404
406
|
return makeInstanceStorageManager(instanceRecord, adminNode, root)
|
|
405
407
|
.instanceStorageManager;
|
|
406
408
|
};
|
|
@@ -4,8 +4,8 @@
|
|
|
4
4
|
* @property {Brand<'nat'>} actualBrandOut
|
|
5
5
|
* @property {Array<number>} [priceList]
|
|
6
6
|
* @property {Array<[number, number]>} [tradeList]
|
|
7
|
-
* @property {
|
|
8
|
-
* @property {import('@agoric/time
|
|
7
|
+
* @property {import('@agoric/time').TimerService} timer
|
|
8
|
+
* @property {import('@agoric/time').RelativeTime} [quoteInterval]
|
|
9
9
|
* @property {ERef<Mint<'set'>>} [quoteMint]
|
|
10
10
|
* @property {Amount<'nat'>} [unitAmountIn]
|
|
11
11
|
*/
|
|
@@ -18,13 +18,14 @@
|
|
|
18
18
|
*/
|
|
19
19
|
export function makeFakePriceAuthority(options: FakePriceAuthorityOptions): Promise<PriceAuthority>;
|
|
20
20
|
export type FakePriceAuthorityOptions = {
|
|
21
|
-
actualBrandIn: Brand<
|
|
22
|
-
actualBrandOut: Brand<
|
|
21
|
+
actualBrandIn: Brand<"nat">;
|
|
22
|
+
actualBrandOut: Brand<"nat">;
|
|
23
23
|
priceList?: number[] | undefined;
|
|
24
24
|
tradeList?: [number, number][] | undefined;
|
|
25
|
-
timer:
|
|
26
|
-
quoteInterval?: import("@agoric/time
|
|
27
|
-
quoteMint?: ERef<Mint<"set">> | undefined;
|
|
28
|
-
unitAmountIn?:
|
|
25
|
+
timer: import("@agoric/time").TimerService;
|
|
26
|
+
quoteInterval?: import("@agoric/time").RelativeTime | undefined;
|
|
27
|
+
quoteMint?: globalThis.ERef<globalThis.Mint<"set">> | undefined;
|
|
28
|
+
unitAmountIn?: import("@agoric/ertp/src/types.js").NatAmount | undefined;
|
|
29
29
|
};
|
|
30
|
+
import type { PriceAuthority } from '@agoric/zoe/tools/types.js';
|
|
30
31
|
//# sourceMappingURL=fakePriceAuthority.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fakePriceAuthority.d.ts","sourceRoot":"","sources":["fakePriceAuthority.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"fakePriceAuthority.d.ts","sourceRoot":"","sources":["fakePriceAuthority.js"],"names":[],"mappings":"AAwBA;;;;;;;;;;GAUG;AAEH;;;;;;GAMG;AACH,gDAHW,yBAAyB,2BAySnC;;mBAvTa,KAAK,CAAC,KAAK,CAAC;oBACZ,KAAK,CAAC,KAAK,CAAC;;;WAGZ,OAAO,cAAc,EAAE,YAAY;;;;;oCAjB4C,4BAA4B"}
|