@waku/rln 0.1.1-fa49e29 → 0.1.2-86d4f56
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 +26 -2
- package/bundle/assets/rln_wasm_bg-a503e304.wasm +0 -0
- package/bundle/index.js +28541 -4914
- package/dist/.tsbuildinfo +1 -1
- package/dist/byte_utils.d.ts +7 -0
- package/dist/byte_utils.js +13 -0
- package/dist/byte_utils.js.map +1 -1
- package/dist/codec.d.ts +5 -3
- package/dist/codec.js +8 -4
- package/dist/codec.js.map +1 -1
- package/dist/create.d.ts +2 -0
- package/dist/create.js +8 -0
- package/dist/create.js.map +1 -0
- package/dist/index.d.ts +3 -2
- package/dist/index.js +3 -9
- package/dist/index.js.map +1 -1
- package/dist/keystore/index.d.ts +2 -0
- package/dist/keystore/index.js.map +1 -1
- package/dist/keystore/keystore.d.ts +11 -11
- package/dist/keystore/keystore.js +12 -3
- package/dist/keystore/keystore.js.map +1 -1
- package/dist/keystore/types.d.ts +25 -5
- package/dist/message.d.ts +1 -1
- package/dist/message.js +1 -1
- package/dist/metamask.d.ts +2 -0
- package/dist/metamask.js +11 -0
- package/dist/metamask.js.map +1 -0
- package/dist/rln.d.ts +51 -0
- package/dist/rln.js +132 -2
- package/dist/rln.js.map +1 -1
- package/dist/rln_contract.d.ts +12 -11
- package/dist/rln_contract.js +32 -21
- package/dist/rln_contract.js.map +1 -1
- package/package.json +6 -6
- package/src/byte_utils.ts +14 -0
- package/src/codec.ts +10 -5
- package/src/create.ts +9 -0
- package/src/index.ts +4 -9
- package/src/message.ts +1 -1
- package/src/metamask.ts +16 -0
- package/src/rln.ts +237 -2
- package/src/rln_contract.ts +37 -33
- package/bundle/assets/rln_wasm_bg-6f96f821.wasm +0 -0
package/README.md
CHANGED
@@ -51,7 +51,11 @@ Or to use ESM import directly from a `<script>` tag:
|
|
51
51
|
```
|
52
52
|
git clone https://github.com/waku-org/js-rln
|
53
53
|
|
54
|
-
cd js-rln/
|
54
|
+
cd js-rln/
|
55
|
+
|
56
|
+
npm install
|
57
|
+
|
58
|
+
cd example/
|
55
59
|
|
56
60
|
npm install # or yarn
|
57
61
|
|
@@ -67,7 +71,16 @@ Browse http://localhost:8080 and open the dev tools console to see the proof bei
|
|
67
71
|
```js
|
68
72
|
import * as rln from "@waku/rln";
|
69
73
|
|
70
|
-
const rlnInstance = await rln.
|
74
|
+
const rlnInstance = await rln.createRLN();
|
75
|
+
```
|
76
|
+
|
77
|
+
### Starting RLN to listen to a contract
|
78
|
+
|
79
|
+
```js
|
80
|
+
import * as rln from "@waku/rln";
|
81
|
+
|
82
|
+
const rlnInstance = await rln.createRLN();
|
83
|
+
await rlnInstance.start(); // will use default Sepolia contract
|
71
84
|
```
|
72
85
|
|
73
86
|
#### Generating RLN Membership Credentials
|
@@ -90,6 +103,17 @@ let credentials = rlnInstance.generateSeededIdentityCredentials(seed);
|
|
90
103
|
rlnInstance.insertMember(credentials.IDCommitment);
|
91
104
|
```
|
92
105
|
|
106
|
+
### Registering Membership on a contract
|
107
|
+
|
108
|
+
```js
|
109
|
+
import * as rln from "@waku/rln";
|
110
|
+
|
111
|
+
const rlnInstance = await rln.createRLN();
|
112
|
+
await rlnInstance.start(); // will use default Sepolia contract
|
113
|
+
|
114
|
+
const membershipInfo = await rlnInstance.contract.registerWithKey(credentials);
|
115
|
+
```
|
116
|
+
|
93
117
|
### Generating a Proof
|
94
118
|
|
95
119
|
```js
|
Binary file
|