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