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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (269) hide show
  1. package/README.md +7 -7
  2. package/bundles/bundle-contractFacet-js-meta.json +622 -313
  3. package/bundles/bundle-contractFacet.d.ts +3 -3
  4. package/bundles/bundle-contractFacet.js +1 -1
  5. package/exported.js +1 -12
  6. package/package.json +75 -60
  7. package/src/cleanProposal.d.ts +2 -2
  8. package/src/cleanProposal.d.ts.map +1 -1
  9. package/src/cleanProposal.js +15 -12
  10. package/src/contractFacet/exit.d.ts.map +1 -1
  11. package/src/contractFacet/exit.js +1 -0
  12. package/src/contractFacet/internal-types.d.ts +2 -2
  13. package/src/contractFacet/internal-types.d.ts.map +1 -1
  14. package/src/contractFacet/internal-types.js +1 -1
  15. package/src/contractFacet/offerHandlerStorage.d.ts +4 -1
  16. package/src/contractFacet/offerHandlerStorage.d.ts.map +1 -1
  17. package/src/contractFacet/offerHandlerStorage.js +11 -3
  18. package/src/contractFacet/reallocate.d.ts +3 -0
  19. package/src/contractFacet/reallocate.d.ts.map +1 -0
  20. package/src/contractFacet/reallocate.js +94 -0
  21. package/src/contractFacet/rightsConservation.d.ts.map +1 -1
  22. package/src/contractFacet/rightsConservation.js +3 -0
  23. package/src/contractFacet/types-ambient.d.ts +259 -0
  24. package/src/contractFacet/types-ambient.js +1 -0
  25. package/src/contractFacet/vatRoot.d.ts +4 -4
  26. package/src/contractFacet/vatRoot.d.ts.map +1 -1
  27. package/src/contractFacet/zcfMint.d.ts +5 -3
  28. package/src/contractFacet/zcfMint.d.ts.map +1 -1
  29. package/src/contractFacet/zcfMint.js +4 -4
  30. package/src/contractFacet/zcfSeat.d.ts +4 -2
  31. package/src/contractFacet/zcfSeat.d.ts.map +1 -1
  32. package/src/contractFacet/zcfSeat.js +125 -5
  33. package/src/contractFacet/zcfZygote.d.ts +1 -2
  34. package/src/contractFacet/zcfZygote.d.ts.map +1 -1
  35. package/src/contractFacet/zcfZygote.js +95 -42
  36. package/src/contractSupport/atomicTransfer.d.ts +0 -6
  37. package/src/contractSupport/atomicTransfer.d.ts.map +1 -1
  38. package/src/contractSupport/atomicTransfer.js +5 -90
  39. package/src/contractSupport/bondingCurves.js +2 -2
  40. package/src/contractSupport/durability.d.ts +3 -3
  41. package/src/contractSupport/durability.d.ts.map +1 -1
  42. package/src/contractSupport/durability.js +5 -5
  43. package/src/contractSupport/index.d.ts +1 -0
  44. package/src/contractSupport/index.js +1 -0
  45. package/src/contractSupport/prepare-ownable.d.ts +11 -0
  46. package/src/contractSupport/prepare-ownable.d.ts.map +1 -0
  47. package/src/contractSupport/prepare-ownable.js +100 -0
  48. package/src/contractSupport/priceAuthority.d.ts +23 -15
  49. package/src/contractSupport/priceAuthority.d.ts.map +1 -1
  50. package/src/contractSupport/priceAuthority.js +32 -17
  51. package/src/contractSupport/priceAuthorityInitial.d.ts +3 -2
  52. package/src/contractSupport/priceAuthorityInitial.d.ts.map +1 -1
  53. package/src/contractSupport/priceAuthorityInitial.js +5 -2
  54. package/src/contractSupport/priceAuthorityQuoteMint.d.ts +2 -1
  55. package/src/contractSupport/priceAuthorityQuoteMint.d.ts.map +1 -1
  56. package/src/contractSupport/priceAuthorityQuoteMint.js +23 -27
  57. package/src/contractSupport/priceAuthorityTransform.d.ts +14 -12
  58. package/src/contractSupport/priceAuthorityTransform.d.ts.map +1 -1
  59. package/src/contractSupport/priceAuthorityTransform.js +10 -8
  60. package/src/contractSupport/priceQuote.d.ts +7 -5
  61. package/src/contractSupport/priceQuote.d.ts.map +1 -1
  62. package/src/contractSupport/priceQuote.js +5 -1
  63. package/src/contractSupport/ratio.d.ts +2 -2
  64. package/src/contractSupport/ratio.d.ts.map +1 -1
  65. package/src/contractSupport/ratio.js +19 -15
  66. package/src/contractSupport/recorder.d.ts +31 -117
  67. package/src/contractSupport/recorder.d.ts.map +1 -1
  68. package/src/contractSupport/recorder.js +21 -10
  69. package/src/contractSupport/safeMath.d.ts +7 -7
  70. package/src/contractSupport/safeMath.d.ts.map +1 -1
  71. package/src/contractSupport/statistics.d.ts +1 -1
  72. package/src/contractSupport/statistics.d.ts.map +1 -1
  73. package/src/contractSupport/topics.d.ts +1 -1
  74. package/src/contractSupport/topics.d.ts.map +1 -1
  75. package/src/contractSupport/{types.d.ts → types-ambient.d.ts} +4 -4
  76. package/src/contractSupport/types-ambient.d.ts.map +1 -0
  77. package/src/contractSupport/{types.js → types-ambient.js} +1 -1
  78. package/src/contractSupport/zoeHelpers.d.ts +1 -1
  79. package/src/contractSupport/zoeHelpers.d.ts.map +1 -1
  80. package/src/contractSupport/zoeHelpers.js +5 -11
  81. package/src/contracts/auction/firstPriceLogic.d.ts.map +1 -1
  82. package/src/contracts/auction/firstPriceLogic.js +5 -8
  83. package/src/contracts/auction/index.d.ts +10 -10
  84. package/src/contracts/auction/index.d.ts.map +1 -1
  85. package/src/contracts/auction/index.js +2 -1
  86. package/src/contracts/auction/secondPriceLogic.d.ts.map +1 -1
  87. package/src/contracts/auction/secondPriceLogic.js +1 -4
  88. package/src/contracts/automaticRefund.d.ts +1 -1
  89. package/src/contracts/automaticRefund.d.ts.map +1 -1
  90. package/src/contracts/autoswap.d.ts.map +1 -1
  91. package/src/contracts/autoswap.js +8 -9
  92. package/src/contracts/barterExchange.d.ts +1 -1
  93. package/src/contracts/barterExchange.d.ts.map +1 -1
  94. package/src/contracts/barterExchange.js +2 -3
  95. package/src/contracts/callSpread/calculateShares.d.ts +1 -8
  96. package/src/contracts/callSpread/calculateShares.d.ts.map +1 -1
  97. package/src/contracts/callSpread/calculateShares.js +1 -1
  98. package/src/contracts/callSpread/fundedCallSpread.d.ts +4 -0
  99. package/src/contracts/callSpread/fundedCallSpread.d.ts.map +1 -1
  100. package/src/contracts/callSpread/fundedCallSpread.js +6 -4
  101. package/src/contracts/callSpread/payoffHandler.d.ts.map +1 -1
  102. package/src/contracts/callSpread/payoffHandler.js +2 -1
  103. package/src/contracts/callSpread/percent.d.ts +2 -4
  104. package/src/contracts/callSpread/percent.d.ts.map +1 -1
  105. package/src/contracts/callSpread/position.d.ts +2 -2
  106. package/src/contracts/callSpread/pricedCallSpread.d.ts +6 -5
  107. package/src/contracts/callSpread/pricedCallSpread.d.ts.map +1 -1
  108. package/src/contracts/callSpread/pricedCallSpread.js +8 -4
  109. package/src/contracts/callSpread/{types.d.ts → types-ambient.d.ts} +3 -3
  110. package/src/contracts/callSpread/types-ambient.d.ts.map +1 -0
  111. package/src/contracts/coveredCall-durable.d.ts +2 -4
  112. package/src/contracts/coveredCall-durable.d.ts.map +1 -1
  113. package/src/contracts/exported.js +3 -3
  114. package/src/contracts/loan/borrow.d.ts.map +1 -1
  115. package/src/contracts/loan/borrow.js +7 -4
  116. package/src/contracts/loan/close.d.ts.map +1 -1
  117. package/src/contracts/loan/close.js +3 -7
  118. package/src/contracts/loan/index.d.ts +5 -1
  119. package/src/contracts/loan/index.d.ts.map +1 -1
  120. package/src/contracts/loan/index.js +4 -0
  121. package/src/contracts/loan/liquidate.d.ts +1 -12
  122. package/src/contracts/loan/liquidate.d.ts.map +1 -1
  123. package/src/contracts/loan/liquidate.js +4 -2
  124. package/src/contracts/loan/scheduleLiquidation.d.ts.map +1 -1
  125. package/src/contracts/loan/scheduleLiquidation.js +1 -0
  126. package/src/contracts/loan/{types.d.ts → types-ambient.d.ts} +16 -17
  127. package/src/contracts/loan/types-ambient.d.ts.map +1 -0
  128. package/src/contracts/loan/{types.js → types-ambient.js} +11 -18
  129. package/src/contracts/loan/updateDebt.js +1 -1
  130. package/src/contracts/mintAndSellNFT.d.ts.map +1 -1
  131. package/src/contracts/mintPayments.d.ts +14 -6
  132. package/src/contracts/mintPayments.d.ts.map +1 -1
  133. package/src/contracts/mintPayments.js +1 -1
  134. package/src/contracts/oracle.d.ts +25 -3
  135. package/src/contracts/oracle.d.ts.map +1 -1
  136. package/src/contracts/oracle.js +7 -0
  137. package/src/contracts/otcDesk.d.ts +3 -3
  138. package/src/contracts/otcDesk.d.ts.map +1 -1
  139. package/src/contracts/otcDesk.js +1 -1
  140. package/src/contracts/priceAggregator.d.ts +112 -18
  141. package/src/contracts/priceAggregator.d.ts.map +1 -1
  142. package/src/contracts/priceAggregator.js +16 -18
  143. package/src/contracts/priceAggregatorTypes.d.ts +2 -2
  144. package/src/contracts/priceAggregatorTypes.d.ts.map +1 -1
  145. package/src/contracts/scaledPriceAuthority.d.ts +4 -5
  146. package/src/contracts/scaledPriceAuthority.d.ts.map +1 -1
  147. package/src/contracts/scaledPriceAuthority.js +6 -0
  148. package/src/contracts/sellItems.d.ts +2 -2
  149. package/src/contracts/sellItems.d.ts.map +1 -1
  150. package/src/contracts/sellItems.js +2 -3
  151. package/src/contracts/simpleExchange.d.ts +3 -3
  152. package/src/contracts/{types.d.ts → types-ambient.d.ts} +1 -1
  153. package/src/contracts/types-ambient.d.ts.map +1 -0
  154. package/src/handleWarning.d.ts.map +1 -1
  155. package/src/instanceRecordStorage.d.ts +1 -1
  156. package/src/instanceRecordStorage.d.ts.map +1 -1
  157. package/src/internal-types.d.ts +20 -32
  158. package/src/internal-types.d.ts.map +1 -1
  159. package/src/internal-types.js +18 -58
  160. package/src/issuerRecord.d.ts +2 -2
  161. package/src/issuerRecord.d.ts.map +1 -1
  162. package/src/issuerStorage.d.ts +4 -4
  163. package/src/issuerStorage.d.ts.map +1 -1
  164. package/src/issuerStorage.js +12 -28
  165. package/src/makeHandle.d.ts +2 -2
  166. package/src/makeHandle.d.ts.map +1 -1
  167. package/src/makeHandle.js +1 -1
  168. package/src/typeGuards.d.ts +119 -20
  169. package/src/typeGuards.d.ts.map +1 -1
  170. package/src/typeGuards.js +18 -9
  171. package/src/types-ambient.d.ts +41 -0
  172. package/src/types-ambient.d.ts.map +1 -0
  173. package/src/{types.js → types-ambient.js} +6 -14
  174. package/src/zoeService/escrowStorage.d.ts +1 -1
  175. package/src/zoeService/escrowStorage.d.ts.map +1 -1
  176. package/src/zoeService/escrowStorage.js +20 -27
  177. package/src/zoeService/feeMint.d.ts +9 -16
  178. package/src/zoeService/feeMint.d.ts.map +1 -1
  179. package/src/zoeService/feeMint.js +21 -15
  180. package/src/zoeService/installationStorage.d.ts +5 -20
  181. package/src/zoeService/installationStorage.d.ts.map +1 -1
  182. package/src/zoeService/installationStorage.js +11 -7
  183. package/src/zoeService/instanceAdminStorage.d.ts +22 -42
  184. package/src/zoeService/instanceAdminStorage.d.ts.map +1 -1
  185. package/src/zoeService/instanceAdminStorage.js +1 -0
  186. package/src/zoeService/internal-types.d.ts +16 -16
  187. package/src/zoeService/internal-types.d.ts.map +1 -1
  188. package/src/zoeService/internal-types.js +6 -6
  189. package/src/zoeService/invitationQueries.d.ts.map +1 -1
  190. package/src/zoeService/invitationQueries.js +7 -5
  191. package/src/zoeService/makeInvitation.d.ts +3 -3
  192. package/src/zoeService/makeInvitation.d.ts.map +1 -1
  193. package/src/zoeService/makeInvitation.js +25 -21
  194. package/src/zoeService/offer/burnInvitation.d.ts.map +1 -1
  195. package/src/zoeService/offer/offer.d.ts.map +1 -1
  196. package/src/zoeService/offer/offer.js +2 -5
  197. package/src/zoeService/originalZoeSeat.d.ts +34 -0
  198. package/src/zoeService/originalZoeSeat.d.ts.map +1 -0
  199. package/src/zoeService/originalZoeSeat.js +353 -0
  200. package/src/zoeService/startInstance.d.ts +3 -3
  201. package/src/zoeService/startInstance.d.ts.map +1 -1
  202. package/src/zoeService/startInstance.js +17 -11
  203. package/src/zoeService/{types.d.ts → types-ambient.d.ts} +26 -31
  204. package/src/zoeService/types-ambient.d.ts.map +1 -0
  205. package/src/zoeService/{types.js → types-ambient.js} +19 -32
  206. package/src/zoeService/utils.d.ts +54 -58
  207. package/src/zoeService/utils.test-d.d.ts +2 -0
  208. package/src/zoeService/utils.test-d.d.ts.map +1 -0
  209. package/src/zoeService/utils.test-d.ts +33 -0
  210. package/src/zoeService/zoe.d.ts +9 -13
  211. package/src/zoeService/zoe.d.ts.map +1 -1
  212. package/src/zoeService/zoe.js +7 -7
  213. package/src/zoeService/zoeSeat.d.ts +15 -45
  214. package/src/zoeService/zoeSeat.d.ts.map +1 -1
  215. package/src/zoeService/zoeSeat.js +214 -114
  216. package/src/zoeService/zoeStorageManager.d.ts +9 -43
  217. package/src/zoeService/zoeStorageManager.d.ts.map +1 -1
  218. package/src/zoeService/zoeStorageManager.js +8 -6
  219. package/tools/fakePriceAuthority.d.ts +9 -8
  220. package/tools/fakePriceAuthority.d.ts.map +1 -1
  221. package/tools/fakePriceAuthority.js +21 -17
  222. package/tools/fakeVatAdmin.d.ts +10 -10
  223. package/tools/manualPriceAuthority.d.ts +11 -6
  224. package/tools/manualPriceAuthority.d.ts.map +1 -1
  225. package/tools/manualPriceAuthority.js +15 -2
  226. package/tools/manualTimer.d.ts +21 -40
  227. package/tools/manualTimer.d.ts.map +1 -1
  228. package/tools/manualTimer.js +30 -16
  229. package/tools/prepare-test-env.js +1 -1
  230. package/tools/scriptedOracle.d.ts +3 -3
  231. package/tools/scriptedOracle.d.ts.map +1 -1
  232. package/tools/scriptedOracle.js +1 -1
  233. package/tools/scriptedPriceAuthority.d.ts +4 -0
  234. package/tools/scriptedPriceAuthority.d.ts.map +1 -1
  235. package/tools/scriptedPriceAuthority.js +6 -1
  236. package/tools/setup-zoe.d.ts +8 -9
  237. package/tools/setup-zoe.d.ts.map +1 -1
  238. package/tools/setup-zoe.js +16 -1
  239. package/tools/test-utils.d.ts +20 -0
  240. package/tools/test-utils.d.ts.map +1 -0
  241. package/tools/test-utils.js +26 -0
  242. package/tools/types.d.ts +21 -21
  243. package/tools/types.d.ts.map +1 -1
  244. package/tools/types.js +10 -10
  245. package/CHANGELOG.md +0 -1203
  246. package/src/contractFacet/types.d.ts +0 -191
  247. package/src/contractFacet/types.d.ts.map +0 -1
  248. package/src/contractFacet/types.js +0 -256
  249. package/src/contractSupport/types.d.ts.map +0 -1
  250. package/src/contracts/callSpread/types.d.ts.map +0 -1
  251. package/src/contracts/loan/types.d.ts.map +0 -1
  252. package/src/contracts/types.d.ts.map +0 -1
  253. package/src/objArrayConversion.d.ts +0 -5
  254. package/src/objArrayConversion.d.ts.map +0 -1
  255. package/src/objArrayConversion.js +0 -35
  256. package/src/types.d.ts +0 -45
  257. package/src/types.d.ts.map +0 -1
  258. package/src/zoeService/types.d.ts.map +0 -1
  259. package/tools/internal-types.d.ts +0 -12
  260. package/tools/internal-types.d.ts.map +0 -1
  261. package/tools/internal-types.js +0 -14
  262. package/tools/priceAuthorityRegistry.d.ts +0 -20
  263. package/tools/priceAuthorityRegistry.d.ts.map +0 -1
  264. package/tools/priceAuthorityRegistry.js +0 -209
  265. package/tools/types-ambient.d.ts +0 -142
  266. package/tools/types-ambient.d.ts.map +0 -1
  267. package/tools/types-ambient.js +0 -160
  268. /package/src/contracts/callSpread/{types.js → types-ambient.js} +0 -0
  269. /package/src/contracts/{types.js → types-ambient.js} +0 -0
@@ -1,7 +1,7 @@
1
+ import { deeplyFulfilledObject, objectMap } from '@agoric/internal';
1
2
  import { provideDurableWeakMapStore } from '@agoric/vat-data';
2
3
  import { E } from '@endo/eventual-send';
3
4
 
4
- import { arrayToObj } from './objArrayConversion.js';
5
5
  import { cleanKeywords } from './cleanProposal.js';
6
6
  import { makeIssuerRecord } from './issuerRecord.js';
7
7
 
@@ -124,11 +124,6 @@ export const provideIssuerStorage = zcfBaggage => {
124
124
  return getByBrand(brand);
125
125
  };
126
126
 
127
- const storeIssuers = issuers => {
128
- assertInstantiated();
129
- return Promise.all(issuers.map(storeIssuer));
130
- };
131
-
132
127
  /** @type {GetAssetKindByBrand} */
133
128
  const getAssetKindByBrand = brand => {
134
129
  assertInstantiated();
@@ -143,28 +138,14 @@ export const provideIssuerStorage = zcfBaggage => {
143
138
  */
144
139
  const storeIssuerKeywordRecord = async uncleanIssuerKeywordRecord => {
145
140
  assertInstantiated();
146
- const keywords = cleanKeywords(uncleanIssuerKeywordRecord);
147
- const issuerPs = keywords.map(
148
- keyword => uncleanIssuerKeywordRecord[keyword],
149
- );
150
- // The issuers may not have been seen before, so we must wait for the
151
- // issuer records to be available synchronously
152
- const issuerRecords = await storeIssuers(issuerPs);
153
- // AWAIT ///
154
-
155
- const issuers = arrayToObj(
156
- issuerRecords.map(record => record.issuer),
157
- keywords,
141
+ cleanKeywords(uncleanIssuerKeywordRecord);
142
+ const issuerRecordPs = objectMap(uncleanIssuerKeywordRecord, issuerP =>
143
+ storeIssuer(issuerP),
158
144
  );
159
- const brands = arrayToObj(
160
- issuerRecords.map(record => record.brand),
161
- keywords,
162
- );
163
-
164
- return harden({
165
- issuers,
166
- brands,
167
- });
145
+ const issuerRecords = await deeplyFulfilledObject(issuerRecordPs);
146
+ const issuers = objectMap(issuerRecords, ({ issuer }) => issuer);
147
+ const brands = objectMap(issuerRecords, ({ brand }) => brand);
148
+ return harden({ issuers, brands });
168
149
  };
169
150
 
170
151
  /**
@@ -189,7 +170,10 @@ export const provideIssuerStorage = zcfBaggage => {
189
170
  return brandToIssuerRecord.get(brand).issuer;
190
171
  };
191
172
 
192
- /** @type {IssuerStorageGetIssuerRecords} */
173
+ /**
174
+ * @param {Issuer[]} issuers
175
+ * @returns {IssuerRecords}
176
+ */
193
177
  const getIssuerRecords = issuers => {
194
178
  assertInstantiated();
195
179
  return issuers.map(issuerToIssuerRecord.get);
@@ -1,4 +1,4 @@
1
- export function defineDurableHandle<H extends string>(baggage: MapStore<string, unknown>, handleType: H): H extends "Instance" ? () => Instance : () => Handle<H>;
1
+ export function defineDurableHandle<H extends string>(baggage: Baggage, handleType: H): H extends "Instance" ? () => Instance : () => Handle<H>;
2
2
  export function makeHandle<H extends string>(handleType: H): H extends "Instance" ? Instance : Handle<H>;
3
- export type Baggage = import('@agoric/vat-data').Baggage;
3
+ import type { Baggage } from '@agoric/vat-data';
4
4
  //# sourceMappingURL=makeHandle.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"makeHandle.d.ts","sourceRoot":"","sources":["makeHandle.js"],"names":[],"mappings":"AAkBO,uIAFmC,QAAQ,mBAajD;AAUM,yGAKN;sBAlCa,OAAO,kBAAkB,EAAE,OAAO"}
1
+ {"version":3,"file":"makeHandle.d.ts","sourceRoot":"","sources":["makeHandle.js"],"names":[],"mappings":"AAkBO,oCAF2D,CAAC,+CAAD,CAAC,AADvD,GACsD,CAAC,AAArD,SAAS,UAAU,GAAG,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,CAAC,CAAC,CAanE;AAUM,2BAF+C,CAAC,6BAAD,CAAC,AAD3C,GAC0C,CAAC,AAAzC,SAAS,UAAU,GAAG,QAAQ,GAAG,MAAM,CAAC,CAAC,CAAC,CAOvD;6BAlC0B,kBAAkB"}
package/src/makeHandle.js CHANGED
@@ -8,7 +8,7 @@ import { HandleI } from './typeGuards.js';
8
8
 
9
9
  const { Fail } = assert;
10
10
 
11
- /** @typedef {import('@agoric/vat-data').Baggage} Baggage */
11
+ /** @import {Baggage} from '@agoric/vat-data' */
12
12
 
13
13
  /**
14
14
  * @template {string} H
@@ -18,53 +18,152 @@ export namespace TermsShape {
18
18
  export namespace InstanceRecordShape {
19
19
  export { InstallationShape as installation };
20
20
  export { InstanceHandleShape as instance };
21
- export const terms: import("@endo/patterns").Matcher;
21
+ export let terms: import("@endo/patterns").Matcher;
22
22
  }
23
- export const HandleI: import("@endo/patterns").InterfaceGuard;
23
+ export const HandleI: import("@endo/patterns").InterfaceGuard<{}>;
24
24
  export function makeHandleShape(name: any): import("@endo/patterns").Matcher;
25
25
  export const TimerShape: import("@endo/patterns").Matcher;
26
26
  export namespace FullProposalShape {
27
27
  export { AmountPatternKeywordRecordShape as want };
28
28
  export { AmountKeywordRecordShape as give };
29
- export const exit: import("@endo/patterns").Matcher;
29
+ export let exit: import("@endo/patterns").Matcher;
30
30
  }
31
31
  /** @see {Proposal} type */
32
32
  export const ProposalShape: import("@endo/patterns").Matcher;
33
+ export const EmptyProposalShape: import("@endo/patterns").Matcher;
33
34
  export function isOnDemandExitRule(exit: any): boolean;
34
35
  export function isWaivedExitRule(exit: ExitRule): exit is WaivedExitRule;
35
36
  export function isAfterDeadlineExitRule(exit: ExitRule): exit is AfterDeadlineExitRule;
36
37
  export const InvitationElementShape: import("@endo/patterns").Matcher;
37
- export const OfferHandlerI: import("@endo/patterns").InterfaceGuard;
38
+ export const OfferHandlerI: import("@endo/patterns").InterfaceGuard<{
39
+ handle: import("@endo/patterns").MethodGuard;
40
+ }>;
38
41
  export const SeatHandleAllocationsShape: import("@endo/patterns").Matcher;
39
42
  export const ZoeMintShape: import("@endo/patterns").Matcher;
40
- export const ZoeMintI: import("@endo/patterns").InterfaceGuard;
41
- export const ZcfMintI: import("@endo/patterns").InterfaceGuard;
43
+ export const ZoeMintI: import("@endo/patterns").InterfaceGuard<{
44
+ getIssuerRecord: import("@endo/patterns").MethodGuard;
45
+ mintAndEscrow: import("@endo/patterns").MethodGuard;
46
+ withdrawAndBurn: import("@endo/patterns").MethodGuard;
47
+ }>;
48
+ export const ZcfMintI: import("@endo/patterns").InterfaceGuard<{
49
+ getIssuerRecord: import("@endo/patterns").MethodGuard;
50
+ mintGains: import("@endo/patterns").MethodGuard;
51
+ burnLosses: import("@endo/patterns").MethodGuard;
52
+ }>;
42
53
  export const FeeMintAccessShape: import("@endo/patterns").Matcher;
43
- export const ExitObjectI: import("@endo/patterns").InterfaceGuard;
54
+ export const ExitObjectI: import("@endo/patterns").InterfaceGuard<{
55
+ exit: import("@endo/patterns").MethodGuard;
56
+ }>;
44
57
  export const ExitObjectShape: import("@endo/patterns").Matcher;
45
58
  export const InstanceAdminShape: import("@endo/patterns").Matcher;
46
- export const InstanceAdminI: import("@endo/patterns").InterfaceGuard;
59
+ export const InstanceAdminI: import("@endo/patterns").InterfaceGuard<{
60
+ makeInvitation: import("@endo/patterns").MethodGuard;
61
+ saveIssuer: import("@endo/patterns").MethodGuard;
62
+ makeNoEscrowSeat: import("@endo/patterns").MethodGuard;
63
+ exitAllSeats: import("@endo/patterns").MethodGuard;
64
+ failAllSeats: import("@endo/patterns").MethodGuard;
65
+ exitSeat: import("@endo/patterns").MethodGuard;
66
+ failSeat: import("@endo/patterns").MethodGuard;
67
+ makeZoeMint: import("@endo/patterns").MethodGuard;
68
+ registerFeeMint: import("@endo/patterns").MethodGuard;
69
+ replaceAllocations: import("@endo/patterns").MethodGuard;
70
+ stopAcceptingOffers: import("@endo/patterns").MethodGuard;
71
+ setOfferFilter: import("@endo/patterns").MethodGuard;
72
+ getOfferFilter: import("@endo/patterns").MethodGuard;
73
+ getExitSubscriber: import("@endo/patterns").MethodGuard;
74
+ isBlocked: import("@endo/patterns").MethodGuard;
75
+ repairContractCompletionWatcher: import("@endo/patterns").MethodGuard;
76
+ }>;
47
77
  export namespace InstanceStorageManagerIKit {
48
- const instanceStorageManager: import("@endo/patterns").InterfaceGuard;
49
- const withdrawFacet: import("@endo/patterns").InterfaceGuard;
50
- const helpers: import("@endo/patterns").InterfaceGuard;
78
+ let instanceStorageManager: import("@endo/patterns").InterfaceGuard<{
79
+ getTerms: import("@endo/patterns").MethodGuard;
80
+ getIssuers: import("@endo/patterns").MethodGuard;
81
+ getBrands: import("@endo/patterns").MethodGuard;
82
+ getInstallation: import("@endo/patterns").MethodGuard;
83
+ getInvitationIssuer: import("@endo/patterns").MethodGuard;
84
+ saveIssuer: import("@endo/patterns").MethodGuard;
85
+ makeZoeMint: import("@endo/patterns").MethodGuard;
86
+ registerFeeMint: import("@endo/patterns").MethodGuard;
87
+ getInstanceRecord: import("@endo/patterns").MethodGuard;
88
+ getIssuerRecords: import("@endo/patterns").MethodGuard;
89
+ getWithdrawFacet: import("@endo/patterns").MethodGuard;
90
+ initInstanceAdmin: import("@endo/patterns").MethodGuard;
91
+ deleteInstanceAdmin: import("@endo/patterns").MethodGuard;
92
+ makeInvitation: import("@endo/patterns").MethodGuard;
93
+ getRoot: import("@endo/patterns").MethodGuard;
94
+ getAdminNode: import("@endo/patterns").MethodGuard;
95
+ }>;
96
+ let withdrawFacet: import("@endo/patterns").InterfaceGuard<{
97
+ withdrawPayments: import("@endo/patterns").MethodGuard;
98
+ }>;
99
+ let helpers: import("@endo/patterns").InterfaceGuard<{
100
+ wrapIssuerKitWithZoeMint: import("@endo/patterns").MethodGuard;
101
+ }>;
51
102
  }
52
103
  export const BundleCapShape: import("@endo/patterns").Matcher;
53
104
  export const BundleShape: import("@endo/patterns").Matcher;
54
105
  export const UnwrappedInstallationShape: import("@endo/patterns").Matcher;
55
106
  export namespace ZoeStorageManagerIKit {
56
- const zoeServiceDataAccess: import("@endo/patterns").InterfaceGuard;
57
- const makeOfferAccess: import("@endo/patterns").InterfaceGuard;
58
- const startInstanceAccess: import("@endo/patterns").InterfaceGuard;
59
- const invitationIssuerAccess: import("@endo/patterns").InterfaceGuard;
107
+ let zoeServiceDataAccess: import("@endo/patterns").InterfaceGuard<{
108
+ getTerms: import("@endo/patterns").MethodGuard;
109
+ getIssuers: import("@endo/patterns").MethodGuard;
110
+ getBrands: import("@endo/patterns").MethodGuard;
111
+ getInstallation: import("@endo/patterns").MethodGuard;
112
+ getInvitationIssuer: import("@endo/patterns").MethodGuard;
113
+ getBundleIDFromInstallation: import("@endo/patterns").MethodGuard;
114
+ installBundle: import("@endo/patterns").MethodGuard;
115
+ installBundleID: import("@endo/patterns").MethodGuard;
116
+ getPublicFacet: import("@endo/patterns").MethodGuard;
117
+ getOfferFilter: import("@endo/patterns").MethodGuard;
118
+ getProposalShapeForInvitation: import("@endo/patterns").MethodGuard;
119
+ }>;
120
+ let makeOfferAccess: import("@endo/patterns").InterfaceGuard<{
121
+ getAssetKindByBrand: import("@endo/patterns").MethodGuard;
122
+ getInstanceAdmin: import("@endo/patterns").MethodGuard;
123
+ getProposalShapeForInvitation: import("@endo/patterns").MethodGuard;
124
+ getInvitationIssuer: import("@endo/patterns").MethodGuard;
125
+ depositPayments: import("@endo/patterns").MethodGuard;
126
+ }>;
127
+ let startInstanceAccess: import("@endo/patterns").InterfaceGuard<{
128
+ makeZoeInstanceStorageManager: import("@endo/patterns").MethodGuard;
129
+ unwrapInstallation: import("@endo/patterns").MethodGuard;
130
+ }>;
131
+ let invitationIssuerAccess: import("@endo/patterns").InterfaceGuard<{
132
+ getInvitationIssuer: import("@endo/patterns").MethodGuard;
133
+ }>;
60
134
  }
61
- export const ZoeServiceI: import("@endo/patterns").InterfaceGuard;
62
- export const AdminFacetI: import("@endo/patterns").InterfaceGuard;
135
+ export const ZoeServiceI: import("@endo/patterns").InterfaceGuard<{
136
+ install: import("@endo/patterns").MethodGuard;
137
+ installBundleID: import("@endo/patterns").MethodGuard;
138
+ startInstance: import("@endo/patterns").MethodGuard;
139
+ offer: import("@endo/patterns").MethodGuard;
140
+ getOfferFilter: import("@endo/patterns").MethodGuard;
141
+ getInvitationIssuer: import("@endo/patterns").MethodGuard;
142
+ getFeeIssuer: import("@endo/patterns").MethodGuard;
143
+ getBrands: import("@endo/patterns").MethodGuard;
144
+ getIssuers: import("@endo/patterns").MethodGuard;
145
+ getPublicFacet: import("@endo/patterns").MethodGuard;
146
+ getTerms: import("@endo/patterns").MethodGuard;
147
+ getInstallationForInstance: import("@endo/patterns").MethodGuard;
148
+ getBundleIDFromInstallation: import("@endo/patterns").MethodGuard;
149
+ getInstallation: import("@endo/patterns").MethodGuard;
150
+ getInstance: import("@endo/patterns").MethodGuard;
151
+ getConfiguration: import("@endo/patterns").MethodGuard;
152
+ getInvitationDetails: import("@endo/patterns").MethodGuard;
153
+ getProposalShapeForInvitation: import("@endo/patterns").MethodGuard;
154
+ }>;
155
+ export const AdminFacetI: import("@endo/patterns").InterfaceGuard<{
156
+ getVatShutdownPromise: import("@endo/patterns").MethodGuard;
157
+ restartContract: import("@endo/patterns").MethodGuard;
158
+ upgradeContract: import("@endo/patterns").MethodGuard;
159
+ }>;
63
160
  export const SeatDataShape: import("@endo/patterns").Matcher;
64
- export const HandleOfferI: import("@endo/patterns").InterfaceGuard;
161
+ export const HandleOfferI: import("@endo/patterns").InterfaceGuard<{
162
+ handleOffer: import("@endo/patterns").MethodGuard;
163
+ }>;
65
164
  export namespace PriceQuoteShape {
66
165
  export { AmountShape as quoteAmount };
67
- export const quotePayment: any;
166
+ export let quotePayment: globalThis.Pattern;
68
167
  }
69
- import { AmountShape } from "@agoric/ertp/src/typeGuards";
168
+ import { AmountShape } from '@agoric/ertp';
70
169
  //# sourceMappingURL=typeGuards.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"typeGuards.d.ts","sourceRoot":"","sources":["typeGuards.js"],"names":[],"mappings":"AAgBA,4DAAuC;AAEvC,qEAAqE;AACrE,+DAAyD;AACzD,mEAAiE;AACjE,iEAA6D;AAC7D,yDAA6C;AAE7C,wEAA8E;AAC9E,+EAGE;AACF,0EAGE;AACF,wEAA8E;AAC9E,yEAGE;AACF,uEAA4E;AAE5E,iEAOE;;;;;;;;;;AAaF,8DAAiD;AAE1C,6EAA4D;AACnE,0DAAmD;;;;;;AA0BnD,2BAA2B;AAC3B,6DAAsE;AAE/D,uDAGN;AAMM,uCAHI,QAAQ,0BAMlB;AAMM,8CAHI,QAAQ,iCAMlB;AAED,sEAKG;AAEH,oEAEG;AAEH,0EAKE;AAEF,4DAAmD;AACnD,+DAIG;AAEH,+DASG;AAEH,kEAA+D;AAE/D,kEAEG;AAEH,+DAAsD;AACtD,kEAA+D;AAC/D,qEAkCG;;;;;;AAiDH,8DAAuD;AACvD,2DAGE;AAEF,0EAUE;;;;;;;AA2DF,kEA6CG;AAEH,kEAIG;AAEH,6DASE;AAEF,mEAKG"}
1
+ {"version":3,"file":"typeGuards.d.ts","sourceRoot":"","sources":["typeGuards.js"],"names":[],"mappings":"AAgBA,4DAAuC;AAEvC,qEAAqE;AACrE,+DAAyD;AACzD,mEAAiE;AACjE,iEAA6D;AAC7D,yDAA6C;AAE7C,wEAA8E;AAC9E,+EAGE;AACF,0EAGE;AACF,wEAA8E;AAC9E,yEAGE;AACF,uEAA4E;AAE5E,iEAOE;;;;;;;;;;AAaF,kEAAiD;AAE1C,6EAA4D;AACnE,0DAAmD;;;;;;AA0BnD,2BAA2B;AAC3B,6DAAsE;AAEtE,kEAIG;AAEI,uDAGN;AAMM,uCAHI,QAAQ,GACN,IAAI,IAAI,cAAc,CAKlC;AAMM,8CAHI,QAAQ,GACN,IAAI,IAAI,qBAAqB,CAKzC;AAED,sEAKG;AAEH;;GAEG;AAEH,0EAKE;AAEF,4DAAmD;AACnD;;;;GAIG;AAEH;;;;GASG;AAEH,kEAA+D;AAE/D;;GAEG;AAEH,+DAAsD;AACtD,kEAA+D;AAC/D;;;;;;;;;;;;;;;;;GAkCG;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiDH,8DAAuD;AACvD,2DAGE;AAEF,0EAUE;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA8DF;;;;;;;;;;;;;;;;;;;GA6CG;AAEH;;;;GAIG;AAEH,6DASE;AAEF;;GAKG;;;;;4BAjYI,cAAc"}
package/src/typeGuards.js CHANGED
@@ -90,6 +90,12 @@ export const FullProposalShape = harden({
90
90
  /** @see {Proposal} type */
91
91
  export const ProposalShape = M.splitRecord({}, FullProposalShape, {});
92
92
 
93
+ export const EmptyProposalShape = M.splitRecord({
94
+ give: {},
95
+ want: {},
96
+ exit: { onDemand: null },
97
+ });
98
+
93
99
  export const isOnDemandExitRule = exit => {
94
100
  const [exitKey] = Object.keys(exit);
95
101
  return exitKey === 'onDemand';
@@ -121,7 +127,7 @@ export const InvitationElementShape = M.splitRecord({
121
127
  });
122
128
 
123
129
  export const OfferHandlerI = M.interface('OfferHandler', {
124
- handle: M.call(SeatShape).optional(M.any()).returns(M.string()),
130
+ handle: M.call(SeatShape).optional(M.any()).returns(M.any()),
125
131
  });
126
132
 
127
133
  export const SeatHandleAllocationsShape = M.arrayOf(
@@ -219,7 +225,7 @@ export const InstanceStorageManagerIKit = harden({
219
225
  InstanceHandleShape,
220
226
  M.remotable('instanceAdmin'),
221
227
  ).returns(M.promise()),
222
- deleteInstanceAdmin: M.call(InstanceAdminI).returns(),
228
+ deleteInstanceAdmin: M.call(InstanceAdminShape).returns(),
223
229
  makeInvitation: M.call(InvitationHandleShape, M.string())
224
230
  .optional(M.record(), M.pattern())
225
231
  .returns(PaymentShape),
@@ -271,10 +277,12 @@ export const ZoeStorageManagerIKit = harden({
271
277
  getBundleIDFromInstallation: M.call(InstallationShape).returns(
272
278
  M.eref(M.string()),
273
279
  ),
274
- installBundle: M.call(M.or(InstanceHandleShape, BundleShape)).returns(
275
- M.promise(),
276
- ),
277
- installBundleID: M.call(M.string()).returns(M.promise()),
280
+ installBundle: M.call(M.or(InstanceHandleShape, BundleShape))
281
+ .optional(M.string())
282
+ .returns(M.promise()),
283
+ installBundleID: M.call(M.string())
284
+ .optional(M.string())
285
+ .returns(M.promise()),
278
286
 
279
287
  getPublicFacet: M.call(InstanceHandleShape).returns(
280
288
  M.eref(M.remotable('PublicFacet')),
@@ -305,6 +313,7 @@ export const ZoeStorageManagerIKit = harden({
305
313
  IssuerPKeywordRecordShape,
306
314
  M.or(InstanceHandleShape, BundleShape),
307
315
  M.or(BundleCapShape, BundleShape),
316
+ M.string(),
308
317
  ).returns(M.promise()),
309
318
  unwrapInstallation: M.callWhen(M.eref(InstallationShape)).returns(
310
319
  UnwrappedInstallationShape,
@@ -316,10 +325,10 @@ export const ZoeStorageManagerIKit = harden({
316
325
  });
317
326
 
318
327
  export const ZoeServiceI = M.interface('ZoeService', {
319
- install: M.call(M.any()).returns(M.promise()),
320
- installBundleID: M.call(M.string()).returns(M.promise()),
328
+ install: M.call(M.any()).optional(M.string()).returns(M.promise()),
329
+ installBundleID: M.call(M.string()).optional(M.string()).returns(M.promise()),
321
330
  startInstance: M.call(M.eref(InstallationShape))
322
- .optional(IssuerPKeywordRecordShape, M.any(), M.any())
331
+ .optional(IssuerPKeywordRecordShape, M.record(), M.record(), M.string())
323
332
  .returns(M.promise()),
324
333
  offer: M.call(M.eref(InvitationShape))
325
334
  .optional(ProposalShape, PaymentPKeywordRecordShape, M.any())
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Alias for RemotableObject
3
+ */
4
+ type Handle<H extends string> = import("@endo/marshal").RemotableObject<H>;
5
+ type Keyword = string;
6
+ /**
7
+ * - an opaque handle for an invitation
8
+ */
9
+ type InvitationHandle = Handle<"Invitation">;
10
+ type IssuerKeywordRecord = Record<Keyword, Issuer<any>>;
11
+ type IssuerPKeywordRecord = Record<Keyword, import("@endo/far").ERef<Issuer<any>>>;
12
+ type BrandKeywordRecord = Record<Keyword, Brand<any>>;
13
+ type StandardTerms = {
14
+ /**
15
+ * - record with
16
+ * keywords keys, issuer values
17
+ */
18
+ issuers: IssuerKeywordRecord;
19
+ /**
20
+ * - record with keywords
21
+ * keys, brand values
22
+ */
23
+ brands: BrandKeywordRecord;
24
+ };
25
+ type AnyTerms = StandardTerms & Record<string, any>;
26
+ type InstanceRecord = {
27
+ installation: import("./zoeService/utils.js").Installation<any>;
28
+ instance: import("./zoeService/utils.js").Instance<any>;
29
+ /**
30
+ * - contract parameters
31
+ */
32
+ terms: AnyTerms;
33
+ };
34
+ type IssuerRecord<K extends globalThis.AssetKind = globalThis.AssetKind, M extends import("@endo/patterns").Key = import("@endo/patterns").Key> = {
35
+ brand: Brand<K>;
36
+ issuer: Issuer<K, M>;
37
+ assetKind: K;
38
+ displayInfo?: globalThis.DisplayInfo<K> | undefined;
39
+ };
40
+ type Allocation = Record<Keyword, import("@agoric/ertp/src/types.js").AnyAmount>;
41
+ //# sourceMappingURL=types-ambient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types-ambient.d.ts","sourceRoot":"","sources":["types-ambient.js"],"names":[],"mappings":";;;YAIqD,CAAC,mBAAzC,OAAO,eAAe,EAAE,eAAe,CAAC,CAAC,CAAC;eAI1C,MAAM;;;;wBACN,MAAM,CAAC,YAAY,CAAC;2BACpB,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC;4BAC5B,MAAM,CAAC,OAAO,EAAE,OAAO,WAAW,EAAE,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;0BACtD,MAAM,CAAC,OAAO,EAAE,KAAK,CAAC,GAAG,CAAC,CAAC;;;;;;aAK1B,mBAAmB;;;;;YAEnB,kBAAkB;;gBAGnB,aAAa,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC;;kBAGlC,OAAO,uBAAuB,EAAE,YAAY,CAAC,GAAG,CAAC;cACjD,OAAO,uBAAuB,EAAE,QAAQ,CAAC,GAAG,CAAC;;;;WAC7C,QAAQ;;kBASR,CAAC,sDADS,CAAC;WADX,KAAK,CAEL,CAAC,AAFM,CAAC;YACR,MAAM,CACN,CAAC,AADO,EAAE,CAAC,CAAC;eACZ,CAAC;;;kBAKF,MAAM,CAAC,OAAO,EAAE,OAAO,2BAA2B,EAAE,SAAS,CAAC"}
@@ -1,20 +1,15 @@
1
1
  // @jessie-check
2
2
 
3
- /// <reference types="ses"/>
4
-
5
3
  /**
6
4
  * @template {string} H - the name of the handle
7
- * @typedef {H & import("@endo/marshal").Remotable} Handle A type constructor for an opaque type
8
- * identified by the H string. This uses an intersection type
9
- * ('MyHandle' & {}) to tag the handle's type even though the actual
10
- * value is just an empty object.
5
+ * @typedef {import("@endo/marshal").RemotableObject<H>} Handle Alias for RemotableObject
11
6
  */
12
7
 
13
8
  /**
14
9
  * @typedef {string} Keyword
15
10
  * @typedef {Handle<'Invitation'>} InvitationHandle - an opaque handle for an invitation
16
11
  * @typedef {Record<Keyword, Issuer<any>>} IssuerKeywordRecord
17
- * @typedef {Record<Keyword, ERef<Issuer<any>>>} IssuerPKeywordRecord
12
+ * @typedef {Record<Keyword, import('@endo/far').ERef<Issuer<any>>>} IssuerPKeywordRecord
18
13
  * @typedef {Record<Keyword, Brand<any>>} BrandKeywordRecord
19
14
  */
20
15
 
@@ -28,24 +23,21 @@
28
23
  * @typedef {StandardTerms & Record<string, any>} AnyTerms
29
24
  *
30
25
  * @typedef {object} InstanceRecord
31
- * @property {Installation} installation
26
+ * @property {import('./zoeService/utils.js').Installation<any>} installation
32
27
  * @property {import("./zoeService/utils.js").Instance<any>} instance
33
28
  * @property {AnyTerms} terms - contract parameters
34
29
  */
35
30
 
36
31
  /**
37
32
  * @template {AssetKind} [K=AssetKind]
33
+ * @template {import("@endo/patterns").Key} [M=import("@endo/patterns").Key] member kind, for Amounts that have member values
38
34
  * @typedef {object} IssuerRecord
39
35
  * @property {Brand<K>} brand
40
- * @property {Issuer<K>} issuer
36
+ * @property {Issuer<K, M>} issuer
41
37
  * @property {K} assetKind
42
38
  * @property {DisplayInfo<K>} [displayInfo]
43
- *
44
- * @typedef {AmountKeywordRecord} Allocation
45
39
  */
46
40
 
47
41
  /**
48
- * @template {object} [R=unknown] Offer result
49
- * @template {object} [A=never] Offer args
50
- * @typedef {Payment<'set'>} Invitation
42
+ * @typedef {Record<Keyword, import('@agoric/ertp/src/types.js').AnyAmount>} Allocation
51
43
  */
@@ -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"}