@waku/discovery 0.0.9-4997440.0 → 0.0.9-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/index.js CHANGED
@@ -123,6 +123,21 @@ class TypedEventEmitter extends EventTarget {
123
123
  }
124
124
  }
125
125
 
126
+ // Light Push V3 Protocol Types and Constants
127
+ var LightPushStatusCodeV3;
128
+ (function (LightPushStatusCodeV3) {
129
+ LightPushStatusCodeV3[LightPushStatusCodeV3["SUCCESS"] = 200] = "SUCCESS";
130
+ LightPushStatusCodeV3[LightPushStatusCodeV3["BAD_REQUEST"] = 400] = "BAD_REQUEST";
131
+ LightPushStatusCodeV3[LightPushStatusCodeV3["PAYLOAD_TOO_LARGE"] = 413] = "PAYLOAD_TOO_LARGE";
132
+ LightPushStatusCodeV3[LightPushStatusCodeV3["INVALID_MESSAGE_ERROR"] = 420] = "INVALID_MESSAGE_ERROR";
133
+ LightPushStatusCodeV3[LightPushStatusCodeV3["UNSUPPORTED_PUBSUB_TOPIC"] = 421] = "UNSUPPORTED_PUBSUB_TOPIC";
134
+ LightPushStatusCodeV3[LightPushStatusCodeV3["TOO_MANY_REQUESTS"] = 429] = "TOO_MANY_REQUESTS";
135
+ LightPushStatusCodeV3[LightPushStatusCodeV3["INTERNAL_SERVER_ERROR"] = 500] = "INTERNAL_SERVER_ERROR";
136
+ LightPushStatusCodeV3[LightPushStatusCodeV3["SERVICE_NOT_AVAILABLE"] = 503] = "SERVICE_NOT_AVAILABLE";
137
+ LightPushStatusCodeV3[LightPushStatusCodeV3["OUT_OF_RLN_PROOF"] = 504] = "OUT_OF_RLN_PROOF";
138
+ LightPushStatusCodeV3[LightPushStatusCodeV3["NO_PEERS_TO_RELAY"] = 505] = "NO_PEERS_TO_RELAY";
139
+ })(LightPushStatusCodeV3 || (LightPushStatusCodeV3 = {}));
140
+
126
141
  var Protocols;
127
142
  (function (Protocols) {
128
143
  Protocols["Relay"] = "relay";
@@ -15951,7 +15966,7 @@ const duplexPipelineFn = (duplex) => {
15951
15966
  /* eslint-disable @typescript-eslint/no-namespace */
15952
15967
  /* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */
15953
15968
  /* eslint-disable @typescript-eslint/no-empty-interface */
15954
- var RateLimitProof$4;
15969
+ var RateLimitProof$6;
15955
15970
  (function (RateLimitProof) {
15956
15971
  let _codec;
15957
15972
  RateLimitProof.codec = () => {
@@ -16050,8 +16065,8 @@ var RateLimitProof$4;
16050
16065
  RateLimitProof.decode = (buf, opts) => {
16051
16066
  return decodeMessage(buf, RateLimitProof.codec(), opts);
16052
16067
  };
16053
- })(RateLimitProof$4 || (RateLimitProof$4 = {}));
16054
- var WakuMessage$4;
16068
+ })(RateLimitProof$6 || (RateLimitProof$6 = {}));
16069
+ var WakuMessage$6;
16055
16070
  (function (WakuMessage) {
16056
16071
  let _codec;
16057
16072
  WakuMessage.codec = () => {
@@ -16082,7 +16097,7 @@ var WakuMessage$4;
16082
16097
  }
16083
16098
  if (obj.rateLimitProof != null) {
16084
16099
  w.uint32(170);
16085
- RateLimitProof$4.codec().encode(obj.rateLimitProof, w);
16100
+ RateLimitProof$6.codec().encode(obj.rateLimitProof, w);
16086
16101
  }
16087
16102
  if (obj.ephemeral != null) {
16088
16103
  w.uint32(248);
@@ -16121,7 +16136,7 @@ var WakuMessage$4;
16121
16136
  break;
16122
16137
  }
16123
16138
  case 21: {
16124
- obj.rateLimitProof = RateLimitProof$4.codec().decode(reader, reader.uint32(), {
16139
+ obj.rateLimitProof = RateLimitProof$6.codec().decode(reader, reader.uint32(), {
16125
16140
  limits: opts.limits?.rateLimitProof
16126
16141
  });
16127
16142
  break;
@@ -16147,7 +16162,7 @@ var WakuMessage$4;
16147
16162
  WakuMessage.decode = (buf, opts) => {
16148
16163
  return decodeMessage(buf, WakuMessage.codec(), opts);
16149
16164
  };
16150
- })(WakuMessage$4 || (WakuMessage$4 = {}));
16165
+ })(WakuMessage$6 || (WakuMessage$6 = {}));
16151
16166
 
16152
16167
  /* eslint-disable import/export */
16153
16168
  /* eslint-disable complexity */
@@ -16282,7 +16297,7 @@ var MessagePush$1;
16282
16297
  if (obj.messages != null) {
16283
16298
  for (const value of obj.messages) {
16284
16299
  w.uint32(10);
16285
- WakuMessage$3.codec().encode(value, w);
16300
+ WakuMessage$5.codec().encode(value, w);
16286
16301
  }
16287
16302
  }
16288
16303
  if (opts.lengthDelimited !== false) {
@@ -16300,7 +16315,7 @@ var MessagePush$1;
16300
16315
  if (opts.limits?.messages != null && obj.messages.length === opts.limits.messages) {
16301
16316
  throw new MaxLengthError('Decode error - map field "messages" had too many elements');
16302
16317
  }
16303
- obj.messages.push(WakuMessage$3.codec().decode(reader, reader.uint32(), {
16318
+ obj.messages.push(WakuMessage$5.codec().decode(reader, reader.uint32(), {
16304
16319
  limits: opts.limits?.messages$
16305
16320
  }));
16306
16321
  break;
@@ -16389,7 +16404,7 @@ var FilterRpc;
16389
16404
  return decodeMessage(buf, FilterRpc.codec(), opts);
16390
16405
  };
16391
16406
  })(FilterRpc || (FilterRpc = {}));
16392
- var RateLimitProof$3;
16407
+ var RateLimitProof$5;
16393
16408
  (function (RateLimitProof) {
16394
16409
  let _codec;
16395
16410
  RateLimitProof.codec = () => {
@@ -16488,8 +16503,8 @@ var RateLimitProof$3;
16488
16503
  RateLimitProof.decode = (buf, opts) => {
16489
16504
  return decodeMessage(buf, RateLimitProof.codec(), opts);
16490
16505
  };
16491
- })(RateLimitProof$3 || (RateLimitProof$3 = {}));
16492
- var WakuMessage$3;
16506
+ })(RateLimitProof$5 || (RateLimitProof$5 = {}));
16507
+ var WakuMessage$5;
16493
16508
  (function (WakuMessage) {
16494
16509
  let _codec;
16495
16510
  WakuMessage.codec = () => {
@@ -16520,7 +16535,7 @@ var WakuMessage$3;
16520
16535
  }
16521
16536
  if (obj.rateLimitProof != null) {
16522
16537
  w.uint32(170);
16523
- RateLimitProof$3.codec().encode(obj.rateLimitProof, w);
16538
+ RateLimitProof$5.codec().encode(obj.rateLimitProof, w);
16524
16539
  }
16525
16540
  if (obj.ephemeral != null) {
16526
16541
  w.uint32(248);
@@ -16559,7 +16574,7 @@ var WakuMessage$3;
16559
16574
  break;
16560
16575
  }
16561
16576
  case 21: {
16562
- obj.rateLimitProof = RateLimitProof$3.codec().decode(reader, reader.uint32(), {
16577
+ obj.rateLimitProof = RateLimitProof$5.codec().decode(reader, reader.uint32(), {
16563
16578
  limits: opts.limits?.rateLimitProof
16564
16579
  });
16565
16580
  break;
@@ -16585,7 +16600,7 @@ var WakuMessage$3;
16585
16600
  WakuMessage.decode = (buf, opts) => {
16586
16601
  return decodeMessage(buf, WakuMessage.codec(), opts);
16587
16602
  };
16588
- })(WakuMessage$3 || (WakuMessage$3 = {}));
16603
+ })(WakuMessage$5 || (WakuMessage$5 = {}));
16589
16604
 
16590
16605
  /* eslint-disable import/export */
16591
16606
  /* eslint-disable complexity */
@@ -16814,7 +16829,7 @@ var MessagePush;
16814
16829
  }
16815
16830
  if (obj.wakuMessage != null) {
16816
16831
  w.uint32(10);
16817
- WakuMessage$2.codec().encode(obj.wakuMessage, w);
16832
+ WakuMessage$4.codec().encode(obj.wakuMessage, w);
16818
16833
  }
16819
16834
  if (obj.pubsubTopic != null) {
16820
16835
  w.uint32(18);
@@ -16830,7 +16845,7 @@ var MessagePush;
16830
16845
  const tag = reader.uint32();
16831
16846
  switch (tag >>> 3) {
16832
16847
  case 1: {
16833
- obj.wakuMessage = WakuMessage$2.codec().decode(reader, reader.uint32(), {
16848
+ obj.wakuMessage = WakuMessage$4.codec().decode(reader, reader.uint32(), {
16834
16849
  limits: opts.limits?.wakuMessage
16835
16850
  });
16836
16851
  break;
@@ -16857,7 +16872,7 @@ var MessagePush;
16857
16872
  return decodeMessage(buf, MessagePush.codec(), opts);
16858
16873
  };
16859
16874
  })(MessagePush || (MessagePush = {}));
16860
- var RateLimitProof$2;
16875
+ var RateLimitProof$4;
16861
16876
  (function (RateLimitProof) {
16862
16877
  let _codec;
16863
16878
  RateLimitProof.codec = () => {
@@ -16956,8 +16971,8 @@ var RateLimitProof$2;
16956
16971
  RateLimitProof.decode = (buf, opts) => {
16957
16972
  return decodeMessage(buf, RateLimitProof.codec(), opts);
16958
16973
  };
16959
- })(RateLimitProof$2 || (RateLimitProof$2 = {}));
16960
- var WakuMessage$2;
16974
+ })(RateLimitProof$4 || (RateLimitProof$4 = {}));
16975
+ var WakuMessage$4;
16961
16976
  (function (WakuMessage) {
16962
16977
  let _codec;
16963
16978
  WakuMessage.codec = () => {
@@ -16988,7 +17003,7 @@ var WakuMessage$2;
16988
17003
  }
16989
17004
  if (obj.rateLimitProof != null) {
16990
17005
  w.uint32(170);
16991
- RateLimitProof$2.codec().encode(obj.rateLimitProof, w);
17006
+ RateLimitProof$4.codec().encode(obj.rateLimitProof, w);
16992
17007
  }
16993
17008
  if (obj.ephemeral != null) {
16994
17009
  w.uint32(248);
@@ -17027,7 +17042,7 @@ var WakuMessage$2;
17027
17042
  break;
17028
17043
  }
17029
17044
  case 21: {
17030
- obj.rateLimitProof = RateLimitProof$2.codec().decode(reader, reader.uint32(), {
17045
+ obj.rateLimitProof = RateLimitProof$4.codec().decode(reader, reader.uint32(), {
17031
17046
  limits: opts.limits?.rateLimitProof
17032
17047
  });
17033
17048
  break;
@@ -17053,14 +17068,14 @@ var WakuMessage$2;
17053
17068
  WakuMessage.decode = (buf, opts) => {
17054
17069
  return decodeMessage(buf, WakuMessage.codec(), opts);
17055
17070
  };
17056
- })(WakuMessage$2 || (WakuMessage$2 = {}));
17071
+ })(WakuMessage$4 || (WakuMessage$4 = {}));
17057
17072
 
17058
17073
  /* eslint-disable import/export */
17059
17074
  /* eslint-disable complexity */
17060
17075
  /* eslint-disable @typescript-eslint/no-namespace */
17061
17076
  /* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */
17062
17077
  /* eslint-disable @typescript-eslint/no-empty-interface */
17063
- var PushRequest;
17078
+ var PushRequest$1;
17064
17079
  (function (PushRequest) {
17065
17080
  let _codec;
17066
17081
  PushRequest.codec = () => {
@@ -17069,31 +17084,29 @@ var PushRequest;
17069
17084
  if (opts.lengthDelimited !== false) {
17070
17085
  w.fork();
17071
17086
  }
17072
- if ((obj.pubsubTopic != null && obj.pubsubTopic !== '')) {
17073
- w.uint32(10);
17087
+ if (obj.pubsubTopic != null) {
17088
+ w.uint32(162);
17074
17089
  w.string(obj.pubsubTopic);
17075
17090
  }
17076
17091
  if (obj.message != null) {
17077
- w.uint32(18);
17078
- WakuMessage$1.codec().encode(obj.message, w);
17092
+ w.uint32(170);
17093
+ WakuMessage$3.codec().encode(obj.message, w);
17079
17094
  }
17080
17095
  if (opts.lengthDelimited !== false) {
17081
17096
  w.ldelim();
17082
17097
  }
17083
17098
  }, (reader, length, opts = {}) => {
17084
- const obj = {
17085
- pubsubTopic: ''
17086
- };
17099
+ const obj = {};
17087
17100
  const end = length == null ? reader.len : reader.pos + length;
17088
17101
  while (reader.pos < end) {
17089
17102
  const tag = reader.uint32();
17090
17103
  switch (tag >>> 3) {
17091
- case 1: {
17104
+ case 20: {
17092
17105
  obj.pubsubTopic = reader.string();
17093
17106
  break;
17094
17107
  }
17095
- case 2: {
17096
- obj.message = WakuMessage$1.codec().decode(reader, reader.uint32(), {
17108
+ case 21: {
17109
+ obj.message = WakuMessage$3.codec().decode(reader, reader.uint32(), {
17097
17110
  limits: opts.limits?.message
17098
17111
  });
17099
17112
  break;
@@ -17115,8 +17128,8 @@ var PushRequest;
17115
17128
  PushRequest.decode = (buf, opts) => {
17116
17129
  return decodeMessage(buf, PushRequest.codec(), opts);
17117
17130
  };
17118
- })(PushRequest || (PushRequest = {}));
17119
- var PushResponse;
17131
+ })(PushRequest$1 || (PushRequest$1 = {}));
17132
+ var PushResponse$1;
17120
17133
  (function (PushResponse) {
17121
17134
  let _codec;
17122
17135
  PushResponse.codec = () => {
@@ -17125,31 +17138,39 @@ var PushResponse;
17125
17138
  if (opts.lengthDelimited !== false) {
17126
17139
  w.fork();
17127
17140
  }
17128
- if ((obj.isSuccess != null && obj.isSuccess !== false)) {
17129
- w.uint32(8);
17130
- w.bool(obj.isSuccess);
17141
+ if ((obj.statusCode != null && obj.statusCode !== 0)) {
17142
+ w.uint32(160);
17143
+ w.uint32(obj.statusCode);
17131
17144
  }
17132
- if (obj.info != null) {
17133
- w.uint32(18);
17134
- w.string(obj.info);
17145
+ if (obj.statusDesc != null) {
17146
+ w.uint32(242);
17147
+ w.string(obj.statusDesc);
17148
+ }
17149
+ if (obj.relayPeerCount != null) {
17150
+ w.uint32(320);
17151
+ w.uint32(obj.relayPeerCount);
17135
17152
  }
17136
17153
  if (opts.lengthDelimited !== false) {
17137
17154
  w.ldelim();
17138
17155
  }
17139
17156
  }, (reader, length, opts = {}) => {
17140
17157
  const obj = {
17141
- isSuccess: false
17158
+ statusCode: 0
17142
17159
  };
17143
17160
  const end = length == null ? reader.len : reader.pos + length;
17144
17161
  while (reader.pos < end) {
17145
17162
  const tag = reader.uint32();
17146
17163
  switch (tag >>> 3) {
17147
- case 1: {
17148
- obj.isSuccess = reader.bool();
17164
+ case 20: {
17165
+ obj.statusCode = reader.uint32();
17149
17166
  break;
17150
17167
  }
17151
- case 2: {
17152
- obj.info = reader.string();
17168
+ case 30: {
17169
+ obj.statusDesc = reader.string();
17170
+ break;
17171
+ }
17172
+ case 40: {
17173
+ obj.relayPeerCount = reader.uint32();
17153
17174
  break;
17154
17175
  }
17155
17176
  default: {
@@ -17169,8 +17190,8 @@ var PushResponse;
17169
17190
  PushResponse.decode = (buf, opts) => {
17170
17191
  return decodeMessage(buf, PushResponse.codec(), opts);
17171
17192
  };
17172
- })(PushResponse || (PushResponse = {}));
17173
- var PushRpc;
17193
+ })(PushResponse$1 || (PushResponse$1 = {}));
17194
+ var PushRpc$1;
17174
17195
  (function (PushRpc) {
17175
17196
  let _codec;
17176
17197
  PushRpc.codec = () => {
@@ -17185,11 +17206,11 @@ var PushRpc;
17185
17206
  }
17186
17207
  if (obj.request != null) {
17187
17208
  w.uint32(18);
17188
- PushRequest.codec().encode(obj.request, w);
17209
+ PushRequest$1.codec().encode(obj.request, w);
17189
17210
  }
17190
17211
  if (obj.response != null) {
17191
17212
  w.uint32(26);
17192
- PushResponse.codec().encode(obj.response, w);
17213
+ PushResponse$1.codec().encode(obj.response, w);
17193
17214
  }
17194
17215
  if (opts.lengthDelimited !== false) {
17195
17216
  w.ldelim();
@@ -17207,13 +17228,13 @@ var PushRpc;
17207
17228
  break;
17208
17229
  }
17209
17230
  case 2: {
17210
- obj.request = PushRequest.codec().decode(reader, reader.uint32(), {
17231
+ obj.request = PushRequest$1.codec().decode(reader, reader.uint32(), {
17211
17232
  limits: opts.limits?.request
17212
17233
  });
17213
17234
  break;
17214
17235
  }
17215
17236
  case 3: {
17216
- obj.response = PushResponse.codec().decode(reader, reader.uint32(), {
17237
+ obj.response = PushResponse$1.codec().decode(reader, reader.uint32(), {
17217
17238
  limits: opts.limits?.response
17218
17239
  });
17219
17240
  break;
@@ -17235,7 +17256,724 @@ var PushRpc;
17235
17256
  PushRpc.decode = (buf, opts) => {
17236
17257
  return decodeMessage(buf, PushRpc.codec(), opts);
17237
17258
  };
17238
- })(PushRpc || (PushRpc = {}));
17259
+ })(PushRpc$1 || (PushRpc$1 = {}));
17260
+ var RateLimitProof$3;
17261
+ (function (RateLimitProof) {
17262
+ let _codec;
17263
+ RateLimitProof.codec = () => {
17264
+ if (_codec == null) {
17265
+ _codec = message((obj, w, opts = {}) => {
17266
+ if (opts.lengthDelimited !== false) {
17267
+ w.fork();
17268
+ }
17269
+ if ((obj.proof != null && obj.proof.byteLength > 0)) {
17270
+ w.uint32(10);
17271
+ w.bytes(obj.proof);
17272
+ }
17273
+ if ((obj.merkleRoot != null && obj.merkleRoot.byteLength > 0)) {
17274
+ w.uint32(18);
17275
+ w.bytes(obj.merkleRoot);
17276
+ }
17277
+ if ((obj.epoch != null && obj.epoch.byteLength > 0)) {
17278
+ w.uint32(26);
17279
+ w.bytes(obj.epoch);
17280
+ }
17281
+ if ((obj.shareX != null && obj.shareX.byteLength > 0)) {
17282
+ w.uint32(34);
17283
+ w.bytes(obj.shareX);
17284
+ }
17285
+ if ((obj.shareY != null && obj.shareY.byteLength > 0)) {
17286
+ w.uint32(42);
17287
+ w.bytes(obj.shareY);
17288
+ }
17289
+ if ((obj.nullifier != null && obj.nullifier.byteLength > 0)) {
17290
+ w.uint32(50);
17291
+ w.bytes(obj.nullifier);
17292
+ }
17293
+ if ((obj.rlnIdentifier != null && obj.rlnIdentifier.byteLength > 0)) {
17294
+ w.uint32(58);
17295
+ w.bytes(obj.rlnIdentifier);
17296
+ }
17297
+ if (opts.lengthDelimited !== false) {
17298
+ w.ldelim();
17299
+ }
17300
+ }, (reader, length, opts = {}) => {
17301
+ const obj = {
17302
+ proof: alloc$1(0),
17303
+ merkleRoot: alloc$1(0),
17304
+ epoch: alloc$1(0),
17305
+ shareX: alloc$1(0),
17306
+ shareY: alloc$1(0),
17307
+ nullifier: alloc$1(0),
17308
+ rlnIdentifier: alloc$1(0)
17309
+ };
17310
+ const end = length == null ? reader.len : reader.pos + length;
17311
+ while (reader.pos < end) {
17312
+ const tag = reader.uint32();
17313
+ switch (tag >>> 3) {
17314
+ case 1: {
17315
+ obj.proof = reader.bytes();
17316
+ break;
17317
+ }
17318
+ case 2: {
17319
+ obj.merkleRoot = reader.bytes();
17320
+ break;
17321
+ }
17322
+ case 3: {
17323
+ obj.epoch = reader.bytes();
17324
+ break;
17325
+ }
17326
+ case 4: {
17327
+ obj.shareX = reader.bytes();
17328
+ break;
17329
+ }
17330
+ case 5: {
17331
+ obj.shareY = reader.bytes();
17332
+ break;
17333
+ }
17334
+ case 6: {
17335
+ obj.nullifier = reader.bytes();
17336
+ break;
17337
+ }
17338
+ case 7: {
17339
+ obj.rlnIdentifier = reader.bytes();
17340
+ break;
17341
+ }
17342
+ default: {
17343
+ reader.skipType(tag & 7);
17344
+ break;
17345
+ }
17346
+ }
17347
+ }
17348
+ return obj;
17349
+ });
17350
+ }
17351
+ return _codec;
17352
+ };
17353
+ RateLimitProof.encode = (obj) => {
17354
+ return encodeMessage(obj, RateLimitProof.codec());
17355
+ };
17356
+ RateLimitProof.decode = (buf, opts) => {
17357
+ return decodeMessage(buf, RateLimitProof.codec(), opts);
17358
+ };
17359
+ })(RateLimitProof$3 || (RateLimitProof$3 = {}));
17360
+ var WakuMessage$3;
17361
+ (function (WakuMessage) {
17362
+ let _codec;
17363
+ WakuMessage.codec = () => {
17364
+ if (_codec == null) {
17365
+ _codec = message((obj, w, opts = {}) => {
17366
+ if (opts.lengthDelimited !== false) {
17367
+ w.fork();
17368
+ }
17369
+ if ((obj.payload != null && obj.payload.byteLength > 0)) {
17370
+ w.uint32(10);
17371
+ w.bytes(obj.payload);
17372
+ }
17373
+ if ((obj.contentTopic != null && obj.contentTopic !== '')) {
17374
+ w.uint32(18);
17375
+ w.string(obj.contentTopic);
17376
+ }
17377
+ if (obj.version != null) {
17378
+ w.uint32(24);
17379
+ w.uint32(obj.version);
17380
+ }
17381
+ if (obj.timestamp != null) {
17382
+ w.uint32(80);
17383
+ w.sint64(obj.timestamp);
17384
+ }
17385
+ if (obj.meta != null) {
17386
+ w.uint32(90);
17387
+ w.bytes(obj.meta);
17388
+ }
17389
+ if (obj.rateLimitProof != null) {
17390
+ w.uint32(170);
17391
+ RateLimitProof$3.codec().encode(obj.rateLimitProof, w);
17392
+ }
17393
+ if (obj.ephemeral != null) {
17394
+ w.uint32(248);
17395
+ w.bool(obj.ephemeral);
17396
+ }
17397
+ if (opts.lengthDelimited !== false) {
17398
+ w.ldelim();
17399
+ }
17400
+ }, (reader, length, opts = {}) => {
17401
+ const obj = {
17402
+ payload: alloc$1(0),
17403
+ contentTopic: ''
17404
+ };
17405
+ const end = length == null ? reader.len : reader.pos + length;
17406
+ while (reader.pos < end) {
17407
+ const tag = reader.uint32();
17408
+ switch (tag >>> 3) {
17409
+ case 1: {
17410
+ obj.payload = reader.bytes();
17411
+ break;
17412
+ }
17413
+ case 2: {
17414
+ obj.contentTopic = reader.string();
17415
+ break;
17416
+ }
17417
+ case 3: {
17418
+ obj.version = reader.uint32();
17419
+ break;
17420
+ }
17421
+ case 10: {
17422
+ obj.timestamp = reader.sint64();
17423
+ break;
17424
+ }
17425
+ case 11: {
17426
+ obj.meta = reader.bytes();
17427
+ break;
17428
+ }
17429
+ case 21: {
17430
+ obj.rateLimitProof = RateLimitProof$3.codec().decode(reader, reader.uint32(), {
17431
+ limits: opts.limits?.rateLimitProof
17432
+ });
17433
+ break;
17434
+ }
17435
+ case 31: {
17436
+ obj.ephemeral = reader.bool();
17437
+ break;
17438
+ }
17439
+ default: {
17440
+ reader.skipType(tag & 7);
17441
+ break;
17442
+ }
17443
+ }
17444
+ }
17445
+ return obj;
17446
+ });
17447
+ }
17448
+ return _codec;
17449
+ };
17450
+ WakuMessage.encode = (obj) => {
17451
+ return encodeMessage(obj, WakuMessage.codec());
17452
+ };
17453
+ WakuMessage.decode = (buf, opts) => {
17454
+ return decodeMessage(buf, WakuMessage.codec(), opts);
17455
+ };
17456
+ })(WakuMessage$3 || (WakuMessage$3 = {}));
17457
+
17458
+ /* eslint-disable import/export */
17459
+ /* eslint-disable complexity */
17460
+ /* eslint-disable @typescript-eslint/no-namespace */
17461
+ /* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */
17462
+ /* eslint-disable @typescript-eslint/no-empty-interface */
17463
+ var PushRequest;
17464
+ (function (PushRequest) {
17465
+ let _codec;
17466
+ PushRequest.codec = () => {
17467
+ if (_codec == null) {
17468
+ _codec = message((obj, w, opts = {}) => {
17469
+ if (opts.lengthDelimited !== false) {
17470
+ w.fork();
17471
+ }
17472
+ if ((obj.pubsubTopic != null && obj.pubsubTopic !== '')) {
17473
+ w.uint32(10);
17474
+ w.string(obj.pubsubTopic);
17475
+ }
17476
+ if (obj.message != null) {
17477
+ w.uint32(18);
17478
+ WakuMessage$2.codec().encode(obj.message, w);
17479
+ }
17480
+ if (opts.lengthDelimited !== false) {
17481
+ w.ldelim();
17482
+ }
17483
+ }, (reader, length, opts = {}) => {
17484
+ const obj = {
17485
+ pubsubTopic: ''
17486
+ };
17487
+ const end = length == null ? reader.len : reader.pos + length;
17488
+ while (reader.pos < end) {
17489
+ const tag = reader.uint32();
17490
+ switch (tag >>> 3) {
17491
+ case 1: {
17492
+ obj.pubsubTopic = reader.string();
17493
+ break;
17494
+ }
17495
+ case 2: {
17496
+ obj.message = WakuMessage$2.codec().decode(reader, reader.uint32(), {
17497
+ limits: opts.limits?.message
17498
+ });
17499
+ break;
17500
+ }
17501
+ default: {
17502
+ reader.skipType(tag & 7);
17503
+ break;
17504
+ }
17505
+ }
17506
+ }
17507
+ return obj;
17508
+ });
17509
+ }
17510
+ return _codec;
17511
+ };
17512
+ PushRequest.encode = (obj) => {
17513
+ return encodeMessage(obj, PushRequest.codec());
17514
+ };
17515
+ PushRequest.decode = (buf, opts) => {
17516
+ return decodeMessage(buf, PushRequest.codec(), opts);
17517
+ };
17518
+ })(PushRequest || (PushRequest = {}));
17519
+ var PushResponse;
17520
+ (function (PushResponse) {
17521
+ let _codec;
17522
+ PushResponse.codec = () => {
17523
+ if (_codec == null) {
17524
+ _codec = message((obj, w, opts = {}) => {
17525
+ if (opts.lengthDelimited !== false) {
17526
+ w.fork();
17527
+ }
17528
+ if ((obj.isSuccess != null && obj.isSuccess !== false)) {
17529
+ w.uint32(8);
17530
+ w.bool(obj.isSuccess);
17531
+ }
17532
+ if (obj.info != null) {
17533
+ w.uint32(18);
17534
+ w.string(obj.info);
17535
+ }
17536
+ if (opts.lengthDelimited !== false) {
17537
+ w.ldelim();
17538
+ }
17539
+ }, (reader, length, opts = {}) => {
17540
+ const obj = {
17541
+ isSuccess: false
17542
+ };
17543
+ const end = length == null ? reader.len : reader.pos + length;
17544
+ while (reader.pos < end) {
17545
+ const tag = reader.uint32();
17546
+ switch (tag >>> 3) {
17547
+ case 1: {
17548
+ obj.isSuccess = reader.bool();
17549
+ break;
17550
+ }
17551
+ case 2: {
17552
+ obj.info = reader.string();
17553
+ break;
17554
+ }
17555
+ default: {
17556
+ reader.skipType(tag & 7);
17557
+ break;
17558
+ }
17559
+ }
17560
+ }
17561
+ return obj;
17562
+ });
17563
+ }
17564
+ return _codec;
17565
+ };
17566
+ PushResponse.encode = (obj) => {
17567
+ return encodeMessage(obj, PushResponse.codec());
17568
+ };
17569
+ PushResponse.decode = (buf, opts) => {
17570
+ return decodeMessage(buf, PushResponse.codec(), opts);
17571
+ };
17572
+ })(PushResponse || (PushResponse = {}));
17573
+ var PushRpc;
17574
+ (function (PushRpc) {
17575
+ let _codec;
17576
+ PushRpc.codec = () => {
17577
+ if (_codec == null) {
17578
+ _codec = message((obj, w, opts = {}) => {
17579
+ if (opts.lengthDelimited !== false) {
17580
+ w.fork();
17581
+ }
17582
+ if ((obj.requestId != null && obj.requestId !== '')) {
17583
+ w.uint32(10);
17584
+ w.string(obj.requestId);
17585
+ }
17586
+ if (obj.request != null) {
17587
+ w.uint32(18);
17588
+ PushRequest.codec().encode(obj.request, w);
17589
+ }
17590
+ if (obj.response != null) {
17591
+ w.uint32(26);
17592
+ PushResponse.codec().encode(obj.response, w);
17593
+ }
17594
+ if (opts.lengthDelimited !== false) {
17595
+ w.ldelim();
17596
+ }
17597
+ }, (reader, length, opts = {}) => {
17598
+ const obj = {
17599
+ requestId: ''
17600
+ };
17601
+ const end = length == null ? reader.len : reader.pos + length;
17602
+ while (reader.pos < end) {
17603
+ const tag = reader.uint32();
17604
+ switch (tag >>> 3) {
17605
+ case 1: {
17606
+ obj.requestId = reader.string();
17607
+ break;
17608
+ }
17609
+ case 2: {
17610
+ obj.request = PushRequest.codec().decode(reader, reader.uint32(), {
17611
+ limits: opts.limits?.request
17612
+ });
17613
+ break;
17614
+ }
17615
+ case 3: {
17616
+ obj.response = PushResponse.codec().decode(reader, reader.uint32(), {
17617
+ limits: opts.limits?.response
17618
+ });
17619
+ break;
17620
+ }
17621
+ default: {
17622
+ reader.skipType(tag & 7);
17623
+ break;
17624
+ }
17625
+ }
17626
+ }
17627
+ return obj;
17628
+ });
17629
+ }
17630
+ return _codec;
17631
+ };
17632
+ PushRpc.encode = (obj) => {
17633
+ return encodeMessage(obj, PushRpc.codec());
17634
+ };
17635
+ PushRpc.decode = (buf, opts) => {
17636
+ return decodeMessage(buf, PushRpc.codec(), opts);
17637
+ };
17638
+ })(PushRpc || (PushRpc = {}));
17639
+ var RateLimitProof$2;
17640
+ (function (RateLimitProof) {
17641
+ let _codec;
17642
+ RateLimitProof.codec = () => {
17643
+ if (_codec == null) {
17644
+ _codec = message((obj, w, opts = {}) => {
17645
+ if (opts.lengthDelimited !== false) {
17646
+ w.fork();
17647
+ }
17648
+ if ((obj.proof != null && obj.proof.byteLength > 0)) {
17649
+ w.uint32(10);
17650
+ w.bytes(obj.proof);
17651
+ }
17652
+ if ((obj.merkleRoot != null && obj.merkleRoot.byteLength > 0)) {
17653
+ w.uint32(18);
17654
+ w.bytes(obj.merkleRoot);
17655
+ }
17656
+ if ((obj.epoch != null && obj.epoch.byteLength > 0)) {
17657
+ w.uint32(26);
17658
+ w.bytes(obj.epoch);
17659
+ }
17660
+ if ((obj.shareX != null && obj.shareX.byteLength > 0)) {
17661
+ w.uint32(34);
17662
+ w.bytes(obj.shareX);
17663
+ }
17664
+ if ((obj.shareY != null && obj.shareY.byteLength > 0)) {
17665
+ w.uint32(42);
17666
+ w.bytes(obj.shareY);
17667
+ }
17668
+ if ((obj.nullifier != null && obj.nullifier.byteLength > 0)) {
17669
+ w.uint32(50);
17670
+ w.bytes(obj.nullifier);
17671
+ }
17672
+ if ((obj.rlnIdentifier != null && obj.rlnIdentifier.byteLength > 0)) {
17673
+ w.uint32(58);
17674
+ w.bytes(obj.rlnIdentifier);
17675
+ }
17676
+ if (opts.lengthDelimited !== false) {
17677
+ w.ldelim();
17678
+ }
17679
+ }, (reader, length, opts = {}) => {
17680
+ const obj = {
17681
+ proof: alloc$1(0),
17682
+ merkleRoot: alloc$1(0),
17683
+ epoch: alloc$1(0),
17684
+ shareX: alloc$1(0),
17685
+ shareY: alloc$1(0),
17686
+ nullifier: alloc$1(0),
17687
+ rlnIdentifier: alloc$1(0)
17688
+ };
17689
+ const end = length == null ? reader.len : reader.pos + length;
17690
+ while (reader.pos < end) {
17691
+ const tag = reader.uint32();
17692
+ switch (tag >>> 3) {
17693
+ case 1: {
17694
+ obj.proof = reader.bytes();
17695
+ break;
17696
+ }
17697
+ case 2: {
17698
+ obj.merkleRoot = reader.bytes();
17699
+ break;
17700
+ }
17701
+ case 3: {
17702
+ obj.epoch = reader.bytes();
17703
+ break;
17704
+ }
17705
+ case 4: {
17706
+ obj.shareX = reader.bytes();
17707
+ break;
17708
+ }
17709
+ case 5: {
17710
+ obj.shareY = reader.bytes();
17711
+ break;
17712
+ }
17713
+ case 6: {
17714
+ obj.nullifier = reader.bytes();
17715
+ break;
17716
+ }
17717
+ case 7: {
17718
+ obj.rlnIdentifier = reader.bytes();
17719
+ break;
17720
+ }
17721
+ default: {
17722
+ reader.skipType(tag & 7);
17723
+ break;
17724
+ }
17725
+ }
17726
+ }
17727
+ return obj;
17728
+ });
17729
+ }
17730
+ return _codec;
17731
+ };
17732
+ RateLimitProof.encode = (obj) => {
17733
+ return encodeMessage(obj, RateLimitProof.codec());
17734
+ };
17735
+ RateLimitProof.decode = (buf, opts) => {
17736
+ return decodeMessage(buf, RateLimitProof.codec(), opts);
17737
+ };
17738
+ })(RateLimitProof$2 || (RateLimitProof$2 = {}));
17739
+ var WakuMessage$2;
17740
+ (function (WakuMessage) {
17741
+ let _codec;
17742
+ WakuMessage.codec = () => {
17743
+ if (_codec == null) {
17744
+ _codec = message((obj, w, opts = {}) => {
17745
+ if (opts.lengthDelimited !== false) {
17746
+ w.fork();
17747
+ }
17748
+ if ((obj.payload != null && obj.payload.byteLength > 0)) {
17749
+ w.uint32(10);
17750
+ w.bytes(obj.payload);
17751
+ }
17752
+ if ((obj.contentTopic != null && obj.contentTopic !== '')) {
17753
+ w.uint32(18);
17754
+ w.string(obj.contentTopic);
17755
+ }
17756
+ if (obj.version != null) {
17757
+ w.uint32(24);
17758
+ w.uint32(obj.version);
17759
+ }
17760
+ if (obj.timestamp != null) {
17761
+ w.uint32(80);
17762
+ w.sint64(obj.timestamp);
17763
+ }
17764
+ if (obj.meta != null) {
17765
+ w.uint32(90);
17766
+ w.bytes(obj.meta);
17767
+ }
17768
+ if (obj.rateLimitProof != null) {
17769
+ w.uint32(170);
17770
+ RateLimitProof$2.codec().encode(obj.rateLimitProof, w);
17771
+ }
17772
+ if (obj.ephemeral != null) {
17773
+ w.uint32(248);
17774
+ w.bool(obj.ephemeral);
17775
+ }
17776
+ if (opts.lengthDelimited !== false) {
17777
+ w.ldelim();
17778
+ }
17779
+ }, (reader, length, opts = {}) => {
17780
+ const obj = {
17781
+ payload: alloc$1(0),
17782
+ contentTopic: ''
17783
+ };
17784
+ const end = length == null ? reader.len : reader.pos + length;
17785
+ while (reader.pos < end) {
17786
+ const tag = reader.uint32();
17787
+ switch (tag >>> 3) {
17788
+ case 1: {
17789
+ obj.payload = reader.bytes();
17790
+ break;
17791
+ }
17792
+ case 2: {
17793
+ obj.contentTopic = reader.string();
17794
+ break;
17795
+ }
17796
+ case 3: {
17797
+ obj.version = reader.uint32();
17798
+ break;
17799
+ }
17800
+ case 10: {
17801
+ obj.timestamp = reader.sint64();
17802
+ break;
17803
+ }
17804
+ case 11: {
17805
+ obj.meta = reader.bytes();
17806
+ break;
17807
+ }
17808
+ case 21: {
17809
+ obj.rateLimitProof = RateLimitProof$2.codec().decode(reader, reader.uint32(), {
17810
+ limits: opts.limits?.rateLimitProof
17811
+ });
17812
+ break;
17813
+ }
17814
+ case 31: {
17815
+ obj.ephemeral = reader.bool();
17816
+ break;
17817
+ }
17818
+ default: {
17819
+ reader.skipType(tag & 7);
17820
+ break;
17821
+ }
17822
+ }
17823
+ }
17824
+ return obj;
17825
+ });
17826
+ }
17827
+ return _codec;
17828
+ };
17829
+ WakuMessage.encode = (obj) => {
17830
+ return encodeMessage(obj, WakuMessage.codec());
17831
+ };
17832
+ WakuMessage.decode = (buf, opts) => {
17833
+ return decodeMessage(buf, WakuMessage.codec(), opts);
17834
+ };
17835
+ })(WakuMessage$2 || (WakuMessage$2 = {}));
17836
+
17837
+ /* eslint-disable import/export */
17838
+ /* eslint-disable complexity */
17839
+ /* eslint-disable @typescript-eslint/no-namespace */
17840
+ /* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */
17841
+ /* eslint-disable @typescript-eslint/no-empty-interface */
17842
+ var LightpushRequest;
17843
+ (function (LightpushRequest) {
17844
+ let _codec;
17845
+ LightpushRequest.codec = () => {
17846
+ if (_codec == null) {
17847
+ _codec = message((obj, w, opts = {}) => {
17848
+ if (opts.lengthDelimited !== false) {
17849
+ w.fork();
17850
+ }
17851
+ if ((obj.requestId != null && obj.requestId !== '')) {
17852
+ w.uint32(10);
17853
+ w.string(obj.requestId);
17854
+ }
17855
+ if (obj.pubsubTopic != null) {
17856
+ w.uint32(162);
17857
+ w.string(obj.pubsubTopic);
17858
+ }
17859
+ if (obj.message != null) {
17860
+ w.uint32(170);
17861
+ WakuMessage$1.codec().encode(obj.message, w);
17862
+ }
17863
+ if (opts.lengthDelimited !== false) {
17864
+ w.ldelim();
17865
+ }
17866
+ }, (reader, length, opts = {}) => {
17867
+ const obj = {
17868
+ requestId: ''
17869
+ };
17870
+ const end = length == null ? reader.len : reader.pos + length;
17871
+ while (reader.pos < end) {
17872
+ const tag = reader.uint32();
17873
+ switch (tag >>> 3) {
17874
+ case 1: {
17875
+ obj.requestId = reader.string();
17876
+ break;
17877
+ }
17878
+ case 20: {
17879
+ obj.pubsubTopic = reader.string();
17880
+ break;
17881
+ }
17882
+ case 21: {
17883
+ obj.message = WakuMessage$1.codec().decode(reader, reader.uint32(), {
17884
+ limits: opts.limits?.message
17885
+ });
17886
+ break;
17887
+ }
17888
+ default: {
17889
+ reader.skipType(tag & 7);
17890
+ break;
17891
+ }
17892
+ }
17893
+ }
17894
+ return obj;
17895
+ });
17896
+ }
17897
+ return _codec;
17898
+ };
17899
+ LightpushRequest.encode = (obj) => {
17900
+ return encodeMessage(obj, LightpushRequest.codec());
17901
+ };
17902
+ LightpushRequest.decode = (buf, opts) => {
17903
+ return decodeMessage(buf, LightpushRequest.codec(), opts);
17904
+ };
17905
+ })(LightpushRequest || (LightpushRequest = {}));
17906
+ var LightpushResponse;
17907
+ (function (LightpushResponse) {
17908
+ let _codec;
17909
+ LightpushResponse.codec = () => {
17910
+ if (_codec == null) {
17911
+ _codec = message((obj, w, opts = {}) => {
17912
+ if (opts.lengthDelimited !== false) {
17913
+ w.fork();
17914
+ }
17915
+ if ((obj.requestId != null && obj.requestId !== '')) {
17916
+ w.uint32(10);
17917
+ w.string(obj.requestId);
17918
+ }
17919
+ if ((obj.statusCode != null && obj.statusCode !== 0)) {
17920
+ w.uint32(80);
17921
+ w.uint32(obj.statusCode);
17922
+ }
17923
+ if (obj.statusDesc != null) {
17924
+ w.uint32(90);
17925
+ w.string(obj.statusDesc);
17926
+ }
17927
+ if (obj.relayPeerCount != null) {
17928
+ w.uint32(96);
17929
+ w.uint32(obj.relayPeerCount);
17930
+ }
17931
+ if (opts.lengthDelimited !== false) {
17932
+ w.ldelim();
17933
+ }
17934
+ }, (reader, length, opts = {}) => {
17935
+ const obj = {
17936
+ requestId: '',
17937
+ statusCode: 0
17938
+ };
17939
+ const end = length == null ? reader.len : reader.pos + length;
17940
+ while (reader.pos < end) {
17941
+ const tag = reader.uint32();
17942
+ switch (tag >>> 3) {
17943
+ case 1: {
17944
+ obj.requestId = reader.string();
17945
+ break;
17946
+ }
17947
+ case 10: {
17948
+ obj.statusCode = reader.uint32();
17949
+ break;
17950
+ }
17951
+ case 11: {
17952
+ obj.statusDesc = reader.string();
17953
+ break;
17954
+ }
17955
+ case 12: {
17956
+ obj.relayPeerCount = reader.uint32();
17957
+ break;
17958
+ }
17959
+ default: {
17960
+ reader.skipType(tag & 7);
17961
+ break;
17962
+ }
17963
+ }
17964
+ }
17965
+ return obj;
17966
+ });
17967
+ }
17968
+ return _codec;
17969
+ };
17970
+ LightpushResponse.encode = (obj) => {
17971
+ return encodeMessage(obj, LightpushResponse.codec());
17972
+ };
17973
+ LightpushResponse.decode = (buf, opts) => {
17974
+ return decodeMessage(buf, LightpushResponse.codec(), opts);
17975
+ };
17976
+ })(LightpushResponse || (LightpushResponse = {}));
17239
17977
  var RateLimitProof$1;
17240
17978
  (function (RateLimitProof) {
17241
17979
  let _codec;