UNPKG

@xmtp/proto

Version:

Protobuf client and generated classes for GRPC API

110 lines 3.63 kB
/* eslint-disable */ import Long from "long"; import _m0 from "protobufjs/minimal"; export const protobufPackage = "xmtp.mls.message_contents"; function createBaseReaddRequest() { return { groupId: new Uint8Array(), commitLogEpoch: Long.UZERO }; } export const ReaddRequest = { encode(message, writer = _m0.Writer.create()) { if (message.groupId.length !== 0) { writer.uint32(10).bytes(message.groupId); } if (!message.commitLogEpoch.isZero()) { writer.uint32(16).uint64(message.commitLogEpoch); } return writer; }, decode(input, length) { const reader = input instanceof _m0.Reader ? input : new _m0.Reader(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseReaddRequest(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: message.groupId = reader.bytes(); break; case 2: message.commitLogEpoch = reader.uint64(); break; default: reader.skipType(tag & 7); break; } } return message; }, fromJSON(object) { return { groupId: isSet(object.groupId) ? bytesFromBase64(object.groupId) : new Uint8Array(), commitLogEpoch: isSet(object.commitLogEpoch) ? Long.fromValue(object.commitLogEpoch) : Long.UZERO, }; }, toJSON(message) { const obj = {}; message.groupId !== undefined && (obj.groupId = base64FromBytes(message.groupId !== undefined ? message.groupId : new Uint8Array())); message.commitLogEpoch !== undefined && (obj.commitLogEpoch = (message.commitLogEpoch || Long.UZERO).toString()); return obj; }, fromPartial(object) { var _a; const message = createBaseReaddRequest(); message.groupId = (_a = object.groupId) !== null && _a !== void 0 ? _a : new Uint8Array(); message.commitLogEpoch = object.commitLogEpoch !== undefined && object.commitLogEpoch !== null ? Long.fromValue(object.commitLogEpoch) : Long.UZERO; return message; }, }; var globalThis = (() => { if (typeof globalThis !== "undefined") return globalThis; if (typeof self !== "undefined") return self; if (typeof window !== "undefined") return window; if (typeof global !== "undefined") return global; throw "Unable to locate global object"; })(); function bytesFromBase64(b64) { if (globalThis.Buffer) { return Uint8Array.from(globalThis.Buffer.from(b64, "base64")); } else { const bin = globalThis.atob(b64); const arr = new Uint8Array(bin.length); for (let i = 0; i < bin.length; ++i) { arr[i] = bin.charCodeAt(i); } return arr; } } function base64FromBytes(arr) { if (globalThis.Buffer) { return globalThis.Buffer.from(arr).toString("base64"); } else { const bin = []; arr.forEach((byte) => { bin.push(String.fromCharCode(byte)); }); return globalThis.btoa(bin.join("")); } } if (_m0.util.Long !== Long) { _m0.util.Long = Long; _m0.configure(); } function isSet(value) { return value !== null && value !== undefined; } //# sourceMappingURL=out_of_band.pb.js.map