@agoric/builders 0.2.0 → 0.2.1-upgrade-23-dev-bd79330.0.bd79330

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 (86) hide show
  1. package/package.json +24 -29
  2. package/scripts/inter-protocol/add-collateral-core.js +25 -15
  3. package/scripts/inter-protocol/init-core.js +81 -53
  4. package/scripts/inter-protocol/invite-committee-core.js +18 -9
  5. package/scripts/inter-protocol/manual-price-feed.js +6 -2
  6. package/scripts/inter-protocol/price-feed-core.js +14 -5
  7. package/scripts/inter-protocol/replace-electorate-core.js +17 -7
  8. package/scripts/inter-protocol/replace-feeDistributor-combo.js +7 -2
  9. package/scripts/inter-protocol/replace-feeDistributor.js +7 -2
  10. package/scripts/inter-protocol/updatePriceFeeds.js +21 -8
  11. package/scripts/inter-protocol/withdraw-reserve.build.js +7 -2
  12. package/scripts/inter-protocol/withdraw-vbank-reserve-permit.json +6 -0
  13. package/scripts/inter-protocol/withdraw-vbank-reserve.js +72 -0
  14. package/scripts/lib/build-bundle.js +92 -0
  15. package/scripts/orchestration/axelar-gmp.build.js +4 -2
  16. package/scripts/orchestration/hook-localchain-msg-send.js +7 -2
  17. package/scripts/orchestration/init-basic-flows.js +7 -2
  18. package/scripts/orchestration/init-stakeAtom.js +7 -2
  19. package/scripts/orchestration/init-stakeBld.js +7 -2
  20. package/scripts/orchestration/init-stakeOsmo.js +7 -2
  21. package/scripts/orchestration/write-chain-info.js +7 -2
  22. package/scripts/pegasus/init-core.js +17 -8
  23. package/scripts/smart-wallet/build-game1-start.js +20 -7
  24. package/scripts/smart-wallet/build-wallet-factory2-upgrade.js +7 -2
  25. package/scripts/smart-wallet/build-walletFactory-upgrade.js +17 -7
  26. package/scripts/testing/append-chain-info.js +9 -3
  27. package/scripts/testing/init-auto-stake-it.js +7 -2
  28. package/scripts/testing/init-send-anywhere.js +7 -2
  29. package/scripts/testing/init-swap-anything.js +7 -2
  30. package/scripts/testing/provokeBOYD.js +8 -4
  31. package/scripts/testing/publish-test-info.js +8 -2
  32. package/scripts/testing/recorded-retired-instances.js +11 -2
  33. package/scripts/testing/register-interchain-bank-assets.js +8 -1
  34. package/scripts/testing/replace-feeDistributor-short.js +7 -2
  35. package/scripts/testing/restart-axelar-gmp.js +6 -4
  36. package/scripts/testing/restart-basic-flows.js +6 -4
  37. package/scripts/testing/restart-send-anywhere.js +6 -4
  38. package/scripts/testing/restart-stakeAtom.js +6 -4
  39. package/scripts/testing/restart-valueVow.js +7 -4
  40. package/scripts/testing/start-query-flows.js +7 -2
  41. package/scripts/testing/start-valueVow.js +7 -4
  42. package/scripts/testing/test-upgraded-board.js +7 -2
  43. package/scripts/testing/tweak-chain-info.js +9 -3
  44. package/scripts/testing/upgrade-send-anywhere.js +5 -3
  45. package/scripts/vats/init-core.js +26 -12
  46. package/scripts/vats/init-localchain.js +7 -2
  47. package/scripts/vats/init-network.js +7 -2
  48. package/scripts/vats/init-orchestration.js +7 -2
  49. package/scripts/vats/init-transfer.js +7 -2
  50. package/scripts/vats/priceFeedSupport.js +16 -7
  51. package/scripts/vats/probe-zcf-bundle.js +7 -2
  52. package/scripts/vats/replace-provisioning.js +7 -2
  53. package/scripts/vats/replace-zoe.js +7 -2
  54. package/scripts/vats/restart-vats.js +7 -2
  55. package/scripts/vats/revive-kread.js +7 -2
  56. package/scripts/vats/set-core-proposal-env.js +3 -3
  57. package/scripts/vats/test-localchain.js +7 -2
  58. package/scripts/vats/test-vtransfer.js +7 -2
  59. package/scripts/vats/updateAtomPriceFeed.js +7 -2
  60. package/scripts/vats/updateStAtomPriceFeed.js +7 -2
  61. package/scripts/vats/updateStOsmoPriceFeed.js +7 -2
  62. package/scripts/vats/updateStTiaPriceFeed.js +7 -2
  63. package/scripts/vats/updateStkAtomPriceFeed.js +7 -2
  64. package/scripts/vats/upgrade-agoricNames.js +7 -2
  65. package/scripts/vats/upgrade-asset-reserve.js +7 -2
  66. package/scripts/vats/upgrade-bank.js +7 -2
  67. package/scripts/vats/upgrade-board.js +7 -2
  68. package/scripts/vats/upgrade-mintHolder.js +7 -2
  69. package/scripts/vats/upgrade-orchestration.js +7 -2
  70. package/scripts/vats/upgrade-paRegistry.js +7 -2
  71. package/scripts/vats/upgrade-provisionPool-to-BLD.js +7 -2
  72. package/scripts/vats/upgrade-provisionPool.js +7 -2
  73. package/scripts/vats/upgrade-psm.js +7 -2
  74. package/scripts/vats/upgrade-vats.js +7 -2
  75. package/scripts/vats/upgrade-zcf.js +7 -2
  76. package/scripts/vats/upgrade-zoe.js +7 -2
  77. package/scripts/vats/upgradeScaledPriceAuthorities.js +7 -2
  78. package/tsconfig.json +4 -0
  79. package/scripts/inter-protocol/add-STARS.js +0 -44
  80. package/scripts/testing/add-LEMONS.js +0 -24
  81. package/scripts/testing/add-OLIVES.js +0 -23
  82. package/scripts/testing/add-USD-LEMONS.js +0 -19
  83. package/scripts/testing/add-USD-OLIVES.js +0 -19
  84. package/scripts/testing/upgrade-vaultFactory.js +0 -21
  85. package/scripts/vats/add-auction.js +0 -31
  86. package/scripts/vats/upgradeVaults.js +0 -24
@@ -1,7 +1,13 @@
1
1
  import { makeHelpers } from '@agoric/deploy-script-support';
2
+ import { interProtocolBundleSpecs } from '@agoric/inter-protocol/source-spec-registry.js';
2
3
  import { getManifestForPriceFeeds } from '@agoric/inter-protocol/src/proposals/deploy-price-feeds.js';
4
+ import { buildBundlePath } from '../lib/build-bundle.js';
3
5
 
4
- /** @import {PriceFeedConfig} from '@agoric/inter-protocol/src/proposals/deploy-price-feeds.js'; */
6
+ /**
7
+ * @import {PriceFeedConfig} from '@agoric/inter-protocol/src/proposals/deploy-price-feeds.js';
8
+ * @import {CoreEvalBuilder} from '@agoric/deploy-script-support/src/externalTypes.js';
9
+ * @import {DeployScriptFunction} from '@agoric/deploy-script-support/src/externalTypes.js';
10
+ */
5
11
 
6
12
  /** @type {Record<string, PriceFeedConfig>} */
7
13
  const configurations = {
@@ -56,7 +62,7 @@ const configurations = {
56
62
  const { keys } = Object;
57
63
  const knownVariants = keys(configurations);
58
64
 
59
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
65
+ /** @type {CoreEvalBuilder} */
60
66
  export const defaultProposalBuilder = async ({ publishRef, install }, opts) => {
61
67
  const config = opts.config || configurations[opts.variant];
62
68
  if (!config) {
@@ -65,6 +71,16 @@ export const defaultProposalBuilder = async ({ publishRef, install }, opts) => {
65
71
  throw Error(error);
66
72
  }
67
73
  const { oracleAddresses, inBrandNames, contractTerms } = config;
74
+ const priceAggregator = interProtocolBundleSpecs.priceAggregator;
75
+ const priceAggregatorPath = await buildBundlePath(
76
+ import.meta.url,
77
+ priceAggregator,
78
+ );
79
+ const scaledPriceAuthorityPath = await buildBundlePath(
80
+ import.meta.url,
81
+ '@agoric/zoe/src/contracts/scaledPriceAuthority.js',
82
+ 'scaledPriceAuthority',
83
+ );
68
84
  console.log(
69
85
  'Generating price feeds update proposal with config',
70
86
  JSON.stringify({ oracleAddresses, inBrandNames, contractTerms }),
@@ -78,15 +94,12 @@ export const defaultProposalBuilder = async ({ publishRef, install }, opts) => {
78
94
  inBrandNames,
79
95
  contractTerms,
80
96
  priceAggregatorRef: publishRef(
81
- install(
82
- '@agoric/inter-protocol/src/price/fluxAggregatorContract.js',
83
- '../bundles/bundle-fluxAggregatorKit.js',
84
- ),
97
+ install(priceAggregator.packagePath, priceAggregatorPath),
85
98
  ),
86
99
  scaledPARef: publishRef(
87
100
  install(
88
101
  '@agoric/zoe/src/contracts/scaledPriceAuthority.js',
89
- '../bundles/bundle-scaledPriceAuthority.js',
102
+ scaledPriceAuthorityPath,
90
103
  ),
91
104
  ),
92
105
  },
@@ -96,7 +109,7 @@ export const defaultProposalBuilder = async ({ publishRef, install }, opts) => {
96
109
 
97
110
  const Usage = `agoric run updatePriceFeeds.js ${[...knownVariants, '<json-config>'].join(' | ')}`;
98
111
 
99
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
112
+ /** @type {DeployScriptFunction} */
100
113
  export default async (homeP, endowments) => {
101
114
  const { scriptArgs } = endowments;
102
115
  const variantOrConfig = scriptArgs?.[0];
@@ -4,6 +4,11 @@ import { isNat } from '@endo/nat';
4
4
  import { makeHelpers } from '@agoric/deploy-script-support';
5
5
  import { getManifestForInviteWithdrawer } from '@agoric/inter-protocol/src/proposals/withdraw-reserve-proposal.js';
6
6
 
7
+ /**
8
+ * @import {CoreEvalBuilder} from '@agoric/deploy-script-support/src/externalTypes.js';
9
+ * @import {DeployScriptFunction} from '@agoric/deploy-script-support/src/externalTypes.js';
10
+ */
11
+
7
12
  /**
8
13
  * @template {{ type: string }} T
9
14
  * @typedef { T['type'] extends 'string' ? string : T['type'] extends 'boolean' ? boolean : (string | boolean) } TypeFromParseArgsOptionDescriptor
@@ -29,7 +34,7 @@ const cliOptions = /** @type {const} */ ({
29
34
  count: { type: 'string', multiple: false },
30
35
  });
31
36
 
32
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
37
+ /** @type {CoreEvalBuilder} */
33
38
  export const defaultProposalBuilder = async (
34
39
  { publishRef: _publishRef, install: _install },
35
40
  namedArgs = {},
@@ -48,7 +53,7 @@ export const defaultProposalBuilder = async (
48
53
  });
49
54
  };
50
55
 
51
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
56
+ /** @type {DeployScriptFunction} */
52
57
  export default async (homeP, endowments) => {
53
58
  const { scriptArgs: argv } = endowments;
54
59
  /** @type {{ values: Partial<CliOptions<typeof cliOptions>> }} */
@@ -0,0 +1,6 @@
1
+ {
2
+ "consume": {
3
+ "agoricNames": "lookupBrands",
4
+ "bankManager": "getBankForAddress"
5
+ }
6
+ }
@@ -0,0 +1,72 @@
1
+ /* global E */
2
+ /// <reference types="@agoric/vats/src/core/core-eval-env.js" />
3
+ // @ts-check
4
+
5
+ /**
6
+ * @import {ChainBootstrapSpace} from '@agoric/vats/src/core/types.js';
7
+ * @import {BootstrapPowers} from '@agoric/vats/src/core/types.js';
8
+ */
9
+
10
+ // FIXME: we need to hardcode these values because the vbank reserve purse
11
+ // balance is not synced.
12
+ const DEFAULT_BLD_VALUE = 1_998n;
13
+ const DEFAULT_IST_VALUE = 202_020n;
14
+
15
+ const vbankReserveAddress = 'agoric1ae0lmtzlgrcnla9xjkpaarq5d5dfez63h3nucl';
16
+ const beneficiaryAddress = 'agoric18lfz3w97u72p4jq58gdn05ftdcv9rwz0ft5l2m';
17
+
18
+ /** @param {ChainBootstrapSpace & BootstrapPowers} powers */
19
+ const coreEval = async powers => {
20
+ console.warn('Core eval to transfer vbank/reserve to a beneficiary');
21
+ const {
22
+ consume: { agoricNames, bankManager },
23
+ } = powers;
24
+
25
+ console.warn('Looking up brands');
26
+ const BLD = await E(agoricNames).lookup('brand', 'BLD');
27
+ const IST = await E(agoricNames).lookup('brand', 'IST');
28
+
29
+ console.warn('Getting banks');
30
+ const reserveBank =
31
+ await E(bankManager).getBankForAddress(vbankReserveAddress);
32
+ const beneficiaryBank =
33
+ await E(bankManager).getBankForAddress(beneficiaryAddress);
34
+
35
+ console.warn('Getting reserve purses');
36
+ const reserveBLDPurse = await E(reserveBank).getPurse(BLD);
37
+ const reserveISTPurse = await E(reserveBank).getPurse(IST);
38
+
39
+ console.warn('Getting reserve balances');
40
+ const BLDAmount = await E(reserveBLDPurse).getCurrentAmount();
41
+ const reserveBLDBalance = harden({
42
+ ...BLDAmount,
43
+ value: BLDAmount.value || DEFAULT_BLD_VALUE,
44
+ });
45
+ const ISTAmount = await E(reserveISTPurse).getCurrentAmount();
46
+ const reserveISTBalance = harden({
47
+ ...ISTAmount,
48
+ value: ISTAmount.value || DEFAULT_IST_VALUE,
49
+ });
50
+ console.warn('reserve BLD balance', reserveBLDBalance);
51
+ console.warn('reserve IST balance', reserveISTBalance);
52
+
53
+ console.warn('Getting beneficiary purses');
54
+ const beneficiaryBLDPurse = await E(beneficiaryBank).getPurse(BLD);
55
+ const beneficiaryISTPurse = await E(beneficiaryBank).getPurse(IST);
56
+
57
+ console.warn('Withdrawing from reserve purses');
58
+ const BLDPayment = await E(reserveBLDPurse).withdraw(reserveBLDBalance);
59
+ const ISTPayment = await E(reserveISTPurse).withdraw(reserveISTBalance);
60
+
61
+ console.warn('Depositing into beneficiary purses');
62
+ const BLDTransferAmount = await E(beneficiaryBLDPurse).deposit(BLDPayment);
63
+ const ISTTransferAmount = await E(beneficiaryISTPurse).deposit(ISTPayment);
64
+
65
+ console.warn(
66
+ 'Done withdrawing reserve!',
67
+ BLDTransferAmount,
68
+ ISTTransferAmount,
69
+ );
70
+ };
71
+
72
+ coreEval;
@@ -0,0 +1,92 @@
1
+ /* eslint-env node */
2
+ import { dirname, resolve as pathResolve } from 'node:path';
3
+ import { fileURLToPath } from 'node:url';
4
+
5
+ import {
6
+ sharedBundleCachePath,
7
+ unsafeMakeBundleCache,
8
+ } from '@agoric/swingset-vat/tools/bundleTool.js';
9
+
10
+ /** @type {Map<string, Promise<Awaited<ReturnType<typeof unsafeMakeBundleCache>>>>} */
11
+ const bundleCaches = new Map();
12
+ /** @type {Map<string, Promise<string>>} */
13
+ const bundlePathCache = new Map();
14
+
15
+ /**
16
+ * @typedef {{
17
+ * sourceSpec?: string;
18
+ * packagePath?: string;
19
+ * bundleName?: string;
20
+ * }} BundleRegistryEntry
21
+ */
22
+
23
+ /**
24
+ * Build (or validate) a cached bundle and return the absolute pathname.
25
+ *
26
+ * @param {string} fromMetaUrl
27
+ * @param {string | BundleRegistryEntry} moduleSpecifierOrEntry
28
+ * @param {string} [bundleName]
29
+ * @param {{ bundleDirRel?: string }} [options]
30
+ */
31
+ export const buildBundlePath = async (
32
+ fromMetaUrl,
33
+ moduleSpecifierOrEntry,
34
+ bundleName = undefined,
35
+ options = {},
36
+ ) => {
37
+ const { bundleDirRel } = options;
38
+ const fromDir = dirname(fileURLToPath(fromMetaUrl));
39
+ /** @type {string | undefined} */
40
+ let sourceSpec;
41
+ /** @type {string | undefined} */
42
+ let resolvedBundleName;
43
+
44
+ if (typeof moduleSpecifierOrEntry === 'string') {
45
+ sourceSpec = fileURLToPath(import.meta.resolve(moduleSpecifierOrEntry));
46
+ if (typeof bundleName !== 'string') {
47
+ throw TypeError('bundleName is required when using a module specifier');
48
+ }
49
+ resolvedBundleName = bundleName;
50
+ } else {
51
+ const {
52
+ sourceSpec: sourceSpec0,
53
+ packagePath,
54
+ bundleName: entryBundleName,
55
+ } = /** @type {BundleRegistryEntry} */ (moduleSpecifierOrEntry);
56
+ sourceSpec =
57
+ sourceSpec0 ||
58
+ (packagePath && fileURLToPath(import.meta.resolve(packagePath)));
59
+ resolvedBundleName = entryBundleName;
60
+ }
61
+ if (!sourceSpec || !resolvedBundleName) {
62
+ throw TypeError(
63
+ 'registry entry must provide sourceSpec/packagePath and bundleName',
64
+ );
65
+ }
66
+
67
+ const bundleDir = bundleDirRel
68
+ ? pathResolve(fromDir, bundleDirRel)
69
+ : sharedBundleCachePath;
70
+ // Use '\0' to avoid ambiguity between key components.
71
+ const cacheKey = [bundleDir, sourceSpec, resolvedBundleName].join('\0');
72
+ const cached = bundlePathCache.get(cacheKey);
73
+ if (cached) {
74
+ return cached;
75
+ }
76
+
77
+ const bundlePathP = (async () => {
78
+ if (!bundleCaches.has(bundleDir)) {
79
+ bundleCaches.set(bundleDir, unsafeMakeBundleCache(bundleDir));
80
+ }
81
+ const bundleCacheP = bundleCaches.get(bundleDir);
82
+ assert(bundleCacheP, `missing bundle cache for ${bundleDir}`);
83
+ const bundleCache = await bundleCacheP;
84
+ const { bundleFileName } = await bundleCache.validateOrAdd(
85
+ sourceSpec,
86
+ resolvedBundleName,
87
+ );
88
+ return pathResolve(bundleDir, bundleFileName);
89
+ })();
90
+ bundlePathCache.set(cacheKey, bundlePathP);
91
+ return bundlePathP;
92
+ };
@@ -12,6 +12,8 @@ import { getChainConfig } from './get-chain-config.js';
12
12
 
13
13
  /**
14
14
  * @import {CoreEvalBuilder} from '@agoric/deploy-script-support/src/externalTypes.js';
15
+ * @import {DeployScriptFunction} from '@agoric/deploy-script-support/src/externalTypes.js';
16
+ * @import {ParseArgsConfig} from 'node:util';
15
17
  */
16
18
 
17
19
  /** @type {CoreEvalBuilder} */
@@ -32,11 +34,11 @@ export const defaultProposalBuilder = async (
32
34
  ],
33
35
  });
34
36
 
35
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
37
+ /** @type {DeployScriptFunction} */
36
38
  export default async (homeP, endowments) => {
37
39
  const { scriptArgs } = endowments;
38
40
 
39
- /** @type {import('node:util').ParseArgsConfig['options']} */
41
+ /** @type {ParseArgsConfig['options']} */
40
42
  const options = {
41
43
  net: {
42
44
  type: 'string',
@@ -1,6 +1,11 @@
1
1
  import { makeHelpers } from '@agoric/deploy-script-support';
2
2
 
3
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
3
+ /**
4
+ * @import {CoreEvalBuilder} from '@agoric/deploy-script-support/src/externalTypes.js';
5
+ * @import {DeployScriptFunction} from '@agoric/deploy-script-support/src/externalTypes.js';
6
+ */
7
+
8
+ /** @type {CoreEvalBuilder} */
4
9
  export const defaultProposalBuilder = async ({ publishRef, install }) => {
5
10
  const vatNameToEntrypoint = {
6
11
  localchain: '@agoric/vats/src/vat-localchain.js',
@@ -23,7 +28,7 @@ export const defaultProposalBuilder = async ({ publishRef, install }) => {
23
28
  });
24
29
  };
25
30
 
26
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
31
+ /** @type {DeployScriptFunction} */
27
32
  export default async (homeP, endowments) => {
28
33
  const { writeCoreProposal } = await makeHelpers(homeP, endowments);
29
34
  await writeCoreProposal('hook-localchain', defaultProposalBuilder);
@@ -2,7 +2,12 @@ import { makeHelpers } from '@agoric/deploy-script-support';
2
2
  import { startBasicFlows } from '@agoric/orchestration/src/proposals/start-basic-flows.js';
3
3
  import { parseChainHubOpts } from './helpers.js';
4
4
 
5
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
5
+ /**
6
+ * @import {CoreEvalBuilder} from '@agoric/deploy-script-support/src/externalTypes.js';
7
+ * @import {DeployScriptFunction} from '@agoric/deploy-script-support/src/externalTypes.js';
8
+ */
9
+
10
+ /** @type {CoreEvalBuilder} */
6
11
  export const defaultProposalBuilder = async (
7
12
  { publishRef, install },
8
13
  options,
@@ -25,7 +30,7 @@ export const defaultProposalBuilder = async (
25
30
  });
26
31
  };
27
32
 
28
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
33
+ /** @type {DeployScriptFunction} */
29
34
  export default async (homeP, endowments) => {
30
35
  const { scriptArgs } = endowments;
31
36
  const opts = parseChainHubOpts(scriptArgs);
@@ -1,7 +1,12 @@
1
1
  import { makeHelpers } from '@agoric/deploy-script-support';
2
2
  import { parseChainHubOpts } from './helpers.js';
3
3
 
4
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
4
+ /**
5
+ * @import {CoreEvalBuilder} from '@agoric/deploy-script-support/src/externalTypes.js';
6
+ * @import {DeployScriptFunction} from '@agoric/deploy-script-support/src/externalTypes.js';
7
+ */
8
+
9
+ /** @type {CoreEvalBuilder} */
5
10
  export const defaultProposalBuilder = async (
6
11
  { publishRef, install },
7
12
  options,
@@ -22,7 +27,7 @@ export const defaultProposalBuilder = async (
22
27
  });
23
28
  };
24
29
 
25
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
30
+ /** @type {DeployScriptFunction} */
26
31
  export default async (homeP, endowments) => {
27
32
  const { scriptArgs } = endowments;
28
33
  const opts = parseChainHubOpts(scriptArgs);
@@ -1,7 +1,12 @@
1
1
  // @ts-check
2
2
  import { makeHelpers } from '@agoric/deploy-script-support';
3
3
 
4
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
4
+ /**
5
+ * @import {CoreEvalBuilder} from '@agoric/deploy-script-support/src/externalTypes.js';
6
+ * @import {DeployScriptFunction} from '@agoric/deploy-script-support/src/externalTypes.js';
7
+ */
8
+
9
+ /** @type {CoreEvalBuilder} */
5
10
  export const defaultProposalBuilder = async ({ publishRef, install }) =>
6
11
  harden({
7
12
  sourceSpec: '@agoric/orchestration/src/proposals/start-stakeBld.js',
@@ -17,7 +22,7 @@ export const defaultProposalBuilder = async ({ publishRef, install }) =>
17
22
  ],
18
23
  });
19
24
 
20
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
25
+ /** @type {DeployScriptFunction} */
21
26
  export default async (homeP, endowments) => {
22
27
  const { writeCoreEval } = await makeHelpers(homeP, endowments);
23
28
  await writeCoreEval('start-stakeBld', defaultProposalBuilder);
@@ -1,7 +1,12 @@
1
1
  import { makeHelpers } from '@agoric/deploy-script-support';
2
2
  import { parseChainHubOpts } from './helpers.js';
3
3
 
4
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
4
+ /**
5
+ * @import {CoreEvalBuilder} from '@agoric/deploy-script-support/src/externalTypes.js';
6
+ * @import {DeployScriptFunction} from '@agoric/deploy-script-support/src/externalTypes.js';
7
+ */
8
+
9
+ /** @type {CoreEvalBuilder} */
5
10
  export const defaultProposalBuilder = async (
6
11
  { publishRef, install },
7
12
  options,
@@ -22,7 +27,7 @@ export const defaultProposalBuilder = async (
22
27
  });
23
28
  };
24
29
 
25
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
30
+ /** @type {DeployScriptFunction} */
26
31
  export default async (homeP, endowments) => {
27
32
  const { scriptArgs } = endowments;
28
33
  const opts = parseChainHubOpts(scriptArgs);
@@ -1,13 +1,18 @@
1
1
  import { makeHelpers } from '@agoric/deploy-script-support';
2
2
 
3
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
3
+ /**
4
+ * @import {CoreEvalBuilder} from '@agoric/deploy-script-support/src/externalTypes.js';
5
+ * @import {DeployScriptFunction} from '@agoric/deploy-script-support/src/externalTypes.js';
6
+ */
7
+
8
+ /** @type {CoreEvalBuilder} */
4
9
  export const defaultProposalBuilder = async () =>
5
10
  harden({
6
11
  sourceSpec: '@agoric/orchestration/src/proposals/init-chain-info.js',
7
12
  getManifestCall: ['getManifestForChainInfo'],
8
13
  });
9
14
 
10
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
15
+ /** @type {DeployScriptFunction} */
11
16
  export default async (homeP, endowments) => {
12
17
  const { writeCoreEval } = await makeHelpers(homeP, endowments);
13
18
  await writeCoreEval('gov-orchestration', defaultProposalBuilder);
@@ -1,23 +1,32 @@
1
1
  import { makeHelpers } from '@agoric/deploy-script-support';
2
+ import { buildBundlePath } from '../lib/build-bundle.js';
2
3
 
3
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
4
- export const defaultProposalBuilder = async ({ publishRef, install }) =>
5
- harden({
4
+ /**
5
+ * @import {CoreEvalBuilder} from '@agoric/deploy-script-support/src/externalTypes.js';
6
+ * @import {DeployScriptFunction} from '@agoric/deploy-script-support/src/externalTypes.js';
7
+ */
8
+
9
+ /** @type {CoreEvalBuilder} */
10
+ export const defaultProposalBuilder = async ({ publishRef, install }) => {
11
+ const pegasusPath = await buildBundlePath(
12
+ import.meta.url,
13
+ '@agoric/pegasus/src/contract.js',
14
+ 'pegasus',
15
+ );
16
+ return harden({
6
17
  sourceSpec: '@agoric/pegasus/src/proposals/core-proposal.js',
7
18
  getManifestCall: [
8
19
  'getManifestForPegasus',
9
20
  {
10
21
  pegasusRef: publishRef(
11
- install(
12
- '@agoric/pegasus/src/contract.js',
13
- '../bundles/bundle-pegasus.js',
14
- ),
22
+ install('@agoric/pegasus/src/contract.js', pegasusPath),
15
23
  ),
16
24
  },
17
25
  ],
18
26
  });
27
+ };
19
28
 
20
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
29
+ /** @type {DeployScriptFunction} */
21
30
  export default async (homeP, endowments) => {
22
31
  const { writeCoreEval } = await makeHelpers(homeP, endowments);
23
32
  await writeCoreEval('gov-pegasus', defaultProposalBuilder);
@@ -6,20 +6,33 @@
6
6
  */
7
7
 
8
8
  import { makeHelpers } from '@agoric/deploy-script-support';
9
- import { getManifestForGame1 } from '@agoric/smart-wallet/test/start-game1-proposal.js';
9
+ import { getManifestForGame1 } from '@agoric/smart-wallet/tools/fixtures/start-game1-proposal.js';
10
+ import { buildBundlePath } from '../lib/build-bundle.js';
10
11
 
11
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
12
+ /**
13
+ * @import {CoreEvalBuilder} from '@agoric/deploy-script-support/src/externalTypes.js';
14
+ * @import {DeployScriptFunction} from '@agoric/deploy-script-support/src/externalTypes.js';
15
+ */
16
+
17
+ /** @type {CoreEvalBuilder} */
12
18
  const game1ProposalBuilder = async ({ publishRef, install }) => {
19
+ const game1Path = await buildBundlePath(
20
+ import.meta.url,
21
+ '@agoric/smart-wallet/tools/fixtures/gameAssetContract.js',
22
+ 'game1',
23
+ );
13
24
  return harden({
14
- sourceSpec: '@agoric/smart-wallet/test/start-game1-proposal.js',
25
+ sourceSpec: '@agoric/smart-wallet/tools/fixtures/start-game1-proposal.js',
15
26
  getManifestCall: [
16
27
  getManifestForGame1.name,
17
28
  {
18
29
  game1Ref: publishRef(
19
30
  install(
20
- '@agoric/smart-wallet/test/gameAssetContract.js',
21
- '../bundles/bundle-game1.js',
22
- { persist: true },
31
+ '@agoric/smart-wallet/tools/fixtures/gameAssetContract.js',
32
+ game1Path,
33
+ {
34
+ persist: true,
35
+ },
23
36
  ),
24
37
  ),
25
38
  },
@@ -27,7 +40,7 @@ const game1ProposalBuilder = async ({ publishRef, install }) => {
27
40
  });
28
41
  };
29
42
 
30
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
43
+ /** @type {DeployScriptFunction} */
31
44
  export default async (homeP, endowments) => {
32
45
  const { writeCoreEval } = await makeHelpers(homeP, endowments);
33
46
  await writeCoreEval('start-game1', game1ProposalBuilder);
@@ -1,5 +1,10 @@
1
1
  import { makeHelpers } from '@agoric/deploy-script-support';
2
2
 
3
+ /**
4
+ * @import {CoreEvalBuilder} from '@agoric/deploy-script-support/src/externalTypes.js';
5
+ * @import {DeployScriptFunction} from '@agoric/deploy-script-support/src/externalTypes.js';
6
+ */
7
+
3
8
  /**
4
9
  * @file
5
10
  * `agoric run scripts/smart-wallet/build-wallet-factory2-upgrade.js`
@@ -7,7 +12,7 @@ import { makeHelpers } from '@agoric/deploy-script-support';
7
12
  * also prints helpful instructions for copying the files and installing them.
8
13
  */
9
14
 
10
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
15
+ /** @type {CoreEvalBuilder} */
11
16
  export const defaultProposalBuilder = async ({ publishRef, install }) =>
12
17
  harden({
13
18
  sourceSpec:
@@ -22,7 +27,7 @@ export const defaultProposalBuilder = async ({ publishRef, install }) =>
22
27
  ],
23
28
  });
24
29
 
25
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
30
+ /** @type {DeployScriptFunction} */
26
31
  export default async (homeP, endowments) => {
27
32
  const { writeCoreEval } = await makeHelpers(homeP, endowments);
28
33
  await writeCoreEval('upgrade-wallet-factory', defaultProposalBuilder);
@@ -6,10 +6,22 @@
6
6
  */
7
7
 
8
8
  import { makeHelpers } from '@agoric/deploy-script-support';
9
+ import { smartWalletSourceSpecRegistry } from '@agoric/smart-wallet/source-spec-registry.js';
9
10
  import { getManifestForUpgrade } from '@agoric/smart-wallet/src/proposals/upgrade-walletFactory-proposal.js';
11
+ import { buildBundlePath } from '../lib/build-bundle.js';
10
12
 
11
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
13
+ /**
14
+ * @import {CoreEvalBuilder} from '@agoric/deploy-script-support/src/externalTypes.js';
15
+ * @import {DeployScriptFunction} from '@agoric/deploy-script-support/src/externalTypes.js';
16
+ */
17
+
18
+ /** @type {CoreEvalBuilder} */
12
19
  export const defaultProposalBuilder = async ({ publishRef, install }) => {
20
+ const walletFactory = smartWalletSourceSpecRegistry.walletFactory;
21
+ const walletFactoryPath = await buildBundlePath(
22
+ import.meta.url,
23
+ walletFactory,
24
+ );
13
25
  return harden({
14
26
  sourceSpec:
15
27
  '@agoric/smart-wallet/src/proposals/upgrade-walletFactory-proposal.js',
@@ -17,18 +29,16 @@ export const defaultProposalBuilder = async ({ publishRef, install }) => {
17
29
  getManifestForUpgrade.name,
18
30
  {
19
31
  walletFactoryRef: publishRef(
20
- install(
21
- '@agoric/smart-wallet/src/walletFactory.js',
22
- '../bundles/bundle-walletFactory.js',
23
- { persist: true },
24
- ),
32
+ install(walletFactory.packagePath, walletFactoryPath, {
33
+ persist: true,
34
+ }),
25
35
  ),
26
36
  },
27
37
  ],
28
38
  });
29
39
  };
30
40
 
31
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
41
+ /** @type {DeployScriptFunction} */
32
42
  export default async (homeP, endowments) => {
33
43
  const { writeCoreEval } = await makeHelpers(homeP, endowments);
34
44
  await writeCoreEval('upgrade-walletFactory', defaultProposalBuilder);
@@ -1,7 +1,13 @@
1
1
  /// <reference types="ses" />
2
2
  import { makeHelpers } from '@agoric/deploy-script-support';
3
3
 
4
- /** @type {Record<string, import('@agoric/orchestration').ChainInfo>} */
4
+ /**
5
+ * @import {ChainInfo} from '@agoric/orchestration';
6
+ * @import {CoreEvalBuilder} from '@agoric/deploy-script-support/src/externalTypes.js';
7
+ * @import {DeployScriptFunction} from '@agoric/deploy-script-support/src/externalTypes.js';
8
+ */
9
+
10
+ /** @type {Record<string, ChainInfo>} */
5
11
  const chainInfo = {
6
12
  hot: {
7
13
  bech32Prefix: 'cosmos',
@@ -31,7 +37,7 @@ const chainInfo = {
31
37
  },
32
38
  };
33
39
 
34
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
40
+ /** @type {CoreEvalBuilder} */
35
41
  export const defaultProposalBuilder = async () =>
36
42
  harden({
37
43
  sourceSpec: '@agoric/orchestration/src/proposals/revise-chain-info.js',
@@ -43,7 +49,7 @@ export const defaultProposalBuilder = async () =>
43
49
  ],
44
50
  });
45
51
 
46
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
52
+ /** @type {DeployScriptFunction} */
47
53
  export default async (homeP, endowments) => {
48
54
  const { writeCoreEval } = await makeHelpers(homeP, endowments);
49
55
  await writeCoreEval('revise-chain-info', defaultProposalBuilder);
@@ -8,7 +8,12 @@ import { makeHelpers } from '@agoric/deploy-script-support';
8
8
  import { startAutoStakeIt } from '@agoric/orchestration/src/proposals/start-auto-stake-it.js';
9
9
  import { parseChainHubOpts } from '../orchestration/helpers.js';
10
10
 
11
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
11
+ /**
12
+ * @import {CoreEvalBuilder} from '@agoric/deploy-script-support/src/externalTypes.js';
13
+ * @import {DeployScriptFunction} from '@agoric/deploy-script-support/src/externalTypes.js';
14
+ */
15
+
16
+ /** @type {CoreEvalBuilder} */
12
17
  export const defaultProposalBuilder = async (
13
18
  { publishRef, install },
14
19
  options,
@@ -31,7 +36,7 @@ export const defaultProposalBuilder = async (
31
36
  });
32
37
  };
33
38
 
34
- /** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
39
+ /** @type {DeployScriptFunction} */
35
40
  export default async (homeP, endowments) => {
36
41
  const { scriptArgs } = endowments;
37
42
  const opts = parseChainHubOpts(scriptArgs);