@agoric/zoe 0.26.2 → 0.26.3-calypso-dev-84eb287.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 (274) hide show
  1. package/README.md +7 -7
  2. package/bundles/bundle-contractFacet-js-meta.json +628 -314
  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 -59
  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/evalContractCode.d.ts.map +1 -1
  11. package/src/contractFacet/evalContractCode.js +2 -2
  12. package/src/contractFacet/exit.d.ts.map +1 -1
  13. package/src/contractFacet/exit.js +1 -0
  14. package/src/contractFacet/internal-types.d.ts +2 -2
  15. package/src/contractFacet/internal-types.d.ts.map +1 -1
  16. package/src/contractFacet/internal-types.js +1 -1
  17. package/src/contractFacet/offerHandlerStorage.d.ts +4 -1
  18. package/src/contractFacet/offerHandlerStorage.d.ts.map +1 -1
  19. package/src/contractFacet/offerHandlerStorage.js +11 -3
  20. package/src/contractFacet/reallocate.d.ts +3 -0
  21. package/src/contractFacet/reallocate.d.ts.map +1 -0
  22. package/src/contractFacet/reallocate.js +94 -0
  23. package/src/contractFacet/rightsConservation.d.ts.map +1 -1
  24. package/src/contractFacet/rightsConservation.js +3 -0
  25. package/src/contractFacet/typeGuards.d.ts +8 -0
  26. package/src/contractFacet/typeGuards.d.ts.map +1 -0
  27. package/src/contractFacet/typeGuards.js +25 -0
  28. package/src/contractFacet/types-ambient.d.ts +271 -0
  29. package/src/contractFacet/types-ambient.js +1 -0
  30. package/src/contractFacet/vatRoot.d.ts +3 -3
  31. package/src/contractFacet/vatRoot.d.ts.map +1 -1
  32. package/src/contractFacet/zcfMint.d.ts +4 -2
  33. package/src/contractFacet/zcfMint.d.ts.map +1 -1
  34. package/src/contractFacet/zcfMint.js +7 -7
  35. package/src/contractFacet/zcfSeat.d.ts +4 -2
  36. package/src/contractFacet/zcfSeat.d.ts.map +1 -1
  37. package/src/contractFacet/zcfSeat.js +130 -7
  38. package/src/contractFacet/zcfZygote.d.ts +1 -2
  39. package/src/contractFacet/zcfZygote.d.ts.map +1 -1
  40. package/src/contractFacet/zcfZygote.js +102 -48
  41. package/src/contractSupport/atomicTransfer.d.ts +0 -6
  42. package/src/contractSupport/atomicTransfer.d.ts.map +1 -1
  43. package/src/contractSupport/atomicTransfer.js +5 -90
  44. package/src/contractSupport/bondingCurves.js +2 -2
  45. package/src/contractSupport/durability.d.ts +3 -3
  46. package/src/contractSupport/durability.d.ts.map +1 -1
  47. package/src/contractSupport/durability.js +5 -5
  48. package/src/contractSupport/index.d.ts +1 -0
  49. package/src/contractSupport/index.js +1 -0
  50. package/src/contractSupport/prepare-ownable.d.ts +11 -0
  51. package/src/contractSupport/prepare-ownable.d.ts.map +1 -0
  52. package/src/contractSupport/prepare-ownable.js +100 -0
  53. package/src/contractSupport/priceAuthority.d.ts +23 -15
  54. package/src/contractSupport/priceAuthority.d.ts.map +1 -1
  55. package/src/contractSupport/priceAuthority.js +33 -18
  56. package/src/contractSupport/priceAuthorityInitial.d.ts +3 -2
  57. package/src/contractSupport/priceAuthorityInitial.d.ts.map +1 -1
  58. package/src/contractSupport/priceAuthorityInitial.js +6 -3
  59. package/src/contractSupport/priceAuthorityQuoteMint.d.ts +2 -1
  60. package/src/contractSupport/priceAuthorityQuoteMint.d.ts.map +1 -1
  61. package/src/contractSupport/priceAuthorityQuoteMint.js +23 -27
  62. package/src/contractSupport/priceAuthorityTransform.d.ts +13 -11
  63. package/src/contractSupport/priceAuthorityTransform.d.ts.map +1 -1
  64. package/src/contractSupport/priceAuthorityTransform.js +10 -8
  65. package/src/contractSupport/priceQuote.d.ts +7 -5
  66. package/src/contractSupport/priceQuote.d.ts.map +1 -1
  67. package/src/contractSupport/priceQuote.js +5 -1
  68. package/src/contractSupport/ratio.d.ts +2 -2
  69. package/src/contractSupport/ratio.d.ts.map +1 -1
  70. package/src/contractSupport/ratio.js +19 -15
  71. package/src/contractSupport/recorder.d.ts +33 -119
  72. package/src/contractSupport/recorder.d.ts.map +1 -1
  73. package/src/contractSupport/recorder.js +21 -10
  74. package/src/contractSupport/safeMath.d.ts +7 -7
  75. package/src/contractSupport/safeMath.d.ts.map +1 -1
  76. package/src/contractSupport/statistics.d.ts +1 -1
  77. package/src/contractSupport/statistics.d.ts.map +1 -1
  78. package/src/contractSupport/topics.d.ts +1 -1
  79. package/src/contractSupport/topics.d.ts.map +1 -1
  80. package/src/contractSupport/{types.d.ts → types-ambient.d.ts} +4 -4
  81. package/src/contractSupport/types-ambient.d.ts.map +1 -0
  82. package/src/contractSupport/{types.js → types-ambient.js} +1 -1
  83. package/src/contractSupport/zoeHelpers.d.ts +1 -1
  84. package/src/contractSupport/zoeHelpers.d.ts.map +1 -1
  85. package/src/contractSupport/zoeHelpers.js +6 -12
  86. package/src/contracts/auction/firstPriceLogic.d.ts.map +1 -1
  87. package/src/contracts/auction/firstPriceLogic.js +5 -8
  88. package/src/contracts/auction/index.d.ts +10 -10
  89. package/src/contracts/auction/index.d.ts.map +1 -1
  90. package/src/contracts/auction/index.js +3 -3
  91. package/src/contracts/auction/secondPriceLogic.d.ts.map +1 -1
  92. package/src/contracts/auction/secondPriceLogic.js +1 -4
  93. package/src/contracts/automaticRefund.d.ts +1 -1
  94. package/src/contracts/automaticRefund.d.ts.map +1 -1
  95. package/src/contracts/autoswap.d.ts.map +1 -1
  96. package/src/contracts/autoswap.js +8 -9
  97. package/src/contracts/barterExchange.d.ts +1 -1
  98. package/src/contracts/barterExchange.d.ts.map +1 -1
  99. package/src/contracts/barterExchange.js +2 -3
  100. package/src/contracts/callSpread/calculateShares.d.ts +1 -8
  101. package/src/contracts/callSpread/calculateShares.d.ts.map +1 -1
  102. package/src/contracts/callSpread/calculateShares.js +1 -1
  103. package/src/contracts/callSpread/fundedCallSpread.d.ts +4 -0
  104. package/src/contracts/callSpread/fundedCallSpread.d.ts.map +1 -1
  105. package/src/contracts/callSpread/fundedCallSpread.js +6 -4
  106. package/src/contracts/callSpread/payoffHandler.d.ts.map +1 -1
  107. package/src/contracts/callSpread/payoffHandler.js +3 -2
  108. package/src/contracts/callSpread/percent.d.ts +2 -4
  109. package/src/contracts/callSpread/percent.d.ts.map +1 -1
  110. package/src/contracts/callSpread/position.d.ts +2 -2
  111. package/src/contracts/callSpread/pricedCallSpread.d.ts +6 -5
  112. package/src/contracts/callSpread/pricedCallSpread.d.ts.map +1 -1
  113. package/src/contracts/callSpread/pricedCallSpread.js +9 -5
  114. package/src/contracts/callSpread/{types.d.ts → types-ambient.d.ts} +3 -3
  115. package/src/contracts/callSpread/types-ambient.d.ts.map +1 -0
  116. package/src/contracts/coveredCall-durable.d.ts +2 -4
  117. package/src/contracts/coveredCall-durable.d.ts.map +1 -1
  118. package/src/contracts/exported.js +3 -3
  119. package/src/contracts/loan/borrow.d.ts.map +1 -1
  120. package/src/contracts/loan/borrow.js +7 -4
  121. package/src/contracts/loan/close.d.ts.map +1 -1
  122. package/src/contracts/loan/close.js +3 -7
  123. package/src/contracts/loan/index.d.ts +5 -1
  124. package/src/contracts/loan/index.d.ts.map +1 -1
  125. package/src/contracts/loan/index.js +4 -0
  126. package/src/contracts/loan/liquidate.d.ts +1 -12
  127. package/src/contracts/loan/liquidate.d.ts.map +1 -1
  128. package/src/contracts/loan/liquidate.js +4 -2
  129. package/src/contracts/loan/scheduleLiquidation.d.ts.map +1 -1
  130. package/src/contracts/loan/scheduleLiquidation.js +2 -1
  131. package/src/contracts/loan/{types.d.ts → types-ambient.d.ts} +16 -17
  132. package/src/contracts/loan/types-ambient.d.ts.map +1 -0
  133. package/src/contracts/loan/{types.js → types-ambient.js} +11 -18
  134. package/src/contracts/loan/updateDebt.js +1 -1
  135. package/src/contracts/mintAndSellNFT.d.ts.map +1 -1
  136. package/src/contracts/mintPayments.d.ts +14 -6
  137. package/src/contracts/mintPayments.d.ts.map +1 -1
  138. package/src/contracts/mintPayments.js +1 -1
  139. package/src/contracts/oracle.d.ts +6 -2
  140. package/src/contracts/oracle.d.ts.map +1 -1
  141. package/src/contracts/oracle.js +10 -3
  142. package/src/contracts/otcDesk.d.ts +3 -3
  143. package/src/contracts/otcDesk.d.ts.map +1 -1
  144. package/src/contracts/otcDesk.js +1 -1
  145. package/src/contracts/priceAggregator.d.ts +25 -17
  146. package/src/contracts/priceAggregator.d.ts.map +1 -1
  147. package/src/contracts/priceAggregator.js +33 -32
  148. package/src/contracts/priceAggregatorTypes.d.ts +2 -2
  149. package/src/contracts/priceAggregatorTypes.d.ts.map +1 -1
  150. package/src/contracts/scaledPriceAuthority.d.ts +3 -4
  151. package/src/contracts/scaledPriceAuthority.d.ts.map +1 -1
  152. package/src/contracts/scaledPriceAuthority.js +6 -0
  153. package/src/contracts/sellItems.d.ts +2 -2
  154. package/src/contracts/sellItems.d.ts.map +1 -1
  155. package/src/contracts/sellItems.js +3 -4
  156. package/src/contracts/simpleExchange.d.ts +3 -3
  157. package/src/contracts/{types.d.ts → types-ambient.d.ts} +1 -1
  158. package/src/contracts/types-ambient.d.ts.map +1 -0
  159. package/src/handleWarning.d.ts.map +1 -1
  160. package/src/instanceRecordStorage.d.ts +1 -1
  161. package/src/instanceRecordStorage.d.ts.map +1 -1
  162. package/src/internal-types.d.ts +21 -32
  163. package/src/internal-types.d.ts.map +1 -1
  164. package/src/internal-types.js +19 -58
  165. package/src/issuerRecord.d.ts +1 -1
  166. package/src/issuerRecord.d.ts.map +1 -1
  167. package/src/issuerStorage.d.ts +3 -3
  168. package/src/issuerStorage.d.ts.map +1 -1
  169. package/src/issuerStorage.js +12 -28
  170. package/src/makeHandle.d.ts +2 -2
  171. package/src/makeHandle.d.ts.map +1 -1
  172. package/src/makeHandle.js +1 -1
  173. package/src/typeGuards.d.ts +114 -20
  174. package/src/typeGuards.d.ts.map +1 -1
  175. package/src/typeGuards.js +19 -20
  176. package/src/types-ambient.d.ts +41 -0
  177. package/src/types-ambient.d.ts.map +1 -0
  178. package/src/{types.js → types-ambient.js} +7 -15
  179. package/src/zoeService/escrowStorage.d.ts +1 -1
  180. package/src/zoeService/escrowStorage.d.ts.map +1 -1
  181. package/src/zoeService/escrowStorage.js +20 -27
  182. package/src/zoeService/feeMint.d.ts +9 -16
  183. package/src/zoeService/feeMint.d.ts.map +1 -1
  184. package/src/zoeService/feeMint.js +21 -15
  185. package/src/zoeService/installationStorage.d.ts +5 -20
  186. package/src/zoeService/installationStorage.d.ts.map +1 -1
  187. package/src/zoeService/installationStorage.js +11 -7
  188. package/src/zoeService/instanceAdminStorage.d.ts +22 -42
  189. package/src/zoeService/instanceAdminStorage.d.ts.map +1 -1
  190. package/src/zoeService/instanceAdminStorage.js +2 -1
  191. package/src/zoeService/internal-types.d.ts +12 -12
  192. package/src/zoeService/internal-types.d.ts.map +1 -1
  193. package/src/zoeService/internal-types.js +6 -6
  194. package/src/zoeService/invitationQueries.d.ts.map +1 -1
  195. package/src/zoeService/invitationQueries.js +7 -5
  196. package/src/zoeService/makeInvitation.d.ts +3 -3
  197. package/src/zoeService/makeInvitation.d.ts.map +1 -1
  198. package/src/zoeService/makeInvitation.js +25 -21
  199. package/src/zoeService/offer/burnInvitation.d.ts.map +1 -1
  200. package/src/zoeService/offer/offer.d.ts.map +1 -1
  201. package/src/zoeService/offer/offer.js +2 -5
  202. package/src/zoeService/originalZoeSeat.d.ts +34 -0
  203. package/src/zoeService/originalZoeSeat.d.ts.map +1 -0
  204. package/src/zoeService/originalZoeSeat.js +353 -0
  205. package/src/zoeService/startInstance.d.ts +3 -3
  206. package/src/zoeService/startInstance.d.ts.map +1 -1
  207. package/src/zoeService/startInstance.js +82 -37
  208. package/src/zoeService/{types.d.ts → types-ambient.d.ts} +23 -28
  209. package/src/zoeService/types-ambient.d.ts.map +1 -0
  210. package/src/zoeService/{types.js → types-ambient.js} +19 -32
  211. package/src/zoeService/utils.d.ts +57 -58
  212. package/src/zoeService/utils.test-d.d.ts +2 -0
  213. package/src/zoeService/utils.test-d.d.ts.map +1 -0
  214. package/src/zoeService/utils.test-d.ts +33 -0
  215. package/src/zoeService/zoe.d.ts +14 -8
  216. package/src/zoeService/zoe.d.ts.map +1 -1
  217. package/src/zoeService/zoe.js +39 -11
  218. package/src/zoeService/zoeSeat.d.ts +15 -45
  219. package/src/zoeService/zoeSeat.d.ts.map +1 -1
  220. package/src/zoeService/zoeSeat.js +215 -115
  221. package/src/zoeService/zoeStorageManager.d.ts +13 -47
  222. package/src/zoeService/zoeStorageManager.d.ts.map +1 -1
  223. package/src/zoeService/zoeStorageManager.js +13 -6
  224. package/tools/fakePriceAuthority.d.ts +9 -8
  225. package/tools/fakePriceAuthority.d.ts.map +1 -1
  226. package/tools/fakePriceAuthority.js +21 -17
  227. package/tools/fakeVatAdmin.d.ts +10 -10
  228. package/tools/manualPriceAuthority.d.ts +11 -6
  229. package/tools/manualPriceAuthority.d.ts.map +1 -1
  230. package/tools/manualPriceAuthority.js +16 -3
  231. package/tools/manualTimer.d.ts +17 -40
  232. package/tools/manualTimer.d.ts.map +1 -1
  233. package/tools/manualTimer.js +30 -16
  234. package/tools/prepare-test-env.js +1 -1
  235. package/tools/scriptedOracle.d.ts +3 -3
  236. package/tools/scriptedOracle.d.ts.map +1 -1
  237. package/tools/scriptedOracle.js +1 -1
  238. package/tools/scriptedPriceAuthority.d.ts +4 -0
  239. package/tools/scriptedPriceAuthority.d.ts.map +1 -1
  240. package/tools/scriptedPriceAuthority.js +8 -3
  241. package/tools/setup-zoe.d.ts +10 -6
  242. package/tools/setup-zoe.d.ts.map +1 -1
  243. package/tools/setup-zoe.js +16 -1
  244. package/tools/test-utils.d.ts +20 -0
  245. package/tools/test-utils.d.ts.map +1 -0
  246. package/tools/test-utils.js +26 -0
  247. package/tools/types.d.ts +21 -21
  248. package/tools/types.d.ts.map +1 -1
  249. package/tools/types.js +10 -10
  250. package/CHANGELOG.md +0 -1171
  251. package/src/contractFacet/types.d.ts +0 -191
  252. package/src/contractFacet/types.d.ts.map +0 -1
  253. package/src/contractFacet/types.js +0 -256
  254. package/src/contractSupport/types.d.ts.map +0 -1
  255. package/src/contracts/callSpread/types.d.ts.map +0 -1
  256. package/src/contracts/loan/types.d.ts.map +0 -1
  257. package/src/contracts/types.d.ts.map +0 -1
  258. package/src/objArrayConversion.d.ts +0 -5
  259. package/src/objArrayConversion.d.ts.map +0 -1
  260. package/src/objArrayConversion.js +0 -35
  261. package/src/types.d.ts +0 -45
  262. package/src/types.d.ts.map +0 -1
  263. package/src/zoeService/types.d.ts.map +0 -1
  264. package/tools/internal-types.d.ts +0 -12
  265. package/tools/internal-types.d.ts.map +0 -1
  266. package/tools/internal-types.js +0 -14
  267. package/tools/priceAuthorityRegistry.d.ts +0 -20
  268. package/tools/priceAuthorityRegistry.d.ts.map +0 -1
  269. package/tools/priceAuthorityRegistry.js +0 -209
  270. package/tools/types-ambient.d.ts +0 -142
  271. package/tools/types-ambient.d.ts.map +0 -1
  272. package/tools/types-ambient.js +0 -160
  273. /package/src/contracts/callSpread/{types.js → types-ambient.js} +0 -0
  274. /package/src/contracts/{types.js → types-ambient.js} +0 -0
@@ -1,5 +1,4 @@
1
- /// <reference path="../../../time/src/types.d.ts" />
2
-
1
+ /* eslint @typescript-eslint/no-floating-promises: "warn" */
3
2
  import { Fail, q } from '@agoric/assert';
4
3
  import { AmountMath, AssetKind, makeIssuerKit } from '@agoric/ertp';
5
4
  import { assertAllDefined } from '@agoric/internal';
@@ -14,7 +13,6 @@ import { E } from '@endo/eventual-send';
14
13
  import { Far } from '@endo/marshal';
15
14
  import { notForProductionUse } from '@agoric/internal/src/magic-cookie-test-only.js';
16
15
 
17
- import '../../tools/types-ambient.js';
18
16
  import {
19
17
  calculateMedian,
20
18
  makeOnewayPriceAuthorityKit,
@@ -32,8 +30,11 @@ import {
32
30
  ratiosSame,
33
31
  } from '../contractSupport/ratio.js';
34
32
 
35
- import '@agoric/ertp/src/types-ambient.js';
36
-
33
+ /**
34
+ * @import {LegacyMap} from '@agoric/store'
35
+ * @import {ContractOf} from '../zoeService/utils.js';
36
+ * @import {PriceDescription, PriceQuote, PriceQuoteValue, PriceQuery,} from '@agoric/zoe/tools/types.js';
37
+ */
37
38
  /** @typedef {bigint | number | string} ParsableNumber */
38
39
  /**
39
40
  * @typedef {Readonly<ParsableNumber | { data: ParsableNumber }>} OraclePriceSubmission
@@ -52,7 +53,7 @@ const priceDescriptionFromQuote = quote => quote.quoteAmount.value[0];
52
53
  * is a stub until we complete what is now in `fluxAggregatorKit.js`.
53
54
  *
54
55
  * @param {ZCF<{
55
- * timer: import('@agoric/time/src/types').TimerService,
56
+ * timer: import('@agoric/time').TimerService,
56
57
  * POLL_INTERVAL: bigint,
57
58
  * brandIn: Brand<'nat'>,
58
59
  * brandOut: Brand<'nat'>,
@@ -60,7 +61,7 @@ const priceDescriptionFromQuote = quote => quote.quoteAmount.value[0];
60
61
  * }>} zcf
61
62
  * @param {{
62
63
  * marshaller: Marshaller,
63
- * quoteMint?: ERef<Mint<'set'>>,
64
+ * quoteMint?: ERef<Mint<'set', PriceDescription>>,
64
65
  * storageNode: ERef<StorageNode>,
65
66
  * }} privateArgs
66
67
  */
@@ -78,12 +79,11 @@ const start = async (zcf, privateArgs) => {
78
79
  const { marshaller, storageNode } = privateArgs;
79
80
  assertAllDefined({ marshaller, storageNode });
80
81
 
82
+ /** @type {ERef<Mint<'set', PriceDescription>>} */
81
83
  const quoteMint =
82
84
  privateArgs.quoteMint ||
83
85
  // makeIssuerKit fails upgrade, this contract is for demo only
84
86
  makeIssuerKit('quote', AssetKind.SET).mint;
85
- /** @type {IssuerRecord<'set'>} */
86
- // xxx saveIssuer not generic
87
87
  const quoteIssuerRecord = await zcf.saveIssuer(
88
88
  E(quoteMint).getIssuer(),
89
89
  'Quote',
@@ -101,8 +101,6 @@ const start = async (zcf, privateArgs) => {
101
101
  * @param {PriceQuoteValue} quote
102
102
  */
103
103
  const authenticateQuote = async quote => {
104
- /** @type {Amount<'set'>} */
105
- // xxx type should be inferred from brand and value
106
104
  const quoteAmount = AmountMath.make(quoteKit.brand, harden(quote));
107
105
  const quotePayment = await E(quoteKit.mint).mintPayment(quoteAmount);
108
106
  return harden({ quoteAmount, quotePayment });
@@ -126,7 +124,7 @@ const start = async (zcf, privateArgs) => {
126
124
 
127
125
  /**
128
126
  * @typedef {object} OracleRecord
129
- * @property {(timestamp: import('@agoric/time/src/types').Timestamp) => Promise<void>} [querier]
127
+ * @property {(timestamp: import('@agoric/time').Timestamp) => Promise<void>} [querier]
130
128
  * @property {Ratio} lastSample
131
129
  * @property {OracleKey} oracleKey
132
130
  */
@@ -143,7 +141,7 @@ const start = async (zcf, privateArgs) => {
143
141
 
144
142
  // Wake every POLL_INTERVAL and run the queriers.
145
143
  const repeaterP = E(timer).makeRepeater(0n, POLL_INTERVAL);
146
- /** @type {import('@agoric/time/src/types').TimerWaker} */
144
+ /** @type {import('@agoric/time').TimerWaker} */
147
145
  const waker = Far('waker', {
148
146
  async wake(timestamp) {
149
147
  // Run all the queriers.
@@ -161,12 +159,12 @@ const start = async (zcf, privateArgs) => {
161
159
  await Promise.all(querierPs).catch(console.error);
162
160
  },
163
161
  });
164
- E(repeaterP).schedule(waker);
162
+ void E(repeaterP).schedule(waker);
165
163
 
166
164
  /**
167
165
  * @param {object} param0
168
166
  * @param {Ratio} [param0.overridePrice]
169
- * @param {import('@agoric/time/src/types').TimestampRecord} [param0.timestamp]
167
+ * @param {import('@agoric/time').TimestampRecord} [param0.timestamp]
170
168
  */
171
169
  const makeCreateQuote = ({ overridePrice, timestamp } = {}) =>
172
170
  /**
@@ -233,17 +231,20 @@ const start = async (zcf, privateArgs) => {
233
231
  });
234
232
 
235
233
  // for each new quote from the priceAuthority, publish it to off-chain storage
236
- observeNotifier(priceAuthority.makeQuoteNotifier(unitAmountIn, brandOut), {
237
- updateState: quote => {
238
- publisher.publish(priceDescriptionFromQuote(quote));
239
- },
240
- fail: reason => {
241
- throw Error(`priceAuthority observer failed: ${reason}`);
242
- },
243
- finish: done => {
244
- throw Error(`priceAuthority observer died: ${done}`);
234
+ void observeNotifier(
235
+ priceAuthority.makeQuoteNotifier(unitAmountIn, brandOut),
236
+ {
237
+ updateState: quote => {
238
+ publisher.publish(priceDescriptionFromQuote(quote));
239
+ },
240
+ fail: reason => {
241
+ throw Error(`priceAuthority observer failed: ${reason}`);
242
+ },
243
+ finish: done => {
244
+ throw Error(`priceAuthority observer died: ${done}`);
245
+ },
245
246
  },
246
- });
247
+ );
247
248
 
248
249
  /**
249
250
  * @param {Ratio} r
@@ -258,7 +259,7 @@ const start = async (zcf, privateArgs) => {
258
259
  );
259
260
 
260
261
  /**
261
- * @param {import('@agoric/time/src/types').Timestamp} timestamp
262
+ * @param {import('@agoric/time').Timestamp} timestamp
262
263
  */
263
264
  const updateQuote = async timestamp => {
264
265
  timestamp = TimeMath.coerceTimestampRecord(timestamp, timerBrand);
@@ -390,7 +391,7 @@ const start = async (zcf, privateArgs) => {
390
391
  return;
391
392
  }
392
393
  // Queue the next update.
393
- E(oracleNotifier).getUpdateSince(updateCount).then(recurse);
394
+ void E(oracleNotifier).getUpdateSince(updateCount).then(recurse);
394
395
 
395
396
  // See if we have associated parameters or just a raw value.
396
397
  /** @type {Ratio | undefined} */
@@ -426,7 +427,7 @@ const start = async (zcf, privateArgs) => {
426
427
  };
427
428
 
428
429
  // Start the notifier.
429
- E(oracleNotifier).getUpdateSince().then(recurse);
430
+ void E(oracleNotifier).getUpdateSince().then(recurse);
430
431
  };
431
432
 
432
433
  const creatorFacet = Far('PriceAggregatorCreatorFacet', {
@@ -457,6 +458,7 @@ const start = async (zcf, privateArgs) => {
457
458
  seat,
458
459
  { notifier: oracleNotifier, scaleValueOut = 1 } = {},
459
460
  ) => {
461
+ seat.exit();
460
462
  const admin = await creatorFacet.initOracle(oracleKey);
461
463
  const invitationMakers = Far('invitation makers', {
462
464
  /** @param {ParsableNumber} price */
@@ -464,11 +466,10 @@ const start = async (zcf, privateArgs) => {
464
466
  assertParsableNumber(price);
465
467
  return zcf.makeInvitation(cSeat => {
466
468
  cSeat.exit();
467
- admin.pushResult(price);
469
+ void admin.pushResult(price);
468
470
  }, 'PushPrice');
469
471
  },
470
472
  });
471
- seat.exit();
472
473
 
473
474
  if (oracleNotifier) {
474
475
  pushFromOracle(oracleNotifier, scaleValueOut, r =>
@@ -592,11 +593,11 @@ const start = async (zcf, privateArgs) => {
592
593
  const oracle = await E(zoe).getPublicFacet(oracleInstance);
593
594
  assert(records.has(record), 'Oracle record is already deleted');
594
595
 
595
- /** @type {import('@agoric/time/src/types').Timestamp} */
596
+ /** @type {import('@agoric/time').Timestamp} */
596
597
  let lastWakeTimestamp = 0n;
597
598
 
598
599
  /**
599
- * @param {import('@agoric/time/src/types').Timestamp} timestamp
600
+ * @param {import('@agoric/time').Timestamp} timestamp
600
601
  */
601
602
  record.querier = async timestamp => {
602
603
  // Submit the query.
@@ -9,7 +9,7 @@ type OracleAdmin<R extends unknown> = {
9
9
  pushResult: (result: R) => Promise<void>;
10
10
  };
11
11
  type OracleKey = {} | string;
12
- type PriceAggregatorKit = Pick<import("./priceAggregator").PriceAggregatorContract, 'creatorFacet' | 'publicFacet'>;
12
+ type PriceAggregatorKit = Pick<import("./priceAggregator").PriceAggregatorContract, "creatorFacet" | "publicFacet">;
13
13
  type OracleQuery = Record<string, unknown> & {
14
14
  kind?: string;
15
15
  increment?: bigint;
@@ -58,7 +58,7 @@ type OracleKit = {
58
58
  };
59
59
  type OracleReply = {
60
60
  reply: unknown;
61
- requiredFee?: Amount<AssetKind> | undefined;
61
+ requiredFee?: globalThis.Amount | undefined;
62
62
  };
63
63
  type OracleHandler = {
64
64
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"priceAggregatorTypes.d.ts","sourceRoot":"","sources":["priceAggregatorTypes.js"],"names":[],"mappings":";;;;YAGc,MAAM,QAAQ,IAAI,CAAC;;;;yBAEV,CAAC,KAAK,QAAQ,IAAI,CA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,EAAE,WAAW,KAAK,IAAI,CAAC,OAAO,CAAC;;iFAOtC,IAAI,CAAC,UAAU,CAAC;;;;;;;;oBAMf,MAAM,mBAAmB;;;;4BAEzB,wCAAwC;;;;4BAExC,MAAM,OAAO,CAAC,UAAU,CAAC;;;mBAMzB,aAAa;;;gBAKb,CAAC,aAAa,EAAE,uBAAuB,KAC7C,kBAAkB;;;kBAKZ,kBAAkB;iBAClB,iBAAiB;cACjB,QAAQ;;;WAKR,OAAO;;;;;;;aAMP,CAAC,KAAK,EAAE,WAAW,EAAE,GAAG,EAAE,MAAM,KAAK,OAAO,CAAC,WAAW,CAAC;;;;aAEzD,CAAC,KAAK,EAAE,WAAW,EAAE,MAAM,EAAE,OAAO,KAAK,IAAI;;;;aAE7C,CAAC,KAAK,EAAE,WAAW,EAChC,KAAmB,EAAE,OAAO,EAC5B,WAAyB,EAAE,MAAM,GAAG,SAAS,KACtC,IAAI"}
@@ -1,7 +1,5 @@
1
- export function prepare(zcf: ZCF<ScaledPriceAuthorityOpts>, privateArgs: object, baggage: MapStore<string, unknown>): Promise<{
2
- publicFacet: {
3
- getPriceAuthority: () => Promise<PriceAuthority>;
4
- } & import("@endo/eventual-send").RemotableBrand<{}, {
1
+ export function prepare(zcf: ZCF<ScaledPriceAuthorityOpts>, privateArgs: object, baggage: import("@agoric/vat-data").Baggage): Promise<{
2
+ publicFacet: import("@endo/exo").Guarded<{
5
3
  getPriceAuthority: () => Promise<PriceAuthority>;
6
4
  }>;
7
5
  }>;
@@ -20,4 +18,5 @@ export type ScaledPriceAuthorityOpts = {
20
18
  */
21
19
  initialPrice?: Ratio | undefined;
22
20
  };
21
+ import type { PriceAuthority } from '@agoric/zoe/tools/types.js';
23
22
  //# sourceMappingURL=scaledPriceAuthority.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"scaledPriceAuthority.d.ts","sourceRoot":"","sources":["scaledPriceAuthority.js"],"names":[],"mappings":"AAgCO,6BAJI,IAAI,wBAAwB,CAAC,eAC7B,MAAM;;;;;;GAyDhB;;0BAzEa,KAAK,cAAc,CAAC;;;;aACpB,KAAK;;;;cACL,KAAK"}
1
+ {"version":3,"file":"scaledPriceAuthority.d.ts","sourceRoot":"","sources":["scaledPriceAuthority.js"],"names":[],"mappings":"AAqCO,6BALI,GAAG,CAAC,wBAAwB,CAAC,eAC7B,MAAM,WACN,OAAO,kBAAkB,EAAE,OAAO;;;;GAyD5C;;0BA1Ea,IAAI,CAAC,cAAc,CAAC;;;;aACpB,KAAK;;;;cACL,KAAK;;;;;;oCAP0E,4BAA4B"}
@@ -9,6 +9,10 @@ import { makeInitialTransform } from '../contractSupport/priceAuthorityInitial.j
9
9
  import { makePriceAuthorityTransform } from '../contractSupport/priceAuthorityTransform.js';
10
10
  import { provideQuoteMint } from '../contractSupport/priceAuthorityQuoteMint.js';
11
11
 
12
+ /**
13
+ * @import {PriceAuthority, PriceDescription, PriceQuote, PriceQuoteValue, PriceQuery,} from '@agoric/zoe/tools/types.js';
14
+ */
15
+
12
16
  /**
13
17
  * @typedef {object} ScaledPriceAuthorityOpts
14
18
  * @property {ERef<PriceAuthority>} sourcePriceAuthority
@@ -30,6 +34,7 @@ import { provideQuoteMint } from '../contractSupport/priceAuthorityQuoteMint.js'
30
34
  * @param {object} privateArgs
31
35
  * @param {import('@agoric/vat-data').Baggage} baggage
32
36
  */
37
+ // 'prepare' is deprecated but still supported
33
38
  export const prepare = async (zcf, privateArgs, baggage) => {
34
39
  const quoteMint = provideQuoteMint(baggage);
35
40
 
@@ -85,3 +90,4 @@ export const prepare = async (zcf, privateArgs, baggage) => {
85
90
  );
86
91
  return harden({ publicFacet });
87
92
  };
93
+ harden(prepare);
@@ -21,10 +21,10 @@
21
21
  * @param {ZCF<{pricePerItem: Amount<'nat'>}>} zcf
22
22
  */
23
23
  export function start(zcf: ZCF<{
24
- pricePerItem: Amount<'nat'>;
24
+ pricePerItem: Amount<"nat">;
25
25
  }>): {
26
26
  creatorFacet: SellItemsCreatorFacet;
27
- creatorInvitation: Promise<Invitation<string, never>>;
27
+ creatorInvitation: Promise<Invitation<string, undefined>>;
28
28
  publicFacet: SellItemsPublicFacet;
29
29
  };
30
30
  //# sourceMappingURL=sellItems.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"sellItems.d.ts","sourceRoot":"","sources":["sellItems.js"],"names":[],"mappings":"AAkBA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH;kBAF8B,OAAO,KAAK,CAAC;;;;;EAwH1C"}
1
+ {"version":3,"file":"sellItems.d.ts","sourceRoot":"","sources":["sellItems.js"],"names":[],"mappings":"AAkBA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,2BAFW,GAAG,CAAC;IAAC,YAAY,EAAE,MAAM,CAAC,KAAK,CAAC,CAAA;CAAC,CAAC;;;;EAuH5C"}
@@ -1,3 +1,4 @@
1
+ /* eslint @typescript-eslint/no-floating-promises: "warn" */
1
2
  import { Far } from '@endo/marshal';
2
3
  import { Nat } from '@endo/nat';
3
4
  import { AmountMath } from '@agoric/ertp';
@@ -11,7 +12,6 @@ import {
11
12
  defaultAcceptanceMsg,
12
13
  assertProposalShape,
13
14
  assertNatAssetKind,
14
- atomicRearrange,
15
15
  } from '../contractSupport/index.js';
16
16
 
17
17
  const { Fail } = assert;
@@ -52,7 +52,7 @@ const start = zcf => {
52
52
  const sell = seat => {
53
53
  sellerSeat = seat;
54
54
 
55
- observeIteration(
55
+ void observeIteration(
56
56
  subscribeLatest(sellerSeat.getSubscriber()),
57
57
  harden({
58
58
  updateState: sellerSeatAllocation =>
@@ -107,8 +107,7 @@ const start = zcf => {
107
107
  Fail`More money (${totalCost}) is required to buy these items`;
108
108
 
109
109
  // Reallocate.
110
- atomicRearrange(
111
- zcf,
110
+ zcf.atomicRearrange(
112
111
  harden([
113
112
  [buyerSeat, sellerSeat, { Money: providedMoney }],
114
113
  [sellerSeat, buyerSeat, { Items: wantedItems }],
@@ -22,13 +22,13 @@
22
22
  export function start(zcf: ZCF): {
23
23
  publicFacet: {
24
24
  makeInvitation: () => Promise<Invitation<unknown, never>>;
25
- getNotifier: () => Notifier<{
25
+ getNotifier: () => globalThis.Notifier<{
26
26
  buys: any;
27
27
  sells: any;
28
28
  }>;
29
- } & import("@endo/eventual-send").RemotableBrand<{}, {
29
+ } & import("@endo/marshal").RemotableObject<`Alleged: ${string}`> & import("@endo/eventual-send").RemotableBrand<{}, {
30
30
  makeInvitation: () => Promise<Invitation<unknown, never>>;
31
- getNotifier: () => Notifier<{
31
+ getNotifier: () => globalThis.Notifier<{
32
32
  buys: any;
33
33
  sells: any;
34
34
  }>;
@@ -77,4 +77,4 @@ type AutoswapPublicFacet = {
77
77
  */
78
78
  getPoolAllocation: () => Record<string, Amount>;
79
79
  };
80
- //# sourceMappingURL=types.d.ts.map
80
+ //# sourceMappingURL=types-ambient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-ambient.d.ts","sourceRoot":"","sources":["types-ambient.js"],"names":[],"mappings":";oBAEc,MAAM,MAAM;uBACZ,MAAM,MAAM;;;yBAGZ,MAAM,OAAO,CAAC,UAAU,CAAC;;6BAE1B,oBAAoB,GAAG,oBAAoB;;2BAK1C,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;WACnB,MAAM;iBACN,MAAM;2BACN,YAAY;kBACZ,MAAM;;;0BAGN,QAAQ;2BACR,qBAAqB;uBACrB,QAAQ;0BACR,oBAAoB;;;gBAGpB,CAAC,UAAU,EAAE,mBAAmB,KAAK,OAAO,CAAC,eAAe,CAAC;eAC7D,MAAM,MAAM;;;oBAKZ,MAAM,MAAM;oBACZ,MAAM,OAAO,CAAC,UAAU,CAAC;;;;;;;wBAKzB,MAAM,OAAO,CAAC,UAAU,CAAC;;;;;;0BAEzB,MAAM,OAAO,CAAC,UAAU,CAAC;;;;;;2BAGzB,MAAM,OAAO,CAAC,UAAU,CAAC;;;;;gCAGzB,MAAM,OAAO,CAAC,UAAU,CAAC;;;;;mCAEzB,MAAM,OAAO,CAAC,UAAU,CAAC;wBAEzB,MAAM,MAAM;;;;;wBACZ,MAAM,MAAM;;;;;mBAEZ,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,KAAK,KAAK,MAAM;;;;;oBAG7C,CAAC,SAAS,EAAE,MAAM,EAAE,OAAO,EAAE,KAAK,KAAK,MAAM;;;;;uBAG7C,MAAM,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"handleWarning.d.ts","sourceRoot":"","sources":["handleWarning.js"],"names":[],"mappings":"AASO,wCAHI,QAAQ,GAAG,CAAC,GACV,IAAI,CAIhB;AASM,8CAHI,cAAc,GAAG,CAAC,GAChB,IAAI,CAIhB"}
1
+ {"version":3,"file":"handleWarning.d.ts","sourceRoot":"","sources":["handleWarning.js"],"names":[],"mappings":"AASO,wCAHI,OAAO,CAAC,GAAG,CAAC,GACV,IAAI,CAIhB;AASM,8CAHI,aAAa,CAAC,GAAG,CAAC,GAChB,IAAI,CAIhB"}
@@ -1,2 +1,2 @@
1
- export function makeInstanceRecordStorage(baggage: MapStore<string, unknown>): (ir: InstanceRecord) => InstanceState;
1
+ export function makeInstanceRecordStorage(baggage: import("@agoric/vat-data").Baggage): (ir: InstanceRecord) => InstanceState;
2
2
  //# sourceMappingURL=instanceRecordStorage.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"instanceRecordStorage.d.ts","sourceRoot":"","sources":["instanceRecordStorage.js"],"names":[],"mappings":"AA8BO,oFAFW,cAAc,KAAK,aAAa,CAqFjD"}
1
+ {"version":3,"file":"instanceRecordStorage.d.ts","sourceRoot":"","sources":["instanceRecordStorage.js"],"names":[],"mappings":"AA8BO,mDAHI,OAAO,kBAAkB,EAAE,OAAO,GAChC,CAAC,EAAE,EAAE,cAAc,KAAK,aAAa,CAqFjD"}
@@ -22,20 +22,21 @@ type ZoeSeatAdminKit = {
22
22
  /**
23
23
  * Make the Zoe seat admin, user seat and a notifier
24
24
  */
25
- type MakeZoeSeatAdminKit = (initialAllocation: Allocation, instanceAdminHelper: InstanceAdminHelper, proposal: ProposalRecord, withdrawFacet: WithdrawFacet, exitObj: ERef<ExitObj>, offerResult?: ERef<unknown>, baggage: MapStore<string, unknown>) => ZoeSeatAdminKit;
25
+ type MakeZoeSeatAdminKit = (initialAllocation: Allocation, instanceAdminHelper: InstanceAdminHelper, proposal: ProposalRecord, withdrawFacet: WithdrawFacet, exitObj: ERef<ExitObj>, offerResult?: ERef<unknown>, baggage: import("@agoric/vat-data").Baggage) => ZoeSeatAdminKit;
26
26
  type ZoeSeatAdminExit = (completion?: Completion) => void;
27
- type ZoeSeatAdmin = {
27
+ type ZoeSeatAdminMethods = {
28
28
  replaceAllocation: (allocation: Allocation) => void;
29
29
  exit: ZoeSeatAdminExit;
30
30
  /**
31
31
  * called with the reason
32
32
  * for calling fail on this seat, where reason is normally an instanceof Error.
33
33
  */
34
- fail: ShutdownWithFailure;
34
+ fail: import("@agoric/swingset-vat").ShutdownWithFailure;
35
35
  getExitSubscriber: () => Subscriber<AmountKeywordRecord>;
36
36
  };
37
+ type ZoeSeatAdmin = import("@endo/marshal").RemotableObject & ZoeSeatAdminMethods;
37
38
  type HandleOfferResult = {
38
- offerResultPromise: Promise<unknown>;
39
+ offerResultPromise: Promise<import("@endo/marshal").Passable>;
39
40
  exitObj: ExitObj;
40
41
  };
41
42
  /**
@@ -55,7 +56,7 @@ type InstanceAdmin = {
55
56
  getOfferFilter: () => string[];
56
57
  getInstallation: () => Installation;
57
58
  exitAllSeats: (completion: Completion) => void;
58
- failAllSeats: ShutdownWithFailure;
59
+ failAllSeats: import("@agoric/swingset-vat").ShutdownWithFailure;
59
60
  stopAcceptingOffers: () => void;
60
61
  isBlocked: (string: string) => boolean;
61
62
  initDelayedState: (handleOfferObj: HandleOfferObj, publicFacet: unknown) => void;
@@ -72,24 +73,26 @@ type HandleOfferObj = {
72
73
  type ZoeInstanceAdminMakeInvitation = (invitationHandle: InvitationHandle, description: string, customDetails?: Record<string, any> | undefined, proposalShape?: Pattern) => Invitation;
73
74
  type ZoeInstanceAdmin = {
74
75
  makeInvitation: ZoeInstanceAdminMakeInvitation;
75
- saveIssuer: (issuerP: ERef<Issuer>, keyword: Keyword) => Promise<IssuerRecord>;
76
+ saveIssuer: <I extends Issuer>(issuerP: ERef<I>, keyword: Keyword) => Promise<I extends Issuer<infer K, infer M> ? IssuerRecord<K, M> : never>;
76
77
  makeZoeMint: MakeZoeMint;
77
78
  registerFeeMint: RegisterFeeMint;
78
79
  makeNoEscrowSeat: MakeNoEscrowSeat;
79
80
  replaceAllocations: ReplaceAllocations;
80
81
  exitAllSeats: (completion: Completion) => void;
81
- failAllSeats: ShutdownWithFailure;
82
+ failAllSeats: import("@agoric/swingset-vat").ShutdownWithFailure;
82
83
  exitSeat: (seatHandle: SeatHandle, completion: Completion) => void;
83
84
  failSeat: (seatHandle: SeatHandle, reason: Error) => void;
84
85
  stopAcceptingOffers: () => void;
85
86
  setOfferFilter: (strings: Array<string>) => void;
86
87
  getOfferFilter: () => Array<string>;
87
88
  getExitSubscriber: (seatHandle: SeatHandle) => Subscriber<AmountKeywordRecord>;
89
+ repairContractCompletionWatcher: () => void;
88
90
  };
89
- type RegisterFeeMint = (keyword: Keyword, allegedFeeMintAccess: FeeMintAccess) => ZoeMint<'nat'>;
91
+ type RegisterFeeMint = (keyword: Keyword, allegedFeeMintAccess: FeeMintAccess) => ZoeMint<"nat">;
90
92
  type WrapIssuerKitWithZoeMint = (keyword: Keyword, localIssuerKit: IssuerKit) => any;
91
- type MakeZoeMint = (keyword: Keyword, assetKind?: AssetKind | undefined, displayInfo?: AdditionalDisplayInfo | undefined, options?: Partial<{
92
- elementShape: any;
93
+ type MakeZoeMint = (keyword: Keyword, assetKind?: globalThis.AssetKind | undefined, displayInfo?: globalThis.AdditionalDisplayInfo | undefined, options?: Partial<{
94
+ elementShape: Pattern;
95
+ recoverySetsOption: import("@agoric/ertp/src/types").RecoverySetsOption;
93
96
  }> | undefined) => ZoeMint;
94
97
  type MakeNoEscrowSeat = (initialAllocation: Allocation, proposal: ProposalRecord, exitObj: ExitObj, seatHandle: SeatHandle) => UserSeat;
95
98
  type ReplaceAllocations = (seatHandleAllocations: SeatHandleAllocation[]) => any;
@@ -97,7 +100,7 @@ type SeatHandleAllocation = {
97
100
  seatHandle: SeatHandle;
98
101
  allocation: Allocation;
99
102
  };
100
- type ZoeMint<K extends AssetKind = AssetKind> = {
103
+ type ZoeMint<K extends AssetKind = globalThis.AssetKind> = {
101
104
  getIssuerRecord: () => IssuerRecord<K>;
102
105
  mintAndEscrow: (totalToMint: Amount<K>) => void;
103
106
  /**
@@ -114,7 +117,7 @@ type ZCFRoot = {
114
117
  };
115
118
  type ExecuteContractResult = {
116
119
  creatorFacet: object;
117
- creatorInvitation: Promise<Invitation>;
120
+ creatorInvitation?: Promise<Invitation<unknown, undefined>> | undefined;
118
121
  publicFacet: object;
119
122
  handleOfferObj: HandleOfferObj;
120
123
  };
@@ -124,7 +127,7 @@ type MakeExitObj = (proposal: ProposalRecord, zoeSeatAdmin: ZCFSeat) => ExitObj;
124
127
  type ExitObj = {
125
128
  exit: () => void;
126
129
  };
127
- type SeatHandle = Handle<'Seat'>;
130
+ type SeatHandle = Handle<"Seat">;
128
131
  /**
129
132
  * Get the assetKind for a brand known by Zoe
130
133
  *
@@ -146,32 +149,18 @@ type ZcfSeatManager = {
146
149
  type ZcfMintReallocator = {
147
150
  reallocate: (zcfSeat: ZCFSeat, newAllocation: Allocation) => void;
148
151
  };
149
- /**
150
- * The SeatManager holds the active zcfSeats and can reallocate and
151
- * make new zcfSeats.
152
- */
153
- type CreateSeatManager = (zoeInstanceAdmin: ERef<ZoeInstanceAdmin>, getAssetKindByBrand: GetAssetKindByBrand, shutdownWithFailure: ShutdownWithFailure, zcfBaggage: MapStore<string, unknown>) => {
154
- seatManager: ZcfSeatManager;
155
- zcfMintReallocator: ZcfMintReallocator;
156
- };
157
152
  /**
158
153
  * Add an issuer and its keyword to the instanceRecord for the
159
154
  * contract instance
160
155
  */
161
156
  type InstanceStateAddIssuer = (keyword: Keyword, issuerRecord: IssuerRecord) => void;
162
- type InstanceStateGetTerms = () => AnyTerms;
163
- type InstanceStateGetInstallation = () => Installation;
164
- type InstanceRecordGetIssuers = () => IssuerKeywordRecord;
165
- type InstanceRecordGetBrands = () => BrandKeywordRecord;
166
157
  type InstanceState = {
167
158
  addIssuer: InstanceStateAddIssuer;
168
- getInstanceRecord: GetInstanceRecord;
169
- getTerms: InstanceStateGetTerms;
170
- getInstallation: InstanceStateGetInstallation;
171
- getIssuers: InstanceRecordGetIssuers;
172
- getBrands: InstanceRecordGetBrands;
159
+ getInstanceRecord: () => InstanceRecord;
160
+ getTerms: () => AnyTerms;
161
+ getInstallation: () => Installation;
162
+ getIssuers: () => IssuerKeywordRecord;
163
+ getBrands: () => BrandKeywordRecord;
173
164
  assertUniqueKeyword: (keyword: Keyword) => void;
174
165
  };
175
- type GetInstanceRecord = () => InstanceRecord;
176
- type IssuerStorageGetIssuerRecords = (issuers: Issuer[]) => IssuerRecords;
177
166
  //# sourceMappingURL=internal-types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"internal-types.d.ts","sourceRoot":"","sources":["internal-types.js"],"names":[],"mappings":";cAIc,cAAc;uBACd,UAAU;gBACV,UAAU;gBACV,MAAM;;;;;qCAOT,UAAU,KACR,qBAAqB;;mCAKR,UAAU,KAAK,qBAAqB;;;qCAKjC,YAAY,KAAK,IAAI;8BACrB,YAAY,KAAK,OAAO;;;cAKvC,QAAQ;kBACR,YAAY;;;;;+CAMf,UAAU,uBACV,mBAAmB,YACnB,cAAc,iBACd,aAAa,WACb,KAAK,OAAO,CAAC,gBACb,KAAK,OAAO,CAAC,yCAEX,eAAe;sCAKjB,UAAU,KACR,IAAI;;oCAKU,UAAU,KAAK,IAAI;UAChC,gBAAgB;;;;;UAChB,mBAAmB;uBAEnB,MAAM,WAAW,mBAAmB,CAAC;;;wBASrC,QAAQ,OAAO,CAAC;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