File tree Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Expand file tree Collapse file tree 1 file changed +41
-0
lines changed Original file line number Diff line number Diff line change
1
+ import yargs from "yargs" ;
2
+ import { hideBin } from "yargs/helpers" ;
3
+ import { DefaultStore } from "../src" ;
4
+ import { Chain } from "../src/chains" ;
5
+
6
+ const parser = yargs ( hideBin ( process . argv ) )
7
+ . usage ( "Usage: $0 --chain <chain_id> --fee <fee> --exponent <exponent>" )
8
+ . options ( {
9
+ chain : {
10
+ type : "string" ,
11
+ demandOption : true ,
12
+ desc : "Chain for which to generate the Set Fee payload" ,
13
+ } ,
14
+ fee : {
15
+ type : "number" ,
16
+ demandOption : true ,
17
+ desc : "The new fee to set" ,
18
+ } ,
19
+ exponent : {
20
+ type : "number" ,
21
+ demandOption : true ,
22
+ desc : "The new fee exponent to set" ,
23
+ } ,
24
+ } ) ;
25
+
26
+ async function main ( ) {
27
+ const { chain, fee, exponent } = await parser . argv ;
28
+
29
+ const chain_obj = DefaultStore . chains [ chain ] ;
30
+ if ( ! chain_obj ) {
31
+ throw new Error ( `Chain with ID '${ chain } ' does not exist.` ) ;
32
+ }
33
+
34
+ const payload = chain_obj . generateGovernanceSetFeePayload ( fee , exponent ) ;
35
+ console . log (
36
+ `Generated payload for chain ${ chain_obj } :` ,
37
+ payload . toString ( "hex" )
38
+ ) ;
39
+ }
40
+
41
+ main ( ) ;
You can’t perform that action at this time.
0 commit comments