@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,5 @@
1
1
  // @jessie-check
2
+ /// <reference types="@agoric/ertp/exported" />
2
3
 
3
4
  /**
4
5
  * @typedef {object} SeatData
@@ -53,13 +54,16 @@
53
54
  */
54
55
 
55
56
  /**
56
- * @typedef {object} ZoeSeatAdmin
57
+ * @typedef ZoeSeatAdminMethods
57
58
  * @property {(allocation: Allocation) => void} replaceAllocation
58
59
  * @property {ZoeSeatAdminExit} exit
59
- * @property {ShutdownWithFailure} fail called with the reason
60
+ * @property {import('@agoric/swingset-vat').ShutdownWithFailure} fail called with the reason
60
61
  * for calling fail on this seat, where reason is normally an instanceof Error.
61
62
  * @property {() => Subscriber<AmountKeywordRecord>} getExitSubscriber
62
63
  */
64
+ /**
65
+ * @typedef {import('@endo/marshal').RemotableObject & ZoeSeatAdminMethods} ZoeSeatAdmin
66
+ */
63
67
 
64
68
  /**
65
69
  * @callback {(brand: Brand) => AssetKind} GetAssetKind
@@ -67,7 +71,7 @@
67
71
 
68
72
  /**
69
73
  * @typedef {object} HandleOfferResult
70
- * @property {Promise<unknown>} offerResultPromise
74
+ * @property {Promise<import('@endo/marshal').Passable>} offerResultPromise
71
75
  * @property {ExitObj} exitObj
72
76
  */
73
77
 
@@ -92,7 +96,7 @@
92
96
  * @property {() => string[]} getOfferFilter
93
97
  * @property {() => Installation} getInstallation
94
98
  * @property {(completion: Completion) => void} exitAllSeats
95
- * @property {ShutdownWithFailure} failAllSeats
99
+ * @property {import('@agoric/swingset-vat').ShutdownWithFailure} failAllSeats
96
100
  * @property {() => void} stopAcceptingOffers
97
101
  * @property {(string: string) => boolean} isBlocked
98
102
  * @property {(handleOfferObj: HandleOfferObj, publicFacet: unknown) => void} initDelayedState
@@ -122,21 +126,22 @@
122
126
  /**
123
127
  * @typedef {object} ZoeInstanceAdmin
124
128
  * @property {ZoeInstanceAdminMakeInvitation} makeInvitation
125
- * @property {(issuerP: ERef<Issuer>,
129
+ * @property {<I extends Issuer>(issuerP: ERef<I>,
126
130
  * keyword: Keyword
127
- * ) => Promise<IssuerRecord>} saveIssuer
131
+ * ) => Promise<I extends Issuer<infer K, infer M> ? IssuerRecord<K, M> : never>} saveIssuer
128
132
  * @property {MakeZoeMint} makeZoeMint
129
133
  * @property {RegisterFeeMint} registerFeeMint
130
134
  * @property {MakeNoEscrowSeat} makeNoEscrowSeat
131
135
  * @property {ReplaceAllocations} replaceAllocations
132
136
  * @property {(completion: Completion) => void} exitAllSeats
133
- * @property {ShutdownWithFailure} failAllSeats
137
+ * @property {import('@agoric/swingset-vat').ShutdownWithFailure} failAllSeats
134
138
  * @property {(seatHandle: SeatHandle, completion: Completion) => void} exitSeat
135
139
  * @property {(seatHandle: SeatHandle, reason: Error) => void} failSeat
136
140
  * @property {() => void} stopAcceptingOffers
137
141
  * @property {(strings: Array<string>) => void} setOfferFilter
138
142
  * @property {() => Array<string>} getOfferFilter
139
143
  * @property {(seatHandle: SeatHandle) => Subscriber<AmountKeywordRecord>} getExitSubscriber
144
+ * @property {() => void} repairContractCompletionWatcher
140
145
  */
141
146
 
142
147
  /**
@@ -159,7 +164,7 @@
159
164
  * @param {Keyword} keyword
160
165
  * @param {AssetKind} [assetKind]
161
166
  * @param {AdditionalDisplayInfo} [displayInfo]
162
- * @param {IssuerOptionsRecord} [options]
167
+ * @param {import('@agoric/ertp').IssuerOptionsRecord} [options]
163
168
  * @returns {ZoeMint}
164
169
  */
165
170
 
@@ -204,7 +209,7 @@
204
209
  /**
205
210
  * @typedef {object} ExecuteContractResult
206
211
  * @property {object} creatorFacet
207
- * @property {Promise<Invitation>} creatorInvitation
212
+ * @property {Promise<Invitation>} [creatorInvitation]
208
213
  * @property {object} publicFacet
209
214
  * @property {HandleOfferObj} handleOfferObj
210
215
  */
@@ -280,19 +285,6 @@
280
285
  * @property {(zcfSeat: ZCFSeat, newAllocation: Allocation) => void} reallocate
281
286
  */
282
287
 
283
- /**
284
- * @callback CreateSeatManager
285
- *
286
- * The SeatManager holds the active zcfSeats and can reallocate and
287
- * make new zcfSeats.
288
- *
289
- * @param {ERef<ZoeInstanceAdmin>} zoeInstanceAdmin
290
- * @param {GetAssetKindByBrand} getAssetKindByBrand
291
- * @param {ShutdownWithFailure} shutdownWithFailure
292
- * @param {import('@agoric/vat-data').Baggage} zcfBaggage
293
- * @returns {{ seatManager: ZcfSeatManager, zcfMintReallocator: ZcfMintReallocator }}
294
- */
295
-
296
288
  /**
297
289
  * @callback InstanceStateAddIssuer
298
290
  *
@@ -304,44 +296,13 @@
304
296
  * @returns {void}
305
297
  */
306
298
 
307
- /**
308
- * @callback InstanceStateGetTerms
309
- * @returns {AnyTerms}
310
- */
311
-
312
- /**
313
- * @callback InstanceStateGetInstallation
314
- * @returns {Installation}
315
- */
316
-
317
- /**
318
- * @callback InstanceRecordGetIssuers
319
- * @returns {IssuerKeywordRecord}
320
- */
321
-
322
- /**
323
- * @callback InstanceRecordGetBrands
324
- * @returns {BrandKeywordRecord}
325
- */
326
-
327
299
  /**
328
300
  * @typedef {object} InstanceState
329
301
  * @property {InstanceStateAddIssuer} addIssuer
330
- * @property {GetInstanceRecord} getInstanceRecord
331
- * @property {InstanceStateGetTerms} getTerms
332
- * @property {InstanceStateGetInstallation} getInstallation
333
- * @property {InstanceRecordGetIssuers} getIssuers
334
- * @property {InstanceRecordGetBrands} getBrands
302
+ * @property {() => InstanceRecord} getInstanceRecord
303
+ * @property {() => AnyTerms} getTerms
304
+ * @property {() => Installation} getInstallation
305
+ * @property {() => IssuerKeywordRecord} getIssuers
306
+ * @property {() => BrandKeywordRecord} getBrands
335
307
  * @property {(keyword: Keyword) => void} assertUniqueKeyword
336
308
  */
337
-
338
- /**
339
- * @callback GetInstanceRecord
340
- * @returns {InstanceRecord}
341
- */
342
-
343
- /**
344
- * @callback IssuerStorageGetIssuerRecords
345
- * @param {Issuer[]} issuers
346
- * @returns {IssuerRecords}
347
- */
@@ -1,3 +1,3 @@
1
1
  export function makeIssuerRecord<K extends AssetKind>(brand: Brand<K>, issuer: Issuer<K>, displayInfo: DisplayInfo<K>): IssuerRecord<K>;
2
- export function assertFullIssuerRecord(issuerRecord: IssuerRecord): asserts issuerRecord is Required<IssuerRecord<AssetKind>>;
2
+ export function assertFullIssuerRecord(issuerRecord: IssuerRecord): asserts issuerRecord is Required<IssuerRecord>;
3
3
  //# sourceMappingURL=issuerRecord.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"issuerRecord.d.ts","sourceRoot":"","sources":["issuerRecord.js"],"names":[],"mappings":"AAaO,wIAMH;AAMG,qDAHI,YAAY,6DAOtB"}
1
+ {"version":3,"file":"issuerRecord.d.ts","sourceRoot":"","sources":["issuerRecord.js"],"names":[],"mappings":"AAaO,iCANkB,CAAC,SAAZ,SAAU,SACb,KAAK,CAAC,CAAC,CAAC,UACR,MAAM,CAAC,CAAC,CAAC,eACT,WAAW,CAAC,CAAC,CAAC,GACZ,YAAY,CAAC,CAAC,CAAC,CAQxB;AAMG,qDAHI,YAAY,GACV,QAAQ,YAAY,IAAI,QAAQ,CAAC,YAAY,CAAC,CAM1D"}
@@ -1,4 +1,4 @@
1
- export function provideIssuerStorage(zcfBaggage: MapStore<string, unknown>): {
1
+ export function provideIssuerStorage(zcfBaggage: import("@agoric/vat-data").Baggage): {
2
2
  storeIssuerKeywordRecord: (uncleanIssuerKeywordRecord: IssuerKeywordRecord) => Promise<{
3
3
  issuers: IssuerKeywordRecord;
4
4
  brands: BrandKeywordRecord;
@@ -7,8 +7,8 @@ export function provideIssuerStorage(zcfBaggage: MapStore<string, unknown>): {
7
7
  storeIssuerRecord: (issuerRecord: IssuerRecord) => IssuerRecord;
8
8
  getAssetKindByBrand: GetAssetKindByBrand;
9
9
  getBrandForIssuer: <K extends AssetKind>(issuer: Issuer<K>) => Brand<K>;
10
- getIssuerForBrand: <K_1 extends AssetKind>(brand: Brand<K_1>) => Issuer<K_1>;
11
- getIssuerRecords: IssuerStorageGetIssuerRecords;
10
+ getIssuerForBrand: <K extends AssetKind>(brand: Brand<K>) => Issuer<K>;
11
+ getIssuerRecords: (issuers: Issuer[]) => IssuerRecords;
12
12
  instantiate: (issuerRecords?: any[]) => void;
13
13
  };
14
14
  //# sourceMappingURL=issuerStorage.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"issuerStorage.d.ts","sourceRoot":"","sources":["issuerStorage.js"],"names":[],"mappings":"AAgBO;2DA2HM,mBAAmB;iBACE,mBAAmB;gBACpB,kBAAkB;;2BAxDtC,KAAK,MAAM,CAAC,KACV,QAAQ,YAAY,CAAC;sCAzBvB,YAAY,KACV,YAAY;;;;;;EAyJ1B"}
1
+ {"version":3,"file":"issuerStorage.d.ts","sourceRoot":"","sources":["issuerStorage.js"],"names":[],"mappings":"AAgBO,iDAFI,OAAO,kBAAkB,EAAE,OAAO;2DAwHhC,mBAAmB,KACjB,OAAO,CAAC;QAAE,OAAO,EAAE,mBAAmB,CAAC;QACnD,MAA4B,EAAE,kBAAkB,CAAA;KAAE,CAAC;2BAnDzC,IAAI,CAAC,MAAM,CAAC,KACV,OAAO,CAAC,YAAY,CAAC;sCAzBvB,YAAY,KACV,YAAY;;wBAyFA,CAAC,SAAZ,SAAU,UACb,MAAM,CAAC,CAAC,CAAC,KACP,KAAK,CAAC,CAAC,CAAC;wBASI,CAAC,SAAZ,SAAU,SACb,KAAK,CAAC,CAAC,CAAC,KACN,MAAM,CAAC,CAAC,CAAC;gCASX,MAAM,EAAE,KACN,aAAa;;EAyB3B"}
@@ -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,oCALe,CAAC,SAAV,MAAQ,WACV,OAAO,cACP,CAAC,GACC,CAAC,SAAS,UAAU,GAAG,MAAM,QAAQ,GAAG,MAAM,MAAM,CAAC,CAAC,CAAC,CAanE;AAUM,2BAJe,CAAC,SAAV,MAAQ,cACV,CAAC,GACC,CAAC,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,147 @@ 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
+ }>;
42
48
  export const FeeMintAccessShape: import("@endo/patterns").Matcher;
43
- export const ExitObjectI: import("@endo/patterns").InterfaceGuard;
49
+ export const ExitObjectI: import("@endo/patterns").InterfaceGuard<{
50
+ exit: import("@endo/patterns").MethodGuard;
51
+ }>;
44
52
  export const ExitObjectShape: import("@endo/patterns").Matcher;
45
53
  export const InstanceAdminShape: import("@endo/patterns").Matcher;
46
- export const InstanceAdminI: import("@endo/patterns").InterfaceGuard;
54
+ export const InstanceAdminI: import("@endo/patterns").InterfaceGuard<{
55
+ makeInvitation: import("@endo/patterns").MethodGuard;
56
+ saveIssuer: import("@endo/patterns").MethodGuard;
57
+ makeNoEscrowSeat: import("@endo/patterns").MethodGuard;
58
+ exitAllSeats: import("@endo/patterns").MethodGuard;
59
+ failAllSeats: import("@endo/patterns").MethodGuard;
60
+ exitSeat: import("@endo/patterns").MethodGuard;
61
+ failSeat: import("@endo/patterns").MethodGuard;
62
+ makeZoeMint: import("@endo/patterns").MethodGuard;
63
+ registerFeeMint: import("@endo/patterns").MethodGuard;
64
+ replaceAllocations: import("@endo/patterns").MethodGuard;
65
+ stopAcceptingOffers: import("@endo/patterns").MethodGuard;
66
+ setOfferFilter: import("@endo/patterns").MethodGuard;
67
+ getOfferFilter: import("@endo/patterns").MethodGuard;
68
+ getExitSubscriber: import("@endo/patterns").MethodGuard;
69
+ isBlocked: import("@endo/patterns").MethodGuard;
70
+ repairContractCompletionWatcher: import("@endo/patterns").MethodGuard;
71
+ }>;
47
72
  export namespace InstanceStorageManagerIKit {
48
- const instanceStorageManager: import("@endo/patterns").InterfaceGuard;
49
- const withdrawFacet: import("@endo/patterns").InterfaceGuard;
50
- const helpers: import("@endo/patterns").InterfaceGuard;
73
+ let instanceStorageManager: import("@endo/patterns").InterfaceGuard<{
74
+ getTerms: import("@endo/patterns").MethodGuard;
75
+ getIssuers: import("@endo/patterns").MethodGuard;
76
+ getBrands: import("@endo/patterns").MethodGuard;
77
+ getInstallation: import("@endo/patterns").MethodGuard;
78
+ getInvitationIssuer: import("@endo/patterns").MethodGuard;
79
+ saveIssuer: import("@endo/patterns").MethodGuard;
80
+ makeZoeMint: import("@endo/patterns").MethodGuard;
81
+ registerFeeMint: import("@endo/patterns").MethodGuard;
82
+ getInstanceRecord: import("@endo/patterns").MethodGuard;
83
+ getIssuerRecords: import("@endo/patterns").MethodGuard;
84
+ getWithdrawFacet: import("@endo/patterns").MethodGuard;
85
+ initInstanceAdmin: import("@endo/patterns").MethodGuard;
86
+ deleteInstanceAdmin: import("@endo/patterns").MethodGuard;
87
+ makeInvitation: import("@endo/patterns").MethodGuard;
88
+ getRoot: import("@endo/patterns").MethodGuard;
89
+ getAdminNode: import("@endo/patterns").MethodGuard;
90
+ }>;
91
+ let withdrawFacet: import("@endo/patterns").InterfaceGuard<{
92
+ withdrawPayments: import("@endo/patterns").MethodGuard;
93
+ }>;
94
+ let helpers: import("@endo/patterns").InterfaceGuard<{
95
+ wrapIssuerKitWithZoeMint: import("@endo/patterns").MethodGuard;
96
+ }>;
51
97
  }
52
98
  export const BundleCapShape: import("@endo/patterns").Matcher;
53
99
  export const BundleShape: import("@endo/patterns").Matcher;
54
100
  export const UnwrappedInstallationShape: import("@endo/patterns").Matcher;
55
101
  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;
102
+ let zoeServiceDataAccess: import("@endo/patterns").InterfaceGuard<{
103
+ getTerms: import("@endo/patterns").MethodGuard;
104
+ getIssuers: import("@endo/patterns").MethodGuard;
105
+ getBrands: import("@endo/patterns").MethodGuard;
106
+ getInstallation: import("@endo/patterns").MethodGuard;
107
+ getInvitationIssuer: import("@endo/patterns").MethodGuard;
108
+ getBundleIDFromInstallation: import("@endo/patterns").MethodGuard;
109
+ installBundle: import("@endo/patterns").MethodGuard;
110
+ installBundleID: import("@endo/patterns").MethodGuard;
111
+ getPublicFacet: import("@endo/patterns").MethodGuard;
112
+ getOfferFilter: import("@endo/patterns").MethodGuard;
113
+ getProposalShapeForInvitation: import("@endo/patterns").MethodGuard;
114
+ }>;
115
+ let makeOfferAccess: import("@endo/patterns").InterfaceGuard<{
116
+ getAssetKindByBrand: import("@endo/patterns").MethodGuard;
117
+ getInstanceAdmin: import("@endo/patterns").MethodGuard;
118
+ getProposalShapeForInvitation: import("@endo/patterns").MethodGuard;
119
+ getInvitationIssuer: import("@endo/patterns").MethodGuard;
120
+ depositPayments: import("@endo/patterns").MethodGuard;
121
+ }>;
122
+ let startInstanceAccess: import("@endo/patterns").InterfaceGuard<{
123
+ makeZoeInstanceStorageManager: import("@endo/patterns").MethodGuard;
124
+ unwrapInstallation: import("@endo/patterns").MethodGuard;
125
+ }>;
126
+ let invitationIssuerAccess: import("@endo/patterns").InterfaceGuard<{
127
+ getInvitationIssuer: import("@endo/patterns").MethodGuard;
128
+ }>;
60
129
  }
61
- export const ZoeServiceI: import("@endo/patterns").InterfaceGuard;
62
- export const AdminFacetI: import("@endo/patterns").InterfaceGuard;
130
+ export const ZoeServiceI: import("@endo/patterns").InterfaceGuard<{
131
+ install: import("@endo/patterns").MethodGuard;
132
+ installBundleID: import("@endo/patterns").MethodGuard;
133
+ startInstance: import("@endo/patterns").MethodGuard;
134
+ offer: import("@endo/patterns").MethodGuard;
135
+ getOfferFilter: import("@endo/patterns").MethodGuard;
136
+ getInvitationIssuer: import("@endo/patterns").MethodGuard;
137
+ getFeeIssuer: import("@endo/patterns").MethodGuard;
138
+ getBrands: import("@endo/patterns").MethodGuard;
139
+ getIssuers: import("@endo/patterns").MethodGuard;
140
+ getPublicFacet: import("@endo/patterns").MethodGuard;
141
+ getTerms: import("@endo/patterns").MethodGuard;
142
+ getInstallationForInstance: import("@endo/patterns").MethodGuard;
143
+ getBundleIDFromInstallation: import("@endo/patterns").MethodGuard;
144
+ getInstallation: import("@endo/patterns").MethodGuard;
145
+ getInstance: import("@endo/patterns").MethodGuard;
146
+ getConfiguration: import("@endo/patterns").MethodGuard;
147
+ getInvitationDetails: import("@endo/patterns").MethodGuard;
148
+ getProposalShapeForInvitation: import("@endo/patterns").MethodGuard;
149
+ }>;
150
+ export const AdminFacetI: import("@endo/patterns").InterfaceGuard<{
151
+ getVatShutdownPromise: import("@endo/patterns").MethodGuard;
152
+ restartContract: import("@endo/patterns").MethodGuard;
153
+ upgradeContract: import("@endo/patterns").MethodGuard;
154
+ }>;
63
155
  export const SeatDataShape: import("@endo/patterns").Matcher;
64
- export const HandleOfferI: import("@endo/patterns").InterfaceGuard;
156
+ export const HandleOfferI: import("@endo/patterns").InterfaceGuard<{
157
+ handleOffer: import("@endo/patterns").MethodGuard;
158
+ }>;
65
159
  export namespace PriceQuoteShape {
66
160
  export { AmountShape as quoteAmount };
67
- export const quotePayment: any;
161
+ export let quotePayment: globalThis.Pattern;
68
162
  }
69
- import { AmountShape } from "@agoric/ertp/src/typeGuards";
163
+ import { AmountShape } from '@agoric/ertp';
70
164
  //# 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,qEAiCG;;;;;;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,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;;;;;4BAtXI,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(
@@ -138,17 +144,6 @@ export const ZoeMintI = M.interface('ZoeMint', {
138
144
  withdrawAndBurn: M.call(AmountShape).returns(),
139
145
  });
140
146
 
141
- export const ZcfMintI = M.interface('ZcfMint', {
142
- getIssuerRecord: M.call().returns(IssuerRecordShape),
143
- mintGains: M.call(AmountKeywordRecordShape)
144
- .optional(M.remotable('zcfSeat'))
145
- .returns(M.remotable('zcfSeat')),
146
- burnLosses: M.call(
147
- AmountKeywordRecordShape,
148
- M.remotable('zcfSeat'),
149
- ).returns(),
150
- });
151
-
152
147
  export const FeeMintAccessShape = M.remotable('FeeMintAccess');
153
148
 
154
149
  export const ExitObjectI = M.interface('Exit Object', {
@@ -190,6 +185,7 @@ export const InstanceAdminI = M.interface('InstanceAdmin', {
190
185
  getOfferFilter: M.call().returns(M.arrayOf(M.string())),
191
186
  getExitSubscriber: M.call(SeatShape).returns(SubscriberShape),
192
187
  isBlocked: M.call(M.string()).returns(M.boolean()),
188
+ repairContractCompletionWatcher: M.call().returns(),
193
189
  });
194
190
 
195
191
  export const InstanceStorageManagerIKit = harden({
@@ -218,7 +214,7 @@ export const InstanceStorageManagerIKit = harden({
218
214
  InstanceHandleShape,
219
215
  M.remotable('instanceAdmin'),
220
216
  ).returns(M.promise()),
221
- deleteInstanceAdmin: M.call(InstanceAdminI).returns(),
217
+ deleteInstanceAdmin: M.call(InstanceAdminShape).returns(),
222
218
  makeInvitation: M.call(InvitationHandleShape, M.string())
223
219
  .optional(M.record(), M.pattern())
224
220
  .returns(PaymentShape),
@@ -270,10 +266,12 @@ export const ZoeStorageManagerIKit = harden({
270
266
  getBundleIDFromInstallation: M.call(InstallationShape).returns(
271
267
  M.eref(M.string()),
272
268
  ),
273
- installBundle: M.call(M.or(InstanceHandleShape, BundleShape)).returns(
274
- M.promise(),
275
- ),
276
- installBundleID: M.call(M.string()).returns(M.promise()),
269
+ installBundle: M.call(M.or(InstanceHandleShape, BundleShape))
270
+ .optional(M.string())
271
+ .returns(M.promise()),
272
+ installBundleID: M.call(M.string())
273
+ .optional(M.string())
274
+ .returns(M.promise()),
277
275
 
278
276
  getPublicFacet: M.call(InstanceHandleShape).returns(
279
277
  M.eref(M.remotable('PublicFacet')),
@@ -304,6 +302,7 @@ export const ZoeStorageManagerIKit = harden({
304
302
  IssuerPKeywordRecordShape,
305
303
  M.or(InstanceHandleShape, BundleShape),
306
304
  M.or(BundleCapShape, BundleShape),
305
+ M.string(),
307
306
  ).returns(M.promise()),
308
307
  unwrapInstallation: M.callWhen(M.eref(InstallationShape)).returns(
309
308
  UnwrappedInstallationShape,
@@ -315,10 +314,10 @@ export const ZoeStorageManagerIKit = harden({
315
314
  });
316
315
 
317
316
  export const ZoeServiceI = M.interface('ZoeService', {
318
- install: M.call(M.any()).returns(M.promise()),
319
- installBundleID: M.call(M.string()).returns(M.promise()),
317
+ install: M.call(M.any()).optional(M.string()).returns(M.promise()),
318
+ installBundleID: M.call(M.string()).optional(M.string()).returns(M.promise()),
320
319
  startInstance: M.call(M.eref(InstallationShape))
321
- .optional(IssuerPKeywordRecordShape, M.any(), M.any())
320
+ .optional(IssuerPKeywordRecordShape, M.record(), M.record(), M.string())
322
321
  .returns(M.promise()),
323
322
  offer: M.call(M.eref(InvitationShape))
324
323
  .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 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":";;;YAGsB,CAAC,SAAV,MAAQ,IACR,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;;kBAII,CAAC,SAAb,SAAU,yBACqB,CAAC,SAAjC,OAAQ,gBAAgB,EAAE,GAAI;WAE7B,KAAK,CAAC,CAAC,CAAC;YACR,MAAM,CAAC,CAAC,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
32
- * @property {import("./zoeService/utils.js").Instance<any>} instance
26
+ * @property {import('./zoeService/utils.js').Installation<any>} installation
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
  */