@waku/rln 0.1.6-4997440.0 → 0.1.6-76fb1ea.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/bundle/_virtual/utils.js +2 -2
- package/bundle/_virtual/utils2.js +2 -2
- package/bundle/node_modules/@chainsafe/bls-keystore/node_modules/@noble/hashes/_sha2.js +1 -1
- package/bundle/node_modules/@chainsafe/bls-keystore/node_modules/@noble/hashes/hmac.js +1 -1
- package/bundle/node_modules/@chainsafe/bls-keystore/node_modules/@noble/hashes/pbkdf2.js +1 -1
- package/bundle/node_modules/@chainsafe/bls-keystore/node_modules/@noble/hashes/scrypt.js +1 -1
- package/bundle/node_modules/@chainsafe/bls-keystore/node_modules/@noble/hashes/sha256.js +1 -1
- package/bundle/node_modules/@chainsafe/bls-keystore/node_modules/@noble/hashes/sha512.js +1 -1
- package/bundle/node_modules/@chainsafe/bls-keystore/node_modules/@noble/hashes/utils.js +1 -1
- package/bundle/node_modules/@chainsafe/bls-keystore/node_modules/ethereum-cryptography/random.js +1 -1
- package/bundle/node_modules/@chainsafe/bls-keystore/node_modules/ethereum-cryptography/utils.js +2 -2
- package/bundle/packages/core/dist/lib/connection_manager/connection_manager.js +1 -0
- package/bundle/packages/core/dist/lib/connection_manager/keep_alive_manager.js +1 -0
- package/bundle/packages/core/dist/lib/filter/filter.js +3 -0
- package/bundle/packages/core/dist/lib/light_push/light_push.js +3 -0
- package/bundle/packages/core/dist/lib/light_push/light_push_v3.js +31 -0
- package/bundle/packages/core/dist/lib/light_push/status_codes.js +26 -0
- package/bundle/packages/core/dist/lib/light_push/status_codes_v3.js +17 -0
- package/bundle/packages/core/dist/lib/message/version_0.js +2 -0
- package/bundle/packages/core/dist/lib/metadata/metadata.js +3 -0
- package/bundle/packages/core/dist/lib/store/store.js +3 -0
- package/bundle/packages/interfaces/dist/light_push_v3.js +16 -0
- package/bundle/packages/proto/dist/generated/light_push.js +28 -22
- package/bundle/packages/proto/dist/generated/light_push_v2.js +389 -0
- package/bundle/packages/proto/dist/generated/light_push_v3.js +348 -0
- package/bundle/packages/rln/dist/codec.js +1 -0
- package/bundle/packages/rln/dist/contract/rln_base_contract.js +1 -0
- package/bundle/packages/rln/dist/contract/rln_contract.js +1 -0
- package/bundle/packages/rln/dist/credentials_manager.js +1 -0
- package/bundle/packages/rln/dist/keystore/keystore.js +1 -0
- package/bundle/packages/rln/dist/message.js +15 -0
- package/bundle/packages/rln/dist/rln.js +15 -0
- package/bundle/packages/rln/dist/utils/epoch.js +1 -0
- package/bundle/packages/utils/dist/common/sharding/index.js +1 -0
- package/dist/.tsbuildinfo +1 -1
- package/package.json +1 -1
@@ -0,0 +1,348 @@
|
|
1
|
+
import { decodeMessage } from '../../../../node_modules/protons-runtime/dist/src/decode.js';
|
2
|
+
import { encodeMessage } from '../../../../node_modules/protons-runtime/dist/src/encode.js';
|
3
|
+
import '../../../../node_modules/protons-runtime/dist/src/codec.js';
|
4
|
+
import { message } from '../../../../node_modules/protons-runtime/dist/src/codecs/message.js';
|
5
|
+
import { alloc } from '../../../../node_modules/uint8arrays/dist/src/alloc.js';
|
6
|
+
import '../../../../node_modules/protons-runtime/dist/src/utils/float.js';
|
7
|
+
import '../../../../node_modules/protons-runtime/dist/src/utils/longbits.js';
|
8
|
+
import '../../../../node_modules/protons-runtime/dist/src/utils/writer.js';
|
9
|
+
|
10
|
+
/* eslint-disable import/export */
|
11
|
+
/* eslint-disable complexity */
|
12
|
+
/* eslint-disable @typescript-eslint/no-namespace */
|
13
|
+
/* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */
|
14
|
+
/* eslint-disable @typescript-eslint/no-empty-interface */
|
15
|
+
var LightpushRequest;
|
16
|
+
(function (LightpushRequest) {
|
17
|
+
let _codec;
|
18
|
+
LightpushRequest.codec = () => {
|
19
|
+
if (_codec == null) {
|
20
|
+
_codec = message((obj, w, opts = {}) => {
|
21
|
+
if (opts.lengthDelimited !== false) {
|
22
|
+
w.fork();
|
23
|
+
}
|
24
|
+
if ((obj.requestId != null && obj.requestId !== '')) {
|
25
|
+
w.uint32(10);
|
26
|
+
w.string(obj.requestId);
|
27
|
+
}
|
28
|
+
if (obj.pubsubTopic != null) {
|
29
|
+
w.uint32(162);
|
30
|
+
w.string(obj.pubsubTopic);
|
31
|
+
}
|
32
|
+
if (obj.message != null) {
|
33
|
+
w.uint32(170);
|
34
|
+
WakuMessage.codec().encode(obj.message, w);
|
35
|
+
}
|
36
|
+
if (opts.lengthDelimited !== false) {
|
37
|
+
w.ldelim();
|
38
|
+
}
|
39
|
+
}, (reader, length, opts = {}) => {
|
40
|
+
const obj = {
|
41
|
+
requestId: ''
|
42
|
+
};
|
43
|
+
const end = length == null ? reader.len : reader.pos + length;
|
44
|
+
while (reader.pos < end) {
|
45
|
+
const tag = reader.uint32();
|
46
|
+
switch (tag >>> 3) {
|
47
|
+
case 1: {
|
48
|
+
obj.requestId = reader.string();
|
49
|
+
break;
|
50
|
+
}
|
51
|
+
case 20: {
|
52
|
+
obj.pubsubTopic = reader.string();
|
53
|
+
break;
|
54
|
+
}
|
55
|
+
case 21: {
|
56
|
+
obj.message = WakuMessage.codec().decode(reader, reader.uint32(), {
|
57
|
+
limits: opts.limits?.message
|
58
|
+
});
|
59
|
+
break;
|
60
|
+
}
|
61
|
+
default: {
|
62
|
+
reader.skipType(tag & 7);
|
63
|
+
break;
|
64
|
+
}
|
65
|
+
}
|
66
|
+
}
|
67
|
+
return obj;
|
68
|
+
});
|
69
|
+
}
|
70
|
+
return _codec;
|
71
|
+
};
|
72
|
+
LightpushRequest.encode = (obj) => {
|
73
|
+
return encodeMessage(obj, LightpushRequest.codec());
|
74
|
+
};
|
75
|
+
LightpushRequest.decode = (buf, opts) => {
|
76
|
+
return decodeMessage(buf, LightpushRequest.codec(), opts);
|
77
|
+
};
|
78
|
+
})(LightpushRequest || (LightpushRequest = {}));
|
79
|
+
var LightpushResponse;
|
80
|
+
(function (LightpushResponse) {
|
81
|
+
let _codec;
|
82
|
+
LightpushResponse.codec = () => {
|
83
|
+
if (_codec == null) {
|
84
|
+
_codec = message((obj, w, opts = {}) => {
|
85
|
+
if (opts.lengthDelimited !== false) {
|
86
|
+
w.fork();
|
87
|
+
}
|
88
|
+
if ((obj.requestId != null && obj.requestId !== '')) {
|
89
|
+
w.uint32(10);
|
90
|
+
w.string(obj.requestId);
|
91
|
+
}
|
92
|
+
if ((obj.statusCode != null && obj.statusCode !== 0)) {
|
93
|
+
w.uint32(80);
|
94
|
+
w.uint32(obj.statusCode);
|
95
|
+
}
|
96
|
+
if (obj.statusDesc != null) {
|
97
|
+
w.uint32(90);
|
98
|
+
w.string(obj.statusDesc);
|
99
|
+
}
|
100
|
+
if (obj.relayPeerCount != null) {
|
101
|
+
w.uint32(96);
|
102
|
+
w.uint32(obj.relayPeerCount);
|
103
|
+
}
|
104
|
+
if (opts.lengthDelimited !== false) {
|
105
|
+
w.ldelim();
|
106
|
+
}
|
107
|
+
}, (reader, length, opts = {}) => {
|
108
|
+
const obj = {
|
109
|
+
requestId: '',
|
110
|
+
statusCode: 0
|
111
|
+
};
|
112
|
+
const end = length == null ? reader.len : reader.pos + length;
|
113
|
+
while (reader.pos < end) {
|
114
|
+
const tag = reader.uint32();
|
115
|
+
switch (tag >>> 3) {
|
116
|
+
case 1: {
|
117
|
+
obj.requestId = reader.string();
|
118
|
+
break;
|
119
|
+
}
|
120
|
+
case 10: {
|
121
|
+
obj.statusCode = reader.uint32();
|
122
|
+
break;
|
123
|
+
}
|
124
|
+
case 11: {
|
125
|
+
obj.statusDesc = reader.string();
|
126
|
+
break;
|
127
|
+
}
|
128
|
+
case 12: {
|
129
|
+
obj.relayPeerCount = reader.uint32();
|
130
|
+
break;
|
131
|
+
}
|
132
|
+
default: {
|
133
|
+
reader.skipType(tag & 7);
|
134
|
+
break;
|
135
|
+
}
|
136
|
+
}
|
137
|
+
}
|
138
|
+
return obj;
|
139
|
+
});
|
140
|
+
}
|
141
|
+
return _codec;
|
142
|
+
};
|
143
|
+
LightpushResponse.encode = (obj) => {
|
144
|
+
return encodeMessage(obj, LightpushResponse.codec());
|
145
|
+
};
|
146
|
+
LightpushResponse.decode = (buf, opts) => {
|
147
|
+
return decodeMessage(buf, LightpushResponse.codec(), opts);
|
148
|
+
};
|
149
|
+
})(LightpushResponse || (LightpushResponse = {}));
|
150
|
+
var RateLimitProof;
|
151
|
+
(function (RateLimitProof) {
|
152
|
+
let _codec;
|
153
|
+
RateLimitProof.codec = () => {
|
154
|
+
if (_codec == null) {
|
155
|
+
_codec = message((obj, w, opts = {}) => {
|
156
|
+
if (opts.lengthDelimited !== false) {
|
157
|
+
w.fork();
|
158
|
+
}
|
159
|
+
if ((obj.proof != null && obj.proof.byteLength > 0)) {
|
160
|
+
w.uint32(10);
|
161
|
+
w.bytes(obj.proof);
|
162
|
+
}
|
163
|
+
if ((obj.merkleRoot != null && obj.merkleRoot.byteLength > 0)) {
|
164
|
+
w.uint32(18);
|
165
|
+
w.bytes(obj.merkleRoot);
|
166
|
+
}
|
167
|
+
if ((obj.epoch != null && obj.epoch.byteLength > 0)) {
|
168
|
+
w.uint32(26);
|
169
|
+
w.bytes(obj.epoch);
|
170
|
+
}
|
171
|
+
if ((obj.shareX != null && obj.shareX.byteLength > 0)) {
|
172
|
+
w.uint32(34);
|
173
|
+
w.bytes(obj.shareX);
|
174
|
+
}
|
175
|
+
if ((obj.shareY != null && obj.shareY.byteLength > 0)) {
|
176
|
+
w.uint32(42);
|
177
|
+
w.bytes(obj.shareY);
|
178
|
+
}
|
179
|
+
if ((obj.nullifier != null && obj.nullifier.byteLength > 0)) {
|
180
|
+
w.uint32(50);
|
181
|
+
w.bytes(obj.nullifier);
|
182
|
+
}
|
183
|
+
if ((obj.rlnIdentifier != null && obj.rlnIdentifier.byteLength > 0)) {
|
184
|
+
w.uint32(58);
|
185
|
+
w.bytes(obj.rlnIdentifier);
|
186
|
+
}
|
187
|
+
if (opts.lengthDelimited !== false) {
|
188
|
+
w.ldelim();
|
189
|
+
}
|
190
|
+
}, (reader, length, opts = {}) => {
|
191
|
+
const obj = {
|
192
|
+
proof: alloc(0),
|
193
|
+
merkleRoot: alloc(0),
|
194
|
+
epoch: alloc(0),
|
195
|
+
shareX: alloc(0),
|
196
|
+
shareY: alloc(0),
|
197
|
+
nullifier: alloc(0),
|
198
|
+
rlnIdentifier: alloc(0)
|
199
|
+
};
|
200
|
+
const end = length == null ? reader.len : reader.pos + length;
|
201
|
+
while (reader.pos < end) {
|
202
|
+
const tag = reader.uint32();
|
203
|
+
switch (tag >>> 3) {
|
204
|
+
case 1: {
|
205
|
+
obj.proof = reader.bytes();
|
206
|
+
break;
|
207
|
+
}
|
208
|
+
case 2: {
|
209
|
+
obj.merkleRoot = reader.bytes();
|
210
|
+
break;
|
211
|
+
}
|
212
|
+
case 3: {
|
213
|
+
obj.epoch = reader.bytes();
|
214
|
+
break;
|
215
|
+
}
|
216
|
+
case 4: {
|
217
|
+
obj.shareX = reader.bytes();
|
218
|
+
break;
|
219
|
+
}
|
220
|
+
case 5: {
|
221
|
+
obj.shareY = reader.bytes();
|
222
|
+
break;
|
223
|
+
}
|
224
|
+
case 6: {
|
225
|
+
obj.nullifier = reader.bytes();
|
226
|
+
break;
|
227
|
+
}
|
228
|
+
case 7: {
|
229
|
+
obj.rlnIdentifier = reader.bytes();
|
230
|
+
break;
|
231
|
+
}
|
232
|
+
default: {
|
233
|
+
reader.skipType(tag & 7);
|
234
|
+
break;
|
235
|
+
}
|
236
|
+
}
|
237
|
+
}
|
238
|
+
return obj;
|
239
|
+
});
|
240
|
+
}
|
241
|
+
return _codec;
|
242
|
+
};
|
243
|
+
RateLimitProof.encode = (obj) => {
|
244
|
+
return encodeMessage(obj, RateLimitProof.codec());
|
245
|
+
};
|
246
|
+
RateLimitProof.decode = (buf, opts) => {
|
247
|
+
return decodeMessage(buf, RateLimitProof.codec(), opts);
|
248
|
+
};
|
249
|
+
})(RateLimitProof || (RateLimitProof = {}));
|
250
|
+
var WakuMessage;
|
251
|
+
(function (WakuMessage) {
|
252
|
+
let _codec;
|
253
|
+
WakuMessage.codec = () => {
|
254
|
+
if (_codec == null) {
|
255
|
+
_codec = message((obj, w, opts = {}) => {
|
256
|
+
if (opts.lengthDelimited !== false) {
|
257
|
+
w.fork();
|
258
|
+
}
|
259
|
+
if ((obj.payload != null && obj.payload.byteLength > 0)) {
|
260
|
+
w.uint32(10);
|
261
|
+
w.bytes(obj.payload);
|
262
|
+
}
|
263
|
+
if ((obj.contentTopic != null && obj.contentTopic !== '')) {
|
264
|
+
w.uint32(18);
|
265
|
+
w.string(obj.contentTopic);
|
266
|
+
}
|
267
|
+
if (obj.version != null) {
|
268
|
+
w.uint32(24);
|
269
|
+
w.uint32(obj.version);
|
270
|
+
}
|
271
|
+
if (obj.timestamp != null) {
|
272
|
+
w.uint32(80);
|
273
|
+
w.sint64(obj.timestamp);
|
274
|
+
}
|
275
|
+
if (obj.meta != null) {
|
276
|
+
w.uint32(90);
|
277
|
+
w.bytes(obj.meta);
|
278
|
+
}
|
279
|
+
if (obj.rateLimitProof != null) {
|
280
|
+
w.uint32(170);
|
281
|
+
RateLimitProof.codec().encode(obj.rateLimitProof, w);
|
282
|
+
}
|
283
|
+
if (obj.ephemeral != null) {
|
284
|
+
w.uint32(248);
|
285
|
+
w.bool(obj.ephemeral);
|
286
|
+
}
|
287
|
+
if (opts.lengthDelimited !== false) {
|
288
|
+
w.ldelim();
|
289
|
+
}
|
290
|
+
}, (reader, length, opts = {}) => {
|
291
|
+
const obj = {
|
292
|
+
payload: alloc(0),
|
293
|
+
contentTopic: ''
|
294
|
+
};
|
295
|
+
const end = length == null ? reader.len : reader.pos + length;
|
296
|
+
while (reader.pos < end) {
|
297
|
+
const tag = reader.uint32();
|
298
|
+
switch (tag >>> 3) {
|
299
|
+
case 1: {
|
300
|
+
obj.payload = reader.bytes();
|
301
|
+
break;
|
302
|
+
}
|
303
|
+
case 2: {
|
304
|
+
obj.contentTopic = reader.string();
|
305
|
+
break;
|
306
|
+
}
|
307
|
+
case 3: {
|
308
|
+
obj.version = reader.uint32();
|
309
|
+
break;
|
310
|
+
}
|
311
|
+
case 10: {
|
312
|
+
obj.timestamp = reader.sint64();
|
313
|
+
break;
|
314
|
+
}
|
315
|
+
case 11: {
|
316
|
+
obj.meta = reader.bytes();
|
317
|
+
break;
|
318
|
+
}
|
319
|
+
case 21: {
|
320
|
+
obj.rateLimitProof = RateLimitProof.codec().decode(reader, reader.uint32(), {
|
321
|
+
limits: opts.limits?.rateLimitProof
|
322
|
+
});
|
323
|
+
break;
|
324
|
+
}
|
325
|
+
case 31: {
|
326
|
+
obj.ephemeral = reader.bool();
|
327
|
+
break;
|
328
|
+
}
|
329
|
+
default: {
|
330
|
+
reader.skipType(tag & 7);
|
331
|
+
break;
|
332
|
+
}
|
333
|
+
}
|
334
|
+
}
|
335
|
+
return obj;
|
336
|
+
});
|
337
|
+
}
|
338
|
+
return _codec;
|
339
|
+
};
|
340
|
+
WakuMessage.encode = (obj) => {
|
341
|
+
return encodeMessage(obj, WakuMessage.codec());
|
342
|
+
};
|
343
|
+
WakuMessage.decode = (buf, opts) => {
|
344
|
+
return decodeMessage(buf, WakuMessage.codec(), opts);
|
345
|
+
};
|
346
|
+
})(WakuMessage || (WakuMessage = {}));
|
347
|
+
|
348
|
+
export { LightpushRequest, LightpushResponse, RateLimitProof, WakuMessage };
|
@@ -1,5 +1,6 @@
|
|
1
1
|
import { hmac } from '../../../node_modules/@noble/hashes/esm/hmac.js';
|
2
2
|
import { sha256 } from '../../../node_modules/@noble/hashes/esm/sha256.js';
|
3
|
+
import '../../interfaces/dist/light_push_v3.js';
|
3
4
|
import '../../interfaces/dist/protocols.js';
|
4
5
|
import '../../interfaces/dist/connection_manager.js';
|
5
6
|
import '../../interfaces/dist/health_indicator.js';
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import '../../../../node_modules/@chainsafe/bls-keystore/lib/index.js';
|
2
|
+
import '../../../interfaces/dist/light_push_v3.js';
|
2
3
|
import '../../../interfaces/dist/protocols.js';
|
3
4
|
import '../../../interfaces/dist/connection_manager.js';
|
4
5
|
import '../../../interfaces/dist/health_indicator.js';
|
@@ -1,8 +1,23 @@
|
|
1
1
|
import { Version } from '../../core/dist/lib/message/version_0.js';
|
2
2
|
import '../../core/dist/lib/filter/filter.js';
|
3
3
|
import '../../core/dist/lib/light_push/light_push.js';
|
4
|
+
import '../../core/dist/lib/light_push/light_push_v3.js';
|
5
|
+
import '../../proto/dist/generated/message.js';
|
6
|
+
import '../../proto/dist/generated/filter.js';
|
7
|
+
import '../../proto/dist/generated/topic_only_message.js';
|
8
|
+
import '../../proto/dist/generated/filter_v2.js';
|
9
|
+
import '../../proto/dist/generated/light_push.js';
|
10
|
+
import '../../proto/dist/generated/light_push_v2.js';
|
11
|
+
import '../../proto/dist/generated/light_push_v3.js';
|
12
|
+
import '../../proto/dist/generated/store_v3.js';
|
13
|
+
import '../../proto/dist/generated/peer_exchange.js';
|
14
|
+
import '../../proto/dist/generated/metadata.js';
|
15
|
+
import '../../proto/dist/generated/sds_message.js';
|
16
|
+
import '../../core/dist/lib/light_push/status_codes_v3.js';
|
17
|
+
import '../../core/dist/lib/light_push/status_codes.js';
|
4
18
|
import '../../core/dist/lib/store/store.js';
|
5
19
|
import '../../core/dist/lib/connection_manager/connection_manager.js';
|
20
|
+
import '../../interfaces/dist/light_push_v3.js';
|
6
21
|
import '../../interfaces/dist/protocols.js';
|
7
22
|
import '../../interfaces/dist/connection_manager.js';
|
8
23
|
import '../../interfaces/dist/health_indicator.js';
|
@@ -1,8 +1,23 @@
|
|
1
1
|
import { createEncoder, createDecoder } from '../../core/dist/lib/message/version_0.js';
|
2
2
|
import '../../core/dist/lib/filter/filter.js';
|
3
3
|
import '../../core/dist/lib/light_push/light_push.js';
|
4
|
+
import '../../core/dist/lib/light_push/light_push_v3.js';
|
5
|
+
import '../../proto/dist/generated/message.js';
|
6
|
+
import '../../proto/dist/generated/filter.js';
|
7
|
+
import '../../proto/dist/generated/topic_only_message.js';
|
8
|
+
import '../../proto/dist/generated/filter_v2.js';
|
9
|
+
import '../../proto/dist/generated/light_push.js';
|
10
|
+
import '../../proto/dist/generated/light_push_v2.js';
|
11
|
+
import '../../proto/dist/generated/light_push_v3.js';
|
12
|
+
import '../../proto/dist/generated/store_v3.js';
|
13
|
+
import '../../proto/dist/generated/peer_exchange.js';
|
14
|
+
import '../../proto/dist/generated/metadata.js';
|
15
|
+
import '../../proto/dist/generated/sds_message.js';
|
16
|
+
import '../../core/dist/lib/light_push/status_codes_v3.js';
|
17
|
+
import '../../core/dist/lib/light_push/status_codes.js';
|
4
18
|
import '../../core/dist/lib/store/store.js';
|
5
19
|
import '../../core/dist/lib/connection_manager/connection_manager.js';
|
20
|
+
import '../../interfaces/dist/light_push_v3.js';
|
6
21
|
import '../../interfaces/dist/protocols.js';
|
7
22
|
import '../../interfaces/dist/connection_manager.js';
|
8
23
|
import '../../interfaces/dist/health_indicator.js';
|
@@ -1,4 +1,5 @@
|
|
1
1
|
import { sha256 } from '../../../../../node_modules/@noble/hashes/esm/sha256.js';
|
2
|
+
import '../../../../interfaces/dist/light_push_v3.js';
|
2
3
|
import '../../../../interfaces/dist/protocols.js';
|
3
4
|
import '../../../../interfaces/dist/connection_manager.js';
|
4
5
|
import { DEFAULT_CLUSTER_ID } from '../../../../interfaces/dist/constants.js';
|