agoric 0.21.2-dev-8657c4c.0 → 0.21.2-dev-a2e9363.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-8657c4c.0+8657c4c",
3
+ "version": "0.21.2-dev-a2e9363.0+a2e9363",
4
4
  "description": "Manage the Agoric Javascript smart contract platform",
5
5
  "type": "module",
6
6
  "main": "src/main.js",
@@ -29,29 +29,29 @@
29
29
  "lint:eslint": "eslint ."
30
30
  },
31
31
  "devDependencies": {
32
- "@agoric/cosmic-swingset": "0.41.4-dev-8657c4c.0+8657c4c",
33
- "@agoric/deploy-script-support": "0.10.4-dev-8657c4c.0+8657c4c",
32
+ "@agoric/cosmic-swingset": "0.41.4-dev-a2e9363.0+a2e9363",
33
+ "@agoric/deploy-script-support": "0.10.4-dev-a2e9363.0+a2e9363",
34
34
  "ava": "^5.3.0",
35
35
  "c8": "^10.1.2",
36
36
  "dd-trace": "^4.11.1"
37
37
  },
38
38
  "dependencies": {
39
- "@agoric/access-token": "0.4.22-dev-8657c4c.0+8657c4c",
40
- "@agoric/cache": "0.3.3-dev-8657c4c.0+8657c4c",
41
- "@agoric/casting": "0.4.3-dev-8657c4c.0+8657c4c",
42
- "@agoric/client-utils": "0.1.1-dev-8657c4c.0+8657c4c",
43
- "@agoric/cosmic-proto": "0.4.1-dev-8657c4c.0+8657c4c",
44
- "@agoric/ertp": "0.16.3-dev-8657c4c.0+8657c4c",
45
- "@agoric/governance": "0.10.4-dev-8657c4c.0+8657c4c",
46
- "@agoric/inter-protocol": "0.16.2-dev-8657c4c.0+8657c4c",
47
- "@agoric/internal": "0.3.3-dev-8657c4c.0+8657c4c",
48
- "@agoric/network": "0.1.1-dev-8657c4c.0+8657c4c",
49
- "@agoric/smart-wallet": "0.5.4-dev-8657c4c.0+8657c4c",
50
- "@agoric/store": "0.9.3-dev-8657c4c.0+8657c4c",
51
- "@agoric/swingset-vat": "0.32.3-dev-8657c4c.0+8657c4c",
52
- "@agoric/vats": "0.15.2-dev-8657c4c.0+8657c4c",
53
- "@agoric/zoe": "0.26.3-dev-8657c4c.0+8657c4c",
54
- "@agoric/zone": "0.2.3-dev-8657c4c.0+8657c4c",
39
+ "@agoric/access-token": "0.4.22-dev-a2e9363.0+a2e9363",
40
+ "@agoric/cache": "0.3.3-dev-a2e9363.0+a2e9363",
41
+ "@agoric/casting": "0.4.3-dev-a2e9363.0+a2e9363",
42
+ "@agoric/client-utils": "0.1.1-dev-a2e9363.0+a2e9363",
43
+ "@agoric/cosmic-proto": "0.4.1-dev-a2e9363.0+a2e9363",
44
+ "@agoric/ertp": "0.16.3-dev-a2e9363.0+a2e9363",
45
+ "@agoric/governance": "0.10.4-dev-a2e9363.0+a2e9363",
46
+ "@agoric/inter-protocol": "0.16.2-dev-a2e9363.0+a2e9363",
47
+ "@agoric/internal": "0.3.3-dev-a2e9363.0+a2e9363",
48
+ "@agoric/network": "0.1.1-dev-a2e9363.0+a2e9363",
49
+ "@agoric/smart-wallet": "0.5.4-dev-a2e9363.0+a2e9363",
50
+ "@agoric/store": "0.9.3-dev-a2e9363.0+a2e9363",
51
+ "@agoric/swingset-vat": "0.32.3-dev-a2e9363.0+a2e9363",
52
+ "@agoric/vats": "0.15.2-dev-a2e9363.0+a2e9363",
53
+ "@agoric/zoe": "0.26.3-dev-a2e9363.0+a2e9363",
54
+ "@agoric/zone": "0.2.3-dev-a2e9363.0+a2e9363",
55
55
  "@confio/relayer": "^0.11.3",
56
56
  "@cosmjs/crypto": "^0.32.3",
57
57
  "@cosmjs/encoding": "^0.32.3",
@@ -102,5 +102,5 @@
102
102
  "typeCoverage": {
103
103
  "atLeast": 77.54
104
104
  },
105
- "gitHead": "8657c4cfc5dcb48602f730574afe5efb6f8ffb24"
105
+ "gitHead": "a2e936366843f74f9d101f3db4b1e76858abe3d7"
106
106
  }
@@ -1,17 +1,16 @@
1
1
  // @ts-check
2
2
  /* eslint-env node */
3
- import { InvalidArgumentError } from 'commander';
3
+ import { fetchEnvNetworkConfig, makeVstorageKit } from '@agoric/client-utils';
4
4
  import { Fail } from '@endo/errors';
5
- import { makeVstorageKit } from '@agoric/client-utils';
5
+ import { InvalidArgumentError } from 'commander';
6
6
  import { outputActionAndHint } from '../lib/wallet.js';
7
- import { getNetworkConfig } from '../lib/network-config.js';
8
7
 
9
8
  /**
10
9
  * @import {ParamTypesMap, ParamTypesMapFromRecord} from '@agoric/governance/src/contractGovernance/typedParamManager.js'
11
10
  * @import {ParamValueForType} from '@agoric/governance/src/types.js'
12
11
  */
13
12
 
14
- const networkConfig = await getNetworkConfig({ env: process.env, fetch });
13
+ const networkConfig = await fetchEnvNetworkConfig({ env: process.env, fetch });
15
14
 
16
15
  /**
17
16
  * @template {ParamTypesMap} M
@@ -1,11 +1,10 @@
1
1
  // @ts-check
2
2
  /* eslint-disable func-names */
3
3
  /* eslint-env node */
4
- import { makeVstorageKit } from '@agoric/client-utils';
4
+ import { fetchEnvNetworkConfig, makeVstorageKit } from '@agoric/client-utils';
5
5
  import { execFileSync as execFileSyncAmbient } from 'child_process';
6
6
  import { Command, CommanderError } from 'commander';
7
7
  import { normalizeAddressWithOptions, pollBlocks } from '../lib/chain.js';
8
- import { getNetworkConfig } from '../lib/network-config.js';
9
8
  import {
10
9
  findContinuingIds,
11
10
  getCurrent,
@@ -26,7 +25,7 @@ const collectValues = (val, memo) => {
26
25
 
27
26
  const defaultKeyring = process.env.AGORIC_KEYRING_BACKEND || 'test';
28
27
 
29
- const networkConfig = await getNetworkConfig({ env: process.env, fetch });
28
+ const networkConfig = await fetchEnvNetworkConfig({ env: process.env, fetch });
30
29
 
31
30
  /**
32
31
  * @param {import('anylogger').Logger} _logger
@@ -4,20 +4,19 @@
4
4
  */
5
5
 
6
6
  // @ts-check
7
- import { makeWalletUtils } from '@agoric/client-utils';
7
+ import { fetchEnvNetworkConfig, makeWalletUtils } from '@agoric/client-utils';
8
8
  import { makeOfferSpecShape } from '@agoric/inter-protocol/src/auction/auctionBook.js';
9
9
  import { Offers } from '@agoric/inter-protocol/src/clientSupport.js';
10
10
  import { objectMap } from '@agoric/internal';
11
11
  import { M, matches } from '@endo/patterns';
12
12
  import { CommanderError, InvalidArgumentError } from 'commander';
13
13
  import { normalizeAddressWithOptions, pollBlocks } from '../lib/chain.js';
14
- import { getCurrent, outputActionAndHint, sendAction } from '../lib/wallet.js';
15
14
  import {
16
15
  asBoardRemote,
17
16
  bigintReplacer,
18
17
  makeAmountFormatter,
19
18
  } from '../lib/format.js';
20
- import { getNetworkConfig } from '../lib/network-config.js';
19
+ import { getCurrent, outputActionAndHint, sendAction } from '../lib/wallet.js';
21
20
 
22
21
  const { values } = Object;
23
22
 
@@ -232,7 +231,7 @@ export const makeInterCommand = (
232
231
  try {
233
232
  // XXX pass fetch to getNetworkConfig() explicitly
234
233
  // await null above makes this await safe
235
- const networkConfig = await getNetworkConfig({ env, fetch });
234
+ const networkConfig = await fetchEnvNetworkConfig({ env, fetch });
236
235
  return makeWalletUtils({ fetch, delay }, networkConfig);
237
236
  } catch (err) {
238
237
  // CommanderError is a class constructor, and so
@@ -2,6 +2,7 @@
2
2
  /* eslint-disable func-names */
3
3
  /* eslint-env node */
4
4
  import {
5
+ fetchEnvNetworkConfig,
5
6
  makeVstorageKit,
6
7
  makeWalletUtils,
7
8
  storageHelper,
@@ -14,14 +15,13 @@ import * as cp from 'child_process';
14
15
  import { Command } from 'commander';
15
16
  import { inspect } from 'util';
16
17
  import { normalizeAddressWithOptions } from '../lib/chain.js';
17
- import { getNetworkConfig } from '../lib/network-config.js';
18
+ import { bigintReplacer } from '../lib/format.js';
18
19
  import {
19
20
  getCurrent,
20
21
  outputAction,
21
22
  sendAction,
22
23
  sendHint,
23
24
  } from '../lib/wallet.js';
24
- import { bigintReplacer } from '../lib/format.js';
25
25
 
26
26
  /** @import {PriceAuthority, PriceDescription, PriceQuote, PriceQuoteValue, PriceQuery,} from '@agoric/zoe/tools/types.js'; */
27
27
 
@@ -86,7 +86,10 @@ export const makeOracleCommand = (logger, io = {}) => {
86
86
 
87
87
  const rpcTools = async () => {
88
88
  // XXX pass fetch to getNetworkConfig() explicitly
89
- const networkConfig = await getNetworkConfig({ env: process.env, fetch });
89
+ const networkConfig = await fetchEnvNetworkConfig({
90
+ env: process.env,
91
+ fetch,
92
+ });
90
93
  const utils = await makeVstorageKit({ fetch }, networkConfig);
91
94
 
92
95
  const lookupPriceAggregatorInstance = ([brandIn, brandOut]) => {
@@ -7,6 +7,7 @@ import {
7
7
  makeFollower,
8
8
  makeLeaderFromRpcAddresses,
9
9
  } from '@agoric/casting';
10
+ import { fetchEnvNetworkConfig } from '@agoric/client-utils';
10
11
  import { slotToRemotable } from '@agoric/internal/src/storage-test-utils.js';
11
12
  import { boardSlottingMarshaller } from '@agoric/vats/tools/board-utils.js';
12
13
  import { Command } from 'commander';
@@ -17,12 +18,11 @@ import {
17
18
  execSwingsetTransaction,
18
19
  normalizeAddressWithOptions,
19
20
  } from '../lib/chain.js';
20
- import { getNetworkConfig } from '../lib/network-config.js';
21
21
 
22
22
  // tight for perf testing but less than this tends to hang.
23
23
  const SLEEP_SECONDS = 0.1;
24
24
 
25
- const networkConfig = await getNetworkConfig({ env: process.env, fetch });
25
+ const networkConfig = await fetchEnvNetworkConfig({ env: process.env, fetch });
26
26
 
27
27
  /**
28
28
  * @param {import('anylogger').Logger} logger
@@ -1,14 +1,17 @@
1
1
  // @ts-check
2
2
  /* eslint-disable func-names */
3
3
  /* eslint-env node */
4
- import { makeVstorageKit, storageHelper } from '@agoric/client-utils';
4
+ import {
5
+ fetchEnvNetworkConfig,
6
+ makeVstorageKit,
7
+ storageHelper,
8
+ } from '@agoric/client-utils';
5
9
  import { Offers } from '@agoric/inter-protocol/src/clientSupport.js';
6
10
  import { Command } from 'commander';
7
- import { getNetworkConfig } from '../lib/network-config.js';
8
- import { outputExecuteOfferAction } from '../lib/wallet.js';
9
11
  import { asPercent } from '../lib/format.js';
12
+ import { outputExecuteOfferAction } from '../lib/wallet.js';
10
13
 
11
- const networkConfig = await getNetworkConfig({ env: process.env, fetch });
14
+ const networkConfig = await fetchEnvNetworkConfig({ env: process.env, fetch });
12
15
 
13
16
  // Adapted from https://gist.github.com/dckc/8b5b2f16395cb4d7f2ff340e0bc6b610#file-psm-tool
14
17
 
@@ -1,13 +1,12 @@
1
1
  // @ts-check
2
2
  /* eslint-disable func-names */
3
3
  /* eslint-env node */
4
- import { makeVstorageKit } from '@agoric/client-utils';
4
+ import { fetchEnvNetworkConfig, makeVstorageKit } from '@agoric/client-utils';
5
5
  import { Offers } from '@agoric/inter-protocol/src/clientSupport.js';
6
6
  import { Command } from 'commander';
7
- import { getNetworkConfig } from '../lib/network-config.js';
8
7
  import { outputActionAndHint } from '../lib/wallet.js';
9
8
 
10
- const networkConfig = await getNetworkConfig({ env: process.env, fetch });
9
+ const networkConfig = await fetchEnvNetworkConfig({ env: process.env, fetch });
11
10
 
12
11
  /**
13
12
  * @param {import('anylogger').Logger} _logger
@@ -1,12 +1,11 @@
1
1
  // @ts-check
2
2
  /* eslint-env node */
3
- import { makeWalletUtils } from '@agoric/client-utils';
3
+ import { fetchEnvNetworkConfig, makeWalletUtils } from '@agoric/client-utils';
4
4
  import { Fail } from '@endo/errors';
5
5
  import { CommanderError } from 'commander';
6
6
  import { normalizeAddressWithOptions } from '../lib/chain.js';
7
- import { getNetworkConfig } from '../lib/network-config.js';
8
- import { sendAction } from '../lib/wallet.js';
9
7
  import { bigintReplacer } from '../lib/format.js';
8
+ import { sendAction } from '../lib/wallet.js';
10
9
 
11
10
  /**
12
11
  * Make commands for testing.
@@ -39,7 +38,7 @@ export const makeTestCommand = (
39
38
  try {
40
39
  // XXX pass fetch to getNetworkConfig() explicitly
41
40
  // await null above makes this await safe
42
- const networkConfig = await getNetworkConfig({ env, fetch });
41
+ const networkConfig = await fetchEnvNetworkConfig({ env, fetch });
43
42
  return makeWalletUtils({ fetch, delay }, networkConfig);
44
43
  } catch (err) {
45
44
  // CommanderError is a class constructor, and so
@@ -1,7 +1,7 @@
1
1
  // @ts-check
2
2
  /* eslint-disable func-names */
3
3
  /* eslint-env node */
4
- import { makeVstorageKit } from '@agoric/client-utils';
4
+ import { fetchEnvNetworkConfig, makeVstorageKit } from '@agoric/client-utils';
5
5
  import {
6
6
  lookupOfferIdForVault,
7
7
  Offers,
@@ -9,9 +9,8 @@ import {
9
9
  import { Command } from 'commander';
10
10
  import { normalizeAddressWithOptions } from '../lib/chain.js';
11
11
  import { getCurrent, outputExecuteOfferAction } from '../lib/wallet.js';
12
- import { getNetworkConfig } from '../lib/network-config.js';
13
12
 
14
- const networkConfig = await getNetworkConfig({ env: process.env, fetch });
13
+ const networkConfig = await fetchEnvNetworkConfig({ env: process.env, fetch });
15
14
 
16
15
  /**
17
16
  * @param {import('anylogger').Logger} logger
@@ -8,7 +8,7 @@ import {
8
8
  makeLeader,
9
9
  makeLeaderFromRpcAddresses,
10
10
  } from '@agoric/casting';
11
- import { makeVstorageKit } from '@agoric/client-utils';
11
+ import { makeVstorageKit, fetchEnvNetworkConfig } from '@agoric/client-utils';
12
12
  import { execFileSync } from 'child_process';
13
13
  import fs from 'fs';
14
14
  import util from 'util';
@@ -19,15 +19,14 @@ import {
19
19
  fetchSwingsetParams,
20
20
  normalizeAddressWithOptions,
21
21
  } from '../lib/chain.js';
22
- import { getNetworkConfig } from '../lib/network-config.js';
23
- import { coalesceWalletState, getCurrent } from '../lib/wallet.js';
24
22
  import {
25
- summarize,
26
23
  fmtRecordOfLines,
27
24
  parseFiniteNumber,
25
+ summarize,
28
26
  } from '../lib/format.js';
27
+ import { coalesceWalletState, getCurrent } from '../lib/wallet.js';
29
28
 
30
- const networkConfig = await getNetworkConfig({ env: process.env, fetch });
29
+ const networkConfig = await fetchEnvNetworkConfig({ env: process.env, fetch });
31
30
 
32
31
  const SLEEP_SECONDS = 3;
33
32
 
package/src/helpers.js CHANGED
@@ -3,7 +3,8 @@
3
3
 
4
4
  /** @import { ChildProcess } from 'child_process' */
5
5
 
6
- export { getNetworkConfig } from './lib/network-config.js';
6
+ // Backwards compatibility
7
+ export { fetchEnvNetworkConfig as getNetworkConfig } from '@agoric/client-utils';
7
8
 
8
9
  export const getSDKBinaries = ({
9
10
  jsPfx = '../..',
@@ -1,41 +0,0 @@
1
- import { NonNullish } from '@agoric/internal';
2
-
3
- /**
4
- * @import {MinimalNetworkConfig} from '@agoric/client-utils';
5
- */
6
-
7
- export const networkConfigUrl = agoricNetSubdomain =>
8
- `https://${agoricNetSubdomain}.agoric.net/network-config`;
9
- export const rpcUrl = agoricNetSubdomain =>
10
- `https://${agoricNetSubdomain}.rpc.agoric.net:443`;
11
-
12
- /**
13
- * @param {string} str
14
- * @param {{ fetch: typeof fetch }} io
15
- * @returns {Promise<MinimalNetworkConfig>}
16
- */
17
- const fromAgoricNet = (str, { fetch }) => {
18
- const [netName, chainName] = str.split(',');
19
- if (chainName) {
20
- return Promise.resolve({ chainName, rpcAddrs: [rpcUrl(netName)] });
21
- }
22
- return fetch(networkConfigUrl(netName)).then(res => res.json());
23
- };
24
-
25
- /**
26
- * @param {{ env: typeof process.env, fetch: typeof fetch }} io
27
- * @returns {Promise<MinimalNetworkConfig>}
28
- */
29
- export const getNetworkConfig = async ({ env, fetch }) => {
30
- if (!('AGORIC_NET' in env) || env.AGORIC_NET === 'local') {
31
- return { rpcAddrs: ['http://0.0.0.0:26657'], chainName: 'agoriclocal' };
32
- }
33
-
34
- return fromAgoricNet(NonNullish(env.AGORIC_NET), { fetch }).catch(err => {
35
- throw Error(
36
- `cannot get network config (${env.AGORIC_NET || 'local'}): ${
37
- err.message
38
- }`,
39
- );
40
- });
41
- };