@@ -74,6 +74,7 @@ yarn add @semaphore-protocol/group
74
74
75
75
``` typescript
76
76
import { Group } from " @semaphore-protocol/group"
77
+ import { Identity } from " @semaphore-protocol/identity"
77
78
78
79
// Group with max 1048576 members (20^²).
79
80
const group1 = new Group (1 )
@@ -83,6 +84,13 @@ const group2 = new Group(1, 16)
83
84
84
85
// Group with max 16777216 members (24^²).
85
86
const group3 = new Group (1 , 24 )
87
+
88
+ // Group with a list of predefined members.
89
+ const identity1 = new Identity ()
90
+ const identity2 = new Identity ()
91
+ const identity3 = new Identity ()
92
+
93
+ const group3 = new Group (1 , 16 , [identity1 .commitment , identity2 .commitment , identity3 .commitment ])
86
94
```
87
95
88
96
\# ** addMember** (identityCommitment: _ Member_ )
@@ -96,21 +104,6 @@ const commitment = identity.generateCommitment()
96
104
group .addMember (commitment )
97
105
```
98
106
99
- \# ** addMembers** (identityCommitments: _ Member\[ ] _ )
100
-
101
- ``` typescript
102
- let identityCommitments: bigint []
103
-
104
- for (let i = 0 ; i < 10 ; i ++ ) {
105
- const identity = new Identity ()
106
- const commitment = identity .generateCommitment ()
107
-
108
- identityCommitments .push (commitment )
109
- }
110
-
111
- group .addMember (identityCommitments )
112
- ```
113
-
114
107
\# ** removeMember** (index: _ number_ )
115
108
116
109
``` typescript
0 commit comments