@agoric/zoe 0.26.3-dev-727699e.0 → 0.26.3-dev-3d98aac.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 (117) hide show
  1. package/bundles/bundle-contractFacet-js-meta.json +226 -236
  2. package/bundles/bundle-contractFacet.js +1 -1
  3. package/package.json +15 -15
  4. package/src/cleanProposal.d.ts +1 -0
  5. package/src/cleanProposal.d.ts.map +1 -1
  6. package/src/cleanProposal.js +4 -0
  7. package/src/contractFacet/exit.d.ts +1 -1
  8. package/src/contractFacet/exit.d.ts.map +1 -1
  9. package/src/contractFacet/types.d.ts +174 -0
  10. package/src/contractFacet/types.d.ts.map +1 -0
  11. package/src/contractFacet/{types-ambient.d.ts → types.ts} +42 -23
  12. package/src/contractFacet/vatRoot.d.ts +8 -2
  13. package/src/contractFacet/vatRoot.d.ts.map +1 -1
  14. package/src/contractFacet/vatRoot.js +5 -4
  15. package/src/contractFacet/zcfMint.d.ts +1 -0
  16. package/src/contractFacet/zcfMint.d.ts.map +1 -1
  17. package/src/contractFacet/zcfMint.js +4 -2
  18. package/src/contractFacet/zcfSeat.d.ts.map +1 -1
  19. package/src/contractFacet/zcfSeat.js +1 -0
  20. package/src/contractFacet/zcfZygote.d.ts +9 -1
  21. package/src/contractFacet/zcfZygote.d.ts.map +1 -1
  22. package/src/contractFacet/zcfZygote.js +15 -3
  23. package/src/contractSupport/atomicTransfer.d.ts +6 -0
  24. package/src/contractSupport/atomicTransfer.d.ts.map +1 -1
  25. package/src/contractSupport/atomicTransfer.js +4 -0
  26. package/src/contractSupport/priceAuthorityInitial.d.ts +2 -0
  27. package/src/contractSupport/priceAuthorityInitial.d.ts.map +1 -1
  28. package/src/contractSupport/priceAuthorityInitial.js +1 -0
  29. package/src/contractSupport/types-ambient.d.ts.map +1 -1
  30. package/src/contractSupport/types-ambient.js +1 -0
  31. package/src/contractSupport/zoeHelpers.d.ts +5 -0
  32. package/src/contractSupport/zoeHelpers.d.ts.map +1 -1
  33. package/src/contractSupport/zoeHelpers.js +1 -0
  34. package/src/contracts/atomicSwap.d.ts +1 -1
  35. package/src/contracts/auction/index.d.ts +3 -3
  36. package/src/contracts/automaticRefund.d.ts +3 -3
  37. package/src/contracts/autoswap.d.ts +4 -0
  38. package/src/contracts/autoswap.d.ts.map +1 -1
  39. package/src/contracts/autoswap.js +4 -0
  40. package/src/contracts/barterExchange.d.ts +2 -2
  41. package/src/contracts/callSpread/fundedCallSpread.d.ts +1 -1
  42. package/src/contracts/callSpread/pricedCallSpread.d.ts +4 -4
  43. package/src/contracts/coveredCall-durable.d.ts +1 -1
  44. package/src/contracts/coveredCall.d.ts +1 -1
  45. package/src/contracts/loan/index.d.ts +1 -1
  46. package/src/contracts/loan/types-ambient.d.ts +13 -13
  47. package/src/contracts/loan/types-ambient.d.ts.map +1 -1
  48. package/src/contracts/loan/types-ambient.js +17 -17
  49. package/src/contracts/mintPayments.d.ts +2 -2
  50. package/src/contracts/oracle.d.ts +3 -0
  51. package/src/contracts/oracle.d.ts.map +1 -1
  52. package/src/contracts/oracle.js +1 -0
  53. package/src/contracts/priceAggregator.d.ts +2 -0
  54. package/src/contracts/priceAggregator.d.ts.map +1 -1
  55. package/src/contracts/priceAggregator.js +6 -2
  56. package/src/contracts/scaledPriceAuthority.d.ts +1 -0
  57. package/src/contracts/scaledPriceAuthority.d.ts.map +1 -1
  58. package/src/contracts/scaledPriceAuthority.js +1 -0
  59. package/src/contracts/sellItems.d.ts +1 -1
  60. package/src/contracts/simpleExchange.d.ts +5 -0
  61. package/src/contracts/simpleExchange.d.ts.map +1 -1
  62. package/src/contracts/simpleExchange.js +4 -0
  63. package/src/contracts/types-ambient.d.ts +7 -7
  64. package/src/contracts/types-ambient.d.ts.map +1 -1
  65. package/src/contracts/types-ambient.js +7 -7
  66. package/src/contracts/valueVow.contract.d.ts +4 -0
  67. package/src/contracts/valueVow.contract.d.ts.map +1 -1
  68. package/src/contracts/valueVow.contract.js +1 -0
  69. package/src/internal-types.d.ts +6 -1
  70. package/src/internal-types.d.ts.map +1 -1
  71. package/src/internal-types.js +5 -0
  72. package/src/typeGuards.d.ts +7 -5
  73. package/src/typeGuards.d.ts.map +1 -1
  74. package/src/typeGuards.js +4 -3
  75. package/src/types-index.d.ts +3 -0
  76. package/src/types-index.js +2 -0
  77. package/src/zoeService/feeMint.d.ts +1 -0
  78. package/src/zoeService/feeMint.d.ts.map +1 -1
  79. package/src/zoeService/feeMint.js +4 -0
  80. package/src/zoeService/installationStorage.d.ts +3 -2
  81. package/src/zoeService/installationStorage.d.ts.map +1 -1
  82. package/src/zoeService/installationStorage.js +1 -0
  83. package/src/zoeService/internal-types.d.ts +9 -3
  84. package/src/zoeService/internal-types.d.ts.map +1 -1
  85. package/src/zoeService/internal-types.js +8 -3
  86. package/src/zoeService/invitationQueries.d.ts +3 -3
  87. package/src/zoeService/invitationQueries.js +3 -3
  88. package/src/zoeService/makeInvitation.d.ts +1 -0
  89. package/src/zoeService/makeInvitation.d.ts.map +1 -1
  90. package/src/zoeService/makeInvitation.js +3 -0
  91. package/src/zoeService/offer/offer.d.ts +1 -0
  92. package/src/zoeService/offer/offer.d.ts.map +1 -1
  93. package/src/zoeService/offer/offer.js +3 -1
  94. package/src/zoeService/types-ambient.d.ts +0 -226
  95. package/src/zoeService/types-ambient.d.ts.map +1 -1
  96. package/src/zoeService/types-ambient.js +4 -327
  97. package/src/zoeService/types.d.ts +235 -0
  98. package/src/zoeService/types.d.ts.map +1 -0
  99. package/src/zoeService/types.ts +299 -0
  100. package/src/zoeService/utils.d.ts +1 -4
  101. package/src/zoeService/utils.test-d.ts +1 -0
  102. package/src/zoeService/zoe.d.ts +11 -1
  103. package/src/zoeService/zoe.d.ts.map +1 -1
  104. package/src/zoeService/zoe.js +8 -1
  105. package/src/zoeService/zoeStorageManager.d.ts +5 -5
  106. package/src/zoeService/zoeStorageManager.d.ts.map +1 -1
  107. package/src/zoeService/zoeStorageManager.js +4 -1
  108. package/tools/scriptedOracle.d.ts +6 -2
  109. package/tools/scriptedOracle.d.ts.map +1 -1
  110. package/tools/scriptedOracle.js +4 -0
  111. package/tools/setup-zoe.d.ts +4 -3
  112. package/tools/setup-zoe.d.ts.map +1 -1
  113. package/tools/setup-zoe.js +4 -0
  114. package/src/contractFacet/internal-types.d.ts +0 -8
  115. package/src/contractFacet/internal-types.d.ts.map +0 -1
  116. package/src/contractFacet/internal-types.js +0 -15
  117. package/src/contractFacet/types-ambient.js +0 -1
@@ -0,0 +1,299 @@
1
+ import type {
2
+ AnyAmount,
3
+ AssetKind,
4
+ DisplayInfo,
5
+ Issuer,
6
+ NatValue,
7
+ Payment,
8
+ } from '@agoric/ertp';
9
+ import type { Subscriber } from '@agoric/notifier';
10
+ import type { ERef, EReturn } from '@endo/eventual-send';
11
+ import type { Bundle, BundleID } from '@agoric/swingset-vat';
12
+ import type { ContractStartFunction, StartParams } from './utils.js';
13
+
14
+ export type IssuerKeywordRecord = Record<Keyword, Issuer<any>>;
15
+
16
+ /** @see {@link https://github.com/sindresorhus/type-fest/blob/main/source/is-any.d.ts} */
17
+ type IsAny<T> = 0 extends 1 & NoInfer<T> ? true : false;
18
+
19
+ /**
20
+ * Zoe provides a framework for deploying and working with smart
21
+ * contracts. It is accessed as a long-lived and well-trusted service
22
+ * that enforces offer safety for the contracts that use it. Zoe has a
23
+ * single `invitationIssuer` for the entirety of its lifetime. By
24
+ * having a reference to Zoe, a user can get the `invitationIssuer`
25
+ * and thus validate any `invitation` they receive from someone else.
26
+ *
27
+ * Zoe has two different facets: the public Zoe service and the
28
+ * contract facet (ZCF). Each contract instance has a copy of ZCF
29
+ * within its vat. The contract and ZCF never have direct access to
30
+ * the users' payments or the Zoe purses.
31
+ */
32
+ export type ZoeService = {
33
+ /**
34
+ * Zoe has a single `invitationIssuer` for the entirety of its
35
+ * lifetime. By having a reference to Zoe, a user can get the
36
+ * `invitationIssuer` and thus validate any `invitation` they receive
37
+ * from someone else. The mint associated with the invitationIssuer
38
+ * creates the ERTP payments that represent the right to interact with
39
+ * a smart contract in particular ways.
40
+ */
41
+ getInvitationIssuer: GetInvitationIssuer;
42
+ install: InstallBundle;
43
+ installBundleID: InstallBundleID;
44
+ startInstance: import('./utils.js').StartInstance;
45
+ offer: Offer;
46
+ getPublicFacet: <I extends Instance>(
47
+ instance: ERef<I>,
48
+ ) => Promise<
49
+ IsAny<I> extends true
50
+ ? any
51
+ : I extends import('./utils.js').Instance<
52
+ infer SF extends ContractStartFunction
53
+ >
54
+ ? IsAny<SF> extends true
55
+ ? unknown
56
+ : EReturn<SF>['publicFacet']
57
+ : never
58
+ >;
59
+ getIssuers: GetIssuers;
60
+ getBrands: GetBrands;
61
+ getTerms: <I extends ERef<Instance>>(
62
+ instance: I,
63
+ ) => IsAny<I> extends true
64
+ ? Promise<any>
65
+ : I extends ERef<
66
+ import('./utils.js').Instance<infer SF extends ContractStartFunction>
67
+ >
68
+ ? IsAny<SF> extends true
69
+ ? Promise<unknown>
70
+ : Promise<StartParams<SF>['terms']>
71
+ : never;
72
+ getOfferFilter: (instance: ERef<Instance>) => Promise<string[]>;
73
+ getInstallationForInstance: GetInstallationForInstance;
74
+ getInstance: GetInstance;
75
+ getInstallation: GetInstallation;
76
+ /**
77
+ * Return an object with the instance, installation, description, invitation
78
+ * handle, and any custom properties specific to the contract.
79
+ */
80
+ getInvitationDetails: GetInvitationDetails;
81
+ getFeeIssuer: GetFeeIssuer;
82
+ getConfiguration: GetConfiguration;
83
+ getBundleIDFromInstallation: GetBundleIDFromInstallation;
84
+ /**
85
+ * Return the pattern (if any) associated with the invitationHandle that a
86
+ * proposal is required to match to be accepted by zoe.offer().
87
+ */
88
+ getProposalShapeForInvitation: (
89
+ invitationHandle: InvitationHandle,
90
+ ) => import('@endo/patterns').Pattern | undefined;
91
+ };
92
+ type GetInvitationIssuer = () => Promise<Issuer<'set', InvitationDetails>>;
93
+ type GetFeeIssuer = () => Promise<Issuer<'nat'>>;
94
+ type GetConfiguration = () => {
95
+ feeIssuerConfig: FeeIssuerConfig;
96
+ };
97
+ export type GetIssuers = (
98
+ instance: import('./utils.js').Instance<any>,
99
+ ) => Promise<IssuerKeywordRecord>;
100
+ export type GetBrands = (
101
+ instance: import('./utils.js').Instance<any>,
102
+ ) => Promise<BrandKeywordRecord>;
103
+ type GetInstallationForInstance = (
104
+ instance: import('./utils.js').Instance<any>,
105
+ ) => Promise<Installation>;
106
+ export type GetInstance = (
107
+ invitation: ERef<import('../types-index.js').Invitation>,
108
+ ) => Promise<import('./utils.js').Instance<any>>;
109
+ export type GetInstallation = (
110
+ invitation: ERef<import('../types-index.js').Invitation>,
111
+ ) => Promise<Installation>;
112
+ export type GetInvitationDetails = (
113
+ invitation: ERef<import('../types-index.js').Invitation<any, any>>,
114
+ ) => Promise<InvitationDetails>;
115
+ /**
116
+ * Create an installation by safely evaluating the code and
117
+ * registering it with Zoe. Returns an installation.
118
+ */
119
+ export type InstallBundle = (
120
+ bundle: Bundle | SourceBundle,
121
+ bundleLabel?: string | undefined,
122
+ ) => Promise<Installation>;
123
+ /**
124
+ * Create an installation from a Bundle ID. Returns an installation.
125
+ */
126
+ export type InstallBundleID = (
127
+ bundleID: BundleID,
128
+ bundleLabel?: string | undefined,
129
+ ) => Promise<Installation>;
130
+ /**
131
+ * Verify that an alleged Installation is real, and return the Bundle ID it
132
+ * will use for contract code.
133
+ */
134
+ export type GetBundleIDFromInstallation = (
135
+ allegedInstallation: ERef<Installation>,
136
+ ) => Promise<string>;
137
+ /**
138
+ * To redeem an invitation, the user normally provides a proposal (their
139
+ * rules for the offer) as well as payments to be escrowed by Zoe. If
140
+ * either the proposal or payments would be empty, indicate this by
141
+ * omitting that argument or passing undefined, rather than passing an
142
+ * empty record.
143
+ *
144
+ * The proposal has three parts: `want` and `give` are used by Zoe to
145
+ * enforce offer safety, and `exit` is used to specify the particular
146
+ * payout-liveness policy that Zoe can guarantee. `want` and `give`
147
+ * are objects with keywords as keys and amounts as values.
148
+ * `paymentKeywordRecord` is a record with keywords as keys, and the
149
+ * values are the actual payments to be escrowed. A payment is
150
+ * expected for every rule under `give`.
151
+ */
152
+ export type Offer = <Result, Args = undefined>(
153
+ invitation: ERef<import('../types-index.js').Invitation<Result, Args>>,
154
+ proposal?: Proposal,
155
+ paymentKeywordRecord?: PaymentPKeywordRecord,
156
+ offerArgs?: Args,
157
+ ) => Promise<UserSeat<Result>>;
158
+ /**
159
+ * Zoe uses seats to access or manipulate offers. They let contracts and users
160
+ * interact with them. Zoe has two kinds of seats. ZCFSeats are used within
161
+ * contracts and with zcf methods. UserSeats represent offers external to Zoe
162
+ * and the contract. The party who exercises an invitation and sends the offer()
163
+ * message to Zoe gets a UserSeat that can check payouts' status or retrieve the
164
+ * result of processing the offer in the contract. This varies, but examples are
165
+ * a string and an invitation for another seat.
166
+ *
167
+ * Also, a UserSeat can be handed to an agent outside Zoe and the contract,
168
+ * letting them query or monitor the current state, access the payouts and
169
+ * result, and, if it's allowed for this seat, call tryExit().
170
+ *
171
+ * Since anyone can attempt to exit the seat if they have a reference to it, you
172
+ * should only share a UserSeat with trusted parties.
173
+ *
174
+ * UserSeat includes queries for the associated offer's current state and an
175
+ * operation to request that the offer exit, as follows:
176
+ */
177
+ export type UserSeat<OR = unknown> = {
178
+ getProposal: () => Promise<ProposalRecord>;
179
+ /**
180
+ * returns a promise for a KeywordPaymentRecord containing all the payouts from
181
+ * this seat. The promise will resolve after the seat has exited.
182
+ */
183
+ getPayouts: () => Promise<PaymentPKeywordRecord>;
184
+ /**
185
+ * returns a promise for the Payment corresponding to the indicated keyword.
186
+ * The promise will resolve after the seat has exited. If there is no payment
187
+ * corresponding to the keyword, an error will be thrown. (It used to return
188
+ * undefined.)
189
+ */
190
+ getPayout: (keyword: Keyword) => Promise<Payment<any, any>>;
191
+ getOfferResult: () => Promise<OR>;
192
+ /**
193
+ * Note: Only works if the seat's `proposal` has an `OnDemand` `exit` clause. Zoe's
194
+ * offer-safety guarantee applies no matter how a seat's interaction with a
195
+ * contract ends. Under normal circumstances, the participant might be able to
196
+ * call `tryExit()`, or the contract might do something explicitly. On exiting,
197
+ * the seat holder gets its current `allocation` and the `seat` can no longer
198
+ * interact with the contract.
199
+ */
200
+ tryExit?: (() => void) | undefined;
201
+ /**
202
+ * Returns true if the seat has exited, false if it is still active.
203
+ */
204
+ hasExited: () => Promise<boolean>;
205
+ /**
206
+ * returns 1 if the proposal's
207
+ * want clause was satisfied by the final allocation, otherwise 0. This is
208
+ * numeric to support a planned enhancement called "multiples" which will allow
209
+ * the return value to be any non-negative number. The promise will resolve
210
+ * after the seat has exited.
211
+ */
212
+ numWantsSatisfied: () => Promise<0 | 1>;
213
+ /**
214
+ * return a promise for the final allocation. The promise will resolve after the
215
+ * seat has exited.
216
+ */
217
+ getFinalAllocation: () => Promise<Allocation>;
218
+ /**
219
+ * returns a subscriber that
220
+ * will be notified when the seat has exited or failed.
221
+ */
222
+ getExitSubscriber: () => Subscriber<import('../types-index.js').Completion>;
223
+ };
224
+ export type Proposal = Partial<ProposalRecord>;
225
+ export type ProposalRecord = {
226
+ give: AmountKeywordRecord;
227
+ want: AmountKeywordRecord;
228
+ exit: ExitRule;
229
+ };
230
+ /**
231
+ * The keys are keywords, and the values are amounts. For example:
232
+ * { Asset: AmountMath.make(assetBrand, 5n), Price:
233
+ * AmountMath.make(priceBrand, 9n) }
234
+ */
235
+ export type AmountKeywordRecord = Record<Keyword, AnyAmount>;
236
+ export type Waker = {
237
+ wake: () => void;
238
+ };
239
+ export type OnDemandExitRule = {
240
+ onDemand: null;
241
+ };
242
+ export type WaivedExitRule = {
243
+ waived: null;
244
+ };
245
+ export type AfterDeadlineExitRule = {
246
+ afterDeadline: {
247
+ timer: import('@agoric/time').TimerService;
248
+ deadline: import('@agoric/time').Timestamp;
249
+ };
250
+ };
251
+ /**
252
+ * The possible keys are 'waived', 'onDemand', and 'afterDeadline'.
253
+ * `timer` and `deadline` only are used for the `afterDeadline` key.
254
+ * The possible records are:
255
+ * `{ waived: null }`
256
+ * `{ onDemand: null }`
257
+ * `{ afterDeadline: { timer :Timer<Deadline>, deadline :Deadline } }`
258
+ */
259
+ export type ExitRule =
260
+ | OnDemandExitRule
261
+ | WaivedExitRule
262
+ | AfterDeadlineExitRule;
263
+ export type Instance<SF = any> = import('./utils.js').Instance<SF>;
264
+ export type ZCFSpec =
265
+ | {
266
+ bundleCap: import('@agoric/swingset-vat').BundleCap;
267
+ }
268
+ | {
269
+ name: string;
270
+ }
271
+ | {
272
+ /** Bundle ID */
273
+ id: string;
274
+ };
275
+ /**
276
+ * Opaque type for a JSONable source bundle
277
+ */
278
+ export type SourceBundle = Record<string, any>;
279
+ export type PaymentPKeywordRecord = Record<Keyword, ERef<Payment<any>>>;
280
+ export type PaymentKeywordRecord = Record<Keyword, Payment<any>>;
281
+ export type InvitationDetails = {
282
+ installation: Installation;
283
+ instance: import('./utils.js').Instance<any>;
284
+ handle: InvitationHandle;
285
+ description: string;
286
+ customDetails?: Record<string, any> | undefined;
287
+ };
288
+ export type Installation<SF = any> = import('./utils.js').Installation<SF>;
289
+ export type InstallationStart<I extends Installation> =
290
+ import('./utils.js').InstallationStart<I>;
291
+ export type FeeIssuerConfig = {
292
+ name: string;
293
+ assetKind: AssetKind;
294
+ displayInfo: DisplayInfo;
295
+ };
296
+ export type ZoeFeesConfig = {
297
+ getPublicFacetFee: NatValue;
298
+ };
299
+ export type FeeMintAccess = Handle<'feeMintAccess'>;
@@ -1,13 +1,10 @@
1
- // Ambient types
2
- import '../types-ambient.js';
3
- import '../contractFacet/types-ambient.js';
4
-
5
1
  import type { Issuer } from '@agoric/ertp/src/types.js';
6
2
  import type { TagContainer } from '@agoric/internal/src/tagged.js';
7
3
  import type { Baggage } from '@agoric/swingset-liveslots';
8
4
  import type { VatUpgradeResults } from '@agoric/swingset-vat';
9
5
  import type { RemotableObject } from '@endo/marshal';
10
6
  import type { FarRef } from '@endo/far';
7
+ import type { ZCF } from '../types-index.js';
11
8
 
12
9
  // XXX https://github.com/Agoric/agoric-sdk/issues/4565
13
10
  type SourceBundle = Record<string, any>;
@@ -1,5 +1,6 @@
1
1
  import { E } from '@endo/far';
2
2
  import type { StartedInstanceKit } from './utils.js';
3
+ import type { ZCF } from '../types-index.js';
3
4
 
4
5
  const someContractStartFn = (
5
6
  zcf: ZCF,
@@ -1,5 +1,10 @@
1
+ export * from "../types-index.js";
1
2
  export type ZoeKit = ReturnType<typeof makeDurableZoeKit>;
2
- /** @import {Baggage} from '@agoric/vat-data' */
3
+ /**
4
+ * @import {VatAdminSvc} from '@agoric/swingset-vat';
5
+ * @import {Baggage} from '@agoric/vat-data';
6
+ * @import {FeeIssuerConfig, FeeMintAccess, ZCFSpec, ZoeService} from './types.js';
7
+ */
3
8
  /**
4
9
  * Create a durable instance of Zoe.
5
10
  *
@@ -55,4 +60,9 @@ export function makeZoeKit(vatAdminSvc?: Promise<VatAdminSvc> | VatAdminSvc, shu
55
60
  setVatAdminService: ((lateVatAdminSvc: any) => void) & import("@endo/pass-style").RemotableObject<`Alleged: ${string}`> & import("@endo/eventual-send").RemotableBrand<{}, (lateVatAdminSvc: any) => void>;
56
61
  };
57
62
  import type { Baggage } from '@agoric/vat-data';
63
+ import type { VatAdminSvc } from '@agoric/swingset-vat';
64
+ import type { FeeIssuerConfig } from './types.js';
65
+ import type { ZCFSpec } from './types.js';
66
+ import type { ZoeService } from './types.js';
67
+ import type { FeeMintAccess } from './types.js';
58
68
  //# sourceMappingURL=zoe.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"zoe.d.ts","sourceRoot":"","sources":["zoe.js"],"names":[],"mappings":"qBAiSa,UAAU,CAAC,OAAO,iBAAiB,CAAC;AAnQjD,gDAAgD;AAEhD;;;;;;;;;;;;;GAaG;AACH,0GAVG;IAAyB,UAAU,EAA3B,OAAO;IACsC,WAAW;IAGK,cAAc;IAGjD,eAAe;IACvB,OAAO;CACnC;;;;;IAgNG,4BAA4B;mBAAjB,aAAa;;EAK3B;AAED;;;;;;;;;;;;;;;GAeG;AACH,yCATW,OAAO,CAAC,WAAW,CAAC,GAAG,WAAW,mBAGlC,OAAO,sBAAsB,EAAE,mBAAmB,oBAGlD,eAAe,YACf,OAAO;;;;;IArBd,4BAA4B;mBAAjB,aAAa;;EA8BxB;6BA7PuB,kBAAkB"}
1
+ {"version":3,"file":"zoe.d.ts","sourceRoot":"","sources":["zoe.js"],"names":[],"mappings":";qBAqSa,UAAU,CAAC,OAAO,iBAAiB,CAAC;AAvQjD;;;;GAIG;AAEH;;;;;;;;;;;;;GAaG;AACH,0GAVG;IAAyB,UAAU,EAA3B,OAAO;IACsC,WAAW;IAGK,cAAc;IAGjD,eAAe;IACvB,OAAO;CACnC;;;;;IAgNG,4BAA4B;mBAAjB,aAAa;;EAK3B;AAED;;;;;;;;;;;;;;;GAeG;AACH,yCATW,OAAO,CAAC,WAAW,CAAC,GAAG,WAAW,mBAGlC,OAAO,sBAAsB,EAAE,mBAAmB,oBAGlD,eAAe,YACf,OAAO;;;;;IArBd,4BAA4B;mBAAjB,aAAa;;EA8BxB;6BA/PsB,kBAAkB;iCADd,sBAAsB;qCAEkB,YAAY;6BAAZ,YAAY;gCAAZ,YAAY;mCAAZ,YAAY"}
@@ -28,7 +28,11 @@ import { getZcfBundleCap } from './createZCFVat.js';
28
28
  import { defaultFeeIssuerConfig, prepareFeeMint } from './feeMint.js';
29
29
  import { ZoeServiceI } from '../typeGuards.js';
30
30
 
31
- /** @import {Baggage} from '@agoric/vat-data' */
31
+ /**
32
+ * @import {VatAdminSvc} from '@agoric/swingset-vat';
33
+ * @import {Baggage} from '@agoric/vat-data';
34
+ * @import {FeeIssuerConfig, FeeMintAccess, ZCFSpec, ZoeService} from './types.js';
35
+ */
32
36
 
33
37
  /**
34
38
  * Create a durable instance of Zoe.
@@ -289,3 +293,6 @@ export { makeDurableZoeKit, makeZoeKit };
289
293
  /**
290
294
  * @typedef {ReturnType<typeof makeDurableZoeKit>} ZoeKit
291
295
  */
296
+
297
+ // eslint-disable-next-line import/export -- no named value exports; only types
298
+ export * from '../types-index.js';
@@ -4,7 +4,7 @@ export function makeZoeStorageManager(createZCFVat: CreateZCFVat, getBundleCapFo
4
4
  getFeeBrand: () => Brand;
5
5
  }, zoeBaggage: Baggage): import("@endo/exo").GuardedKit<{
6
6
  zoeServiceDataAccess: {
7
- getInvitationIssuer: () => globalThis.Issuer<"set", InvitationDetails>;
7
+ getInvitationIssuer: () => globalThis.Issuer<"set", import("@agoric/zoe").InvitationDetails>;
8
8
  getBundleIDFromInstallation(allegedInstallation: any): Promise<string | undefined>;
9
9
  getPublicFacet(instance: any): any;
10
10
  getBrands(instance: any): any;
@@ -13,14 +13,14 @@ export function makeZoeStorageManager(createZCFVat: CreateZCFVat, getBundleCapFo
13
13
  getTerms(instance: any): any;
14
14
  getInstallation(instance: any): any;
15
15
  getProposalShapeForInvitation: (invitationHandle: any) => any;
16
- installBundle: (allegedBundle: any, bundleLabel: any) => Promise<Installation<any>>;
17
- installBundleID(bundleID: any, bundleLabel: any): Promise<Installation<unknown>>;
16
+ installBundle: (allegedBundle: any, bundleLabel: any) => Promise<globalThis.Installation>;
17
+ installBundleID(bundleID: any, bundleLabel: any): Promise<globalThis.Installation<unknown>>;
18
18
  };
19
19
  makeOfferAccess: {
20
20
  getAssetKindByBrand: GetAssetKindByBrand;
21
21
  getInstanceAdmin(instance: any): any;
22
22
  getProposalShapeForInvitation: (invitationHandle: any) => any;
23
- getInvitationIssuer: () => globalThis.Issuer<"set", InvitationDetails>;
23
+ getInvitationIssuer: () => globalThis.Issuer<"set", import("@agoric/zoe").InvitationDetails>;
24
24
  depositPayments(proposal: any, payments: any): Promise<Allocation>;
25
25
  };
26
26
  startInstanceAccess: {
@@ -33,7 +33,7 @@ export function makeZoeStorageManager(createZCFVat: CreateZCFVat, getBundleCapFo
33
33
  }>;
34
34
  };
35
35
  invitationIssuerAccess: {
36
- getInvitationIssuer: () => globalThis.Issuer<"set", InvitationDetails>;
36
+ getInvitationIssuer: () => globalThis.Issuer<"set", import("@agoric/zoe").InvitationDetails>;
37
37
  };
38
38
  }>;
39
39
  import type { Baggage } from '@agoric/vat-data';
@@ -1 +1 @@
1
- {"version":3,"file":"zoeStorageManager.d.ts","sourceRoot":"","sources":["zoeStorageManager.js"],"names":[],"mappings":"AAwDO,oDAXI,YAAY,qBAEZ,iBAAiB,kBACjB,OAAO,sBAAsB,EAAE,mBAAmB,WAClD;IACL,eAAe,EAAE,eAAe,CAAC;IACjC,YAAY,EAAE,MAAM,MAAM,CAAC;IAC3B,WAAW,EAAE,MAAM,KAAK,CAAC;CAC3B,cACO,OAAO;;;;;;;;;;;;;;;;;;;;;;;;kBAZkC,CAAC;qBAC3B,CAAC;oBAA0B,CAAC;;;;;;;GAsbrD;6BAlc0B,kBAAkB"}
1
+ {"version":3,"file":"zoeStorageManager.d.ts","sourceRoot":"","sources":["zoeStorageManager.js"],"names":[],"mappings":"AA2DO,oDAXI,YAAY,qBAEZ,iBAAiB,kBACjB,OAAO,sBAAsB,EAAE,mBAAmB,WAClD;IACL,eAAe,EAAE,eAAe,CAAC;IACjC,YAAY,EAAE,MAAM,MAAM,CAAC;IAC3B,WAAW,EAAE,MAAM,KAAK,CAAC;CAC3B,cACO,OAAO;;;;;;;;;;;;;;;;;;;;;;;;kBAXmC,CAAC,EAAC,YAAa;qBAE5D,CAAC;oBAA0B,CAAC;;;;;;;GAobnC;6BApcyB,kBAAkB"}
@@ -29,7 +29,10 @@ import {
29
29
  ZoeStorageManagerIKit,
30
30
  } from '../typeGuards.js';
31
31
 
32
- /** @import {Baggage} from '@agoric/vat-data' */
32
+ /**
33
+ * @import {Baggage} from '@agoric/vat-data';
34
+ * @import {ContractMeta, ContractStartFn, InvitationAmount, OfferHandler, TransferPart, ZCF, ZCFSeat} from '@agoric/zoe';
35
+ */
33
36
 
34
37
  const { ownKeys } = Reflect;
35
38
 
@@ -1,3 +1,6 @@
1
+ /**
2
+ * @import {ZoeService} from '../src/types-index.js';
3
+ */
1
4
  /**
2
5
  * Start an instance of an Oracle that follows a script. The Oracle has access
3
6
  * to a timer, and looks in the script for events indexed by the current time.
@@ -17,11 +20,12 @@
17
20
  export function makeScriptedOracle(script: Record<string, any>, oracleInstallation: Installation<import("../src/contracts/oracle.js").OracleStart>, timer: import("@agoric/time").TimerService, zoe: ZoeService, feeIssuer: Issuer): Promise<{
18
21
  publicFacet: object & {
19
22
  query(query: OracleQuery): Promise<unknown>;
20
- makeQueryInvitation(query: OracleQuery): Promise<Invitation<unknown, never>>;
23
+ makeQueryInvitation(query: OracleQuery): Promise<globalThis.Invitation<unknown, never>>;
21
24
  } & import("@endo/pass-style").RemotableObject<`Alleged: ${string}`> & import("@endo/eventual-send").RemotableBrand<{}, {
22
25
  query(query: OracleQuery): Promise<unknown>;
23
- makeQueryInvitation(query: OracleQuery): Promise<Invitation<unknown, never>>;
26
+ makeQueryInvitation(query: OracleQuery): Promise<globalThis.Invitation<unknown, never>>;
24
27
  }>;
25
28
  creatorFacet: OracleCreatorFacet;
26
29
  }>;
30
+ import type { ZoeService } from '../src/types-index.js';
27
31
  //# sourceMappingURL=scriptedOracle.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"scriptedOracle.d.ts","sourceRoot":"","sources":["scriptedOracle.js"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;GAeG;AACH,2CANW,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,sBACnB,YAAY,CAAC,OAAO,4BAA4B,EAAE,WAAW,CAAC,SAC9D,OAAO,cAAc,EAAE,YAAY,OACnC,UAAU,aACV,MAAM;;;;;;;;;GAqChB"}
1
+ {"version":3,"file":"scriptedOracle.d.ts","sourceRoot":"","sources":["scriptedOracle.js"],"names":[],"mappings":"AAIA;;GAEG;AAEH;;;;;;;;;;;;;;;GAeG;AACH,2CANW,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,sBACnB,YAAY,CAAC,OAAO,4BAA4B,EAAE,WAAW,CAAC,SAC9D,OAAO,cAAc,EAAE,YAAY,OACnC,UAAU,aACV,MAAM;;;;;;;;;GAqChB;gCAtD4B,uBAAuB"}
@@ -2,6 +2,10 @@ import { TimeMath } from '@agoric/time';
2
2
  import { E } from '@endo/eventual-send';
3
3
  import { Far } from '@endo/marshal';
4
4
 
5
+ /**
6
+ * @import {ZoeService} from '../src/types-index.js';
7
+ */
8
+
5
9
  /**
6
10
  * Start an instance of an Oracle that follows a script. The Oracle has access
7
11
  * to a timer, and looks in the script for events indexed by the current time.
@@ -1,19 +1,19 @@
1
1
  export function makeZoeKitForTest(vatAdminSvc?: VatAdminSvc): {
2
- zoeService: import("@endo/exo").Guarded<ZoeService>;
2
+ zoeService: import("@endo/exo").Guarded<globalThis.ZoeService>;
3
3
  zoeConfigFacet: import("@endo/exo").Guarded<{
4
4
  updateZcfBundleId(bundleId: any): void;
5
5
  }>;
6
6
  feeMintAccess: FeeMintAccess;
7
7
  setVatAdminService: ((lateVatAdminSvc: any) => void) & import("@endo/pass-style").RemotableObject<`Alleged: ${string}`> & import("@endo/eventual-send").RemotableBrand<{}, (lateVatAdminSvc: any) => void>;
8
8
  };
9
- export function makeZoeForTest(vatAdminSvc?: VatAdminSvc): import("@endo/exo").Guarded<ZoeService>;
9
+ export function makeZoeForTest(vatAdminSvc?: VatAdminSvc): import("@endo/exo").Guarded<globalThis.ZoeService>;
10
10
  export function setUpZoeForTest<T extends unknown = any>({ setJig, feeIssuerConfig, vatAdminSvc, useNearRemote, }?: {
11
11
  setJig?: ((jig: T) => void) | undefined;
12
12
  feeIssuerConfig?: FeeIssuerConfig | undefined;
13
13
  vatAdminSvc?: VatAdminSvc | undefined;
14
14
  useNearRemote?: boolean | undefined;
15
15
  }): Promise<{
16
- zoe: import("@endo/exo").Guarded<ZoeService>;
16
+ zoe: import("@endo/exo").Guarded<globalThis.ZoeService>;
17
17
  feeMintAccessP: FeeMintAccess;
18
18
  bundleAndInstall: (path: string) => Promise<Installation>;
19
19
  vatAdminSvc: VatAdminSvc;
@@ -31,4 +31,5 @@ export function setUpZoeForTest<T extends unknown = any>({ setJig, feeIssuerConf
31
31
  };
32
32
  } | undefined;
33
33
  }>;
34
+ import type { FeeIssuerConfig } from '../src/types-index.js';
34
35
  //# sourceMappingURL=setup-zoe.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"setup-zoe.d.ts","sourceRoot":"","sources":["setup-zoe.js"],"names":[],"mappings":"AAUO,gDAFI,WAAW;;;;;;;EAOrB;AAKM,6CAFI,WAAW,2CAGqB;AAapC,gCAPgB,CAAC,mFAErB;IAAmC,MAAM,UAA3B,CAAC,KAAK,IAAI;IACU,eAAe;IACnB,WAAW;IACf,aAAa;CAAC;;;6BA2B9B,MAAM,KACJ,OAAO,CAAC,YAAY,CAAC;;;;;;;;;;;;;;;GAiBnC"}
1
+ {"version":3,"file":"setup-zoe.d.ts","sourceRoot":"","sources":["setup-zoe.js"],"names":[],"mappings":"AAcO,gDAFI,WAAW;;;;;;;EAOrB;AAKM,6CAFI,WAAW,sDAGqB;AAapC,gCAPgB,CAAC,mFAErB;IAAmC,MAAM,UAA3B,CAAC,KAAK,IAAI;IACU,eAAe;IACnB,WAAW;IACf,aAAa;CAAC;;;6BA2B9B,MAAM,KACJ,OAAO,CAAC,YAAY,CAAC;;;;;;;;;;;;;;;GAiBnC;qCAzEiC,uBAAuB"}
@@ -5,6 +5,10 @@ import bundleSource from '@endo/bundle-source';
5
5
  import { makeDurableZoeKit } from '../src/zoeService/zoe.js';
6
6
  import fakeVatAdmin, { makeFakeVatAdmin } from './fakeVatAdmin.js';
7
7
 
8
+ /**
9
+ * @import {FeeIssuerConfig} from '../src/types-index.js';
10
+ */
11
+
8
12
  /**
9
13
  * @param {VatAdminSvc} [vatAdminSvc]
10
14
  */
@@ -1,8 +0,0 @@
1
- type TestJigSetter = ({ zcf }: {
2
- zcf: ZCF;
3
- }) => void;
4
- type ZCFZygote = {
5
- startContract: (instanceAdminFromZoe: ERef<ZoeInstanceAdmin>, instanceRecordFromZoe: InstanceRecord, issuerStorageFromZoe: IssuerRecords, privateArgs?: object) => Promise<ExecuteContractResult>;
6
- restartContract: (privateArgs?: object) => void;
7
- };
8
- //# sourceMappingURL=internal-types.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"internal-types.d.ts","sourceRoot":"","sources":["internal-types.js"],"names":[],"mappings":"qBAGa,CAAE,EAAC,GAAG,EAAC,EAAE;IAAC,GAAG,EAAE,GAAG,CAAA;CAAC,KAAM,IAAI;;mBAK5B,CAAC,oBAAoB,EAAE,IAAI,CAAC,gBAAgB,CAAC,EACpD,qBAAqB,EAAE,cAAc,EACrC,oBAAoB,EAAE,aAAa,EACnC,WAAW,CAAC,EAAE,MAAM,KACnB,OAAO,CAAC,qBAAqB,CAAC;qBACxB,CAAC,WAAW,CAAC,EAAE,MAAM,KAAK,IAAI"}
@@ -1,15 +0,0 @@
1
- // @jessie-check
2
-
3
- /**
4
- * @typedef {( {zcf}: {zcf: ZCF} ) => void} TestJigSetter
5
- */
6
-
7
- /**
8
- * @typedef ZCFZygote
9
- * @property {(instanceAdminFromZoe: ERef<ZoeInstanceAdmin>,
10
- * instanceRecordFromZoe: InstanceRecord,
11
- * issuerStorageFromZoe: IssuerRecords,
12
- * privateArgs?: object,
13
- * ) => Promise<ExecuteContractResult>} startContract
14
- * @property {(privateArgs?: object) => void} restartContract
15
- */
@@ -1 +0,0 @@
1
- // Dummy file for .d.ts twin to declare ambients