@semaphore-protocol/cli 0.3.0 → 0.4.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/README.md CHANGED
@@ -46,8 +46,8 @@
46
46
  </h4>
47
47
  </div>
48
48
 
49
- | Setting up a project, although not particularly complex, can be a lengthy process for some people. A command line to initialize a Semaphore project can reduce the set-up time from a few minutes to a few seconds. In addition, the Semaphore CLI can also be used to obtain on-chain group data. |
50
- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
49
+ | Setting up a project, although not particularly complex, can be a lengthy process for some people. The Semaphore CLI reduces the set-up time from a few minutes to a few seconds. In addition, it can also be used to obtain on-chain group data. |
50
+ | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
51
51
 
52
52
  ## 🛠 Install
53
53
 
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  /**
4
4
  * @module @semaphore-protocol/cli
5
- * @version 0.3.0
5
+ * @version 0.4.0
6
6
  * @file A command line tool to set up your Semaphore project and get group data.
7
7
  * @copyright Ethereum Foundation 2022
8
8
  * @license MIT
@@ -83,9 +83,13 @@ program
83
83
  });
84
84
  program
85
85
  .command("get-groups")
86
- .description("Get the list of groups from a supported network (Goerli or Arbitrum).")
86
+ .description("Get the list of groups from a supported network (goerli or arbitrum).")
87
87
  .option("-n, --network <network-name>", "Supported Ethereum network.", "goerli")
88
88
  .action(async ({ network }) => {
89
+ if (!["goerli", "arbitrum"].includes(network)) {
90
+ console.info(`\n ${logSymbols.error}`, `error: the network '${network}' is not supported\n`);
91
+ return;
92
+ }
89
93
  const subgraph = new Subgraph(network);
90
94
  const spinner = new Spinner("Fetching groups");
91
95
  spinner.start();
@@ -112,6 +116,10 @@ program
112
116
  .option("--members", "Show group members.")
113
117
  .option("--signals", "Show group signals.")
114
118
  .action(async (groupId, { network, members, signals }) => {
119
+ if (!["goerli", "arbitrum"].includes(network)) {
120
+ console.info(`\n ${logSymbols.error}`, `error: the network '${network}' is not supported\n`);
121
+ return;
122
+ }
115
123
  const subgraph = new Subgraph(network);
116
124
  const spinner = new Spinner(`Fetching group ${groupId}`);
117
125
  spinner.start();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@semaphore-protocol/cli",
3
3
  "type": "module",
4
- "version": "0.3.0",
4
+ "version": "0.4.0",
5
5
  "description": "A command line tool to set up your Semaphore project and get group data.",
6
6
  "license": "MIT",
7
7
  "bin": {
@@ -32,6 +32,7 @@
32
32
  "access": "public"
33
33
  },
34
34
  "devDependencies": {
35
+ "@types/clear": "^0.1.2",
35
36
  "@types/figlet": "^1.5.5",
36
37
  "rollup-plugin-cleanup": "^3.2.1",
37
38
  "rollup-plugin-typescript2": "^0.31.2",
@@ -40,7 +41,6 @@
40
41
  },
41
42
  "dependencies": {
42
43
  "@semaphore-protocol/subgraph": "2.6.1",
43
- "@types/clear": "^0.1.2",
44
44
  "chalk": "^5.1.2",
45
45
  "commander": "^9.4.1",
46
46
  "download": "^8.0.0",
package/src/index.ts CHANGED
@@ -69,9 +69,14 @@ program
69
69
 
70
70
  program
71
71
  .command("get-groups")
72
- .description("Get the list of groups from a supported network (Goerli or Arbitrum).")
72
+ .description("Get the list of groups from a supported network (goerli or arbitrum).")
73
73
  .option("-n, --network <network-name>", "Supported Ethereum network.", "goerli")
74
74
  .action(async ({ network }) => {
75
+ if (!["goerli", "arbitrum"].includes(network)) {
76
+ console.info(`\n ${logSymbols.error}`, `error: the network '${network}' is not supported\n`)
77
+ return
78
+ }
79
+
75
80
  const subgraph = new Subgraph(network)
76
81
  const spinner = new Spinner("Fetching groups")
77
82
 
@@ -105,6 +110,11 @@ program
105
110
  .option("--members", "Show group members.")
106
111
  .option("--signals", "Show group signals.")
107
112
  .action(async (groupId, { network, members, signals }) => {
113
+ if (!["goerli", "arbitrum"].includes(network)) {
114
+ console.info(`\n ${logSymbols.error}`, `error: the network '${network}' is not supported\n`)
115
+ return
116
+ }
117
+
108
118
  const subgraph = new Subgraph(network)
109
119
  const spinner = new Spinner(`Fetching group ${groupId}`)
110
120