@xmtp/proto
Advanced tools
Comparing version 3.0.0 to 3.1.0
{ | ||
"name": "@xmtp/proto", | ||
"version": "3.0.0", | ||
"version": "3.1.0", | ||
"description": "Protobuf client and generated classes for GRPC API", | ||
@@ -5,0 +5,0 @@ "main": "./ts/dist/cjs/node.js", |
@@ -6,3 +6,3 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.EncryptedPrivateKeyBundle = exports.EncryptedPrivateKeyBundleV1 = exports.PrivateKeyBundle = exports.PrivateKeyBundleV1 = exports.PrivateKey_Secp256k1 = exports.PrivateKey = exports.protobufPackage = void 0; | ||
exports.EncryptedPrivateKeyBundle = exports.EncryptedPrivateKeyBundleV1 = exports.PrivateKeyBundle = exports.PrivateKeyBundleV2 = exports.SignedPrivateKey_Secp256k1 = exports.SignedPrivateKey = exports.PrivateKeyBundleV1 = exports.PrivateKey_Secp256k1 = exports.PrivateKey = exports.protobufPackage = void 0; | ||
/* eslint-disable */ | ||
@@ -213,4 +213,203 @@ const long_1 = __importDefault(require("long")); | ||
}; | ||
function createBaseSignedPrivateKey() { | ||
return { createdNs: long_1.default.UZERO, secp256k1: undefined, publicKey: undefined }; | ||
} | ||
exports.SignedPrivateKey = { | ||
encode(message, writer = minimal_1.default.Writer.create()) { | ||
if (!message.createdNs.isZero()) { | ||
writer.uint32(8).uint64(message.createdNs); | ||
} | ||
if (message.secp256k1 !== undefined) { | ||
exports.SignedPrivateKey_Secp256k1.encode(message.secp256k1, writer.uint32(18).fork()).ldelim(); | ||
} | ||
if (message.publicKey !== undefined) { | ||
public_key_pb_1.SignedPublicKey.encode(message.publicKey, writer.uint32(26).fork()).ldelim(); | ||
} | ||
return writer; | ||
}, | ||
decode(input, length) { | ||
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input); | ||
let end = length === undefined ? reader.len : reader.pos + length; | ||
const message = createBaseSignedPrivateKey(); | ||
while (reader.pos < end) { | ||
const tag = reader.uint32(); | ||
switch (tag >>> 3) { | ||
case 1: | ||
message.createdNs = reader.uint64(); | ||
break; | ||
case 2: | ||
message.secp256k1 = exports.SignedPrivateKey_Secp256k1.decode(reader, reader.uint32()); | ||
break; | ||
case 3: | ||
message.publicKey = public_key_pb_1.SignedPublicKey.decode(reader, reader.uint32()); | ||
break; | ||
default: | ||
reader.skipType(tag & 7); | ||
break; | ||
} | ||
} | ||
return message; | ||
}, | ||
fromJSON(object) { | ||
return { | ||
createdNs: isSet(object.createdNs) | ||
? long_1.default.fromValue(object.createdNs) | ||
: long_1.default.UZERO, | ||
secp256k1: isSet(object.secp256k1) | ||
? exports.SignedPrivateKey_Secp256k1.fromJSON(object.secp256k1) | ||
: undefined, | ||
publicKey: isSet(object.publicKey) | ||
? public_key_pb_1.SignedPublicKey.fromJSON(object.publicKey) | ||
: undefined, | ||
}; | ||
}, | ||
toJSON(message) { | ||
const obj = {}; | ||
message.createdNs !== undefined && | ||
(obj.createdNs = (message.createdNs || long_1.default.UZERO).toString()); | ||
message.secp256k1 !== undefined && | ||
(obj.secp256k1 = message.secp256k1 | ||
? exports.SignedPrivateKey_Secp256k1.toJSON(message.secp256k1) | ||
: undefined); | ||
message.publicKey !== undefined && | ||
(obj.publicKey = message.publicKey | ||
? public_key_pb_1.SignedPublicKey.toJSON(message.publicKey) | ||
: undefined); | ||
return obj; | ||
}, | ||
fromPartial(object) { | ||
const message = createBaseSignedPrivateKey(); | ||
message.createdNs = | ||
object.createdNs !== undefined && object.createdNs !== null | ||
? long_1.default.fromValue(object.createdNs) | ||
: long_1.default.UZERO; | ||
message.secp256k1 = | ||
object.secp256k1 !== undefined && object.secp256k1 !== null | ||
? exports.SignedPrivateKey_Secp256k1.fromPartial(object.secp256k1) | ||
: undefined; | ||
message.publicKey = | ||
object.publicKey !== undefined && object.publicKey !== null | ||
? public_key_pb_1.SignedPublicKey.fromPartial(object.publicKey) | ||
: undefined; | ||
return message; | ||
}, | ||
}; | ||
function createBaseSignedPrivateKey_Secp256k1() { | ||
return { bytes: new Uint8Array() }; | ||
} | ||
exports.SignedPrivateKey_Secp256k1 = { | ||
encode(message, writer = minimal_1.default.Writer.create()) { | ||
if (message.bytes.length !== 0) { | ||
writer.uint32(10).bytes(message.bytes); | ||
} | ||
return writer; | ||
}, | ||
decode(input, length) { | ||
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input); | ||
let end = length === undefined ? reader.len : reader.pos + length; | ||
const message = createBaseSignedPrivateKey_Secp256k1(); | ||
while (reader.pos < end) { | ||
const tag = reader.uint32(); | ||
switch (tag >>> 3) { | ||
case 1: | ||
message.bytes = reader.bytes(); | ||
break; | ||
default: | ||
reader.skipType(tag & 7); | ||
break; | ||
} | ||
} | ||
return message; | ||
}, | ||
fromJSON(object) { | ||
return { | ||
bytes: isSet(object.bytes) | ||
? bytesFromBase64(object.bytes) | ||
: new Uint8Array(), | ||
}; | ||
}, | ||
toJSON(message) { | ||
const obj = {}; | ||
message.bytes !== undefined && | ||
(obj.bytes = base64FromBytes(message.bytes !== undefined ? message.bytes : new Uint8Array())); | ||
return obj; | ||
}, | ||
fromPartial(object) { | ||
var _a; | ||
const message = createBaseSignedPrivateKey_Secp256k1(); | ||
message.bytes = (_a = object.bytes) !== null && _a !== void 0 ? _a : new Uint8Array(); | ||
return message; | ||
}, | ||
}; | ||
function createBasePrivateKeyBundleV2() { | ||
return { identityKey: undefined, preKeys: [] }; | ||
} | ||
exports.PrivateKeyBundleV2 = { | ||
encode(message, writer = minimal_1.default.Writer.create()) { | ||
if (message.identityKey !== undefined) { | ||
exports.SignedPrivateKey.encode(message.identityKey, writer.uint32(10).fork()).ldelim(); | ||
} | ||
for (const v of message.preKeys) { | ||
exports.SignedPrivateKey.encode(v, writer.uint32(18).fork()).ldelim(); | ||
} | ||
return writer; | ||
}, | ||
decode(input, length) { | ||
const reader = input instanceof minimal_1.default.Reader ? input : new minimal_1.default.Reader(input); | ||
let end = length === undefined ? reader.len : reader.pos + length; | ||
const message = createBasePrivateKeyBundleV2(); | ||
while (reader.pos < end) { | ||
const tag = reader.uint32(); | ||
switch (tag >>> 3) { | ||
case 1: | ||
message.identityKey = exports.SignedPrivateKey.decode(reader, reader.uint32()); | ||
break; | ||
case 2: | ||
message.preKeys.push(exports.SignedPrivateKey.decode(reader, reader.uint32())); | ||
break; | ||
default: | ||
reader.skipType(tag & 7); | ||
break; | ||
} | ||
} | ||
return message; | ||
}, | ||
fromJSON(object) { | ||
return { | ||
identityKey: isSet(object.identityKey) | ||
? exports.SignedPrivateKey.fromJSON(object.identityKey) | ||
: undefined, | ||
preKeys: Array.isArray(object === null || object === void 0 ? void 0 : object.preKeys) | ||
? object.preKeys.map((e) => exports.SignedPrivateKey.fromJSON(e)) | ||
: [], | ||
}; | ||
}, | ||
toJSON(message) { | ||
const obj = {}; | ||
message.identityKey !== undefined && | ||
(obj.identityKey = message.identityKey | ||
? exports.SignedPrivateKey.toJSON(message.identityKey) | ||
: undefined); | ||
if (message.preKeys) { | ||
obj.preKeys = message.preKeys.map((e) => e ? exports.SignedPrivateKey.toJSON(e) : undefined); | ||
} | ||
else { | ||
obj.preKeys = []; | ||
} | ||
return obj; | ||
}, | ||
fromPartial(object) { | ||
var _a; | ||
const message = createBasePrivateKeyBundleV2(); | ||
message.identityKey = | ||
object.identityKey !== undefined && object.identityKey !== null | ||
? exports.SignedPrivateKey.fromPartial(object.identityKey) | ||
: undefined; | ||
message.preKeys = | ||
((_a = object.preKeys) === null || _a === void 0 ? void 0 : _a.map((e) => exports.SignedPrivateKey.fromPartial(e))) || []; | ||
return message; | ||
}, | ||
}; | ||
function createBasePrivateKeyBundle() { | ||
return { v1: undefined }; | ||
return { v1: undefined, v2: undefined }; | ||
} | ||
@@ -222,2 +421,5 @@ exports.PrivateKeyBundle = { | ||
} | ||
if (message.v2 !== undefined) { | ||
exports.PrivateKeyBundleV2.encode(message.v2, writer.uint32(18).fork()).ldelim(); | ||
} | ||
return writer; | ||
@@ -235,2 +437,5 @@ }, | ||
break; | ||
case 2: | ||
message.v2 = exports.PrivateKeyBundleV2.decode(reader, reader.uint32()); | ||
break; | ||
default: | ||
@@ -246,2 +451,3 @@ reader.skipType(tag & 7); | ||
v1: isSet(object.v1) ? exports.PrivateKeyBundleV1.fromJSON(object.v1) : undefined, | ||
v2: isSet(object.v2) ? exports.PrivateKeyBundleV2.fromJSON(object.v2) : undefined, | ||
}; | ||
@@ -253,2 +459,4 @@ }, | ||
(obj.v1 = message.v1 ? exports.PrivateKeyBundleV1.toJSON(message.v1) : undefined); | ||
message.v2 !== undefined && | ||
(obj.v2 = message.v2 ? exports.PrivateKeyBundleV2.toJSON(message.v2) : undefined); | ||
return obj; | ||
@@ -262,2 +470,6 @@ }, | ||
: undefined; | ||
message.v2 = | ||
object.v2 !== undefined && object.v2 !== null | ||
? exports.PrivateKeyBundleV2.fromPartial(object.v2) | ||
: undefined; | ||
return message; | ||
@@ -264,0 +476,0 @@ }, |
/* eslint-disable */ | ||
import Long from "long"; | ||
import { PublicKey } from "./public_key.pb"; | ||
import { PublicKey, SignedPublicKey } from "./public_key.pb"; | ||
import { Ciphertext } from "./ciphertext.pb"; | ||
@@ -206,4 +206,203 @@ import _m0 from "protobufjs/minimal"; | ||
}; | ||
function createBaseSignedPrivateKey() { | ||
return { createdNs: Long.UZERO, secp256k1: undefined, publicKey: undefined }; | ||
} | ||
export const SignedPrivateKey = { | ||
encode(message, writer = _m0.Writer.create()) { | ||
if (!message.createdNs.isZero()) { | ||
writer.uint32(8).uint64(message.createdNs); | ||
} | ||
if (message.secp256k1 !== undefined) { | ||
SignedPrivateKey_Secp256k1.encode(message.secp256k1, writer.uint32(18).fork()).ldelim(); | ||
} | ||
if (message.publicKey !== undefined) { | ||
SignedPublicKey.encode(message.publicKey, writer.uint32(26).fork()).ldelim(); | ||
} | ||
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 = createBaseSignedPrivateKey(); | ||
while (reader.pos < end) { | ||
const tag = reader.uint32(); | ||
switch (tag >>> 3) { | ||
case 1: | ||
message.createdNs = reader.uint64(); | ||
break; | ||
case 2: | ||
message.secp256k1 = SignedPrivateKey_Secp256k1.decode(reader, reader.uint32()); | ||
break; | ||
case 3: | ||
message.publicKey = SignedPublicKey.decode(reader, reader.uint32()); | ||
break; | ||
default: | ||
reader.skipType(tag & 7); | ||
break; | ||
} | ||
} | ||
return message; | ||
}, | ||
fromJSON(object) { | ||
return { | ||
createdNs: isSet(object.createdNs) | ||
? Long.fromValue(object.createdNs) | ||
: Long.UZERO, | ||
secp256k1: isSet(object.secp256k1) | ||
? SignedPrivateKey_Secp256k1.fromJSON(object.secp256k1) | ||
: undefined, | ||
publicKey: isSet(object.publicKey) | ||
? SignedPublicKey.fromJSON(object.publicKey) | ||
: undefined, | ||
}; | ||
}, | ||
toJSON(message) { | ||
const obj = {}; | ||
message.createdNs !== undefined && | ||
(obj.createdNs = (message.createdNs || Long.UZERO).toString()); | ||
message.secp256k1 !== undefined && | ||
(obj.secp256k1 = message.secp256k1 | ||
? SignedPrivateKey_Secp256k1.toJSON(message.secp256k1) | ||
: undefined); | ||
message.publicKey !== undefined && | ||
(obj.publicKey = message.publicKey | ||
? SignedPublicKey.toJSON(message.publicKey) | ||
: undefined); | ||
return obj; | ||
}, | ||
fromPartial(object) { | ||
const message = createBaseSignedPrivateKey(); | ||
message.createdNs = | ||
object.createdNs !== undefined && object.createdNs !== null | ||
? Long.fromValue(object.createdNs) | ||
: Long.UZERO; | ||
message.secp256k1 = | ||
object.secp256k1 !== undefined && object.secp256k1 !== null | ||
? SignedPrivateKey_Secp256k1.fromPartial(object.secp256k1) | ||
: undefined; | ||
message.publicKey = | ||
object.publicKey !== undefined && object.publicKey !== null | ||
? SignedPublicKey.fromPartial(object.publicKey) | ||
: undefined; | ||
return message; | ||
}, | ||
}; | ||
function createBaseSignedPrivateKey_Secp256k1() { | ||
return { bytes: new Uint8Array() }; | ||
} | ||
export const SignedPrivateKey_Secp256k1 = { | ||
encode(message, writer = _m0.Writer.create()) { | ||
if (message.bytes.length !== 0) { | ||
writer.uint32(10).bytes(message.bytes); | ||
} | ||
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 = createBaseSignedPrivateKey_Secp256k1(); | ||
while (reader.pos < end) { | ||
const tag = reader.uint32(); | ||
switch (tag >>> 3) { | ||
case 1: | ||
message.bytes = reader.bytes(); | ||
break; | ||
default: | ||
reader.skipType(tag & 7); | ||
break; | ||
} | ||
} | ||
return message; | ||
}, | ||
fromJSON(object) { | ||
return { | ||
bytes: isSet(object.bytes) | ||
? bytesFromBase64(object.bytes) | ||
: new Uint8Array(), | ||
}; | ||
}, | ||
toJSON(message) { | ||
const obj = {}; | ||
message.bytes !== undefined && | ||
(obj.bytes = base64FromBytes(message.bytes !== undefined ? message.bytes : new Uint8Array())); | ||
return obj; | ||
}, | ||
fromPartial(object) { | ||
var _a; | ||
const message = createBaseSignedPrivateKey_Secp256k1(); | ||
message.bytes = (_a = object.bytes) !== null && _a !== void 0 ? _a : new Uint8Array(); | ||
return message; | ||
}, | ||
}; | ||
function createBasePrivateKeyBundleV2() { | ||
return { identityKey: undefined, preKeys: [] }; | ||
} | ||
export const PrivateKeyBundleV2 = { | ||
encode(message, writer = _m0.Writer.create()) { | ||
if (message.identityKey !== undefined) { | ||
SignedPrivateKey.encode(message.identityKey, writer.uint32(10).fork()).ldelim(); | ||
} | ||
for (const v of message.preKeys) { | ||
SignedPrivateKey.encode(v, writer.uint32(18).fork()).ldelim(); | ||
} | ||
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 = createBasePrivateKeyBundleV2(); | ||
while (reader.pos < end) { | ||
const tag = reader.uint32(); | ||
switch (tag >>> 3) { | ||
case 1: | ||
message.identityKey = SignedPrivateKey.decode(reader, reader.uint32()); | ||
break; | ||
case 2: | ||
message.preKeys.push(SignedPrivateKey.decode(reader, reader.uint32())); | ||
break; | ||
default: | ||
reader.skipType(tag & 7); | ||
break; | ||
} | ||
} | ||
return message; | ||
}, | ||
fromJSON(object) { | ||
return { | ||
identityKey: isSet(object.identityKey) | ||
? SignedPrivateKey.fromJSON(object.identityKey) | ||
: undefined, | ||
preKeys: Array.isArray(object === null || object === void 0 ? void 0 : object.preKeys) | ||
? object.preKeys.map((e) => SignedPrivateKey.fromJSON(e)) | ||
: [], | ||
}; | ||
}, | ||
toJSON(message) { | ||
const obj = {}; | ||
message.identityKey !== undefined && | ||
(obj.identityKey = message.identityKey | ||
? SignedPrivateKey.toJSON(message.identityKey) | ||
: undefined); | ||
if (message.preKeys) { | ||
obj.preKeys = message.preKeys.map((e) => e ? SignedPrivateKey.toJSON(e) : undefined); | ||
} | ||
else { | ||
obj.preKeys = []; | ||
} | ||
return obj; | ||
}, | ||
fromPartial(object) { | ||
var _a; | ||
const message = createBasePrivateKeyBundleV2(); | ||
message.identityKey = | ||
object.identityKey !== undefined && object.identityKey !== null | ||
? SignedPrivateKey.fromPartial(object.identityKey) | ||
: undefined; | ||
message.preKeys = | ||
((_a = object.preKeys) === null || _a === void 0 ? void 0 : _a.map((e) => SignedPrivateKey.fromPartial(e))) || []; | ||
return message; | ||
}, | ||
}; | ||
function createBasePrivateKeyBundle() { | ||
return { v1: undefined }; | ||
return { v1: undefined, v2: undefined }; | ||
} | ||
@@ -215,2 +414,5 @@ export const PrivateKeyBundle = { | ||
} | ||
if (message.v2 !== undefined) { | ||
PrivateKeyBundleV2.encode(message.v2, writer.uint32(18).fork()).ldelim(); | ||
} | ||
return writer; | ||
@@ -228,2 +430,5 @@ }, | ||
break; | ||
case 2: | ||
message.v2 = PrivateKeyBundleV2.decode(reader, reader.uint32()); | ||
break; | ||
default: | ||
@@ -239,2 +444,3 @@ reader.skipType(tag & 7); | ||
v1: isSet(object.v1) ? PrivateKeyBundleV1.fromJSON(object.v1) : undefined, | ||
v2: isSet(object.v2) ? PrivateKeyBundleV2.fromJSON(object.v2) : undefined, | ||
}; | ||
@@ -246,2 +452,4 @@ }, | ||
(obj.v1 = message.v1 ? PrivateKeyBundleV1.toJSON(message.v1) : undefined); | ||
message.v2 !== undefined && | ||
(obj.v2 = message.v2 ? PrivateKeyBundleV2.toJSON(message.v2) : undefined); | ||
return obj; | ||
@@ -255,2 +463,6 @@ }, | ||
: undefined; | ||
message.v2 = | ||
object.v2 !== undefined && object.v2 !== null | ||
? PrivateKeyBundleV2.fromPartial(object.v2) | ||
: undefined; | ||
return message; | ||
@@ -257,0 +469,0 @@ }, |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
932490
14938