@agoric/zoe 0.26.3-upgrade-16-dev-0df76a7.0 → 0.26.3-upgrade-17-dev-e67cd91.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 (132) hide show
  1. package/README.md +2 -3
  2. package/bundles/bundle-contractFacet-js-meta.json +536 -507
  3. package/bundles/bundle-contractFacet.js +1 -1
  4. package/package.json +30 -28
  5. package/src/cleanProposal.d.ts.map +1 -1
  6. package/src/cleanProposal.js +4 -2
  7. package/src/contractFacet/allocationMath.d.ts.map +1 -1
  8. package/src/contractFacet/allocationMath.js +1 -2
  9. package/src/contractFacet/exit.d.ts.map +1 -1
  10. package/src/contractFacet/exit.js +1 -2
  11. package/src/contractFacet/offerHandlerStorage.d.ts +4 -0
  12. package/src/contractFacet/offerHandlerStorage.d.ts.map +1 -1
  13. package/src/contractFacet/offerHandlerStorage.js +12 -0
  14. package/src/contractFacet/reallocate.d.ts.map +1 -1
  15. package/src/contractFacet/reallocate.js +1 -2
  16. package/src/contractFacet/rightsConservation.js +5 -5
  17. package/src/contractFacet/typeGuards.d.ts +8 -0
  18. package/src/contractFacet/typeGuards.d.ts.map +1 -0
  19. package/src/contractFacet/typeGuards.js +25 -0
  20. package/src/contractFacet/types-ambient.d.ts +4 -1
  21. package/src/contractFacet/vatRoot.d.ts.map +1 -1
  22. package/src/contractFacet/vatRoot.js +1 -2
  23. package/src/contractFacet/zcfMint.d.ts.map +1 -1
  24. package/src/contractFacet/zcfMint.js +3 -5
  25. package/src/contractFacet/zcfSeat.d.ts.map +1 -1
  26. package/src/contractFacet/zcfSeat.js +10 -9
  27. package/src/contractFacet/zcfZygote.d.ts.map +1 -1
  28. package/src/contractFacet/zcfZygote.js +8 -12
  29. package/src/contractSupport/bondingCurves.js +1 -1
  30. package/src/contractSupport/priceAuthority.d.ts.map +1 -1
  31. package/src/contractSupport/priceAuthority.js +2 -3
  32. package/src/contractSupport/priceAuthorityInitial.d.ts.map +1 -1
  33. package/src/contractSupport/priceAuthorityInitial.js +0 -1
  34. package/src/contractSupport/priceAuthorityTransform.js +1 -1
  35. package/src/contractSupport/priceQuote.d.ts.map +1 -1
  36. package/src/contractSupport/priceQuote.js +2 -3
  37. package/src/contractSupport/ratio.d.ts +12 -3
  38. package/src/contractSupport/ratio.d.ts.map +1 -1
  39. package/src/contractSupport/ratio.js +19 -5
  40. package/src/contractSupport/recorder.d.ts +11 -21
  41. package/src/contractSupport/recorder.d.ts.map +1 -1
  42. package/src/contractSupport/recorder.js +9 -21
  43. package/src/contractSupport/stateMachine.js +1 -1
  44. package/src/contractSupport/topics.d.ts +26 -0
  45. package/src/contractSupport/topics.d.ts.map +1 -1
  46. package/src/contractSupport/topics.js +24 -1
  47. package/src/contractSupport/zoeHelpers.d.ts.map +1 -1
  48. package/src/contractSupport/zoeHelpers.js +6 -9
  49. package/src/contracts/auction/assertBidSeat.js +1 -1
  50. package/src/contracts/auction/index.d.ts.map +1 -1
  51. package/src/contracts/auction/index.js +1 -3
  52. package/src/contracts/auction/secondPriceLogic.js +4 -4
  53. package/src/contracts/autoswap.d.ts.map +1 -1
  54. package/src/contracts/autoswap.js +4 -2
  55. package/src/contracts/callSpread/calculateShares.js +1 -1
  56. package/src/contracts/callSpread/payoffHandler.d.ts.map +1 -1
  57. package/src/contracts/callSpread/payoffHandler.js +0 -1
  58. package/src/contracts/callSpread/pricedCallSpread.d.ts.map +1 -1
  59. package/src/contracts/callSpread/pricedCallSpread.js +1 -3
  60. package/src/contracts/coveredCall-durable.d.ts.map +1 -1
  61. package/src/contracts/coveredCall-durable.js +1 -2
  62. package/src/contracts/coveredCall.d.ts.map +1 -1
  63. package/src/contracts/coveredCall.js +1 -2
  64. package/src/contracts/loan/borrow.js +1 -1
  65. package/src/contracts/loan/close.js +1 -1
  66. package/src/contracts/loan/scheduleLiquidation.d.ts.map +1 -1
  67. package/src/contracts/loan/scheduleLiquidation.js +0 -1
  68. package/src/contracts/loan/updateDebt.js +3 -3
  69. package/src/contracts/mintAndSellNFT.js +1 -1
  70. package/src/contracts/oracle.d.ts.map +1 -1
  71. package/src/contracts/oracle.js +1 -2
  72. package/src/contracts/otcDesk.js +1 -1
  73. package/src/contracts/priceAggregator.d.ts.map +1 -1
  74. package/src/contracts/priceAggregator.js +3 -4
  75. package/src/contracts/sellItems.d.ts.map +1 -1
  76. package/src/contracts/sellItems.js +1 -3
  77. package/src/contracts/valueVow.contract.d.ts +17 -0
  78. package/src/contracts/valueVow.contract.d.ts.map +1 -0
  79. package/src/contracts/valueVow.contract.js +63 -0
  80. package/src/instanceRecordStorage.d.ts.map +1 -1
  81. package/src/instanceRecordStorage.js +2 -5
  82. package/src/issuerRecord.js +1 -1
  83. package/src/issuerStorage.d.ts.map +1 -1
  84. package/src/issuerStorage.js +5 -4
  85. package/src/makeHandle.d.ts.map +1 -1
  86. package/src/makeHandle.js +1 -3
  87. package/src/typeGuards.d.ts +10 -8
  88. package/src/typeGuards.d.ts.map +1 -1
  89. package/src/typeGuards.js +7 -12
  90. package/src/zoeService/createZCFVat.js +1 -1
  91. package/src/zoeService/escrowStorage.js +3 -3
  92. package/src/zoeService/feeMint.d.ts.map +1 -1
  93. package/src/zoeService/feeMint.js +1 -2
  94. package/src/zoeService/installationStorage.d.ts.map +1 -1
  95. package/src/zoeService/installationStorage.js +1 -3
  96. package/src/zoeService/instanceAdminStorage.d.ts.map +1 -1
  97. package/src/zoeService/instanceAdminStorage.js +7 -9
  98. package/src/zoeService/internal-types.d.ts +1 -1
  99. package/src/zoeService/internal-types.d.ts.map +1 -1
  100. package/src/zoeService/internal-types.js +0 -1
  101. package/src/zoeService/invitationQueries.js +3 -3
  102. package/src/zoeService/makeInvitation.js +1 -1
  103. package/src/zoeService/offer/burnInvitation.d.ts.map +1 -1
  104. package/src/zoeService/offer/burnInvitation.js +3 -5
  105. package/src/zoeService/offer/offer.d.ts.map +1 -1
  106. package/src/zoeService/offer/offer.js +1 -2
  107. package/src/zoeService/originalZoeSeat.d.ts.map +1 -1
  108. package/src/zoeService/originalZoeSeat.js +1 -3
  109. package/src/zoeService/startInstance.d.ts.map +1 -1
  110. package/src/zoeService/startInstance.js +1 -9
  111. package/src/zoeService/utils.d.ts +3 -2
  112. package/src/zoeService/utils.test-d.ts +6 -5
  113. package/src/zoeService/zoe.d.ts +3 -2
  114. package/src/zoeService/zoe.d.ts.map +1 -1
  115. package/src/zoeService/zoe.js +54 -52
  116. package/src/zoeService/zoeSeat.d.ts.map +1 -1
  117. package/src/zoeService/zoeSeat.js +1 -3
  118. package/src/zoeService/zoeStorageManager.d.ts.map +1 -1
  119. package/src/zoeService/zoeStorageManager.js +0 -1
  120. package/tools/fakePriceAuthority.d.ts.map +1 -1
  121. package/tools/fakePriceAuthority.js +5 -4
  122. package/tools/fakeVatAdmin.d.ts.map +1 -1
  123. package/tools/fakeVatAdmin.js +10 -9
  124. package/tools/manualPriceAuthority.d.ts.map +1 -1
  125. package/tools/manualPriceAuthority.js +0 -1
  126. package/tools/manualTimer.d.ts.map +1 -1
  127. package/tools/manualTimer.js +1 -2
  128. package/tools/scriptedPriceAuthority.d.ts.map +1 -1
  129. package/tools/scriptedPriceAuthority.js +0 -1
  130. package/tools/setup-zoe.d.ts +3 -3
  131. package/tools/setup-zoe.d.ts.map +1 -1
  132. package/tools/setup-zoe.js +1 -0
@@ -1,5 +1,5 @@
1
1
  /// <reference path="./types-ambient.js" />
2
- import { q, Fail } from '@agoric/assert';
2
+ import { q, Fail } from '@endo/errors';
3
3
  import { AmountMath } from '@agoric/ertp';
4
4
  import { assertRecord } from '@endo/marshal';
5
5
  import { isNat } from '@endo/nat';
@@ -158,17 +158,26 @@ const divideHelper = (amount, ratio, divideOp) => {
158
158
  );
159
159
  };
160
160
 
161
- /** @type {ScaleAmount} */
161
+ /**
162
+ * Divide the amount by the ratio, truncating the remainder.
163
+ * @type {ScaleAmount}
164
+ */
162
165
  export const floorDivideBy = (amount, ratio) => {
163
166
  return divideHelper(amount, ratio, floorDivide);
164
167
  };
165
168
 
166
- /** @type {ScaleAmount} */
169
+ /**
170
+ * Divide the amount by the ratio, rounding up the remainder.
171
+ * @type {ScaleAmount}
172
+ */
167
173
  export const ceilDivideBy = (amount, ratio) => {
168
174
  return divideHelper(amount, ratio, ceilDivide);
169
175
  };
170
176
 
171
- /** @type {ScaleAmount} */
177
+ /**
178
+ * Divide the amount by the ratio, rounding to nearest with ties to even (aka Banker's Rounding) as in IEEE 754 default rounding.
179
+ * @type {ScaleAmount}
180
+ */
172
181
  export const divideBy = (amount, ratio) => {
173
182
  return divideHelper(amount, ratio, bankersDivide);
174
183
  };
@@ -334,7 +343,8 @@ export const ratiosSame = (left, right) => {
334
343
  };
335
344
 
336
345
  /**
337
- * Make an equivalant ratio with a new denominator
346
+ * Make a new ratio with a smaller denominator that approximates the ratio. If
347
+ * the proposed denominator is larger than the current one, return the original.
338
348
  *
339
349
  * @param {Ratio} ratio
340
350
  * @param {bigint} newDen
@@ -343,6 +353,10 @@ export const ratiosSame = (left, right) => {
343
353
  export const quantize = (ratio, newDen) => {
344
354
  const oldDen = ratio.denominator.value;
345
355
  const oldNum = ratio.numerator.value;
356
+ if (newDen > oldDen) {
357
+ return ratio;
358
+ }
359
+
346
360
  const newNum =
347
361
  newDen === oldDen ? oldNum : bankersDivide(oldNum * newDen, oldDen);
348
362
  return makeRatio(
@@ -1,4 +1,4 @@
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<{
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?: TypedPattern<any> | undefined) => import("@endo/exo").Guarded<{
2
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
@@ -24,12 +24,12 @@ export function prepareRecorder(baggage: import("@agoric/vat-data").Baggage, mar
24
24
  export function defineRecorderKit({ makeRecorder, makeDurablePublishKit }: {
25
25
  makeRecorder: MakeRecorder;
26
26
  makeDurablePublishKit: ReturnType<typeof prepareDurablePublishKit>;
27
- }): <T>(storageNode: StorageNode | Awaited<import("@endo/far").FarRef<StorageNode>>, valueShape?: TypedMatcher<T> | undefined) => RecorderKit<T>;
27
+ }): <T>(storageNode: StorageNode | Awaited<import("@endo/far").FarRef<StorageNode>>, valueShape?: TypedPattern<T> | undefined) => RecorderKit<T>;
28
28
  export function defineERecorderKit({ makeRecorder, makeDurablePublishKit }: {
29
29
  makeRecorder: MakeRecorder;
30
30
  makeDurablePublishKit: ReturnType<typeof prepareDurablePublishKit>;
31
- }): <T>(storageNodeP: ERef<StorageNode>, valueShape?: TypedMatcher<T> | undefined) => EventualRecorderKit<T>;
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>;
31
+ }): <T>(storageNodeP: ERef<StorageNode>, valueShape?: TypedPattern<T> | undefined) => EventualRecorderKit<T>;
32
+ export function prepareRecorderKit(baggage: import("@agoric/vat-data").Baggage, marshaller: ERef<Marshaller>): <T>(storageNode: StorageNode | Awaited<import("@endo/far").FarRef<StorageNode>>, valueShape?: TypedPattern<T> | undefined) => RecorderKit<T>;
33
33
  export function prepareRecorderKitMakers(baggage: import("@agoric/vat-data").Baggage, marshaller: ERef<Marshaller>): {
34
34
  makeDurablePublishKit: (options?: {
35
35
  valueDurability?: "mandatory" | undefined;
@@ -44,7 +44,7 @@ export function prepareRecorderKitMakers(baggage: import("@agoric/vat-data").Bag
44
44
  getUpdateSince(updateCount: any): any;
45
45
  };
46
46
  }>;
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<{
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?: TypedPattern<any> | undefined) => import("@endo/exo").Guarded<{
48
48
  getStorageNode(): import("@endo/eventual-send").DataOnly<globalThis.StorageNode> & import("@endo/eventual-send").RemotableBrand<import("@endo/eventual-send").DataOnly<globalThis.StorageNode>, globalThis.StorageNode>;
49
49
  /**
50
50
  * Memoizes the remote call to the storage node
@@ -67,8 +67,8 @@ export function prepareRecorderKitMakers(baggage: import("@agoric/vat-data").Bag
67
67
  */
68
68
  writeFinal(value: any): Promise<void>;
69
69
  }>;
70
- makeRecorderKit: <T>(storageNode: StorageNode | Awaited<import("@endo/far").FarRef<StorageNode>>, valueShape?: TypedMatcher<T> | undefined) => RecorderKit<T>;
71
- makeERecorderKit: <T>(storageNodeP: ERef<StorageNode>, valueShape?: TypedMatcher<T> | undefined) => EventualRecorderKit<T>;
70
+ makeRecorderKit: <T>(storageNode: StorageNode | Awaited<import("@endo/far").FarRef<StorageNode>>, valueShape?: TypedPattern<T> | undefined) => RecorderKit<T>;
71
+ makeERecorderKit: <T>(storageNodeP: ERef<StorageNode>, valueShape?: TypedPattern<T> | undefined) => EventualRecorderKit<T>;
72
72
  };
73
73
  export function prepareMockRecorderKitMakers(): {
74
74
  storageNode: globalThis.StorageNode & {
@@ -87,7 +87,7 @@ export function prepareMockRecorderKitMakers(): {
87
87
  getUpdateSince(updateCount: any): any;
88
88
  };
89
89
  }>;
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<{
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?: TypedPattern<any> | undefined) => import("@endo/exo").Guarded<{
91
91
  getStorageNode(): import("@endo/eventual-send").DataOnly<globalThis.StorageNode> & import("@endo/eventual-send").RemotableBrand<import("@endo/eventual-send").DataOnly<globalThis.StorageNode>, globalThis.StorageNode>;
92
92
  /**
93
93
  * Memoizes the remote call to the storage node
@@ -110,8 +110,8 @@ export function prepareMockRecorderKitMakers(): {
110
110
  */
111
111
  writeFinal(value: any): Promise<void>;
112
112
  }>;
113
- makeRecorderKit: <T>(storageNode: StorageNode | Awaited<import("@endo/far").FarRef<StorageNode>>, valueShape?: TypedMatcher<T> | undefined) => RecorderKit<T>;
114
- makeERecorderKit: <T>(storageNodeP: ERef<StorageNode>, valueShape?: TypedMatcher<T> | undefined) => EventualRecorderKit<T>;
113
+ makeRecorderKit: <T>(storageNode: StorageNode | Awaited<import("@endo/far").FarRef<StorageNode>>, valueShape?: TypedPattern<T> | undefined) => RecorderKit<T>;
114
+ makeERecorderKit: <T>(storageNodeP: ERef<StorageNode>, valueShape?: TypedPattern<T> | undefined) => EventualRecorderKit<T>;
115
115
  };
116
116
  export type Recorder<T> = {
117
117
  getStorageNode(): Awaited<import("@endo/far").FarRef<StorageNode>>;
@@ -128,16 +128,6 @@ export type EventualRecorderKit<T> = Pick<PublishKit<T>, "subscriber"> & {
128
128
  export type MakeRecorder = ReturnType<typeof prepareRecorder>;
129
129
  export type MakeRecorderKit = ReturnType<typeof defineRecorderKit>;
130
130
  export type MakeERecorderKit = ReturnType<typeof defineERecorderKit>;
131
- /**
132
- * Stop-gap until https://github.com/Agoric/agoric-sdk/issues/6160
133
- * explictly specify the type that the Pattern will verify through a match.
134
- *
135
- * This is a Pattern but since that's `any`, including in the typedef turns the
136
- * whole thing to `any`.
137
- */
138
- export type TypedMatcher<T> = import("@endo/patterns").Matcher & {
139
- validatedType?: T;
140
- };
141
- export type MatchedType<TM extends TypedMatcher<any>> = TM extends TypedMatcher<infer T> ? T : never;
131
+ import type { TypedPattern } from '@agoric/internal';
142
132
  import { prepareDurablePublishKit } from '@agoric/notifier';
143
133
  //# sourceMappingURL=recorder.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"recorder.d.ts","sourceRoot":"","sources":["recorder.js"],"names":[],"mappings":"AA4CO,yCAHI,OAAO,kBAAkB,EAAE,OAAO,cAClC,IAAI,CAAC,UAAU,CAAC,4TA2ItB,WAAW;;IAxGV;;;;OAIG;sBADU,OAAO,CAAC,MAAM,CAAC;IAa5B;;;;;OAKG;iBAFQ,GAAG,GACD,OAAO,CAAC,IAAI,CAAC;IAa1B;;;;;OAKG;sBAFQ,GAAG,GACD,OAAO,CAAC,IAAI,CAAC;GAkB/B;AAWM,2EAFI;IAAC,YAAY,EAAE,YAAY,CAAC;IAAC,qBAAqB,EAAE,UAAU,CAAC,OAAO,wBAAwB,CAAC,CAAA;CAAC,IAI5F,CAAC,eACH,WAAW,GAAG,OAAO,CAAC,OAAO,WAAW,EAAE,MAAM,CAAC,WAAW,CAAC,CAAC,+CAE5D,WAAW,CAAC,CAAC,CAAC,CAc5B;AAUM,4EAFI;IAAC,YAAY,EAAE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@
1
- import { Fail } from '@agoric/assert';
1
+ import { Fail } from '@endo/errors';
2
2
  import { StorageNodeShape } from '@agoric/internal';
3
3
  import { prepareDurablePublishKit } from '@agoric/notifier';
4
4
  import {
@@ -9,6 +9,10 @@ import { mustMatch } from '@agoric/store';
9
9
  import { M, makeScalarBigMapStore, prepareExoClass } from '@agoric/vat-data';
10
10
  import { E } from '@endo/eventual-send';
11
11
 
12
+ /**
13
+ * @import {TypedPattern} from '@agoric/internal';
14
+ */
15
+
12
16
  /**
13
17
  * Recorders support publishing data to vstorage.
14
18
  *
@@ -56,12 +60,12 @@ export const prepareRecorder = (baggage, marshaller) => {
56
60
  * @template T
57
61
  * @param {PublishKit<T>['publisher']} publisher
58
62
  * @param {Awaited<import('@endo/far').FarRef<StorageNode>>} storageNode
59
- * @param {TypedMatcher<T>} [valueShape]
63
+ * @param {TypedPattern<any>} [valueShape]
60
64
  */
61
65
  (
62
66
  publisher,
63
67
  storageNode,
64
- valueShape = /** @type {TypedMatcher<any>} */ (M.any()),
68
+ valueShape = /** @type {TypedPattern<any>} */ (M.any()),
65
69
  ) => {
66
70
  return {
67
71
  closed: false,
@@ -145,7 +149,7 @@ export const defineRecorderKit = ({ makeRecorder, makeDurablePublishKit }) => {
145
149
  /**
146
150
  * @template T
147
151
  * @param {StorageNode | Awaited<import('@endo/far').FarRef<StorageNode>>} storageNode
148
- * @param {TypedMatcher<T>} [valueShape]
152
+ * @param {TypedPattern<T>} [valueShape]
149
153
  * @returns {RecorderKit<T>}
150
154
  */
151
155
  const makeRecorderKit = (storageNode, valueShape) => {
@@ -174,7 +178,7 @@ export const defineERecorderKit = ({ makeRecorder, makeDurablePublishKit }) => {
174
178
  /**
175
179
  * @template T
176
180
  * @param {ERef<StorageNode>} storageNodeP
177
- * @param {TypedMatcher<T>} [valueShape]
181
+ * @param {TypedPattern<T>} [valueShape]
178
182
  * @returns {EventualRecorderKit<T>}
179
183
  */
180
184
  const makeERecorderKit = (storageNodeP, valueShape) => {
@@ -258,19 +262,3 @@ export const prepareMockRecorderKitMakers = () => {
258
262
  storageNode: makeFakeStorage('mock recorder storage'),
259
263
  };
260
264
  };
261
-
262
- /**
263
- * Stop-gap until https://github.com/Agoric/agoric-sdk/issues/6160
264
- * explictly specify the type that the Pattern will verify through a match.
265
- *
266
- * This is a Pattern but since that's `any`, including in the typedef turns the
267
- * whole thing to `any`.
268
- *
269
- * @template T
270
- * @typedef {import('@endo/patterns').Matcher & { validatedType?: T }} TypedMatcher
271
- */
272
-
273
- /**
274
- * @template {TypedMatcher<any>} TM
275
- * @typedef {TM extends TypedMatcher<infer T> ? T : never} MatchedType
276
- */
@@ -1,4 +1,4 @@
1
- import { assert } from '@agoric/assert';
1
+ import { assert } from '@endo/errors';
2
2
 
3
3
  /* allowedTransitions is an array of arrays which gets turned into a
4
4
  * map. The map maps string states to an array of potential next
@@ -8,6 +8,18 @@ export const PublicTopicShape: import("@endo/patterns").Matcher;
8
8
  * storagePath: ERef<string>,
9
9
  * }} PublicTopic
10
10
  */
11
+ /**
12
+ * A {PublicTopic} in which the `storagePath` is always a resolved string and the `subscriber is remote.
13
+ *
14
+ * Useful when working with Vows and async-flow.
15
+ *
16
+ * @template {object} T topic value
17
+ * @typedef {{
18
+ * description?: string,
19
+ * subscriber: Remote<Subscriber<T>>,
20
+ * storagePath: string,
21
+ * }} ResolvedPublicTopic
22
+ */
11
23
  export const TopicsRecordShape: import("@endo/patterns").Matcher;
12
24
  export function makeRecorderTopic<T>(description: string, recorderKit: import("./recorder.js").RecorderKit<T> | import("./recorder.js").EventualRecorderKit<T>): PublicTopic<T>;
13
25
  export type PublicTopic<T extends unknown> = {
@@ -15,8 +27,22 @@ export type PublicTopic<T extends unknown> = {
15
27
  subscriber: Subscriber<T>;
16
28
  storagePath: ERef<string>;
17
29
  };
30
+ /**
31
+ * A {PublicTopic} in which the `storagePath` is always a resolved string and the `subscriber is remote.
32
+ *
33
+ * Useful when working with Vows and async-flow.
34
+ */
35
+ export type ResolvedPublicTopic<T extends unknown> = {
36
+ description?: string;
37
+ subscriber: Remote<Subscriber<T>>;
38
+ storagePath: string;
39
+ };
18
40
  export type TopicsRecord = {
19
41
  [topicName: string]: PublicTopic<unknown>;
20
42
  };
43
+ export type ResolvedTopicsRecord = {
44
+ [topicName: string]: ResolvedPublicTopic<unknown>;
45
+ };
21
46
  import { SubscriberShape } from '@agoric/notifier';
47
+ import type { Remote } from '@agoric/internal';
22
48
  //# 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,kCALM,CAAC,eACH,MAAM,eACN,OAAO,eAAe,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,OAAO,eAAe,EAAE,mBAAmB,CAAC,CAAC,CAAC,GACrF,WAAW,CAAC,CAAC,CAAC,CAU1B;wBA9BqB,CAAC,oBACV;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"}
1
+ {"version":3,"file":"topics.d.ts","sourceRoot":"","sources":["topics.js"],"names":[],"mappings":";AAUA,gEAME;AAEF;;;;;;;GAOG;AAEH;;;;;;;;;;;GAWG;AAEH,iEAA0E;AAoBnE,kCALM,CAAC,eACH,MAAM,eACN,OAAO,eAAe,EAAE,WAAW,CAAC,CAAC,CAAC,GAAG,OAAO,eAAe,EAAE,mBAAmB,CAAC,CAAC,CAAC,GACrF,WAAW,CAAC,CAAC,CAAC,CAU1B;wBAjDqB,CAAC,oBACV;IACZ,WAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAc,EAAE,UAAU,CAAC,CAAC,CAAC,CAAC;IAC9B,WAAe,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC;CAC3B;;;;;;gCAQkB,CAAC,oBACV;IACZ,WAAe,CAAC,EAAE,MAAM,CAAC;IACzB,UAAc,EAAE,OAAO,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC;IACtC,WAAe,EAAE,MAAM,CAAC;CACrB;2BAMS;IACZ,CAAK,SAAS,EAAE,MAAM,GAAG,WAAW,CAAC,OAAO,CAAC,CAAC;CAC3C;mCAIS;IACZ,CAAK,SAAS,EAAE,MAAM,GAAG,mBAAmB,CAAC,OAAO,CAAC,CAAC;CACnD;gCAnD4B,kBAAkB;4BAKzB,kBAAkB"}
@@ -2,12 +2,16 @@ import { SubscriberShape } from '@agoric/notifier';
2
2
  import { M } from '@agoric/store';
3
3
  import { E } from '@endo/far';
4
4
 
5
+ /**
6
+ * @import {Remote} from '@agoric/internal';
7
+ */
8
+
5
9
  export { SubscriberShape };
6
10
 
7
11
  export const PublicTopicShape = M.splitRecord(
8
12
  {
9
13
  subscriber: SubscriberShape,
10
- storagePath: M.promise(/* string */),
14
+ storagePath: M.or(M.promise(/* string */), M.string()),
11
15
  },
12
16
  { description: M.string() },
13
17
  );
@@ -21,6 +25,19 @@ export const PublicTopicShape = M.splitRecord(
21
25
  * }} PublicTopic
22
26
  */
23
27
 
28
+ /**
29
+ * A {PublicTopic} in which the `storagePath` is always a resolved string and the `subscriber is remote.
30
+ *
31
+ * Useful when working with Vows and async-flow.
32
+ *
33
+ * @template {object} T topic value
34
+ * @typedef {{
35
+ * description?: string,
36
+ * subscriber: Remote<Subscriber<T>>,
37
+ * storagePath: string,
38
+ * }} ResolvedPublicTopic
39
+ */
40
+
24
41
  export const TopicsRecordShape = M.recordOf(M.string(), PublicTopicShape);
25
42
 
26
43
  /**
@@ -29,6 +46,12 @@ export const TopicsRecordShape = M.recordOf(M.string(), PublicTopicShape);
29
46
  * }} TopicsRecord
30
47
  */
31
48
 
49
+ /**
50
+ * @typedef {{
51
+ * [topicName: string]: ResolvedPublicTopic<unknown>,
52
+ * }} ResolvedTopicsRecord
53
+ */
54
+
32
55
  /**
33
56
  * @template T
34
57
  * @param {string} description
@@ -1 +1 @@
1
- {"version":3,"file":"zoeHelpers.d.ts","sourceRoot":"","sources":["zoeHelpers.js"],"names":[],"mappings":"AASA,iIAAkI;AAM3H,oEAON;AAuBM,+BALI,GAAG,QACH,cAAc,UACd,mBAAmB,GACjB,CAAC,GAAC,CAAC,CAOf;AAED,mBAAmB;AACnB,mBADW,IAAI,CAkBb;AAEF,wBAAwB;AACxB,wBADW,SAAS,CAqBlB;AAiBK,uCAHI,OAAO,iBACP,OAAO,QAIgD;AAsB3D,0CAHI,OAAO,YACP,cAAc,QA+BxB;AAGM,+DAGN;AAED,6EAA8E;AAavE,mCANI,GAAG,iBACH,OAAO,WACP,mBAAmB,YACnB,qBAAqB,GACnB,OAAO,CAAC,MAAM,CAAC,CA8B3B;AAYM,sCALI,GAAG,QACH,OAAO,WACP,mBAAmB,GACjB,OAAO,CAAC,qBAAqB,CAAC,CAQ1C;AAWM,oCAJI,GAAG,wBACH,mBAAmB,4EAgB7B;AAED,0BAA0B;AAC1B,0BADW,WAAW,CAYpB;AAiDK,wBAHe,IAAI,kBACJ,MAAM,uBA/BjB,GAAG,cAGH,IAAI,CAAC,UAAU,CAAC,MAAM,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
+ {"version":3,"file":"zoeHelpers.d.ts","sourceRoot":"","sources":["zoeHelpers.js"],"names":[],"mappings":"AASA,iIAAkI;AAI3H,oEAON;AAuBM,+BALI,GAAG,QACH,cAAc,UACd,mBAAmB,GACjB,CAAC,GAAC,CAAC,CAOf;AAED,mBAAmB;AACnB,mBADW,IAAI,CAkBb;AAEF,wBAAwB;AACxB,wBADW,SAAS,CAqBlB;AAiBK,uCAHI,OAAO,iBACP,OAAO,QAIgD;AAsB3D,0CAHI,OAAO,YACP,cAAc,QA8BxB;AAGM,+DAGN;AAED,6EAA8E;AAavE,mCANI,GAAG,iBACH,OAAO,WACP,mBAAmB,YACnB,qBAAqB,GACnB,OAAO,CAAC,MAAM,CAAC,CA8B3B;AAYM,sCALI,GAAG,QACH,OAAO,WACP,mBAAmB,GACjB,OAAO,CAAC,qBAAqB,CAAC,CAQ1C;AAWM,oCAJI,GAAG,wBACH,mBAAmB,4EAgB7B;AAED,0BAA0B;AAC1B,0BADW,WAAW,CAYpB;AAiDK,wBAHe,IAAI,kBACJ,MAAM,uBA/BjB,GAAG,cAGH,IAAI,CAAC,UAAU,CAAC,MAAM,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;;iBAxVa,MAAM,cAAc;0BACpB,MAAM,UAAU"}
@@ -1,7 +1,7 @@
1
- /* eslint @typescript-eslint/no-floating-promises: "warn" */
2
- import { mustMatch, keyEQ } from '@agoric/store';
1
+ import { Fail } from '@endo/errors';
3
2
  import { E } from '@endo/eventual-send';
4
3
  import { makePromiseKit } from '@endo/promise-kit';
4
+ import { mustMatch, keyEQ } from '@agoric/store';
5
5
  import { AssetKind } from '@agoric/ertp';
6
6
  import { fromUniqueEntries } from '@agoric/internal';
7
7
  import { satisfiesWant } from '../contractFacet/offerSafety.js';
@@ -9,8 +9,6 @@ import { atomicTransfer, fromOnly, toOnly } from './atomicTransfer.js';
9
9
 
10
10
  export const defaultAcceptanceMsg = `The offer has been accepted. Once the contract has been completed, please check your payout`;
11
11
 
12
- const { Fail } = assert;
13
-
14
12
  const getKeysSorted = obj => harden(Reflect.ownKeys(obj || {}).sort());
15
13
 
16
14
  export const assertIssuerKeywords = (zcf, expected) => {
@@ -137,11 +135,10 @@ export const assertProposalShape = (seat, expected) => {
137
135
  !Array.isArray(expected) || Fail`Expected must be an non-array object`;
138
136
  const assertValuesNull = e => {
139
137
  if (e !== undefined) {
140
- Object.values(e).forEach(
141
- value =>
142
- value === null ||
143
- Fail`The value of the expected record must be null but was ${value}`,
144
- );
138
+ for (const value of Object.values(e)) {
139
+ value === null ||
140
+ Fail`The value of the expected record must be null but was ${value}`;
141
+ }
145
142
  }
146
143
  };
147
144
 
@@ -1,4 +1,4 @@
1
- import { Fail } from '@agoric/assert';
1
+ import { Fail } from '@endo/errors';
2
2
  import { AmountMath } from '@agoric/ertp';
3
3
 
4
4
  export const assertBidSeat = (zcf, sellSeat, bidSeat) => {
@@ -1 +1 @@
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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyHJ;AAjJD,wCAAkC;AAClC,0CAAoC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["index.js"],"names":[],"mappings":"AAmBA;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAyHJ;AAjJD,wCAAkC;AAClC,0CAAoC"}
@@ -1,4 +1,4 @@
1
- /* eslint @typescript-eslint/no-floating-promises: "warn" */
1
+ import { Fail } from '@endo/errors';
2
2
  import { E } from '@endo/eventual-send';
3
3
  import { mustMatch } from '@endo/patterns';
4
4
  import { Far } from '@endo/marshal';
@@ -14,8 +14,6 @@ import * as secondPriceLogic from './secondPriceLogic.js';
14
14
  import * as firstPriceLogic from './firstPriceLogic.js';
15
15
  import { assertBidSeat } from './assertBidSeat.js';
16
16
 
17
- const { Fail } = assert;
18
-
19
17
  const FIRST_PRICE = 'first-price';
20
18
  const SECOND_PRICE = 'second-price';
21
19
 
@@ -20,7 +20,7 @@ export const calcWinnerAndClose = (zcf, sellSeat, bidSeats) => {
20
20
  let highestBidSeat = bidSeats[0];
21
21
  let activeBidsCount = 0n;
22
22
 
23
- bidSeats.forEach(bidSeat => {
23
+ for (const bidSeat of bidSeats) {
24
24
  if (!bidSeat.hasExited()) {
25
25
  activeBidsCount += 1n;
26
26
  const bid = bidSeat.getAmountAllocated('Bid', bidBrand);
@@ -35,7 +35,7 @@ export const calcWinnerAndClose = (zcf, sellSeat, bidSeats) => {
35
35
  secondHighestBid = bid;
36
36
  }
37
37
  }
38
- });
38
+ }
39
39
 
40
40
  if (activeBidsCount === 0n) {
41
41
  throw sellSeat.fail(Error(`Could not close auction. No bids were active`));
@@ -59,10 +59,10 @@ export const calcWinnerAndClose = (zcf, sellSeat, bidSeats) => {
59
59
  );
60
60
 
61
61
  sellSeat.exit();
62
- bidSeats.forEach(bidSeat => {
62
+ for (const bidSeat of bidSeats) {
63
63
  if (!bidSeat.hasExited()) {
64
64
  bidSeat.exit();
65
65
  }
66
- });
66
+ }
67
67
  zcf.shutdown('Auction closed.');
68
68
  };
@@ -1 +1 @@
1
- {"version":3,"file":"autoswap.d.ts","sourceRoot":"","sources":["autoswap.js"],"names":[],"mappings":"AAeA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,2BAFW,GAAG;;GAsVb"}
1
+ {"version":3,"file":"autoswap.d.ts","sourceRoot":"","sources":["autoswap.js"],"names":[],"mappings":"AAeA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsCG;AACH,2BAFW,GAAG;;GAwVb"}
@@ -1,5 +1,5 @@
1
+ import { assert } from '@endo/errors';
1
2
  import { Far } from '@endo/marshal';
2
- import { assert } from '@agoric/assert';
3
3
  import { AmountMath, isNatValue } from '@agoric/ertp';
4
4
 
5
5
  // Eventually will be importable from '@agoric/zoe-contract-support'
@@ -64,7 +64,9 @@ const start = async zcf => {
64
64
  // In order to get all the brands, we must call zcf.getTerms() after
65
65
  // we create the liquidityIssuer
66
66
  const { brands } = zcf.getTerms();
67
- Object.values(brands).forEach(brand => assertNatAssetKind(zcf, brand));
67
+ for (const brand of Object.values(brands)) {
68
+ assertNatAssetKind(zcf, brand);
69
+ }
68
70
  /** @type {Map<Brand,Keyword>} */
69
71
  const brandToKeyword = new Map(
70
72
  Object.entries(brands).map(([keyword, brand]) => [brand, keyword]),
@@ -1,7 +1,7 @@
1
1
  /// <reference path="./types-ambient.js" />
2
2
 
3
+ import { assert } from '@endo/errors';
3
4
  import { AmountMath, isNatValue } from '@agoric/ertp';
4
- import { assert } from '@agoric/assert';
5
5
  import { makeRatio, oneMinus } from '../../contractSupport/index.js';
6
6
  import { make100Percent, make0Percent } from './percent.js';
7
7
 
@@ -1 +1 @@
1
- {"version":3,"file":"payoffHandler.d.ts","sourceRoot":"","sources":["payoffHandler.js"],"names":[],"mappings":"AAaA;;;;;;;;GAQG;AACH,uCALW,GAAG,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,mBACxB,MAAM,CAAC,YAAY,EAAC,aAAa,CAAC,OAAO,CAAC,CAAC,kBAC3C,OAAO,GACL,aAAa,CAgEzB"}
1
+ {"version":3,"file":"payoffHandler.d.ts","sourceRoot":"","sources":["payoffHandler.js"],"names":[],"mappings":"AAYA;;;;;;;;GAQG;AACH,uCALW,GAAG,CAAC,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,mBACxB,MAAM,CAAC,YAAY,EAAC,aAAa,CAAC,OAAO,CAAC,CAAC,kBAC3C,OAAO,GACL,aAAa,CAgEzB"}
@@ -1,4 +1,3 @@
1
- /* eslint @typescript-eslint/no-floating-promises: "warn" */
2
1
  /// <reference path="./types-ambient.js" />
3
2
 
4
3
  import { E } from '@endo/eventual-send';
@@ -1 +1 @@
1
- {"version":3,"file":"pricedCallSpread.d.ts","sourceRoot":"","sources":["pricedCallSpread.js"],"names":[],"mappings":"AA0BA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,2BATW,GAAG,CAAC;IACd,YAAc,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;IAC9B,YAAc,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;IAC9B,gBAAkB,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;IAClC,cAAgB,EAAE,cAAc,CAAC;IACjC,UAAY,EAAE,MAAM,CAAC;IACrB,gBAAkB,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;CAC/B,CAAC;;;;;;;;;;;;EA0GJ;oCA7J4F,4BAA4B"}
1
+ {"version":3,"file":"pricedCallSpread.d.ts","sourceRoot":"","sources":["pricedCallSpread.js"],"names":[],"mappings":"AAwBA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4CG;AACH,2BATW,GAAG,CAAC;IACd,YAAc,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;IAC9B,YAAc,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;IAC9B,gBAAkB,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;IAClC,cAAgB,EAAE,cAAc,CAAC;IACjC,UAAY,EAAE,MAAM,CAAC;IACrB,gBAAkB,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC;CAC/B,CAAC;;;;;;;;;;;;EA0GJ;oCA3J4F,4BAA4B"}
@@ -1,6 +1,6 @@
1
- /* eslint @typescript-eslint/no-floating-promises: "warn" */
2
1
  /// <reference path="./types-ambient.js" />
3
2
 
3
+ import { Fail } from '@endo/errors';
4
4
  import { makePromiseKit } from '@endo/promise-kit';
5
5
  import { E } from '@endo/eventual-send';
6
6
  import { Far } from '@endo/marshal';
@@ -19,8 +19,6 @@ import { Position } from './position.js';
19
19
  * @import {PriceAuthority, PriceDescription, PriceQuote, PriceQuoteValue, PriceQuery,} from '@agoric/zoe/tools/types.js';
20
20
  */
21
21
 
22
- const { Fail } = assert;
23
-
24
22
  const PERCENT_BASE = 100n;
25
23
  const BASIS_POINTS = 10000n;
26
24
 
@@ -1 +1 @@
1
- {"version":3,"file":"coveredCall-durable.d.ts","sourceRoot":"","sources":["coveredCall-durable.js"],"names":[],"mappings":"AASA;;;;;;;;;;;;;;GAcG;AACH,2BAJW,GAAG,gBACH,OAAO,mBACP,OAAO,kBAAkB,EAAE,OAAO;;;;GA6E5C"}
1
+ {"version":3,"file":"coveredCall-durable.d.ts","sourceRoot":"","sources":["coveredCall-durable.js"],"names":[],"mappings":"AAQA;;;;;;;;;;;;;;GAcG;AACH,2BAJW,GAAG,gBACH,OAAO,mBACP,OAAO,kBAAkB,EAAE,OAAO;;;;GA6E5C"}
@@ -1,10 +1,9 @@
1
+ import { Fail } from '@endo/errors';
1
2
  import { mustMatch, M } from '@agoric/store';
2
3
  import { prepareExo, prepareExoClass } from '@agoric/vat-data';
3
4
  import { swapExact } from '../contractSupport/index.js';
4
5
  import { isAfterDeadlineExitRule, OfferHandlerI } from '../typeGuards.js';
5
6
 
6
- const { Fail } = assert;
7
-
8
7
  const sellSeatExpiredMsg = 'The covered call option is expired.';
9
8
 
10
9
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"coveredCall.d.ts","sourceRoot":"","sources":["coveredCall.js"],"names":[],"mappings":"AAOA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AACH,2BAFW,GAAG;;EA6Cb"}
1
+ {"version":3,"file":"coveredCall.d.ts","sourceRoot":"","sources":["coveredCall.js"],"names":[],"mappings":"AAMA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2DG;AACH,2BAFW,GAAG;;EA6Cb"}
@@ -1,10 +1,9 @@
1
+ import { Fail, q } from '@endo/errors';
1
2
  import { M, mustMatch } from '@agoric/store';
2
3
  // Eventually will be importable from '@agoric/zoe-contract-support'
3
4
  import { swapExact } from '../contractSupport/index.js';
4
5
  import { isAfterDeadlineExitRule } from '../typeGuards.js';
5
6
 
6
- const { Fail, quote: q } = assert;
7
-
8
7
  /**
9
8
  * A call option is the right (but not the obligation) to buy digital
10
9
  * assets at a pre-determined price, called the strike price. This
@@ -1,4 +1,4 @@
1
- import { assert, Fail } from '@agoric/assert';
1
+ import { assert, Fail } from '@endo/errors';
2
2
  import { E } from '@endo/eventual-send';
3
3
  import { Far } from '@endo/marshal';
4
4
  import { makePromiseKit } from '@endo/promise-kit';
@@ -1,6 +1,6 @@
1
1
  /// <reference path="./types-ambient.js" />
2
2
 
3
- import { Fail } from '@agoric/assert';
3
+ import { Fail } from '@endo/errors';
4
4
  import { AmountMath } from '@agoric/ertp';
5
5
 
6
6
  import { assertProposalShape } from '../../contractSupport/index.js';
@@ -1 +1 @@
1
- {"version":3,"file":"scheduleLiquidation.d.ts","sourceRoot":"","sources":["scheduleLiquidation.js"],"names":[],"mappings":"AAWA,kCAAkC;AAClC,kCADW,mBAAmB,CAsD5B"}
1
+ {"version":3,"file":"scheduleLiquidation.d.ts","sourceRoot":"","sources":["scheduleLiquidation.js"],"names":[],"mappings":"AAUA,kCAAkC;AAClC,kCADW,mBAAmB,CAsD5B"}
@@ -1,4 +1,3 @@
1
- /* eslint @typescript-eslint/no-floating-promises: "warn" */
2
1
  import { E } from '@endo/eventual-send';
3
2
  import { AmountMath } from '@agoric/ertp';
4
3
 
@@ -1,6 +1,6 @@
1
+ import { annotateError, X } from '@endo/errors';
1
2
  import { Far } from '@endo/marshal';
2
3
  import { makeNotifierKit, observeNotifier } from '@agoric/notifier';
3
- import { assert, details as X } from '@agoric/assert';
4
4
  import { AmountMath } from '@agoric/ertp';
5
5
  import { TimeMath } from '@agoric/time';
6
6
 
@@ -70,7 +70,7 @@ export const makeDebtCalculator = debtCalculatorConfig => {
70
70
  }
71
71
  },
72
72
  fail: reason => {
73
- assert.note(
73
+ annotateError(
74
74
  reason,
75
75
  X`Period problem: ${originalDebt}, started: ${basetime}, debt: ${debt}`,
76
76
  );
@@ -79,7 +79,7 @@ export const makeDebtCalculator = debtCalculatorConfig => {
79
79
  });
80
80
 
81
81
  observeNotifier(periodNotifier, periodObserver).catch(reason => {
82
- assert.note(
82
+ annotateError(
83
83
  reason,
84
84
  X`Unable to updateDebt originally: ${originalDebt}, started: ${basetime}, debt: ${debt}`,
85
85
  );
@@ -1,8 +1,8 @@
1
+ import { assert } from '@endo/errors';
1
2
  import { makeIssuerKit, AssetKind, AmountMath } from '@agoric/ertp';
2
3
  import { E } from '@endo/eventual-send';
3
4
  import { Far } from '@endo/marshal';
4
5
 
5
- import { assert } from '@agoric/assert';
6
6
  import { notForProductionUse } from '@agoric/internal/src/magic-cookie-test-only.js';
7
7
 
8
8
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"oracle.d.ts","sourceRoot":"","sources":["oracle.js"],"names":[],"mappings":"6BA6Gc,WAAW,OAAO,KAAK,CAAC;0BACxB,OAAO,KAAK;AAtG1B;;GAEG;AAEH;;;;GAIG;AACH,2BAFW,GAAG;;;;;;;QAkDV,iCAAiC;qBAArB,WAAW;QAgBvB,iCAAiC;mCAArB,WAAW;;QAhBvB,iCAAiC;qBAArB,WAAW;QAgBvB,iCAAiC;mCAArB,WAAW;;GAwB1B;gCAhG4B,wBAAwB"}
1
+ {"version":3,"file":"oracle.d.ts","sourceRoot":"","sources":["oracle.js"],"names":[],"mappings":"6BA4Gc,WAAW,OAAO,KAAK,CAAC;0BACxB,OAAO,KAAK;AAtG1B;;GAEG;AAEH;;;;GAIG;AACH,2BAFW,GAAG;;;;;;;QAkDV,iCAAiC;qBAArB,WAAW;QAgBvB,iCAAiC;mCAArB,WAAW;;QAhBvB,iCAAiC;qBAArB,WAAW;QAgBvB,iCAAiC;mCAArB,WAAW;;GAwB1B;gCAhG4B,wBAAwB"}
@@ -1,5 +1,4 @@
1
- /* eslint @typescript-eslint/no-floating-promises: "warn" */
2
- import { assert, Fail } from '@agoric/assert';
1
+ import { assert, Fail } from '@endo/errors';
3
2
  import { Far } from '@endo/marshal';
4
3
  import { AmountMath } from '@agoric/ertp';
5
4
 
@@ -1,5 +1,5 @@
1
+ import { assert } from '@endo/errors';
1
2
  import { E } from '@endo/eventual-send';
2
- import { assert } from '@agoric/assert';
3
3
  import { Far } from '@endo/marshal';
4
4
  import {
5
5
  offerTo,
@@ -1 +1 @@
1
- {"version":3,"file":"priceAggregator.d.ts","sourceRoot":"","sources":["priceAggregator.js"],"names":[],"mappings":"6BAqCc,MAAM,GAAG,MAAM,GAAG,MAAM;oCAEzB,QAAQ,CAAC,cAAc,GAAG;IAAE,IAAI,EAAE,cAAc,CAAA;CAAE,CAAC;oBAGlD,cAAc,GAAG,KAAK;sCAmlBtB,WAAW,OAAO,KAAK,CAAC;AA9kBtC;;;;;;;;;;;;;;;;;;;GAmBG;AACH,2BAbW,GAAG,CAAC;IACd,KAAO,EAAE,OAAO,cAAc,EAAE,YAAY,CAAC;IAC7C,aAAe,EAAE,MAAM,CAAC;IACxB,OAAS,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;IACxB,QAAU,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC;IACzB,YAAc,EAAE,MAAM,CAAC,KAAK,CAAC,CAA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