/** * Generated by the protoc-gen-ts. DO NOT EDIT! * compiler version: 3.21.12 * source: txfilter/txfilter.proto * git: https://github.com/thesayyn/protoc-gen-ts */ import * as pb_1 from "google-protobuf"; export namespace txfilter { export class Stat extends pb_1.Message { #one_of_decls: number[][] = []; constructor(data?: any[] | { fp_count?: number; filter_costs?: number; db_costs?: number; }) { super(); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [], this.#one_of_decls); if (!Array.isArray(data) && typeof data == "object") { if ("fp_count" in data && data.fp_count != undefined) { this.fp_count = data.fp_count; } if ("filter_costs" in data && data.filter_costs != undefined) { this.filter_costs = data.filter_costs; } if ("db_costs" in data && data.db_costs != undefined) { this.db_costs = data.db_costs; } } } get fp_count() { return pb_1.Message.getFieldWithDefault(this, 1, 0) as number; } set fp_count(value: number) { pb_1.Message.setField(this, 1, value); } get filter_costs() { return pb_1.Message.getFieldWithDefault(this, 2, 0) as number; } set filter_costs(value: number) { pb_1.Message.setField(this, 2, value); } get db_costs() { return pb_1.Message.getFieldWithDefault(this, 3, 0) as number; } set db_costs(value: number) { pb_1.Message.setField(this, 3, value); } static fromObject(data: { fp_count?: number; filter_costs?: number; db_costs?: number; }): Stat { const message = new Stat({}); if (data.fp_count != null) { message.fp_count = data.fp_count; } if (data.filter_costs != null) { message.filter_costs = data.filter_costs; } if (data.db_costs != null) { message.db_costs = data.db_costs; } return message; } toObject() { const data: { fp_count?: number; filter_costs?: number; db_costs?: number; } = {}; if (this.fp_count != null) { data.fp_count = this.fp_count; } if (this.filter_costs != null) { data.filter_costs = this.filter_costs; } if (this.db_costs != null) { data.db_costs = this.db_costs; } return data; } serialize(): Uint8Array; serialize(w: pb_1.BinaryWriter): void; serialize(w?: pb_1.BinaryWriter): Uint8Array | void { const writer = w || new pb_1.BinaryWriter(); if (this.fp_count != 0) writer.writeUint32(1, this.fp_count); if (this.filter_costs != 0) writer.writeInt64(2, this.filter_costs); if (this.db_costs != 0) writer.writeInt64(3, this.db_costs); if (!w) return writer.getResultBuffer(); } static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Stat { const reader = bytes instanceof pb_1.BinaryReader ? bytes : new pb_1.BinaryReader(bytes), message = new Stat(); while (reader.nextField()) { if (reader.isEndGroup()) break; switch (reader.getFieldNumber()) { case 1: message.fp_count = reader.readUint32(); break; case 2: message.filter_costs = reader.readInt64(); break; case 3: message.db_costs = reader.readInt64(); break; default: reader.skipField(); } } return message; } serializeBinary(): Uint8Array { return this.serialize(); } static deserializeBinary(bytes: Uint8Array): Stat { return Stat.deserialize(bytes); } } }