@hyperlane-xyz/cli 1.4.3-beta0 → 1.4.3-beta2
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/dist/cli.js +0 -0
- package/dist/src/commands/config.d.ts.map +1 -1
- package/dist/src/commands/config.js +66 -55
- package/dist/src/commands/config.js.map +1 -1
- package/dist/src/commands/deploy.js +2 -2
- package/dist/src/commands/deploy.js.map +1 -1
- package/dist/src/commands/options.d.ts +2 -0
- package/dist/src/commands/options.d.ts.map +1 -1
- package/dist/src/commands/options.js +13 -0
- package/dist/src/commands/options.js.map +1 -1
- package/dist/src/commands/send.js +4 -4
- package/dist/src/commands/send.js.map +1 -1
- package/dist/src/config/chain.d.ts +6 -0
- package/dist/src/config/chain.d.ts.map +1 -0
- package/dist/src/config/chain.js +48 -0
- package/dist/src/config/chain.js.map +1 -0
- package/dist/src/config/multisig.d.ts +7 -0
- package/dist/src/config/multisig.d.ts.map +1 -0
- package/dist/src/config/multisig.js +57 -0
- package/dist/src/config/multisig.js.map +1 -0
- package/dist/src/configs.d.ts +43 -111
- package/dist/src/configs.d.ts.map +1 -1
- package/dist/src/configs.js +27 -10
- package/dist/src/configs.js.map +1 -1
- package/dist/src/context.d.ts +3 -57
- package/dist/src/context.d.ts.map +1 -1
- package/dist/src/context.js +2 -1
- package/dist/src/context.js.map +1 -1
- package/dist/src/deploy/TestRecipientDeployer.d.ts +3 -3
- package/dist/src/deploy/TestRecipientDeployer.d.ts.map +1 -1
- package/dist/src/deploy/TestRecipientDeployer.js +2 -2
- package/dist/src/deploy/TestRecipientDeployer.js.map +1 -1
- package/dist/src/deploy/core.d.ts.map +1 -1
- package/dist/src/deploy/core.js +30 -68
- package/dist/src/deploy/core.js.map +1 -1
- package/dist/src/deploy/types.d.ts +4 -4
- package/dist/src/deploy/types.d.ts.map +1 -1
- package/dist/src/deploy/utils.d.ts.map +1 -1
- package/dist/src/deploy/utils.js +1 -1
- package/dist/src/deploy/utils.js.map +1 -1
- package/dist/src/deploy/warp.d.ts.map +1 -1
- package/dist/src/deploy/warp.js +3 -2
- package/dist/src/deploy/warp.js.map +1 -1
- package/dist/src/send/message.d.ts +2 -2
- package/dist/src/send/message.d.ts.map +1 -1
- package/dist/src/send/message.js +9 -16
- package/dist/src/send/message.js.map +1 -1
- package/dist/src/send/transfer.d.ts +4 -4
- package/dist/src/send/transfer.d.ts.map +1 -1
- package/dist/src/send/transfer.js +6 -16
- package/dist/src/send/transfer.js.map +1 -1
- package/dist/src/utils/balances.d.ts +2 -2
- package/dist/src/utils/balances.d.ts.map +1 -1
- package/dist/src/utils/balances.js.map +1 -1
- package/dist/src/utils/chains.d.ts +9 -0
- package/dist/src/utils/chains.d.ts.map +1 -0
- package/dist/src/utils/chains.js +57 -0
- package/dist/src/utils/chains.js.map +1 -0
- package/dist/src/utils/files.js +1 -1
- package/dist/src/utils/files.js.map +1 -1
- package/examples/multisig-ism.yaml +10 -10
- package/examples/warp-tokens.yaml +3 -2
- package/package.json +3 -3
package/dist/cli.js
CHANGED
|
File without changes
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/commands/config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../../src/commands/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,OAAO,CAAC;AActC;;GAEG;AACH,eAAO,MAAM,aAAa,EAAE,aAU3B,CAAC"}
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import { mergeYamlOrJson } from '../utils/files.js';
|
|
1
|
+
import { createChainConfig } from '../config/chain.js';
|
|
2
|
+
import { createMultisigConfig } from '../config/multisig.js';
|
|
3
|
+
import { readChainConfig, readMultisigConfig } from '../configs.js';
|
|
4
|
+
import { log } from '../logger.js';
|
|
5
|
+
import { chainsCommandOption, fileFormatOption, outputFileOption, } from './options.js';
|
|
7
6
|
/**
|
|
8
7
|
* Parent command
|
|
9
8
|
*/
|
|
@@ -15,70 +14,67 @@ export const configCommand = {
|
|
|
15
14
|
.command(validateCommand)
|
|
16
15
|
.version(false)
|
|
17
16
|
.demandCommand(),
|
|
18
|
-
handler: () =>
|
|
17
|
+
handler: () => log('Command required'),
|
|
19
18
|
};
|
|
20
19
|
/**
|
|
21
|
-
* Create
|
|
20
|
+
* Create commands
|
|
22
21
|
*/
|
|
23
22
|
const createCommand = {
|
|
24
23
|
command: 'create',
|
|
25
|
-
describe: 'Create a new
|
|
24
|
+
describe: 'Create a new Hyperlane config',
|
|
25
|
+
builder: (yargs) => yargs
|
|
26
|
+
.command(createChainCommand)
|
|
27
|
+
.command(createMultisigCommand)
|
|
28
|
+
.version(false)
|
|
29
|
+
.demandCommand(),
|
|
30
|
+
handler: () => log('Command required'),
|
|
31
|
+
};
|
|
32
|
+
const createChainCommand = {
|
|
33
|
+
command: 'chain',
|
|
34
|
+
describe: 'Create a new, minimal Hyperlane chain config (aka chain metadata)',
|
|
26
35
|
builder: (yargs) => yargs.options({
|
|
27
|
-
output:
|
|
28
|
-
|
|
29
|
-
alias: 'o',
|
|
30
|
-
description: 'Output file path',
|
|
31
|
-
},
|
|
32
|
-
format: {
|
|
33
|
-
type: 'string',
|
|
34
|
-
alias: 'f',
|
|
35
|
-
description: 'Output file format',
|
|
36
|
-
choices: ['json', 'yaml'],
|
|
37
|
-
},
|
|
36
|
+
output: outputFileOption('./configs/chain-config.yaml'),
|
|
37
|
+
format: fileFormatOption,
|
|
38
38
|
}),
|
|
39
39
|
handler: async (argv) => {
|
|
40
|
-
const format = argv.format
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
const
|
|
58
|
-
|
|
59
|
-
name,
|
|
60
|
-
chainId: parseInt(chainId, 10),
|
|
61
|
-
domainId: parseInt(domainId, 10),
|
|
62
|
-
protocol,
|
|
63
|
-
rpcUrls: [{ http: rpcUrl }],
|
|
64
|
-
};
|
|
65
|
-
if (isValidChainMetadata(metadata)) {
|
|
66
|
-
logGreen(`Chain config is valid, writing to file ${output}`);
|
|
67
|
-
mergeYamlOrJson(output, { [name]: metadata }, format);
|
|
68
|
-
}
|
|
69
|
-
else {
|
|
70
|
-
errorRed(`Chain config is invalid, please see https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/typescript/cli/examples/chain-config.yaml for an example`);
|
|
71
|
-
throw new Error('Invalid chain config');
|
|
72
|
-
}
|
|
40
|
+
const format = argv.format;
|
|
41
|
+
const outPath = argv.output;
|
|
42
|
+
await createChainConfig({ format, outPath });
|
|
43
|
+
process.exit(0);
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
const createMultisigCommand = {
|
|
47
|
+
command: 'multisig',
|
|
48
|
+
describe: 'Create a new Multisig ISM config',
|
|
49
|
+
builder: (yargs) => yargs.options({
|
|
50
|
+
output: outputFileOption('./configs/multisig-ism.yaml'),
|
|
51
|
+
format: fileFormatOption,
|
|
52
|
+
chains: chainsCommandOption,
|
|
53
|
+
}),
|
|
54
|
+
handler: async (argv) => {
|
|
55
|
+
const format = argv.format;
|
|
56
|
+
const outPath = argv.output;
|
|
57
|
+
const chainConfigPath = argv.chains;
|
|
58
|
+
await createMultisigConfig({ format, outPath, chainConfigPath });
|
|
73
59
|
process.exit(0);
|
|
74
60
|
},
|
|
75
61
|
};
|
|
76
62
|
/**
|
|
77
|
-
* Validate
|
|
63
|
+
* Validate commands
|
|
78
64
|
*/
|
|
79
65
|
const validateCommand = {
|
|
80
66
|
command: 'validate',
|
|
81
|
-
describe: 'Validate
|
|
67
|
+
describe: 'Validate a config in a YAML or JSON file',
|
|
68
|
+
builder: (yargs) => yargs
|
|
69
|
+
.command(validateChainCommand)
|
|
70
|
+
.command(validateMultisigCommand)
|
|
71
|
+
.version(false)
|
|
72
|
+
.demandCommand(),
|
|
73
|
+
handler: () => log('Command required'),
|
|
74
|
+
};
|
|
75
|
+
const validateChainCommand = {
|
|
76
|
+
command: 'chain',
|
|
77
|
+
describe: 'Validate a chain config in a YAML or JSON file',
|
|
82
78
|
builder: (yargs) => yargs.options({
|
|
83
79
|
path: {
|
|
84
80
|
type: 'string',
|
|
@@ -91,4 +87,19 @@ const validateCommand = {
|
|
|
91
87
|
readChainConfig(path);
|
|
92
88
|
},
|
|
93
89
|
};
|
|
90
|
+
const validateMultisigCommand = {
|
|
91
|
+
command: 'multisig',
|
|
92
|
+
describe: 'Validate a multisig ism config in a YAML or JSON file',
|
|
93
|
+
builder: (yargs) => yargs.options({
|
|
94
|
+
path: {
|
|
95
|
+
type: 'string',
|
|
96
|
+
description: 'Input file path',
|
|
97
|
+
demandOption: true,
|
|
98
|
+
},
|
|
99
|
+
}),
|
|
100
|
+
handler: async (argv) => {
|
|
101
|
+
const path = argv.path;
|
|
102
|
+
readMultisigConfig(path);
|
|
103
|
+
},
|
|
104
|
+
};
|
|
94
105
|
//# sourceMappingURL=config.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/commands/config.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../../src/commands/config.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAE,oBAAoB,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,MAAM,eAAe,CAAC;AACpE,OAAO,EAAE,GAAG,EAAE,MAAM,cAAc,CAAC;AAGnC,OAAO,EACL,mBAAmB,EACnB,gBAAg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AAK,EAAE,IAAI,EAAE,EAAE;QACtB,MAAM,IAAI,GAAG,IAAI,CAAC,IAAc,CAAC;QACjC,eAAe,CAAC,IAAI,CAAC,CAAC;IACxB,CAAC;CACF,CAAC;AAEF,MAAM,uBAAuB,GAAkB;IAC7C,OAAO,EAAE,UAAU;IACnB,QAAQ,EAAE,uDAAuD;IACjE,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CACjB,KAAK,CAAC,OAAO,CAAC;QACZ,IAAI,EAAE;YACJ,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,iBAAiB;YAC9B,YAAY,EAAE,IAAI;SACnB;KACF,CAAC;IACJ,OAAO,EAAE,KAAK,EAAE,IAAI,EAAE,EAAE;QACtB,MAAM,IAAI,GAAG,IAAI,CAAC,IAAc,CAAC;QACjC,kBAAkB,CAAC,IAAI,CAAC,CAAC;IAC3B,CAAC;CACF,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { runCoreDeploy } from '../deploy/core.js';
|
|
2
2
|
import { runWarpDeploy } from '../deploy/warp.js';
|
|
3
|
-
import { logGray } from '../logger.js';
|
|
3
|
+
import { log, logGray } from '../logger.js';
|
|
4
4
|
import { chainsCommandOption, coreArtifactsOption, keyCommandOption, outDirCommandOption, } from './options.js';
|
|
5
5
|
/**
|
|
6
6
|
* Parent command
|
|
@@ -13,7 +13,7 @@ export const deployCommand = {
|
|
|
13
13
|
.command(warpCommand)
|
|
14
14
|
.version(false)
|
|
15
15
|
.demandCommand(),
|
|
16
|
-
handler: () =>
|
|
16
|
+
handler: () => log('Command required'),
|
|
17
17
|
};
|
|
18
18
|
/**
|
|
19
19
|
* Core command
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deploy.js","sourceRoot":"","sources":["../../../src/commands/deploy.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAClD,OAAO,EAAE,aAAa,EAAE,MAAM,mBAAmB,CA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,CAAC;QAC5C,MAAM,OAAO,GAAW,IAAI,CAAC,GAAG,CAAC;QACjC,MAAM,aAAa,CAAC,EAAE,GAAG,EAAE,eAAe,EAAE,OAAO,EAAE,CAAC,CAAC;QACvD,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;CACF,CAAC;AAEF;;GAEG;AACH,MAAM,WAAW,GAAkB;IACjC,OAAO,EAAE,MAAM;IACf,QAAQ,EAAE,6BAA6B;IACvC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE,CACjB,KAAK,CAAC,OAAO,CAAC;QACZ,GAAG,EAAE,gBAAgB;QACrB,MAAM,EAAE,mBAAmB;QAC3B,GAAG,EAAE,mBAAmB;QACxB,IAAI,EAAE,mBAAmB;QACzB,MAAM,EAAE;YACN,IAAI,EAAE,QAAQ;YACd,WAAW,EAAE,mDAAmD;YAChE,OAAO,EAAE,4BAA4B;SACtC;KACF,CAAC;IACJ,OAAO,EAAE,KAAK,EAAE,IAAS,EAAE,EAAE;QAC3B,MAAM,GAAG,GAAW,IAAI,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;QACpD,MAAM,eAAe,GAAW,IAAI,CAAC,MAAM,CAAC;QAC5C,MAAM,cAAc,GAAW,IAAI,CAAC,MAAM,CAAC;QAC3C,MAAM,iBAAiB,GAAW,IAAI,CAAC,IAAI,CAAC;QAC5C,MAAM,OAAO,GAAW,IAAI,CAAC,GAAG,CAAC;QACjC,MAAM,aAAa,CAAC;YAClB,GAAG;YACH,eAAe;YACf,cAAc;YACd,iBAAiB;YACjB,OAAO;SACR,CAAC,CAAC;QACH,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;CACF,CAAC"}
|
|
@@ -3,4 +3,6 @@ export declare const keyCommandOption: Options;
|
|
|
3
3
|
export declare const chainsCommandOption: Options;
|
|
4
4
|
export declare const outDirCommandOption: Options;
|
|
5
5
|
export declare const coreArtifactsOption: Options;
|
|
6
|
+
export declare const fileFormatOption: Options;
|
|
7
|
+
export declare const outputFileOption: (defaultPath: string) => Options;
|
|
6
8
|
//# sourceMappingURL=options.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../src/commands/options.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEhC,eAAO,MAAM,gBAAgB,EAAE,OAI9B,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,OAIjC,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,OAIjC,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,OAGjC,CAAC"}
|
|
1
|
+
{"version":3,"file":"options.d.ts","sourceRoot":"","sources":["../../../src/commands/options.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAEhC,eAAO,MAAM,gBAAgB,EAAE,OAI9B,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,OAIjC,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,OAIjC,CAAC;AAEF,eAAO,MAAM,mBAAmB,EAAE,OAGjC,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,OAM9B,CAAC;AAEF,eAAO,MAAM,gBAAgB,gBAAiB,MAAM,KAAG,OAKrD,CAAC"}
|
|
@@ -16,4 +16,17 @@ export const coreArtifactsOption = {
|
|
|
16
16
|
type: 'string',
|
|
17
17
|
description: 'File path to core deployment output artifacts',
|
|
18
18
|
};
|
|
19
|
+
export const fileFormatOption = {
|
|
20
|
+
type: 'string',
|
|
21
|
+
alias: 'f',
|
|
22
|
+
description: 'Output file format',
|
|
23
|
+
choices: ['json', 'yaml'],
|
|
24
|
+
default: 'yaml',
|
|
25
|
+
};
|
|
26
|
+
export const outputFileOption = (defaultPath) => ({
|
|
27
|
+
type: 'string',
|
|
28
|
+
alias: 'o',
|
|
29
|
+
description: 'Output file path',
|
|
30
|
+
default: defaultPath,
|
|
31
|
+
});
|
|
19
32
|
//# sourceMappingURL=options.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"options.js","sourceRoot":"","sources":["../../../src/commands/options.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,gBAAgB,GAAY;IACvC,IAAI,EAAE,QAAQ;IACd,WAAW,EACT,sFAAsF;CACzF,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAY;IAC1C,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,mDAAmD;IAChE,OAAO,EAAE,6BAA6B;CACvC,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAY;IAC1C,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,sCAAsC;IACnD,OAAO,EAAE,aAAa;CACvB,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAY;IAC1C,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,+CAA+C;CAC7D,CAAC"}
|
|
1
|
+
{"version":3,"file":"options.js","sourceRoot":"","sources":["../../../src/commands/options.ts"],"names":[],"mappings":"AAGA,MAAM,CAAC,MAAM,gBAAgB,GAAY;IACvC,IAAI,EAAE,QAAQ;IACd,WAAW,EACT,sFAAsF;CACzF,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAY;IAC1C,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,mDAAmD;IAChE,OAAO,EAAE,6BAA6B;CACvC,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAY;IAC1C,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,sCAAsC;IACnD,OAAO,EAAE,aAAa;CACvB,CAAC;AAEF,MAAM,CAAC,MAAM,mBAAmB,GAAY;IAC1C,IAAI,EAAE,QAAQ;IACd,WAAW,EAAE,+CAA+C;CAC7D,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAY;IACvC,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,GAAG;IACV,WAAW,EAAE,oBAAoB;IACjC,OAAO,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC;IACzB,OAAO,EAAE,MAAM;CAChB,CAAC;AAEF,MAAM,CAAC,MAAM,gBAAgB,GAAG,CAAC,WAAmB,EAAW,EAAE,CAAC,CAAC;IACjE,IAAI,EAAE,QAAQ;IACd,KAAK,EAAE,GAAG;IACV,WAAW,EAAE,kBAAkB;IAC/B,OAAO,EAAE,WAAW;CACrB,CAAC,CAAC"}
|
|
@@ -48,14 +48,14 @@ const messageCommand = {
|
|
|
48
48
|
const coreArtifactsPath = argv.core;
|
|
49
49
|
const origin = argv.origin;
|
|
50
50
|
const destination = argv.destination;
|
|
51
|
-
const
|
|
51
|
+
const timeoutSec = argv.timeout;
|
|
52
52
|
await sendTestMessage({
|
|
53
53
|
key,
|
|
54
54
|
chainConfigPath,
|
|
55
55
|
coreArtifactsPath,
|
|
56
56
|
origin,
|
|
57
57
|
destination,
|
|
58
|
-
|
|
58
|
+
timeoutSec,
|
|
59
59
|
});
|
|
60
60
|
process.exit(0);
|
|
61
61
|
},
|
|
@@ -89,7 +89,7 @@ const transferCommand = {
|
|
|
89
89
|
const coreArtifactsPath = argv.core;
|
|
90
90
|
const origin = argv.origin;
|
|
91
91
|
const destination = argv.destination;
|
|
92
|
-
const
|
|
92
|
+
const timeoutSec = argv.timeout;
|
|
93
93
|
const routerAddress = argv.router;
|
|
94
94
|
const wei = argv.wei;
|
|
95
95
|
const recipient = argv.recipient;
|
|
@@ -102,7 +102,7 @@ const transferCommand = {
|
|
|
102
102
|
routerAddress,
|
|
103
103
|
wei,
|
|
104
104
|
recipient,
|
|
105
|
-
|
|
105
|
+
timeoutSec,
|
|
106
106
|
});
|
|
107
107
|
process.exit(0);
|
|
108
108
|
},
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"send.js","sourceRoot":"","sources":["../../../src/commands/send.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,G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YACd,WAAW,EAAE,8CAA8C;SAC5D;KACF,CAAC;IACJ,OAAO,EAAE,KAAK,EAAE,IAAS,EAAE,EAAE;QAC3B,MAAM,GAAG,GAAW,IAAI,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC;QACpD,MAAM,eAAe,GAAW,IAAI,CAAC,MAAM,CAAC;QAC5C,MAAM,iBAAiB,GAAW,IAAI,CAAC,IAAI,CAAC;QAC5C,MAAM,MAAM,GAAW,IAAI,CAAC,MAAM,CAAC;QACnC,MAAM,WAAW,GAAW,IAAI,CAAC,WAAW,CAAC;QAC7C,MAAM,UAAU,GAAW,IAAI,CAAC,OAAO,CAAC;QACxC,MAAM,aAAa,GAAW,IAAI,CAAC,MAAM,CAAC;QAC1C,MAAM,GAAG,GAAW,IAAI,CAAC,GAAG,CAAC;QAC7B,MAAM,SAAS,GAAuB,IAAI,CAAC,SAAS,CAAC;QACrD,MAAM,gBAAgB,CAAC;YACrB,GAAG;YACH,eAAe;YACf,iBAAiB;YACjB,MAAM;YACN,WAAW;YACX,aAAa;YACb,GAAG;YACH,SAAS;YACT,UAAU;SACX,CAAC,CAAC;QACH,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAClB,CAAC;CACF,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"chain.d.ts","sourceRoot":"","sources":["../../../src/config/chain.ts"],"names":[],"mappings":"AAMA,OAAO,EAAE,UAAU,EAAmB,MAAM,mBAAmB,CAAC;AAEhE,wBAAsB,iBAAiB,CAAC,EACtC,MAAM,EACN,OAAO,GACR,EAAE;IACD,MAAM,EAAE,UAAU,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;CACjB,iBAyCA"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import { confirm, input, select } from '@inquirer/prompts';
|
|
2
|
+
import { isValidChainMetadata } from '@hyperlane-xyz/sdk';
|
|
3
|
+
import { ProtocolType } from '@hyperlane-xyz/utils';
|
|
4
|
+
import { errorRed, logBlue, logGreen } from '../logger.js';
|
|
5
|
+
import { mergeYamlOrJson } from '../utils/files.js';
|
|
6
|
+
export async function createChainConfig({ format, outPath, }) {
|
|
7
|
+
logBlue('Creating a new chain config');
|
|
8
|
+
const name = await input({
|
|
9
|
+
message: 'Enter chain name (one word, lower case)',
|
|
10
|
+
});
|
|
11
|
+
const chainId = await input({ message: 'Enter chain id (number)' });
|
|
12
|
+
const skipDomain = await confirm({
|
|
13
|
+
message: 'Will the domainId match the chainId (recommended)?',
|
|
14
|
+
});
|
|
15
|
+
let domainId;
|
|
16
|
+
if (skipDomain) {
|
|
17
|
+
domainId = chainId;
|
|
18
|
+
}
|
|
19
|
+
else {
|
|
20
|
+
domainId = await input({
|
|
21
|
+
message: 'Enter domain id (number, often matches chainId)',
|
|
22
|
+
});
|
|
23
|
+
}
|
|
24
|
+
const protocol = await select({
|
|
25
|
+
message: 'Select protocol type',
|
|
26
|
+
choices: Object.values(ProtocolType).map((protocol) => ({
|
|
27
|
+
name: protocol,
|
|
28
|
+
value: protocol,
|
|
29
|
+
})),
|
|
30
|
+
});
|
|
31
|
+
const rpcUrl = await input({ message: 'Enter http or https rpc url' });
|
|
32
|
+
const metadata = {
|
|
33
|
+
name,
|
|
34
|
+
chainId: parseInt(chainId, 10),
|
|
35
|
+
domainId: parseInt(domainId, 10),
|
|
36
|
+
protocol,
|
|
37
|
+
rpcUrls: [{ http: rpcUrl }],
|
|
38
|
+
};
|
|
39
|
+
if (isValidChainMetadata(metadata)) {
|
|
40
|
+
logGreen(`Chain config is valid, writing to file ${outPath}`);
|
|
41
|
+
mergeYamlOrJson(outPath, { [name]: metadata }, format);
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
errorRed(`Chain config is invalid, please see https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/typescript/cli/examples/chain-config.yaml for an example`);
|
|
45
|
+
throw new Error('Invalid chain config');
|
|
46
|
+
}
|
|
47
|
+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CAAC,CAAC;KACJ,CAAC,CAAC;IACH,MAAM,MAAM,GAAG,MAAM,KAAK,CAAC,EAAE,OAAO,EAAE,6BAA6B,EAAE,CAAC,CAAC;IACvE,MAAM,QAAQ,GAAkB;QAC9B,IAAI;QACJ,OAAO,EAAE,QAAQ,CAAC,OAAO,EAAE,EAAE,CAAC;QAC9B,QAAQ,EAAE,QAAQ,CAAC,QAAQ,EAAE,EAAE,CAAC;QAChC,QAAQ;QACR,OAAO,EAAE,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC;KAC5B,CAAC;IACF,IAAI,oBAAoB,CAAC,QAAQ,CAAC,EAAE;QAClC,QAAQ,CAAC,0CAA0C,OAAO,EAAE,CAAC,CAAC;QAC9D,eAAe,CAAC,OAAO,EAAE,EAAE,CAAC,IAAI,CAAC,EAAE,QAAQ,EAAE,EAAE,MAAM,CAAC,CAAC;KACxD;SAAM;QACL,QAAQ,CACN,4JAA4J,CAC7J,CAAC;QACF,MAAM,IAAI,KAAK,CAAC,sBAAsB,CAAC,CAAC;KACzC;AACH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multisig.d.ts","sourceRoot":"","sources":["../../../src/config/multisig.ts"],"names":[],"mappings":"AASA,OAAO,EAAE,UAAU,EAAmB,MAAM,mBAAmB,CAAC;AAEhE,wBAAsB,oBAAoB,CAAC,EACzC,MAAM,EACN,OAAO,EACP,eAAe,GAChB,EAAE;IACD,MAAM,EAAE,UAAU,CAAC;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,eAAe,EAAE,MAAM,CAAC;CACzB,iBAwDA"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { confirm, input, select } from '@inquirer/prompts';
|
|
2
|
+
import { isValidMultisigConfig, readChainConfigIfExists, } from '../configs.js';
|
|
3
|
+
import { errorRed, log, logBlue, logGreen } from '../logger.js';
|
|
4
|
+
import { runMultiChainSelectionStep } from '../utils/chains.js';
|
|
5
|
+
import { mergeYamlOrJson } from '../utils/files.js';
|
|
6
|
+
export async function createMultisigConfig({ format, outPath, chainConfigPath, }) {
|
|
7
|
+
logBlue('Creating a new multisig config');
|
|
8
|
+
const customChains = readChainConfigIfExists(chainConfigPath);
|
|
9
|
+
const chains = await runMultiChainSelectionStep(customChains);
|
|
10
|
+
const result = {};
|
|
11
|
+
let lastConfig = undefined;
|
|
12
|
+
let repeat = false;
|
|
13
|
+
for (const chain of chains) {
|
|
14
|
+
log(`Setting values for chain ${chain}`);
|
|
15
|
+
if (lastConfig && repeat) {
|
|
16
|
+
result[chain] = lastConfig;
|
|
17
|
+
continue;
|
|
18
|
+
}
|
|
19
|
+
const moduleType = await select({
|
|
20
|
+
message: 'Select multisig type',
|
|
21
|
+
choices: [
|
|
22
|
+
// { value: 'routing, name: 'routing' }, // TODO add support
|
|
23
|
+
// { value: 'aggregation, name: 'aggregation' }, // TODO add support
|
|
24
|
+
{ value: 'legacy_multisig', name: 'legacy multisig' },
|
|
25
|
+
{ value: 'merkle_root_multisig', name: 'merkle root multisig' },
|
|
26
|
+
{ value: 'message_id_multisig', name: 'message id multisig' },
|
|
27
|
+
],
|
|
28
|
+
pageSize: 5,
|
|
29
|
+
});
|
|
30
|
+
const thresholdInput = await input({
|
|
31
|
+
message: 'Enter threshold of signers (number)',
|
|
32
|
+
});
|
|
33
|
+
const threshold = parseInt(thresholdInput, 10);
|
|
34
|
+
const validatorsInput = await input({
|
|
35
|
+
message: 'Enter validator addresses (comma separated list)',
|
|
36
|
+
});
|
|
37
|
+
const validators = validatorsInput.split(',').map((v) => v.trim());
|
|
38
|
+
lastConfig = {
|
|
39
|
+
type: moduleType,
|
|
40
|
+
threshold,
|
|
41
|
+
validators,
|
|
42
|
+
};
|
|
43
|
+
result[chain] = lastConfig;
|
|
44
|
+
repeat = await confirm({
|
|
45
|
+
message: 'Use this same config for remaining chains?',
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
if (isValidMultisigConfig(result)) {
|
|
49
|
+
logGreen(`Multisig config is valid, writing to file ${outPath}`);
|
|
50
|
+
mergeYamlOrJson(outPath, result, format);
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
errorRed(`Multisig config is invalid, please see https://github.com/hyperlane-xyz/hyperlane-monorepo/blob/main/typescript/cli/examples/multisig-ism.yaml for an example`);
|
|
54
|
+
throw new Error('Invalid multisig config');
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=multisig.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"multisig.js","sourceRoot":"","sources":["../../../src/config/multisig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3D,OAAO,EAEL,qBAAqB,EACrB,uBAAuB,GACxB,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,QAAQ,EAAE,GAAG,EAAE,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAChE,OAAO,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAc,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAEhE,MAAM,CAAC,KAAK,UAAU,oBAAoB,CAAC,EACzC,MAAM,EACN,OAAO,EACP,eAAe,GAKhB;IACC,OAAO,CAAC,gCAAgC,CAAC,CAAC;IAC1C,MAAM,YAAY,GAAG,uBAAuB,CAAC,eAAe,CAAC,CAAC;IAC9D,MAAM,MAAM,GAAG,MAAM,0BAA0B,CAAC,YAAY,CAAC,CAAC;IAE9D,MAAM,MAAM,GAAsB,EAAE,CAAC;IACrC,IAAI,UAAU,GAA4C,SAAS,CAAC;IACpE,IAAI,MAAM,GAAG,KAAK,CAAC;IACnB,KAAK,MAAM,KAAK,IAAI,MAAM,EAAE;QAC1B,GAAG,CAAC,4BAA4B,KAAK,EAAE,CAAC,CAAC;QACzC,IAAI,UAAU,IAAI,MAAM,EAAE;YACxB,MAAM,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M,IAAI,KAAK,CAAC,yBAAyB,CAAC,CAAC;KAC5C;AACH,CAAC"}
|
package/dist/src/configs.d.ts
CHANGED
|
@@ -1,118 +1,49 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
2
|
import { TokenType } from '@hyperlane-xyz/hyperlane-token';
|
|
3
|
-
import { ChainMap, HyperlaneContractsMap, MultisigIsmConfig } from '@hyperlane-xyz/sdk';
|
|
4
|
-
export declare function readChainConfig(
|
|
5
|
-
|
|
6
|
-
chainId: number;
|
|
7
|
-
protocol: import("@hyperlane-xyz/sdk").ProtocolType;
|
|
8
|
-
rpcUrls: [{
|
|
9
|
-
http: string;
|
|
10
|
-
webSocket?: string | undefined;
|
|
11
|
-
pagination?: {
|
|
12
|
-
maxBlockRange?: number | undefined;
|
|
13
|
-
minBlockNumber?: number | undefined;
|
|
14
|
-
maxBlockAge?: number | undefined;
|
|
15
|
-
} | undefined;
|
|
16
|
-
retry?: {
|
|
17
|
-
maxRequests: number;
|
|
18
|
-
baseRetryMs: number;
|
|
19
|
-
} | undefined;
|
|
20
|
-
}, ...{
|
|
21
|
-
http: string;
|
|
22
|
-
webSocket?: string | undefined;
|
|
23
|
-
pagination?: {
|
|
24
|
-
maxBlockRange?: number | undefined;
|
|
25
|
-
minBlockNumber?: number | undefined;
|
|
26
|
-
maxBlockAge?: number | undefined;
|
|
27
|
-
} | undefined;
|
|
28
|
-
retry?: {
|
|
29
|
-
maxRequests: number;
|
|
30
|
-
baseRetryMs: number;
|
|
31
|
-
} | undefined;
|
|
32
|
-
}[]];
|
|
33
|
-
domainId?: number | undefined;
|
|
34
|
-
displayName?: string | undefined;
|
|
35
|
-
displayNameShort?: string | undefined;
|
|
36
|
-
logoURI?: string | undefined;
|
|
37
|
-
nativeToken?: {
|
|
38
|
-
symbol: string;
|
|
39
|
-
name: string;
|
|
40
|
-
decimals: number;
|
|
41
|
-
} | undefined;
|
|
42
|
-
blockExplorers?: {
|
|
43
|
-
url: string;
|
|
44
|
-
name: string;
|
|
45
|
-
apiUrl: string;
|
|
46
|
-
apiKey?: string | undefined;
|
|
47
|
-
family?: import("@hyperlane-xyz/sdk").ExplorerFamily | undefined;
|
|
48
|
-
}[] | undefined;
|
|
49
|
-
blocks?: {
|
|
50
|
-
confirmations: number;
|
|
51
|
-
reorgPeriod?: number | undefined;
|
|
52
|
-
estimateBlockTime?: number | undefined;
|
|
53
|
-
} | undefined;
|
|
54
|
-
transactionOverrides?: {} | undefined;
|
|
55
|
-
gasCurrencyCoinGeckoId?: string | undefined;
|
|
56
|
-
gnosisSafeTransactionServiceUrl?: string | undefined;
|
|
57
|
-
isTestnet?: boolean | undefined;
|
|
58
|
-
}>;
|
|
59
|
-
export declare function readChainConfigIfExists(filePath: string): ChainMap<{
|
|
60
|
-
name: string;
|
|
61
|
-
chainId: number;
|
|
62
|
-
protocol: import("@hyperlane-xyz/sdk").ProtocolType;
|
|
63
|
-
rpcUrls: [{
|
|
64
|
-
http: string;
|
|
65
|
-
webSocket?: string | undefined;
|
|
66
|
-
pagination?: {
|
|
67
|
-
maxBlockRange?: number | undefined;
|
|
68
|
-
minBlockNumber?: number | undefined;
|
|
69
|
-
maxBlockAge?: number | undefined;
|
|
70
|
-
} | undefined;
|
|
71
|
-
retry?: {
|
|
72
|
-
maxRequests: number;
|
|
73
|
-
baseRetryMs: number;
|
|
74
|
-
} | undefined;
|
|
75
|
-
}, ...{
|
|
76
|
-
http: string;
|
|
77
|
-
webSocket?: string | undefined;
|
|
78
|
-
pagination?: {
|
|
79
|
-
maxBlockRange?: number | undefined;
|
|
80
|
-
minBlockNumber?: number | undefined;
|
|
81
|
-
maxBlockAge?: number | undefined;
|
|
82
|
-
} | undefined;
|
|
83
|
-
retry?: {
|
|
84
|
-
maxRequests: number;
|
|
85
|
-
baseRetryMs: number;
|
|
86
|
-
} | undefined;
|
|
87
|
-
}[]];
|
|
88
|
-
domainId?: number | undefined;
|
|
89
|
-
displayName?: string | undefined;
|
|
90
|
-
displayNameShort?: string | undefined;
|
|
91
|
-
logoURI?: string | undefined;
|
|
92
|
-
nativeToken?: {
|
|
93
|
-
symbol: string;
|
|
94
|
-
name: string;
|
|
95
|
-
decimals: number;
|
|
96
|
-
} | undefined;
|
|
97
|
-
blockExplorers?: {
|
|
98
|
-
url: string;
|
|
99
|
-
name: string;
|
|
100
|
-
apiUrl: string;
|
|
101
|
-
apiKey?: string | undefined;
|
|
102
|
-
family?: import("@hyperlane-xyz/sdk").ExplorerFamily | undefined;
|
|
103
|
-
}[] | undefined;
|
|
104
|
-
blocks?: {
|
|
105
|
-
confirmations: number;
|
|
106
|
-
reorgPeriod?: number | undefined;
|
|
107
|
-
estimateBlockTime?: number | undefined;
|
|
108
|
-
} | undefined;
|
|
109
|
-
transactionOverrides?: {} | undefined;
|
|
110
|
-
gasCurrencyCoinGeckoId?: string | undefined;
|
|
111
|
-
gnosisSafeTransactionServiceUrl?: string | undefined;
|
|
112
|
-
isTestnet?: boolean | undefined;
|
|
113
|
-
}>;
|
|
3
|
+
import { ChainMap, ChainMetadata, HyperlaneContractsMap, MultisigIsmConfig } from '@hyperlane-xyz/sdk';
|
|
4
|
+
export declare function readChainConfig(filePath: string): ChainMap<ChainMetadata>;
|
|
5
|
+
export declare function readChainConfigIfExists(filePath: string): ChainMap<ChainMetadata>;
|
|
114
6
|
export declare function readDeploymentArtifacts(filePath: string): HyperlaneContractsMap<any>;
|
|
7
|
+
declare const MultisigConfigMapSchema: z.ZodObject<{}, "strip", z.ZodObject<{
|
|
8
|
+
type: z.ZodString;
|
|
9
|
+
threshold: z.ZodNumber;
|
|
10
|
+
validators: z.ZodArray<z.ZodString, "many">;
|
|
11
|
+
}, "strip", z.ZodTypeAny, {
|
|
12
|
+
type: string;
|
|
13
|
+
threshold: number;
|
|
14
|
+
validators: string[];
|
|
15
|
+
}, {
|
|
16
|
+
type: string;
|
|
17
|
+
threshold: number;
|
|
18
|
+
validators: string[];
|
|
19
|
+
}>, z.objectOutputType<{}, z.ZodObject<{
|
|
20
|
+
type: z.ZodString;
|
|
21
|
+
threshold: z.ZodNumber;
|
|
22
|
+
validators: z.ZodArray<z.ZodString, "many">;
|
|
23
|
+
}, "strip", z.ZodTypeAny, {
|
|
24
|
+
type: string;
|
|
25
|
+
threshold: number;
|
|
26
|
+
validators: string[];
|
|
27
|
+
}, {
|
|
28
|
+
type: string;
|
|
29
|
+
threshold: number;
|
|
30
|
+
validators: string[];
|
|
31
|
+
}>, "strip">, z.objectInputType<{}, z.ZodObject<{
|
|
32
|
+
type: z.ZodString;
|
|
33
|
+
threshold: z.ZodNumber;
|
|
34
|
+
validators: z.ZodArray<z.ZodString, "many">;
|
|
35
|
+
}, "strip", z.ZodTypeAny, {
|
|
36
|
+
type: string;
|
|
37
|
+
threshold: number;
|
|
38
|
+
validators: string[];
|
|
39
|
+
}, {
|
|
40
|
+
type: string;
|
|
41
|
+
threshold: number;
|
|
42
|
+
validators: string[];
|
|
43
|
+
}>, "strip">>;
|
|
44
|
+
export type MultisigConfigMap = z.infer<typeof MultisigConfigMapSchema>;
|
|
115
45
|
export declare function readMultisigConfig(filePath: string): ChainMap<MultisigIsmConfig>;
|
|
46
|
+
export declare function isValidMultisigConfig(config: any): boolean;
|
|
116
47
|
export declare const WarpRouteConfigSchema: z.ZodObject<{
|
|
117
48
|
base: z.ZodObject<{
|
|
118
49
|
mailbox: z.ZodOptional<z.ZodString>;
|
|
@@ -281,4 +212,5 @@ export declare function readWarpRouteConfig(filePath: string): {
|
|
|
281
212
|
totalSupply?: number | undefined;
|
|
282
213
|
}[]];
|
|
283
214
|
};
|
|
215
|
+
export {};
|
|
284
216
|
//# sourceMappingURL=configs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"configs.d.ts","sourceRoot":"","sources":["../../src/configs.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAC;AAC3D,OAAO,EACL,QA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