agoric 0.21.2-other-dev-8f8782b.0 → 0.21.2-other-dev-3eb1a1d.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 +53 -38
- package/src/anylogger-agoric.js +31 -16
- package/src/bin-agops.js +8 -10
- package/src/chain-config.js +33 -14
- package/src/commands/auction.js +17 -18
- package/src/commands/{ec.js → gov.js} +211 -59
- package/src/commands/inter.js +45 -62
- package/src/commands/oracle.js +98 -61
- package/src/commands/perf.js +6 -6
- package/src/commands/psm.js +19 -20
- package/src/commands/reserve.js +8 -6
- package/src/commands/test-upgrade.js +16 -8
- package/src/commands/vaults.js +25 -18
- package/src/commands/wallet.js +105 -35
- package/src/cosmos.js +3 -3
- package/src/deploy.js +3 -4
- package/src/entrypoint.js +1 -3
- package/src/follow.js +6 -3
- package/src/helpers.js +9 -5
- package/src/init.js +2 -9
- package/src/install.js +17 -16
- package/src/lib/bundles.js +102 -0
- package/src/lib/chain.js +63 -12
- package/src/lib/format.js +28 -34
- package/src/lib/network-config.js +41 -0
- package/src/lib/wallet.js +43 -143
- package/src/main-publish.js +2 -3
- package/src/main.js +91 -89
- package/src/open.js +8 -10
- package/src/publish.js +4 -9
- package/src/scripts.js +13 -4
- package/src/sdk-package-names.js +13 -7
- package/src/set-defaults.js +2 -1
- package/src/start.js +59 -67
- package/tools/getting-started.js +254 -0
- package/tools/resm-plugin/deploy.js +18 -0
- package/tools/resm-plugin/package.json +12 -0
- package/tools/resm-plugin/src/output.js +1 -0
- package/tools/resm-plugin/src/plugin.js +17 -0
- package/CHANGELOG.md +0 -1069
- package/src/lib/rpc.js +0 -272
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agoric",
|
|
3
|
-
"version": "0.21.2-other-dev-
|
|
3
|
+
"version": "0.21.2-other-dev-3eb1a1d.0+3eb1a1d",
|
|
4
4
|
"description": "Manage the Agoric Javascript smart contract platform",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "src/main.js",
|
|
@@ -8,60 +8,72 @@
|
|
|
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
|
+
},
|
|
11
15
|
"files": [
|
|
12
16
|
"src",
|
|
17
|
+
"tools",
|
|
13
18
|
"exported.js"
|
|
14
19
|
],
|
|
15
20
|
"scripts": {
|
|
16
21
|
"build": "node ./scripts/get-sdk-package-names.js > src/sdk-package-names.js",
|
|
17
22
|
"test": "ava",
|
|
18
|
-
"test:c8": "c8 $C8_OPTIONS ava
|
|
23
|
+
"test:c8": "c8 --all $C8_OPTIONS ava",
|
|
19
24
|
"test:xs": "exit 0",
|
|
20
25
|
"integration-test": "ava --config .ava-integration-test.config.js",
|
|
21
26
|
"lint-fix": "yarn lint:eslint --fix",
|
|
22
27
|
"lint": "run-s --continue-on-error lint:*",
|
|
23
|
-
"lint:types": "tsc
|
|
28
|
+
"lint:types": "tsc",
|
|
24
29
|
"lint:eslint": "eslint ."
|
|
25
30
|
},
|
|
26
31
|
"devDependencies": {
|
|
27
|
-
"@agoric/
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
32
|
+
"@agoric/cosmic-swingset": "0.41.4-other-dev-3eb1a1d.0+3eb1a1d",
|
|
33
|
+
"@agoric/deploy-script-support": "0.10.4-other-dev-3eb1a1d.0+3eb1a1d",
|
|
34
|
+
"ava": "^5.3.0",
|
|
35
|
+
"c8": "^10.1.2",
|
|
36
|
+
"dd-trace": "^4.11.1"
|
|
31
37
|
},
|
|
32
38
|
"dependencies": {
|
|
33
|
-
"@agoric/access-token": "0.4.22-other-dev-
|
|
34
|
-
"@agoric/
|
|
35
|
-
"@agoric/
|
|
36
|
-
"@agoric/
|
|
37
|
-
"@agoric/cosmic-proto": "0.
|
|
38
|
-
"@agoric/ertp": "0.16.3-other-dev-
|
|
39
|
-
"@agoric/
|
|
40
|
-
"@agoric/
|
|
41
|
-
"@agoric/
|
|
42
|
-
"@agoric/
|
|
43
|
-
"@agoric/
|
|
44
|
-
"@agoric/
|
|
45
|
-
"@agoric/
|
|
46
|
-
"@agoric/
|
|
47
|
-
"@
|
|
48
|
-
"@
|
|
49
|
-
"@
|
|
50
|
-
"@cosmjs/
|
|
51
|
-
"@cosmjs/
|
|
52
|
-
"@cosmjs/
|
|
53
|
-
"@
|
|
54
|
-
"@
|
|
55
|
-
"@endo/
|
|
56
|
-
"@endo/
|
|
57
|
-
"@endo/
|
|
58
|
-
"@endo/
|
|
59
|
-
"@endo/
|
|
60
|
-
"@endo/
|
|
39
|
+
"@agoric/access-token": "0.4.22-other-dev-3eb1a1d.0+3eb1a1d",
|
|
40
|
+
"@agoric/cache": "0.3.3-other-dev-3eb1a1d.0+3eb1a1d",
|
|
41
|
+
"@agoric/casting": "0.4.3-other-dev-3eb1a1d.0+3eb1a1d",
|
|
42
|
+
"@agoric/client-utils": "0.1.1-other-dev-3eb1a1d.0+3eb1a1d",
|
|
43
|
+
"@agoric/cosmic-proto": "0.4.1-other-dev-3eb1a1d.0+3eb1a1d",
|
|
44
|
+
"@agoric/ertp": "0.16.3-other-dev-3eb1a1d.0+3eb1a1d",
|
|
45
|
+
"@agoric/governance": "0.10.4-other-dev-3eb1a1d.0+3eb1a1d",
|
|
46
|
+
"@agoric/inter-protocol": "0.16.2-other-dev-3eb1a1d.0+3eb1a1d",
|
|
47
|
+
"@agoric/internal": "0.3.3-other-dev-3eb1a1d.0+3eb1a1d",
|
|
48
|
+
"@agoric/network": "0.1.1-other-dev-3eb1a1d.0+3eb1a1d",
|
|
49
|
+
"@agoric/smart-wallet": "0.5.4-other-dev-3eb1a1d.0+3eb1a1d",
|
|
50
|
+
"@agoric/store": "0.9.3-other-dev-3eb1a1d.0+3eb1a1d",
|
|
51
|
+
"@agoric/swingset-vat": "0.32.3-other-dev-3eb1a1d.0+3eb1a1d",
|
|
52
|
+
"@agoric/vats": "0.15.2-other-dev-3eb1a1d.0+3eb1a1d",
|
|
53
|
+
"@agoric/zoe": "0.26.3-other-dev-3eb1a1d.0+3eb1a1d",
|
|
54
|
+
"@agoric/zone": "0.2.3-other-dev-3eb1a1d.0+3eb1a1d",
|
|
55
|
+
"@confio/relayer": "^0.11.3",
|
|
56
|
+
"@cosmjs/crypto": "^0.32.3",
|
|
57
|
+
"@cosmjs/encoding": "^0.32.3",
|
|
58
|
+
"@cosmjs/math": "^0.32.3",
|
|
59
|
+
"@cosmjs/proto-signing": "^0.32.3",
|
|
60
|
+
"@cosmjs/stargate": "^0.32.3",
|
|
61
|
+
"@endo/bundle-source": "^3.5.0",
|
|
62
|
+
"@endo/captp": "^4.4.3",
|
|
63
|
+
"@endo/compartment-mapper": "^1.4.0",
|
|
64
|
+
"@endo/env-options": "^1.1.8",
|
|
65
|
+
"@endo/errors": "^1.2.8",
|
|
66
|
+
"@endo/far": "^1.1.9",
|
|
67
|
+
"@endo/init": "^1.1.7",
|
|
68
|
+
"@endo/marshal": "^1.6.2",
|
|
69
|
+
"@endo/nat": "^5.0.13",
|
|
70
|
+
"@endo/patterns": "^1.4.7",
|
|
71
|
+
"@endo/promise-kit": "^1.1.8",
|
|
72
|
+
"@endo/zip": "^1.0.9",
|
|
61
73
|
"@iarna/toml": "^2.2.3",
|
|
62
74
|
"anylogger": "^0.21.0",
|
|
63
75
|
"chalk": "^5.2.0",
|
|
64
|
-
"commander": "^
|
|
76
|
+
"commander": "^12.1.0",
|
|
65
77
|
"deterministic-json": "^1.0.5",
|
|
66
78
|
"esm": "agoric-labs/esm#Agoric-built",
|
|
67
79
|
"inquirer": "^8.2.2",
|
|
@@ -82,10 +94,13 @@
|
|
|
82
94
|
"homepage": "https://github.com/Agoric/agoric-sdk#readme",
|
|
83
95
|
"ava": {
|
|
84
96
|
"files": [
|
|
85
|
-
"test
|
|
97
|
+
"test/**/*.test.*"
|
|
86
98
|
],
|
|
87
99
|
"timeout": "2m",
|
|
88
100
|
"workerThreads": false
|
|
89
101
|
},
|
|
90
|
-
"
|
|
102
|
+
"typeCoverage": {
|
|
103
|
+
"atLeast": 77.54
|
|
104
|
+
},
|
|
105
|
+
"gitHead": "3eb1a1d2d75b2b4a94807cd3bf759bc9fc531f05"
|
|
91
106
|
}
|
package/src/anylogger-agoric.js
CHANGED
|
@@ -1,31 +1,46 @@
|
|
|
1
|
-
/*
|
|
1
|
+
/* eslint-env node */
|
|
2
|
+
import {
|
|
3
|
+
getEnvironmentOption,
|
|
4
|
+
getEnvironmentOptionsList,
|
|
5
|
+
} from '@endo/env-options';
|
|
2
6
|
import anylogger from 'anylogger';
|
|
3
7
|
import chalk from 'chalk';
|
|
4
8
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
const DEBUG_LIST = getEnvironmentOptionsList('DEBUG');
|
|
10
|
+
|
|
11
|
+
// Turn on debugging output with DEBUG=agoric or DEBUG=agoric:${level}
|
|
12
|
+
let selectedLevel =
|
|
13
|
+
DEBUG_LIST.length || getEnvironmentOption('DEBUG', 'unset') === 'unset'
|
|
14
|
+
? 'log'
|
|
15
|
+
: 'info';
|
|
16
|
+
for (const level of DEBUG_LIST) {
|
|
17
|
+
const parts = level.split(':');
|
|
18
|
+
if (parts[0] !== 'agoric') {
|
|
19
|
+
continue;
|
|
20
|
+
}
|
|
21
|
+
if (parts.length > 1) {
|
|
22
|
+
selectedLevel = parts[1];
|
|
23
|
+
} else {
|
|
24
|
+
selectedLevel = 'debug';
|
|
25
|
+
}
|
|
12
26
|
}
|
|
13
|
-
const
|
|
27
|
+
const selectedCode = anylogger.levels[selectedLevel];
|
|
28
|
+
const globalCode = selectedCode === undefined ? -Infinity : selectedCode;
|
|
14
29
|
|
|
15
30
|
const oldExt = anylogger.ext;
|
|
16
|
-
anylogger.ext = (l,
|
|
17
|
-
l = oldExt(l,
|
|
18
|
-
l.enabledFor = lvl =>
|
|
31
|
+
anylogger.ext = (l, ...rest) => {
|
|
32
|
+
l = oldExt(l, ...rest);
|
|
33
|
+
l.enabledFor = lvl => globalCode >= anylogger.levels[lvl];
|
|
19
34
|
|
|
20
35
|
const prefix = l.name.replace(/:/g, ': ');
|
|
21
36
|
for (const [level, code] of Object.entries(anylogger.levels)) {
|
|
22
|
-
if (
|
|
23
|
-
// Disable printing.
|
|
24
|
-
l[level] = () => {};
|
|
25
|
-
} else {
|
|
37
|
+
if (globalCode >= code) {
|
|
26
38
|
// Enable the printing with a prefix.
|
|
27
39
|
const doLog = l[level] || (() => {});
|
|
28
40
|
l[level] = (...args) => doLog(chalk.bold.blue(`${prefix}:`), ...args);
|
|
41
|
+
} else {
|
|
42
|
+
// Disable printing.
|
|
43
|
+
l[level] = () => {};
|
|
29
44
|
}
|
|
30
45
|
}
|
|
31
46
|
return l;
|
package/src/bin-agops.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
+
/* eslint-env node */
|
|
2
3
|
// @ts-check
|
|
3
4
|
// @jessie-check
|
|
4
5
|
|
|
5
|
-
|
|
6
|
-
/* global fetch, setTimeout */
|
|
6
|
+
import '@endo/init/pre.js';
|
|
7
7
|
|
|
8
|
-
import '@agoric/casting/node-fetch-shim.js';
|
|
9
8
|
import '@endo/init';
|
|
10
|
-
|
|
9
|
+
|
|
10
|
+
import { E } from '@endo/far';
|
|
11
11
|
|
|
12
12
|
import { execFileSync } from 'child_process';
|
|
13
13
|
import path from 'path';
|
|
@@ -15,7 +15,7 @@ import process from 'process';
|
|
|
15
15
|
import anylogger from 'anylogger';
|
|
16
16
|
import { Command, CommanderError, createCommand } from 'commander';
|
|
17
17
|
import { makeOracleCommand } from './commands/oracle.js';
|
|
18
|
-
import {
|
|
18
|
+
import { makeGovCommand } from './commands/gov.js';
|
|
19
19
|
import { makePsmCommand } from './commands/psm.js';
|
|
20
20
|
import { makeReserveCommand } from './commands/reserve.js';
|
|
21
21
|
import { makeVaultsCommand } from './commands/vaults.js';
|
|
@@ -31,7 +31,7 @@ const program = new Command();
|
|
|
31
31
|
program.name(progname).version('unversioned');
|
|
32
32
|
|
|
33
33
|
program.addCommand(makeOracleCommand(logger));
|
|
34
|
-
program.addCommand(
|
|
34
|
+
program.addCommand(makeGovCommand(logger));
|
|
35
35
|
program.addCommand(makePerfCommand(logger));
|
|
36
36
|
program.addCommand(makePsmCommand(logger));
|
|
37
37
|
program.addCommand(makeVaultsCommand(logger));
|
|
@@ -74,13 +74,11 @@ program.addCommand(makeAuctionCommand(logger, { ...procIO, fetch }));
|
|
|
74
74
|
program.addCommand(makeInterCommand(procIO, { fetch }));
|
|
75
75
|
program.addCommand(makeTestCommand(procIO, { fetch }));
|
|
76
76
|
|
|
77
|
-
|
|
78
|
-
await program.parseAsync(process.argv);
|
|
79
|
-
} catch (err) {
|
|
77
|
+
void E.when(program.parseAsync(process.argv), undefined, err => {
|
|
80
78
|
if (err instanceof CommanderError) {
|
|
81
79
|
console.error(err.message);
|
|
82
80
|
} else {
|
|
83
81
|
console.error(err); // CRASH! show stack trace
|
|
84
82
|
}
|
|
85
83
|
process.exit(1);
|
|
86
|
-
}
|
|
84
|
+
});
|
package/src/chain-config.js
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import djson from 'deterministic-json';
|
|
2
2
|
import TOML from '@iarna/toml';
|
|
3
|
+
import * as Tokens from '@agoric/internal/src/tokens.js';
|
|
3
4
|
|
|
4
5
|
export const STAKING_MAX_VALIDATORS = 150;
|
|
5
6
|
// Required for IBC connections not to time out.
|
|
@@ -13,38 +14,38 @@ export const ICA_HOST_ALLOW_MESSAGES = [
|
|
|
13
14
|
];
|
|
14
15
|
|
|
15
16
|
const Stake = /** @type {const} */ ({
|
|
16
|
-
name:
|
|
17
|
+
name: Tokens.Stake.proposedName,
|
|
17
18
|
description: 'The token used by delegates to stake on the Agoric chain',
|
|
18
19
|
denom_units: [
|
|
19
20
|
{
|
|
20
|
-
denom:
|
|
21
|
+
denom: Tokens.Stake.denom,
|
|
21
22
|
exponent: 0,
|
|
22
23
|
},
|
|
23
24
|
{
|
|
24
25
|
denom: 'bld',
|
|
25
|
-
exponent:
|
|
26
|
+
exponent: Tokens.Stake.displayInfo.decimalPlaces,
|
|
26
27
|
},
|
|
27
28
|
],
|
|
28
|
-
base:
|
|
29
|
+
base: Tokens.Stake.denom,
|
|
29
30
|
display: 'bld',
|
|
30
|
-
symbol:
|
|
31
|
+
symbol: Tokens.Stake.symbol,
|
|
31
32
|
});
|
|
32
33
|
const Stable = /** @type {const} */ ({
|
|
33
|
-
name:
|
|
34
|
+
name: Tokens.Stable.proposedName,
|
|
34
35
|
description: 'The stable token used by the Agoric chain',
|
|
35
36
|
denom_units: [
|
|
36
37
|
{
|
|
37
|
-
denom:
|
|
38
|
+
denom: Tokens.Stable.denom,
|
|
38
39
|
exponent: 0,
|
|
39
40
|
},
|
|
40
41
|
{
|
|
41
42
|
denom: 'ist',
|
|
42
|
-
exponent:
|
|
43
|
+
exponent: Tokens.Stable.displayInfo.decimalPlaces,
|
|
43
44
|
},
|
|
44
45
|
],
|
|
45
|
-
base:
|
|
46
|
+
base: Tokens.Stable.denom,
|
|
46
47
|
display: 'ist',
|
|
47
|
-
symbol:
|
|
48
|
+
symbol: Tokens.Stable.symbol,
|
|
48
49
|
});
|
|
49
50
|
export const DENOM_METADATA = /** @type {const} */ ([Stake, Stable]);
|
|
50
51
|
|
|
@@ -80,7 +81,12 @@ export const DEFAULT_RPC_PORT = 26657;
|
|
|
80
81
|
export const DEFAULT_PROM_PORT = 26660;
|
|
81
82
|
export const DEFAULT_API_PORT = 1317;
|
|
82
83
|
|
|
83
|
-
|
|
84
|
+
/**
|
|
85
|
+
* Rewrite the app.toml.
|
|
86
|
+
*
|
|
87
|
+
* @param {{ appToml: string, enableCors?: boolean, exportMetrics?: boolean, portNum?: string, chainId?: string, enableRosetta?: boolean, rosettaPort?: string }} input
|
|
88
|
+
* @returns {string} toml
|
|
89
|
+
*/
|
|
84
90
|
export function finishCosmosApp({
|
|
85
91
|
appToml,
|
|
86
92
|
enableCors,
|
|
@@ -91,6 +97,8 @@ export function finishCosmosApp({
|
|
|
91
97
|
rosettaPort = `${DEFAULT_ROSETTA_PORT}`,
|
|
92
98
|
}) {
|
|
93
99
|
const rpcPort = Number(portNum);
|
|
100
|
+
// TODO: Use an accurate narrow type.
|
|
101
|
+
/** @type {Record<string, any>} */
|
|
94
102
|
const app = TOML.parse(appToml);
|
|
95
103
|
|
|
96
104
|
if (enableCors) {
|
|
@@ -137,7 +145,12 @@ export function finishCosmosApp({
|
|
|
137
145
|
return TOML.stringify(app);
|
|
138
146
|
}
|
|
139
147
|
|
|
140
|
-
|
|
148
|
+
/**
|
|
149
|
+
* Rewrite the config.toml.
|
|
150
|
+
*
|
|
151
|
+
* @param {{ configToml: string, enableCors?: boolean, exportMetrics?: boolean, portNum?: string, persistentPeers?: string, seeds?: string, unconditionalPeerIds?: string }} input
|
|
152
|
+
* @returns {string} toml
|
|
153
|
+
*/
|
|
141
154
|
export function finishTendermintConfig({
|
|
142
155
|
configToml,
|
|
143
156
|
enableCors,
|
|
@@ -150,6 +163,8 @@ export function finishTendermintConfig({
|
|
|
150
163
|
const rpcPort = Number(portNum);
|
|
151
164
|
|
|
152
165
|
// Adjust the config.toml.
|
|
166
|
+
// TODO: Use an accurate narrow type.
|
|
167
|
+
/** @type {Record<string, any>} */
|
|
153
168
|
const config = TOML.parse(configToml);
|
|
154
169
|
|
|
155
170
|
config.proxy_app = 'kvstore';
|
|
@@ -188,7 +203,12 @@ export function finishTendermintConfig({
|
|
|
188
203
|
return TOML.stringify(config);
|
|
189
204
|
}
|
|
190
205
|
|
|
191
|
-
|
|
206
|
+
/**
|
|
207
|
+
* Rewrite/import the genesis.json.
|
|
208
|
+
*
|
|
209
|
+
* @param {{ genesisJson: string, exportedGenesisJson?: string }} input
|
|
210
|
+
* @returns {string} json
|
|
211
|
+
*/
|
|
192
212
|
export function finishCosmosGenesis({ genesisJson, exportedGenesisJson }) {
|
|
193
213
|
const genesis = JSON.parse(genesisJson);
|
|
194
214
|
const exported = exportedGenesisJson ? JSON.parse(exportedGenesisJson) : {};
|
|
@@ -235,7 +255,6 @@ export function finishCosmosGenesis({ genesisJson, exportedGenesisJson }) {
|
|
|
235
255
|
|
|
236
256
|
// Set the denomination for different modules.
|
|
237
257
|
genesis.app_state.mint.params.mint_denom = MINT_DENOM;
|
|
238
|
-
genesis.app_state.crisis.constant_fee.denom = MINT_DENOM;
|
|
239
258
|
genesis.app_state.gov.deposit_params.min_deposit = GOV_DEPOSIT_COINS;
|
|
240
259
|
genesis.app_state.gov.voting_params.voting_period = GOV_VOTING_PERIOD;
|
|
241
260
|
|
package/src/commands/auction.js
CHANGED
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
/* eslint-disable @jessie.js/no-nested-await */
|
|
2
1
|
// @ts-check
|
|
3
|
-
/* eslint-
|
|
2
|
+
/* eslint-env node */
|
|
4
3
|
import { InvalidArgumentError } from 'commander';
|
|
5
|
-
import {
|
|
4
|
+
import { Fail } from '@endo/errors';
|
|
5
|
+
import { makeVstorageKit } from '@agoric/client-utils';
|
|
6
6
|
import { outputActionAndHint } from '../lib/wallet.js';
|
|
7
|
+
import { getNetworkConfig } from '../lib/network-config.js';
|
|
7
8
|
|
|
8
|
-
|
|
9
|
+
/**
|
|
10
|
+
* @import {ParamTypesMap, ParamTypesMapFromRecord} from '@agoric/governance/src/contractGovernance/typedParamManager.js'
|
|
11
|
+
* @import {ParamValueForType} from '@agoric/governance/src/types.js'
|
|
12
|
+
*/
|
|
9
13
|
|
|
10
|
-
|
|
11
|
-
/** @template M @typedef {import('@agoric/governance/src/contractGovernance/typedParamManager.js').ParamTypesMapFromRecord<M>} ParamTypesMapFromRecord */
|
|
14
|
+
const networkConfig = await getNetworkConfig({ env: process.env, fetch });
|
|
12
15
|
|
|
13
16
|
/**
|
|
14
17
|
* @template {ParamTypesMap} M
|
|
@@ -59,11 +62,6 @@ export const makeAuctionCommand = (
|
|
|
59
62
|
'descending clock step size',
|
|
60
63
|
BigInt,
|
|
61
64
|
)
|
|
62
|
-
.option(
|
|
63
|
-
'--discount-step <integer>',
|
|
64
|
-
'proposed value (basis points)',
|
|
65
|
-
BigInt,
|
|
66
|
-
)
|
|
67
65
|
.requiredOption(
|
|
68
66
|
'--charterAcceptOfferId <string>',
|
|
69
67
|
'offer that had continuing invitation result',
|
|
@@ -91,14 +89,13 @@ export const makeAuctionCommand = (
|
|
|
91
89
|
* }} opts
|
|
92
90
|
*/
|
|
93
91
|
async opts => {
|
|
94
|
-
const { agoricNames,
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
// @ts-expect-error XXX should runtime check?
|
|
98
|
-
const { current } = await readLatestHead(
|
|
99
|
-
`published.auction.governance`,
|
|
92
|
+
const { agoricNames, readPublished } = await makeVstorageKit(
|
|
93
|
+
{ fetch },
|
|
94
|
+
networkConfig,
|
|
100
95
|
);
|
|
101
96
|
|
|
97
|
+
const { current } = await readPublished(`auction.governance`);
|
|
98
|
+
|
|
102
99
|
const {
|
|
103
100
|
AuctionStartDelay: {
|
|
104
101
|
value: { timerBrand },
|
|
@@ -111,7 +108,7 @@ export const makeAuctionCommand = (
|
|
|
111
108
|
* but TimeMath.toRel prodocues a RelativeTime (which may be a bare bigint).
|
|
112
109
|
*
|
|
113
110
|
* @param {bigint} relValue
|
|
114
|
-
* @returns {import('@agoric/time
|
|
111
|
+
* @returns {import('@agoric/time').RelativeTimeRecord}
|
|
115
112
|
*/
|
|
116
113
|
const toRel = relValue => ({ timerBrand, relValue });
|
|
117
114
|
|
|
@@ -130,6 +127,8 @@ export const makeAuctionCommand = (
|
|
|
130
127
|
};
|
|
131
128
|
|
|
132
129
|
if (Object.keys(params).length === 0) {
|
|
130
|
+
// InvalidArgumentError is a class constructor, and so
|
|
131
|
+
// must be invoked with `new`.
|
|
133
132
|
throw new InvalidArgumentError(`no parameters given`);
|
|
134
133
|
}
|
|
135
134
|
|