@agoric/zoe 0.26.3-upgrade-18a-dev-4ee0508.0 → 0.26.3-upgrade-20-dev-086463b.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/bundles/bundle-contractFacet-js-meta.json +288 -288
- package/bundles/bundle-contractFacet.js +1 -1
- package/package.json +30 -30
- package/src/cleanProposal.d.ts +2 -0
- package/src/cleanProposal.d.ts.map +1 -1
- package/src/cleanProposal.js +4 -2
- package/src/contractFacet/exit.d.ts +1 -1
- package/src/contractFacet/exit.d.ts.map +1 -1
- package/src/contractFacet/offerHandlerStorage.d.ts +1 -1
- package/src/contractFacet/offerHandlerStorage.d.ts.map +1 -1
- package/src/contractFacet/offerHandlerStorage.js +5 -0
- package/src/contractFacet/reallocate.d.ts.map +1 -1
- package/src/contractFacet/reallocate.js +4 -0
- package/src/contractFacet/rightsConservation.d.ts.map +1 -1
- package/src/contractFacet/rightsConservation.js +0 -1
- package/src/contractFacet/types.d.ts +184 -0
- package/src/contractFacet/types.d.ts.map +1 -0
- package/src/contractFacet/{types-ambient.d.ts → types.ts} +66 -91
- package/src/contractFacet/vatRoot.d.ts +8 -2
- package/src/contractFacet/vatRoot.d.ts.map +1 -1
- package/src/contractFacet/vatRoot.js +5 -4
- package/src/contractFacet/zcfMint.d.ts +4 -3
- package/src/contractFacet/zcfMint.d.ts.map +1 -1
- package/src/contractFacet/zcfMint.js +9 -21
- package/src/contractFacet/zcfSeat.d.ts.map +1 -1
- package/src/contractFacet/zcfSeat.js +12 -188
- package/src/contractFacet/zcfZygote.d.ts +9 -1
- package/src/contractFacet/zcfZygote.d.ts.map +1 -1
- package/src/contractFacet/zcfZygote.js +27 -9
- package/src/contractSupport/atomicTransfer.d.ts +6 -0
- package/src/contractSupport/atomicTransfer.d.ts.map +1 -1
- package/src/contractSupport/atomicTransfer.js +4 -0
- package/src/contractSupport/bondingCurves.js +1 -1
- package/src/contractSupport/durability.d.ts +1 -0
- package/src/contractSupport/durability.d.ts.map +1 -1
- package/src/contractSupport/durability.js +4 -0
- package/src/contractSupport/index.d.ts +2 -2
- package/src/contractSupport/index.js +2 -19
- package/src/contractSupport/priceAuthorityInitial.d.ts +2 -0
- package/src/contractSupport/priceAuthorityInitial.d.ts.map +1 -1
- package/src/contractSupport/priceAuthorityInitial.js +3 -1
- package/src/contractSupport/priceQuote.d.ts +1 -0
- package/src/contractSupport/priceQuote.d.ts.map +1 -1
- package/src/contractSupport/priceQuote.js +6 -1
- package/src/contractSupport/recorder.d.ts +8 -24
- package/src/contractSupport/recorder.d.ts.map +1 -1
- package/src/contractSupport/recorder.js +6 -0
- package/src/contractSupport/types-ambient.d.ts.map +1 -1
- package/src/contractSupport/types-ambient.js +1 -0
- package/src/contractSupport/zoeHelpers.d.ts +11 -2
- package/src/contractSupport/zoeHelpers.d.ts.map +1 -1
- package/src/contractSupport/zoeHelpers.js +7 -2
- package/src/contracts/atomicSwap.d.ts +1 -1
- package/src/contracts/auction/index.d.ts +3 -3
- package/src/contracts/automaticRefund.d.ts +3 -3
- package/src/contracts/autoswap.d.ts +4 -0
- package/src/contracts/autoswap.d.ts.map +1 -1
- package/src/contracts/autoswap.js +4 -0
- package/src/contracts/barterExchange.d.ts +2 -2
- package/src/contracts/callSpread/fundedCallSpread.d.ts +1 -1
- package/src/contracts/callSpread/pricedCallSpread.d.ts +4 -4
- package/src/contracts/coveredCall-durable.d.ts +1 -1
- package/src/contracts/coveredCall.d.ts +1 -1
- package/src/contracts/coveredCall.d.ts.map +1 -1
- package/src/contracts/coveredCall.js +1 -6
- package/src/contracts/loan/index.d.ts +1 -1
- package/src/contracts/loan/types-ambient.d.ts +13 -13
- package/src/contracts/loan/types-ambient.d.ts.map +1 -1
- package/src/contracts/loan/types-ambient.js +17 -17
- package/src/contracts/mintPayments.d.ts +2 -2
- package/src/contracts/oracle.d.ts +3 -0
- package/src/contracts/oracle.d.ts.map +1 -1
- package/src/contracts/oracle.js +1 -0
- package/src/contracts/priceAggregator.d.ts +2 -0
- package/src/contracts/priceAggregator.d.ts.map +1 -1
- package/src/contracts/priceAggregator.js +14 -11
- package/src/contracts/scaledPriceAuthority.d.ts +1 -0
- package/src/contracts/scaledPriceAuthority.d.ts.map +1 -1
- package/src/contracts/scaledPriceAuthority.js +1 -0
- package/src/contracts/sellItems.d.ts +1 -1
- package/src/contracts/simpleExchange.d.ts +5 -0
- package/src/contracts/simpleExchange.d.ts.map +1 -1
- package/src/contracts/simpleExchange.js +4 -0
- package/src/contracts/types-ambient.d.ts +7 -7
- package/src/contracts/types-ambient.d.ts.map +1 -1
- package/src/contracts/types-ambient.js +7 -7
- package/src/contracts/valueVow.contract.d.ts +5 -2
- package/src/contracts/valueVow.contract.d.ts.map +1 -1
- package/src/contracts/valueVow.contract.js +1 -0
- package/src/instanceRecordStorage.d.ts.map +1 -1
- package/src/instanceRecordStorage.js +3 -1
- package/src/internal-types.d.ts +15 -6
- package/src/internal-types.d.ts.map +1 -1
- package/src/internal-types.js +9 -5
- package/src/issuerRecord.d.ts +3 -2
- package/src/issuerRecord.d.ts.map +1 -1
- package/src/issuerRecord.js +6 -2
- package/src/issuerStorage.d.ts +3 -2
- package/src/issuerStorage.d.ts.map +1 -1
- package/src/issuerStorage.js +10 -5
- package/src/typeGuards.d.ts +10 -5
- package/src/typeGuards.d.ts.map +1 -1
- package/src/typeGuards.js +9 -6
- package/src/types-ambient.d.ts +0 -40
- package/src/types-ambient.d.ts.map +1 -1
- package/src/types-ambient.js +4 -42
- package/src/types-index.d.ts +4 -0
- package/src/types-index.js +2 -0
- package/src/types.d.ts +29 -0
- package/src/types.d.ts.map +1 -0
- package/src/types.ts +44 -0
- package/src/zoeService/escrowStorage.d.ts.map +1 -1
- package/src/zoeService/escrowStorage.js +4 -0
- package/src/zoeService/feeMint.d.ts +1 -0
- package/src/zoeService/feeMint.d.ts.map +1 -1
- package/src/zoeService/feeMint.js +4 -0
- package/src/zoeService/installationStorage.d.ts +4 -5
- package/src/zoeService/installationStorage.d.ts.map +1 -1
- package/src/zoeService/installationStorage.js +8 -8
- package/src/zoeService/instanceAdminStorage.d.ts +1 -0
- package/src/zoeService/instanceAdminStorage.d.ts.map +1 -1
- package/src/zoeService/instanceAdminStorage.js +4 -0
- package/src/zoeService/internal-types.d.ts +12 -5
- package/src/zoeService/internal-types.d.ts.map +1 -1
- package/src/zoeService/internal-types.js +10 -10
- package/src/zoeService/invitationQueries.d.ts +3 -3
- package/src/zoeService/invitationQueries.js +3 -3
- package/src/zoeService/makeInvitation.d.ts +1 -0
- package/src/zoeService/makeInvitation.d.ts.map +1 -1
- package/src/zoeService/makeInvitation.js +3 -1
- package/src/zoeService/offer/burnInvitation.d.ts +1 -1
- package/src/zoeService/offer/burnInvitation.d.ts.map +1 -1
- package/src/zoeService/offer/burnInvitation.js +3 -2
- package/src/zoeService/offer/offer.d.ts +1 -0
- package/src/zoeService/offer/offer.d.ts.map +1 -1
- package/src/zoeService/offer/offer.js +3 -1
- package/src/zoeService/originalZoeSeat.d.ts.map +1 -1
- package/src/zoeService/originalZoeSeat.js +6 -4
- package/src/zoeService/startInstance.d.ts +1 -1
- package/src/zoeService/startInstance.d.ts.map +1 -1
- package/src/zoeService/startInstance.js +5 -4
- package/src/zoeService/types-ambient.d.ts +0 -220
- package/src/zoeService/types-ambient.d.ts.map +1 -1
- package/src/zoeService/types-ambient.js +4 -323
- package/src/zoeService/types.d.ts +238 -0
- package/src/zoeService/types.d.ts.map +1 -0
- package/src/zoeService/types.ts +307 -0
- package/src/zoeService/utils.d.ts +18 -10
- package/src/zoeService/utils.test-d.ts +1 -0
- package/src/zoeService/zoe.d.ts +11 -1
- package/src/zoeService/zoe.d.ts.map +1 -1
- package/src/zoeService/zoe.js +8 -1
- package/src/zoeService/zoeSeat.d.ts +1 -4
- package/src/zoeService/zoeSeat.d.ts.map +1 -1
- package/src/zoeService/zoeSeat.js +6 -4
- package/src/zoeService/zoeStorageManager.d.ts +5 -5
- package/src/zoeService/zoeStorageManager.d.ts.map +1 -1
- package/src/zoeService/zoeStorageManager.js +4 -3
- package/tools/fakePriceAuthority.d.ts +3 -2
- package/tools/fakePriceAuthority.d.ts.map +1 -1
- package/tools/fakePriceAuthority.js +9 -6
- package/tools/fakeVatAdmin.d.ts +10 -4
- package/tools/fakeVatAdmin.d.ts.map +1 -1
- package/tools/fakeVatAdmin.js +21 -10
- package/tools/manualPriceAuthority.d.ts +6 -2
- package/tools/manualPriceAuthority.d.ts.map +1 -1
- package/tools/manualPriceAuthority.js +8 -6
- package/tools/scriptedOracle.d.ts +7 -3
- package/tools/scriptedOracle.d.ts.map +1 -1
- package/tools/scriptedOracle.js +4 -0
- package/tools/scriptedPriceAuthority.d.ts.map +1 -1
- package/tools/scriptedPriceAuthority.js +6 -5
- package/tools/setup-zoe.d.ts +12 -6
- package/tools/setup-zoe.d.ts.map +1 -1
- package/tools/setup-zoe.js +38 -5
- package/tools/test-utils.d.ts +10 -6
- package/tools/test-utils.d.ts.map +1 -1
- package/tools/test-utils.js +6 -2
- package/tools/types.d.ts +5 -0
- package/tools/types.d.ts.map +1 -1
- package/tools/types.js +5 -0
- package/src/contractFacet/internal-types.d.ts +0 -8
- package/src/contractFacet/internal-types.d.ts.map +0 -1
- package/src/contractFacet/internal-types.js +0 -15
- package/src/contractFacet/types-ambient.js +0 -1
- package/src/contractSupport/ratio.d.ts +0 -37
- package/src/contractSupport/ratio.d.ts.map +0 -1
- package/src/contractSupport/ratio.js +0 -419
- package/src/contractSupport/safeMath.d.ts +0 -11
- package/src/contractSupport/safeMath.d.ts.map +0 -1
- package/src/contractSupport/safeMath.js +0 -49
|
@@ -1,14 +1,20 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* @
|
|
2
|
+
* @import {ZoeService} from '@agoric/zoe';
|
|
3
|
+
*/
|
|
4
|
+
/**
|
|
5
|
+
* @param {VatPowers & { testJigSetter: ( {zcf}: {zcf: ZCF} ) => void }} powers
|
|
3
6
|
* @param {{contractBundleCap: BundleCap, zoeService: ZoeService, invitationIssuer: Issuer<'set'>, privateArgs?: any}} vatParameters
|
|
4
7
|
* @param {import('@agoric/vat-data').Baggage} baggage
|
|
5
8
|
*/
|
|
6
9
|
export function buildRootObject(powers: VatPowers & {
|
|
7
|
-
testJigSetter:
|
|
10
|
+
testJigSetter: ({ zcf }: {
|
|
11
|
+
zcf: ZCF;
|
|
12
|
+
}) => void;
|
|
8
13
|
}, vatParameters: {
|
|
9
14
|
contractBundleCap: BundleCap;
|
|
10
15
|
zoeService: ZoeService;
|
|
11
16
|
invitationIssuer: Issuer<"set">;
|
|
12
17
|
privateArgs?: any;
|
|
13
18
|
}, baggage: import("@agoric/vat-data").Baggage): Promise<import("@endo/pass-style").RemotableObject<`Alleged: ${string}`> & import("@endo/eventual-send").RemotableBrand<{}, {}>>;
|
|
19
|
+
import type { ZoeService } from '@agoric/zoe';
|
|
14
20
|
//# sourceMappingURL=vatRoot.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"vatRoot.d.ts","sourceRoot":"","sources":["vatRoot.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"vatRoot.d.ts","sourceRoot":"","sources":["vatRoot.js"],"names":[],"mappings":"AAeA;;GAEG;AAEH;;;;GAIG;AACH,wCAJW,SAAS,GAAG;IAAE,aAAa,EAAE,CAAE,EAAC,GAAG,EAAC,EAAE;QAAC,GAAG,EAAE,GAAG,CAAA;KAAC,KAAM,IAAI,CAAA;CAAE,iBAC5D;IAAC,iBAAiB,EAAE,SAAS,CAAC;IAAC,UAAU,EAAE,UAAU,CAAC;IAAC,gBAAgB,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;IAAC,WAAW,CAAC,EAAE,GAAG,CAAA;CAAC,WAC1G,OAAO,kBAAkB,EAAE,OAAO,oIA8D5C;gCApE4B,aAAa"}
|
|
@@ -11,12 +11,14 @@ import { Fail } from '@endo/errors';
|
|
|
11
11
|
import { Far } from '@endo/marshal';
|
|
12
12
|
import { E } from '@endo/far';
|
|
13
13
|
|
|
14
|
-
import '../internal-types.js';
|
|
15
|
-
|
|
16
14
|
import { makeZCFZygote } from './zcfZygote.js';
|
|
17
15
|
|
|
18
16
|
/**
|
|
19
|
-
* @
|
|
17
|
+
* @import {ZoeService} from '@agoric/zoe';
|
|
18
|
+
*/
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* @param {VatPowers & { testJigSetter: ( {zcf}: {zcf: ZCF} ) => void }} powers
|
|
20
22
|
* @param {{contractBundleCap: BundleCap, zoeService: ZoeService, invitationIssuer: Issuer<'set'>, privateArgs?: any}} vatParameters
|
|
21
23
|
* @param {import('@agoric/vat-data').Baggage} baggage
|
|
22
24
|
*/
|
|
@@ -72,7 +74,6 @@ export async function buildRootObject(powers, vatParameters, baggage) {
|
|
|
72
74
|
issuerStorageFromZoe,
|
|
73
75
|
privateArgs = undefined,
|
|
74
76
|
) => {
|
|
75
|
-
/** @type {ZCFZygote} */
|
|
76
77
|
return E(zcfZygote).startContract(
|
|
77
78
|
zoeInstanceAdmin,
|
|
78
79
|
instanceRecordFromZoe,
|
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
export function sumAmountKeywordRecord(amr: AmountKeywordRecord, issuerRecord:
|
|
1
|
+
export function sumAmountKeywordRecord(amr: AmountKeywordRecord, issuerRecord: ZoeIssuerRecord): Amount;
|
|
2
2
|
export function prepareZcMint(zcfBaggage: import("@agoric/vat-data").Baggage, recordIssuer: {
|
|
3
|
-
(keyword: string, issuerRecord:
|
|
3
|
+
(keyword: string, issuerRecord: ZoeIssuerRecord): void;
|
|
4
4
|
}, getAssetKindByBrand: GetAssetKindByBrand, makeEmptySeatKit: (exit?: undefined) => {
|
|
5
5
|
zcfSeat: any;
|
|
6
6
|
userSeat: Promise<UserSeat>;
|
|
7
|
-
}, reallocator: ZcfMintReallocator):
|
|
7
|
+
}, reallocator: ZcfMintReallocator): (keyword: string, zoeMintP: ERef<ZoeMint<K>>) => Promise<ZCFMint<K>>;
|
|
8
|
+
import type { ZCFMint } from '@agoric/zoe';
|
|
8
9
|
//# sourceMappingURL=zcfMint.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zcfMint.d.ts","sourceRoot":"","sources":["zcfMint.js"],"names":[],"mappings":"AAmBO,4CAJI,mBAAmB,gBACnB,
|
|
1
|
+
{"version":3,"file":"zcfMint.d.ts","sourceRoot":"","sources":["zcfMint.js"],"names":[],"mappings":"AAmBO,4CAJI,mBAAmB,gBACnB,eAAe,GACb,MAAM,CAYlB;AASM,0CANI,OAAO,kBAAkB,EAAE,OAAO,gBAClC;IAAE,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,EAAE,eAAe,GAAG,IAAI,CAAA;CAAE,uBAC1D,mBAAmB,oBACnB,CAAC,IAAI,CAAC,EAAE,SAAS,KAAK;IAAE,OAAO,EAAE,GAAG,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAC,QAAQ,CAAC,CAAA;CAAE,eACnE,kBAAkB,IA0Gb,SAJH,MAIU,EAAE,UAHZ,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,CAGK,KAFlB,OAAO,CAAC,QAAQ,CAAC,CAAC,CAAC,CAWjC;6BA5IkC,aAAa"}
|
|
@@ -6,15 +6,15 @@ import { prepareExoClass } from '@agoric/vat-data';
|
|
|
6
6
|
import { coerceAmountKeywordRecord } from '../cleanProposal.js';
|
|
7
7
|
import { assertFullIssuerRecord, makeIssuerRecord } from '../issuerRecord.js';
|
|
8
8
|
import { addToAllocation, subtractFromAllocation } from './allocationMath.js';
|
|
9
|
-
|
|
10
|
-
import '../internal-types.js';
|
|
11
9
|
import { ZcfMintI } from './typeGuards.js';
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* @import {ZCFMint, ZCFSeat} from '@agoric/zoe';
|
|
13
|
+
*/
|
|
14
14
|
|
|
15
15
|
/**
|
|
16
16
|
* @param {AmountKeywordRecord} amr
|
|
17
|
-
* @param {
|
|
17
|
+
* @param {ZoeIssuerRecord} issuerRecord
|
|
18
18
|
* @returns {Amount}
|
|
19
19
|
*/
|
|
20
20
|
export const sumAmountKeywordRecord = (amr, issuerRecord) => {
|
|
@@ -31,7 +31,7 @@ export const sumAmountKeywordRecord = (amr, issuerRecord) => {
|
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
33
|
* @param {import('@agoric/vat-data').Baggage} zcfBaggage
|
|
34
|
-
* @param {{ (keyword: string, issuerRecord:
|
|
34
|
+
* @param {{ (keyword: string, issuerRecord: ZoeIssuerRecord): void }} recordIssuer
|
|
35
35
|
* @param {GetAssetKindByBrand} getAssetKindByBrand
|
|
36
36
|
* @param {(exit?: undefined) => { zcfSeat: any; userSeat: Promise<UserSeat> }} makeEmptySeatKit
|
|
37
37
|
* @param {ZcfMintReallocator} reallocator
|
|
@@ -51,7 +51,7 @@ export const prepareZcMint = (
|
|
|
51
51
|
* @template {AssetKind} [K=AssetKind]
|
|
52
52
|
* @param {string} keyword
|
|
53
53
|
* @param {ZoeMint<K>} zoeMint
|
|
54
|
-
* @param {Required<
|
|
54
|
+
* @param {Required<ZoeIssuerRecord<K>>} issuerRecord
|
|
55
55
|
*/
|
|
56
56
|
(keyword, zoeMint, issuerRecord) => {
|
|
57
57
|
const {
|
|
@@ -87,19 +87,13 @@ export const prepareZcMint = (
|
|
|
87
87
|
gains,
|
|
88
88
|
);
|
|
89
89
|
|
|
90
|
-
// Increment the stagedAllocation if it exists so that the
|
|
91
|
-
// stagedAllocation is kept up to the currentAllocation
|
|
92
|
-
if (zcfSeat.hasStagedAllocation()) {
|
|
93
|
-
zcfSeat.incrementBy(gains);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
90
|
// Offer safety should never be able to be violated here, as
|
|
97
91
|
// we are adding assets. However, we keep this check so that
|
|
98
92
|
// all reallocations are covered by offer safety checks, and
|
|
99
93
|
// that any bug within Zoe that may affect this is caught.
|
|
100
94
|
zcfSeat.isOfferSafe(allocationPlusGains) ||
|
|
101
95
|
Fail`The allocation after minting gains ${allocationPlusGains} for the zcfSeat was not offer safe`;
|
|
102
|
-
// No effects above,
|
|
96
|
+
// No effects above, Note COMMIT POINT within
|
|
103
97
|
// reallocator.reallocate(). The following two steps *should* be
|
|
104
98
|
// committed atomically, but it is not a disaster if they are
|
|
105
99
|
// not. If we minted only, no one would ever get those
|
|
@@ -129,13 +123,7 @@ export const prepareZcMint = (
|
|
|
129
123
|
zcfSeat.isOfferSafe(allocationMinusLosses) ||
|
|
130
124
|
Fail`The allocation after burning losses ${allocationMinusLosses} for the zcfSeat was not offer safe`;
|
|
131
125
|
|
|
132
|
-
//
|
|
133
|
-
// stagedAllocation is kept up to the currentAllocation
|
|
134
|
-
if (zcfSeat.hasStagedAllocation()) {
|
|
135
|
-
zcfSeat.decrementBy(losses);
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
// No effects above, apart from decrementBy. Note COMMIT POINT within
|
|
126
|
+
// No effects above, Note COMMIT POINT within
|
|
139
127
|
// reallocator.reallocate(). The following two steps *should* be
|
|
140
128
|
// committed atomically, but it is not a disaster if they are
|
|
141
129
|
// not. If we only commit the allocationMinusLosses no one would
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zcfSeat.d.ts","sourceRoot":"","sources":["zcfSeat.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"zcfSeat.d.ts","sourceRoot":"","sources":["zcfSeat.js"],"names":[],"mappings":"AAqCO,oDANI,IAAI,CAAC,gBAAgB,CAAC,uBACtB,mBAAmB,uBACnB,OAAO,sBAAsB,EAAE,mBAAmB,cAClD,OAAO,kBAAkB,EAAE,OAAO,GAChC;IAAE,WAAW,EAAE,cAAc,CAAC;IAAC,kBAAkB,EAAE,kBAAkB,CAAA;CAAE,CAuTnF"}
|
|
@@ -5,7 +5,6 @@ import {
|
|
|
5
5
|
prepareExoClass,
|
|
6
6
|
prepareExoClassKit,
|
|
7
7
|
provide,
|
|
8
|
-
provideDurableMapStore,
|
|
9
8
|
provideDurableWeakMapStore,
|
|
10
9
|
} from '@agoric/vat-data';
|
|
11
10
|
import { AmountMath } from '@agoric/ertp';
|
|
@@ -13,8 +12,6 @@ import { initEmpty, M } from '@agoric/store';
|
|
|
13
12
|
|
|
14
13
|
import { isOfferSafe } from './offerSafety.js';
|
|
15
14
|
import { assertRightsConserved } from './rightsConservation.js';
|
|
16
|
-
import { addToAllocation, subtractFromAllocation } from './allocationMath.js';
|
|
17
|
-
import { coerceAmountKeywordRecord } from '../cleanProposal.js';
|
|
18
15
|
import {
|
|
19
16
|
AmountKeywordRecordShape,
|
|
20
17
|
SeatDataShape,
|
|
@@ -23,6 +20,11 @@ import {
|
|
|
23
20
|
import { makeAllocationMap } from './reallocate.js';
|
|
24
21
|
import { TransferPartShape } from '../contractSupport/atomicTransfer.js';
|
|
25
22
|
|
|
23
|
+
/**
|
|
24
|
+
* @import {WeakMapStore} from '@agoric/store';
|
|
25
|
+
* @import {TransferPart, ZCFSeat} from '@agoric/zoe';
|
|
26
|
+
*/
|
|
27
|
+
|
|
26
28
|
/**
|
|
27
29
|
* The SeatManager holds the active zcfSeats and can reallocate and
|
|
28
30
|
* make new zcfSeats.
|
|
@@ -41,11 +43,11 @@ export const createSeatManager = (
|
|
|
41
43
|
) => {
|
|
42
44
|
/** @type {WeakMapStore<ZCFSeat, Allocation>} */
|
|
43
45
|
let activeZCFSeats = provideDurableWeakMapStore(zcfBaggage, 'activeZCFSeats');
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
'zcfSeatToStagedAllocations'
|
|
48
|
-
|
|
46
|
+
|
|
47
|
+
// Removed. See #6679
|
|
48
|
+
if (zcfBaggage.has('zcfSeatToStagedAllocations')) {
|
|
49
|
+
zcfBaggage.delete('zcfSeatToStagedAllocations');
|
|
50
|
+
}
|
|
49
51
|
|
|
50
52
|
/** @type {WeakMapStore<ZCFSeat, SeatHandle>} */
|
|
51
53
|
let zcfSeatToSeatHandle = provideDurableWeakMapStore(
|
|
@@ -84,64 +86,6 @@ export const createSeatManager = (
|
|
|
84
86
|
return activeZCFSeats.get(zcfSeat);
|
|
85
87
|
};
|
|
86
88
|
|
|
87
|
-
/**
|
|
88
|
-
* @param {ZCFSeat} zcfSeat
|
|
89
|
-
* @returns {void}
|
|
90
|
-
*/
|
|
91
|
-
const commitStagedAllocation = zcfSeat => {
|
|
92
|
-
// By this point, we have checked that the zcfSeat is a key in
|
|
93
|
-
// activeZCFSeats and in zcfSeatToStagedAllocations.
|
|
94
|
-
activeZCFSeats.set(zcfSeat, zcfSeat.getStagedAllocation());
|
|
95
|
-
zcfSeatToStagedAllocations.delete(zcfSeat);
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
/**
|
|
99
|
-
* @param {ZCFSeat} zcfSeat
|
|
100
|
-
* @returns {Allocation}
|
|
101
|
-
*/
|
|
102
|
-
const hasStagedAllocation = zcfSeatToStagedAllocations.has;
|
|
103
|
-
|
|
104
|
-
/**
|
|
105
|
-
* Get the stagedAllocation. If one does not exist, return the
|
|
106
|
-
* currentAllocation. We return the currentAllocation in this case
|
|
107
|
-
* so that downstream users do not have to check whether the
|
|
108
|
-
* stagedAllocation is defined before adding to it or subtracting
|
|
109
|
-
* from it. To check whether a stagedAllocation exists, use
|
|
110
|
-
* `hasStagedAllocation`
|
|
111
|
-
*
|
|
112
|
-
* @param {ZCFSeat} zcfSeat
|
|
113
|
-
* @returns {Allocation}
|
|
114
|
-
*/
|
|
115
|
-
const getStagedAllocation = zcfSeat => {
|
|
116
|
-
if (zcfSeatToStagedAllocations.has(zcfSeat)) {
|
|
117
|
-
return zcfSeatToStagedAllocations.get(zcfSeat);
|
|
118
|
-
} else {
|
|
119
|
-
return activeZCFSeats.get(zcfSeat);
|
|
120
|
-
}
|
|
121
|
-
};
|
|
122
|
-
|
|
123
|
-
const assertStagedAllocation = zcfSeat => {
|
|
124
|
-
hasStagedAllocation(zcfSeat) ||
|
|
125
|
-
Fail`Reallocate failed because a seat had no staged allocation. Please add or subtract from the seat and then reallocate.`;
|
|
126
|
-
};
|
|
127
|
-
|
|
128
|
-
const setStagedAllocation = (zcfSeat, newStagedAllocation) => {
|
|
129
|
-
if (zcfSeatToStagedAllocations.has(zcfSeat)) {
|
|
130
|
-
zcfSeatToStagedAllocations.set(zcfSeat, newStagedAllocation);
|
|
131
|
-
} else {
|
|
132
|
-
zcfSeatToStagedAllocations.init(zcfSeat, newStagedAllocation);
|
|
133
|
-
}
|
|
134
|
-
};
|
|
135
|
-
|
|
136
|
-
/** @param {ZCFSeat} zcfSeat */
|
|
137
|
-
const assertNoStagedAllocation = zcfSeat => {
|
|
138
|
-
if (hasStagedAllocation(zcfSeat)) {
|
|
139
|
-
Fail`The seat could not be exited with a staged but uncommitted allocation: ${getStagedAllocation(
|
|
140
|
-
zcfSeat,
|
|
141
|
-
)}. Please reallocate over this seat or clear the staged allocation.`;
|
|
142
|
-
}
|
|
143
|
-
};
|
|
144
|
-
|
|
145
89
|
const ZCFSeatI = M.interface('ZCFSeat', {}, { sloppy: true });
|
|
146
90
|
|
|
147
91
|
const makeZCFSeatInternal = prepareExoClass(
|
|
@@ -163,7 +107,6 @@ export const createSeatManager = (
|
|
|
163
107
|
exit(completion) {
|
|
164
108
|
const { self } = this;
|
|
165
109
|
assertActive(self);
|
|
166
|
-
assertNoStagedAllocation(self);
|
|
167
110
|
doExitSeat(self);
|
|
168
111
|
void E(zoeInstanceAdmin).exitSeat(
|
|
169
112
|
zcfSeatToSeatHandle.get(self),
|
|
@@ -221,10 +164,6 @@ export const createSeatManager = (
|
|
|
221
164
|
const { self } = this;
|
|
222
165
|
return getCurrentAllocation(self);
|
|
223
166
|
},
|
|
224
|
-
getStagedAllocation() {
|
|
225
|
-
const { self } = this;
|
|
226
|
-
return getStagedAllocation(self);
|
|
227
|
-
},
|
|
228
167
|
isOfferSafe(newAllocation) {
|
|
229
168
|
const { state, self } = this;
|
|
230
169
|
assertActive(self);
|
|
@@ -236,53 +175,6 @@ export const createSeatManager = (
|
|
|
236
175
|
|
|
237
176
|
return isOfferSafe(state.proposal, reallocation);
|
|
238
177
|
},
|
|
239
|
-
/**
|
|
240
|
-
* @deprecated switch to zcf.atomicRearrange()
|
|
241
|
-
* @param {AmountKeywordRecord} amountKeywordRecord
|
|
242
|
-
*/
|
|
243
|
-
incrementBy(amountKeywordRecord) {
|
|
244
|
-
const { self } = this;
|
|
245
|
-
assertActive(self);
|
|
246
|
-
amountKeywordRecord = coerceAmountKeywordRecord(
|
|
247
|
-
amountKeywordRecord,
|
|
248
|
-
getAssetKindByBrand,
|
|
249
|
-
);
|
|
250
|
-
setStagedAllocation(
|
|
251
|
-
self,
|
|
252
|
-
addToAllocation(getStagedAllocation(self), amountKeywordRecord),
|
|
253
|
-
);
|
|
254
|
-
return amountKeywordRecord;
|
|
255
|
-
},
|
|
256
|
-
/**
|
|
257
|
-
* @deprecated switch to zcf.atomicRearrange()
|
|
258
|
-
* @param {AmountKeywordRecord} amountKeywordRecord
|
|
259
|
-
*/
|
|
260
|
-
decrementBy(amountKeywordRecord) {
|
|
261
|
-
const { self } = this;
|
|
262
|
-
assertActive(self);
|
|
263
|
-
amountKeywordRecord = coerceAmountKeywordRecord(
|
|
264
|
-
amountKeywordRecord,
|
|
265
|
-
getAssetKindByBrand,
|
|
266
|
-
);
|
|
267
|
-
setStagedAllocation(
|
|
268
|
-
self,
|
|
269
|
-
subtractFromAllocation(
|
|
270
|
-
getStagedAllocation(self),
|
|
271
|
-
amountKeywordRecord,
|
|
272
|
-
),
|
|
273
|
-
);
|
|
274
|
-
return amountKeywordRecord;
|
|
275
|
-
},
|
|
276
|
-
clear() {
|
|
277
|
-
const { self } = this;
|
|
278
|
-
if (zcfSeatToStagedAllocations.has(self)) {
|
|
279
|
-
zcfSeatToStagedAllocations.delete(self);
|
|
280
|
-
}
|
|
281
|
-
},
|
|
282
|
-
hasStagedAllocation() {
|
|
283
|
-
const { self } = this;
|
|
284
|
-
return hasStagedAllocation(self);
|
|
285
|
-
},
|
|
286
178
|
},
|
|
287
179
|
);
|
|
288
180
|
|
|
@@ -296,9 +188,6 @@ export const createSeatManager = (
|
|
|
296
188
|
seatManager: M.interface('ZcfSeatManager', {
|
|
297
189
|
makeZCFSeat: M.call(SeatDataShape).returns(M.remotable('zcfSeat')),
|
|
298
190
|
atomicRearrange: M.call(M.arrayOf(TransferPartShape)).returns(),
|
|
299
|
-
reallocate: M.call(M.remotable('zcfSeat'), M.remotable('zcfSeat'))
|
|
300
|
-
.rest(M.arrayOf(M.remotable('zcfSeat')))
|
|
301
|
-
.returns(),
|
|
302
191
|
dropAllReferences: M.call().returns(),
|
|
303
192
|
}),
|
|
304
193
|
zcfMintReallocator: M.interface('MintReallocator', {
|
|
@@ -350,8 +239,6 @@ export const createSeatManager = (
|
|
|
350
239
|
// ////// All Seats are active /////////////////////////////////
|
|
351
240
|
for (const [seat] of newAllocations) {
|
|
352
241
|
assertActive(seat);
|
|
353
|
-
!seat.hasStagedAllocation() ||
|
|
354
|
-
Fail`Cannot mix atomicRearrange with seat stagings: ${seat}`;
|
|
355
242
|
zcfSeatToSeatHandle.has(seat) ||
|
|
356
243
|
Fail`The seat ${seat} was not recognized`;
|
|
357
244
|
}
|
|
@@ -410,69 +297,6 @@ export const createSeatManager = (
|
|
|
410
297
|
throw err;
|
|
411
298
|
}
|
|
412
299
|
},
|
|
413
|
-
reallocate(/** @type {ZCFSeat[]} */ ...seats) {
|
|
414
|
-
for (const seat of seats) {
|
|
415
|
-
assertActive(seat);
|
|
416
|
-
assertStagedAllocation(seat);
|
|
417
|
-
}
|
|
418
|
-
|
|
419
|
-
// Ensure that rights are conserved overall.
|
|
420
|
-
const flattenAllocations = allocations =>
|
|
421
|
-
allocations.flatMap(Object.values);
|
|
422
|
-
const previousAllocations = seats.map(seat =>
|
|
423
|
-
seat.getCurrentAllocation(),
|
|
424
|
-
);
|
|
425
|
-
const previousAmounts = flattenAllocations(previousAllocations);
|
|
426
|
-
const newAllocations = seats.map(seat => seat.getStagedAllocation());
|
|
427
|
-
const newAmounts = flattenAllocations(newAllocations);
|
|
428
|
-
|
|
429
|
-
assertRightsConserved(previousAmounts, newAmounts);
|
|
430
|
-
|
|
431
|
-
// Ensure that offer safety holds.
|
|
432
|
-
for (const seat of seats) {
|
|
433
|
-
isOfferSafe(seat.getProposal(), seat.getStagedAllocation()) ||
|
|
434
|
-
Fail`Offer safety was violated by the proposed allocation: ${seat.getStagedAllocation()}. Proposal was ${seat.getProposal()}`;
|
|
435
|
-
}
|
|
436
|
-
|
|
437
|
-
// Keep track of seats used so far in this call, to prevent aliasing.
|
|
438
|
-
const zcfSeatsSoFar = new Set();
|
|
439
|
-
|
|
440
|
-
for (const seat of seats) {
|
|
441
|
-
zcfSeatToSeatHandle.has(seat) ||
|
|
442
|
-
Fail`The seat ${seat} was not recognized`;
|
|
443
|
-
!zcfSeatsSoFar.has(seat) ||
|
|
444
|
-
Fail`Seat (${seat}) was already an argument to reallocate`;
|
|
445
|
-
zcfSeatsSoFar.add(seat);
|
|
446
|
-
}
|
|
447
|
-
|
|
448
|
-
try {
|
|
449
|
-
// No side effects above. All conditions checked which could have
|
|
450
|
-
// caused us to reject this reallocation.
|
|
451
|
-
// COMMIT POINT
|
|
452
|
-
// All the effects below must succeed "atomically". Scare quotes because
|
|
453
|
-
// the eventual send at the bottom is part of this "atomicity" even
|
|
454
|
-
// though its effects happen later. The send occurs in the order of
|
|
455
|
-
// updates from zcf to zoe, its effects must occur immediately in zoe
|
|
456
|
-
// on reception, and must not fail.
|
|
457
|
-
//
|
|
458
|
-
// Commit the staged allocations (currentAllocation is replaced
|
|
459
|
-
// for each of the seats) and inform Zoe of the
|
|
460
|
-
// newAllocation.
|
|
461
|
-
|
|
462
|
-
for (const seat of seats) {
|
|
463
|
-
commitStagedAllocation(seat);
|
|
464
|
-
}
|
|
465
|
-
const seatHandleAllocations = seats.map(seat => {
|
|
466
|
-
const seatHandle = zcfSeatToSeatHandle.get(seat);
|
|
467
|
-
return { seatHandle, allocation: seat.getCurrentAllocation() };
|
|
468
|
-
});
|
|
469
|
-
|
|
470
|
-
E(zoeInstanceAdmin).replaceAllocations(seatHandleAllocations);
|
|
471
|
-
} catch (err) {
|
|
472
|
-
shutdownWithFailure(err);
|
|
473
|
-
throw err;
|
|
474
|
-
}
|
|
475
|
-
},
|
|
476
300
|
dropAllReferences() {
|
|
477
301
|
activeZCFSeats = replaceDurableWeakMapStore(
|
|
478
302
|
zcfBaggage,
|
|
@@ -485,9 +309,9 @@ export const createSeatManager = (
|
|
|
485
309
|
},
|
|
486
310
|
},
|
|
487
311
|
zcfMintReallocator: {
|
|
488
|
-
// Unlike the zcf.
|
|
312
|
+
// Unlike the zcf.atomicRearrange method, this one does not check
|
|
489
313
|
// conservation, and so can be used internally for reallocations that
|
|
490
|
-
// violate conservation.
|
|
314
|
+
// violate conservation, like minting and burning.
|
|
491
315
|
reallocate(zcfSeat, newAllocation) {
|
|
492
316
|
try {
|
|
493
317
|
// COMMIT POINT
|
|
@@ -1,2 +1,10 @@
|
|
|
1
|
-
export function makeZCFZygote(powers: VatPowers, zoeService: ERef<ZoeService>, invitationIssuer: Issuer<"set">, testJigSetter:
|
|
1
|
+
export function makeZCFZygote(powers: VatPowers, zoeService: ERef<ZoeService>, invitationIssuer: Issuer<"set">, testJigSetter: ({ zcf }: {
|
|
2
|
+
zcf: ZCF;
|
|
3
|
+
}) => void, contractBundleCap: BundleCap, zcfBaggage?: import("@agoric/vat-data").Baggage): Promise<ZCFZygote>;
|
|
4
|
+
export type ZCFZygote = {
|
|
5
|
+
startContract: (instanceAdminFromZoe: ERef<ZoeInstanceAdmin>, instanceRecordFromZoe: InstanceRecord, issuerStorageFromZoe: IssuerRecords, privateArgs?: object) => Promise<ExecuteContractResult>;
|
|
6
|
+
restartContract: (privateArgs?: object) => void;
|
|
7
|
+
};
|
|
8
|
+
import type { ZoeService } from '@agoric/zoe';
|
|
9
|
+
import type { ZCF } from '@agoric/zoe';
|
|
2
10
|
//# sourceMappingURL=zcfZygote.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zcfZygote.d.ts","sourceRoot":"","sources":["zcfZygote.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"zcfZygote.d.ts","sourceRoot":"","sources":["zcfZygote.js"],"names":[],"mappings":"AA6DO,sCARI,SAAS,cACT,IAAI,CAAC,UAAU,CAAC,oBAChB,MAAM,CAAC,KAAK,CAAC,iBACb,CAAE,EAAC,GAAG,EAAC,EAAE;IAAC,GAAG,EAAE,GAAG,CAAA;CAAC,KAAM,IAAI,qBAC7B,SAAS,eACT,OAAO,kBAAkB,EAAE,OAAO,GAChC,OAAO,CAAC,SAAS,CAAC,CAod9B;;mBAvea,CAAC,oBAAoB,EAAE,IAAI,CAAC,gBAAgB,CAAC,EACpD,qBAAqB,EAAE,cAAc,EACrC,oBAAoB,EAAE,aAAa,EACnC,WAAW,CAAC,EAAE,MAAM,KACnB,OAAO,CAAC,qBAAqB,CAAC;qBACxB,CAAC,WAAW,CAAC,EAAE,MAAM,KAAK,IAAI;;gCAV8D,aAAa;yBAAb,aAAa"}
|
|
@@ -30,9 +30,21 @@ import { prepareZcMint } from './zcfMint.js';
|
|
|
30
30
|
import { ZcfI } from './typeGuards.js';
|
|
31
31
|
|
|
32
32
|
/// <reference path="../internal-types.js" />
|
|
33
|
-
/// <reference path="./internal-types.js" />
|
|
34
33
|
|
|
35
|
-
/**
|
|
34
|
+
/**
|
|
35
|
+
* @import {IssuerOptionsRecord} from '@agoric/ertp';
|
|
36
|
+
* @import {ContractMeta, ContractStartFn, SetTestJig, ZCF, ZCFMint, ZCFRegisterFeeMint, ZoeService} from '@agoric/zoe';
|
|
37
|
+
*/
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* @typedef ZCFZygote
|
|
41
|
+
* @property {(instanceAdminFromZoe: ERef<ZoeInstanceAdmin>,
|
|
42
|
+
* instanceRecordFromZoe: InstanceRecord,
|
|
43
|
+
* issuerStorageFromZoe: IssuerRecords,
|
|
44
|
+
* privateArgs?: object,
|
|
45
|
+
* ) => Promise<ExecuteContractResult>} startContract
|
|
46
|
+
* @property {(privateArgs?: object) => void} restartContract
|
|
47
|
+
*/
|
|
36
48
|
|
|
37
49
|
/**
|
|
38
50
|
* Make the ZCF vat in zygote-usable form. First, a generic ZCF is
|
|
@@ -42,7 +54,7 @@ import { ZcfI } from './typeGuards.js';
|
|
|
42
54
|
* @param {VatPowers} powers
|
|
43
55
|
* @param {ERef<ZoeService>} zoeService
|
|
44
56
|
* @param {Issuer<'set'>} invitationIssuer
|
|
45
|
-
* @param {
|
|
57
|
+
* @param {( {zcf}: {zcf: ZCF} ) => void} testJigSetter
|
|
46
58
|
* @param {BundleCap} contractBundleCap
|
|
47
59
|
* @param {import('@agoric/vat-data').Baggage} zcfBaggage
|
|
48
60
|
* @returns {Promise<ZCFZygote>}
|
|
@@ -92,7 +104,7 @@ export const makeZCFZygote = async (
|
|
|
92
104
|
|
|
93
105
|
/**
|
|
94
106
|
* @param {string} keyword
|
|
95
|
-
* @param {
|
|
107
|
+
* @param {ZoeIssuerRecord} issuerRecord
|
|
96
108
|
*/
|
|
97
109
|
const recordIssuer = (keyword, issuerRecord) => {
|
|
98
110
|
getInstanceRecHolder().addIssuer(keyword, issuerRecord);
|
|
@@ -238,7 +250,7 @@ export const makeZCFZygote = async (
|
|
|
238
250
|
} else {
|
|
239
251
|
bundle = contractBundleCap;
|
|
240
252
|
}
|
|
241
|
-
return evalContractBundle(bundle);
|
|
253
|
+
return /** @type {any} */ (evalContractBundle(bundle));
|
|
242
254
|
};
|
|
243
255
|
// evaluate the contract (either the first version, or an upgrade)
|
|
244
256
|
const bundleResult = await evaluateContract();
|
|
@@ -283,7 +295,6 @@ export const makeZCFZygote = async (
|
|
|
283
295
|
/** @type {ZCF} */
|
|
284
296
|
const zcf = prepareExo(zcfBaggage, 'zcf', ZcfI, {
|
|
285
297
|
atomicRearrange: transfers => seatManager.atomicRearrange(transfers),
|
|
286
|
-
reallocate: (...seats) => seatManager.reallocate(...seats),
|
|
287
298
|
assertUniqueKeyword: kwd => getInstanceRecHolder().assertUniqueKeyword(kwd),
|
|
288
299
|
saveIssuer: async (issuerP, keyword) => {
|
|
289
300
|
// TODO: The checks of the keyword for uniqueness are
|
|
@@ -488,9 +499,16 @@ export const makeZCFZygote = async (
|
|
|
488
499
|
publicFacet = undefined,
|
|
489
500
|
creatorInvitation = undefined,
|
|
490
501
|
}) => {
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
502
|
+
let priorCreatorFacet;
|
|
503
|
+
let priorPublicFacet;
|
|
504
|
+
let priorCreatorInvitation;
|
|
505
|
+
try {
|
|
506
|
+
priorCreatorFacet = zcfBaggage.get('creatorFacet');
|
|
507
|
+
priorPublicFacet = zcfBaggage.get('publicFacet');
|
|
508
|
+
priorCreatorInvitation = zcfBaggage.get('creatorInvitation');
|
|
509
|
+
} catch (e) {
|
|
510
|
+
Fail`restartContract failed: original contract facets were not durable (${e})`;
|
|
511
|
+
}
|
|
494
512
|
|
|
495
513
|
(priorCreatorFacet === creatorFacet &&
|
|
496
514
|
priorPublicFacet === publicFacet &&
|
|
@@ -1,6 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @import {TransferPart, ZCF, ZCFSeat} from '@agoric/zoe';
|
|
3
|
+
*/
|
|
1
4
|
export const TransferPartShape: import("@endo/patterns").Matcher;
|
|
2
5
|
export function atomicRearrange(zcf: ZCF, transfers: TransferPart[]): void;
|
|
3
6
|
export function fromOnly(fromSeat: ZCFSeat, fromAmounts: AmountKeywordRecord): TransferPart;
|
|
4
7
|
export function toOnly(toSeat: ZCFSeat, toAmounts: AmountKeywordRecord): TransferPart;
|
|
5
8
|
export function atomicTransfer(zcf: ZCF, fromSeat?: ZCFSeat, toSeat?: ZCFSeat, fromAmounts?: AmountKeywordRecord, toAmounts?: AmountKeywordRecord): void;
|
|
9
|
+
import type { ZCF } from '@agoric/zoe';
|
|
10
|
+
import type { TransferPart } from '@agoric/zoe';
|
|
11
|
+
import type { ZCFSeat } from '@agoric/zoe';
|
|
6
12
|
//# sourceMappingURL=atomicTransfer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"atomicTransfer.d.ts","sourceRoot":"","sources":["atomicTransfer.js"],"names":[],"mappings":"AAGA,iEAGE;AAyCK,qCAHI,GAAG,aACH,YAAY,EAAE,QAIxB;AAcM,mCAJI,OAAO,eACP,mBAAmB,GACjB,YAAY,CAGmB;AAcrC,+BAJI,OAAO,aACP,mBAAmB,GACjB,YAAY,CAG0B;AAW5C,oCANI,GAAG,aACH,OAAO,WACP,OAAO,gBACP,mBAAmB,cACnB,mBAAmB,QAQgD"}
|
|
1
|
+
{"version":3,"file":"atomicTransfer.d.ts","sourceRoot":"","sources":["atomicTransfer.js"],"names":[],"mappings":"AAGA;;GAEG;AAEH,iEAGE;AAyCK,qCAHI,GAAG,aACH,YAAY,EAAE,QAIxB;AAcM,mCAJI,OAAO,eACP,mBAAmB,GACjB,YAAY,CAGmB;AAcrC,+BAJI,OAAO,aACP,mBAAmB,GACjB,YAAY,CAG0B;AAW5C,oCANI,GAAG,aACH,OAAO,WACP,OAAO,gBACP,mBAAmB,cACnB,mBAAmB,QAQgD;yBAhGjC,aAAa;kCAAb,aAAa;6BAAb,aAAa"}
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { M } from '@agoric/store';
|
|
2
2
|
import { AmountKeywordRecordShape, SeatShape } from '../typeGuards.js';
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* @import {TransferPart, ZCF, ZCFSeat} from '@agoric/zoe';
|
|
6
|
+
*/
|
|
7
|
+
|
|
4
8
|
export const TransferPartShape = M.splitArray(
|
|
5
9
|
harden([M.opt(SeatShape), M.opt(SeatShape), M.opt(AmountKeywordRecordShape)]),
|
|
6
10
|
harden([M.opt(AmountKeywordRecordShape)]),
|
|
@@ -2,4 +2,5 @@ export function makeEphemeraProvider<E extends {}, K extends WeakKey>(init: (key
|
|
|
2
2
|
export function provideEmptySeat(zcf: ZCF, baggage: import("@agoric/swingset-liveslots").Baggage, name: string): ZCFSeat;
|
|
3
3
|
export function provideAll<T extends Record<string, () => ERef<any>>>(baggage: MapStore<string, any>, thunks: T): Promise<{ [K in keyof T]: Awaited<ReturnType<T[K]>>; }>;
|
|
4
4
|
export function provideSingleton<T extends () => ERef<any>>(mapStore: import("@agoric/vat-data").Baggage, key: string, makeValue: T, withValue?: (value: Awaited<ReturnType<T>>) => void): Promise<Awaited<ReturnType<T>>>;
|
|
5
|
+
import type { MapStore } from '@agoric/swingset-liveslots';
|
|
5
6
|
//# sourceMappingURL=durability.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"durability.d.ts","sourceRoot":"","sources":["durability.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"durability.d.ts","sourceRoot":"","sources":["durability.js"],"names":[],"mappings":"AAiBO,qCAJW,CAAC,SAAN,EAAI,EACM,CAAC,SAAV,OAAQ,QACX,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC,eASA,CAAC,CAWxB;AAWM,sCALI,GAAG,WACH,OAAO,4BAA4B,EAAE,OAAO,QAC5C,MAAM,GACJ,OAAO,CAInB;AAiCM,2BALwC,CAAC,SAAlC,MAAM,CAAC,MAAM,EAAE,MAAM,IAAI,CAAC,GAAG,CAAC,CAAE,WACnC,SAAS,MAAM,EAAE,GAAG,CAAC,UACrB,CAAC,GACC,OAAO,CAAC,GAAG,CAAC,IAAI,MAAM,CAAC,GAAG,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,GAAE,CAAC,CAuBlE;AAgBM,iCAPwB,CAAC,SAAnB,MAAO,IAAI,CAAC,GAAG,CAAE,YACnB,OAAO,kBAAkB,EAAE,OAAO,OAClC,MAAM,aACN,CAAC,cACD,CAAC,KAAK,EAAE,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,KAAK,IAAI,GACrC,OAAO,CAAC,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAc3C;8BA7H0B,4BAA4B"}
|
|
@@ -2,6 +2,10 @@ import { allValues, objectMap } from '@agoric/internal';
|
|
|
2
2
|
import { provide } from '@agoric/vat-data';
|
|
3
3
|
import { E } from '@endo/eventual-send';
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* @import {MapStore} from '@agoric/swingset-liveslots';
|
|
7
|
+
*/
|
|
8
|
+
|
|
5
9
|
/**
|
|
6
10
|
* SCALE: Only for low cardinality provisioning. Every value from init() will
|
|
7
11
|
* remain in the map for the lifetime of the heap. If a key object is GCed, its
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
export { natSafeMath } from "
|
|
1
|
+
export { natSafeMath } from "@agoric/ertp/src/safeMath.js";
|
|
2
2
|
export { makeStateMachine } from "./stateMachine.js";
|
|
3
|
+
export * from "@agoric/ertp/src/ratio.js";
|
|
3
4
|
export * from "./durability.js";
|
|
4
5
|
export * from "./prepare-ownable.js";
|
|
5
6
|
export * from "./priceAuthority.js";
|
|
@@ -10,5 +11,4 @@ export * from "./topics.js";
|
|
|
10
11
|
export { getInputPrice, getOutputPrice, calcLiqValueToMint, calcValueToRemove, calcSecondaryRequired } from "./bondingCurves.js";
|
|
11
12
|
export { atomicRearrange, atomicTransfer, fromOnly, toOnly } from "./atomicTransfer.js";
|
|
12
13
|
export { defaultAcceptanceMsg, swap, fitProposalShape, assertProposalShape, assertIssuerKeywords, satisfies, assertNatAssetKind, swapExact, depositToSeat, withdrawFromSeat, saveAllIssuers, offerTo } from "./zoeHelpers.js";
|
|
13
|
-
export { makeRatio, makeRatioFromAmounts, floorMultiplyBy, floorDivideBy, ceilMultiplyBy, ceilDivideBy, assertIsRatio, invertRatio, oneMinus, addRatios, multiplyRatios, ratiosSame, quantize, ratioGTE, subtractRatios, ratioToNumber } from "./ratio.js";
|
|
14
14
|
//# sourceMappingURL=index.d.ts.map
|
|
@@ -8,7 +8,7 @@ export {
|
|
|
8
8
|
calcSecondaryRequired,
|
|
9
9
|
} from './bondingCurves.js';
|
|
10
10
|
|
|
11
|
-
export { natSafeMath } from '
|
|
11
|
+
export { natSafeMath } from '@agoric/ertp/src/safeMath.js';
|
|
12
12
|
|
|
13
13
|
export { makeStateMachine } from './stateMachine.js';
|
|
14
14
|
|
|
@@ -34,24 +34,7 @@ export {
|
|
|
34
34
|
offerTo,
|
|
35
35
|
} from './zoeHelpers.js';
|
|
36
36
|
|
|
37
|
-
export
|
|
38
|
-
makeRatio,
|
|
39
|
-
makeRatioFromAmounts,
|
|
40
|
-
floorMultiplyBy,
|
|
41
|
-
floorDivideBy,
|
|
42
|
-
ceilMultiplyBy,
|
|
43
|
-
ceilDivideBy,
|
|
44
|
-
assertIsRatio,
|
|
45
|
-
invertRatio,
|
|
46
|
-
oneMinus,
|
|
47
|
-
addRatios,
|
|
48
|
-
multiplyRatios,
|
|
49
|
-
ratiosSame,
|
|
50
|
-
quantize,
|
|
51
|
-
ratioGTE,
|
|
52
|
-
subtractRatios,
|
|
53
|
-
ratioToNumber,
|
|
54
|
-
} from './ratio.js';
|
|
37
|
+
export * from '@agoric/ertp/src/ratio.js';
|
|
55
38
|
|
|
56
39
|
export * from './durability.js';
|
|
57
40
|
export * from './prepare-ownable.js';
|
|
@@ -1,4 +1,6 @@
|
|
|
1
1
|
export function makeInitialTransform(priceOutPerIn: Ratio, priceAuthority: PriceAuthority, quoteMint: ERef<Mint<"set", PriceDescription>>, brandIn: Brand<"nat">, brandOut: Brand<"nat">): PriceAuthority;
|
|
2
2
|
import type { PriceAuthority } from '@agoric/zoe/tools/types.js';
|
|
3
3
|
import type { PriceDescription } from '@agoric/zoe/tools/types.js';
|
|
4
|
+
import type { Mint } from '@agoric/ertp';
|
|
5
|
+
import type { Brand } from '@agoric/ertp';
|
|
4
6
|
//# sourceMappingURL=priceAuthorityInitial.d.ts.map
|