@agoric/zoe 0.26.3-upgrade-14-dev-c8f9e7b.0 → 0.26.3-upgrade-16-dev-8879538.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +7 -7
- package/bundles/bundle-contractFacet-js-meta.json +622 -313
- package/bundles/bundle-contractFacet.d.ts +3 -3
- package/bundles/bundle-contractFacet.js +1 -1
- package/exported.js +1 -12
- package/package.json +75 -60
- package/src/cleanProposal.d.ts +2 -2
- package/src/cleanProposal.d.ts.map +1 -1
- package/src/cleanProposal.js +15 -12
- package/src/contractFacet/exit.d.ts.map +1 -1
- package/src/contractFacet/exit.js +1 -0
- package/src/contractFacet/internal-types.d.ts +2 -2
- package/src/contractFacet/internal-types.d.ts.map +1 -1
- package/src/contractFacet/internal-types.js +1 -1
- package/src/contractFacet/offerHandlerStorage.d.ts +4 -1
- package/src/contractFacet/offerHandlerStorage.d.ts.map +1 -1
- package/src/contractFacet/offerHandlerStorage.js +11 -3
- package/src/contractFacet/reallocate.d.ts +3 -0
- package/src/contractFacet/reallocate.d.ts.map +1 -0
- package/src/contractFacet/reallocate.js +94 -0
- package/src/contractFacet/rightsConservation.d.ts.map +1 -1
- package/src/contractFacet/rightsConservation.js +3 -0
- package/src/contractFacet/types-ambient.d.ts +259 -0
- package/src/contractFacet/types-ambient.js +1 -0
- package/src/contractFacet/vatRoot.d.ts +4 -4
- package/src/contractFacet/vatRoot.d.ts.map +1 -1
- package/src/contractFacet/zcfMint.d.ts +5 -3
- package/src/contractFacet/zcfMint.d.ts.map +1 -1
- package/src/contractFacet/zcfMint.js +4 -4
- package/src/contractFacet/zcfSeat.d.ts +4 -2
- package/src/contractFacet/zcfSeat.d.ts.map +1 -1
- package/src/contractFacet/zcfSeat.js +125 -5
- package/src/contractFacet/zcfZygote.d.ts +1 -2
- package/src/contractFacet/zcfZygote.d.ts.map +1 -1
- package/src/contractFacet/zcfZygote.js +95 -42
- package/src/contractSupport/atomicTransfer.d.ts +0 -6
- package/src/contractSupport/atomicTransfer.d.ts.map +1 -1
- package/src/contractSupport/atomicTransfer.js +5 -90
- package/src/contractSupport/bondingCurves.js +2 -2
- package/src/contractSupport/durability.d.ts +3 -3
- package/src/contractSupport/durability.d.ts.map +1 -1
- package/src/contractSupport/durability.js +5 -5
- package/src/contractSupport/index.d.ts +1 -0
- package/src/contractSupport/index.js +1 -0
- package/src/contractSupport/prepare-ownable.d.ts +11 -0
- package/src/contractSupport/prepare-ownable.d.ts.map +1 -0
- package/src/contractSupport/prepare-ownable.js +100 -0
- package/src/contractSupport/priceAuthority.d.ts +23 -15
- package/src/contractSupport/priceAuthority.d.ts.map +1 -1
- package/src/contractSupport/priceAuthority.js +32 -17
- package/src/contractSupport/priceAuthorityInitial.d.ts +3 -2
- package/src/contractSupport/priceAuthorityInitial.d.ts.map +1 -1
- package/src/contractSupport/priceAuthorityInitial.js +5 -2
- package/src/contractSupport/priceAuthorityQuoteMint.d.ts +2 -1
- package/src/contractSupport/priceAuthorityQuoteMint.d.ts.map +1 -1
- package/src/contractSupport/priceAuthorityQuoteMint.js +23 -27
- package/src/contractSupport/priceAuthorityTransform.d.ts +14 -12
- package/src/contractSupport/priceAuthorityTransform.d.ts.map +1 -1
- package/src/contractSupport/priceAuthorityTransform.js +10 -8
- package/src/contractSupport/priceQuote.d.ts +7 -5
- package/src/contractSupport/priceQuote.d.ts.map +1 -1
- package/src/contractSupport/priceQuote.js +5 -1
- package/src/contractSupport/ratio.d.ts +2 -2
- package/src/contractSupport/ratio.d.ts.map +1 -1
- package/src/contractSupport/ratio.js +19 -15
- package/src/contractSupport/recorder.d.ts +31 -117
- package/src/contractSupport/recorder.d.ts.map +1 -1
- package/src/contractSupport/recorder.js +21 -10
- package/src/contractSupport/safeMath.d.ts +7 -7
- package/src/contractSupport/safeMath.d.ts.map +1 -1
- package/src/contractSupport/statistics.d.ts +1 -1
- package/src/contractSupport/statistics.d.ts.map +1 -1
- package/src/contractSupport/topics.d.ts +1 -1
- package/src/contractSupport/topics.d.ts.map +1 -1
- package/src/contractSupport/{types.d.ts → types-ambient.d.ts} +4 -4
- package/src/contractSupport/types-ambient.d.ts.map +1 -0
- package/src/contractSupport/{types.js → types-ambient.js} +1 -1
- package/src/contractSupport/zoeHelpers.d.ts +1 -1
- package/src/contractSupport/zoeHelpers.d.ts.map +1 -1
- package/src/contractSupport/zoeHelpers.js +5 -11
- package/src/contracts/auction/firstPriceLogic.d.ts.map +1 -1
- package/src/contracts/auction/firstPriceLogic.js +5 -8
- package/src/contracts/auction/index.d.ts +10 -10
- package/src/contracts/auction/index.d.ts.map +1 -1
- package/src/contracts/auction/index.js +2 -1
- package/src/contracts/auction/secondPriceLogic.d.ts.map +1 -1
- package/src/contracts/auction/secondPriceLogic.js +1 -4
- package/src/contracts/automaticRefund.d.ts +1 -1
- package/src/contracts/automaticRefund.d.ts.map +1 -1
- package/src/contracts/autoswap.d.ts.map +1 -1
- package/src/contracts/autoswap.js +8 -9
- package/src/contracts/barterExchange.d.ts +1 -1
- package/src/contracts/barterExchange.d.ts.map +1 -1
- package/src/contracts/barterExchange.js +2 -3
- package/src/contracts/callSpread/calculateShares.d.ts +1 -8
- package/src/contracts/callSpread/calculateShares.d.ts.map +1 -1
- package/src/contracts/callSpread/calculateShares.js +1 -1
- package/src/contracts/callSpread/fundedCallSpread.d.ts +4 -0
- package/src/contracts/callSpread/fundedCallSpread.d.ts.map +1 -1
- package/src/contracts/callSpread/fundedCallSpread.js +6 -4
- package/src/contracts/callSpread/payoffHandler.d.ts.map +1 -1
- package/src/contracts/callSpread/payoffHandler.js +2 -1
- package/src/contracts/callSpread/percent.d.ts +2 -4
- package/src/contracts/callSpread/percent.d.ts.map +1 -1
- package/src/contracts/callSpread/position.d.ts +2 -2
- package/src/contracts/callSpread/pricedCallSpread.d.ts +6 -5
- package/src/contracts/callSpread/pricedCallSpread.d.ts.map +1 -1
- package/src/contracts/callSpread/pricedCallSpread.js +8 -4
- package/src/contracts/callSpread/{types.d.ts → types-ambient.d.ts} +3 -3
- package/src/contracts/callSpread/types-ambient.d.ts.map +1 -0
- package/src/contracts/coveredCall-durable.d.ts +2 -4
- package/src/contracts/coveredCall-durable.d.ts.map +1 -1
- package/src/contracts/exported.js +3 -3
- package/src/contracts/loan/borrow.d.ts.map +1 -1
- package/src/contracts/loan/borrow.js +7 -4
- package/src/contracts/loan/close.d.ts.map +1 -1
- package/src/contracts/loan/close.js +3 -7
- package/src/contracts/loan/index.d.ts +5 -1
- package/src/contracts/loan/index.d.ts.map +1 -1
- package/src/contracts/loan/index.js +4 -0
- package/src/contracts/loan/liquidate.d.ts +1 -12
- package/src/contracts/loan/liquidate.d.ts.map +1 -1
- package/src/contracts/loan/liquidate.js +4 -2
- package/src/contracts/loan/scheduleLiquidation.d.ts.map +1 -1
- package/src/contracts/loan/scheduleLiquidation.js +1 -0
- package/src/contracts/loan/{types.d.ts → types-ambient.d.ts} +16 -17
- package/src/contracts/loan/types-ambient.d.ts.map +1 -0
- package/src/contracts/loan/{types.js → types-ambient.js} +11 -18
- package/src/contracts/loan/updateDebt.js +1 -1
- package/src/contracts/mintAndSellNFT.d.ts.map +1 -1
- package/src/contracts/mintPayments.d.ts +14 -6
- package/src/contracts/mintPayments.d.ts.map +1 -1
- package/src/contracts/mintPayments.js +1 -1
- package/src/contracts/oracle.d.ts +25 -3
- package/src/contracts/oracle.d.ts.map +1 -1
- package/src/contracts/oracle.js +7 -0
- package/src/contracts/otcDesk.d.ts +3 -3
- package/src/contracts/otcDesk.d.ts.map +1 -1
- package/src/contracts/otcDesk.js +1 -1
- package/src/contracts/priceAggregator.d.ts +112 -18
- package/src/contracts/priceAggregator.d.ts.map +1 -1
- package/src/contracts/priceAggregator.js +16 -18
- package/src/contracts/priceAggregatorTypes.d.ts +2 -2
- package/src/contracts/priceAggregatorTypes.d.ts.map +1 -1
- package/src/contracts/scaledPriceAuthority.d.ts +4 -5
- package/src/contracts/scaledPriceAuthority.d.ts.map +1 -1
- package/src/contracts/scaledPriceAuthority.js +6 -0
- package/src/contracts/sellItems.d.ts +2 -2
- package/src/contracts/sellItems.d.ts.map +1 -1
- package/src/contracts/sellItems.js +2 -3
- package/src/contracts/simpleExchange.d.ts +3 -3
- package/src/contracts/{types.d.ts → types-ambient.d.ts} +1 -1
- package/src/contracts/types-ambient.d.ts.map +1 -0
- package/src/handleWarning.d.ts.map +1 -1
- package/src/instanceRecordStorage.d.ts +1 -1
- package/src/instanceRecordStorage.d.ts.map +1 -1
- package/src/internal-types.d.ts +20 -32
- package/src/internal-types.d.ts.map +1 -1
- package/src/internal-types.js +18 -58
- package/src/issuerRecord.d.ts +2 -2
- package/src/issuerRecord.d.ts.map +1 -1
- package/src/issuerStorage.d.ts +4 -4
- package/src/issuerStorage.d.ts.map +1 -1
- package/src/issuerStorage.js +12 -28
- package/src/makeHandle.d.ts +2 -2
- package/src/makeHandle.d.ts.map +1 -1
- package/src/makeHandle.js +1 -1
- package/src/typeGuards.d.ts +119 -20
- package/src/typeGuards.d.ts.map +1 -1
- package/src/typeGuards.js +18 -9
- package/src/types-ambient.d.ts +41 -0
- package/src/types-ambient.d.ts.map +1 -0
- package/src/{types.js → types-ambient.js} +6 -14
- package/src/zoeService/escrowStorage.d.ts +1 -1
- package/src/zoeService/escrowStorage.d.ts.map +1 -1
- package/src/zoeService/escrowStorage.js +20 -27
- package/src/zoeService/feeMint.d.ts +9 -16
- package/src/zoeService/feeMint.d.ts.map +1 -1
- package/src/zoeService/feeMint.js +21 -15
- package/src/zoeService/installationStorage.d.ts +5 -20
- package/src/zoeService/installationStorage.d.ts.map +1 -1
- package/src/zoeService/installationStorage.js +11 -7
- package/src/zoeService/instanceAdminStorage.d.ts +22 -42
- package/src/zoeService/instanceAdminStorage.d.ts.map +1 -1
- package/src/zoeService/instanceAdminStorage.js +1 -0
- package/src/zoeService/internal-types.d.ts +16 -16
- package/src/zoeService/internal-types.d.ts.map +1 -1
- package/src/zoeService/internal-types.js +6 -6
- package/src/zoeService/invitationQueries.d.ts.map +1 -1
- package/src/zoeService/invitationQueries.js +7 -5
- package/src/zoeService/makeInvitation.d.ts +3 -3
- package/src/zoeService/makeInvitation.d.ts.map +1 -1
- package/src/zoeService/makeInvitation.js +25 -21
- package/src/zoeService/offer/burnInvitation.d.ts.map +1 -1
- package/src/zoeService/offer/offer.d.ts.map +1 -1
- package/src/zoeService/offer/offer.js +2 -5
- package/src/zoeService/originalZoeSeat.d.ts +34 -0
- package/src/zoeService/originalZoeSeat.d.ts.map +1 -0
- package/src/zoeService/originalZoeSeat.js +353 -0
- package/src/zoeService/startInstance.d.ts +3 -3
- package/src/zoeService/startInstance.d.ts.map +1 -1
- package/src/zoeService/startInstance.js +17 -11
- package/src/zoeService/{types.d.ts → types-ambient.d.ts} +26 -31
- package/src/zoeService/types-ambient.d.ts.map +1 -0
- package/src/zoeService/{types.js → types-ambient.js} +19 -32
- package/src/zoeService/utils.d.ts +54 -58
- package/src/zoeService/utils.test-d.d.ts +2 -0
- package/src/zoeService/utils.test-d.d.ts.map +1 -0
- package/src/zoeService/utils.test-d.ts +33 -0
- package/src/zoeService/zoe.d.ts +9 -13
- package/src/zoeService/zoe.d.ts.map +1 -1
- package/src/zoeService/zoe.js +7 -7
- package/src/zoeService/zoeSeat.d.ts +15 -45
- package/src/zoeService/zoeSeat.d.ts.map +1 -1
- package/src/zoeService/zoeSeat.js +214 -114
- package/src/zoeService/zoeStorageManager.d.ts +9 -43
- package/src/zoeService/zoeStorageManager.d.ts.map +1 -1
- package/src/zoeService/zoeStorageManager.js +8 -6
- package/tools/fakePriceAuthority.d.ts +9 -8
- package/tools/fakePriceAuthority.d.ts.map +1 -1
- package/tools/fakePriceAuthority.js +21 -17
- package/tools/fakeVatAdmin.d.ts +10 -10
- package/tools/manualPriceAuthority.d.ts +11 -6
- package/tools/manualPriceAuthority.d.ts.map +1 -1
- package/tools/manualPriceAuthority.js +15 -2
- package/tools/manualTimer.d.ts +21 -40
- package/tools/manualTimer.d.ts.map +1 -1
- package/tools/manualTimer.js +30 -16
- package/tools/prepare-test-env.js +1 -1
- package/tools/scriptedOracle.d.ts +3 -3
- package/tools/scriptedOracle.d.ts.map +1 -1
- package/tools/scriptedOracle.js +1 -1
- package/tools/scriptedPriceAuthority.d.ts +4 -0
- package/tools/scriptedPriceAuthority.d.ts.map +1 -1
- package/tools/scriptedPriceAuthority.js +6 -1
- package/tools/setup-zoe.d.ts +8 -9
- package/tools/setup-zoe.d.ts.map +1 -1
- package/tools/setup-zoe.js +16 -1
- package/tools/test-utils.d.ts +20 -0
- package/tools/test-utils.d.ts.map +1 -0
- package/tools/test-utils.js +26 -0
- package/tools/types.d.ts +21 -21
- package/tools/types.d.ts.map +1 -1
- package/tools/types.js +10 -10
- package/CHANGELOG.md +0 -1203
- package/src/contractFacet/types.d.ts +0 -191
- package/src/contractFacet/types.d.ts.map +0 -1
- package/src/contractFacet/types.js +0 -256
- package/src/contractSupport/types.d.ts.map +0 -1
- package/src/contracts/callSpread/types.d.ts.map +0 -1
- package/src/contracts/loan/types.d.ts.map +0 -1
- package/src/contracts/types.d.ts.map +0 -1
- package/src/objArrayConversion.d.ts +0 -5
- package/src/objArrayConversion.d.ts.map +0 -1
- package/src/objArrayConversion.js +0 -35
- package/src/types.d.ts +0 -45
- package/src/types.d.ts.map +0 -1
- package/src/zoeService/types.d.ts.map +0 -1
- package/tools/internal-types.d.ts +0 -12
- package/tools/internal-types.d.ts.map +0 -1
- package/tools/internal-types.js +0 -14
- package/tools/priceAuthorityRegistry.d.ts +0 -20
- package/tools/priceAuthorityRegistry.d.ts.map +0 -1
- package/tools/priceAuthorityRegistry.js +0 -209
- package/tools/types-ambient.d.ts +0 -142
- package/tools/types-ambient.d.ts.map +0 -1
- package/tools/types-ambient.js +0 -160
- /package/src/contracts/callSpread/{types.js → types-ambient.js} +0 -0
- /package/src/contracts/{types.js → types-ambient.js} +0 -0
|
@@ -10,7 +10,9 @@ import { TimeMath } from '@agoric/time';
|
|
|
10
10
|
|
|
11
11
|
import { natSafeMath } from '../src/contractSupport/index.js';
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
/**
|
|
14
|
+
* @import {PriceAuthority, PriceDescription, PriceQuote, PriceQuoteValue, PriceQuery,} from '@agoric/zoe/tools/types.js';
|
|
15
|
+
*/
|
|
14
16
|
|
|
15
17
|
const { Fail } = assert;
|
|
16
18
|
const { coerceRelativeTimeRecord } = TimeMath;
|
|
@@ -26,8 +28,8 @@ const timestampLTE = (a, b) => TimeMath.compareAbs(a, b) <= 0;
|
|
|
26
28
|
* @property {Brand<'nat'>} actualBrandOut
|
|
27
29
|
* @property {Array<number>} [priceList]
|
|
28
30
|
* @property {Array<[number, number]>} [tradeList]
|
|
29
|
-
* @property {
|
|
30
|
-
* @property {import('@agoric/time
|
|
31
|
+
* @property {import('@agoric/time').TimerService} timer
|
|
32
|
+
* @property {import('@agoric/time').RelativeTime} [quoteInterval]
|
|
31
33
|
* @property {ERef<Mint<'set'>>} [quoteMint]
|
|
32
34
|
* @property {Amount<'nat'>} [unitAmountIn]
|
|
33
35
|
*/
|
|
@@ -84,7 +86,7 @@ export async function makeFakePriceAuthority(options) {
|
|
|
84
86
|
const quoteBrand = await E(quoteIssuer).getBrand();
|
|
85
87
|
|
|
86
88
|
/**
|
|
87
|
-
* @type {NotifierRecord<import('@agoric/time
|
|
89
|
+
* @type {NotifierRecord<import('@agoric/time').Timestamp>}
|
|
88
90
|
* We need to have a notifier driven by the
|
|
89
91
|
* TimerService because if the timer pushes updates to individual
|
|
90
92
|
* QuoteNotifiers, we have a dependency inversion and the timer can never know
|
|
@@ -104,7 +106,7 @@ export async function makeFakePriceAuthority(options) {
|
|
|
104
106
|
*
|
|
105
107
|
* @param {Amount<'nat'>} amountIn
|
|
106
108
|
* @param {Brand} brandOut
|
|
107
|
-
* @param {import('@agoric/time
|
|
109
|
+
* @param {import('@agoric/time').Timestamp} quoteTime
|
|
108
110
|
* @returns {PriceQuote}
|
|
109
111
|
*/
|
|
110
112
|
function priceInQuote(amountIn, brandOut, quoteTime) {
|
|
@@ -115,16 +117,19 @@ export async function makeFakePriceAuthority(options) {
|
|
|
115
117
|
natSafeMath.multiply(amountIn.value, tradeValueOut),
|
|
116
118
|
tradeValueIn,
|
|
117
119
|
);
|
|
120
|
+
/** @type {Amount<'set', PriceDescription>} */
|
|
118
121
|
const quoteAmount = AmountMath.make(
|
|
119
122
|
quoteBrand,
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
123
|
+
/** @type {[PriceDescription]} */ (
|
|
124
|
+
harden([
|
|
125
|
+
{
|
|
126
|
+
amountIn,
|
|
127
|
+
amountOut: AmountMath.make(actualBrandOut, valueOut),
|
|
128
|
+
timer,
|
|
129
|
+
timestamp: quoteTime,
|
|
130
|
+
},
|
|
131
|
+
])
|
|
132
|
+
),
|
|
128
133
|
);
|
|
129
134
|
const quote = harden({
|
|
130
135
|
quotePayment: E(quoteMint).mintPayment(quoteAmount),
|
|
@@ -136,7 +141,7 @@ export async function makeFakePriceAuthority(options) {
|
|
|
136
141
|
/**
|
|
137
142
|
* @param {Brand<'nat'>} brandIn
|
|
138
143
|
* @param {Amount<'nat'>} amountOut
|
|
139
|
-
* @param {import('@agoric/time
|
|
144
|
+
* @param {import('@agoric/time').Timestamp} quoteTime
|
|
140
145
|
* @returns {PriceQuote}
|
|
141
146
|
*/
|
|
142
147
|
function priceOutQuote(brandIn, amountOut, quoteTime) {
|
|
@@ -158,7 +163,7 @@ export async function makeFakePriceAuthority(options) {
|
|
|
158
163
|
let latestTick;
|
|
159
164
|
|
|
160
165
|
// clients who are waiting for a specific timestamp
|
|
161
|
-
/** @type { [when: import('@agoric/time
|
|
166
|
+
/** @type { [when: import('@agoric/time').Timestamp, resolve: (quote: PriceQuote) => void][] } */
|
|
162
167
|
let timeClients = [];
|
|
163
168
|
|
|
164
169
|
// Check if a comparison request has been satisfied.
|
|
@@ -254,13 +259,12 @@ export async function makeFakePriceAuthority(options) {
|
|
|
254
259
|
async function* generateQuotes(amountIn, brandOut) {
|
|
255
260
|
let record = await ticker.getUpdateSince();
|
|
256
261
|
while (record.updateCount !== undefined) {
|
|
257
|
-
// eslint-disable-next-line no-await-in-loop
|
|
258
262
|
const { value: timestamp } = record; // = await E(timer).getCurrentTimestamp();
|
|
259
263
|
yield priceInQuote(amountIn, brandOut, timestamp);
|
|
260
|
-
// eslint-disable-next-line no-await-in-loop
|
|
261
264
|
record = await ticker.getUpdateSince(record.updateCount);
|
|
262
265
|
}
|
|
263
266
|
}
|
|
267
|
+
harden(generateQuotes);
|
|
264
268
|
|
|
265
269
|
/** @type {PriceAuthority} */
|
|
266
270
|
const priceAuthority = Far('fake price authority', {
|
package/tools/fakeVatAdmin.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
export const zcfBundleCap: any;
|
|
2
2
|
export default fakeVatAdmin;
|
|
3
|
-
export type BundleID = import(
|
|
4
|
-
export type EndoZipBase64Bundle = import(
|
|
5
|
-
export type BundleCap = import(
|
|
3
|
+
export type BundleID = import("@agoric/swingset-vat").BundleID;
|
|
4
|
+
export type EndoZipBase64Bundle = import("@agoric/swingset-vat").EndoZipBase64Bundle;
|
|
5
|
+
export type BundleCap = import("@agoric/swingset-vat").BundleCap;
|
|
6
6
|
declare const fakeVatAdmin: {
|
|
7
7
|
getBundleCap: (bundleID: any) => Promise<any>;
|
|
8
8
|
waitForBundleCap: (bundleID: any) => Promise<any>;
|
|
@@ -16,13 +16,13 @@ declare const fakeVatAdmin: {
|
|
|
16
16
|
done: () => Promise<any>;
|
|
17
17
|
terminateWithFailure: () => void;
|
|
18
18
|
upgrade: (_bundleCap: any, _options: any) => never;
|
|
19
|
-
} & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
19
|
+
} & import("@endo/marshal").RemotableObject<`Alleged: ${string}`> & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
20
20
|
done: () => Promise<any>;
|
|
21
21
|
terminateWithFailure: () => void;
|
|
22
22
|
upgrade: (_bundleCap: any, _options: any) => never;
|
|
23
23
|
}>;
|
|
24
24
|
}>;
|
|
25
|
-
} & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
25
|
+
} & import("@endo/marshal").RemotableObject<`Alleged: ${string}`> & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
26
26
|
getBundleCap: (bundleID: any) => Promise<any>;
|
|
27
27
|
waitForBundleCap: (bundleID: any) => Promise<any>;
|
|
28
28
|
getNamedBundleCap: (name: any) => Promise<any>;
|
|
@@ -35,7 +35,7 @@ declare const fakeVatAdmin: {
|
|
|
35
35
|
done: () => Promise<any>;
|
|
36
36
|
terminateWithFailure: () => void;
|
|
37
37
|
upgrade: (_bundleCap: any, _options: any) => never;
|
|
38
|
-
} & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
38
|
+
} & import("@endo/marshal").RemotableObject<`Alleged: ${string}`> & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
39
39
|
done: () => Promise<any>;
|
|
40
40
|
terminateWithFailure: () => void;
|
|
41
41
|
upgrade: (_bundleCap: any, _options: any) => never;
|
|
@@ -60,13 +60,13 @@ export function makeFakeVatAdmin(testContextSetter?: ((...args: any[]) => unknow
|
|
|
60
60
|
done: () => Promise<any>;
|
|
61
61
|
terminateWithFailure: () => void;
|
|
62
62
|
upgrade: (_bundleCap: any, _options: any) => never;
|
|
63
|
-
} & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
63
|
+
} & import("@endo/marshal").RemotableObject<`Alleged: ${string}`> & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
64
64
|
done: () => Promise<any>;
|
|
65
65
|
terminateWithFailure: () => void;
|
|
66
66
|
upgrade: (_bundleCap: any, _options: any) => never;
|
|
67
67
|
}>;
|
|
68
68
|
}>;
|
|
69
|
-
} & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
69
|
+
} & import("@endo/marshal").RemotableObject<`Alleged: ${string}`> & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
70
70
|
getBundleCap: (bundleID: any) => Promise<any>;
|
|
71
71
|
waitForBundleCap: (bundleID: any) => Promise<any>;
|
|
72
72
|
getNamedBundleCap: (name: any) => Promise<any>;
|
|
@@ -79,7 +79,7 @@ export function makeFakeVatAdmin(testContextSetter?: ((...args: any[]) => unknow
|
|
|
79
79
|
done: () => Promise<any>;
|
|
80
80
|
terminateWithFailure: () => void;
|
|
81
81
|
upgrade: (_bundleCap: any, _options: any) => never;
|
|
82
|
-
} & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
82
|
+
} & import("@endo/marshal").RemotableObject<`Alleged: ${string}`> & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
83
83
|
done: () => Promise<any>;
|
|
84
84
|
terminateWithFailure: () => void;
|
|
85
85
|
upgrade: (_bundleCap: any, _options: any) => never;
|
|
@@ -95,7 +95,7 @@ export function makeFakeVatAdmin(testContextSetter?: ((...args: any[]) => unknow
|
|
|
95
95
|
getCriticalVatKey: () => {};
|
|
96
96
|
getVatPowers: () => {
|
|
97
97
|
D: (bcap: any) => {
|
|
98
|
-
getBundle: () =>
|
|
98
|
+
getBundle: () => globalThis.EndoZipBase64Bundle;
|
|
99
99
|
};
|
|
100
100
|
};
|
|
101
101
|
};
|
|
@@ -1,20 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @import {PriceAuthority, PriceDescription, PriceQuote, PriceQuoteValue, PriceQuery,} from '@agoric/zoe/tools/types.js';
|
|
3
|
+
*/
|
|
1
4
|
/**
|
|
2
5
|
* @param {object} options
|
|
3
6
|
* @param {Brand<'nat'>} options.actualBrandIn
|
|
4
7
|
* @param {Brand<'nat'>} options.actualBrandOut
|
|
5
8
|
* @param {Ratio} options.initialPrice
|
|
6
|
-
* @param {import('@agoric/time
|
|
9
|
+
* @param {import('@agoric/time').TimerService} options.timer
|
|
7
10
|
* @param {IssuerKit<'set'>} [options.quoteIssuerKit]
|
|
8
|
-
* @returns {PriceAuthority & { setPrice: (Ratio) => void }}
|
|
11
|
+
* @returns {PriceAuthority & { setPrice: (Ratio) => void; disable: () => void }}
|
|
9
12
|
*/
|
|
10
13
|
export function makeManualPriceAuthority(options: {
|
|
11
|
-
actualBrandIn: Brand<
|
|
12
|
-
actualBrandOut: Brand<
|
|
14
|
+
actualBrandIn: Brand<"nat">;
|
|
15
|
+
actualBrandOut: Brand<"nat">;
|
|
13
16
|
initialPrice: Ratio;
|
|
14
|
-
timer: import(
|
|
15
|
-
quoteIssuerKit?: IssuerKit<"set"> | undefined;
|
|
17
|
+
timer: import("@agoric/time").TimerService;
|
|
18
|
+
quoteIssuerKit?: globalThis.IssuerKit<"set"> | undefined;
|
|
16
19
|
}): PriceAuthority & {
|
|
17
20
|
setPrice: (Ratio: any) => void;
|
|
21
|
+
disable: () => void;
|
|
18
22
|
};
|
|
19
23
|
export type ManualPriceAuthority = ReturnType<typeof makeManualPriceAuthority>;
|
|
24
|
+
import type { PriceAuthority } from '@agoric/zoe/tools/types.js';
|
|
20
25
|
//# sourceMappingURL=manualPriceAuthority.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manualPriceAuthority.d.ts","sourceRoot":"","sources":["manualPriceAuthority.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"manualPriceAuthority.d.ts","sourceRoot":"","sources":["manualPriceAuthority.js"],"names":[],"mappings":"AAaA;;GAEG;AAEH;;;;;;;;GAQG;AACH;IAPiC,aAAa,EAAnC,KAAK,CAAC,KAAK,CAAC;IACU,cAAc,EAApC,KAAK,CAAC,KAAK,CAAC;IACG,YAAY,EAA3B,KAAK;IACwC,KAAK,EAAlD,OAAO,cAAc,EAAE,YAAY;IACR,cAAc;;cACV,CAAC,KAAK,KAAA,KAAK,IAAI;aAAW,MAAM,IAAI;EA8E7E;mCACa,UAAU,CAAC,OAAO,wBAAwB,CAAC;oCAzFoC,4BAA4B"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
// @jessie-check
|
|
2
|
+
/* eslint @typescript-eslint/no-floating-promises: "warn" */
|
|
2
3
|
|
|
3
4
|
import { AmountMath, makeIssuerKit, AssetKind } from '@agoric/ertp';
|
|
4
5
|
import { E } from '@endo/eventual-send';
|
|
@@ -10,14 +11,18 @@ import {
|
|
|
10
11
|
floorDivideBy,
|
|
11
12
|
} from '../src/contractSupport/index.js';
|
|
12
13
|
|
|
14
|
+
/**
|
|
15
|
+
* @import {PriceAuthority, PriceDescription, PriceQuote, PriceQuoteValue, PriceQuery,} from '@agoric/zoe/tools/types.js';
|
|
16
|
+
*/
|
|
17
|
+
|
|
13
18
|
/**
|
|
14
19
|
* @param {object} options
|
|
15
20
|
* @param {Brand<'nat'>} options.actualBrandIn
|
|
16
21
|
* @param {Brand<'nat'>} options.actualBrandOut
|
|
17
22
|
* @param {Ratio} options.initialPrice
|
|
18
|
-
* @param {import('@agoric/time
|
|
23
|
+
* @param {import('@agoric/time').TimerService} options.timer
|
|
19
24
|
* @param {IssuerKit<'set'>} [options.quoteIssuerKit]
|
|
20
|
-
* @returns {PriceAuthority & { setPrice: (Ratio) => void }}
|
|
25
|
+
* @returns {PriceAuthority & { setPrice: (Ratio) => void; disable: () => void }}
|
|
21
26
|
*/
|
|
22
27
|
export function makeManualPriceAuthority(options) {
|
|
23
28
|
const {
|
|
@@ -31,6 +36,7 @@ export function makeManualPriceAuthority(options) {
|
|
|
31
36
|
|
|
32
37
|
/** @type {Ratio} */
|
|
33
38
|
let currentPrice = initialPrice;
|
|
39
|
+
let disabled = false;
|
|
34
40
|
|
|
35
41
|
const { notifier, updater } = makeNotifierKit();
|
|
36
42
|
updater.updateState(currentPrice);
|
|
@@ -51,6 +57,9 @@ export function makeManualPriceAuthority(options) {
|
|
|
51
57
|
};
|
|
52
58
|
|
|
53
59
|
function createQuote(priceQuery) {
|
|
60
|
+
if (disabled) {
|
|
61
|
+
throw Error('disabled');
|
|
62
|
+
}
|
|
54
63
|
const quote = priceQuery(calcAmountOut, calcAmountIn);
|
|
55
64
|
if (!quote) {
|
|
56
65
|
return undefined;
|
|
@@ -85,6 +94,10 @@ export function makeManualPriceAuthority(options) {
|
|
|
85
94
|
updater.updateState(currentPrice);
|
|
86
95
|
fireTriggers(createQuote);
|
|
87
96
|
},
|
|
97
|
+
disable: () => {
|
|
98
|
+
disabled = true;
|
|
99
|
+
updater.updateState(false);
|
|
100
|
+
},
|
|
88
101
|
...priceAuthority,
|
|
89
102
|
});
|
|
90
103
|
}
|
package/tools/manualTimer.d.ts
CHANGED
|
@@ -1,44 +1,25 @@
|
|
|
1
|
-
export
|
|
1
|
+
export function buildZoeManualTimer(log?: ((...args: any[]) => void) | undefined, startValue?: import("@agoric/time").Timestamp | undefined, options?: ZoeManualTimerOptions | undefined): ZoeManualTimer;
|
|
2
|
+
export default buildZoeManualTimer;
|
|
2
3
|
export type ZoeManualTimerOptions = {
|
|
3
|
-
timeStep?: import(
|
|
4
|
+
timeStep?: import("@agoric/time").RelativeTime | bigint;
|
|
4
5
|
eventLoopIteration?: () => Promise<void>;
|
|
5
6
|
};
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
* to execute their callbacks.
|
|
25
|
-
*
|
|
26
|
-
* The following will wait for all such Promise activity to finish
|
|
27
|
-
* before returning from `tick()`:
|
|
28
|
-
*
|
|
29
|
-
* eventLoopIteration = () => new Promise(setImmediate);
|
|
30
|
-
* mt = buildManualTimer(log, startTime, { eventLoopIteration })
|
|
31
|
-
*
|
|
32
|
-
* `tickN(count)` calls `tick()` multiple times, awaiting each one
|
|
33
|
-
*
|
|
34
|
-
* The first argument is called to log 'tick' events, which might help
|
|
35
|
-
* with "golden transcript" -style tests to distinguish tick
|
|
36
|
-
* boundaries
|
|
37
|
-
*
|
|
38
|
-
* @param {(...args: any[]) => void} [log]
|
|
39
|
-
* @param {import('@agoric/time/src/types').Timestamp | bigint} [startValue=0n]
|
|
40
|
-
* @param {ZoeManualTimerOptions} [options]
|
|
41
|
-
* @returns {ManualTimer}
|
|
42
|
-
*/
|
|
43
|
-
declare function buildManualTimer(log?: ((...args: any[]) => void) | undefined, startValue?: import("@agoric/time/src/types").Timestamp | undefined, options?: ZoeManualTimerOptions | undefined): ManualTimer;
|
|
7
|
+
export type ManualTimerAdmin = {
|
|
8
|
+
/**
|
|
9
|
+
* Advance the timer by one tick.
|
|
10
|
+
* DEPRECATED: use `await tickN(1)` instead. `tick` function errors might be
|
|
11
|
+
* thrown synchronously, even though success is signaled by returning anything
|
|
12
|
+
* other than a rejected promise.
|
|
13
|
+
*/
|
|
14
|
+
tick: (msg?: string) => void | Promise<void>;
|
|
15
|
+
tickN: (nTimes: number, msg?: string) => Promise<void>;
|
|
16
|
+
};
|
|
17
|
+
export type ZoeManualTimer = TimerServiceI & RemotableObject<"TimerService"> & RemotableBrand<{}, TimerServiceI> & {
|
|
18
|
+
advanceTo: (when: import("@agoric/time").Timestamp, msg?: string) => bigint;
|
|
19
|
+
advanceBy: (rel: import("@agoric/time").RelativeTime, msg?: string) => bigint;
|
|
20
|
+
} & RemotableBrand<ManualTimerAdmin, TimerServiceI & ManualTimerAdmin> & ManualTimerAdmin;
|
|
21
|
+
import { buildManualTimer } from '@agoric/swingset-vat/tools/manual-timer.js';
|
|
22
|
+
import type { TimerServiceI } from '@agoric/time';
|
|
23
|
+
import type { RemotableObject } from '@endo/pass-style';
|
|
24
|
+
import type { RemotableBrand } from '@endo/eventual-send';
|
|
44
25
|
//# sourceMappingURL=manualTimer.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"manualTimer.d.ts","sourceRoot":"","sources":["manualTimer.js"],"names":[],"mappings":";
|
|
1
|
+
{"version":3,"file":"manualTimer.d.ts","sourceRoot":"","sources":["manualTimer.js"],"names":[],"mappings":"AA0EO,qDANc,GAAG,EAAE,KAAK,IAAI,wHAGtB,cAAc,CAsD1B;;oCA5GY;IACZ,QAAW,CAAC,EAAE,OAAO,cAAc,EAAE,YAAY,GAAG,MAAM,CAAC;IAC3D,kBAAqB,CAAC,EAAE,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC;CACzC;;;;;;;;UAOU,CAAC,GAAG,CAAC,EAAE,MAAM,KAAK,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;WAItC,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC;;;;qBAsCF,OAAQ,cACxD,EAAE,YAAY;;iCApEQ,4CAA4C;mCAI7C,cAAc;qCACZ,kBAAkB;oCACnB,qBAAqB"}
|
package/tools/manualTimer.js
CHANGED
|
@@ -1,10 +1,13 @@
|
|
|
1
1
|
import { Far } from '@endo/marshal';
|
|
2
2
|
import { bindAllMethods } from '@agoric/internal';
|
|
3
|
-
import { buildManualTimer
|
|
3
|
+
import { buildManualTimer } from '@agoric/swingset-vat/tools/manual-timer.js';
|
|
4
4
|
import { TimeMath } from '@agoric/time';
|
|
5
5
|
|
|
6
|
-
|
|
7
|
-
import '
|
|
6
|
+
/**
|
|
7
|
+
* @import {TimerServiceI} from '@agoric/time';
|
|
8
|
+
* @import {RemotableObject} from '@endo/pass-style';
|
|
9
|
+
* @import {RemotableBrand} from '@endo/eventual-send';
|
|
10
|
+
*/
|
|
8
11
|
|
|
9
12
|
const { Fail } = assert;
|
|
10
13
|
|
|
@@ -13,13 +16,24 @@ const { Fail } = assert;
|
|
|
13
16
|
|
|
14
17
|
/**
|
|
15
18
|
* @typedef {{
|
|
16
|
-
* timeStep?: import('@agoric/time
|
|
19
|
+
* timeStep?: import('@agoric/time').RelativeTime | bigint,
|
|
17
20
|
* eventLoopIteration?: () => Promise<void>,
|
|
18
21
|
* }} ZoeManualTimerOptions
|
|
19
22
|
*/
|
|
20
23
|
|
|
21
24
|
const nolog = (..._args) => {};
|
|
22
25
|
|
|
26
|
+
/**
|
|
27
|
+
* @typedef {object} ManualTimerAdmin
|
|
28
|
+
* @property {(msg?: string) => void | Promise<void>} tick Advance the timer by one tick.
|
|
29
|
+
* DEPRECATED: use `await tickN(1)` instead. `tick` function errors might be
|
|
30
|
+
* thrown synchronously, even though success is signaled by returning anything
|
|
31
|
+
* other than a rejected promise.
|
|
32
|
+
* @property {(nTimes: number, msg?: string) => Promise<void>} tickN
|
|
33
|
+
*/
|
|
34
|
+
|
|
35
|
+
/** @typedef {ReturnType<typeof buildManualTimer> & RemotableBrand<ManualTimerAdmin, TimerServiceI & ManualTimerAdmin> & ManualTimerAdmin} ZoeManualTimer */
|
|
36
|
+
|
|
23
37
|
/**
|
|
24
38
|
* A fake TimerService, for unit tests that do not use a real
|
|
25
39
|
* kernel. You can make time pass by calling `advanceTo(when)`, or one
|
|
@@ -53,12 +67,16 @@ const nolog = (..._args) => {};
|
|
|
53
67
|
* boundaries
|
|
54
68
|
*
|
|
55
69
|
* @param {(...args: any[]) => void} [log]
|
|
56
|
-
* @param {import('@agoric/time
|
|
70
|
+
* @param {import('@agoric/time').Timestamp | bigint} [startValue=0n]
|
|
57
71
|
* @param {ZoeManualTimerOptions} [options]
|
|
58
|
-
* @returns {
|
|
72
|
+
* @returns {ZoeManualTimer}
|
|
59
73
|
*/
|
|
60
74
|
|
|
61
|
-
const
|
|
75
|
+
export const buildZoeManualTimer = (
|
|
76
|
+
log = nolog,
|
|
77
|
+
startValue = 0n,
|
|
78
|
+
options = {},
|
|
79
|
+
) => {
|
|
62
80
|
const { timeStep = 1n, eventLoopIteration, ...buildOptions } = options;
|
|
63
81
|
const optSuffix = msg => (msg ? `: ${msg}` : '');
|
|
64
82
|
const callbacks = {
|
|
@@ -76,7 +94,7 @@ const buildManualTimer = (log = nolog, startValue = 0n, options = {}) => {
|
|
|
76
94
|
assert.typeof(startValue, 'bigint');
|
|
77
95
|
assert.typeof(timeStepValue, 'bigint');
|
|
78
96
|
|
|
79
|
-
const timerService =
|
|
97
|
+
const timerService = buildManualTimer({
|
|
80
98
|
startTime: startValue,
|
|
81
99
|
...buildOptions,
|
|
82
100
|
callbacks,
|
|
@@ -94,23 +112,19 @@ const buildManualTimer = (log = nolog, startValue = 0n, options = {}) => {
|
|
|
94
112
|
|
|
95
113
|
const tickN = async (nTimes, msg) => {
|
|
96
114
|
nTimes >= 1 || Fail`invariant nTimes >= 1`;
|
|
115
|
+
await null;
|
|
97
116
|
for (let i = 0; i < nTimes; i += 1) {
|
|
98
|
-
// eslint-disable-next-line no-await-in-loop
|
|
99
117
|
await tick(msg);
|
|
100
118
|
}
|
|
101
119
|
};
|
|
102
120
|
|
|
103
|
-
const setWakeup = (when, handler, cancelToken) => {
|
|
104
|
-
return timerService.setWakeup(when, handler, cancelToken);
|
|
105
|
-
};
|
|
106
|
-
|
|
107
121
|
return Far('ManualTimer', {
|
|
108
122
|
...bindAllMethods(timerService),
|
|
109
123
|
tick,
|
|
110
124
|
tickN,
|
|
111
|
-
setWakeup,
|
|
112
125
|
});
|
|
113
126
|
};
|
|
114
|
-
harden(
|
|
127
|
+
harden(buildZoeManualTimer);
|
|
115
128
|
|
|
116
|
-
export
|
|
129
|
+
// Default export is for backwards compatibility
|
|
130
|
+
export default buildZoeManualTimer;
|
|
@@ -10,15 +10,15 @@
|
|
|
10
10
|
*
|
|
11
11
|
* @param {Record<string, any>} script
|
|
12
12
|
* @param {Installation<import('../src/contracts/oracle.js').OracleStart>} oracleInstallation
|
|
13
|
-
* @param {import('@agoric/time
|
|
13
|
+
* @param {import('@agoric/time').TimerService} timer
|
|
14
14
|
* @param {ZoeService} zoe
|
|
15
15
|
* @param {Issuer} feeIssuer
|
|
16
16
|
*/
|
|
17
|
-
export function makeScriptedOracle(script: Record<string, any>, oracleInstallation: Installation<import(
|
|
17
|
+
export function makeScriptedOracle(script: Record<string, any>, oracleInstallation: Installation<import("../src/contracts/oracle.js").OracleStart>, timer: import("@agoric/time").TimerService, zoe: ZoeService, feeIssuer: Issuer): Promise<{
|
|
18
18
|
publicFacet: {
|
|
19
19
|
query(query: OracleQuery): Promise<unknown>;
|
|
20
20
|
makeQueryInvitation(query: OracleQuery): Promise<Invitation<unknown, never>>;
|
|
21
|
-
} & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
21
|
+
} & import("@endo/marshal").RemotableObject<`Alleged: ${string}`> & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
22
22
|
query(query: OracleQuery): Promise<unknown>;
|
|
23
23
|
makeQueryInvitation(query: OracleQuery): Promise<Invitation<unknown, never>>;
|
|
24
24
|
}>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scriptedOracle.d.ts","sourceRoot":"","sources":["scriptedOracle.js"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AACH,2CANW,
|
|
1
|
+
{"version":3,"file":"scriptedOracle.d.ts","sourceRoot":"","sources":["scriptedOracle.js"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AACH,2CANW,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,sBACnB,YAAY,CAAC,OAAO,4BAA4B,EAAE,WAAW,CAAC,SAC9D,OAAO,cAAc,EAAE,YAAY,OACnC,UAAU,aACV,MAAM;;qBAiCH,WACP;mCAIib,WAAW;;;;;;GADlc"}
|
package/tools/scriptedOracle.js
CHANGED
|
@@ -14,7 +14,7 @@ import { Far } from '@endo/marshal';
|
|
|
14
14
|
*
|
|
15
15
|
* @param {Record<string, any>} script
|
|
16
16
|
* @param {Installation<import('../src/contracts/oracle.js').OracleStart>} oracleInstallation
|
|
17
|
-
* @param {import('@agoric/time
|
|
17
|
+
* @param {import('@agoric/time').TimerService} timer
|
|
18
18
|
* @param {ZoeService} zoe
|
|
19
19
|
* @param {Issuer} feeIssuer
|
|
20
20
|
*/
|
|
@@ -1,2 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @import {PriceAuthority, PriceDescription, PriceQuote, PriceQuoteValue, PriceQuery,} from '@agoric/zoe/tools/types.js';
|
|
3
|
+
*/
|
|
1
4
|
export function makeScriptedPriceAuthority(options: any): PriceAuthority;
|
|
5
|
+
import type { PriceAuthority } from '@agoric/zoe/tools/types.js';
|
|
2
6
|
//# sourceMappingURL=scriptedPriceAuthority.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scriptedPriceAuthority.d.ts","sourceRoot":"","sources":["scriptedPriceAuthority.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"scriptedPriceAuthority.d.ts","sourceRoot":"","sources":["scriptedPriceAuthority.js"],"names":[],"mappings":"AAWA;;GAEG;AAEH,yEAoFC;oCAvF4F,4BAA4B"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
/* eslint @typescript-eslint/no-floating-promises: "warn" */
|
|
1
2
|
import { AmountMath, makeIssuerKit, AssetKind } from '@agoric/ertp';
|
|
2
3
|
import { E } from '@endo/eventual-send';
|
|
3
4
|
import { Far } from '@endo/marshal';
|
|
@@ -8,6 +9,10 @@ import {
|
|
|
8
9
|
makeOnewayPriceAuthorityKit,
|
|
9
10
|
} from '../src/contractSupport/index.js';
|
|
10
11
|
|
|
12
|
+
/**
|
|
13
|
+
* @import {PriceAuthority, PriceDescription, PriceQuote, PriceQuoteValue, PriceQuery,} from '@agoric/zoe/tools/types.js';
|
|
14
|
+
*/
|
|
15
|
+
|
|
11
16
|
export function makeScriptedPriceAuthority(options) {
|
|
12
17
|
const {
|
|
13
18
|
actualBrandIn,
|
|
@@ -64,7 +69,7 @@ export function makeScriptedPriceAuthority(options) {
|
|
|
64
69
|
);
|
|
65
70
|
}
|
|
66
71
|
|
|
67
|
-
/** @type {ERef<Notifier<import('@agoric/time
|
|
72
|
+
/** @type {ERef<Notifier<import('@agoric/time').Timestamp>>} */
|
|
68
73
|
const notifier = E(timer).makeNotifier(0n, quoteInterval);
|
|
69
74
|
const priceAuthorityOptions = harden({
|
|
70
75
|
timer,
|
package/tools/setup-zoe.d.ts
CHANGED
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
export function makeZoeKitForTest(vatAdminSvc?:
|
|
1
|
+
export function makeZoeKitForTest(vatAdminSvc?: VatAdminSvc | undefined): {
|
|
2
2
|
zoeService: ZoeService;
|
|
3
|
-
zoeConfigFacet: {
|
|
4
|
-
updateZcfBundleId(bundleId: any): void;
|
|
5
|
-
} & import("@endo/eventual-send").RemotableBrand<{}, {
|
|
3
|
+
zoeConfigFacet: import("@endo/exo").Guarded<{
|
|
6
4
|
updateZcfBundleId(bundleId: any): void;
|
|
7
5
|
}>;
|
|
8
6
|
feeMintAccess: FeeMintAccess;
|
|
9
|
-
setVatAdminService: ((lateVatAdminSvc: any) => void) & import("@endo/eventual-send").RemotableBrand<{}, (lateVatAdminSvc: any) => void>;
|
|
7
|
+
setVatAdminService: ((lateVatAdminSvc: any) => void) & import("@endo/captp").RemotableObject<`Alleged: ${string}`> & import("@endo/eventual-send").RemotableBrand<{}, (lateVatAdminSvc: any) => void>;
|
|
10
8
|
};
|
|
11
|
-
export function makeZoeForTest(vatAdminSvc?:
|
|
9
|
+
export function makeZoeForTest(vatAdminSvc?: VatAdminSvc | undefined): ZoeService;
|
|
12
10
|
export function setUpZoeForTest<T extends unknown = unknown>({ setJig, feeIssuerConfig, vatAdminSvc, useNearRemote, }?: {
|
|
13
11
|
setJig?: ((jig: T) => void) | undefined;
|
|
14
12
|
feeIssuerConfig?: FeeIssuerConfig | undefined;
|
|
15
|
-
vatAdminSvc?:
|
|
13
|
+
vatAdminSvc?: VatAdminSvc | undefined;
|
|
16
14
|
useNearRemote?: boolean | undefined;
|
|
17
15
|
}): Promise<{
|
|
18
16
|
zoe: ZoeService;
|
|
19
17
|
feeMintAccessP: FeeMintAccess;
|
|
20
|
-
|
|
18
|
+
bundleAndInstall: (path: string) => Promise<Installation>;
|
|
19
|
+
vatAdminSvc: VatAdminSvc;
|
|
21
20
|
vatAdminState: {
|
|
22
21
|
getExitMessage: () => any;
|
|
23
22
|
getHasExited: () => boolean;
|
|
@@ -27,7 +26,7 @@ export function setUpZoeForTest<T extends unknown = unknown>({ setJig, feeIssuer
|
|
|
27
26
|
getCriticalVatKey: () => {};
|
|
28
27
|
getVatPowers: () => {
|
|
29
28
|
D: (bcap: any) => {
|
|
30
|
-
getBundle: () =>
|
|
29
|
+
getBundle: () => EndoZipBase64Bundle;
|
|
31
30
|
};
|
|
32
31
|
};
|
|
33
32
|
} | undefined;
|
package/tools/setup-zoe.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"setup-zoe.d.ts","sourceRoot":"","sources":["setup-zoe.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"setup-zoe.d.ts","sourceRoot":"","sources":["setup-zoe.js"],"names":[],"mappings":"AAUO;;;;;;;EAKN;AAKM,kFACoC;AAYpC,gCALU,CAAC;IAAoB,MAAM,UAA3B,CAAC,KAAK,IAAI;IACU,eAAe;IACnB,WAAW;IACf,aAAa;;;;6BA2B7B,MAAM,KACJ,OAAO,CAAC,YAAY,CAAC;;;;;;;;;;;;;;;GAiBnC"}
|
package/tools/setup-zoe.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { makeLoopback } from '@endo/captp';
|
|
1
|
+
import { E, makeLoopback } from '@endo/captp';
|
|
2
2
|
|
|
3
3
|
import { makeScalarBigMapStore } from '@agoric/vat-data';
|
|
4
|
+
import bundleSource from '@endo/bundle-source';
|
|
4
5
|
import { makeDurableZoeKit } from '../src/zoeService/zoe.js';
|
|
5
6
|
import fakeVatAdmin, { makeFakeVatAdmin } from './fakeVatAdmin.js';
|
|
6
7
|
|
|
@@ -53,9 +54,23 @@ export const setUpZoeForTest = async ({
|
|
|
53
54
|
zoeBaggage: makeScalarBigMapStore('zoe baggage', { durable: true }),
|
|
54
55
|
}),
|
|
55
56
|
);
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* @param {string} path
|
|
60
|
+
* @returns {Promise<Installation>}
|
|
61
|
+
*/
|
|
62
|
+
const bundleAndInstall = async path => {
|
|
63
|
+
const bundle = await bundleSource(path);
|
|
64
|
+
const id = `b1-${path}`;
|
|
65
|
+
assert(vatAdminState, 'installBundle called before vatAdminState defined');
|
|
66
|
+
vatAdminState.installBundle(id, bundle);
|
|
67
|
+
return E(zoeService).installBundleID(id);
|
|
68
|
+
};
|
|
69
|
+
|
|
56
70
|
return {
|
|
57
71
|
zoe: zoeService,
|
|
58
72
|
feeMintAccessP: feeMintAccess,
|
|
73
|
+
bundleAndInstall,
|
|
59
74
|
vatAdminSvc,
|
|
60
75
|
vatAdminState,
|
|
61
76
|
};
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
export function withAmountUtils(kit: Pick<IssuerKit<"nat">, "brand" | "issuer" | "mint">): {
|
|
2
|
+
/** @param {NatValue} v */
|
|
3
|
+
make: (v: NatValue) => import("@agoric/ertp/src/types.js").NatAmount;
|
|
4
|
+
makeEmpty: () => import("@agoric/ertp/src/types.js").NatAmount;
|
|
5
|
+
/**
|
|
6
|
+
* @param {NatValue} n
|
|
7
|
+
* @param {NatValue} [d]
|
|
8
|
+
*/
|
|
9
|
+
makeRatio: (n: NatValue, d?: bigint | undefined) => Ratio;
|
|
10
|
+
/** @param {number} n */
|
|
11
|
+
units: (n: number) => import("@agoric/ertp/src/types.js").NatAmount;
|
|
12
|
+
/** The intact Exo remotable */
|
|
13
|
+
issuerKit: Pick<globalThis.IssuerKit<"nat">, "brand" | "issuer" | "mint">;
|
|
14
|
+
brand: globalThis.Brand<"nat">;
|
|
15
|
+
issuer: globalThis.Issuer<"nat", import("@endo/patterns").Key>;
|
|
16
|
+
mint: globalThis.Mint<"nat", import("@endo/patterns").Key>;
|
|
17
|
+
};
|
|
18
|
+
export { makeFakeStorageKit } from "@agoric/internal/src/storage-test-utils.js";
|
|
19
|
+
export type AmountUtils = ReturnType<typeof withAmountUtils>;
|
|
20
|
+
//# sourceMappingURL=test-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"test-utils.d.ts","sourceRoot":"","sources":["test-utils.js"],"names":[],"mappings":"AAIO,qCADK,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,EAAE,OAAO,GAAG,QAAQ,GAAG,MAAM,CAAC;IAK3D,0BAA0B;cAAd,QAAQ;;IAGpB;;;OAGG;mBAFQ,QAAQ;IAInB,wBAAwB;eAAZ,MAAM;IAGlB,+BAA+B;;;;;EAGlC;;0BACa,UAAU,CAAC,OAAO,eAAe,CAAC"}
|