@waku/message-encryption 0.0.34-6d86b6f.0 → 0.0.34-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.
@@ -1349,7 +1349,7 @@ class MaxLengthError extends Error {
1349
1349
  /* eslint-disable @typescript-eslint/no-namespace */
1350
1350
  /* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */
1351
1351
  /* eslint-disable @typescript-eslint/no-empty-interface */
1352
- var RateLimitProof$4;
1352
+ var RateLimitProof$6;
1353
1353
  (function (RateLimitProof) {
1354
1354
  let _codec;
1355
1355
  RateLimitProof.codec = () => {
@@ -1448,8 +1448,8 @@ var RateLimitProof$4;
1448
1448
  RateLimitProof.decode = (buf, opts) => {
1449
1449
  return decodeMessage(buf, RateLimitProof.codec(), opts);
1450
1450
  };
1451
- })(RateLimitProof$4 || (RateLimitProof$4 = {}));
1452
- var WakuMessage$4;
1451
+ })(RateLimitProof$6 || (RateLimitProof$6 = {}));
1452
+ var WakuMessage$6;
1453
1453
  (function (WakuMessage) {
1454
1454
  let _codec;
1455
1455
  WakuMessage.codec = () => {
@@ -1480,7 +1480,7 @@ var WakuMessage$4;
1480
1480
  }
1481
1481
  if (obj.rateLimitProof != null) {
1482
1482
  w.uint32(170);
1483
- RateLimitProof$4.codec().encode(obj.rateLimitProof, w);
1483
+ RateLimitProof$6.codec().encode(obj.rateLimitProof, w);
1484
1484
  }
1485
1485
  if (obj.ephemeral != null) {
1486
1486
  w.uint32(248);
@@ -1519,7 +1519,7 @@ var WakuMessage$4;
1519
1519
  break;
1520
1520
  }
1521
1521
  case 21: {
1522
- obj.rateLimitProof = RateLimitProof$4.codec().decode(reader, reader.uint32(), {
1522
+ obj.rateLimitProof = RateLimitProof$6.codec().decode(reader, reader.uint32(), {
1523
1523
  limits: opts.limits?.rateLimitProof
1524
1524
  });
1525
1525
  break;
@@ -1545,7 +1545,7 @@ var WakuMessage$4;
1545
1545
  WakuMessage.decode = (buf, opts) => {
1546
1546
  return decodeMessage(buf, WakuMessage.codec(), opts);
1547
1547
  };
1548
- })(WakuMessage$4 || (WakuMessage$4 = {}));
1548
+ })(WakuMessage$6 || (WakuMessage$6 = {}));
1549
1549
 
1550
1550
  /* eslint-disable import/export */
1551
1551
  /* eslint-disable complexity */
@@ -1680,7 +1680,7 @@ var MessagePush$1;
1680
1680
  if (obj.messages != null) {
1681
1681
  for (const value of obj.messages) {
1682
1682
  w.uint32(10);
1683
- WakuMessage$3.codec().encode(value, w);
1683
+ WakuMessage$5.codec().encode(value, w);
1684
1684
  }
1685
1685
  }
1686
1686
  if (opts.lengthDelimited !== false) {
@@ -1698,7 +1698,7 @@ var MessagePush$1;
1698
1698
  if (opts.limits?.messages != null && obj.messages.length === opts.limits.messages) {
1699
1699
  throw new MaxLengthError('Decode error - map field "messages" had too many elements');
1700
1700
  }
1701
- obj.messages.push(WakuMessage$3.codec().decode(reader, reader.uint32(), {
1701
+ obj.messages.push(WakuMessage$5.codec().decode(reader, reader.uint32(), {
1702
1702
  limits: opts.limits?.messages$
1703
1703
  }));
1704
1704
  break;
@@ -1787,7 +1787,7 @@ var FilterRpc;
1787
1787
  return decodeMessage(buf, FilterRpc.codec(), opts);
1788
1788
  };
1789
1789
  })(FilterRpc || (FilterRpc = {}));
1790
- var RateLimitProof$3;
1790
+ var RateLimitProof$5;
1791
1791
  (function (RateLimitProof) {
1792
1792
  let _codec;
1793
1793
  RateLimitProof.codec = () => {
@@ -1886,8 +1886,8 @@ var RateLimitProof$3;
1886
1886
  RateLimitProof.decode = (buf, opts) => {
1887
1887
  return decodeMessage(buf, RateLimitProof.codec(), opts);
1888
1888
  };
1889
- })(RateLimitProof$3 || (RateLimitProof$3 = {}));
1890
- var WakuMessage$3;
1889
+ })(RateLimitProof$5 || (RateLimitProof$5 = {}));
1890
+ var WakuMessage$5;
1891
1891
  (function (WakuMessage) {
1892
1892
  let _codec;
1893
1893
  WakuMessage.codec = () => {
@@ -1918,7 +1918,7 @@ var WakuMessage$3;
1918
1918
  }
1919
1919
  if (obj.rateLimitProof != null) {
1920
1920
  w.uint32(170);
1921
- RateLimitProof$3.codec().encode(obj.rateLimitProof, w);
1921
+ RateLimitProof$5.codec().encode(obj.rateLimitProof, w);
1922
1922
  }
1923
1923
  if (obj.ephemeral != null) {
1924
1924
  w.uint32(248);
@@ -1957,7 +1957,7 @@ var WakuMessage$3;
1957
1957
  break;
1958
1958
  }
1959
1959
  case 21: {
1960
- obj.rateLimitProof = RateLimitProof$3.codec().decode(reader, reader.uint32(), {
1960
+ obj.rateLimitProof = RateLimitProof$5.codec().decode(reader, reader.uint32(), {
1961
1961
  limits: opts.limits?.rateLimitProof
1962
1962
  });
1963
1963
  break;
@@ -1983,7 +1983,7 @@ var WakuMessage$3;
1983
1983
  WakuMessage.decode = (buf, opts) => {
1984
1984
  return decodeMessage(buf, WakuMessage.codec(), opts);
1985
1985
  };
1986
- })(WakuMessage$3 || (WakuMessage$3 = {}));
1986
+ })(WakuMessage$5 || (WakuMessage$5 = {}));
1987
1987
 
1988
1988
  /* eslint-disable import/export */
1989
1989
  /* eslint-disable complexity */
@@ -2070,54 +2070,815 @@ var FilterSubscribeRequest;
2070
2070
  if (opts.lengthDelimited !== false) {
2071
2071
  w.fork();
2072
2072
  }
2073
- if ((obj.requestId != null && obj.requestId !== '')) {
2073
+ if ((obj.requestId != null && obj.requestId !== '')) {
2074
+ w.uint32(10);
2075
+ w.string(obj.requestId);
2076
+ }
2077
+ if (obj.filterSubscribeType != null && __FilterSubscribeTypeValues[obj.filterSubscribeType] !== 0) {
2078
+ w.uint32(16);
2079
+ FilterSubscribeRequest.FilterSubscribeType.codec().encode(obj.filterSubscribeType, w);
2080
+ }
2081
+ if (obj.pubsubTopic != null) {
2082
+ w.uint32(82);
2083
+ w.string(obj.pubsubTopic);
2084
+ }
2085
+ if (obj.contentTopics != null) {
2086
+ for (const value of obj.contentTopics) {
2087
+ w.uint32(90);
2088
+ w.string(value);
2089
+ }
2090
+ }
2091
+ if (opts.lengthDelimited !== false) {
2092
+ w.ldelim();
2093
+ }
2094
+ }, (reader, length, opts = {}) => {
2095
+ const obj = {
2096
+ requestId: '',
2097
+ filterSubscribeType: FilterSubscribeType.SUBSCRIBER_PING,
2098
+ contentTopics: []
2099
+ };
2100
+ const end = length == null ? reader.len : reader.pos + length;
2101
+ while (reader.pos < end) {
2102
+ const tag = reader.uint32();
2103
+ switch (tag >>> 3) {
2104
+ case 1: {
2105
+ obj.requestId = reader.string();
2106
+ break;
2107
+ }
2108
+ case 2: {
2109
+ obj.filterSubscribeType = FilterSubscribeRequest.FilterSubscribeType.codec().decode(reader);
2110
+ break;
2111
+ }
2112
+ case 10: {
2113
+ obj.pubsubTopic = reader.string();
2114
+ break;
2115
+ }
2116
+ case 11: {
2117
+ if (opts.limits?.contentTopics != null && obj.contentTopics.length === opts.limits.contentTopics) {
2118
+ throw new MaxLengthError('Decode error - map field "contentTopics" had too many elements');
2119
+ }
2120
+ obj.contentTopics.push(reader.string());
2121
+ break;
2122
+ }
2123
+ default: {
2124
+ reader.skipType(tag & 7);
2125
+ break;
2126
+ }
2127
+ }
2128
+ }
2129
+ return obj;
2130
+ });
2131
+ }
2132
+ return _codec;
2133
+ };
2134
+ FilterSubscribeRequest.encode = (obj) => {
2135
+ return encodeMessage(obj, FilterSubscribeRequest.codec());
2136
+ };
2137
+ FilterSubscribeRequest.decode = (buf, opts) => {
2138
+ return decodeMessage(buf, FilterSubscribeRequest.codec(), opts);
2139
+ };
2140
+ })(FilterSubscribeRequest || (FilterSubscribeRequest = {}));
2141
+ var FilterSubscribeResponse;
2142
+ (function (FilterSubscribeResponse) {
2143
+ let _codec;
2144
+ FilterSubscribeResponse.codec = () => {
2145
+ if (_codec == null) {
2146
+ _codec = message((obj, w, opts = {}) => {
2147
+ if (opts.lengthDelimited !== false) {
2148
+ w.fork();
2149
+ }
2150
+ if ((obj.requestId != null && obj.requestId !== '')) {
2151
+ w.uint32(10);
2152
+ w.string(obj.requestId);
2153
+ }
2154
+ if ((obj.statusCode != null && obj.statusCode !== 0)) {
2155
+ w.uint32(80);
2156
+ w.uint32(obj.statusCode);
2157
+ }
2158
+ if (obj.statusDesc != null) {
2159
+ w.uint32(90);
2160
+ w.string(obj.statusDesc);
2161
+ }
2162
+ if (opts.lengthDelimited !== false) {
2163
+ w.ldelim();
2164
+ }
2165
+ }, (reader, length, opts = {}) => {
2166
+ const obj = {
2167
+ requestId: '',
2168
+ statusCode: 0
2169
+ };
2170
+ const end = length == null ? reader.len : reader.pos + length;
2171
+ while (reader.pos < end) {
2172
+ const tag = reader.uint32();
2173
+ switch (tag >>> 3) {
2174
+ case 1: {
2175
+ obj.requestId = reader.string();
2176
+ break;
2177
+ }
2178
+ case 10: {
2179
+ obj.statusCode = reader.uint32();
2180
+ break;
2181
+ }
2182
+ case 11: {
2183
+ obj.statusDesc = reader.string();
2184
+ break;
2185
+ }
2186
+ default: {
2187
+ reader.skipType(tag & 7);
2188
+ break;
2189
+ }
2190
+ }
2191
+ }
2192
+ return obj;
2193
+ });
2194
+ }
2195
+ return _codec;
2196
+ };
2197
+ FilterSubscribeResponse.encode = (obj) => {
2198
+ return encodeMessage(obj, FilterSubscribeResponse.codec());
2199
+ };
2200
+ FilterSubscribeResponse.decode = (buf, opts) => {
2201
+ return decodeMessage(buf, FilterSubscribeResponse.codec(), opts);
2202
+ };
2203
+ })(FilterSubscribeResponse || (FilterSubscribeResponse = {}));
2204
+ var MessagePush;
2205
+ (function (MessagePush) {
2206
+ let _codec;
2207
+ MessagePush.codec = () => {
2208
+ if (_codec == null) {
2209
+ _codec = message((obj, w, opts = {}) => {
2210
+ if (opts.lengthDelimited !== false) {
2211
+ w.fork();
2212
+ }
2213
+ if (obj.wakuMessage != null) {
2214
+ w.uint32(10);
2215
+ WakuMessage$4.codec().encode(obj.wakuMessage, w);
2216
+ }
2217
+ if (obj.pubsubTopic != null) {
2218
+ w.uint32(18);
2219
+ w.string(obj.pubsubTopic);
2220
+ }
2221
+ if (opts.lengthDelimited !== false) {
2222
+ w.ldelim();
2223
+ }
2224
+ }, (reader, length, opts = {}) => {
2225
+ const obj = {};
2226
+ const end = length == null ? reader.len : reader.pos + length;
2227
+ while (reader.pos < end) {
2228
+ const tag = reader.uint32();
2229
+ switch (tag >>> 3) {
2230
+ case 1: {
2231
+ obj.wakuMessage = WakuMessage$4.codec().decode(reader, reader.uint32(), {
2232
+ limits: opts.limits?.wakuMessage
2233
+ });
2234
+ break;
2235
+ }
2236
+ case 2: {
2237
+ obj.pubsubTopic = reader.string();
2238
+ break;
2239
+ }
2240
+ default: {
2241
+ reader.skipType(tag & 7);
2242
+ break;
2243
+ }
2244
+ }
2245
+ }
2246
+ return obj;
2247
+ });
2248
+ }
2249
+ return _codec;
2250
+ };
2251
+ MessagePush.encode = (obj) => {
2252
+ return encodeMessage(obj, MessagePush.codec());
2253
+ };
2254
+ MessagePush.decode = (buf, opts) => {
2255
+ return decodeMessage(buf, MessagePush.codec(), opts);
2256
+ };
2257
+ })(MessagePush || (MessagePush = {}));
2258
+ var RateLimitProof$4;
2259
+ (function (RateLimitProof) {
2260
+ let _codec;
2261
+ RateLimitProof.codec = () => {
2262
+ if (_codec == null) {
2263
+ _codec = message((obj, w, opts = {}) => {
2264
+ if (opts.lengthDelimited !== false) {
2265
+ w.fork();
2266
+ }
2267
+ if ((obj.proof != null && obj.proof.byteLength > 0)) {
2268
+ w.uint32(10);
2269
+ w.bytes(obj.proof);
2270
+ }
2271
+ if ((obj.merkleRoot != null && obj.merkleRoot.byteLength > 0)) {
2272
+ w.uint32(18);
2273
+ w.bytes(obj.merkleRoot);
2274
+ }
2275
+ if ((obj.epoch != null && obj.epoch.byteLength > 0)) {
2276
+ w.uint32(26);
2277
+ w.bytes(obj.epoch);
2278
+ }
2279
+ if ((obj.shareX != null && obj.shareX.byteLength > 0)) {
2280
+ w.uint32(34);
2281
+ w.bytes(obj.shareX);
2282
+ }
2283
+ if ((obj.shareY != null && obj.shareY.byteLength > 0)) {
2284
+ w.uint32(42);
2285
+ w.bytes(obj.shareY);
2286
+ }
2287
+ if ((obj.nullifier != null && obj.nullifier.byteLength > 0)) {
2288
+ w.uint32(50);
2289
+ w.bytes(obj.nullifier);
2290
+ }
2291
+ if ((obj.rlnIdentifier != null && obj.rlnIdentifier.byteLength > 0)) {
2292
+ w.uint32(58);
2293
+ w.bytes(obj.rlnIdentifier);
2294
+ }
2295
+ if (opts.lengthDelimited !== false) {
2296
+ w.ldelim();
2297
+ }
2298
+ }, (reader, length, opts = {}) => {
2299
+ const obj = {
2300
+ proof: alloc$1(0),
2301
+ merkleRoot: alloc$1(0),
2302
+ epoch: alloc$1(0),
2303
+ shareX: alloc$1(0),
2304
+ shareY: alloc$1(0),
2305
+ nullifier: alloc$1(0),
2306
+ rlnIdentifier: alloc$1(0)
2307
+ };
2308
+ const end = length == null ? reader.len : reader.pos + length;
2309
+ while (reader.pos < end) {
2310
+ const tag = reader.uint32();
2311
+ switch (tag >>> 3) {
2312
+ case 1: {
2313
+ obj.proof = reader.bytes();
2314
+ break;
2315
+ }
2316
+ case 2: {
2317
+ obj.merkleRoot = reader.bytes();
2318
+ break;
2319
+ }
2320
+ case 3: {
2321
+ obj.epoch = reader.bytes();
2322
+ break;
2323
+ }
2324
+ case 4: {
2325
+ obj.shareX = reader.bytes();
2326
+ break;
2327
+ }
2328
+ case 5: {
2329
+ obj.shareY = reader.bytes();
2330
+ break;
2331
+ }
2332
+ case 6: {
2333
+ obj.nullifier = reader.bytes();
2334
+ break;
2335
+ }
2336
+ case 7: {
2337
+ obj.rlnIdentifier = reader.bytes();
2338
+ break;
2339
+ }
2340
+ default: {
2341
+ reader.skipType(tag & 7);
2342
+ break;
2343
+ }
2344
+ }
2345
+ }
2346
+ return obj;
2347
+ });
2348
+ }
2349
+ return _codec;
2350
+ };
2351
+ RateLimitProof.encode = (obj) => {
2352
+ return encodeMessage(obj, RateLimitProof.codec());
2353
+ };
2354
+ RateLimitProof.decode = (buf, opts) => {
2355
+ return decodeMessage(buf, RateLimitProof.codec(), opts);
2356
+ };
2357
+ })(RateLimitProof$4 || (RateLimitProof$4 = {}));
2358
+ var WakuMessage$4;
2359
+ (function (WakuMessage) {
2360
+ let _codec;
2361
+ WakuMessage.codec = () => {
2362
+ if (_codec == null) {
2363
+ _codec = message((obj, w, opts = {}) => {
2364
+ if (opts.lengthDelimited !== false) {
2365
+ w.fork();
2366
+ }
2367
+ if ((obj.payload != null && obj.payload.byteLength > 0)) {
2368
+ w.uint32(10);
2369
+ w.bytes(obj.payload);
2370
+ }
2371
+ if ((obj.contentTopic != null && obj.contentTopic !== '')) {
2372
+ w.uint32(18);
2373
+ w.string(obj.contentTopic);
2374
+ }
2375
+ if (obj.version != null) {
2376
+ w.uint32(24);
2377
+ w.uint32(obj.version);
2378
+ }
2379
+ if (obj.timestamp != null) {
2380
+ w.uint32(80);
2381
+ w.sint64(obj.timestamp);
2382
+ }
2383
+ if (obj.meta != null) {
2384
+ w.uint32(90);
2385
+ w.bytes(obj.meta);
2386
+ }
2387
+ if (obj.rateLimitProof != null) {
2388
+ w.uint32(170);
2389
+ RateLimitProof$4.codec().encode(obj.rateLimitProof, w);
2390
+ }
2391
+ if (obj.ephemeral != null) {
2392
+ w.uint32(248);
2393
+ w.bool(obj.ephemeral);
2394
+ }
2395
+ if (opts.lengthDelimited !== false) {
2396
+ w.ldelim();
2397
+ }
2398
+ }, (reader, length, opts = {}) => {
2399
+ const obj = {
2400
+ payload: alloc$1(0),
2401
+ contentTopic: ''
2402
+ };
2403
+ const end = length == null ? reader.len : reader.pos + length;
2404
+ while (reader.pos < end) {
2405
+ const tag = reader.uint32();
2406
+ switch (tag >>> 3) {
2407
+ case 1: {
2408
+ obj.payload = reader.bytes();
2409
+ break;
2410
+ }
2411
+ case 2: {
2412
+ obj.contentTopic = reader.string();
2413
+ break;
2414
+ }
2415
+ case 3: {
2416
+ obj.version = reader.uint32();
2417
+ break;
2418
+ }
2419
+ case 10: {
2420
+ obj.timestamp = reader.sint64();
2421
+ break;
2422
+ }
2423
+ case 11: {
2424
+ obj.meta = reader.bytes();
2425
+ break;
2426
+ }
2427
+ case 21: {
2428
+ obj.rateLimitProof = RateLimitProof$4.codec().decode(reader, reader.uint32(), {
2429
+ limits: opts.limits?.rateLimitProof
2430
+ });
2431
+ break;
2432
+ }
2433
+ case 31: {
2434
+ obj.ephemeral = reader.bool();
2435
+ break;
2436
+ }
2437
+ default: {
2438
+ reader.skipType(tag & 7);
2439
+ break;
2440
+ }
2441
+ }
2442
+ }
2443
+ return obj;
2444
+ });
2445
+ }
2446
+ return _codec;
2447
+ };
2448
+ WakuMessage.encode = (obj) => {
2449
+ return encodeMessage(obj, WakuMessage.codec());
2450
+ };
2451
+ WakuMessage.decode = (buf, opts) => {
2452
+ return decodeMessage(buf, WakuMessage.codec(), opts);
2453
+ };
2454
+ })(WakuMessage$4 || (WakuMessage$4 = {}));
2455
+
2456
+ /* eslint-disable import/export */
2457
+ /* eslint-disable complexity */
2458
+ /* eslint-disable @typescript-eslint/no-namespace */
2459
+ /* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */
2460
+ /* eslint-disable @typescript-eslint/no-empty-interface */
2461
+ var PushRequest$1;
2462
+ (function (PushRequest) {
2463
+ let _codec;
2464
+ PushRequest.codec = () => {
2465
+ if (_codec == null) {
2466
+ _codec = message((obj, w, opts = {}) => {
2467
+ if (opts.lengthDelimited !== false) {
2468
+ w.fork();
2469
+ }
2470
+ if (obj.pubsubTopic != null) {
2471
+ w.uint32(162);
2472
+ w.string(obj.pubsubTopic);
2473
+ }
2474
+ if (obj.message != null) {
2475
+ w.uint32(170);
2476
+ WakuMessage$3.codec().encode(obj.message, w);
2477
+ }
2478
+ if (opts.lengthDelimited !== false) {
2479
+ w.ldelim();
2480
+ }
2481
+ }, (reader, length, opts = {}) => {
2482
+ const obj = {};
2483
+ const end = length == null ? reader.len : reader.pos + length;
2484
+ while (reader.pos < end) {
2485
+ const tag = reader.uint32();
2486
+ switch (tag >>> 3) {
2487
+ case 20: {
2488
+ obj.pubsubTopic = reader.string();
2489
+ break;
2490
+ }
2491
+ case 21: {
2492
+ obj.message = WakuMessage$3.codec().decode(reader, reader.uint32(), {
2493
+ limits: opts.limits?.message
2494
+ });
2495
+ break;
2496
+ }
2497
+ default: {
2498
+ reader.skipType(tag & 7);
2499
+ break;
2500
+ }
2501
+ }
2502
+ }
2503
+ return obj;
2504
+ });
2505
+ }
2506
+ return _codec;
2507
+ };
2508
+ PushRequest.encode = (obj) => {
2509
+ return encodeMessage(obj, PushRequest.codec());
2510
+ };
2511
+ PushRequest.decode = (buf, opts) => {
2512
+ return decodeMessage(buf, PushRequest.codec(), opts);
2513
+ };
2514
+ })(PushRequest$1 || (PushRequest$1 = {}));
2515
+ var PushResponse$1;
2516
+ (function (PushResponse) {
2517
+ let _codec;
2518
+ PushResponse.codec = () => {
2519
+ if (_codec == null) {
2520
+ _codec = message((obj, w, opts = {}) => {
2521
+ if (opts.lengthDelimited !== false) {
2522
+ w.fork();
2523
+ }
2524
+ if ((obj.statusCode != null && obj.statusCode !== 0)) {
2525
+ w.uint32(160);
2526
+ w.uint32(obj.statusCode);
2527
+ }
2528
+ if (obj.statusDesc != null) {
2529
+ w.uint32(242);
2530
+ w.string(obj.statusDesc);
2531
+ }
2532
+ if (obj.relayPeerCount != null) {
2533
+ w.uint32(320);
2534
+ w.uint32(obj.relayPeerCount);
2535
+ }
2536
+ if (opts.lengthDelimited !== false) {
2537
+ w.ldelim();
2538
+ }
2539
+ }, (reader, length, opts = {}) => {
2540
+ const obj = {
2541
+ statusCode: 0
2542
+ };
2543
+ const end = length == null ? reader.len : reader.pos + length;
2544
+ while (reader.pos < end) {
2545
+ const tag = reader.uint32();
2546
+ switch (tag >>> 3) {
2547
+ case 20: {
2548
+ obj.statusCode = reader.uint32();
2549
+ break;
2550
+ }
2551
+ case 30: {
2552
+ obj.statusDesc = reader.string();
2553
+ break;
2554
+ }
2555
+ case 40: {
2556
+ obj.relayPeerCount = reader.uint32();
2557
+ break;
2558
+ }
2559
+ default: {
2560
+ reader.skipType(tag & 7);
2561
+ break;
2562
+ }
2563
+ }
2564
+ }
2565
+ return obj;
2566
+ });
2567
+ }
2568
+ return _codec;
2569
+ };
2570
+ PushResponse.encode = (obj) => {
2571
+ return encodeMessage(obj, PushResponse.codec());
2572
+ };
2573
+ PushResponse.decode = (buf, opts) => {
2574
+ return decodeMessage(buf, PushResponse.codec(), opts);
2575
+ };
2576
+ })(PushResponse$1 || (PushResponse$1 = {}));
2577
+ var PushRpc$1;
2578
+ (function (PushRpc) {
2579
+ let _codec;
2580
+ PushRpc.codec = () => {
2581
+ if (_codec == null) {
2582
+ _codec = message((obj, w, opts = {}) => {
2583
+ if (opts.lengthDelimited !== false) {
2584
+ w.fork();
2585
+ }
2586
+ if ((obj.requestId != null && obj.requestId !== '')) {
2587
+ w.uint32(10);
2588
+ w.string(obj.requestId);
2589
+ }
2590
+ if (obj.request != null) {
2591
+ w.uint32(18);
2592
+ PushRequest$1.codec().encode(obj.request, w);
2593
+ }
2594
+ if (obj.response != null) {
2595
+ w.uint32(26);
2596
+ PushResponse$1.codec().encode(obj.response, w);
2597
+ }
2598
+ if (opts.lengthDelimited !== false) {
2599
+ w.ldelim();
2600
+ }
2601
+ }, (reader, length, opts = {}) => {
2602
+ const obj = {
2603
+ requestId: ''
2604
+ };
2605
+ const end = length == null ? reader.len : reader.pos + length;
2606
+ while (reader.pos < end) {
2607
+ const tag = reader.uint32();
2608
+ switch (tag >>> 3) {
2609
+ case 1: {
2610
+ obj.requestId = reader.string();
2611
+ break;
2612
+ }
2613
+ case 2: {
2614
+ obj.request = PushRequest$1.codec().decode(reader, reader.uint32(), {
2615
+ limits: opts.limits?.request
2616
+ });
2617
+ break;
2618
+ }
2619
+ case 3: {
2620
+ obj.response = PushResponse$1.codec().decode(reader, reader.uint32(), {
2621
+ limits: opts.limits?.response
2622
+ });
2623
+ break;
2624
+ }
2625
+ default: {
2626
+ reader.skipType(tag & 7);
2627
+ break;
2628
+ }
2629
+ }
2630
+ }
2631
+ return obj;
2632
+ });
2633
+ }
2634
+ return _codec;
2635
+ };
2636
+ PushRpc.encode = (obj) => {
2637
+ return encodeMessage(obj, PushRpc.codec());
2638
+ };
2639
+ PushRpc.decode = (buf, opts) => {
2640
+ return decodeMessage(buf, PushRpc.codec(), opts);
2641
+ };
2642
+ })(PushRpc$1 || (PushRpc$1 = {}));
2643
+ var RateLimitProof$3;
2644
+ (function (RateLimitProof) {
2645
+ let _codec;
2646
+ RateLimitProof.codec = () => {
2647
+ if (_codec == null) {
2648
+ _codec = message((obj, w, opts = {}) => {
2649
+ if (opts.lengthDelimited !== false) {
2650
+ w.fork();
2651
+ }
2652
+ if ((obj.proof != null && obj.proof.byteLength > 0)) {
2653
+ w.uint32(10);
2654
+ w.bytes(obj.proof);
2655
+ }
2656
+ if ((obj.merkleRoot != null && obj.merkleRoot.byteLength > 0)) {
2657
+ w.uint32(18);
2658
+ w.bytes(obj.merkleRoot);
2659
+ }
2660
+ if ((obj.epoch != null && obj.epoch.byteLength > 0)) {
2661
+ w.uint32(26);
2662
+ w.bytes(obj.epoch);
2663
+ }
2664
+ if ((obj.shareX != null && obj.shareX.byteLength > 0)) {
2665
+ w.uint32(34);
2666
+ w.bytes(obj.shareX);
2667
+ }
2668
+ if ((obj.shareY != null && obj.shareY.byteLength > 0)) {
2669
+ w.uint32(42);
2670
+ w.bytes(obj.shareY);
2671
+ }
2672
+ if ((obj.nullifier != null && obj.nullifier.byteLength > 0)) {
2673
+ w.uint32(50);
2674
+ w.bytes(obj.nullifier);
2675
+ }
2676
+ if ((obj.rlnIdentifier != null && obj.rlnIdentifier.byteLength > 0)) {
2677
+ w.uint32(58);
2678
+ w.bytes(obj.rlnIdentifier);
2679
+ }
2680
+ if (opts.lengthDelimited !== false) {
2681
+ w.ldelim();
2682
+ }
2683
+ }, (reader, length, opts = {}) => {
2684
+ const obj = {
2685
+ proof: alloc$1(0),
2686
+ merkleRoot: alloc$1(0),
2687
+ epoch: alloc$1(0),
2688
+ shareX: alloc$1(0),
2689
+ shareY: alloc$1(0),
2690
+ nullifier: alloc$1(0),
2691
+ rlnIdentifier: alloc$1(0)
2692
+ };
2693
+ const end = length == null ? reader.len : reader.pos + length;
2694
+ while (reader.pos < end) {
2695
+ const tag = reader.uint32();
2696
+ switch (tag >>> 3) {
2697
+ case 1: {
2698
+ obj.proof = reader.bytes();
2699
+ break;
2700
+ }
2701
+ case 2: {
2702
+ obj.merkleRoot = reader.bytes();
2703
+ break;
2704
+ }
2705
+ case 3: {
2706
+ obj.epoch = reader.bytes();
2707
+ break;
2708
+ }
2709
+ case 4: {
2710
+ obj.shareX = reader.bytes();
2711
+ break;
2712
+ }
2713
+ case 5: {
2714
+ obj.shareY = reader.bytes();
2715
+ break;
2716
+ }
2717
+ case 6: {
2718
+ obj.nullifier = reader.bytes();
2719
+ break;
2720
+ }
2721
+ case 7: {
2722
+ obj.rlnIdentifier = reader.bytes();
2723
+ break;
2724
+ }
2725
+ default: {
2726
+ reader.skipType(tag & 7);
2727
+ break;
2728
+ }
2729
+ }
2730
+ }
2731
+ return obj;
2732
+ });
2733
+ }
2734
+ return _codec;
2735
+ };
2736
+ RateLimitProof.encode = (obj) => {
2737
+ return encodeMessage(obj, RateLimitProof.codec());
2738
+ };
2739
+ RateLimitProof.decode = (buf, opts) => {
2740
+ return decodeMessage(buf, RateLimitProof.codec(), opts);
2741
+ };
2742
+ })(RateLimitProof$3 || (RateLimitProof$3 = {}));
2743
+ var WakuMessage$3;
2744
+ (function (WakuMessage) {
2745
+ let _codec;
2746
+ WakuMessage.codec = () => {
2747
+ if (_codec == null) {
2748
+ _codec = message((obj, w, opts = {}) => {
2749
+ if (opts.lengthDelimited !== false) {
2750
+ w.fork();
2751
+ }
2752
+ if ((obj.payload != null && obj.payload.byteLength > 0)) {
2753
+ w.uint32(10);
2754
+ w.bytes(obj.payload);
2755
+ }
2756
+ if ((obj.contentTopic != null && obj.contentTopic !== '')) {
2757
+ w.uint32(18);
2758
+ w.string(obj.contentTopic);
2759
+ }
2760
+ if (obj.version != null) {
2761
+ w.uint32(24);
2762
+ w.uint32(obj.version);
2763
+ }
2764
+ if (obj.timestamp != null) {
2765
+ w.uint32(80);
2766
+ w.sint64(obj.timestamp);
2767
+ }
2768
+ if (obj.meta != null) {
2769
+ w.uint32(90);
2770
+ w.bytes(obj.meta);
2771
+ }
2772
+ if (obj.rateLimitProof != null) {
2773
+ w.uint32(170);
2774
+ RateLimitProof$3.codec().encode(obj.rateLimitProof, w);
2775
+ }
2776
+ if (obj.ephemeral != null) {
2777
+ w.uint32(248);
2778
+ w.bool(obj.ephemeral);
2779
+ }
2780
+ if (opts.lengthDelimited !== false) {
2781
+ w.ldelim();
2782
+ }
2783
+ }, (reader, length, opts = {}) => {
2784
+ const obj = {
2785
+ payload: alloc$1(0),
2786
+ contentTopic: ''
2787
+ };
2788
+ const end = length == null ? reader.len : reader.pos + length;
2789
+ while (reader.pos < end) {
2790
+ const tag = reader.uint32();
2791
+ switch (tag >>> 3) {
2792
+ case 1: {
2793
+ obj.payload = reader.bytes();
2794
+ break;
2795
+ }
2796
+ case 2: {
2797
+ obj.contentTopic = reader.string();
2798
+ break;
2799
+ }
2800
+ case 3: {
2801
+ obj.version = reader.uint32();
2802
+ break;
2803
+ }
2804
+ case 10: {
2805
+ obj.timestamp = reader.sint64();
2806
+ break;
2807
+ }
2808
+ case 11: {
2809
+ obj.meta = reader.bytes();
2810
+ break;
2811
+ }
2812
+ case 21: {
2813
+ obj.rateLimitProof = RateLimitProof$3.codec().decode(reader, reader.uint32(), {
2814
+ limits: opts.limits?.rateLimitProof
2815
+ });
2816
+ break;
2817
+ }
2818
+ case 31: {
2819
+ obj.ephemeral = reader.bool();
2820
+ break;
2821
+ }
2822
+ default: {
2823
+ reader.skipType(tag & 7);
2824
+ break;
2825
+ }
2826
+ }
2827
+ }
2828
+ return obj;
2829
+ });
2830
+ }
2831
+ return _codec;
2832
+ };
2833
+ WakuMessage.encode = (obj) => {
2834
+ return encodeMessage(obj, WakuMessage.codec());
2835
+ };
2836
+ WakuMessage.decode = (buf, opts) => {
2837
+ return decodeMessage(buf, WakuMessage.codec(), opts);
2838
+ };
2839
+ })(WakuMessage$3 || (WakuMessage$3 = {}));
2840
+
2841
+ /* eslint-disable import/export */
2842
+ /* eslint-disable complexity */
2843
+ /* eslint-disable @typescript-eslint/no-namespace */
2844
+ /* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */
2845
+ /* eslint-disable @typescript-eslint/no-empty-interface */
2846
+ var PushRequest;
2847
+ (function (PushRequest) {
2848
+ let _codec;
2849
+ PushRequest.codec = () => {
2850
+ if (_codec == null) {
2851
+ _codec = message((obj, w, opts = {}) => {
2852
+ if (opts.lengthDelimited !== false) {
2853
+ w.fork();
2854
+ }
2855
+ if ((obj.pubsubTopic != null && obj.pubsubTopic !== '')) {
2074
2856
  w.uint32(10);
2075
- w.string(obj.requestId);
2076
- }
2077
- if (obj.filterSubscribeType != null && __FilterSubscribeTypeValues[obj.filterSubscribeType] !== 0) {
2078
- w.uint32(16);
2079
- FilterSubscribeRequest.FilterSubscribeType.codec().encode(obj.filterSubscribeType, w);
2080
- }
2081
- if (obj.pubsubTopic != null) {
2082
- w.uint32(82);
2083
2857
  w.string(obj.pubsubTopic);
2084
2858
  }
2085
- if (obj.contentTopics != null) {
2086
- for (const value of obj.contentTopics) {
2087
- w.uint32(90);
2088
- w.string(value);
2089
- }
2859
+ if (obj.message != null) {
2860
+ w.uint32(18);
2861
+ WakuMessage$2.codec().encode(obj.message, w);
2090
2862
  }
2091
2863
  if (opts.lengthDelimited !== false) {
2092
2864
  w.ldelim();
2093
2865
  }
2094
2866
  }, (reader, length, opts = {}) => {
2095
2867
  const obj = {
2096
- requestId: '',
2097
- filterSubscribeType: FilterSubscribeType.SUBSCRIBER_PING,
2098
- contentTopics: []
2868
+ pubsubTopic: ''
2099
2869
  };
2100
2870
  const end = length == null ? reader.len : reader.pos + length;
2101
2871
  while (reader.pos < end) {
2102
2872
  const tag = reader.uint32();
2103
2873
  switch (tag >>> 3) {
2104
2874
  case 1: {
2105
- obj.requestId = reader.string();
2106
- break;
2107
- }
2108
- case 2: {
2109
- obj.filterSubscribeType = FilterSubscribeRequest.FilterSubscribeType.codec().decode(reader);
2110
- break;
2111
- }
2112
- case 10: {
2113
2875
  obj.pubsubTopic = reader.string();
2114
2876
  break;
2115
2877
  }
2116
- case 11: {
2117
- if (opts.limits?.contentTopics != null && obj.contentTopics.length === opts.limits.contentTopics) {
2118
- throw new MaxLengthError('Decode error - map field "contentTopics" had too many elements');
2119
- }
2120
- obj.contentTopics.push(reader.string());
2878
+ case 2: {
2879
+ obj.message = WakuMessage$2.codec().decode(reader, reader.uint32(), {
2880
+ limits: opts.limits?.message
2881
+ });
2121
2882
  break;
2122
2883
  }
2123
2884
  default: {
@@ -2131,56 +2892,47 @@ var FilterSubscribeRequest;
2131
2892
  }
2132
2893
  return _codec;
2133
2894
  };
2134
- FilterSubscribeRequest.encode = (obj) => {
2135
- return encodeMessage(obj, FilterSubscribeRequest.codec());
2895
+ PushRequest.encode = (obj) => {
2896
+ return encodeMessage(obj, PushRequest.codec());
2136
2897
  };
2137
- FilterSubscribeRequest.decode = (buf, opts) => {
2138
- return decodeMessage(buf, FilterSubscribeRequest.codec(), opts);
2898
+ PushRequest.decode = (buf, opts) => {
2899
+ return decodeMessage(buf, PushRequest.codec(), opts);
2139
2900
  };
2140
- })(FilterSubscribeRequest || (FilterSubscribeRequest = {}));
2141
- var FilterSubscribeResponse;
2142
- (function (FilterSubscribeResponse) {
2901
+ })(PushRequest || (PushRequest = {}));
2902
+ var PushResponse;
2903
+ (function (PushResponse) {
2143
2904
  let _codec;
2144
- FilterSubscribeResponse.codec = () => {
2905
+ PushResponse.codec = () => {
2145
2906
  if (_codec == null) {
2146
2907
  _codec = message((obj, w, opts = {}) => {
2147
2908
  if (opts.lengthDelimited !== false) {
2148
2909
  w.fork();
2149
2910
  }
2150
- if ((obj.requestId != null && obj.requestId !== '')) {
2151
- w.uint32(10);
2152
- w.string(obj.requestId);
2153
- }
2154
- if ((obj.statusCode != null && obj.statusCode !== 0)) {
2155
- w.uint32(80);
2156
- w.uint32(obj.statusCode);
2911
+ if ((obj.isSuccess != null && obj.isSuccess !== false)) {
2912
+ w.uint32(8);
2913
+ w.bool(obj.isSuccess);
2157
2914
  }
2158
- if (obj.statusDesc != null) {
2159
- w.uint32(90);
2160
- w.string(obj.statusDesc);
2915
+ if (obj.info != null) {
2916
+ w.uint32(18);
2917
+ w.string(obj.info);
2161
2918
  }
2162
2919
  if (opts.lengthDelimited !== false) {
2163
2920
  w.ldelim();
2164
2921
  }
2165
2922
  }, (reader, length, opts = {}) => {
2166
2923
  const obj = {
2167
- requestId: '',
2168
- statusCode: 0
2924
+ isSuccess: false
2169
2925
  };
2170
2926
  const end = length == null ? reader.len : reader.pos + length;
2171
2927
  while (reader.pos < end) {
2172
2928
  const tag = reader.uint32();
2173
2929
  switch (tag >>> 3) {
2174
2930
  case 1: {
2175
- obj.requestId = reader.string();
2176
- break;
2177
- }
2178
- case 10: {
2179
- obj.statusCode = reader.uint32();
2931
+ obj.isSuccess = reader.bool();
2180
2932
  break;
2181
2933
  }
2182
- case 11: {
2183
- obj.statusDesc = reader.string();
2934
+ case 2: {
2935
+ obj.info = reader.string();
2184
2936
  break;
2185
2937
  }
2186
2938
  default: {
@@ -2194,47 +2946,59 @@ var FilterSubscribeResponse;
2194
2946
  }
2195
2947
  return _codec;
2196
2948
  };
2197
- FilterSubscribeResponse.encode = (obj) => {
2198
- return encodeMessage(obj, FilterSubscribeResponse.codec());
2949
+ PushResponse.encode = (obj) => {
2950
+ return encodeMessage(obj, PushResponse.codec());
2199
2951
  };
2200
- FilterSubscribeResponse.decode = (buf, opts) => {
2201
- return decodeMessage(buf, FilterSubscribeResponse.codec(), opts);
2952
+ PushResponse.decode = (buf, opts) => {
2953
+ return decodeMessage(buf, PushResponse.codec(), opts);
2202
2954
  };
2203
- })(FilterSubscribeResponse || (FilterSubscribeResponse = {}));
2204
- var MessagePush;
2205
- (function (MessagePush) {
2955
+ })(PushResponse || (PushResponse = {}));
2956
+ var PushRpc;
2957
+ (function (PushRpc) {
2206
2958
  let _codec;
2207
- MessagePush.codec = () => {
2959
+ PushRpc.codec = () => {
2208
2960
  if (_codec == null) {
2209
2961
  _codec = message((obj, w, opts = {}) => {
2210
2962
  if (opts.lengthDelimited !== false) {
2211
2963
  w.fork();
2212
2964
  }
2213
- if (obj.wakuMessage != null) {
2965
+ if ((obj.requestId != null && obj.requestId !== '')) {
2214
2966
  w.uint32(10);
2215
- WakuMessage$2.codec().encode(obj.wakuMessage, w);
2967
+ w.string(obj.requestId);
2216
2968
  }
2217
- if (obj.pubsubTopic != null) {
2969
+ if (obj.request != null) {
2218
2970
  w.uint32(18);
2219
- w.string(obj.pubsubTopic);
2971
+ PushRequest.codec().encode(obj.request, w);
2972
+ }
2973
+ if (obj.response != null) {
2974
+ w.uint32(26);
2975
+ PushResponse.codec().encode(obj.response, w);
2220
2976
  }
2221
2977
  if (opts.lengthDelimited !== false) {
2222
2978
  w.ldelim();
2223
2979
  }
2224
2980
  }, (reader, length, opts = {}) => {
2225
- const obj = {};
2981
+ const obj = {
2982
+ requestId: ''
2983
+ };
2226
2984
  const end = length == null ? reader.len : reader.pos + length;
2227
2985
  while (reader.pos < end) {
2228
2986
  const tag = reader.uint32();
2229
2987
  switch (tag >>> 3) {
2230
2988
  case 1: {
2231
- obj.wakuMessage = WakuMessage$2.codec().decode(reader, reader.uint32(), {
2232
- limits: opts.limits?.wakuMessage
2233
- });
2989
+ obj.requestId = reader.string();
2234
2990
  break;
2235
2991
  }
2236
2992
  case 2: {
2237
- obj.pubsubTopic = reader.string();
2993
+ obj.request = PushRequest.codec().decode(reader, reader.uint32(), {
2994
+ limits: opts.limits?.request
2995
+ });
2996
+ break;
2997
+ }
2998
+ case 3: {
2999
+ obj.response = PushResponse.codec().decode(reader, reader.uint32(), {
3000
+ limits: opts.limits?.response
3001
+ });
2238
3002
  break;
2239
3003
  }
2240
3004
  default: {
@@ -2248,13 +3012,13 @@ var MessagePush;
2248
3012
  }
2249
3013
  return _codec;
2250
3014
  };
2251
- MessagePush.encode = (obj) => {
2252
- return encodeMessage(obj, MessagePush.codec());
3015
+ PushRpc.encode = (obj) => {
3016
+ return encodeMessage(obj, PushRpc.codec());
2253
3017
  };
2254
- MessagePush.decode = (buf, opts) => {
2255
- return decodeMessage(buf, MessagePush.codec(), opts);
3018
+ PushRpc.decode = (buf, opts) => {
3019
+ return decodeMessage(buf, PushRpc.codec(), opts);
2256
3020
  };
2257
- })(MessagePush || (MessagePush = {}));
3021
+ })(PushRpc || (PushRpc = {}));
2258
3022
  var RateLimitProof$2;
2259
3023
  (function (RateLimitProof) {
2260
3024
  let _codec;
@@ -2458,21 +3222,25 @@ var WakuMessage$2;
2458
3222
  /* eslint-disable @typescript-eslint/no-namespace */
2459
3223
  /* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */
2460
3224
  /* eslint-disable @typescript-eslint/no-empty-interface */
2461
- var PushRequest;
2462
- (function (PushRequest) {
3225
+ var LightpushRequest;
3226
+ (function (LightpushRequest) {
2463
3227
  let _codec;
2464
- PushRequest.codec = () => {
3228
+ LightpushRequest.codec = () => {
2465
3229
  if (_codec == null) {
2466
3230
  _codec = message((obj, w, opts = {}) => {
2467
3231
  if (opts.lengthDelimited !== false) {
2468
3232
  w.fork();
2469
3233
  }
2470
- if ((obj.pubsubTopic != null && obj.pubsubTopic !== '')) {
3234
+ if ((obj.requestId != null && obj.requestId !== '')) {
2471
3235
  w.uint32(10);
3236
+ w.string(obj.requestId);
3237
+ }
3238
+ if (obj.pubsubTopic != null) {
3239
+ w.uint32(162);
2472
3240
  w.string(obj.pubsubTopic);
2473
3241
  }
2474
3242
  if (obj.message != null) {
2475
- w.uint32(18);
3243
+ w.uint32(170);
2476
3244
  WakuMessage$1.codec().encode(obj.message, w);
2477
3245
  }
2478
3246
  if (opts.lengthDelimited !== false) {
@@ -2480,17 +3248,21 @@ var PushRequest;
2480
3248
  }
2481
3249
  }, (reader, length, opts = {}) => {
2482
3250
  const obj = {
2483
- pubsubTopic: ''
3251
+ requestId: ''
2484
3252
  };
2485
3253
  const end = length == null ? reader.len : reader.pos + length;
2486
3254
  while (reader.pos < end) {
2487
3255
  const tag = reader.uint32();
2488
3256
  switch (tag >>> 3) {
2489
3257
  case 1: {
3258
+ obj.requestId = reader.string();
3259
+ break;
3260
+ }
3261
+ case 20: {
2490
3262
  obj.pubsubTopic = reader.string();
2491
3263
  break;
2492
3264
  }
2493
- case 2: {
3265
+ case 21: {
2494
3266
  obj.message = WakuMessage$1.codec().decode(reader, reader.uint32(), {
2495
3267
  limits: opts.limits?.message
2496
3268
  });
@@ -2507,71 +3279,17 @@ var PushRequest;
2507
3279
  }
2508
3280
  return _codec;
2509
3281
  };
2510
- PushRequest.encode = (obj) => {
2511
- return encodeMessage(obj, PushRequest.codec());
2512
- };
2513
- PushRequest.decode = (buf, opts) => {
2514
- return decodeMessage(buf, PushRequest.codec(), opts);
2515
- };
2516
- })(PushRequest || (PushRequest = {}));
2517
- var PushResponse;
2518
- (function (PushResponse) {
2519
- let _codec;
2520
- PushResponse.codec = () => {
2521
- if (_codec == null) {
2522
- _codec = message((obj, w, opts = {}) => {
2523
- if (opts.lengthDelimited !== false) {
2524
- w.fork();
2525
- }
2526
- if ((obj.isSuccess != null && obj.isSuccess !== false)) {
2527
- w.uint32(8);
2528
- w.bool(obj.isSuccess);
2529
- }
2530
- if (obj.info != null) {
2531
- w.uint32(18);
2532
- w.string(obj.info);
2533
- }
2534
- if (opts.lengthDelimited !== false) {
2535
- w.ldelim();
2536
- }
2537
- }, (reader, length, opts = {}) => {
2538
- const obj = {
2539
- isSuccess: false
2540
- };
2541
- const end = length == null ? reader.len : reader.pos + length;
2542
- while (reader.pos < end) {
2543
- const tag = reader.uint32();
2544
- switch (tag >>> 3) {
2545
- case 1: {
2546
- obj.isSuccess = reader.bool();
2547
- break;
2548
- }
2549
- case 2: {
2550
- obj.info = reader.string();
2551
- break;
2552
- }
2553
- default: {
2554
- reader.skipType(tag & 7);
2555
- break;
2556
- }
2557
- }
2558
- }
2559
- return obj;
2560
- });
2561
- }
2562
- return _codec;
2563
- };
2564
- PushResponse.encode = (obj) => {
2565
- return encodeMessage(obj, PushResponse.codec());
3282
+ LightpushRequest.encode = (obj) => {
3283
+ return encodeMessage(obj, LightpushRequest.codec());
2566
3284
  };
2567
- PushResponse.decode = (buf, opts) => {
2568
- return decodeMessage(buf, PushResponse.codec(), opts);
3285
+ LightpushRequest.decode = (buf, opts) => {
3286
+ return decodeMessage(buf, LightpushRequest.codec(), opts);
2569
3287
  };
2570
- })(PushResponse || (PushResponse = {}));
2571
- var PushRpc;
2572
- (function (PushRpc) {
3288
+ })(LightpushRequest || (LightpushRequest = {}));
3289
+ var LightpushResponse;
3290
+ (function (LightpushResponse) {
2573
3291
  let _codec;
2574
- PushRpc.codec = () => {
3292
+ LightpushResponse.codec = () => {
2575
3293
  if (_codec == null) {
2576
3294
  _codec = message((obj, w, opts = {}) => {
2577
3295
  if (opts.lengthDelimited !== false) {
@@ -2581,20 +3299,25 @@ var PushRpc;
2581
3299
  w.uint32(10);
2582
3300
  w.string(obj.requestId);
2583
3301
  }
2584
- if (obj.request != null) {
2585
- w.uint32(18);
2586
- PushRequest.codec().encode(obj.request, w);
3302
+ if ((obj.statusCode != null && obj.statusCode !== 0)) {
3303
+ w.uint32(80);
3304
+ w.uint32(obj.statusCode);
2587
3305
  }
2588
- if (obj.response != null) {
2589
- w.uint32(26);
2590
- PushResponse.codec().encode(obj.response, w);
3306
+ if (obj.statusDesc != null) {
3307
+ w.uint32(90);
3308
+ w.string(obj.statusDesc);
3309
+ }
3310
+ if (obj.relayPeerCount != null) {
3311
+ w.uint32(96);
3312
+ w.uint32(obj.relayPeerCount);
2591
3313
  }
2592
3314
  if (opts.lengthDelimited !== false) {
2593
3315
  w.ldelim();
2594
3316
  }
2595
3317
  }, (reader, length, opts = {}) => {
2596
3318
  const obj = {
2597
- requestId: ''
3319
+ requestId: '',
3320
+ statusCode: 0
2598
3321
  };
2599
3322
  const end = length == null ? reader.len : reader.pos + length;
2600
3323
  while (reader.pos < end) {
@@ -2604,16 +3327,16 @@ var PushRpc;
2604
3327
  obj.requestId = reader.string();
2605
3328
  break;
2606
3329
  }
2607
- case 2: {
2608
- obj.request = PushRequest.codec().decode(reader, reader.uint32(), {
2609
- limits: opts.limits?.request
2610
- });
3330
+ case 10: {
3331
+ obj.statusCode = reader.uint32();
2611
3332
  break;
2612
3333
  }
2613
- case 3: {
2614
- obj.response = PushResponse.codec().decode(reader, reader.uint32(), {
2615
- limits: opts.limits?.response
2616
- });
3334
+ case 11: {
3335
+ obj.statusDesc = reader.string();
3336
+ break;
3337
+ }
3338
+ case 12: {
3339
+ obj.relayPeerCount = reader.uint32();
2617
3340
  break;
2618
3341
  }
2619
3342
  default: {
@@ -2627,13 +3350,13 @@ var PushRpc;
2627
3350
  }
2628
3351
  return _codec;
2629
3352
  };
2630
- PushRpc.encode = (obj) => {
2631
- return encodeMessage(obj, PushRpc.codec());
3353
+ LightpushResponse.encode = (obj) => {
3354
+ return encodeMessage(obj, LightpushResponse.codec());
2632
3355
  };
2633
- PushRpc.decode = (buf, opts) => {
2634
- return decodeMessage(buf, PushRpc.codec(), opts);
3356
+ LightpushResponse.decode = (buf, opts) => {
3357
+ return decodeMessage(buf, LightpushResponse.codec(), opts);
2635
3358
  };
2636
- })(PushRpc || (PushRpc = {}));
3359
+ })(LightpushResponse || (LightpushResponse = {}));
2637
3360
  var RateLimitProof$1;
2638
3361
  (function (RateLimitProof) {
2639
3362
  let _codec;
@@ -4142,6 +4865,21 @@ const sha256$1 = /* @__PURE__ */ createHasher(() => new SHA256());
4142
4865
  /** @deprecated Use import from `noble/hashes/sha2` module */
4143
4866
  const sha256 = sha256$1;
4144
4867
 
4868
+ // Light Push V3 Protocol Types and Constants
4869
+ var LightPushStatusCodeV3;
4870
+ (function (LightPushStatusCodeV3) {
4871
+ LightPushStatusCodeV3[LightPushStatusCodeV3["SUCCESS"] = 200] = "SUCCESS";
4872
+ LightPushStatusCodeV3[LightPushStatusCodeV3["BAD_REQUEST"] = 400] = "BAD_REQUEST";
4873
+ LightPushStatusCodeV3[LightPushStatusCodeV3["PAYLOAD_TOO_LARGE"] = 413] = "PAYLOAD_TOO_LARGE";
4874
+ LightPushStatusCodeV3[LightPushStatusCodeV3["INVALID_MESSAGE_ERROR"] = 420] = "INVALID_MESSAGE_ERROR";
4875
+ LightPushStatusCodeV3[LightPushStatusCodeV3["UNSUPPORTED_PUBSUB_TOPIC"] = 421] = "UNSUPPORTED_PUBSUB_TOPIC";
4876
+ LightPushStatusCodeV3[LightPushStatusCodeV3["TOO_MANY_REQUESTS"] = 429] = "TOO_MANY_REQUESTS";
4877
+ LightPushStatusCodeV3[LightPushStatusCodeV3["INTERNAL_SERVER_ERROR"] = 500] = "INTERNAL_SERVER_ERROR";
4878
+ LightPushStatusCodeV3[LightPushStatusCodeV3["SERVICE_NOT_AVAILABLE"] = 503] = "SERVICE_NOT_AVAILABLE";
4879
+ LightPushStatusCodeV3[LightPushStatusCodeV3["OUT_OF_RLN_PROOF"] = 504] = "OUT_OF_RLN_PROOF";
4880
+ LightPushStatusCodeV3[LightPushStatusCodeV3["NO_PEERS_TO_RELAY"] = 505] = "NO_PEERS_TO_RELAY";
4881
+ })(LightPushStatusCodeV3 || (LightPushStatusCodeV3 = {}));
4882
+
4145
4883
  var Protocols;
4146
4884
  (function (Protocols) {
4147
4885
  Protocols["Relay"] = "relay";
@@ -5140,9 +5878,6 @@ let DecodedMessage$1 = class DecodedMessage {
5140
5878
  get contentTopic() {
5141
5879
  return this.proto.contentTopic;
5142
5880
  }
5143
- get _rawTimestamp() {
5144
- return this.proto.timestamp;
5145
- }
5146
5881
  get timestamp() {
5147
5882
  // In the case we receive a value that is bigger than JS's max number,
5148
5883
  // we catch the error and return undefined.
@@ -5164,7 +5899,7 @@ let DecodedMessage$1 = class DecodedMessage {
5164
5899
  get version() {
5165
5900
  // https://rfc.vac.dev/spec/14/
5166
5901
  // > If omitted, the value SHOULD be interpreted as version 0.
5167
- return this.proto.version ?? 0;
5902
+ return this.proto.version ?? Version;
5168
5903
  }
5169
5904
  get rateLimitProof() {
5170
5905
  return this.proto.rateLimitProof;
@@ -5181,7 +5916,7 @@ let Decoder$1 = class Decoder {
5181
5916
  }
5182
5917
  }
5183
5918
  fromWireToProtoObj(bytes) {
5184
- const protoMessage = WakuMessage$4.decode(bytes);
5919
+ const protoMessage = WakuMessage$6.decode(bytes);
5185
5920
  return Promise.resolve({
5186
5921
  payload: protoMessage.payload,
5187
5922
  contentTopic: protoMessage.contentTopic,
@@ -5419,4 +6154,4 @@ function postCipher(message) {
5419
6154
  return { payload, sig };
5420
6155
  }
5421
6156
 
5422
- export { Decoder$1 as D, Logger as L, WakuMessage$3 as W, decryptAsymmetric as a, postCipher as b, DecodedMessage as c, determinePubsubTopic as d, encryptAsymmetric as e, encryptSymmetric as f, decryptSymmetric as g, preCipher as p };
6157
+ export { Decoder$1 as D, Logger as L, WakuMessage$5 as W, decryptAsymmetric as a, postCipher as b, DecodedMessage as c, determinePubsubTopic as d, encryptAsymmetric as e, encryptSymmetric as f, decryptSymmetric as g, preCipher as p };