@waku/core 0.0.36-10590da.0 → 0.0.36-3730abc.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 +495 -55
- package/bundle/lib/message/version_0.js +1 -1
- package/bundle/{version_0-CiYGrPc2.js → version_0-y7BmRolm.js} +919 -184
- package/dist/.tsbuildinfo +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/connection_manager/connection_manager.d.ts +1 -1
- package/dist/lib/connection_manager/connection_manager.js +1 -1
- package/dist/lib/filter/filter.d.ts +4 -2
- package/dist/lib/filter/filter.js +21 -3
- package/dist/lib/filter/filter.js.map +1 -1
- package/dist/lib/light_push/index.d.ts +5 -1
- package/dist/lib/light_push/index.js +5 -1
- package/dist/lib/light_push/index.js.map +1 -1
- package/dist/lib/light_push/light_push.d.ts +3 -4
- package/dist/lib/light_push/light_push.js +18 -19
- package/dist/lib/light_push/light_push.js.map +1 -1
- package/dist/lib/light_push/light_push_v3.d.ts +10 -0
- package/dist/lib/light_push/light_push_v3.js +172 -0
- package/dist/lib/light_push/light_push_v3.js.map +1 -0
- package/dist/lib/light_push/push_rpc.d.ts +1 -1
- package/dist/lib/light_push/push_rpc.js.map +1 -1
- package/dist/lib/light_push/push_rpc_v2.d.ts +11 -0
- package/dist/lib/light_push/push_rpc_v2.js +32 -0
- package/dist/lib/light_push/push_rpc_v2.js.map +1 -0
- package/dist/lib/light_push/push_rpc_v3.d.ts +11 -0
- package/dist/lib/light_push/push_rpc_v3.js +33 -0
- package/dist/lib/light_push/push_rpc_v3.js.map +1 -0
- package/dist/lib/light_push/status_codes.d.ts +14 -0
- package/dist/lib/light_push/status_codes.js +49 -0
- package/dist/lib/light_push/status_codes.js.map +1 -0
- package/dist/lib/light_push/status_codes_v3.d.ts +17 -0
- package/dist/lib/light_push/status_codes_v3.js +69 -0
- package/dist/lib/light_push/status_codes_v3.js.map +1 -0
- package/dist/lib/message/version_0.d.ts +2 -3
- package/dist/lib/message/version_0.js +1 -4
- package/dist/lib/message/version_0.js.map +1 -1
- package/dist/lib/message_hash/index.d.ts +1 -0
- package/dist/lib/message_hash/index.js +2 -0
- package/dist/lib/message_hash/index.js.map +1 -0
- package/dist/lib/message_hash/message_hash.d.ts +52 -0
- package/dist/lib/message_hash/message_hash.js +84 -0
- package/dist/lib/message_hash/message_hash.js.map +1 -0
- package/dist/lib/store/rpc.js +16 -10
- package/dist/lib/store/rpc.js.map +1 -1
- package/dist/lib/store/store.js +12 -2
- package/dist/lib/store/store.js.map +1 -1
- package/package.json +1 -1
- package/src/index.ts +11 -0
- package/src/lib/connection_manager/connection_manager.ts +1 -1
- package/src/lib/filter/filter.ts +33 -6
- package/src/lib/light_push/index.ts +24 -1
- package/src/lib/light_push/light_push.ts +25 -23
- package/src/lib/light_push/light_push_v3.ts +233 -0
- package/src/lib/light_push/push_rpc.ts +1 -1
- package/src/lib/light_push/push_rpc_v2.ts +38 -0
- package/src/lib/light_push/push_rpc_v3.ts +46 -0
- package/src/lib/light_push/status_codes.ts +71 -0
- package/src/lib/light_push/status_codes_v3.ts +97 -0
- package/src/lib/message/version_0.ts +3 -7
- package/src/lib/message_hash/index.ts +1 -0
- package/src/lib/message_hash/message_hash.ts +106 -0
- package/src/lib/store/rpc.ts +23 -19
- package/src/lib/store/store.ts +13 -1
@@ -1530,7 +1530,7 @@ class MaxLengthError extends Error {
|
|
1530
1530
|
/* eslint-disable @typescript-eslint/no-namespace */
|
1531
1531
|
/* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */
|
1532
1532
|
/* eslint-disable @typescript-eslint/no-empty-interface */
|
1533
|
-
var RateLimitProof$
|
1533
|
+
var RateLimitProof$6;
|
1534
1534
|
(function (RateLimitProof) {
|
1535
1535
|
let _codec;
|
1536
1536
|
RateLimitProof.codec = () => {
|
@@ -1629,8 +1629,8 @@ var RateLimitProof$4;
|
|
1629
1629
|
RateLimitProof.decode = (buf, opts) => {
|
1630
1630
|
return decodeMessage(buf, RateLimitProof.codec(), opts);
|
1631
1631
|
};
|
1632
|
-
})(RateLimitProof$
|
1633
|
-
var WakuMessage$
|
1632
|
+
})(RateLimitProof$6 || (RateLimitProof$6 = {}));
|
1633
|
+
var WakuMessage$6;
|
1634
1634
|
(function (WakuMessage) {
|
1635
1635
|
let _codec;
|
1636
1636
|
WakuMessage.codec = () => {
|
@@ -1661,7 +1661,7 @@ var WakuMessage$4;
|
|
1661
1661
|
}
|
1662
1662
|
if (obj.rateLimitProof != null) {
|
1663
1663
|
w.uint32(170);
|
1664
|
-
RateLimitProof$
|
1664
|
+
RateLimitProof$6.codec().encode(obj.rateLimitProof, w);
|
1665
1665
|
}
|
1666
1666
|
if (obj.ephemeral != null) {
|
1667
1667
|
w.uint32(248);
|
@@ -1700,7 +1700,7 @@ var WakuMessage$4;
|
|
1700
1700
|
break;
|
1701
1701
|
}
|
1702
1702
|
case 21: {
|
1703
|
-
obj.rateLimitProof = RateLimitProof$
|
1703
|
+
obj.rateLimitProof = RateLimitProof$6.codec().decode(reader, reader.uint32(), {
|
1704
1704
|
limits: opts.limits?.rateLimitProof
|
1705
1705
|
});
|
1706
1706
|
break;
|
@@ -1726,12 +1726,12 @@ var WakuMessage$4;
|
|
1726
1726
|
WakuMessage.decode = (buf, opts) => {
|
1727
1727
|
return decodeMessage(buf, WakuMessage.codec(), opts);
|
1728
1728
|
};
|
1729
|
-
})(WakuMessage$
|
1729
|
+
})(WakuMessage$6 || (WakuMessage$6 = {}));
|
1730
1730
|
|
1731
1731
|
var message = /*#__PURE__*/Object.freeze({
|
1732
1732
|
__proto__: null,
|
1733
|
-
get RateLimitProof () { return RateLimitProof$
|
1734
|
-
get WakuMessage () { return WakuMessage$
|
1733
|
+
get RateLimitProof () { return RateLimitProof$6; },
|
1734
|
+
get WakuMessage () { return WakuMessage$6; }
|
1735
1735
|
});
|
1736
1736
|
|
1737
1737
|
/* eslint-disable import/export */
|
@@ -1867,7 +1867,7 @@ var MessagePush$1;
|
|
1867
1867
|
if (obj.messages != null) {
|
1868
1868
|
for (const value of obj.messages) {
|
1869
1869
|
w.uint32(10);
|
1870
|
-
WakuMessage$
|
1870
|
+
WakuMessage$5.codec().encode(value, w);
|
1871
1871
|
}
|
1872
1872
|
}
|
1873
1873
|
if (opts.lengthDelimited !== false) {
|
@@ -1885,7 +1885,7 @@ var MessagePush$1;
|
|
1885
1885
|
if (opts.limits?.messages != null && obj.messages.length === opts.limits.messages) {
|
1886
1886
|
throw new MaxLengthError('Decode error - map field "messages" had too many elements');
|
1887
1887
|
}
|
1888
|
-
obj.messages.push(WakuMessage$
|
1888
|
+
obj.messages.push(WakuMessage$5.codec().decode(reader, reader.uint32(), {
|
1889
1889
|
limits: opts.limits?.messages$
|
1890
1890
|
}));
|
1891
1891
|
break;
|
@@ -1974,7 +1974,7 @@ var FilterRpc;
|
|
1974
1974
|
return decodeMessage(buf, FilterRpc.codec(), opts);
|
1975
1975
|
};
|
1976
1976
|
})(FilterRpc || (FilterRpc = {}));
|
1977
|
-
var RateLimitProof$
|
1977
|
+
var RateLimitProof$5;
|
1978
1978
|
(function (RateLimitProof) {
|
1979
1979
|
let _codec;
|
1980
1980
|
RateLimitProof.codec = () => {
|
@@ -2073,8 +2073,8 @@ var RateLimitProof$3;
|
|
2073
2073
|
RateLimitProof.decode = (buf, opts) => {
|
2074
2074
|
return decodeMessage(buf, RateLimitProof.codec(), opts);
|
2075
2075
|
};
|
2076
|
-
})(RateLimitProof$
|
2077
|
-
var WakuMessage$
|
2076
|
+
})(RateLimitProof$5 || (RateLimitProof$5 = {}));
|
2077
|
+
var WakuMessage$5;
|
2078
2078
|
(function (WakuMessage) {
|
2079
2079
|
let _codec;
|
2080
2080
|
WakuMessage.codec = () => {
|
@@ -2105,7 +2105,7 @@ var WakuMessage$3;
|
|
2105
2105
|
}
|
2106
2106
|
if (obj.rateLimitProof != null) {
|
2107
2107
|
w.uint32(170);
|
2108
|
-
RateLimitProof$
|
2108
|
+
RateLimitProof$5.codec().encode(obj.rateLimitProof, w);
|
2109
2109
|
}
|
2110
2110
|
if (obj.ephemeral != null) {
|
2111
2111
|
w.uint32(248);
|
@@ -2144,7 +2144,7 @@ var WakuMessage$3;
|
|
2144
2144
|
break;
|
2145
2145
|
}
|
2146
2146
|
case 21: {
|
2147
|
-
obj.rateLimitProof = RateLimitProof$
|
2147
|
+
obj.rateLimitProof = RateLimitProof$5.codec().decode(reader, reader.uint32(), {
|
2148
2148
|
limits: opts.limits?.rateLimitProof
|
2149
2149
|
});
|
2150
2150
|
break;
|
@@ -2170,7 +2170,7 @@ var WakuMessage$3;
|
|
2170
2170
|
WakuMessage.decode = (buf, opts) => {
|
2171
2171
|
return decodeMessage(buf, WakuMessage.codec(), opts);
|
2172
2172
|
};
|
2173
|
-
})(WakuMessage$
|
2173
|
+
})(WakuMessage$5 || (WakuMessage$5 = {}));
|
2174
2174
|
|
2175
2175
|
/* eslint-disable import/export */
|
2176
2176
|
/* eslint-disable complexity */
|
@@ -2265,46 +2265,807 @@ var FilterSubscribeRequest;
|
|
2265
2265
|
w.uint32(16);
|
2266
2266
|
FilterSubscribeRequest.FilterSubscribeType.codec().encode(obj.filterSubscribeType, w);
|
2267
2267
|
}
|
2268
|
-
if (obj.pubsubTopic != null) {
|
2269
|
-
w.uint32(82);
|
2268
|
+
if (obj.pubsubTopic != null) {
|
2269
|
+
w.uint32(82);
|
2270
|
+
w.string(obj.pubsubTopic);
|
2271
|
+
}
|
2272
|
+
if (obj.contentTopics != null) {
|
2273
|
+
for (const value of obj.contentTopics) {
|
2274
|
+
w.uint32(90);
|
2275
|
+
w.string(value);
|
2276
|
+
}
|
2277
|
+
}
|
2278
|
+
if (opts.lengthDelimited !== false) {
|
2279
|
+
w.ldelim();
|
2280
|
+
}
|
2281
|
+
}, (reader, length, opts = {}) => {
|
2282
|
+
const obj = {
|
2283
|
+
requestId: '',
|
2284
|
+
filterSubscribeType: FilterSubscribeType.SUBSCRIBER_PING,
|
2285
|
+
contentTopics: []
|
2286
|
+
};
|
2287
|
+
const end = length == null ? reader.len : reader.pos + length;
|
2288
|
+
while (reader.pos < end) {
|
2289
|
+
const tag = reader.uint32();
|
2290
|
+
switch (tag >>> 3) {
|
2291
|
+
case 1: {
|
2292
|
+
obj.requestId = reader.string();
|
2293
|
+
break;
|
2294
|
+
}
|
2295
|
+
case 2: {
|
2296
|
+
obj.filterSubscribeType = FilterSubscribeRequest.FilterSubscribeType.codec().decode(reader);
|
2297
|
+
break;
|
2298
|
+
}
|
2299
|
+
case 10: {
|
2300
|
+
obj.pubsubTopic = reader.string();
|
2301
|
+
break;
|
2302
|
+
}
|
2303
|
+
case 11: {
|
2304
|
+
if (opts.limits?.contentTopics != null && obj.contentTopics.length === opts.limits.contentTopics) {
|
2305
|
+
throw new MaxLengthError('Decode error - map field "contentTopics" had too many elements');
|
2306
|
+
}
|
2307
|
+
obj.contentTopics.push(reader.string());
|
2308
|
+
break;
|
2309
|
+
}
|
2310
|
+
default: {
|
2311
|
+
reader.skipType(tag & 7);
|
2312
|
+
break;
|
2313
|
+
}
|
2314
|
+
}
|
2315
|
+
}
|
2316
|
+
return obj;
|
2317
|
+
});
|
2318
|
+
}
|
2319
|
+
return _codec;
|
2320
|
+
};
|
2321
|
+
FilterSubscribeRequest.encode = (obj) => {
|
2322
|
+
return encodeMessage(obj, FilterSubscribeRequest.codec());
|
2323
|
+
};
|
2324
|
+
FilterSubscribeRequest.decode = (buf, opts) => {
|
2325
|
+
return decodeMessage(buf, FilterSubscribeRequest.codec(), opts);
|
2326
|
+
};
|
2327
|
+
})(FilterSubscribeRequest || (FilterSubscribeRequest = {}));
|
2328
|
+
var FilterSubscribeResponse$1;
|
2329
|
+
(function (FilterSubscribeResponse) {
|
2330
|
+
let _codec;
|
2331
|
+
FilterSubscribeResponse.codec = () => {
|
2332
|
+
if (_codec == null) {
|
2333
|
+
_codec = message$1((obj, w, opts = {}) => {
|
2334
|
+
if (opts.lengthDelimited !== false) {
|
2335
|
+
w.fork();
|
2336
|
+
}
|
2337
|
+
if ((obj.requestId != null && obj.requestId !== '')) {
|
2338
|
+
w.uint32(10);
|
2339
|
+
w.string(obj.requestId);
|
2340
|
+
}
|
2341
|
+
if ((obj.statusCode != null && obj.statusCode !== 0)) {
|
2342
|
+
w.uint32(80);
|
2343
|
+
w.uint32(obj.statusCode);
|
2344
|
+
}
|
2345
|
+
if (obj.statusDesc != null) {
|
2346
|
+
w.uint32(90);
|
2347
|
+
w.string(obj.statusDesc);
|
2348
|
+
}
|
2349
|
+
if (opts.lengthDelimited !== false) {
|
2350
|
+
w.ldelim();
|
2351
|
+
}
|
2352
|
+
}, (reader, length, opts = {}) => {
|
2353
|
+
const obj = {
|
2354
|
+
requestId: '',
|
2355
|
+
statusCode: 0
|
2356
|
+
};
|
2357
|
+
const end = length == null ? reader.len : reader.pos + length;
|
2358
|
+
while (reader.pos < end) {
|
2359
|
+
const tag = reader.uint32();
|
2360
|
+
switch (tag >>> 3) {
|
2361
|
+
case 1: {
|
2362
|
+
obj.requestId = reader.string();
|
2363
|
+
break;
|
2364
|
+
}
|
2365
|
+
case 10: {
|
2366
|
+
obj.statusCode = reader.uint32();
|
2367
|
+
break;
|
2368
|
+
}
|
2369
|
+
case 11: {
|
2370
|
+
obj.statusDesc = reader.string();
|
2371
|
+
break;
|
2372
|
+
}
|
2373
|
+
default: {
|
2374
|
+
reader.skipType(tag & 7);
|
2375
|
+
break;
|
2376
|
+
}
|
2377
|
+
}
|
2378
|
+
}
|
2379
|
+
return obj;
|
2380
|
+
});
|
2381
|
+
}
|
2382
|
+
return _codec;
|
2383
|
+
};
|
2384
|
+
FilterSubscribeResponse.encode = (obj) => {
|
2385
|
+
return encodeMessage(obj, FilterSubscribeResponse.codec());
|
2386
|
+
};
|
2387
|
+
FilterSubscribeResponse.decode = (buf, opts) => {
|
2388
|
+
return decodeMessage(buf, FilterSubscribeResponse.codec(), opts);
|
2389
|
+
};
|
2390
|
+
})(FilterSubscribeResponse$1 || (FilterSubscribeResponse$1 = {}));
|
2391
|
+
var MessagePush;
|
2392
|
+
(function (MessagePush) {
|
2393
|
+
let _codec;
|
2394
|
+
MessagePush.codec = () => {
|
2395
|
+
if (_codec == null) {
|
2396
|
+
_codec = message$1((obj, w, opts = {}) => {
|
2397
|
+
if (opts.lengthDelimited !== false) {
|
2398
|
+
w.fork();
|
2399
|
+
}
|
2400
|
+
if (obj.wakuMessage != null) {
|
2401
|
+
w.uint32(10);
|
2402
|
+
WakuMessage$4.codec().encode(obj.wakuMessage, w);
|
2403
|
+
}
|
2404
|
+
if (obj.pubsubTopic != null) {
|
2405
|
+
w.uint32(18);
|
2406
|
+
w.string(obj.pubsubTopic);
|
2407
|
+
}
|
2408
|
+
if (opts.lengthDelimited !== false) {
|
2409
|
+
w.ldelim();
|
2410
|
+
}
|
2411
|
+
}, (reader, length, opts = {}) => {
|
2412
|
+
const obj = {};
|
2413
|
+
const end = length == null ? reader.len : reader.pos + length;
|
2414
|
+
while (reader.pos < end) {
|
2415
|
+
const tag = reader.uint32();
|
2416
|
+
switch (tag >>> 3) {
|
2417
|
+
case 1: {
|
2418
|
+
obj.wakuMessage = WakuMessage$4.codec().decode(reader, reader.uint32(), {
|
2419
|
+
limits: opts.limits?.wakuMessage
|
2420
|
+
});
|
2421
|
+
break;
|
2422
|
+
}
|
2423
|
+
case 2: {
|
2424
|
+
obj.pubsubTopic = reader.string();
|
2425
|
+
break;
|
2426
|
+
}
|
2427
|
+
default: {
|
2428
|
+
reader.skipType(tag & 7);
|
2429
|
+
break;
|
2430
|
+
}
|
2431
|
+
}
|
2432
|
+
}
|
2433
|
+
return obj;
|
2434
|
+
});
|
2435
|
+
}
|
2436
|
+
return _codec;
|
2437
|
+
};
|
2438
|
+
MessagePush.encode = (obj) => {
|
2439
|
+
return encodeMessage(obj, MessagePush.codec());
|
2440
|
+
};
|
2441
|
+
MessagePush.decode = (buf, opts) => {
|
2442
|
+
return decodeMessage(buf, MessagePush.codec(), opts);
|
2443
|
+
};
|
2444
|
+
})(MessagePush || (MessagePush = {}));
|
2445
|
+
var RateLimitProof$4;
|
2446
|
+
(function (RateLimitProof) {
|
2447
|
+
let _codec;
|
2448
|
+
RateLimitProof.codec = () => {
|
2449
|
+
if (_codec == null) {
|
2450
|
+
_codec = message$1((obj, w, opts = {}) => {
|
2451
|
+
if (opts.lengthDelimited !== false) {
|
2452
|
+
w.fork();
|
2453
|
+
}
|
2454
|
+
if ((obj.proof != null && obj.proof.byteLength > 0)) {
|
2455
|
+
w.uint32(10);
|
2456
|
+
w.bytes(obj.proof);
|
2457
|
+
}
|
2458
|
+
if ((obj.merkleRoot != null && obj.merkleRoot.byteLength > 0)) {
|
2459
|
+
w.uint32(18);
|
2460
|
+
w.bytes(obj.merkleRoot);
|
2461
|
+
}
|
2462
|
+
if ((obj.epoch != null && obj.epoch.byteLength > 0)) {
|
2463
|
+
w.uint32(26);
|
2464
|
+
w.bytes(obj.epoch);
|
2465
|
+
}
|
2466
|
+
if ((obj.shareX != null && obj.shareX.byteLength > 0)) {
|
2467
|
+
w.uint32(34);
|
2468
|
+
w.bytes(obj.shareX);
|
2469
|
+
}
|
2470
|
+
if ((obj.shareY != null && obj.shareY.byteLength > 0)) {
|
2471
|
+
w.uint32(42);
|
2472
|
+
w.bytes(obj.shareY);
|
2473
|
+
}
|
2474
|
+
if ((obj.nullifier != null && obj.nullifier.byteLength > 0)) {
|
2475
|
+
w.uint32(50);
|
2476
|
+
w.bytes(obj.nullifier);
|
2477
|
+
}
|
2478
|
+
if ((obj.rlnIdentifier != null && obj.rlnIdentifier.byteLength > 0)) {
|
2479
|
+
w.uint32(58);
|
2480
|
+
w.bytes(obj.rlnIdentifier);
|
2481
|
+
}
|
2482
|
+
if (opts.lengthDelimited !== false) {
|
2483
|
+
w.ldelim();
|
2484
|
+
}
|
2485
|
+
}, (reader, length, opts = {}) => {
|
2486
|
+
const obj = {
|
2487
|
+
proof: alloc$1(0),
|
2488
|
+
merkleRoot: alloc$1(0),
|
2489
|
+
epoch: alloc$1(0),
|
2490
|
+
shareX: alloc$1(0),
|
2491
|
+
shareY: alloc$1(0),
|
2492
|
+
nullifier: alloc$1(0),
|
2493
|
+
rlnIdentifier: alloc$1(0)
|
2494
|
+
};
|
2495
|
+
const end = length == null ? reader.len : reader.pos + length;
|
2496
|
+
while (reader.pos < end) {
|
2497
|
+
const tag = reader.uint32();
|
2498
|
+
switch (tag >>> 3) {
|
2499
|
+
case 1: {
|
2500
|
+
obj.proof = reader.bytes();
|
2501
|
+
break;
|
2502
|
+
}
|
2503
|
+
case 2: {
|
2504
|
+
obj.merkleRoot = reader.bytes();
|
2505
|
+
break;
|
2506
|
+
}
|
2507
|
+
case 3: {
|
2508
|
+
obj.epoch = reader.bytes();
|
2509
|
+
break;
|
2510
|
+
}
|
2511
|
+
case 4: {
|
2512
|
+
obj.shareX = reader.bytes();
|
2513
|
+
break;
|
2514
|
+
}
|
2515
|
+
case 5: {
|
2516
|
+
obj.shareY = reader.bytes();
|
2517
|
+
break;
|
2518
|
+
}
|
2519
|
+
case 6: {
|
2520
|
+
obj.nullifier = reader.bytes();
|
2521
|
+
break;
|
2522
|
+
}
|
2523
|
+
case 7: {
|
2524
|
+
obj.rlnIdentifier = reader.bytes();
|
2525
|
+
break;
|
2526
|
+
}
|
2527
|
+
default: {
|
2528
|
+
reader.skipType(tag & 7);
|
2529
|
+
break;
|
2530
|
+
}
|
2531
|
+
}
|
2532
|
+
}
|
2533
|
+
return obj;
|
2534
|
+
});
|
2535
|
+
}
|
2536
|
+
return _codec;
|
2537
|
+
};
|
2538
|
+
RateLimitProof.encode = (obj) => {
|
2539
|
+
return encodeMessage(obj, RateLimitProof.codec());
|
2540
|
+
};
|
2541
|
+
RateLimitProof.decode = (buf, opts) => {
|
2542
|
+
return decodeMessage(buf, RateLimitProof.codec(), opts);
|
2543
|
+
};
|
2544
|
+
})(RateLimitProof$4 || (RateLimitProof$4 = {}));
|
2545
|
+
var WakuMessage$4;
|
2546
|
+
(function (WakuMessage) {
|
2547
|
+
let _codec;
|
2548
|
+
WakuMessage.codec = () => {
|
2549
|
+
if (_codec == null) {
|
2550
|
+
_codec = message$1((obj, w, opts = {}) => {
|
2551
|
+
if (opts.lengthDelimited !== false) {
|
2552
|
+
w.fork();
|
2553
|
+
}
|
2554
|
+
if ((obj.payload != null && obj.payload.byteLength > 0)) {
|
2555
|
+
w.uint32(10);
|
2556
|
+
w.bytes(obj.payload);
|
2557
|
+
}
|
2558
|
+
if ((obj.contentTopic != null && obj.contentTopic !== '')) {
|
2559
|
+
w.uint32(18);
|
2560
|
+
w.string(obj.contentTopic);
|
2561
|
+
}
|
2562
|
+
if (obj.version != null) {
|
2563
|
+
w.uint32(24);
|
2564
|
+
w.uint32(obj.version);
|
2565
|
+
}
|
2566
|
+
if (obj.timestamp != null) {
|
2567
|
+
w.uint32(80);
|
2568
|
+
w.sint64(obj.timestamp);
|
2569
|
+
}
|
2570
|
+
if (obj.meta != null) {
|
2571
|
+
w.uint32(90);
|
2572
|
+
w.bytes(obj.meta);
|
2573
|
+
}
|
2574
|
+
if (obj.rateLimitProof != null) {
|
2575
|
+
w.uint32(170);
|
2576
|
+
RateLimitProof$4.codec().encode(obj.rateLimitProof, w);
|
2577
|
+
}
|
2578
|
+
if (obj.ephemeral != null) {
|
2579
|
+
w.uint32(248);
|
2580
|
+
w.bool(obj.ephemeral);
|
2581
|
+
}
|
2582
|
+
if (opts.lengthDelimited !== false) {
|
2583
|
+
w.ldelim();
|
2584
|
+
}
|
2585
|
+
}, (reader, length, opts = {}) => {
|
2586
|
+
const obj = {
|
2587
|
+
payload: alloc$1(0),
|
2588
|
+
contentTopic: ''
|
2589
|
+
};
|
2590
|
+
const end = length == null ? reader.len : reader.pos + length;
|
2591
|
+
while (reader.pos < end) {
|
2592
|
+
const tag = reader.uint32();
|
2593
|
+
switch (tag >>> 3) {
|
2594
|
+
case 1: {
|
2595
|
+
obj.payload = reader.bytes();
|
2596
|
+
break;
|
2597
|
+
}
|
2598
|
+
case 2: {
|
2599
|
+
obj.contentTopic = reader.string();
|
2600
|
+
break;
|
2601
|
+
}
|
2602
|
+
case 3: {
|
2603
|
+
obj.version = reader.uint32();
|
2604
|
+
break;
|
2605
|
+
}
|
2606
|
+
case 10: {
|
2607
|
+
obj.timestamp = reader.sint64();
|
2608
|
+
break;
|
2609
|
+
}
|
2610
|
+
case 11: {
|
2611
|
+
obj.meta = reader.bytes();
|
2612
|
+
break;
|
2613
|
+
}
|
2614
|
+
case 21: {
|
2615
|
+
obj.rateLimitProof = RateLimitProof$4.codec().decode(reader, reader.uint32(), {
|
2616
|
+
limits: opts.limits?.rateLimitProof
|
2617
|
+
});
|
2618
|
+
break;
|
2619
|
+
}
|
2620
|
+
case 31: {
|
2621
|
+
obj.ephemeral = reader.bool();
|
2622
|
+
break;
|
2623
|
+
}
|
2624
|
+
default: {
|
2625
|
+
reader.skipType(tag & 7);
|
2626
|
+
break;
|
2627
|
+
}
|
2628
|
+
}
|
2629
|
+
}
|
2630
|
+
return obj;
|
2631
|
+
});
|
2632
|
+
}
|
2633
|
+
return _codec;
|
2634
|
+
};
|
2635
|
+
WakuMessage.encode = (obj) => {
|
2636
|
+
return encodeMessage(obj, WakuMessage.codec());
|
2637
|
+
};
|
2638
|
+
WakuMessage.decode = (buf, opts) => {
|
2639
|
+
return decodeMessage(buf, WakuMessage.codec(), opts);
|
2640
|
+
};
|
2641
|
+
})(WakuMessage$4 || (WakuMessage$4 = {}));
|
2642
|
+
|
2643
|
+
/* eslint-disable import/export */
|
2644
|
+
/* eslint-disable complexity */
|
2645
|
+
/* eslint-disable @typescript-eslint/no-namespace */
|
2646
|
+
/* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */
|
2647
|
+
/* eslint-disable @typescript-eslint/no-empty-interface */
|
2648
|
+
var PushRequest$1;
|
2649
|
+
(function (PushRequest) {
|
2650
|
+
let _codec;
|
2651
|
+
PushRequest.codec = () => {
|
2652
|
+
if (_codec == null) {
|
2653
|
+
_codec = message$1((obj, w, opts = {}) => {
|
2654
|
+
if (opts.lengthDelimited !== false) {
|
2655
|
+
w.fork();
|
2656
|
+
}
|
2657
|
+
if (obj.pubsubTopic != null) {
|
2658
|
+
w.uint32(162);
|
2659
|
+
w.string(obj.pubsubTopic);
|
2660
|
+
}
|
2661
|
+
if (obj.message != null) {
|
2662
|
+
w.uint32(170);
|
2663
|
+
WakuMessage$3.codec().encode(obj.message, w);
|
2664
|
+
}
|
2665
|
+
if (opts.lengthDelimited !== false) {
|
2666
|
+
w.ldelim();
|
2667
|
+
}
|
2668
|
+
}, (reader, length, opts = {}) => {
|
2669
|
+
const obj = {};
|
2670
|
+
const end = length == null ? reader.len : reader.pos + length;
|
2671
|
+
while (reader.pos < end) {
|
2672
|
+
const tag = reader.uint32();
|
2673
|
+
switch (tag >>> 3) {
|
2674
|
+
case 20: {
|
2675
|
+
obj.pubsubTopic = reader.string();
|
2676
|
+
break;
|
2677
|
+
}
|
2678
|
+
case 21: {
|
2679
|
+
obj.message = WakuMessage$3.codec().decode(reader, reader.uint32(), {
|
2680
|
+
limits: opts.limits?.message
|
2681
|
+
});
|
2682
|
+
break;
|
2683
|
+
}
|
2684
|
+
default: {
|
2685
|
+
reader.skipType(tag & 7);
|
2686
|
+
break;
|
2687
|
+
}
|
2688
|
+
}
|
2689
|
+
}
|
2690
|
+
return obj;
|
2691
|
+
});
|
2692
|
+
}
|
2693
|
+
return _codec;
|
2694
|
+
};
|
2695
|
+
PushRequest.encode = (obj) => {
|
2696
|
+
return encodeMessage(obj, PushRequest.codec());
|
2697
|
+
};
|
2698
|
+
PushRequest.decode = (buf, opts) => {
|
2699
|
+
return decodeMessage(buf, PushRequest.codec(), opts);
|
2700
|
+
};
|
2701
|
+
})(PushRequest$1 || (PushRequest$1 = {}));
|
2702
|
+
var PushResponse$1;
|
2703
|
+
(function (PushResponse) {
|
2704
|
+
let _codec;
|
2705
|
+
PushResponse.codec = () => {
|
2706
|
+
if (_codec == null) {
|
2707
|
+
_codec = message$1((obj, w, opts = {}) => {
|
2708
|
+
if (opts.lengthDelimited !== false) {
|
2709
|
+
w.fork();
|
2710
|
+
}
|
2711
|
+
if ((obj.statusCode != null && obj.statusCode !== 0)) {
|
2712
|
+
w.uint32(160);
|
2713
|
+
w.uint32(obj.statusCode);
|
2714
|
+
}
|
2715
|
+
if (obj.statusDesc != null) {
|
2716
|
+
w.uint32(242);
|
2717
|
+
w.string(obj.statusDesc);
|
2718
|
+
}
|
2719
|
+
if (obj.relayPeerCount != null) {
|
2720
|
+
w.uint32(320);
|
2721
|
+
w.uint32(obj.relayPeerCount);
|
2722
|
+
}
|
2723
|
+
if (opts.lengthDelimited !== false) {
|
2724
|
+
w.ldelim();
|
2725
|
+
}
|
2726
|
+
}, (reader, length, opts = {}) => {
|
2727
|
+
const obj = {
|
2728
|
+
statusCode: 0
|
2729
|
+
};
|
2730
|
+
const end = length == null ? reader.len : reader.pos + length;
|
2731
|
+
while (reader.pos < end) {
|
2732
|
+
const tag = reader.uint32();
|
2733
|
+
switch (tag >>> 3) {
|
2734
|
+
case 20: {
|
2735
|
+
obj.statusCode = reader.uint32();
|
2736
|
+
break;
|
2737
|
+
}
|
2738
|
+
case 30: {
|
2739
|
+
obj.statusDesc = reader.string();
|
2740
|
+
break;
|
2741
|
+
}
|
2742
|
+
case 40: {
|
2743
|
+
obj.relayPeerCount = reader.uint32();
|
2744
|
+
break;
|
2745
|
+
}
|
2746
|
+
default: {
|
2747
|
+
reader.skipType(tag & 7);
|
2748
|
+
break;
|
2749
|
+
}
|
2750
|
+
}
|
2751
|
+
}
|
2752
|
+
return obj;
|
2753
|
+
});
|
2754
|
+
}
|
2755
|
+
return _codec;
|
2756
|
+
};
|
2757
|
+
PushResponse.encode = (obj) => {
|
2758
|
+
return encodeMessage(obj, PushResponse.codec());
|
2759
|
+
};
|
2760
|
+
PushResponse.decode = (buf, opts) => {
|
2761
|
+
return decodeMessage(buf, PushResponse.codec(), opts);
|
2762
|
+
};
|
2763
|
+
})(PushResponse$1 || (PushResponse$1 = {}));
|
2764
|
+
var PushRpc$1;
|
2765
|
+
(function (PushRpc) {
|
2766
|
+
let _codec;
|
2767
|
+
PushRpc.codec = () => {
|
2768
|
+
if (_codec == null) {
|
2769
|
+
_codec = message$1((obj, w, opts = {}) => {
|
2770
|
+
if (opts.lengthDelimited !== false) {
|
2771
|
+
w.fork();
|
2772
|
+
}
|
2773
|
+
if ((obj.requestId != null && obj.requestId !== '')) {
|
2774
|
+
w.uint32(10);
|
2775
|
+
w.string(obj.requestId);
|
2776
|
+
}
|
2777
|
+
if (obj.request != null) {
|
2778
|
+
w.uint32(18);
|
2779
|
+
PushRequest$1.codec().encode(obj.request, w);
|
2780
|
+
}
|
2781
|
+
if (obj.response != null) {
|
2782
|
+
w.uint32(26);
|
2783
|
+
PushResponse$1.codec().encode(obj.response, w);
|
2784
|
+
}
|
2785
|
+
if (opts.lengthDelimited !== false) {
|
2786
|
+
w.ldelim();
|
2787
|
+
}
|
2788
|
+
}, (reader, length, opts = {}) => {
|
2789
|
+
const obj = {
|
2790
|
+
requestId: ''
|
2791
|
+
};
|
2792
|
+
const end = length == null ? reader.len : reader.pos + length;
|
2793
|
+
while (reader.pos < end) {
|
2794
|
+
const tag = reader.uint32();
|
2795
|
+
switch (tag >>> 3) {
|
2796
|
+
case 1: {
|
2797
|
+
obj.requestId = reader.string();
|
2798
|
+
break;
|
2799
|
+
}
|
2800
|
+
case 2: {
|
2801
|
+
obj.request = PushRequest$1.codec().decode(reader, reader.uint32(), {
|
2802
|
+
limits: opts.limits?.request
|
2803
|
+
});
|
2804
|
+
break;
|
2805
|
+
}
|
2806
|
+
case 3: {
|
2807
|
+
obj.response = PushResponse$1.codec().decode(reader, reader.uint32(), {
|
2808
|
+
limits: opts.limits?.response
|
2809
|
+
});
|
2810
|
+
break;
|
2811
|
+
}
|
2812
|
+
default: {
|
2813
|
+
reader.skipType(tag & 7);
|
2814
|
+
break;
|
2815
|
+
}
|
2816
|
+
}
|
2817
|
+
}
|
2818
|
+
return obj;
|
2819
|
+
});
|
2820
|
+
}
|
2821
|
+
return _codec;
|
2822
|
+
};
|
2823
|
+
PushRpc.encode = (obj) => {
|
2824
|
+
return encodeMessage(obj, PushRpc.codec());
|
2825
|
+
};
|
2826
|
+
PushRpc.decode = (buf, opts) => {
|
2827
|
+
return decodeMessage(buf, PushRpc.codec(), opts);
|
2828
|
+
};
|
2829
|
+
})(PushRpc$1 || (PushRpc$1 = {}));
|
2830
|
+
var RateLimitProof$3;
|
2831
|
+
(function (RateLimitProof) {
|
2832
|
+
let _codec;
|
2833
|
+
RateLimitProof.codec = () => {
|
2834
|
+
if (_codec == null) {
|
2835
|
+
_codec = message$1((obj, w, opts = {}) => {
|
2836
|
+
if (opts.lengthDelimited !== false) {
|
2837
|
+
w.fork();
|
2838
|
+
}
|
2839
|
+
if ((obj.proof != null && obj.proof.byteLength > 0)) {
|
2840
|
+
w.uint32(10);
|
2841
|
+
w.bytes(obj.proof);
|
2842
|
+
}
|
2843
|
+
if ((obj.merkleRoot != null && obj.merkleRoot.byteLength > 0)) {
|
2844
|
+
w.uint32(18);
|
2845
|
+
w.bytes(obj.merkleRoot);
|
2846
|
+
}
|
2847
|
+
if ((obj.epoch != null && obj.epoch.byteLength > 0)) {
|
2848
|
+
w.uint32(26);
|
2849
|
+
w.bytes(obj.epoch);
|
2850
|
+
}
|
2851
|
+
if ((obj.shareX != null && obj.shareX.byteLength > 0)) {
|
2852
|
+
w.uint32(34);
|
2853
|
+
w.bytes(obj.shareX);
|
2854
|
+
}
|
2855
|
+
if ((obj.shareY != null && obj.shareY.byteLength > 0)) {
|
2856
|
+
w.uint32(42);
|
2857
|
+
w.bytes(obj.shareY);
|
2858
|
+
}
|
2859
|
+
if ((obj.nullifier != null && obj.nullifier.byteLength > 0)) {
|
2860
|
+
w.uint32(50);
|
2861
|
+
w.bytes(obj.nullifier);
|
2862
|
+
}
|
2863
|
+
if ((obj.rlnIdentifier != null && obj.rlnIdentifier.byteLength > 0)) {
|
2864
|
+
w.uint32(58);
|
2865
|
+
w.bytes(obj.rlnIdentifier);
|
2866
|
+
}
|
2867
|
+
if (opts.lengthDelimited !== false) {
|
2868
|
+
w.ldelim();
|
2869
|
+
}
|
2870
|
+
}, (reader, length, opts = {}) => {
|
2871
|
+
const obj = {
|
2872
|
+
proof: alloc$1(0),
|
2873
|
+
merkleRoot: alloc$1(0),
|
2874
|
+
epoch: alloc$1(0),
|
2875
|
+
shareX: alloc$1(0),
|
2876
|
+
shareY: alloc$1(0),
|
2877
|
+
nullifier: alloc$1(0),
|
2878
|
+
rlnIdentifier: alloc$1(0)
|
2879
|
+
};
|
2880
|
+
const end = length == null ? reader.len : reader.pos + length;
|
2881
|
+
while (reader.pos < end) {
|
2882
|
+
const tag = reader.uint32();
|
2883
|
+
switch (tag >>> 3) {
|
2884
|
+
case 1: {
|
2885
|
+
obj.proof = reader.bytes();
|
2886
|
+
break;
|
2887
|
+
}
|
2888
|
+
case 2: {
|
2889
|
+
obj.merkleRoot = reader.bytes();
|
2890
|
+
break;
|
2891
|
+
}
|
2892
|
+
case 3: {
|
2893
|
+
obj.epoch = reader.bytes();
|
2894
|
+
break;
|
2895
|
+
}
|
2896
|
+
case 4: {
|
2897
|
+
obj.shareX = reader.bytes();
|
2898
|
+
break;
|
2899
|
+
}
|
2900
|
+
case 5: {
|
2901
|
+
obj.shareY = reader.bytes();
|
2902
|
+
break;
|
2903
|
+
}
|
2904
|
+
case 6: {
|
2905
|
+
obj.nullifier = reader.bytes();
|
2906
|
+
break;
|
2907
|
+
}
|
2908
|
+
case 7: {
|
2909
|
+
obj.rlnIdentifier = reader.bytes();
|
2910
|
+
break;
|
2911
|
+
}
|
2912
|
+
default: {
|
2913
|
+
reader.skipType(tag & 7);
|
2914
|
+
break;
|
2915
|
+
}
|
2916
|
+
}
|
2917
|
+
}
|
2918
|
+
return obj;
|
2919
|
+
});
|
2920
|
+
}
|
2921
|
+
return _codec;
|
2922
|
+
};
|
2923
|
+
RateLimitProof.encode = (obj) => {
|
2924
|
+
return encodeMessage(obj, RateLimitProof.codec());
|
2925
|
+
};
|
2926
|
+
RateLimitProof.decode = (buf, opts) => {
|
2927
|
+
return decodeMessage(buf, RateLimitProof.codec(), opts);
|
2928
|
+
};
|
2929
|
+
})(RateLimitProof$3 || (RateLimitProof$3 = {}));
|
2930
|
+
var WakuMessage$3;
|
2931
|
+
(function (WakuMessage) {
|
2932
|
+
let _codec;
|
2933
|
+
WakuMessage.codec = () => {
|
2934
|
+
if (_codec == null) {
|
2935
|
+
_codec = message$1((obj, w, opts = {}) => {
|
2936
|
+
if (opts.lengthDelimited !== false) {
|
2937
|
+
w.fork();
|
2938
|
+
}
|
2939
|
+
if ((obj.payload != null && obj.payload.byteLength > 0)) {
|
2940
|
+
w.uint32(10);
|
2941
|
+
w.bytes(obj.payload);
|
2942
|
+
}
|
2943
|
+
if ((obj.contentTopic != null && obj.contentTopic !== '')) {
|
2944
|
+
w.uint32(18);
|
2945
|
+
w.string(obj.contentTopic);
|
2946
|
+
}
|
2947
|
+
if (obj.version != null) {
|
2948
|
+
w.uint32(24);
|
2949
|
+
w.uint32(obj.version);
|
2950
|
+
}
|
2951
|
+
if (obj.timestamp != null) {
|
2952
|
+
w.uint32(80);
|
2953
|
+
w.sint64(obj.timestamp);
|
2954
|
+
}
|
2955
|
+
if (obj.meta != null) {
|
2956
|
+
w.uint32(90);
|
2957
|
+
w.bytes(obj.meta);
|
2958
|
+
}
|
2959
|
+
if (obj.rateLimitProof != null) {
|
2960
|
+
w.uint32(170);
|
2961
|
+
RateLimitProof$3.codec().encode(obj.rateLimitProof, w);
|
2962
|
+
}
|
2963
|
+
if (obj.ephemeral != null) {
|
2964
|
+
w.uint32(248);
|
2965
|
+
w.bool(obj.ephemeral);
|
2966
|
+
}
|
2967
|
+
if (opts.lengthDelimited !== false) {
|
2968
|
+
w.ldelim();
|
2969
|
+
}
|
2970
|
+
}, (reader, length, opts = {}) => {
|
2971
|
+
const obj = {
|
2972
|
+
payload: alloc$1(0),
|
2973
|
+
contentTopic: ''
|
2974
|
+
};
|
2975
|
+
const end = length == null ? reader.len : reader.pos + length;
|
2976
|
+
while (reader.pos < end) {
|
2977
|
+
const tag = reader.uint32();
|
2978
|
+
switch (tag >>> 3) {
|
2979
|
+
case 1: {
|
2980
|
+
obj.payload = reader.bytes();
|
2981
|
+
break;
|
2982
|
+
}
|
2983
|
+
case 2: {
|
2984
|
+
obj.contentTopic = reader.string();
|
2985
|
+
break;
|
2986
|
+
}
|
2987
|
+
case 3: {
|
2988
|
+
obj.version = reader.uint32();
|
2989
|
+
break;
|
2990
|
+
}
|
2991
|
+
case 10: {
|
2992
|
+
obj.timestamp = reader.sint64();
|
2993
|
+
break;
|
2994
|
+
}
|
2995
|
+
case 11: {
|
2996
|
+
obj.meta = reader.bytes();
|
2997
|
+
break;
|
2998
|
+
}
|
2999
|
+
case 21: {
|
3000
|
+
obj.rateLimitProof = RateLimitProof$3.codec().decode(reader, reader.uint32(), {
|
3001
|
+
limits: opts.limits?.rateLimitProof
|
3002
|
+
});
|
3003
|
+
break;
|
3004
|
+
}
|
3005
|
+
case 31: {
|
3006
|
+
obj.ephemeral = reader.bool();
|
3007
|
+
break;
|
3008
|
+
}
|
3009
|
+
default: {
|
3010
|
+
reader.skipType(tag & 7);
|
3011
|
+
break;
|
3012
|
+
}
|
3013
|
+
}
|
3014
|
+
}
|
3015
|
+
return obj;
|
3016
|
+
});
|
3017
|
+
}
|
3018
|
+
return _codec;
|
3019
|
+
};
|
3020
|
+
WakuMessage.encode = (obj) => {
|
3021
|
+
return encodeMessage(obj, WakuMessage.codec());
|
3022
|
+
};
|
3023
|
+
WakuMessage.decode = (buf, opts) => {
|
3024
|
+
return decodeMessage(buf, WakuMessage.codec(), opts);
|
3025
|
+
};
|
3026
|
+
})(WakuMessage$3 || (WakuMessage$3 = {}));
|
3027
|
+
|
3028
|
+
/* eslint-disable import/export */
|
3029
|
+
/* eslint-disable complexity */
|
3030
|
+
/* eslint-disable @typescript-eslint/no-namespace */
|
3031
|
+
/* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */
|
3032
|
+
/* eslint-disable @typescript-eslint/no-empty-interface */
|
3033
|
+
var PushRequest;
|
3034
|
+
(function (PushRequest) {
|
3035
|
+
let _codec;
|
3036
|
+
PushRequest.codec = () => {
|
3037
|
+
if (_codec == null) {
|
3038
|
+
_codec = message$1((obj, w, opts = {}) => {
|
3039
|
+
if (opts.lengthDelimited !== false) {
|
3040
|
+
w.fork();
|
3041
|
+
}
|
3042
|
+
if ((obj.pubsubTopic != null && obj.pubsubTopic !== '')) {
|
3043
|
+
w.uint32(10);
|
2270
3044
|
w.string(obj.pubsubTopic);
|
2271
3045
|
}
|
2272
|
-
if (obj.
|
2273
|
-
|
2274
|
-
|
2275
|
-
w.string(value);
|
2276
|
-
}
|
3046
|
+
if (obj.message != null) {
|
3047
|
+
w.uint32(18);
|
3048
|
+
WakuMessage$2.codec().encode(obj.message, w);
|
2277
3049
|
}
|
2278
3050
|
if (opts.lengthDelimited !== false) {
|
2279
3051
|
w.ldelim();
|
2280
3052
|
}
|
2281
3053
|
}, (reader, length, opts = {}) => {
|
2282
3054
|
const obj = {
|
2283
|
-
|
2284
|
-
filterSubscribeType: FilterSubscribeType.SUBSCRIBER_PING,
|
2285
|
-
contentTopics: []
|
3055
|
+
pubsubTopic: ''
|
2286
3056
|
};
|
2287
3057
|
const end = length == null ? reader.len : reader.pos + length;
|
2288
3058
|
while (reader.pos < end) {
|
2289
3059
|
const tag = reader.uint32();
|
2290
3060
|
switch (tag >>> 3) {
|
2291
3061
|
case 1: {
|
2292
|
-
obj.requestId = reader.string();
|
2293
|
-
break;
|
2294
|
-
}
|
2295
|
-
case 2: {
|
2296
|
-
obj.filterSubscribeType = FilterSubscribeRequest.FilterSubscribeType.codec().decode(reader);
|
2297
|
-
break;
|
2298
|
-
}
|
2299
|
-
case 10: {
|
2300
3062
|
obj.pubsubTopic = reader.string();
|
2301
3063
|
break;
|
2302
3064
|
}
|
2303
|
-
case
|
2304
|
-
|
2305
|
-
|
2306
|
-
}
|
2307
|
-
obj.contentTopics.push(reader.string());
|
3065
|
+
case 2: {
|
3066
|
+
obj.message = WakuMessage$2.codec().decode(reader, reader.uint32(), {
|
3067
|
+
limits: opts.limits?.message
|
3068
|
+
});
|
2308
3069
|
break;
|
2309
3070
|
}
|
2310
3071
|
default: {
|
@@ -2318,56 +3079,47 @@ var FilterSubscribeRequest;
|
|
2318
3079
|
}
|
2319
3080
|
return _codec;
|
2320
3081
|
};
|
2321
|
-
|
2322
|
-
return encodeMessage(obj,
|
3082
|
+
PushRequest.encode = (obj) => {
|
3083
|
+
return encodeMessage(obj, PushRequest.codec());
|
2323
3084
|
};
|
2324
|
-
|
2325
|
-
return decodeMessage(buf,
|
3085
|
+
PushRequest.decode = (buf, opts) => {
|
3086
|
+
return decodeMessage(buf, PushRequest.codec(), opts);
|
2326
3087
|
};
|
2327
|
-
})(
|
2328
|
-
var
|
2329
|
-
(function (
|
3088
|
+
})(PushRequest || (PushRequest = {}));
|
3089
|
+
var PushResponse;
|
3090
|
+
(function (PushResponse) {
|
2330
3091
|
let _codec;
|
2331
|
-
|
3092
|
+
PushResponse.codec = () => {
|
2332
3093
|
if (_codec == null) {
|
2333
3094
|
_codec = message$1((obj, w, opts = {}) => {
|
2334
3095
|
if (opts.lengthDelimited !== false) {
|
2335
3096
|
w.fork();
|
2336
3097
|
}
|
2337
|
-
if ((obj.
|
2338
|
-
w.uint32(
|
2339
|
-
w.
|
2340
|
-
}
|
2341
|
-
if ((obj.statusCode != null && obj.statusCode !== 0)) {
|
2342
|
-
w.uint32(80);
|
2343
|
-
w.uint32(obj.statusCode);
|
3098
|
+
if ((obj.isSuccess != null && obj.isSuccess !== false)) {
|
3099
|
+
w.uint32(8);
|
3100
|
+
w.bool(obj.isSuccess);
|
2344
3101
|
}
|
2345
|
-
if (obj.
|
2346
|
-
w.uint32(
|
2347
|
-
w.string(obj.
|
3102
|
+
if (obj.info != null) {
|
3103
|
+
w.uint32(18);
|
3104
|
+
w.string(obj.info);
|
2348
3105
|
}
|
2349
3106
|
if (opts.lengthDelimited !== false) {
|
2350
3107
|
w.ldelim();
|
2351
3108
|
}
|
2352
3109
|
}, (reader, length, opts = {}) => {
|
2353
3110
|
const obj = {
|
2354
|
-
|
2355
|
-
statusCode: 0
|
3111
|
+
isSuccess: false
|
2356
3112
|
};
|
2357
3113
|
const end = length == null ? reader.len : reader.pos + length;
|
2358
3114
|
while (reader.pos < end) {
|
2359
3115
|
const tag = reader.uint32();
|
2360
3116
|
switch (tag >>> 3) {
|
2361
3117
|
case 1: {
|
2362
|
-
obj.
|
2363
|
-
break;
|
2364
|
-
}
|
2365
|
-
case 10: {
|
2366
|
-
obj.statusCode = reader.uint32();
|
3118
|
+
obj.isSuccess = reader.bool();
|
2367
3119
|
break;
|
2368
3120
|
}
|
2369
|
-
case
|
2370
|
-
obj.
|
3121
|
+
case 2: {
|
3122
|
+
obj.info = reader.string();
|
2371
3123
|
break;
|
2372
3124
|
}
|
2373
3125
|
default: {
|
@@ -2381,47 +3133,59 @@ var FilterSubscribeResponse$1;
|
|
2381
3133
|
}
|
2382
3134
|
return _codec;
|
2383
3135
|
};
|
2384
|
-
|
2385
|
-
return encodeMessage(obj,
|
3136
|
+
PushResponse.encode = (obj) => {
|
3137
|
+
return encodeMessage(obj, PushResponse.codec());
|
2386
3138
|
};
|
2387
|
-
|
2388
|
-
return decodeMessage(buf,
|
3139
|
+
PushResponse.decode = (buf, opts) => {
|
3140
|
+
return decodeMessage(buf, PushResponse.codec(), opts);
|
2389
3141
|
};
|
2390
|
-
})(
|
2391
|
-
var
|
2392
|
-
(function (
|
3142
|
+
})(PushResponse || (PushResponse = {}));
|
3143
|
+
var PushRpc;
|
3144
|
+
(function (PushRpc) {
|
2393
3145
|
let _codec;
|
2394
|
-
|
3146
|
+
PushRpc.codec = () => {
|
2395
3147
|
if (_codec == null) {
|
2396
3148
|
_codec = message$1((obj, w, opts = {}) => {
|
2397
3149
|
if (opts.lengthDelimited !== false) {
|
2398
3150
|
w.fork();
|
2399
3151
|
}
|
2400
|
-
if (obj.
|
3152
|
+
if ((obj.requestId != null && obj.requestId !== '')) {
|
2401
3153
|
w.uint32(10);
|
2402
|
-
|
3154
|
+
w.string(obj.requestId);
|
2403
3155
|
}
|
2404
|
-
if (obj.
|
3156
|
+
if (obj.request != null) {
|
2405
3157
|
w.uint32(18);
|
2406
|
-
|
3158
|
+
PushRequest.codec().encode(obj.request, w);
|
3159
|
+
}
|
3160
|
+
if (obj.response != null) {
|
3161
|
+
w.uint32(26);
|
3162
|
+
PushResponse.codec().encode(obj.response, w);
|
2407
3163
|
}
|
2408
3164
|
if (opts.lengthDelimited !== false) {
|
2409
3165
|
w.ldelim();
|
2410
3166
|
}
|
2411
3167
|
}, (reader, length, opts = {}) => {
|
2412
|
-
const obj = {
|
3168
|
+
const obj = {
|
3169
|
+
requestId: ''
|
3170
|
+
};
|
2413
3171
|
const end = length == null ? reader.len : reader.pos + length;
|
2414
3172
|
while (reader.pos < end) {
|
2415
3173
|
const tag = reader.uint32();
|
2416
3174
|
switch (tag >>> 3) {
|
2417
3175
|
case 1: {
|
2418
|
-
obj.
|
2419
|
-
limits: opts.limits?.wakuMessage
|
2420
|
-
});
|
3176
|
+
obj.requestId = reader.string();
|
2421
3177
|
break;
|
2422
3178
|
}
|
2423
3179
|
case 2: {
|
2424
|
-
obj.
|
3180
|
+
obj.request = PushRequest.codec().decode(reader, reader.uint32(), {
|
3181
|
+
limits: opts.limits?.request
|
3182
|
+
});
|
3183
|
+
break;
|
3184
|
+
}
|
3185
|
+
case 3: {
|
3186
|
+
obj.response = PushResponse.codec().decode(reader, reader.uint32(), {
|
3187
|
+
limits: opts.limits?.response
|
3188
|
+
});
|
2425
3189
|
break;
|
2426
3190
|
}
|
2427
3191
|
default: {
|
@@ -2435,13 +3199,13 @@ var MessagePush;
|
|
2435
3199
|
}
|
2436
3200
|
return _codec;
|
2437
3201
|
};
|
2438
|
-
|
2439
|
-
return encodeMessage(obj,
|
3202
|
+
PushRpc.encode = (obj) => {
|
3203
|
+
return encodeMessage(obj, PushRpc.codec());
|
2440
3204
|
};
|
2441
|
-
|
2442
|
-
return decodeMessage(buf,
|
3205
|
+
PushRpc.decode = (buf, opts) => {
|
3206
|
+
return decodeMessage(buf, PushRpc.codec(), opts);
|
2443
3207
|
};
|
2444
|
-
})(
|
3208
|
+
})(PushRpc || (PushRpc = {}));
|
2445
3209
|
var RateLimitProof$2;
|
2446
3210
|
(function (RateLimitProof) {
|
2447
3211
|
let _codec;
|
@@ -2645,21 +3409,25 @@ var WakuMessage$2;
|
|
2645
3409
|
/* eslint-disable @typescript-eslint/no-namespace */
|
2646
3410
|
/* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */
|
2647
3411
|
/* eslint-disable @typescript-eslint/no-empty-interface */
|
2648
|
-
var
|
2649
|
-
(function (
|
3412
|
+
var LightpushRequest;
|
3413
|
+
(function (LightpushRequest) {
|
2650
3414
|
let _codec;
|
2651
|
-
|
3415
|
+
LightpushRequest.codec = () => {
|
2652
3416
|
if (_codec == null) {
|
2653
3417
|
_codec = message$1((obj, w, opts = {}) => {
|
2654
3418
|
if (opts.lengthDelimited !== false) {
|
2655
3419
|
w.fork();
|
2656
3420
|
}
|
2657
|
-
if ((obj.
|
3421
|
+
if ((obj.requestId != null && obj.requestId !== '')) {
|
2658
3422
|
w.uint32(10);
|
3423
|
+
w.string(obj.requestId);
|
3424
|
+
}
|
3425
|
+
if (obj.pubsubTopic != null) {
|
3426
|
+
w.uint32(162);
|
2659
3427
|
w.string(obj.pubsubTopic);
|
2660
3428
|
}
|
2661
3429
|
if (obj.message != null) {
|
2662
|
-
w.uint32(
|
3430
|
+
w.uint32(170);
|
2663
3431
|
WakuMessage$1.codec().encode(obj.message, w);
|
2664
3432
|
}
|
2665
3433
|
if (opts.lengthDelimited !== false) {
|
@@ -2667,17 +3435,21 @@ var PushRequest;
|
|
2667
3435
|
}
|
2668
3436
|
}, (reader, length, opts = {}) => {
|
2669
3437
|
const obj = {
|
2670
|
-
|
3438
|
+
requestId: ''
|
2671
3439
|
};
|
2672
3440
|
const end = length == null ? reader.len : reader.pos + length;
|
2673
3441
|
while (reader.pos < end) {
|
2674
3442
|
const tag = reader.uint32();
|
2675
3443
|
switch (tag >>> 3) {
|
2676
3444
|
case 1: {
|
3445
|
+
obj.requestId = reader.string();
|
3446
|
+
break;
|
3447
|
+
}
|
3448
|
+
case 20: {
|
2677
3449
|
obj.pubsubTopic = reader.string();
|
2678
3450
|
break;
|
2679
3451
|
}
|
2680
|
-
case
|
3452
|
+
case 21: {
|
2681
3453
|
obj.message = WakuMessage$1.codec().decode(reader, reader.uint32(), {
|
2682
3454
|
limits: opts.limits?.message
|
2683
3455
|
});
|
@@ -2694,71 +3466,17 @@ var PushRequest;
|
|
2694
3466
|
}
|
2695
3467
|
return _codec;
|
2696
3468
|
};
|
2697
|
-
|
2698
|
-
return encodeMessage(obj,
|
2699
|
-
};
|
2700
|
-
PushRequest.decode = (buf, opts) => {
|
2701
|
-
return decodeMessage(buf, PushRequest.codec(), opts);
|
2702
|
-
};
|
2703
|
-
})(PushRequest || (PushRequest = {}));
|
2704
|
-
var PushResponse;
|
2705
|
-
(function (PushResponse) {
|
2706
|
-
let _codec;
|
2707
|
-
PushResponse.codec = () => {
|
2708
|
-
if (_codec == null) {
|
2709
|
-
_codec = message$1((obj, w, opts = {}) => {
|
2710
|
-
if (opts.lengthDelimited !== false) {
|
2711
|
-
w.fork();
|
2712
|
-
}
|
2713
|
-
if ((obj.isSuccess != null && obj.isSuccess !== false)) {
|
2714
|
-
w.uint32(8);
|
2715
|
-
w.bool(obj.isSuccess);
|
2716
|
-
}
|
2717
|
-
if (obj.info != null) {
|
2718
|
-
w.uint32(18);
|
2719
|
-
w.string(obj.info);
|
2720
|
-
}
|
2721
|
-
if (opts.lengthDelimited !== false) {
|
2722
|
-
w.ldelim();
|
2723
|
-
}
|
2724
|
-
}, (reader, length, opts = {}) => {
|
2725
|
-
const obj = {
|
2726
|
-
isSuccess: false
|
2727
|
-
};
|
2728
|
-
const end = length == null ? reader.len : reader.pos + length;
|
2729
|
-
while (reader.pos < end) {
|
2730
|
-
const tag = reader.uint32();
|
2731
|
-
switch (tag >>> 3) {
|
2732
|
-
case 1: {
|
2733
|
-
obj.isSuccess = reader.bool();
|
2734
|
-
break;
|
2735
|
-
}
|
2736
|
-
case 2: {
|
2737
|
-
obj.info = reader.string();
|
2738
|
-
break;
|
2739
|
-
}
|
2740
|
-
default: {
|
2741
|
-
reader.skipType(tag & 7);
|
2742
|
-
break;
|
2743
|
-
}
|
2744
|
-
}
|
2745
|
-
}
|
2746
|
-
return obj;
|
2747
|
-
});
|
2748
|
-
}
|
2749
|
-
return _codec;
|
2750
|
-
};
|
2751
|
-
PushResponse.encode = (obj) => {
|
2752
|
-
return encodeMessage(obj, PushResponse.codec());
|
3469
|
+
LightpushRequest.encode = (obj) => {
|
3470
|
+
return encodeMessage(obj, LightpushRequest.codec());
|
2753
3471
|
};
|
2754
|
-
|
2755
|
-
return decodeMessage(buf,
|
3472
|
+
LightpushRequest.decode = (buf, opts) => {
|
3473
|
+
return decodeMessage(buf, LightpushRequest.codec(), opts);
|
2756
3474
|
};
|
2757
|
-
})(
|
2758
|
-
var
|
2759
|
-
(function (
|
3475
|
+
})(LightpushRequest || (LightpushRequest = {}));
|
3476
|
+
var LightpushResponse;
|
3477
|
+
(function (LightpushResponse) {
|
2760
3478
|
let _codec;
|
2761
|
-
|
3479
|
+
LightpushResponse.codec = () => {
|
2762
3480
|
if (_codec == null) {
|
2763
3481
|
_codec = message$1((obj, w, opts = {}) => {
|
2764
3482
|
if (opts.lengthDelimited !== false) {
|
@@ -2768,20 +3486,25 @@ var PushRpc$1;
|
|
2768
3486
|
w.uint32(10);
|
2769
3487
|
w.string(obj.requestId);
|
2770
3488
|
}
|
2771
|
-
if (obj.
|
2772
|
-
w.uint32(
|
2773
|
-
|
3489
|
+
if ((obj.statusCode != null && obj.statusCode !== 0)) {
|
3490
|
+
w.uint32(80);
|
3491
|
+
w.uint32(obj.statusCode);
|
2774
3492
|
}
|
2775
|
-
if (obj.
|
2776
|
-
w.uint32(
|
2777
|
-
|
3493
|
+
if (obj.statusDesc != null) {
|
3494
|
+
w.uint32(90);
|
3495
|
+
w.string(obj.statusDesc);
|
3496
|
+
}
|
3497
|
+
if (obj.relayPeerCount != null) {
|
3498
|
+
w.uint32(96);
|
3499
|
+
w.uint32(obj.relayPeerCount);
|
2778
3500
|
}
|
2779
3501
|
if (opts.lengthDelimited !== false) {
|
2780
3502
|
w.ldelim();
|
2781
3503
|
}
|
2782
3504
|
}, (reader, length, opts = {}) => {
|
2783
3505
|
const obj = {
|
2784
|
-
requestId: ''
|
3506
|
+
requestId: '',
|
3507
|
+
statusCode: 0
|
2785
3508
|
};
|
2786
3509
|
const end = length == null ? reader.len : reader.pos + length;
|
2787
3510
|
while (reader.pos < end) {
|
@@ -2791,16 +3514,16 @@ var PushRpc$1;
|
|
2791
3514
|
obj.requestId = reader.string();
|
2792
3515
|
break;
|
2793
3516
|
}
|
2794
|
-
case
|
2795
|
-
obj.
|
2796
|
-
limits: opts.limits?.request
|
2797
|
-
});
|
3517
|
+
case 10: {
|
3518
|
+
obj.statusCode = reader.uint32();
|
2798
3519
|
break;
|
2799
3520
|
}
|
2800
|
-
case
|
2801
|
-
obj.
|
2802
|
-
|
2803
|
-
|
3521
|
+
case 11: {
|
3522
|
+
obj.statusDesc = reader.string();
|
3523
|
+
break;
|
3524
|
+
}
|
3525
|
+
case 12: {
|
3526
|
+
obj.relayPeerCount = reader.uint32();
|
2804
3527
|
break;
|
2805
3528
|
}
|
2806
3529
|
default: {
|
@@ -2814,13 +3537,13 @@ var PushRpc$1;
|
|
2814
3537
|
}
|
2815
3538
|
return _codec;
|
2816
3539
|
};
|
2817
|
-
|
2818
|
-
return encodeMessage(obj,
|
3540
|
+
LightpushResponse.encode = (obj) => {
|
3541
|
+
return encodeMessage(obj, LightpushResponse.codec());
|
2819
3542
|
};
|
2820
|
-
|
2821
|
-
return decodeMessage(buf,
|
3543
|
+
LightpushResponse.decode = (buf, opts) => {
|
3544
|
+
return decodeMessage(buf, LightpushResponse.codec(), opts);
|
2822
3545
|
};
|
2823
|
-
})(
|
3546
|
+
})(LightpushResponse || (LightpushResponse = {}));
|
2824
3547
|
var RateLimitProof$1;
|
2825
3548
|
(function (RateLimitProof) {
|
2826
3549
|
let _codec;
|
@@ -4350,6 +5073,21 @@ function toString(array, encoding = 'utf8') {
|
|
4350
5073
|
return base.encoder.encode(array).substring(1);
|
4351
5074
|
}
|
4352
5075
|
|
5076
|
+
function numberToBytes(value) {
|
5077
|
+
const buffer = new ArrayBuffer(8);
|
5078
|
+
const view = new DataView(buffer);
|
5079
|
+
if (typeof value === "number") {
|
5080
|
+
view.setFloat64(0, value, false);
|
5081
|
+
}
|
5082
|
+
else {
|
5083
|
+
view.setBigInt64(0, value, false);
|
5084
|
+
}
|
5085
|
+
return new Uint8Array(buffer);
|
5086
|
+
}
|
5087
|
+
/**
|
5088
|
+
* Convert byte array to hex string (no `0x` prefix).
|
5089
|
+
*/
|
5090
|
+
const bytesToHex = (bytes) => toString(bytes, "base16");
|
4353
5091
|
/**
|
4354
5092
|
* Decode byte array to utf-8 string.
|
4355
5093
|
*/
|
@@ -4532,9 +5270,6 @@ class DecodedMessage {
|
|
4532
5270
|
get contentTopic() {
|
4533
5271
|
return this.proto.contentTopic;
|
4534
5272
|
}
|
4535
|
-
get _rawTimestamp() {
|
4536
|
-
return this.proto.timestamp;
|
4537
|
-
}
|
4538
5273
|
get timestamp() {
|
4539
5274
|
// In the case we receive a value that is bigger than JS's max number,
|
4540
5275
|
// we catch the error and return undefined.
|
@@ -4556,7 +5291,7 @@ class DecodedMessage {
|
|
4556
5291
|
get version() {
|
4557
5292
|
// https://rfc.vac.dev/spec/14/
|
4558
5293
|
// > If omitted, the value SHOULD be interpreted as version 0.
|
4559
|
-
return this.proto.version ??
|
5294
|
+
return this.proto.version ?? Version;
|
4560
5295
|
}
|
4561
5296
|
get rateLimitProof() {
|
4562
5297
|
return this.proto.rateLimitProof;
|
@@ -4577,7 +5312,7 @@ class Encoder {
|
|
4577
5312
|
}
|
4578
5313
|
}
|
4579
5314
|
async toWire(message$1) {
|
4580
|
-
return WakuMessage$
|
5315
|
+
return WakuMessage$6.encode(await this.toProtoObj(message$1));
|
4581
5316
|
}
|
4582
5317
|
async toProtoObj(message) {
|
4583
5318
|
const timestamp = message.timestamp ?? new Date();
|
@@ -4619,7 +5354,7 @@ class Decoder {
|
|
4619
5354
|
}
|
4620
5355
|
}
|
4621
5356
|
fromWireToProtoObj(bytes) {
|
4622
|
-
const protoMessage = WakuMessage$
|
5357
|
+
const protoMessage = WakuMessage$6.decode(bytes);
|
4623
5358
|
return Promise.resolve({
|
4624
5359
|
payload: protoMessage.payload,
|
4625
5360
|
contentTopic: protoMessage.contentTopic,
|
@@ -4665,4 +5400,4 @@ var version_0 = /*#__PURE__*/Object.freeze({
|
|
4665
5400
|
proto: message
|
4666
5401
|
});
|
4667
5402
|
|
4668
|
-
export { DecodedMessage as D, Encoder as E, FilterSubscribeRequest as F, MessagePush as M, PushRpc
|
5403
|
+
export { Decoder as A, DecodedMessage as D, Encoder as E, FilterSubscribeRequest as F, LightpushResponse as L, MessagePush as M, PushRpc as P, StoreQueryRequest$1 as S, Version as V, WakuMetadataRequest as W, allocUnsafe as a, alloc$1 as b, encode as c, decode as d, encodingLength as e, FilterSubscribeResponse$1 as f, LightpushRequest as g, PushResponse$1 as h, StoreQueryResponse$1 as i, bases as j, fromString as k, createEncoder as l, bytesToUtf8 as m, pubsubTopicsToShardInfo as n, WakuMetadataResponse as o, pubsubTopicToSingleShardInfo as p, concat as q, sha256 as r, shardInfoToPubsubTopics as s, toString as t, utf8ToBytes as u, version_0 as v, bytesToHex as w, numberToBytes as x, createDecoder as y, message as z };
|