@agoric/zoe 0.26.3-upgrade-14-dev-c8f9e7b.0 → 0.26.3-upgrade-16-fi-dev-8879538.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (269) hide show
  1. package/README.md +7 -7
  2. package/bundles/bundle-contractFacet-js-meta.json +622 -313
  3. package/bundles/bundle-contractFacet.d.ts +3 -3
  4. package/bundles/bundle-contractFacet.js +1 -1
  5. package/exported.js +1 -12
  6. package/package.json +75 -60
  7. package/src/cleanProposal.d.ts +2 -2
  8. package/src/cleanProposal.d.ts.map +1 -1
  9. package/src/cleanProposal.js +15 -12
  10. package/src/contractFacet/exit.d.ts.map +1 -1
  11. package/src/contractFacet/exit.js +1 -0
  12. package/src/contractFacet/internal-types.d.ts +2 -2
  13. package/src/contractFacet/internal-types.d.ts.map +1 -1
  14. package/src/contractFacet/internal-types.js +1 -1
  15. package/src/contractFacet/offerHandlerStorage.d.ts +4 -1
  16. package/src/contractFacet/offerHandlerStorage.d.ts.map +1 -1
  17. package/src/contractFacet/offerHandlerStorage.js +11 -3
  18. package/src/contractFacet/reallocate.d.ts +3 -0
  19. package/src/contractFacet/reallocate.d.ts.map +1 -0
  20. package/src/contractFacet/reallocate.js +94 -0
  21. package/src/contractFacet/rightsConservation.d.ts.map +1 -1
  22. package/src/contractFacet/rightsConservation.js +3 -0
  23. package/src/contractFacet/types-ambient.d.ts +259 -0
  24. package/src/contractFacet/types-ambient.js +1 -0
  25. package/src/contractFacet/vatRoot.d.ts +4 -4
  26. package/src/contractFacet/vatRoot.d.ts.map +1 -1
  27. package/src/contractFacet/zcfMint.d.ts +5 -3
  28. package/src/contractFacet/zcfMint.d.ts.map +1 -1
  29. package/src/contractFacet/zcfMint.js +4 -4
  30. package/src/contractFacet/zcfSeat.d.ts +4 -2
  31. package/src/contractFacet/zcfSeat.d.ts.map +1 -1
  32. package/src/contractFacet/zcfSeat.js +125 -5
  33. package/src/contractFacet/zcfZygote.d.ts +1 -2
  34. package/src/contractFacet/zcfZygote.d.ts.map +1 -1
  35. package/src/contractFacet/zcfZygote.js +95 -42
  36. package/src/contractSupport/atomicTransfer.d.ts +0 -6
  37. package/src/contractSupport/atomicTransfer.d.ts.map +1 -1
  38. package/src/contractSupport/atomicTransfer.js +5 -90
  39. package/src/contractSupport/bondingCurves.js +2 -2
  40. package/src/contractSupport/durability.d.ts +3 -3
  41. package/src/contractSupport/durability.d.ts.map +1 -1
  42. package/src/contractSupport/durability.js +5 -5
  43. package/src/contractSupport/index.d.ts +1 -0
  44. package/src/contractSupport/index.js +1 -0
  45. package/src/contractSupport/prepare-ownable.d.ts +11 -0
  46. package/src/contractSupport/prepare-ownable.d.ts.map +1 -0
  47. package/src/contractSupport/prepare-ownable.js +100 -0
  48. package/src/contractSupport/priceAuthority.d.ts +23 -15
  49. package/src/contractSupport/priceAuthority.d.ts.map +1 -1
  50. package/src/contractSupport/priceAuthority.js +32 -17
  51. package/src/contractSupport/priceAuthorityInitial.d.ts +3 -2
  52. package/src/contractSupport/priceAuthorityInitial.d.ts.map +1 -1
  53. package/src/contractSupport/priceAuthorityInitial.js +5 -2
  54. package/src/contractSupport/priceAuthorityQuoteMint.d.ts +2 -1
  55. package/src/contractSupport/priceAuthorityQuoteMint.d.ts.map +1 -1
  56. package/src/contractSupport/priceAuthorityQuoteMint.js +23 -27
  57. package/src/contractSupport/priceAuthorityTransform.d.ts +14 -12
  58. package/src/contractSupport/priceAuthorityTransform.d.ts.map +1 -1
  59. package/src/contractSupport/priceAuthorityTransform.js +10 -8
  60. package/src/contractSupport/priceQuote.d.ts +7 -5
  61. package/src/contractSupport/priceQuote.d.ts.map +1 -1
  62. package/src/contractSupport/priceQuote.js +5 -1
  63. package/src/contractSupport/ratio.d.ts +2 -2
  64. package/src/contractSupport/ratio.d.ts.map +1 -1
  65. package/src/contractSupport/ratio.js +19 -15
  66. package/src/contractSupport/recorder.d.ts +31 -117
  67. package/src/contractSupport/recorder.d.ts.map +1 -1
  68. package/src/contractSupport/recorder.js +21 -10
  69. package/src/contractSupport/safeMath.d.ts +7 -7
  70. package/src/contractSupport/safeMath.d.ts.map +1 -1
  71. package/src/contractSupport/statistics.d.ts +1 -1
  72. package/src/contractSupport/statistics.d.ts.map +1 -1
  73. package/src/contractSupport/topics.d.ts +1 -1
  74. package/src/contractSupport/topics.d.ts.map +1 -1
  75. package/src/contractSupport/{types.d.ts → types-ambient.d.ts} +4 -4
  76. package/src/contractSupport/types-ambient.d.ts.map +1 -0
  77. package/src/contractSupport/{types.js → types-ambient.js} +1 -1
  78. package/src/contractSupport/zoeHelpers.d.ts +1 -1
  79. package/src/contractSupport/zoeHelpers.d.ts.map +1 -1
  80. package/src/contractSupport/zoeHelpers.js +5 -11
  81. package/src/contracts/auction/firstPriceLogic.d.ts.map +1 -1
  82. package/src/contracts/auction/firstPriceLogic.js +5 -8
  83. package/src/contracts/auction/index.d.ts +10 -10
  84. package/src/contracts/auction/index.d.ts.map +1 -1
  85. package/src/contracts/auction/index.js +2 -1
  86. package/src/contracts/auction/secondPriceLogic.d.ts.map +1 -1
  87. package/src/contracts/auction/secondPriceLogic.js +1 -4
  88. package/src/contracts/automaticRefund.d.ts +1 -1
  89. package/src/contracts/automaticRefund.d.ts.map +1 -1
  90. package/src/contracts/autoswap.d.ts.map +1 -1
  91. package/src/contracts/autoswap.js +8 -9
  92. package/src/contracts/barterExchange.d.ts +1 -1
  93. package/src/contracts/barterExchange.d.ts.map +1 -1
  94. package/src/contracts/barterExchange.js +2 -3
  95. package/src/contracts/callSpread/calculateShares.d.ts +1 -8
  96. package/src/contracts/callSpread/calculateShares.d.ts.map +1 -1
  97. package/src/contracts/callSpread/calculateShares.js +1 -1
  98. package/src/contracts/callSpread/fundedCallSpread.d.ts +4 -0
  99. package/src/contracts/callSpread/fundedCallSpread.d.ts.map +1 -1
  100. package/src/contracts/callSpread/fundedCallSpread.js +6 -4
  101. package/src/contracts/callSpread/payoffHandler.d.ts.map +1 -1
  102. package/src/contracts/callSpread/payoffHandler.js +2 -1
  103. package/src/contracts/callSpread/percent.d.ts +2 -4
  104. package/src/contracts/callSpread/percent.d.ts.map +1 -1
  105. package/src/contracts/callSpread/position.d.ts +2 -2
  106. package/src/contracts/callSpread/pricedCallSpread.d.ts +6 -5
  107. package/src/contracts/callSpread/pricedCallSpread.d.ts.map +1 -1
  108. package/src/contracts/callSpread/pricedCallSpread.js +8 -4
  109. package/src/contracts/callSpread/{types.d.ts → types-ambient.d.ts} +3 -3
  110. package/src/contracts/callSpread/types-ambient.d.ts.map +1 -0
  111. package/src/contracts/coveredCall-durable.d.ts +2 -4
  112. package/src/contracts/coveredCall-durable.d.ts.map +1 -1
  113. package/src/contracts/exported.js +3 -3
  114. package/src/contracts/loan/borrow.d.ts.map +1 -1
  115. package/src/contracts/loan/borrow.js +7 -4
  116. package/src/contracts/loan/close.d.ts.map +1 -1
  117. package/src/contracts/loan/close.js +3 -7
  118. package/src/contracts/loan/index.d.ts +5 -1
  119. package/src/contracts/loan/index.d.ts.map +1 -1
  120. package/src/contracts/loan/index.js +4 -0
  121. package/src/contracts/loan/liquidate.d.ts +1 -12
  122. package/src/contracts/loan/liquidate.d.ts.map +1 -1
  123. package/src/contracts/loan/liquidate.js +4 -2
  124. package/src/contracts/loan/scheduleLiquidation.d.ts.map +1 -1
  125. package/src/contracts/loan/scheduleLiquidation.js +1 -0
  126. package/src/contracts/loan/{types.d.ts → types-ambient.d.ts} +16 -17
  127. package/src/contracts/loan/types-ambient.d.ts.map +1 -0
  128. package/src/contracts/loan/{types.js → types-ambient.js} +11 -18
  129. package/src/contracts/loan/updateDebt.js +1 -1
  130. package/src/contracts/mintAndSellNFT.d.ts.map +1 -1
  131. package/src/contracts/mintPayments.d.ts +14 -6
  132. package/src/contracts/mintPayments.d.ts.map +1 -1
  133. package/src/contracts/mintPayments.js +1 -1
  134. package/src/contracts/oracle.d.ts +25 -3
  135. package/src/contracts/oracle.d.ts.map +1 -1
  136. package/src/contracts/oracle.js +7 -0
  137. package/src/contracts/otcDesk.d.ts +3 -3
  138. package/src/contracts/otcDesk.d.ts.map +1 -1
  139. package/src/contracts/otcDesk.js +1 -1
  140. package/src/contracts/priceAggregator.d.ts +112 -18
  141. package/src/contracts/priceAggregator.d.ts.map +1 -1
  142. package/src/contracts/priceAggregator.js +16 -18
  143. package/src/contracts/priceAggregatorTypes.d.ts +2 -2
  144. package/src/contracts/priceAggregatorTypes.d.ts.map +1 -1
  145. package/src/contracts/scaledPriceAuthority.d.ts +4 -5
  146. package/src/contracts/scaledPriceAuthority.d.ts.map +1 -1
  147. package/src/contracts/scaledPriceAuthority.js +6 -0
  148. package/src/contracts/sellItems.d.ts +2 -2
  149. package/src/contracts/sellItems.d.ts.map +1 -1
  150. package/src/contracts/sellItems.js +2 -3
  151. package/src/contracts/simpleExchange.d.ts +3 -3
  152. package/src/contracts/{types.d.ts → types-ambient.d.ts} +1 -1
  153. package/src/contracts/types-ambient.d.ts.map +1 -0
  154. package/src/handleWarning.d.ts.map +1 -1
  155. package/src/instanceRecordStorage.d.ts +1 -1
  156. package/src/instanceRecordStorage.d.ts.map +1 -1
  157. package/src/internal-types.d.ts +20 -32
  158. package/src/internal-types.d.ts.map +1 -1
  159. package/src/internal-types.js +18 -58
  160. package/src/issuerRecord.d.ts +2 -2
  161. package/src/issuerRecord.d.ts.map +1 -1
  162. package/src/issuerStorage.d.ts +4 -4
  163. package/src/issuerStorage.d.ts.map +1 -1
  164. package/src/issuerStorage.js +12 -28
  165. package/src/makeHandle.d.ts +2 -2
  166. package/src/makeHandle.d.ts.map +1 -1
  167. package/src/makeHandle.js +1 -1
  168. package/src/typeGuards.d.ts +119 -20
  169. package/src/typeGuards.d.ts.map +1 -1
  170. package/src/typeGuards.js +18 -9
  171. package/src/types-ambient.d.ts +41 -0
  172. package/src/types-ambient.d.ts.map +1 -0
  173. package/src/{types.js → types-ambient.js} +6 -14
  174. package/src/zoeService/escrowStorage.d.ts +1 -1
  175. package/src/zoeService/escrowStorage.d.ts.map +1 -1
  176. package/src/zoeService/escrowStorage.js +20 -27
  177. package/src/zoeService/feeMint.d.ts +9 -16
  178. package/src/zoeService/feeMint.d.ts.map +1 -1
  179. package/src/zoeService/feeMint.js +21 -15
  180. package/src/zoeService/installationStorage.d.ts +5 -20
  181. package/src/zoeService/installationStorage.d.ts.map +1 -1
  182. package/src/zoeService/installationStorage.js +11 -7
  183. package/src/zoeService/instanceAdminStorage.d.ts +22 -42
  184. package/src/zoeService/instanceAdminStorage.d.ts.map +1 -1
  185. package/src/zoeService/instanceAdminStorage.js +1 -0
  186. package/src/zoeService/internal-types.d.ts +16 -16
  187. package/src/zoeService/internal-types.d.ts.map +1 -1
  188. package/src/zoeService/internal-types.js +6 -6
  189. package/src/zoeService/invitationQueries.d.ts.map +1 -1
  190. package/src/zoeService/invitationQueries.js +7 -5
  191. package/src/zoeService/makeInvitation.d.ts +3 -3
  192. package/src/zoeService/makeInvitation.d.ts.map +1 -1
  193. package/src/zoeService/makeInvitation.js +25 -21
  194. package/src/zoeService/offer/burnInvitation.d.ts.map +1 -1
  195. package/src/zoeService/offer/offer.d.ts.map +1 -1
  196. package/src/zoeService/offer/offer.js +2 -5
  197. package/src/zoeService/originalZoeSeat.d.ts +34 -0
  198. package/src/zoeService/originalZoeSeat.d.ts.map +1 -0
  199. package/src/zoeService/originalZoeSeat.js +353 -0
  200. package/src/zoeService/startInstance.d.ts +3 -3
  201. package/src/zoeService/startInstance.d.ts.map +1 -1
  202. package/src/zoeService/startInstance.js +17 -11
  203. package/src/zoeService/{types.d.ts → types-ambient.d.ts} +26 -31
  204. package/src/zoeService/types-ambient.d.ts.map +1 -0
  205. package/src/zoeService/{types.js → types-ambient.js} +19 -32
  206. package/src/zoeService/utils.d.ts +54 -58
  207. package/src/zoeService/utils.test-d.d.ts +2 -0
  208. package/src/zoeService/utils.test-d.d.ts.map +1 -0
  209. package/src/zoeService/utils.test-d.ts +33 -0
  210. package/src/zoeService/zoe.d.ts +9 -13
  211. package/src/zoeService/zoe.d.ts.map +1 -1
  212. package/src/zoeService/zoe.js +7 -7
  213. package/src/zoeService/zoeSeat.d.ts +15 -45
  214. package/src/zoeService/zoeSeat.d.ts.map +1 -1
  215. package/src/zoeService/zoeSeat.js +214 -114
  216. package/src/zoeService/zoeStorageManager.d.ts +9 -43
  217. package/src/zoeService/zoeStorageManager.d.ts.map +1 -1
  218. package/src/zoeService/zoeStorageManager.js +8 -6
  219. package/tools/fakePriceAuthority.d.ts +9 -8
  220. package/tools/fakePriceAuthority.d.ts.map +1 -1
  221. package/tools/fakePriceAuthority.js +21 -17
  222. package/tools/fakeVatAdmin.d.ts +10 -10
  223. package/tools/manualPriceAuthority.d.ts +11 -6
  224. package/tools/manualPriceAuthority.d.ts.map +1 -1
  225. package/tools/manualPriceAuthority.js +15 -2
  226. package/tools/manualTimer.d.ts +21 -40
  227. package/tools/manualTimer.d.ts.map +1 -1
  228. package/tools/manualTimer.js +30 -16
  229. package/tools/prepare-test-env.js +1 -1
  230. package/tools/scriptedOracle.d.ts +3 -3
  231. package/tools/scriptedOracle.d.ts.map +1 -1
  232. package/tools/scriptedOracle.js +1 -1
  233. package/tools/scriptedPriceAuthority.d.ts +4 -0
  234. package/tools/scriptedPriceAuthority.d.ts.map +1 -1
  235. package/tools/scriptedPriceAuthority.js +6 -1
  236. package/tools/setup-zoe.d.ts +8 -9
  237. package/tools/setup-zoe.d.ts.map +1 -1
  238. package/tools/setup-zoe.js +16 -1
  239. package/tools/test-utils.d.ts +20 -0
  240. package/tools/test-utils.d.ts.map +1 -0
  241. package/tools/test-utils.js +26 -0
  242. package/tools/types.d.ts +21 -21
  243. package/tools/types.d.ts.map +1 -1
  244. package/tools/types.js +10 -10
  245. package/CHANGELOG.md +0 -1203
  246. package/src/contractFacet/types.d.ts +0 -191
  247. package/src/contractFacet/types.d.ts.map +0 -1
  248. package/src/contractFacet/types.js +0 -256
  249. package/src/contractSupport/types.d.ts.map +0 -1
  250. package/src/contracts/callSpread/types.d.ts.map +0 -1
  251. package/src/contracts/loan/types.d.ts.map +0 -1
  252. package/src/contracts/types.d.ts.map +0 -1
  253. package/src/objArrayConversion.d.ts +0 -5
  254. package/src/objArrayConversion.d.ts.map +0 -1
  255. package/src/objArrayConversion.js +0 -35
  256. package/src/types.d.ts +0 -45
  257. package/src/types.d.ts.map +0 -1
  258. package/src/zoeService/types.d.ts.map +0 -1
  259. package/tools/internal-types.d.ts +0 -12
  260. package/tools/internal-types.d.ts.map +0 -1
  261. package/tools/internal-types.js +0 -14
  262. package/tools/priceAuthorityRegistry.d.ts +0 -20
  263. package/tools/priceAuthorityRegistry.d.ts.map +0 -1
  264. package/tools/priceAuthorityRegistry.js +0 -209
  265. package/tools/types-ambient.d.ts +0 -142
  266. package/tools/types-ambient.d.ts.map +0 -1
  267. package/tools/types-ambient.js +0 -160
  268. /package/src/contracts/callSpread/{types.js → types-ambient.js} +0 -0
  269. /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
- import './types-ambient.js';
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 {ERef<import('@agoric/time/src/types').TimerService>} timer
30
- * @property {import('@agoric/time/src/types').RelativeTime} [quoteInterval]
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/src/types').Timestamp>}
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/src/types').Timestamp} quoteTime
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
- harden([
121
- {
122
- amountIn,
123
- amountOut: AmountMath.make(actualBrandOut, valueOut),
124
- timer,
125
- timestamp: quoteTime,
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/src/types').Timestamp} quoteTime
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/src/types').Timestamp, resolve: (quote: PriceQuote) => void][] } */
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', {
@@ -1,8 +1,8 @@
1
1
  export const zcfBundleCap: any;
2
2
  export default fakeVatAdmin;
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;
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: () => import("@agoric/swingset-vat").EndoZipBase64Bundle;
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/src/types').TimerService} options.timer
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<'nat'>;
12
- actualBrandOut: Brand<'nat'>;
14
+ actualBrandIn: Brand<"nat">;
15
+ actualBrandOut: Brand<"nat">;
13
16
  initialPrice: Ratio;
14
- timer: import('@agoric/time/src/types').TimerService;
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":"AAYA;;;;;;;;GAQG;AACH;IAPiC,aAAa,EAAnC,MAAM,KAAK,CAAC;IACU,cAAc,EAApC,MAAM,KAAK,CAAC;IACG,YAAY,EAA3B,KAAK;IACkD,KAAK,EAA5D,OAAO,wBAAwB,EAAE,YAAY;IAClB,cAAc;;8BACC,IAAI;EAsExD;mCACa,WAAW,+BAA+B,CAAC"}
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/src/types').TimerService} options.timer
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
  }
@@ -1,44 +1,25 @@
1
- export default buildManualTimer;
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('@agoric/time/src/types').RelativeTime | bigint;
4
+ timeStep?: import("@agoric/time").RelativeTime | bigint;
4
5
  eventLoopIteration?: () => Promise<void>;
5
6
  };
6
- /**
7
- * A fake TimerService, for unit tests that do not use a real
8
- * kernel. You can make time pass by calling `advanceTo(when)`, or one
9
- * `timeStep` at a time by calling `tick()`.
10
- *
11
- * `advanceTo()` merely schedules a wakeup: the actual
12
- * handlers (in the code under test) are invoked several turns
13
- * later. Some zoe/etc tests want to poll for the consequences of
14
- * those invocations. The best approach is to get an appropriate
15
- * Promise from your code-under-test, wait for it to fire, and then
16
- * poll. But some libraries do not offer this convenience, especially
17
- * when they use internal "fire and forget" actions.
18
- *
19
- * To support those tests, the manual timer accepts a
20
- * `eventLoopIteration` option. If provided, each call to `tick()`
21
- * will wait for all triggered activity to complete before
22
- * returning. That doesn't mean the `wake()` handler's result promise
23
- * has fired; it just means there are no settled Promises still trying
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":";oCAca;IACZ,QAAW,CAAC,EAAE,OAAO,wBAAwB,EAAE,YAAY,GAAG,MAAM,CAAC;IACrE,kBAAqB,CAAC,EAAE,MAAM,QAAQ,IAAI,CAAC,CAAC;CACzC;AAKJ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoCG;AAEH,mDANqB,GAAG,EAAE,KAAK,IAAI,kIAGtB,WAAW,CAuDvB"}
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"}
@@ -1,10 +1,13 @@
1
1
  import { Far } from '@endo/marshal';
2
2
  import { bindAllMethods } from '@agoric/internal';
3
- import { buildManualTimer as build } from '@agoric/swingset-vat/tools/manual-timer.js';
3
+ import { buildManualTimer } from '@agoric/swingset-vat/tools/manual-timer.js';
4
4
  import { TimeMath } from '@agoric/time';
5
5
 
6
- import './types-ambient.js';
7
- import './internal-types.js';
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/src/types').RelativeTime | bigint,
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/src/types').Timestamp | bigint} [startValue=0n]
70
+ * @param {import('@agoric/time').Timestamp | bigint} [startValue=0n]
57
71
  * @param {ZoeManualTimerOptions} [options]
58
- * @returns {ManualTimer}
72
+ * @returns {ZoeManualTimer}
59
73
  */
60
74
 
61
- const buildManualTimer = (log = nolog, startValue = 0n, options = {}) => {
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 = build({
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(buildManualTimer);
127
+ harden(buildZoeManualTimer);
115
128
 
116
- export default buildManualTimer;
129
+ // Default export is for backwards compatibility
130
+ export default buildZoeManualTimer;
@@ -7,4 +7,4 @@
7
7
  * the same as the SwingSet vat environment.
8
8
  */
9
9
 
10
- import '@agoric/swingset-vat/tools/prepare-test-env.js';
10
+ import '@agoric/swingset-liveslots/tools/prepare-test-env.js';
@@ -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/src/types').TimerService} timer
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('../src/contracts/oracle.js').OracleStart>, timer: import('@agoric/time/src/types').TimerService, zoe: ZoeService, feeIssuer: Issuer): Promise<{
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,OAAO,MAAM,EAAE,GAAG,CAAC,sBACnB,aAAa,OAAO,4BAA4B,EAAE,WAAW,CAAC,SAC9D,OAAO,wBAAwB,EAAE,YAAY,OAC7C,UAAU,aACV,MAAM;;;;;;;;;GAqChB"}
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"}
@@ -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
  */
@@ -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":"AAUA,yEAoFC"}
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/src/types').Timestamp>>} */
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,
@@ -1,23 +1,22 @@
1
- export function makeZoeKitForTest(vatAdminSvc?: import("@agoric/swingset-vat").VatAdminSvc | undefined): {
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?: import("@agoric/swingset-vat").VatAdminSvc | undefined): ZoeService;
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?: import("@agoric/swingset-vat").VatAdminSvc | undefined;
13
+ vatAdminSvc?: VatAdminSvc | undefined;
16
14
  useNearRemote?: boolean | undefined;
17
15
  }): Promise<{
18
16
  zoe: ZoeService;
19
17
  feeMintAccessP: FeeMintAccess;
20
- vatAdminSvc: import("@agoric/swingset-vat").VatAdminSvc;
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: () => import("@agoric/swingset-vat").EndoZipBase64Bundle;
29
+ getBundle: () => EndoZipBase64Bundle;
31
30
  };
32
31
  };
33
32
  } | undefined;
@@ -1 +1 @@
1
- {"version":3,"file":"setup-zoe.d.ts","sourceRoot":"","sources":["setup-zoe.js"],"names":[],"mappings":"AASO;;;;;;;;;EAKN;AAKM,iHACoC;AAYpC;IAL+B,MAAM,gBAArB,IAAI;IACU,eAAe;IACnB,WAAW;IACf,aAAa;;;;;;;;;;;;;;;;;;GA+BzC"}
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"}
@@ -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"}