@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,4 +1,4 @@
1
- export function provideEscrowStorage(baggage: MapStore<string, unknown>): {
1
+ export function provideEscrowStorage(baggage: import("@agoric/vat-data").Baggage): {
2
2
  createPurse: CreatePurse;
3
3
  provideLocalPurse: ProvideLocalPurse;
4
4
  withdrawPayments: WithdrawPayments;
@@ -1 +1 @@
1
- {"version":3,"file":"escrowStorage.d.ts","sourceRoot":"","sources":["escrowStorage.js"],"names":[],"mappings":"AAkBO;;;;;EAkHN"}
1
+ {"version":3,"file":"escrowStorage.d.ts","sourceRoot":"","sources":["escrowStorage.js"],"names":[],"mappings":"AAiBO,8CAFI,OAAO,kBAAkB,EAAE,OAAO;;;;;EA8G5C"}
@@ -1,14 +1,13 @@
1
1
  import { AmountMath } from '@agoric/ertp';
2
2
  import { E } from '@endo/eventual-send';
3
3
  import { q, Fail } from '@agoric/assert';
4
- import { objectMap } from '@agoric/internal';
4
+ import { deeplyFulfilledObject, objectMap } from '@agoric/internal';
5
5
  import { provideDurableWeakMapStore } from '@agoric/vat-data';
6
6
 
7
- import './types.js';
7
+ /// <reference path="./types.js" />
8
8
  import './internal-types.js';
9
9
 
10
10
  import { cleanKeywords } from '../cleanProposal.js';
11
- import { arrayToObj } from '../objArrayConversion.js';
12
11
 
13
12
  /**
14
13
  * Store the pool purses whose purpose is to escrow assets, with one
@@ -17,7 +16,7 @@ import { arrayToObj } from '../objArrayConversion.js';
17
16
  * @param {import('@agoric/vat-data').Baggage} baggage
18
17
  */
19
18
  export const provideEscrowStorage = baggage => {
20
- /** @type {WeakMapStore<Brand, ERef<Purse>>} */
19
+ /** @type {WeakMapStore<Brand, Purse>} */
21
20
  const brandToPurse = provideDurableWeakMapStore(baggage, 'brandToPurse');
22
21
 
23
22
  /** @type {CreatePurse} */
@@ -76,7 +75,6 @@ export const provideEscrowStorage = baggage => {
76
75
  const depositPayments = async (proposal, payments) => {
77
76
  const { give, want } = proposal;
78
77
  const giveKeywords = Object.keys(give);
79
- const wantKeywords = Object.keys(want);
80
78
  const paymentKeywords = cleanKeywords(payments);
81
79
 
82
80
  // Assert that all of the payment keywords are present in the give
@@ -91,35 +89,30 @@ export const provideEscrowStorage = baggage => {
91
89
  )}`;
92
90
  });
93
91
 
94
- const proposalKeywords = harden([...giveKeywords, ...wantKeywords]);
95
-
96
- // If any of these deposits hang or fail, then depositPayments
92
+ // If any of these deposits hang or fail, then this `await` also
97
93
  // hangs or fails, the offer does not succeed, and any funds that
98
94
  // were deposited into the pool purses are lost. We have a ticket
99
95
  // for giving the user a refund of what was already deposited, and
100
96
  // offer safety and payout liveness are still meaningful as long
101
97
  // as issuers are well-behaved. For more, see
102
98
  // https://github.com/Agoric/agoric-sdk/issues/1271
103
- const amountsDeposited = await Promise.all(
104
- giveKeywords.map(keyword => {
105
- payments[keyword] !== undefined ||
106
- Fail`The ${q(
107
- keyword,
108
- )} keyword in proposal.give did not have an associated payment in the paymentKeywordRecord, which had keywords: ${q(
109
- paymentKeywords,
110
- )}`;
111
- return doDepositPayment(payments[keyword], give[keyword]);
112
- }),
113
- );
114
-
115
- const emptyAmountsForWantKeywords = wantKeywords.map(keyword =>
116
- AmountMath.makeEmptyFromAmount(want[keyword]),
117
- );
99
+ const depositPs = objectMap(give, (amount, keyword) => {
100
+ payments[keyword] !== undefined ||
101
+ Fail`The ${q(
102
+ keyword,
103
+ )} keyword in proposal.give did not have an associated payment in the paymentKeywordRecord, which had keywords: ${q(
104
+ paymentKeywords,
105
+ )}`;
106
+ return doDepositPayment(payments[keyword], amount);
107
+ });
108
+ const deposits = await deeplyFulfilledObject(depositPs);
118
109
 
119
- const initialAllocation = arrayToObj(
120
- [...amountsDeposited, ...emptyAmountsForWantKeywords],
121
- proposalKeywords,
122
- );
110
+ const initialAllocation = harden({
111
+ ...objectMap(want, amount => AmountMath.makeEmptyFromAmount(amount)),
112
+ // Deposits should win in case of overlapping give/want keywords
113
+ // (which are not allowed as of 2024-01).
114
+ ...deposits,
115
+ });
123
116
 
124
117
  return initialAllocation;
125
118
  };
@@ -1,29 +1,22 @@
1
1
  export namespace defaultFeeIssuerConfig {
2
- const name: "ZDEFAULT";
3
- const assetKind: "nat";
2
+ let name: "ZDEFAULT";
3
+ let assetKind: "nat";
4
4
  namespace displayInfo {
5
- export const decimalPlaces: number;
6
- const assetKind_1: "nat";
5
+ export let decimalPlaces: number;
6
+ let assetKind_1: "nat";
7
7
  export { assetKind_1 as assetKind };
8
8
  }
9
9
  }
10
10
  /**
11
11
  * @param {import('@agoric/vat-data').Baggage} zoeBaggage
12
12
  * @param {FeeIssuerConfig} feeIssuerConfig
13
- * @param {ShutdownWithFailure} shutdownZoeVat
13
+ * @param {import('@agoric/swingset-vat').ShutdownWithFailure} shutdownZoeVat
14
14
  */
15
- export function prepareFeeMint(zoeBaggage: MapStore<string, unknown>, feeIssuerConfig: FeeIssuerConfig, shutdownZoeVat: ShutdownWithFailure): {
15
+ export function prepareFeeMint(zoeBaggage: import("@agoric/vat-data").Baggage, feeIssuerConfig: FeeIssuerConfig, shutdownZoeVat: import("@agoric/swingset-vat").ShutdownWithFailure): import("@endo/exo").GuardedKit<{
16
16
  feeMint: {
17
- getFeeIssuerKit(allegedFeeMintAccess: any): any;
18
- getFeeIssuer(): any;
19
- getFeeBrand(): any;
20
- };
21
- feeMintAccess: {};
22
- } & import("@endo/eventual-send").RemotableBrand<{}, {
23
- feeMint: {
24
- getFeeIssuerKit(allegedFeeMintAccess: any): any;
25
- getFeeIssuer(): any;
26
- getFeeBrand(): any;
17
+ getFeeIssuerKit(allegedFeeMintAccess: any): globalThis.IssuerKit<"nat">;
18
+ getFeeIssuer(): globalThis.Issuer<"nat", import("@endo/patterns").Key>;
19
+ getFeeBrand(): globalThis.Brand<"nat">;
27
20
  };
28
21
  feeMintAccess: {};
29
22
  }>;
@@ -1 +1 @@
1
- {"version":3,"file":"feeMint.d.ts","sourceRoot":"","sources":["feeMint.js"],"names":[],"mappings":";;;;;;;;;AA2BA;;;;GAIG;AACH,uFAHW,eAAe,kBACf,mBAAmB;;;;;;;;;;;;;;GAsD7B"}
1
+ {"version":3,"file":"feeMint.d.ts","sourceRoot":"","sources":["feeMint.js"],"names":[],"mappings":";;;;;;;;;AA4BA;;;;GAIG;AACH,2CAJW,OAAO,kBAAkB,EAAE,OAAO,mBAClC,eAAe,kBACf,OAAO,sBAAsB,EAAE,mBAAmB;;;;;;;GA2D5D"}
@@ -1,9 +1,9 @@
1
1
  import {
2
- makeDurableIssuerKit,
3
2
  AssetKind,
4
- prepareIssuerKit,
5
3
  IssuerShape,
6
4
  BrandShape,
5
+ prepareIssuerKit,
6
+ hasIssuer,
7
7
  } from '@agoric/ertp';
8
8
  import { initEmpty, M } from '@agoric/store';
9
9
  import {
@@ -13,8 +13,9 @@ import {
13
13
  } from '@agoric/vat-data';
14
14
  import { FeeMintAccessShape } from '../typeGuards.js';
15
15
 
16
- const { Fail } = assert;
16
+ const { Fail, quote: q } = assert;
17
17
 
18
+ /** @deprecated Redundant. Just omit it. */
18
19
  const FEE_MINT_KIT = 'FeeMintKit';
19
20
 
20
21
  export const defaultFeeIssuerConfig = harden(
@@ -28,23 +29,28 @@ export const defaultFeeIssuerConfig = harden(
28
29
  /**
29
30
  * @param {import('@agoric/vat-data').Baggage} zoeBaggage
30
31
  * @param {FeeIssuerConfig} feeIssuerConfig
31
- * @param {ShutdownWithFailure} shutdownZoeVat
32
+ * @param {import('@agoric/swingset-vat').ShutdownWithFailure} shutdownZoeVat
32
33
  */
33
34
  const prepareFeeMint = (zoeBaggage, feeIssuerConfig, shutdownZoeVat) => {
34
35
  const mintBaggage = provideDurableMapStore(zoeBaggage, 'mintBaggage');
35
- if (!mintBaggage.has(FEE_MINT_KIT)) {
36
- /** @type {IssuerKit} */
37
- const feeIssuerKit = makeDurableIssuerKit(
36
+ if (mintBaggage.has(FEE_MINT_KIT)) {
37
+ hasIssuer(mintBaggage) ||
38
+ Fail`Legacy ${q(
39
+ FEE_MINT_KIT,
40
+ )} must be redundant with normal storing of issuerKit in issuerBaggage`;
41
+ // Upgrade this legacy state by simply deleting it.
42
+ mintBaggage.delete(FEE_MINT_KIT);
43
+ }
44
+
45
+ const feeIssuerKit = /** @type {IssuerKit<'nat'>} */ (
46
+ prepareIssuerKit(
38
47
  mintBaggage,
39
48
  feeIssuerConfig.name,
40
49
  feeIssuerConfig.assetKind,
41
50
  feeIssuerConfig.displayInfo,
42
51
  shutdownZoeVat,
43
- );
44
- mintBaggage.init(FEE_MINT_KIT, feeIssuerKit);
45
- } else {
46
- prepareIssuerKit(mintBaggage, shutdownZoeVat);
47
- }
52
+ )
53
+ );
48
54
 
49
55
  const FeeMintIKit = harden({
50
56
  feeMint: M.interface('FeeMint', {
@@ -66,13 +72,13 @@ const prepareFeeMint = (zoeBaggage, feeIssuerConfig, shutdownZoeVat) => {
66
72
  const { facets } = this;
67
73
  facets.feeMintAccess === allegedFeeMintAccess ||
68
74
  Fail`The object representing access to the fee brand mint was not provided`;
69
- return mintBaggage.get(FEE_MINT_KIT);
75
+ return feeIssuerKit;
70
76
  },
71
77
  getFeeIssuer() {
72
- return mintBaggage.get(FEE_MINT_KIT).issuer;
78
+ return feeIssuerKit.issuer;
73
79
  },
74
80
  getFeeBrand() {
75
- return mintBaggage.get(FEE_MINT_KIT).brand;
81
+ return feeIssuerKit.brand;
76
82
  },
77
83
  },
78
84
  // feeMintAccess is an opaque durable object representing the right to get
@@ -1,21 +1,6 @@
1
- export function makeInstallationStorage(getBundleCapForID: GetBundleCapForID, zoeBaggage: MapStore<string, unknown>): {
1
+ export function makeInstallationStorage(getBundleCapForID: GetBundleCapForID, zoeBaggage: Baggage): import("@endo/exo").Guarded<{
2
2
  installBundle(allegedBundle: any, bundleLabel: any): any;
3
- installBundleID(bundleID: any, bundleLabel?: any): Promise<Installation<any>>;
4
- unwrapInstallation(installation: any): {
5
- bundleCap: any;
6
- bundleID: string;
7
- installation: any;
8
- bundle?: undefined;
9
- } | {
10
- bundle: SourceBundle;
11
- installation: any;
12
- bundleCap?: undefined;
13
- bundleID?: undefined;
14
- };
15
- getBundleIDFromInstallation(allegedInstallation: any): any;
16
- } & import("@endo/eventual-send").RemotableBrand<{}, {
17
- installBundle(allegedBundle: any, bundleLabel: any): any;
18
- installBundleID(bundleID: any, bundleLabel?: any): Promise<Installation<any>>;
3
+ installBundleID(bundleID: any, bundleLabel?: any): Promise<Installation<unknown>>;
19
4
  unwrapInstallation(installation: any): {
20
5
  bundleCap: any;
21
6
  bundleID: string;
@@ -29,7 +14,7 @@ export function makeInstallationStorage(getBundleCapForID: GetBundleCapForID, zo
29
14
  };
30
15
  getBundleIDFromInstallation(allegedInstallation: any): any;
31
16
  }>;
32
- export type BundleCap = import('@agoric/swingset-vat').BundleCap;
33
- export type BundleID = import('@agoric/swingset-vat').BundleID;
34
- export type Baggage = import('@agoric/vat-data').Baggage;
17
+ export type BundleCap = import("@agoric/swingset-vat").BundleCap;
18
+ export type BundleID = import("@agoric/swingset-vat").BundleID;
19
+ import type { Baggage } from '@agoric/vat-data';
35
20
  //# sourceMappingURL=installationStorage.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"installationStorage.d.ts","sourceRoot":"","sources":["installationStorage.js"],"names":[],"mappings":"AAuBO,2DAHI,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4I3B;wBAjJc,OAAO,sBAAsB,EAAE,SAAS;uBACxC,OAAO,sBAAsB,EAAE,QAAQ;sBACxC,OAAO,kBAAkB,EAAE,OAAO"}
1
+ {"version":3,"file":"installationStorage.d.ts","sourceRoot":"","sources":["installationStorage.js"],"names":[],"mappings":"AAuBO,2DAHI,iBAAiB,cACjB,OAAO;;;;;;;;;;;;;;;GA+IjB;wBArJc,OAAO,sBAAsB,EAAE,SAAS;uBACxC,OAAO,sBAAsB,EAAE,QAAQ;6BAC3B,kBAAkB"}
@@ -15,7 +15,7 @@ const { Fail, quote: q } = assert;
15
15
 
16
16
  /** @typedef { import('@agoric/swingset-vat').BundleCap} BundleCap */
17
17
  /** @typedef { import('@agoric/swingset-vat').BundleID} BundleID */
18
- /** @typedef {import('@agoric/vat-data').Baggage} Baggage */
18
+ /** @import {Baggage} from '@agoric/vat-data' */
19
19
 
20
20
  /**
21
21
  * @param {GetBundleCapForID} getBundleCapForID
@@ -33,20 +33,24 @@ export const makeInstallationStorage = (getBundleCapForID, zoeBaggage) => {
33
33
  'installationsBundle',
34
34
  );
35
35
 
36
+ /** @type {(bundleLabel: string) => Installation<unknown>} */
36
37
  const makeBundleIDInstallation = prepareKind(
37
38
  zoeBaggage,
38
39
  'BundleIDInstallation',
39
40
  bundleLabel => ({ bundleLabel }),
41
+ // @ts-expect-error cast without StartFunction property
40
42
  {
41
43
  getBundle: _context => Fail`bundleID-based Installation`,
42
44
  getBundleLabel: ({ state: { bundleLabel } }) => bundleLabel,
43
45
  },
44
46
  );
45
47
 
48
+ /** @type {(bundle: SourceBundle, bundleLabel?: string) => Installation<unknown>} */
46
49
  const makeBundleInstallation = prepareKind(
47
50
  zoeBaggage,
48
51
  'BundleInstallation',
49
52
  (bundle, bundleLabel) => ({ bundle, bundleLabel }),
53
+ // @ts-expect-error cast without StartFunction property
50
54
  {
51
55
  getBundle: ({ state: { bundle } }) => bundle,
52
56
  getBundleLabel: ({ state: { bundleLabel } }) => bundleLabel,
@@ -68,8 +72,6 @@ export const makeInstallationStorage = (getBundleCapForID, zoeBaggage) => {
68
72
  typeof bundle === 'object' || Fail`a bundle must be provided`;
69
73
  /** @type {Installation} */
70
74
  bundle || Fail`a bundle must be provided`;
71
- /** @type {Installation} */
72
- // @ts-expect-error cast
73
75
  const installation = makeBundleInstallation(bundle, bundleLabel);
74
76
  installationsBundle.init(installation, bundle);
75
77
  return installation;
@@ -81,8 +83,12 @@ export const makeInstallationStorage = (getBundleCapForID, zoeBaggage) => {
81
83
  InstanceHandleShape,
82
84
  M.recordOf(M.string(), M.string({ stringLengthLimit: Infinity })),
83
85
  ),
84
- ).returns(M.promise()),
85
- installBundleID: M.call(M.string()).returns(M.promise()),
86
+ )
87
+ .optional(M.string())
88
+ .returns(M.promise()),
89
+ installBundleID: M.call(M.string())
90
+ .optional(M.string())
91
+ .returns(M.promise()),
86
92
  unwrapInstallation: M.callWhen(M.await(InstallationShape)).returns(
87
93
  UnwrappedInstallationShape,
88
94
  ),
@@ -125,8 +131,6 @@ export const makeInstallationStorage = (getBundleCapForID, zoeBaggage) => {
125
131
  const bundleCap = await getBundleCapForID(bundleID);
126
132
  // AWAIT
127
133
 
128
- /** @type {Installation} */
129
- // @ts-expect-error cast
130
134
  const installation = makeBundleIDInstallation(bundleLabel);
131
135
  installationsBundleCap.init(
132
136
  installation,
@@ -1,4 +1,4 @@
1
- export function makeInstanceAdminStorage(baggage: MapStore<string, unknown>): {
1
+ export function makeInstanceAdminStorage(baggage: import("@agoric/vat-data").Baggage): import("@endo/exo").GuardedKit<{
2
2
  accessor: {
3
3
  getPublicFacet(instance: any): any;
4
4
  getBrands(instance: any): any;
@@ -9,25 +9,11 @@ export function makeInstanceAdminStorage(baggage: MapStore<string, unknown>): {
9
9
  getInstanceAdmin(instance: any): any;
10
10
  };
11
11
  updater: {
12
- initInstanceAdmin(instance: any, instanceAdmin: any): Promise<any>;
13
- deleteInstanceAdmin(instance: any): any;
14
- };
15
- } & import("@endo/eventual-send").RemotableBrand<{}, {
16
- accessor: {
17
- getPublicFacet(instance: any): any;
18
- getBrands(instance: any): any;
19
- getIssuers(instance: any): any;
20
- getTerms(instance: any): any;
21
- getOfferFilter(instance: any): any;
22
- getInstallation(instance: any): any;
23
- getInstanceAdmin(instance: any): any;
24
- };
25
- updater: {
26
- initInstanceAdmin(instance: any, instanceAdmin: any): Promise<any>;
27
- deleteInstanceAdmin(instance: any): any;
12
+ initInstanceAdmin(instance: any, instanceAdmin: any): Promise<void>;
13
+ deleteInstanceAdmin(instance: any): void;
28
14
  };
29
15
  }>;
30
- export function makeInstanceAdminMaker(zoeBaggage: MapStore<string, unknown>, seatHandleToZoeSeatAdmin: WeakMapStore<SeatHandle, ZoeSeatAdmin>): (instanceHandle: any, zoeInstanceStorageManager: any, adminNode: any) => import("@agoric/vat-data/src/types.js").KindFacet<{
16
+ export function makeInstanceAdminMaker(zoeBaggage: import("@agoric/vat-data").Baggage, seatHandleToZoeSeatAdmin: WeakMapStore<SeatHandle, ZoeSeatAdmin>): (instanceHandle: any, zoeInstanceStorageManager: any, adminNode: any) => import("@agoric/swingset-liveslots").KindFacet<{
31
17
  getPublicFacet: ({ state }: {
32
18
  state: any;
33
19
  }) => any;
@@ -66,39 +52,33 @@ export function makeInstanceAdminMaker(zoeBaggage: MapStore<string, unknown>, se
66
52
  facets: {
67
53
  helper: any;
68
54
  };
69
- }, invitationHandle: any, initialAllocation: any, proposal: any, offerArgs?: undefined) => {
70
- getProposal(): Promise<ProposalRecord>;
71
- getPayouts(): Promise<{}>;
55
+ }, invitationHandle: any, initialAllocation: any, proposal: any, offerArgs?: undefined) => import("@endo/exo").Guarded<{
56
+ getProposal(): Promise<any>;
57
+ getPayouts(): Promise<any>;
72
58
  getPayout(keyword: any): Promise<any>;
73
59
  getOfferResult(): Promise<any>;
74
- hasExited(): Promise<boolean>;
75
- tryExit(): Promise<void>;
76
- numWantsSatisfied(): Promise<0 | 1>;
77
- getExitSubscriber(): {
78
- subscribeAfter(publishCount?: bigint): Promise<any>;
79
- getUpdateSince(updateCount: any): any;
80
- };
81
- getFinalAllocation(): Promise<AmountKeywordRecord>;
82
- };
60
+ hasExited(): Promise<any>;
61
+ tryExit(): Promise<any>;
62
+ numWantsSatisfied(): Promise<any>;
63
+ getExitSubscriber(): any;
64
+ getFinalAllocation(): any;
65
+ }>;
83
66
  makeNoEscrowSeat: ({ state, facets: { helper } }: {
84
67
  state: any;
85
68
  facets: {
86
69
  helper: any;
87
70
  };
88
- }, initialAllocation: any, proposal: any, exitObj: any, seatHandle: any) => {
89
- getProposal(): Promise<ProposalRecord>;
90
- getPayouts(): Promise<{}>;
71
+ }, initialAllocation: any, proposal: any, exitObj: any, seatHandle: any) => import("@endo/exo").Guarded<{
72
+ getProposal(): Promise<any>;
73
+ getPayouts(): Promise<any>;
91
74
  getPayout(keyword: any): Promise<any>;
92
75
  getOfferResult(): Promise<any>;
93
- hasExited(): Promise<boolean>;
94
- tryExit(): Promise<void>;
95
- numWantsSatisfied(): Promise<0 | 1>;
96
- getExitSubscriber(): {
97
- subscribeAfter(publishCount?: bigint): Promise<any>;
98
- getUpdateSince(updateCount: any): any;
99
- };
100
- getFinalAllocation(): Promise<AmountKeywordRecord>;
101
- };
76
+ hasExited(): Promise<any>;
77
+ tryExit(): Promise<any>;
78
+ numWantsSatisfied(): Promise<any>;
79
+ getExitSubscriber(): any;
80
+ getFinalAllocation(): any;
81
+ }>;
102
82
  getOfferFilter: ({ state }: {
103
83
  state: any;
104
84
  }) => any;
@@ -1 +1 @@
1
- {"version":3,"file":"instanceAdminStorage.d.ts","sourceRoot":"","sources":["instanceAdminStorage.js"],"names":[],"mappings":"AAmDO;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA0DN;AA0JM,wGAFI,aAAa,UAAU,EAAE,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwChD;6BAvDY,SAAS;IACrB,WAAe,EAAE,OAAO,CAAC;IACzB,eAAmB,EAAE,OAAO,CAAC;CAC1B,CAAC;2BACQ;IACZ,kBAAsB,EAAE,MAAM,EAAE,CAAC;CAC9B;oBACS,YAAY,GAAG,cAAc;4BAC7B;IACZ,KAAS,EAAE,KAAK,CAAC;CACd"}
1
+ {"version":3,"file":"instanceAdminStorage.d.ts","sourceRoot":"","sources":["instanceAdminStorage.js"],"names":[],"mappings":"AAoDO,kDADK,OAAO,kBAAkB,EAAE,OAAO;;;;;;;;;;;;;;GA2D7C;AA0JM,mDAHI,OAAO,kBAAkB,EAAE,OAAO,4BAClC,YAAY,CAAC,UAAU,EAAE,YAAY,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwChD;6BAvDY,QAAQ,CAAC;IACrB,WAAe,EAAE,OAAO,CAAC;IACzB,eAAmB,EAAE,OAAO,CAAC;CAC1B,CAAC;2BACQ;IACZ,kBAAsB,EAAE,MAAM,EAAE,CAAC;CAC9B;oBACS,YAAY,GAAG,cAAc;4BAC7B;IACZ,KAAS,EAAE,KAAK,CAAC;CACd"}
@@ -1,3 +1,4 @@
1
+ /* eslint @typescript-eslint/no-floating-promises: "warn" */
1
2
  import {
2
3
  canBeDurable,
3
4
  makeScalarBigSetStore,
@@ -177,7 +178,7 @@ const makeInstanceAdminBehavior = (zoeBaggage, makeZoeSeatAdminKit) => {
177
178
 
178
179
  state.zoeSeatAdmins.add(zoeSeatAdmin);
179
180
  state.handleOfferObj || Fail`incomplete setup of zoe seat`;
180
- E.when(
181
+ void E.when(
181
182
  E(state.handleOfferObj).handleOffer(invitationHandle, seatData),
182
183
  /** @param {HandleOfferResult} result */
183
184
  result => zoeSeatAdmin.resolveExitAndResult(result),
@@ -32,13 +32,13 @@ type UnwrapInstallation = (installationP: ERef<Installation>) => ERef<{
32
32
  }>;
33
33
  type GetIssuerRecords = () => IssuerRecords;
34
34
  type ZoeInstanceStorageManager = {
35
- getTerms: InstanceStateGetTerms;
36
- getIssuers: InstanceRecordGetIssuers;
37
- getBrands: InstanceRecordGetBrands;
38
- saveIssuer: SaveIssuer;
35
+ getTerms: () => AnyTerms;
36
+ getIssuers: () => IssuerKeywordRecord;
37
+ getBrands: () => BrandKeywordRecord;
38
+ saveIssuer: ZCF["saveIssuer"];
39
39
  makeZoeMint: MakeZoeMint;
40
40
  registerFeeMint: RegisterFeeMint;
41
- getInstanceRecord: GetInstanceRecord;
41
+ getInstanceRecord: () => InstanceRecord;
42
42
  getIssuerRecords: GetIssuerRecords;
43
43
  initInstanceAdmin: InitInstanceAdmin;
44
44
  deleteInstanceAdmin: DeleteInstanceAdmin;
@@ -51,7 +51,7 @@ type ZoeInstanceStorageManager = {
51
51
  /**
52
52
  * of CreateVatResults
53
53
  */
54
- getAdminNode: () => import('@agoric/swingset-vat').VatAdminFacet;
54
+ getAdminNode: () => import("@agoric/swingset-vat").VatAdminFacet;
55
55
  };
56
56
  /**
57
57
  * Create a storage manager for a particular contract instance. The
@@ -59,21 +59,21 @@ type ZoeInstanceStorageManager = {
59
59
  * issuerStorage and escrowStorage from Zoe, and stores the
60
60
  * instance-specific terms
61
61
  */
62
- type MakeZoeInstanceStorageManager = (instanceBaggage: MapStore<string, unknown>, installation: Installation, customTerms: object, uncleanIssuerKeywordRecord: IssuerKeywordRecord, instance: Instance, contractBundleCap: BundleCap, instanceLabel: string) => Promise<ZoeInstanceStorageManager>;
62
+ type MakeZoeInstanceStorageManager = (instanceBaggage: import("@agoric/vat-data").Baggage, installation: Installation, customTerms: object, uncleanIssuerKeywordRecord: IssuerKeywordRecord, instance: Instance, contractBundleCap: BundleCap, instanceLabel: string) => Promise<ZoeInstanceStorageManager>;
63
63
  type GetBundleCapForID = (id: BundleID) => Promise<BundleCap>;
64
64
  type GetProposalShapeForInvitation = (invitationHandle: InvitationHandle) => Pattern | undefined;
65
65
  type ZoeStorageManager = {
66
66
  makeZoeInstanceStorageManager: MakeZoeInstanceStorageManager;
67
67
  getAssetKindByBrand: GetAssetKindByBrand;
68
68
  depositPayments: DepositPayments;
69
- invitationIssuer: Issuer<'set'>;
69
+ invitationIssuer: Issuer<"set">;
70
70
  installBundle: InstallBundle;
71
71
  installBundleID: InstallBundleID;
72
72
  getBundleIDFromInstallation: GetBundleIDFromInstallation;
73
- getPublicFacet: import('./utils.js').GetPublicFacet;
73
+ getPublicFacet: import("./utils.js").GetPublicFacet;
74
74
  getBrands: GetBrands;
75
75
  getIssuers: GetIssuers;
76
- getTerms: import('./utils').GetTerms;
76
+ getTerms: import("./utils.js").GetTerms;
77
77
  getOfferFilter: GetOfferFilter;
78
78
  setOfferFilter: SetOfferFilter;
79
79
  getInstallationForInstance: GetInstallationForInstance;
@@ -85,6 +85,6 @@ type ZoeStorageManager = {
85
85
  * Use VatAdminSvc to create a new vat, but only with the code of the
86
86
  * ZCF bundle
87
87
  */
88
- type CreateZCFVat = (contractBundleCap: BundleCap, contractLabel: string) => Promise<import('@agoric/swingset-vat').CreateVatResults>;
89
- type GetFeeIssuerKit = (feeMintAccess: FeeMintAccess) => IssuerKit<'nat'>;
88
+ type CreateZCFVat = (contractBundleCap: BundleCap, contractLabel: string) => Promise<import("@agoric/swingset-vat").CreateVatResults>;
89
+ type GetFeeIssuerKit = (feeMintAccess: FeeMintAccess) => IssuerKit<"nat">;
90
90
  //# sourceMappingURL=internal-types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"internal-types.d.ts","sourceRoot":"","sources":["internal-types.js"],"names":[],"mappings":";;;4BAMW,MAAM,SACN,KAAK,KACH,KAAK,IAAI,CAAC;;;;;;;;kCAWZ,MAAM,SACN,KAAK,KACH,KAAK;;;;;;;kCAUP,cAAc,YACd,qBAAqB,KACnB,QAAQ,UAAU,CAAC;oCAKrB,QAAQ,iBACR,aAAa,KACX,IAAI;mCAKN,QAAQ,KACN,aAAa;sCAKf,QAAQ,KACN,IAAI;;;;;0CASN,KAAK,YAAY,CAAC,KAChB,KAAK;IACjB,MAAU,CAAC,EAAE,YAAY,CAAC;IAC1B,SAAa,CAAC,EAAE,SAAS,CAAC;IAC1B,QAAY,CAAC,EAAE,QAAQ,CAAC;IACxB,YAAgB,EAAC,YAAY,CAAA;CAC1B,CAAC;;;cAWS,qBAAqB;gBACrB,wBAAwB;eACxB,uBAAuB;gBACvB,UAAU;iBACV,WAAW;qBACX,eAAe;uBACf,iBAAiB;sBACjB,gBAAgB;uBAChB,iBAAiB;yBACjB,mBAAmB;oBACnB,8BAA8B;yBAC9B,MAAM,MAAM;;;;aACZ,MAAM,MAAM;;;;kBACZ,MAAM,OAAO,sBAAsB,EAAE,aAAa;;;;;;;;gGAWrD,YAAY,eACZ,MAAM,8BACN,mBAAmB,YACnB,QAAQ,qBACR,SAAS,iBACT,MAAM,KACJ,QAAQ,yBAAyB,CAAC;8BAKpC,QAAQ,KACN,QAAQ,SAAS,CAAC;wDAKpB,gBAAgB,KACd,OAAO,GAAG,SAAS;;mCAKlB,6BAA6B;yBAC7B,mBAAmB;qBACnB,eAAe;sBACf,OAAO,KAAK,CAAC;mBACb,aAAa;qBACb,eAAe;iCACf,2BAA2B;oBAC3B,OAAO,YAAY,EAAE,cAAc;eACnC,SAAS;gBACT,UAAU;cACV,OAAO,SAAS,EAAE,QAAQ;oBAC1B,cAAc;oBACd,cAAc;gCACd,0BAA0B;sBAC1B,gBAAgB;wBAChB,kBAAkB;mCAClB,6BAA6B;;;;;;wCAQhC,SAAS,iBACT,MAAM,KACJ,QAAQ,OAAO,sBAAsB,EAAE,gBAAgB,CAAC;uCAK1D,aAAa,KACX,UAAU,KAAK,CAAC"}
1
+ {"version":3,"file":"internal-types.d.ts","sourceRoot":"","sources":["internal-types.js"],"names":[],"mappings":";;;4BAMW,MAAM,SACN,KAAK,KACH,IAAI,CAAC,IAAI,CAAC;;;;;;;;kCAWZ,MAAM,SACN,KAAK,KACH,KAAK;;;;;;;kCAUP,cAAc,YACd,qBAAqB,KACnB,OAAO,CAAC,UAAU,CAAC;oCAKrB,QAAQ,iBACR,aAAa,KACX,IAAI;mCAKN,QAAQ,KACN,aAAa;sCAKf,QAAQ,KACN,IAAI;;;;;0CASN,IAAI,CAAC,YAAY,CAAC,KAChB,IAAI,CAAC;IACjB,MAAU,CAAC,EAAE,YAAY,CAAC;IAC1B,SAAa,CAAC,EAAE,SAAS,CAAC;IAC1B,QAAY,CAAC,EAAE,QAAQ,CAAC;IACxB,YAAgB,EAAC,YAAY,CAAA;CAC1B,CAAC;8BAMQ,aAAa;;cAKZ,MAAM,QAAQ;gBACd,MAAM,mBAAmB;eACzB,MAAM,kBAAkB;gBACxB,GAAG,CAAC,YAAY,CAAC;iBACjB,WAAW;qBACX,eAAe;uBACf,MAAM,cAAc;sBACpB,gBAAgB;uBAChB,iBAAiB;yBACjB,mBAAmB;oBACnB,8BAA8B;yBAC9B,MAAM,MAAM;;;;aACZ,MAAM,MAAM;;;;kBACZ,MAAM,OAAO,sBAAsB,EAAE,aAAa;;;;;;;;uDAUrD,OAAO,kBAAkB,EAAE,OAAO,gBAClC,YAAY,eACZ,MAAM,8BACN,mBAAmB,YACnB,QAAQ,qBACR,SAAS,iBACT,MAAM,KACJ,OAAO,CAAC,yBAAyB,CAAC;8BAKpC,QAAQ,KACN,OAAO,CAAC,SAAS,CAAC;wDAKpB,gBAAgB,KACd,OAAO,GAAG,SAAS;;mCAKlB,6BAA6B;yBAC7B,mBAAmB;qBACnB,eAAe;sBACf,MAAM,CAAC,KAAK,CAAC;mBACb,aAAa;qBACb,eAAe;iCACf,2BAA2B;oBAC3B,OAAO,YAAY,EAAE,cAAc;eACnC,SAAS;gBACT,UAAU;cACV,OAAO,YAAY,EAAE,QAAQ;oBAC7B,cAAc;oBACd,cAAc;gCACd,0BAA0B;sBAC1B,gBAAgB;wBAChB,kBAAkB;mCAClB,6BAA6B;;;;;;wCAQhC,SAAS,iBACT,MAAM,KACJ,OAAO,CAAC,OAAO,sBAAsB,EAAE,gBAAgB,CAAC;uCAK1D,aAAa,KACX,SAAS,CAAC,KAAK,CAAC"}
@@ -76,13 +76,13 @@
76
76
 
77
77
  /**
78
78
  * @typedef {object} ZoeInstanceStorageManager
79
- * @property {InstanceStateGetTerms} getTerms
80
- * @property {InstanceRecordGetIssuers} getIssuers
81
- * @property {InstanceRecordGetBrands} getBrands
82
- * @property {SaveIssuer} saveIssuer
79
+ * @property {() => AnyTerms} getTerms
80
+ * @property {() => IssuerKeywordRecord} getIssuers
81
+ * @property {() => BrandKeywordRecord} getBrands
82
+ * @property {ZCF['saveIssuer']} saveIssuer
83
83
  * @property {MakeZoeMint} makeZoeMint
84
84
  * @property {RegisterFeeMint} registerFeeMint
85
- * @property {GetInstanceRecord} getInstanceRecord
85
+ * @property {() => InstanceRecord} getInstanceRecord
86
86
  * @property {GetIssuerRecords} getIssuerRecords
87
87
  * @property {InitInstanceAdmin} initInstanceAdmin
88
88
  * @property {DeleteInstanceAdmin} deleteInstanceAdmin
@@ -133,7 +133,7 @@
133
133
  * @property {import('./utils.js').GetPublicFacet} getPublicFacet
134
134
  * @property {GetBrands} getBrands
135
135
  * @property {GetIssuers} getIssuers
136
- * @property {import('./utils').GetTerms} getTerms
136
+ * @property {import('./utils.js').GetTerms} getTerms
137
137
  * @property {GetOfferFilter} getOfferFilter
138
138
  * @property {SetOfferFilter} setOfferFilter
139
139
  * @property {GetInstallationForInstance} getInstallationForInstance
@@ -1 +1 @@
1
- {"version":3,"file":"invitationQueries.d.ts","sourceRoot":"","sources":["invitationQueries.js"],"names":[],"mappings":"AAKO;;;;EA6BN"}
1
+ {"version":3,"file":"invitationQueries.d.ts","sourceRoot":"","sources":["invitationQueries.js"],"names":[],"mappings":"AAKO;;;;EA+BN"}
@@ -1,6 +1,6 @@
1
1
  // @jessie-check
2
2
 
3
- import { assert, details as X } from '@agoric/assert';
3
+ import { assert, details as X, Fail, quote as q } from '@agoric/assert';
4
4
  import { E } from '@endo/eventual-send';
5
5
 
6
6
  export const makeInvitationQueryFns = invitationIssuer => {
@@ -13,10 +13,12 @@ export const makeInvitationQueryFns = invitationIssuer => {
13
13
  assert.note(err, X`Due to ${reason}`);
14
14
  throw err;
15
15
  };
16
- return E.get(
17
- E.get(E(invitationIssuer).getAmountOf(invitationP).catch(onRejected))
18
- .value,
19
- )[0];
16
+ const invAmount = await E(invitationIssuer)
17
+ .getAmountOf(invitationP)
18
+ .catch(onRejected);
19
+ (Array.isArray(invAmount.value) && invAmount.value.length === 1) ||
20
+ Fail`Expected exactly 1 invitation, not ${q(invAmount.value.length)}`;
21
+ return invAmount.value[0];
20
22
  };
21
23
 
22
24
  /** @type {GetInstance} */
@@ -1,5 +1,5 @@
1
- export function prepareInvitationKit(baggage: MapStore<string, unknown>, shutdownZoeVat?: ShutdownWithFailure | undefined): {
2
- invitationIssuer: Issuer<"set">;
3
- invitationKit: IssuerKit<"set">;
1
+ export function prepareInvitationKit(baggage: import("@agoric/vat-data").Baggage, shutdownZoeVat?: import("@agoric/swingset-vat").ShutdownWithFailure | undefined): {
2
+ invitationIssuer: globalThis.Issuer<"set", InvitationDetails>;
3
+ invitationKit: globalThis.IssuerKit<"set", InvitationDetails>;
4
4
  };
5
5
  //# sourceMappingURL=makeInvitation.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"makeInvitation.d.ts","sourceRoot":"","sources":["makeInvitation.js"],"names":[],"mappings":"AAgBO,0FAFI,mBAAmB,GAAG,SAAS;;;EA4BzC"}
1
+ {"version":3,"file":"makeInvitation.d.ts","sourceRoot":"","sources":["makeInvitation.js"],"names":[],"mappings":"AAgBO,8CAHI,OAAO,kBAAkB,EAAE,OAAO,mBAClC,OAAO,sBAAsB,EAAE,mBAAmB,GAAG,SAAS;;;EAgCxE"}