@agoric/zoe 0.26.3-dev-82cced2.0 → 0.26.3-dev-354c092.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@agoric/zoe",
3
- "version": "0.26.3-dev-82cced2.0+82cced2",
3
+ "version": "0.26.3-dev-354c092.0+354c092",
4
4
  "description": "Zoe: the Smart Contract Framework for Offer Enforcement",
5
5
  "type": "module",
6
6
  "main": "./src/zoeService/zoe.js",
@@ -43,15 +43,15 @@
43
43
  },
44
44
  "homepage": "https://github.com/Agoric/agoric-sdk#readme",
45
45
  "dependencies": {
46
- "@agoric/assert": "0.6.1-dev-82cced2.0+82cced2",
47
- "@agoric/ertp": "0.16.3-dev-82cced2.0+82cced2",
48
- "@agoric/internal": "0.3.3-dev-82cced2.0+82cced2",
49
- "@agoric/notifier": "0.6.3-dev-82cced2.0+82cced2",
50
- "@agoric/store": "0.9.3-dev-82cced2.0+82cced2",
51
- "@agoric/swingset-liveslots": "0.10.3-dev-82cced2.0+82cced2",
52
- "@agoric/swingset-vat": "0.32.3-dev-82cced2.0+82cced2",
53
- "@agoric/time": "0.3.3-dev-82cced2.0+82cced2",
54
- "@agoric/vat-data": "0.5.3-dev-82cced2.0+82cced2",
46
+ "@agoric/assert": "0.6.1-dev-354c092.0+354c092",
47
+ "@agoric/ertp": "0.16.3-dev-354c092.0+354c092",
48
+ "@agoric/internal": "0.3.3-dev-354c092.0+354c092",
49
+ "@agoric/notifier": "0.6.3-dev-354c092.0+354c092",
50
+ "@agoric/store": "0.9.3-dev-354c092.0+354c092",
51
+ "@agoric/swingset-liveslots": "0.10.3-dev-354c092.0+354c092",
52
+ "@agoric/swingset-vat": "0.32.3-dev-354c092.0+354c092",
53
+ "@agoric/time": "0.3.3-dev-354c092.0+354c092",
54
+ "@agoric/vat-data": "0.5.3-dev-354c092.0+354c092",
55
55
  "@endo/bundle-source": "^2.7.0",
56
56
  "@endo/captp": "^3.1.4",
57
57
  "@endo/eventual-send": "^0.17.5",
@@ -64,7 +64,7 @@
64
64
  "yargs-parser": "^21.1.1"
65
65
  },
66
66
  "devDependencies": {
67
- "@agoric/kmarshal": "0.1.1-dev-82cced2.0+82cced2",
67
+ "@agoric/kmarshal": "0.1.1-dev-354c092.0+354c092",
68
68
  "@endo/init": "^0.5.59",
69
69
  "ava": "^5.3.0",
70
70
  "c8": "^7.13.0",
@@ -137,5 +137,5 @@
137
137
  "typeCoverage": {
138
138
  "atLeast": 81.5
139
139
  },
140
- "gitHead": "82cced2187816b38afb7f21b474de1517b4f7422"
140
+ "gitHead": "354c09254ac91e9dc97ca97f6bef291b2cafabb6"
141
141
  }
@@ -1,6 +1,4 @@
1
1
  /* eslint @typescript-eslint/no-floating-promises: "warn" */
2
- /// <reference types="@agoric/time/src/types.d.ts" />
3
-
4
2
  import { E } from '@endo/eventual-send';
5
3
  import { Far } from '@endo/marshal';
6
4
  import { assert, q, Fail } from '@agoric/assert';
@@ -64,7 +62,7 @@ export const PriceAuthorityI = M.interface('PriceAuthority', {
64
62
  * @param {object} opts
65
63
  * @param {Issuer<'set'>} opts.quoteIssuer
66
64
  * @param {ERef<Notifier<unknown>>} opts.notifier
67
- * @param {ERef<import('@agoric/time/src/types').TimerService>} opts.timer
65
+ * @param {ERef<import('@agoric/time').TimerService>} opts.timer
68
66
  * @param {PriceQuoteCreate} opts.createQuote
69
67
  * @param {Brand<'nat'>} opts.actualBrandIn
70
68
  * @param {Brand<'nat'>} opts.actualBrandOut
@@ -10,7 +10,7 @@ import { makeNotifier } from '@agoric/notifier';
10
10
  * @param {Brand<'set'>} quoteBrand
11
11
  * @param {Amount<'nat'>} amountIn
12
12
  * @param {Amount<'nat'>} amountOut
13
- * @param {ERef<import('@agoric/time/src/types').TimerService>} timer
13
+ * @param {ERef<import('@agoric/time').TimerService>} timer
14
14
  * @param {import('@agoric/time').Timestamp} timestamp
15
15
  * @param {ERef<Mint<'set'>>} quoteMint
16
16
  * @returns {Promise<PriceQuote>}
@@ -25,7 +25,7 @@ export const getPriceDescription = quote => {
25
25
  export const getAmountIn = quote => getPriceDescription(quote).amountIn;
26
26
  /** @param {PriceQuote} quote */
27
27
  export const getAmountOut = quote => getPriceDescription(quote).amountOut;
28
- /** @type {(quote: PriceQuote) => import('@agoric/time/src/types').Timestamp} */
28
+ /** @type {(quote: PriceQuote) => import('@agoric/time').Timestamp} */
29
29
  export const getTimestamp = quote => getPriceDescription(quote).timestamp;
30
30
 
31
31
  /** @param {Brand<'nat'>} brand */
@@ -37,7 +37,7 @@ const SECOND_PRICE = 'second-price';
37
37
  * null } want: { Asset: null } }.
38
38
  *
39
39
  * @param {ZCF<{
40
- * timeAuthority: import('@agoric/time/src/types').TimerService,
40
+ * timeAuthority: import('@agoric/time').TimerService,
41
41
  * winnerPriceOption?: FIRST_PRICE | SECOND_PRICE,
42
42
  * bidDuration: bigint,
43
43
  * }>} zcf
@@ -1,5 +1,5 @@
1
1
  /**
2
- * @typedef {Notifier<import('@agoric/time/src/types').TimestampRecord>} PeriodNotifier
2
+ * @typedef {Notifier<import('@agoric/time').TimestampRecord>} PeriodNotifier
3
3
  *
4
4
  * The Notifier that provides notifications that periods have passed.
5
5
  * Since notifiers can't be relied on to produce an output every time
@@ -35,7 +35,7 @@
35
35
  * The rate in basis points that will be multiplied with the debt on
36
36
  * every period to compound interest.
37
37
  *
38
- * @property {import('@agoric/time/src/types').RelativeTime} interestPeriod
38
+ * @property {import('@agoric/time').RelativeTime} interestPeriod
39
39
  *
40
40
  * @property {Brand} loanBrand
41
41
  * @property {Brand} collateralBrand
@@ -162,14 +162,14 @@
162
162
  * The AsyncIterable to notify when a period has occurred
163
163
  *
164
164
  * @property {Ratio} interestRate
165
- * @property {import('@agoric/time/src/types').RelativeTime} interestPeriod
165
+ * @property {import('@agoric/time').RelativeTime} interestPeriod
166
166
  *
167
167
  * the period at which the outstanding debt increases by the interestRate
168
168
  *
169
169
  * @property {ZCF} zcf
170
170
  *
171
171
  * @property {LoanConfigWithBorrowerMinusDebt} configMinusGetDebt
172
- * @property {import('@agoric/time/src/types').Timestamp} basetime The starting point from which to calculate
172
+ * @property {import('@agoric/time').Timestamp} basetime The starting point from which to calculate
173
173
  * interest.
174
174
  */
175
175
 
@@ -182,7 +182,7 @@
182
182
  * @property {PriceAuthority} priceAuthority
183
183
  * @property {PeriodNotifier} periodNotifier
184
184
  * @property {bigint} interestRate
185
- * @property {import('@agoric/time/src/types').RelativeTime} interestPeriod
185
+ * @property {import('@agoric/time').RelativeTime} interestPeriod
186
186
  * @property {ZCFSeat} lenderSeat
187
187
  */
188
188
 
@@ -205,7 +205,7 @@
205
205
  * triggered the liquidation. This may be lower than expected if the
206
206
  * price is moving quickly.
207
207
  *
208
- * @property {() => import('@agoric/time/src/types').Timestamp} getLastCalculationTimestamp
208
+ * @property {() => import('@agoric/time').Timestamp} getLastCalculationTimestamp
209
209
  *
210
210
  * Get the timestamp at which the debt was most recently recalculated.
211
211
  *
@@ -45,7 +45,7 @@ export const makeDebtCalculator = debtCalculatorConfig => {
45
45
  const config = { ...configMinusGetDebt, getDebt };
46
46
 
47
47
  const periodObserver = Far('periodObserver', {
48
- /** @type {(timestamp: import('@agoric/time/src/types.js').TimestampRecord) => void} */
48
+ /** @type {(timestamp: import('@agoric/time').TimestampRecord) => void} */
49
49
  updateState: timestamp => {
50
50
  let updatedLoan = false;
51
51
  // we could calculate the number of required updates and multiply by a power
@@ -58,7 +58,7 @@ const start = zcf => {
58
58
  *
59
59
  * @param {AmountKeywordRecord} price
60
60
  * @param {AmountKeywordRecord} assets
61
- * @param {Timer} timeAuthority
61
+ * @param {import('@agoric/time').TimerService} timeAuthority
62
62
  * @param {any} deadline
63
63
  * @returns {Promise<Payment>}
64
64
  */
@@ -1,6 +1,4 @@
1
1
  /* eslint @typescript-eslint/no-floating-promises: "warn" */
2
- /// <reference types="@agoric/time/src/types.d.ts" />
3
-
4
2
  import { Fail, q } from '@agoric/assert';
5
3
  import { AmountMath, AssetKind, makeIssuerKit } from '@agoric/ertp';
6
4
  import { assertAllDefined } from '@agoric/internal';
@@ -53,7 +51,7 @@ const priceDescriptionFromQuote = quote => quote.quoteAmount.value[0];
53
51
  * is a stub until we complete what is now in `fluxAggregatorKit.js`.
54
52
  *
55
53
  * @param {ZCF<{
56
- * timer: import('@agoric/time/src/types').TimerService,
54
+ * timer: import('@agoric/time').TimerService,
57
55
  * POLL_INTERVAL: bigint,
58
56
  * brandIn: Brand<'nat'>,
59
57
  * brandOut: Brand<'nat'>,
@@ -127,7 +125,7 @@ const start = async (zcf, privateArgs) => {
127
125
 
128
126
  /**
129
127
  * @typedef {object} OracleRecord
130
- * @property {(timestamp: import('@agoric/time/src/types').Timestamp) => Promise<void>} [querier]
128
+ * @property {(timestamp: import('@agoric/time').Timestamp) => Promise<void>} [querier]
131
129
  * @property {Ratio} lastSample
132
130
  * @property {OracleKey} oracleKey
133
131
  */
@@ -144,7 +142,7 @@ const start = async (zcf, privateArgs) => {
144
142
 
145
143
  // Wake every POLL_INTERVAL and run the queriers.
146
144
  const repeaterP = E(timer).makeRepeater(0n, POLL_INTERVAL);
147
- /** @type {import('@agoric/time/src/types').TimerWaker} */
145
+ /** @type {import('@agoric/time').TimerWaker} */
148
146
  const waker = Far('waker', {
149
147
  async wake(timestamp) {
150
148
  // Run all the queriers.
@@ -167,7 +165,7 @@ const start = async (zcf, privateArgs) => {
167
165
  /**
168
166
  * @param {object} param0
169
167
  * @param {Ratio} [param0.overridePrice]
170
- * @param {import('@agoric/time/src/types').TimestampRecord} [param0.timestamp]
168
+ * @param {import('@agoric/time').TimestampRecord} [param0.timestamp]
171
169
  */
172
170
  const makeCreateQuote = ({ overridePrice, timestamp } = {}) =>
173
171
  /**
@@ -259,7 +257,7 @@ const start = async (zcf, privateArgs) => {
259
257
  );
260
258
 
261
259
  /**
262
- * @param {import('@agoric/time/src/types').Timestamp} timestamp
260
+ * @param {import('@agoric/time').Timestamp} timestamp
263
261
  */
264
262
  const updateQuote = async timestamp => {
265
263
  timestamp = TimeMath.coerceTimestampRecord(timestamp, timerBrand);
@@ -593,11 +591,11 @@ const start = async (zcf, privateArgs) => {
593
591
  const oracle = await E(zoe).getPublicFacet(oracleInstance);
594
592
  assert(records.has(record), 'Oracle record is already deleted');
595
593
 
596
- /** @type {import('@agoric/time/src/types').Timestamp} */
594
+ /** @type {import('@agoric/time').Timestamp} */
597
595
  let lastWakeTimestamp = 0n;
598
596
 
599
597
  /**
600
- * @param {import('@agoric/time/src/types').Timestamp} timestamp
598
+ * @param {import('@agoric/time').Timestamp} timestamp
601
599
  */
602
600
  record.querier = async timestamp => {
603
601
  // Submit the query.
@@ -244,15 +244,6 @@
244
244
  * @property {() => void} wake
245
245
  */
246
246
 
247
- /**
248
- * @typedef {import('@agoric/time/src/types').Timestamp} Deadline
249
- */
250
-
251
- /**
252
- * @typedef {object} Timer
253
- * @property {(deadline: Deadline, wakerP: ERef<Waker>) => void} setWakeup
254
- */
255
-
256
247
  /**
257
248
  * @typedef {object} OnDemandExitRule
258
249
  * @property {null} onDemand
@@ -265,7 +256,7 @@
265
256
 
266
257
  /**
267
258
  * @typedef {object} AfterDeadlineExitRule
268
- * @property {{timer:Timer, deadline:Deadline}} afterDeadline
259
+ * @property {{timer: import('@agoric/time').TimerService, deadline: import('@agoric/time').Timestamp}} afterDeadline
269
260
  */
270
261
 
271
262
  /**
@@ -26,8 +26,8 @@ const timestampLTE = (a, b) => TimeMath.compareAbs(a, b) <= 0;
26
26
  * @property {Brand<'nat'>} actualBrandOut
27
27
  * @property {Array<number>} [priceList]
28
28
  * @property {Array<[number, number]>} [tradeList]
29
- * @property {ERef<import('@agoric/time/src/types').TimerService>} timer
30
- * @property {import('@agoric/time/src/types').RelativeTime} [quoteInterval]
29
+ * @property {ERef<import('@agoric/time').TimerService>} timer
30
+ * @property {import('@agoric/time').RelativeTime} [quoteInterval]
31
31
  * @property {ERef<Mint<'set'>>} [quoteMint]
32
32
  * @property {Amount<'nat'>} [unitAmountIn]
33
33
  */
@@ -84,7 +84,7 @@ export async function makeFakePriceAuthority(options) {
84
84
  const quoteBrand = await E(quoteIssuer).getBrand();
85
85
 
86
86
  /**
87
- * @type {NotifierRecord<import('@agoric/time/src/types').Timestamp>}
87
+ * @type {NotifierRecord<import('@agoric/time').Timestamp>}
88
88
  * We need to have a notifier driven by the
89
89
  * TimerService because if the timer pushes updates to individual
90
90
  * QuoteNotifiers, we have a dependency inversion and the timer can never know
@@ -104,7 +104,7 @@ export async function makeFakePriceAuthority(options) {
104
104
  *
105
105
  * @param {Amount<'nat'>} amountIn
106
106
  * @param {Brand} brandOut
107
- * @param {import('@agoric/time/src/types').Timestamp} quoteTime
107
+ * @param {import('@agoric/time').Timestamp} quoteTime
108
108
  * @returns {PriceQuote}
109
109
  */
110
110
  function priceInQuote(amountIn, brandOut, quoteTime) {
@@ -136,7 +136,7 @@ export async function makeFakePriceAuthority(options) {
136
136
  /**
137
137
  * @param {Brand<'nat'>} brandIn
138
138
  * @param {Amount<'nat'>} amountOut
139
- * @param {import('@agoric/time/src/types').Timestamp} quoteTime
139
+ * @param {import('@agoric/time').Timestamp} quoteTime
140
140
  * @returns {PriceQuote}
141
141
  */
142
142
  function priceOutQuote(brandIn, amountOut, quoteTime) {
@@ -158,7 +158,7 @@ export async function makeFakePriceAuthority(options) {
158
158
  let latestTick;
159
159
 
160
160
  // clients who are waiting for a specific timestamp
161
- /** @type { [when: import('@agoric/time/src/types').Timestamp, resolve: (quote: PriceQuote) => void][] } */
161
+ /** @type { [when: import('@agoric/time').Timestamp, resolve: (quote: PriceQuote) => void][] } */
162
162
  let timeClients = [];
163
163
 
164
164
  // Check if a comparison request has been satisfied.
@@ -10,5 +10,5 @@
10
10
  */
11
11
 
12
12
  /**
13
- * @typedef {import('@agoric/time/src/types').TimerService & ManualTimerAdmin} ManualTimer
13
+ * @typedef {import('@agoric/time').TimerService & ManualTimerAdmin} ManualTimer
14
14
  */
@@ -16,7 +16,7 @@ import {
16
16
  * @param {Brand<'nat'>} options.actualBrandIn
17
17
  * @param {Brand<'nat'>} options.actualBrandOut
18
18
  * @param {Ratio} options.initialPrice
19
- * @param {import('@agoric/time/src/types').TimerService} options.timer
19
+ * @param {import('@agoric/time').TimerService} options.timer
20
20
  * @param {IssuerKit<'set'>} [options.quoteIssuerKit]
21
21
  * @returns {PriceAuthority & { setPrice: (Ratio) => void }}
22
22
  */
@@ -13,7 +13,7 @@ const { Fail } = assert;
13
13
 
14
14
  /**
15
15
  * @typedef {{
16
- * timeStep?: import('@agoric/time/src/types').RelativeTime | bigint,
16
+ * timeStep?: import('@agoric/time').RelativeTime | bigint,
17
17
  * eventLoopIteration?: () => Promise<void>,
18
18
  * }} ZoeManualTimerOptions
19
19
  */
@@ -53,7 +53,7 @@ const nolog = (..._args) => {};
53
53
  * boundaries
54
54
  *
55
55
  * @param {(...args: any[]) => void} [log]
56
- * @param {import('@agoric/time/src/types').Timestamp | bigint} [startValue=0n]
56
+ * @param {import('@agoric/time').Timestamp | bigint} [startValue=0n]
57
57
  * @param {ZoeManualTimerOptions} [options]
58
58
  * @returns {ManualTimer}
59
59
  */
@@ -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/src/types').TimerService} timer
17
+ * @param {import('@agoric/time').TimerService} timer
18
18
  * @param {ZoeService} zoe
19
19
  * @param {Issuer} feeIssuer
20
20
  */
@@ -65,7 +65,7 @@ export function makeScriptedPriceAuthority(options) {
65
65
  );
66
66
  }
67
67
 
68
- /** @type {ERef<Notifier<import('@agoric/time/src/types').Timestamp>>} */
68
+ /** @type {ERef<Notifier<import('@agoric/time').Timestamp>>} */
69
69
  const notifier = E(timer).makeNotifier(0n, quoteInterval);
70
70
  const priceAuthorityOptions = harden({
71
71
  timer,
@@ -21,9 +21,9 @@
21
21
  * The amount supplied to a trade
22
22
  * @property {Amount<'nat'>} amountOut
23
23
  * The quoted result of trading `amountIn`
24
- * @property {import('@agoric/time/src/types').TimerService} timer
24
+ * @property {import('@agoric/time').TimerService} timer
25
25
  * The service that gave the `timestamp`
26
- * @property {import('@agoric/time/src/types').TimestampRecord} timestamp
26
+ * @property {import('@agoric/time').TimestampRecord} timestamp
27
27
  * A timestamp according to `timer` for the quote
28
28
  * @property {any} [conditions]
29
29
  * Additional conditions for the quote
@@ -68,7 +68,7 @@
68
68
  *
69
69
  * @property {(brandIn: Brand,
70
70
  * brandOut: Brand
71
- * ) => ERef<import('@agoric/time/src/types').TimerService>} getTimerService
71
+ * ) => ERef<import('@agoric/time').TimerService>} getTimerService
72
72
  * Get the timer used in PriceQuotes for a given brandIn/brandOut pair
73
73
  *
74
74
  * @property {(amountIn: Amount<'nat'>,
@@ -78,7 +78,7 @@
78
78
  * `amountIn`. The rate at which these are issued may be very different between
79
79
  * `priceAuthorities`.
80
80
  *
81
- * @property {(deadline: import('@agoric/time/src/types').Timestamp,
81
+ * @property {(deadline: import('@agoric/time').Timestamp,
82
82
  * amountIn: Amount<'nat'>,
83
83
  * brandOut: Brand<'nat'>
84
84
  * ) => Promise<PriceQuote>} quoteAtTime
@@ -146,7 +146,7 @@
146
146
  * @callback PriceQuery
147
147
  * @param {PriceCalculator} calcAmountIn
148
148
  * @param {PriceCalculator} calcAmountOut
149
- * @returns {{ amountIn: Amount<'nat'>, amountOut: Amount<'nat'>, timestamp?: import('@agoric/time/src/types').TimestampRecord } | undefined}
149
+ * @returns {{ amountIn: Amount<'nat'>, amountOut: Amount<'nat'>, timestamp?: import('@agoric/time').TimestampRecord } | undefined}
150
150
  */
151
151
 
152
152
  /**
package/tools/types.js CHANGED
@@ -22,9 +22,9 @@ export {};
22
22
  * The amount supplied to a trade
23
23
  * @property {Amount<'nat'>} amountOut
24
24
  * The quoted result of trading `amountIn`
25
- * @property {import('@agoric/time/src/types').TimerService} timer
25
+ * @property {import('@agoric/time').TimerService} timer
26
26
  * The service that gave the `timestamp`
27
- * @property {import('@agoric/time/src/types').TimestampRecord} timestamp
27
+ * @property {import('@agoric/time').TimestampRecord} timestamp
28
28
  * A timestamp according to `timer` for the quote
29
29
  * @property {any} [conditions]
30
30
  * Additional conditions for the quote
@@ -69,7 +69,7 @@ export {};
69
69
  *
70
70
  * @property {(brandIn: Brand,
71
71
  * brandOut: Brand
72
- * ) => ERef<import('@agoric/time/src/types').TimerService>} getTimerService
72
+ * ) => ERef<import('@agoric/time').TimerService>} getTimerService
73
73
  * Get the timer used in PriceQuotes for a given brandIn/brandOut pair
74
74
  *
75
75
  * @property {(amountIn: Amount<'nat'>,
@@ -79,7 +79,7 @@ export {};
79
79
  * `amountIn`. The rate at which these are issued may be very different between
80
80
  * `priceAuthorities`.
81
81
  *
82
- * @property {(deadline: import('@agoric/time/src/types').Timestamp,
82
+ * @property {(deadline: import('@agoric/time').Timestamp,
83
83
  * amountIn: Amount<'nat'>,
84
84
  * brandOut: Brand<'nat'>
85
85
  * ) => Promise<PriceQuote>} quoteAtTime
@@ -147,7 +147,7 @@ export {};
147
147
  * @callback PriceQuery
148
148
  * @param {PriceCalculator} calcAmountIn
149
149
  * @param {PriceCalculator} calcAmountOut
150
- * @returns {{ amountIn: Amount<'nat'>, amountOut: Amount<'nat'>, timestamp?: import('@agoric/time/src/types').TimestampRecord } | undefined}
150
+ * @returns {{ amountIn: Amount<'nat'>, amountOut: Amount<'nat'>, timestamp?: import('@agoric/time').TimestampRecord } | undefined}
151
151
  */
152
152
 
153
153
  /**