UNPKG

@xmtp/proto

Version:

Protobuf client and generated classes for GRPC API

73 lines (72 loc) 2.43 kB
"use strict"; // Code generated by protoc-gen-ts_proto. DO NOT EDIT. // versions: // protoc-gen-ts_proto v1.181.2 // protoc v3.21.12 // source: identity/credential.proto var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); exports.MlsCredential = exports.protobufPackage = void 0; /* eslint-disable */ const long_1 = __importDefault(require("long")); const minimal_1 = __importDefault(require("protobufjs/minimal")); exports.protobufPackage = "xmtp.identity"; function createBaseMlsCredential() { return { inboxId: "" }; } exports.MlsCredential = { encode(message, writer = minimal_1.default.Writer.create()) { if (message.inboxId !== "") { writer.uint32(10).string(message.inboxId); } return writer; }, decode(input, length) { const reader = input instanceof minimal_1.default.Reader ? input : minimal_1.default.Reader.create(input); let end = length === undefined ? reader.len : reader.pos + length; const message = createBaseMlsCredential(); while (reader.pos < end) { const tag = reader.uint32(); switch (tag >>> 3) { case 1: if (tag !== 10) { break; } message.inboxId = reader.string(); continue; } if ((tag & 7) === 4 || tag === 0) { break; } reader.skipType(tag & 7); } return message; }, fromJSON(object) { return { inboxId: isSet(object.inboxId) ? globalThis.String(object.inboxId) : "" }; }, toJSON(message) { const obj = {}; if (message.inboxId !== "") { obj.inboxId = message.inboxId; } return obj; }, create(base) { return exports.MlsCredential.fromPartial(base ?? {}); }, fromPartial(object) { const message = createBaseMlsCredential(); message.inboxId = object.inboxId ?? ""; return message; }, }; if (minimal_1.default.util.Long !== long_1.default) { minimal_1.default.util.Long = long_1.default; minimal_1.default.configure(); } function isSet(value) { return value !== null && value !== undefined; }