@agoric/deploy-script-support 0.10.4-20230923T000433-dev-63b1fb6.0 → 0.10.4-calypso-dev-dabccdc.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.
@@ -11,21 +11,47 @@ import {
11
11
  } from './coreProposalBehavior.js';
12
12
 
13
13
  /**
14
- * @typedef {string | { module: string, entrypoint: string, args?: Array<unknown> }} ConfigProposal
14
+ * @typedef {string | {module: string, entrypoint?: string, args?: Array<unknown>}} ConfigProposal
15
15
  */
16
16
 
17
- const { details: X, Fail } = assert;
17
+ /**
18
+ * @typedef {{steps: ConfigProposal[][]}} SequentialCoreProposals
19
+ * @typedef {ConfigProposal[] | SequentialCoreProposals} CoreProposals
20
+ */
21
+
22
+ const { Fail } = assert;
18
23
 
19
24
  const req = createRequire(import.meta.url);
20
25
 
26
+ /**
27
+ * @param {...(CoreProposals | undefined | null)} args
28
+ * @returns {SequentialCoreProposals}
29
+ */
30
+ export const mergeCoreProposals = (...args) => {
31
+ /** @type {ConfigProposal[][]} */
32
+ const steps = [];
33
+ for (const coreProposal of args) {
34
+ if (!coreProposal) {
35
+ continue;
36
+ }
37
+ if ('steps' in coreProposal) {
38
+ steps.push(...coreProposal.steps);
39
+ } else {
40
+ steps.push(coreProposal);
41
+ }
42
+ }
43
+ return harden({ steps });
44
+ };
45
+ harden(mergeCoreProposals);
46
+
21
47
  /**
22
48
  * @param {(ModuleSpecifier | FilePath)[]} paths
23
49
  * @typedef {string} ModuleSpecifier
24
50
  * @typedef {string} FilePath
25
51
  */
26
52
  const pathResolve = (...paths) => {
27
- const fileName = paths.pop();
28
- assert(fileName, '>=1 paths required');
53
+ const fileName = /** @type {string} */ (paths.pop());
54
+ fileName || Fail`base name required`;
29
55
  try {
30
56
  return req.resolve(fileName, {
31
57
  paths,
@@ -40,6 +66,19 @@ const findModule = (initDir, srcSpec) =>
40
66
  ? pathResolve(initDir, srcSpec)
41
67
  : req.resolve(srcSpec);
42
68
 
69
+ /**
70
+ * @param {{ bundleID?: string, bundleName?: string }} handle - mutated then hardened
71
+ * @param {string} sourceSpec - the specifier of a module to load
72
+ * @param {string} key - the key of the proposal
73
+ * @param {string} piece - the piece of the proposal
74
+ * @returns {Promise<[string, any]>}
75
+ */
76
+ const namedHandleToBundleSpec = async (handle, sourceSpec, key, piece) => {
77
+ handle.bundleName = `coreProposal${String(key)}_${piece}`;
78
+ harden(handle);
79
+ return harden([handle.bundleName, { sourceSpec }]);
80
+ };
81
+
43
82
  /**
44
83
  * Format core proposals to be run at bootstrap:
45
84
  * SwingSet `bundles` configuration
@@ -51,188 +90,225 @@ const findModule = (initDir, srcSpec) =>
51
90
  * but for sim-chain and such, they can be declared statically in
52
91
  * the chain configuration, in which case they are run at bootstrap.
53
92
  *
54
- * @param {ConfigProposal[]} coreProposals - governance
93
+ * @param {CoreProposals} coreProposals - governance
55
94
  * proposals to run at chain bootstrap for scenarios such as sim-chain.
56
95
  * @param {FilePath} [dirname]
57
- * @param {typeof makeEnactCoreProposalsFromBundleRef} [makeEnactCoreProposals]
58
- * @param {(i: number) => number} [getSequenceForProposal]
96
+ * @param {object} [opts]
97
+ * @param {typeof makeEnactCoreProposalsFromBundleRef} [opts.makeEnactCoreProposals]
98
+ * @param {(key: PropertyKey) => PropertyKey} [opts.getSequenceForProposal]
99
+ * @param {typeof namedHandleToBundleSpec} [opts.handleToBundleSpec]
59
100
  */
60
101
  export const extractCoreProposalBundles = async (
61
102
  coreProposals,
62
103
  dirname = '.',
63
- makeEnactCoreProposals = makeEnactCoreProposalsFromBundleRef,
64
- getSequenceForProposal,
104
+ opts,
65
105
  ) => {
66
- if (!getSequenceForProposal) {
67
- // Deterministic proposal numbers.
68
- getSequenceForProposal = i => i;
69
- }
106
+ const {
107
+ makeEnactCoreProposals = makeEnactCoreProposalsFromBundleRef,
108
+ getSequenceForProposal = key => key,
109
+ handleToBundleSpec = namedHandleToBundleSpec,
110
+ } = opts || {};
70
111
 
71
112
  dirname = pathResolve(dirname);
72
113
  dirname = await fs.promises
73
114
  .stat(dirname)
74
115
  .then(stbuf => (stbuf.isDirectory() ? dirname : path.dirname(dirname)));
75
116
 
76
- /** @type {Map<{ bundleName?: string }, { source: string, bundle?: string }>} */
117
+ /** @type {Map<{ bundleID?: string, bundleName?: string }, { source: string, bundle?: string }>} */
77
118
  const bundleHandleToAbsolutePaths = new Map();
78
119
 
120
+ const proposalSteps =
121
+ 'steps' in coreProposals ? coreProposals.steps : [coreProposals];
79
122
  const bundleToSource = new Map();
80
- const extracted = await Promise.all(
81
- coreProposals.map(async (coreProposal, i) => {
82
- // console.debug(`Parsing core proposal:`, coreProposal);
83
-
84
- /** @type {string} */
85
- let entrypoint;
86
- /** @type {unknown[]} */
87
- let args;
88
- /** @type {string} */
89
- let module;
90
- if (typeof coreProposal === 'string') {
91
- module = coreProposal;
92
- entrypoint = 'defaultProposalBuilder';
93
- args = [];
94
- } else {
95
- ({ module, entrypoint, args = [] } = coreProposal);
96
- }
97
-
98
- typeof module === 'string' ||
99
- Fail`coreProposal module ${module} must be string`;
100
- typeof entrypoint === 'string' ||
101
- Fail`coreProposal entrypoint ${entrypoint} must be string`;
102
- Array.isArray(args) || Fail`coreProposal args ${args} must be array`;
103
-
104
- const thisProposalBundleHandles = new Set();
105
- assert(getSequenceForProposal);
106
- const thisProposalSequence = getSequenceForProposal(i);
107
- const initPath = findModule(dirname, module);
108
- const initDir = path.dirname(initPath);
109
- /** @type {Record<string, import('./externalTypes.js').ProposalBuilder>} */
110
- const ns = await import(initPath);
111
- const install = (srcSpec, bundlePath) => {
112
- const absoluteSrc = findModule(initDir, srcSpec);
113
- const bundleHandle = {};
114
- const absolutePaths = { source: absoluteSrc };
115
- if (bundlePath) {
116
- const absoluteBundle = pathResolve(initDir, bundlePath);
117
- absolutePaths.bundle = absoluteBundle;
118
- const oldSource = bundleToSource.get(absoluteBundle);
119
- if (oldSource) {
120
- assert.equal(
121
- oldSource,
122
- absoluteSrc,
123
- X`${bundlePath} already installed from ${oldSource}, now ${absoluteSrc}`,
124
- );
123
+ const extractedSteps = await Promise.all(
124
+ proposalSteps.map((proposalStep, i) =>
125
+ Promise.all(
126
+ proposalStep.map(async (coreProposal, j) => {
127
+ const key = `${i}.${j}`;
128
+ // console.debug(`Parsing core proposal:`, coreProposal);
129
+
130
+ /** @type {string} */
131
+ let entrypoint;
132
+ /** @type {unknown[]} */
133
+ let args;
134
+ /** @type {string} */
135
+ let module;
136
+ if (typeof coreProposal === 'string') {
137
+ module = coreProposal;
138
+ entrypoint = 'defaultProposalBuilder';
139
+ args = [];
125
140
  } else {
126
- bundleToSource.set(absoluteBundle, absoluteSrc);
127
- }
128
- }
129
- // Don't harden the bundleHandle since we need to set the bundleName on
130
- // its unique identity later.
131
- thisProposalBundleHandles.add(bundleHandle);
132
- bundleHandleToAbsolutePaths.set(bundleHandle, harden(absolutePaths));
133
- return bundleHandle;
134
- };
135
- /** @type {import('./externalTypes.js').PublishBundleRef} */
136
- const publishRef = async handleP => {
137
- const handle = await handleP;
138
- bundleHandleToAbsolutePaths.has(handle) ||
139
- Fail`${handle} not in installed bundles`;
140
- return handle;
141
- };
142
- const proposal = await ns[entrypoint]({ publishRef, install }, ...args);
143
-
144
- // Add the proposal bundle handles in sorted order.
145
- const bundleSpecEntries = [...thisProposalBundleHandles.keys()]
146
- .map(handle => [handle, bundleHandleToAbsolutePaths.get(handle)])
147
- .sort(([_hnda, { source: a }], [_hndb, { source: b }]) => {
148
- if (a < b) {
149
- return -1;
141
+ ({
142
+ module,
143
+ entrypoint = 'defaultProposalBuilder',
144
+ args = [],
145
+ } = coreProposal);
150
146
  }
151
- if (a > b) {
152
- return 1;
153
- }
154
- return 0;
155
- })
156
- .map(([handle, absolutePaths], j) => {
157
- // Transform the bundle handle identity into a bundleName reference.
158
- handle.bundleName = `coreProposal${thisProposalSequence}_${j}`;
159
- harden(handle);
160
-
161
- /** @type {[string, { sourceSpec: string }]} */
162
- const specEntry = [
163
- handle.bundleName,
164
- { sourceSpec: absolutePaths.source },
165
- ];
166
- return specEntry;
167
- });
168
-
169
- // Now that we've assigned all the bundleNames and hardened the
170
- // handles, we can extract the behavior bundle.
171
- const { sourceSpec, getManifestCall } = await deeplyFulfilledObject(
172
- harden(proposal),
173
- );
174
-
175
- const behaviorSource = pathResolve(initDir, sourceSpec);
176
- const behaviors = await import(behaviorSource);
177
- const [exportedGetManifest, ...manifestArgs] = getManifestCall;
178
- const { manifest: overrideManifest } = await behaviors[
179
- exportedGetManifest
180
- ](harden({ restoreRef: () => null }), ...manifestArgs);
181
-
182
- const behaviorBundleHandle = harden({
183
- bundleName: `coreProposal${thisProposalSequence}_behaviors`,
184
- });
185
- const behaviorAbsolutePaths = harden({
186
- source: behaviorSource,
187
- });
188
- bundleHandleToAbsolutePaths.set(
189
- behaviorBundleHandle,
190
- behaviorAbsolutePaths,
191
- );
192
-
193
- bundleSpecEntries.unshift([
194
- behaviorBundleHandle.bundleName,
195
- { sourceSpec: behaviorAbsolutePaths.source },
196
- ]);
197
-
198
- return harden({
199
- ref: behaviorBundleHandle,
200
- call: getManifestCall,
201
- overrideManifest,
202
- bundleSpecs: bundleSpecEntries,
203
- });
204
- }),
147
+
148
+ typeof module === 'string' ||
149
+ Fail`coreProposal module ${module} must be string`;
150
+ typeof entrypoint === 'string' ||
151
+ Fail`coreProposal entrypoint ${entrypoint} must be string`;
152
+ Array.isArray(args) || Fail`coreProposal args ${args} must be array`;
153
+
154
+ const thisProposalBundleHandles = new Set();
155
+ assert(getSequenceForProposal);
156
+ const thisProposalSequence = getSequenceForProposal(key);
157
+ const initPath = findModule(dirname, module);
158
+ const initDir = path.dirname(initPath);
159
+ /** @type {Record<string, import('./externalTypes.js').CoreEvalBuilder>} */
160
+ const ns = await import(initPath);
161
+ const install = (srcSpec, bundlePath) => {
162
+ const absoluteSrc = findModule(initDir, srcSpec);
163
+ const bundleHandle = {};
164
+ const absolutePaths = { source: absoluteSrc };
165
+ if (bundlePath) {
166
+ const absoluteBundle = pathResolve(initDir, bundlePath);
167
+ absolutePaths.bundle = absoluteBundle;
168
+ const oldSource = bundleToSource.get(absoluteBundle);
169
+ if (oldSource) {
170
+ oldSource === absoluteSrc ||
171
+ Fail`${bundlePath} already installed from ${oldSource}, now ${absoluteSrc}`;
172
+ } else {
173
+ bundleToSource.set(absoluteBundle, absoluteSrc);
174
+ }
175
+ }
176
+ // Don't harden the bundleHandle since we need to set the bundleName on
177
+ // its unique identity later.
178
+ thisProposalBundleHandles.add(bundleHandle);
179
+ bundleHandleToAbsolutePaths.set(
180
+ bundleHandle,
181
+ harden(absolutePaths),
182
+ );
183
+ return bundleHandle;
184
+ };
185
+ /** @type {import('./externalTypes.js').PublishBundleRef} */
186
+ const publishRef = async handleP => {
187
+ const handle = await handleP;
188
+ bundleHandleToAbsolutePaths.has(handle) ||
189
+ Fail`${handle} not in installed bundles`;
190
+ return handle;
191
+ };
192
+ const proposal = await ns[entrypoint](
193
+ {
194
+ publishRef,
195
+ // @ts-expect-error not statically verified to return a full obj
196
+ install,
197
+ },
198
+ ...args,
199
+ );
200
+
201
+ // Add the proposal bundle handles in sorted order.
202
+ const bundleSpecEntries = await Promise.all(
203
+ [...thisProposalBundleHandles.keys()]
204
+ .map(handle => [handle, bundleHandleToAbsolutePaths.get(handle)])
205
+ .sort(([_hnda, { source: a }], [_hndb, { source: b }]) => {
206
+ if (a < b) {
207
+ return -1;
208
+ }
209
+ if (a > b) {
210
+ return 1;
211
+ }
212
+ return 0;
213
+ })
214
+ .map(async ([handle, absolutePaths], k) => {
215
+ // Transform the bundle handle identity into a bundleName reference.
216
+ const specEntry = await handleToBundleSpec(
217
+ handle,
218
+ absolutePaths.source,
219
+ thisProposalSequence,
220
+ String(k),
221
+ );
222
+ harden(handle);
223
+ return specEntry;
224
+ }),
225
+ );
226
+
227
+ // Now that we've assigned all the bundleNames and hardened the
228
+ // handles, we can extract the behavior bundle.
229
+ const { sourceSpec, getManifestCall } = await deeplyFulfilledObject(
230
+ harden(proposal),
231
+ );
232
+
233
+ const proposalSource = pathResolve(initDir, sourceSpec);
234
+ const proposalNS = await import(proposalSource);
235
+ const [manifestGetterName, ...manifestGetterArgs] = getManifestCall;
236
+ manifestGetterName in proposalNS ||
237
+ Fail`proposal ${proposalSource} missing export ${manifestGetterName}`;
238
+ const { manifest: customManifest } = await proposalNS[
239
+ manifestGetterName
240
+ ](harden({ restoreRef: () => null }), ...manifestGetterArgs);
241
+
242
+ const behaviorBundleHandle = {};
243
+ const specEntry = await handleToBundleSpec(
244
+ behaviorBundleHandle,
245
+ proposalSource,
246
+ thisProposalSequence,
247
+ 'proposalNS',
248
+ );
249
+ bundleSpecEntries.unshift(specEntry);
250
+
251
+ bundleHandleToAbsolutePaths.set(
252
+ behaviorBundleHandle,
253
+ harden({
254
+ source: proposalSource,
255
+ }),
256
+ );
257
+
258
+ return /** @type {const} */ ([
259
+ key,
260
+ {
261
+ ref: behaviorBundleHandle,
262
+ call: getManifestCall,
263
+ customManifest,
264
+ bundleSpecs: bundleSpecEntries,
265
+ },
266
+ ]);
267
+ }),
268
+ ),
269
+ ),
205
270
  );
206
271
 
207
272
  // Extract all the bundle specs in already-sorted order.
208
273
  const bundles = Object.fromEntries(
209
- extracted.flatMap(({ bundleSpecs }) => bundleSpecs),
274
+ extractedSteps.flatMap(step =>
275
+ step.flatMap(([_key, { bundleSpecs }]) => bundleSpecs),
276
+ ),
210
277
  );
211
278
  harden(bundles);
212
279
 
213
- // Extract the manifest references and calls.
214
- const makeCPArgs = extracted.map(({ ref, call, overrideManifest }) => ({
215
- ref,
216
- call,
217
- overrideManifest,
218
- }));
219
- harden(makeCPArgs);
280
+ const codeSteps = extractedSteps.map(extractedStep => {
281
+ // Extract the manifest references and calls.
282
+ const metadataRecords = extractedStep.map(([_key, extractedSpec]) => {
283
+ const { ref, call, customManifest } = extractedSpec;
284
+ return { ref, call, customManifest };
285
+ });
286
+ harden(metadataRecords);
220
287
 
221
- const code = `\
222
- // This is generated by @agoric/cosmic-swingset/src/extract-proposal.js - DO NOT EDIT
288
+ const code = `\
289
+ // This is generated by @agoric/deploy-script-support/src/extract-proposal.js - DO NOT EDIT
223
290
  /* eslint-disable */
224
291
 
225
- const makeCoreProposalArgs = harden(${stringify(makeCPArgs, true)});
226
-
227
- const makeCoreProposalBehavior = ${makeCoreProposalBehavior};
292
+ const metadataRecords = harden(${stringify(metadataRecords, true)});
228
293
 
229
- (${makeEnactCoreProposals})({ makeCoreProposalArgs, E });
294
+ // Make an enactCoreProposals function and "export" it by way of script completion value.
295
+ // It is constructed by an IIFE to ensure the absence of global bindings for
296
+ // makeCoreProposalBehavior and makeEnactCoreProposals (the latter referencing the former),
297
+ // which may not be necessary but preserves behavior pre-dating
298
+ // https://github.com/Agoric/agoric-sdk/pull/8712 .
299
+ const enactCoreProposals = ((
300
+ makeCoreProposalBehavior = ${makeCoreProposalBehavior},
301
+ makeEnactCoreProposals = ${makeEnactCoreProposals},
302
+ ) => makeEnactCoreProposals({ metadataRecords, E }))();
303
+ enactCoreProposals;
230
304
  `;
305
+ return defangAndTrim(code);
306
+ });
231
307
 
232
308
  // console.debug('created bundles from proposals:', coreProposals, bundles);
233
- return {
309
+ return harden({
234
310
  bundles,
235
- code: defangAndTrim(code),
311
+ codeSteps,
236
312
  bundleHandleToAbsolutePaths,
237
- };
313
+ });
238
314
  };
@@ -13,6 +13,9 @@
13
13
  import { E } from '@endo/far';
14
14
  import url from 'url';
15
15
 
16
+ /** @typedef {ReturnType<import('./endo-pieces-contract.js')['start']>['publicFacet']} BundleMaker */
17
+ /** @typedef {ReturnType<BundleMaker['makeBundler']>} Bundler */
18
+
16
19
  export const makeGetBundlerMaker =
17
20
  (homeP, { lookup, bundleSource }) =>
18
21
  async ({
@@ -20,6 +23,7 @@ export const makeGetBundlerMaker =
20
23
  log = console.log,
21
24
  } = {}) => {
22
25
  const { board: optionalBoard, zoe, scratch } = await homeP;
26
+ /** @type {() => Promise<BundleMaker>} */
23
27
  const lookupOrCreate = async () => {
24
28
  // Locate the bundler maker if any already exists at the given path.
25
29
  let bundlerMaker = await lookup(JSON.parse(BUNDLER_MAKER_LOOKUP));
package/src/helpers.js CHANGED
@@ -1,5 +1,7 @@
1
1
  // @ts-check
2
- import '@agoric/zoe/exported.js';
2
+
3
+ /// <reference path="../../zoe/exported.js" />
4
+
3
5
  import { E } from '@endo/far';
4
6
  import bundleSource from '@endo/bundle-source';
5
7
 
@@ -15,7 +17,7 @@ import { makeSaveIssuer } from './saveIssuer.js';
15
17
  import { makeGetBundlerMaker } from './getBundlerMaker.js';
16
18
  import { assertOfferResult } from './assertOfferResult.js';
17
19
  import { installInPieces } from './installInPieces.js';
18
- import { makeWriteCoreProposal } from './writeCoreProposal.js';
20
+ import { makeWriteCoreEval } from './writeCoreEvalParts.js';
19
21
 
20
22
  export * from '@agoric/internal/src/node/createBundles.js';
21
23
 
@@ -135,8 +137,16 @@ export const makeHelpers = async (homePromise, endowments) => {
135
137
  get getBundlerMaker() {
136
138
  return makeGetBundlerMaker(homePromise, { bundleSource, lookup });
137
139
  },
140
+ /** @returns {import('./writeCoreEvalParts.js').WriteCoreEval} */
141
+ get writeCoreEval() {
142
+ return makeWriteCoreEval(homePromise, endowments, {
143
+ getBundleSpec: deps.cacheAndGetBundleSpec,
144
+ getBundlerMaker: helpers.getBundlerMaker,
145
+ });
146
+ },
147
+ /** @deprecated use writeCoreEval */
138
148
  get writeCoreProposal() {
139
- return makeWriteCoreProposal(homePromise, endowments, {
149
+ return makeWriteCoreEval(homePromise, endowments, {
140
150
  getBundleSpec: deps.cacheAndGetBundleSpec,
141
151
  getBundlerMaker: helpers.getBundlerMaker,
142
152
  });
package/src/install.js CHANGED
@@ -3,20 +3,11 @@ import './externalTypes.js';
3
3
 
4
4
  import { E } from '@endo/far';
5
5
 
6
- /** @typedef {import('@agoric/deploy-script-support/src/externalTypes').Petname} Petname */
7
-
8
- /**
9
- * @callback BundleSource
10
- * @param {string} startFilename - the filepath to start the bundling from
11
- * @param {ModuleFormat | BundleOptions} [moduleFormat]
12
- * @param {object} [powers]
13
- * @param {ReadFn} [powers.read]
14
- * @param {CanonicalFn} [powers.canonical]
15
- */
6
+ /** @import {Petname} from '@agoric/deploy-script-support/src/externalTypes.js' */
16
7
 
17
8
  // XXX board is Board but specifying that leads to type errors with imports which aren't worth fixing right now
18
9
  /**
19
- * @param {BundleSource} bundleSource
10
+ * @param {typeof import('@endo/bundle-source')['default']} bundleSource
20
11
  * @param {ERef<ZoeService>} zoe
21
12
  * @param {ERef<import('./startInstance.js').InstallationManager>} installationManager
22
13
  * @param {ERef<any>} board
package/src/offer.js CHANGED
@@ -4,7 +4,7 @@ import { assert } from '@agoric/assert';
4
4
  // Avoid pulling in too many dependencies like notifiers
5
5
  import { AmountMath } from '@agoric/ertp/src/amountMath.js';
6
6
 
7
- /** @typedef {import('@agoric/deploy-script-support/src/externalTypes').Petname} Petname */
7
+ /** @import {Petname} from '@agoric/deploy-script-support/src/externalTypes.js' */
8
8
 
9
9
  /**
10
10
  * @typedef {object} OfferHelperConfig
@@ -19,7 +19,7 @@ import { AmountMath } from '@agoric/ertp/src/amountMath.js';
19
19
  * @param {ERef<any>} walletAdmin - an internal type of the
20
20
  * wallet, not defined here
21
21
  * @param {ERef<ZoeService>} zoe
22
- * @param {ERef<Purse>} zoeInvitationPurse
22
+ * @param {ERef<Purse<'set', InvitationDetails>>} zoeInvitationPurse
23
23
  */
24
24
  export const makeOfferAndFindInvitationAmount = (
25
25
  walletAdmin,
@@ -28,7 +28,7 @@ export const makeOfferAndFindInvitationAmount = (
28
28
  ) => {
29
29
  /**
30
30
  * @param {Record<string, any>} invitationDetailsCriteria
31
- * @returns {Promise<Amount>} invitationAmount
31
+ * @returns {Promise<InvitationAmount>} invitationAmount
32
32
  */
33
33
  const findInvitationAmount = async invitationDetailsCriteria => {
34
34
  const invitationAmount = await E(zoeInvitationPurse).getCurrentAmount();
@@ -114,9 +114,8 @@ export const makeOfferAndFindInvitationAmount = (
114
114
  } = config;
115
115
 
116
116
  const invitationToUse = getInvitation(invitation, partialInvitationDetails);
117
- const invitationDetails = await E(zoe).getInvitationDetails(
118
- invitationToUse,
119
- );
117
+ const invitationDetails =
118
+ await E(zoe).getInvitationDetails(invitationToUse);
120
119
  const payments = withdrawPayments(proposal, paymentsWithPursePetnames);
121
120
 
122
121
  const seat = E(zoe).offer(invitationToUse, proposal, payments);
package/src/saveIssuer.js CHANGED
@@ -1,12 +1,12 @@
1
1
  // @ts-check
2
2
  import { E } from '@endo/far';
3
3
 
4
- /** @typedef {import('@agoric/deploy-script-support/src/externalTypes').Petname} Petname */
4
+ /** @import {Petname} from '@agoric/deploy-script-support/src/externalTypes.js' */
5
5
 
6
6
  /**
7
7
  * @param {ERef<any>} walletAdmin - an internal type of the
8
8
  * wallet, not defined here
9
- * @param {ERef<import('./startInstance').IssuerManager>} issuerManager
9
+ * @param {ERef<import('./startInstance.js').IssuerManager>} issuerManager
10
10
  */
11
11
  export const makeSaveIssuer = (walletAdmin, issuerManager) => {
12
12
  /**
@@ -2,7 +2,7 @@
2
2
  import { assert } from '@agoric/assert';
3
3
  import { E, passStyleOf } from '@endo/far';
4
4
 
5
- /** @typedef {import('@agoric/deploy-script-support/src/externalTypes').Petname} Petname */
5
+ /** @import {Petname} from '@agoric/deploy-script-support/src/externalTypes.js' */
6
6
 
7
7
  /**
8
8
  * @template T
@@ -100,9 +100,8 @@ export const makeStartInstance = (
100
100
  `creatorInvitation must be defined to be deposited`,
101
101
  );
102
102
  console.log(`-- Adding Invitation for: ${instancePetname}`);
103
- const invitationAmount = await E(zoeInvitationPurse).deposit(
104
- creatorInvitation,
105
- );
103
+ const invitationAmount =
104
+ await E(zoeInvitationPurse).deposit(creatorInvitation);
106
105
  console.log(`- Created Contract Instance: ${instancePetname}`);
107
106
 
108
107
  const creatorInvitationDetails = invitationAmount.value[0];