commit new proto buf gen

This commit is contained in:
danisharora099 2024-01-30 19:52:03 +05:30
parent 8fa2d1b236
commit b41fb70576
No known key found for this signature in database
GPG Key ID: FBD2BF500037F135
8 changed files with 366 additions and 213 deletions

View File

@ -4,8 +4,8 @@
/* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */ /* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */
/* eslint-disable @typescript-eslint/no-empty-interface */ /* eslint-disable @typescript-eslint/no-empty-interface */
import { encodeMessage, decodeMessage, message } from 'protons-runtime' import { type Codec, decodeMessage, encodeMessage, message } from 'protons-runtime'
import type { Codec } from 'protons-runtime' import { alloc as uint8ArrayAlloc } from 'uint8arrays/alloc'
import type { Uint8ArrayList } from 'uint8arraylist' import type { Uint8ArrayList } from 'uint8arraylist'
export interface FilterRequest { export interface FilterRequest {
@ -48,12 +48,14 @@ export namespace FilterRequest {
const tag = reader.uint32() const tag = reader.uint32()
switch (tag >>> 3) { switch (tag >>> 3) {
case 1: case 1: {
obj.contentTopic = reader.string() obj.contentTopic = reader.string()
break break
default: }
default: {
reader.skipType(tag & 7) reader.skipType(tag & 7)
break break
}
} }
} }
@ -115,18 +117,22 @@ export namespace FilterRequest {
const tag = reader.uint32() const tag = reader.uint32()
switch (tag >>> 3) { switch (tag >>> 3) {
case 1: case 1: {
obj.subscribe = reader.bool() obj.subscribe = reader.bool()
break break
case 2: }
case 2: {
obj.topic = reader.string() obj.topic = reader.string()
break break
case 3: }
case 3: {
obj.contentFilters.push(FilterRequest.ContentFilter.codec().decode(reader, reader.uint32())) obj.contentFilters.push(FilterRequest.ContentFilter.codec().decode(reader, reader.uint32()))
break break
default: }
default: {
reader.skipType(tag & 7) reader.skipType(tag & 7)
break break
}
} }
} }
@ -181,12 +187,14 @@ export namespace MessagePush {
const tag = reader.uint32() const tag = reader.uint32()
switch (tag >>> 3) { switch (tag >>> 3) {
case 1: case 1: {
obj.messages.push(WakuMessage.codec().decode(reader, reader.uint32())) obj.messages.push(WakuMessage.codec().decode(reader, reader.uint32()))
break break
default: }
default: {
reader.skipType(tag & 7) reader.skipType(tag & 7)
break break
}
} }
} }
@ -251,18 +259,22 @@ export namespace FilterRpc {
const tag = reader.uint32() const tag = reader.uint32()
switch (tag >>> 3) { switch (tag >>> 3) {
case 1: case 1: {
obj.requestId = reader.string() obj.requestId = reader.string()
break break
case 2: }
case 2: {
obj.request = FilterRequest.codec().decode(reader, reader.uint32()) obj.request = FilterRequest.codec().decode(reader, reader.uint32())
break break
case 3: }
case 3: {
obj.push = MessagePush.codec().decode(reader, reader.uint32()) obj.push = MessagePush.codec().decode(reader, reader.uint32())
break break
default: }
default: {
reader.skipType(tag & 7) reader.skipType(tag & 7)
break break
}
} }
} }
@ -342,13 +354,13 @@ export namespace RateLimitProof {
} }
}, (reader, length) => { }, (reader, length) => {
const obj: any = { const obj: any = {
proof: new Uint8Array(0), proof: uint8ArrayAlloc(0),
merkleRoot: new Uint8Array(0), merkleRoot: uint8ArrayAlloc(0),
epoch: new Uint8Array(0), epoch: uint8ArrayAlloc(0),
shareX: new Uint8Array(0), shareX: uint8ArrayAlloc(0),
shareY: new Uint8Array(0), shareY: uint8ArrayAlloc(0),
nullifier: new Uint8Array(0), nullifier: uint8ArrayAlloc(0),
rlnIdentifier: new Uint8Array(0) rlnIdentifier: uint8ArrayAlloc(0)
} }
const end = length == null ? reader.len : reader.pos + length const end = length == null ? reader.len : reader.pos + length
@ -357,30 +369,38 @@ export namespace RateLimitProof {
const tag = reader.uint32() const tag = reader.uint32()
switch (tag >>> 3) { switch (tag >>> 3) {
case 1: case 1: {
obj.proof = reader.bytes() obj.proof = reader.bytes()
break break
case 2: }
case 2: {
obj.merkleRoot = reader.bytes() obj.merkleRoot = reader.bytes()
break break
case 3: }
case 3: {
obj.epoch = reader.bytes() obj.epoch = reader.bytes()
break break
case 4: }
case 4: {
obj.shareX = reader.bytes() obj.shareX = reader.bytes()
break break
case 5: }
case 5: {
obj.shareY = reader.bytes() obj.shareY = reader.bytes()
break break
case 6: }
case 6: {
obj.nullifier = reader.bytes() obj.nullifier = reader.bytes()
break break
case 7: }
case 7: {
obj.rlnIdentifier = reader.bytes() obj.rlnIdentifier = reader.bytes()
break break
default: }
default: {
reader.skipType(tag & 7) reader.skipType(tag & 7)
break break
}
} }
} }
@ -460,7 +480,7 @@ export namespace WakuMessage {
} }
}, (reader, length) => { }, (reader, length) => {
const obj: any = { const obj: any = {
payload: new Uint8Array(0), payload: uint8ArrayAlloc(0),
contentTopic: '' contentTopic: ''
} }
@ -470,30 +490,38 @@ export namespace WakuMessage {
const tag = reader.uint32() const tag = reader.uint32()
switch (tag >>> 3) { switch (tag >>> 3) {
case 1: case 1: {
obj.payload = reader.bytes() obj.payload = reader.bytes()
break break
case 2: }
case 2: {
obj.contentTopic = reader.string() obj.contentTopic = reader.string()
break break
case 3: }
case 3: {
obj.version = reader.uint32() obj.version = reader.uint32()
break break
case 10: }
case 10: {
obj.timestamp = reader.sint64() obj.timestamp = reader.sint64()
break break
case 11: }
case 11: {
obj.meta = reader.bytes() obj.meta = reader.bytes()
break break
case 21: }
case 21: {
obj.rateLimitProof = RateLimitProof.codec().decode(reader, reader.uint32()) obj.rateLimitProof = RateLimitProof.codec().decode(reader, reader.uint32())
break break
case 31: }
case 31: {
obj.ephemeral = reader.bool() obj.ephemeral = reader.bool()
break break
default: }
default: {
reader.skipType(tag & 7) reader.skipType(tag & 7)
break break
}
} }
} }

View File

@ -4,8 +4,8 @@
/* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */ /* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */
/* eslint-disable @typescript-eslint/no-empty-interface */ /* eslint-disable @typescript-eslint/no-empty-interface */
import { enumeration, encodeMessage, decodeMessage, message } from 'protons-runtime' import { type Codec, decodeMessage, encodeMessage, enumeration, message } from 'protons-runtime'
import type { Codec } from 'protons-runtime' import { alloc as uint8ArrayAlloc } from 'uint8arrays/alloc'
import type { Uint8ArrayList } from 'uint8arraylist' import type { Uint8ArrayList } from 'uint8arraylist'
export interface FilterSubscribeRequest { export interface FilterSubscribeRequest {
@ -83,21 +83,26 @@ export namespace FilterSubscribeRequest {
const tag = reader.uint32() const tag = reader.uint32()
switch (tag >>> 3) { switch (tag >>> 3) {
case 1: case 1: {
obj.requestId = reader.string() obj.requestId = reader.string()
break break
case 2: }
case 2: {
obj.filterSubscribeType = FilterSubscribeRequest.FilterSubscribeType.codec().decode(reader) obj.filterSubscribeType = FilterSubscribeRequest.FilterSubscribeType.codec().decode(reader)
break break
case 10: }
case 10: {
obj.pubsubTopic = reader.string() obj.pubsubTopic = reader.string()
break break
case 11: }
case 11: {
obj.contentTopics.push(reader.string()) obj.contentTopics.push(reader.string())
break break
default: }
default: {
reader.skipType(tag & 7) reader.skipType(tag & 7)
break break
}
} }
} }
@ -163,18 +168,22 @@ export namespace FilterSubscribeResponse {
const tag = reader.uint32() const tag = reader.uint32()
switch (tag >>> 3) { switch (tag >>> 3) {
case 1: case 1: {
obj.requestId = reader.string() obj.requestId = reader.string()
break break
case 10: }
case 10: {
obj.statusCode = reader.uint32() obj.statusCode = reader.uint32()
break break
case 11: }
case 11: {
obj.statusDesc = reader.string() obj.statusDesc = reader.string()
break break
default: }
default: {
reader.skipType(tag & 7) reader.skipType(tag & 7)
break break
}
} }
} }
@ -231,15 +240,18 @@ export namespace MessagePush {
const tag = reader.uint32() const tag = reader.uint32()
switch (tag >>> 3) { switch (tag >>> 3) {
case 1: case 1: {
obj.wakuMessage = WakuMessage.codec().decode(reader, reader.uint32()) obj.wakuMessage = WakuMessage.codec().decode(reader, reader.uint32())
break break
case 2: }
case 2: {
obj.pubsubTopic = reader.string() obj.pubsubTopic = reader.string()
break break
default: }
default: {
reader.skipType(tag & 7) reader.skipType(tag & 7)
break break
}
} }
} }
@ -319,13 +331,13 @@ export namespace RateLimitProof {
} }
}, (reader, length) => { }, (reader, length) => {
const obj: any = { const obj: any = {
proof: new Uint8Array(0), proof: uint8ArrayAlloc(0),
merkleRoot: new Uint8Array(0), merkleRoot: uint8ArrayAlloc(0),
epoch: new Uint8Array(0), epoch: uint8ArrayAlloc(0),
shareX: new Uint8Array(0), shareX: uint8ArrayAlloc(0),
shareY: new Uint8Array(0), shareY: uint8ArrayAlloc(0),
nullifier: new Uint8Array(0), nullifier: uint8ArrayAlloc(0),
rlnIdentifier: new Uint8Array(0) rlnIdentifier: uint8ArrayAlloc(0)
} }
const end = length == null ? reader.len : reader.pos + length const end = length == null ? reader.len : reader.pos + length
@ -334,30 +346,38 @@ export namespace RateLimitProof {
const tag = reader.uint32() const tag = reader.uint32()
switch (tag >>> 3) { switch (tag >>> 3) {
case 1: case 1: {
obj.proof = reader.bytes() obj.proof = reader.bytes()
break break
case 2: }
case 2: {
obj.merkleRoot = reader.bytes() obj.merkleRoot = reader.bytes()
break break
case 3: }
case 3: {
obj.epoch = reader.bytes() obj.epoch = reader.bytes()
break break
case 4: }
case 4: {
obj.shareX = reader.bytes() obj.shareX = reader.bytes()
break break
case 5: }
case 5: {
obj.shareY = reader.bytes() obj.shareY = reader.bytes()
break break
case 6: }
case 6: {
obj.nullifier = reader.bytes() obj.nullifier = reader.bytes()
break break
case 7: }
case 7: {
obj.rlnIdentifier = reader.bytes() obj.rlnIdentifier = reader.bytes()
break break
default: }
default: {
reader.skipType(tag & 7) reader.skipType(tag & 7)
break break
}
} }
} }
@ -437,7 +457,7 @@ export namespace WakuMessage {
} }
}, (reader, length) => { }, (reader, length) => {
const obj: any = { const obj: any = {
payload: new Uint8Array(0), payload: uint8ArrayAlloc(0),
contentTopic: '' contentTopic: ''
} }
@ -447,30 +467,38 @@ export namespace WakuMessage {
const tag = reader.uint32() const tag = reader.uint32()
switch (tag >>> 3) { switch (tag >>> 3) {
case 1: case 1: {
obj.payload = reader.bytes() obj.payload = reader.bytes()
break break
case 2: }
case 2: {
obj.contentTopic = reader.string() obj.contentTopic = reader.string()
break break
case 3: }
case 3: {
obj.version = reader.uint32() obj.version = reader.uint32()
break break
case 10: }
case 10: {
obj.timestamp = reader.sint64() obj.timestamp = reader.sint64()
break break
case 11: }
case 11: {
obj.meta = reader.bytes() obj.meta = reader.bytes()
break break
case 21: }
case 21: {
obj.rateLimitProof = RateLimitProof.codec().decode(reader, reader.uint32()) obj.rateLimitProof = RateLimitProof.codec().decode(reader, reader.uint32())
break break
case 31: }
case 31: {
obj.ephemeral = reader.bool() obj.ephemeral = reader.bool()
break break
default: }
default: {
reader.skipType(tag & 7) reader.skipType(tag & 7)
break break
}
} }
} }

View File

@ -4,8 +4,8 @@
/* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */ /* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */
/* eslint-disable @typescript-eslint/no-empty-interface */ /* eslint-disable @typescript-eslint/no-empty-interface */
import { encodeMessage, decodeMessage, message } from 'protons-runtime' import { type Codec, decodeMessage, encodeMessage, message } from 'protons-runtime'
import type { Codec } from 'protons-runtime' import { alloc as uint8ArrayAlloc } from 'uint8arrays/alloc'
import type { Uint8ArrayList } from 'uint8arraylist' import type { Uint8ArrayList } from 'uint8arraylist'
export interface PushRequest { export interface PushRequest {
@ -47,15 +47,18 @@ export namespace PushRequest {
const tag = reader.uint32() const tag = reader.uint32()
switch (tag >>> 3) { switch (tag >>> 3) {
case 1: case 1: {
obj.pubsubTopic = reader.string() obj.pubsubTopic = reader.string()
break break
case 2: }
case 2: {
obj.message = WakuMessage.codec().decode(reader, reader.uint32()) obj.message = WakuMessage.codec().decode(reader, reader.uint32())
break break
default: }
default: {
reader.skipType(tag & 7) reader.skipType(tag & 7)
break break
}
} }
} }
@ -114,15 +117,18 @@ export namespace PushResponse {
const tag = reader.uint32() const tag = reader.uint32()
switch (tag >>> 3) { switch (tag >>> 3) {
case 1: case 1: {
obj.isSuccess = reader.bool() obj.isSuccess = reader.bool()
break break
case 2: }
case 2: {
obj.info = reader.string() obj.info = reader.string()
break break
default: }
default: {
reader.skipType(tag & 7) reader.skipType(tag & 7)
break break
}
} }
} }
@ -187,18 +193,22 @@ export namespace PushRpc {
const tag = reader.uint32() const tag = reader.uint32()
switch (tag >>> 3) { switch (tag >>> 3) {
case 1: case 1: {
obj.requestId = reader.string() obj.requestId = reader.string()
break break
case 2: }
case 2: {
obj.request = PushRequest.codec().decode(reader, reader.uint32()) obj.request = PushRequest.codec().decode(reader, reader.uint32())
break break
case 3: }
case 3: {
obj.response = PushResponse.codec().decode(reader, reader.uint32()) obj.response = PushResponse.codec().decode(reader, reader.uint32())
break break
default: }
default: {
reader.skipType(tag & 7) reader.skipType(tag & 7)
break break
}
} }
} }
@ -278,13 +288,13 @@ export namespace RateLimitProof {
} }
}, (reader, length) => { }, (reader, length) => {
const obj: any = { const obj: any = {
proof: new Uint8Array(0), proof: uint8ArrayAlloc(0),
merkleRoot: new Uint8Array(0), merkleRoot: uint8ArrayAlloc(0),
epoch: new Uint8Array(0), epoch: uint8ArrayAlloc(0),
shareX: new Uint8Array(0), shareX: uint8ArrayAlloc(0),
shareY: new Uint8Array(0), shareY: uint8ArrayAlloc(0),
nullifier: new Uint8Array(0), nullifier: uint8ArrayAlloc(0),
rlnIdentifier: new Uint8Array(0) rlnIdentifier: uint8ArrayAlloc(0)
} }
const end = length == null ? reader.len : reader.pos + length const end = length == null ? reader.len : reader.pos + length
@ -293,30 +303,38 @@ export namespace RateLimitProof {
const tag = reader.uint32() const tag = reader.uint32()
switch (tag >>> 3) { switch (tag >>> 3) {
case 1: case 1: {
obj.proof = reader.bytes() obj.proof = reader.bytes()
break break
case 2: }
case 2: {
obj.merkleRoot = reader.bytes() obj.merkleRoot = reader.bytes()
break break
case 3: }
case 3: {
obj.epoch = reader.bytes() obj.epoch = reader.bytes()
break break
case 4: }
case 4: {
obj.shareX = reader.bytes() obj.shareX = reader.bytes()
break break
case 5: }
case 5: {
obj.shareY = reader.bytes() obj.shareY = reader.bytes()
break break
case 6: }
case 6: {
obj.nullifier = reader.bytes() obj.nullifier = reader.bytes()
break break
case 7: }
case 7: {
obj.rlnIdentifier = reader.bytes() obj.rlnIdentifier = reader.bytes()
break break
default: }
default: {
reader.skipType(tag & 7) reader.skipType(tag & 7)
break break
}
} }
} }
@ -396,7 +414,7 @@ export namespace WakuMessage {
} }
}, (reader, length) => { }, (reader, length) => {
const obj: any = { const obj: any = {
payload: new Uint8Array(0), payload: uint8ArrayAlloc(0),
contentTopic: '' contentTopic: ''
} }
@ -406,30 +424,38 @@ export namespace WakuMessage {
const tag = reader.uint32() const tag = reader.uint32()
switch (tag >>> 3) { switch (tag >>> 3) {
case 1: case 1: {
obj.payload = reader.bytes() obj.payload = reader.bytes()
break break
case 2: }
case 2: {
obj.contentTopic = reader.string() obj.contentTopic = reader.string()
break break
case 3: }
case 3: {
obj.version = reader.uint32() obj.version = reader.uint32()
break break
case 10: }
case 10: {
obj.timestamp = reader.sint64() obj.timestamp = reader.sint64()
break break
case 11: }
case 11: {
obj.meta = reader.bytes() obj.meta = reader.bytes()
break break
case 21: }
case 21: {
obj.rateLimitProof = RateLimitProof.codec().decode(reader, reader.uint32()) obj.rateLimitProof = RateLimitProof.codec().decode(reader, reader.uint32())
break break
case 31: }
case 31: {
obj.ephemeral = reader.bool() obj.ephemeral = reader.bool()
break break
default: }
default: {
reader.skipType(tag & 7) reader.skipType(tag & 7)
break break
}
} }
} }

View File

@ -4,8 +4,8 @@
/* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */ /* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */
/* eslint-disable @typescript-eslint/no-empty-interface */ /* eslint-disable @typescript-eslint/no-empty-interface */
import { encodeMessage, decodeMessage, message } from 'protons-runtime' import { type Codec, decodeMessage, encodeMessage, message } from 'protons-runtime'
import type { Codec } from 'protons-runtime' import { alloc as uint8ArrayAlloc } from 'uint8arrays/alloc'
import type { Uint8ArrayList } from 'uint8arraylist' import type { Uint8ArrayList } from 'uint8arraylist'
export interface RateLimitProof { export interface RateLimitProof {
@ -68,13 +68,13 @@ export namespace RateLimitProof {
} }
}, (reader, length) => { }, (reader, length) => {
const obj: any = { const obj: any = {
proof: new Uint8Array(0), proof: uint8ArrayAlloc(0),
merkleRoot: new Uint8Array(0), merkleRoot: uint8ArrayAlloc(0),
epoch: new Uint8Array(0), epoch: uint8ArrayAlloc(0),
shareX: new Uint8Array(0), shareX: uint8ArrayAlloc(0),
shareY: new Uint8Array(0), shareY: uint8ArrayAlloc(0),
nullifier: new Uint8Array(0), nullifier: uint8ArrayAlloc(0),
rlnIdentifier: new Uint8Array(0) rlnIdentifier: uint8ArrayAlloc(0)
} }
const end = length == null ? reader.len : reader.pos + length const end = length == null ? reader.len : reader.pos + length
@ -83,30 +83,38 @@ export namespace RateLimitProof {
const tag = reader.uint32() const tag = reader.uint32()
switch (tag >>> 3) { switch (tag >>> 3) {
case 1: case 1: {
obj.proof = reader.bytes() obj.proof = reader.bytes()
break break
case 2: }
case 2: {
obj.merkleRoot = reader.bytes() obj.merkleRoot = reader.bytes()
break break
case 3: }
case 3: {
obj.epoch = reader.bytes() obj.epoch = reader.bytes()
break break
case 4: }
case 4: {
obj.shareX = reader.bytes() obj.shareX = reader.bytes()
break break
case 5: }
case 5: {
obj.shareY = reader.bytes() obj.shareY = reader.bytes()
break break
case 6: }
case 6: {
obj.nullifier = reader.bytes() obj.nullifier = reader.bytes()
break break
case 7: }
case 7: {
obj.rlnIdentifier = reader.bytes() obj.rlnIdentifier = reader.bytes()
break break
default: }
default: {
reader.skipType(tag & 7) reader.skipType(tag & 7)
break break
}
} }
} }
@ -186,7 +194,7 @@ export namespace WakuMessage {
} }
}, (reader, length) => { }, (reader, length) => {
const obj: any = { const obj: any = {
payload: new Uint8Array(0), payload: uint8ArrayAlloc(0),
contentTopic: '' contentTopic: ''
} }
@ -196,30 +204,38 @@ export namespace WakuMessage {
const tag = reader.uint32() const tag = reader.uint32()
switch (tag >>> 3) { switch (tag >>> 3) {
case 1: case 1: {
obj.payload = reader.bytes() obj.payload = reader.bytes()
break break
case 2: }
case 2: {
obj.contentTopic = reader.string() obj.contentTopic = reader.string()
break break
case 3: }
case 3: {
obj.version = reader.uint32() obj.version = reader.uint32()
break break
case 10: }
case 10: {
obj.timestamp = reader.sint64() obj.timestamp = reader.sint64()
break break
case 11: }
case 11: {
obj.meta = reader.bytes() obj.meta = reader.bytes()
break break
case 21: }
case 21: {
obj.rateLimitProof = RateLimitProof.codec().decode(reader, reader.uint32()) obj.rateLimitProof = RateLimitProof.codec().decode(reader, reader.uint32())
break break
case 31: }
case 31: {
obj.ephemeral = reader.bool() obj.ephemeral = reader.bool()
break break
default: }
default: {
reader.skipType(tag & 7) reader.skipType(tag & 7)
break break
}
} }
} }

View File

@ -4,8 +4,7 @@
/* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */ /* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */
/* eslint-disable @typescript-eslint/no-empty-interface */ /* eslint-disable @typescript-eslint/no-empty-interface */
import { encodeMessage, decodeMessage, message } from 'protons-runtime' import { type Codec, decodeMessage, encodeMessage, message } from 'protons-runtime'
import type { Codec } from 'protons-runtime'
import type { Uint8ArrayList } from 'uint8arraylist' import type { Uint8ArrayList } from 'uint8arraylist'
export interface WakuMetadataRequest { export interface WakuMetadataRequest {
@ -49,15 +48,18 @@ export namespace WakuMetadataRequest {
const tag = reader.uint32() const tag = reader.uint32()
switch (tag >>> 3) { switch (tag >>> 3) {
case 1: case 1: {
obj.clusterId = reader.uint32() obj.clusterId = reader.uint32()
break break
case 2: }
case 2: {
obj.shards.push(reader.uint32()) obj.shards.push(reader.uint32())
break break
default: }
default: {
reader.skipType(tag & 7) reader.skipType(tag & 7)
break break
}
} }
} }
@ -118,15 +120,18 @@ export namespace WakuMetadataResponse {
const tag = reader.uint32() const tag = reader.uint32()
switch (tag >>> 3) { switch (tag >>> 3) {
case 1: case 1: {
obj.clusterId = reader.uint32() obj.clusterId = reader.uint32()
break break
case 2: }
case 2: {
obj.shards.push(reader.uint32()) obj.shards.push(reader.uint32())
break break
default: }
default: {
reader.skipType(tag & 7) reader.skipType(tag & 7)
break break
}
} }
} }

View File

@ -4,8 +4,7 @@
/* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */ /* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */
/* eslint-disable @typescript-eslint/no-empty-interface */ /* eslint-disable @typescript-eslint/no-empty-interface */
import { encodeMessage, decodeMessage, message } from 'protons-runtime' import { type Codec, decodeMessage, encodeMessage, message } from 'protons-runtime'
import type { Codec } from 'protons-runtime'
import type { Uint8ArrayList } from 'uint8arraylist' import type { Uint8ArrayList } from 'uint8arraylist'
export interface PeerInfo { export interface PeerInfo {
@ -39,12 +38,14 @@ export namespace PeerInfo {
const tag = reader.uint32() const tag = reader.uint32()
switch (tag >>> 3) { switch (tag >>> 3) {
case 1: case 1: {
obj.enr = reader.bytes() obj.enr = reader.bytes()
break break
default: }
default: {
reader.skipType(tag & 7) reader.skipType(tag & 7)
break break
}
} }
} }
@ -95,12 +96,14 @@ export namespace PeerExchangeQuery {
const tag = reader.uint32() const tag = reader.uint32()
switch (tag >>> 3) { switch (tag >>> 3) {
case 1: case 1: {
obj.numPeers = reader.uint64() obj.numPeers = reader.uint64()
break break
default: }
default: {
reader.skipType(tag & 7) reader.skipType(tag & 7)
break break
}
} }
} }
@ -155,12 +158,14 @@ export namespace PeerExchangeResponse {
const tag = reader.uint32() const tag = reader.uint32()
switch (tag >>> 3) { switch (tag >>> 3) {
case 1: case 1: {
obj.peerInfos.push(PeerInfo.codec().decode(reader, reader.uint32())) obj.peerInfos.push(PeerInfo.codec().decode(reader, reader.uint32()))
break break
default: }
default: {
reader.skipType(tag & 7) reader.skipType(tag & 7)
break break
}
} }
} }
@ -217,15 +222,18 @@ export namespace PeerExchangeRPC {
const tag = reader.uint32() const tag = reader.uint32()
switch (tag >>> 3) { switch (tag >>> 3) {
case 1: case 1: {
obj.query = PeerExchangeQuery.codec().decode(reader, reader.uint32()) obj.query = PeerExchangeQuery.codec().decode(reader, reader.uint32())
break break
case 2: }
case 2: {
obj.response = PeerExchangeResponse.codec().decode(reader, reader.uint32()) obj.response = PeerExchangeResponse.codec().decode(reader, reader.uint32())
break break
default: }
default: {
reader.skipType(tag & 7) reader.skipType(tag & 7)
break break
}
} }
} }

View File

@ -4,8 +4,8 @@
/* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */ /* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */
/* eslint-disable @typescript-eslint/no-empty-interface */ /* eslint-disable @typescript-eslint/no-empty-interface */
import { encodeMessage, decodeMessage, message, enumeration } from 'protons-runtime' import { type Codec, decodeMessage, encodeMessage, enumeration, message } from 'protons-runtime'
import type { Codec } from 'protons-runtime' import { alloc as uint8ArrayAlloc } from 'uint8arrays/alloc'
import type { Uint8ArrayList } from 'uint8arraylist' import type { Uint8ArrayList } from 'uint8arraylist'
export interface Index { export interface Index {
@ -50,7 +50,7 @@ export namespace Index {
} }
}, (reader, length) => { }, (reader, length) => {
const obj: any = { const obj: any = {
digest: new Uint8Array(0), digest: uint8ArrayAlloc(0),
receiverTime: 0n, receiverTime: 0n,
senderTime: 0n, senderTime: 0n,
pubsubTopic: '' pubsubTopic: ''
@ -62,21 +62,26 @@ export namespace Index {
const tag = reader.uint32() const tag = reader.uint32()
switch (tag >>> 3) { switch (tag >>> 3) {
case 1: case 1: {
obj.digest = reader.bytes() obj.digest = reader.bytes()
break break
case 2: }
case 2: {
obj.receiverTime = reader.sint64() obj.receiverTime = reader.sint64()
break break
case 3: }
case 3: {
obj.senderTime = reader.sint64() obj.senderTime = reader.sint64()
break break
case 4: }
case 4: {
obj.pubsubTopic = reader.string() obj.pubsubTopic = reader.string()
break break
default: }
default: {
reader.skipType(tag & 7) reader.skipType(tag & 7)
break break
}
} }
} }
@ -155,18 +160,22 @@ export namespace PagingInfo {
const tag = reader.uint32() const tag = reader.uint32()
switch (tag >>> 3) { switch (tag >>> 3) {
case 1: case 1: {
obj.pageSize = reader.uint64() obj.pageSize = reader.uint64()
break break
case 2: }
case 2: {
obj.cursor = Index.codec().decode(reader, reader.uint32()) obj.cursor = Index.codec().decode(reader, reader.uint32())
break break
case 3: }
case 3: {
obj.direction = PagingInfo.Direction.codec().decode(reader) obj.direction = PagingInfo.Direction.codec().decode(reader)
break break
default: }
default: {
reader.skipType(tag & 7) reader.skipType(tag & 7)
break break
}
} }
} }
@ -219,12 +228,14 @@ export namespace ContentFilter {
const tag = reader.uint32() const tag = reader.uint32()
switch (tag >>> 3) { switch (tag >>> 3) {
case 1: case 1: {
obj.contentTopic = reader.string() obj.contentTopic = reader.string()
break break
default: }
default: {
reader.skipType(tag & 7) reader.skipType(tag & 7)
break break
}
} }
} }
@ -303,24 +314,30 @@ export namespace HistoryQuery {
const tag = reader.uint32() const tag = reader.uint32()
switch (tag >>> 3) { switch (tag >>> 3) {
case 2: case 2: {
obj.pubsubTopic = reader.string() obj.pubsubTopic = reader.string()
break break
case 3: }
case 3: {
obj.contentFilters.push(ContentFilter.codec().decode(reader, reader.uint32())) obj.contentFilters.push(ContentFilter.codec().decode(reader, reader.uint32()))
break break
case 4: }
case 4: {
obj.pagingInfo = PagingInfo.codec().decode(reader, reader.uint32()) obj.pagingInfo = PagingInfo.codec().decode(reader, reader.uint32())
break break
case 5: }
case 5: {
obj.startTime = reader.sint64() obj.startTime = reader.sint64()
break break
case 6: }
case 6: {
obj.endTime = reader.sint64() obj.endTime = reader.sint64()
break break
default: }
default: {
reader.skipType(tag & 7) reader.skipType(tag & 7)
break break
}
} }
} }
@ -404,18 +421,22 @@ export namespace HistoryResponse {
const tag = reader.uint32() const tag = reader.uint32()
switch (tag >>> 3) { switch (tag >>> 3) {
case 2: case 2: {
obj.messages.push(WakuMessage.codec().decode(reader, reader.uint32())) obj.messages.push(WakuMessage.codec().decode(reader, reader.uint32()))
break break
case 3: }
case 3: {
obj.pagingInfo = PagingInfo.codec().decode(reader, reader.uint32()) obj.pagingInfo = PagingInfo.codec().decode(reader, reader.uint32())
break break
case 4: }
case 4: {
obj.error = HistoryResponse.HistoryError.codec().decode(reader) obj.error = HistoryResponse.HistoryError.codec().decode(reader)
break break
default: }
default: {
reader.skipType(tag & 7) reader.skipType(tag & 7)
break break
}
} }
} }
@ -480,18 +501,22 @@ export namespace HistoryRpc {
const tag = reader.uint32() const tag = reader.uint32()
switch (tag >>> 3) { switch (tag >>> 3) {
case 1: case 1: {
obj.requestId = reader.string() obj.requestId = reader.string()
break break
case 2: }
case 2: {
obj.query = HistoryQuery.codec().decode(reader, reader.uint32()) obj.query = HistoryQuery.codec().decode(reader, reader.uint32())
break break
case 3: }
case 3: {
obj.response = HistoryResponse.codec().decode(reader, reader.uint32()) obj.response = HistoryResponse.codec().decode(reader, reader.uint32())
break break
default: }
default: {
reader.skipType(tag & 7) reader.skipType(tag & 7)
break break
}
} }
} }
@ -571,13 +596,13 @@ export namespace RateLimitProof {
} }
}, (reader, length) => { }, (reader, length) => {
const obj: any = { const obj: any = {
proof: new Uint8Array(0), proof: uint8ArrayAlloc(0),
merkleRoot: new Uint8Array(0), merkleRoot: uint8ArrayAlloc(0),
epoch: new Uint8Array(0), epoch: uint8ArrayAlloc(0),
shareX: new Uint8Array(0), shareX: uint8ArrayAlloc(0),
shareY: new Uint8Array(0), shareY: uint8ArrayAlloc(0),
nullifier: new Uint8Array(0), nullifier: uint8ArrayAlloc(0),
rlnIdentifier: new Uint8Array(0) rlnIdentifier: uint8ArrayAlloc(0)
} }
const end = length == null ? reader.len : reader.pos + length const end = length == null ? reader.len : reader.pos + length
@ -586,30 +611,38 @@ export namespace RateLimitProof {
const tag = reader.uint32() const tag = reader.uint32()
switch (tag >>> 3) { switch (tag >>> 3) {
case 1: case 1: {
obj.proof = reader.bytes() obj.proof = reader.bytes()
break break
case 2: }
case 2: {
obj.merkleRoot = reader.bytes() obj.merkleRoot = reader.bytes()
break break
case 3: }
case 3: {
obj.epoch = reader.bytes() obj.epoch = reader.bytes()
break break
case 4: }
case 4: {
obj.shareX = reader.bytes() obj.shareX = reader.bytes()
break break
case 5: }
case 5: {
obj.shareY = reader.bytes() obj.shareY = reader.bytes()
break break
case 6: }
case 6: {
obj.nullifier = reader.bytes() obj.nullifier = reader.bytes()
break break
case 7: }
case 7: {
obj.rlnIdentifier = reader.bytes() obj.rlnIdentifier = reader.bytes()
break break
default: }
default: {
reader.skipType(tag & 7) reader.skipType(tag & 7)
break break
}
} }
} }
@ -689,7 +722,7 @@ export namespace WakuMessage {
} }
}, (reader, length) => { }, (reader, length) => {
const obj: any = { const obj: any = {
payload: new Uint8Array(0), payload: uint8ArrayAlloc(0),
contentTopic: '' contentTopic: ''
} }
@ -699,30 +732,38 @@ export namespace WakuMessage {
const tag = reader.uint32() const tag = reader.uint32()
switch (tag >>> 3) { switch (tag >>> 3) {
case 1: case 1: {
obj.payload = reader.bytes() obj.payload = reader.bytes()
break break
case 2: }
case 2: {
obj.contentTopic = reader.string() obj.contentTopic = reader.string()
break break
case 3: }
case 3: {
obj.version = reader.uint32() obj.version = reader.uint32()
break break
case 10: }
case 10: {
obj.timestamp = reader.sint64() obj.timestamp = reader.sint64()
break break
case 11: }
case 11: {
obj.meta = reader.bytes() obj.meta = reader.bytes()
break break
case 21: }
case 21: {
obj.rateLimitProof = RateLimitProof.codec().decode(reader, reader.uint32()) obj.rateLimitProof = RateLimitProof.codec().decode(reader, reader.uint32())
break break
case 31: }
case 31: {
obj.ephemeral = reader.bool() obj.ephemeral = reader.bool()
break break
default: }
default: {
reader.skipType(tag & 7) reader.skipType(tag & 7)
break break
}
} }
} }

View File

@ -4,8 +4,7 @@
/* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */ /* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */
/* eslint-disable @typescript-eslint/no-empty-interface */ /* eslint-disable @typescript-eslint/no-empty-interface */
import { encodeMessage, decodeMessage, message } from 'protons-runtime' import { type Codec, decodeMessage, encodeMessage, message } from 'protons-runtime'
import type { Codec } from 'protons-runtime'
import type { Uint8ArrayList } from 'uint8arraylist' import type { Uint8ArrayList } from 'uint8arraylist'
export interface TopicOnlyMessage { export interface TopicOnlyMessage {
@ -41,12 +40,14 @@ export namespace TopicOnlyMessage {
const tag = reader.uint32() const tag = reader.uint32()
switch (tag >>> 3) { switch (tag >>> 3) {
case 2: case 2: {
obj.contentTopic = reader.string() obj.contentTopic = reader.string()
break break
default: }
default: {
reader.skipType(tag & 7) reader.skipType(tag & 7)
break break
}
} }
} }