@agoric/zoe 0.26.2 → 0.26.3-calypso-dev-84eb287.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -7
- package/bundles/bundle-contractFacet-js-meta.json +628 -314
- package/bundles/bundle-contractFacet.d.ts +3 -3
- package/bundles/bundle-contractFacet.js +1 -1
- package/exported.js +1 -12
- package/package.json +75 -59
- package/src/cleanProposal.d.ts +2 -2
- package/src/cleanProposal.d.ts.map +1 -1
- package/src/cleanProposal.js +15 -12
- package/src/contractFacet/evalContractCode.d.ts.map +1 -1
- package/src/contractFacet/evalContractCode.js +2 -2
- package/src/contractFacet/exit.d.ts.map +1 -1
- package/src/contractFacet/exit.js +1 -0
- package/src/contractFacet/internal-types.d.ts +2 -2
- package/src/contractFacet/internal-types.d.ts.map +1 -1
- package/src/contractFacet/internal-types.js +1 -1
- package/src/contractFacet/offerHandlerStorage.d.ts +4 -1
- package/src/contractFacet/offerHandlerStorage.d.ts.map +1 -1
- package/src/contractFacet/offerHandlerStorage.js +11 -3
- package/src/contractFacet/reallocate.d.ts +3 -0
- package/src/contractFacet/reallocate.d.ts.map +1 -0
- package/src/contractFacet/reallocate.js +94 -0
- package/src/contractFacet/rightsConservation.d.ts.map +1 -1
- package/src/contractFacet/rightsConservation.js +3 -0
- package/src/contractFacet/typeGuards.d.ts +8 -0
- package/src/contractFacet/typeGuards.d.ts.map +1 -0
- package/src/contractFacet/typeGuards.js +25 -0
- package/src/contractFacet/types-ambient.d.ts +271 -0
- package/src/contractFacet/types-ambient.js +1 -0
- package/src/contractFacet/vatRoot.d.ts +3 -3
- package/src/contractFacet/vatRoot.d.ts.map +1 -1
- package/src/contractFacet/zcfMint.d.ts +4 -2
- package/src/contractFacet/zcfMint.d.ts.map +1 -1
- package/src/contractFacet/zcfMint.js +7 -7
- package/src/contractFacet/zcfSeat.d.ts +4 -2
- package/src/contractFacet/zcfSeat.d.ts.map +1 -1
- package/src/contractFacet/zcfSeat.js +130 -7
- package/src/contractFacet/zcfZygote.d.ts +1 -2
- package/src/contractFacet/zcfZygote.d.ts.map +1 -1
- package/src/contractFacet/zcfZygote.js +102 -48
- package/src/contractSupport/atomicTransfer.d.ts +0 -6
- package/src/contractSupport/atomicTransfer.d.ts.map +1 -1
- package/src/contractSupport/atomicTransfer.js +5 -90
- package/src/contractSupport/bondingCurves.js +2 -2
- package/src/contractSupport/durability.d.ts +3 -3
- package/src/contractSupport/durability.d.ts.map +1 -1
- package/src/contractSupport/durability.js +5 -5
- package/src/contractSupport/index.d.ts +1 -0
- package/src/contractSupport/index.js +1 -0
- package/src/contractSupport/prepare-ownable.d.ts +11 -0
- package/src/contractSupport/prepare-ownable.d.ts.map +1 -0
- package/src/contractSupport/prepare-ownable.js +100 -0
- package/src/contractSupport/priceAuthority.d.ts +23 -15
- package/src/contractSupport/priceAuthority.d.ts.map +1 -1
- package/src/contractSupport/priceAuthority.js +33 -18
- package/src/contractSupport/priceAuthorityInitial.d.ts +3 -2
- package/src/contractSupport/priceAuthorityInitial.d.ts.map +1 -1
- package/src/contractSupport/priceAuthorityInitial.js +6 -3
- package/src/contractSupport/priceAuthorityQuoteMint.d.ts +2 -1
- package/src/contractSupport/priceAuthorityQuoteMint.d.ts.map +1 -1
- package/src/contractSupport/priceAuthorityQuoteMint.js +23 -27
- package/src/contractSupport/priceAuthorityTransform.d.ts +13 -11
- package/src/contractSupport/priceAuthorityTransform.d.ts.map +1 -1
- package/src/contractSupport/priceAuthorityTransform.js +10 -8
- package/src/contractSupport/priceQuote.d.ts +7 -5
- package/src/contractSupport/priceQuote.d.ts.map +1 -1
- package/src/contractSupport/priceQuote.js +5 -1
- package/src/contractSupport/ratio.d.ts +2 -2
- package/src/contractSupport/ratio.d.ts.map +1 -1
- package/src/contractSupport/ratio.js +19 -15
- package/src/contractSupport/recorder.d.ts +33 -119
- package/src/contractSupport/recorder.d.ts.map +1 -1
- package/src/contractSupport/recorder.js +21 -10
- package/src/contractSupport/safeMath.d.ts +7 -7
- package/src/contractSupport/safeMath.d.ts.map +1 -1
- package/src/contractSupport/statistics.d.ts +1 -1
- package/src/contractSupport/statistics.d.ts.map +1 -1
- package/src/contractSupport/topics.d.ts +1 -1
- package/src/contractSupport/topics.d.ts.map +1 -1
- package/src/contractSupport/{types.d.ts → types-ambient.d.ts} +4 -4
- package/src/contractSupport/types-ambient.d.ts.map +1 -0
- package/src/contractSupport/{types.js → types-ambient.js} +1 -1
- package/src/contractSupport/zoeHelpers.d.ts +1 -1
- package/src/contractSupport/zoeHelpers.d.ts.map +1 -1
- package/src/contractSupport/zoeHelpers.js +6 -12
- package/src/contracts/auction/firstPriceLogic.d.ts.map +1 -1
- package/src/contracts/auction/firstPriceLogic.js +5 -8
- package/src/contracts/auction/index.d.ts +10 -10
- package/src/contracts/auction/index.d.ts.map +1 -1
- package/src/contracts/auction/index.js +3 -3
- package/src/contracts/auction/secondPriceLogic.d.ts.map +1 -1
- package/src/contracts/auction/secondPriceLogic.js +1 -4
- package/src/contracts/automaticRefund.d.ts +1 -1
- package/src/contracts/automaticRefund.d.ts.map +1 -1
- package/src/contracts/autoswap.d.ts.map +1 -1
- package/src/contracts/autoswap.js +8 -9
- package/src/contracts/barterExchange.d.ts +1 -1
- package/src/contracts/barterExchange.d.ts.map +1 -1
- package/src/contracts/barterExchange.js +2 -3
- package/src/contracts/callSpread/calculateShares.d.ts +1 -8
- package/src/contracts/callSpread/calculateShares.d.ts.map +1 -1
- package/src/contracts/callSpread/calculateShares.js +1 -1
- package/src/contracts/callSpread/fundedCallSpread.d.ts +4 -0
- package/src/contracts/callSpread/fundedCallSpread.d.ts.map +1 -1
- package/src/contracts/callSpread/fundedCallSpread.js +6 -4
- package/src/contracts/callSpread/payoffHandler.d.ts.map +1 -1
- package/src/contracts/callSpread/payoffHandler.js +3 -2
- package/src/contracts/callSpread/percent.d.ts +2 -4
- package/src/contracts/callSpread/percent.d.ts.map +1 -1
- package/src/contracts/callSpread/position.d.ts +2 -2
- package/src/contracts/callSpread/pricedCallSpread.d.ts +6 -5
- package/src/contracts/callSpread/pricedCallSpread.d.ts.map +1 -1
- package/src/contracts/callSpread/pricedCallSpread.js +9 -5
- package/src/contracts/callSpread/{types.d.ts → types-ambient.d.ts} +3 -3
- package/src/contracts/callSpread/types-ambient.d.ts.map +1 -0
- package/src/contracts/coveredCall-durable.d.ts +2 -4
- package/src/contracts/coveredCall-durable.d.ts.map +1 -1
- package/src/contracts/exported.js +3 -3
- package/src/contracts/loan/borrow.d.ts.map +1 -1
- package/src/contracts/loan/borrow.js +7 -4
- package/src/contracts/loan/close.d.ts.map +1 -1
- package/src/contracts/loan/close.js +3 -7
- package/src/contracts/loan/index.d.ts +5 -1
- package/src/contracts/loan/index.d.ts.map +1 -1
- package/src/contracts/loan/index.js +4 -0
- package/src/contracts/loan/liquidate.d.ts +1 -12
- package/src/contracts/loan/liquidate.d.ts.map +1 -1
- package/src/contracts/loan/liquidate.js +4 -2
- package/src/contracts/loan/scheduleLiquidation.d.ts.map +1 -1
- package/src/contracts/loan/scheduleLiquidation.js +2 -1
- package/src/contracts/loan/{types.d.ts → types-ambient.d.ts} +16 -17
- package/src/contracts/loan/types-ambient.d.ts.map +1 -0
- package/src/contracts/loan/{types.js → types-ambient.js} +11 -18
- package/src/contracts/loan/updateDebt.js +1 -1
- package/src/contracts/mintAndSellNFT.d.ts.map +1 -1
- package/src/contracts/mintPayments.d.ts +14 -6
- package/src/contracts/mintPayments.d.ts.map +1 -1
- package/src/contracts/mintPayments.js +1 -1
- package/src/contracts/oracle.d.ts +6 -2
- package/src/contracts/oracle.d.ts.map +1 -1
- package/src/contracts/oracle.js +10 -3
- package/src/contracts/otcDesk.d.ts +3 -3
- package/src/contracts/otcDesk.d.ts.map +1 -1
- package/src/contracts/otcDesk.js +1 -1
- package/src/contracts/priceAggregator.d.ts +25 -17
- package/src/contracts/priceAggregator.d.ts.map +1 -1
- package/src/contracts/priceAggregator.js +33 -32
- package/src/contracts/priceAggregatorTypes.d.ts +2 -2
- package/src/contracts/priceAggregatorTypes.d.ts.map +1 -1
- package/src/contracts/scaledPriceAuthority.d.ts +3 -4
- package/src/contracts/scaledPriceAuthority.d.ts.map +1 -1
- package/src/contracts/scaledPriceAuthority.js +6 -0
- package/src/contracts/sellItems.d.ts +2 -2
- package/src/contracts/sellItems.d.ts.map +1 -1
- package/src/contracts/sellItems.js +3 -4
- package/src/contracts/simpleExchange.d.ts +3 -3
- package/src/contracts/{types.d.ts → types-ambient.d.ts} +1 -1
- package/src/contracts/types-ambient.d.ts.map +1 -0
- package/src/handleWarning.d.ts.map +1 -1
- package/src/instanceRecordStorage.d.ts +1 -1
- package/src/instanceRecordStorage.d.ts.map +1 -1
- package/src/internal-types.d.ts +21 -32
- package/src/internal-types.d.ts.map +1 -1
- package/src/internal-types.js +19 -58
- package/src/issuerRecord.d.ts +1 -1
- package/src/issuerRecord.d.ts.map +1 -1
- package/src/issuerStorage.d.ts +3 -3
- package/src/issuerStorage.d.ts.map +1 -1
- package/src/issuerStorage.js +12 -28
- package/src/makeHandle.d.ts +2 -2
- package/src/makeHandle.d.ts.map +1 -1
- package/src/makeHandle.js +1 -1
- package/src/typeGuards.d.ts +114 -20
- package/src/typeGuards.d.ts.map +1 -1
- package/src/typeGuards.js +19 -20
- package/src/types-ambient.d.ts +41 -0
- package/src/types-ambient.d.ts.map +1 -0
- package/src/{types.js → types-ambient.js} +7 -15
- package/src/zoeService/escrowStorage.d.ts +1 -1
- package/src/zoeService/escrowStorage.d.ts.map +1 -1
- package/src/zoeService/escrowStorage.js +20 -27
- package/src/zoeService/feeMint.d.ts +9 -16
- package/src/zoeService/feeMint.d.ts.map +1 -1
- package/src/zoeService/feeMint.js +21 -15
- package/src/zoeService/installationStorage.d.ts +5 -20
- package/src/zoeService/installationStorage.d.ts.map +1 -1
- package/src/zoeService/installationStorage.js +11 -7
- package/src/zoeService/instanceAdminStorage.d.ts +22 -42
- package/src/zoeService/instanceAdminStorage.d.ts.map +1 -1
- package/src/zoeService/instanceAdminStorage.js +2 -1
- package/src/zoeService/internal-types.d.ts +12 -12
- package/src/zoeService/internal-types.d.ts.map +1 -1
- package/src/zoeService/internal-types.js +6 -6
- package/src/zoeService/invitationQueries.d.ts.map +1 -1
- package/src/zoeService/invitationQueries.js +7 -5
- package/src/zoeService/makeInvitation.d.ts +3 -3
- package/src/zoeService/makeInvitation.d.ts.map +1 -1
- package/src/zoeService/makeInvitation.js +25 -21
- package/src/zoeService/offer/burnInvitation.d.ts.map +1 -1
- package/src/zoeService/offer/offer.d.ts.map +1 -1
- package/src/zoeService/offer/offer.js +2 -5
- package/src/zoeService/originalZoeSeat.d.ts +34 -0
- package/src/zoeService/originalZoeSeat.d.ts.map +1 -0
- package/src/zoeService/originalZoeSeat.js +353 -0
- package/src/zoeService/startInstance.d.ts +3 -3
- package/src/zoeService/startInstance.d.ts.map +1 -1
- package/src/zoeService/startInstance.js +82 -37
- package/src/zoeService/{types.d.ts → types-ambient.d.ts} +23 -28
- package/src/zoeService/types-ambient.d.ts.map +1 -0
- package/src/zoeService/{types.js → types-ambient.js} +19 -32
- package/src/zoeService/utils.d.ts +57 -58
- package/src/zoeService/utils.test-d.d.ts +2 -0
- package/src/zoeService/utils.test-d.d.ts.map +1 -0
- package/src/zoeService/utils.test-d.ts +33 -0
- package/src/zoeService/zoe.d.ts +14 -8
- package/src/zoeService/zoe.d.ts.map +1 -1
- package/src/zoeService/zoe.js +39 -11
- package/src/zoeService/zoeSeat.d.ts +15 -45
- package/src/zoeService/zoeSeat.d.ts.map +1 -1
- package/src/zoeService/zoeSeat.js +215 -115
- package/src/zoeService/zoeStorageManager.d.ts +13 -47
- package/src/zoeService/zoeStorageManager.d.ts.map +1 -1
- package/src/zoeService/zoeStorageManager.js +13 -6
- package/tools/fakePriceAuthority.d.ts +9 -8
- package/tools/fakePriceAuthority.d.ts.map +1 -1
- package/tools/fakePriceAuthority.js +21 -17
- package/tools/fakeVatAdmin.d.ts +10 -10
- package/tools/manualPriceAuthority.d.ts +11 -6
- package/tools/manualPriceAuthority.d.ts.map +1 -1
- package/tools/manualPriceAuthority.js +16 -3
- package/tools/manualTimer.d.ts +17 -40
- package/tools/manualTimer.d.ts.map +1 -1
- package/tools/manualTimer.js +30 -16
- package/tools/prepare-test-env.js +1 -1
- package/tools/scriptedOracle.d.ts +3 -3
- package/tools/scriptedOracle.d.ts.map +1 -1
- package/tools/scriptedOracle.js +1 -1
- package/tools/scriptedPriceAuthority.d.ts +4 -0
- package/tools/scriptedPriceAuthority.d.ts.map +1 -1
- package/tools/scriptedPriceAuthority.js +8 -3
- package/tools/setup-zoe.d.ts +10 -6
- package/tools/setup-zoe.d.ts.map +1 -1
- package/tools/setup-zoe.js +16 -1
- package/tools/test-utils.d.ts +20 -0
- package/tools/test-utils.d.ts.map +1 -0
- package/tools/test-utils.js +26 -0
- package/tools/types.d.ts +21 -21
- package/tools/types.d.ts.map +1 -1
- package/tools/types.js +10 -10
- package/CHANGELOG.md +0 -1171
- package/src/contractFacet/types.d.ts +0 -191
- package/src/contractFacet/types.d.ts.map +0 -1
- package/src/contractFacet/types.js +0 -256
- package/src/contractSupport/types.d.ts.map +0 -1
- package/src/contracts/callSpread/types.d.ts.map +0 -1
- package/src/contracts/loan/types.d.ts.map +0 -1
- package/src/contracts/types.d.ts.map +0 -1
- package/src/objArrayConversion.d.ts +0 -5
- package/src/objArrayConversion.d.ts.map +0 -1
- package/src/objArrayConversion.js +0 -35
- package/src/types.d.ts +0 -45
- package/src/types.d.ts.map +0 -1
- package/src/zoeService/types.d.ts.map +0 -1
- package/tools/internal-types.d.ts +0 -12
- package/tools/internal-types.d.ts.map +0 -1
- package/tools/internal-types.js +0 -14
- package/tools/priceAuthorityRegistry.d.ts +0 -20
- package/tools/priceAuthorityRegistry.d.ts.map +0 -1
- package/tools/priceAuthorityRegistry.js +0 -209
- package/tools/types-ambient.d.ts +0 -142
- package/tools/types-ambient.d.ts.map +0 -1
- package/tools/types-ambient.js +0 -160
- /package/src/contracts/callSpread/{types.js → types-ambient.js} +0 -0
- /package/src/contracts/{types.js → types-ambient.js} +0 -0
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
/* eslint @typescript-eslint/no-floating-promises: "warn" */
|
|
3
2
|
import { Fail, q } from '@agoric/assert';
|
|
4
3
|
import { AmountMath, AssetKind, makeIssuerKit } from '@agoric/ertp';
|
|
5
4
|
import { assertAllDefined } from '@agoric/internal';
|
|
@@ -14,7 +13,6 @@ import { E } from '@endo/eventual-send';
|
|
|
14
13
|
import { Far } from '@endo/marshal';
|
|
15
14
|
import { notForProductionUse } from '@agoric/internal/src/magic-cookie-test-only.js';
|
|
16
15
|
|
|
17
|
-
import '../../tools/types-ambient.js';
|
|
18
16
|
import {
|
|
19
17
|
calculateMedian,
|
|
20
18
|
makeOnewayPriceAuthorityKit,
|
|
@@ -32,8 +30,11 @@ import {
|
|
|
32
30
|
ratiosSame,
|
|
33
31
|
} from '../contractSupport/ratio.js';
|
|
34
32
|
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
/**
|
|
34
|
+
* @import {LegacyMap} from '@agoric/store'
|
|
35
|
+
* @import {ContractOf} from '../zoeService/utils.js';
|
|
36
|
+
* @import {PriceDescription, PriceQuote, PriceQuoteValue, PriceQuery,} from '@agoric/zoe/tools/types.js';
|
|
37
|
+
*/
|
|
37
38
|
/** @typedef {bigint | number | string} ParsableNumber */
|
|
38
39
|
/**
|
|
39
40
|
* @typedef {Readonly<ParsableNumber | { data: ParsableNumber }>} OraclePriceSubmission
|
|
@@ -52,7 +53,7 @@ const priceDescriptionFromQuote = quote => quote.quoteAmount.value[0];
|
|
|
52
53
|
* is a stub until we complete what is now in `fluxAggregatorKit.js`.
|
|
53
54
|
*
|
|
54
55
|
* @param {ZCF<{
|
|
55
|
-
* timer: import('@agoric/time
|
|
56
|
+
* timer: import('@agoric/time').TimerService,
|
|
56
57
|
* POLL_INTERVAL: bigint,
|
|
57
58
|
* brandIn: Brand<'nat'>,
|
|
58
59
|
* brandOut: Brand<'nat'>,
|
|
@@ -60,7 +61,7 @@ const priceDescriptionFromQuote = quote => quote.quoteAmount.value[0];
|
|
|
60
61
|
* }>} zcf
|
|
61
62
|
* @param {{
|
|
62
63
|
* marshaller: Marshaller,
|
|
63
|
-
* quoteMint?: ERef<Mint<'set'>>,
|
|
64
|
+
* quoteMint?: ERef<Mint<'set', PriceDescription>>,
|
|
64
65
|
* storageNode: ERef<StorageNode>,
|
|
65
66
|
* }} privateArgs
|
|
66
67
|
*/
|
|
@@ -78,12 +79,11 @@ const start = async (zcf, privateArgs) => {
|
|
|
78
79
|
const { marshaller, storageNode } = privateArgs;
|
|
79
80
|
assertAllDefined({ marshaller, storageNode });
|
|
80
81
|
|
|
82
|
+
/** @type {ERef<Mint<'set', PriceDescription>>} */
|
|
81
83
|
const quoteMint =
|
|
82
84
|
privateArgs.quoteMint ||
|
|
83
85
|
// makeIssuerKit fails upgrade, this contract is for demo only
|
|
84
86
|
makeIssuerKit('quote', AssetKind.SET).mint;
|
|
85
|
-
/** @type {IssuerRecord<'set'>} */
|
|
86
|
-
// xxx saveIssuer not generic
|
|
87
87
|
const quoteIssuerRecord = await zcf.saveIssuer(
|
|
88
88
|
E(quoteMint).getIssuer(),
|
|
89
89
|
'Quote',
|
|
@@ -101,8 +101,6 @@ const start = async (zcf, privateArgs) => {
|
|
|
101
101
|
* @param {PriceQuoteValue} quote
|
|
102
102
|
*/
|
|
103
103
|
const authenticateQuote = async quote => {
|
|
104
|
-
/** @type {Amount<'set'>} */
|
|
105
|
-
// xxx type should be inferred from brand and value
|
|
106
104
|
const quoteAmount = AmountMath.make(quoteKit.brand, harden(quote));
|
|
107
105
|
const quotePayment = await E(quoteKit.mint).mintPayment(quoteAmount);
|
|
108
106
|
return harden({ quoteAmount, quotePayment });
|
|
@@ -126,7 +124,7 @@ const start = async (zcf, privateArgs) => {
|
|
|
126
124
|
|
|
127
125
|
/**
|
|
128
126
|
* @typedef {object} OracleRecord
|
|
129
|
-
* @property {(timestamp: import('@agoric/time
|
|
127
|
+
* @property {(timestamp: import('@agoric/time').Timestamp) => Promise<void>} [querier]
|
|
130
128
|
* @property {Ratio} lastSample
|
|
131
129
|
* @property {OracleKey} oracleKey
|
|
132
130
|
*/
|
|
@@ -143,7 +141,7 @@ const start = async (zcf, privateArgs) => {
|
|
|
143
141
|
|
|
144
142
|
// Wake every POLL_INTERVAL and run the queriers.
|
|
145
143
|
const repeaterP = E(timer).makeRepeater(0n, POLL_INTERVAL);
|
|
146
|
-
/** @type {import('@agoric/time
|
|
144
|
+
/** @type {import('@agoric/time').TimerWaker} */
|
|
147
145
|
const waker = Far('waker', {
|
|
148
146
|
async wake(timestamp) {
|
|
149
147
|
// Run all the queriers.
|
|
@@ -161,12 +159,12 @@ const start = async (zcf, privateArgs) => {
|
|
|
161
159
|
await Promise.all(querierPs).catch(console.error);
|
|
162
160
|
},
|
|
163
161
|
});
|
|
164
|
-
E(repeaterP).schedule(waker);
|
|
162
|
+
void E(repeaterP).schedule(waker);
|
|
165
163
|
|
|
166
164
|
/**
|
|
167
165
|
* @param {object} param0
|
|
168
166
|
* @param {Ratio} [param0.overridePrice]
|
|
169
|
-
* @param {import('@agoric/time
|
|
167
|
+
* @param {import('@agoric/time').TimestampRecord} [param0.timestamp]
|
|
170
168
|
*/
|
|
171
169
|
const makeCreateQuote = ({ overridePrice, timestamp } = {}) =>
|
|
172
170
|
/**
|
|
@@ -233,17 +231,20 @@ const start = async (zcf, privateArgs) => {
|
|
|
233
231
|
});
|
|
234
232
|
|
|
235
233
|
// for each new quote from the priceAuthority, publish it to off-chain storage
|
|
236
|
-
observeNotifier(
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
234
|
+
void observeNotifier(
|
|
235
|
+
priceAuthority.makeQuoteNotifier(unitAmountIn, brandOut),
|
|
236
|
+
{
|
|
237
|
+
updateState: quote => {
|
|
238
|
+
publisher.publish(priceDescriptionFromQuote(quote));
|
|
239
|
+
},
|
|
240
|
+
fail: reason => {
|
|
241
|
+
throw Error(`priceAuthority observer failed: ${reason}`);
|
|
242
|
+
},
|
|
243
|
+
finish: done => {
|
|
244
|
+
throw Error(`priceAuthority observer died: ${done}`);
|
|
245
|
+
},
|
|
245
246
|
},
|
|
246
|
-
|
|
247
|
+
);
|
|
247
248
|
|
|
248
249
|
/**
|
|
249
250
|
* @param {Ratio} r
|
|
@@ -258,7 +259,7 @@ const start = async (zcf, privateArgs) => {
|
|
|
258
259
|
);
|
|
259
260
|
|
|
260
261
|
/**
|
|
261
|
-
* @param {import('@agoric/time
|
|
262
|
+
* @param {import('@agoric/time').Timestamp} timestamp
|
|
262
263
|
*/
|
|
263
264
|
const updateQuote = async timestamp => {
|
|
264
265
|
timestamp = TimeMath.coerceTimestampRecord(timestamp, timerBrand);
|
|
@@ -390,7 +391,7 @@ const start = async (zcf, privateArgs) => {
|
|
|
390
391
|
return;
|
|
391
392
|
}
|
|
392
393
|
// Queue the next update.
|
|
393
|
-
E(oracleNotifier).getUpdateSince(updateCount).then(recurse);
|
|
394
|
+
void E(oracleNotifier).getUpdateSince(updateCount).then(recurse);
|
|
394
395
|
|
|
395
396
|
// See if we have associated parameters or just a raw value.
|
|
396
397
|
/** @type {Ratio | undefined} */
|
|
@@ -426,7 +427,7 @@ const start = async (zcf, privateArgs) => {
|
|
|
426
427
|
};
|
|
427
428
|
|
|
428
429
|
// Start the notifier.
|
|
429
|
-
E(oracleNotifier).getUpdateSince().then(recurse);
|
|
430
|
+
void E(oracleNotifier).getUpdateSince().then(recurse);
|
|
430
431
|
};
|
|
431
432
|
|
|
432
433
|
const creatorFacet = Far('PriceAggregatorCreatorFacet', {
|
|
@@ -457,6 +458,7 @@ const start = async (zcf, privateArgs) => {
|
|
|
457
458
|
seat,
|
|
458
459
|
{ notifier: oracleNotifier, scaleValueOut = 1 } = {},
|
|
459
460
|
) => {
|
|
461
|
+
seat.exit();
|
|
460
462
|
const admin = await creatorFacet.initOracle(oracleKey);
|
|
461
463
|
const invitationMakers = Far('invitation makers', {
|
|
462
464
|
/** @param {ParsableNumber} price */
|
|
@@ -464,11 +466,10 @@ const start = async (zcf, privateArgs) => {
|
|
|
464
466
|
assertParsableNumber(price);
|
|
465
467
|
return zcf.makeInvitation(cSeat => {
|
|
466
468
|
cSeat.exit();
|
|
467
|
-
admin.pushResult(price);
|
|
469
|
+
void admin.pushResult(price);
|
|
468
470
|
}, 'PushPrice');
|
|
469
471
|
},
|
|
470
472
|
});
|
|
471
|
-
seat.exit();
|
|
472
473
|
|
|
473
474
|
if (oracleNotifier) {
|
|
474
475
|
pushFromOracle(oracleNotifier, scaleValueOut, r =>
|
|
@@ -592,11 +593,11 @@ const start = async (zcf, privateArgs) => {
|
|
|
592
593
|
const oracle = await E(zoe).getPublicFacet(oracleInstance);
|
|
593
594
|
assert(records.has(record), 'Oracle record is already deleted');
|
|
594
595
|
|
|
595
|
-
/** @type {import('@agoric/time
|
|
596
|
+
/** @type {import('@agoric/time').Timestamp} */
|
|
596
597
|
let lastWakeTimestamp = 0n;
|
|
597
598
|
|
|
598
599
|
/**
|
|
599
|
-
* @param {import('@agoric/time
|
|
600
|
+
* @param {import('@agoric/time').Timestamp} timestamp
|
|
600
601
|
*/
|
|
601
602
|
record.querier = async timestamp => {
|
|
602
603
|
// Submit the query.
|
|
@@ -9,7 +9,7 @@ type OracleAdmin<R extends unknown> = {
|
|
|
9
9
|
pushResult: (result: R) => Promise<void>;
|
|
10
10
|
};
|
|
11
11
|
type OracleKey = {} | string;
|
|
12
|
-
type PriceAggregatorKit = Pick<import("./priceAggregator").PriceAggregatorContract,
|
|
12
|
+
type PriceAggregatorKit = Pick<import("./priceAggregator").PriceAggregatorContract, "creatorFacet" | "publicFacet">;
|
|
13
13
|
type OracleQuery = Record<string, unknown> & {
|
|
14
14
|
kind?: string;
|
|
15
15
|
increment?: bigint;
|
|
@@ -58,7 +58,7 @@ type OracleKit = {
|
|
|
58
58
|
};
|
|
59
59
|
type OracleReply = {
|
|
60
60
|
reply: unknown;
|
|
61
|
-
requiredFee?: Amount
|
|
61
|
+
requiredFee?: globalThis.Amount | undefined;
|
|
62
62
|
};
|
|
63
63
|
type OracleHandler = {
|
|
64
64
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"priceAggregatorTypes.d.ts","sourceRoot":"","sources":["priceAggregatorTypes.js"],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"priceAggregatorTypes.d.ts","sourceRoot":"","sources":["priceAggregatorTypes.js"],"names":[],"mappings":"iBACsB,CAAC;;;;YAET,MAAM,OAAO,CAAC,IAAI,CAAC;;;;gBAEnB,CAAC,MAAM,EAAE,CAAC,KAAK,OAAO,CAAC,IAAI,CAAC;;iBAK7B,EAAE,GAAG,MAAM;0BAIX,IAAI,CAAC,OAAO,mBAAmB,EAAE,uBAAuB,EAAE,cAAc,GAAG,aAAa,CAAC;mBAIzF,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG;IACtC,IAAM,CAAC,EAAE,MAAM,CAAC;IAChB,SAAW,CAAC,EAAE,MAAM,CAAC;CAClB;;;;;;;;yBAMU,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC,UAAU,CAAC;;;;WAExC,CAAC,KAAK,EAAE,WAAW,KAAK,IAAI,CAAC,OAAO,CAAC;;iFAOtC,IAAI,CAAC,UAAU,CAAC;;;;;;;;oBAMf,MAAM,mBAAmB;;;;4BAEzB,wCAAwC;;;;4BAExC,MAAM,OAAO,CAAC,UAAU,CAAC;;;mBAMzB,aAAa;;;gBAKb,CAAC,aAAa,EAAE,uBAAuB,KAC7C,kBAAkB;;;kBAKZ,kBAAkB;iBAClB,iBAAiB;cACjB,QAAQ;;;WAKR,OAAO;;;;;;;aAMP,CAAC,KAAK,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,WAAW,CAAC;;;;aAEzD,CAAC,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,KAAK,IAAI;;;;aAE7C,CAAC,KAAK,EAAE,WAAW,EAChC,KAAmB,EAAE,OAAO,EAC5B,WAAyB,EAAE,MAAM,GAAG,SAAS,KACtC,IAAI"}
|
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
export function prepare(zcf: ZCF<ScaledPriceAuthorityOpts>, privateArgs: object, baggage:
|
|
2
|
-
publicFacet: {
|
|
3
|
-
getPriceAuthority: () => Promise<PriceAuthority>;
|
|
4
|
-
} & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
1
|
+
export function prepare(zcf: ZCF<ScaledPriceAuthorityOpts>, privateArgs: object, baggage: import("@agoric/vat-data").Baggage): Promise<{
|
|
2
|
+
publicFacet: import("@endo/exo").Guarded<{
|
|
5
3
|
getPriceAuthority: () => Promise<PriceAuthority>;
|
|
6
4
|
}>;
|
|
7
5
|
}>;
|
|
@@ -20,4 +18,5 @@ export type ScaledPriceAuthorityOpts = {
|
|
|
20
18
|
*/
|
|
21
19
|
initialPrice?: Ratio | undefined;
|
|
22
20
|
};
|
|
21
|
+
import type { PriceAuthority } from '@agoric/zoe/tools/types.js';
|
|
23
22
|
//# sourceMappingURL=scaledPriceAuthority.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scaledPriceAuthority.d.ts","sourceRoot":"","sources":["scaledPriceAuthority.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"scaledPriceAuthority.d.ts","sourceRoot":"","sources":["scaledPriceAuthority.js"],"names":[],"mappings":"AAqCO,6BALI,GAAG,CAAC,wBAAwB,CAAC,eAC7B,MAAM,WACN,OAAO,kBAAkB,EAAE,OAAO;;;;GAyD5C;;0BA1Ea,IAAI,CAAC,cAAc,CAAC;;;;aACpB,KAAK;;;;cACL,KAAK;;;;;;oCAP0E,4BAA4B"}
|
|
@@ -9,6 +9,10 @@ import { makeInitialTransform } from '../contractSupport/priceAuthorityInitial.j
|
|
|
9
9
|
import { makePriceAuthorityTransform } from '../contractSupport/priceAuthorityTransform.js';
|
|
10
10
|
import { provideQuoteMint } from '../contractSupport/priceAuthorityQuoteMint.js';
|
|
11
11
|
|
|
12
|
+
/**
|
|
13
|
+
* @import {PriceAuthority, PriceDescription, PriceQuote, PriceQuoteValue, PriceQuery,} from '@agoric/zoe/tools/types.js';
|
|
14
|
+
*/
|
|
15
|
+
|
|
12
16
|
/**
|
|
13
17
|
* @typedef {object} ScaledPriceAuthorityOpts
|
|
14
18
|
* @property {ERef<PriceAuthority>} sourcePriceAuthority
|
|
@@ -30,6 +34,7 @@ import { provideQuoteMint } from '../contractSupport/priceAuthorityQuoteMint.js'
|
|
|
30
34
|
* @param {object} privateArgs
|
|
31
35
|
* @param {import('@agoric/vat-data').Baggage} baggage
|
|
32
36
|
*/
|
|
37
|
+
// 'prepare' is deprecated but still supported
|
|
33
38
|
export const prepare = async (zcf, privateArgs, baggage) => {
|
|
34
39
|
const quoteMint = provideQuoteMint(baggage);
|
|
35
40
|
|
|
@@ -85,3 +90,4 @@ export const prepare = async (zcf, privateArgs, baggage) => {
|
|
|
85
90
|
);
|
|
86
91
|
return harden({ publicFacet });
|
|
87
92
|
};
|
|
93
|
+
harden(prepare);
|
|
@@ -21,10 +21,10 @@
|
|
|
21
21
|
* @param {ZCF<{pricePerItem: Amount<'nat'>}>} zcf
|
|
22
22
|
*/
|
|
23
23
|
export function start(zcf: ZCF<{
|
|
24
|
-
pricePerItem: Amount<
|
|
24
|
+
pricePerItem: Amount<"nat">;
|
|
25
25
|
}>): {
|
|
26
26
|
creatorFacet: SellItemsCreatorFacet;
|
|
27
|
-
creatorInvitation: Promise<Invitation<string,
|
|
27
|
+
creatorInvitation: Promise<Invitation<string, undefined>>;
|
|
28
28
|
publicFacet: SellItemsPublicFacet;
|
|
29
29
|
};
|
|
30
30
|
//# sourceMappingURL=sellItems.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sellItems.d.ts","sourceRoot":"","sources":["sellItems.js"],"names":[],"mappings":"AAkBA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH;
|
|
1
|
+
{"version":3,"file":"sellItems.d.ts","sourceRoot":"","sources":["sellItems.js"],"names":[],"mappings":"AAkBA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,2BAFW,GAAG,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC,KAAK,CAAC,CAAA;CAAC,CAAC;;;;EAuH5C"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint @typescript-eslint/no-floating-promises: "warn" */
|
|
1
2
|
import { Far } from '@endo/marshal';
|
|
2
3
|
import { Nat } from '@endo/nat';
|
|
3
4
|
import { AmountMath } from '@agoric/ertp';
|
|
@@ -11,7 +12,6 @@ import {
|
|
|
11
12
|
defaultAcceptanceMsg,
|
|
12
13
|
assertProposalShape,
|
|
13
14
|
assertNatAssetKind,
|
|
14
|
-
atomicRearrange,
|
|
15
15
|
} from '../contractSupport/index.js';
|
|
16
16
|
|
|
17
17
|
const { Fail } = assert;
|
|
@@ -52,7 +52,7 @@ const start = zcf => {
|
|
|
52
52
|
const sell = seat => {
|
|
53
53
|
sellerSeat = seat;
|
|
54
54
|
|
|
55
|
-
observeIteration(
|
|
55
|
+
void observeIteration(
|
|
56
56
|
subscribeLatest(sellerSeat.getSubscriber()),
|
|
57
57
|
harden({
|
|
58
58
|
updateState: sellerSeatAllocation =>
|
|
@@ -107,8 +107,7 @@ const start = zcf => {
|
|
|
107
107
|
Fail`More money (${totalCost}) is required to buy these items`;
|
|
108
108
|
|
|
109
109
|
// Reallocate.
|
|
110
|
-
atomicRearrange(
|
|
111
|
-
zcf,
|
|
110
|
+
zcf.atomicRearrange(
|
|
112
111
|
harden([
|
|
113
112
|
[buyerSeat, sellerSeat, { Money: providedMoney }],
|
|
114
113
|
[sellerSeat, buyerSeat, { Items: wantedItems }],
|
|
@@ -22,13 +22,13 @@
|
|
|
22
22
|
export function start(zcf: ZCF): {
|
|
23
23
|
publicFacet: {
|
|
24
24
|
makeInvitation: () => Promise<Invitation<unknown, never>>;
|
|
25
|
-
getNotifier: () => Notifier<{
|
|
25
|
+
getNotifier: () => globalThis.Notifier<{
|
|
26
26
|
buys: any;
|
|
27
27
|
sells: any;
|
|
28
28
|
}>;
|
|
29
|
-
} & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
29
|
+
} & import("@endo/marshal").RemotableObject<`Alleged: ${string}`> & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
30
30
|
makeInvitation: () => Promise<Invitation<unknown, never>>;
|
|
31
|
-
getNotifier: () => Notifier<{
|
|
31
|
+
getNotifier: () => globalThis.Notifier<{
|
|
32
32
|
buys: any;
|
|
33
33
|
sells: any;
|
|
34
34
|
}>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types-ambient.d.ts","sourceRoot":"","sources":["types-ambient.js"],"names":[],"mappings":";oBAEc,MAAM,MAAM;uBACZ,MAAM,MAAM;;;yBAGZ,MAAM,OAAO,CAAC,UAAU,CAAC;;6BAE1B,oBAAoB,GAAG,oBAAoB;;2BAK1C,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;WACnB,MAAM;iBACN,MAAM;2BACN,YAAY;kBACZ,MAAM;;;0BAGN,QAAQ;2BACR,qBAAqB;uBACrB,QAAQ;0BACR,oBAAoB;;;gBAGpB,CAAC,UAAU,EAAE,mBAAmB,KAAK,OAAO,CAAC,eAAe,CAAC;eAC7D,MAAM,MAAM;;;oBAKZ,MAAM,MAAM;oBACZ,MAAM,OAAO,CAAC,UAAU,CAAC;;;;;;;wBAKzB,MAAM,OAAO,CAAC,UAAU,CAAC;;;;;;0BAEzB,MAAM,OAAO,CAAC,UAAU,CAAC;;;;;;2BAGzB,MAAM,OAAO,CAAC,UAAU,CAAC;;;;;gCAGzB,MAAM,OAAO,CAAC,UAAU,CAAC;;;;;mCAEzB,MAAM,OAAO,CAAC,UAAU,CAAC;wBAEzB,MAAM,MAAM;;;;;wBACZ,MAAM,MAAM;;;;;mBAEZ,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,KAAK,MAAM;;;;;oBAG7C,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,KAAK,MAAM;;;;;uBAG7C,MAAM,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"handleWarning.d.ts","sourceRoot":"","sources":["handleWarning.js"],"names":[],"mappings":"AASO,wCAHI,
|
|
1
|
+
{"version":3,"file":"handleWarning.d.ts","sourceRoot":"","sources":["handleWarning.js"],"names":[],"mappings":"AASO,wCAHI,OAAO,CAAC,GAAG,CAAC,GACV,IAAI,CAIhB;AASM,8CAHI,aAAa,CAAC,GAAG,CAAC,GAChB,IAAI,CAIhB"}
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export function makeInstanceRecordStorage(baggage:
|
|
1
|
+
export function makeInstanceRecordStorage(baggage: import("@agoric/vat-data").Baggage): (ir: InstanceRecord) => InstanceState;
|
|
2
2
|
//# sourceMappingURL=instanceRecordStorage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"instanceRecordStorage.d.ts","sourceRoot":"","sources":["instanceRecordStorage.js"],"names":[],"mappings":"AA8BO,
|
|
1
|
+
{"version":3,"file":"instanceRecordStorage.d.ts","sourceRoot":"","sources":["instanceRecordStorage.js"],"names":[],"mappings":"AA8BO,mDAHI,OAAO,kBAAkB,EAAE,OAAO,GAChC,CAAC,EAAE,EAAE,cAAc,KAAK,aAAa,CAqFjD"}
|
package/src/internal-types.d.ts
CHANGED
|
@@ -22,20 +22,21 @@ type ZoeSeatAdminKit = {
|
|
|
22
22
|
/**
|
|
23
23
|
* Make the Zoe seat admin, user seat and a notifier
|
|
24
24
|
*/
|
|
25
|
-
type MakeZoeSeatAdminKit = (initialAllocation: Allocation, instanceAdminHelper: InstanceAdminHelper, proposal: ProposalRecord, withdrawFacet: WithdrawFacet, exitObj: ERef<ExitObj>, offerResult?: ERef<unknown>, baggage:
|
|
25
|
+
type MakeZoeSeatAdminKit = (initialAllocation: Allocation, instanceAdminHelper: InstanceAdminHelper, proposal: ProposalRecord, withdrawFacet: WithdrawFacet, exitObj: ERef<ExitObj>, offerResult?: ERef<unknown>, baggage: import("@agoric/vat-data").Baggage) => ZoeSeatAdminKit;
|
|
26
26
|
type ZoeSeatAdminExit = (completion?: Completion) => void;
|
|
27
|
-
type
|
|
27
|
+
type ZoeSeatAdminMethods = {
|
|
28
28
|
replaceAllocation: (allocation: Allocation) => void;
|
|
29
29
|
exit: ZoeSeatAdminExit;
|
|
30
30
|
/**
|
|
31
31
|
* called with the reason
|
|
32
32
|
* for calling fail on this seat, where reason is normally an instanceof Error.
|
|
33
33
|
*/
|
|
34
|
-
fail: ShutdownWithFailure;
|
|
34
|
+
fail: import("@agoric/swingset-vat").ShutdownWithFailure;
|
|
35
35
|
getExitSubscriber: () => Subscriber<AmountKeywordRecord>;
|
|
36
36
|
};
|
|
37
|
+
type ZoeSeatAdmin = import("@endo/marshal").RemotableObject & ZoeSeatAdminMethods;
|
|
37
38
|
type HandleOfferResult = {
|
|
38
|
-
offerResultPromise: Promise<
|
|
39
|
+
offerResultPromise: Promise<import("@endo/marshal").Passable>;
|
|
39
40
|
exitObj: ExitObj;
|
|
40
41
|
};
|
|
41
42
|
/**
|
|
@@ -55,7 +56,7 @@ type InstanceAdmin = {
|
|
|
55
56
|
getOfferFilter: () => string[];
|
|
56
57
|
getInstallation: () => Installation;
|
|
57
58
|
exitAllSeats: (completion: Completion) => void;
|
|
58
|
-
failAllSeats: ShutdownWithFailure;
|
|
59
|
+
failAllSeats: import("@agoric/swingset-vat").ShutdownWithFailure;
|
|
59
60
|
stopAcceptingOffers: () => void;
|
|
60
61
|
isBlocked: (string: string) => boolean;
|
|
61
62
|
initDelayedState: (handleOfferObj: HandleOfferObj, publicFacet: unknown) => void;
|
|
@@ -72,24 +73,26 @@ type HandleOfferObj = {
|
|
|
72
73
|
type ZoeInstanceAdminMakeInvitation = (invitationHandle: InvitationHandle, description: string, customDetails?: Record<string, any> | undefined, proposalShape?: Pattern) => Invitation;
|
|
73
74
|
type ZoeInstanceAdmin = {
|
|
74
75
|
makeInvitation: ZoeInstanceAdminMakeInvitation;
|
|
75
|
-
saveIssuer: (issuerP: ERef<
|
|
76
|
+
saveIssuer: <I extends Issuer>(issuerP: ERef<I>, keyword: Keyword) => Promise<I extends Issuer<infer K, infer M> ? IssuerRecord<K, M> : never>;
|
|
76
77
|
makeZoeMint: MakeZoeMint;
|
|
77
78
|
registerFeeMint: RegisterFeeMint;
|
|
78
79
|
makeNoEscrowSeat: MakeNoEscrowSeat;
|
|
79
80
|
replaceAllocations: ReplaceAllocations;
|
|
80
81
|
exitAllSeats: (completion: Completion) => void;
|
|
81
|
-
failAllSeats: ShutdownWithFailure;
|
|
82
|
+
failAllSeats: import("@agoric/swingset-vat").ShutdownWithFailure;
|
|
82
83
|
exitSeat: (seatHandle: SeatHandle, completion: Completion) => void;
|
|
83
84
|
failSeat: (seatHandle: SeatHandle, reason: Error) => void;
|
|
84
85
|
stopAcceptingOffers: () => void;
|
|
85
86
|
setOfferFilter: (strings: Array<string>) => void;
|
|
86
87
|
getOfferFilter: () => Array<string>;
|
|
87
88
|
getExitSubscriber: (seatHandle: SeatHandle) => Subscriber<AmountKeywordRecord>;
|
|
89
|
+
repairContractCompletionWatcher: () => void;
|
|
88
90
|
};
|
|
89
|
-
type RegisterFeeMint = (keyword: Keyword, allegedFeeMintAccess: FeeMintAccess) => ZoeMint<
|
|
91
|
+
type RegisterFeeMint = (keyword: Keyword, allegedFeeMintAccess: FeeMintAccess) => ZoeMint<"nat">;
|
|
90
92
|
type WrapIssuerKitWithZoeMint = (keyword: Keyword, localIssuerKit: IssuerKit) => any;
|
|
91
|
-
type MakeZoeMint = (keyword: Keyword, assetKind?: AssetKind | undefined, displayInfo?: AdditionalDisplayInfo | undefined, options?: Partial<{
|
|
92
|
-
elementShape:
|
|
93
|
+
type MakeZoeMint = (keyword: Keyword, assetKind?: globalThis.AssetKind | undefined, displayInfo?: globalThis.AdditionalDisplayInfo | undefined, options?: Partial<{
|
|
94
|
+
elementShape: Pattern;
|
|
95
|
+
recoverySetsOption: import("@agoric/ertp/src/types").RecoverySetsOption;
|
|
93
96
|
}> | undefined) => ZoeMint;
|
|
94
97
|
type MakeNoEscrowSeat = (initialAllocation: Allocation, proposal: ProposalRecord, exitObj: ExitObj, seatHandle: SeatHandle) => UserSeat;
|
|
95
98
|
type ReplaceAllocations = (seatHandleAllocations: SeatHandleAllocation[]) => any;
|
|
@@ -97,7 +100,7 @@ type SeatHandleAllocation = {
|
|
|
97
100
|
seatHandle: SeatHandle;
|
|
98
101
|
allocation: Allocation;
|
|
99
102
|
};
|
|
100
|
-
type ZoeMint<K extends AssetKind = AssetKind> = {
|
|
103
|
+
type ZoeMint<K extends AssetKind = globalThis.AssetKind> = {
|
|
101
104
|
getIssuerRecord: () => IssuerRecord<K>;
|
|
102
105
|
mintAndEscrow: (totalToMint: Amount<K>) => void;
|
|
103
106
|
/**
|
|
@@ -114,7 +117,7 @@ type ZCFRoot = {
|
|
|
114
117
|
};
|
|
115
118
|
type ExecuteContractResult = {
|
|
116
119
|
creatorFacet: object;
|
|
117
|
-
creatorInvitation
|
|
120
|
+
creatorInvitation?: Promise<Invitation<unknown, undefined>> | undefined;
|
|
118
121
|
publicFacet: object;
|
|
119
122
|
handleOfferObj: HandleOfferObj;
|
|
120
123
|
};
|
|
@@ -124,7 +127,7 @@ type MakeExitObj = (proposal: ProposalRecord, zoeSeatAdmin: ZCFSeat) => ExitObj;
|
|
|
124
127
|
type ExitObj = {
|
|
125
128
|
exit: () => void;
|
|
126
129
|
};
|
|
127
|
-
type SeatHandle = Handle<
|
|
130
|
+
type SeatHandle = Handle<"Seat">;
|
|
128
131
|
/**
|
|
129
132
|
* Get the assetKind for a brand known by Zoe
|
|
130
133
|
*
|
|
@@ -146,32 +149,18 @@ type ZcfSeatManager = {
|
|
|
146
149
|
type ZcfMintReallocator = {
|
|
147
150
|
reallocate: (zcfSeat: ZCFSeat, newAllocation: Allocation) => void;
|
|
148
151
|
};
|
|
149
|
-
/**
|
|
150
|
-
* The SeatManager holds the active zcfSeats and can reallocate and
|
|
151
|
-
* make new zcfSeats.
|
|
152
|
-
*/
|
|
153
|
-
type CreateSeatManager = (zoeInstanceAdmin: ERef<ZoeInstanceAdmin>, getAssetKindByBrand: GetAssetKindByBrand, shutdownWithFailure: ShutdownWithFailure, zcfBaggage: MapStore<string, unknown>) => {
|
|
154
|
-
seatManager: ZcfSeatManager;
|
|
155
|
-
zcfMintReallocator: ZcfMintReallocator;
|
|
156
|
-
};
|
|
157
152
|
/**
|
|
158
153
|
* Add an issuer and its keyword to the instanceRecord for the
|
|
159
154
|
* contract instance
|
|
160
155
|
*/
|
|
161
156
|
type InstanceStateAddIssuer = (keyword: Keyword, issuerRecord: IssuerRecord) => void;
|
|
162
|
-
type InstanceStateGetTerms = () => AnyTerms;
|
|
163
|
-
type InstanceStateGetInstallation = () => Installation;
|
|
164
|
-
type InstanceRecordGetIssuers = () => IssuerKeywordRecord;
|
|
165
|
-
type InstanceRecordGetBrands = () => BrandKeywordRecord;
|
|
166
157
|
type InstanceState = {
|
|
167
158
|
addIssuer: InstanceStateAddIssuer;
|
|
168
|
-
getInstanceRecord:
|
|
169
|
-
getTerms:
|
|
170
|
-
getInstallation:
|
|
171
|
-
getIssuers:
|
|
172
|
-
getBrands:
|
|
159
|
+
getInstanceRecord: () => InstanceRecord;
|
|
160
|
+
getTerms: () => AnyTerms;
|
|
161
|
+
getInstallation: () => Installation;
|
|
162
|
+
getIssuers: () => IssuerKeywordRecord;
|
|
163
|
+
getBrands: () => BrandKeywordRecord;
|
|
173
164
|
assertUniqueKeyword: (keyword: Keyword) => void;
|
|
174
165
|
};
|
|
175
|
-
type GetInstanceRecord = () => InstanceRecord;
|
|
176
|
-
type IssuerStorageGetIssuerRecords = (issuers: Issuer[]) => IssuerRecords;
|
|
177
166
|
//# sourceMappingURL=internal-types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"internal-types.d.ts","sourceRoot":"","sources":["internal-types.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"internal-types.d.ts","sourceRoot":"","sources":["internal-types.js"],"names":[],"mappings":"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"}
|