@xmtp/proto
Version:
Protobuf client and generated classes for GRPC API
67 lines (66 loc) • 2 kB
JavaScript
// 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
/* eslint-disable */
import Long from "long";
import _m0 from "protobufjs/minimal";
export const protobufPackage = "xmtp.identity";
function createBaseMlsCredential() {
return { inboxId: "" };
}
export const MlsCredential = {
encode(message, writer = _m0.Writer.create()) {
if (message.inboxId !== "") {
writer.uint32(10).string(message.inboxId);
}
return writer;
},
decode(input, length) {
const reader = input instanceof _m0.Reader ? input : _m0.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 MlsCredential.fromPartial(base ?? {});
},
fromPartial(object) {
const message = createBaseMlsCredential();
message.inboxId = object.inboxId ?? "";
return message;
},
};
if (_m0.util.Long !== Long) {
_m0.util.Long = Long;
_m0.configure();
}
function isSet(value) {
return value !== null && value !== undefined;
}