@agoric/orchestration 0.1.1-dev-42a6f7b.0 → 0.1.1-dev-3921619.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 +2 -2
- package/src/utils/agd-lib.d.ts +0 -1
- package/src/utils/agd-lib.d.ts.map +1 -1
- package/src/utils/agd-lib.js +9 -18
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agoric/orchestration",
|
|
3
|
-
"version": "0.1.1-dev-
|
|
3
|
+
"version": "0.1.1-dev-3921619.0+3921619",
|
|
4
4
|
"description": "Chain abstraction for Agoric's orchestration clients",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "index.js",
|
|
@@ -105,5 +105,5 @@
|
|
|
105
105
|
"typeCoverage": {
|
|
106
106
|
"atLeast": 97.7
|
|
107
107
|
},
|
|
108
|
-
"gitHead": "
|
|
108
|
+
"gitHead": "3921619362142ca037d689fd57238fb3f802a8c4"
|
|
109
109
|
}
|
package/src/utils/agd-lib.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agd-lib.d.ts","sourceRoot":"","sources":["agd-lib.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"agd-lib.d.ts","sourceRoot":"","sources":["agd-lib.js"],"names":[],"mappings":"AAkBO,+CAFI;IAAE,YAAY,EAAE,QAAQ,CAAC;IAAC,GAAG,CAAC,EAAE,OAAO,OAAO,CAAC,GAAG,CAAA;CAAE;;;QAmCzD;;;;;WAKG;uBAJQ,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,CAAC,GAC/C,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,GAC5B,CAAC,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,EAAE,IAAI,EAAE,MAAM,C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,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,EAAE,IAAI,EAAE,MAAM,CAAC,GAC1D,CAAC,GAAG,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,CAAC;;;QAiBtC;;;;WAIG;0BADQ,MAAM,EAAE;;;QAuDjB;;;WAGG;oBAFQ,MAAM,YACN,MAAM;+BAzDR,MAAM,EAAE;QAmEjB,2BAA2B;uBAAf,MAAM;;IAKpB;;OAEG;qBADQ,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC;sBAzEvB,MAAM,EAAE;;mBAvBR,CAAC,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,GAAG,CAAC,GAC/C,CAAC,IAAI,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,CAAC,GAC5B,CAAC,GAAG,EAAE,UAAU,EAAE,IAAI,EAAE,MAAM,GAAG,UAAU,EAAE,IAAI,EAAE,MAAM,CAAC,GAC1D,CAAC,GAAG,EAAE,KAAK,EAAE,GAAG,IAAI,EAAE,MAAM,EAAE,CAAC;IAoCtC;;;;;OAKG;iBAFQ,MAAM,EAAE,0BACR;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,IAAI,EAAE,MAAM,CAAC;QAAC,GAAG,CAAC,EAAE,OAAO,CAAA;KAAE;GA8DhC"}
|
package/src/utils/agd-lib.js
CHANGED
|
@@ -1,22 +1,10 @@
|
|
|
1
1
|
import assert from 'node:assert';
|
|
2
|
+
import { toCLIOptions } from '@agoric/internal/src/cli-utils.js';
|
|
2
3
|
|
|
3
4
|
const { freeze } = Object;
|
|
4
5
|
|
|
5
6
|
const agdBinary = 'agd';
|
|
6
7
|
|
|
7
|
-
/**
|
|
8
|
-
* @param {Record<string, unknown>} record - e.g. { color: 'blue' }
|
|
9
|
-
* @returns {string[]} - e.g. ['--color', 'blue']
|
|
10
|
-
*/
|
|
11
|
-
export const flags = record => {
|
|
12
|
-
// TODO? support --yes with boolean?
|
|
13
|
-
|
|
14
|
-
/** @type {[string, string][]} */
|
|
15
|
-
// @ts-expect-error undefined is filtered out
|
|
16
|
-
const skipUndef = Object.entries(record).filter(([_k, v]) => v !== undefined);
|
|
17
|
-
return skipUndef.map(([k, v]) => [`--${k}`, v]).flat();
|
|
18
|
-
};
|
|
19
|
-
|
|
20
8
|
/**
|
|
21
9
|
* @callback ExecSync
|
|
22
10
|
* @param {string} file
|
|
@@ -37,7 +25,10 @@ export const makeAgd = ({ execFileSync, log = console.log }) => {
|
|
|
37
25
|
* }} opts
|
|
38
26
|
*/
|
|
39
27
|
const make = ({ home, keyringBackend, rpcAddrs } = {}) => {
|
|
40
|
-
const keyringArgs =
|
|
28
|
+
const keyringArgs = toCLIOptions({
|
|
29
|
+
home,
|
|
30
|
+
'keyring-backend': keyringBackend,
|
|
31
|
+
});
|
|
41
32
|
if (rpcAddrs) {
|
|
42
33
|
assert.equal(
|
|
43
34
|
rpcAddrs.length,
|
|
@@ -45,7 +36,7 @@ export const makeAgd = ({ execFileSync, log = console.log }) => {
|
|
|
45
36
|
'XXX rpcAddrs must contain only one entry',
|
|
46
37
|
);
|
|
47
38
|
}
|
|
48
|
-
const nodeArgs =
|
|
39
|
+
const nodeArgs = toCLIOptions({ node: rpcAddrs && rpcAddrs[0] });
|
|
49
40
|
|
|
50
41
|
/**
|
|
51
42
|
* @param {string[]} args
|
|
@@ -54,7 +45,7 @@ export const makeAgd = ({ execFileSync, log = console.log }) => {
|
|
|
54
45
|
const exec = (args, opts = { encoding: 'utf-8' }) =>
|
|
55
46
|
execFileSync(agdBinary, args, opts);
|
|
56
47
|
|
|
57
|
-
const outJson =
|
|
48
|
+
const outJson = toCLIOptions({ output: 'json' });
|
|
58
49
|
|
|
59
50
|
const ro = freeze({
|
|
60
51
|
status: async () => JSON.parse(exec([...nodeArgs, 'status'])),
|
|
@@ -110,8 +101,8 @@ export const makeAgd = ({ execFileSync, log = console.log }) => {
|
|
|
110
101
|
...txArgs,
|
|
111
102
|
...nodeArgs,
|
|
112
103
|
...keyringArgs,
|
|
113
|
-
...
|
|
114
|
-
...
|
|
104
|
+
...toCLIOptions({ 'chain-id': chainId, from }),
|
|
105
|
+
...toCLIOptions({
|
|
115
106
|
'broadcast-mode': 'block',
|
|
116
107
|
gas: 'auto',
|
|
117
108
|
'gas-adjustment': '1.4',
|