@agoric/zoe 0.26.3-upgrade-14-dev-c8f9e7b.0 → 0.26.3-upgrade-16-fi-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
package/src/issuerStorage.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
+
import { deeplyFulfilledObject, objectMap } from '@agoric/internal';
|
|
1
2
|
import { provideDurableWeakMapStore } from '@agoric/vat-data';
|
|
2
3
|
import { E } from '@endo/eventual-send';
|
|
3
4
|
|
|
4
|
-
import { arrayToObj } from './objArrayConversion.js';
|
|
5
5
|
import { cleanKeywords } from './cleanProposal.js';
|
|
6
6
|
import { makeIssuerRecord } from './issuerRecord.js';
|
|
7
7
|
|
|
@@ -124,11 +124,6 @@ export const provideIssuerStorage = zcfBaggage => {
|
|
|
124
124
|
return getByBrand(brand);
|
|
125
125
|
};
|
|
126
126
|
|
|
127
|
-
const storeIssuers = issuers => {
|
|
128
|
-
assertInstantiated();
|
|
129
|
-
return Promise.all(issuers.map(storeIssuer));
|
|
130
|
-
};
|
|
131
|
-
|
|
132
127
|
/** @type {GetAssetKindByBrand} */
|
|
133
128
|
const getAssetKindByBrand = brand => {
|
|
134
129
|
assertInstantiated();
|
|
@@ -143,28 +138,14 @@ export const provideIssuerStorage = zcfBaggage => {
|
|
|
143
138
|
*/
|
|
144
139
|
const storeIssuerKeywordRecord = async uncleanIssuerKeywordRecord => {
|
|
145
140
|
assertInstantiated();
|
|
146
|
-
|
|
147
|
-
const
|
|
148
|
-
|
|
149
|
-
);
|
|
150
|
-
// The issuers may not have been seen before, so we must wait for the
|
|
151
|
-
// issuer records to be available synchronously
|
|
152
|
-
const issuerRecords = await storeIssuers(issuerPs);
|
|
153
|
-
// AWAIT ///
|
|
154
|
-
|
|
155
|
-
const issuers = arrayToObj(
|
|
156
|
-
issuerRecords.map(record => record.issuer),
|
|
157
|
-
keywords,
|
|
141
|
+
cleanKeywords(uncleanIssuerKeywordRecord);
|
|
142
|
+
const issuerRecordPs = objectMap(uncleanIssuerKeywordRecord, issuerP =>
|
|
143
|
+
storeIssuer(issuerP),
|
|
158
144
|
);
|
|
159
|
-
const
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
);
|
|
163
|
-
|
|
164
|
-
return harden({
|
|
165
|
-
issuers,
|
|
166
|
-
brands,
|
|
167
|
-
});
|
|
145
|
+
const issuerRecords = await deeplyFulfilledObject(issuerRecordPs);
|
|
146
|
+
const issuers = objectMap(issuerRecords, ({ issuer }) => issuer);
|
|
147
|
+
const brands = objectMap(issuerRecords, ({ brand }) => brand);
|
|
148
|
+
return harden({ issuers, brands });
|
|
168
149
|
};
|
|
169
150
|
|
|
170
151
|
/**
|
|
@@ -189,7 +170,10 @@ export const provideIssuerStorage = zcfBaggage => {
|
|
|
189
170
|
return brandToIssuerRecord.get(brand).issuer;
|
|
190
171
|
};
|
|
191
172
|
|
|
192
|
-
/**
|
|
173
|
+
/**
|
|
174
|
+
* @param {Issuer[]} issuers
|
|
175
|
+
* @returns {IssuerRecords}
|
|
176
|
+
*/
|
|
193
177
|
const getIssuerRecords = issuers => {
|
|
194
178
|
assertInstantiated();
|
|
195
179
|
return issuers.map(issuerToIssuerRecord.get);
|
package/src/makeHandle.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export function defineDurableHandle<H extends string>(baggage:
|
|
1
|
+
export function defineDurableHandle<H extends string>(baggage: Baggage, handleType: H): H extends "Instance" ? () => Instance : () => Handle<H>;
|
|
2
2
|
export function makeHandle<H extends string>(handleType: H): H extends "Instance" ? Instance : Handle<H>;
|
|
3
|
-
|
|
3
|
+
import type { Baggage } from '@agoric/vat-data';
|
|
4
4
|
//# sourceMappingURL=makeHandle.d.ts.map
|
package/src/makeHandle.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"makeHandle.d.ts","sourceRoot":"","sources":["makeHandle.js"],"names":[],"mappings":"AAkBO,
|
|
1
|
+
{"version":3,"file":"makeHandle.d.ts","sourceRoot":"","sources":["makeHandle.js"],"names":[],"mappings":"AAkBO,oCAF2D,CAAC,+CAAD,CAAC,AADvD,GACsD,CAAC,AAArD,SAAS,UAAU,GAAG,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,CAAC,CAAC,CAanE;AAUM,2BAF+C,CAAC,6BAAD,CAAC,AAD3C,GAC0C,CAAC,AAAzC,SAAS,UAAU,GAAG,QAAQ,GAAG,MAAM,CAAC,CAAC,CAAC,CAOvD;6BAlC0B,kBAAkB"}
|
package/src/makeHandle.js
CHANGED
package/src/typeGuards.d.ts
CHANGED
|
@@ -18,53 +18,152 @@ export namespace TermsShape {
|
|
|
18
18
|
export namespace InstanceRecordShape {
|
|
19
19
|
export { InstallationShape as installation };
|
|
20
20
|
export { InstanceHandleShape as instance };
|
|
21
|
-
export
|
|
21
|
+
export let terms: import("@endo/patterns").Matcher;
|
|
22
22
|
}
|
|
23
|
-
export const HandleI: import("@endo/patterns").InterfaceGuard
|
|
23
|
+
export const HandleI: import("@endo/patterns").InterfaceGuard<{}>;
|
|
24
24
|
export function makeHandleShape(name: any): import("@endo/patterns").Matcher;
|
|
25
25
|
export const TimerShape: import("@endo/patterns").Matcher;
|
|
26
26
|
export namespace FullProposalShape {
|
|
27
27
|
export { AmountPatternKeywordRecordShape as want };
|
|
28
28
|
export { AmountKeywordRecordShape as give };
|
|
29
|
-
export
|
|
29
|
+
export let exit: import("@endo/patterns").Matcher;
|
|
30
30
|
}
|
|
31
31
|
/** @see {Proposal} type */
|
|
32
32
|
export const ProposalShape: import("@endo/patterns").Matcher;
|
|
33
|
+
export const EmptyProposalShape: import("@endo/patterns").Matcher;
|
|
33
34
|
export function isOnDemandExitRule(exit: any): boolean;
|
|
34
35
|
export function isWaivedExitRule(exit: ExitRule): exit is WaivedExitRule;
|
|
35
36
|
export function isAfterDeadlineExitRule(exit: ExitRule): exit is AfterDeadlineExitRule;
|
|
36
37
|
export const InvitationElementShape: import("@endo/patterns").Matcher;
|
|
37
|
-
export const OfferHandlerI: import("@endo/patterns").InterfaceGuard
|
|
38
|
+
export const OfferHandlerI: import("@endo/patterns").InterfaceGuard<{
|
|
39
|
+
handle: import("@endo/patterns").MethodGuard;
|
|
40
|
+
}>;
|
|
38
41
|
export const SeatHandleAllocationsShape: import("@endo/patterns").Matcher;
|
|
39
42
|
export const ZoeMintShape: import("@endo/patterns").Matcher;
|
|
40
|
-
export const ZoeMintI: import("@endo/patterns").InterfaceGuard
|
|
41
|
-
|
|
43
|
+
export const ZoeMintI: import("@endo/patterns").InterfaceGuard<{
|
|
44
|
+
getIssuerRecord: import("@endo/patterns").MethodGuard;
|
|
45
|
+
mintAndEscrow: import("@endo/patterns").MethodGuard;
|
|
46
|
+
withdrawAndBurn: import("@endo/patterns").MethodGuard;
|
|
47
|
+
}>;
|
|
48
|
+
export const ZcfMintI: import("@endo/patterns").InterfaceGuard<{
|
|
49
|
+
getIssuerRecord: import("@endo/patterns").MethodGuard;
|
|
50
|
+
mintGains: import("@endo/patterns").MethodGuard;
|
|
51
|
+
burnLosses: import("@endo/patterns").MethodGuard;
|
|
52
|
+
}>;
|
|
42
53
|
export const FeeMintAccessShape: import("@endo/patterns").Matcher;
|
|
43
|
-
export const ExitObjectI: import("@endo/patterns").InterfaceGuard
|
|
54
|
+
export const ExitObjectI: import("@endo/patterns").InterfaceGuard<{
|
|
55
|
+
exit: import("@endo/patterns").MethodGuard;
|
|
56
|
+
}>;
|
|
44
57
|
export const ExitObjectShape: import("@endo/patterns").Matcher;
|
|
45
58
|
export const InstanceAdminShape: import("@endo/patterns").Matcher;
|
|
46
|
-
export const InstanceAdminI: import("@endo/patterns").InterfaceGuard
|
|
59
|
+
export const InstanceAdminI: import("@endo/patterns").InterfaceGuard<{
|
|
60
|
+
makeInvitation: import("@endo/patterns").MethodGuard;
|
|
61
|
+
saveIssuer: import("@endo/patterns").MethodGuard;
|
|
62
|
+
makeNoEscrowSeat: import("@endo/patterns").MethodGuard;
|
|
63
|
+
exitAllSeats: import("@endo/patterns").MethodGuard;
|
|
64
|
+
failAllSeats: import("@endo/patterns").MethodGuard;
|
|
65
|
+
exitSeat: import("@endo/patterns").MethodGuard;
|
|
66
|
+
failSeat: import("@endo/patterns").MethodGuard;
|
|
67
|
+
makeZoeMint: import("@endo/patterns").MethodGuard;
|
|
68
|
+
registerFeeMint: import("@endo/patterns").MethodGuard;
|
|
69
|
+
replaceAllocations: import("@endo/patterns").MethodGuard;
|
|
70
|
+
stopAcceptingOffers: import("@endo/patterns").MethodGuard;
|
|
71
|
+
setOfferFilter: import("@endo/patterns").MethodGuard;
|
|
72
|
+
getOfferFilter: import("@endo/patterns").MethodGuard;
|
|
73
|
+
getExitSubscriber: import("@endo/patterns").MethodGuard;
|
|
74
|
+
isBlocked: import("@endo/patterns").MethodGuard;
|
|
75
|
+
repairContractCompletionWatcher: import("@endo/patterns").MethodGuard;
|
|
76
|
+
}>;
|
|
47
77
|
export namespace InstanceStorageManagerIKit {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
78
|
+
let instanceStorageManager: import("@endo/patterns").InterfaceGuard<{
|
|
79
|
+
getTerms: import("@endo/patterns").MethodGuard;
|
|
80
|
+
getIssuers: import("@endo/patterns").MethodGuard;
|
|
81
|
+
getBrands: import("@endo/patterns").MethodGuard;
|
|
82
|
+
getInstallation: import("@endo/patterns").MethodGuard;
|
|
83
|
+
getInvitationIssuer: import("@endo/patterns").MethodGuard;
|
|
84
|
+
saveIssuer: import("@endo/patterns").MethodGuard;
|
|
85
|
+
makeZoeMint: import("@endo/patterns").MethodGuard;
|
|
86
|
+
registerFeeMint: import("@endo/patterns").MethodGuard;
|
|
87
|
+
getInstanceRecord: import("@endo/patterns").MethodGuard;
|
|
88
|
+
getIssuerRecords: import("@endo/patterns").MethodGuard;
|
|
89
|
+
getWithdrawFacet: import("@endo/patterns").MethodGuard;
|
|
90
|
+
initInstanceAdmin: import("@endo/patterns").MethodGuard;
|
|
91
|
+
deleteInstanceAdmin: import("@endo/patterns").MethodGuard;
|
|
92
|
+
makeInvitation: import("@endo/patterns").MethodGuard;
|
|
93
|
+
getRoot: import("@endo/patterns").MethodGuard;
|
|
94
|
+
getAdminNode: import("@endo/patterns").MethodGuard;
|
|
95
|
+
}>;
|
|
96
|
+
let withdrawFacet: import("@endo/patterns").InterfaceGuard<{
|
|
97
|
+
withdrawPayments: import("@endo/patterns").MethodGuard;
|
|
98
|
+
}>;
|
|
99
|
+
let helpers: import("@endo/patterns").InterfaceGuard<{
|
|
100
|
+
wrapIssuerKitWithZoeMint: import("@endo/patterns").MethodGuard;
|
|
101
|
+
}>;
|
|
51
102
|
}
|
|
52
103
|
export const BundleCapShape: import("@endo/patterns").Matcher;
|
|
53
104
|
export const BundleShape: import("@endo/patterns").Matcher;
|
|
54
105
|
export const UnwrappedInstallationShape: import("@endo/patterns").Matcher;
|
|
55
106
|
export namespace ZoeStorageManagerIKit {
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
107
|
+
let zoeServiceDataAccess: import("@endo/patterns").InterfaceGuard<{
|
|
108
|
+
getTerms: import("@endo/patterns").MethodGuard;
|
|
109
|
+
getIssuers: import("@endo/patterns").MethodGuard;
|
|
110
|
+
getBrands: import("@endo/patterns").MethodGuard;
|
|
111
|
+
getInstallation: import("@endo/patterns").MethodGuard;
|
|
112
|
+
getInvitationIssuer: import("@endo/patterns").MethodGuard;
|
|
113
|
+
getBundleIDFromInstallation: import("@endo/patterns").MethodGuard;
|
|
114
|
+
installBundle: import("@endo/patterns").MethodGuard;
|
|
115
|
+
installBundleID: import("@endo/patterns").MethodGuard;
|
|
116
|
+
getPublicFacet: import("@endo/patterns").MethodGuard;
|
|
117
|
+
getOfferFilter: import("@endo/patterns").MethodGuard;
|
|
118
|
+
getProposalShapeForInvitation: import("@endo/patterns").MethodGuard;
|
|
119
|
+
}>;
|
|
120
|
+
let makeOfferAccess: import("@endo/patterns").InterfaceGuard<{
|
|
121
|
+
getAssetKindByBrand: import("@endo/patterns").MethodGuard;
|
|
122
|
+
getInstanceAdmin: import("@endo/patterns").MethodGuard;
|
|
123
|
+
getProposalShapeForInvitation: import("@endo/patterns").MethodGuard;
|
|
124
|
+
getInvitationIssuer: import("@endo/patterns").MethodGuard;
|
|
125
|
+
depositPayments: import("@endo/patterns").MethodGuard;
|
|
126
|
+
}>;
|
|
127
|
+
let startInstanceAccess: import("@endo/patterns").InterfaceGuard<{
|
|
128
|
+
makeZoeInstanceStorageManager: import("@endo/patterns").MethodGuard;
|
|
129
|
+
unwrapInstallation: import("@endo/patterns").MethodGuard;
|
|
130
|
+
}>;
|
|
131
|
+
let invitationIssuerAccess: import("@endo/patterns").InterfaceGuard<{
|
|
132
|
+
getInvitationIssuer: import("@endo/patterns").MethodGuard;
|
|
133
|
+
}>;
|
|
60
134
|
}
|
|
61
|
-
export const ZoeServiceI: import("@endo/patterns").InterfaceGuard
|
|
62
|
-
|
|
135
|
+
export const ZoeServiceI: import("@endo/patterns").InterfaceGuard<{
|
|
136
|
+
install: import("@endo/patterns").MethodGuard;
|
|
137
|
+
installBundleID: import("@endo/patterns").MethodGuard;
|
|
138
|
+
startInstance: import("@endo/patterns").MethodGuard;
|
|
139
|
+
offer: import("@endo/patterns").MethodGuard;
|
|
140
|
+
getOfferFilter: import("@endo/patterns").MethodGuard;
|
|
141
|
+
getInvitationIssuer: import("@endo/patterns").MethodGuard;
|
|
142
|
+
getFeeIssuer: import("@endo/patterns").MethodGuard;
|
|
143
|
+
getBrands: import("@endo/patterns").MethodGuard;
|
|
144
|
+
getIssuers: import("@endo/patterns").MethodGuard;
|
|
145
|
+
getPublicFacet: import("@endo/patterns").MethodGuard;
|
|
146
|
+
getTerms: import("@endo/patterns").MethodGuard;
|
|
147
|
+
getInstallationForInstance: import("@endo/patterns").MethodGuard;
|
|
148
|
+
getBundleIDFromInstallation: import("@endo/patterns").MethodGuard;
|
|
149
|
+
getInstallation: import("@endo/patterns").MethodGuard;
|
|
150
|
+
getInstance: import("@endo/patterns").MethodGuard;
|
|
151
|
+
getConfiguration: import("@endo/patterns").MethodGuard;
|
|
152
|
+
getInvitationDetails: import("@endo/patterns").MethodGuard;
|
|
153
|
+
getProposalShapeForInvitation: import("@endo/patterns").MethodGuard;
|
|
154
|
+
}>;
|
|
155
|
+
export const AdminFacetI: import("@endo/patterns").InterfaceGuard<{
|
|
156
|
+
getVatShutdownPromise: import("@endo/patterns").MethodGuard;
|
|
157
|
+
restartContract: import("@endo/patterns").MethodGuard;
|
|
158
|
+
upgradeContract: import("@endo/patterns").MethodGuard;
|
|
159
|
+
}>;
|
|
63
160
|
export const SeatDataShape: import("@endo/patterns").Matcher;
|
|
64
|
-
export const HandleOfferI: import("@endo/patterns").InterfaceGuard
|
|
161
|
+
export const HandleOfferI: import("@endo/patterns").InterfaceGuard<{
|
|
162
|
+
handleOffer: import("@endo/patterns").MethodGuard;
|
|
163
|
+
}>;
|
|
65
164
|
export namespace PriceQuoteShape {
|
|
66
165
|
export { AmountShape as quoteAmount };
|
|
67
|
-
export
|
|
166
|
+
export let quotePayment: globalThis.Pattern;
|
|
68
167
|
}
|
|
69
|
-
import { AmountShape } from
|
|
168
|
+
import { AmountShape } from '@agoric/ertp';
|
|
70
169
|
//# sourceMappingURL=typeGuards.d.ts.map
|
package/src/typeGuards.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"typeGuards.d.ts","sourceRoot":"","sources":["typeGuards.js"],"names":[],"mappings":"AAgBA,4DAAuC;AAEvC,qEAAqE;AACrE,+DAAyD;AACzD,mEAAiE;AACjE,iEAA6D;AAC7D,yDAA6C;AAE7C,wEAA8E;AAC9E,+EAGE;AACF,0EAGE;AACF,wEAA8E;AAC9E,yEAGE;AACF,uEAA4E;AAE5E,iEAOE;;;;;;;;;;AAaF,
|
|
1
|
+
{"version":3,"file":"typeGuards.d.ts","sourceRoot":"","sources":["typeGuards.js"],"names":[],"mappings":"AAgBA,4DAAuC;AAEvC,qEAAqE;AACrE,+DAAyD;AACzD,mEAAiE;AACjE,iEAA6D;AAC7D,yDAA6C;AAE7C,wEAA8E;AAC9E,+EAGE;AACF,0EAGE;AACF,wEAA8E;AAC9E,yEAGE;AACF,uEAA4E;AAE5E,iEAOE;;;;;;;;;;AAaF,kEAAiD;AAE1C,6EAA4D;AACnE,0DAAmD;;;;;;AA0BnD,2BAA2B;AAC3B,6DAAsE;AAEtE,kEAIG;AAEI,uDAGN;AAMM,uCAHI,QAAQ,GACN,IAAI,IAAI,cAAc,CAKlC;AAMM,8CAHI,QAAQ,GACN,IAAI,IAAI,qBAAqB,CAKzC;AAED,sEAKG;AAEH;;GAEG;AAEH,0EAKE;AAEF,4DAAmD;AACnD;;;;GAIG;AAEH;;;;GASG;AAEH,kEAA+D;AAE/D;;GAEG;AAEH,+DAAsD;AACtD,kEAA+D;AAC/D;;;;;;;;;;;;;;;;;GAkCG;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiDH,8DAAuD;AACvD,2DAGE;AAEF,0EAUE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8DF;;;;;;;;;;;;;;;;;;;GA6CG;AAEH;;;;GAIG;AAEH,6DASE;AAEF;;GAKG;;;;;4BAjYI,cAAc"}
|
package/src/typeGuards.js
CHANGED
|
@@ -90,6 +90,12 @@ export const FullProposalShape = harden({
|
|
|
90
90
|
/** @see {Proposal} type */
|
|
91
91
|
export const ProposalShape = M.splitRecord({}, FullProposalShape, {});
|
|
92
92
|
|
|
93
|
+
export const EmptyProposalShape = M.splitRecord({
|
|
94
|
+
give: {},
|
|
95
|
+
want: {},
|
|
96
|
+
exit: { onDemand: null },
|
|
97
|
+
});
|
|
98
|
+
|
|
93
99
|
export const isOnDemandExitRule = exit => {
|
|
94
100
|
const [exitKey] = Object.keys(exit);
|
|
95
101
|
return exitKey === 'onDemand';
|
|
@@ -121,7 +127,7 @@ export const InvitationElementShape = M.splitRecord({
|
|
|
121
127
|
});
|
|
122
128
|
|
|
123
129
|
export const OfferHandlerI = M.interface('OfferHandler', {
|
|
124
|
-
handle: M.call(SeatShape).optional(M.any()).returns(M.
|
|
130
|
+
handle: M.call(SeatShape).optional(M.any()).returns(M.any()),
|
|
125
131
|
});
|
|
126
132
|
|
|
127
133
|
export const SeatHandleAllocationsShape = M.arrayOf(
|
|
@@ -219,7 +225,7 @@ export const InstanceStorageManagerIKit = harden({
|
|
|
219
225
|
InstanceHandleShape,
|
|
220
226
|
M.remotable('instanceAdmin'),
|
|
221
227
|
).returns(M.promise()),
|
|
222
|
-
deleteInstanceAdmin: M.call(
|
|
228
|
+
deleteInstanceAdmin: M.call(InstanceAdminShape).returns(),
|
|
223
229
|
makeInvitation: M.call(InvitationHandleShape, M.string())
|
|
224
230
|
.optional(M.record(), M.pattern())
|
|
225
231
|
.returns(PaymentShape),
|
|
@@ -271,10 +277,12 @@ export const ZoeStorageManagerIKit = harden({
|
|
|
271
277
|
getBundleIDFromInstallation: M.call(InstallationShape).returns(
|
|
272
278
|
M.eref(M.string()),
|
|
273
279
|
),
|
|
274
|
-
installBundle: M.call(M.or(InstanceHandleShape, BundleShape))
|
|
275
|
-
M.
|
|
276
|
-
|
|
277
|
-
installBundleID: M.call(M.string())
|
|
280
|
+
installBundle: M.call(M.or(InstanceHandleShape, BundleShape))
|
|
281
|
+
.optional(M.string())
|
|
282
|
+
.returns(M.promise()),
|
|
283
|
+
installBundleID: M.call(M.string())
|
|
284
|
+
.optional(M.string())
|
|
285
|
+
.returns(M.promise()),
|
|
278
286
|
|
|
279
287
|
getPublicFacet: M.call(InstanceHandleShape).returns(
|
|
280
288
|
M.eref(M.remotable('PublicFacet')),
|
|
@@ -305,6 +313,7 @@ export const ZoeStorageManagerIKit = harden({
|
|
|
305
313
|
IssuerPKeywordRecordShape,
|
|
306
314
|
M.or(InstanceHandleShape, BundleShape),
|
|
307
315
|
M.or(BundleCapShape, BundleShape),
|
|
316
|
+
M.string(),
|
|
308
317
|
).returns(M.promise()),
|
|
309
318
|
unwrapInstallation: M.callWhen(M.eref(InstallationShape)).returns(
|
|
310
319
|
UnwrappedInstallationShape,
|
|
@@ -316,10 +325,10 @@ export const ZoeStorageManagerIKit = harden({
|
|
|
316
325
|
});
|
|
317
326
|
|
|
318
327
|
export const ZoeServiceI = M.interface('ZoeService', {
|
|
319
|
-
install: M.call(M.any()).returns(M.promise()),
|
|
320
|
-
installBundleID: M.call(M.string()).returns(M.promise()),
|
|
328
|
+
install: M.call(M.any()).optional(M.string()).returns(M.promise()),
|
|
329
|
+
installBundleID: M.call(M.string()).optional(M.string()).returns(M.promise()),
|
|
321
330
|
startInstance: M.call(M.eref(InstallationShape))
|
|
322
|
-
.optional(IssuerPKeywordRecordShape, M.
|
|
331
|
+
.optional(IssuerPKeywordRecordShape, M.record(), M.record(), M.string())
|
|
323
332
|
.returns(M.promise()),
|
|
324
333
|
offer: M.call(M.eref(InvitationShape))
|
|
325
334
|
.optional(ProposalShape, PaymentPKeywordRecordShape, M.any())
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Alias for RemotableObject
|
|
3
|
+
*/
|
|
4
|
+
type Handle<H extends string> = import("@endo/marshal").RemotableObject<H>;
|
|
5
|
+
type Keyword = string;
|
|
6
|
+
/**
|
|
7
|
+
* - an opaque handle for an invitation
|
|
8
|
+
*/
|
|
9
|
+
type InvitationHandle = Handle<"Invitation">;
|
|
10
|
+
type IssuerKeywordRecord = Record<Keyword, Issuer<any>>;
|
|
11
|
+
type IssuerPKeywordRecord = Record<Keyword, import("@endo/far").ERef<Issuer<any>>>;
|
|
12
|
+
type BrandKeywordRecord = Record<Keyword, Brand<any>>;
|
|
13
|
+
type StandardTerms = {
|
|
14
|
+
/**
|
|
15
|
+
* - record with
|
|
16
|
+
* keywords keys, issuer values
|
|
17
|
+
*/
|
|
18
|
+
issuers: IssuerKeywordRecord;
|
|
19
|
+
/**
|
|
20
|
+
* - record with keywords
|
|
21
|
+
* keys, brand values
|
|
22
|
+
*/
|
|
23
|
+
brands: BrandKeywordRecord;
|
|
24
|
+
};
|
|
25
|
+
type AnyTerms = StandardTerms & Record<string, any>;
|
|
26
|
+
type InstanceRecord = {
|
|
27
|
+
installation: import("./zoeService/utils.js").Installation<any>;
|
|
28
|
+
instance: import("./zoeService/utils.js").Instance<any>;
|
|
29
|
+
/**
|
|
30
|
+
* - contract parameters
|
|
31
|
+
*/
|
|
32
|
+
terms: AnyTerms;
|
|
33
|
+
};
|
|
34
|
+
type IssuerRecord<K extends globalThis.AssetKind = globalThis.AssetKind, M extends import("@endo/patterns").Key = import("@endo/patterns").Key> = {
|
|
35
|
+
brand: Brand<K>;
|
|
36
|
+
issuer: Issuer<K, M>;
|
|
37
|
+
assetKind: K;
|
|
38
|
+
displayInfo?: globalThis.DisplayInfo<K> | undefined;
|
|
39
|
+
};
|
|
40
|
+
type Allocation = Record<Keyword, import("@agoric/ertp/src/types.js").AnyAmount>;
|
|
41
|
+
//# sourceMappingURL=types-ambient.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types-ambient.d.ts","sourceRoot":"","sources":["types-ambient.js"],"names":[],"mappings":";;;YAIqD,CAAC,mBAAzC,OAAO,eAAe,EAAE,eAAe,CAAC,CAAC,CAAC;eAI1C,MAAM;;;;wBACN,MAAM,CAAC,YAAY,CAAC;2BACpB,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;4BAC5B,MAAM,CAAC,OAAO,EAAE,OAAO,WAAW,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;0BACtD,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;;;;;;aAK1B,mBAAmB;;;;;YAEnB,kBAAkB;;gBAGnB,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;;kBAGlC,OAAO,uBAAuB,EAAE,YAAY,CAAC,GAAG,CAAC;cACjD,OAAO,uBAAuB,EAAE,QAAQ,CAAC,GAAG,CAAC;;;;WAC7C,QAAQ;;kBASR,CAAC,sDADS,CAAC;WADX,KAAK,CAEL,CAAC,AAFM,CAAC;YACR,MAAM,CACN,CAAC,AADO,EAAE,CAAC,CAAC;eACZ,CAAC;;;kBAKF,MAAM,CAAC,OAAO,EAAE,OAAO,2BAA2B,EAAE,SAAS,CAAC"}
|
|
@@ -1,20 +1,15 @@
|
|
|
1
1
|
// @jessie-check
|
|
2
2
|
|
|
3
|
-
/// <reference types="ses"/>
|
|
4
|
-
|
|
5
3
|
/**
|
|
6
4
|
* @template {string} H - the name of the handle
|
|
7
|
-
* @typedef {
|
|
8
|
-
* identified by the H string. This uses an intersection type
|
|
9
|
-
* ('MyHandle' & {}) to tag the handle's type even though the actual
|
|
10
|
-
* value is just an empty object.
|
|
5
|
+
* @typedef {import("@endo/marshal").RemotableObject<H>} Handle Alias for RemotableObject
|
|
11
6
|
*/
|
|
12
7
|
|
|
13
8
|
/**
|
|
14
9
|
* @typedef {string} Keyword
|
|
15
10
|
* @typedef {Handle<'Invitation'>} InvitationHandle - an opaque handle for an invitation
|
|
16
11
|
* @typedef {Record<Keyword, Issuer<any>>} IssuerKeywordRecord
|
|
17
|
-
* @typedef {Record<Keyword, ERef<Issuer<any>>>} IssuerPKeywordRecord
|
|
12
|
+
* @typedef {Record<Keyword, import('@endo/far').ERef<Issuer<any>>>} IssuerPKeywordRecord
|
|
18
13
|
* @typedef {Record<Keyword, Brand<any>>} BrandKeywordRecord
|
|
19
14
|
*/
|
|
20
15
|
|
|
@@ -28,24 +23,21 @@
|
|
|
28
23
|
* @typedef {StandardTerms & Record<string, any>} AnyTerms
|
|
29
24
|
*
|
|
30
25
|
* @typedef {object} InstanceRecord
|
|
31
|
-
* @property {Installation} installation
|
|
26
|
+
* @property {import('./zoeService/utils.js').Installation<any>} installation
|
|
32
27
|
* @property {import("./zoeService/utils.js").Instance<any>} instance
|
|
33
28
|
* @property {AnyTerms} terms - contract parameters
|
|
34
29
|
*/
|
|
35
30
|
|
|
36
31
|
/**
|
|
37
32
|
* @template {AssetKind} [K=AssetKind]
|
|
33
|
+
* @template {import("@endo/patterns").Key} [M=import("@endo/patterns").Key] member kind, for Amounts that have member values
|
|
38
34
|
* @typedef {object} IssuerRecord
|
|
39
35
|
* @property {Brand<K>} brand
|
|
40
|
-
* @property {Issuer<K>} issuer
|
|
36
|
+
* @property {Issuer<K, M>} issuer
|
|
41
37
|
* @property {K} assetKind
|
|
42
38
|
* @property {DisplayInfo<K>} [displayInfo]
|
|
43
|
-
*
|
|
44
|
-
* @typedef {AmountKeywordRecord} Allocation
|
|
45
39
|
*/
|
|
46
40
|
|
|
47
41
|
/**
|
|
48
|
-
* @
|
|
49
|
-
* @template {object} [A=never] Offer args
|
|
50
|
-
* @typedef {Payment<'set'>} Invitation
|
|
42
|
+
* @typedef {Record<Keyword, import('@agoric/ertp/src/types.js').AnyAmount>} Allocation
|
|
51
43
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"escrowStorage.d.ts","sourceRoot":"","sources":["escrowStorage.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"escrowStorage.d.ts","sourceRoot":"","sources":["escrowStorage.js"],"names":[],"mappings":"AAiBO,8CAFI,OAAO,kBAAkB,EAAE,OAAO;;;;;EA8G5C"}
|
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
import { AmountMath } from '@agoric/ertp';
|
|
2
2
|
import { E } from '@endo/eventual-send';
|
|
3
3
|
import { q, Fail } from '@agoric/assert';
|
|
4
|
-
import { objectMap } from '@agoric/internal';
|
|
4
|
+
import { deeplyFulfilledObject, objectMap } from '@agoric/internal';
|
|
5
5
|
import { provideDurableWeakMapStore } from '@agoric/vat-data';
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
/// <reference path="./types.js" />
|
|
8
8
|
import './internal-types.js';
|
|
9
9
|
|
|
10
10
|
import { cleanKeywords } from '../cleanProposal.js';
|
|
11
|
-
import { arrayToObj } from '../objArrayConversion.js';
|
|
12
11
|
|
|
13
12
|
/**
|
|
14
13
|
* Store the pool purses whose purpose is to escrow assets, with one
|
|
@@ -17,7 +16,7 @@ import { arrayToObj } from '../objArrayConversion.js';
|
|
|
17
16
|
* @param {import('@agoric/vat-data').Baggage} baggage
|
|
18
17
|
*/
|
|
19
18
|
export const provideEscrowStorage = baggage => {
|
|
20
|
-
/** @type {WeakMapStore<Brand,
|
|
19
|
+
/** @type {WeakMapStore<Brand, Purse>} */
|
|
21
20
|
const brandToPurse = provideDurableWeakMapStore(baggage, 'brandToPurse');
|
|
22
21
|
|
|
23
22
|
/** @type {CreatePurse} */
|
|
@@ -76,7 +75,6 @@ export const provideEscrowStorage = baggage => {
|
|
|
76
75
|
const depositPayments = async (proposal, payments) => {
|
|
77
76
|
const { give, want } = proposal;
|
|
78
77
|
const giveKeywords = Object.keys(give);
|
|
79
|
-
const wantKeywords = Object.keys(want);
|
|
80
78
|
const paymentKeywords = cleanKeywords(payments);
|
|
81
79
|
|
|
82
80
|
// Assert that all of the payment keywords are present in the give
|
|
@@ -91,35 +89,30 @@ export const provideEscrowStorage = baggage => {
|
|
|
91
89
|
)}`;
|
|
92
90
|
});
|
|
93
91
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
// If any of these deposits hang or fail, then depositPayments
|
|
92
|
+
// If any of these deposits hang or fail, then this `await` also
|
|
97
93
|
// hangs or fails, the offer does not succeed, and any funds that
|
|
98
94
|
// were deposited into the pool purses are lost. We have a ticket
|
|
99
95
|
// for giving the user a refund of what was already deposited, and
|
|
100
96
|
// offer safety and payout liveness are still meaningful as long
|
|
101
97
|
// as issuers are well-behaved. For more, see
|
|
102
98
|
// https://github.com/Agoric/agoric-sdk/issues/1271
|
|
103
|
-
const
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
);
|
|
114
|
-
|
|
115
|
-
const emptyAmountsForWantKeywords = wantKeywords.map(keyword =>
|
|
116
|
-
AmountMath.makeEmptyFromAmount(want[keyword]),
|
|
117
|
-
);
|
|
99
|
+
const depositPs = objectMap(give, (amount, keyword) => {
|
|
100
|
+
payments[keyword] !== undefined ||
|
|
101
|
+
Fail`The ${q(
|
|
102
|
+
keyword,
|
|
103
|
+
)} keyword in proposal.give did not have an associated payment in the paymentKeywordRecord, which had keywords: ${q(
|
|
104
|
+
paymentKeywords,
|
|
105
|
+
)}`;
|
|
106
|
+
return doDepositPayment(payments[keyword], amount);
|
|
107
|
+
});
|
|
108
|
+
const deposits = await deeplyFulfilledObject(depositPs);
|
|
118
109
|
|
|
119
|
-
const initialAllocation =
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
110
|
+
const initialAllocation = harden({
|
|
111
|
+
...objectMap(want, amount => AmountMath.makeEmptyFromAmount(amount)),
|
|
112
|
+
// Deposits should win in case of overlapping give/want keywords
|
|
113
|
+
// (which are not allowed as of 2024-01).
|
|
114
|
+
...deposits,
|
|
115
|
+
});
|
|
123
116
|
|
|
124
117
|
return initialAllocation;
|
|
125
118
|
};
|
|
@@ -1,29 +1,22 @@
|
|
|
1
1
|
export namespace defaultFeeIssuerConfig {
|
|
2
|
-
|
|
3
|
-
|
|
2
|
+
let name: "ZDEFAULT";
|
|
3
|
+
let assetKind: "nat";
|
|
4
4
|
namespace displayInfo {
|
|
5
|
-
export
|
|
6
|
-
|
|
5
|
+
export let decimalPlaces: number;
|
|
6
|
+
let assetKind_1: "nat";
|
|
7
7
|
export { assetKind_1 as assetKind };
|
|
8
8
|
}
|
|
9
9
|
}
|
|
10
10
|
/**
|
|
11
11
|
* @param {import('@agoric/vat-data').Baggage} zoeBaggage
|
|
12
12
|
* @param {FeeIssuerConfig} feeIssuerConfig
|
|
13
|
-
* @param {ShutdownWithFailure} shutdownZoeVat
|
|
13
|
+
* @param {import('@agoric/swingset-vat').ShutdownWithFailure} shutdownZoeVat
|
|
14
14
|
*/
|
|
15
|
-
export function prepareFeeMint(zoeBaggage:
|
|
15
|
+
export function prepareFeeMint(zoeBaggage: import("@agoric/vat-data").Baggage, feeIssuerConfig: FeeIssuerConfig, shutdownZoeVat: import("@agoric/swingset-vat").ShutdownWithFailure): import("@endo/exo").GuardedKit<{
|
|
16
16
|
feeMint: {
|
|
17
|
-
getFeeIssuerKit(allegedFeeMintAccess: any):
|
|
18
|
-
getFeeIssuer():
|
|
19
|
-
getFeeBrand():
|
|
20
|
-
};
|
|
21
|
-
feeMintAccess: {};
|
|
22
|
-
} & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
23
|
-
feeMint: {
|
|
24
|
-
getFeeIssuerKit(allegedFeeMintAccess: any): any;
|
|
25
|
-
getFeeIssuer(): any;
|
|
26
|
-
getFeeBrand(): any;
|
|
17
|
+
getFeeIssuerKit(allegedFeeMintAccess: any): globalThis.IssuerKit<"nat">;
|
|
18
|
+
getFeeIssuer(): globalThis.Issuer<"nat", import("@endo/patterns").Key>;
|
|
19
|
+
getFeeBrand(): globalThis.Brand<"nat">;
|
|
27
20
|
};
|
|
28
21
|
feeMintAccess: {};
|
|
29
22
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"feeMint.d.ts","sourceRoot":"","sources":["feeMint.js"],"names":[],"mappings":";;;;;;;;;
|
|
1
|
+
{"version":3,"file":"feeMint.d.ts","sourceRoot":"","sources":["feeMint.js"],"names":[],"mappings":";;;;;;;;;AA4BA;;;;GAIG;AACH,2CAJW,OAAO,kBAAkB,EAAE,OAAO,mBAClC,eAAe,kBACf,OAAO,sBAAsB,EAAE,mBAAmB;;;;;;;GA2D5D"}
|