@agoric/vats 0.15.2-dev-857e650.0 → 0.15.2-dev-284e2db.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 (80) hide show
  1. package/package.json +20 -20
  2. package/src/bridge.d.ts.map +1 -1
  3. package/src/bridge.js +23 -11
  4. package/src/centralSupply.d.ts.map +1 -1
  5. package/src/centralSupply.js +3 -3
  6. package/src/core/basic-behaviors.d.ts.map +1 -1
  7. package/src/core/basic-behaviors.js +55 -49
  8. package/src/core/boot-chain.js +3 -3
  9. package/src/core/boot-sim.js +3 -3
  10. package/src/core/boot-solo.js +4 -4
  11. package/src/core/chain-behaviors.d.ts.map +1 -1
  12. package/src/core/chain-behaviors.js +28 -23
  13. package/src/core/client-behaviors.d.ts.map +1 -1
  14. package/src/core/client-behaviors.js +5 -4
  15. package/src/core/demoIssuers.d.ts +17 -15
  16. package/src/core/demoIssuers.d.ts.map +1 -1
  17. package/src/core/demoIssuers.js +34 -34
  18. package/src/core/lib-boot.d.ts +9 -8
  19. package/src/core/lib-boot.d.ts.map +1 -1
  20. package/src/core/lib-boot.js +26 -15
  21. package/src/core/promise-space.d.ts.map +1 -1
  22. package/src/core/promise-space.js +14 -14
  23. package/src/core/startWalletFactory.d.ts +4 -1
  24. package/src/core/startWalletFactory.d.ts.map +1 -1
  25. package/src/core/startWalletFactory.js +25 -16
  26. package/src/core/types.d.ts +19 -278
  27. package/src/core/types.d.ts.map +1 -1
  28. package/src/core/types.js +385 -210
  29. package/src/core/utils.d.ts +4 -2
  30. package/src/core/utils.d.ts.map +1 -1
  31. package/src/core/utils.js +30 -28
  32. package/src/crc.d.ts +2 -6
  33. package/src/crc.d.ts.map +1 -1
  34. package/src/crc.js +5 -15
  35. package/src/ibc.d.ts +5 -5
  36. package/src/ibc.d.ts.map +1 -1
  37. package/src/ibc.js +22 -40
  38. package/src/lib-board.d.ts +48 -49
  39. package/src/lib-board.d.ts.map +1 -1
  40. package/src/lib-board.js +32 -39
  41. package/src/mintHolder.d.ts.map +1 -1
  42. package/src/mintHolder.js +5 -6
  43. package/src/nameHub.d.ts.map +1 -1
  44. package/src/nameHub.js +17 -7
  45. package/src/proposals/network-proposal.d.ts.map +1 -1
  46. package/src/proposals/network-proposal.js +13 -10
  47. package/src/proposals/restart-vats-proposal.d.ts +1 -1
  48. package/src/proposals/restart-vats-proposal.d.ts.map +1 -1
  49. package/src/proposals/restart-vats-proposal.js +3 -3
  50. package/src/provisionPool.d.ts.map +1 -1
  51. package/src/provisionPool.js +9 -10
  52. package/src/provisionPoolKit.d.ts +14 -27
  53. package/src/provisionPoolKit.d.ts.map +1 -1
  54. package/src/provisionPoolKit.js +26 -29
  55. package/src/repl.js +1 -1
  56. package/src/types.d.ts +28 -27
  57. package/src/types.d.ts.map +1 -1
  58. package/src/types.js +49 -46
  59. package/src/vat-bank.d.ts +49 -48
  60. package/src/vat-bank.d.ts.map +1 -1
  61. package/src/vat-bank.js +55 -50
  62. package/src/vat-mints.d.ts +10 -10
  63. package/src/vat-mints.d.ts.map +1 -1
  64. package/src/vat-mints.js +6 -6
  65. package/src/vat-provisioning.d.ts.map +1 -1
  66. package/src/vat-provisioning.js +11 -6
  67. package/src/virtual-purse.d.ts +6 -6
  68. package/src/virtual-purse.d.ts.map +1 -1
  69. package/src/virtual-purse.js +34 -33
  70. package/src/walletFlags.js +1 -2
  71. package/tools/authorityViz.d.ts.map +1 -1
  72. package/tools/authorityViz.js +34 -25
  73. package/tools/bank-utils.d.ts +1 -1
  74. package/tools/bank-utils.d.ts.map +1 -1
  75. package/tools/bank-utils.js +12 -5
  76. package/tools/board-utils.d.ts +1 -1
  77. package/tools/board-utils.d.ts.map +1 -1
  78. package/tools/board-utils.js +22 -14
  79. package/tools/boot-test-utils.d.ts.map +1 -1
  80. package/tools/boot-test-utils.js +7 -9
package/src/lib-board.js CHANGED
@@ -1,7 +1,6 @@
1
1
  // @ts-check
2
2
  /**
3
3
  * @file lib-board: share objects by way of plain-data ids
4
- *
5
4
  * @see prepareBoardKit()
6
5
  */
7
6
 
@@ -48,11 +47,11 @@ const BoardKitIKit = {
48
47
  //#endregion
49
48
 
50
49
  /**
51
- * For a value with a known id in the board, we can use
52
- * that board id as a slot to preserve identity when marshaling.
50
+ * For a value with a known id in the board, we can use that board id as a slot
51
+ * to preserve identity when marshaling.
53
52
  *
54
53
  * The contents of the string depend on the `prefix` and `crcDigits` options:
55
- * \`${prefix}${crc}${seq}\`
54
+ * `${prefix}${crc}${seq}`
56
55
  *
57
56
  * For example, 'board0371' for prefix: 'board0', seq: 1, 2 digits crc.
58
57
  *
@@ -75,14 +74,11 @@ const calcCrc = (data, crcDigits) => {
75
74
  };
76
75
 
77
76
  /**
77
+ * @typedef {ReturnType<typeof initDurableBoardState>} BoardState // TODO: use
78
+ * Key from @agoric/store when available
78
79
  * @see {prepareExoClassKit}
79
- * @see {@link ../../SwingSet/docs/virtual-objects.md|SwingSet Virtual Objects}
80
- *
81
- * Hoisting this function makes defining the state type concise.
82
- * @typedef {ReturnType<typeof initDurableBoardState>} BoardState
80
+ * @see {@link ../../SwingSet/docs/virtual-objects.md|SwingSet Virtual Objects} Hoisting this function makes defining the state type concise.
83
81
  *
84
- *
85
- * // TODO: use Key from @agoric/store when available
86
82
  * @typedef {import('@endo/marshal').Passable} Key
87
83
  */
88
84
 
@@ -93,7 +89,8 @@ const calcCrc = (data, crcDigits) => {
93
89
  * @param {bigint | number} [initSequence]
94
90
  * @param {object} [options]
95
91
  * @param {string} [options.prefix] prefix for all ids generated
96
- * @param {number} [options.crcDigits] count of digits to use in CRC at end of the id
92
+ * @param {number} [options.crcDigits] count of digits to use in CRC at end of
93
+ * the id
97
94
  */
98
95
  const initDurableBoardState = (
99
96
  initSequence = 0,
@@ -180,9 +177,7 @@ const getValue = (id, { prefix, crcDigits, idToVal }) => {
180
177
  throw Fail`board does not have id: ${id}`;
181
178
  };
182
179
 
183
- /**
184
- * @param {BoardState} state
185
- */
180
+ /** @param {BoardState} state */
186
181
  const makeSlotToVal = state => {
187
182
  const ifaceAllegedPrefix = 'Alleged: ';
188
183
  const ifaceInaccessiblePrefix = 'SEVERED: ';
@@ -243,9 +238,9 @@ const makePublishingMarshaller = state => {
243
238
  //#endregion
244
239
 
245
240
  /**
246
- * A board is a two-way mapping between objects (such as issuers,
247
- * brands, installation handles) and plain-data string IDs.
248
- * A well-known board allows sharing objects by way of their ids.
241
+ * A board is a two-way mapping between objects (such as issuers, brands,
242
+ * installation handles) and plain-data string IDs. A well-known board allows
243
+ * sharing objects by way of their ids.
249
244
  *
250
245
  * @param {import('@agoric/vat-data').Baggage} baggage for upgrade successors
251
246
  * @see {@link packages/SwingSet/docs/vat-upgrade.md|Vat Upgrade}
@@ -261,13 +256,13 @@ export const prepareBoardKit = baggage => {
261
256
  /**
262
257
  * Provide an ID for a value, generating one if not already present.
263
258
  *
264
- * Each board ID includes a CRC so that the last part is well-distributed,
265
- * which mitigates typo risks.
259
+ * Each board ID includes a CRC so that the last part is
260
+ * well-distributed, which mitigates typo risks.
266
261
  *
267
- * Scaling Consideration: since we cannot know when consumers
268
- * are no longer interested in an ID, a board holds a strong reference
269
- * to `value` for its entire lifetime. For a well-known board, this
270
- * is essentially forever.
262
+ * Scaling Consideration: since we cannot know when consumers are no
263
+ * longer interested in an ID, a board holds a strong reference to
264
+ * `value` for its entire lifetime. For a well-known board, this is
265
+ * essentially forever.
271
266
  *
272
267
  * @param {Key} value
273
268
  * @throws if `value` is not a Key in the @agoric/store sense
@@ -283,14 +278,14 @@ export const prepareBoardKit = baggage => {
283
278
  return getValue(id, this.state);
284
279
  },
285
280
  /**
286
- * Convenience method for recursively traversing boards and
287
- * board-like remotables to get data associated with a sequence of ids
288
- * corresponding to each successive board.
289
- * For example, `lookup("foo", "bar")` gets the value associated with
290
- * id "foo" and returns the result of invoking `lookup("bar")` upon it
291
- * to get the value it associates with id "bar".
281
+ * Convenience method for recursively traversing boards and board-like
282
+ * remotables to get data associated with a sequence of ids
283
+ * corresponding to each successive board. For example, `lookup("foo",
284
+ * "bar")` gets the value associated with id "foo" and returns the
285
+ * result of invoking `lookup("bar")` upon it to get the value it
286
+ * associates with id "bar".
292
287
  *
293
- * @param {...string} path
288
+ * @param {...string} path
294
289
  */
295
290
  async lookup(...path) {
296
291
  const {
@@ -316,19 +311,19 @@ export const prepareBoardKit = baggage => {
316
311
  return harden([...state.idToVal.keys()]);
317
312
  },
318
313
  /**
319
- * Get a marshaller that implements the convertValToSlot hook using getId(),
320
- * "publishing" previously un-mapped objects.
314
+ * Get a marshaller that implements the convertValToSlot hook using
315
+ * getId(), "publishing" previously un-mapped objects.
321
316
  */
322
317
  getPublishingMarshaller() {
323
318
  return this.facets.publishingMarshaller;
324
319
  },
325
320
  /**
326
- * Get a marshaller that implements the convertValToSlot hook using getId(),
327
- * only for objects that the board has().
321
+ * Get a marshaller that implements the convertValToSlot hook using
322
+ * getId(), only for objects that the board has().
328
323
  *
329
324
  * For other objects, we don't throw, but we emit a null slot.
330
- * Un-serializing a null slot always produces a fresh object
331
- * rather than preserving object identity.
325
+ * Un-serializing a null slot always produces a fresh object rather than
326
+ * preserving object identity.
332
327
  */
333
328
  getReadonlyMarshaller() {
334
329
  return this.facets.readonlyMarshaller;
@@ -370,9 +365,7 @@ export const prepareBoardKit = baggage => {
370
365
  );
371
366
  };
372
367
 
373
- /**
374
- * @param {import('@agoric/zone').Zone} zone
375
- */
368
+ /** @param {import('@agoric/zone').Zone} zone */
376
369
  export const prepareRecorderFactory = zone => {
377
370
  const baggage = zone.mapStore(`Recorder Baggage`);
378
371
  const makeDurablePublishKit = prepareDurablePublishKit(
@@ -1 +1 @@
1
- {"version":3,"file":"mintHolder.d.ts","sourceRoot":"","sources":["mintHolder.js"],"names":[],"mappings":"AA4CO,oFAHI,SAAS;;;EAUnB;sBA1Ca,OAAO,kBAAkB,EAAE,OAAO;;;;8CAInC;IACZ,OAAW,EAAE,MAAM,CAAC;IACpB,SAAa,EAAE,CAAC,CAAC;IACjB,WAAe,EAAE,WAAW,CAAC;CAC1B"}
1
+ {"version":3,"file":"mintHolder.d.ts","sourceRoot":"","sources":["mintHolder.js"],"names":[],"mappings":"AA2CO,oFAHI,SAAS;;;EAUnB;sBAzCa,OAAO,kBAAkB,EAAE,OAAO;;;;8CAInC;IACZ,OAAW,EAAE,MAAM,CAAC;IACpB,SAAa,EAAE,CAAC,CAAC;IACjB,WAAe,EAAE,WAAW,CAAC;CAC1B"}
package/src/mintHolder.js CHANGED
@@ -12,9 +12,9 @@ import {
12
12
  /**
13
13
  * @template {AssetKind} K
14
14
  * @typedef {{
15
- * keyword: string,
16
- * assetKind: K,
17
- * displayInfo: DisplayInfo,
15
+ * keyword: string;
16
+ * assetKind: K;
17
+ * displayInfo: DisplayInfo;
18
18
  * }} IssuerInfo<K>
19
19
  */
20
20
 
@@ -33,9 +33,8 @@ function provideIssuerKit(zcf, baggage) {
33
33
  }
34
34
 
35
35
  /**
36
- * This contract holds one mint; it basically wraps
37
- * makeIssuerKit in its own contract, and hence in
38
- * its own vat.
36
+ * This contract holds one mint; it basically wraps makeIssuerKit in its own
37
+ * contract, and hence in its own vat.
39
38
  *
40
39
  * @template {AssetKind} K
41
40
  * @param {ZCF<IssuerInfo<K>>} zcf
@@ -1 +1 @@
1
- {"version":3,"file":"nameHub.d.ts","sourceRoot":"","sources":["nameHub.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAgDO,4CADK,OAAO,cAAc,EAAE,IAAI,eAwB1B,OAAO,YAAY,EAAE,SAAS,WAC9B,MAAM,iGAalB;AA4CM,wCAFI,OAAO,cAAc,EAAE,IAAI,SAcnB,OAAO,SAAS,EAAE,UAAU,CAoN9C;AApNY,kCAAM,OAAO,SAAS,EAAE,UAAU,CAAA"}
1
+ {"version":3,"file":"nameHub.d.ts","sourceRoot":"","sources":["nameHub.js"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;AAgDO,4CADK,OAAO,cAAc,EAAE,IAAI,eA4B1B,OAAO,YAAY,EAAE,SAAS,WAC9B,MAAM,iGAalB;AA4CM,wCAFI,OAAO,cAAc,EAAE,IAAI,SAcnB,OAAO,SAAS,EAAE,UAAU,CA0N9C;AA1NY,kCAAM,OAAO,SAAS,EAAE,UAAU,CAAA"}
package/src/nameHub.js CHANGED
@@ -51,7 +51,11 @@ export const prepareMixinMyAddress = zone => {
51
51
  ...NameHubIKit.nameAdmin.methodGuards,
52
52
  getMyAddress: M.call().returns(M.string()),
53
53
  });
54
- /** @type {import('@agoric/internal/src/callback.js').MakeAttenuator<import('./types.js').MyAddressNameAdmin>} */
54
+ /**
55
+ * @type {import('@agoric/internal/src/callback.js').MakeAttenuator<
56
+ * import('./types.js').MyAddressNameAdmin
57
+ * >}
58
+ */
55
59
  const mixin = prepareGuardedAttenuator(zone, MixinI, {
56
60
  tag: 'MyAddressNameAdmin',
57
61
  });
@@ -122,8 +126,8 @@ const updated = (updateCallback, hub, _newValue = undefined) => {
122
126
  };
123
127
 
124
128
  /**
125
- * Make two facets of a node in a name hierarchy: the nameHub
126
- * is read access and the nameAdmin is write access.
129
+ * Make two facets of a node in a name hierarchy: the nameHub is read access and
130
+ * the nameAdmin is write access.
127
131
  *
128
132
  * @param {import('@agoric/zone').Zone} zone
129
133
  */
@@ -139,7 +143,7 @@ export const prepareNameHubKit = zone => {
139
143
  /** @param {{}} me */
140
144
  const my = me => provideWeak(ephemera, me, init1);
141
145
 
142
- /** @type {() => import('./types').NameHubKit } */
146
+ /** @type {() => import('./types').NameHubKit} */
143
147
  const makeNameHubKit = zone.exoClassKit(
144
148
  'NameHubKit',
145
149
  NameHubIKit,
@@ -283,7 +287,13 @@ export const prepareNameHubKit = zone => {
283
287
  const { keyToPK, keyToAdminPK } = my(this.facets.nameHub);
284
288
  const { keyToValue, keyToAdmin, updateCallback } = this.state;
285
289
 
286
- /** @type {[Map<string, PromiseKit<unknown>>, MapStore<string, unknown>, unknown][]} */
290
+ /**
291
+ * @type {[
292
+ * Map<string, PromiseKit<unknown>>,
293
+ * MapStore<string, unknown>,
294
+ * unknown,
295
+ * ][]}
296
+ */
287
297
  const valueMapEntries = [
288
298
  [keyToAdminPK, keyToAdmin, adminValue],
289
299
  [keyToPK, keyToValue, newValue],
@@ -354,8 +364,8 @@ export const prepareNameHubKit = zone => {
354
364
  };
355
365
 
356
366
  /**
357
- * Make two facets of a node in a name hierarchy: the nameHub
358
- * is read access and the nameAdmin is write access.
367
+ * Make two facets of a node in a name hierarchy: the nameHub is read access and
368
+ * the nameAdmin is write access.
359
369
  *
360
370
  * @returns {import('./types.js').NameHubKit}
361
371
  */
@@ -1 +1 @@
1
- {"version":3,"file":"network-proposal.d.ts","sourceRoot":"","sources":["network-proposal.js"],"names":[],"mappings":"AAgBO,+CAHI,QAAQ,GAAG,OAAO,kGA2D5B;AAgBM,wJAbK,eAAe,GAAG;IAC7B,OAAW,EAAE;QAAE,eAAe,EAAE,UAAU,GAAG,CAAC,CAAA;KAAE,CAAA;IAChD,OAAW,EAAE;QAAE,UAAU,EAAE,SAAS,GAAG,CAAC,CAAA;KAAE,CAAA;CACvC;;oBAGoB,YAAY;gBAAU,YAAY;;kBA2DzD;AAEM;;;;;;;;;;;;;;;;;;;;;;EAmBL;iCA9EoB,SAAS,KAAK,UAAU,YACxB,KAAK,KAAK,MAAM;sBAEzB;IAAE,OAAO,EAAE,KAAK,UAAU,CAAC,CAAC;IAAC,GAAG,EAAE,KAAK,MAAM,CAAC,CAAC;IAAC,YAAY,EAAE,KAAK,eAAe,GAAG,SAAS,CAAC,CAAA;CAAC"}
1
+ {"version":3,"file":"network-proposal.d.ts","sourceRoot":"","sources":["network-proposal.js"],"names":[],"mappings":"AAgBO,+CAHI,QAAQ,GAAG,OAAO,kGA2D5B;AAmBM,wJAhBI,eAAe,GAAG;IAC5B,OAAW,EAAE;QAAE,eAAe,EAAE,UAAU,GAAG,CAAC,CAAA;KAAE,CAAC;IACjD,OAAW,EAAE;QAAE,UAAU,EAAE,SAAS,GAAG,CAAC,CAAA;KAAE,CAAC;CACxC;;oBAEqB,YAAY;gBAAU,YAAY;;kBA+D1D;AAEM;;;;;;;;;;;;;;;;;;;;;;EAmBL;iCAjFmB,SAAS,KAAK,UAAU,YAAY,KAAK,KAAK,MAAM;sBAE5D;IACZ,OAAW,EAAE,KAAK,UAAU,CAAC,CAAC;IAC9B,GAAO,EAAE,KAAK,MAAM,CAAC,CAAC;IACtB,YAAgB,EAAE,KAAK,eAAe,GAAG,SAAS,CAAC,CAAC;CACjD"}
@@ -73,18 +73,21 @@ export const registerNetworkProtocols = async (vats, dibcBridgeManager) => {
73
73
  };
74
74
 
75
75
  /**
76
- * @param { BootstrapPowers & {
77
- * consume: { loadCriticalVat: VatLoader<any> }
78
- * produce: { networkVat: Producer<any> }
76
+ * @param {BootstrapPowers & {
77
+ * consume: { loadCriticalVat: VatLoader<any> };
78
+ * produce: { networkVat: Producer<any> };
79
79
  * }} powers
80
- *
81
80
  * @param {object} options
82
- * @param {{networkRef: VatSourceRef, ibcRef: VatSourceRef}} options.options
83
- * // TODO: why doesn't overloading VatLoader work???
84
- * @typedef { ((name: 'network') => NetworkVat) &
85
- * ((name: 'ibc') => IBCVat) } VatLoader2
81
+ * @param {{ networkRef: VatSourceRef; ibcRef: VatSourceRef }} options.options
82
+ * // TODO: why doesn't overloading VatLoader work???
83
+ *
84
+ * @typedef {((name: 'network') => NetworkVat) & ((name: 'ibc') => IBCVat)} VatLoader2
86
85
  *
87
- * @typedef {{ network: ERef<NetworkVat>, ibc: ERef<IBCVat>, provisioning: ERef<ProvisioningVat | undefined>}} NetVats
86
+ * @typedef {{
87
+ * network: ERef<NetworkVat>;
88
+ * ibc: ERef<IBCVat>;
89
+ * provisioning: ERef<ProvisioningVat | undefined>;
90
+ * }} NetVats
88
91
  */
89
92
  export const setupNetworkProtocols = async (
90
93
  {
@@ -99,7 +102,7 @@ export const setupNetworkProtocols = async (
99
102
  options,
100
103
  ) => {
101
104
  const { networkRef, ibcRef } = options.options;
102
- /** @type { NetVats } */
105
+ /** @type {NetVats} */
103
106
  const vats = {
104
107
  network: E(loadCriticalVat)('network', networkRef),
105
108
  ibc: E(loadCriticalVat)('ibc', ibcRef),
@@ -1,6 +1,6 @@
1
1
  export function restartVats({ consume }: BootstrapPowers & import('@agoric/inter-protocol/src/proposals/econ-behaviors.js').EconomyBootstrapSpace, { options }: {
2
2
  options: {
3
- skip: Array<string>;
3
+ skip: string[];
4
4
  };
5
5
  }): Promise<void>;
6
6
  export function getManifestForRestart(_powers: any, options: any): {
@@ -1 +1 @@
1
- {"version":3,"file":"restart-vats-proposal.d.ts","sourceRoot":"","sources":["restart-vats-proposal.js"],"names":[],"mappings":"AA8BO,yCAJI,eAAe,GAAG,OAAO,wDAAwD,EAAE,qBAAqB;IAEzE,OAAO,EAAtC;QAAE,IAAI,EAAE,MAAM,MAAM,CAAC,CAAA;KAAC;kBA2GhC;AAGM;;;;;;;;;;;;;;;;;;EAkBL"}
1
+ {"version":3,"file":"restart-vats-proposal.d.ts","sourceRoot":"","sources":["restart-vats-proposal.js"],"names":[],"mappings":"AA+BO,yCALI,eAAe,GACzB,OAAW,wDAAwD,EAAE,qBAAqB;IAErD,OAAO,EAAlC;QAAE,IAAI,EAAE,MAAM,EAAE,CAAA;KAAE;kBA0G5B;AAGM;;;;;;;;;;;;;;;;;;EAkBL"}
@@ -24,9 +24,10 @@ const vatUpgradeStatus = {
24
24
  };
25
25
 
26
26
  /**
27
- * @param {BootstrapPowers & import('@agoric/inter-protocol/src/proposals/econ-behaviors.js').EconomyBootstrapSpace} space
27
+ * @param {BootstrapPowers &
28
+ * import('@agoric/inter-protocol/src/proposals/econ-behaviors.js').EconomyBootstrapSpace} space
28
29
  * @param {object} config
29
- * @param {{ skip: Array<string>}} config.options
30
+ * @param {{ skip: string[] }} config.options
30
31
  */
31
32
  export const restartVats = async ({ consume }, { options }) => {
32
33
  console.log(HR);
@@ -52,7 +53,6 @@ export const restartVats = async ({ consume }, { options }) => {
52
53
 
53
54
  const failures = [];
54
55
  /**
55
- *
56
56
  * @param {string} debugName
57
57
  * @param {Instance} instance
58
58
  * @param {ERef<AdminFacet>} adminFacet
@@ -1 +1 @@
1
- {"version":3,"file":"provisionPool.d.ts","sourceRoot":"","sources":["provisionPool.js"],"names":[],"mappings":"AAgBA,gEAWE;AAmBK,6BAVI,IAAI,cAAc,CAAC;cAEf,OAAO,WAAW,EAAE,IAAI,CAAC,OAAO,eAAe,EAAE,IAAI,CAAC;4BACxC,UAAU;iBACrB,WAAW;gBACZ,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqE1B;;;;6BAhFY,aAAa,GAAG,gBAAgB;IAC5C,uBAA4B,EAAE,QAAQ,CAAC;CAClC,CAAC"}
1
+ {"version":3,"file":"provisionPool.d.ts","sourceRoot":"","sources":["provisionPool.js"],"names":[],"mappings":"AAgBA,gEAWE;AAkBK,6BAVI,IAAI,cAAc,CAAC;cAEf,OAAO,WAAW,EAAE,IAAI,CAAC,OAAO,eAAe,EAAE,IAAI,CAAC;4BACxC,UAAU;iBACrB,WAAW;gBACZ,UAAU;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqE1B;;;;6BA/EY,aAAa,GACzB,gBAAoB;IACpB,uBAA6B,EAAE,QAAQ,CAAC;CACnC,CAAC"}
@@ -28,19 +28,18 @@ export const privateArgsShape = M.splitRecord(
28
28
  );
29
29
 
30
30
  /**
31
- * @typedef {StandardTerms & GovernanceTerms<{
32
- * PerAccountInitialAmount: 'amount',
31
+ * @typedef {StandardTerms &
32
+ * GovernanceTerms<{
33
+ * PerAccountInitialAmount: 'amount';
33
34
  * }>} ProvisionTerms
34
- *
35
- * TODO: ERef<GovernedCreatorFacet<ProvisionCreator>>
36
- *
35
+ * TODO: ERef<GovernedCreatorFacet<ProvisionCreator>>
37
36
  * @param {ZCF<ProvisionTerms>} zcf
38
37
  * @param {{
39
- * poolBank: import('@endo/far').ERef<import('./vat-bank.js').Bank>,
40
- * initialPoserInvitation: Invitation,
41
- * storageNode: StorageNode,
42
- * marshaller: Marshaller,
43
- * metricsOverride?: import('./provisionPoolKit').MetricsNotification,
38
+ * poolBank: import('@endo/far').ERef<import('./vat-bank.js').Bank>;
39
+ * initialPoserInvitation: Invitation;
40
+ * storageNode: StorageNode;
41
+ * marshaller: Marshaller;
42
+ * metricsOverride?: import('./provisionPoolKit').MetricsNotification;
44
43
  * }} privateArgs
45
44
  * @param {import('@agoric/vat-data').Baggage} baggage
46
45
  */
@@ -13,9 +13,7 @@ export function prepareProvisionPoolKit(baggage: MapStore<string, unknown>, { ma
13
13
  storageNode: ERef<StorageNode>;
14
14
  }) => Promise<{
15
15
  machine: {
16
- /**
17
- * @param {string[]} oldAddresses
18
- */
16
+ /** @param {string[]} oldAddresses */
19
17
  addRevivableAddresses(oldAddresses: string[]): void;
20
18
  getWalletReviver(): {
21
19
  /** @param {string} address */
@@ -49,9 +47,7 @@ export function prepareProvisionPoolKit(baggage: MapStore<string, unknown>, { ma
49
47
  */
50
48
  ackWallet(address: string): boolean;
51
49
  };
52
- /**
53
- * @param {ProvisionPoolKitReferences} erefs
54
- */
50
+ /** @param {ProvisionPoolKitReferences} erefs */
55
51
  setReferences(erefs: ProvisionPoolKitReferences): Promise<void>;
56
52
  makeHandler(): {
57
53
  fromBridge: (obj: any) => Promise<void>;
@@ -101,10 +97,7 @@ export function prepareProvisionPoolKit(baggage: MapStore<string, unknown>, { ma
101
97
  onTrade(converted: any): void;
102
98
  onSendFunds(provided: any): void;
103
99
  onProvisioned(): void;
104
- /**
105
- *
106
- * @param {ERef<Bank>} destBank
107
- */
100
+ /** @param {ERef<Bank>} destBank */
108
101
  sendInitialPayment(destBank: ERef<Bank>): Promise<void>;
109
102
  /**
110
103
  * @param {object} [options]
@@ -127,9 +120,7 @@ export function prepareProvisionPoolKit(baggage: MapStore<string, unknown>, { ma
127
120
  };
128
121
  } & import("@endo/eventual-send").RemotableBrand<{}, {
129
122
  machine: {
130
- /**
131
- * @param {string[]} oldAddresses
132
- */
123
+ /** @param {string[]} oldAddresses */
133
124
  addRevivableAddresses(oldAddresses: string[]): void;
134
125
  getWalletReviver(): {
135
126
  /** @param {string} address */
@@ -163,9 +154,7 @@ export function prepareProvisionPoolKit(baggage: MapStore<string, unknown>, { ma
163
154
  */
164
155
  ackWallet(address: string): boolean;
165
156
  };
166
- /**
167
- * @param {ProvisionPoolKitReferences} erefs
168
- */
157
+ /** @param {ProvisionPoolKitReferences} erefs */
169
158
  setReferences(erefs: ProvisionPoolKitReferences): Promise<void>;
170
159
  makeHandler(): {
171
160
  fromBridge: (obj: any) => Promise<void>;
@@ -215,10 +204,7 @@ export function prepareProvisionPoolKit(baggage: MapStore<string, unknown>, { ma
215
204
  onTrade(converted: any): void;
216
205
  onSendFunds(provided: any): void;
217
206
  onProvisioned(): void;
218
- /**
219
- *
220
- * @param {ERef<Bank>} destBank
221
- */
207
+ /** @param {ERef<Bank>} destBank */
222
208
  sendInitialPayment(destBank: ERef<Bank>): Promise<void>;
223
209
  /**
224
210
  * @param {object} [options]
@@ -366,8 +352,8 @@ export type ProvisionPoolKitReferences = {
366
352
  walletFactory: ERef<import('@agoric/vats/src/core/startWalletFactory').WalletFactoryStartResult['creatorFacet']>;
367
353
  };
368
354
  /**
369
- * Metrics naming scheme is that nouns are present values and past-participles
370
- * are accumulative.
355
+ * Metrics naming scheme is that nouns are
356
+ * present values and past-participles are accumulative.
371
357
  */
372
358
  export type MetricsNotification = {
373
359
  /**
@@ -375,18 +361,19 @@ export type MetricsNotification = {
375
361
  */
376
362
  walletsProvisioned: bigint;
377
363
  /**
378
- * running sum of Minted provided to new wallets
364
+ * running sum of Minted provided
365
+ * to new wallets
379
366
  */
380
367
  totalMintedProvided: Amount<'nat'>;
381
368
  /**
382
- * running sum of Minted
383
- * ever received by the contract from PSM
369
+ * running sum of Minted ever
370
+ * received by the contract from PSM
384
371
  */
385
372
  totalMintedConverted: Amount<'nat'>;
386
373
  };
387
374
  /**
388
- * Given attenuated access to the funding purse,
389
- * handle requests to provision smart wallets.
375
+ * Given attenuated access to the funding purse, handle requests to provision
376
+ * smart wallets.
390
377
  */
391
378
  export type Bank = import('./vat-bank.js').Bank;
392
379
  //# sourceMappingURL=provisionPoolKit.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"provisionPoolKit.d.ts","sourceRoot":"","sources":["provisionPoolKit.js"],"names":[],"mappings":"AAqDO,0EAJkB,KAAK,IAAI,CAAC,KAAK,QAAQ,IAAI,CAAC,iBAC1C,MAAM,IAAI,0DAKR,0BAA0B;;;;GAgCtC;AAWM,wHAPI;IACV,eAAmB,EAAE,OAAO,6CAA6C,EAAE,eAAe,CAAC;IAC3F,MAAU,MAAI;IACd,QAAY,EAAE,OAAO,WAAW,EAAE,IAAI,CAAC,IAAI,CAAC,CAAC;IAC7C,GAAO,EAAE,GAAG,CAAC;CACV;IA8VqB,SAAS,EAArB,KAAK;IACmB,WAAW,EAAnC,KAAK,WAAW,CAAC;;;QAhRtB;;WAEG;4CADQ,MAAM,EAAE;;YAkDnB,8BAA8B;kCAAlB,MAAM;;;;;;;;;;;;;;;;;;;;;;;;YAqBlB;;;eAGG;+BAFQ,MAAM,GACJ,OAAO;;QAhEpB;;WAEG;6BADQ,0BAA0B;;;;;;QA8BrC;;;WAGG;uBAFQ,KAAK,YACL,WAAW;;;QAQtB,8BAA8B;8BAAlB,MAAM;;;;;;;;;;;;;;;;;;;;;;;;QAqBlB;;;WAGG;2BAFQ,MAAM,GACJ,OAAO;;;;;;;QAgDpB;;;WAGG;qCADQ,KAAK,IAAI,CAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAE5D;;iBAKU,KAAK,WAAW,CAAC;yBACjB,KAAK,OAAO,cAAc,EAAE,SAAS,CAAC;mBACtC,KACb,OAAW,0CAA0C,EAAE,wBAAwB,CAAC,cAAc,CAAC,CAC5F;;;;;;;;;;wBAMU,MAAM;;;;;yBACN,OAAO,KAAK,CAAC;;;;;0BAEb,OAAO,KAAK,CAAC;;;;;;mBAWd,OAAO,eAAe,EAAE,IAAI"}
@@ -23,38 +23,42 @@ import { PowerFlags } from './walletFlags.js';
23
23
 
24
24
  const { details: X, quote: q, Fail } = assert;
25
25
 
26
- /** @typedef {import('@agoric/zoe/src/zoeService/utils').Instance<import('@agoric/inter-protocol/src/psm/psm.js').prepare>} PsmInstance */
26
+ /**
27
+ * @typedef {import('@agoric/zoe/src/zoeService/utils').Instance<
28
+ * import('@agoric/inter-protocol/src/psm/psm.js').prepare
29
+ * >} PsmInstance
30
+ */
27
31
 
28
32
  /**
29
33
  * @typedef {object} ProvisionPoolKitReferences
30
34
  * @property {ERef<BankManager>} bankManager
31
35
  * @property {ERef<import('@agoric/vats').NameAdmin>} namesByAddressAdmin
32
- * @property {ERef<import('@agoric/vats/src/core/startWalletFactory').WalletFactoryStartResult['creatorFacet']>} walletFactory
36
+ * @property {ERef<
37
+ * import('@agoric/vats/src/core/startWalletFactory').WalletFactoryStartResult['creatorFacet']
38
+ * >} walletFactory
33
39
  */
34
40
 
35
41
  /**
36
- * @typedef {object} MetricsNotification
37
- * Metrics naming scheme is that nouns are present values and past-participles
38
- * are accumulative.
39
- *
40
- * @property {bigint} walletsProvisioned count of new wallets provisioned
41
- * @property {Amount<'nat'>} totalMintedProvided running sum of Minted provided to new wallets
42
- * @property {Amount<'nat'>} totalMintedConverted running sum of Minted
43
- * ever received by the contract from PSM
42
+ * @typedef {object} MetricsNotification Metrics naming scheme is that nouns are
43
+ * present values and past-participles are accumulative.
44
+ * @property {bigint} walletsProvisioned count of new wallets provisioned
45
+ * @property {Amount<'nat'>} totalMintedProvided running sum of Minted provided
46
+ * to new wallets
47
+ * @property {Amount<'nat'>} totalMintedConverted running sum of Minted ever
48
+ * received by the contract from PSM
44
49
  */
45
50
 
46
51
  /**
47
- * Given attenuated access to the funding purse,
48
- * handle requests to provision smart wallets.
52
+ * Given attenuated access to the funding purse, handle requests to provision
53
+ * smart wallets.
49
54
  *
50
55
  * @param {(depositBank: ERef<Bank>) => Promise<void>} sendInitialPayment
51
56
  * @param {() => void} onProvisioned
57
+ *
52
58
  * @typedef {import('./vat-bank.js').Bank} Bank
53
59
  */
54
60
  export const makeBridgeProvisionTool = (sendInitialPayment, onProvisioned) => {
55
- /**
56
- * @param {ProvisionPoolKitReferences} refs
57
- */
61
+ /** @param {ProvisionPoolKitReferences} refs */
58
62
  const makeBridgeHandler = ({
59
63
  bankManager,
60
64
  namesByAddressAdmin,
@@ -90,10 +94,10 @@ export const makeBridgeProvisionTool = (sendInitialPayment, onProvisioned) => {
90
94
  /**
91
95
  * @param {import('@agoric/vat-data').Baggage} baggage
92
96
  * @param {{
93
- * makeRecorderKit: import('@agoric/zoe/src/contractSupport/recorder.js').MakeRecorderKit,
94
- * params: *,
95
- * poolBank: import('@endo/far').ERef<Bank>,
96
- * zcf: ZCF,
97
+ * makeRecorderKit: import('@agoric/zoe/src/contractSupport/recorder.js').MakeRecorderKit;
98
+ * params: any;
99
+ * poolBank: import('@endo/far').ERef<Bank>;
100
+ * zcf: ZCF;
97
101
  * }} powers
98
102
  */
99
103
  export const prepareProvisionPoolKit = (
@@ -173,9 +177,7 @@ export const prepareProvisionPoolKit = (
173
177
  {
174
178
  // aka "limitedCreatorFacet"
175
179
  machine: {
176
- /**
177
- * @param {string[]} oldAddresses
178
- */
180
+ /** @param {string[]} oldAddresses */
179
181
  addRevivableAddresses(oldAddresses) {
180
182
  console.log('revivableAddresses count', oldAddresses.length);
181
183
  this.state.revivableAddresses.addAll(oldAddresses);
@@ -183,9 +185,7 @@ export const prepareProvisionPoolKit = (
183
185
  getWalletReviver() {
184
186
  return this.facets.walletReviver;
185
187
  },
186
- /**
187
- * @param {ProvisionPoolKitReferences} erefs
188
- */
188
+ /** @param {ProvisionPoolKitReferences} erefs */
189
189
  async setReferences(erefs) {
190
190
  const { bankManager, namesByAddressAdmin, walletFactory } = erefs;
191
191
  const obj = harden({
@@ -295,10 +295,7 @@ export const prepareProvisionPoolKit = (
295
295
  state.walletsProvisioned += 1n;
296
296
  facets.helper.publishMetrics();
297
297
  },
298
- /**
299
- *
300
- * @param {ERef<Bank>} destBank
301
- */
298
+ /** @param {ERef<Bank>} destBank */
302
299
  async sendInitialPayment(destBank) {
303
300
  const {
304
301
  facets: { helper },
package/src/repl.js CHANGED
@@ -74,7 +74,7 @@ function dump0(value, spaces, inProgress, depth) {
74
74
 
75
75
  let sep = '';
76
76
  let closer;
77
- /** @type {Array<string | symbol>} */
77
+ /** @type {(string | symbol)[]} */
78
78
  const names = Object.getOwnPropertyNames(value);
79
79
  const nonNumber = new Set(names);
80
80
  if (Array.isArray(value)) {