@agoric/zoe 0.26.2 → 0.26.3-calypso-dev-84eb287.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 +628 -314
- package/bundles/bundle-contractFacet.d.ts +3 -3
- package/bundles/bundle-contractFacet.js +1 -1
- package/exported.js +1 -12
- package/package.json +75 -59
- package/src/cleanProposal.d.ts +2 -2
- package/src/cleanProposal.d.ts.map +1 -1
- package/src/cleanProposal.js +15 -12
- package/src/contractFacet/evalContractCode.d.ts.map +1 -1
- package/src/contractFacet/evalContractCode.js +2 -2
- 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/typeGuards.d.ts +8 -0
- package/src/contractFacet/typeGuards.d.ts.map +1 -0
- package/src/contractFacet/typeGuards.js +25 -0
- package/src/contractFacet/types-ambient.d.ts +271 -0
- package/src/contractFacet/types-ambient.js +1 -0
- package/src/contractFacet/vatRoot.d.ts +3 -3
- package/src/contractFacet/vatRoot.d.ts.map +1 -1
- package/src/contractFacet/zcfMint.d.ts +4 -2
- package/src/contractFacet/zcfMint.d.ts.map +1 -1
- package/src/contractFacet/zcfMint.js +7 -7
- package/src/contractFacet/zcfSeat.d.ts +4 -2
- package/src/contractFacet/zcfSeat.d.ts.map +1 -1
- package/src/contractFacet/zcfSeat.js +130 -7
- package/src/contractFacet/zcfZygote.d.ts +1 -2
- package/src/contractFacet/zcfZygote.d.ts.map +1 -1
- package/src/contractFacet/zcfZygote.js +102 -48
- 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 +33 -18
- package/src/contractSupport/priceAuthorityInitial.d.ts +3 -2
- package/src/contractSupport/priceAuthorityInitial.d.ts.map +1 -1
- package/src/contractSupport/priceAuthorityInitial.js +6 -3
- 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 +13 -11
- 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 +33 -119
- 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 +6 -12
- 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 +3 -3
- 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 +3 -2
- 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 +9 -5
- 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 +2 -1
- 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 +6 -2
- package/src/contracts/oracle.d.ts.map +1 -1
- package/src/contracts/oracle.js +10 -3
- 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 +25 -17
- package/src/contracts/priceAggregator.d.ts.map +1 -1
- package/src/contracts/priceAggregator.js +33 -32
- package/src/contracts/priceAggregatorTypes.d.ts +2 -2
- package/src/contracts/priceAggregatorTypes.d.ts.map +1 -1
- package/src/contracts/scaledPriceAuthority.d.ts +3 -4
- 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 +3 -4
- 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 +21 -32
- package/src/internal-types.d.ts.map +1 -1
- package/src/internal-types.js +19 -58
- package/src/issuerRecord.d.ts +1 -1
- package/src/issuerRecord.d.ts.map +1 -1
- package/src/issuerStorage.d.ts +3 -3
- 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 +114 -20
- package/src/typeGuards.d.ts.map +1 -1
- package/src/typeGuards.js +19 -20
- package/src/types-ambient.d.ts +41 -0
- package/src/types-ambient.d.ts.map +1 -0
- package/src/{types.js → types-ambient.js} +7 -15
- 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 +2 -1
- package/src/zoeService/internal-types.d.ts +12 -12
- 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 +82 -37
- package/src/zoeService/{types.d.ts → types-ambient.d.ts} +23 -28
- 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 +57 -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 +14 -8
- package/src/zoeService/zoe.d.ts.map +1 -1
- package/src/zoeService/zoe.js +39 -11
- package/src/zoeService/zoeSeat.d.ts +15 -45
- package/src/zoeService/zoeSeat.d.ts.map +1 -1
- package/src/zoeService/zoeSeat.js +215 -115
- package/src/zoeService/zoeStorageManager.d.ts +13 -47
- package/src/zoeService/zoeStorageManager.d.ts.map +1 -1
- package/src/zoeService/zoeStorageManager.js +13 -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 +16 -3
- package/tools/manualTimer.d.ts +17 -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 +8 -3
- package/tools/setup-zoe.d.ts +10 -6
- 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 -1171
- 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,3 +1,4 @@
|
|
|
1
|
+
/* eslint @typescript-eslint/no-floating-promises: "warn" */
|
|
1
2
|
import { E } from '@endo/eventual-send';
|
|
2
3
|
import { passStyleOf } from '@endo/marshal';
|
|
3
4
|
import {
|
|
@@ -5,14 +6,23 @@ import {
|
|
|
5
6
|
makeScalarBigMapStore,
|
|
6
7
|
provideDurableWeakMapStore,
|
|
7
8
|
prepareExoClass,
|
|
9
|
+
prepareExo,
|
|
10
|
+
watchPromise,
|
|
8
11
|
} from '@agoric/vat-data';
|
|
9
12
|
import { initEmpty } from '@agoric/store';
|
|
13
|
+
import { isUpgradeDisconnection } from '@agoric/internal/src/upgrade-api.js';
|
|
10
14
|
|
|
11
15
|
import { defineDurableHandle } from '../makeHandle.js';
|
|
12
16
|
import { makeInstanceAdminMaker } from './instanceAdminStorage.js';
|
|
13
|
-
import {
|
|
17
|
+
import {
|
|
18
|
+
AdminFacetI,
|
|
19
|
+
InstanceAdminI,
|
|
20
|
+
InstanceAdminShape,
|
|
21
|
+
} from '../typeGuards.js';
|
|
22
|
+
|
|
23
|
+
// import '../internal-types.js';
|
|
14
24
|
|
|
15
|
-
/** @
|
|
25
|
+
/** @import {Baggage} from '@agoric/vat-data' */
|
|
16
26
|
/** @typedef { import('@agoric/swingset-vat').BundleCap} BundleCap */
|
|
17
27
|
|
|
18
28
|
const { Fail, quote: q } = assert;
|
|
@@ -22,7 +32,7 @@ const { Fail, quote: q } = assert;
|
|
|
22
32
|
* @param {() => ERef<BundleCap>} getZcfBundleCapP
|
|
23
33
|
* @param {(id: string) => BundleCap} getBundleCapByIdNow
|
|
24
34
|
* @param {Baggage} zoeBaggage
|
|
25
|
-
* @returns {import('./utils').StartInstance}
|
|
35
|
+
* @returns {import('./utils.js').StartInstance}
|
|
26
36
|
*/
|
|
27
37
|
export const makeStartInstance = (
|
|
28
38
|
startInstanceAccess,
|
|
@@ -43,13 +53,54 @@ export const makeStartInstance = (
|
|
|
43
53
|
seatHandleToZoeSeatAdmin,
|
|
44
54
|
);
|
|
45
55
|
|
|
56
|
+
const getFreshZcfBundleCap = async () => {
|
|
57
|
+
const settledBundleCap = await getZcfBundleCapP();
|
|
58
|
+
settledBundleCap !== undefined || Fail`the ZCF bundle cap was broken`;
|
|
59
|
+
return settledBundleCap;
|
|
60
|
+
};
|
|
61
|
+
|
|
46
62
|
const InstanceAdminStateShape = harden({
|
|
47
63
|
instanceStorage: M.remotable('ZoeInstanceStorageManager'),
|
|
48
64
|
instanceAdmin: M.remotable('InstanceAdmin'),
|
|
49
|
-
seatHandleToSeatAdmin: M.remotable(),
|
|
65
|
+
seatHandleToSeatAdmin: M.remotable(), // seatHandleToSeatAdmin, but putting that string here is backwards-incompatible
|
|
50
66
|
adminNode: M.remotable('adminNode'),
|
|
51
67
|
});
|
|
52
68
|
|
|
69
|
+
/** @type {import('@agoric/swingset-liveslots').PromiseWatcher<Completion, [InstanceAdmin, Handle<'adminNode'>]>} */
|
|
70
|
+
const watcher = prepareExo(
|
|
71
|
+
zoeBaggage,
|
|
72
|
+
'InstanceCompletionWatcher',
|
|
73
|
+
M.interface('InstanceCompletionWatcher', {
|
|
74
|
+
onFulfilled: M.call(
|
|
75
|
+
M.any(),
|
|
76
|
+
InstanceAdminShape,
|
|
77
|
+
M.remotable('adminNode'),
|
|
78
|
+
).returns(),
|
|
79
|
+
onRejected: M.call(
|
|
80
|
+
M.any(),
|
|
81
|
+
InstanceAdminShape,
|
|
82
|
+
M.remotable('adminNode'),
|
|
83
|
+
).returns(),
|
|
84
|
+
}),
|
|
85
|
+
{
|
|
86
|
+
onFulfilled: (completion, instanceAdmin) =>
|
|
87
|
+
instanceAdmin.exitAllSeats(completion),
|
|
88
|
+
onRejected: (/** @type {Error} */ reason, instanceAdmin, adminNode) => {
|
|
89
|
+
if (isUpgradeDisconnection(reason)) {
|
|
90
|
+
console.log(`resetting promise watcher after upgrade`, reason);
|
|
91
|
+
// eslint-disable-next-line no-use-before-define
|
|
92
|
+
watchForAdminNodeDone(adminNode, instanceAdmin);
|
|
93
|
+
} else {
|
|
94
|
+
instanceAdmin.failAllSeats(reason);
|
|
95
|
+
}
|
|
96
|
+
},
|
|
97
|
+
},
|
|
98
|
+
);
|
|
99
|
+
|
|
100
|
+
const watchForAdminNodeDone = (adminNode, instAdmin) => {
|
|
101
|
+
watchPromise(E(adminNode).done(), watcher, instAdmin, adminNode);
|
|
102
|
+
};
|
|
103
|
+
|
|
53
104
|
const makeZoeInstanceAdmin = prepareExoClass(
|
|
54
105
|
zoeBaggage,
|
|
55
106
|
'zoeInstanceAdmin',
|
|
@@ -124,10 +175,10 @@ export const makeStartInstance = (
|
|
|
124
175
|
replaceAllocations(seatHandleAllocations) {
|
|
125
176
|
const { state } = this;
|
|
126
177
|
try {
|
|
127
|
-
|
|
178
|
+
for (const { seatHandle, allocation } of seatHandleAllocations) {
|
|
128
179
|
const zoeSeatAdmin = state.seatHandleToSeatAdmin.get(seatHandle);
|
|
129
180
|
zoeSeatAdmin.replaceAllocation(allocation);
|
|
130
|
-
}
|
|
181
|
+
}
|
|
131
182
|
} catch (err) {
|
|
132
183
|
// nothing for Zoe to do if the termination fails
|
|
133
184
|
void E(state.adminNode).terminateWithFailure(err);
|
|
@@ -154,6 +205,10 @@ export const makeStartInstance = (
|
|
|
154
205
|
const { state } = this;
|
|
155
206
|
return state.instanceAdmin.isBlocked(string);
|
|
156
207
|
},
|
|
208
|
+
repairContractCompletionWatcher() {
|
|
209
|
+
const { state, self } = this;
|
|
210
|
+
void watchForAdminNodeDone(state.adminNode, self);
|
|
211
|
+
},
|
|
157
212
|
},
|
|
158
213
|
{
|
|
159
214
|
stateShape: InstanceAdminStateShape,
|
|
@@ -178,12 +233,10 @@ export const makeStartInstance = (
|
|
|
178
233
|
/**
|
|
179
234
|
*
|
|
180
235
|
* @param {import('@agoric/swingset-vat').VatAdminFacet} adminNode
|
|
181
|
-
* @param {*} zcfBundleCap
|
|
182
236
|
* @param {*} contractBundleCap
|
|
183
237
|
*/
|
|
184
|
-
(adminNode,
|
|
238
|
+
(adminNode, contractBundleCap) => ({
|
|
185
239
|
adminNode,
|
|
186
|
-
zcfBundleCap,
|
|
187
240
|
contractBundleCap,
|
|
188
241
|
}),
|
|
189
242
|
{
|
|
@@ -200,36 +253,40 @@ export const makeStartInstance = (
|
|
|
200
253
|
privateArgs: newPrivateArgs,
|
|
201
254
|
};
|
|
202
255
|
|
|
203
|
-
return E(
|
|
204
|
-
vatParameters,
|
|
205
|
-
|
|
256
|
+
return E.when(getFreshZcfBundleCap(), bCap =>
|
|
257
|
+
E(state.adminNode).upgrade(bCap, { vatParameters }),
|
|
258
|
+
);
|
|
206
259
|
},
|
|
207
260
|
async upgradeContract(contractBundleId, newPrivateArgs = undefined) {
|
|
208
261
|
const { state } = this;
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
262
|
+
|
|
263
|
+
const newContractBundleCap =
|
|
264
|
+
await getBundleCapByIdNow(contractBundleId);
|
|
212
265
|
const vatParameters = {
|
|
213
266
|
contractBundleCap: newContractBundleCap,
|
|
214
267
|
privateArgs: newPrivateArgs,
|
|
215
268
|
};
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
269
|
+
state.contractBundleCap = newContractBundleCap;
|
|
270
|
+
return E.when(getFreshZcfBundleCap(), bCap =>
|
|
271
|
+
E(state.adminNode).upgrade(bCap, { vatParameters }),
|
|
272
|
+
);
|
|
219
273
|
},
|
|
220
274
|
},
|
|
221
275
|
);
|
|
222
276
|
|
|
277
|
+
/**
|
|
278
|
+
* @type {import('./utils.js').StartInstance}
|
|
279
|
+
*/
|
|
223
280
|
const startInstance = async (
|
|
224
281
|
installationP,
|
|
225
282
|
uncleanIssuerKeywordRecord = harden({}),
|
|
283
|
+
// @ts-expect-error FIXME may not match the expected terms of SF
|
|
226
284
|
customTerms = harden({}),
|
|
227
285
|
privateArgs = undefined,
|
|
228
286
|
instanceLabel = '',
|
|
229
287
|
) => {
|
|
230
|
-
const { installation, bundle, bundleCap } =
|
|
231
|
-
startInstanceAccess
|
|
232
|
-
).unwrapInstallation(installationP);
|
|
288
|
+
const { installation, bundle, bundleCap } =
|
|
289
|
+
await E(startInstanceAccess).unwrapInstallation(installationP);
|
|
233
290
|
// AWAIT ///
|
|
234
291
|
|
|
235
292
|
const contractBundleCap = bundle || bundleCap;
|
|
@@ -274,15 +331,10 @@ export const makeStartInstance = (
|
|
|
274
331
|
);
|
|
275
332
|
zoeInstanceStorageManager.initInstanceAdmin(instanceHandle, instanceAdmin);
|
|
276
333
|
|
|
277
|
-
|
|
278
|
-
E(adminNode).done(),
|
|
279
|
-
completion => {
|
|
280
|
-
instanceAdmin.exitAllSeats(completion);
|
|
281
|
-
},
|
|
282
|
-
reason => instanceAdmin.failAllSeats(reason),
|
|
283
|
-
);
|
|
334
|
+
void watchForAdminNodeDone(adminNode, instanceAdmin);
|
|
284
335
|
|
|
285
336
|
/** @type {ZoeInstanceAdmin} */
|
|
337
|
+
// @ts-expect-error XXX saveIssuer
|
|
286
338
|
const zoeInstanceAdminForZcf = makeZoeInstanceAdmin(
|
|
287
339
|
zoeInstanceStorageManager,
|
|
288
340
|
instanceAdmin,
|
|
@@ -306,11 +358,9 @@ export const makeStartInstance = (
|
|
|
306
358
|
|
|
307
359
|
instanceAdmin.initDelayedState(handleOfferObj, publicFacet);
|
|
308
360
|
|
|
309
|
-
const settledBundleCap = await getZcfBundleCapP();
|
|
310
|
-
settledBundleCap !== undefined || Fail`the bundle cap was broken`;
|
|
311
|
-
|
|
312
361
|
// creatorInvitation can be undefined, but if it is defined,
|
|
313
362
|
// let's make sure it is an invitation.
|
|
363
|
+
// @ts-expect-error cast
|
|
314
364
|
return E.when(
|
|
315
365
|
Promise.all([
|
|
316
366
|
creatorInvitationP,
|
|
@@ -324,11 +374,7 @@ export const makeStartInstance = (
|
|
|
324
374
|
isLiveResult ||
|
|
325
375
|
Fail`The contract did not correctly return a creatorInvitation`;
|
|
326
376
|
|
|
327
|
-
const adminFacet = makeAdminFacet(
|
|
328
|
-
adminNode,
|
|
329
|
-
harden(settledBundleCap),
|
|
330
|
-
contractBundleCap,
|
|
331
|
-
);
|
|
377
|
+
const adminFacet = makeAdminFacet(adminNode, contractBundleCap);
|
|
332
378
|
|
|
333
379
|
// Actually returned to the user.
|
|
334
380
|
return harden({
|
|
@@ -343,6 +389,5 @@ export const makeStartInstance = (
|
|
|
343
389
|
},
|
|
344
390
|
);
|
|
345
391
|
};
|
|
346
|
-
// @ts-expect-error cast
|
|
347
392
|
return harden(startInstance);
|
|
348
393
|
};
|
|
@@ -23,12 +23,12 @@ type ZoeService = {
|
|
|
23
23
|
getInvitationIssuer: GetInvitationIssuer;
|
|
24
24
|
install: InstallBundle;
|
|
25
25
|
installBundleID: InstallBundleID;
|
|
26
|
-
startInstance: import(
|
|
26
|
+
startInstance: import("./utils.js").StartInstance;
|
|
27
27
|
offer: Offer;
|
|
28
|
-
getPublicFacet: import(
|
|
28
|
+
getPublicFacet: import("./utils.js").GetPublicFacet;
|
|
29
29
|
getIssuers: GetIssuers;
|
|
30
30
|
getBrands: GetBrands;
|
|
31
|
-
getTerms: import(
|
|
31
|
+
getTerms: import("./utils.js").GetTerms;
|
|
32
32
|
getOfferFilter: GetOfferFilter;
|
|
33
33
|
getInstallationForInstance: GetInstallationForInstance;
|
|
34
34
|
getInstance: GetInstance;
|
|
@@ -43,19 +43,19 @@ type ZoeService = {
|
|
|
43
43
|
getBundleIDFromInstallation: GetBundleIDFromInstallation;
|
|
44
44
|
getProposalShapeForInvitation: (invitationHandle: InvitationHandle) => Pattern | undefined;
|
|
45
45
|
};
|
|
46
|
-
type GetInvitationIssuer = () => Promise<Issuer<
|
|
47
|
-
type GetFeeIssuer = () => Promise<Issuer<
|
|
46
|
+
type GetInvitationIssuer = () => Promise<Issuer<"set", InvitationDetails>>;
|
|
47
|
+
type GetFeeIssuer = () => Promise<Issuer<"nat">>;
|
|
48
48
|
type GetConfiguration = () => {
|
|
49
49
|
feeIssuerConfig: FeeIssuerConfig;
|
|
50
50
|
};
|
|
51
|
-
type GetIssuers = (instance: import(
|
|
52
|
-
type GetBrands = (instance: import(
|
|
53
|
-
type GetOfferFilter = (instance: import(
|
|
51
|
+
type GetIssuers = (instance: import("./utils.js").Instance<any>) => Promise<IssuerKeywordRecord>;
|
|
52
|
+
type GetBrands = (instance: import("./utils.js").Instance<any>) => Promise<BrandKeywordRecord>;
|
|
53
|
+
type GetOfferFilter = (instance: import("./utils.js").Instance<any>) => string[];
|
|
54
54
|
type SetOfferFilter = (instance: Instance, strings: string[]) => any;
|
|
55
|
-
type GetInstallationForInstance = (instance: import(
|
|
56
|
-
type GetInstance = (invitation: ERef<Invitation>) => Promise<import(
|
|
55
|
+
type GetInstallationForInstance = (instance: import("./utils.js").Instance<any>) => Promise<Installation>;
|
|
56
|
+
type GetInstance = (invitation: ERef<Invitation>) => Promise<import("./utils.js").Instance<any>>;
|
|
57
57
|
type GetInstallation = (invitation: ERef<Invitation>) => Promise<Installation>;
|
|
58
|
-
type GetInvitationDetails = (invitation: ERef<Invitation
|
|
58
|
+
type GetInvitationDetails = (invitation: ERef<Invitation<any, any>>) => Promise<InvitationDetails>;
|
|
59
59
|
/**
|
|
60
60
|
* Create an installation by safely evaluating the code and
|
|
61
61
|
* registering it with Zoe. Returns an installation.
|
|
@@ -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 = <
|
|
88
|
+
type Offer = <Result, Args = undefined>(invitation: ERef<Invitation<Result, Args>>, proposal?: Proposal, paymentKeywordRecord?: PaymentPKeywordRecord, offerArgs?: Args) => 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
|
|
@@ -161,14 +161,10 @@ type ProposalRecord = {
|
|
|
161
161
|
* { Asset: AmountMath.make(assetBrand, 5n), Price:
|
|
162
162
|
* AmountMath.make(priceBrand, 9n) }
|
|
163
163
|
*/
|
|
164
|
-
type AmountKeywordRecord = Record<Keyword,
|
|
164
|
+
type AmountKeywordRecord = Record<Keyword, import("@agoric/ertp/src/types.js").AnyAmount>;
|
|
165
165
|
type Waker = {
|
|
166
166
|
wake: () => void;
|
|
167
167
|
};
|
|
168
|
-
type Deadline = import('@agoric/time/src/types').Timestamp;
|
|
169
|
-
type Timer = {
|
|
170
|
-
setWakeup: (deadline: Deadline, wakerP: ERef<Waker>) => void;
|
|
171
|
-
};
|
|
172
168
|
type OnDemandExitRule = {
|
|
173
169
|
onDemand: null;
|
|
174
170
|
};
|
|
@@ -177,8 +173,8 @@ type WaivedExitRule = {
|
|
|
177
173
|
};
|
|
178
174
|
type AfterDeadlineExitRule = {
|
|
179
175
|
afterDeadline: {
|
|
180
|
-
timer:
|
|
181
|
-
deadline:
|
|
176
|
+
timer: import("@agoric/time").TimerService;
|
|
177
|
+
deadline: import("@agoric/time").Timestamp;
|
|
182
178
|
};
|
|
183
179
|
};
|
|
184
180
|
/**
|
|
@@ -187,13 +183,12 @@ type AfterDeadlineExitRule = {
|
|
|
187
183
|
* The possible records are:
|
|
188
184
|
* `{ waived: null }`
|
|
189
185
|
* `{ onDemand: null }`
|
|
190
|
-
* `{ afterDeadline: { timer :Timer<Deadline>, deadline :Deadline } }
|
|
186
|
+
* `{ afterDeadline: { timer :Timer<Deadline>, deadline :Deadline } }`
|
|
191
187
|
*/
|
|
192
188
|
type ExitRule = OnDemandExitRule | WaivedExitRule | AfterDeadlineExitRule;
|
|
193
|
-
type Instance = import(
|
|
194
|
-
type VatAdminSvc = import('@agoric/swingset-vat').VatAdminSvc;
|
|
189
|
+
type Instance = import("./utils.js").Instance<any>;
|
|
195
190
|
type ZCFSpec = {
|
|
196
|
-
bundleCap: import(
|
|
191
|
+
bundleCap: import("@agoric/swingset-vat").BundleCap;
|
|
197
192
|
} | {
|
|
198
193
|
name: string;
|
|
199
194
|
} | {
|
|
@@ -207,13 +202,13 @@ type PaymentPKeywordRecord = Record<Keyword, ERef<Payment<any>>>;
|
|
|
207
202
|
type PaymentKeywordRecord = Record<Keyword, Payment<any>>;
|
|
208
203
|
type InvitationDetails = {
|
|
209
204
|
installation: Installation;
|
|
210
|
-
instance: import(
|
|
205
|
+
instance: import("./utils.js").Instance<any>;
|
|
211
206
|
handle: InvitationHandle;
|
|
212
207
|
description: string;
|
|
213
208
|
customDetails?: Record<string, any> | undefined;
|
|
214
209
|
};
|
|
215
|
-
type Installation<SF = any> = import(
|
|
216
|
-
type InstallationStart<I extends Installation
|
|
210
|
+
type Installation<SF = any> = import("./utils.js").Installation<SF>;
|
|
211
|
+
type InstallationStart<I extends Installation> = import("./utils.js").InstallationStart<I>;
|
|
217
212
|
type FeeIssuerConfig = {
|
|
218
213
|
name: string;
|
|
219
214
|
assetKind: AssetKind;
|
|
@@ -222,5 +217,5 @@ type FeeIssuerConfig = {
|
|
|
222
217
|
type ZoeFeesConfig = {
|
|
223
218
|
getPublicFacetFee: NatValue;
|
|
224
219
|
};
|
|
225
|
-
type FeeMintAccess = Handle<
|
|
226
|
-
//# sourceMappingURL=types.d.ts.map
|
|
220
|
+
type FeeMintAccess = Handle<"feeMintAccess">;
|
|
221
|
+
//# sourceMappingURL=types-ambient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types-ambient.d.ts","sourceRoot":"","sources":["types-ambient.js"],"names":[],"mappings":"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"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @jessie-check
|
|
2
2
|
|
|
3
|
-
/// <reference types="ses"/>
|
|
3
|
+
/// <reference types="ses" />
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* @typedef {object} ZoeService
|
|
@@ -28,12 +28,12 @@
|
|
|
28
28
|
*
|
|
29
29
|
* @property {InstallBundle} install
|
|
30
30
|
* @property {InstallBundleID} installBundleID
|
|
31
|
-
* @property {import('./utils').StartInstance} startInstance
|
|
31
|
+
* @property {import('./utils.js').StartInstance} startInstance
|
|
32
32
|
* @property {Offer} offer
|
|
33
|
-
* @property {import('./utils').GetPublicFacet} getPublicFacet
|
|
33
|
+
* @property {import('./utils.js').GetPublicFacet} getPublicFacet
|
|
34
34
|
* @property {GetIssuers} getIssuers
|
|
35
35
|
* @property {GetBrands} getBrands
|
|
36
|
-
* @property {import('./utils').GetTerms} getTerms
|
|
36
|
+
* @property {import('./utils.js').GetTerms} getTerms
|
|
37
37
|
* @property {GetOfferFilter} getOfferFilter
|
|
38
38
|
* @property {GetInstallationForInstance} getInstallationForInstance
|
|
39
39
|
* @property {GetInstance} getInstance
|
|
@@ -49,7 +49,7 @@
|
|
|
49
49
|
|
|
50
50
|
/**
|
|
51
51
|
* @callback GetInvitationIssuer
|
|
52
|
-
* @returns {Promise<Issuer<'set'>>}
|
|
52
|
+
* @returns {Promise<Issuer<'set', InvitationDetails>>}
|
|
53
53
|
*/
|
|
54
54
|
|
|
55
55
|
/**
|
|
@@ -66,19 +66,19 @@
|
|
|
66
66
|
|
|
67
67
|
/**
|
|
68
68
|
* @callback GetIssuers
|
|
69
|
-
* @param {import('./utils').Instance<any>} instance
|
|
69
|
+
* @param {import('./utils.js').Instance<any>} instance
|
|
70
70
|
* @returns {Promise<IssuerKeywordRecord>}
|
|
71
71
|
*/
|
|
72
72
|
|
|
73
73
|
/**
|
|
74
74
|
* @callback GetBrands
|
|
75
|
-
* @param {import('./utils').Instance<any>} instance
|
|
75
|
+
* @param {import('./utils.js').Instance<any>} instance
|
|
76
76
|
* @returns {Promise<BrandKeywordRecord>}
|
|
77
77
|
*/
|
|
78
78
|
|
|
79
79
|
/**
|
|
80
80
|
* @callback GetOfferFilter
|
|
81
|
-
* @param {import('./utils').Instance<any>} instance
|
|
81
|
+
* @param {import('./utils.js').Instance<any>} instance
|
|
82
82
|
* @returns {string[]}
|
|
83
83
|
*/
|
|
84
84
|
|
|
@@ -90,14 +90,14 @@
|
|
|
90
90
|
|
|
91
91
|
/**
|
|
92
92
|
* @callback GetInstallationForInstance
|
|
93
|
-
* @param {import('./utils').Instance<any>} instance
|
|
93
|
+
* @param {import('./utils.js').Instance<any>} instance
|
|
94
94
|
* @returns {Promise<Installation>}
|
|
95
95
|
*/
|
|
96
96
|
|
|
97
97
|
/**
|
|
98
98
|
* @callback GetInstance
|
|
99
99
|
* @param {ERef<Invitation>} invitation
|
|
100
|
-
* @returns {Promise<import('./utils').Instance<any>>}
|
|
100
|
+
* @returns {Promise<import('./utils.js').Instance<any>>}
|
|
101
101
|
*/
|
|
102
102
|
|
|
103
103
|
/**
|
|
@@ -108,7 +108,7 @@
|
|
|
108
108
|
|
|
109
109
|
/**
|
|
110
110
|
* @callback GetInvitationDetails
|
|
111
|
-
* @param {ERef<Invitation
|
|
111
|
+
* @param {ERef<Invitation<any, any>>} invitation
|
|
112
112
|
* @returns {Promise<InvitationDetails>}
|
|
113
113
|
*/
|
|
114
114
|
|
|
@@ -148,7 +148,7 @@
|
|
|
148
148
|
*/
|
|
149
149
|
|
|
150
150
|
/**
|
|
151
|
-
* @typedef {<
|
|
151
|
+
* @typedef {<Result, Args = undefined>(
|
|
152
152
|
* invitation: ERef<Invitation<Result, Args>>,
|
|
153
153
|
* proposal?: Proposal,
|
|
154
154
|
* paymentKeywordRecord?: PaymentPKeywordRecord,
|
|
@@ -232,7 +232,7 @@
|
|
|
232
232
|
*/
|
|
233
233
|
|
|
234
234
|
/**
|
|
235
|
-
* @typedef {Record<Keyword,
|
|
235
|
+
* @typedef {Record<Keyword, import('@agoric/ertp/src/types.js').AnyAmount>} AmountKeywordRecord
|
|
236
236
|
*
|
|
237
237
|
* The keys are keywords, and the values are amounts. For example:
|
|
238
238
|
* { Asset: AmountMath.make(assetBrand, 5n), Price:
|
|
@@ -244,15 +244,6 @@
|
|
|
244
244
|
* @property {() => void} wake
|
|
245
245
|
*/
|
|
246
246
|
|
|
247
|
-
/**
|
|
248
|
-
* @typedef {import('@agoric/time/src/types').Timestamp} Deadline
|
|
249
|
-
*/
|
|
250
|
-
|
|
251
|
-
/**
|
|
252
|
-
* @typedef {object} Timer
|
|
253
|
-
* @property {(deadline: Deadline, wakerP: ERef<Waker>) => void} setWakeup
|
|
254
|
-
*/
|
|
255
|
-
|
|
256
247
|
/**
|
|
257
248
|
* @typedef {object} OnDemandExitRule
|
|
258
249
|
* @property {null} onDemand
|
|
@@ -265,7 +256,7 @@
|
|
|
265
256
|
|
|
266
257
|
/**
|
|
267
258
|
* @typedef {object} AfterDeadlineExitRule
|
|
268
|
-
* @property {{timer:
|
|
259
|
+
* @property {{timer: import('@agoric/time').TimerService, deadline: import('@agoric/time').Timestamp}} afterDeadline
|
|
269
260
|
*/
|
|
270
261
|
|
|
271
262
|
/**
|
|
@@ -276,15 +267,11 @@
|
|
|
276
267
|
* The possible records are:
|
|
277
268
|
* `{ waived: null }`
|
|
278
269
|
* `{ onDemand: null }`
|
|
279
|
-
* `{ afterDeadline: { timer :Timer<Deadline>, deadline :Deadline } }
|
|
280
|
-
*/
|
|
281
|
-
|
|
282
|
-
/**
|
|
283
|
-
* @typedef {import('./utils').Instance<any>} Instance
|
|
270
|
+
* `{ afterDeadline: { timer :Timer<Deadline>, deadline :Deadline } }`
|
|
284
271
|
*/
|
|
285
272
|
|
|
286
273
|
/**
|
|
287
|
-
* @typedef {import('
|
|
274
|
+
* @typedef {import('./utils.js').Instance<any>} Instance
|
|
288
275
|
*/
|
|
289
276
|
|
|
290
277
|
/**
|
|
@@ -304,7 +291,7 @@
|
|
|
304
291
|
/**
|
|
305
292
|
* @typedef {object} InvitationDetails
|
|
306
293
|
* @property {Installation} installation
|
|
307
|
-
* @property {import('./utils').Instance<any>} instance
|
|
294
|
+
* @property {import('./utils.js').Instance<any>} instance
|
|
308
295
|
* @property {InvitationHandle} handle
|
|
309
296
|
* @property {string} description
|
|
310
297
|
* @property {Record<string, any>} [customDetails]
|
|
@@ -312,12 +299,12 @@
|
|
|
312
299
|
|
|
313
300
|
/**
|
|
314
301
|
* @template [SF=any] contract start function
|
|
315
|
-
* @typedef {import('./utils').Installation<SF>} Installation
|
|
302
|
+
* @typedef {import('./utils.js').Installation<SF>} Installation
|
|
316
303
|
*/
|
|
317
304
|
|
|
318
305
|
/**
|
|
319
306
|
* @template {Installation} I
|
|
320
|
-
* @typedef {import('./utils').InstallationStart<I>} InstallationStart
|
|
307
|
+
* @typedef {import('./utils.js').InstallationStart<I>} InstallationStart
|
|
321
308
|
*/
|
|
322
309
|
|
|
323
310
|
/**
|