@waku/discovery 0.0.9-76fb1ea.0 → 0.0.9-86bbf5b.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,21 +123,6 @@ 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
-
141
126
  var Protocols;
142
127
  (function (Protocols) {
143
128
  Protocols["Relay"] = "relay";
@@ -15966,7 +15951,7 @@ const duplexPipelineFn = (duplex) => {
15966
15951
  /* eslint-disable @typescript-eslint/no-namespace */
15967
15952
  /* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */
15968
15953
  /* eslint-disable @typescript-eslint/no-empty-interface */
15969
- var RateLimitProof$6;
15954
+ var RateLimitProof$4;
15970
15955
  (function (RateLimitProof) {
15971
15956
  let _codec;
15972
15957
  RateLimitProof.codec = () => {
@@ -16065,8 +16050,8 @@ var RateLimitProof$6;
16065
16050
  RateLimitProof.decode = (buf, opts) => {
16066
16051
  return decodeMessage(buf, RateLimitProof.codec(), opts);
16067
16052
  };
16068
- })(RateLimitProof$6 || (RateLimitProof$6 = {}));
16069
- var WakuMessage$6;
16053
+ })(RateLimitProof$4 || (RateLimitProof$4 = {}));
16054
+ var WakuMessage$4;
16070
16055
  (function (WakuMessage) {
16071
16056
  let _codec;
16072
16057
  WakuMessage.codec = () => {
@@ -16097,7 +16082,7 @@ var WakuMessage$6;
16097
16082
  }
16098
16083
  if (obj.rateLimitProof != null) {
16099
16084
  w.uint32(170);
16100
- RateLimitProof$6.codec().encode(obj.rateLimitProof, w);
16085
+ RateLimitProof$4.codec().encode(obj.rateLimitProof, w);
16101
16086
  }
16102
16087
  if (obj.ephemeral != null) {
16103
16088
  w.uint32(248);
@@ -16136,7 +16121,7 @@ var WakuMessage$6;
16136
16121
  break;
16137
16122
  }
16138
16123
  case 21: {
16139
- obj.rateLimitProof = RateLimitProof$6.codec().decode(reader, reader.uint32(), {
16124
+ obj.rateLimitProof = RateLimitProof$4.codec().decode(reader, reader.uint32(), {
16140
16125
  limits: opts.limits?.rateLimitProof
16141
16126
  });
16142
16127
  break;
@@ -16162,7 +16147,7 @@ var WakuMessage$6;
16162
16147
  WakuMessage.decode = (buf, opts) => {
16163
16148
  return decodeMessage(buf, WakuMessage.codec(), opts);
16164
16149
  };
16165
- })(WakuMessage$6 || (WakuMessage$6 = {}));
16150
+ })(WakuMessage$4 || (WakuMessage$4 = {}));
16166
16151
 
16167
16152
  /* eslint-disable import/export */
16168
16153
  /* eslint-disable complexity */
@@ -16297,7 +16282,7 @@ var MessagePush$1;
16297
16282
  if (obj.messages != null) {
16298
16283
  for (const value of obj.messages) {
16299
16284
  w.uint32(10);
16300
- WakuMessage$5.codec().encode(value, w);
16285
+ WakuMessage$3.codec().encode(value, w);
16301
16286
  }
16302
16287
  }
16303
16288
  if (opts.lengthDelimited !== false) {
@@ -16315,7 +16300,7 @@ var MessagePush$1;
16315
16300
  if (opts.limits?.messages != null && obj.messages.length === opts.limits.messages) {
16316
16301
  throw new MaxLengthError('Decode error - map field "messages" had too many elements');
16317
16302
  }
16318
- obj.messages.push(WakuMessage$5.codec().decode(reader, reader.uint32(), {
16303
+ obj.messages.push(WakuMessage$3.codec().decode(reader, reader.uint32(), {
16319
16304
  limits: opts.limits?.messages$
16320
16305
  }));
16321
16306
  break;
@@ -16404,7 +16389,7 @@ var FilterRpc;
16404
16389
  return decodeMessage(buf, FilterRpc.codec(), opts);
16405
16390
  };
16406
16391
  })(FilterRpc || (FilterRpc = {}));
16407
- var RateLimitProof$5;
16392
+ var RateLimitProof$3;
16408
16393
  (function (RateLimitProof) {
16409
16394
  let _codec;
16410
16395
  RateLimitProof.codec = () => {
@@ -16503,8 +16488,8 @@ var RateLimitProof$5;
16503
16488
  RateLimitProof.decode = (buf, opts) => {
16504
16489
  return decodeMessage(buf, RateLimitProof.codec(), opts);
16505
16490
  };
16506
- })(RateLimitProof$5 || (RateLimitProof$5 = {}));
16507
- var WakuMessage$5;
16491
+ })(RateLimitProof$3 || (RateLimitProof$3 = {}));
16492
+ var WakuMessage$3;
16508
16493
  (function (WakuMessage) {
16509
16494
  let _codec;
16510
16495
  WakuMessage.codec = () => {
@@ -16535,7 +16520,7 @@ var WakuMessage$5;
16535
16520
  }
16536
16521
  if (obj.rateLimitProof != null) {
16537
16522
  w.uint32(170);
16538
- RateLimitProof$5.codec().encode(obj.rateLimitProof, w);
16523
+ RateLimitProof$3.codec().encode(obj.rateLimitProof, w);
16539
16524
  }
16540
16525
  if (obj.ephemeral != null) {
16541
16526
  w.uint32(248);
@@ -16574,7 +16559,7 @@ var WakuMessage$5;
16574
16559
  break;
16575
16560
  }
16576
16561
  case 21: {
16577
- obj.rateLimitProof = RateLimitProof$5.codec().decode(reader, reader.uint32(), {
16562
+ obj.rateLimitProof = RateLimitProof$3.codec().decode(reader, reader.uint32(), {
16578
16563
  limits: opts.limits?.rateLimitProof
16579
16564
  });
16580
16565
  break;
@@ -16600,7 +16585,7 @@ var WakuMessage$5;
16600
16585
  WakuMessage.decode = (buf, opts) => {
16601
16586
  return decodeMessage(buf, WakuMessage.codec(), opts);
16602
16587
  };
16603
- })(WakuMessage$5 || (WakuMessage$5 = {}));
16588
+ })(WakuMessage$3 || (WakuMessage$3 = {}));
16604
16589
 
16605
16590
  /* eslint-disable import/export */
16606
16591
  /* eslint-disable complexity */
@@ -16829,7 +16814,7 @@ var MessagePush;
16829
16814
  }
16830
16815
  if (obj.wakuMessage != null) {
16831
16816
  w.uint32(10);
16832
- WakuMessage$4.codec().encode(obj.wakuMessage, w);
16817
+ WakuMessage$2.codec().encode(obj.wakuMessage, w);
16833
16818
  }
16834
16819
  if (obj.pubsubTopic != null) {
16835
16820
  w.uint32(18);
@@ -16845,7 +16830,7 @@ var MessagePush;
16845
16830
  const tag = reader.uint32();
16846
16831
  switch (tag >>> 3) {
16847
16832
  case 1: {
16848
- obj.wakuMessage = WakuMessage$4.codec().decode(reader, reader.uint32(), {
16833
+ obj.wakuMessage = WakuMessage$2.codec().decode(reader, reader.uint32(), {
16849
16834
  limits: opts.limits?.wakuMessage
16850
16835
  });
16851
16836
  break;
@@ -16872,7 +16857,7 @@ var MessagePush;
16872
16857
  return decodeMessage(buf, MessagePush.codec(), opts);
16873
16858
  };
16874
16859
  })(MessagePush || (MessagePush = {}));
16875
- var RateLimitProof$4;
16860
+ var RateLimitProof$2;
16876
16861
  (function (RateLimitProof) {
16877
16862
  let _codec;
16878
16863
  RateLimitProof.codec = () => {
@@ -16971,8 +16956,8 @@ var RateLimitProof$4;
16971
16956
  RateLimitProof.decode = (buf, opts) => {
16972
16957
  return decodeMessage(buf, RateLimitProof.codec(), opts);
16973
16958
  };
16974
- })(RateLimitProof$4 || (RateLimitProof$4 = {}));
16975
- var WakuMessage$4;
16959
+ })(RateLimitProof$2 || (RateLimitProof$2 = {}));
16960
+ var WakuMessage$2;
16976
16961
  (function (WakuMessage) {
16977
16962
  let _codec;
16978
16963
  WakuMessage.codec = () => {
@@ -17003,7 +16988,7 @@ var WakuMessage$4;
17003
16988
  }
17004
16989
  if (obj.rateLimitProof != null) {
17005
16990
  w.uint32(170);
17006
- RateLimitProof$4.codec().encode(obj.rateLimitProof, w);
16991
+ RateLimitProof$2.codec().encode(obj.rateLimitProof, w);
17007
16992
  }
17008
16993
  if (obj.ephemeral != null) {
17009
16994
  w.uint32(248);
@@ -17042,7 +17027,7 @@ var WakuMessage$4;
17042
17027
  break;
17043
17028
  }
17044
17029
  case 21: {
17045
- obj.rateLimitProof = RateLimitProof$4.codec().decode(reader, reader.uint32(), {
17030
+ obj.rateLimitProof = RateLimitProof$2.codec().decode(reader, reader.uint32(), {
17046
17031
  limits: opts.limits?.rateLimitProof
17047
17032
  });
17048
17033
  break;
@@ -17068,14 +17053,14 @@ var WakuMessage$4;
17068
17053
  WakuMessage.decode = (buf, opts) => {
17069
17054
  return decodeMessage(buf, WakuMessage.codec(), opts);
17070
17055
  };
17071
- })(WakuMessage$4 || (WakuMessage$4 = {}));
17056
+ })(WakuMessage$2 || (WakuMessage$2 = {}));
17072
17057
 
17073
17058
  /* eslint-disable import/export */
17074
17059
  /* eslint-disable complexity */
17075
17060
  /* eslint-disable @typescript-eslint/no-namespace */
17076
17061
  /* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */
17077
17062
  /* eslint-disable @typescript-eslint/no-empty-interface */
17078
- var PushRequest$1;
17063
+ var PushRequest;
17079
17064
  (function (PushRequest) {
17080
17065
  let _codec;
17081
17066
  PushRequest.codec = () => {
@@ -17084,29 +17069,31 @@ var PushRequest$1;
17084
17069
  if (opts.lengthDelimited !== false) {
17085
17070
  w.fork();
17086
17071
  }
17087
- if (obj.pubsubTopic != null) {
17088
- w.uint32(162);
17072
+ if ((obj.pubsubTopic != null && obj.pubsubTopic !== '')) {
17073
+ w.uint32(10);
17089
17074
  w.string(obj.pubsubTopic);
17090
17075
  }
17091
17076
  if (obj.message != null) {
17092
- w.uint32(170);
17093
- WakuMessage$3.codec().encode(obj.message, w);
17077
+ w.uint32(18);
17078
+ WakuMessage$1.codec().encode(obj.message, w);
17094
17079
  }
17095
17080
  if (opts.lengthDelimited !== false) {
17096
17081
  w.ldelim();
17097
17082
  }
17098
17083
  }, (reader, length, opts = {}) => {
17099
- const obj = {};
17084
+ const obj = {
17085
+ pubsubTopic: ''
17086
+ };
17100
17087
  const end = length == null ? reader.len : reader.pos + length;
17101
17088
  while (reader.pos < end) {
17102
17089
  const tag = reader.uint32();
17103
17090
  switch (tag >>> 3) {
17104
- case 20: {
17091
+ case 1: {
17105
17092
  obj.pubsubTopic = reader.string();
17106
17093
  break;
17107
17094
  }
17108
- case 21: {
17109
- obj.message = WakuMessage$3.codec().decode(reader, reader.uint32(), {
17095
+ case 2: {
17096
+ obj.message = WakuMessage$1.codec().decode(reader, reader.uint32(), {
17110
17097
  limits: opts.limits?.message
17111
17098
  });
17112
17099
  break;
@@ -17128,8 +17115,8 @@ var PushRequest$1;
17128
17115
  PushRequest.decode = (buf, opts) => {
17129
17116
  return decodeMessage(buf, PushRequest.codec(), opts);
17130
17117
  };
17131
- })(PushRequest$1 || (PushRequest$1 = {}));
17132
- var PushResponse$1;
17118
+ })(PushRequest || (PushRequest = {}));
17119
+ var PushResponse;
17133
17120
  (function (PushResponse) {
17134
17121
  let _codec;
17135
17122
  PushResponse.codec = () => {
@@ -17138,39 +17125,31 @@ var PushResponse$1;
17138
17125
  if (opts.lengthDelimited !== false) {
17139
17126
  w.fork();
17140
17127
  }
17141
- if ((obj.statusCode != null && obj.statusCode !== 0)) {
17142
- w.uint32(160);
17143
- w.uint32(obj.statusCode);
17144
- }
17145
- if (obj.statusDesc != null) {
17146
- w.uint32(242);
17147
- w.string(obj.statusDesc);
17128
+ if ((obj.isSuccess != null && obj.isSuccess !== false)) {
17129
+ w.uint32(8);
17130
+ w.bool(obj.isSuccess);
17148
17131
  }
17149
- if (obj.relayPeerCount != null) {
17150
- w.uint32(320);
17151
- w.uint32(obj.relayPeerCount);
17132
+ if (obj.info != null) {
17133
+ w.uint32(18);
17134
+ w.string(obj.info);
17152
17135
  }
17153
17136
  if (opts.lengthDelimited !== false) {
17154
17137
  w.ldelim();
17155
17138
  }
17156
17139
  }, (reader, length, opts = {}) => {
17157
17140
  const obj = {
17158
- statusCode: 0
17141
+ isSuccess: false
17159
17142
  };
17160
17143
  const end = length == null ? reader.len : reader.pos + length;
17161
17144
  while (reader.pos < end) {
17162
17145
  const tag = reader.uint32();
17163
17146
  switch (tag >>> 3) {
17164
- case 20: {
17165
- obj.statusCode = reader.uint32();
17166
- break;
17167
- }
17168
- case 30: {
17169
- obj.statusDesc = reader.string();
17147
+ case 1: {
17148
+ obj.isSuccess = reader.bool();
17170
17149
  break;
17171
17150
  }
17172
- case 40: {
17173
- obj.relayPeerCount = reader.uint32();
17151
+ case 2: {
17152
+ obj.info = reader.string();
17174
17153
  break;
17175
17154
  }
17176
17155
  default: {
@@ -17190,8 +17169,8 @@ var PushResponse$1;
17190
17169
  PushResponse.decode = (buf, opts) => {
17191
17170
  return decodeMessage(buf, PushResponse.codec(), opts);
17192
17171
  };
17193
- })(PushResponse$1 || (PushResponse$1 = {}));
17194
- var PushRpc$1;
17172
+ })(PushResponse || (PushResponse = {}));
17173
+ var PushRpc;
17195
17174
  (function (PushRpc) {
17196
17175
  let _codec;
17197
17176
  PushRpc.codec = () => {
@@ -17206,11 +17185,11 @@ var PushRpc$1;
17206
17185
  }
17207
17186
  if (obj.request != null) {
17208
17187
  w.uint32(18);
17209
- PushRequest$1.codec().encode(obj.request, w);
17188
+ PushRequest.codec().encode(obj.request, w);
17210
17189
  }
17211
17190
  if (obj.response != null) {
17212
17191
  w.uint32(26);
17213
- PushResponse$1.codec().encode(obj.response, w);
17192
+ PushResponse.codec().encode(obj.response, w);
17214
17193
  }
17215
17194
  if (opts.lengthDelimited !== false) {
17216
17195
  w.ldelim();
@@ -17228,392 +17207,13 @@ var PushRpc$1;
17228
17207
  break;
17229
17208
  }
17230
17209
  case 2: {
17231
- obj.request = PushRequest$1.codec().decode(reader, reader.uint32(), {
17210
+ obj.request = PushRequest.codec().decode(reader, reader.uint32(), {
17232
17211
  limits: opts.limits?.request
17233
17212
  });
17234
17213
  break;
17235
17214
  }
17236
17215
  case 3: {
17237
- obj.response = PushResponse$1.codec().decode(reader, reader.uint32(), {
17238
- limits: opts.limits?.response
17239
- });
17240
- break;
17241
- }
17242
- default: {
17243
- reader.skipType(tag & 7);
17244
- break;
17245
- }
17246
- }
17247
- }
17248
- return obj;
17249
- });
17250
- }
17251
- return _codec;
17252
- };
17253
- PushRpc.encode = (obj) => {
17254
- return encodeMessage(obj, PushRpc.codec());
17255
- };
17256
- PushRpc.decode = (buf, opts) => {
17257
- return decodeMessage(buf, PushRpc.codec(), opts);
17258
- };
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(), {
17216
+ obj.response = PushResponse.codec().decode(reader, reader.uint32(), {
17617
17217
  limits: opts.limits?.response
17618
17218
  });
17619
17219
  break;
@@ -17636,344 +17236,6 @@ var PushRpc;
17636
17236
  return decodeMessage(buf, PushRpc.codec(), opts);
17637
17237
  };
17638
17238
  })(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 = {}));
17977
17239
  var RateLimitProof$1;
17978
17240
  (function (RateLimitProof) {
17979
17241
  let _codec;