@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
@@ -1,5 +1,5 @@
1
- export function prepareRecorder(baggage: MapStore<string, unknown>, marshaller: ERef<Marshaller>): (publisher: Publisher<unknown>, storageNode: StorageNode, valueShape?: TypedMatcher<unknown> | undefined) => {
2
- getStorageNode(): StorageNode;
1
+ export function prepareRecorder(baggage: import("@agoric/vat-data").Baggage, marshaller: ERef<Marshaller>): (publisher: globalThis.Publisher<unknown>, storageNode: import("@endo/eventual-send").DataOnly<globalThis.StorageNode> & import("@endo/eventual-send").RemotableBrand<import("@endo/eventual-send").DataOnly<globalThis.StorageNode>, globalThis.StorageNode>, valueShape?: TypedMatcher<unknown> | undefined) => import("@endo/exo").Guarded<{
2
+ getStorageNode(): import("@endo/eventual-send").DataOnly<globalThis.StorageNode> & import("@endo/eventual-send").RemotableBrand<import("@endo/eventual-send").DataOnly<globalThis.StorageNode>, globalThis.StorageNode>;
3
3
  /**
4
4
  * Memoizes the remote call to the storage node
5
5
  *
@@ -9,63 +9,31 @@ export function prepareRecorder(baggage: MapStore<string, unknown>, marshaller:
9
9
  /**
10
10
  * Marshalls before writing to storage or publisher to help ensure the two streams match.
11
11
  *
12
- * @param {unknown} value
12
+ * @param {any} value
13
13
  * @returns {Promise<void>}
14
14
  */
15
- write(value: unknown): Promise<void>;
15
+ write(value: any): Promise<void>;
16
16
  /**
17
17
  * Like `write` but prevents future writes and terminates the publisher.
18
18
  *
19
- * @param {unknown} value
19
+ * @param {any} value
20
20
  * @returns {Promise<void>}
21
21
  */
22
- writeFinal(value: unknown): Promise<void>;
23
- } & import("@endo/eventual-send").RemotableBrand<{}, {
24
- getStorageNode(): StorageNode;
25
- /**
26
- * Memoizes the remote call to the storage node
27
- *
28
- * @returns {Promise<string>}
29
- */
30
- getStoragePath(): Promise<string>;
31
- /**
32
- * Marshalls before writing to storage or publisher to help ensure the two streams match.
33
- *
34
- * @param {unknown} value
35
- * @returns {Promise<void>}
36
- */
37
- write(value: unknown): Promise<void>;
38
- /**
39
- * Like `write` but prevents future writes and terminates the publisher.
40
- *
41
- * @param {unknown} value
42
- * @returns {Promise<void>}
43
- */
44
- writeFinal(value: unknown): Promise<void>;
22
+ writeFinal(value: any): Promise<void>;
45
23
  }>;
46
24
  export function defineRecorderKit({ makeRecorder, makeDurablePublishKit }: {
47
25
  makeRecorder: MakeRecorder;
48
26
  makeDurablePublishKit: ReturnType<typeof prepareDurablePublishKit>;
49
- }): <T>(storageNode: StorageNode, valueShape?: TypedMatcher<T> | undefined) => RecorderKit<T>;
27
+ }): <T>(storageNode: StorageNode | Awaited<import("@endo/far").FarRef<StorageNode>>, valueShape?: TypedMatcher<T> | undefined) => RecorderKit<T>;
50
28
  export function defineERecorderKit({ makeRecorder, makeDurablePublishKit }: {
51
29
  makeRecorder: MakeRecorder;
52
30
  makeDurablePublishKit: ReturnType<typeof prepareDurablePublishKit>;
53
31
  }): <T>(storageNodeP: ERef<StorageNode>, valueShape?: TypedMatcher<T> | undefined) => EventualRecorderKit<T>;
54
- export function prepareRecorderKit(baggage: MapStore<string, unknown>, marshaller: ERef<Marshaller>): <T>(storageNode: StorageNode, valueShape?: TypedMatcher<T> | undefined) => RecorderKit<T>;
55
- export function prepareRecorderKitMakers(baggage: MapStore<string, unknown>, marshaller: ERef<Marshaller>): {
32
+ export function prepareRecorderKit(baggage: import("@agoric/vat-data").Baggage, marshaller: ERef<Marshaller>): <T>(storageNode: StorageNode | Awaited<import("@endo/far").FarRef<StorageNode>>, valueShape?: TypedMatcher<T> | undefined) => RecorderKit<T>;
33
+ export function prepareRecorderKitMakers(baggage: import("@agoric/vat-data").Baggage, marshaller: ERef<Marshaller>): {
56
34
  makeDurablePublishKit: (options?: {
57
35
  valueDurability?: "mandatory" | undefined;
58
- } | undefined) => {
59
- publisher: {
60
- publish(value: any): void;
61
- finish(finalValue: any): void;
62
- fail(reason: any): void;
63
- };
64
- subscriber: {
65
- subscribeAfter(publishCount?: bigint): Promise<any>;
66
- getUpdateSince(updateCount: any): any;
67
- };
68
- } & import("@endo/eventual-send").RemotableBrand<{}, {
36
+ } | undefined) => import("@endo/exo").GuardedKit<{
69
37
  publisher: {
70
38
  publish(value: any): void;
71
39
  finish(finalValue: any): void;
@@ -76,30 +44,8 @@ export function prepareRecorderKitMakers(baggage: MapStore<string, unknown>, mar
76
44
  getUpdateSince(updateCount: any): any;
77
45
  };
78
46
  }>;
79
- makeRecorder: (publisher: Publisher<unknown>, storageNode: StorageNode, valueShape?: TypedMatcher<unknown> | undefined) => {
80
- getStorageNode(): StorageNode;
81
- /**
82
- * Memoizes the remote call to the storage node
83
- *
84
- * @returns {Promise<string>}
85
- */
86
- getStoragePath(): Promise<string>;
87
- /**
88
- * Marshalls before writing to storage or publisher to help ensure the two streams match.
89
- *
90
- * @param {unknown} value
91
- * @returns {Promise<void>}
92
- */
93
- write(value: unknown): Promise<void>;
94
- /**
95
- * Like `write` but prevents future writes and terminates the publisher.
96
- *
97
- * @param {unknown} value
98
- * @returns {Promise<void>}
99
- */
100
- writeFinal(value: unknown): Promise<void>;
101
- } & import("@endo/eventual-send").RemotableBrand<{}, {
102
- getStorageNode(): StorageNode;
47
+ makeRecorder: (publisher: globalThis.Publisher<unknown>, storageNode: import("@endo/eventual-send").DataOnly<globalThis.StorageNode> & import("@endo/eventual-send").RemotableBrand<import("@endo/eventual-send").DataOnly<globalThis.StorageNode>, globalThis.StorageNode>, valueShape?: TypedMatcher<unknown> | undefined) => import("@endo/exo").Guarded<{
48
+ getStorageNode(): import("@endo/eventual-send").DataOnly<globalThis.StorageNode> & import("@endo/eventual-send").RemotableBrand<import("@endo/eventual-send").DataOnly<globalThis.StorageNode>, globalThis.StorageNode>;
103
49
  /**
104
50
  * Memoizes the remote call to the storage node
105
51
  *
@@ -109,38 +55,28 @@ export function prepareRecorderKitMakers(baggage: MapStore<string, unknown>, mar
109
55
  /**
110
56
  * Marshalls before writing to storage or publisher to help ensure the two streams match.
111
57
  *
112
- * @param {unknown} value
58
+ * @param {any} value
113
59
  * @returns {Promise<void>}
114
60
  */
115
- write(value: unknown): Promise<void>;
61
+ write(value: any): Promise<void>;
116
62
  /**
117
63
  * Like `write` but prevents future writes and terminates the publisher.
118
64
  *
119
- * @param {unknown} value
65
+ * @param {any} value
120
66
  * @returns {Promise<void>}
121
67
  */
122
- writeFinal(value: unknown): Promise<void>;
68
+ writeFinal(value: any): Promise<void>;
123
69
  }>;
124
- makeRecorderKit: <T>(storageNode: StorageNode, valueShape?: TypedMatcher<T> | undefined) => RecorderKit<T>;
70
+ makeRecorderKit: <T>(storageNode: StorageNode | Awaited<import("@endo/far").FarRef<StorageNode>>, valueShape?: TypedMatcher<T> | undefined) => RecorderKit<T>;
125
71
  makeERecorderKit: <T_1>(storageNodeP: ERef<StorageNode>, valueShape?: TypedMatcher<T_1> | undefined) => EventualRecorderKit<T_1>;
126
72
  };
127
73
  export function prepareMockRecorderKitMakers(): {
128
- storageNode: StorageNode & {
74
+ storageNode: globalThis.StorageNode & {
129
75
  countSetValueCalls: () => number;
130
76
  };
131
77
  makeDurablePublishKit: (options?: {
132
78
  valueDurability?: "mandatory" | undefined;
133
- } | undefined) => {
134
- publisher: {
135
- publish(value: any): void;
136
- finish(finalValue: any): void;
137
- fail(reason: any): void;
138
- };
139
- subscriber: {
140
- subscribeAfter(publishCount?: bigint): Promise<any>;
141
- getUpdateSince(updateCount: any): any;
142
- };
143
- } & import("@endo/eventual-send").RemotableBrand<{}, {
79
+ } | undefined) => import("@endo/exo").GuardedKit<{
144
80
  publisher: {
145
81
  publish(value: any): void;
146
82
  finish(finalValue: any): void;
@@ -151,30 +87,8 @@ export function prepareMockRecorderKitMakers(): {
151
87
  getUpdateSince(updateCount: any): any;
152
88
  };
153
89
  }>;
154
- makeRecorder: (publisher: Publisher<unknown>, storageNode: StorageNode, valueShape?: TypedMatcher<unknown> | undefined) => {
155
- getStorageNode(): StorageNode;
156
- /**
157
- * Memoizes the remote call to the storage node
158
- *
159
- * @returns {Promise<string>}
160
- */
161
- getStoragePath(): Promise<string>;
162
- /**
163
- * Marshalls before writing to storage or publisher to help ensure the two streams match.
164
- *
165
- * @param {unknown} value
166
- * @returns {Promise<void>}
167
- */
168
- write(value: unknown): Promise<void>;
169
- /**
170
- * Like `write` but prevents future writes and terminates the publisher.
171
- *
172
- * @param {unknown} value
173
- * @returns {Promise<void>}
174
- */
175
- writeFinal(value: unknown): Promise<void>;
176
- } & import("@endo/eventual-send").RemotableBrand<{}, {
177
- getStorageNode(): StorageNode;
90
+ makeRecorder: (publisher: globalThis.Publisher<unknown>, storageNode: import("@endo/eventual-send").DataOnly<globalThis.StorageNode> & import("@endo/eventual-send").RemotableBrand<import("@endo/eventual-send").DataOnly<globalThis.StorageNode>, globalThis.StorageNode>, valueShape?: TypedMatcher<unknown> | undefined) => import("@endo/exo").Guarded<{
91
+ getStorageNode(): import("@endo/eventual-send").DataOnly<globalThis.StorageNode> & import("@endo/eventual-send").RemotableBrand<import("@endo/eventual-send").DataOnly<globalThis.StorageNode>, globalThis.StorageNode>;
178
92
  /**
179
93
  * Memoizes the remote call to the storage node
180
94
  *
@@ -184,31 +98,31 @@ export function prepareMockRecorderKitMakers(): {
184
98
  /**
185
99
  * Marshalls before writing to storage or publisher to help ensure the two streams match.
186
100
  *
187
- * @param {unknown} value
101
+ * @param {any} value
188
102
  * @returns {Promise<void>}
189
103
  */
190
- write(value: unknown): Promise<void>;
104
+ write(value: any): Promise<void>;
191
105
  /**
192
106
  * Like `write` but prevents future writes and terminates the publisher.
193
107
  *
194
- * @param {unknown} value
108
+ * @param {any} value
195
109
  * @returns {Promise<void>}
196
110
  */
197
- writeFinal(value: unknown): Promise<void>;
111
+ writeFinal(value: any): Promise<void>;
198
112
  }>;
199
- makeRecorderKit: <T>(storageNode: StorageNode, valueShape?: TypedMatcher<T> | undefined) => RecorderKit<T>;
113
+ makeRecorderKit: <T>(storageNode: StorageNode | Awaited<import("@endo/far").FarRef<StorageNode>>, valueShape?: TypedMatcher<T> | undefined) => RecorderKit<T>;
200
114
  makeERecorderKit: <T_1>(storageNodeP: ERef<StorageNode>, valueShape?: TypedMatcher<T_1> | undefined) => EventualRecorderKit<T_1>;
201
115
  };
202
116
  export type Recorder<T> = {
203
- getStorageNode(): StorageNode;
117
+ getStorageNode(): Awaited<import("@endo/far").FarRef<StorageNode>>;
204
118
  getStoragePath(): Promise<string>;
205
119
  write(value: T): Promise<void>;
206
120
  writeFinal(value: T): Promise<void>;
207
121
  };
208
- export type RecorderKit<T> = Pick<PublishKit<T>, 'subscriber'> & {
122
+ export type RecorderKit<T> = Pick<PublishKit<T>, "subscriber"> & {
209
123
  recorder: Recorder<T>;
210
124
  };
211
- export type EventualRecorderKit<T> = Pick<PublishKit<T>, 'subscriber'> & {
125
+ export type EventualRecorderKit<T> = Pick<PublishKit<T>, "subscriber"> & {
212
126
  recorderP: ERef<Recorder<T>>;
213
127
  };
214
128
  export type MakeRecorder = ReturnType<typeof prepareRecorder>;
@@ -221,9 +135,9 @@ export type MakeERecorderKit = ReturnType<typeof defineERecorderKit>;
221
135
  * This is a Pattern but since that's `any`, including in the typedef turns the
222
136
  * whole thing to `any`.
223
137
  */
224
- export type TypedMatcher<T> = {
138
+ export type TypedMatcher<T> = import("@endo/patterns").Matcher & {
225
139
  validatedType?: T;
226
140
  };
227
141
  export type MatchedType<TM extends TypedMatcher<any>> = TM extends TypedMatcher<infer T> ? T : never;
228
- import { prepareDurablePublishKit } from "@agoric/notifier";
142
+ import { prepareDurablePublishKit } from '@agoric/notifier';
229
143
  //# sourceMappingURL=recorder.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"recorder.d.ts","sourceRoot":"","sources":["recorder.js"],"names":[],"mappings":"AA4CO,gFAFI,KAAK,UAAU,CAAC;;IAmCrB;;;;OAIG;sBADU,QAAQ,MAAM,CAAC;IAa5B;;;;;OAKG;iBAFQ,OAAO,GACL,QAAQ,IAAI,CAAC;IAa1B;;;;;OAKG;sBAFQ,OAAO,GACL,QAAQ,IAAI,CAAC;;;IArC1B;;;;OAIG;sBADU,QAAQ,MAAM,CAAC;IAa5B;;;;;OAKG;iBAFQ,OAAO,GACL,QAAQ,IAAI,CAAC;IAa1B;;;;;OAKG;sBAFQ,OAAO,GACL,QAAQ,IAAI,CAAC;GAkB/B;AAWM,2EAFI;IAAC,YAAY,EAAE,YAAY,CAAC;IAAC,qBAAqB,EAAE,WAAW,+BAA+B,CAAC,CAAA;CAAC,oBAK9F,WAAW,8DAUvB;AAUM,4EAFI;IAAC,YAAY,EAAE,YAAY,CAAC;IAAC,qBAAqB,EAAE,WAAW,+BAA+B,CAAC,CAAA;CAAC,qBAK9F,KAAK,WAAW,CAAC,sEAY7B;AAaM,mFAFI,KAAK,UAAU,CAAC,oBA9Cd,WAAW,8DAuDvB;AAaM,yFAFI,KAAK,UAAU,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;QAvIrB;;;;WAIG;0BADU,QAAQ,MAAM,CAAC;QAa5B;;;;;WAKG;qBAFQ,OAAO,GACL,QAAQ,IAAI,CAAC;QAa1B;;;;;WAKG;0BAFQ,OAAO,GACL,QAAQ,IAAI,CAAC;;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;;;;;;yBA2Ee,CAAC,IAAtD,OAAO,gBAAgB,EAAE,OAAO,GAAG;IAAE,aAAa,CAAC,EAAE,CAAC,CAAA;CAAE;wBAKxD,EAAE,8BAAF,EAAE,SAAS,YAAY,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,GAAG,KAAK;yCAhRhB,kBAAkB"}
@@ -23,7 +23,7 @@ import { E } from '@endo/eventual-send';
23
23
 
24
24
  /**
25
25
  * @template T
26
- * @typedef {{ getStorageNode(): StorageNode, getStoragePath(): Promise<string>, write(value: T): Promise<void>, writeFinal(value: T): Promise<void> }} Recorder
26
+ * @typedef {{ getStorageNode(): Awaited<import('@endo/far').FarRef<StorageNode>>, getStoragePath(): Promise<string>, write(value: T): Promise<void>, writeFinal(value: T): Promise<void> }} Recorder
27
27
  */
28
28
 
29
29
  /**
@@ -39,7 +39,7 @@ import { E } from '@endo/eventual-send';
39
39
  /**
40
40
  * Wrap a Publisher to record all the values to chain storage.
41
41
  *
42
- * @param {import('@agoric/zoe').Baggage} baggage
42
+ * @param {import('@agoric/vat-data').Baggage} baggage
43
43
  * @param {ERef<Marshaller>} marshaller
44
44
  */
45
45
  export const prepareRecorder = (baggage, marshaller) => {
@@ -55,7 +55,7 @@ export const prepareRecorder = (baggage, marshaller) => {
55
55
  /**
56
56
  * @template T
57
57
  * @param {PublishKit<T>['publisher']} publisher
58
- * @param {StorageNode} storageNode
58
+ * @param {Awaited<import('@endo/far').FarRef<StorageNode>>} storageNode
59
59
  * @param {TypedMatcher<T>} [valueShape]
60
60
  */
61
61
  (
@@ -94,7 +94,7 @@ export const prepareRecorder = (baggage, marshaller) => {
94
94
  /**
95
95
  * Marshalls before writing to storage or publisher to help ensure the two streams match.
96
96
  *
97
- * @param {unknown} value
97
+ * @param {any} value
98
98
  * @returns {Promise<void>}
99
99
  */
100
100
  async write(value) {
@@ -111,7 +111,7 @@ export const prepareRecorder = (baggage, marshaller) => {
111
111
  /**
112
112
  * Like `write` but prevents future writes and terminates the publisher.
113
113
  *
114
- * @param {unknown} value
114
+ * @param {any} value
115
115
  * @returns {Promise<void>}
116
116
  */
117
117
  async writeFinal(value) {
@@ -122,7 +122,7 @@ export const prepareRecorder = (baggage, marshaller) => {
122
122
  const serialized = JSON.stringify(encoded);
123
123
  await E(storageNode).setValue(serialized);
124
124
 
125
- // below here differs from writeFinal()
125
+ // below here differs from write()
126
126
  this.state.closed = true;
127
127
  return publisher.finish(value);
128
128
  },
@@ -144,13 +144,19 @@ harden(prepareRecorder);
144
144
  export const defineRecorderKit = ({ makeRecorder, makeDurablePublishKit }) => {
145
145
  /**
146
146
  * @template T
147
- * @param {StorageNode} storageNode
147
+ * @param {StorageNode | Awaited<import('@endo/far').FarRef<StorageNode>>} storageNode
148
148
  * @param {TypedMatcher<T>} [valueShape]
149
149
  * @returns {RecorderKit<T>}
150
150
  */
151
151
  const makeRecorderKit = (storageNode, valueShape) => {
152
152
  const { subscriber, publisher } = makeDurablePublishKit();
153
- const recorder = makeRecorder(publisher, storageNode, valueShape);
153
+ const recorder = makeRecorder(
154
+ publisher,
155
+ /** @type { Awaited<import('@endo/far').FarRef<StorageNode>> } */ (
156
+ storageNode
157
+ ),
158
+ valueShape,
159
+ );
154
160
  return harden({ subscriber, recorder });
155
161
  };
156
162
  return makeRecorderKit;
@@ -174,7 +180,12 @@ export const defineERecorderKit = ({ makeRecorder, makeDurablePublishKit }) => {
174
180
  const makeERecorderKit = (storageNodeP, valueShape) => {
175
181
  const { publisher, subscriber } = makeDurablePublishKit();
176
182
  const recorderP = E.when(storageNodeP, storageNode =>
177
- makeRecorder(publisher, storageNode, valueShape),
183
+ makeRecorder(
184
+ publisher,
185
+ // @ts-expect-error Casting because it's remote
186
+ /** @type { import('@endo/far').FarRef<StorageNode> } */ (storageNode),
187
+ valueShape,
188
+ ),
178
189
  );
179
190
  return { subscriber, recorderP };
180
191
  };
@@ -256,7 +267,7 @@ export const prepareMockRecorderKitMakers = () => {
256
267
  * whole thing to `any`.
257
268
  *
258
269
  * @template T
259
- * @typedef {{ validatedType?: T }} TypedMatcher
270
+ * @typedef {import('@endo/patterns').Matcher & { validatedType?: T }} TypedMatcher
260
271
  */
261
272
 
262
273
  /**
@@ -1,11 +1,11 @@
1
1
  export namespace natSafeMath {
2
- const add: NatOp;
3
- const subtract: NatOp;
4
- const multiply: NatOp;
5
- const floorDivide: NatOp;
6
- const ceilDivide: NatOp;
7
- const bankersDivide: NatOp;
8
- const isGTE: (x: number | bigint, y: number | bigint) => boolean;
2
+ let add: NatOp;
3
+ let subtract: NatOp;
4
+ let multiply: NatOp;
5
+ let floorDivide: NatOp;
6
+ let ceilDivide: NatOp;
7
+ let bankersDivide: NatOp;
8
+ let isGTE: (x: number | bigint, y: number | bigint) => boolean;
9
9
  }
10
10
  export type NatOp = (x: number | bigint, y: number | bigint) => NatValue;
11
11
  //# sourceMappingURL=safeMath.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"safeMath.d.ts","sourceRoot":"","sources":["safeMath.js"],"names":[],"mappings":";eAYa,KAAK;oBAGL,KAAK;oBAEL,KAAK;uBAEL,KAAK;sBAEL,KAAK;yBAQN,KAAK;;;wBA3BC,MAAM,GAAG,MAAM,KAAK,MAAM,GAAG,MAAM,KAAK,QAAQ"}
1
+ {"version":3,"file":"safeMath.d.ts","sourceRoot":"","sources":["safeMath.js"],"names":[],"mappings":";;;;;;;mBA8CiB,MAAM,GAAG,MAAM,KAAK,MAAM,GAAG,MAAM;;oBA5CtC,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,KAAK,QAAQ"}
@@ -1,4 +1,4 @@
1
- export function calculateMedian<T>(samples: T[], math: TypedMath<T>): T | undefined;
1
+ export function calculateMedian<T>(samples: Array<T>, math: TypedMath<T>): T | undefined;
2
2
  export type TypedMath<T> = {
3
3
  add: (a: T, b: T) => T;
4
4
  divide: (a: T, b: bigint) => T;
@@ -1 +1 @@
1
- {"version":3,"file":"statistics.d.ts","sourceRoot":"","sources":["statistics.js"],"names":[],"mappings":"AAgBO,oFAwBN;;aArCiB,CAAC,KAAK,CAAC,KAAK,CAAC;gBACb,CAAC,KAAK,MAAM,KAAK,CAAC;eAClB,CAAC,KAAK,CAAC,KAAK,OAAO"}
1
+ {"version":3,"file":"statistics.d.ts","sourceRoot":"","sources":["statistics.js"],"names":[],"mappings":"AAgBO,gCAFM,CAAC,WAFH,KAAK,CAEH,CAAC,AAFI,CAAC,QACR,SAAS,CACP,CAAC,AADQ,CAAC,GACV,CAAC,GAAG,SAAS,CA0BzB;sBAnCuB,CAAC;SAFX,CAAC,CAAC,EAEQ,CAAC,AAFN,EAAE,CAAC,EAEE,CAAC,AAFA,KAED,CAAC,AAFM;YACjB,CAAC,CAAC,EACQ,CAAC,AADN,EAAE,CAAC,EAAE,MAAM,KACN,CAAC,AADW;WACtB,CAAC,CAAC,EAAQ,CAAC,AAAN,EAAE,CAAC,EAAE,CAAC,KAAK,OAAO"}
@@ -18,5 +18,5 @@ export type PublicTopic<T extends unknown> = {
18
18
  export type TopicsRecord = {
19
19
  [topicName: string]: PublicTopic<unknown>;
20
20
  };
21
- import { SubscriberShape } from "@agoric/notifier";
21
+ import { SubscriberShape } from '@agoric/notifier';
22
22
  //# sourceMappingURL=topics.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"topics.d.ts","sourceRoot":"","sources":["topics.js"],"names":[],"mappings":";AAMA,gEAME;AAEF;;;;;;;GAOG;AAEH,iEAA0E;AAcnE,kDAJI,MAAM,wHAYhB;6CA7BY;IACZ,WAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAc,EAAE,WAAW,CAAC,CAAC,CAAC;IAC9B,WAAe,EAAE,KAAK,MAAM,CAAC,CAAC;CAC3B"}
1
+ {"version":3,"file":"topics.d.ts","sourceRoot":"","sources":["topics.js"],"names":[],"mappings":";AAMA,gEAME;AAEF;;;;;;;GAOG;AAEH,iEAA0E;AAcnE,kCAFkB,CAAC,eAFf,MAAM,eACN,OAAO,eAAe,EAAE,WAAW,CACrB,CAAC,AADsB,CAAC,GAAG,OAAO,eAAe,EAAE,mBAAmB,CACtE,CAAC,AADuE,CAAC,GACrF,WAAW,CAAC,CAAC,CAAC,CAU1B;wBA3B2B,CAAC,oBAFhB;IACZ,WAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAc,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;IAC9B,WAAe,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;CAC3B;2BAMS;IACZ,CAAK,SAAS,EAAE,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;CAC3C;gCA5B4B,kBAAkB"}
@@ -56,8 +56,8 @@ type Reverse = (keywordRecord?: KeywordKeywordRecord | undefined) => KeywordKeyw
56
56
  */
57
57
  type MapKeywords = (keywordRecord: AmountKeywordRecord | PaymentPKeywordRecord | IssuerKeywordRecord | undefined, keywordMapping: KeywordKeywordRecord) => any;
58
58
  type Ratio = {
59
- numerator: Amount<'nat'>;
60
- denominator: Amount<'nat'>;
59
+ numerator: Amount<"nat">;
60
+ denominator: Amount<"nat">;
61
61
  };
62
- type ScaleAmount = (amount: Amount<'nat'>, ratio: Ratio) => Amount<'nat'>;
63
- //# sourceMappingURL=types.d.ts.map
62
+ type ScaleAmount = (amount: Amount<"nat">, ratio: Ratio) => Amount<"nat">;
63
+ //# sourceMappingURL=types-ambient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-ambient.d.ts","sourceRoot":"","sources":["types-ambient.js"],"names":[],"mappings":";UAMc,OAAO;;;;;WACP,mBAAmB;;;;;;;;YAEnB,mBAAmB;;;;;;;;;;;;;;;kBAqBtB,GAAG,YACH,OAAO,aACP,OAAO,KACL,MAAM;;;;;;;;;;uBAcR,GAAG,YACH,OAAO,aACP,OAAO,KACL,MAAM;;;;4BAIN,MAAM,CAAC,OAAO,EAAC,OAAO,CAAC;;;;;;qEAYvB,oBAAoB;;;;;;;mCAWtB,mBAAmB,GAAG,qBAAqB,GAAG,mBAAmB,GAAG,SAAS,kBAC7E,oBAAoB;;eAKjB,MAAM,CAAC,KAAK,CAAC;iBACb,MAAM,CAAC,KAAK,CAAC;;4BAKhB,MAAM,CAAC,KAAK,CAAC,SACb,KAAK,KACH,MAAM,CAAC,KAAK,CAAC"}
@@ -1,6 +1,6 @@
1
1
  // @jessie-check
2
2
 
3
- /// <reference types="ses"/>
3
+ /// <reference types="ses" />
4
4
 
5
5
  /**
6
6
  * @typedef {object} SeatGainsLossesRecord
@@ -11,7 +11,7 @@ export function assertNatAssetKind(zcf: any, brand: any): void;
11
11
  export const depositToSeatSuccessMsg: "Deposit and reallocation successful.";
12
12
  export function depositToSeat(zcf: ZCF, recipientSeat: ZCFSeat, amounts: AmountKeywordRecord, payments: PaymentPKeywordRecord): Promise<string>;
13
13
  export function withdrawFromSeat(zcf: ZCF, seat: ZCFSeat, amounts: AmountKeywordRecord): Promise<PaymentPKeywordRecord>;
14
- export function saveAllIssuers(zcf: ZCF, issuerKeywordRecord?: IssuerKeywordRecord): Promise<(IssuerRecord<any> | undefined)[]>;
14
+ export function saveAllIssuers(zcf: ZCF, issuerKeywordRecord?: IssuerKeywordRecord): Promise<(IssuerRecord<any, import("@endo/patterns").Key> | undefined)[]>;
15
15
  /** @type {MapKeywords} */
16
16
  export const mapKeywords: MapKeywords;
17
17
  export function offerTo<Args extends unknown, Result extends unknown>(zcf: ZCF, invitation: ERef<Invitation<Result, Args>>, keywordMapping: KeywordKeywordRecord | undefined, proposal: Proposal, fromSeat: ZCFSeat, toSeat?: ZCFSeat | undefined, offerArgs?: Args | undefined): Promise<{
@@ -1 +1 @@
1
- {"version":3,"file":"zoeHelpers.d.ts","sourceRoot":"","sources":["zoeHelpers.js"],"names":[],"mappings":"AAaA,iIAAkI;AAM3H,oEAON;AAuBM,+BALI,GAAG,QACH,cAAc,UACd,mBAAmB,GACjB,CAAC,GAAC,CAAC,CAOf;AAED,mBAAmB;AACnB,mBADW,IAAI,CAmBb;AA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,cAGH,IAAI,CAAC,UAAU,CAqB8B,MAAM,AArB7B,EAAE,IAAI,CAAC,CAAC,kBAG9B,oBAAoB,GAAG,SAAS,YAKhC,QAAQ,YAGR,OAAO,+DAUL,OAAO,CAAC;IAAC,eAAe,EAAE,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC,CAAC;IAAC,SAAS,EAAE,OAAO,CAAC,mBAAmB,CAAC,CAAA;CAAC,CAAC,CA+D1G;;iBAzVa,MAAM,cAAc;0BACpB,MAAM,UAAU"}
@@ -1,15 +1,11 @@
1
+ /* eslint @typescript-eslint/no-floating-promises: "warn" */
1
2
  import { mustMatch, keyEQ } from '@agoric/store';
2
3
  import { E } from '@endo/eventual-send';
3
4
  import { makePromiseKit } from '@endo/promise-kit';
4
5
  import { AssetKind } from '@agoric/ertp';
5
6
  import { fromUniqueEntries } from '@agoric/internal';
6
7
  import { satisfiesWant } from '../contractFacet/offerSafety.js';
7
- import {
8
- atomicRearrange,
9
- atomicTransfer,
10
- fromOnly,
11
- toOnly,
12
- } from './atomicTransfer.js';
8
+ import { atomicTransfer, fromOnly, toOnly } from './atomicTransfer.js';
13
9
 
14
10
  export const defaultAcceptanceMsg = `The offer has been accepted. Once the contract has been completed, please check your payout`;
15
11
 
@@ -57,8 +53,7 @@ export const satisfies = (zcf, seat, update) => {
57
53
  /** @type {Swap} */
58
54
  export const swap = (zcf, leftSeat, rightSeat) => {
59
55
  try {
60
- atomicRearrange(
61
- zcf,
56
+ zcf.atomicRearrange(
62
57
  harden([
63
58
  [rightSeat, leftSeat, leftSeat.getProposal().want],
64
59
  [leftSeat, rightSeat, rightSeat.getProposal().want],
@@ -78,8 +73,7 @@ export const swap = (zcf, leftSeat, rightSeat) => {
78
73
  /** @type {SwapExact} */
79
74
  export const swapExact = (zcf, leftSeat, rightSeat) => {
80
75
  try {
81
- atomicRearrange(
82
- zcf,
76
+ zcf.atomicRearrange(
83
77
  harden([
84
78
  fromOnly(rightSeat, rightSeat.getProposal().give),
85
79
  fromOnly(leftSeat, leftSeat.getProposal().give),
@@ -305,7 +299,7 @@ const reverse = (keywordRecord = {}) => {
305
299
  * @param {ZCFSeat} fromSeat
306
300
  * The seat in contractA to take the offer payments from.
307
301
  *
308
- * @param {ZCFSeat} [toSeat=fromSeat]
302
+ * @param {ZCFSeat} [toSeat]
309
303
  * The seat in contractA to deposit the payout of the offer to.
310
304
  * If `toSeat` is not provided, this defaults to the `fromSeat`.
311
305
  *
@@ -1 +1 @@
1
- {"version":3,"file":"firstPriceLogic.d.ts","sourceRoot":"","sources":["firstPriceLogic.js"],"names":[],"mappings":"AAQO,wCAJI,GAAG,YACH,OAAO,YACP,MAAM,OAAO,CAAC,QAqDxB"}
1
+ {"version":3,"file":"firstPriceLogic.d.ts","sourceRoot":"","sources":["firstPriceLogic.js"],"names":[],"mappings":"AAOO,wCAJI,GAAG,YACH,OAAO,YACP,KAAK,CAAC,OAAO,CAAC,QAmDxB"}
@@ -1,5 +1,4 @@
1
1
  import { AmountMath } from '@agoric/ertp';
2
- import { atomicRearrange } from '../../contractSupport/index.js';
3
2
 
4
3
  /**
5
4
  * @param {ZCF} zcf
@@ -20,10 +19,9 @@ export const calcWinnerAndClose = (zcf, sellSeat, bidSeats) => {
20
19
  let highestBidSeat = bidSeats[0];
21
20
  let activeBidsCount = 0n;
22
21
 
23
- bidSeats.forEach(bidSeat => {
22
+ for (const bidSeat of bidSeats) {
24
23
  if (!bidSeat.hasExited()) {
25
24
  activeBidsCount += 1n;
26
- /** @type {Amount<'nat'>} */
27
25
  const bid = bidSeat.getAmountAllocated('Bid', bidBrand);
28
26
  // bidSeat is added in time order, in case of a tie, we privilege the earlier.
29
27
  // So the later bidder will need a strictly greater bid to win the auction.
@@ -35,15 +33,14 @@ export const calcWinnerAndClose = (zcf, sellSeat, bidSeats) => {
35
33
  highestBidSeat = bidSeat;
36
34
  }
37
35
  }
38
- });
36
+ }
39
37
 
40
38
  if (activeBidsCount === 0n) {
41
39
  throw sellSeat.fail(Error(`Could not close auction. No bids were active`));
42
40
  }
43
41
 
44
42
  // Everyone else gets a refund so their values remain the same.
45
- atomicRearrange(
46
- zcf,
43
+ zcf.atomicRearrange(
47
44
  harden([
48
45
  [highestBidSeat, sellSeat, { Bid: highestBid }, { Ask: highestBid }],
49
46
  [sellSeat, highestBidSeat, { Asset: assetAmount }],
@@ -51,10 +48,10 @@ export const calcWinnerAndClose = (zcf, sellSeat, bidSeats) => {
51
48
  );
52
49
 
53
50
  sellSeat.exit();
54
- bidSeats.forEach(bidSeat => {
51
+ for (const bidSeat of bidSeats) {
55
52
  if (!bidSeat.hasExited()) {
56
53
  bidSeat.exit();
57
54
  }
58
- });
55
+ }
59
56
  zcf.shutdown('Auction closed.');
60
57
  };
@@ -16,14 +16,14 @@
16
16
  * null } want: { Asset: null } }.
17
17
  *
18
18
  * @param {ZCF<{
19
- * timeAuthority: import('@agoric/time/src/types').TimerService,
19
+ * timeAuthority: import('@agoric/time').TimerService,
20
20
  * winnerPriceOption?: FIRST_PRICE | SECOND_PRICE,
21
21
  * bidDuration: bigint,
22
22
  * }>} zcf
23
23
  */
24
24
  export function start(zcf: ZCF<{
25
- timeAuthority: import('@agoric/time/src/types').TimerService;
26
- winnerPriceOption?: "first-price" | "second-price" | undefined;
25
+ timeAuthority: import("@agoric/time").TimerService;
26
+ winnerPriceOption?: "first-price" | "second-price";
27
27
  bidDuration: bigint;
28
28
  }>): {
29
29
  creatorInvitation: Promise<Invitation<{
@@ -34,10 +34,10 @@ export function start(zcf: ZCF<{
34
34
  winnerPriceOption: string;
35
35
  closesAfter: any;
36
36
  bidDuration: bigint;
37
- timeAuthority: import("@agoric/time/src/types").TimerService;
37
+ timeAuthority: import("@agoric/time").TimerService;
38
38
  bids: string | any[];
39
39
  };
40
- } & import("@endo/eventual-send").RemotableBrand<{}, {
40
+ } & import("@endo/marshal").RemotableObject<`Alleged: ${string}`> & import("@endo/eventual-send").RemotableBrand<{}, {
41
41
  makeBidInvitation: () => Promise<Invitation<unknown, never>>;
42
42
  getSessionDetails: () => {
43
43
  auctionedAssets: any;
@@ -45,10 +45,10 @@ export function start(zcf: ZCF<{
45
45
  winnerPriceOption: string;
46
46
  closesAfter: any;
47
47
  bidDuration: bigint;
48
- timeAuthority: import("@agoric/time/src/types").TimerService;
48
+ timeAuthority: import("@agoric/time").TimerService;
49
49
  bids: string | any[];
50
50
  };
51
- }>, never>>;
51
+ }>, undefined>>;
52
52
  publicFacet: {
53
53
  getCurrentBids: () => any[] | "Bids are hidden for \"second price\" auctions";
54
54
  getSessionDetails: () => {
@@ -57,10 +57,10 @@ export function start(zcf: ZCF<{
57
57
  winnerPriceOption: string;
58
58
  closesAfter: any;
59
59
  bidDuration: bigint;
60
- timeAuthority: import("@agoric/time/src/types").TimerService;
60
+ timeAuthority: import("@agoric/time").TimerService;
61
61
  bids: string | any[];
62
62
  };
63
- } & import("@endo/eventual-send").RemotableBrand<{}, {
63
+ } & import("@endo/marshal").RemotableObject<`Alleged: ${string}`> & import("@endo/eventual-send").RemotableBrand<{}, {
64
64
  getCurrentBids: () => any[] | "Bids are hidden for \"second price\" auctions";
65
65
  getSessionDetails: () => {
66
66
  auctionedAssets: any;
@@ -68,7 +68,7 @@ export function start(zcf: ZCF<{
68
68
  winnerPriceOption: string;
69
69
  closesAfter: any;
70
70
  bidDuration: bigint;
71
- timeAuthority: import("@agoric/time/src/types").TimerService;
71
+ timeAuthority: import("@agoric/time").TimerService;
72
72
  bids: string | any[];
73
73
  };
74
74
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"AAoBA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH;mBALkB,OAAO,wBAAwB,EAAE,YAAY;;iBAE/C,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA2HrB;AAlJD,wCAAkC;AAClC,0CAAoC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"AAqBA;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,2BANW,GAAG,CAAC;IACd,aAAe,EAAE,OAAO,cAAc,EAAE,YAAY,CAAC;IACrD,iBAAmB,CAAC,EAAE,8BAA0B,CAAC;IACjD,WAAa,EAAE,MAAM,CAAC;CACnB,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EA0HJ;AAlJD,wCAAkC;AAClC,0CAAoC"}
@@ -1,3 +1,4 @@
1
+ /* eslint @typescript-eslint/no-floating-promises: "warn" */
1
2
  import { E } from '@endo/eventual-send';
2
3
  import { mustMatch } from '@endo/patterns';
3
4
  import { Far } from '@endo/marshal';
@@ -36,7 +37,7 @@ const SECOND_PRICE = 'second-price';
36
37
  * null } want: { Asset: null } }.
37
38
  *
38
39
  * @param {ZCF<{
39
- * timeAuthority: import('@agoric/time/src/types').TimerService,
40
+ * timeAuthority: import('@agoric/time').TimerService,
40
41
  * winnerPriceOption?: FIRST_PRICE | SECOND_PRICE,
41
42
  * bidDuration: bigint,
42
43
  * }>} zcf