@semaphore-protocol/cli 4.0.0-beta.3 → 4.0.0-beta.5

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/index.js CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  /**
4
4
  * @module @semaphore-protocol/cli
5
- * @version 4.0.0-beta.3
5
+ * @version 4.0.0-beta.5
6
6
  * @file A command line tool to set up your Semaphore project and get group data.
7
7
  * @copyright Ethereum Foundation 2024
8
8
  * @license MIT
@@ -10,7 +10,7 @@
10
10
  */
11
11
 
12
12
  import { SemaphoreSubgraph, SemaphoreEthers } from '@semaphore-protocol/data';
13
- import supportedNetworks from '@semaphore-protocol/utils/supported-networks';
13
+ import { isSupportedNetwork, supportedNetworks } from '@semaphore-protocol/utils/networks';
14
14
  import chalk from 'chalk';
15
15
  import { program } from 'commander';
16
16
  import decompress from 'decompress';
@@ -221,9 +221,9 @@ program
221
221
  .allowExcessArguments(false)
222
222
  .action(async ({ network }) => {
223
223
  if (!network) {
224
- network = await getSupportedNetwork(supportedNetworks);
224
+ network = await getSupportedNetwork(Object.keys(supportedNetworks));
225
225
  }
226
- if (!supportedNetworks.includes(network)) {
226
+ if (!isSupportedNetwork(network)) {
227
227
  console.info(`\n ${logSymbols.error}`, `error: the network '${network}' is not supported\n`);
228
228
  return;
229
229
  }
@@ -245,9 +245,9 @@ program
245
245
  .allowExcessArguments(false)
246
246
  .action(async (groupId, { network }) => {
247
247
  if (!network) {
248
- network = await getSupportedNetwork(supportedNetworks);
248
+ network = await getSupportedNetwork(Object.keys(supportedNetworks));
249
249
  }
250
- if (!supportedNetworks.includes(network)) {
250
+ if (!isSupportedNetwork(network)) {
251
251
  console.info(`\n ${logSymbols.error}`, `error: the network '${network}' is not supported\n`);
252
252
  return;
253
253
  }
@@ -299,9 +299,9 @@ program
299
299
  .allowExcessArguments(false)
300
300
  .action(async (groupId, { network }) => {
301
301
  if (!network) {
302
- network = await getSupportedNetwork(supportedNetworks);
302
+ network = await getSupportedNetwork(Object.keys(supportedNetworks));
303
303
  }
304
- if (!supportedNetworks.includes(network)) {
304
+ if (!isSupportedNetwork(network)) {
305
305
  console.info(`\n ${logSymbols.error}`, `error: the network '${network}' is not supported\n`);
306
306
  return;
307
307
  }
@@ -351,9 +351,9 @@ program
351
351
  .allowExcessArguments(false)
352
352
  .action(async (groupId, { network }) => {
353
353
  if (!network) {
354
- network = await getSupportedNetwork(supportedNetworks);
354
+ network = await getSupportedNetwork(Object.keys(supportedNetworks));
355
355
  }
356
- if (!supportedNetworks.includes(network)) {
356
+ if (!isSupportedNetwork(network)) {
357
357
  console.info(`\n ${logSymbols.error}`, `error: the network '${network}' is not supported\n`);
358
358
  return;
359
359
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@semaphore-protocol/cli",
3
3
  "type": "module",
4
- "version": "4.0.0-beta.3",
4
+ "version": "4.0.0-beta.5",
5
5
  "description": "A command line tool to set up your Semaphore project and get group data.",
6
6
  "license": "MIT",
7
7
  "bin": {
@@ -41,8 +41,8 @@
41
41
  "rollup-plugin-cleanup": "^3.2.1"
42
42
  },
43
43
  "dependencies": {
44
- "@semaphore-protocol/data": "4.0.0-beta.3",
45
- "@semaphore-protocol/utils": "4.0.0-beta.3",
44
+ "@semaphore-protocol/data": "4.0.0-beta.5",
45
+ "@semaphore-protocol/utils": "4.0.0-beta.5",
46
46
  "axios": "^1.6.7",
47
47
  "boxen": "^7.1.1",
48
48
  "chalk": "^5.3.0",
package/src/index.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { GroupResponse, SemaphoreEthers, SemaphoreSubgraph } from "@semaphore-protocol/data"
2
- import supportedNetworks from "@semaphore-protocol/utils/supported-networks"
2
+ import { isSupportedNetwork, supportedNetworks } from "@semaphore-protocol/utils/networks"
3
3
  import chalk from "chalk"
4
4
  import { program } from "commander"
5
5
  import decompress from "decompress"
@@ -121,10 +121,10 @@ program
121
121
  .allowExcessArguments(false)
122
122
  .action(async ({ network }) => {
123
123
  if (!network) {
124
- network = await getSupportedNetwork(supportedNetworks)
124
+ network = await getSupportedNetwork(Object.keys(supportedNetworks))
125
125
  }
126
126
 
127
- if (!supportedNetworks.includes(network)) {
127
+ if (!isSupportedNetwork(network)) {
128
128
  console.info(`\n ${logSymbols.error}`, `error: the network '${network}' is not supported\n`)
129
129
  return
130
130
  }
@@ -151,10 +151,10 @@ program
151
151
  .allowExcessArguments(false)
152
152
  .action(async (groupId, { network }) => {
153
153
  if (!network) {
154
- network = await getSupportedNetwork(supportedNetworks)
154
+ network = await getSupportedNetwork(Object.keys(supportedNetworks))
155
155
  }
156
156
 
157
- if (!supportedNetworks.includes(network)) {
157
+ if (!isSupportedNetwork(network)) {
158
158
  console.info(`\n ${logSymbols.error}`, `error: the network '${network}' is not supported\n`)
159
159
  return
160
160
  }
@@ -219,10 +219,10 @@ program
219
219
  .allowExcessArguments(false)
220
220
  .action(async (groupId, { network }) => {
221
221
  if (!network) {
222
- network = await getSupportedNetwork(supportedNetworks)
222
+ network = await getSupportedNetwork(Object.keys(supportedNetworks))
223
223
  }
224
224
 
225
- if (!supportedNetworks.includes(network)) {
225
+ if (!isSupportedNetwork(network)) {
226
226
  console.info(`\n ${logSymbols.error}`, `error: the network '${network}' is not supported\n`)
227
227
  return
228
228
  }
@@ -285,10 +285,10 @@ program
285
285
  .allowExcessArguments(false)
286
286
  .action(async (groupId, { network }) => {
287
287
  if (!network) {
288
- network = await getSupportedNetwork(supportedNetworks)
288
+ network = await getSupportedNetwork(Object.keys(supportedNetworks))
289
289
  }
290
290
 
291
- if (!supportedNetworks.includes(network)) {
291
+ if (!isSupportedNetwork(network)) {
292
292
  console.info(`\n ${logSymbols.error}`, `error: the network '${network}' is not supported\n`)
293
293
  return
294
294
  }