@agoric/vats 0.15.2-dev-b5a2ed1.0 → 0.15.2-dev-3da32ff.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.
package/src/core/types.js DELETED
@@ -1,522 +0,0 @@
1
- // @ts-check
2
-
3
- /**
4
- * This type conflicts with packages/SwingSet/src/vats/plugin-manager.js
5
- *
6
- * @template T
7
- * @typedef {'Device' & { __deviceType__: T }} Device
8
- */
9
-
10
- /** @typedef {<T>(target: Device<T>) => T} DProxy (approximately) */
11
-
12
- /**
13
- * SwingSet types
14
- *
15
- * @typedef {Device<
16
- * ReturnType<
17
- * typeof import('@agoric/swingset-vat/src/devices/bridge/device-bridge.js').buildRootDeviceNode
18
- * >
19
- * >} BridgeDevice
20
- *
21
- * @typedef {Device<
22
- * ReturnType<
23
- * typeof import('@agoric/swingset-vat/src/devices/command/device-command.js').buildRootDeviceNode
24
- * >
25
- * >} CommandDevice
26
- *
27
- * @typedef {Device<
28
- * ReturnType<
29
- * typeof import('@agoric/swingset-vat/src/devices/mailbox/device-mailbox.js').buildRootDeviceNode
30
- * >
31
- * >} MailboxDevice
32
- *
33
- * @typedef {Device<
34
- * ReturnType<
35
- * typeof import('@agoric/swingset-vat/src/devices/plugin/device-plugin.js').buildRootDeviceNode
36
- * >
37
- * >} PluginDevice
38
- *
39
- * @typedef {Device<
40
- * ReturnType<
41
- * typeof import('@agoric/swingset-vat/src/devices/timer/device-timer.js').buildRootDeviceNode
42
- * >
43
- * >} TimerDevice
44
- *
45
- * @typedef {Device<
46
- * import('@agoric/swingset-vat/src/devices/vat-admin/device-vat-admin.js').VatAdminRootDeviceNode
47
- * >} VatAdminDevice
48
- *
49
- * @typedef {ERef<
50
- * ReturnType<
51
- * typeof import('@agoric/swingset-vat/src/vats/vattp/vat-vattp.js').buildRootObject
52
- * >
53
- * >} VattpVat
54
- *
55
- * @typedef {ERef<
56
- * ReturnType<
57
- * typeof import('@agoric/swingset-vat/src/vats/vat-admin/vat-vat-admin.js').buildRootObject
58
- * >
59
- * >} VatAdminVat
60
- *
61
- * @typedef {ERef<
62
- * ReturnType<
63
- * typeof import('@agoric/swingset-vat/src/vats/timer/vat-timer.js').buildRootObject
64
- * >
65
- * >} TimerVat
66
- * See deliverToController in packages/SwingSet/src/vats/comms/controller.js
67
- *
68
- * @typedef {ERef<{
69
- * addRemote: (name: string, tx: unknown, rx: unknown) => void;
70
- * addEgress: (addr: string, ix: number, provider: unknown) => void;
71
- * addIngress: (
72
- * remoteID: string,
73
- * remoteRefID: number,
74
- * label?: string,
75
- * ) => Promise<any>;
76
- * }>} CommsVatRoot
77
- *
78
- * @typedef {{
79
- * comms: CommsVatRoot;
80
- * timer: TimerVat;
81
- * vatAdmin: VatAdminVat;
82
- * vattp: VattpVat;
83
- * }} SwingsetVats
84
- *
85
- * @typedef {{
86
- * vatParameters: { chainStorageEntries?: [k: string, v: string][] };
87
- * }} ChainStorageVatParams
88
- */
89
-
90
- /**
91
- * @typedef {{
92
- * vatAdmin: VatAdminDevice;
93
- * mailbox: MailboxDevice;
94
- * command: CommandDevice;
95
- * timer: TimerDevice;
96
- * plugin: PluginDevice;
97
- * }} SoloDevices
98
- *
99
- * @typedef {{
100
- * vatAdmin: VatAdminDevice;
101
- * mailbox: MailboxDevice;
102
- * timer: TimerDevice;
103
- * bridge?: BridgeDevice;
104
- * }} ChainDevices
105
- */
106
-
107
- /**
108
- * @typedef {{
109
- * getChainBundle: () => unknown;
110
- * getChainConfigNotifier: () => Notifier<unknown>;
111
- * }} ClientProvider
112
- */
113
-
114
- /**
115
- * @template T
116
- * @typedef {object} Producer<T>
117
- * @property {(v: ERef<T>) => void} resolve
118
- * @property {(r: unknown) => void} reject
119
- * @property {(reason?: unknown) => void} reset
120
- */
121
- /** @typedef {{ bundleName?: string; bundleID?: string }} VatSourceRef */
122
- /**
123
- * @template T
124
- * @typedef {(name: string, sourceRef?: VatSourceRef) => T} VatLoader<T>
125
- */
126
-
127
- /**
128
- * @typedef {{
129
- * assignBundle: (ps: PropertyMaker[]) => void;
130
- * }} ClientManager
131
- * tool to put properties onto the `home` object of the client
132
- *
133
- * @typedef {(addr: string, flags: string[]) => Record<string, unknown>} PropertyMaker
134
- * callback to assign a property onto the `home` object of the client
135
- */
136
-
137
- /**
138
- * @template B Bidirectional
139
- * @template [C={}] Consume only
140
- * @template [P={}] Produce only
141
- * @typedef {{
142
- * consume: { [K in keyof (B & C)]: Promise<(B & C)[K]> };
143
- * produce: { [K in keyof (B & P)]: Producer<(B & P)[K]> };
144
- * }} PromiseSpaceOf
145
- */
146
-
147
- /**
148
- * @callback CreateUserBundle
149
- * @param {string} nickname
150
- * @param {string} clientAddress
151
- * @param {string[]} powerFlags
152
- * @returns {Promise<Record<string, Promise<any>>>}
153
- *
154
- * @typedef {object} ClientFacet
155
- * @property {() => ERef<Record<string, any>>} getChainBundle Required for
156
- * ag-solo, but deprecated in favour of getConfiguration NOTE: we use `any`
157
- * rather than `unknown` because each client that wants to call a method such
158
- * as `E(userBundle.bank).deposit(payment)` has to cast userBundle.bank;
159
- * ideally, the cast is to some useful type. But unknown can't be cast
160
- * directly to some other type; it has to be cast to any first.
161
- * @property {() => AsyncIterable<Configuration, Configuration>} getConfiguration
162
- *
163
- * @typedef {{ clientAddress: string; clientHome: Record<string, any> }} Configuration
164
- *
165
- * @typedef {object} ClientCreator
166
- * @property {CreateUserBundle} createUserBundle Required for vat-provisioning,
167
- * but deprecated in favor of {@link createClient}.
168
- * @property {(
169
- * nickname: string,
170
- * clientAddress: string,
171
- * powerFlags: string[],
172
- * ) => Promise<ClientFacet>} createClientFacet
173
- */
174
-
175
- /**
176
- * @typedef {import('@agoric/internal/src/tokens.js').TokenKeyword} TokenKeyword
177
- *
178
- * @typedef {{
179
- * issuer: TokenKeyword | 'Invitation' | 'AUSD';
180
- * installation:
181
- * | 'centralSupply'
182
- * | 'mintHolder'
183
- * | 'walletFactory'
184
- * | 'provisionPool'
185
- * | 'auctioneer'
186
- * | 'feeDistributor'
187
- * | 'contractGovernor'
188
- * | 'committee'
189
- * | 'noActionElectorate'
190
- * | 'binaryVoteCounter'
191
- * | 'VaultFactory'
192
- * | 'liquidate'
193
- * | 'Pegasus'
194
- * | 'reserve'
195
- * | 'psm'
196
- * | 'econCommitteeCharter'
197
- * | 'priceAggregator';
198
- * instance:
199
- * | 'economicCommittee'
200
- * | 'feeDistributor'
201
- * | 'auctioneer'
202
- * | 'VaultFactory'
203
- * | 'VaultFactoryGovernor'
204
- * | 'econCommitteeCharter'
205
- * | 'walletFactory'
206
- * | 'provisionPool'
207
- * | 'reserve'
208
- * | 'reserveGovernor'
209
- * | 'Pegasus';
210
- * oracleBrand: 'USD';
211
- * uiConfig: 'VaultFactory';
212
- * }} WellKnownName
213
- *
214
- * @typedef {{
215
- * issuer: {
216
- * produce: Record<WellKnownName['issuer'], Producer<Issuer>>;
217
- * consume: Record<WellKnownName['issuer'], Promise<Issuer>> & {
218
- * BLD: Promise<Issuer<'nat'>>;
219
- * IST: Promise<Issuer<'nat'>>;
220
- * };
221
- * };
222
- * brand: {
223
- * produce: Record<WellKnownName['issuer'], Producer<Brand>> & {
224
- * timer: Producer<import('@agoric/time').TimerBrand>;
225
- * };
226
- * consume: Record<WellKnownName['issuer'], Promise<Brand>> & {
227
- * BLD: Promise<Brand<'nat'>>;
228
- * IST: Promise<Brand<'nat'>>;
229
- * timer: Producer<import('@agoric/time').TimerBrand>;
230
- * };
231
- * };
232
- * oracleBrand: {
233
- * produce: Record<WellKnownName['oracleBrand'], Producer<Brand>>;
234
- * consume: Record<WellKnownName['oracleBrand'], Promise<Brand>>;
235
- * };
236
- * installation: {
237
- * produce: Record<WellKnownName['installation'], Producer<Installation>>;
238
- * consume: Record<
239
- * WellKnownName['installation'],
240
- * Promise<Installation<unknown>>
241
- * > & {
242
- * auctioneer: Promise<
243
- * Installation<
244
- * import('@agoric/inter-protocol/src/auction/auctioneer.js').start
245
- * >
246
- * >;
247
- * centralSupply: Promise<
248
- * Installation<import('@agoric/vats/src/centralSupply.js').start>
249
- * >;
250
- * committee: Promise<
251
- * Installation<import('@agoric/governance/src/committee.js')['start']>
252
- * >;
253
- * contractGovernor: Promise<
254
- * Installation<
255
- * import('@agoric/governance/src/contractGovernor.js')['start']
256
- * >
257
- * >;
258
- * econCommitteeCharter: Promise<
259
- * Installation<
260
- * import('@agoric/inter-protocol/src/econCommitteeCharter.js')['start']
261
- * >
262
- * >;
263
- * feeDistributor: Promise<
264
- * Installation<
265
- * import('@agoric/inter-protocol/src/feeDistributor.js').start
266
- * >
267
- * >;
268
- * mintHolder: Promise<
269
- * Installation<import('@agoric/vats/src/mintHolder.js').start>
270
- * >;
271
- * psm: Promise<
272
- * Installation<
273
- * import('@agoric/inter-protocol/src/psm/psm.js')['start']
274
- * >
275
- * >;
276
- * provisionPool: Promise<
277
- * Installation<
278
- * import('@agoric/inter-protocol/src/provisionPool.js')['start']
279
- * >
280
- * >;
281
- * reserve: Promise<
282
- * Installation<
283
- * import('@agoric/inter-protocol/src/reserve/assetReserve.js')['start']
284
- * >
285
- * >;
286
- * VaultFactory: Promise<
287
- * Installation<
288
- * import('@agoric/inter-protocol/src/vaultFactory/vaultFactory.js')['start']
289
- * >
290
- * >;
291
- * walletFactory: Promise<
292
- * Installation<
293
- * import('@agoric/smart-wallet/src/walletFactory.js').start
294
- * >
295
- * >;
296
- * };
297
- * };
298
- * instance: {
299
- * produce: Record<WellKnownName['instance'], Producer<Instance>>;
300
- * consume: Record<WellKnownName['instance'], Promise<Instance>>;
301
- * };
302
- * uiConfig: {
303
- * produce: Record<
304
- * WellKnownName['uiConfig'],
305
- * Producer<Record<string, any>>
306
- * >;
307
- * consume: Record<WellKnownName['uiConfig'], Promise<Record<string, any>>>;
308
- * };
309
- * }} WellKnownSpaces
310
- */
311
-
312
- /**
313
- * @template {GovernableStartFn} SF
314
- * @typedef {{
315
- * installation: ERef<Installation<SF>>;
316
- * issuerKeywordRecord?: IssuerKeywordRecord;
317
- * governedParams: Record<string, unknown>;
318
- * terms: Omit<
319
- * import('@agoric/zoe/src/zoeService/utils').StartParams<SF>['terms'],
320
- * 'brands' | 'issuers' | 'governedParams' | 'electionManager'
321
- * >;
322
- * privateArgs: Omit<
323
- * import('@agoric/zoe/src/zoeService/utils').StartParams<SF>['privateArgs'],
324
- * 'initialPoserInvitation'
325
- * >;
326
- * label: string;
327
- * }} StartGovernedUpgradableOpts
328
- */
329
- /**
330
- * @typedef {<SF extends GovernableStartFn>(
331
- * opts: StartGovernedUpgradableOpts<SF>,
332
- * ) => Promise<GovernanceFacetKit<SF>>} startGovernedUpgradable
333
- */
334
-
335
- /**
336
- * @template {import('@agoric/zoe/src/zoeService/utils').ContractStartFunction} SF
337
- * @typedef {{
338
- * installation: ERef<Installation<SF>>;
339
- * issuerKeywordRecord?: IssuerKeywordRecord;
340
- * terms?: Omit<
341
- * import('@agoric/zoe/src/zoeService/utils').StartParams<SF>['terms'],
342
- * 'brands' | 'issuers'
343
- * >;
344
- * privateArgs?: import('@agoric/zoe/src/zoeService/utils').StartParams<SF>['privateArgs'];
345
- * label: string;
346
- * }} StartUpgradableOpts
347
- */
348
- /**
349
- * @typedef {<
350
- * SF extends
351
- * import('@agoric/zoe/src/zoeService/utils').ContractStartFunction,
352
- * >(
353
- * opts: StartUpgradableOpts<SF>,
354
- * ) => Promise<
355
- * import('@agoric/zoe/src/zoeService/utils').StartedInstanceKit<SF> & {
356
- * label: string;
357
- * }
358
- * >} StartUpgradable
359
- */
360
-
361
- /**
362
- * @template T @typedef
363
- * {import('@agoric/zoe/src/zoeService/utils').StartedInstanceKit<T> }
364
- * StartedInstanceKit
365
- */
366
-
367
- /**
368
- * @typedef {{ label: string } & StartedInstanceKit<
369
- * import('@agoric/zoe/src/zoeService/utils').ContractStartFunction
370
- * >} StartedInstanceKitWithLabel
371
- */
372
-
373
- /**
374
- * @typedef {{
375
- * agoricNames: NameHub;
376
- * agoricNamesAdmin: import('@agoric/vats').NameAdmin;
377
- * bankManager: BankManager;
378
- * bldIssuerKit: RemoteIssuerKit;
379
- * board: import('@agoric/vats').Board;
380
- * bridgeManager: import('../types.js').BridgeManager | undefined;
381
- * chainStorage: StorageNode | null;
382
- * chainTimerService: import('@agoric/time/src/types').TimerService;
383
- * client: ClientManager;
384
- * clientCreator: ClientCreator;
385
- * coreEvalBridgeHandler: import('../types.js').BridgeHandler;
386
- * diagnostics: {
387
- * savePrivateArgs: (instance: Instance, privateArgs: unknown) => void;
388
- * };
389
- * feeMintAccess: FeeMintAccess;
390
- * highPrioritySendersManager: import('@agoric/internal/src/priority-senders.js').PrioritySendersManager?;
391
- * initialSupply: Payment<'nat'>;
392
- * instancePrivateArgs: Map<Instance, unknown>;
393
- * namesByAddress: NameHub;
394
- * namesByAddressAdmin: import('../types').NamesByAddressAdmin;
395
- * pegasusConnections: import('@agoric/vats').NameHubKit;
396
- * pegasusConnectionsAdmin: import('@agoric/vats').NameAdmin;
397
- * priceAuthorityVat: Awaited<PriceAuthorityVat>;
398
- * priceAuthority: PriceAuthority;
399
- * priceAuthorityAdmin: PriceAuthorityRegistryAdmin;
400
- * provisioning: Awaited<ProvisioningVat> | undefined;
401
- * provisionBridgeManager:
402
- * | import('../types.js').ScopedBridgeManager
403
- * | undefined;
404
- * provisionWalletBridgeManager:
405
- * | import('../types.js').ScopedBridgeManager
406
- * | undefined;
407
- * storageBridgeManager: import('../types.js').ScopedBridgeManager?;
408
- * contractKits: MapStore<Instance, StartedInstanceKitWithLabel>;
409
- * startUpgradable: StartUpgradable;
410
- * governedContractKits: MapStore<
411
- * Instance,
412
- * GovernanceFacetKit<any> & { label: string }
413
- * >;
414
- * startGovernedUpgradable: startGovernedUpgradable;
415
- * testFirstAnchorKit: import('../vat-bank.js').AssetIssuerKit<'nat'>;
416
- * walletBridgeManager: import('../types.js').ScopedBridgeManager | undefined;
417
- * walletFactoryStartResult: import('./startWalletFactory').WalletFactoryStartResult;
418
- * provisionPoolStartResult: unknown;
419
- * vatStore: import('./utils.js').VatStore;
420
- * zoe: ZoeService;
421
- * }} ChainBootstrapSpaceT
422
- *
423
- * @typedef {PromiseSpaceOf<ChainBootstrapSpaceT>} ChainBootstrapSpace
424
- *
425
- * @typedef {import('@agoric/vats').NameHub} NameHub IDEA/TODO: make types of
426
- * demo stuff invisible in production behaviors
427
- *
428
- * @typedef {{
429
- * argv: {
430
- * hardcodedClientAddresses?: string[];
431
- * FIXME_GCI: string;
432
- * PROVISIONER_INDEX?: number;
433
- * };
434
- * }} BootstrapVatParams
435
- *
436
- * @typedef {BootstrapSpace & {
437
- * zone: import('@agoric/zone').Zone;
438
- * devices: SoloDevices | ChainDevices;
439
- * vats: SwingsetVats;
440
- * vatPowers: { [prop: string]: any; D: DProxy };
441
- * vatParameters: BootstrapVatParams;
442
- * runBehaviors: (manifest: unknown) => Promise<unknown>;
443
- * modules: Record<string, Record<string, any>>;
444
- * }} BootstrapPowers
445
- *
446
- * @typedef {WellKnownSpaces &
447
- * PromiseSpaceOf<
448
- * ChainBootstrapSpaceT & {
449
- * vatAdminSvc: VatAdminSvc;
450
- * },
451
- * {},
452
- * {
453
- * loadVat: VatLoader<unknown>;
454
- * loadCriticalVat: VatLoader<unknown>;
455
- * }
456
- * >} BootstrapSpace
457
- *
458
- * @typedef {{ mint: ERef<Mint>; issuer: ERef<Issuer>; brand: Brand }} RemoteIssuerKit
459
- *
460
- * @typedef {Awaited<ReturnType<Awaited<BankVat>['makeBankManager']>>} BankManager
461
- *
462
- * @typedef {ERef<ReturnType<import('../vat-agoricNames').buildRootObject>>} AgoricNamesVat
463
- *
464
- * @typedef {ERef<ReturnType<import('../vat-bank.js').buildRootObject>>} BankVat
465
- *
466
- * @typedef {ERef<ReturnType<import('../vat-board.js').buildRootObject>>} BoardVat
467
- *
468
- * @typedef {ERef<ReturnType<import('../vat-bridge.js').buildRootObject>>} ChainStorageVat
469
- *
470
- * @typedef {ERef<
471
- * ReturnType<import('../vat-provisioning.js').buildRootObject>
472
- * >} ProvisioningVat
473
- *
474
- * @typedef {ERef<ReturnType<import('../vat-mints.js').buildRootObject>>} MintsVat
475
- *
476
- * @typedef {ERef<
477
- * ReturnType<import('../vat-priceAuthority.js').buildRootObject>
478
- * >} PriceAuthorityVat
479
- *
480
- * @typedef {ERef<ReturnType<import('../vat-network.js').buildRootObject>>} NetworkVat
481
- *
482
- * @typedef {ERef<ReturnType<import('../vat-ibc.js').buildRootObject>>} IBCVat
483
- *
484
- * @typedef {import('@agoric/zoe/tools/priceAuthorityRegistry').PriceAuthorityRegistryAdmin} PriceAuthorityRegistryAdmin
485
- *
486
- * @typedef {{
487
- * namedVat: PromiseSpaceOf<{
488
- * agoricNames: Awaited<AgoricNamesVat>;
489
- * board: Awaited<BoardVat>;
490
- * }>;
491
- * }} NamedVatPowers
492
- */
493
-
494
- /**
495
- * @typedef {PromiseSpaceOf<{
496
- * mints: MintsVat;
497
- * }>} DemoFaucetPowers
498
- */
499
-
500
- /**
501
- * @typedef {{
502
- * spawner: SpawnerVat;
503
- * http: HttpVat;
504
- * network: NetworkVat;
505
- * uploads: UploadsVat;
506
- * bootstrap: unknown;
507
- * }} SoloVats
508
- *
509
- * @typedef {ERef<
510
- * ReturnType<import('@agoric/solo/src/vat-spawner.js').buildRootObject>
511
- * >} SpawnerVat
512
- *
513
- * @typedef {ERef<
514
- * ReturnType<import('@agoric/solo/src/vat-http.js').buildRootObject>
515
- * >} HttpVat
516
- *
517
- * @typedef {ERef<
518
- * ReturnType<import('@agoric/solo/src/vat-uploads.js').buildRootObject>
519
- * >} UploadsVat
520
- */
521
-
522
- /** @template T @typedef {{vatPowers: { D: DProxy }, devices: T}} BootDevices<T> */
@@ -1 +0,0 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["types.js"],"names":[],"mappings":"uBAMa,OAAO,WAAW,EAAE,KAAK,CAAC,CAAC,CAAC;oBAI5B,WACZ,WAAe,cAAc,gBAAgB,EAAE,eAAe,CAAC,CAC5D,CAAC,OAAO,CAAC;;;;;;;;;eASO,MAAM,KAAK,OAAO;;;;;sBACd,MAAM,EAAE,KAAK,QAAQ,GAAG,CAAC;;;;;gCAEhB,OAAO,KAAK,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE;;;;;UAElD,MAAM,MAAM,EAAE;;;;;YAEd,MAAM,OAAO,EAAE;;;;;;wBAMT,MAAM,aAAa,MAAM,EAAE,KAAK,QAAQ,UAAU,CAAC;;;;;;mBACnD,MAAM,KAAK,QAAQ,IAAI,CAAC;;;;;sBAGrB,MAAM,0BAA0B,SAAS;;;;eAG5C,MAAM,YAAY,OAAO,aAAa,SAAS,KAAK,IAAI;;;;;;kBAExD,MAAM,YAAY,OAAO,aAAa,SAAS,KAAK,IAAI;;;;;;2BAIpD,MAAM,EAAE,KAAK,QAAQ,SAAS,CAAC;;;;;kBAGnC,MAAM,KAAK,IAAI;;;;;cAErB,MAAM,OAAO;mBAER,SAAS,GAAG,oBAAoB,KAAK,IAAI;;;qBAE5B,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,KAAK,IAAI;;;;;;;;;aAK9C,OAAO;;;;eACP,SAAS;;iCAGT,SAAS,GAAG;IAAE,YAAY,IAAI,MAAM,CAAA;CAAE;;uBAIvC,MAAM,aACD,MAAM,EAAE,GAClB,QAAQ;QACf,OAAa,EAAE,OAAO,CAAC;QACvB,SAAe,EAAE,kBAAkB,CAAC;KAC/B,CAAC;sBACgB,MAAM,GAAG,QAAQ,kBAAkB,CAAC;;;;;;;;;;sBAOvC,GAAG,KAAK,QAAQ,IAAI,CAAC;;;;;;;oBAMrB,GAAG,KAAK,QAAQ,GAAG,CAAC;sBACpB,GAAG,KAAK,QAAQ,IAAI,CAAC;2BACjB,KAAK,aAAa,CAAC,KAAK,IAAI;0BAC5B,KAAK,aAAa,CAAC,KAAK,IAAI;;;;;;yBAMrC,MAAM,YACN,KAAK,aAAa,GAAG,SAAS,CAAC,KACtC,mBAAmB"}