@semaphore-protocol/group 3.1.0 → 3.2.1

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
@@ -40,7 +40,7 @@
40
40
  🔎 Issues
41
41
  </a>
42
42
  <span>&nbsp;&nbsp;|&nbsp;&nbsp;</span>
43
- <a href="https://discord.gg/6mSdGHnstH">
43
+ <a href="https://semaphore.appliedzkp.org/discord">
44
44
  🗣️ Chat &amp; Support
45
45
  </a>
46
46
  </h4>
package/dist/index.mjs CHANGED
@@ -1,13 +1,13 @@
1
1
  /**
2
2
  * @module @semaphore-protocol/group
3
- * @version 3.1.0
3
+ * @version 3.2.1
4
4
  * @file A library to create and manage Semaphore groups.
5
5
  * @copyright Ethereum Foundation 2022
6
6
  * @license MIT
7
7
  * @see [Github]{@link https://github.com/semaphore-protocol/semaphore/tree/main/packages/group}
8
8
  */
9
9
  import { IncrementalMerkleTree } from '@zk-kit/incremental-merkle-tree';
10
- import poseidon from 'poseidon-lite';
10
+ import { poseidon2 } from 'poseidon-lite/poseidon2';
11
11
  import { BigNumber } from '@ethersproject/bignumber';
12
12
  import { zeroPad } from '@ethersproject/bytes';
13
13
  import { keccak256 } from '@ethersproject/keccak256';
@@ -35,7 +35,7 @@ var Group = /** @class */ (function () {
35
35
  throw new Error("The tree depth must be between 16 and 32");
36
36
  }
37
37
  this._id = id;
38
- this.merkleTree = new IncrementalMerkleTree(poseidon, treeDepth, hash(id), 2);
38
+ this.merkleTree = new IncrementalMerkleTree(poseidon2, treeDepth, hash(id), 2);
39
39
  }
40
40
  Object.defineProperty(Group.prototype, "id", {
41
41
  /**
@@ -1,6 +1,6 @@
1
1
  /**
2
2
  * @module @semaphore-protocol/group
3
- * @version 3.1.0
3
+ * @version 3.2.1
4
4
  * @file A library to create and manage Semaphore groups.
5
5
  * @copyright Ethereum Foundation 2022
6
6
  * @license MIT
@@ -11,15 +11,11 @@
11
11
  Object.defineProperty(exports, '__esModule', { value: true });
12
12
 
13
13
  var incrementalMerkleTree = require('@zk-kit/incremental-merkle-tree');
14
- var poseidon = require('poseidon-lite');
14
+ var poseidon2 = require('poseidon-lite/poseidon2');
15
15
  var bignumber = require('@ethersproject/bignumber');
16
16
  var bytes = require('@ethersproject/bytes');
17
17
  var keccak256 = require('@ethersproject/keccak256');
18
18
 
19
- function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; }
20
-
21
- var poseidon__default = /*#__PURE__*/_interopDefaultLegacy(poseidon);
22
-
23
19
  /**
24
20
  * Creates a keccak256 hash of a message compatible with the SNARK scalar modulus.
25
21
  * @param message The message to be hashed.
@@ -43,7 +39,7 @@ var Group = /** @class */ (function () {
43
39
  throw new Error("The tree depth must be between 16 and 32");
44
40
  }
45
41
  this._id = id;
46
- this.merkleTree = new incrementalMerkleTree.IncrementalMerkleTree(poseidon__default["default"], treeDepth, hash(id), 2);
42
+ this.merkleTree = new incrementalMerkleTree.IncrementalMerkleTree(poseidon2.poseidon2, treeDepth, hash(id), 2);
47
43
  }
48
44
  Object.defineProperty(Group.prototype, "id", {
49
45
  /**
package/package.json CHANGED
@@ -1,44 +1,44 @@
1
1
  {
2
- "name": "@semaphore-protocol/group",
3
- "version": "3.1.0",
4
- "description": "A library to create and manage Semaphore groups.",
5
- "license": "MIT",
6
- "main": "dist/index.node.js",
7
- "exports": {
8
- "import": "./dist/index.mjs",
9
- "require": "./dist/index.node.js"
10
- },
11
- "types": "dist/types/index.d.ts",
12
- "files": [
13
- "dist/",
14
- "src/",
15
- "LICENSE",
16
- "README.md"
17
- ],
18
- "repository": "https://github.com/semaphore-protocol/semaphore",
19
- "homepage": "https://github.com/semaphore-protocol/semaphore/tree/main/packages/group",
20
- "bugs": {
21
- "url": "https://github.com/semaphore-protocol/semaphore.git/issues"
22
- },
23
- "scripts": {
24
- "build:watch": "rollup -c rollup.config.ts -w --configPlugin typescript",
25
- "build": "rimraf dist && rollup -c rollup.config.ts --configPlugin typescript",
26
- "prepublishOnly": "yarn build",
27
- "docs": "typedoc src/index.ts --out ../../docs/group"
28
- },
29
- "publishConfig": {
30
- "access": "public"
31
- },
32
- "devDependencies": {
33
- "rollup-plugin-cleanup": "^3.2.1",
34
- "rollup-plugin-typescript2": "^0.31.2",
35
- "typedoc": "^0.22.11"
36
- },
37
- "dependencies": {
38
- "@ethersproject/bignumber": "^5.7.0",
39
- "@ethersproject/bytes": "^5.7.0",
40
- "@ethersproject/keccak256": "^5.7.0",
41
- "@zk-kit/incremental-merkle-tree": "1.0.0",
42
- "poseidon-lite": "^0.0.2"
43
- }
44
- }
2
+ "name": "@semaphore-protocol/group",
3
+ "version": "3.2.1",
4
+ "description": "A library to create and manage Semaphore groups.",
5
+ "license": "MIT",
6
+ "main": "dist/index.node.js",
7
+ "exports": {
8
+ "import": "./dist/index.mjs",
9
+ "require": "./dist/index.node.js"
10
+ },
11
+ "types": "dist/types/index.d.ts",
12
+ "files": [
13
+ "dist/",
14
+ "src/",
15
+ "LICENSE",
16
+ "README.md"
17
+ ],
18
+ "repository": "https://github.com/semaphore-protocol/semaphore",
19
+ "homepage": "https://github.com/semaphore-protocol/semaphore/tree/main/packages/group",
20
+ "bugs": {
21
+ "url": "https://github.com/semaphore-protocol/semaphore.git/issues"
22
+ },
23
+ "scripts": {
24
+ "build:watch": "rollup -c rollup.config.ts -w --configPlugin typescript",
25
+ "build": "rimraf dist && rollup -c rollup.config.ts --configPlugin typescript",
26
+ "prepublishOnly": "yarn build",
27
+ "docs": "typedoc src/index.ts --out ../../docs/group"
28
+ },
29
+ "publishConfig": {
30
+ "access": "public"
31
+ },
32
+ "devDependencies": {
33
+ "rollup-plugin-cleanup": "^3.2.1",
34
+ "rollup-plugin-typescript2": "^0.31.2",
35
+ "typedoc": "^0.22.11"
36
+ },
37
+ "dependencies": {
38
+ "@ethersproject/bignumber": "^5.7.0",
39
+ "@ethersproject/bytes": "^5.7.0",
40
+ "@ethersproject/keccak256": "^5.7.0",
41
+ "@zk-kit/incremental-merkle-tree": "1.0.0",
42
+ "poseidon-lite": "^0.1.0"
43
+ }
44
+ }
package/src/group.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { IncrementalMerkleTree, MerkleProof } from "@zk-kit/incremental-merkle-tree"
2
- import poseidon from "poseidon-lite"
2
+ import { poseidon2 } from "poseidon-lite/poseidon2"
3
3
  import hash from "./hash"
4
4
  import { BigNumberish } from "./types"
5
5
 
@@ -19,7 +19,7 @@ export default class Group {
19
19
  }
20
20
 
21
21
  this._id = id
22
- this.merkleTree = new IncrementalMerkleTree(poseidon, treeDepth, hash(id), 2)
22
+ this.merkleTree = new IncrementalMerkleTree(poseidon2, treeDepth, hash(id), 2)
23
23
  }
24
24
 
25
25
  /**
@@ -1 +1 @@
1
- export type BigNumberish = string | number | bigint;
1
+ export type BigNumberish = string | number | bigint