agoric 0.21.2-dev-3b478fb.0 → 0.21.2-dev-8f9f075.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "agoric",
3
- "version": "0.21.2-dev-3b478fb.0+3b478fb",
3
+ "version": "0.21.2-dev-8f9f075.0+8f9f075",
4
4
  "description": "Manage the Agoric Javascript smart contract platform",
5
5
  "type": "module",
6
6
  "main": "src/main.js",
@@ -30,29 +30,29 @@
30
30
  "lint:eslint": "eslint ."
31
31
  },
32
32
  "devDependencies": {
33
- "@agoric/cosmic-swingset": "0.41.4-dev-3b478fb.0+3b478fb",
34
- "@agoric/deploy-script-support": "0.10.4-dev-3b478fb.0+3b478fb",
33
+ "@agoric/cosmic-swingset": "0.41.4-dev-8f9f075.0+8f9f075",
34
+ "@agoric/deploy-script-support": "0.10.4-dev-8f9f075.0+8f9f075",
35
35
  "ava": "^5.3.0",
36
36
  "c8": "^10.1.2",
37
37
  "dd-trace": "^4.11.1"
38
38
  },
39
39
  "dependencies": {
40
- "@agoric/access-token": "0.4.22-dev-3b478fb.0+3b478fb",
41
- "@agoric/cache": "0.3.3-dev-3b478fb.0+3b478fb",
42
- "@agoric/casting": "0.4.3-dev-3b478fb.0+3b478fb",
43
- "@agoric/client-utils": "0.1.1-dev-3b478fb.0+3b478fb",
44
- "@agoric/cosmic-proto": "0.4.1-dev-3b478fb.0+3b478fb",
45
- "@agoric/ertp": "0.16.3-dev-3b478fb.0+3b478fb",
46
- "@agoric/governance": "0.10.4-dev-3b478fb.0+3b478fb",
47
- "@agoric/inter-protocol": "0.16.2-dev-3b478fb.0+3b478fb",
48
- "@agoric/internal": "0.3.3-dev-3b478fb.0+3b478fb",
49
- "@agoric/network": "0.1.1-dev-3b478fb.0+3b478fb",
50
- "@agoric/smart-wallet": "0.5.4-dev-3b478fb.0+3b478fb",
51
- "@agoric/store": "0.9.3-dev-3b478fb.0+3b478fb",
52
- "@agoric/swingset-vat": "0.32.3-dev-3b478fb.0+3b478fb",
53
- "@agoric/vats": "0.15.2-dev-3b478fb.0+3b478fb",
54
- "@agoric/zoe": "0.26.3-dev-3b478fb.0+3b478fb",
55
- "@agoric/zone": "0.2.3-dev-3b478fb.0+3b478fb",
40
+ "@agoric/access-token": "0.4.22-dev-8f9f075.0+8f9f075",
41
+ "@agoric/cache": "0.3.3-dev-8f9f075.0+8f9f075",
42
+ "@agoric/casting": "0.4.3-dev-8f9f075.0+8f9f075",
43
+ "@agoric/client-utils": "0.1.1-dev-8f9f075.0+8f9f075",
44
+ "@agoric/cosmic-proto": "0.4.1-dev-8f9f075.0+8f9f075",
45
+ "@agoric/ertp": "0.16.3-dev-8f9f075.0+8f9f075",
46
+ "@agoric/governance": "0.10.4-dev-8f9f075.0+8f9f075",
47
+ "@agoric/inter-protocol": "0.16.2-dev-8f9f075.0+8f9f075",
48
+ "@agoric/internal": "0.3.3-dev-8f9f075.0+8f9f075",
49
+ "@agoric/network": "0.1.1-dev-8f9f075.0+8f9f075",
50
+ "@agoric/smart-wallet": "0.5.4-dev-8f9f075.0+8f9f075",
51
+ "@agoric/store": "0.9.3-dev-8f9f075.0+8f9f075",
52
+ "@agoric/swingset-vat": "0.32.3-dev-8f9f075.0+8f9f075",
53
+ "@agoric/vats": "0.15.2-dev-8f9f075.0+8f9f075",
54
+ "@agoric/zoe": "0.26.3-dev-8f9f075.0+8f9f075",
55
+ "@agoric/zone": "0.2.3-dev-8f9f075.0+8f9f075",
56
56
  "@confio/relayer": "^0.11.3",
57
57
  "@cosmjs/crypto": "^0.32.3",
58
58
  "@cosmjs/encoding": "^0.32.3",
@@ -103,5 +103,5 @@
103
103
  "typeCoverage": {
104
104
  "atLeast": 78.19
105
105
  },
106
- "gitHead": "3b478fb9e3fe7ded8dec1e83bab68760571f9071"
106
+ "gitHead": "8f9f07501c1e5f25103d0a015f2f2817275391f2"
107
107
  }
@@ -1,6 +1,10 @@
1
1
  // @ts-check
2
2
  /* eslint-env node */
3
- import { fetchEnvNetworkConfig, makeVstorageKit } from '@agoric/client-utils';
3
+ import {
4
+ fetchEnvNetworkConfig,
5
+ makeAgoricNames,
6
+ makeVstorageKit,
7
+ } from '@agoric/client-utils';
4
8
  import { Fail } from '@endo/errors';
5
9
  import { InvalidArgumentError } from 'commander';
6
10
  import { outputActionAndHint } from '../lib/wallet.js';
@@ -88,10 +92,11 @@ export const makeAuctionCommand = (
88
92
  * }} opts
89
93
  */
90
94
  async opts => {
91
- const { agoricNames, readPublished } = await makeVstorageKit(
95
+ const { readPublished, ...vsk } = makeVstorageKit(
92
96
  { fetch },
93
97
  networkConfig,
94
98
  );
99
+ const agoricNames = await makeAgoricNames(vsk.fromBoard, vsk.vstorage);
95
100
 
96
101
  const { current } = await readPublished(`auction.governance`);
97
102
 
@@ -1,7 +1,11 @@
1
1
  // @ts-check
2
2
  /* eslint-disable func-names */
3
3
  /* eslint-env node */
4
- import { fetchEnvNetworkConfig, makeVstorageKit } from '@agoric/client-utils';
4
+ import {
5
+ fetchEnvNetworkConfig,
6
+ makeAgoricNames,
7
+ makeVstorageKit,
8
+ } from '@agoric/client-utils';
5
9
  import { execFileSync as execFileSyncAmbient } from 'child_process';
6
10
  import { Command, CommanderError } from 'commander';
7
11
  import { normalizeAddressWithOptions, pollBlocks } from '../lib/chain.js';
@@ -14,8 +18,10 @@ import {
14
18
  } from '../lib/wallet.js';
15
19
 
16
20
  /**
17
- * @import {OfferSpec} from '@agoric/smart-wallet/src/offers.js'
18
- * @import {QuestionDetails} from '@agoric/governance/src/types.js'
21
+ * @import {OfferSpec} from '@agoric/smart-wallet/src/offers.js';
22
+ * @import {AgoricNamesRemotes} from '@agoric/vats/tools/board-utils.js';
23
+ * @import {CurrentWalletRecord} from '@agoric/smart-wallet/src/smartWallet.js';
24
+ * @import {VstorageKit} from '@agoric/client-utils';
19
25
  */
20
26
 
21
27
  const collectValues = (val, memo) => {
@@ -85,19 +91,21 @@ export const makeGovCommand = (_logger, io = {}) => {
85
91
  * given a sendFrom address; else print it.
86
92
  *
87
93
  * @param {{
88
- * toOffer: (agoricNames: *, current: import('@agoric/smart-wallet/src/smartWallet.js').CurrentWalletRecord | undefined) => OfferSpec,
94
+ * toOffer: (agoricNames: AgoricNamesRemotes, current: CurrentWalletRecord | undefined) => OfferSpec,
89
95
  * sendFrom?: string | undefined,
90
96
  * keyringBackend: string,
91
97
  * instanceName?: string,
92
98
  * }} detail
93
- * @param {Awaited<ReturnType<makeVstorageKit>>} [optUtils]
99
+ * @param {VstorageKit} [vsk]
94
100
  */
95
101
  const processOffer = async function (
96
102
  { toOffer, sendFrom, keyringBackend },
97
- optUtils,
103
+ vsk,
98
104
  ) {
99
- const utils = await (optUtils || makeVstorageKit({ fetch }, networkConfig));
100
- const { agoricNames, readPublished } = utils;
105
+ await null;
106
+ vsk ||= makeVstorageKit({ fetch }, networkConfig);
107
+ const { readPublished } = vsk;
108
+ const agoricNames = await makeAgoricNames(vsk.fromBoard, vsk.vstorage);
101
109
 
102
110
  assert(keyringBackend, 'missing keyring-backend option');
103
111
 
@@ -264,10 +272,11 @@ export const makeGovCommand = (_logger, io = {}) => {
264
272
  )
265
273
  .requiredOption('--for <string>', 'description of the invitation')
266
274
  .action(async opts => {
267
- const { agoricNames, readPublished } = await makeVstorageKit(
275
+ const { readPublished, ...vsk } = makeVstorageKit(
268
276
  { fetch },
269
277
  networkConfig,
270
278
  );
279
+ const agoricNames = await makeAgoricNames(vsk.fromBoard, vsk.vstorage);
271
280
  const current = await getCurrent(opts.from, { readPublished });
272
281
 
273
282
  const known = findContinuingIds(current, agoricNames);
@@ -293,10 +302,11 @@ export const makeGovCommand = (_logger, io = {}) => {
293
302
  normalizeAddress,
294
303
  )
295
304
  .action(async opts => {
296
- const { agoricNames, readPublished } = await makeVstorageKit(
305
+ const { readPublished, ...vsk } = makeVstorageKit(
297
306
  { fetch },
298
307
  networkConfig,
299
308
  );
309
+ const agoricNames = await makeAgoricNames(vsk.fromBoard, vsk.vstorage);
300
310
  const current = await getCurrent(opts.from, { readPublished });
301
311
 
302
312
  const found = findContinuingIds(current, agoricNames);
@@ -332,8 +342,8 @@ export const makeGovCommand = (_logger, io = {}) => {
332
342
  normalizeAddress,
333
343
  )
334
344
  .action(async function (opts, options) {
335
- const utils = await makeVstorageKit({ fetch }, networkConfig);
336
- const { readPublished } = utils;
345
+ const vsk = makeVstorageKit({ fetch }, networkConfig);
346
+ const { readPublished } = vsk;
337
347
 
338
348
  const questionDesc = await readPublished(
339
349
  `committees.${opts.pathname}.latestQuestion`,
@@ -383,7 +393,7 @@ export const makeGovCommand = (_logger, io = {}) => {
383
393
  sendFrom: opts.sendFrom,
384
394
  keyringBackend: options.optsWithGlobals().keyringBackend,
385
395
  },
386
- utils,
396
+ vsk,
387
397
  );
388
398
  });
389
399
 
@@ -3,6 +3,7 @@
3
3
  /* eslint-env node */
4
4
  import {
5
5
  fetchEnvNetworkConfig,
6
+ makeAgoricNames,
6
7
  makeVstorageKit,
7
8
  makeWalletUtils,
8
9
  storageHelper,
@@ -90,19 +91,20 @@ export const makeOracleCommand = (logger, io = {}) => {
90
91
  env: process.env,
91
92
  fetch,
92
93
  });
93
- const utils = await makeVstorageKit({ fetch }, networkConfig);
94
+ const vsk = makeVstorageKit({ fetch }, networkConfig);
95
+ const agoricNames = await makeAgoricNames(vsk.fromBoard, vsk.vstorage);
94
96
 
95
97
  const lookupPriceAggregatorInstance = ([brandIn, brandOut]) => {
96
98
  const name = oracleBrandFeedName(brandIn, brandOut);
97
- const instance = utils.agoricNames.instance[name];
99
+ const instance = agoricNames.instance[name];
98
100
  if (!instance) {
99
- logger.debug('known instances:', utils.agoricNames.instance);
101
+ logger.debug('known instances:', agoricNames.instance);
100
102
  throw Error(`Unknown instance ${name}`);
101
103
  }
102
104
  return instance;
103
105
  };
104
106
 
105
- return { ...utils, networkConfig, lookupPriceAggregatorInstance };
107
+ return { ...vsk, networkConfig, lookupPriceAggregatorInstance };
106
108
  };
107
109
 
108
110
  oracle
@@ -3,6 +3,7 @@
3
3
  /* eslint-env node */
4
4
  import {
5
5
  fetchEnvNetworkConfig,
6
+ makeAgoricNames,
6
7
  makeVstorageKit,
7
8
  storageHelper,
8
9
  } from '@agoric/client-utils';
@@ -66,13 +67,14 @@ export const makePsmCommand = logger => {
66
67
  );
67
68
 
68
69
  const rpcTools = async () => {
69
- const utils = await makeVstorageKit({ fetch }, networkConfig);
70
+ const vsk = await makeVstorageKit({ fetch }, networkConfig);
71
+ const agoricNames = await makeAgoricNames(vsk.fromBoard, vsk.vstorage);
70
72
 
71
73
  const lookupPsmInstance = ([minted, anchor]) => {
72
74
  const name = `psm-${minted}-${anchor}`;
73
- const instance = utils.agoricNames.instance[name];
75
+ const instance = agoricNames.instance[name];
74
76
  if (!instance) {
75
- logger.debug('known instances:', utils.agoricNames.instance);
77
+ logger.debug('known instances:', agoricNames.instance);
76
78
  throw Error(`Unknown instance ${name}`);
77
79
  }
78
80
  return instance;
@@ -83,20 +85,19 @@ export const makePsmCommand = logger => {
83
85
  * @param {[Minted: string, Anchor: string]} pair
84
86
  */
85
87
  const getGovernanceState = async ([Minted, Anchor]) => {
86
- const govContent = await utils.vstorage.readLatest(
88
+ const govContent = await vsk.vstorage.readLatest(
87
89
  `published.psm.${Minted}.${Anchor}.governance`,
88
90
  );
89
91
  assert(govContent, 'no gov content');
90
92
  const { current: governance } = last(
91
- storageHelper.unserializeTxt(govContent, utils.fromBoard),
93
+ storageHelper.unserializeTxt(govContent, vsk.fromBoard),
92
94
  );
93
- const { [`psm.${Minted}.${Anchor}`]: instance } =
94
- utils.agoricNames.instance;
95
+ const { [`psm.${Minted}.${Anchor}`]: instance } = agoricNames.instance;
95
96
 
96
97
  return { instance, governance };
97
98
  };
98
99
 
99
- return { ...utils, lookupPsmInstance, getGovernanceState };
100
+ return { ...vsk, agoricNames, lookupPsmInstance, getGovernanceState };
100
101
  };
101
102
 
102
103
  psm
@@ -1,7 +1,11 @@
1
1
  // @ts-check
2
2
  /* eslint-disable func-names */
3
3
  /* eslint-env node */
4
- import { fetchEnvNetworkConfig, makeVstorageKit } from '@agoric/client-utils';
4
+ import {
5
+ fetchEnvNetworkConfig,
6
+ makeAgoricNames,
7
+ makeVstorageKit,
8
+ } from '@agoric/client-utils';
5
9
  import { Offers } from '@agoric/inter-protocol/src/clientSupport.js';
6
10
  import { Command } from 'commander';
7
11
  import { outputActionAndHint } from '../lib/wallet.js';
@@ -31,7 +35,8 @@ export const makeReserveCommand = (_logger, io = {}) => {
31
35
  * }} opts
32
36
  */
33
37
  async ({ collateralBrand, ...opts }) => {
34
- const { agoricNames } = await makeVstorageKit({ fetch }, networkConfig);
38
+ const vsk = makeVstorageKit({ fetch }, networkConfig);
39
+ const agoricNames = await makeAgoricNames(vsk.fromBoard, vsk.vstorage);
35
40
 
36
41
  const offer = Offers.reserve.AddCollateral(agoricNames, {
37
42
  collateralBrandKey: collateralBrand,
@@ -65,7 +70,8 @@ export const makeReserveCommand = (_logger, io = {}) => {
65
70
  1,
66
71
  )
67
72
  .action(async function (opts) {
68
- const { agoricNames } = await makeVstorageKit({ fetch }, networkConfig);
73
+ const vsk = makeVstorageKit({ fetch }, networkConfig);
74
+ const agoricNames = await makeAgoricNames(vsk.fromBoard, vsk.vstorage);
69
75
 
70
76
  const reserveInstance = agoricNames.instance.reserve;
71
77
  assert(reserveInstance, 'missing reserve in names');
@@ -1,7 +1,11 @@
1
1
  // @ts-check
2
2
  /* eslint-disable func-names */
3
3
  /* eslint-env node */
4
- import { fetchEnvNetworkConfig, makeVstorageKit } from '@agoric/client-utils';
4
+ import {
5
+ fetchEnvNetworkConfig,
6
+ makeAgoricNames,
7
+ makeVstorageKit,
8
+ } from '@agoric/client-utils';
5
9
  import {
6
10
  lookupOfferIdForVault,
7
11
  Offers,
@@ -63,7 +67,8 @@ export const makeVaultsCommand = logger => {
63
67
  .option('--collateralBrand <string>', 'Collateral brand key', 'ATOM')
64
68
  .action(async function (opts) {
65
69
  logger.warn('running with options', opts);
66
- const { agoricNames } = await makeVstorageKit({ fetch }, networkConfig);
70
+ const vsk = makeVstorageKit({ fetch }, networkConfig);
71
+ const agoricNames = await makeAgoricNames(vsk.fromBoard, vsk.vstorage);
67
72
 
68
73
  const offer = Offers.vaults.OpenVault(agoricNames, {
69
74
  giveCollateral: opts.giveCollateral,
@@ -98,10 +103,11 @@ export const makeVaultsCommand = logger => {
98
103
  .requiredOption('--vaultId <string>', 'Key of vault (e.g. vault1)')
99
104
  .action(async function (opts) {
100
105
  logger.warn('running with options', opts);
101
- const { agoricNames, readPublished } = await makeVstorageKit(
106
+ const { readPublished, ...vsk } = makeVstorageKit(
102
107
  { fetch },
103
108
  networkConfig,
104
109
  );
110
+ const agoricNames = await makeAgoricNames(vsk.fromBoard, vsk.vstorage);
105
111
 
106
112
  const previousOfferId = await lookupOfferIdForVault(
107
113
  opts.vaultId,
@@ -142,10 +148,11 @@ export const makeVaultsCommand = logger => {
142
148
  )
143
149
  .action(async function (opts) {
144
150
  logger.warn('running with options', opts);
145
- const { agoricNames, readPublished } = await makeVstorageKit(
151
+ const { readPublished, ...vsk } = makeVstorageKit(
146
152
  { fetch },
147
153
  networkConfig,
148
154
  );
155
+ const agoricNames = await makeAgoricNames(vsk.fromBoard, vsk.vstorage);
149
156
 
150
157
  const previousOfferId = await lookupOfferIdForVault(
151
158
  opts.vaultId,
@@ -8,7 +8,11 @@ import {
8
8
  makeLeader,
9
9
  makeLeaderFromRpcAddresses,
10
10
  } from '@agoric/casting';
11
- import { makeVstorageKit, fetchEnvNetworkConfig } from '@agoric/client-utils';
11
+ import {
12
+ makeVstorageKit,
13
+ fetchEnvNetworkConfig,
14
+ makeAgoricNames,
15
+ } from '@agoric/client-utils';
12
16
  import { execFileSync } from 'child_process';
13
17
  import fs from 'fs';
14
18
  import util from 'util';
@@ -214,13 +218,11 @@ export const makeWalletCommand = async command => {
214
218
  normalizeAddress,
215
219
  )
216
220
  .action(async function (opts) {
217
- const { agoricNames, unserializer, readPublished } =
218
- await makeVstorageKit(
219
- {
220
- fetch,
221
- },
222
- networkConfig,
223
- );
221
+ const { readPublished, unserializer, ...vsk } = makeVstorageKit(
222
+ { fetch },
223
+ networkConfig,
224
+ );
225
+ const agoricNames = await makeAgoricNames(vsk.fromBoard, vsk.vstorage);
224
226
 
225
227
  const leader = makeLeader(networkConfig.rpcAddrs[0]);
226
228
  const follower = await makeFollower(
package/src/lib/wallet.js CHANGED
@@ -149,7 +149,7 @@ export const coalesceWalletState = async (follower, invitationBrand) => {
149
149
  * fees?: string,
150
150
  * verbose?: boolean,
151
151
  * keyring?: {home?: string, backend: string},
152
- * stdout: Pick<import('stream').Writable, 'write'>,
152
+ * stdout?: Pick<import('stream').Writable, 'write'>,
153
153
  * execFileSync: typeof import('child_process').execFileSync,
154
154
  * delay: (ms: number) => Promise<void>,
155
155
  * dryRun?: boolean,