Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@xmtp/proto

Package Overview
Dependencies
Maintainers
0
Versions
140
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@xmtp/proto - npm Package Compare versions

Comparing version 3.70.2 to 3.71.0

ts/dist/cjs/identity/api/v1/identity.pb.js

2

package.json
{
"name": "@xmtp/proto",
"version": "3.70.2",
"version": "3.71.0",
"description": "Protobuf client and generated classes for GRPC API",

@@ -5,0 +5,0 @@ "main": "./ts/dist/cjs/node.js",

@@ -123,3 +123,2 @@ "use strict";

signature: new Uint8Array(),
chainRpcUrl: "",
};

@@ -138,5 +137,2 @@ }

}
if (message.chainRpcUrl !== "") {
writer.uint32(34).string(message.chainRpcUrl);
}
return writer;

@@ -160,5 +156,2 @@ },

break;
case 4:
message.chainRpcUrl = reader.string();
break;
default:

@@ -180,3 +173,2 @@ reader.skipType(tag & 7);

: new Uint8Array(),
chainRpcUrl: isSet(object.chainRpcUrl) ? String(object.chainRpcUrl) : "",
};

@@ -191,8 +183,6 @@ },

(obj.signature = base64FromBytes(message.signature !== undefined ? message.signature : new Uint8Array()));
message.chainRpcUrl !== undefined &&
(obj.chainRpcUrl = message.chainRpcUrl);
return obj;
},
fromPartial(object) {
var _a, _b, _c;
var _a, _b;
const message = createBaseSmartContractWalletSignature();

@@ -205,3 +195,2 @@ message.accountId = (_a = object.accountId) !== null && _a !== void 0 ? _a : "";

message.signature = (_b = object.signature) !== null && _b !== void 0 ? _b : new Uint8Array();
message.chainRpcUrl = (_c = object.chainRpcUrl) !== null && _c !== void 0 ? _c : "";
return message;

@@ -208,0 +197,0 @@ },

@@ -6,3 +6,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.ValidationApiClientImpl = exports.GetAssociationStateResponse = exports.GetAssociationStateRequest = exports.ValidateGroupMessagesResponse_ValidationResponse = exports.ValidateGroupMessagesResponse = exports.ValidateGroupMessagesRequest_GroupMessage = exports.ValidateGroupMessagesRequest = exports.ValidateInboxIdKeyPackagesResponse_Response = exports.ValidateInboxIdKeyPackagesResponse = exports.ValidateInboxIdKeyPackagesRequest_KeyPackage = exports.ValidateInboxIdKeyPackagesRequest = exports.protobufPackage = void 0;
exports.ValidationApiClientImpl = exports.ValidateInboxIdsResponse_ValidationResponse = exports.ValidateInboxIdsResponse = exports.ValidateInboxIdsRequest_ValidationRequest = exports.ValidateInboxIdsRequest = exports.GetAssociationStateResponse = exports.GetAssociationStateRequest = exports.ValidateGroupMessagesResponse_ValidationResponse = exports.ValidateGroupMessagesResponse = exports.ValidateGroupMessagesRequest_GroupMessage = exports.ValidateGroupMessagesRequest = exports.ValidateKeyPackagesResponse_ValidationResponse = exports.ValidateKeyPackagesResponse = exports.ValidateKeyPackagesRequest_KeyPackage = exports.ValidateKeyPackagesRequest = exports.ValidateInboxIdKeyPackagesResponse_Response = exports.ValidateInboxIdKeyPackagesResponse = exports.ValidateInboxIdKeyPackagesRequest_KeyPackage = exports.ValidateInboxIdKeyPackagesRequest = exports.protobufPackage = void 0;
/* eslint-disable */

@@ -12,2 +12,3 @@ const long_1 = __importDefault(require("long"));

const association_pb_1 = require("../../identity/associations/association.pb");
const identity_pb_1 = require("../../identity/api/v1/identity.pb");
const minimal_1 = __importDefault(require("protobufjs/minimal"));

@@ -293,2 +294,290 @@ exports.protobufPackage = "xmtp.mls_validation.v1";

};
function createBaseValidateKeyPackagesRequest() {
return { keyPackages: [] };
}
exports.ValidateKeyPackagesRequest = {
encode(message, writer = minimal_1.default.Writer.create()) {
for (const v of message.keyPackages) {
exports.ValidateKeyPackagesRequest_KeyPackage.encode(v, writer.uint32(10).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 = createBaseValidateKeyPackagesRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.keyPackages.push(exports.ValidateKeyPackagesRequest_KeyPackage.decode(reader, reader.uint32()));
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object) {
return {
keyPackages: Array.isArray(object === null || object === void 0 ? void 0 : object.keyPackages)
? object.keyPackages.map((e) => exports.ValidateKeyPackagesRequest_KeyPackage.fromJSON(e))
: [],
};
},
toJSON(message) {
const obj = {};
if (message.keyPackages) {
obj.keyPackages = message.keyPackages.map((e) => e ? exports.ValidateKeyPackagesRequest_KeyPackage.toJSON(e) : undefined);
}
else {
obj.keyPackages = [];
}
return obj;
},
fromPartial(object) {
var _a;
const message = createBaseValidateKeyPackagesRequest();
message.keyPackages =
((_a = object.keyPackages) === null || _a === void 0 ? void 0 : _a.map((e) => exports.ValidateKeyPackagesRequest_KeyPackage.fromPartial(e))) || [];
return message;
},
};
function createBaseValidateKeyPackagesRequest_KeyPackage() {
return {
keyPackageBytesTlsSerialized: new Uint8Array(),
isInboxIdCredential: false,
};
}
exports.ValidateKeyPackagesRequest_KeyPackage = {
encode(message, writer = minimal_1.default.Writer.create()) {
if (message.keyPackageBytesTlsSerialized.length !== 0) {
writer.uint32(10).bytes(message.keyPackageBytesTlsSerialized);
}
if (message.isInboxIdCredential === true) {
writer.uint32(16).bool(message.isInboxIdCredential);
}
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 = createBaseValidateKeyPackagesRequest_KeyPackage();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.keyPackageBytesTlsSerialized = reader.bytes();
break;
case 2:
message.isInboxIdCredential = reader.bool();
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object) {
return {
keyPackageBytesTlsSerialized: isSet(object.keyPackageBytesTlsSerialized)
? bytesFromBase64(object.keyPackageBytesTlsSerialized)
: new Uint8Array(),
isInboxIdCredential: isSet(object.isInboxIdCredential)
? Boolean(object.isInboxIdCredential)
: false,
};
},
toJSON(message) {
const obj = {};
message.keyPackageBytesTlsSerialized !== undefined &&
(obj.keyPackageBytesTlsSerialized = base64FromBytes(message.keyPackageBytesTlsSerialized !== undefined
? message.keyPackageBytesTlsSerialized
: new Uint8Array()));
message.isInboxIdCredential !== undefined &&
(obj.isInboxIdCredential = message.isInboxIdCredential);
return obj;
},
fromPartial(object) {
var _a, _b;
const message = createBaseValidateKeyPackagesRequest_KeyPackage();
message.keyPackageBytesTlsSerialized =
(_a = object.keyPackageBytesTlsSerialized) !== null && _a !== void 0 ? _a : new Uint8Array();
message.isInboxIdCredential = (_b = object.isInboxIdCredential) !== null && _b !== void 0 ? _b : false;
return message;
},
};
function createBaseValidateKeyPackagesResponse() {
return { responses: [] };
}
exports.ValidateKeyPackagesResponse = {
encode(message, writer = minimal_1.default.Writer.create()) {
for (const v of message.responses) {
exports.ValidateKeyPackagesResponse_ValidationResponse.encode(v, writer.uint32(10).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 = createBaseValidateKeyPackagesResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.responses.push(exports.ValidateKeyPackagesResponse_ValidationResponse.decode(reader, reader.uint32()));
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object) {
return {
responses: Array.isArray(object === null || object === void 0 ? void 0 : object.responses)
? object.responses.map((e) => exports.ValidateKeyPackagesResponse_ValidationResponse.fromJSON(e))
: [],
};
},
toJSON(message) {
const obj = {};
if (message.responses) {
obj.responses = message.responses.map((e) => e ? exports.ValidateKeyPackagesResponse_ValidationResponse.toJSON(e) : undefined);
}
else {
obj.responses = [];
}
return obj;
},
fromPartial(object) {
var _a;
const message = createBaseValidateKeyPackagesResponse();
message.responses =
((_a = object.responses) === null || _a === void 0 ? void 0 : _a.map((e) => exports.ValidateKeyPackagesResponse_ValidationResponse.fromPartial(e))) || [];
return message;
},
};
function createBaseValidateKeyPackagesResponse_ValidationResponse() {
return {
isOk: false,
errorMessage: "",
installationId: new Uint8Array(),
accountAddress: "",
credentialIdentityBytes: new Uint8Array(),
expiration: long_1.default.UZERO,
};
}
exports.ValidateKeyPackagesResponse_ValidationResponse = {
encode(message, writer = minimal_1.default.Writer.create()) {
if (message.isOk === true) {
writer.uint32(8).bool(message.isOk);
}
if (message.errorMessage !== "") {
writer.uint32(18).string(message.errorMessage);
}
if (message.installationId.length !== 0) {
writer.uint32(26).bytes(message.installationId);
}
if (message.accountAddress !== "") {
writer.uint32(34).string(message.accountAddress);
}
if (message.credentialIdentityBytes.length !== 0) {
writer.uint32(42).bytes(message.credentialIdentityBytes);
}
if (!message.expiration.isZero()) {
writer.uint32(48).uint64(message.expiration);
}
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 = createBaseValidateKeyPackagesResponse_ValidationResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.isOk = reader.bool();
break;
case 2:
message.errorMessage = reader.string();
break;
case 3:
message.installationId = reader.bytes();
break;
case 4:
message.accountAddress = reader.string();
break;
case 5:
message.credentialIdentityBytes = reader.bytes();
break;
case 6:
message.expiration = reader.uint64();
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object) {
return {
isOk: isSet(object.isOk) ? Boolean(object.isOk) : false,
errorMessage: isSet(object.errorMessage)
? String(object.errorMessage)
: "",
installationId: isSet(object.installationId)
? bytesFromBase64(object.installationId)
: new Uint8Array(),
accountAddress: isSet(object.accountAddress)
? String(object.accountAddress)
: "",
credentialIdentityBytes: isSet(object.credentialIdentityBytes)
? bytesFromBase64(object.credentialIdentityBytes)
: new Uint8Array(),
expiration: isSet(object.expiration)
? long_1.default.fromValue(object.expiration)
: long_1.default.UZERO,
};
},
toJSON(message) {
const obj = {};
message.isOk !== undefined && (obj.isOk = message.isOk);
message.errorMessage !== undefined &&
(obj.errorMessage = message.errorMessage);
message.installationId !== undefined &&
(obj.installationId = base64FromBytes(message.installationId !== undefined
? message.installationId
: new Uint8Array()));
message.accountAddress !== undefined &&
(obj.accountAddress = message.accountAddress);
message.credentialIdentityBytes !== undefined &&
(obj.credentialIdentityBytes = base64FromBytes(message.credentialIdentityBytes !== undefined
? message.credentialIdentityBytes
: new Uint8Array()));
message.expiration !== undefined &&
(obj.expiration = (message.expiration || long_1.default.UZERO).toString());
return obj;
},
fromPartial(object) {
var _a, _b, _c, _d, _e;
const message = createBaseValidateKeyPackagesResponse_ValidationResponse();
message.isOk = (_a = object.isOk) !== null && _a !== void 0 ? _a : false;
message.errorMessage = (_b = object.errorMessage) !== null && _b !== void 0 ? _b : "";
message.installationId = (_c = object.installationId) !== null && _c !== void 0 ? _c : new Uint8Array();
message.accountAddress = (_d = object.accountAddress) !== null && _d !== void 0 ? _d : "";
message.credentialIdentityBytes =
(_e = object.credentialIdentityBytes) !== null && _e !== void 0 ? _e : new Uint8Array();
message.expiration =
object.expiration !== undefined && object.expiration !== null
? long_1.default.fromValue(object.expiration)
: long_1.default.UZERO;
return message;
},
};
function createBaseValidateGroupMessagesRequest() {

@@ -652,5 +941,263 @@ return { groupMessages: [] };

};
function createBaseValidateInboxIdsRequest() {
return { requests: [] };
}
exports.ValidateInboxIdsRequest = {
encode(message, writer = minimal_1.default.Writer.create()) {
for (const v of message.requests) {
exports.ValidateInboxIdsRequest_ValidationRequest.encode(v, writer.uint32(10).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 = createBaseValidateInboxIdsRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.requests.push(exports.ValidateInboxIdsRequest_ValidationRequest.decode(reader, reader.uint32()));
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object) {
return {
requests: Array.isArray(object === null || object === void 0 ? void 0 : object.requests)
? object.requests.map((e) => exports.ValidateInboxIdsRequest_ValidationRequest.fromJSON(e))
: [],
};
},
toJSON(message) {
const obj = {};
if (message.requests) {
obj.requests = message.requests.map((e) => e ? exports.ValidateInboxIdsRequest_ValidationRequest.toJSON(e) : undefined);
}
else {
obj.requests = [];
}
return obj;
},
fromPartial(object) {
var _a;
const message = createBaseValidateInboxIdsRequest();
message.requests =
((_a = object.requests) === null || _a === void 0 ? void 0 : _a.map((e) => exports.ValidateInboxIdsRequest_ValidationRequest.fromPartial(e))) || [];
return message;
},
};
function createBaseValidateInboxIdsRequest_ValidationRequest() {
return {
credential: undefined,
installationPublicKey: new Uint8Array(),
identityUpdates: [],
};
}
exports.ValidateInboxIdsRequest_ValidationRequest = {
encode(message, writer = minimal_1.default.Writer.create()) {
if (message.credential !== undefined) {
credential_pb_1.MlsCredential.encode(message.credential, writer.uint32(10).fork()).ldelim();
}
if (message.installationPublicKey.length !== 0) {
writer.uint32(18).bytes(message.installationPublicKey);
}
for (const v of message.identityUpdates) {
association_pb_1.IdentityUpdate.encode(v, 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 = createBaseValidateInboxIdsRequest_ValidationRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.credential = credential_pb_1.MlsCredential.decode(reader, reader.uint32());
break;
case 2:
message.installationPublicKey = reader.bytes();
break;
case 3:
message.identityUpdates.push(association_pb_1.IdentityUpdate.decode(reader, reader.uint32()));
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object) {
return {
credential: isSet(object.credential)
? credential_pb_1.MlsCredential.fromJSON(object.credential)
: undefined,
installationPublicKey: isSet(object.installationPublicKey)
? bytesFromBase64(object.installationPublicKey)
: new Uint8Array(),
identityUpdates: Array.isArray(object === null || object === void 0 ? void 0 : object.identityUpdates)
? object.identityUpdates.map((e) => association_pb_1.IdentityUpdate.fromJSON(e))
: [],
};
},
toJSON(message) {
const obj = {};
message.credential !== undefined &&
(obj.credential = message.credential
? credential_pb_1.MlsCredential.toJSON(message.credential)
: undefined);
message.installationPublicKey !== undefined &&
(obj.installationPublicKey = base64FromBytes(message.installationPublicKey !== undefined
? message.installationPublicKey
: new Uint8Array()));
if (message.identityUpdates) {
obj.identityUpdates = message.identityUpdates.map((e) => e ? association_pb_1.IdentityUpdate.toJSON(e) : undefined);
}
else {
obj.identityUpdates = [];
}
return obj;
},
fromPartial(object) {
var _a, _b;
const message = createBaseValidateInboxIdsRequest_ValidationRequest();
message.credential =
object.credential !== undefined && object.credential !== null
? credential_pb_1.MlsCredential.fromPartial(object.credential)
: undefined;
message.installationPublicKey =
(_a = object.installationPublicKey) !== null && _a !== void 0 ? _a : new Uint8Array();
message.identityUpdates =
((_b = object.identityUpdates) === null || _b === void 0 ? void 0 : _b.map((e) => association_pb_1.IdentityUpdate.fromPartial(e))) || [];
return message;
},
};
function createBaseValidateInboxIdsResponse() {
return { responses: [] };
}
exports.ValidateInboxIdsResponse = {
encode(message, writer = minimal_1.default.Writer.create()) {
for (const v of message.responses) {
exports.ValidateInboxIdsResponse_ValidationResponse.encode(v, writer.uint32(10).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 = createBaseValidateInboxIdsResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.responses.push(exports.ValidateInboxIdsResponse_ValidationResponse.decode(reader, reader.uint32()));
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object) {
return {
responses: Array.isArray(object === null || object === void 0 ? void 0 : object.responses)
? object.responses.map((e) => exports.ValidateInboxIdsResponse_ValidationResponse.fromJSON(e))
: [],
};
},
toJSON(message) {
const obj = {};
if (message.responses) {
obj.responses = message.responses.map((e) => e ? exports.ValidateInboxIdsResponse_ValidationResponse.toJSON(e) : undefined);
}
else {
obj.responses = [];
}
return obj;
},
fromPartial(object) {
var _a;
const message = createBaseValidateInboxIdsResponse();
message.responses =
((_a = object.responses) === null || _a === void 0 ? void 0 : _a.map((e) => exports.ValidateInboxIdsResponse_ValidationResponse.fromPartial(e))) || [];
return message;
},
};
function createBaseValidateInboxIdsResponse_ValidationResponse() {
return { isOk: false, errorMessage: "", inboxId: "" };
}
exports.ValidateInboxIdsResponse_ValidationResponse = {
encode(message, writer = minimal_1.default.Writer.create()) {
if (message.isOk === true) {
writer.uint32(8).bool(message.isOk);
}
if (message.errorMessage !== "") {
writer.uint32(18).string(message.errorMessage);
}
if (message.inboxId !== "") {
writer.uint32(26).string(message.inboxId);
}
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 = createBaseValidateInboxIdsResponse_ValidationResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.isOk = reader.bool();
break;
case 2:
message.errorMessage = reader.string();
break;
case 3:
message.inboxId = reader.string();
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object) {
return {
isOk: isSet(object.isOk) ? Boolean(object.isOk) : false,
errorMessage: isSet(object.errorMessage)
? String(object.errorMessage)
: "",
inboxId: isSet(object.inboxId) ? String(object.inboxId) : "",
};
},
toJSON(message) {
const obj = {};
message.isOk !== undefined && (obj.isOk = message.isOk);
message.errorMessage !== undefined &&
(obj.errorMessage = message.errorMessage);
message.inboxId !== undefined && (obj.inboxId = message.inboxId);
return obj;
},
fromPartial(object) {
var _a, _b, _c;
const message = createBaseValidateInboxIdsResponse_ValidationResponse();
message.isOk = (_a = object.isOk) !== null && _a !== void 0 ? _a : false;
message.errorMessage = (_b = object.errorMessage) !== null && _b !== void 0 ? _b : "";
message.inboxId = (_c = object.inboxId) !== null && _c !== void 0 ? _c : "";
return message;
},
};
class ValidationApiClientImpl {
constructor(rpc) {
this.rpc = rpc;
this.ValidateKeyPackages = this.ValidateKeyPackages.bind(this);
this.ValidateGroupMessages = this.ValidateGroupMessages.bind(this);

@@ -660,3 +1207,11 @@ this.GetAssociationState = this.GetAssociationState.bind(this);

this.ValidateInboxIdKeyPackages.bind(this);
this.ValidateInboxIds = this.ValidateInboxIds.bind(this);
this.VerifySmartContractWalletSignatures =
this.VerifySmartContractWalletSignatures.bind(this);
}
ValidateKeyPackages(request) {
const data = exports.ValidateKeyPackagesRequest.encode(request).finish();
const promise = this.rpc.request("xmtp.mls_validation.v1.ValidationApi", "ValidateKeyPackages", data);
return promise.then((data) => exports.ValidateKeyPackagesResponse.decode(new minimal_1.default.Reader(data)));
}
ValidateGroupMessages(request) {

@@ -673,6 +1228,16 @@ const data = exports.ValidateGroupMessagesRequest.encode(request).finish();

ValidateInboxIdKeyPackages(request) {
const data = exports.ValidateInboxIdKeyPackagesRequest.encode(request).finish();
const data = exports.ValidateKeyPackagesRequest.encode(request).finish();
const promise = this.rpc.request("xmtp.mls_validation.v1.ValidationApi", "ValidateInboxIdKeyPackages", data);
return promise.then((data) => exports.ValidateInboxIdKeyPackagesResponse.decode(new minimal_1.default.Reader(data)));
}
ValidateInboxIds(request) {
const data = exports.ValidateInboxIdsRequest.encode(request).finish();
const promise = this.rpc.request("xmtp.mls_validation.v1.ValidationApi", "ValidateInboxIds", data);
return promise.then((data) => exports.ValidateInboxIdsResponse.decode(new minimal_1.default.Reader(data)));
}
VerifySmartContractWalletSignatures(request) {
const data = identity_pb_1.VerifySmartContractWalletSignaturesRequest.encode(request).finish();
const promise = this.rpc.request("xmtp.mls_validation.v1.ValidationApi", "VerifySmartContractWalletSignatures", data);
return promise.then((data) => identity_pb_1.VerifySmartContractWalletSignaturesResponse.decode(new minimal_1.default.Reader(data)));
}
}

@@ -679,0 +1244,0 @@ exports.ValidationApiClientImpl = ValidationApiClientImpl;

@@ -117,3 +117,2 @@ /* eslint-disable */

signature: new Uint8Array(),
chainRpcUrl: "",
};

@@ -132,5 +131,2 @@ }

}
if (message.chainRpcUrl !== "") {
writer.uint32(34).string(message.chainRpcUrl);
}
return writer;

@@ -154,5 +150,2 @@ },

break;
case 4:
message.chainRpcUrl = reader.string();
break;
default:

@@ -174,3 +167,2 @@ reader.skipType(tag & 7);

: new Uint8Array(),
chainRpcUrl: isSet(object.chainRpcUrl) ? String(object.chainRpcUrl) : "",
};

@@ -185,8 +177,6 @@ },

(obj.signature = base64FromBytes(message.signature !== undefined ? message.signature : new Uint8Array()));
message.chainRpcUrl !== undefined &&
(obj.chainRpcUrl = message.chainRpcUrl);
return obj;
},
fromPartial(object) {
var _a, _b, _c;
var _a, _b;
const message = createBaseSmartContractWalletSignature();

@@ -199,3 +189,2 @@ message.accountId = (_a = object.accountId) !== null && _a !== void 0 ? _a : "";

message.signature = (_b = object.signature) !== null && _b !== void 0 ? _b : new Uint8Array();
message.chainRpcUrl = (_c = object.chainRpcUrl) !== null && _c !== void 0 ? _c : "";
return message;

@@ -202,0 +191,0 @@ },

@@ -5,2 +5,3 @@ /* eslint-disable */

import { IdentityUpdate, AssociationState, AssociationStateDiff, } from "../../identity/associations/association.pb";
import { VerifySmartContractWalletSignaturesResponse, VerifySmartContractWalletSignaturesRequest, } from "../../identity/api/v1/identity.pb";
import _m0 from "protobufjs/minimal";

@@ -286,2 +287,290 @@ export const protobufPackage = "xmtp.mls_validation.v1";

};
function createBaseValidateKeyPackagesRequest() {
return { keyPackages: [] };
}
export const ValidateKeyPackagesRequest = {
encode(message, writer = _m0.Writer.create()) {
for (const v of message.keyPackages) {
ValidateKeyPackagesRequest_KeyPackage.encode(v, writer.uint32(10).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 = createBaseValidateKeyPackagesRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.keyPackages.push(ValidateKeyPackagesRequest_KeyPackage.decode(reader, reader.uint32()));
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object) {
return {
keyPackages: Array.isArray(object === null || object === void 0 ? void 0 : object.keyPackages)
? object.keyPackages.map((e) => ValidateKeyPackagesRequest_KeyPackage.fromJSON(e))
: [],
};
},
toJSON(message) {
const obj = {};
if (message.keyPackages) {
obj.keyPackages = message.keyPackages.map((e) => e ? ValidateKeyPackagesRequest_KeyPackage.toJSON(e) : undefined);
}
else {
obj.keyPackages = [];
}
return obj;
},
fromPartial(object) {
var _a;
const message = createBaseValidateKeyPackagesRequest();
message.keyPackages =
((_a = object.keyPackages) === null || _a === void 0 ? void 0 : _a.map((e) => ValidateKeyPackagesRequest_KeyPackage.fromPartial(e))) || [];
return message;
},
};
function createBaseValidateKeyPackagesRequest_KeyPackage() {
return {
keyPackageBytesTlsSerialized: new Uint8Array(),
isInboxIdCredential: false,
};
}
export const ValidateKeyPackagesRequest_KeyPackage = {
encode(message, writer = _m0.Writer.create()) {
if (message.keyPackageBytesTlsSerialized.length !== 0) {
writer.uint32(10).bytes(message.keyPackageBytesTlsSerialized);
}
if (message.isInboxIdCredential === true) {
writer.uint32(16).bool(message.isInboxIdCredential);
}
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 = createBaseValidateKeyPackagesRequest_KeyPackage();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.keyPackageBytesTlsSerialized = reader.bytes();
break;
case 2:
message.isInboxIdCredential = reader.bool();
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object) {
return {
keyPackageBytesTlsSerialized: isSet(object.keyPackageBytesTlsSerialized)
? bytesFromBase64(object.keyPackageBytesTlsSerialized)
: new Uint8Array(),
isInboxIdCredential: isSet(object.isInboxIdCredential)
? Boolean(object.isInboxIdCredential)
: false,
};
},
toJSON(message) {
const obj = {};
message.keyPackageBytesTlsSerialized !== undefined &&
(obj.keyPackageBytesTlsSerialized = base64FromBytes(message.keyPackageBytesTlsSerialized !== undefined
? message.keyPackageBytesTlsSerialized
: new Uint8Array()));
message.isInboxIdCredential !== undefined &&
(obj.isInboxIdCredential = message.isInboxIdCredential);
return obj;
},
fromPartial(object) {
var _a, _b;
const message = createBaseValidateKeyPackagesRequest_KeyPackage();
message.keyPackageBytesTlsSerialized =
(_a = object.keyPackageBytesTlsSerialized) !== null && _a !== void 0 ? _a : new Uint8Array();
message.isInboxIdCredential = (_b = object.isInboxIdCredential) !== null && _b !== void 0 ? _b : false;
return message;
},
};
function createBaseValidateKeyPackagesResponse() {
return { responses: [] };
}
export const ValidateKeyPackagesResponse = {
encode(message, writer = _m0.Writer.create()) {
for (const v of message.responses) {
ValidateKeyPackagesResponse_ValidationResponse.encode(v, writer.uint32(10).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 = createBaseValidateKeyPackagesResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.responses.push(ValidateKeyPackagesResponse_ValidationResponse.decode(reader, reader.uint32()));
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object) {
return {
responses: Array.isArray(object === null || object === void 0 ? void 0 : object.responses)
? object.responses.map((e) => ValidateKeyPackagesResponse_ValidationResponse.fromJSON(e))
: [],
};
},
toJSON(message) {
const obj = {};
if (message.responses) {
obj.responses = message.responses.map((e) => e ? ValidateKeyPackagesResponse_ValidationResponse.toJSON(e) : undefined);
}
else {
obj.responses = [];
}
return obj;
},
fromPartial(object) {
var _a;
const message = createBaseValidateKeyPackagesResponse();
message.responses =
((_a = object.responses) === null || _a === void 0 ? void 0 : _a.map((e) => ValidateKeyPackagesResponse_ValidationResponse.fromPartial(e))) || [];
return message;
},
};
function createBaseValidateKeyPackagesResponse_ValidationResponse() {
return {
isOk: false,
errorMessage: "",
installationId: new Uint8Array(),
accountAddress: "",
credentialIdentityBytes: new Uint8Array(),
expiration: Long.UZERO,
};
}
export const ValidateKeyPackagesResponse_ValidationResponse = {
encode(message, writer = _m0.Writer.create()) {
if (message.isOk === true) {
writer.uint32(8).bool(message.isOk);
}
if (message.errorMessage !== "") {
writer.uint32(18).string(message.errorMessage);
}
if (message.installationId.length !== 0) {
writer.uint32(26).bytes(message.installationId);
}
if (message.accountAddress !== "") {
writer.uint32(34).string(message.accountAddress);
}
if (message.credentialIdentityBytes.length !== 0) {
writer.uint32(42).bytes(message.credentialIdentityBytes);
}
if (!message.expiration.isZero()) {
writer.uint32(48).uint64(message.expiration);
}
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 = createBaseValidateKeyPackagesResponse_ValidationResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.isOk = reader.bool();
break;
case 2:
message.errorMessage = reader.string();
break;
case 3:
message.installationId = reader.bytes();
break;
case 4:
message.accountAddress = reader.string();
break;
case 5:
message.credentialIdentityBytes = reader.bytes();
break;
case 6:
message.expiration = reader.uint64();
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object) {
return {
isOk: isSet(object.isOk) ? Boolean(object.isOk) : false,
errorMessage: isSet(object.errorMessage)
? String(object.errorMessage)
: "",
installationId: isSet(object.installationId)
? bytesFromBase64(object.installationId)
: new Uint8Array(),
accountAddress: isSet(object.accountAddress)
? String(object.accountAddress)
: "",
credentialIdentityBytes: isSet(object.credentialIdentityBytes)
? bytesFromBase64(object.credentialIdentityBytes)
: new Uint8Array(),
expiration: isSet(object.expiration)
? Long.fromValue(object.expiration)
: Long.UZERO,
};
},
toJSON(message) {
const obj = {};
message.isOk !== undefined && (obj.isOk = message.isOk);
message.errorMessage !== undefined &&
(obj.errorMessage = message.errorMessage);
message.installationId !== undefined &&
(obj.installationId = base64FromBytes(message.installationId !== undefined
? message.installationId
: new Uint8Array()));
message.accountAddress !== undefined &&
(obj.accountAddress = message.accountAddress);
message.credentialIdentityBytes !== undefined &&
(obj.credentialIdentityBytes = base64FromBytes(message.credentialIdentityBytes !== undefined
? message.credentialIdentityBytes
: new Uint8Array()));
message.expiration !== undefined &&
(obj.expiration = (message.expiration || Long.UZERO).toString());
return obj;
},
fromPartial(object) {
var _a, _b, _c, _d, _e;
const message = createBaseValidateKeyPackagesResponse_ValidationResponse();
message.isOk = (_a = object.isOk) !== null && _a !== void 0 ? _a : false;
message.errorMessage = (_b = object.errorMessage) !== null && _b !== void 0 ? _b : "";
message.installationId = (_c = object.installationId) !== null && _c !== void 0 ? _c : new Uint8Array();
message.accountAddress = (_d = object.accountAddress) !== null && _d !== void 0 ? _d : "";
message.credentialIdentityBytes =
(_e = object.credentialIdentityBytes) !== null && _e !== void 0 ? _e : new Uint8Array();
message.expiration =
object.expiration !== undefined && object.expiration !== null
? Long.fromValue(object.expiration)
: Long.UZERO;
return message;
},
};
function createBaseValidateGroupMessagesRequest() {

@@ -645,5 +934,263 @@ return { groupMessages: [] };

};
function createBaseValidateInboxIdsRequest() {
return { requests: [] };
}
export const ValidateInboxIdsRequest = {
encode(message, writer = _m0.Writer.create()) {
for (const v of message.requests) {
ValidateInboxIdsRequest_ValidationRequest.encode(v, writer.uint32(10).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 = createBaseValidateInboxIdsRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.requests.push(ValidateInboxIdsRequest_ValidationRequest.decode(reader, reader.uint32()));
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object) {
return {
requests: Array.isArray(object === null || object === void 0 ? void 0 : object.requests)
? object.requests.map((e) => ValidateInboxIdsRequest_ValidationRequest.fromJSON(e))
: [],
};
},
toJSON(message) {
const obj = {};
if (message.requests) {
obj.requests = message.requests.map((e) => e ? ValidateInboxIdsRequest_ValidationRequest.toJSON(e) : undefined);
}
else {
obj.requests = [];
}
return obj;
},
fromPartial(object) {
var _a;
const message = createBaseValidateInboxIdsRequest();
message.requests =
((_a = object.requests) === null || _a === void 0 ? void 0 : _a.map((e) => ValidateInboxIdsRequest_ValidationRequest.fromPartial(e))) || [];
return message;
},
};
function createBaseValidateInboxIdsRequest_ValidationRequest() {
return {
credential: undefined,
installationPublicKey: new Uint8Array(),
identityUpdates: [],
};
}
export const ValidateInboxIdsRequest_ValidationRequest = {
encode(message, writer = _m0.Writer.create()) {
if (message.credential !== undefined) {
MlsCredential.encode(message.credential, writer.uint32(10).fork()).ldelim();
}
if (message.installationPublicKey.length !== 0) {
writer.uint32(18).bytes(message.installationPublicKey);
}
for (const v of message.identityUpdates) {
IdentityUpdate.encode(v, 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 = createBaseValidateInboxIdsRequest_ValidationRequest();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.credential = MlsCredential.decode(reader, reader.uint32());
break;
case 2:
message.installationPublicKey = reader.bytes();
break;
case 3:
message.identityUpdates.push(IdentityUpdate.decode(reader, reader.uint32()));
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object) {
return {
credential: isSet(object.credential)
? MlsCredential.fromJSON(object.credential)
: undefined,
installationPublicKey: isSet(object.installationPublicKey)
? bytesFromBase64(object.installationPublicKey)
: new Uint8Array(),
identityUpdates: Array.isArray(object === null || object === void 0 ? void 0 : object.identityUpdates)
? object.identityUpdates.map((e) => IdentityUpdate.fromJSON(e))
: [],
};
},
toJSON(message) {
const obj = {};
message.credential !== undefined &&
(obj.credential = message.credential
? MlsCredential.toJSON(message.credential)
: undefined);
message.installationPublicKey !== undefined &&
(obj.installationPublicKey = base64FromBytes(message.installationPublicKey !== undefined
? message.installationPublicKey
: new Uint8Array()));
if (message.identityUpdates) {
obj.identityUpdates = message.identityUpdates.map((e) => e ? IdentityUpdate.toJSON(e) : undefined);
}
else {
obj.identityUpdates = [];
}
return obj;
},
fromPartial(object) {
var _a, _b;
const message = createBaseValidateInboxIdsRequest_ValidationRequest();
message.credential =
object.credential !== undefined && object.credential !== null
? MlsCredential.fromPartial(object.credential)
: undefined;
message.installationPublicKey =
(_a = object.installationPublicKey) !== null && _a !== void 0 ? _a : new Uint8Array();
message.identityUpdates =
((_b = object.identityUpdates) === null || _b === void 0 ? void 0 : _b.map((e) => IdentityUpdate.fromPartial(e))) || [];
return message;
},
};
function createBaseValidateInboxIdsResponse() {
return { responses: [] };
}
export const ValidateInboxIdsResponse = {
encode(message, writer = _m0.Writer.create()) {
for (const v of message.responses) {
ValidateInboxIdsResponse_ValidationResponse.encode(v, writer.uint32(10).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 = createBaseValidateInboxIdsResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.responses.push(ValidateInboxIdsResponse_ValidationResponse.decode(reader, reader.uint32()));
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object) {
return {
responses: Array.isArray(object === null || object === void 0 ? void 0 : object.responses)
? object.responses.map((e) => ValidateInboxIdsResponse_ValidationResponse.fromJSON(e))
: [],
};
},
toJSON(message) {
const obj = {};
if (message.responses) {
obj.responses = message.responses.map((e) => e ? ValidateInboxIdsResponse_ValidationResponse.toJSON(e) : undefined);
}
else {
obj.responses = [];
}
return obj;
},
fromPartial(object) {
var _a;
const message = createBaseValidateInboxIdsResponse();
message.responses =
((_a = object.responses) === null || _a === void 0 ? void 0 : _a.map((e) => ValidateInboxIdsResponse_ValidationResponse.fromPartial(e))) || [];
return message;
},
};
function createBaseValidateInboxIdsResponse_ValidationResponse() {
return { isOk: false, errorMessage: "", inboxId: "" };
}
export const ValidateInboxIdsResponse_ValidationResponse = {
encode(message, writer = _m0.Writer.create()) {
if (message.isOk === true) {
writer.uint32(8).bool(message.isOk);
}
if (message.errorMessage !== "") {
writer.uint32(18).string(message.errorMessage);
}
if (message.inboxId !== "") {
writer.uint32(26).string(message.inboxId);
}
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 = createBaseValidateInboxIdsResponse_ValidationResponse();
while (reader.pos < end) {
const tag = reader.uint32();
switch (tag >>> 3) {
case 1:
message.isOk = reader.bool();
break;
case 2:
message.errorMessage = reader.string();
break;
case 3:
message.inboxId = reader.string();
break;
default:
reader.skipType(tag & 7);
break;
}
}
return message;
},
fromJSON(object) {
return {
isOk: isSet(object.isOk) ? Boolean(object.isOk) : false,
errorMessage: isSet(object.errorMessage)
? String(object.errorMessage)
: "",
inboxId: isSet(object.inboxId) ? String(object.inboxId) : "",
};
},
toJSON(message) {
const obj = {};
message.isOk !== undefined && (obj.isOk = message.isOk);
message.errorMessage !== undefined &&
(obj.errorMessage = message.errorMessage);
message.inboxId !== undefined && (obj.inboxId = message.inboxId);
return obj;
},
fromPartial(object) {
var _a, _b, _c;
const message = createBaseValidateInboxIdsResponse_ValidationResponse();
message.isOk = (_a = object.isOk) !== null && _a !== void 0 ? _a : false;
message.errorMessage = (_b = object.errorMessage) !== null && _b !== void 0 ? _b : "";
message.inboxId = (_c = object.inboxId) !== null && _c !== void 0 ? _c : "";
return message;
},
};
export class ValidationApiClientImpl {
constructor(rpc) {
this.rpc = rpc;
this.ValidateKeyPackages = this.ValidateKeyPackages.bind(this);
this.ValidateGroupMessages = this.ValidateGroupMessages.bind(this);

@@ -653,3 +1200,11 @@ this.GetAssociationState = this.GetAssociationState.bind(this);

this.ValidateInboxIdKeyPackages.bind(this);
this.ValidateInboxIds = this.ValidateInboxIds.bind(this);
this.VerifySmartContractWalletSignatures =
this.VerifySmartContractWalletSignatures.bind(this);
}
ValidateKeyPackages(request) {
const data = ValidateKeyPackagesRequest.encode(request).finish();
const promise = this.rpc.request("xmtp.mls_validation.v1.ValidationApi", "ValidateKeyPackages", data);
return promise.then((data) => ValidateKeyPackagesResponse.decode(new _m0.Reader(data)));
}
ValidateGroupMessages(request) {

@@ -666,6 +1221,16 @@ const data = ValidateGroupMessagesRequest.encode(request).finish();

ValidateInboxIdKeyPackages(request) {
const data = ValidateInboxIdKeyPackagesRequest.encode(request).finish();
const data = ValidateKeyPackagesRequest.encode(request).finish();
const promise = this.rpc.request("xmtp.mls_validation.v1.ValidationApi", "ValidateInboxIdKeyPackages", data);
return promise.then((data) => ValidateInboxIdKeyPackagesResponse.decode(new _m0.Reader(data)));
}
ValidateInboxIds(request) {
const data = ValidateInboxIdsRequest.encode(request).finish();
const promise = this.rpc.request("xmtp.mls_validation.v1.ValidationApi", "ValidateInboxIds", data);
return promise.then((data) => ValidateInboxIdsResponse.decode(new _m0.Reader(data)));
}
VerifySmartContractWalletSignatures(request) {
const data = VerifySmartContractWalletSignaturesRequest.encode(request).finish();
const promise = this.rpc.request("xmtp.mls_validation.v1.ValidationApi", "VerifySmartContractWalletSignatures", data);
return promise.then((data) => VerifySmartContractWalletSignaturesResponse.decode(new _m0.Reader(data)));
}
}

@@ -672,0 +1237,0 @@ var globalThis = (() => {

@@ -29,4 +29,2 @@ import Long from "long";

signature: Uint8Array;
/** The RPC URL specifies a chain to verify the signature against */
chainRpcUrl: string;
}

@@ -85,3 +83,2 @@ /**

signature?: Uint8Array | undefined;
chainRpcUrl?: string | undefined;
} & {

@@ -162,3 +159,2 @@ accountId?: string | undefined;

signature?: Uint8Array | undefined;
chainRpcUrl?: string | undefined;
} & { [K_1 in Exclude<keyof I, keyof SmartContractWalletSignature>]: never; }>(object: I): SmartContractWalletSignature;

@@ -249,3 +245,2 @@ };

signature?: Uint8Array | undefined;
chainRpcUrl?: string | undefined;
} | undefined;

@@ -284,3 +279,2 @@ installationKey?: {

signature?: Uint8Array | undefined;
chainRpcUrl?: string | undefined;
} & {

@@ -361,3 +355,2 @@ accountId?: string | undefined;

signature?: Uint8Array | undefined;
chainRpcUrl?: string | undefined;
} & { [K_2 in Exclude<keyof I["erc6492"], keyof SmartContractWalletSignature>]: never; }) | undefined;

@@ -364,0 +357,0 @@ installationKey?: ({

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

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 not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is too big to display

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc