diff --git a/dist/generated/qrcode_data_pb.js b/dist/generated/qrcode_data_pb.js index e903a4aea9805dde1a3e87e2cbbc287f411fef3c..4fb64d64b1f48e4470c501d4a69072f64a6d8792 100644 --- a/dist/generated/qrcode_data_pb.js +++ b/dist/generated/qrcode_data_pb.js @@ -2294,6 +2294,814 @@ $root.vereign = (function () { }; return WrapperData; })(); + qrcode_data.DocumentData_V1 = (function () { + /** + * Properties of a DocumentData_V1. + * @memberof vereign.protobuf.qrcode_data + * @interface IDocumentData_V1 + * @property {string|null} [author] DocumentData_V1 author + * @property {string|null} [documentTitle] DocumentData_V1 documentTitle + * @property {string|null} [documentDescription] DocumentData_V1 documentDescription + * @property {string|null} [creationDate] DocumentData_V1 creationDate + * @property {number|null} [documentPages] DocumentData_V1 documentPages + * @property {vereign.protobuf.qrcode_data.IIpfsContentData_V1|null} [ipfs] DocumentData_V1 ipfs + */ + /** + * Constructs a new DocumentData_V1. + * @memberof vereign.protobuf.qrcode_data + * @classdesc Represents a DocumentData_V1. + * @implements IDocumentData_V1 + * @constructor + * @param {vereign.protobuf.qrcode_data.IDocumentData_V1=} [properties] Properties to set + */ + function DocumentData_V1(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + /** + * DocumentData_V1 author. + * @member {string} author + * @memberof vereign.protobuf.qrcode_data.DocumentData_V1 + * @instance + */ + DocumentData_V1.prototype.author = ""; + /** + * DocumentData_V1 documentTitle. + * @member {string} documentTitle + * @memberof vereign.protobuf.qrcode_data.DocumentData_V1 + * @instance + */ + DocumentData_V1.prototype.documentTitle = ""; + /** + * DocumentData_V1 documentDescription. + * @member {string} documentDescription + * @memberof vereign.protobuf.qrcode_data.DocumentData_V1 + * @instance + */ + DocumentData_V1.prototype.documentDescription = ""; + /** + * DocumentData_V1 creationDate. + * @member {string} creationDate + * @memberof vereign.protobuf.qrcode_data.DocumentData_V1 + * @instance + */ + DocumentData_V1.prototype.creationDate = ""; + /** + * DocumentData_V1 documentPages. + * @member {number} documentPages + * @memberof vereign.protobuf.qrcode_data.DocumentData_V1 + * @instance + */ + DocumentData_V1.prototype.documentPages = 0; + /** + * DocumentData_V1 ipfs. + * @member {vereign.protobuf.qrcode_data.IIpfsContentData_V1|null|undefined} ipfs + * @memberof vereign.protobuf.qrcode_data.DocumentData_V1 + * @instance + */ + DocumentData_V1.prototype.ipfs = null; + /** + * Creates a new DocumentData_V1 instance using the specified properties. + * @function create + * @memberof vereign.protobuf.qrcode_data.DocumentData_V1 + * @static + * @param {vereign.protobuf.qrcode_data.IDocumentData_V1=} [properties] Properties to set + * @returns {vereign.protobuf.qrcode_data.DocumentData_V1} DocumentData_V1 instance + */ + DocumentData_V1.create = function create(properties) { + return new DocumentData_V1(properties); + }; + /** + * Encodes the specified DocumentData_V1 message. Does not implicitly {@link vereign.protobuf.qrcode_data.DocumentData_V1.verify|verify} messages. + * @function encode + * @memberof vereign.protobuf.qrcode_data.DocumentData_V1 + * @static + * @param {vereign.protobuf.qrcode_data.IDocumentData_V1} message DocumentData_V1 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentData_V1.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.author != null && Object.hasOwnProperty.call(message, "author")) + writer.uint32(/* id 1, wireType 2 =*/ 10).string(message.author); + if (message.documentTitle != null && Object.hasOwnProperty.call(message, "documentTitle")) + writer.uint32(/* id 2, wireType 2 =*/ 18).string(message.documentTitle); + if (message.documentDescription != null && Object.hasOwnProperty.call(message, "documentDescription")) + writer.uint32(/* id 3, wireType 2 =*/ 26).string(message.documentDescription); + if (message.creationDate != null && Object.hasOwnProperty.call(message, "creationDate")) + writer.uint32(/* id 4, wireType 2 =*/ 34).string(message.creationDate); + if (message.documentPages != null && Object.hasOwnProperty.call(message, "documentPages")) + writer.uint32(/* id 5, wireType 0 =*/ 40).int32(message.documentPages); + if (message.ipfs != null && Object.hasOwnProperty.call(message, "ipfs")) + $root.vereign.protobuf.qrcode_data.IpfsContentData_V1.encode(message.ipfs, writer.uint32(/* id 6, wireType 2 =*/ 50).fork()).ldelim(); + return writer; + }; + /** + * Encodes the specified DocumentData_V1 message, length delimited. Does not implicitly {@link vereign.protobuf.qrcode_data.DocumentData_V1.verify|verify} messages. + * @function encodeDelimited + * @memberof vereign.protobuf.qrcode_data.DocumentData_V1 + * @static + * @param {vereign.protobuf.qrcode_data.IDocumentData_V1} message DocumentData_V1 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DocumentData_V1.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + /** + * Decodes a DocumentData_V1 message from the specified reader or buffer. + * @function decode + * @memberof vereign.protobuf.qrcode_data.DocumentData_V1 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {vereign.protobuf.qrcode_data.DocumentData_V1} DocumentData_V1 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentData_V1.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.vereign.protobuf.qrcode_data.DocumentData_V1(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.author = reader.string(); + break; + case 2: + message.documentTitle = reader.string(); + break; + case 3: + message.documentDescription = reader.string(); + break; + case 4: + message.creationDate = reader.string(); + break; + case 5: + message.documentPages = reader.int32(); + break; + case 6: + message.ipfs = $root.vereign.protobuf.qrcode_data.IpfsContentData_V1.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + /** + * Decodes a DocumentData_V1 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof vereign.protobuf.qrcode_data.DocumentData_V1 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {vereign.protobuf.qrcode_data.DocumentData_V1} DocumentData_V1 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DocumentData_V1.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** + * Verifies a DocumentData_V1 message. + * @function verify + * @memberof vereign.protobuf.qrcode_data.DocumentData_V1 + * @static + * @param {Object.<string,*>} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DocumentData_V1.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.author != null && message.hasOwnProperty("author")) + if (!$util.isString(message.author)) + return "author: string expected"; + if (message.documentTitle != null && message.hasOwnProperty("documentTitle")) + if (!$util.isString(message.documentTitle)) + return "documentTitle: string expected"; + if (message.documentDescription != null && message.hasOwnProperty("documentDescription")) + if (!$util.isString(message.documentDescription)) + return "documentDescription: string expected"; + if (message.creationDate != null && message.hasOwnProperty("creationDate")) + if (!$util.isString(message.creationDate)) + return "creationDate: string expected"; + if (message.documentPages != null && message.hasOwnProperty("documentPages")) + if (!$util.isInteger(message.documentPages)) + return "documentPages: integer expected"; + if (message.ipfs != null && message.hasOwnProperty("ipfs")) { + var error = $root.vereign.protobuf.qrcode_data.IpfsContentData_V1.verify(message.ipfs); + if (error) + return "ipfs." + error; + } + return null; + }; + /** + * Creates a DocumentData_V1 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof vereign.protobuf.qrcode_data.DocumentData_V1 + * @static + * @param {Object.<string,*>} object Plain object + * @returns {vereign.protobuf.qrcode_data.DocumentData_V1} DocumentData_V1 + */ + DocumentData_V1.fromObject = function fromObject(object) { + if (object instanceof $root.vereign.protobuf.qrcode_data.DocumentData_V1) + return object; + var message = new $root.vereign.protobuf.qrcode_data.DocumentData_V1(); + if (object.author != null) + message.author = String(object.author); + if (object.documentTitle != null) + message.documentTitle = String(object.documentTitle); + if (object.documentDescription != null) + message.documentDescription = String(object.documentDescription); + if (object.creationDate != null) + message.creationDate = String(object.creationDate); + if (object.documentPages != null) + message.documentPages = object.documentPages | 0; + if (object.ipfs != null) { + if (typeof object.ipfs !== "object") + throw TypeError(".vereign.protobuf.qrcode_data.DocumentData_V1.ipfs: object expected"); + message.ipfs = $root.vereign.protobuf.qrcode_data.IpfsContentData_V1.fromObject(object.ipfs); + } + return message; + }; + /** + * Creates a plain object from a DocumentData_V1 message. Also converts values to other types if specified. + * @function toObject + * @memberof vereign.protobuf.qrcode_data.DocumentData_V1 + * @static + * @param {vereign.protobuf.qrcode_data.DocumentData_V1} message DocumentData_V1 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.<string,*>} Plain object + */ + DocumentData_V1.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.author = ""; + object.documentTitle = ""; + object.documentDescription = ""; + object.creationDate = ""; + object.documentPages = 0; + object.ipfs = null; + } + if (message.author != null && message.hasOwnProperty("author")) + object.author = message.author; + if (message.documentTitle != null && message.hasOwnProperty("documentTitle")) + object.documentTitle = message.documentTitle; + if (message.documentDescription != null && message.hasOwnProperty("documentDescription")) + object.documentDescription = message.documentDescription; + if (message.creationDate != null && message.hasOwnProperty("creationDate")) + object.creationDate = message.creationDate; + if (message.documentPages != null && message.hasOwnProperty("documentPages")) + object.documentPages = message.documentPages; + if (message.ipfs != null && message.hasOwnProperty("ipfs")) + object.ipfs = $root.vereign.protobuf.qrcode_data.IpfsContentData_V1.toObject(message.ipfs, options); + return object; + }; + /** + * Converts this DocumentData_V1 to JSON. + * @function toJSON + * @memberof vereign.protobuf.qrcode_data.DocumentData_V1 + * @instance + * @returns {Object.<string,*>} JSON object + */ + DocumentData_V1.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + return DocumentData_V1; + })(); + qrcode_data.SealDocumentHeadData_V1 = (function () { + /** + * Properties of a SealDocumentHeadData_V1. + * @memberof vereign.protobuf.qrcode_data + * @interface ISealDocumentHeadData_V1 + * @property {Uint8Array|null} [key] SealDocumentHeadData_V1 key + * @property {Uint8Array|null} [data] SealDocumentHeadData_V1 data + * @property {string|null} [ipfsIndexCid] SealDocumentHeadData_V1 ipfsIndexCid + */ + /** + * Constructs a new SealDocumentHeadData_V1. + * @memberof vereign.protobuf.qrcode_data + * @classdesc Reference + * https://community.vereign.com/t/seal-blockchain-status-storage-for-documents-and-beyond/371/6 + * Step 14 + * @implements ISealDocumentHeadData_V1 + * @constructor + * @param {vereign.protobuf.qrcode_data.ISealDocumentHeadData_V1=} [properties] Properties to set + */ + function SealDocumentHeadData_V1(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + /** + * SealDocumentHeadData_V1 key. + * @member {Uint8Array} key + * @memberof vereign.protobuf.qrcode_data.SealDocumentHeadData_V1 + * @instance + */ + SealDocumentHeadData_V1.prototype.key = $util.newBuffer([]); + /** + * SealDocumentHeadData_V1 data. + * @member {Uint8Array} data + * @memberof vereign.protobuf.qrcode_data.SealDocumentHeadData_V1 + * @instance + */ + SealDocumentHeadData_V1.prototype.data = $util.newBuffer([]); + /** + * SealDocumentHeadData_V1 ipfsIndexCid. + * @member {string} ipfsIndexCid + * @memberof vereign.protobuf.qrcode_data.SealDocumentHeadData_V1 + * @instance + */ + SealDocumentHeadData_V1.prototype.ipfsIndexCid = ""; + /** + * Creates a new SealDocumentHeadData_V1 instance using the specified properties. + * @function create + * @memberof vereign.protobuf.qrcode_data.SealDocumentHeadData_V1 + * @static + * @param {vereign.protobuf.qrcode_data.ISealDocumentHeadData_V1=} [properties] Properties to set + * @returns {vereign.protobuf.qrcode_data.SealDocumentHeadData_V1} SealDocumentHeadData_V1 instance + */ + SealDocumentHeadData_V1.create = function create(properties) { + return new SealDocumentHeadData_V1(properties); + }; + /** + * Encodes the specified SealDocumentHeadData_V1 message. Does not implicitly {@link vereign.protobuf.qrcode_data.SealDocumentHeadData_V1.verify|verify} messages. + * @function encode + * @memberof vereign.protobuf.qrcode_data.SealDocumentHeadData_V1 + * @static + * @param {vereign.protobuf.qrcode_data.ISealDocumentHeadData_V1} message SealDocumentHeadData_V1 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SealDocumentHeadData_V1.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.key != null && Object.hasOwnProperty.call(message, "key")) + writer.uint32(/* id 1, wireType 2 =*/ 10).bytes(message.key); + if (message.data != null && Object.hasOwnProperty.call(message, "data")) + writer.uint32(/* id 2, wireType 2 =*/ 18).bytes(message.data); + if (message.ipfsIndexCid != null && Object.hasOwnProperty.call(message, "ipfsIndexCid")) + writer.uint32(/* id 3, wireType 2 =*/ 26).string(message.ipfsIndexCid); + return writer; + }; + /** + * Encodes the specified SealDocumentHeadData_V1 message, length delimited. Does not implicitly {@link vereign.protobuf.qrcode_data.SealDocumentHeadData_V1.verify|verify} messages. + * @function encodeDelimited + * @memberof vereign.protobuf.qrcode_data.SealDocumentHeadData_V1 + * @static + * @param {vereign.protobuf.qrcode_data.ISealDocumentHeadData_V1} message SealDocumentHeadData_V1 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SealDocumentHeadData_V1.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + /** + * Decodes a SealDocumentHeadData_V1 message from the specified reader or buffer. + * @function decode + * @memberof vereign.protobuf.qrcode_data.SealDocumentHeadData_V1 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {vereign.protobuf.qrcode_data.SealDocumentHeadData_V1} SealDocumentHeadData_V1 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SealDocumentHeadData_V1.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.vereign.protobuf.qrcode_data.SealDocumentHeadData_V1(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.key = reader.bytes(); + break; + case 2: + message.data = reader.bytes(); + break; + case 3: + message.ipfsIndexCid = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + /** + * Decodes a SealDocumentHeadData_V1 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof vereign.protobuf.qrcode_data.SealDocumentHeadData_V1 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {vereign.protobuf.qrcode_data.SealDocumentHeadData_V1} SealDocumentHeadData_V1 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SealDocumentHeadData_V1.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** + * Verifies a SealDocumentHeadData_V1 message. + * @function verify + * @memberof vereign.protobuf.qrcode_data.SealDocumentHeadData_V1 + * @static + * @param {Object.<string,*>} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SealDocumentHeadData_V1.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.key != null && message.hasOwnProperty("key")) + if (!(message.key && typeof message.key.length === "number" || $util.isString(message.key))) + return "key: buffer expected"; + if (message.data != null && message.hasOwnProperty("data")) + if (!(message.data && typeof message.data.length === "number" || $util.isString(message.data))) + return "data: buffer expected"; + if (message.ipfsIndexCid != null && message.hasOwnProperty("ipfsIndexCid")) + if (!$util.isString(message.ipfsIndexCid)) + return "ipfsIndexCid: string expected"; + return null; + }; + /** + * Creates a SealDocumentHeadData_V1 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof vereign.protobuf.qrcode_data.SealDocumentHeadData_V1 + * @static + * @param {Object.<string,*>} object Plain object + * @returns {vereign.protobuf.qrcode_data.SealDocumentHeadData_V1} SealDocumentHeadData_V1 + */ + SealDocumentHeadData_V1.fromObject = function fromObject(object) { + if (object instanceof $root.vereign.protobuf.qrcode_data.SealDocumentHeadData_V1) + return object; + var message = new $root.vereign.protobuf.qrcode_data.SealDocumentHeadData_V1(); + if (object.key != null) + if (typeof object.key === "string") + $util.base64.decode(object.key, message.key = $util.newBuffer($util.base64.length(object.key)), 0); + else if (object.key.length) + message.key = object.key; + if (object.data != null) + if (typeof object.data === "string") + $util.base64.decode(object.data, message.data = $util.newBuffer($util.base64.length(object.data)), 0); + else if (object.data.length) + message.data = object.data; + if (object.ipfsIndexCid != null) + message.ipfsIndexCid = String(object.ipfsIndexCid); + return message; + }; + /** + * Creates a plain object from a SealDocumentHeadData_V1 message. Also converts values to other types if specified. + * @function toObject + * @memberof vereign.protobuf.qrcode_data.SealDocumentHeadData_V1 + * @static + * @param {vereign.protobuf.qrcode_data.SealDocumentHeadData_V1} message SealDocumentHeadData_V1 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.<string,*>} Plain object + */ + SealDocumentHeadData_V1.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.key = ""; + else { + object.key = []; + if (options.bytes !== Array) + object.key = $util.newBuffer(object.key); + } + if (options.bytes === String) + object.data = ""; + else { + object.data = []; + if (options.bytes !== Array) + object.data = $util.newBuffer(object.data); + } + object.ipfsIndexCid = ""; + } + if (message.key != null && message.hasOwnProperty("key")) + object.key = options.bytes === String ? $util.base64.encode(message.key, 0, message.key.length) : options.bytes === Array ? Array.prototype.slice.call(message.key) : message.key; + if (message.data != null && message.hasOwnProperty("data")) + object.data = options.bytes === String ? $util.base64.encode(message.data, 0, message.data.length) : options.bytes === Array ? Array.prototype.slice.call(message.data) : message.data; + if (message.ipfsIndexCid != null && message.hasOwnProperty("ipfsIndexCid")) + object.ipfsIndexCid = message.ipfsIndexCid; + return object; + }; + /** + * Converts this SealDocumentHeadData_V1 to JSON. + * @function toJSON + * @memberof vereign.protobuf.qrcode_data.SealDocumentHeadData_V1 + * @instance + * @returns {Object.<string,*>} JSON object + */ + SealDocumentHeadData_V1.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + return SealDocumentHeadData_V1; + })(); + qrcode_data.SealIndexObject_V1 = (function () { + /** + * Properties of a SealIndexObject_V1. + * @memberof vereign.protobuf.qrcode_data + * @interface ISealIndexObject_V1 + * @property {Uint8Array|null} [sealKey] SealIndexObject_V1 sealKey + * @property {string|null} [sealTailCid] SealIndexObject_V1 sealTailCid + * @property {string|null} [chain] SealIndexObject_V1 chain + * @property {string|null} [block] SealIndexObject_V1 block + * @property {string|null} [transactionId] SealIndexObject_V1 transactionId + * @property {string|null} [hashBatchId] SealIndexObject_V1 hashBatchId + */ + /** + * Constructs a new SealIndexObject_V1. + * @memberof vereign.protobuf.qrcode_data + * @classdesc Represents a SealIndexObject_V1. + * @implements ISealIndexObject_V1 + * @constructor + * @param {vereign.protobuf.qrcode_data.ISealIndexObject_V1=} [properties] Properties to set + */ + function SealIndexObject_V1(properties) { + if (properties) + for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) + if (properties[keys[i]] != null) + this[keys[i]] = properties[keys[i]]; + } + /** + * SealIndexObject_V1 sealKey. + * @member {Uint8Array} sealKey + * @memberof vereign.protobuf.qrcode_data.SealIndexObject_V1 + * @instance + */ + SealIndexObject_V1.prototype.sealKey = $util.newBuffer([]); + /** + * SealIndexObject_V1 sealTailCid. + * @member {string} sealTailCid + * @memberof vereign.protobuf.qrcode_data.SealIndexObject_V1 + * @instance + */ + SealIndexObject_V1.prototype.sealTailCid = ""; + /** + * SealIndexObject_V1 chain. + * @member {string} chain + * @memberof vereign.protobuf.qrcode_data.SealIndexObject_V1 + * @instance + */ + SealIndexObject_V1.prototype.chain = ""; + /** + * SealIndexObject_V1 block. + * @member {string} block + * @memberof vereign.protobuf.qrcode_data.SealIndexObject_V1 + * @instance + */ + SealIndexObject_V1.prototype.block = ""; + /** + * SealIndexObject_V1 transactionId. + * @member {string} transactionId + * @memberof vereign.protobuf.qrcode_data.SealIndexObject_V1 + * @instance + */ + SealIndexObject_V1.prototype.transactionId = ""; + /** + * SealIndexObject_V1 hashBatchId. + * @member {string} hashBatchId + * @memberof vereign.protobuf.qrcode_data.SealIndexObject_V1 + * @instance + */ + SealIndexObject_V1.prototype.hashBatchId = ""; + /** + * Creates a new SealIndexObject_V1 instance using the specified properties. + * @function create + * @memberof vereign.protobuf.qrcode_data.SealIndexObject_V1 + * @static + * @param {vereign.protobuf.qrcode_data.ISealIndexObject_V1=} [properties] Properties to set + * @returns {vereign.protobuf.qrcode_data.SealIndexObject_V1} SealIndexObject_V1 instance + */ + SealIndexObject_V1.create = function create(properties) { + return new SealIndexObject_V1(properties); + }; + /** + * Encodes the specified SealIndexObject_V1 message. Does not implicitly {@link vereign.protobuf.qrcode_data.SealIndexObject_V1.verify|verify} messages. + * @function encode + * @memberof vereign.protobuf.qrcode_data.SealIndexObject_V1 + * @static + * @param {vereign.protobuf.qrcode_data.ISealIndexObject_V1} message SealIndexObject_V1 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SealIndexObject_V1.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.sealKey != null && Object.hasOwnProperty.call(message, "sealKey")) + writer.uint32(/* id 1, wireType 2 =*/ 10).bytes(message.sealKey); + if (message.sealTailCid != null && Object.hasOwnProperty.call(message, "sealTailCid")) + writer.uint32(/* id 2, wireType 2 =*/ 18).string(message.sealTailCid); + if (message.chain != null && Object.hasOwnProperty.call(message, "chain")) + writer.uint32(/* id 3, wireType 2 =*/ 26).string(message.chain); + if (message.block != null && Object.hasOwnProperty.call(message, "block")) + writer.uint32(/* id 4, wireType 2 =*/ 34).string(message.block); + if (message.transactionId != null && Object.hasOwnProperty.call(message, "transactionId")) + writer.uint32(/* id 5, wireType 2 =*/ 42).string(message.transactionId); + if (message.hashBatchId != null && Object.hasOwnProperty.call(message, "hashBatchId")) + writer.uint32(/* id 6, wireType 2 =*/ 50).string(message.hashBatchId); + return writer; + }; + /** + * Encodes the specified SealIndexObject_V1 message, length delimited. Does not implicitly {@link vereign.protobuf.qrcode_data.SealIndexObject_V1.verify|verify} messages. + * @function encodeDelimited + * @memberof vereign.protobuf.qrcode_data.SealIndexObject_V1 + * @static + * @param {vereign.protobuf.qrcode_data.ISealIndexObject_V1} message SealIndexObject_V1 message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SealIndexObject_V1.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + /** + * Decodes a SealIndexObject_V1 message from the specified reader or buffer. + * @function decode + * @memberof vereign.protobuf.qrcode_data.SealIndexObject_V1 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {vereign.protobuf.qrcode_data.SealIndexObject_V1} SealIndexObject_V1 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SealIndexObject_V1.decode = function decode(reader, length) { + if (!(reader instanceof $Reader)) + reader = $Reader.create(reader); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.vereign.protobuf.qrcode_data.SealIndexObject_V1(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.sealKey = reader.bytes(); + break; + case 2: + message.sealTailCid = reader.string(); + break; + case 3: + message.chain = reader.string(); + break; + case 4: + message.block = reader.string(); + break; + case 5: + message.transactionId = reader.string(); + break; + case 6: + message.hashBatchId = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + /** + * Decodes a SealIndexObject_V1 message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof vereign.protobuf.qrcode_data.SealIndexObject_V1 + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {vereign.protobuf.qrcode_data.SealIndexObject_V1} SealIndexObject_V1 + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SealIndexObject_V1.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + /** + * Verifies a SealIndexObject_V1 message. + * @function verify + * @memberof vereign.protobuf.qrcode_data.SealIndexObject_V1 + * @static + * @param {Object.<string,*>} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SealIndexObject_V1.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.sealKey != null && message.hasOwnProperty("sealKey")) + if (!(message.sealKey && typeof message.sealKey.length === "number" || $util.isString(message.sealKey))) + return "sealKey: buffer expected"; + if (message.sealTailCid != null && message.hasOwnProperty("sealTailCid")) + if (!$util.isString(message.sealTailCid)) + return "sealTailCid: string expected"; + if (message.chain != null && message.hasOwnProperty("chain")) + if (!$util.isString(message.chain)) + return "chain: string expected"; + if (message.block != null && message.hasOwnProperty("block")) + if (!$util.isString(message.block)) + return "block: string expected"; + if (message.transactionId != null && message.hasOwnProperty("transactionId")) + if (!$util.isString(message.transactionId)) + return "transactionId: string expected"; + if (message.hashBatchId != null && message.hasOwnProperty("hashBatchId")) + if (!$util.isString(message.hashBatchId)) + return "hashBatchId: string expected"; + return null; + }; + /** + * Creates a SealIndexObject_V1 message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof vereign.protobuf.qrcode_data.SealIndexObject_V1 + * @static + * @param {Object.<string,*>} object Plain object + * @returns {vereign.protobuf.qrcode_data.SealIndexObject_V1} SealIndexObject_V1 + */ + SealIndexObject_V1.fromObject = function fromObject(object) { + if (object instanceof $root.vereign.protobuf.qrcode_data.SealIndexObject_V1) + return object; + var message = new $root.vereign.protobuf.qrcode_data.SealIndexObject_V1(); + if (object.sealKey != null) + if (typeof object.sealKey === "string") + $util.base64.decode(object.sealKey, message.sealKey = $util.newBuffer($util.base64.length(object.sealKey)), 0); + else if (object.sealKey.length) + message.sealKey = object.sealKey; + if (object.sealTailCid != null) + message.sealTailCid = String(object.sealTailCid); + if (object.chain != null) + message.chain = String(object.chain); + if (object.block != null) + message.block = String(object.block); + if (object.transactionId != null) + message.transactionId = String(object.transactionId); + if (object.hashBatchId != null) + message.hashBatchId = String(object.hashBatchId); + return message; + }; + /** + * Creates a plain object from a SealIndexObject_V1 message. Also converts values to other types if specified. + * @function toObject + * @memberof vereign.protobuf.qrcode_data.SealIndexObject_V1 + * @static + * @param {vereign.protobuf.qrcode_data.SealIndexObject_V1} message SealIndexObject_V1 + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.<string,*>} Plain object + */ + SealIndexObject_V1.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.sealKey = ""; + else { + object.sealKey = []; + if (options.bytes !== Array) + object.sealKey = $util.newBuffer(object.sealKey); + } + object.sealTailCid = ""; + object.chain = ""; + object.block = ""; + object.transactionId = ""; + object.hashBatchId = ""; + } + if (message.sealKey != null && message.hasOwnProperty("sealKey")) + object.sealKey = options.bytes === String ? $util.base64.encode(message.sealKey, 0, message.sealKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.sealKey) : message.sealKey; + if (message.sealTailCid != null && message.hasOwnProperty("sealTailCid")) + object.sealTailCid = message.sealTailCid; + if (message.chain != null && message.hasOwnProperty("chain")) + object.chain = message.chain; + if (message.block != null && message.hasOwnProperty("block")) + object.block = message.block; + if (message.transactionId != null && message.hasOwnProperty("transactionId")) + object.transactionId = message.transactionId; + if (message.hashBatchId != null && message.hasOwnProperty("hashBatchId")) + object.hashBatchId = message.hashBatchId; + return object; + }; + /** + * Converts this SealIndexObject_V1 to JSON. + * @function toJSON + * @memberof vereign.protobuf.qrcode_data.SealIndexObject_V1 + * @instance + * @returns {Object.<string,*>} JSON object + */ + SealIndexObject_V1.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + return SealIndexObject_V1; + })(); return qrcode_data; })(); return protobuf; diff --git a/dist/services/CryptoService/CryptoServiceNode.js b/dist/services/CryptoService/CryptoServiceNode.js index f789e304e709d2a7f8862a7f6d358e83b8b79f9c..4ec8219bf5980636fa6dabde71c8386664644e31 100644 --- a/dist/services/CryptoService/CryptoServiceNode.js +++ b/dist/services/CryptoService/CryptoServiceNode.js @@ -66,6 +66,9 @@ class CryptoServiceNode { Buffer.from(encrypted), Buffer.from(authTag), ]); + console.log({ key }); + console.log("key buffer", key.buffer); + console.log({ encryptedWithTag }); return { key: key.buffer, iv: iv.buffer, diff --git a/src/services/CryptoService/CryptoServiceNode.ts b/src/services/CryptoService/CryptoServiceNode.ts index c98ecf2187558d3e30df438d1601e3ed6de46d41..0be7495e386757ac87c82551ca8ccf78cf27c23c 100644 --- a/src/services/CryptoService/CryptoServiceNode.ts +++ b/src/services/CryptoService/CryptoServiceNode.ts @@ -46,6 +46,10 @@ class CryptoServiceNode implements ICryptoService { Buffer.from(authTag), ]); + console.log({ key }); + console.log("key buffer", key.buffer); + console.log({ encryptedWithTag }); + return { key: key.buffer, iv: iv.buffer,