@agoric/builders 0.1.1-dev-5954931.0.5954931 → 0.1.1-dev-754cd9e.0.754cd9e
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/builders",
|
|
3
|
-
"version": "0.1.1-dev-
|
|
3
|
+
"version": "0.1.1-dev-754cd9e.0.754cd9e",
|
|
4
4
|
"description": "Build scripts for proposals to an Agoric chain",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./index.js",
|
|
@@ -23,33 +23,34 @@
|
|
|
23
23
|
"author": "Agoric",
|
|
24
24
|
"license": "Apache-2.0",
|
|
25
25
|
"dependencies": {
|
|
26
|
-
"@agoric/ertp": "0.16.3-dev-
|
|
27
|
-
"@agoric/internal": "0.3.3-dev-
|
|
28
|
-
"@agoric/notifier": "0.6.3-dev-
|
|
29
|
-
"@agoric/smart-wallet": "0.5.4-dev-
|
|
30
|
-
"@agoric/vat-data": "0.5.3-dev-
|
|
31
|
-
"@agoric/vats": "0.15.2-dev-
|
|
32
|
-
"@agoric/zoe": "0.26.3-dev-
|
|
26
|
+
"@agoric/ertp": "0.16.3-dev-754cd9e.0.754cd9e",
|
|
27
|
+
"@agoric/internal": "0.3.3-dev-754cd9e.0.754cd9e",
|
|
28
|
+
"@agoric/notifier": "0.6.3-dev-754cd9e.0.754cd9e",
|
|
29
|
+
"@agoric/smart-wallet": "0.5.4-dev-754cd9e.0.754cd9e",
|
|
30
|
+
"@agoric/vat-data": "0.5.3-dev-754cd9e.0.754cd9e",
|
|
31
|
+
"@agoric/vats": "0.15.2-dev-754cd9e.0.754cd9e",
|
|
32
|
+
"@agoric/zoe": "0.26.3-dev-754cd9e.0.754cd9e",
|
|
33
33
|
"@endo/bundle-source": "^4.1.2",
|
|
34
34
|
"@endo/captp": "^4.4.8",
|
|
35
35
|
"@endo/eventual-send": "^1.3.4",
|
|
36
36
|
"@endo/far": "^1.1.14",
|
|
37
37
|
"@endo/init": "^1.1.12",
|
|
38
38
|
"@endo/marshal": "^1.8.0",
|
|
39
|
+
"@endo/nat": "^5.1.3",
|
|
39
40
|
"@endo/patterns": "^1.7.0",
|
|
40
41
|
"@endo/promise-kit": "^1.1.13",
|
|
41
42
|
"@endo/stream": "^1.2.13",
|
|
42
43
|
"import-meta-resolve": "^4.1.0"
|
|
43
44
|
},
|
|
44
45
|
"devDependencies": {
|
|
45
|
-
"@agoric/deploy-script-support": "0.10.4-dev-
|
|
46
|
-
"@agoric/governance": "0.10.4-dev-
|
|
47
|
-
"@agoric/inter-protocol": "0.16.2-dev-
|
|
48
|
-
"@agoric/orchestration": "0.1.1-dev-
|
|
49
|
-
"@agoric/store": "0.9.3-dev-
|
|
50
|
-
"@agoric/swing-store": "0.9.2-dev-
|
|
51
|
-
"@agoric/swingset-liveslots": "0.10.3-dev-
|
|
52
|
-
"@agoric/time": "0.3.3-dev-
|
|
46
|
+
"@agoric/deploy-script-support": "0.10.4-dev-754cd9e.0.754cd9e",
|
|
47
|
+
"@agoric/governance": "0.10.4-dev-754cd9e.0.754cd9e",
|
|
48
|
+
"@agoric/inter-protocol": "0.16.2-dev-754cd9e.0.754cd9e",
|
|
49
|
+
"@agoric/orchestration": "0.1.1-dev-754cd9e.0.754cd9e",
|
|
50
|
+
"@agoric/store": "0.9.3-dev-754cd9e.0.754cd9e",
|
|
51
|
+
"@agoric/swing-store": "0.9.2-dev-754cd9e.0.754cd9e",
|
|
52
|
+
"@agoric/swingset-liveslots": "0.10.3-dev-754cd9e.0.754cd9e",
|
|
53
|
+
"@agoric/time": "0.3.3-dev-754cd9e.0.754cd9e",
|
|
53
54
|
"@endo/errors": "^1.2.13",
|
|
54
55
|
"ava": "^5.3.0",
|
|
55
56
|
"c8": "^10.1.3"
|
|
@@ -82,5 +83,5 @@
|
|
|
82
83
|
"typeCoverage": {
|
|
83
84
|
"atLeast": 89.94
|
|
84
85
|
},
|
|
85
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "754cd9e5fe69ad4921eb057140c1384f173bb4be"
|
|
86
87
|
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
/* eslint-env node */
|
|
2
|
+
import { parseArgs } from 'node:util';
|
|
3
|
+
import { isNat } from '@endo/nat';
|
|
4
|
+
import { makeHelpers } from '@agoric/deploy-script-support';
|
|
5
|
+
import { getManifestForInviteWithdrawer } from '@agoric/inter-protocol/src/proposals/withdraw-reserve-proposal.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* @template {{ type: string }} T
|
|
9
|
+
* @typedef { T['type'] extends 'string' ? string : T['type'] extends 'boolean' ? boolean : (string | boolean) } TypeFromParseArgsOptionDescriptor
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
/**
|
|
13
|
+
* @template {Record<string, { type: string, multiple?: boolean }>} T
|
|
14
|
+
* @typedef {{
|
|
15
|
+
* [K in keyof T]: (
|
|
16
|
+
* T[K]['multiple'] extends true
|
|
17
|
+
* ? TypeFromParseArgsOptionDescriptor<T[K]>[]
|
|
18
|
+
* : T[K]['multiple'] extends (false | unknown)
|
|
19
|
+
* ? TypeFromParseArgsOptionDescriptor<T[K]>
|
|
20
|
+
* : (TypeFromParseArgsOptionDescriptor<T[K]>[] | TypeFromParseArgsOptionDescriptor<T[K]>)
|
|
21
|
+
* )
|
|
22
|
+
* }} CliOptions
|
|
23
|
+
*/
|
|
24
|
+
|
|
25
|
+
const { Fail } = assert;
|
|
26
|
+
|
|
27
|
+
const cliOptions = /** @type {const} */ ({
|
|
28
|
+
address: { type: 'string', multiple: false },
|
|
29
|
+
count: { type: 'string', multiple: false },
|
|
30
|
+
});
|
|
31
|
+
|
|
32
|
+
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').CoreEvalBuilder} */
|
|
33
|
+
export const defaultProposalBuilder = async (
|
|
34
|
+
{ publishRef: _publishRef, install: _install },
|
|
35
|
+
namedArgs = {},
|
|
36
|
+
) => {
|
|
37
|
+
const { address, count } = namedArgs;
|
|
38
|
+
|
|
39
|
+
typeof address === 'string' || Fail`string address is required`;
|
|
40
|
+
if (count !== undefined) {
|
|
41
|
+
isNat(count) || Fail`count must be a safe natural number`;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return harden({
|
|
45
|
+
sourceSpec:
|
|
46
|
+
'@agoric/inter-protocol/src/proposals/withdraw-reserve-proposal.js',
|
|
47
|
+
getManifestCall: [getManifestForInviteWithdrawer.name, { address, count }],
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
/** @type {import('@agoric/deploy-script-support/src/externalTypes.js').DeployScriptFunction} */
|
|
52
|
+
export default async (homeP, endowments) => {
|
|
53
|
+
const { scriptArgs: argv } = endowments;
|
|
54
|
+
/** @type {{ values: Partial<CliOptions<typeof cliOptions>> }} */
|
|
55
|
+
const { values: rawArgs } = parseArgs({ args: argv, options: cliOptions });
|
|
56
|
+
const { address, count: rawCount } = rawArgs;
|
|
57
|
+
const count = (() => {
|
|
58
|
+
if (rawCount === undefined) return undefined;
|
|
59
|
+
/[0-9]/.test(rawCount) || Fail`--count value must be numeric`;
|
|
60
|
+
return +rawCount;
|
|
61
|
+
})();
|
|
62
|
+
const namedArgs = { address, count };
|
|
63
|
+
|
|
64
|
+
const { writeCoreEval } = await makeHelpers(homeP, endowments);
|
|
65
|
+
await writeCoreEval('withdraw-reserve', utils =>
|
|
66
|
+
defaultProposalBuilder(utils, namedArgs),
|
|
67
|
+
);
|
|
68
|
+
};
|