@agoric/zoe 0.27.0-u19.2 → 0.27.0-u21.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 (170) hide show
  1. package/bundles/bundle-contractFacet-js-meta.json +281 -281
  2. package/bundles/bundle-contractFacet.js +1 -1
  3. package/package.json +36 -35
  4. package/src/cleanProposal.d.ts +2 -0
  5. package/src/cleanProposal.d.ts.map +1 -1
  6. package/src/cleanProposal.js +4 -2
  7. package/src/contractFacet/exit.d.ts +1 -1
  8. package/src/contractFacet/exit.d.ts.map +1 -1
  9. package/src/contractFacet/offerHandlerStorage.d.ts +1 -1
  10. package/src/contractFacet/rightsConservation.d.ts.map +1 -1
  11. package/src/contractFacet/rightsConservation.js +0 -1
  12. package/src/contractFacet/types.d.ts +184 -0
  13. package/src/contractFacet/types.d.ts.map +1 -0
  14. package/src/contractFacet/{types-ambient.d.ts → types.ts} +66 -29
  15. package/src/contractFacet/vatRoot.d.ts +9 -3
  16. package/src/contractFacet/vatRoot.d.ts.map +1 -1
  17. package/src/contractFacet/vatRoot.js +5 -4
  18. package/src/contractFacet/zcfMint.d.ts +3 -2
  19. package/src/contractFacet/zcfMint.d.ts.map +1 -1
  20. package/src/contractFacet/zcfMint.js +7 -7
  21. package/src/contractFacet/zcfSeat.d.ts +3 -1
  22. package/src/contractFacet/zcfSeat.d.ts.map +1 -1
  23. package/src/contractFacet/zcfSeat.js +6 -4
  24. package/src/contractFacet/zcfZygote.d.ts +8 -1
  25. package/src/contractFacet/zcfZygote.d.ts.map +1 -1
  26. package/src/contractFacet/zcfZygote.js +20 -8
  27. package/src/contractSupport/atomicTransfer.d.ts +6 -0
  28. package/src/contractSupport/atomicTransfer.d.ts.map +1 -1
  29. package/src/contractSupport/atomicTransfer.js +4 -0
  30. package/src/contractSupport/bondingCurves.js +1 -1
  31. package/src/contractSupport/index.d.ts +2 -2
  32. package/src/contractSupport/index.js +2 -19
  33. package/src/contractSupport/prepare-ownable.d.ts +1 -1
  34. package/src/contractSupport/prepare-ownable.d.ts.map +1 -1
  35. package/src/contractSupport/prepare-ownable.js +5 -1
  36. package/src/contractSupport/priceAuthorityInitial.d.ts +2 -0
  37. package/src/contractSupport/priceAuthorityInitial.d.ts.map +1 -1
  38. package/src/contractSupport/priceAuthorityInitial.js +3 -1
  39. package/src/contractSupport/types-ambient.d.ts.map +1 -1
  40. package/src/contractSupport/types-ambient.js +1 -0
  41. package/src/contractSupport/zoeHelpers.d.ts +6 -1
  42. package/src/contractSupport/zoeHelpers.d.ts.map +1 -1
  43. package/src/contractSupport/zoeHelpers.js +1 -0
  44. package/src/contracts/atomicSwap.d.ts +1 -1
  45. package/src/contracts/auction/index.d.ts +5 -5
  46. package/src/contracts/automaticRefund.d.ts +4 -4
  47. package/src/contracts/autoswap.d.ts +4 -0
  48. package/src/contracts/autoswap.d.ts.map +1 -1
  49. package/src/contracts/autoswap.js +4 -0
  50. package/src/contracts/barterExchange.d.ts +3 -3
  51. package/src/contracts/callSpread/fundedCallSpread.d.ts +1 -1
  52. package/src/contracts/callSpread/pricedCallSpread.d.ts +5 -5
  53. package/src/contracts/coveredCall-durable.d.ts +1 -1
  54. package/src/contracts/coveredCall.d.ts +1 -1
  55. package/src/contracts/loan/index.d.ts +1 -1
  56. package/src/contracts/loan/liquidate.d.ts.map +1 -1
  57. package/src/contracts/loan/liquidate.js +5 -1
  58. package/src/contracts/loan/types-ambient.d.ts +13 -13
  59. package/src/contracts/loan/types-ambient.d.ts.map +1 -1
  60. package/src/contracts/loan/types-ambient.js +17 -17
  61. package/src/contracts/mintPayments.d.ts +4 -4
  62. package/src/contracts/oracle.d.ts +5 -2
  63. package/src/contracts/oracle.d.ts.map +1 -1
  64. package/src/contracts/oracle.js +1 -0
  65. package/src/contracts/otcDesk.d.ts +1 -1
  66. package/src/contracts/priceAggregator.d.ts +4 -2
  67. package/src/contracts/priceAggregator.d.ts.map +1 -1
  68. package/src/contracts/priceAggregator.js +10 -8
  69. package/src/contracts/scaledPriceAuthority.d.ts +1 -0
  70. package/src/contracts/scaledPriceAuthority.d.ts.map +1 -1
  71. package/src/contracts/scaledPriceAuthority.js +1 -0
  72. package/src/contracts/sellItems.d.ts +1 -1
  73. package/src/contracts/simpleExchange.d.ts +6 -1
  74. package/src/contracts/simpleExchange.d.ts.map +1 -1
  75. package/src/contracts/simpleExchange.js +4 -0
  76. package/src/contracts/types-ambient.d.ts +7 -7
  77. package/src/contracts/types-ambient.d.ts.map +1 -1
  78. package/src/contracts/types-ambient.js +7 -7
  79. package/src/contracts/valueVow.contract.d.ts +5 -2
  80. package/src/contracts/valueVow.contract.d.ts.map +1 -1
  81. package/src/contracts/valueVow.contract.js +1 -0
  82. package/src/instanceRecordStorage.d.ts +3 -1
  83. package/src/instanceRecordStorage.d.ts.map +1 -1
  84. package/src/instanceRecordStorage.js +9 -2
  85. package/src/internal-types.d.ts +25 -10
  86. package/src/internal-types.d.ts.map +1 -1
  87. package/src/internal-types.js +21 -11
  88. package/src/issuerRecord.d.ts +3 -2
  89. package/src/issuerRecord.d.ts.map +1 -1
  90. package/src/issuerRecord.js +6 -2
  91. package/src/issuerStorage.d.ts +3 -2
  92. package/src/issuerStorage.d.ts.map +1 -1
  93. package/src/issuerStorage.js +6 -5
  94. package/src/typeGuards.d.ts +10 -6
  95. package/src/typeGuards.d.ts.map +1 -1
  96. package/src/typeGuards.js +7 -5
  97. package/src/types-ambient.d.ts +0 -40
  98. package/src/types-ambient.d.ts.map +1 -1
  99. package/src/types-ambient.js +4 -42
  100. package/src/types-index.d.ts +4 -0
  101. package/src/types-index.js +2 -0
  102. package/src/types.d.ts +29 -0
  103. package/src/types.d.ts.map +1 -0
  104. package/src/types.ts +37 -0
  105. package/src/zoeService/escrowStorage.d.ts.map +1 -1
  106. package/src/zoeService/escrowStorage.js +1 -2
  107. package/src/zoeService/feeMint.d.ts +6 -3
  108. package/src/zoeService/feeMint.d.ts.map +1 -1
  109. package/src/zoeService/feeMint.js +8 -2
  110. package/src/zoeService/installationStorage.d.ts +3 -2
  111. package/src/zoeService/installationStorage.d.ts.map +1 -1
  112. package/src/zoeService/installationStorage.js +3 -7
  113. package/src/zoeService/internal-types.d.ts +11 -3
  114. package/src/zoeService/internal-types.d.ts.map +1 -1
  115. package/src/zoeService/internal-types.js +9 -3
  116. package/src/zoeService/invitationQueries.d.ts +3 -3
  117. package/src/zoeService/invitationQueries.js +3 -3
  118. package/src/zoeService/makeInvitation.d.ts +4 -1
  119. package/src/zoeService/makeInvitation.d.ts.map +1 -1
  120. package/src/zoeService/makeInvitation.js +8 -2
  121. package/src/zoeService/offer/offer.d.ts +1 -0
  122. package/src/zoeService/offer/offer.d.ts.map +1 -1
  123. package/src/zoeService/offer/offer.js +3 -1
  124. package/src/zoeService/originalZoeSeat.d.ts.map +1 -1
  125. package/src/zoeService/originalZoeSeat.js +0 -2
  126. package/src/zoeService/startInstance.d.ts.map +1 -1
  127. package/src/zoeService/startInstance.js +2 -4
  128. package/src/zoeService/types-ambient.d.ts +0 -226
  129. package/src/zoeService/types-ambient.d.ts.map +1 -1
  130. package/src/zoeService/types-ambient.js +4 -327
  131. package/src/zoeService/types.d.ts +238 -0
  132. package/src/zoeService/types.d.ts.map +1 -0
  133. package/src/zoeService/types.ts +307 -0
  134. package/src/zoeService/utils.d.ts +13 -5
  135. package/src/zoeService/utils.test-d.ts +1 -0
  136. package/src/zoeService/zoe.d.ts +18 -7
  137. package/src/zoeService/zoe.d.ts.map +1 -1
  138. package/src/zoeService/zoe.js +12 -5
  139. package/src/zoeService/zoeSeat.d.ts.map +1 -1
  140. package/src/zoeService/zoeSeat.js +1 -2
  141. package/src/zoeService/zoeStorageManager.d.ts +6 -6
  142. package/src/zoeService/zoeStorageManager.d.ts.map +1 -1
  143. package/src/zoeService/zoeStorageManager.js +13 -4
  144. package/tools/fakeVatAdmin.d.ts +15 -8
  145. package/tools/fakeVatAdmin.d.ts.map +1 -1
  146. package/tools/fakeVatAdmin.js +18 -10
  147. package/tools/manualPriceAuthority.d.ts +4 -1
  148. package/tools/manualPriceAuthority.d.ts.map +1 -1
  149. package/tools/manualPriceAuthority.js +1 -0
  150. package/tools/scriptedOracle.d.ts +7 -3
  151. package/tools/scriptedOracle.d.ts.map +1 -1
  152. package/tools/scriptedOracle.js +4 -0
  153. package/tools/setup-zoe.d.ts +13 -7
  154. package/tools/setup-zoe.d.ts.map +1 -1
  155. package/tools/setup-zoe.js +38 -5
  156. package/tools/test-utils.d.ts +1 -1
  157. package/tools/test-utils.js +1 -1
  158. package/tools/types.d.ts +1 -0
  159. package/tools/types.d.ts.map +1 -1
  160. package/tools/types.js +1 -0
  161. package/src/contractFacet/internal-types.d.ts +0 -8
  162. package/src/contractFacet/internal-types.d.ts.map +0 -1
  163. package/src/contractFacet/internal-types.js +0 -15
  164. package/src/contractFacet/types-ambient.js +0 -1
  165. package/src/contractSupport/ratio.d.ts +0 -37
  166. package/src/contractSupport/ratio.d.ts.map +0 -1
  167. package/src/contractSupport/ratio.js +0 -419
  168. package/src/contractSupport/safeMath.d.ts +0 -11
  169. package/src/contractSupport/safeMath.d.ts.map +0 -1
  170. package/src/contractSupport/safeMath.js +0 -49
@@ -1,328 +1,5 @@
1
- // @jessie-check
1
+ /** @file @deprecated */
2
2
 
3
- /// <reference types="ses" />
4
-
5
- /**
6
- * @typedef {object} ZoeService
7
- *
8
- * Zoe provides a framework for deploying and working with smart
9
- * contracts. It is accessed as a long-lived and well-trusted service
10
- * that enforces offer safety for the contracts that use it. Zoe has a
11
- * single `invitationIssuer` for the entirety of its lifetime. By
12
- * having a reference to Zoe, a user can get the `invitationIssuer`
13
- * and thus validate any `invitation` they receive from someone else.
14
- *
15
- * Zoe has two different facets: the public Zoe service and the
16
- * contract facet (ZCF). Each contract instance has a copy of ZCF
17
- * within its vat. The contract and ZCF never have direct access to
18
- * the users' payments or the Zoe purses.
19
- *
20
- * @property {GetInvitationIssuer} getInvitationIssuer
21
- *
22
- * Zoe has a single `invitationIssuer` for the entirety of its
23
- * lifetime. By having a reference to Zoe, a user can get the
24
- * `invitationIssuer` and thus validate any `invitation` they receive
25
- * from someone else. The mint associated with the invitationIssuer
26
- * creates the ERTP payments that represent the right to interact with
27
- * a smart contract in particular ways.
28
- *
29
- * @property {InstallBundle} install
30
- * @property {InstallBundleID} installBundleID
31
- * @property {import('./utils.js').StartInstance} startInstance
32
- * @property {Offer} offer
33
- * @property {import('./utils.js').GetPublicFacet} getPublicFacet
34
- * @property {GetIssuers} getIssuers
35
- * @property {GetBrands} getBrands
36
- * @property {import('./utils.js').GetTerms} getTerms
37
- * @property {GetOfferFilter} getOfferFilter
38
- * @property {GetInstallationForInstance} getInstallationForInstance
39
- * @property {GetInstance} getInstance
40
- * @property {GetInstallation} getInstallation
41
- * @property {GetInvitationDetails} getInvitationDetails
42
- * Return an object with the instance, installation, description, invitation
43
- * handle, and any custom properties specific to the contract.
44
- * @property {GetFeeIssuer} getFeeIssuer
45
- * @property {GetConfiguration} getConfiguration
46
- * @property {GetBundleIDFromInstallation} getBundleIDFromInstallation
47
- * @property {(invitationHandle: InvitationHandle) => import('@endo/patterns').Pattern | undefined} getProposalShapeForInvitation
48
- * Return the pattern (if any) associated with the invitationHandle that a
49
- * proposal is required to match to be accepted by zoe.offer().
50
- */
51
-
52
- /**
53
- * @callback GetInvitationIssuer
54
- * @returns {Promise<Issuer<'set', InvitationDetails>>}
55
- */
56
-
57
- /**
58
- * @callback GetFeeIssuer
59
- * @returns {Promise<Issuer<'nat'>>}
60
- */
61
-
62
- /**
63
- * @callback GetConfiguration
64
- * @returns {{
65
- * feeIssuerConfig: FeeIssuerConfig,
66
- * }}
67
- */
68
-
69
- /**
70
- * @callback GetIssuers
71
- * @param {import('./utils.js').Instance<any>} instance
72
- * @returns {Promise<IssuerKeywordRecord>}
73
- */
74
-
75
- /**
76
- * @callback GetBrands
77
- * @param {import('./utils.js').Instance<any>} instance
78
- * @returns {Promise<BrandKeywordRecord>}
79
- */
80
-
81
- /**
82
- * @callback GetOfferFilter
83
- * @param {import('./utils.js').Instance<any>} instance
84
- * @returns {string[]}
85
- */
86
-
87
- /**
88
- * @callback SetOfferFilter
89
- * @param {Instance} instance
90
- * @param {string[]} strings
91
- */
92
-
93
- /**
94
- * @callback GetInstallationForInstance
95
- * @param {import('./utils.js').Instance<any>} instance
96
- * @returns {Promise<Installation>}
97
- */
98
-
99
- /**
100
- * @callback GetInstance
101
- * @param {ERef<Invitation>} invitation
102
- * @returns {Promise<import('./utils.js').Instance<any>>}
103
- */
104
-
105
- /**
106
- * @callback GetInstallation
107
- * @param {ERef<Invitation>} invitation
108
- * @returns {Promise<Installation>}
109
- */
110
-
111
- /**
112
- * @callback GetInvitationDetails
113
- * @param {ERef<Invitation<any, any>>} invitation
114
- * @returns {Promise<InvitationDetails>}
115
- */
116
-
117
- // TODO remove support for source bundles, leaving only support for hash bundles.
118
- // https://github.com/Agoric/agoric-sdk/issues/4565
119
- /**
120
- * @callback InstallBundle
121
- *
122
- * Create an installation by safely evaluating the code and
123
- * registering it with Zoe. Returns an installation.
124
- *
125
- * @param {Bundle | SourceBundle} bundle
126
- * @param {string} [bundleLabel]
127
- * @returns {Promise<Installation>}
128
- */
129
-
130
- // TODO consolidate installBundleID into install.
131
- // https://github.com/Agoric/agoric-sdk/issues/4974
132
- /**
133
- * @callback InstallBundleID
134
- *
135
- * Create an installation from a Bundle ID. Returns an installation.
136
- *
137
- * @param {BundleID} bundleID
138
- * @param {string} [bundleLabel]
139
- * @returns {Promise<Installation>}
140
- */
141
-
142
- /**
143
- * @callback GetBundleIDFromInstallation
144
- *
145
- * Verify that an alleged Installation is real, and return the Bundle ID it
146
- * will use for contract code.
147
- *
148
- * @param {ERef<Installation>} allegedInstallation
149
- * @returns {Promise<BundleID>}
150
- */
151
-
152
- /**
153
- * @typedef {<Result, Args = undefined>(
154
- * invitation: ERef<Invitation<Result, Args>>,
155
- * proposal?: Proposal,
156
- * paymentKeywordRecord?: PaymentPKeywordRecord,
157
- * offerArgs?: Args,
158
- * ) => Promise<UserSeat<Result>>
159
- * } Offer
160
- *
161
- * To redeem an invitation, the user normally provides a proposal (their
162
- * rules for the offer) as well as payments to be escrowed by Zoe. If
163
- * either the proposal or payments would be empty, indicate this by
164
- * omitting that argument or passing undefined, rather than passing an
165
- * empty record.
166
- *
167
- * The proposal has three parts: `want` and `give` are used by Zoe to
168
- * enforce offer safety, and `exit` is used to specify the particular
169
- * payout-liveness policy that Zoe can guarantee. `want` and `give`
170
- * are objects with keywords as keys and amounts as values.
171
- * `paymentKeywordRecord` is a record with keywords as keys, and the
172
- * values are the actual payments to be escrowed. A payment is
173
- * expected for every rule under `give`.
174
- */
175
-
176
- /**
177
- * Zoe uses seats to access or manipulate offers. They let contracts and users
178
- * interact with them. Zoe has two kinds of seats. ZCFSeats are used within
179
- * contracts and with zcf methods. UserSeats represent offers external to Zoe
180
- * and the contract. The party who exercises an invitation and sends the offer()
181
- * message to Zoe gets a UserSeat that can check payouts' status or retrieve the
182
- * result of processing the offer in the contract. This varies, but examples are
183
- * a string and an invitation for another seat.
184
- *
185
- * Also, a UserSeat can be handed to an agent outside Zoe and the contract,
186
- * letting them query or monitor the current state, access the payouts and
187
- * result, and, if it's allowed for this seat, call tryExit().
188
- *
189
- * Since anyone can attempt to exit the seat if they have a reference to it, you
190
- * should only share a UserSeat with trusted parties.
191
- *
192
- * UserSeat includes queries for the associated offer's current state and an
193
- * operation to request that the offer exit, as follows:
194
- *
195
- * @see {@link https://docs.agoric.com/zoe/api/zoe.html#userseat-object}}
196
- * @template {object} [OR=unknown]
197
- * @typedef {object} UserSeat
198
- * @property {() => Promise<ProposalRecord>} getProposal
199
- * @property {() => Promise<PaymentPKeywordRecord>} getPayouts
200
- * returns a promise for a KeywordPaymentRecord containing all the payouts from
201
- * this seat. The promise will resolve after the seat has exited.
202
- * @property {(keyword: Keyword) => Promise<Payment<any, any>>} getPayout
203
- * returns a promise for the Payment corresponding to the indicated keyword.
204
- * The promise will resolve after the seat has exited. If there is no payment
205
- * corresponding to the keyword, an error will be thrown. (It used to return
206
- * undefined.)
207
- * @property {() => Promise<OR>} getOfferResult
208
- * @property {() => void} [tryExit]
209
- * Note: Only works if the seat's `proposal` has an `OnDemand` `exit` clause. Zoe's
210
- * offer-safety guarantee applies no matter how a seat's interaction with a
211
- * contract ends. Under normal circumstances, the participant might be able to
212
- * call `tryExit()`, or the contract might do something explicitly. On exiting,
213
- * the seat holder gets its current `allocation` and the `seat` can no longer
214
- * interact with the contract.
215
- * @property {() => Promise<boolean>} hasExited
216
- * Returns true if the seat has exited, false if it is still active.
217
- * @property {() => Promise<0|1>} numWantsSatisfied returns 1 if the proposal's
218
- * want clause was satisfied by the final allocation, otherwise 0. This is
219
- * numeric to support a planned enhancement called "multiples" which will allow
220
- * the return value to be any non-negative number. The promise will resolve
221
- * after the seat has exited.
222
- * @property {() => Promise<Allocation>} getFinalAllocation
223
- * return a promise for the final allocation. The promise will resolve after the
224
- * seat has exited.
225
- * @property {() => Subscriber<Completion>} getExitSubscriber returns a subscriber that
226
- * will be notified when the seat has exited or failed.
227
- */
228
-
229
- /**
230
- * @typedef {Partial<ProposalRecord>} Proposal
231
- *
232
- * @typedef {{give: AmountKeywordRecord,
233
- * want: AmountKeywordRecord,
234
- * exit: ExitRule
235
- * }} ProposalRecord
236
- */
237
-
238
- /**
239
- * @typedef {Record<Keyword, import('@agoric/ertp/src/types.js').AnyAmount>} AmountKeywordRecord
240
- *
241
- * The keys are keywords, and the values are amounts. For example:
242
- * { Asset: AmountMath.make(assetBrand, 5n), Price:
243
- * AmountMath.make(priceBrand, 9n) }
244
- */
245
-
246
- /**
247
- * @typedef {object} Waker
248
- * @property {() => void} wake
249
- */
250
-
251
- /**
252
- * @typedef {object} OnDemandExitRule
253
- * @property {null} onDemand
254
- */
255
-
256
- /**
257
- * @typedef {object} WaivedExitRule
258
- * @property {null} waived
259
- */
260
-
261
- /**
262
- * @typedef {object} AfterDeadlineExitRule
263
- * @property {{timer: import('@agoric/time').TimerService, deadline: import('@agoric/time').Timestamp}} afterDeadline
264
- */
265
-
266
- /**
267
- * @typedef {OnDemandExitRule | WaivedExitRule | AfterDeadlineExitRule} ExitRule
268
- *
269
- * The possible keys are 'waived', 'onDemand', and 'afterDeadline'.
270
- * `timer` and `deadline` only are used for the `afterDeadline` key.
271
- * The possible records are:
272
- * `{ waived: null }`
273
- * `{ onDemand: null }`
274
- * `{ afterDeadline: { timer :Timer<Deadline>, deadline :Deadline } }`
275
- */
276
-
277
- /**
278
- * @typedef {import('./utils.js').Instance<any>} Instance
279
- */
280
-
281
- /**
282
- * @typedef {{bundleCap: import('@agoric/swingset-vat').BundleCap } | {name: string} | {id: BundleID}} ZCFSpec
283
- */
284
-
285
- /**
286
- * @typedef {Record<string, any>} SourceBundle
287
- * Opaque type for a JSONable source bundle
288
- */
289
-
290
- /**
291
- * @typedef {Record<Keyword,ERef<Payment<any>>>} PaymentPKeywordRecord
292
- * @typedef {Record<Keyword,Payment<any>>} PaymentKeywordRecord
293
- */
294
-
295
- /**
296
- * @typedef {object} InvitationDetails
297
- * @property {Installation} installation
298
- * @property {import('./utils.js').Instance<any>} instance
299
- * @property {InvitationHandle} handle
300
- * @property {string} description
301
- * @property {Record<string, any>} [customDetails]
302
- */
303
-
304
- /**
305
- * @template [SF=any] contract start function
306
- * @typedef {import('./utils.js').Installation<SF>} Installation
307
- */
308
-
309
- /**
310
- * @template {Installation} I
311
- * @typedef {import('./utils.js').InstallationStart<I>} InstallationStart
312
- */
313
-
314
- /**
315
- * @typedef {object} FeeIssuerConfig
316
- * @property {string} name
317
- * @property {AssetKind} assetKind
318
- * @property {DisplayInfo} displayInfo
319
- */
320
-
321
- /**
322
- * @typedef {object} ZoeFeesConfig
323
- * @property {NatValue} getPublicFacetFee
324
- */
325
-
326
- /**
327
- * @typedef {Handle<'feeMintAccess'>} FeeMintAccess
328
- */
3
+ console.error(
4
+ 'NOTICE: src/zoeService/types-ambient.js no longer provides types; use explicit imports or the top level `/exported.js`',
5
+ );
@@ -0,0 +1,238 @@
1
+ import type { AnyAmount, AssetKind, DisplayInfo, Issuer, NatValue, Payment } from '@agoric/ertp';
2
+ import type { Subscriber } from '@agoric/notifier';
3
+ import type { ERef, EReturn } from '@endo/eventual-send';
4
+ import type { Bundle, BundleID } from '@agoric/swingset-vat';
5
+ import type { ContractStartFunction, StartParams } from './utils.js';
6
+ import type { Keyword, InvitationHandle, BrandKeywordRecord, Handle, IssuerKeywordRecord } from '../types.js';
7
+ import type { Allocation } from '../types-index.js';
8
+ /**
9
+ * @see {@link https://github.com/sindresorhus/type-fest/blob/main/source/is-any.d.ts}
10
+ */
11
+ type IsAny<T> = 0 extends 1 & NoInfer<T> ? true : false;
12
+ /**
13
+ * Zoe provides a framework for deploying and working with smart
14
+ * contracts. It is accessed as a long-lived and well-trusted service
15
+ * that enforces offer safety for the contracts that use it. Zoe has a
16
+ * single `invitationIssuer` for the entirety of its lifetime. By
17
+ * having a reference to Zoe, a user can get the `invitationIssuer`
18
+ * and thus validate any `invitation` they receive from someone else.
19
+ *
20
+ * Zoe has two different facets: the public Zoe service and the
21
+ * contract facet (ZCF). Each contract instance has a copy of ZCF
22
+ * within its vat. The contract and ZCF never have direct access to
23
+ * the users' payments or the Zoe purses.
24
+ */
25
+ export type ZoeService = {
26
+ /**
27
+ * Zoe has a single `invitationIssuer` for the entirety of its
28
+ * lifetime. By having a reference to Zoe, a user can get the
29
+ * `invitationIssuer` and thus validate any `invitation` they receive
30
+ * from someone else. The mint associated with the invitationIssuer
31
+ * creates the ERTP payments that represent the right to interact with
32
+ * a smart contract in particular ways.
33
+ */
34
+ getInvitationIssuer: GetInvitationIssuer;
35
+ install: InstallBundle;
36
+ installBundleID: InstallBundleID;
37
+ startInstance: import('./utils.js').StartInstance;
38
+ offer: Offer;
39
+ getPublicFacet: <I extends Instance>(instance: ERef<I>) => Promise<IsAny<I> extends true ? any : I extends import('./utils.js').Instance<infer SF extends ContractStartFunction> ? IsAny<SF> extends true ? unknown : EReturn<SF>['publicFacet'] : never>;
40
+ getIssuers: GetIssuers;
41
+ getBrands: GetBrands;
42
+ getTerms: <I extends ERef<Instance>>(instance: I) => IsAny<I> extends true ? Promise<any> : I extends ERef<import('./utils.js').Instance<infer SF extends ContractStartFunction>> ? IsAny<SF> extends true ? Promise<unknown> : Promise<StartParams<SF>['terms']> : never;
43
+ getOfferFilter: (instance: ERef<Instance>) => Promise<string[]>;
44
+ getInstallationForInstance: GetInstallationForInstance;
45
+ getInstance: GetInstance;
46
+ getInstallation: GetInstallation;
47
+ /**
48
+ * Return an object with the instance, installation, description, invitation
49
+ * handle, and any custom properties specific to the contract.
50
+ */
51
+ getInvitationDetails: GetInvitationDetails;
52
+ getFeeIssuer: GetFeeIssuer;
53
+ getConfiguration: GetConfiguration;
54
+ getBundleIDFromInstallation: GetBundleIDFromInstallation;
55
+ /**
56
+ * Return the pattern (if any) associated with the invitationHandle that a
57
+ * proposal is required to match to be accepted by zoe.offer().
58
+ */
59
+ getProposalShapeForInvitation: (invitationHandle: InvitationHandle) => import('@endo/patterns').Pattern | undefined;
60
+ };
61
+ type GetInvitationIssuer = () => Promise<Issuer<'set', InvitationDetails>>;
62
+ type GetFeeIssuer = () => Promise<Issuer<'nat'>>;
63
+ type GetConfiguration = () => {
64
+ feeIssuerConfig: FeeIssuerConfig;
65
+ };
66
+ export type GetIssuers = (instance: import('./utils.js').Instance<any>) => Promise<IssuerKeywordRecord>;
67
+ export type GetBrands = (instance: import('./utils.js').Instance<any>) => Promise<BrandKeywordRecord>;
68
+ type GetInstallationForInstance = (instance: import('./utils.js').Instance<any>) => Promise<Installation>;
69
+ export type GetInstance = (invitation: ERef<import('../types-index.js').Invitation>) => Promise<import('./utils.js').Instance<any>>;
70
+ export type GetInstallation = (invitation: ERef<import('../types-index.js').Invitation>) => Promise<Installation>;
71
+ export type GetInvitationDetails = (invitation: ERef<import('../types-index.js').Invitation<any, any>>) => Promise<InvitationDetails>;
72
+ /**
73
+ * Create an installation by safely evaluating the code and
74
+ * registering it with Zoe. Returns an installation.
75
+ */
76
+ export type InstallBundle = (bundle: Bundle | SourceBundle, bundleLabel?: string | undefined) => Promise<Installation>;
77
+ /**
78
+ * Create an installation from a Bundle ID. Returns an installation.
79
+ */
80
+ export type InstallBundleID = (bundleID: BundleID, bundleLabel?: string | undefined) => Promise<Installation>;
81
+ /**
82
+ * Verify that an alleged Installation is real, and return the Bundle ID it
83
+ * will use for contract code.
84
+ */
85
+ export type GetBundleIDFromInstallation = (allegedInstallation: ERef<Installation>) => Promise<string>;
86
+ /**
87
+ * To redeem an invitation, the user normally provides a proposal (their
88
+ * rules for the offer) as well as payments to be escrowed by Zoe. If
89
+ * either the proposal or payments would be empty, indicate this by
90
+ * omitting that argument or passing undefined, rather than passing an
91
+ * empty record.
92
+ *
93
+ * The proposal has three parts: `want` and `give` are used by Zoe to
94
+ * enforce offer safety, and `exit` is used to specify the particular
95
+ * payout-liveness policy that Zoe can guarantee. `want` and `give`
96
+ * are objects with keywords as keys and amounts as values.
97
+ * `paymentKeywordRecord` is a record with keywords as keys, and the
98
+ * values are the actual payments to be escrowed. A payment is
99
+ * expected for every rule under `give`.
100
+ */
101
+ export type Offer = <Result, Args = undefined>(invitation: ERef<import('../types-index.js').Invitation<Result, Args>>, proposal?: Proposal, paymentKeywordRecord?: PaymentPKeywordRecord, offerArgs?: Args) => Promise<UserSeat<Result>>;
102
+ /**
103
+ * Zoe uses seats to access or manipulate offers. They let contracts and users
104
+ * interact with them. Zoe has two kinds of seats. ZCFSeats are used within
105
+ * contracts and with zcf methods. UserSeats represent offers external to Zoe
106
+ * and the contract. The party who exercises an invitation and sends the offer()
107
+ * message to Zoe gets a UserSeat that can check payouts' status or retrieve the
108
+ * result of processing the offer in the contract. This varies, but examples are
109
+ * a string and an invitation for another seat.
110
+ *
111
+ * Also, a UserSeat can be handed to an agent outside Zoe and the contract,
112
+ * letting them query or monitor the current state, access the payouts and
113
+ * result, and, if it's allowed for this seat, call tryExit().
114
+ *
115
+ * Since anyone can attempt to exit the seat if they have a reference to it, you
116
+ * should only share a UserSeat with trusted parties.
117
+ *
118
+ * UserSeat includes queries for the associated offer's current state and an
119
+ * operation to request that the offer exit, as follows:
120
+ */
121
+ export type UserSeat<OR = unknown> = {
122
+ getProposal: () => Promise<ProposalRecord>;
123
+ /**
124
+ * returns a promise for a KeywordPaymentRecord containing all the payouts from
125
+ * this seat. The promise will resolve after the seat has exited.
126
+ */
127
+ getPayouts: () => Promise<PaymentPKeywordRecord>;
128
+ /**
129
+ * returns a promise for the Payment corresponding to the indicated keyword.
130
+ * The promise will resolve after the seat has exited. If there is no payment
131
+ * corresponding to the keyword, an error will be thrown. (It used to return
132
+ * undefined.)
133
+ */
134
+ getPayout: (keyword: Keyword) => Promise<Payment<any, any>>;
135
+ getOfferResult: () => Promise<OR>;
136
+ /**
137
+ * Note: Only works if the seat's `proposal` has an `OnDemand` `exit` clause. Zoe's
138
+ * offer-safety guarantee applies no matter how a seat's interaction with a
139
+ * contract ends. Under normal circumstances, the participant might be able to
140
+ * call `tryExit()`, or the contract might do something explicitly. On exiting,
141
+ * the seat holder gets its current `allocation` and the `seat` can no longer
142
+ * interact with the contract.
143
+ */
144
+ tryExit?: (() => void) | undefined;
145
+ /**
146
+ * Returns true if the seat has exited, false if it is still active.
147
+ */
148
+ hasExited: () => Promise<boolean>;
149
+ /**
150
+ * returns 1 if the proposal's
151
+ * want clause was satisfied by the final allocation, otherwise 0. This is
152
+ * numeric to support a planned enhancement called "multiples" which will allow
153
+ * the return value to be any non-negative number. The promise will resolve
154
+ * after the seat has exited.
155
+ */
156
+ numWantsSatisfied: () => Promise<0 | 1>;
157
+ /**
158
+ * return a promise for the final allocation. The promise will resolve after the
159
+ * seat has exited.
160
+ */
161
+ getFinalAllocation: () => Promise<Allocation>;
162
+ /**
163
+ * returns a subscriber that
164
+ * will be notified when the seat has exited or failed.
165
+ */
166
+ getExitSubscriber: () => Subscriber<import('../types-index.js').Completion>;
167
+ };
168
+ export type Proposal = Partial<ProposalRecord>;
169
+ export type ProposalRecord = {
170
+ give: AmountKeywordRecord;
171
+ want: AmountKeywordRecord;
172
+ exit: ExitRule;
173
+ };
174
+ /**
175
+ * The keys are keywords, and the values are amounts. For example:
176
+ * { Asset: AmountMath.make(assetBrand, 5n), Price:
177
+ * AmountMath.make(priceBrand, 9n) }
178
+ */
179
+ export type AmountKeywordRecord = Record<Keyword, AnyAmount>;
180
+ export type Waker = {
181
+ wake: () => void;
182
+ };
183
+ export type OnDemandExitRule = {
184
+ onDemand: null;
185
+ };
186
+ export type WaivedExitRule = {
187
+ waived: null;
188
+ };
189
+ export type AfterDeadlineExitRule = {
190
+ afterDeadline: {
191
+ timer: import('@agoric/time').TimerService;
192
+ deadline: import('@agoric/time').Timestamp;
193
+ };
194
+ };
195
+ /**
196
+ * The possible keys are 'waived', 'onDemand', and 'afterDeadline'.
197
+ * `timer` and `deadline` only are used for the `afterDeadline` key.
198
+ * The possible records are:
199
+ * `{ waived: null }`
200
+ * `{ onDemand: null }`
201
+ * `{ afterDeadline: { timer :Timer<Deadline>, deadline :Deadline } }`
202
+ */
203
+ export type ExitRule = OnDemandExitRule | WaivedExitRule | AfterDeadlineExitRule;
204
+ export type Instance<SF = any> = import('./utils.js').Instance<SF>;
205
+ export type ZCFSpec = {
206
+ bundleCap: import('@agoric/swingset-vat').BundleCap;
207
+ } | {
208
+ name: string;
209
+ } | {
210
+ /** Bundle ID */
211
+ id: string;
212
+ };
213
+ /**
214
+ * Opaque type for a JSONable source bundle
215
+ */
216
+ export type SourceBundle = Record<string, any>;
217
+ export type PaymentPKeywordRecord = Record<Keyword, ERef<Payment<any>>>;
218
+ export type PaymentKeywordRecord = Record<Keyword, Payment<any>>;
219
+ export type InvitationDetails = {
220
+ installation: Installation;
221
+ instance: import('./utils.js').Instance<any>;
222
+ handle: InvitationHandle;
223
+ description: string;
224
+ customDetails?: Record<string, any> | undefined;
225
+ };
226
+ export type Installation<SF = any> = import('./utils.js').Installation<SF>;
227
+ export type InstallationStart<I extends Installation> = import('./utils.js').InstallationStart<I>;
228
+ export type FeeIssuerConfig = {
229
+ name: string;
230
+ assetKind: AssetKind;
231
+ displayInfo: DisplayInfo;
232
+ };
233
+ export type ZoeFeesConfig = {
234
+ getPublicFacetFee: NatValue;
235
+ };
236
+ export type FeeMintAccess = Handle<'feeMintAccess'>;
237
+ export {};
238
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,SAAS,EACT,SAAS,EACT,WAAW,EACX,MAAM,EACN,QAAQ,EACR,OAAO,EACR,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,kBAAkB,CAAC;AACnD,OAAO,KAAK,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAC7D,OAAO,KAAK,EAAE,qBAAqB,EAAE,WAAW,EAAE,MAAM,YAAY,CAAC;AACrE,OAAO,KAAK,EACV,OAAO,EACP,gBAAgB,EAChB,kBAAkB,EAClB,MAAM,EACN,mBAAmB,EACpB,MAAM,aAAa,CAAC;AACrB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAC;AAEpD;;GAEG;AACH,KAAK,KAAK,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,IAAI,GAAG,KAAK,CAAC;AAExD;;;;;;;;;;;;GAYG;AACH,MAAM,MAAM,UAAU,GAAG;IACvB;;;;;;;OAOG;IACH,mBAAmB,EAAE,mBAAmB,CAAC;IACzC,OAAO,EAAE,aAAa,CAAC;IACvB,eAAe,EAAE,eAAe,CAAC;IACjC,aAAa,EAAE,OAAO,YAAY,EAAE,aAAa,CAAC;IAClD,KAAK,EAAE,KAAK,CAAC;IACb,cAAc,EAAE,CAA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