@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,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
|
-
makeDurableIssuerKit,
|
|
3
2
|
AssetKind,
|
|
4
|
-
prepareIssuerKit,
|
|
5
3
|
IssuerShape,
|
|
6
4
|
BrandShape,
|
|
5
|
+
prepareIssuerKit,
|
|
6
|
+
hasIssuer,
|
|
7
7
|
} from '@agoric/ertp';
|
|
8
8
|
import { initEmpty, M } from '@agoric/store';
|
|
9
9
|
import {
|
|
@@ -13,8 +13,9 @@ import {
|
|
|
13
13
|
} from '@agoric/vat-data';
|
|
14
14
|
import { FeeMintAccessShape } from '../typeGuards.js';
|
|
15
15
|
|
|
16
|
-
const { Fail } = assert;
|
|
16
|
+
const { Fail, quote: q } = assert;
|
|
17
17
|
|
|
18
|
+
/** @deprecated Redundant. Just omit it. */
|
|
18
19
|
const FEE_MINT_KIT = 'FeeMintKit';
|
|
19
20
|
|
|
20
21
|
export const defaultFeeIssuerConfig = harden(
|
|
@@ -28,23 +29,28 @@ export const defaultFeeIssuerConfig = harden(
|
|
|
28
29
|
/**
|
|
29
30
|
* @param {import('@agoric/vat-data').Baggage} zoeBaggage
|
|
30
31
|
* @param {FeeIssuerConfig} feeIssuerConfig
|
|
31
|
-
* @param {ShutdownWithFailure} shutdownZoeVat
|
|
32
|
+
* @param {import('@agoric/swingset-vat').ShutdownWithFailure} shutdownZoeVat
|
|
32
33
|
*/
|
|
33
34
|
const prepareFeeMint = (zoeBaggage, feeIssuerConfig, shutdownZoeVat) => {
|
|
34
35
|
const mintBaggage = provideDurableMapStore(zoeBaggage, 'mintBaggage');
|
|
35
|
-
if (
|
|
36
|
-
|
|
37
|
-
|
|
36
|
+
if (mintBaggage.has(FEE_MINT_KIT)) {
|
|
37
|
+
hasIssuer(mintBaggage) ||
|
|
38
|
+
Fail`Legacy ${q(
|
|
39
|
+
FEE_MINT_KIT,
|
|
40
|
+
)} must be redundant with normal storing of issuerKit in issuerBaggage`;
|
|
41
|
+
// Upgrade this legacy state by simply deleting it.
|
|
42
|
+
mintBaggage.delete(FEE_MINT_KIT);
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
const feeIssuerKit = /** @type {IssuerKit<'nat'>} */ (
|
|
46
|
+
prepareIssuerKit(
|
|
38
47
|
mintBaggage,
|
|
39
48
|
feeIssuerConfig.name,
|
|
40
49
|
feeIssuerConfig.assetKind,
|
|
41
50
|
feeIssuerConfig.displayInfo,
|
|
42
51
|
shutdownZoeVat,
|
|
43
|
-
)
|
|
44
|
-
|
|
45
|
-
} else {
|
|
46
|
-
prepareIssuerKit(mintBaggage, shutdownZoeVat);
|
|
47
|
-
}
|
|
52
|
+
)
|
|
53
|
+
);
|
|
48
54
|
|
|
49
55
|
const FeeMintIKit = harden({
|
|
50
56
|
feeMint: M.interface('FeeMint', {
|
|
@@ -66,13 +72,13 @@ const prepareFeeMint = (zoeBaggage, feeIssuerConfig, shutdownZoeVat) => {
|
|
|
66
72
|
const { facets } = this;
|
|
67
73
|
facets.feeMintAccess === allegedFeeMintAccess ||
|
|
68
74
|
Fail`The object representing access to the fee brand mint was not provided`;
|
|
69
|
-
return
|
|
75
|
+
return feeIssuerKit;
|
|
70
76
|
},
|
|
71
77
|
getFeeIssuer() {
|
|
72
|
-
return
|
|
78
|
+
return feeIssuerKit.issuer;
|
|
73
79
|
},
|
|
74
80
|
getFeeBrand() {
|
|
75
|
-
return
|
|
81
|
+
return feeIssuerKit.brand;
|
|
76
82
|
},
|
|
77
83
|
},
|
|
78
84
|
// feeMintAccess is an opaque durable object representing the right to get
|
|
@@ -1,21 +1,6 @@
|
|
|
1
|
-
export function makeInstallationStorage(getBundleCapForID: GetBundleCapForID, zoeBaggage:
|
|
1
|
+
export function makeInstallationStorage(getBundleCapForID: GetBundleCapForID, zoeBaggage: Baggage): import("@endo/exo").Guarded<{
|
|
2
2
|
installBundle(allegedBundle: any, bundleLabel: any): any;
|
|
3
|
-
installBundleID(bundleID: any, bundleLabel?: any): Promise<Installation<
|
|
4
|
-
unwrapInstallation(installation: any): {
|
|
5
|
-
bundleCap: any;
|
|
6
|
-
bundleID: string;
|
|
7
|
-
installation: any;
|
|
8
|
-
bundle?: undefined;
|
|
9
|
-
} | {
|
|
10
|
-
bundle: SourceBundle;
|
|
11
|
-
installation: any;
|
|
12
|
-
bundleCap?: undefined;
|
|
13
|
-
bundleID?: undefined;
|
|
14
|
-
};
|
|
15
|
-
getBundleIDFromInstallation(allegedInstallation: any): any;
|
|
16
|
-
} & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
17
|
-
installBundle(allegedBundle: any, bundleLabel: any): any;
|
|
18
|
-
installBundleID(bundleID: any, bundleLabel?: any): Promise<Installation<any>>;
|
|
3
|
+
installBundleID(bundleID: any, bundleLabel?: any): Promise<Installation<unknown>>;
|
|
19
4
|
unwrapInstallation(installation: any): {
|
|
20
5
|
bundleCap: any;
|
|
21
6
|
bundleID: string;
|
|
@@ -29,7 +14,7 @@ export function makeInstallationStorage(getBundleCapForID: GetBundleCapForID, zo
|
|
|
29
14
|
};
|
|
30
15
|
getBundleIDFromInstallation(allegedInstallation: any): any;
|
|
31
16
|
}>;
|
|
32
|
-
export type BundleCap = import(
|
|
33
|
-
export type BundleID = import(
|
|
34
|
-
|
|
17
|
+
export type BundleCap = import("@agoric/swingset-vat").BundleCap;
|
|
18
|
+
export type BundleID = import("@agoric/swingset-vat").BundleID;
|
|
19
|
+
import type { Baggage } from '@agoric/vat-data';
|
|
35
20
|
//# sourceMappingURL=installationStorage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"installationStorage.d.ts","sourceRoot":"","sources":["installationStorage.js"],"names":[],"mappings":"AAuBO,2DAHI,iBAAiB
|
|
1
|
+
{"version":3,"file":"installationStorage.d.ts","sourceRoot":"","sources":["installationStorage.js"],"names":[],"mappings":"AAuBO,2DAHI,iBAAiB;;;;;;;;;;;;;;;GAgJ3B;wBArJc,OAAO,sBAAsB,EAAE,SAAS;uBACxC,OAAO,sBAAsB,EAAE,QAAQ;6BAC3B,kBAAkB"}
|
|
@@ -15,7 +15,7 @@ const { Fail, quote: q } = assert;
|
|
|
15
15
|
|
|
16
16
|
/** @typedef { import('@agoric/swingset-vat').BundleCap} BundleCap */
|
|
17
17
|
/** @typedef { import('@agoric/swingset-vat').BundleID} BundleID */
|
|
18
|
-
/** @
|
|
18
|
+
/** @import {Baggage} from '@agoric/vat-data' */
|
|
19
19
|
|
|
20
20
|
/**
|
|
21
21
|
* @param {GetBundleCapForID} getBundleCapForID
|
|
@@ -33,20 +33,24 @@ export const makeInstallationStorage = (getBundleCapForID, zoeBaggage) => {
|
|
|
33
33
|
'installationsBundle',
|
|
34
34
|
);
|
|
35
35
|
|
|
36
|
+
/** @type {(bundleLabel: string) => Installation<unknown>} */
|
|
36
37
|
const makeBundleIDInstallation = prepareKind(
|
|
37
38
|
zoeBaggage,
|
|
38
39
|
'BundleIDInstallation',
|
|
39
40
|
bundleLabel => ({ bundleLabel }),
|
|
41
|
+
// @ts-expect-error cast without StartFunction property
|
|
40
42
|
{
|
|
41
43
|
getBundle: _context => Fail`bundleID-based Installation`,
|
|
42
44
|
getBundleLabel: ({ state: { bundleLabel } }) => bundleLabel,
|
|
43
45
|
},
|
|
44
46
|
);
|
|
45
47
|
|
|
48
|
+
/** @type {(bundle: SourceBundle, bundleLabel?: string) => Installation<unknown>} */
|
|
46
49
|
const makeBundleInstallation = prepareKind(
|
|
47
50
|
zoeBaggage,
|
|
48
51
|
'BundleInstallation',
|
|
49
52
|
(bundle, bundleLabel) => ({ bundle, bundleLabel }),
|
|
53
|
+
// @ts-expect-error cast without StartFunction property
|
|
50
54
|
{
|
|
51
55
|
getBundle: ({ state: { bundle } }) => bundle,
|
|
52
56
|
getBundleLabel: ({ state: { bundleLabel } }) => bundleLabel,
|
|
@@ -68,8 +72,6 @@ export const makeInstallationStorage = (getBundleCapForID, zoeBaggage) => {
|
|
|
68
72
|
typeof bundle === 'object' || Fail`a bundle must be provided`;
|
|
69
73
|
/** @type {Installation} */
|
|
70
74
|
bundle || Fail`a bundle must be provided`;
|
|
71
|
-
/** @type {Installation} */
|
|
72
|
-
// @ts-expect-error cast
|
|
73
75
|
const installation = makeBundleInstallation(bundle, bundleLabel);
|
|
74
76
|
installationsBundle.init(installation, bundle);
|
|
75
77
|
return installation;
|
|
@@ -81,8 +83,12 @@ export const makeInstallationStorage = (getBundleCapForID, zoeBaggage) => {
|
|
|
81
83
|
InstanceHandleShape,
|
|
82
84
|
M.recordOf(M.string(), M.string({ stringLengthLimit: Infinity })),
|
|
83
85
|
),
|
|
84
|
-
)
|
|
85
|
-
|
|
86
|
+
)
|
|
87
|
+
.optional(M.string())
|
|
88
|
+
.returns(M.promise()),
|
|
89
|
+
installBundleID: M.call(M.string())
|
|
90
|
+
.optional(M.string())
|
|
91
|
+
.returns(M.promise()),
|
|
86
92
|
unwrapInstallation: M.callWhen(M.await(InstallationShape)).returns(
|
|
87
93
|
UnwrappedInstallationShape,
|
|
88
94
|
),
|
|
@@ -125,8 +131,6 @@ export const makeInstallationStorage = (getBundleCapForID, zoeBaggage) => {
|
|
|
125
131
|
const bundleCap = await getBundleCapForID(bundleID);
|
|
126
132
|
// AWAIT
|
|
127
133
|
|
|
128
|
-
/** @type {Installation} */
|
|
129
|
-
// @ts-expect-error cast
|
|
130
134
|
const installation = makeBundleIDInstallation(bundleLabel);
|
|
131
135
|
installationsBundleCap.init(
|
|
132
136
|
installation,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export function makeInstanceAdminStorage(baggage:
|
|
1
|
+
export function makeInstanceAdminStorage(baggage: import("@agoric/vat-data").Baggage): import("@endo/exo").GuardedKit<{
|
|
2
2
|
accessor: {
|
|
3
3
|
getPublicFacet(instance: any): any;
|
|
4
4
|
getBrands(instance: any): any;
|
|
@@ -9,25 +9,11 @@ export function makeInstanceAdminStorage(baggage: MapStore<string, unknown>): {
|
|
|
9
9
|
getInstanceAdmin(instance: any): any;
|
|
10
10
|
};
|
|
11
11
|
updater: {
|
|
12
|
-
initInstanceAdmin(instance: any, instanceAdmin: any): Promise<
|
|
13
|
-
deleteInstanceAdmin(instance: any):
|
|
14
|
-
};
|
|
15
|
-
} & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
16
|
-
accessor: {
|
|
17
|
-
getPublicFacet(instance: any): any;
|
|
18
|
-
getBrands(instance: any): any;
|
|
19
|
-
getIssuers(instance: any): any;
|
|
20
|
-
getTerms(instance: any): any;
|
|
21
|
-
getOfferFilter(instance: any): any;
|
|
22
|
-
getInstallation(instance: any): any;
|
|
23
|
-
getInstanceAdmin(instance: any): any;
|
|
24
|
-
};
|
|
25
|
-
updater: {
|
|
26
|
-
initInstanceAdmin(instance: any, instanceAdmin: any): Promise<any>;
|
|
27
|
-
deleteInstanceAdmin(instance: any): any;
|
|
12
|
+
initInstanceAdmin(instance: any, instanceAdmin: any): Promise<void>;
|
|
13
|
+
deleteInstanceAdmin(instance: any): void;
|
|
28
14
|
};
|
|
29
15
|
}>;
|
|
30
|
-
export function makeInstanceAdminMaker(zoeBaggage:
|
|
16
|
+
export function makeInstanceAdminMaker(zoeBaggage: import("@agoric/vat-data").Baggage, seatHandleToZoeSeatAdmin: WeakMapStore<SeatHandle, ZoeSeatAdmin>): (instanceHandle: any, zoeInstanceStorageManager: any, adminNode: any) => import("@agoric/swingset-liveslots").KindFacet<{
|
|
31
17
|
getPublicFacet: ({ state }: {
|
|
32
18
|
state: any;
|
|
33
19
|
}) => any;
|
|
@@ -66,39 +52,33 @@ export function makeInstanceAdminMaker(zoeBaggage: MapStore<string, unknown>, se
|
|
|
66
52
|
facets: {
|
|
67
53
|
helper: any;
|
|
68
54
|
};
|
|
69
|
-
}, invitationHandle: any, initialAllocation: any, proposal: any, offerArgs?: undefined) => {
|
|
70
|
-
getProposal(): Promise<
|
|
71
|
-
getPayouts(): Promise<
|
|
55
|
+
}, invitationHandle: any, initialAllocation: any, proposal: any, offerArgs?: undefined) => import("@endo/exo").Guarded<{
|
|
56
|
+
getProposal(): Promise<any>;
|
|
57
|
+
getPayouts(): Promise<any>;
|
|
72
58
|
getPayout(keyword: any): Promise<any>;
|
|
73
59
|
getOfferResult(): Promise<any>;
|
|
74
|
-
hasExited(): Promise<
|
|
75
|
-
tryExit(): Promise<
|
|
76
|
-
numWantsSatisfied(): Promise<
|
|
77
|
-
getExitSubscriber():
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
};
|
|
81
|
-
getFinalAllocation(): Promise<AmountKeywordRecord>;
|
|
82
|
-
};
|
|
60
|
+
hasExited(): Promise<any>;
|
|
61
|
+
tryExit(): Promise<any>;
|
|
62
|
+
numWantsSatisfied(): Promise<any>;
|
|
63
|
+
getExitSubscriber(): any;
|
|
64
|
+
getFinalAllocation(): any;
|
|
65
|
+
}>;
|
|
83
66
|
makeNoEscrowSeat: ({ state, facets: { helper } }: {
|
|
84
67
|
state: any;
|
|
85
68
|
facets: {
|
|
86
69
|
helper: any;
|
|
87
70
|
};
|
|
88
|
-
}, initialAllocation: any, proposal: any, exitObj: any, seatHandle: any) => {
|
|
89
|
-
getProposal(): Promise<
|
|
90
|
-
getPayouts(): Promise<
|
|
71
|
+
}, initialAllocation: any, proposal: any, exitObj: any, seatHandle: any) => import("@endo/exo").Guarded<{
|
|
72
|
+
getProposal(): Promise<any>;
|
|
73
|
+
getPayouts(): Promise<any>;
|
|
91
74
|
getPayout(keyword: any): Promise<any>;
|
|
92
75
|
getOfferResult(): Promise<any>;
|
|
93
|
-
hasExited(): Promise<
|
|
94
|
-
tryExit(): Promise<
|
|
95
|
-
numWantsSatisfied(): Promise<
|
|
96
|
-
getExitSubscriber():
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
};
|
|
100
|
-
getFinalAllocation(): Promise<AmountKeywordRecord>;
|
|
101
|
-
};
|
|
76
|
+
hasExited(): Promise<any>;
|
|
77
|
+
tryExit(): Promise<any>;
|
|
78
|
+
numWantsSatisfied(): Promise<any>;
|
|
79
|
+
getExitSubscriber(): any;
|
|
80
|
+
getFinalAllocation(): any;
|
|
81
|
+
}>;
|
|
102
82
|
getOfferFilter: ({ state }: {
|
|
103
83
|
state: any;
|
|
104
84
|
}) => any;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instanceAdminStorage.d.ts","sourceRoot":"","sources":["instanceAdminStorage.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"instanceAdminStorage.d.ts","sourceRoot":"","sources":["instanceAdminStorage.js"],"names":[],"mappings":"AAoDO,kDADK,OAAO,kBAAkB,EAAE,OAAO;;;;;;;;;;;;;;GA2D7C;AA0JM,mDAHI,OAAO,kBAAkB,EAAE,OAAO,4BAClC,YAAY,CAAC,UAAU,EAAE,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwChD;6BAvDY,QAAQ,CAAC;IACrB,WAAe,EAAE,OAAO,CAAC;IACzB,eAAmB,EAAE,OAAO,CAAC;CAC1B,CAAC;2BACQ;IACZ,kBAAsB,EAAE,MAAM,EAAE,CAAC;CAC9B;oBACS,YAAY,GAAG,cAAc;4BAC7B;IACZ,KAAS,EAAE,KAAK,CAAC;CACd"}
|
|
@@ -24,21 +24,21 @@ type DeleteInstanceAdmin = (instance: Instance) => void;
|
|
|
24
24
|
* Assert the installation is known, and return the bundle/bundlecap and
|
|
25
25
|
* installation
|
|
26
26
|
*/
|
|
27
|
-
type UnwrapInstallation = (installationP: ERef<Installation>) => ERef<{
|
|
27
|
+
type UnwrapInstallation = (installationP: ERef<Installation>) => globalThis.ERef<{
|
|
28
28
|
bundle?: SourceBundle;
|
|
29
|
-
bundleCap?:
|
|
30
|
-
bundleID?:
|
|
29
|
+
bundleCap?: any;
|
|
30
|
+
bundleID?: string | undefined;
|
|
31
31
|
installation: Installation;
|
|
32
32
|
}>;
|
|
33
33
|
type GetIssuerRecords = () => IssuerRecords;
|
|
34
34
|
type ZoeInstanceStorageManager = {
|
|
35
|
-
getTerms:
|
|
36
|
-
getIssuers:
|
|
37
|
-
getBrands:
|
|
38
|
-
saveIssuer:
|
|
35
|
+
getTerms: () => AnyTerms;
|
|
36
|
+
getIssuers: () => IssuerKeywordRecord;
|
|
37
|
+
getBrands: () => BrandKeywordRecord;
|
|
38
|
+
saveIssuer: ZCF["saveIssuer"];
|
|
39
39
|
makeZoeMint: MakeZoeMint;
|
|
40
40
|
registerFeeMint: RegisterFeeMint;
|
|
41
|
-
getInstanceRecord:
|
|
41
|
+
getInstanceRecord: () => InstanceRecord;
|
|
42
42
|
getIssuerRecords: GetIssuerRecords;
|
|
43
43
|
initInstanceAdmin: InitInstanceAdmin;
|
|
44
44
|
deleteInstanceAdmin: DeleteInstanceAdmin;
|
|
@@ -51,7 +51,7 @@ type ZoeInstanceStorageManager = {
|
|
|
51
51
|
/**
|
|
52
52
|
* of CreateVatResults
|
|
53
53
|
*/
|
|
54
|
-
getAdminNode: () => import(
|
|
54
|
+
getAdminNode: () => import("@agoric/swingset-vat").VatAdminFacet;
|
|
55
55
|
};
|
|
56
56
|
/**
|
|
57
57
|
* Create a storage manager for a particular contract instance. The
|
|
@@ -59,21 +59,21 @@ type ZoeInstanceStorageManager = {
|
|
|
59
59
|
* issuerStorage and escrowStorage from Zoe, and stores the
|
|
60
60
|
* instance-specific terms
|
|
61
61
|
*/
|
|
62
|
-
type MakeZoeInstanceStorageManager = (instanceBaggage:
|
|
63
|
-
type GetBundleCapForID = (id:
|
|
62
|
+
type MakeZoeInstanceStorageManager = (instanceBaggage: import("@agoric/vat-data").Baggage, installation: Installation, customTerms: object, uncleanIssuerKeywordRecord: IssuerKeywordRecord, instance: Instance, contractBundleCap: any, instanceLabel: string) => Promise<ZoeInstanceStorageManager>;
|
|
63
|
+
type GetBundleCapForID = (id: string) => Promise<any>;
|
|
64
64
|
type GetProposalShapeForInvitation = (invitationHandle: InvitationHandle) => Pattern | undefined;
|
|
65
65
|
type ZoeStorageManager = {
|
|
66
66
|
makeZoeInstanceStorageManager: MakeZoeInstanceStorageManager;
|
|
67
67
|
getAssetKindByBrand: GetAssetKindByBrand;
|
|
68
68
|
depositPayments: DepositPayments;
|
|
69
|
-
invitationIssuer: Issuer<
|
|
69
|
+
invitationIssuer: Issuer<"set">;
|
|
70
70
|
installBundle: InstallBundle;
|
|
71
71
|
installBundleID: InstallBundleID;
|
|
72
72
|
getBundleIDFromInstallation: GetBundleIDFromInstallation;
|
|
73
|
-
getPublicFacet: import(
|
|
73
|
+
getPublicFacet: import("./utils.js").GetPublicFacet;
|
|
74
74
|
getBrands: GetBrands;
|
|
75
75
|
getIssuers: GetIssuers;
|
|
76
|
-
getTerms: import(
|
|
76
|
+
getTerms: import("./utils.js").GetTerms;
|
|
77
77
|
getOfferFilter: GetOfferFilter;
|
|
78
78
|
setOfferFilter: SetOfferFilter;
|
|
79
79
|
getInstallationForInstance: GetInstallationForInstance;
|
|
@@ -85,6 +85,6 @@ type ZoeStorageManager = {
|
|
|
85
85
|
* Use VatAdminSvc to create a new vat, but only with the code of the
|
|
86
86
|
* ZCF bundle
|
|
87
87
|
*/
|
|
88
|
-
type CreateZCFVat = (contractBundleCap:
|
|
89
|
-
type GetFeeIssuerKit = (feeMintAccess: FeeMintAccess) => IssuerKit<
|
|
88
|
+
type CreateZCFVat = (contractBundleCap: any, contractLabel: string) => Promise<import("@agoric/swingset-vat").CreateVatResults>;
|
|
89
|
+
type GetFeeIssuerKit = (feeMintAccess: FeeMintAccess) => IssuerKit<"nat">;
|
|
90
90
|
//# sourceMappingURL=internal-types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal-types.d.ts","sourceRoot":"","sources":["internal-types.js"],"names":[],"mappings":";;;4BAMW,MAAM,SACN,KAAK,KACH,
|
|
1
|
+
{"version":3,"file":"internal-types.d.ts","sourceRoot":"","sources":["internal-types.js"],"names":[],"mappings":";;;4BAMW,MAAM,SACN,KAAK,KACH,IAAI,CAAC,IAAI,CAAC;;;;;;;;kCAWZ,MAAM,SACN,KAAK,KACH,KAAK;;;;;;;kCAUP,cAAc,YACd,qBAAqB,KACnB,OAAO,CAAC,UAAU,CAAC;oCAKrB,QAAQ,iBACR,aAAa,KACX,IAAI;mCAKN,QAAQ,KACN,aAAa;sCAKf,QAAQ,KACN,IAAI;;;;;0CASN,IAAI,CAAC,YAAY,CAAC;aAEf,YAAY;;;kBAGR,YAAY;;8BAOjB,aAAa;;cAKZ,MAAM,QAAQ;gBACd,MAAM,mBAAmB;eACzB,MAAM,kBAAkB;gBACxB,GAAG,CAAC,YAAY,CAAC;iBACjB,WAAW;qBACX,eAAe;uBACf,MAAM,cAAc;sBACpB,gBAAgB;uBAChB,iBAAiB;yBACjB,mBAAmB;oBACnB,8BAA8B;yBAC9B,MAAM,MAAM;;;;aACZ,MAAM,MAAM;;;;kBACZ,MAAM,OAAO,sBAAsB,EAAE,aAAa;;;;;;;;uDAUrD,OAAO,kBAAkB,EAAE,OAAO,gBAClC,YAAY,eACZ,MAAM,8BACN,mBAAmB,YACnB,QAAQ,yCAER,MAAM,KACJ,OAAO,CAAC,yBAAyB,CAAC;;wDAWpC,gBAAgB,KACd,OAAO,GAAG,SAAS;;mCAKlB,6BAA6B;yBAC7B,mBAAmB;qBACnB,eAAe;sBACf,MAAM,CAAC,KAAK,CAAC;mBACb,aAAa;qBACb,eAAe;iCACf,2BAA2B;oBAC3B,OAAO,YAAY,EAAE,cAAc;eACnC,SAAS;gBACT,UAAU;cACV,OAAO,YAAY,EAAE,QAAQ;oBAC7B,cAAc;oBACd,cAAc;gCACd,0BAA0B;sBAC1B,gBAAgB;wBAChB,kBAAkB;mCAClB,6BAA6B;;;;;;4DAShC,MAAM,KACJ,OAAO,CAAC,OAAO,sBAAsB,EAAE,gBAAgB,CAAC;uCAK1D,aAAa,KACX,SAAS,CAAC,KAAK,CAAC"}
|
|
@@ -76,13 +76,13 @@
|
|
|
76
76
|
|
|
77
77
|
/**
|
|
78
78
|
* @typedef {object} ZoeInstanceStorageManager
|
|
79
|
-
* @property {
|
|
80
|
-
* @property {
|
|
81
|
-
* @property {
|
|
82
|
-
* @property {
|
|
79
|
+
* @property {() => AnyTerms} getTerms
|
|
80
|
+
* @property {() => IssuerKeywordRecord} getIssuers
|
|
81
|
+
* @property {() => BrandKeywordRecord} getBrands
|
|
82
|
+
* @property {ZCF['saveIssuer']} saveIssuer
|
|
83
83
|
* @property {MakeZoeMint} makeZoeMint
|
|
84
84
|
* @property {RegisterFeeMint} registerFeeMint
|
|
85
|
-
* @property {
|
|
85
|
+
* @property {() => InstanceRecord} getInstanceRecord
|
|
86
86
|
* @property {GetIssuerRecords} getIssuerRecords
|
|
87
87
|
* @property {InitInstanceAdmin} initInstanceAdmin
|
|
88
88
|
* @property {DeleteInstanceAdmin} deleteInstanceAdmin
|
|
@@ -133,7 +133,7 @@
|
|
|
133
133
|
* @property {import('./utils.js').GetPublicFacet} getPublicFacet
|
|
134
134
|
* @property {GetBrands} getBrands
|
|
135
135
|
* @property {GetIssuers} getIssuers
|
|
136
|
-
* @property {import('./utils').GetTerms} getTerms
|
|
136
|
+
* @property {import('./utils.js').GetTerms} getTerms
|
|
137
137
|
* @property {GetOfferFilter} getOfferFilter
|
|
138
138
|
* @property {SetOfferFilter} setOfferFilter
|
|
139
139
|
* @property {GetInstallationForInstance} getInstallationForInstance
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"invitationQueries.d.ts","sourceRoot":"","sources":["invitationQueries.js"],"names":[],"mappings":"AAKO;;;;
|
|
1
|
+
{"version":3,"file":"invitationQueries.d.ts","sourceRoot":"","sources":["invitationQueries.js"],"names":[],"mappings":"AAKO;;;;EA+BN"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// @jessie-check
|
|
2
2
|
|
|
3
|
-
import { assert, details as X } from '@agoric/assert';
|
|
3
|
+
import { assert, details as X, Fail, quote as q } from '@agoric/assert';
|
|
4
4
|
import { E } from '@endo/eventual-send';
|
|
5
5
|
|
|
6
6
|
export const makeInvitationQueryFns = invitationIssuer => {
|
|
@@ -13,10 +13,12 @@ export const makeInvitationQueryFns = invitationIssuer => {
|
|
|
13
13
|
assert.note(err, X`Due to ${reason}`);
|
|
14
14
|
throw err;
|
|
15
15
|
};
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
)
|
|
16
|
+
const invAmount = await E(invitationIssuer)
|
|
17
|
+
.getAmountOf(invitationP)
|
|
18
|
+
.catch(onRejected);
|
|
19
|
+
(Array.isArray(invAmount.value) && invAmount.value.length === 1) ||
|
|
20
|
+
Fail`Expected exactly 1 invitation, not ${q(invAmount.value.length)}`;
|
|
21
|
+
return invAmount.value[0];
|
|
20
22
|
};
|
|
21
23
|
|
|
22
24
|
/** @type {GetInstance} */
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export function prepareInvitationKit(baggage:
|
|
2
|
-
invitationIssuer: Issuer<"set">;
|
|
3
|
-
invitationKit: IssuerKit<"set">;
|
|
1
|
+
export function prepareInvitationKit(baggage: import("@agoric/vat-data").Baggage, shutdownZoeVat?: import("@agoric/swingset-vat").ShutdownWithFailure | undefined): {
|
|
2
|
+
invitationIssuer: globalThis.Issuer<"set", InvitationDetails>;
|
|
3
|
+
invitationKit: globalThis.IssuerKit<"set", InvitationDetails>;
|
|
4
4
|
};
|
|
5
5
|
//# sourceMappingURL=makeInvitation.d.ts.map
|
|
@@ -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,8CAHI,OAAO,kBAAkB,EAAE,OAAO,mBAClC,OAAO,sBAAsB,EAAE,mBAAmB,GAAG,SAAS;;;EAgCxE"}
|
|
@@ -1,41 +1,45 @@
|
|
|
1
1
|
// @jessie-check
|
|
2
2
|
|
|
3
|
+
import { Fail, q } from '@agoric/assert';
|
|
3
4
|
import { provideDurableMapStore } from '@agoric/vat-data';
|
|
4
|
-
import {
|
|
5
|
-
AssetKind,
|
|
6
|
-
makeDurableIssuerKit,
|
|
7
|
-
prepareIssuerKit,
|
|
8
|
-
} from '@agoric/ertp';
|
|
5
|
+
import { AssetKind, hasIssuer, prepareIssuerKit } from '@agoric/ertp';
|
|
9
6
|
import { InvitationElementShape } from '../typeGuards.js';
|
|
10
7
|
|
|
8
|
+
/**
|
|
9
|
+
* Not deprecated because the first use below is still correct.
|
|
10
|
+
*/
|
|
11
11
|
const ZOE_INVITATION_KIT = 'ZoeInvitationKit';
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* @param {import('@agoric/vat-data').Baggage} baggage
|
|
15
|
-
* @param {ShutdownWithFailure | undefined} shutdownZoeVat
|
|
15
|
+
* @param {import('@agoric/swingset-vat').ShutdownWithFailure | undefined} shutdownZoeVat
|
|
16
16
|
*/
|
|
17
17
|
export const prepareInvitationKit = (baggage, shutdownZoeVat = undefined) => {
|
|
18
|
-
/** @type {IssuerKit<'set'> | undefined} */
|
|
19
|
-
let invitationKit;
|
|
20
|
-
|
|
21
18
|
const invitationKitBaggage = provideDurableMapStore(
|
|
22
19
|
baggage,
|
|
23
20
|
ZOE_INVITATION_KIT,
|
|
24
21
|
);
|
|
25
|
-
if (
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
);
|
|
34
|
-
invitationKitBaggage.init(ZOE_INVITATION_KIT, invitationKit);
|
|
35
|
-
} else {
|
|
36
|
-
invitationKit = prepareIssuerKit(invitationKitBaggage);
|
|
22
|
+
if (invitationKitBaggage.has(ZOE_INVITATION_KIT)) {
|
|
23
|
+
// This legacy second use of ZOE_INVITATION_KIT is unneeded.
|
|
24
|
+
hasIssuer(invitationKitBaggage) ||
|
|
25
|
+
Fail`Legacy use of ${q(
|
|
26
|
+
ZOE_INVITATION_KIT,
|
|
27
|
+
)} must be redundant with normal storing of issuerKit in issuerBaggage`;
|
|
28
|
+
// Upgrade this legacy state by simply deleting it.
|
|
29
|
+
invitationKitBaggage.delete(ZOE_INVITATION_KIT);
|
|
37
30
|
}
|
|
38
31
|
|
|
32
|
+
/** @type {IssuerKit<'set', InvitationDetails>} */
|
|
33
|
+
// @ts-expect-error cast
|
|
34
|
+
const invitationKit = prepareIssuerKit(
|
|
35
|
+
invitationKitBaggage,
|
|
36
|
+
'Zoe Invitation',
|
|
37
|
+
AssetKind.SET,
|
|
38
|
+
undefined,
|
|
39
|
+
shutdownZoeVat,
|
|
40
|
+
{ elementShape: InvitationElementShape },
|
|
41
|
+
);
|
|
42
|
+
|
|
39
43
|
return harden({
|
|
40
44
|
invitationIssuer: invitationKit.issuer,
|
|
41
45
|
invitationKit,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"burnInvitation.d.ts","sourceRoot":"","sources":["burnInvitation.js"],"names":[],"mappings":"AAgBO,iDAPI,MAAM,cACN,
|
|
1
|
+
{"version":3,"file":"burnInvitation.d.ts","sourceRoot":"","sources":["burnInvitation.js"],"names":[],"mappings":"AAgBO,iDAPI,MAAM,cACN,IAAI,CAAC,OAAO,CAAC,GACX,OAAO,CAAC;IACpB,cAAkB,EAAE,QAAQ,CAAC;IAC7B,gBAAoB,EAAE,gBAAgB,CAAC;CACpC,CAAC,CA4BJ"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"offer.d.ts","sourceRoot":"","sources":["offer.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"offer.d.ts","sourceRoot":"","sources":["offer.js"],"names":[],"mappings":"AAcO,6DA0DN"}
|
|
@@ -8,8 +8,6 @@ import { cleanProposal } from '../../cleanProposal.js';
|
|
|
8
8
|
import { burnInvitation } from './burnInvitation.js';
|
|
9
9
|
import { makeInvitationQueryFns } from '../invitationQueries.js';
|
|
10
10
|
|
|
11
|
-
import '@agoric/ertp/exported.js';
|
|
12
|
-
import '@agoric/store/exported.js';
|
|
13
11
|
import '../internal-types.js';
|
|
14
12
|
|
|
15
13
|
const { quote: q, Fail } = assert;
|
|
@@ -24,9 +22,8 @@ export const makeOfferMethod = offerDataAccess => {
|
|
|
24
22
|
) => {
|
|
25
23
|
const invitationIssuer = offerDataAccess.getInvitationIssuer();
|
|
26
24
|
const query = makeInvitationQueryFns(invitationIssuer);
|
|
27
|
-
const { instance, description } =
|
|
28
|
-
invitation
|
|
29
|
-
);
|
|
25
|
+
const { instance, description } =
|
|
26
|
+
await query.getInvitationDetails(invitation);
|
|
30
27
|
// AWAIT ///
|
|
31
28
|
|
|
32
29
|
const instanceAdmin = await offerDataAccess.getInstanceAdmin(instance);
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
export namespace coreUserSeatMethods {
|
|
2
|
+
let getProposal: import("@endo/patterns").MethodGuard;
|
|
3
|
+
let getPayouts: import("@endo/patterns").MethodGuard;
|
|
4
|
+
let getPayout: import("@endo/patterns").MethodGuard;
|
|
5
|
+
let getOfferResult: import("@endo/patterns").MethodGuard;
|
|
6
|
+
let hasExited: import("@endo/patterns").MethodGuard;
|
|
7
|
+
let numWantsSatisfied: import("@endo/patterns").MethodGuard;
|
|
8
|
+
let getFinalAllocation: import("@endo/patterns").MethodGuard;
|
|
9
|
+
let getExitSubscriber: import("@endo/patterns").MethodGuard;
|
|
10
|
+
}
|
|
11
|
+
export const ZoeUserSeatShape: import("@endo/patterns").InterfaceGuard<{
|
|
12
|
+
tryExit: import("@endo/patterns").MethodGuard;
|
|
13
|
+
getProposal: import("@endo/patterns").MethodGuard;
|
|
14
|
+
getPayouts: import("@endo/patterns").MethodGuard;
|
|
15
|
+
getPayout: import("@endo/patterns").MethodGuard;
|
|
16
|
+
getOfferResult: import("@endo/patterns").MethodGuard;
|
|
17
|
+
hasExited: import("@endo/patterns").MethodGuard;
|
|
18
|
+
numWantsSatisfied: import("@endo/patterns").MethodGuard;
|
|
19
|
+
getFinalAllocation: import("@endo/patterns").MethodGuard;
|
|
20
|
+
getExitSubscriber: import("@endo/patterns").MethodGuard;
|
|
21
|
+
}>;
|
|
22
|
+
export namespace OriginalZoeSeatIKit {
|
|
23
|
+
export let zoeSeatAdmin: import("@endo/patterns").InterfaceGuard<{
|
|
24
|
+
replaceAllocation: import("@endo/patterns").MethodGuard;
|
|
25
|
+
exit: import("@endo/patterns").MethodGuard;
|
|
26
|
+
fail: import("@endo/patterns").MethodGuard;
|
|
27
|
+
resolveExitAndResult: import("@endo/patterns").MethodGuard;
|
|
28
|
+
getExitSubscriber: import("@endo/patterns").MethodGuard;
|
|
29
|
+
finalPayouts: import("@endo/patterns").MethodGuard;
|
|
30
|
+
}>;
|
|
31
|
+
export { ZoeUserSeatShape as userSeat };
|
|
32
|
+
}
|
|
33
|
+
export function declareOldZoeSeatAdminKind(baggage: import("@agoric/vat-data").Baggage, makeDurablePublishKit: () => PublishKit<any>): void;
|
|
34
|
+
//# sourceMappingURL=originalZoeSeat.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"originalZoeSeat.d.ts","sourceRoot":"","sources":["originalZoeSeat.js"],"names":[],"mappings":";;;;;;;;;;AA8BA;;;;;;;;;;GAGG;;;;;;;;;;;;AA+CI,oDAHI,OAAO,kBAAkB,EAAE,OAAO,yBAClC,MAAM,UAAU,CAAC,GAAG,CAAC,QAkR/B"}
|