agoric 0.21.2-dev-7cc5def.0 → 0.21.2-u11.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-7cc5def.0+7cc5def",
3
+ "version": "0.21.2-u11.0",
4
4
  "description": "Manage the Agoric Javascript smart contract platform",
5
5
  "type": "module",
6
6
  "main": "src/main.js",
@@ -8,10 +8,6 @@
8
8
  "agoric": "src/entrypoint.js",
9
9
  "agops": "src/bin-agops.js"
10
10
  },
11
- "exports": {
12
- "./src/entrypoint.js": "./src/entrypoint.js",
13
- "./src/helpers.js": "./src/helpers.js"
14
- },
15
11
  "files": [
16
12
  "src",
17
13
  "exported.js"
@@ -24,31 +20,29 @@
24
20
  "integration-test": "ava --config .ava-integration-test.config.js",
25
21
  "lint-fix": "yarn lint:eslint --fix",
26
22
  "lint": "run-s --continue-on-error lint:*",
27
- "lint:types": "tsc",
23
+ "lint:types": "tsc -p jsconfig.json",
28
24
  "lint:eslint": "eslint ."
29
25
  },
30
26
  "devDependencies": {
31
- "@agoric/cosmic-swingset": "0.41.4-dev-7cc5def.0+7cc5def",
32
- "@agoric/deploy-script-support": "0.10.4-dev-7cc5def.0+7cc5def",
33
- "ava": "^5.3.0",
27
+ "@agoric/deploy-script-support": "^0.10.4-u11.0",
28
+ "ava": "^5.2.0",
34
29
  "c8": "^7.13.0"
35
30
  },
36
31
  "dependencies": {
37
- "@agoric/access-token": "0.4.22-dev-7cc5def.0+7cc5def",
38
- "@agoric/assert": "0.6.1-dev-7cc5def.0+7cc5def",
39
- "@agoric/cache": "0.3.3-dev-7cc5def.0+7cc5def",
40
- "@agoric/casting": "0.4.3-dev-7cc5def.0+7cc5def",
41
- "@agoric/cosmic-proto": "0.3.1-dev-7cc5def.0+7cc5def",
42
- "@agoric/ertp": "0.16.3-dev-7cc5def.0+7cc5def",
43
- "@agoric/inter-protocol": "0.16.2-dev-7cc5def.0+7cc5def",
44
- "@agoric/internal": "0.3.3-dev-7cc5def.0+7cc5def",
45
- "@agoric/network": "0.1.1-dev-7cc5def.0+7cc5def",
46
- "@agoric/smart-wallet": "0.5.4-dev-7cc5def.0+7cc5def",
47
- "@agoric/store": "0.9.3-dev-7cc5def.0+7cc5def",
48
- "@agoric/swingset-vat": "0.32.3-dev-7cc5def.0+7cc5def",
49
- "@agoric/vats": "0.15.2-dev-7cc5def.0+7cc5def",
50
- "@agoric/zoe": "0.26.3-dev-7cc5def.0+7cc5def",
51
- "@agoric/zone": "0.2.3-dev-7cc5def.0+7cc5def",
32
+ "@agoric/access-token": "^0.4.21",
33
+ "@agoric/assert": "^0.6.0",
34
+ "@agoric/cache": "^0.3.3-u11.0",
35
+ "@agoric/casting": "^0.4.3-u11.0",
36
+ "@agoric/cosmic-proto": "^0.3.0",
37
+ "@agoric/ertp": "^0.16.3-u11.0",
38
+ "@agoric/inter-protocol": "^0.16.2-u11.0",
39
+ "@agoric/internal": "^0.3.3-u11.0",
40
+ "@agoric/smart-wallet": "^0.5.4-u11.0",
41
+ "@agoric/store": "^0.9.3-u11.0",
42
+ "@agoric/swingset-vat": "^0.32.3-u11.0",
43
+ "@agoric/vats": "^0.15.2-u11.0",
44
+ "@agoric/zoe": "^0.26.3-u11.0",
45
+ "@agoric/zone": "^0.2.3-u11.0",
52
46
  "@confio/relayer": "^0.9.0",
53
47
  "@cosmjs/crypto": "^0.30.1",
54
48
  "@cosmjs/encoding": "^0.30.1",
@@ -56,14 +50,14 @@
56
50
  "@cosmjs/proto-signing": "^0.30.1",
57
51
  "@cosmjs/stargate": "^0.30.1",
58
52
  "@cosmjs/tendermint-rpc": "^0.30.1",
59
- "@endo/bundle-source": "^2.5.2",
60
- "@endo/captp": "^3.1.2",
61
- "@endo/compartment-mapper": "^0.8.5",
62
- "@endo/far": "^0.2.19",
63
- "@endo/init": "^0.5.57",
64
- "@endo/marshal": "^0.8.6",
65
- "@endo/nat": "^4.1.28",
66
- "@endo/promise-kit": "^0.2.57",
53
+ "@endo/bundle-source": "^2.5.1",
54
+ "@endo/captp": "^3.1.1",
55
+ "@endo/compartment-mapper": "^0.8.4",
56
+ "@endo/far": "^0.2.18",
57
+ "@endo/init": "^0.5.56",
58
+ "@endo/marshal": "^0.8.5",
59
+ "@endo/nat": "^4.1.27",
60
+ "@endo/promise-kit": "^0.2.56",
67
61
  "@iarna/toml": "^2.2.3",
68
62
  "anylogger": "^0.21.0",
69
63
  "chalk": "^5.2.0",
@@ -94,5 +88,5 @@
94
88
  "timeout": "2m",
95
89
  "workerThreads": false
96
90
  },
97
- "gitHead": "7cc5defcf5c6d126fe39c94be4953afd11105a5c"
91
+ "gitHead": "92b6cd72484079b0349d8ccfa4510aeb820e8d67"
98
92
  }
package/src/bin-agops.js CHANGED
@@ -2,14 +2,12 @@
2
2
  // @ts-check
3
3
  // @jessie-check
4
4
 
5
+ /* eslint-disable @jessie.js/no-nested-await */
5
6
  /* global fetch, setTimeout */
6
7
 
7
- import '@endo/init/pre.js';
8
-
9
8
  import '@agoric/casting/node-fetch-shim.js';
10
9
  import '@endo/init';
11
-
12
- import { E } from '@endo/far';
10
+ import '@endo/init/pre.js';
13
11
 
14
12
  import { execFileSync } from 'child_process';
15
13
  import path from 'path';
@@ -76,11 +74,13 @@ program.addCommand(makeAuctionCommand(logger, { ...procIO, fetch }));
76
74
  program.addCommand(makeInterCommand(procIO, { fetch }));
77
75
  program.addCommand(makeTestCommand(procIO, { fetch }));
78
76
 
79
- E.when(program.parseAsync(process.argv), undefined, err => {
77
+ try {
78
+ await program.parseAsync(process.argv);
79
+ } catch (err) {
80
80
  if (err instanceof CommanderError) {
81
81
  console.error(err.message);
82
82
  } else {
83
83
  console.error(err); // CRASH! show stack trace
84
84
  }
85
85
  process.exit(1);
86
- });
86
+ }
@@ -1,6 +1,5 @@
1
1
  import djson from 'deterministic-json';
2
2
  import TOML from '@iarna/toml';
3
- import * as Tokens from '@agoric/internal/src/tokens.js';
4
3
 
5
4
  export const STAKING_MAX_VALIDATORS = 150;
6
5
  // Required for IBC connections not to time out.
@@ -14,38 +13,38 @@ export const ICA_HOST_ALLOW_MESSAGES = [
14
13
  ];
15
14
 
16
15
  const Stake = /** @type {const} */ ({
17
- name: Tokens.Stake.proposedName,
16
+ name: 'Agoric Staking Token',
18
17
  description: 'The token used by delegates to stake on the Agoric chain',
19
18
  denom_units: [
20
19
  {
21
- denom: Tokens.Stake.denom,
20
+ denom: 'ubld',
22
21
  exponent: 0,
23
22
  },
24
23
  {
25
24
  denom: 'bld',
26
- exponent: Tokens.Stake.displayInfo.decimalPlaces,
25
+ exponent: 6,
27
26
  },
28
27
  ],
29
- base: Tokens.Stake.denom,
28
+ base: 'ubld',
30
29
  display: 'bld',
31
- symbol: Tokens.Stake.symbol,
30
+ symbol: 'BLD',
32
31
  });
33
32
  const Stable = /** @type {const} */ ({
34
- name: Tokens.Stable.proposedName,
33
+ name: 'Agoric stable token',
35
34
  description: 'The stable token used by the Agoric chain',
36
35
  denom_units: [
37
36
  {
38
- denom: Tokens.Stable.denom,
37
+ denom: 'uist',
39
38
  exponent: 0,
40
39
  },
41
40
  {
42
41
  denom: 'ist',
43
- exponent: Tokens.Stable.displayInfo.decimalPlaces,
42
+ exponent: 6,
44
43
  },
45
44
  ],
46
- base: Tokens.Stable.denom,
45
+ base: 'uist',
47
46
  display: 'ist',
48
- symbol: Tokens.Stable.symbol,
47
+ symbol: 'IST',
49
48
  });
50
49
  export const DENOM_METADATA = /** @type {const} */ ([Stake, Stable]);
51
50
 
@@ -1,3 +1,4 @@
1
+ /* eslint-disable @jessie.js/no-nested-await */
1
2
  // @ts-check
2
3
  /* eslint-disable func-names */
3
4
  import { InvalidArgumentError } from 'commander';
@@ -7,11 +8,7 @@ import { outputActionAndHint } from '../lib/wallet.js';
7
8
  const { Fail } = assert;
8
9
 
9
10
  /** @typedef {import('@agoric/governance/src/contractGovernance/typedParamManager.js').ParamTypesMap} ParamTypesMap */
10
-
11
- /**
12
- * @template {ParamStateRecord} M
13
- * @typedef {import('@agoric/governance/src/contractGovernance/typedParamManager.js').ParamTypesMapFromRecord<M>} ParamTypesMapFromRecord
14
- */
11
+ /** @template M @typedef {import('@agoric/governance/src/contractGovernance/typedParamManager.js').ParamTypesMapFromRecord<M>} ParamTypesMapFromRecord */
15
12
 
16
13
  /**
17
14
  * @template {ParamTypesMap} M
@@ -1,3 +1,4 @@
1
+ /* eslint-disable @jessie.js/no-nested-await */
1
2
  // @ts-check
2
3
  /* eslint-disable func-names */
3
4
  /* global globalThis, process, setTimeout */
@@ -25,6 +25,7 @@ import {
25
25
  import { getNetworkConfig } from '../lib/rpc.js';
26
26
  import {
27
27
  getCurrent,
28
+ makeParseAmount,
28
29
  makeWalletUtils,
29
30
  outputActionAndHint,
30
31
  sendAction,
@@ -87,7 +88,7 @@ const makeFormatters = assets => {
87
88
  * @param {(_: T) => string} f
88
89
  * @returns { (x: T | null | undefined ) => string | undefined }
89
90
  */
90
- const maybe = f => x => (x ? f(x) : undefined);
91
+ const maybe = f => x => x ? f(x) : undefined;
91
92
 
92
93
  return {
93
94
  amount,
@@ -107,7 +108,7 @@ const makeFormatters = assets => {
107
108
  * Dynamic check that an OfferStatus is also a BidSpec.
108
109
  *
109
110
  * @param {import('@agoric/smart-wallet/src/offers.js').OfferStatus} offerStatus
110
- * @param {import('../lib/wallet.js').AgoricNamesRemotes} agoricNames
111
+ * @param {Awaited<ReturnType<import('../lib/rpc').makeAgoricNames>>} agoricNames
111
112
  * @param {typeof console.warn} warn
112
113
  * returns null if offerStatus is not a BidSpec
113
114
  */
@@ -205,10 +206,6 @@ export const makeInterCommand = (
205
206
  const interCmd = createCommand('inter')
206
207
  .description('Inter Protocol commands for liquidation bidding etc.')
207
208
  .option('--home <dir>', 'agd CosmosSDK application home directory')
208
- .option(
209
- '--fees <amount>',
210
- 'set fees for transaction broadcast (e.g. 5000ubld)',
211
- )
212
209
  .option(
213
210
  '--keyring-backend <os|file|test>',
214
211
  `keyring's backend (os|file|test) (default "${
@@ -241,6 +238,7 @@ export const makeInterCommand = (
241
238
  try {
242
239
  // XXX pass fetch to getNetworkConfig() explicitly
243
240
  // await null above makes this await safe
241
+ // eslint-disable-next-line @jessie.js/no-nested-await
244
242
  const networkConfig = await getNetworkConfig(env);
245
243
  return makeWalletUtils({ fetch, execFileSync, delay }, networkConfig);
246
244
  } catch (err) {
@@ -341,10 +339,10 @@ inter auction status
341
339
  const { networkConfig, agoricNames, pollOffer } = tools;
342
340
  const io = { ...networkConfig, execFileSync, delay, stdout };
343
341
 
344
- const { home, keyringBackend: backend, fees } = interCmd.opts();
342
+ const { home, keyringBackend: backend } = interCmd.opts();
345
343
  const result = await sendAction(
346
344
  { method: 'executeOffer', offer },
347
- { keyring: { home, backend }, from, fees, verbose: false, dryRun, ...io },
345
+ { keyring: { home, backend }, from, verbose: false, dryRun, ...io },
348
346
  );
349
347
  if (dryRun) {
350
348
  return;
@@ -418,7 +416,14 @@ inter auction status
418
416
  async ({ generateOnly, dryRun, ...opts }) => {
419
417
  const tools = await tryMakeUtils();
420
418
 
421
- const offer = Offers.auction.Bid(tools.agoricNames, opts);
419
+ const parseAmount = makeParseAmount(
420
+ tools.agoricNames,
421
+ msg => new InvalidArgumentError(msg),
422
+ );
423
+ const offer = Offers.auction.Bid(tools.agoricNames.brand, {
424
+ ...opts,
425
+ parseAmount,
426
+ });
422
427
 
423
428
  if (generateOnly) {
424
429
  outputActionAndHint(
@@ -459,7 +464,14 @@ inter auction status
459
464
  async ({ generateOnly, ...opts }) => {
460
465
  const tools = await tryMakeUtils();
461
466
 
462
- const offer = Offers.auction.Bid(tools.agoricNames, opts);
467
+ const parseAmount = makeParseAmount(
468
+ tools.agoricNames,
469
+ msg => new InvalidArgumentError(msg),
470
+ );
471
+ const offer = Offers.auction.Bid(tools.agoricNames.brand, {
472
+ ...opts,
473
+ parseAmount,
474
+ });
463
475
  if (generateOnly) {
464
476
  outputActionAndHint(
465
477
  { method: 'executeOffer', offer },
@@ -1,3 +1,5 @@
1
+ /* eslint-disable no-await-in-loop */
2
+ /* eslint-disable @jessie.js/no-nested-await */
1
3
  // @ts-check
2
4
  /* eslint-disable func-names */
3
5
  /* global fetch, setTimeout, process */
@@ -7,7 +9,6 @@ import { Nat } from '@endo/nat';
7
9
  import { Command } from 'commander';
8
10
  import * as cp from 'child_process';
9
11
  import { inspect } from 'util';
10
- import { instanceNameFor } from '@agoric/inter-protocol/src/proposals/price-feed-proposal.js';
11
12
  import { normalizeAddressWithOptions } from '../lib/chain.js';
12
13
  import { getNetworkConfig, makeRpcUtils, storageHelper } from '../lib/rpc.js';
13
14
  import {
@@ -76,7 +77,7 @@ export const makeOracleCommand = (logger, io = {}) => {
76
77
  const utils = await makeRpcUtils({ fetch });
77
78
 
78
79
  const lookupPriceAggregatorInstance = ([brandIn, brandOut]) => {
79
- const name = instanceNameFor(brandIn, brandOut);
80
+ const name = `${brandIn}-${brandOut} price feed`;
80
81
  const instance = utils.agoricNames.instance[name];
81
82
  if (!instance) {
82
83
  logger.debug('known instances:', utils.agoricNames.instance);
@@ -1,3 +1,5 @@
1
+ /* eslint-disable no-await-in-loop */
2
+ /* eslint-disable @jessie.js/no-nested-await */
1
3
  // @ts-check
2
4
  /* eslint-disable func-names */
3
5
  /* global process */
@@ -1,3 +1,5 @@
1
+ /* eslint-disable no-await-in-loop */
2
+ /* eslint-disable @jessie.js/no-nested-await */
1
3
  // @ts-check
2
4
  /* eslint-disable func-names */
3
5
  /* global fetch, process */
@@ -151,17 +153,15 @@ export const makePsmCommand = logger => {
151
153
  .option('--giveMinted <DOLLARS>', 'amount of minted tokens to give', Number)
152
154
  .option('--feePct [%]', 'Gas fee percentage', Number)
153
155
  .option('--offerId <string>', 'Offer id', String, `swap-${Date.now()}`)
154
- .action(
155
- async function (
156
- /** @type {Parameters<typeof Offers.psm.swap>[2]} */ opts,
157
- ) {
158
- console.warn('running with options', opts);
159
- const { agoricNames, lookupPsmInstance } = await rpcTools();
160
- const instance = await lookupPsmInstance(opts.pair);
161
- const offer = Offers.psm.swap(agoricNames, instance, opts);
162
- outputExecuteOfferAction(offer);
163
- },
164
- );
156
+ .action(async function (
157
+ /** @type {Parameters<typeof Offers.psm.swap>[2]} */ opts,
158
+ ) {
159
+ console.warn('running with options', opts);
160
+ const { agoricNames, lookupPsmInstance } = await rpcTools();
161
+ const instance = await lookupPsmInstance(opts.pair);
162
+ const offer = Offers.psm.swap(instance, agoricNames.brand, opts);
163
+ outputExecuteOfferAction(offer);
164
+ });
165
165
 
166
166
  psm
167
167
  .command('proposePauseOffers')
@@ -1,3 +1,4 @@
1
+ /* eslint-disable @jessie.js/no-nested-await */
1
2
  // @ts-check
2
3
  /* eslint-disable func-names */
3
4
  /* global fetch, process */
@@ -31,7 +32,7 @@ export const makeReserveCommand = (_logger, io = {}) => {
31
32
  async ({ collateralBrand, ...opts }) => {
32
33
  const { agoricNames } = await makeRpcUtils({ fetch });
33
34
 
34
- const offer = Offers.reserve.AddCollateral(agoricNames, {
35
+ const offer = Offers.reserve.AddCollateral(agoricNames.brand, {
35
36
  collateralBrandKey: collateralBrand,
36
37
  ...opts,
37
38
  });
@@ -38,6 +38,7 @@ export const makeTestCommand = (
38
38
  try {
39
39
  // XXX pass fetch to getNetworkConfig() explicitly
40
40
  // await null above makes this await safe
41
+ // eslint-disable-next-line @jessie.js/no-nested-await
41
42
  const networkConfig = await getNetworkConfig(env);
42
43
  return makeWalletUtils({ fetch, execFileSync, delay }, networkConfig);
43
44
  } catch (err) {
@@ -82,13 +83,7 @@ export const makeTestCommand = (
82
83
  publicInvitationMaker: 'makeInvitation',
83
84
  },
84
85
  proposal: {
85
- want: {
86
- Tokens: {
87
- // @ts-expect-error BoardRemote not a Brand object
88
- brand: agoricNames.brand.GoodStuff,
89
- value: 32n,
90
- },
91
- },
86
+ want: { Tokens: { brand: agoricNames.brand.GoodStuff, value: 32n } },
92
87
  },
93
88
  };
94
89
  const result = await sendAction(
@@ -1,3 +1,5 @@
1
+ /* eslint-disable no-await-in-loop */
2
+ /* eslint-disable @jessie.js/no-nested-await */
1
3
  // @ts-check
2
4
  /* eslint-disable func-names */
3
5
  /* global fetch, process */
@@ -63,7 +65,7 @@ export const makeVaultsCommand = logger => {
63
65
  logger.warn('running with options', opts);
64
66
  const { agoricNames } = await makeRpcUtils({ fetch });
65
67
 
66
- const offer = Offers.vaults.OpenVault(agoricNames, {
68
+ const offer = Offers.vaults.OpenVault(agoricNames.brand, {
67
69
  giveCollateral: opts.giveCollateral,
68
70
  wantMinted: opts.wantMinted,
69
71
  offerId: opts.offerId,
@@ -104,7 +106,7 @@ export const makeVaultsCommand = logger => {
104
106
  );
105
107
 
106
108
  const offer = Offers.vaults.AdjustBalances(
107
- agoricNames,
109
+ agoricNames.brand,
108
110
  {
109
111
  giveCollateral: opts.giveCollateral,
110
112
  wantCollateral: opts.wantCollateral,
@@ -145,7 +147,7 @@ export const makeVaultsCommand = logger => {
145
147
  );
146
148
 
147
149
  const offer = Offers.vaults.CloseVault(
148
- agoricNames,
150
+ agoricNames.brand,
149
151
  {
150
152
  giveMinted: opts.giveMinted,
151
153
  offerId: opts.offerId,
package/src/init.js CHANGED
@@ -5,7 +5,7 @@ import { makePspawn } from './helpers.js';
5
5
  // https://github.com/Agoric/agoric-sdk/issues/6512
6
6
  import '@endo/captp/src/types.js';
7
7
  import '@agoric/swingset-vat/exported.js';
8
- import '@agoric/network/exported.js';
8
+ import '@agoric/swingset-vat/src/vats/network/types.js';
9
9
 
10
10
  // Use either an absolute template URL, or find it relative to DAPP_URL_BASE.
11
11
  const gitURL = (relativeOrAbsoluteURL, base) => {
@@ -40,10 +40,9 @@ export default async function initMain(_progname, rawArgs, priv, opts) {
40
40
  dappBranch = ['-b', opts.dappBranch];
41
41
  }
42
42
 
43
- const shallow = ['--depth', '1', '--shallow-submodules'];
44
43
  const exitStatus = await pspawn(
45
44
  'git',
46
- ['clone', '--origin=upstream', ...shallow, dappURL, DIR, ...dappBranch],
45
+ ['clone', '--origin=upstream', dappURL, DIR, ...dappBranch],
47
46
  {
48
47
  stdio: 'inherit',
49
48
  },
@@ -61,6 +60,7 @@ export default async function initMain(_progname, rawArgs, priv, opts) {
61
60
  const path = `${DIR}/${dir}package.json`;
62
61
  log('rewriting ', path);
63
62
 
63
+ // eslint-disable-next-line no-await-in-loop
64
64
  const contents = await fs.readFile(path, 'utf-8');
65
65
  const pkg = JSON.parse(contents.replace(/@DIR@/g, DIR));
66
66
  if (dir === '') {
@@ -74,6 +74,7 @@ export default async function initMain(_progname, rawArgs, priv, opts) {
74
74
  pkg.name = `${DIR}${pkg.name.substr(topLevelName.length)}`;
75
75
  const json = JSON.stringify(pkg, undefined, 2);
76
76
 
77
+ // eslint-disable-next-line no-await-in-loop
77
78
  await fs.writeFile(path, json);
78
79
  }
79
80
 
package/src/install.js CHANGED
@@ -61,6 +61,7 @@ export default async function installMain(progname, rawArgs, powers, opts) {
61
61
  const yarnInstallEachWorktree = async (phase, ...flags) => {
62
62
  for await (const workTree of workTrees) {
63
63
  log.info(`yarn install ${phase} in ${workTree}`);
64
+ // eslint-disable-next-line no-await-in-loop
64
65
  const yarnInstall = await pspawn(
65
66
  'yarn',
66
67
  [...linkFlags, 'install', ...flags],
@@ -287,7 +288,6 @@ export default async function installMain(progname, rawArgs, powers, opts) {
287
288
  await Promise.all(
288
289
  [...sdkPackageToPath.entries()].map(async ([pjName, dir]) => {
289
290
  const SUBOPTIMAL = false;
290
- await null;
291
291
  if (SUBOPTIMAL) {
292
292
  // This use of yarn is noisy and slow.
293
293
  await pspawn('yarn', [...linkFlags, 'unlink', pjName]);
package/src/lib/chain.js CHANGED
@@ -38,7 +38,6 @@ harden(normalizeAddressWithOptions);
38
38
  * @param {ReadonlyArray<string>} swingsetArgs
39
39
  * @param {import('./rpc').MinimalNetworkConfig & {
40
40
  * from: string,
41
- * fees?: string,
42
41
  * dryRun?: boolean,
43
42
  * verbose?: boolean,
44
43
  * keyring?: {home?: string, backend: string}
@@ -49,7 +48,6 @@ harden(normalizeAddressWithOptions);
49
48
  export const execSwingsetTransaction = (swingsetArgs, opts) => {
50
49
  const {
51
50
  from,
52
- fees,
53
51
  dryRun = false,
54
52
  verbose = true,
55
53
  keyring = undefined,
@@ -62,11 +60,9 @@ export const execSwingsetTransaction = (swingsetArgs, opts) => {
62
60
  const backendOpt = keyring?.backend
63
61
  ? [`--keyring-backend=${keyring.backend}`]
64
62
  : [];
65
- const feeOpt = fees ? ['--fees', fees] : [];
66
63
  const cmd = [`--node=${rpcAddrs[0]}`, `--chain-id=${chainName}`].concat(
67
64
  homeOpt,
68
65
  backendOpt,
69
- feeOpt,
70
66
  [`--from=${from}`, 'tx', 'swingset'],
71
67
  swingsetArgs,
72
68
  );
@@ -79,15 +75,7 @@ export const execSwingsetTransaction = (swingsetArgs, opts) => {
79
75
  } else {
80
76
  const yesCmd = cmd.concat(['--yes']);
81
77
  if (verbose) console.log('Executing ', yesCmd);
82
- const out = execFileSync(agdBinary, yesCmd, { encoding: 'utf-8' });
83
-
84
- // agd puts this diagnostic on stdout rather than stderr :-/
85
- // "Default sign-mode 'direct' not supported by Ledger, using sign-mode 'amino-json'.
86
- if (out.startsWith('Default sign-mode')) {
87
- const stripDiagnostic = out.replace(/^Default[^\n]+\n/, '');
88
- return stripDiagnostic;
89
- }
90
- return out;
78
+ return execFileSync(agdBinary, yesCmd, { encoding: 'utf-8' });
91
79
  }
92
80
  };
93
81
  harden(execSwingsetTransaction);
@@ -134,6 +122,7 @@ export const pollBlocks = opts => async lookup => {
134
122
  } = status;
135
123
  try {
136
124
  // see await null above
125
+ // eslint-disable-next-line @jessie.js/no-nested-await, no-await-in-loop
137
126
  const result = await lookup({ time, height });
138
127
  return result;
139
128
  } catch (_err) {
@@ -143,6 +132,7 @@ export const pollBlocks = opts => async lookup => {
143
132
  height,
144
133
  'retrying...',
145
134
  );
135
+ // eslint-disable-next-line @jessie.js/no-nested-await, no-await-in-loop
146
136
  await delay(period);
147
137
  }
148
138
  }
package/src/lib/format.js CHANGED
@@ -1,8 +1,10 @@
1
1
  // @ts-check
2
+ import { makeBoardRemote } from '@agoric/vats/tools/board-utils.js';
3
+ // eslint-disable-next-line no-unused-vars -- typeof below
4
+ import { makeAgoricNames } from './rpc.js';
2
5
 
3
6
  // ambient types
4
7
  import '@agoric/ertp/src/types-ambient.js';
5
- import { makeBoardRemote } from '@agoric/vats/tools/board-utils.js';
6
8
 
7
9
  /** @typedef {import('@agoric/vats/tools/board-utils.js').BoardRemote} BoardRemote */
8
10
 
@@ -28,15 +30,16 @@ export const Natural = str => {
28
30
  */
29
31
  export const bigintReplacer = (k, v) => (typeof v === 'bigint' ? `${v}` : v);
30
32
 
31
- /** @type {Partial<import('@agoric/vats/tools/board-utils.js').VBankAssetDetail>} */
33
+ /** @type {import('@agoric/vats/tools/board-utils.js').VBankAssetDetail} */
32
34
  // eslint-disable-next-line no-unused-vars
33
35
  const exampleAsset = {
36
+ // @ts-expect-error cast
34
37
  brand: makeBoardRemote({ boardId: 'board0425', iface: 'Alleged: BLD brand' }),
35
38
  displayInfo: { assetKind: 'nat', decimalPlaces: 6 },
39
+ // @ts-expect-error cast
36
40
  issuer: makeBoardRemote({ boardId: null, iface: undefined }),
37
- proposedName: 'Agoric staking token',
41
+ petname: 'Agoric staking token',
38
42
  };
39
-
40
43
  /** @typedef {import('@agoric/vats/tools/board-utils.js').VBankAssetDetail } AssetDescriptor */
41
44
 
42
45
  /**
@@ -119,7 +122,7 @@ export const fmtRecordOfLines = record => {
119
122
  * Summarize the offerStatuses of the state as user-facing informative tuples
120
123
  *
121
124
  * @param {import('@agoric/smart-wallet/src/utils.js').CoalescedWalletState} state
122
- * @param {import('./wallet.js').AgoricNamesRemotes} agoricNames
125
+ * @param {Awaited<ReturnType<typeof makeAgoricNames>>} agoricNames
123
126
  */
124
127
  export const offerStatusTuples = (state, agoricNames) => {
125
128
  const { offerStatuses } = state;
@@ -176,7 +179,7 @@ export const offerStatusTuples = (state, agoricNames) => {
176
179
  /**
177
180
  * @param {import('@agoric/smart-wallet/src/smartWallet').CurrentWalletRecord} current
178
181
  * @param {ReturnType<import('@agoric/smart-wallet/src/utils.js').makeWalletStateCoalescer>['state']} coalesced
179
- * @param {import('./wallet.js').AgoricNamesRemotes} agoricNames
182
+ * @param {Awaited<ReturnType<typeof makeAgoricNames>>} agoricNames
180
183
  */
181
184
  export const summarize = (current, coalesced, agoricNames) => {
182
185
  return {
package/src/lib/rpc.js CHANGED
@@ -1,4 +1,5 @@
1
1
  // @ts-check
2
+ /* eslint-disable @jessie.js/no-nested-await */
2
3
  /* global Buffer, fetch, process */
3
4
 
4
5
  import { NonNullish } from '@agoric/assert';
@@ -49,8 +50,7 @@ export const getNetworkConfig = async env => {
49
50
  };
50
51
 
51
52
  /** @type {MinimalNetworkConfig} */
52
- const networkConfig = await getNetworkConfig(process.env);
53
- export { networkConfig };
53
+ export const networkConfig = await getNetworkConfig(process.env);
54
54
  // console.warn('networkConfig', networkConfig);
55
55
 
56
56
  /**
@@ -132,11 +132,11 @@ export const makeVStorage = (powers, config = networkConfig) => {
132
132
  const parts = [];
133
133
  // undefined the first iteration, to query at the highest
134
134
  let blockHeight;
135
- await null;
136
135
  do {
137
136
  // console.debug('READING', { blockHeight });
138
137
  let values;
139
138
  try {
139
+ // eslint-disable-next-line no-await-in-loop
140
140
  ({ blockHeight, values } = await this.readAt(
141
141
  path,
142
142
  blockHeight && Number(blockHeight) - 1,
@@ -242,7 +242,6 @@ export const makeAgoricNames = async (ctx, vstorage) => {
242
242
  * @param {MinimalNetworkConfig} config
243
243
  */
244
244
  export const makeRpcUtils = async ({ fetch }, config = networkConfig) => {
245
- await null;
246
245
  try {
247
246
  const vstorage = makeVStorage({ fetch }, config);
248
247
  const fromBoard = makeFromBoard();