From 13c02d59f68fc1f8054f68035c6288dc867a8389 Mon Sep 17 00:00:00 2001 From: Naq302 Date: Tue, 26 Aug 2025 11:26:50 +0930 Subject: [PATCH 1/7] fix: improve THORChain genMsgs.sh script robustness and error handling - Add comprehensive error handling with set -e and proper exit codes - Implement automatic cleanup with trap to prevent temp directory leaks - Add validation for proto file existence before processing - Enhance cosmos dependency handling with conditional download - Validate generated output files exist and are non-empty - Improve user feedback with success indicators and detailed error messages - Clean up empty error files automatically - Add proper error checking for git clone, curl download, and protobuf generation --- packages/xchain-mayachain/genMsgs.sh | 40 +- .../src/types/proto/MsgCompiled.d.ts | 3341 +++++ .../src/types/proto/MsgCompiled.js | 10115 ++++++++++++++++ packages/xchain-thorchain/genMsgs.sh | 92 +- .../src/types/proto/MsgCompiled.d.ts | 2071 ++++ .../src/types/proto/MsgCompiled.js | 5409 +++++++++ 6 files changed, 21045 insertions(+), 23 deletions(-) diff --git a/packages/xchain-mayachain/genMsgs.sh b/packages/xchain-mayachain/genMsgs.sh index 7082af057..1ed7bbc85 100755 --- a/packages/xchain-mayachain/genMsgs.sh +++ b/packages/xchain-mayachain/genMsgs.sh @@ -1,6 +1,6 @@ #!/bin/bash -# this script checks out mayanode master and generates the proto3 typescript buindings for MsgDeposit and MsgSend +# This script updates MAYAChain Protobuf bindings for MsgDeposit and MsgSend MSG_COMPILED_OUTPUTFILE=src/types/proto/MsgCompiled.js MSG_COMPILED_TYPES_OUTPUTFILE=src/types/proto/MsgCompiled.d.ts @@ -8,22 +8,48 @@ MSG_COMPILED_TYPES_OUTPUTFILE=src/types/proto/MsgCompiled.d.ts TMP_DIR=$(mktemp -d) tput setaf 2 -echo "Checking out https://gitlab.com/mayachain/mayanode to $TMP_DIR" +echo "Checking out https://gitlab.com/mayachain/mayanode to $TMP_DIR" tput sgr0 -(cd $TMP_DIR && git clone https://gitlab.com/mayachain/mayanode) +(cd "$TMP_DIR" && git clone https://gitlab.com/mayachain/mayanode) -# Generate msgs +# Verify proto files exist +tput setaf 2 +echo "Checking proto files" +tput sgr0 +ls "$TMP_DIR/mayanode/proto/mayachain/v1/common/common.proto" || echo "common.proto missing" +ls "$TMP_DIR/mayanode/proto/mayachain/v1/x/mayachain/types/msg_deposit.proto" || echo "msg_deposit.proto missing" +ls "$TMP_DIR/mayanode/proto/mayachain/v1/x/mayachain/types/msg_send.proto" || echo "msg_send.proto missing" + +# Download cosmos/base/v1beta1/coin.proto from cosmossdk if needed +if [ ! -f "$TMP_DIR/mayanode/third_party/proto/cosmos/base/v1beta1/coin.proto" ]; then + tput setaf 2 + echo "Downloading cosmos/base/v1beta1/coin.proto from cosmossdk" + tput sgr0 + mkdir -p "$TMP_DIR/mayanode/third_party/proto/cosmos/base/v1beta1" + curl -o "$TMP_DIR/mayanode/third_party/proto/cosmos/base/v1beta1/coin.proto" \ + "https://raw.githubusercontent.com/cosmos/cosmos-sdk/main/proto/cosmos/base/v1beta1/coin.proto" +fi + +# Generate Protobuf JS bindings with include path tput setaf 2 echo "Generating $MSG_COMPILED_OUTPUTFILE" tput sgr0 -yarn run pbjs -w commonjs -t static-module $TMP_DIR/mayanode/proto/mayachain/v1/common/common.proto $TMP_DIR/mayanode/proto/mayachain/v1/x/mayachain/types/msg_deposit.proto $TMP_DIR/mayanode/proto/mayachain/v1/x/mayachain/types/msg_send.proto $TMP_DIR/mayanode/third_party/proto/cosmos/base/v1beta1/coin.proto -o $MSG_COMPILED_OUTPUTFILE +yarn pbjs -w commonjs -t static-module \ + -p "$TMP_DIR/mayanode/proto" \ + -p "$TMP_DIR/mayanode/third_party/proto" \ + "$TMP_DIR/mayanode/proto/mayachain/v1/common/common.proto" \ + "$TMP_DIR/mayanode/proto/mayachain/v1/x/mayachain/types/msg_deposit.proto" \ + "$TMP_DIR/mayanode/proto/mayachain/v1/x/mayachain/types/msg_send.proto" \ + "$TMP_DIR/mayanode/third_party/proto/cosmos/base/v1beta1/coin.proto" \ + -o "$MSG_COMPILED_OUTPUTFILE" 2>pbjs_errors.txt +# Generate TypeScript definitions tput setaf 2 echo "Generating $MSG_COMPILED_TYPES_OUTPUTFILE" tput sgr0 -yarn run pbts $MSG_COMPILED_OUTPUTFILE -o $MSG_COMPILED_TYPES_OUTPUTFILE +yarn pbts "$MSG_COMPILED_OUTPUTFILE" -o "$MSG_COMPILED_TYPES_OUTPUTFILE" 2>pbts_errors.txt tput setaf 2 echo "Removing $TMP_DIR/mayanode" tput sgr0 -rm -rf $TMP_DIR +rm -rf "$TMP_DIR" diff --git a/packages/xchain-mayachain/src/types/proto/MsgCompiled.d.ts b/packages/xchain-mayachain/src/types/proto/MsgCompiled.d.ts index 9ee549297..74e2546eb 100644 --- a/packages/xchain-mayachain/src/types/proto/MsgCompiled.d.ts +++ b/packages/xchain-mayachain/src/types/proto/MsgCompiled.d.ts @@ -627,6 +627,3347 @@ export namespace common { } } +/** Namespace google. */ +export namespace google { + + /** Namespace protobuf. */ + namespace protobuf { + + /** Properties of a FileDescriptorSet. */ + interface IFileDescriptorSet { + + /** FileDescriptorSet file */ + file?: (google.protobuf.IFileDescriptorProto[]|null); + } + + /** Represents a FileDescriptorSet. */ + class FileDescriptorSet implements IFileDescriptorSet { + + /** + * Constructs a new FileDescriptorSet. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorSet); + + /** FileDescriptorSet file. */ + public file: google.protobuf.IFileDescriptorProto[]; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorSet instance + */ + public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @param message FileDescriptorSet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; + + /** + * Verifies a FileDescriptorSet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorSet + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @param message FileDescriptorSet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorSet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FileDescriptorProto. */ + interface IFileDescriptorProto { + + /** FileDescriptorProto name */ + name?: (string|null); + + /** FileDescriptorProto package */ + "package"?: (string|null); + + /** FileDescriptorProto dependency */ + dependency?: (string[]|null); + + /** FileDescriptorProto publicDependency */ + publicDependency?: (number[]|null); + + /** FileDescriptorProto weakDependency */ + weakDependency?: (number[]|null); + + /** FileDescriptorProto messageType */ + messageType?: (google.protobuf.IDescriptorProto[]|null); + + /** FileDescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** FileDescriptorProto service */ + service?: (google.protobuf.IServiceDescriptorProto[]|null); + + /** FileDescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** FileDescriptorProto options */ + options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo */ + sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax */ + syntax?: (string|null); + } + + /** Represents a FileDescriptorProto. */ + class FileDescriptorProto implements IFileDescriptorProto { + + /** + * Constructs a new FileDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileDescriptorProto); + + /** FileDescriptorProto name. */ + public name: string; + + /** FileDescriptorProto package. */ + public package: string; + + /** FileDescriptorProto dependency. */ + public dependency: string[]; + + /** FileDescriptorProto publicDependency. */ + public publicDependency: number[]; + + /** FileDescriptorProto weakDependency. */ + public weakDependency: number[]; + + /** FileDescriptorProto messageType. */ + public messageType: google.protobuf.IDescriptorProto[]; + + /** FileDescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** FileDescriptorProto service. */ + public service: google.protobuf.IServiceDescriptorProto[]; + + /** FileDescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** FileDescriptorProto options. */ + public options?: (google.protobuf.IFileOptions|null); + + /** FileDescriptorProto sourceCodeInfo. */ + public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); + + /** FileDescriptorProto syntax. */ + public syntax: string; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FileDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @param message FileDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; + + /** + * Verifies a FileDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @param message FileDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a DescriptorProto. */ + interface IDescriptorProto { + + /** DescriptorProto name */ + name?: (string|null); + + /** DescriptorProto field */ + field?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto extension */ + extension?: (google.protobuf.IFieldDescriptorProto[]|null); + + /** DescriptorProto nestedType */ + nestedType?: (google.protobuf.IDescriptorProto[]|null); + + /** DescriptorProto enumType */ + enumType?: (google.protobuf.IEnumDescriptorProto[]|null); + + /** DescriptorProto extensionRange */ + extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); + + /** DescriptorProto oneofDecl */ + oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); + + /** DescriptorProto options */ + options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange */ + reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); + + /** DescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents a DescriptorProto. */ + class DescriptorProto implements IDescriptorProto { + + /** + * Constructs a new DescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IDescriptorProto); + + /** DescriptorProto name. */ + public name: string; + + /** DescriptorProto field. */ + public field: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto extension. */ + public extension: google.protobuf.IFieldDescriptorProto[]; + + /** DescriptorProto nestedType. */ + public nestedType: google.protobuf.IDescriptorProto[]; + + /** DescriptorProto enumType. */ + public enumType: google.protobuf.IEnumDescriptorProto[]; + + /** DescriptorProto extensionRange. */ + public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; + + /** DescriptorProto oneofDecl. */ + public oneofDecl: google.protobuf.IOneofDescriptorProto[]; + + /** DescriptorProto options. */ + public options?: (google.protobuf.IMessageOptions|null); + + /** DescriptorProto reservedRange. */ + public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; + + /** DescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns DescriptorProto instance + */ + public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @param message DescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; + + /** + * Verifies a DescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns DescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @param message DescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this DescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace DescriptorProto { + + /** Properties of an ExtensionRange. */ + interface IExtensionRange { + + /** ExtensionRange start */ + start?: (number|null); + + /** ExtensionRange end */ + end?: (number|null); + + /** ExtensionRange options */ + options?: (google.protobuf.IExtensionRangeOptions|null); + } + + /** Represents an ExtensionRange. */ + class ExtensionRange implements IExtensionRange { + + /** + * Constructs a new ExtensionRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); + + /** ExtensionRange start. */ + public start: number; + + /** ExtensionRange end. */ + public end: number; + + /** ExtensionRange options. */ + public options?: (google.protobuf.IExtensionRangeOptions|null); + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @param message ExtensionRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Verifies an ExtensionRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @param message ExtensionRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ReservedRange. */ + interface IReservedRange { + + /** ReservedRange start */ + start?: (number|null); + + /** ReservedRange end */ + end?: (number|null); + } + + /** Represents a ReservedRange. */ + class ReservedRange implements IReservedRange { + + /** + * Constructs a new ReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); + + /** ReservedRange start. */ + public start: number; + + /** ReservedRange end. */ + public end: number; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns ReservedRange instance + */ + public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @param message ReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Verifies a ReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @param message ReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of an ExtensionRangeOptions. */ + interface IExtensionRangeOptions { + + /** ExtensionRangeOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an ExtensionRangeOptions. */ + class ExtensionRangeOptions implements IExtensionRangeOptions { + + /** + * Constructs a new ExtensionRangeOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IExtensionRangeOptions); + + /** ExtensionRangeOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ExtensionRangeOptions instance + */ + public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @param message ExtensionRangeOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; + + /** + * Verifies an ExtensionRangeOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ExtensionRangeOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @param message ExtensionRangeOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FieldDescriptorProto. */ + interface IFieldDescriptorProto { + + /** FieldDescriptorProto name */ + name?: (string|null); + + /** FieldDescriptorProto number */ + number?: (number|null); + + /** FieldDescriptorProto label */ + label?: (google.protobuf.FieldDescriptorProto.Label|null); + + /** FieldDescriptorProto type */ + type?: (google.protobuf.FieldDescriptorProto.Type|null); + + /** FieldDescriptorProto typeName */ + typeName?: (string|null); + + /** FieldDescriptorProto extendee */ + extendee?: (string|null); + + /** FieldDescriptorProto defaultValue */ + defaultValue?: (string|null); + + /** FieldDescriptorProto oneofIndex */ + oneofIndex?: (number|null); + + /** FieldDescriptorProto jsonName */ + jsonName?: (string|null); + + /** FieldDescriptorProto options */ + options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional */ + proto3Optional?: (boolean|null); + } + + /** Represents a FieldDescriptorProto. */ + class FieldDescriptorProto implements IFieldDescriptorProto { + + /** + * Constructs a new FieldDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldDescriptorProto); + + /** FieldDescriptorProto name. */ + public name: string; + + /** FieldDescriptorProto number. */ + public number: number; + + /** FieldDescriptorProto label. */ + public label: google.protobuf.FieldDescriptorProto.Label; + + /** FieldDescriptorProto type. */ + public type: google.protobuf.FieldDescriptorProto.Type; + + /** FieldDescriptorProto typeName. */ + public typeName: string; + + /** FieldDescriptorProto extendee. */ + public extendee: string; + + /** FieldDescriptorProto defaultValue. */ + public defaultValue: string; + + /** FieldDescriptorProto oneofIndex. */ + public oneofIndex: number; + + /** FieldDescriptorProto jsonName. */ + public jsonName: string; + + /** FieldDescriptorProto options. */ + public options?: (google.protobuf.IFieldOptions|null); + + /** FieldDescriptorProto proto3Optional. */ + public proto3Optional: boolean; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldDescriptorProto instance + */ + public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @param message FieldDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; + + /** + * Verifies a FieldDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @param message FieldDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace FieldDescriptorProto { + + /** Type enum. */ + enum Type { + TYPE_DOUBLE = 1, + TYPE_FLOAT = 2, + TYPE_INT64 = 3, + TYPE_UINT64 = 4, + TYPE_INT32 = 5, + TYPE_FIXED64 = 6, + TYPE_FIXED32 = 7, + TYPE_BOOL = 8, + TYPE_STRING = 9, + TYPE_GROUP = 10, + TYPE_MESSAGE = 11, + TYPE_BYTES = 12, + TYPE_UINT32 = 13, + TYPE_ENUM = 14, + TYPE_SFIXED32 = 15, + TYPE_SFIXED64 = 16, + TYPE_SINT32 = 17, + TYPE_SINT64 = 18 + } + + /** Label enum. */ + enum Label { + LABEL_OPTIONAL = 1, + LABEL_REQUIRED = 2, + LABEL_REPEATED = 3 + } + } + + /** Properties of an OneofDescriptorProto. */ + interface IOneofDescriptorProto { + + /** OneofDescriptorProto name */ + name?: (string|null); + + /** OneofDescriptorProto options */ + options?: (google.protobuf.IOneofOptions|null); + } + + /** Represents an OneofDescriptorProto. */ + class OneofDescriptorProto implements IOneofDescriptorProto { + + /** + * Constructs a new OneofDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofDescriptorProto); + + /** OneofDescriptorProto name. */ + public name: string; + + /** OneofDescriptorProto options. */ + public options?: (google.protobuf.IOneofOptions|null); + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofDescriptorProto instance + */ + public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @param message OneofDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; + + /** + * Verifies an OneofDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @param message OneofDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an EnumDescriptorProto. */ + interface IEnumDescriptorProto { + + /** EnumDescriptorProto name */ + name?: (string|null); + + /** EnumDescriptorProto value */ + value?: (google.protobuf.IEnumValueDescriptorProto[]|null); + + /** EnumDescriptorProto options */ + options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange */ + reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); + + /** EnumDescriptorProto reservedName */ + reservedName?: (string[]|null); + } + + /** Represents an EnumDescriptorProto. */ + class EnumDescriptorProto implements IEnumDescriptorProto { + + /** + * Constructs a new EnumDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumDescriptorProto); + + /** EnumDescriptorProto name. */ + public name: string; + + /** EnumDescriptorProto value. */ + public value: google.protobuf.IEnumValueDescriptorProto[]; + + /** EnumDescriptorProto options. */ + public options?: (google.protobuf.IEnumOptions|null); + + /** EnumDescriptorProto reservedRange. */ + public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; + + /** EnumDescriptorProto reservedName. */ + public reservedName: string[]; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @param message EnumDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; + + /** + * Verifies an EnumDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @param message EnumDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace EnumDescriptorProto { + + /** Properties of an EnumReservedRange. */ + interface IEnumReservedRange { + + /** EnumReservedRange start */ + start?: (number|null); + + /** EnumReservedRange end */ + end?: (number|null); + } + + /** Represents an EnumReservedRange. */ + class EnumReservedRange implements IEnumReservedRange { + + /** + * Constructs a new EnumReservedRange. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); + + /** EnumReservedRange start. */ + public start: number; + + /** EnumReservedRange end. */ + public end: number; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumReservedRange instance + */ + public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @param message EnumReservedRange message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Verifies an EnumReservedRange message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumReservedRange + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @param message EnumReservedRange + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumReservedRange to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of an EnumValueDescriptorProto. */ + interface IEnumValueDescriptorProto { + + /** EnumValueDescriptorProto name */ + name?: (string|null); + + /** EnumValueDescriptorProto number */ + number?: (number|null); + + /** EnumValueDescriptorProto options */ + options?: (google.protobuf.IEnumValueOptions|null); + } + + /** Represents an EnumValueDescriptorProto. */ + class EnumValueDescriptorProto implements IEnumValueDescriptorProto { + + /** + * Constructs a new EnumValueDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueDescriptorProto); + + /** EnumValueDescriptorProto name. */ + public name: string; + + /** EnumValueDescriptorProto number. */ + public number: number; + + /** EnumValueDescriptorProto options. */ + public options?: (google.protobuf.IEnumValueOptions|null); + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueDescriptorProto instance + */ + public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @param message EnumValueDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; + + /** + * Verifies an EnumValueDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @param message EnumValueDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ServiceDescriptorProto. */ + interface IServiceDescriptorProto { + + /** ServiceDescriptorProto name */ + name?: (string|null); + + /** ServiceDescriptorProto method */ + method?: (google.protobuf.IMethodDescriptorProto[]|null); + + /** ServiceDescriptorProto options */ + options?: (google.protobuf.IServiceOptions|null); + } + + /** Represents a ServiceDescriptorProto. */ + class ServiceDescriptorProto implements IServiceDescriptorProto { + + /** + * Constructs a new ServiceDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceDescriptorProto); + + /** ServiceDescriptorProto name. */ + public name: string; + + /** ServiceDescriptorProto method. */ + public method: google.protobuf.IMethodDescriptorProto[]; + + /** ServiceDescriptorProto options. */ + public options?: (google.protobuf.IServiceOptions|null); + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceDescriptorProto instance + */ + public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @param message ServiceDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; + + /** + * Verifies a ServiceDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @param message ServiceDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a MethodDescriptorProto. */ + interface IMethodDescriptorProto { + + /** MethodDescriptorProto name */ + name?: (string|null); + + /** MethodDescriptorProto inputType */ + inputType?: (string|null); + + /** MethodDescriptorProto outputType */ + outputType?: (string|null); + + /** MethodDescriptorProto options */ + options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming */ + clientStreaming?: (boolean|null); + + /** MethodDescriptorProto serverStreaming */ + serverStreaming?: (boolean|null); + } + + /** Represents a MethodDescriptorProto. */ + class MethodDescriptorProto implements IMethodDescriptorProto { + + /** + * Constructs a new MethodDescriptorProto. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodDescriptorProto); + + /** MethodDescriptorProto name. */ + public name: string; + + /** MethodDescriptorProto inputType. */ + public inputType: string; + + /** MethodDescriptorProto outputType. */ + public outputType: string; + + /** MethodDescriptorProto options. */ + public options?: (google.protobuf.IMethodOptions|null); + + /** MethodDescriptorProto clientStreaming. */ + public clientStreaming: boolean; + + /** MethodDescriptorProto serverStreaming. */ + public serverStreaming: boolean; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodDescriptorProto instance + */ + public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @param message MethodDescriptorProto message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; + + /** + * Verifies a MethodDescriptorProto message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodDescriptorProto + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @param message MethodDescriptorProto + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FileOptions. */ + interface IFileOptions { + + /** FileOptions javaPackage */ + javaPackage?: (string|null); + + /** FileOptions javaOuterClassname */ + javaOuterClassname?: (string|null); + + /** FileOptions javaMultipleFiles */ + javaMultipleFiles?: (boolean|null); + + /** FileOptions javaGenerateEqualsAndHash */ + javaGenerateEqualsAndHash?: (boolean|null); + + /** FileOptions javaStringCheckUtf8 */ + javaStringCheckUtf8?: (boolean|null); + + /** FileOptions optimizeFor */ + optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|null); + + /** FileOptions goPackage */ + goPackage?: (string|null); + + /** FileOptions ccGenericServices */ + ccGenericServices?: (boolean|null); + + /** FileOptions javaGenericServices */ + javaGenericServices?: (boolean|null); + + /** FileOptions pyGenericServices */ + pyGenericServices?: (boolean|null); + + /** FileOptions phpGenericServices */ + phpGenericServices?: (boolean|null); + + /** FileOptions deprecated */ + deprecated?: (boolean|null); + + /** FileOptions ccEnableArenas */ + ccEnableArenas?: (boolean|null); + + /** FileOptions objcClassPrefix */ + objcClassPrefix?: (string|null); + + /** FileOptions csharpNamespace */ + csharpNamespace?: (string|null); + + /** FileOptions swiftPrefix */ + swiftPrefix?: (string|null); + + /** FileOptions phpClassPrefix */ + phpClassPrefix?: (string|null); + + /** FileOptions phpNamespace */ + phpNamespace?: (string|null); + + /** FileOptions phpMetadataNamespace */ + phpMetadataNamespace?: (string|null); + + /** FileOptions rubyPackage */ + rubyPackage?: (string|null); + + /** FileOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FileOptions .gogoproto.goprotoGettersAll */ + ".gogoproto.goprotoGettersAll"?: (boolean|null); + + /** FileOptions .gogoproto.goprotoEnumPrefixAll */ + ".gogoproto.goprotoEnumPrefixAll"?: (boolean|null); + + /** FileOptions .gogoproto.goprotoStringerAll */ + ".gogoproto.goprotoStringerAll"?: (boolean|null); + + /** FileOptions .gogoproto.verboseEqualAll */ + ".gogoproto.verboseEqualAll"?: (boolean|null); + + /** FileOptions .gogoproto.faceAll */ + ".gogoproto.faceAll"?: (boolean|null); + + /** FileOptions .gogoproto.gostringAll */ + ".gogoproto.gostringAll"?: (boolean|null); + + /** FileOptions .gogoproto.populateAll */ + ".gogoproto.populateAll"?: (boolean|null); + + /** FileOptions .gogoproto.stringerAll */ + ".gogoproto.stringerAll"?: (boolean|null); + + /** FileOptions .gogoproto.onlyoneAll */ + ".gogoproto.onlyoneAll"?: (boolean|null); + + /** FileOptions .gogoproto.equalAll */ + ".gogoproto.equalAll"?: (boolean|null); + + /** FileOptions .gogoproto.descriptionAll */ + ".gogoproto.descriptionAll"?: (boolean|null); + + /** FileOptions .gogoproto.testgenAll */ + ".gogoproto.testgenAll"?: (boolean|null); + + /** FileOptions .gogoproto.benchgenAll */ + ".gogoproto.benchgenAll"?: (boolean|null); + + /** FileOptions .gogoproto.marshalerAll */ + ".gogoproto.marshalerAll"?: (boolean|null); + + /** FileOptions .gogoproto.unmarshalerAll */ + ".gogoproto.unmarshalerAll"?: (boolean|null); + + /** FileOptions .gogoproto.stableMarshalerAll */ + ".gogoproto.stableMarshalerAll"?: (boolean|null); + + /** FileOptions .gogoproto.sizerAll */ + ".gogoproto.sizerAll"?: (boolean|null); + + /** FileOptions .gogoproto.goprotoEnumStringerAll */ + ".gogoproto.goprotoEnumStringerAll"?: (boolean|null); + + /** FileOptions .gogoproto.enumStringerAll */ + ".gogoproto.enumStringerAll"?: (boolean|null); + + /** FileOptions .gogoproto.unsafeMarshalerAll */ + ".gogoproto.unsafeMarshalerAll"?: (boolean|null); + + /** FileOptions .gogoproto.unsafeUnmarshalerAll */ + ".gogoproto.unsafeUnmarshalerAll"?: (boolean|null); + + /** FileOptions .gogoproto.goprotoExtensionsMapAll */ + ".gogoproto.goprotoExtensionsMapAll"?: (boolean|null); + + /** FileOptions .gogoproto.goprotoUnrecognizedAll */ + ".gogoproto.goprotoUnrecognizedAll"?: (boolean|null); + + /** FileOptions .gogoproto.gogoprotoImport */ + ".gogoproto.gogoprotoImport"?: (boolean|null); + + /** FileOptions .gogoproto.protosizerAll */ + ".gogoproto.protosizerAll"?: (boolean|null); + + /** FileOptions .gogoproto.compareAll */ + ".gogoproto.compareAll"?: (boolean|null); + + /** FileOptions .gogoproto.typedeclAll */ + ".gogoproto.typedeclAll"?: (boolean|null); + + /** FileOptions .gogoproto.enumdeclAll */ + ".gogoproto.enumdeclAll"?: (boolean|null); + + /** FileOptions .gogoproto.goprotoRegistration */ + ".gogoproto.goprotoRegistration"?: (boolean|null); + + /** FileOptions .gogoproto.messagenameAll */ + ".gogoproto.messagenameAll"?: (boolean|null); + + /** FileOptions .gogoproto.goprotoSizecacheAll */ + ".gogoproto.goprotoSizecacheAll"?: (boolean|null); + + /** FileOptions .gogoproto.goprotoUnkeyedAll */ + ".gogoproto.goprotoUnkeyedAll"?: (boolean|null); + } + + /** Represents a FileOptions. */ + class FileOptions implements IFileOptions { + + /** + * Constructs a new FileOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFileOptions); + + /** FileOptions javaPackage. */ + public javaPackage: string; + + /** FileOptions javaOuterClassname. */ + public javaOuterClassname: string; + + /** FileOptions javaMultipleFiles. */ + public javaMultipleFiles: boolean; + + /** FileOptions javaGenerateEqualsAndHash. */ + public javaGenerateEqualsAndHash: boolean; + + /** FileOptions javaStringCheckUtf8. */ + public javaStringCheckUtf8: boolean; + + /** FileOptions optimizeFor. */ + public optimizeFor: google.protobuf.FileOptions.OptimizeMode; + + /** FileOptions goPackage. */ + public goPackage: string; + + /** FileOptions ccGenericServices. */ + public ccGenericServices: boolean; + + /** FileOptions javaGenericServices. */ + public javaGenericServices: boolean; + + /** FileOptions pyGenericServices. */ + public pyGenericServices: boolean; + + /** FileOptions phpGenericServices. */ + public phpGenericServices: boolean; + + /** FileOptions deprecated. */ + public deprecated: boolean; + + /** FileOptions ccEnableArenas. */ + public ccEnableArenas: boolean; + + /** FileOptions objcClassPrefix. */ + public objcClassPrefix: string; + + /** FileOptions csharpNamespace. */ + public csharpNamespace: string; + + /** FileOptions swiftPrefix. */ + public swiftPrefix: string; + + /** FileOptions phpClassPrefix. */ + public phpClassPrefix: string; + + /** FileOptions phpNamespace. */ + public phpNamespace: string; + + /** FileOptions phpMetadataNamespace. */ + public phpMetadataNamespace: string; + + /** FileOptions rubyPackage. */ + public rubyPackage: string; + + /** FileOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FileOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FileOptions instance + */ + public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @param message FileOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; + + /** + * Verifies a FileOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FileOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @param message FileOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FileOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace FileOptions { + + /** OptimizeMode enum. */ + enum OptimizeMode { + SPEED = 1, + CODE_SIZE = 2, + LITE_RUNTIME = 3 + } + } + + /** Properties of a MessageOptions. */ + interface IMessageOptions { + + /** MessageOptions messageSetWireFormat */ + messageSetWireFormat?: (boolean|null); + + /** MessageOptions noStandardDescriptorAccessor */ + noStandardDescriptorAccessor?: (boolean|null); + + /** MessageOptions deprecated */ + deprecated?: (boolean|null); + + /** MessageOptions mapEntry */ + mapEntry?: (boolean|null); + + /** MessageOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** MessageOptions .gogoproto.goprotoGetters */ + ".gogoproto.goprotoGetters"?: (boolean|null); + + /** MessageOptions .gogoproto.goprotoStringer */ + ".gogoproto.goprotoStringer"?: (boolean|null); + + /** MessageOptions .gogoproto.verboseEqual */ + ".gogoproto.verboseEqual"?: (boolean|null); + + /** MessageOptions .gogoproto.face */ + ".gogoproto.face"?: (boolean|null); + + /** MessageOptions .gogoproto.gostring */ + ".gogoproto.gostring"?: (boolean|null); + + /** MessageOptions .gogoproto.populate */ + ".gogoproto.populate"?: (boolean|null); + + /** MessageOptions .gogoproto.stringer */ + ".gogoproto.stringer"?: (boolean|null); + + /** MessageOptions .gogoproto.onlyone */ + ".gogoproto.onlyone"?: (boolean|null); + + /** MessageOptions .gogoproto.equal */ + ".gogoproto.equal"?: (boolean|null); + + /** MessageOptions .gogoproto.description */ + ".gogoproto.description"?: (boolean|null); + + /** MessageOptions .gogoproto.testgen */ + ".gogoproto.testgen"?: (boolean|null); + + /** MessageOptions .gogoproto.benchgen */ + ".gogoproto.benchgen"?: (boolean|null); + + /** MessageOptions .gogoproto.marshaler */ + ".gogoproto.marshaler"?: (boolean|null); + + /** MessageOptions .gogoproto.unmarshaler */ + ".gogoproto.unmarshaler"?: (boolean|null); + + /** MessageOptions .gogoproto.stableMarshaler */ + ".gogoproto.stableMarshaler"?: (boolean|null); + + /** MessageOptions .gogoproto.sizer */ + ".gogoproto.sizer"?: (boolean|null); + + /** MessageOptions .gogoproto.unsafeMarshaler */ + ".gogoproto.unsafeMarshaler"?: (boolean|null); + + /** MessageOptions .gogoproto.unsafeUnmarshaler */ + ".gogoproto.unsafeUnmarshaler"?: (boolean|null); + + /** MessageOptions .gogoproto.goprotoExtensionsMap */ + ".gogoproto.goprotoExtensionsMap"?: (boolean|null); + + /** MessageOptions .gogoproto.goprotoUnrecognized */ + ".gogoproto.goprotoUnrecognized"?: (boolean|null); + + /** MessageOptions .gogoproto.protosizer */ + ".gogoproto.protosizer"?: (boolean|null); + + /** MessageOptions .gogoproto.compare */ + ".gogoproto.compare"?: (boolean|null); + + /** MessageOptions .gogoproto.typedecl */ + ".gogoproto.typedecl"?: (boolean|null); + + /** MessageOptions .gogoproto.messagename */ + ".gogoproto.messagename"?: (boolean|null); + + /** MessageOptions .gogoproto.goprotoSizecache */ + ".gogoproto.goprotoSizecache"?: (boolean|null); + + /** MessageOptions .gogoproto.goprotoUnkeyed */ + ".gogoproto.goprotoUnkeyed"?: (boolean|null); + } + + /** Represents a MessageOptions. */ + class MessageOptions implements IMessageOptions { + + /** + * Constructs a new MessageOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMessageOptions); + + /** MessageOptions messageSetWireFormat. */ + public messageSetWireFormat: boolean; + + /** MessageOptions noStandardDescriptorAccessor. */ + public noStandardDescriptorAccessor: boolean; + + /** MessageOptions deprecated. */ + public deprecated: boolean; + + /** MessageOptions mapEntry. */ + public mapEntry: boolean; + + /** MessageOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MessageOptions instance + */ + public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @param message MessageOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; + + /** + * Verifies a MessageOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MessageOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @param message MessageOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MessageOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a FieldOptions. */ + interface IFieldOptions { + + /** FieldOptions ctype */ + ctype?: (google.protobuf.FieldOptions.CType|null); + + /** FieldOptions packed */ + packed?: (boolean|null); + + /** FieldOptions jstype */ + jstype?: (google.protobuf.FieldOptions.JSType|null); + + /** FieldOptions lazy */ + lazy?: (boolean|null); + + /** FieldOptions deprecated */ + deprecated?: (boolean|null); + + /** FieldOptions weak */ + weak?: (boolean|null); + + /** FieldOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** FieldOptions .gogoproto.nullable */ + ".gogoproto.nullable"?: (boolean|null); + + /** FieldOptions .gogoproto.embed */ + ".gogoproto.embed"?: (boolean|null); + + /** FieldOptions .gogoproto.customtype */ + ".gogoproto.customtype"?: (string|null); + + /** FieldOptions .gogoproto.customname */ + ".gogoproto.customname"?: (string|null); + + /** FieldOptions .gogoproto.jsontag */ + ".gogoproto.jsontag"?: (string|null); + + /** FieldOptions .gogoproto.moretags */ + ".gogoproto.moretags"?: (string|null); + + /** FieldOptions .gogoproto.casttype */ + ".gogoproto.casttype"?: (string|null); + + /** FieldOptions .gogoproto.castkey */ + ".gogoproto.castkey"?: (string|null); + + /** FieldOptions .gogoproto.castvalue */ + ".gogoproto.castvalue"?: (string|null); + + /** FieldOptions .gogoproto.stdtime */ + ".gogoproto.stdtime"?: (boolean|null); + + /** FieldOptions .gogoproto.stdduration */ + ".gogoproto.stdduration"?: (boolean|null); + + /** FieldOptions .gogoproto.wktpointer */ + ".gogoproto.wktpointer"?: (boolean|null); + + /** FieldOptions .gogoproto.castrepeated */ + ".gogoproto.castrepeated"?: (string|null); + } + + /** Represents a FieldOptions. */ + class FieldOptions implements IFieldOptions { + + /** + * Constructs a new FieldOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IFieldOptions); + + /** FieldOptions ctype. */ + public ctype: google.protobuf.FieldOptions.CType; + + /** FieldOptions packed. */ + public packed: boolean; + + /** FieldOptions jstype. */ + public jstype: google.protobuf.FieldOptions.JSType; + + /** FieldOptions lazy. */ + public lazy: boolean; + + /** FieldOptions deprecated. */ + public deprecated: boolean; + + /** FieldOptions weak. */ + public weak: boolean; + + /** FieldOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns FieldOptions instance + */ + public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @param message FieldOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; + + /** + * Verifies a FieldOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns FieldOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @param message FieldOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this FieldOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace FieldOptions { + + /** CType enum. */ + enum CType { + STRING = 0, + CORD = 1, + STRING_PIECE = 2 + } + + /** JSType enum. */ + enum JSType { + JS_NORMAL = 0, + JS_STRING = 1, + JS_NUMBER = 2 + } + } + + /** Properties of an OneofOptions. */ + interface IOneofOptions { + + /** OneofOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents an OneofOptions. */ + class OneofOptions implements IOneofOptions { + + /** + * Constructs a new OneofOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IOneofOptions); + + /** OneofOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns OneofOptions instance + */ + public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @param message OneofOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; + + /** + * Verifies an OneofOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OneofOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @param message OneofOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OneofOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an EnumOptions. */ + interface IEnumOptions { + + /** EnumOptions allowAlias */ + allowAlias?: (boolean|null); + + /** EnumOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** EnumOptions .gogoproto.goprotoEnumPrefix */ + ".gogoproto.goprotoEnumPrefix"?: (boolean|null); + + /** EnumOptions .gogoproto.goprotoEnumStringer */ + ".gogoproto.goprotoEnumStringer"?: (boolean|null); + + /** EnumOptions .gogoproto.enumStringer */ + ".gogoproto.enumStringer"?: (boolean|null); + + /** EnumOptions .gogoproto.enumCustomname */ + ".gogoproto.enumCustomname"?: (string|null); + + /** EnumOptions .gogoproto.enumdecl */ + ".gogoproto.enumdecl"?: (boolean|null); + } + + /** Represents an EnumOptions. */ + class EnumOptions implements IEnumOptions { + + /** + * Constructs a new EnumOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumOptions); + + /** EnumOptions allowAlias. */ + public allowAlias: boolean; + + /** EnumOptions deprecated. */ + public deprecated: boolean; + + /** EnumOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumOptions instance + */ + public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @param message EnumOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; + + /** + * Verifies an EnumOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @param message EnumOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an EnumValueOptions. */ + interface IEnumValueOptions { + + /** EnumValueOptions deprecated */ + deprecated?: (boolean|null); + + /** EnumValueOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + + /** EnumValueOptions .gogoproto.enumvalueCustomname */ + ".gogoproto.enumvalueCustomname"?: (string|null); + } + + /** Represents an EnumValueOptions. */ + class EnumValueOptions implements IEnumValueOptions { + + /** + * Constructs a new EnumValueOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IEnumValueOptions); + + /** EnumValueOptions deprecated. */ + public deprecated: boolean; + + /** EnumValueOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns EnumValueOptions instance + */ + public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @param message EnumValueOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; + + /** + * Verifies an EnumValueOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns EnumValueOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @param message EnumValueOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this EnumValueOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a ServiceOptions. */ + interface IServiceOptions { + + /** ServiceOptions deprecated */ + deprecated?: (boolean|null); + + /** ServiceOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents a ServiceOptions. */ + class ServiceOptions implements IServiceOptions { + + /** + * Constructs a new ServiceOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IServiceOptions); + + /** ServiceOptions deprecated. */ + public deprecated: boolean; + + /** ServiceOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns ServiceOptions instance + */ + public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @param message ServiceOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; + + /** + * Verifies a ServiceOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ServiceOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @param message ServiceOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ServiceOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a MethodOptions. */ + interface IMethodOptions { + + /** MethodOptions deprecated */ + deprecated?: (boolean|null); + + /** MethodOptions idempotencyLevel */ + idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|null); + + /** MethodOptions uninterpretedOption */ + uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); + } + + /** Represents a MethodOptions. */ + class MethodOptions implements IMethodOptions { + + /** + * Constructs a new MethodOptions. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IMethodOptions); + + /** MethodOptions deprecated. */ + public deprecated: boolean; + + /** MethodOptions idempotencyLevel. */ + public idempotencyLevel: google.protobuf.MethodOptions.IdempotencyLevel; + + /** MethodOptions uninterpretedOption. */ + public uninterpretedOption: google.protobuf.IUninterpretedOption[]; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @param [properties] Properties to set + * @returns MethodOptions instance + */ + public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @param message MethodOptions message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; + + /** + * Verifies a MethodOptions message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MethodOptions + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @param message MethodOptions + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MethodOptions to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace MethodOptions { + + /** IdempotencyLevel enum. */ + enum IdempotencyLevel { + IDEMPOTENCY_UNKNOWN = 0, + NO_SIDE_EFFECTS = 1, + IDEMPOTENT = 2 + } + } + + /** Properties of an UninterpretedOption. */ + interface IUninterpretedOption { + + /** UninterpretedOption name */ + name?: (google.protobuf.UninterpretedOption.INamePart[]|null); + + /** UninterpretedOption identifierValue */ + identifierValue?: (string|null); + + /** UninterpretedOption positiveIntValue */ + positiveIntValue?: (number|Long|null); + + /** UninterpretedOption negativeIntValue */ + negativeIntValue?: (number|Long|null); + + /** UninterpretedOption doubleValue */ + doubleValue?: (number|null); + + /** UninterpretedOption stringValue */ + stringValue?: (Uint8Array|null); + + /** UninterpretedOption aggregateValue */ + aggregateValue?: (string|null); + } + + /** Represents an UninterpretedOption. */ + class UninterpretedOption implements IUninterpretedOption { + + /** + * Constructs a new UninterpretedOption. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IUninterpretedOption); + + /** UninterpretedOption name. */ + public name: google.protobuf.UninterpretedOption.INamePart[]; + + /** UninterpretedOption identifierValue. */ + public identifierValue: string; + + /** UninterpretedOption positiveIntValue. */ + public positiveIntValue: (number|Long); + + /** UninterpretedOption negativeIntValue. */ + public negativeIntValue: (number|Long); + + /** UninterpretedOption doubleValue. */ + public doubleValue: number; + + /** UninterpretedOption stringValue. */ + public stringValue: Uint8Array; + + /** UninterpretedOption aggregateValue. */ + public aggregateValue: string; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @param [properties] Properties to set + * @returns UninterpretedOption instance + */ + public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @param message UninterpretedOption message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; + + /** + * Verifies an UninterpretedOption message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns UninterpretedOption + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @param message UninterpretedOption + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this UninterpretedOption to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace UninterpretedOption { + + /** Properties of a NamePart. */ + interface INamePart { + + /** NamePart namePart */ + namePart: string; + + /** NamePart isExtension */ + isExtension: boolean; + } + + /** Represents a NamePart. */ + class NamePart implements INamePart { + + /** + * Constructs a new NamePart. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.UninterpretedOption.INamePart); + + /** NamePart namePart. */ + public namePart: string; + + /** NamePart isExtension. */ + public isExtension: boolean; + + /** + * Creates a new NamePart instance using the specified properties. + * @param [properties] Properties to set + * @returns NamePart instance + */ + public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @param message NamePart message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; + + /** + * Verifies a NamePart message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NamePart + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @param message NamePart + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NamePart to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a SourceCodeInfo. */ + interface ISourceCodeInfo { + + /** SourceCodeInfo location */ + location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); + } + + /** Represents a SourceCodeInfo. */ + class SourceCodeInfo implements ISourceCodeInfo { + + /** + * Constructs a new SourceCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.ISourceCodeInfo); + + /** SourceCodeInfo location. */ + public location: google.protobuf.SourceCodeInfo.ILocation[]; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns SourceCodeInfo instance + */ + public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @param message SourceCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; + + /** + * Verifies a SourceCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns SourceCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @param message SourceCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this SourceCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace SourceCodeInfo { + + /** Properties of a Location. */ + interface ILocation { + + /** Location path */ + path?: (number[]|null); + + /** Location span */ + span?: (number[]|null); + + /** Location leadingComments */ + leadingComments?: (string|null); + + /** Location trailingComments */ + trailingComments?: (string|null); + + /** Location leadingDetachedComments */ + leadingDetachedComments?: (string[]|null); + } + + /** Represents a Location. */ + class Location implements ILocation { + + /** + * Constructs a new Location. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); + + /** Location path. */ + public path: number[]; + + /** Location span. */ + public span: number[]; + + /** Location leadingComments. */ + public leadingComments: string; + + /** Location trailingComments. */ + public trailingComments: string; + + /** Location leadingDetachedComments. */ + public leadingDetachedComments: string[]; + + /** + * Creates a new Location instance using the specified properties. + * @param [properties] Properties to set + * @returns Location instance + */ + public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @param message Location message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Location message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; + + /** + * Verifies a Location message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Location + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @param message Location + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Location to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + + /** Properties of a GeneratedCodeInfo. */ + interface IGeneratedCodeInfo { + + /** GeneratedCodeInfo annotation */ + annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); + } + + /** Represents a GeneratedCodeInfo. */ + class GeneratedCodeInfo implements IGeneratedCodeInfo { + + /** + * Constructs a new GeneratedCodeInfo. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.IGeneratedCodeInfo); + + /** GeneratedCodeInfo annotation. */ + public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @param [properties] Properties to set + * @returns GeneratedCodeInfo instance + */ + public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @param message GeneratedCodeInfo message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; + + /** + * Verifies a GeneratedCodeInfo message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns GeneratedCodeInfo + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @param message GeneratedCodeInfo + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + namespace GeneratedCodeInfo { + + /** Properties of an Annotation. */ + interface IAnnotation { + + /** Annotation path */ + path?: (number[]|null); + + /** Annotation sourceFile */ + sourceFile?: (string|null); + + /** Annotation begin */ + begin?: (number|null); + + /** Annotation end */ + end?: (number|null); + } + + /** Represents an Annotation. */ + class Annotation implements IAnnotation { + + /** + * Constructs a new Annotation. + * @param [properties] Properties to set + */ + constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); + + /** Annotation path. */ + public path: number[]; + + /** Annotation sourceFile. */ + public sourceFile: string; + + /** Annotation begin. */ + public begin: number; + + /** Annotation end. */ + public end: number; + + /** + * Creates a new Annotation instance using the specified properties. + * @param [properties] Properties to set + * @returns Annotation instance + */ + public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @param message Annotation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Verifies an Annotation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Annotation + */ + public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @param message Annotation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Annotation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } + } +} + /** Namespace types. */ export namespace types { diff --git a/packages/xchain-mayachain/src/types/proto/MsgCompiled.js b/packages/xchain-mayachain/src/types/proto/MsgCompiled.js index 3e72884ca..1f3ea47ea 100644 --- a/packages/xchain-mayachain/src/types/proto/MsgCompiled.js +++ b/packages/xchain-mayachain/src/types/proto/MsgCompiled.js @@ -1540,6 +1540,10121 @@ $root.common = (function() { return common; })(); +$root.gogoproto = (function() { + + /** + * Namespace gogoproto. + * @exports gogoproto + * @namespace + */ + var gogoproto = {}; + + return gogoproto; +})(); + +$root.google = (function() { + + /** + * Namespace google. + * @exports google + * @namespace + */ + var google = {}; + + google.protobuf = (function() { + + /** + * Namespace protobuf. + * @memberof google + * @namespace + */ + var protobuf = {}; + + protobuf.FileDescriptorSet = (function() { + + /** + * Properties of a FileDescriptorSet. + * @memberof google.protobuf + * @interface IFileDescriptorSet + * @property {Array.|null} [file] FileDescriptorSet file + */ + + /** + * Constructs a new FileDescriptorSet. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorSet. + * @implements IFileDescriptorSet + * @constructor + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + */ + function FileDescriptorSet(properties) { + this.file = []; + 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]]; + } + + /** + * FileDescriptorSet file. + * @member {Array.} file + * @memberof google.protobuf.FileDescriptorSet + * @instance + */ + FileDescriptorSet.prototype.file = $util.emptyArray; + + /** + * Creates a new FileDescriptorSet instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance + */ + FileDescriptorSet.create = function create(properties) { + return new FileDescriptorSet(properties); + }; + + /** + * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.file != null && message.file.length) + for (var i = 0; i < message.file.length; ++i) + $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.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.google.protobuf.FileDescriptorSet(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.file && message.file.length)) + message.file = []; + message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorSet message. + * @function verify + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorSet.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.file != null && message.hasOwnProperty("file")) { + if (!Array.isArray(message.file)) + return "file: array expected"; + for (var i = 0; i < message.file.length; ++i) { + var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); + if (error) + return "file." + error; + } + } + return null; + }; + + /** + * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet + */ + FileDescriptorSet.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorSet) + return object; + var message = new $root.google.protobuf.FileDescriptorSet(); + if (object.file) { + if (!Array.isArray(object.file)) + throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); + message.file = []; + for (var i = 0; i < object.file.length; ++i) { + if (typeof object.file[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); + message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorSet + * @static + * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorSet.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.file = []; + if (message.file && message.file.length) { + object.file = []; + for (var j = 0; j < message.file.length; ++j) + object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); + } + return object; + }; + + /** + * Converts this FileDescriptorSet to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorSet + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorSet.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FileDescriptorSet; + })(); + + protobuf.FileDescriptorProto = (function() { + + /** + * Properties of a FileDescriptorProto. + * @memberof google.protobuf + * @interface IFileDescriptorProto + * @property {string|null} [name] FileDescriptorProto name + * @property {string|null} ["package"] FileDescriptorProto package + * @property {Array.|null} [dependency] FileDescriptorProto dependency + * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency + * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency + * @property {Array.|null} [messageType] FileDescriptorProto messageType + * @property {Array.|null} [enumType] FileDescriptorProto enumType + * @property {Array.|null} [service] FileDescriptorProto service + * @property {Array.|null} [extension] FileDescriptorProto extension + * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options + * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo + * @property {string|null} [syntax] FileDescriptorProto syntax + */ + + /** + * Constructs a new FileDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FileDescriptorProto. + * @implements IFileDescriptorProto + * @constructor + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + */ + function FileDescriptorProto(properties) { + this.dependency = []; + this.publicDependency = []; + this.weakDependency = []; + this.messageType = []; + this.enumType = []; + this.service = []; + this.extension = []; + 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]]; + } + + /** + * FileDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.name = ""; + + /** + * FileDescriptorProto package. + * @member {string} package + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype["package"] = ""; + + /** + * FileDescriptorProto dependency. + * @member {Array.} dependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.dependency = $util.emptyArray; + + /** + * FileDescriptorProto publicDependency. + * @member {Array.} publicDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.publicDependency = $util.emptyArray; + + /** + * FileDescriptorProto weakDependency. + * @member {Array.} weakDependency + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.weakDependency = $util.emptyArray; + + /** + * FileDescriptorProto messageType. + * @member {Array.} messageType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.messageType = $util.emptyArray; + + /** + * FileDescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * FileDescriptorProto service. + * @member {Array.} service + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.service = $util.emptyArray; + + /** + * FileDescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.extension = $util.emptyArray; + + /** + * FileDescriptorProto options. + * @member {google.protobuf.IFileOptions|null|undefined} options + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.options = null; + + /** + * FileDescriptorProto sourceCodeInfo. + * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.sourceCodeInfo = null; + + /** + * FileDescriptorProto syntax. + * @member {string} syntax + * @memberof google.protobuf.FileDescriptorProto + * @instance + */ + FileDescriptorProto.prototype.syntax = ""; + + /** + * Creates a new FileDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance + */ + FileDescriptorProto.create = function create(properties) { + return new FileDescriptorProto(properties); + }; + + /** + * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); + if (message.dependency != null && message.dependency.length) + for (var i = 0; i < message.dependency.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); + if (message.messageType != null && message.messageType.length) + for (var i = 0; i < message.messageType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.service != null && message.service.length) + for (var i = 0; i < message.service.length; ++i) + $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) + $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.publicDependency != null && message.publicDependency.length) + for (var i = 0; i < message.publicDependency.length; ++i) + writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); + if (message.weakDependency != null && message.weakDependency.length) + for (var i = 0; i < message.weakDependency.length; ++i) + writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); + if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) + writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); + return writer; + }; + + /** + * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.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.google.protobuf.FileDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message["package"] = reader.string(); + break; + case 3: + if (!(message.dependency && message.dependency.length)) + message.dependency = []; + message.dependency.push(reader.string()); + break; + case 10: + if (!(message.publicDependency && message.publicDependency.length)) + message.publicDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.publicDependency.push(reader.int32()); + } else + message.publicDependency.push(reader.int32()); + break; + case 11: + if (!(message.weakDependency && message.weakDependency.length)) + message.weakDependency = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.weakDependency.push(reader.int32()); + } else + message.weakDependency.push(reader.int32()); + break; + case 4: + if (!(message.messageType && message.messageType.length)) + message.messageType = []; + message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + case 5: + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + case 6: + if (!(message.service && message.service.length)) + message.service = []; + message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); + break; + case 7: + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + case 8: + message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); + break; + case 9: + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); + break; + case 12: + message.syntax = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileDescriptorProto message. + * @function verify + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message["package"] != null && message.hasOwnProperty("package")) + if (!$util.isString(message["package"])) + return "package: string expected"; + if (message.dependency != null && message.hasOwnProperty("dependency")) { + if (!Array.isArray(message.dependency)) + return "dependency: array expected"; + for (var i = 0; i < message.dependency.length; ++i) + if (!$util.isString(message.dependency[i])) + return "dependency: string[] expected"; + } + if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { + if (!Array.isArray(message.publicDependency)) + return "publicDependency: array expected"; + for (var i = 0; i < message.publicDependency.length; ++i) + if (!$util.isInteger(message.publicDependency[i])) + return "publicDependency: integer[] expected"; + } + if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { + if (!Array.isArray(message.weakDependency)) + return "weakDependency: array expected"; + for (var i = 0; i < message.weakDependency.length; ++i) + if (!$util.isInteger(message.weakDependency[i])) + return "weakDependency: integer[] expected"; + } + if (message.messageType != null && message.hasOwnProperty("messageType")) { + if (!Array.isArray(message.messageType)) + return "messageType: array expected"; + for (var i = 0; i < message.messageType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); + if (error) + return "messageType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.service != null && message.hasOwnProperty("service")) { + if (!Array.isArray(message.service)) + return "service: array expected"; + for (var i = 0; i < message.service.length; ++i) { + var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); + if (error) + return "service." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FileOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { + var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); + if (error) + return "sourceCodeInfo." + error; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + if (!$util.isString(message.syntax)) + return "syntax: string expected"; + return null; + }; + + /** + * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto + */ + FileDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileDescriptorProto) + return object; + var message = new $root.google.protobuf.FileDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object["package"] != null) + message["package"] = String(object["package"]); + if (object.dependency) { + if (!Array.isArray(object.dependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); + message.dependency = []; + for (var i = 0; i < object.dependency.length; ++i) + message.dependency[i] = String(object.dependency[i]); + } + if (object.publicDependency) { + if (!Array.isArray(object.publicDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); + message.publicDependency = []; + for (var i = 0; i < object.publicDependency.length; ++i) + message.publicDependency[i] = object.publicDependency[i] | 0; + } + if (object.weakDependency) { + if (!Array.isArray(object.weakDependency)) + throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); + message.weakDependency = []; + for (var i = 0; i < object.weakDependency.length; ++i) + message.weakDependency[i] = object.weakDependency[i] | 0; + } + if (object.messageType) { + if (!Array.isArray(object.messageType)) + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); + message.messageType = []; + for (var i = 0; i < object.messageType.length; ++i) { + if (typeof object.messageType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); + message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.service) { + if (!Array.isArray(object.service)) + throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); + message.service = []; + for (var i = 0; i < object.service.length; ++i) { + if (typeof object.service[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); + message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FileOptions.fromObject(object.options); + } + if (object.sourceCodeInfo != null) { + if (typeof object.sourceCodeInfo !== "object") + throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); + message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); + } + if (object.syntax != null) + message.syntax = String(object.syntax); + return message; + }; + + /** + * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileDescriptorProto + * @static + * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.dependency = []; + object.messageType = []; + object.enumType = []; + object.service = []; + object.extension = []; + object.publicDependency = []; + object.weakDependency = []; + } + if (options.defaults) { + object.name = ""; + object["package"] = ""; + object.options = null; + object.sourceCodeInfo = null; + object.syntax = ""; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message["package"] != null && message.hasOwnProperty("package")) + object["package"] = message["package"]; + if (message.dependency && message.dependency.length) { + object.dependency = []; + for (var j = 0; j < message.dependency.length; ++j) + object.dependency[j] = message.dependency[j]; + } + if (message.messageType && message.messageType.length) { + object.messageType = []; + for (var j = 0; j < message.messageType.length; ++j) + object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.service && message.service.length) { + object.service = []; + for (var j = 0; j < message.service.length; ++j) + object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); + if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) + object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); + if (message.publicDependency && message.publicDependency.length) { + object.publicDependency = []; + for (var j = 0; j < message.publicDependency.length; ++j) + object.publicDependency[j] = message.publicDependency[j]; + } + if (message.weakDependency && message.weakDependency.length) { + object.weakDependency = []; + for (var j = 0; j < message.weakDependency.length; ++j) + object.weakDependency[j] = message.weakDependency[j]; + } + if (message.syntax != null && message.hasOwnProperty("syntax")) + object.syntax = message.syntax; + return object; + }; + + /** + * Converts this FileDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FileDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FileDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return FileDescriptorProto; + })(); + + protobuf.DescriptorProto = (function() { + + /** + * Properties of a DescriptorProto. + * @memberof google.protobuf + * @interface IDescriptorProto + * @property {string|null} [name] DescriptorProto name + * @property {Array.|null} [field] DescriptorProto field + * @property {Array.|null} [extension] DescriptorProto extension + * @property {Array.|null} [nestedType] DescriptorProto nestedType + * @property {Array.|null} [enumType] DescriptorProto enumType + * @property {Array.|null} [extensionRange] DescriptorProto extensionRange + * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl + * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options + * @property {Array.|null} [reservedRange] DescriptorProto reservedRange + * @property {Array.|null} [reservedName] DescriptorProto reservedName + */ + + /** + * Constructs a new DescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a DescriptorProto. + * @implements IDescriptorProto + * @constructor + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + */ + function DescriptorProto(properties) { + this.field = []; + this.extension = []; + this.nestedType = []; + this.enumType = []; + this.extensionRange = []; + this.oneofDecl = []; + this.reservedRange = []; + this.reservedName = []; + 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]]; + } + + /** + * DescriptorProto name. + * @member {string} name + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.name = ""; + + /** + * DescriptorProto field. + * @member {Array.} field + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.field = $util.emptyArray; + + /** + * DescriptorProto extension. + * @member {Array.} extension + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extension = $util.emptyArray; + + /** + * DescriptorProto nestedType. + * @member {Array.} nestedType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.nestedType = $util.emptyArray; + + /** + * DescriptorProto enumType. + * @member {Array.} enumType + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.enumType = $util.emptyArray; + + /** + * DescriptorProto extensionRange. + * @member {Array.} extensionRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.extensionRange = $util.emptyArray; + + /** + * DescriptorProto oneofDecl. + * @member {Array.} oneofDecl + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.oneofDecl = $util.emptyArray; + + /** + * DescriptorProto options. + * @member {google.protobuf.IMessageOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.options = null; + + /** + * DescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * DescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.DescriptorProto + * @instance + */ + DescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new DescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto} DescriptorProto instance + */ + DescriptorProto.create = function create(properties) { + return new DescriptorProto(properties); + }; + + /** + * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.field != null && message.field.length) + for (var i = 0; i < message.field.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.nestedType != null && message.nestedType.length) + for (var i = 0; i < message.nestedType.length; ++i) + $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.enumType != null && message.enumType.length) + for (var i = 0; i < message.enumType.length; ++i) + $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.extensionRange != null && message.extensionRange.length) + for (var i = 0; i < message.extensionRange.length; ++i) + $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + if (message.extension != null && message.extension.length) + for (var i = 0; i < message.extension.length; ++i) + $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); + if (message.oneofDecl != null && message.oneofDecl.length) + for (var i = 0; i < message.oneofDecl.length; ++i) + $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.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.google.protobuf.DescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + if (!(message.field && message.field.length)) + message.field = []; + message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + case 6: + if (!(message.extension && message.extension.length)) + message.extension = []; + message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); + break; + case 3: + if (!(message.nestedType && message.nestedType.length)) + message.nestedType = []; + message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); + break; + case 4: + if (!(message.enumType && message.enumType.length)) + message.enumType = []; + message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); + break; + case 5: + if (!(message.extensionRange && message.extensionRange.length)) + message.extensionRange = []; + message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); + break; + case 8: + if (!(message.oneofDecl && message.oneofDecl.length)) + message.oneofDecl = []; + message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); + break; + case 7: + message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); + break; + case 9: + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); + break; + case 10: + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto} DescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + DescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a DescriptorProto message. + * @function verify + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + DescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.field != null && message.hasOwnProperty("field")) { + if (!Array.isArray(message.field)) + return "field: array expected"; + for (var i = 0; i < message.field.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); + if (error) + return "field." + error; + } + } + if (message.extension != null && message.hasOwnProperty("extension")) { + if (!Array.isArray(message.extension)) + return "extension: array expected"; + for (var i = 0; i < message.extension.length; ++i) { + var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); + if (error) + return "extension." + error; + } + } + if (message.nestedType != null && message.hasOwnProperty("nestedType")) { + if (!Array.isArray(message.nestedType)) + return "nestedType: array expected"; + for (var i = 0; i < message.nestedType.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); + if (error) + return "nestedType." + error; + } + } + if (message.enumType != null && message.hasOwnProperty("enumType")) { + if (!Array.isArray(message.enumType)) + return "enumType: array expected"; + for (var i = 0; i < message.enumType.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); + if (error) + return "enumType." + error; + } + } + if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { + if (!Array.isArray(message.extensionRange)) + return "extensionRange: array expected"; + for (var i = 0; i < message.extensionRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); + if (error) + return "extensionRange." + error; + } + } + if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { + if (!Array.isArray(message.oneofDecl)) + return "oneofDecl: array expected"; + for (var i = 0; i < message.oneofDecl.length; ++i) { + var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); + if (error) + return "oneofDecl." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MessageOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto} DescriptorProto + */ + DescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto) + return object; + var message = new $root.google.protobuf.DescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.field) { + if (!Array.isArray(object.field)) + throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); + message.field = []; + for (var i = 0; i < object.field.length; ++i) { + if (typeof object.field[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); + message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); + } + } + if (object.extension) { + if (!Array.isArray(object.extension)) + throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); + message.extension = []; + for (var i = 0; i < object.extension.length; ++i) { + if (typeof object.extension[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); + message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); + } + } + if (object.nestedType) { + if (!Array.isArray(object.nestedType)) + throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); + message.nestedType = []; + for (var i = 0; i < object.nestedType.length; ++i) { + if (typeof object.nestedType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); + message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); + } + } + if (object.enumType) { + if (!Array.isArray(object.enumType)) + throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); + message.enumType = []; + for (var i = 0; i < object.enumType.length; ++i) { + if (typeof object.enumType[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); + message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); + } + } + if (object.extensionRange) { + if (!Array.isArray(object.extensionRange)) + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); + message.extensionRange = []; + for (var i = 0; i < object.extensionRange.length; ++i) { + if (typeof object.extensionRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); + message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); + } + } + if (object.oneofDecl) { + if (!Array.isArray(object.oneofDecl)) + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); + message.oneofDecl = []; + for (var i = 0; i < object.oneofDecl.length; ++i) { + if (typeof object.oneofDecl[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); + message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto + * @static + * @param {google.protobuf.DescriptorProto} message DescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + DescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.field = []; + object.nestedType = []; + object.enumType = []; + object.extensionRange = []; + object.extension = []; + object.oneofDecl = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.field && message.field.length) { + object.field = []; + for (var j = 0; j < message.field.length; ++j) + object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); + } + if (message.nestedType && message.nestedType.length) { + object.nestedType = []; + for (var j = 0; j < message.nestedType.length; ++j) + object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); + } + if (message.enumType && message.enumType.length) { + object.enumType = []; + for (var j = 0; j < message.enumType.length; ++j) + object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); + } + if (message.extensionRange && message.extensionRange.length) { + object.extensionRange = []; + for (var j = 0; j < message.extensionRange.length; ++j) + object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); + } + if (message.extension && message.extension.length) { + object.extension = []; + for (var j = 0; j < message.extension.length; ++j) + object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); + if (message.oneofDecl && message.oneofDecl.length) { + object.oneofDecl = []; + for (var j = 0; j < message.oneofDecl.length; ++j) + object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); + } + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this DescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto + * @instance + * @returns {Object.} JSON object + */ + DescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + DescriptorProto.ExtensionRange = (function() { + + /** + * Properties of an ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @interface IExtensionRange + * @property {number|null} [start] ExtensionRange start + * @property {number|null} [end] ExtensionRange end + * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options + */ + + /** + * Constructs a new ExtensionRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents an ExtensionRange. + * @implements IExtensionRange + * @constructor + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + */ + function ExtensionRange(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]]; + } + + /** + * ExtensionRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.start = 0; + + /** + * ExtensionRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.end = 0; + + /** + * ExtensionRange options. + * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + */ + ExtensionRange.prototype.options = null; + + /** + * Creates a new ExtensionRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance + */ + ExtensionRange.create = function create(properties) { + return new ExtensionRange(properties); + }; + + /** + * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.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.google.protobuf.DescriptorProto.ExtensionRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + case 3: + message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange + */ + ExtensionRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); + message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @static + * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + object.options = null; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ExtensionRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ExtensionRange + * @instance + * @returns {Object.} JSON object + */ + ExtensionRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ExtensionRange; + })(); + + DescriptorProto.ReservedRange = (function() { + + /** + * Properties of a ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @interface IReservedRange + * @property {number|null} [start] ReservedRange start + * @property {number|null} [end] ReservedRange end + */ + + /** + * Constructs a new ReservedRange. + * @memberof google.protobuf.DescriptorProto + * @classdesc Represents a ReservedRange. + * @implements IReservedRange + * @constructor + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + */ + function ReservedRange(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]]; + } + + /** + * ReservedRange start. + * @member {number} start + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.start = 0; + + /** + * ReservedRange end. + * @member {number} end + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + */ + ReservedRange.prototype.end = 0; + + /** + * Creates a new ReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance + */ + ReservedRange.create = function create(properties) { + return new ReservedRange(properties); + }; + + /** + * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.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.google.protobuf.DescriptorProto.ReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ReservedRange message. + * @function verify + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange + */ + ReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) + return object; + var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @static + * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this ReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.DescriptorProto.ReservedRange + * @instance + * @returns {Object.} JSON object + */ + ReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ReservedRange; + })(); + + return DescriptorProto; + })(); + + protobuf.ExtensionRangeOptions = (function() { + + /** + * Properties of an ExtensionRangeOptions. + * @memberof google.protobuf + * @interface IExtensionRangeOptions + * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption + */ + + /** + * Constructs a new ExtensionRangeOptions. + * @memberof google.protobuf + * @classdesc Represents an ExtensionRangeOptions. + * @implements IExtensionRangeOptions + * @constructor + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + */ + function ExtensionRangeOptions(properties) { + this.uninterpretedOption = []; + 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]]; + } + + /** + * ExtensionRangeOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + */ + ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new ExtensionRangeOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance + */ + ExtensionRangeOptions.create = function create(properties) { + return new ExtensionRangeOptions(properties); + }; + + /** + * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.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.google.protobuf.ExtensionRangeOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ExtensionRangeOptions message. + * @function verify + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ExtensionRangeOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions + */ + ExtensionRangeOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ExtensionRangeOptions) + return object; + var message = new $root.google.protobuf.ExtensionRangeOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ExtensionRangeOptions + * @static + * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ExtensionRangeOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this ExtensionRangeOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ExtensionRangeOptions + * @instance + * @returns {Object.} JSON object + */ + ExtensionRangeOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ExtensionRangeOptions; + })(); + + protobuf.FieldDescriptorProto = (function() { + + /** + * Properties of a FieldDescriptorProto. + * @memberof google.protobuf + * @interface IFieldDescriptorProto + * @property {string|null} [name] FieldDescriptorProto name + * @property {number|null} [number] FieldDescriptorProto number + * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label + * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type + * @property {string|null} [typeName] FieldDescriptorProto typeName + * @property {string|null} [extendee] FieldDescriptorProto extendee + * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue + * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex + * @property {string|null} [jsonName] FieldDescriptorProto jsonName + * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options + * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional + */ + + /** + * Constructs a new FieldDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a FieldDescriptorProto. + * @implements IFieldDescriptorProto + * @constructor + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + */ + function FieldDescriptorProto(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]]; + } + + /** + * FieldDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.name = ""; + + /** + * FieldDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.number = 0; + + /** + * FieldDescriptorProto label. + * @member {google.protobuf.FieldDescriptorProto.Label} label + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.label = 1; + + /** + * FieldDescriptorProto type. + * @member {google.protobuf.FieldDescriptorProto.Type} type + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.type = 1; + + /** + * FieldDescriptorProto typeName. + * @member {string} typeName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.typeName = ""; + + /** + * FieldDescriptorProto extendee. + * @member {string} extendee + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.extendee = ""; + + /** + * FieldDescriptorProto defaultValue. + * @member {string} defaultValue + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.defaultValue = ""; + + /** + * FieldDescriptorProto oneofIndex. + * @member {number} oneofIndex + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.oneofIndex = 0; + + /** + * FieldDescriptorProto jsonName. + * @member {string} jsonName + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.jsonName = ""; + + /** + * FieldDescriptorProto options. + * @member {google.protobuf.IFieldOptions|null|undefined} options + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.options = null; + + /** + * FieldDescriptorProto proto3Optional. + * @member {boolean} proto3Optional + * @memberof google.protobuf.FieldDescriptorProto + * @instance + */ + FieldDescriptorProto.prototype.proto3Optional = false; + + /** + * Creates a new FieldDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance + */ + FieldDescriptorProto.create = function create(properties) { + return new FieldDescriptorProto(properties); + }; + + /** + * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); + if (message.label != null && Object.hasOwnProperty.call(message, "label")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); + if (message.type != null && Object.hasOwnProperty.call(message, "type")) + writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); + if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); + if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) + writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); + if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); + if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); + if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); + return writer; + }; + + /** + * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.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.google.protobuf.FieldDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 3: + message.number = reader.int32(); + break; + case 4: + message.label = reader.int32(); + break; + case 5: + message.type = reader.int32(); + break; + case 6: + message.typeName = reader.string(); + break; + case 2: + message.extendee = reader.string(); + break; + case 7: + message.defaultValue = reader.string(); + break; + case 9: + message.oneofIndex = reader.int32(); + break; + case 10: + message.jsonName = reader.string(); + break; + case 8: + message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); + break; + case 17: + message.proto3Optional = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldDescriptorProto message. + * @function verify + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.label != null && message.hasOwnProperty("label")) + switch (message.label) { + default: + return "label: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.type != null && message.hasOwnProperty("type")) + switch (message.type) { + default: + return "type: enum value expected"; + case 1: + case 2: + case 3: + case 4: + case 5: + case 6: + case 7: + case 8: + case 9: + case 10: + case 11: + case 12: + case 13: + case 14: + case 15: + case 16: + case 17: + case 18: + break; + } + if (message.typeName != null && message.hasOwnProperty("typeName")) + if (!$util.isString(message.typeName)) + return "typeName: string expected"; + if (message.extendee != null && message.hasOwnProperty("extendee")) + if (!$util.isString(message.extendee)) + return "extendee: string expected"; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + if (!$util.isString(message.defaultValue)) + return "defaultValue: string expected"; + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + if (!$util.isInteger(message.oneofIndex)) + return "oneofIndex: integer expected"; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + if (!$util.isString(message.jsonName)) + return "jsonName: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.FieldOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + if (typeof message.proto3Optional !== "boolean") + return "proto3Optional: boolean expected"; + return null; + }; + + /** + * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto + */ + FieldDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldDescriptorProto) + return object; + var message = new $root.google.protobuf.FieldDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + switch (object.label) { + case "LABEL_OPTIONAL": + case 1: + message.label = 1; + break; + case "LABEL_REQUIRED": + case 2: + message.label = 2; + break; + case "LABEL_REPEATED": + case 3: + message.label = 3; + break; + } + switch (object.type) { + case "TYPE_DOUBLE": + case 1: + message.type = 1; + break; + case "TYPE_FLOAT": + case 2: + message.type = 2; + break; + case "TYPE_INT64": + case 3: + message.type = 3; + break; + case "TYPE_UINT64": + case 4: + message.type = 4; + break; + case "TYPE_INT32": + case 5: + message.type = 5; + break; + case "TYPE_FIXED64": + case 6: + message.type = 6; + break; + case "TYPE_FIXED32": + case 7: + message.type = 7; + break; + case "TYPE_BOOL": + case 8: + message.type = 8; + break; + case "TYPE_STRING": + case 9: + message.type = 9; + break; + case "TYPE_GROUP": + case 10: + message.type = 10; + break; + case "TYPE_MESSAGE": + case 11: + message.type = 11; + break; + case "TYPE_BYTES": + case 12: + message.type = 12; + break; + case "TYPE_UINT32": + case 13: + message.type = 13; + break; + case "TYPE_ENUM": + case 14: + message.type = 14; + break; + case "TYPE_SFIXED32": + case 15: + message.type = 15; + break; + case "TYPE_SFIXED64": + case 16: + message.type = 16; + break; + case "TYPE_SINT32": + case 17: + message.type = 17; + break; + case "TYPE_SINT64": + case 18: + message.type = 18; + break; + } + if (object.typeName != null) + message.typeName = String(object.typeName); + if (object.extendee != null) + message.extendee = String(object.extendee); + if (object.defaultValue != null) + message.defaultValue = String(object.defaultValue); + if (object.oneofIndex != null) + message.oneofIndex = object.oneofIndex | 0; + if (object.jsonName != null) + message.jsonName = String(object.jsonName); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); + } + if (object.proto3Optional != null) + message.proto3Optional = Boolean(object.proto3Optional); + return message; + }; + + /** + * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldDescriptorProto + * @static + * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.extendee = ""; + object.number = 0; + object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; + object.type = options.enums === String ? "TYPE_DOUBLE" : 1; + object.typeName = ""; + object.defaultValue = ""; + object.options = null; + object.oneofIndex = 0; + object.jsonName = ""; + object.proto3Optional = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.extendee != null && message.hasOwnProperty("extendee")) + object.extendee = message.extendee; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.label != null && message.hasOwnProperty("label")) + object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; + if (message.type != null && message.hasOwnProperty("type")) + object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; + if (message.typeName != null && message.hasOwnProperty("typeName")) + object.typeName = message.typeName; + if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) + object.defaultValue = message.defaultValue; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); + if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) + object.oneofIndex = message.oneofIndex; + if (message.jsonName != null && message.hasOwnProperty("jsonName")) + object.jsonName = message.jsonName; + if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) + object.proto3Optional = message.proto3Optional; + return object; + }; + + /** + * Converts this FieldDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.FieldDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + FieldDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * Type enum. + * @name google.protobuf.FieldDescriptorProto.Type + * @enum {number} + * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value + * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value + * @property {number} TYPE_INT64=3 TYPE_INT64 value + * @property {number} TYPE_UINT64=4 TYPE_UINT64 value + * @property {number} TYPE_INT32=5 TYPE_INT32 value + * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value + * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value + * @property {number} TYPE_BOOL=8 TYPE_BOOL value + * @property {number} TYPE_STRING=9 TYPE_STRING value + * @property {number} TYPE_GROUP=10 TYPE_GROUP value + * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value + * @property {number} TYPE_BYTES=12 TYPE_BYTES value + * @property {number} TYPE_UINT32=13 TYPE_UINT32 value + * @property {number} TYPE_ENUM=14 TYPE_ENUM value + * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value + * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value + * @property {number} TYPE_SINT32=17 TYPE_SINT32 value + * @property {number} TYPE_SINT64=18 TYPE_SINT64 value + */ + FieldDescriptorProto.Type = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "TYPE_DOUBLE"] = 1; + values[valuesById[2] = "TYPE_FLOAT"] = 2; + values[valuesById[3] = "TYPE_INT64"] = 3; + values[valuesById[4] = "TYPE_UINT64"] = 4; + values[valuesById[5] = "TYPE_INT32"] = 5; + values[valuesById[6] = "TYPE_FIXED64"] = 6; + values[valuesById[7] = "TYPE_FIXED32"] = 7; + values[valuesById[8] = "TYPE_BOOL"] = 8; + values[valuesById[9] = "TYPE_STRING"] = 9; + values[valuesById[10] = "TYPE_GROUP"] = 10; + values[valuesById[11] = "TYPE_MESSAGE"] = 11; + values[valuesById[12] = "TYPE_BYTES"] = 12; + values[valuesById[13] = "TYPE_UINT32"] = 13; + values[valuesById[14] = "TYPE_ENUM"] = 14; + values[valuesById[15] = "TYPE_SFIXED32"] = 15; + values[valuesById[16] = "TYPE_SFIXED64"] = 16; + values[valuesById[17] = "TYPE_SINT32"] = 17; + values[valuesById[18] = "TYPE_SINT64"] = 18; + return values; + })(); + + /** + * Label enum. + * @name google.protobuf.FieldDescriptorProto.Label + * @enum {number} + * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value + * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value + * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value + */ + FieldDescriptorProto.Label = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "LABEL_OPTIONAL"] = 1; + values[valuesById[2] = "LABEL_REQUIRED"] = 2; + values[valuesById[3] = "LABEL_REPEATED"] = 3; + return values; + })(); + + return FieldDescriptorProto; + })(); + + protobuf.OneofDescriptorProto = (function() { + + /** + * Properties of an OneofDescriptorProto. + * @memberof google.protobuf + * @interface IOneofDescriptorProto + * @property {string|null} [name] OneofDescriptorProto name + * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options + */ + + /** + * Constructs a new OneofDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an OneofDescriptorProto. + * @implements IOneofDescriptorProto + * @constructor + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + */ + function OneofDescriptorProto(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]]; + } + + /** + * OneofDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.name = ""; + + /** + * OneofDescriptorProto options. + * @member {google.protobuf.IOneofOptions|null|undefined} options + * @memberof google.protobuf.OneofDescriptorProto + * @instance + */ + OneofDescriptorProto.prototype.options = null; + + /** + * Creates a new OneofDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance + */ + OneofDescriptorProto.create = function create(properties) { + return new OneofDescriptorProto(properties); + }; + + /** + * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.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.google.protobuf.OneofDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofDescriptorProto message. + * @function verify + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.OneofOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto + */ + OneofDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofDescriptorProto) + return object; + var message = new $root.google.protobuf.OneofDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofDescriptorProto + * @static + * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this OneofDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.OneofDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + OneofDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return OneofDescriptorProto; + })(); + + protobuf.EnumDescriptorProto = (function() { + + /** + * Properties of an EnumDescriptorProto. + * @memberof google.protobuf + * @interface IEnumDescriptorProto + * @property {string|null} [name] EnumDescriptorProto name + * @property {Array.|null} [value] EnumDescriptorProto value + * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options + * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange + * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName + */ + + /** + * Constructs a new EnumDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumDescriptorProto. + * @implements IEnumDescriptorProto + * @constructor + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + */ + function EnumDescriptorProto(properties) { + this.value = []; + this.reservedRange = []; + this.reservedName = []; + 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]]; + } + + /** + * EnumDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.name = ""; + + /** + * EnumDescriptorProto value. + * @member {Array.} value + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.value = $util.emptyArray; + + /** + * EnumDescriptorProto options. + * @member {google.protobuf.IEnumOptions|null|undefined} options + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.options = null; + + /** + * EnumDescriptorProto reservedRange. + * @member {Array.} reservedRange + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; + + /** + * EnumDescriptorProto reservedName. + * @member {Array.} reservedName + * @memberof google.protobuf.EnumDescriptorProto + * @instance + */ + EnumDescriptorProto.prototype.reservedName = $util.emptyArray; + + /** + * Creates a new EnumDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance + */ + EnumDescriptorProto.create = function create(properties) { + return new EnumDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.value != null && message.value.length) + for (var i = 0; i < message.value.length; ++i) + $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.reservedRange != null && message.reservedRange.length) + for (var i = 0; i < message.reservedRange.length; ++i) + $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.reservedName != null && message.reservedName.length) + for (var i = 0; i < message.reservedName.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); + return writer; + }; + + /** + * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.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.google.protobuf.EnumDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + if (!(message.value && message.value.length)) + message.value = []; + message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); + break; + case 3: + message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); + break; + case 4: + if (!(message.reservedRange && message.reservedRange.length)) + message.reservedRange = []; + message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); + break; + case 5: + if (!(message.reservedName && message.reservedName.length)) + message.reservedName = []; + message.reservedName.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.value != null && message.hasOwnProperty("value")) { + if (!Array.isArray(message.value)) + return "value: array expected"; + for (var i = 0; i < message.value.length; ++i) { + var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); + if (error) + return "value." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { + if (!Array.isArray(message.reservedRange)) + return "reservedRange: array expected"; + for (var i = 0; i < message.reservedRange.length; ++i) { + var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); + if (error) + return "reservedRange." + error; + } + } + if (message.reservedName != null && message.hasOwnProperty("reservedName")) { + if (!Array.isArray(message.reservedName)) + return "reservedName: array expected"; + for (var i = 0; i < message.reservedName.length; ++i) + if (!$util.isString(message.reservedName[i])) + return "reservedName: string[] expected"; + } + return null; + }; + + /** + * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto + */ + EnumDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.value) { + if (!Array.isArray(object.value)) + throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); + message.value = []; + for (var i = 0; i < object.value.length; ++i) { + if (typeof object.value[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); + message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); + } + if (object.reservedRange) { + if (!Array.isArray(object.reservedRange)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); + message.reservedRange = []; + for (var i = 0; i < object.reservedRange.length; ++i) { + if (typeof object.reservedRange[i] !== "object") + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); + message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); + } + } + if (object.reservedName) { + if (!Array.isArray(object.reservedName)) + throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); + message.reservedName = []; + for (var i = 0; i < object.reservedName.length; ++i) + message.reservedName[i] = String(object.reservedName[i]); + } + return message; + }; + + /** + * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto + * @static + * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.value = []; + object.reservedRange = []; + object.reservedName = []; + } + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.value && message.value.length) { + object.value = []; + for (var j = 0; j < message.value.length; ++j) + object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); + if (message.reservedRange && message.reservedRange.length) { + object.reservedRange = []; + for (var j = 0; j < message.reservedRange.length; ++j) + object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); + } + if (message.reservedName && message.reservedName.length) { + object.reservedName = []; + for (var j = 0; j < message.reservedName.length; ++j) + object.reservedName[j] = message.reservedName[j]; + } + return object; + }; + + /** + * Converts this EnumDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + EnumDescriptorProto.EnumReservedRange = (function() { + + /** + * Properties of an EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @interface IEnumReservedRange + * @property {number|null} [start] EnumReservedRange start + * @property {number|null} [end] EnumReservedRange end + */ + + /** + * Constructs a new EnumReservedRange. + * @memberof google.protobuf.EnumDescriptorProto + * @classdesc Represents an EnumReservedRange. + * @implements IEnumReservedRange + * @constructor + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + */ + function EnumReservedRange(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]]; + } + + /** + * EnumReservedRange start. + * @member {number} start + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.start = 0; + + /** + * EnumReservedRange end. + * @member {number} end + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + */ + EnumReservedRange.prototype.end = 0; + + /** + * Creates a new EnumReservedRange instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance + */ + EnumReservedRange.create = function create(properties) { + return new EnumReservedRange(properties); + }; + + /** + * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.start != null && Object.hasOwnProperty.call(message, "start")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); + return writer; + }; + + /** + * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.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.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.start = reader.int32(); + break; + case 2: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumReservedRange message. + * @function verify + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumReservedRange.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.start != null && message.hasOwnProperty("start")) + if (!$util.isInteger(message.start)) + return "start: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange + */ + EnumReservedRange.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) + return object; + var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); + if (object.start != null) + message.start = object.start | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @static + * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumReservedRange.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.start = 0; + object.end = 0; + } + if (message.start != null && message.hasOwnProperty("start")) + object.start = message.start; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this EnumReservedRange to JSON. + * @function toJSON + * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange + * @instance + * @returns {Object.} JSON object + */ + EnumReservedRange.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EnumReservedRange; + })(); + + return EnumDescriptorProto; + })(); + + protobuf.EnumValueDescriptorProto = (function() { + + /** + * Properties of an EnumValueDescriptorProto. + * @memberof google.protobuf + * @interface IEnumValueDescriptorProto + * @property {string|null} [name] EnumValueDescriptorProto name + * @property {number|null} [number] EnumValueDescriptorProto number + * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options + */ + + /** + * Constructs a new EnumValueDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents an EnumValueDescriptorProto. + * @implements IEnumValueDescriptorProto + * @constructor + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + */ + function EnumValueDescriptorProto(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]]; + } + + /** + * EnumValueDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.name = ""; + + /** + * EnumValueDescriptorProto number. + * @member {number} number + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.number = 0; + + /** + * EnumValueDescriptorProto options. + * @member {google.protobuf.IEnumValueOptions|null|undefined} options + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + */ + EnumValueDescriptorProto.prototype.options = null; + + /** + * Creates a new EnumValueDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance + */ + EnumValueDescriptorProto.create = function create(properties) { + return new EnumValueDescriptorProto(properties); + }; + + /** + * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.number != null && Object.hasOwnProperty.call(message, "number")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.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.google.protobuf.EnumValueDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.number = reader.int32(); + break; + case 3: + message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueDescriptorProto message. + * @function verify + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.number != null && message.hasOwnProperty("number")) + if (!$util.isInteger(message.number)) + return "number: integer expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.EnumValueOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto + */ + EnumValueDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) + return object; + var message = new $root.google.protobuf.EnumValueDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.number != null) + message.number = object.number | 0; + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueDescriptorProto + * @static + * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.number = 0; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.number != null && message.hasOwnProperty("number")) + object.number = message.number; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this EnumValueDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + EnumValueDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EnumValueDescriptorProto; + })(); + + protobuf.ServiceDescriptorProto = (function() { + + /** + * Properties of a ServiceDescriptorProto. + * @memberof google.protobuf + * @interface IServiceDescriptorProto + * @property {string|null} [name] ServiceDescriptorProto name + * @property {Array.|null} [method] ServiceDescriptorProto method + * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options + */ + + /** + * Constructs a new ServiceDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a ServiceDescriptorProto. + * @implements IServiceDescriptorProto + * @constructor + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + */ + function ServiceDescriptorProto(properties) { + this.method = []; + 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]]; + } + + /** + * ServiceDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.name = ""; + + /** + * ServiceDescriptorProto method. + * @member {Array.} method + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.method = $util.emptyArray; + + /** + * ServiceDescriptorProto options. + * @member {google.protobuf.IServiceOptions|null|undefined} options + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + */ + ServiceDescriptorProto.prototype.options = null; + + /** + * Creates a new ServiceDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance + */ + ServiceDescriptorProto.create = function create(properties) { + return new ServiceDescriptorProto(properties); + }; + + /** + * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.method != null && message.method.length) + for (var i = 0; i < message.method.length; ++i) + $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.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.google.protobuf.ServiceDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + if (!(message.method && message.method.length)) + message.method = []; + message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); + break; + case 3: + message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceDescriptorProto message. + * @function verify + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.method != null && message.hasOwnProperty("method")) { + if (!Array.isArray(message.method)) + return "method: array expected"; + for (var i = 0; i < message.method.length; ++i) { + var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); + if (error) + return "method." + error; + } + } + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.ServiceOptions.verify(message.options); + if (error) + return "options." + error; + } + return null; + }; + + /** + * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto + */ + ServiceDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceDescriptorProto) + return object; + var message = new $root.google.protobuf.ServiceDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.method) { + if (!Array.isArray(object.method)) + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); + message.method = []; + for (var i = 0; i < object.method.length; ++i) { + if (typeof object.method[i] !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); + message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); + } + } + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); + } + return message; + }; + + /** + * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceDescriptorProto + * @static + * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.method = []; + if (options.defaults) { + object.name = ""; + object.options = null; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.method && message.method.length) { + object.method = []; + for (var j = 0; j < message.method.length; ++j) + object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); + } + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); + return object; + }; + + /** + * Converts this ServiceDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + ServiceDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ServiceDescriptorProto; + })(); + + protobuf.MethodDescriptorProto = (function() { + + /** + * Properties of a MethodDescriptorProto. + * @memberof google.protobuf + * @interface IMethodDescriptorProto + * @property {string|null} [name] MethodDescriptorProto name + * @property {string|null} [inputType] MethodDescriptorProto inputType + * @property {string|null} [outputType] MethodDescriptorProto outputType + * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options + * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming + * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming + */ + + /** + * Constructs a new MethodDescriptorProto. + * @memberof google.protobuf + * @classdesc Represents a MethodDescriptorProto. + * @implements IMethodDescriptorProto + * @constructor + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + */ + function MethodDescriptorProto(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]]; + } + + /** + * MethodDescriptorProto name. + * @member {string} name + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.name = ""; + + /** + * MethodDescriptorProto inputType. + * @member {string} inputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.inputType = ""; + + /** + * MethodDescriptorProto outputType. + * @member {string} outputType + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.outputType = ""; + + /** + * MethodDescriptorProto options. + * @member {google.protobuf.IMethodOptions|null|undefined} options + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.options = null; + + /** + * MethodDescriptorProto clientStreaming. + * @member {boolean} clientStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.clientStreaming = false; + + /** + * MethodDescriptorProto serverStreaming. + * @member {boolean} serverStreaming + * @memberof google.protobuf.MethodDescriptorProto + * @instance + */ + MethodDescriptorProto.prototype.serverStreaming = false; + + /** + * Creates a new MethodDescriptorProto instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance + */ + MethodDescriptorProto.create = function create(properties) { + return new MethodDescriptorProto(properties); + }; + + /** + * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && Object.hasOwnProperty.call(message, "name")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); + if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); + if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); + if (message.options != null && Object.hasOwnProperty.call(message, "options")) + $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); + if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); + return writer; + }; + + /** + * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.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.google.protobuf.MethodDescriptorProto(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.name = reader.string(); + break; + case 2: + message.inputType = reader.string(); + break; + case 3: + message.outputType = reader.string(); + break; + case 4: + message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); + break; + case 5: + message.clientStreaming = reader.bool(); + break; + case 6: + message.serverStreaming = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodDescriptorProto message. + * @function verify + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodDescriptorProto.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) + if (!$util.isString(message.name)) + return "name: string expected"; + if (message.inputType != null && message.hasOwnProperty("inputType")) + if (!$util.isString(message.inputType)) + return "inputType: string expected"; + if (message.outputType != null && message.hasOwnProperty("outputType")) + if (!$util.isString(message.outputType)) + return "outputType: string expected"; + if (message.options != null && message.hasOwnProperty("options")) { + var error = $root.google.protobuf.MethodOptions.verify(message.options); + if (error) + return "options." + error; + } + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + if (typeof message.clientStreaming !== "boolean") + return "clientStreaming: boolean expected"; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + if (typeof message.serverStreaming !== "boolean") + return "serverStreaming: boolean expected"; + return null; + }; + + /** + * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto + */ + MethodDescriptorProto.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodDescriptorProto) + return object; + var message = new $root.google.protobuf.MethodDescriptorProto(); + if (object.name != null) + message.name = String(object.name); + if (object.inputType != null) + message.inputType = String(object.inputType); + if (object.outputType != null) + message.outputType = String(object.outputType); + if (object.options != null) { + if (typeof object.options !== "object") + throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); + message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); + } + if (object.clientStreaming != null) + message.clientStreaming = Boolean(object.clientStreaming); + if (object.serverStreaming != null) + message.serverStreaming = Boolean(object.serverStreaming); + return message; + }; + + /** + * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodDescriptorProto + * @static + * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodDescriptorProto.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.name = ""; + object.inputType = ""; + object.outputType = ""; + object.options = null; + object.clientStreaming = false; + object.serverStreaming = false; + } + if (message.name != null && message.hasOwnProperty("name")) + object.name = message.name; + if (message.inputType != null && message.hasOwnProperty("inputType")) + object.inputType = message.inputType; + if (message.outputType != null && message.hasOwnProperty("outputType")) + object.outputType = message.outputType; + if (message.options != null && message.hasOwnProperty("options")) + object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); + if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) + object.clientStreaming = message.clientStreaming; + if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) + object.serverStreaming = message.serverStreaming; + return object; + }; + + /** + * Converts this MethodDescriptorProto to JSON. + * @function toJSON + * @memberof google.protobuf.MethodDescriptorProto + * @instance + * @returns {Object.} JSON object + */ + MethodDescriptorProto.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MethodDescriptorProto; + })(); + + protobuf.FileOptions = (function() { + + /** + * Properties of a FileOptions. + * @memberof google.protobuf + * @interface IFileOptions + * @property {string|null} [javaPackage] FileOptions javaPackage + * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname + * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles + * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash + * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 + * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor + * @property {string|null} [goPackage] FileOptions goPackage + * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices + * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices + * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices + * @property {boolean|null} [phpGenericServices] FileOptions phpGenericServices + * @property {boolean|null} [deprecated] FileOptions deprecated + * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas + * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix + * @property {string|null} [csharpNamespace] FileOptions csharpNamespace + * @property {string|null} [swiftPrefix] FileOptions swiftPrefix + * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix + * @property {string|null} [phpNamespace] FileOptions phpNamespace + * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace + * @property {string|null} [rubyPackage] FileOptions rubyPackage + * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption + * @property {boolean|null} [".gogoproto.goprotoGettersAll"] FileOptions .gogoproto.goprotoGettersAll + * @property {boolean|null} [".gogoproto.goprotoEnumPrefixAll"] FileOptions .gogoproto.goprotoEnumPrefixAll + * @property {boolean|null} [".gogoproto.goprotoStringerAll"] FileOptions .gogoproto.goprotoStringerAll + * @property {boolean|null} [".gogoproto.verboseEqualAll"] FileOptions .gogoproto.verboseEqualAll + * @property {boolean|null} [".gogoproto.faceAll"] FileOptions .gogoproto.faceAll + * @property {boolean|null} [".gogoproto.gostringAll"] FileOptions .gogoproto.gostringAll + * @property {boolean|null} [".gogoproto.populateAll"] FileOptions .gogoproto.populateAll + * @property {boolean|null} [".gogoproto.stringerAll"] FileOptions .gogoproto.stringerAll + * @property {boolean|null} [".gogoproto.onlyoneAll"] FileOptions .gogoproto.onlyoneAll + * @property {boolean|null} [".gogoproto.equalAll"] FileOptions .gogoproto.equalAll + * @property {boolean|null} [".gogoproto.descriptionAll"] FileOptions .gogoproto.descriptionAll + * @property {boolean|null} [".gogoproto.testgenAll"] FileOptions .gogoproto.testgenAll + * @property {boolean|null} [".gogoproto.benchgenAll"] FileOptions .gogoproto.benchgenAll + * @property {boolean|null} [".gogoproto.marshalerAll"] FileOptions .gogoproto.marshalerAll + * @property {boolean|null} [".gogoproto.unmarshalerAll"] FileOptions .gogoproto.unmarshalerAll + * @property {boolean|null} [".gogoproto.stableMarshalerAll"] FileOptions .gogoproto.stableMarshalerAll + * @property {boolean|null} [".gogoproto.sizerAll"] FileOptions .gogoproto.sizerAll + * @property {boolean|null} [".gogoproto.goprotoEnumStringerAll"] FileOptions .gogoproto.goprotoEnumStringerAll + * @property {boolean|null} [".gogoproto.enumStringerAll"] FileOptions .gogoproto.enumStringerAll + * @property {boolean|null} [".gogoproto.unsafeMarshalerAll"] FileOptions .gogoproto.unsafeMarshalerAll + * @property {boolean|null} [".gogoproto.unsafeUnmarshalerAll"] FileOptions .gogoproto.unsafeUnmarshalerAll + * @property {boolean|null} [".gogoproto.goprotoExtensionsMapAll"] FileOptions .gogoproto.goprotoExtensionsMapAll + * @property {boolean|null} [".gogoproto.goprotoUnrecognizedAll"] FileOptions .gogoproto.goprotoUnrecognizedAll + * @property {boolean|null} [".gogoproto.gogoprotoImport"] FileOptions .gogoproto.gogoprotoImport + * @property {boolean|null} [".gogoproto.protosizerAll"] FileOptions .gogoproto.protosizerAll + * @property {boolean|null} [".gogoproto.compareAll"] FileOptions .gogoproto.compareAll + * @property {boolean|null} [".gogoproto.typedeclAll"] FileOptions .gogoproto.typedeclAll + * @property {boolean|null} [".gogoproto.enumdeclAll"] FileOptions .gogoproto.enumdeclAll + * @property {boolean|null} [".gogoproto.goprotoRegistration"] FileOptions .gogoproto.goprotoRegistration + * @property {boolean|null} [".gogoproto.messagenameAll"] FileOptions .gogoproto.messagenameAll + * @property {boolean|null} [".gogoproto.goprotoSizecacheAll"] FileOptions .gogoproto.goprotoSizecacheAll + * @property {boolean|null} [".gogoproto.goprotoUnkeyedAll"] FileOptions .gogoproto.goprotoUnkeyedAll + */ + + /** + * Constructs a new FileOptions. + * @memberof google.protobuf + * @classdesc Represents a FileOptions. + * @implements IFileOptions + * @constructor + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + */ + function FileOptions(properties) { + this.uninterpretedOption = []; + 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]]; + } + + /** + * FileOptions javaPackage. + * @member {string} javaPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaPackage = ""; + + /** + * FileOptions javaOuterClassname. + * @member {string} javaOuterClassname + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaOuterClassname = ""; + + /** + * FileOptions javaMultipleFiles. + * @member {boolean} javaMultipleFiles + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaMultipleFiles = false; + + /** + * FileOptions javaGenerateEqualsAndHash. + * @member {boolean} javaGenerateEqualsAndHash + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenerateEqualsAndHash = false; + + /** + * FileOptions javaStringCheckUtf8. + * @member {boolean} javaStringCheckUtf8 + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaStringCheckUtf8 = false; + + /** + * FileOptions optimizeFor. + * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.optimizeFor = 1; + + /** + * FileOptions goPackage. + * @member {string} goPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.goPackage = ""; + + /** + * FileOptions ccGenericServices. + * @member {boolean} ccGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccGenericServices = false; + + /** + * FileOptions javaGenericServices. + * @member {boolean} javaGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.javaGenericServices = false; + + /** + * FileOptions pyGenericServices. + * @member {boolean} pyGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.pyGenericServices = false; + + /** + * FileOptions phpGenericServices. + * @member {boolean} phpGenericServices + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpGenericServices = false; + + /** + * FileOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.deprecated = false; + + /** + * FileOptions ccEnableArenas. + * @member {boolean} ccEnableArenas + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.ccEnableArenas = true; + + /** + * FileOptions objcClassPrefix. + * @member {string} objcClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.objcClassPrefix = ""; + + /** + * FileOptions csharpNamespace. + * @member {string} csharpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.csharpNamespace = ""; + + /** + * FileOptions swiftPrefix. + * @member {string} swiftPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.swiftPrefix = ""; + + /** + * FileOptions phpClassPrefix. + * @member {string} phpClassPrefix + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpClassPrefix = ""; + + /** + * FileOptions phpNamespace. + * @member {string} phpNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpNamespace = ""; + + /** + * FileOptions phpMetadataNamespace. + * @member {string} phpMetadataNamespace + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.phpMetadataNamespace = ""; + + /** + * FileOptions rubyPackage. + * @member {string} rubyPackage + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.rubyPackage = ""; + + /** + * FileOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FileOptions .gogoproto.goprotoGettersAll. + * @member {boolean} .gogoproto.goprotoGettersAll + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".gogoproto.goprotoGettersAll"] = false; + + /** + * FileOptions .gogoproto.goprotoEnumPrefixAll. + * @member {boolean} .gogoproto.goprotoEnumPrefixAll + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".gogoproto.goprotoEnumPrefixAll"] = false; + + /** + * FileOptions .gogoproto.goprotoStringerAll. + * @member {boolean} .gogoproto.goprotoStringerAll + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".gogoproto.goprotoStringerAll"] = false; + + /** + * FileOptions .gogoproto.verboseEqualAll. + * @member {boolean} .gogoproto.verboseEqualAll + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".gogoproto.verboseEqualAll"] = false; + + /** + * FileOptions .gogoproto.faceAll. + * @member {boolean} .gogoproto.faceAll + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".gogoproto.faceAll"] = false; + + /** + * FileOptions .gogoproto.gostringAll. + * @member {boolean} .gogoproto.gostringAll + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".gogoproto.gostringAll"] = false; + + /** + * FileOptions .gogoproto.populateAll. + * @member {boolean} .gogoproto.populateAll + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".gogoproto.populateAll"] = false; + + /** + * FileOptions .gogoproto.stringerAll. + * @member {boolean} .gogoproto.stringerAll + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".gogoproto.stringerAll"] = false; + + /** + * FileOptions .gogoproto.onlyoneAll. + * @member {boolean} .gogoproto.onlyoneAll + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".gogoproto.onlyoneAll"] = false; + + /** + * FileOptions .gogoproto.equalAll. + * @member {boolean} .gogoproto.equalAll + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".gogoproto.equalAll"] = false; + + /** + * FileOptions .gogoproto.descriptionAll. + * @member {boolean} .gogoproto.descriptionAll + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".gogoproto.descriptionAll"] = false; + + /** + * FileOptions .gogoproto.testgenAll. + * @member {boolean} .gogoproto.testgenAll + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".gogoproto.testgenAll"] = false; + + /** + * FileOptions .gogoproto.benchgenAll. + * @member {boolean} .gogoproto.benchgenAll + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".gogoproto.benchgenAll"] = false; + + /** + * FileOptions .gogoproto.marshalerAll. + * @member {boolean} .gogoproto.marshalerAll + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".gogoproto.marshalerAll"] = false; + + /** + * FileOptions .gogoproto.unmarshalerAll. + * @member {boolean} .gogoproto.unmarshalerAll + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".gogoproto.unmarshalerAll"] = false; + + /** + * FileOptions .gogoproto.stableMarshalerAll. + * @member {boolean} .gogoproto.stableMarshalerAll + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".gogoproto.stableMarshalerAll"] = false; + + /** + * FileOptions .gogoproto.sizerAll. + * @member {boolean} .gogoproto.sizerAll + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".gogoproto.sizerAll"] = false; + + /** + * FileOptions .gogoproto.goprotoEnumStringerAll. + * @member {boolean} .gogoproto.goprotoEnumStringerAll + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".gogoproto.goprotoEnumStringerAll"] = false; + + /** + * FileOptions .gogoproto.enumStringerAll. + * @member {boolean} .gogoproto.enumStringerAll + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".gogoproto.enumStringerAll"] = false; + + /** + * FileOptions .gogoproto.unsafeMarshalerAll. + * @member {boolean} .gogoproto.unsafeMarshalerAll + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".gogoproto.unsafeMarshalerAll"] = false; + + /** + * FileOptions .gogoproto.unsafeUnmarshalerAll. + * @member {boolean} .gogoproto.unsafeUnmarshalerAll + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".gogoproto.unsafeUnmarshalerAll"] = false; + + /** + * FileOptions .gogoproto.goprotoExtensionsMapAll. + * @member {boolean} .gogoproto.goprotoExtensionsMapAll + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".gogoproto.goprotoExtensionsMapAll"] = false; + + /** + * FileOptions .gogoproto.goprotoUnrecognizedAll. + * @member {boolean} .gogoproto.goprotoUnrecognizedAll + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".gogoproto.goprotoUnrecognizedAll"] = false; + + /** + * FileOptions .gogoproto.gogoprotoImport. + * @member {boolean} .gogoproto.gogoprotoImport + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".gogoproto.gogoprotoImport"] = false; + + /** + * FileOptions .gogoproto.protosizerAll. + * @member {boolean} .gogoproto.protosizerAll + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".gogoproto.protosizerAll"] = false; + + /** + * FileOptions .gogoproto.compareAll. + * @member {boolean} .gogoproto.compareAll + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".gogoproto.compareAll"] = false; + + /** + * FileOptions .gogoproto.typedeclAll. + * @member {boolean} .gogoproto.typedeclAll + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".gogoproto.typedeclAll"] = false; + + /** + * FileOptions .gogoproto.enumdeclAll. + * @member {boolean} .gogoproto.enumdeclAll + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".gogoproto.enumdeclAll"] = false; + + /** + * FileOptions .gogoproto.goprotoRegistration. + * @member {boolean} .gogoproto.goprotoRegistration + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".gogoproto.goprotoRegistration"] = false; + + /** + * FileOptions .gogoproto.messagenameAll. + * @member {boolean} .gogoproto.messagenameAll + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".gogoproto.messagenameAll"] = false; + + /** + * FileOptions .gogoproto.goprotoSizecacheAll. + * @member {boolean} .gogoproto.goprotoSizecacheAll + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".gogoproto.goprotoSizecacheAll"] = false; + + /** + * FileOptions .gogoproto.goprotoUnkeyedAll. + * @member {boolean} .gogoproto.goprotoUnkeyedAll + * @memberof google.protobuf.FileOptions + * @instance + */ + FileOptions.prototype[".gogoproto.goprotoUnkeyedAll"] = false; + + /** + * Creates a new FileOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions=} [properties] Properties to set + * @returns {google.protobuf.FileOptions} FileOptions instance + */ + FileOptions.create = function create(properties) { + return new FileOptions(properties); + }; + + /** + * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); + if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); + if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) + writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); + if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); + if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); + if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) + writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); + if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) + writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); + if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) + writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); + if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) + writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); + if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) + writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); + if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) + writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); + if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) + writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); + if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) + writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); + if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) + writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); + if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) + writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); + if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) + writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); + if (message.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) + writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); + if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) + writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); + if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) + writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".gogoproto.goprotoGettersAll"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goprotoGettersAll")) + writer.uint32(/* id 63001, wireType 0 =*/504008).bool(message[".gogoproto.goprotoGettersAll"]); + if (message[".gogoproto.goprotoEnumPrefixAll"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goprotoEnumPrefixAll")) + writer.uint32(/* id 63002, wireType 0 =*/504016).bool(message[".gogoproto.goprotoEnumPrefixAll"]); + if (message[".gogoproto.goprotoStringerAll"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goprotoStringerAll")) + writer.uint32(/* id 63003, wireType 0 =*/504024).bool(message[".gogoproto.goprotoStringerAll"]); + if (message[".gogoproto.verboseEqualAll"] != null && Object.hasOwnProperty.call(message, ".gogoproto.verboseEqualAll")) + writer.uint32(/* id 63004, wireType 0 =*/504032).bool(message[".gogoproto.verboseEqualAll"]); + if (message[".gogoproto.faceAll"] != null && Object.hasOwnProperty.call(message, ".gogoproto.faceAll")) + writer.uint32(/* id 63005, wireType 0 =*/504040).bool(message[".gogoproto.faceAll"]); + if (message[".gogoproto.gostringAll"] != null && Object.hasOwnProperty.call(message, ".gogoproto.gostringAll")) + writer.uint32(/* id 63006, wireType 0 =*/504048).bool(message[".gogoproto.gostringAll"]); + if (message[".gogoproto.populateAll"] != null && Object.hasOwnProperty.call(message, ".gogoproto.populateAll")) + writer.uint32(/* id 63007, wireType 0 =*/504056).bool(message[".gogoproto.populateAll"]); + if (message[".gogoproto.stringerAll"] != null && Object.hasOwnProperty.call(message, ".gogoproto.stringerAll")) + writer.uint32(/* id 63008, wireType 0 =*/504064).bool(message[".gogoproto.stringerAll"]); + if (message[".gogoproto.onlyoneAll"] != null && Object.hasOwnProperty.call(message, ".gogoproto.onlyoneAll")) + writer.uint32(/* id 63009, wireType 0 =*/504072).bool(message[".gogoproto.onlyoneAll"]); + if (message[".gogoproto.equalAll"] != null && Object.hasOwnProperty.call(message, ".gogoproto.equalAll")) + writer.uint32(/* id 63013, wireType 0 =*/504104).bool(message[".gogoproto.equalAll"]); + if (message[".gogoproto.descriptionAll"] != null && Object.hasOwnProperty.call(message, ".gogoproto.descriptionAll")) + writer.uint32(/* id 63014, wireType 0 =*/504112).bool(message[".gogoproto.descriptionAll"]); + if (message[".gogoproto.testgenAll"] != null && Object.hasOwnProperty.call(message, ".gogoproto.testgenAll")) + writer.uint32(/* id 63015, wireType 0 =*/504120).bool(message[".gogoproto.testgenAll"]); + if (message[".gogoproto.benchgenAll"] != null && Object.hasOwnProperty.call(message, ".gogoproto.benchgenAll")) + writer.uint32(/* id 63016, wireType 0 =*/504128).bool(message[".gogoproto.benchgenAll"]); + if (message[".gogoproto.marshalerAll"] != null && Object.hasOwnProperty.call(message, ".gogoproto.marshalerAll")) + writer.uint32(/* id 63017, wireType 0 =*/504136).bool(message[".gogoproto.marshalerAll"]); + if (message[".gogoproto.unmarshalerAll"] != null && Object.hasOwnProperty.call(message, ".gogoproto.unmarshalerAll")) + writer.uint32(/* id 63018, wireType 0 =*/504144).bool(message[".gogoproto.unmarshalerAll"]); + if (message[".gogoproto.stableMarshalerAll"] != null && Object.hasOwnProperty.call(message, ".gogoproto.stableMarshalerAll")) + writer.uint32(/* id 63019, wireType 0 =*/504152).bool(message[".gogoproto.stableMarshalerAll"]); + if (message[".gogoproto.sizerAll"] != null && Object.hasOwnProperty.call(message, ".gogoproto.sizerAll")) + writer.uint32(/* id 63020, wireType 0 =*/504160).bool(message[".gogoproto.sizerAll"]); + if (message[".gogoproto.goprotoEnumStringerAll"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goprotoEnumStringerAll")) + writer.uint32(/* id 63021, wireType 0 =*/504168).bool(message[".gogoproto.goprotoEnumStringerAll"]); + if (message[".gogoproto.enumStringerAll"] != null && Object.hasOwnProperty.call(message, ".gogoproto.enumStringerAll")) + writer.uint32(/* id 63022, wireType 0 =*/504176).bool(message[".gogoproto.enumStringerAll"]); + if (message[".gogoproto.unsafeMarshalerAll"] != null && Object.hasOwnProperty.call(message, ".gogoproto.unsafeMarshalerAll")) + writer.uint32(/* id 63023, wireType 0 =*/504184).bool(message[".gogoproto.unsafeMarshalerAll"]); + if (message[".gogoproto.unsafeUnmarshalerAll"] != null && Object.hasOwnProperty.call(message, ".gogoproto.unsafeUnmarshalerAll")) + writer.uint32(/* id 63024, wireType 0 =*/504192).bool(message[".gogoproto.unsafeUnmarshalerAll"]); + if (message[".gogoproto.goprotoExtensionsMapAll"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goprotoExtensionsMapAll")) + writer.uint32(/* id 63025, wireType 0 =*/504200).bool(message[".gogoproto.goprotoExtensionsMapAll"]); + if (message[".gogoproto.goprotoUnrecognizedAll"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goprotoUnrecognizedAll")) + writer.uint32(/* id 63026, wireType 0 =*/504208).bool(message[".gogoproto.goprotoUnrecognizedAll"]); + if (message[".gogoproto.gogoprotoImport"] != null && Object.hasOwnProperty.call(message, ".gogoproto.gogoprotoImport")) + writer.uint32(/* id 63027, wireType 0 =*/504216).bool(message[".gogoproto.gogoprotoImport"]); + if (message[".gogoproto.protosizerAll"] != null && Object.hasOwnProperty.call(message, ".gogoproto.protosizerAll")) + writer.uint32(/* id 63028, wireType 0 =*/504224).bool(message[".gogoproto.protosizerAll"]); + if (message[".gogoproto.compareAll"] != null && Object.hasOwnProperty.call(message, ".gogoproto.compareAll")) + writer.uint32(/* id 63029, wireType 0 =*/504232).bool(message[".gogoproto.compareAll"]); + if (message[".gogoproto.typedeclAll"] != null && Object.hasOwnProperty.call(message, ".gogoproto.typedeclAll")) + writer.uint32(/* id 63030, wireType 0 =*/504240).bool(message[".gogoproto.typedeclAll"]); + if (message[".gogoproto.enumdeclAll"] != null && Object.hasOwnProperty.call(message, ".gogoproto.enumdeclAll")) + writer.uint32(/* id 63031, wireType 0 =*/504248).bool(message[".gogoproto.enumdeclAll"]); + if (message[".gogoproto.goprotoRegistration"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goprotoRegistration")) + writer.uint32(/* id 63032, wireType 0 =*/504256).bool(message[".gogoproto.goprotoRegistration"]); + if (message[".gogoproto.messagenameAll"] != null && Object.hasOwnProperty.call(message, ".gogoproto.messagenameAll")) + writer.uint32(/* id 63033, wireType 0 =*/504264).bool(message[".gogoproto.messagenameAll"]); + if (message[".gogoproto.goprotoSizecacheAll"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goprotoSizecacheAll")) + writer.uint32(/* id 63034, wireType 0 =*/504272).bool(message[".gogoproto.goprotoSizecacheAll"]); + if (message[".gogoproto.goprotoUnkeyedAll"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goprotoUnkeyedAll")) + writer.uint32(/* id 63035, wireType 0 =*/504280).bool(message[".gogoproto.goprotoUnkeyedAll"]); + return writer; + }; + + /** + * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FileOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.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.google.protobuf.FileOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.javaPackage = reader.string(); + break; + case 8: + message.javaOuterClassname = reader.string(); + break; + case 10: + message.javaMultipleFiles = reader.bool(); + break; + case 20: + message.javaGenerateEqualsAndHash = reader.bool(); + break; + case 27: + message.javaStringCheckUtf8 = reader.bool(); + break; + case 9: + message.optimizeFor = reader.int32(); + break; + case 11: + message.goPackage = reader.string(); + break; + case 16: + message.ccGenericServices = reader.bool(); + break; + case 17: + message.javaGenericServices = reader.bool(); + break; + case 18: + message.pyGenericServices = reader.bool(); + break; + case 42: + message.phpGenericServices = reader.bool(); + break; + case 23: + message.deprecated = reader.bool(); + break; + case 31: + message.ccEnableArenas = reader.bool(); + break; + case 36: + message.objcClassPrefix = reader.string(); + break; + case 37: + message.csharpNamespace = reader.string(); + break; + case 39: + message.swiftPrefix = reader.string(); + break; + case 40: + message.phpClassPrefix = reader.string(); + break; + case 41: + message.phpNamespace = reader.string(); + break; + case 44: + message.phpMetadataNamespace = reader.string(); + break; + case 45: + message.rubyPackage = reader.string(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + case 63001: + message[".gogoproto.goprotoGettersAll"] = reader.bool(); + break; + case 63002: + message[".gogoproto.goprotoEnumPrefixAll"] = reader.bool(); + break; + case 63003: + message[".gogoproto.goprotoStringerAll"] = reader.bool(); + break; + case 63004: + message[".gogoproto.verboseEqualAll"] = reader.bool(); + break; + case 63005: + message[".gogoproto.faceAll"] = reader.bool(); + break; + case 63006: + message[".gogoproto.gostringAll"] = reader.bool(); + break; + case 63007: + message[".gogoproto.populateAll"] = reader.bool(); + break; + case 63008: + message[".gogoproto.stringerAll"] = reader.bool(); + break; + case 63009: + message[".gogoproto.onlyoneAll"] = reader.bool(); + break; + case 63013: + message[".gogoproto.equalAll"] = reader.bool(); + break; + case 63014: + message[".gogoproto.descriptionAll"] = reader.bool(); + break; + case 63015: + message[".gogoproto.testgenAll"] = reader.bool(); + break; + case 63016: + message[".gogoproto.benchgenAll"] = reader.bool(); + break; + case 63017: + message[".gogoproto.marshalerAll"] = reader.bool(); + break; + case 63018: + message[".gogoproto.unmarshalerAll"] = reader.bool(); + break; + case 63019: + message[".gogoproto.stableMarshalerAll"] = reader.bool(); + break; + case 63020: + message[".gogoproto.sizerAll"] = reader.bool(); + break; + case 63021: + message[".gogoproto.goprotoEnumStringerAll"] = reader.bool(); + break; + case 63022: + message[".gogoproto.enumStringerAll"] = reader.bool(); + break; + case 63023: + message[".gogoproto.unsafeMarshalerAll"] = reader.bool(); + break; + case 63024: + message[".gogoproto.unsafeUnmarshalerAll"] = reader.bool(); + break; + case 63025: + message[".gogoproto.goprotoExtensionsMapAll"] = reader.bool(); + break; + case 63026: + message[".gogoproto.goprotoUnrecognizedAll"] = reader.bool(); + break; + case 63027: + message[".gogoproto.gogoprotoImport"] = reader.bool(); + break; + case 63028: + message[".gogoproto.protosizerAll"] = reader.bool(); + break; + case 63029: + message[".gogoproto.compareAll"] = reader.bool(); + break; + case 63030: + message[".gogoproto.typedeclAll"] = reader.bool(); + break; + case 63031: + message[".gogoproto.enumdeclAll"] = reader.bool(); + break; + case 63032: + message[".gogoproto.goprotoRegistration"] = reader.bool(); + break; + case 63033: + message[".gogoproto.messagenameAll"] = reader.bool(); + break; + case 63034: + message[".gogoproto.goprotoSizecacheAll"] = reader.bool(); + break; + case 63035: + message[".gogoproto.goprotoUnkeyedAll"] = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FileOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FileOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FileOptions} FileOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FileOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FileOptions message. + * @function verify + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FileOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + if (!$util.isString(message.javaPackage)) + return "javaPackage: string expected"; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + if (!$util.isString(message.javaOuterClassname)) + return "javaOuterClassname: string expected"; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + if (typeof message.javaMultipleFiles !== "boolean") + return "javaMultipleFiles: boolean expected"; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + if (typeof message.javaGenerateEqualsAndHash !== "boolean") + return "javaGenerateEqualsAndHash: boolean expected"; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + if (typeof message.javaStringCheckUtf8 !== "boolean") + return "javaStringCheckUtf8: boolean expected"; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + switch (message.optimizeFor) { + default: + return "optimizeFor: enum value expected"; + case 1: + case 2: + case 3: + break; + } + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + if (!$util.isString(message.goPackage)) + return "goPackage: string expected"; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + if (typeof message.ccGenericServices !== "boolean") + return "ccGenericServices: boolean expected"; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + if (typeof message.javaGenericServices !== "boolean") + return "javaGenericServices: boolean expected"; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + if (typeof message.pyGenericServices !== "boolean") + return "pyGenericServices: boolean expected"; + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + if (typeof message.phpGenericServices !== "boolean") + return "phpGenericServices: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + if (typeof message.ccEnableArenas !== "boolean") + return "ccEnableArenas: boolean expected"; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + if (!$util.isString(message.objcClassPrefix)) + return "objcClassPrefix: string expected"; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + if (!$util.isString(message.csharpNamespace)) + return "csharpNamespace: string expected"; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + if (!$util.isString(message.swiftPrefix)) + return "swiftPrefix: string expected"; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + if (!$util.isString(message.phpClassPrefix)) + return "phpClassPrefix: string expected"; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + if (!$util.isString(message.phpNamespace)) + return "phpNamespace: string expected"; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + if (!$util.isString(message.phpMetadataNamespace)) + return "phpMetadataNamespace: string expected"; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + if (!$util.isString(message.rubyPackage)) + return "rubyPackage: string expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".gogoproto.goprotoGettersAll"] != null && message.hasOwnProperty(".gogoproto.goprotoGettersAll")) + if (typeof message[".gogoproto.goprotoGettersAll"] !== "boolean") + return ".gogoproto.goprotoGettersAll: boolean expected"; + if (message[".gogoproto.goprotoEnumPrefixAll"] != null && message.hasOwnProperty(".gogoproto.goprotoEnumPrefixAll")) + if (typeof message[".gogoproto.goprotoEnumPrefixAll"] !== "boolean") + return ".gogoproto.goprotoEnumPrefixAll: boolean expected"; + if (message[".gogoproto.goprotoStringerAll"] != null && message.hasOwnProperty(".gogoproto.goprotoStringerAll")) + if (typeof message[".gogoproto.goprotoStringerAll"] !== "boolean") + return ".gogoproto.goprotoStringerAll: boolean expected"; + if (message[".gogoproto.verboseEqualAll"] != null && message.hasOwnProperty(".gogoproto.verboseEqualAll")) + if (typeof message[".gogoproto.verboseEqualAll"] !== "boolean") + return ".gogoproto.verboseEqualAll: boolean expected"; + if (message[".gogoproto.faceAll"] != null && message.hasOwnProperty(".gogoproto.faceAll")) + if (typeof message[".gogoproto.faceAll"] !== "boolean") + return ".gogoproto.faceAll: boolean expected"; + if (message[".gogoproto.gostringAll"] != null && message.hasOwnProperty(".gogoproto.gostringAll")) + if (typeof message[".gogoproto.gostringAll"] !== "boolean") + return ".gogoproto.gostringAll: boolean expected"; + if (message[".gogoproto.populateAll"] != null && message.hasOwnProperty(".gogoproto.populateAll")) + if (typeof message[".gogoproto.populateAll"] !== "boolean") + return ".gogoproto.populateAll: boolean expected"; + if (message[".gogoproto.stringerAll"] != null && message.hasOwnProperty(".gogoproto.stringerAll")) + if (typeof message[".gogoproto.stringerAll"] !== "boolean") + return ".gogoproto.stringerAll: boolean expected"; + if (message[".gogoproto.onlyoneAll"] != null && message.hasOwnProperty(".gogoproto.onlyoneAll")) + if (typeof message[".gogoproto.onlyoneAll"] !== "boolean") + return ".gogoproto.onlyoneAll: boolean expected"; + if (message[".gogoproto.equalAll"] != null && message.hasOwnProperty(".gogoproto.equalAll")) + if (typeof message[".gogoproto.equalAll"] !== "boolean") + return ".gogoproto.equalAll: boolean expected"; + if (message[".gogoproto.descriptionAll"] != null && message.hasOwnProperty(".gogoproto.descriptionAll")) + if (typeof message[".gogoproto.descriptionAll"] !== "boolean") + return ".gogoproto.descriptionAll: boolean expected"; + if (message[".gogoproto.testgenAll"] != null && message.hasOwnProperty(".gogoproto.testgenAll")) + if (typeof message[".gogoproto.testgenAll"] !== "boolean") + return ".gogoproto.testgenAll: boolean expected"; + if (message[".gogoproto.benchgenAll"] != null && message.hasOwnProperty(".gogoproto.benchgenAll")) + if (typeof message[".gogoproto.benchgenAll"] !== "boolean") + return ".gogoproto.benchgenAll: boolean expected"; + if (message[".gogoproto.marshalerAll"] != null && message.hasOwnProperty(".gogoproto.marshalerAll")) + if (typeof message[".gogoproto.marshalerAll"] !== "boolean") + return ".gogoproto.marshalerAll: boolean expected"; + if (message[".gogoproto.unmarshalerAll"] != null && message.hasOwnProperty(".gogoproto.unmarshalerAll")) + if (typeof message[".gogoproto.unmarshalerAll"] !== "boolean") + return ".gogoproto.unmarshalerAll: boolean expected"; + if (message[".gogoproto.stableMarshalerAll"] != null && message.hasOwnProperty(".gogoproto.stableMarshalerAll")) + if (typeof message[".gogoproto.stableMarshalerAll"] !== "boolean") + return ".gogoproto.stableMarshalerAll: boolean expected"; + if (message[".gogoproto.sizerAll"] != null && message.hasOwnProperty(".gogoproto.sizerAll")) + if (typeof message[".gogoproto.sizerAll"] !== "boolean") + return ".gogoproto.sizerAll: boolean expected"; + if (message[".gogoproto.goprotoEnumStringerAll"] != null && message.hasOwnProperty(".gogoproto.goprotoEnumStringerAll")) + if (typeof message[".gogoproto.goprotoEnumStringerAll"] !== "boolean") + return ".gogoproto.goprotoEnumStringerAll: boolean expected"; + if (message[".gogoproto.enumStringerAll"] != null && message.hasOwnProperty(".gogoproto.enumStringerAll")) + if (typeof message[".gogoproto.enumStringerAll"] !== "boolean") + return ".gogoproto.enumStringerAll: boolean expected"; + if (message[".gogoproto.unsafeMarshalerAll"] != null && message.hasOwnProperty(".gogoproto.unsafeMarshalerAll")) + if (typeof message[".gogoproto.unsafeMarshalerAll"] !== "boolean") + return ".gogoproto.unsafeMarshalerAll: boolean expected"; + if (message[".gogoproto.unsafeUnmarshalerAll"] != null && message.hasOwnProperty(".gogoproto.unsafeUnmarshalerAll")) + if (typeof message[".gogoproto.unsafeUnmarshalerAll"] !== "boolean") + return ".gogoproto.unsafeUnmarshalerAll: boolean expected"; + if (message[".gogoproto.goprotoExtensionsMapAll"] != null && message.hasOwnProperty(".gogoproto.goprotoExtensionsMapAll")) + if (typeof message[".gogoproto.goprotoExtensionsMapAll"] !== "boolean") + return ".gogoproto.goprotoExtensionsMapAll: boolean expected"; + if (message[".gogoproto.goprotoUnrecognizedAll"] != null && message.hasOwnProperty(".gogoproto.goprotoUnrecognizedAll")) + if (typeof message[".gogoproto.goprotoUnrecognizedAll"] !== "boolean") + return ".gogoproto.goprotoUnrecognizedAll: boolean expected"; + if (message[".gogoproto.gogoprotoImport"] != null && message.hasOwnProperty(".gogoproto.gogoprotoImport")) + if (typeof message[".gogoproto.gogoprotoImport"] !== "boolean") + return ".gogoproto.gogoprotoImport: boolean expected"; + if (message[".gogoproto.protosizerAll"] != null && message.hasOwnProperty(".gogoproto.protosizerAll")) + if (typeof message[".gogoproto.protosizerAll"] !== "boolean") + return ".gogoproto.protosizerAll: boolean expected"; + if (message[".gogoproto.compareAll"] != null && message.hasOwnProperty(".gogoproto.compareAll")) + if (typeof message[".gogoproto.compareAll"] !== "boolean") + return ".gogoproto.compareAll: boolean expected"; + if (message[".gogoproto.typedeclAll"] != null && message.hasOwnProperty(".gogoproto.typedeclAll")) + if (typeof message[".gogoproto.typedeclAll"] !== "boolean") + return ".gogoproto.typedeclAll: boolean expected"; + if (message[".gogoproto.enumdeclAll"] != null && message.hasOwnProperty(".gogoproto.enumdeclAll")) + if (typeof message[".gogoproto.enumdeclAll"] !== "boolean") + return ".gogoproto.enumdeclAll: boolean expected"; + if (message[".gogoproto.goprotoRegistration"] != null && message.hasOwnProperty(".gogoproto.goprotoRegistration")) + if (typeof message[".gogoproto.goprotoRegistration"] !== "boolean") + return ".gogoproto.goprotoRegistration: boolean expected"; + if (message[".gogoproto.messagenameAll"] != null && message.hasOwnProperty(".gogoproto.messagenameAll")) + if (typeof message[".gogoproto.messagenameAll"] !== "boolean") + return ".gogoproto.messagenameAll: boolean expected"; + if (message[".gogoproto.goprotoSizecacheAll"] != null && message.hasOwnProperty(".gogoproto.goprotoSizecacheAll")) + if (typeof message[".gogoproto.goprotoSizecacheAll"] !== "boolean") + return ".gogoproto.goprotoSizecacheAll: boolean expected"; + if (message[".gogoproto.goprotoUnkeyedAll"] != null && message.hasOwnProperty(".gogoproto.goprotoUnkeyedAll")) + if (typeof message[".gogoproto.goprotoUnkeyedAll"] !== "boolean") + return ".gogoproto.goprotoUnkeyedAll: boolean expected"; + return null; + }; + + /** + * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FileOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FileOptions} FileOptions + */ + FileOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FileOptions) + return object; + var message = new $root.google.protobuf.FileOptions(); + if (object.javaPackage != null) + message.javaPackage = String(object.javaPackage); + if (object.javaOuterClassname != null) + message.javaOuterClassname = String(object.javaOuterClassname); + if (object.javaMultipleFiles != null) + message.javaMultipleFiles = Boolean(object.javaMultipleFiles); + if (object.javaGenerateEqualsAndHash != null) + message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); + if (object.javaStringCheckUtf8 != null) + message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); + switch (object.optimizeFor) { + case "SPEED": + case 1: + message.optimizeFor = 1; + break; + case "CODE_SIZE": + case 2: + message.optimizeFor = 2; + break; + case "LITE_RUNTIME": + case 3: + message.optimizeFor = 3; + break; + } + if (object.goPackage != null) + message.goPackage = String(object.goPackage); + if (object.ccGenericServices != null) + message.ccGenericServices = Boolean(object.ccGenericServices); + if (object.javaGenericServices != null) + message.javaGenericServices = Boolean(object.javaGenericServices); + if (object.pyGenericServices != null) + message.pyGenericServices = Boolean(object.pyGenericServices); + if (object.phpGenericServices != null) + message.phpGenericServices = Boolean(object.phpGenericServices); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.ccEnableArenas != null) + message.ccEnableArenas = Boolean(object.ccEnableArenas); + if (object.objcClassPrefix != null) + message.objcClassPrefix = String(object.objcClassPrefix); + if (object.csharpNamespace != null) + message.csharpNamespace = String(object.csharpNamespace); + if (object.swiftPrefix != null) + message.swiftPrefix = String(object.swiftPrefix); + if (object.phpClassPrefix != null) + message.phpClassPrefix = String(object.phpClassPrefix); + if (object.phpNamespace != null) + message.phpNamespace = String(object.phpNamespace); + if (object.phpMetadataNamespace != null) + message.phpMetadataNamespace = String(object.phpMetadataNamespace); + if (object.rubyPackage != null) + message.rubyPackage = String(object.rubyPackage); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".gogoproto.goprotoGettersAll"] != null) + message[".gogoproto.goprotoGettersAll"] = Boolean(object[".gogoproto.goprotoGettersAll"]); + if (object[".gogoproto.goprotoEnumPrefixAll"] != null) + message[".gogoproto.goprotoEnumPrefixAll"] = Boolean(object[".gogoproto.goprotoEnumPrefixAll"]); + if (object[".gogoproto.goprotoStringerAll"] != null) + message[".gogoproto.goprotoStringerAll"] = Boolean(object[".gogoproto.goprotoStringerAll"]); + if (object[".gogoproto.verboseEqualAll"] != null) + message[".gogoproto.verboseEqualAll"] = Boolean(object[".gogoproto.verboseEqualAll"]); + if (object[".gogoproto.faceAll"] != null) + message[".gogoproto.faceAll"] = Boolean(object[".gogoproto.faceAll"]); + if (object[".gogoproto.gostringAll"] != null) + message[".gogoproto.gostringAll"] = Boolean(object[".gogoproto.gostringAll"]); + if (object[".gogoproto.populateAll"] != null) + message[".gogoproto.populateAll"] = Boolean(object[".gogoproto.populateAll"]); + if (object[".gogoproto.stringerAll"] != null) + message[".gogoproto.stringerAll"] = Boolean(object[".gogoproto.stringerAll"]); + if (object[".gogoproto.onlyoneAll"] != null) + message[".gogoproto.onlyoneAll"] = Boolean(object[".gogoproto.onlyoneAll"]); + if (object[".gogoproto.equalAll"] != null) + message[".gogoproto.equalAll"] = Boolean(object[".gogoproto.equalAll"]); + if (object[".gogoproto.descriptionAll"] != null) + message[".gogoproto.descriptionAll"] = Boolean(object[".gogoproto.descriptionAll"]); + if (object[".gogoproto.testgenAll"] != null) + message[".gogoproto.testgenAll"] = Boolean(object[".gogoproto.testgenAll"]); + if (object[".gogoproto.benchgenAll"] != null) + message[".gogoproto.benchgenAll"] = Boolean(object[".gogoproto.benchgenAll"]); + if (object[".gogoproto.marshalerAll"] != null) + message[".gogoproto.marshalerAll"] = Boolean(object[".gogoproto.marshalerAll"]); + if (object[".gogoproto.unmarshalerAll"] != null) + message[".gogoproto.unmarshalerAll"] = Boolean(object[".gogoproto.unmarshalerAll"]); + if (object[".gogoproto.stableMarshalerAll"] != null) + message[".gogoproto.stableMarshalerAll"] = Boolean(object[".gogoproto.stableMarshalerAll"]); + if (object[".gogoproto.sizerAll"] != null) + message[".gogoproto.sizerAll"] = Boolean(object[".gogoproto.sizerAll"]); + if (object[".gogoproto.goprotoEnumStringerAll"] != null) + message[".gogoproto.goprotoEnumStringerAll"] = Boolean(object[".gogoproto.goprotoEnumStringerAll"]); + if (object[".gogoproto.enumStringerAll"] != null) + message[".gogoproto.enumStringerAll"] = Boolean(object[".gogoproto.enumStringerAll"]); + if (object[".gogoproto.unsafeMarshalerAll"] != null) + message[".gogoproto.unsafeMarshalerAll"] = Boolean(object[".gogoproto.unsafeMarshalerAll"]); + if (object[".gogoproto.unsafeUnmarshalerAll"] != null) + message[".gogoproto.unsafeUnmarshalerAll"] = Boolean(object[".gogoproto.unsafeUnmarshalerAll"]); + if (object[".gogoproto.goprotoExtensionsMapAll"] != null) + message[".gogoproto.goprotoExtensionsMapAll"] = Boolean(object[".gogoproto.goprotoExtensionsMapAll"]); + if (object[".gogoproto.goprotoUnrecognizedAll"] != null) + message[".gogoproto.goprotoUnrecognizedAll"] = Boolean(object[".gogoproto.goprotoUnrecognizedAll"]); + if (object[".gogoproto.gogoprotoImport"] != null) + message[".gogoproto.gogoprotoImport"] = Boolean(object[".gogoproto.gogoprotoImport"]); + if (object[".gogoproto.protosizerAll"] != null) + message[".gogoproto.protosizerAll"] = Boolean(object[".gogoproto.protosizerAll"]); + if (object[".gogoproto.compareAll"] != null) + message[".gogoproto.compareAll"] = Boolean(object[".gogoproto.compareAll"]); + if (object[".gogoproto.typedeclAll"] != null) + message[".gogoproto.typedeclAll"] = Boolean(object[".gogoproto.typedeclAll"]); + if (object[".gogoproto.enumdeclAll"] != null) + message[".gogoproto.enumdeclAll"] = Boolean(object[".gogoproto.enumdeclAll"]); + if (object[".gogoproto.goprotoRegistration"] != null) + message[".gogoproto.goprotoRegistration"] = Boolean(object[".gogoproto.goprotoRegistration"]); + if (object[".gogoproto.messagenameAll"] != null) + message[".gogoproto.messagenameAll"] = Boolean(object[".gogoproto.messagenameAll"]); + if (object[".gogoproto.goprotoSizecacheAll"] != null) + message[".gogoproto.goprotoSizecacheAll"] = Boolean(object[".gogoproto.goprotoSizecacheAll"]); + if (object[".gogoproto.goprotoUnkeyedAll"] != null) + message[".gogoproto.goprotoUnkeyedAll"] = Boolean(object[".gogoproto.goprotoUnkeyedAll"]); + return message; + }; + + /** + * Creates a plain object from a FileOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FileOptions + * @static + * @param {google.protobuf.FileOptions} message FileOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FileOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.javaPackage = ""; + object.javaOuterClassname = ""; + object.optimizeFor = options.enums === String ? "SPEED" : 1; + object.javaMultipleFiles = false; + object.goPackage = ""; + object.ccGenericServices = false; + object.javaGenericServices = false; + object.pyGenericServices = false; + object.javaGenerateEqualsAndHash = false; + object.deprecated = false; + object.javaStringCheckUtf8 = false; + object.ccEnableArenas = true; + object.objcClassPrefix = ""; + object.csharpNamespace = ""; + object.swiftPrefix = ""; + object.phpClassPrefix = ""; + object.phpNamespace = ""; + object.phpGenericServices = false; + object.phpMetadataNamespace = ""; + object.rubyPackage = ""; + object[".gogoproto.goprotoGettersAll"] = false; + object[".gogoproto.goprotoEnumPrefixAll"] = false; + object[".gogoproto.goprotoStringerAll"] = false; + object[".gogoproto.verboseEqualAll"] = false; + object[".gogoproto.faceAll"] = false; + object[".gogoproto.gostringAll"] = false; + object[".gogoproto.populateAll"] = false; + object[".gogoproto.stringerAll"] = false; + object[".gogoproto.onlyoneAll"] = false; + object[".gogoproto.equalAll"] = false; + object[".gogoproto.descriptionAll"] = false; + object[".gogoproto.testgenAll"] = false; + object[".gogoproto.benchgenAll"] = false; + object[".gogoproto.marshalerAll"] = false; + object[".gogoproto.unmarshalerAll"] = false; + object[".gogoproto.stableMarshalerAll"] = false; + object[".gogoproto.sizerAll"] = false; + object[".gogoproto.goprotoEnumStringerAll"] = false; + object[".gogoproto.enumStringerAll"] = false; + object[".gogoproto.unsafeMarshalerAll"] = false; + object[".gogoproto.unsafeUnmarshalerAll"] = false; + object[".gogoproto.goprotoExtensionsMapAll"] = false; + object[".gogoproto.goprotoUnrecognizedAll"] = false; + object[".gogoproto.gogoprotoImport"] = false; + object[".gogoproto.protosizerAll"] = false; + object[".gogoproto.compareAll"] = false; + object[".gogoproto.typedeclAll"] = false; + object[".gogoproto.enumdeclAll"] = false; + object[".gogoproto.goprotoRegistration"] = false; + object[".gogoproto.messagenameAll"] = false; + object[".gogoproto.goprotoSizecacheAll"] = false; + object[".gogoproto.goprotoUnkeyedAll"] = false; + } + if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) + object.javaPackage = message.javaPackage; + if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) + object.javaOuterClassname = message.javaOuterClassname; + if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) + object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; + if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) + object.javaMultipleFiles = message.javaMultipleFiles; + if (message.goPackage != null && message.hasOwnProperty("goPackage")) + object.goPackage = message.goPackage; + if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) + object.ccGenericServices = message.ccGenericServices; + if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) + object.javaGenericServices = message.javaGenericServices; + if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) + object.pyGenericServices = message.pyGenericServices; + if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) + object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) + object.javaStringCheckUtf8 = message.javaStringCheckUtf8; + if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) + object.ccEnableArenas = message.ccEnableArenas; + if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) + object.objcClassPrefix = message.objcClassPrefix; + if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) + object.csharpNamespace = message.csharpNamespace; + if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) + object.swiftPrefix = message.swiftPrefix; + if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) + object.phpClassPrefix = message.phpClassPrefix; + if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) + object.phpNamespace = message.phpNamespace; + if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) + object.phpGenericServices = message.phpGenericServices; + if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) + object.phpMetadataNamespace = message.phpMetadataNamespace; + if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) + object.rubyPackage = message.rubyPackage; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".gogoproto.goprotoGettersAll"] != null && message.hasOwnProperty(".gogoproto.goprotoGettersAll")) + object[".gogoproto.goprotoGettersAll"] = message[".gogoproto.goprotoGettersAll"]; + if (message[".gogoproto.goprotoEnumPrefixAll"] != null && message.hasOwnProperty(".gogoproto.goprotoEnumPrefixAll")) + object[".gogoproto.goprotoEnumPrefixAll"] = message[".gogoproto.goprotoEnumPrefixAll"]; + if (message[".gogoproto.goprotoStringerAll"] != null && message.hasOwnProperty(".gogoproto.goprotoStringerAll")) + object[".gogoproto.goprotoStringerAll"] = message[".gogoproto.goprotoStringerAll"]; + if (message[".gogoproto.verboseEqualAll"] != null && message.hasOwnProperty(".gogoproto.verboseEqualAll")) + object[".gogoproto.verboseEqualAll"] = message[".gogoproto.verboseEqualAll"]; + if (message[".gogoproto.faceAll"] != null && message.hasOwnProperty(".gogoproto.faceAll")) + object[".gogoproto.faceAll"] = message[".gogoproto.faceAll"]; + if (message[".gogoproto.gostringAll"] != null && message.hasOwnProperty(".gogoproto.gostringAll")) + object[".gogoproto.gostringAll"] = message[".gogoproto.gostringAll"]; + if (message[".gogoproto.populateAll"] != null && message.hasOwnProperty(".gogoproto.populateAll")) + object[".gogoproto.populateAll"] = message[".gogoproto.populateAll"]; + if (message[".gogoproto.stringerAll"] != null && message.hasOwnProperty(".gogoproto.stringerAll")) + object[".gogoproto.stringerAll"] = message[".gogoproto.stringerAll"]; + if (message[".gogoproto.onlyoneAll"] != null && message.hasOwnProperty(".gogoproto.onlyoneAll")) + object[".gogoproto.onlyoneAll"] = message[".gogoproto.onlyoneAll"]; + if (message[".gogoproto.equalAll"] != null && message.hasOwnProperty(".gogoproto.equalAll")) + object[".gogoproto.equalAll"] = message[".gogoproto.equalAll"]; + if (message[".gogoproto.descriptionAll"] != null && message.hasOwnProperty(".gogoproto.descriptionAll")) + object[".gogoproto.descriptionAll"] = message[".gogoproto.descriptionAll"]; + if (message[".gogoproto.testgenAll"] != null && message.hasOwnProperty(".gogoproto.testgenAll")) + object[".gogoproto.testgenAll"] = message[".gogoproto.testgenAll"]; + if (message[".gogoproto.benchgenAll"] != null && message.hasOwnProperty(".gogoproto.benchgenAll")) + object[".gogoproto.benchgenAll"] = message[".gogoproto.benchgenAll"]; + if (message[".gogoproto.marshalerAll"] != null && message.hasOwnProperty(".gogoproto.marshalerAll")) + object[".gogoproto.marshalerAll"] = message[".gogoproto.marshalerAll"]; + if (message[".gogoproto.unmarshalerAll"] != null && message.hasOwnProperty(".gogoproto.unmarshalerAll")) + object[".gogoproto.unmarshalerAll"] = message[".gogoproto.unmarshalerAll"]; + if (message[".gogoproto.stableMarshalerAll"] != null && message.hasOwnProperty(".gogoproto.stableMarshalerAll")) + object[".gogoproto.stableMarshalerAll"] = message[".gogoproto.stableMarshalerAll"]; + if (message[".gogoproto.sizerAll"] != null && message.hasOwnProperty(".gogoproto.sizerAll")) + object[".gogoproto.sizerAll"] = message[".gogoproto.sizerAll"]; + if (message[".gogoproto.goprotoEnumStringerAll"] != null && message.hasOwnProperty(".gogoproto.goprotoEnumStringerAll")) + object[".gogoproto.goprotoEnumStringerAll"] = message[".gogoproto.goprotoEnumStringerAll"]; + if (message[".gogoproto.enumStringerAll"] != null && message.hasOwnProperty(".gogoproto.enumStringerAll")) + object[".gogoproto.enumStringerAll"] = message[".gogoproto.enumStringerAll"]; + if (message[".gogoproto.unsafeMarshalerAll"] != null && message.hasOwnProperty(".gogoproto.unsafeMarshalerAll")) + object[".gogoproto.unsafeMarshalerAll"] = message[".gogoproto.unsafeMarshalerAll"]; + if (message[".gogoproto.unsafeUnmarshalerAll"] != null && message.hasOwnProperty(".gogoproto.unsafeUnmarshalerAll")) + object[".gogoproto.unsafeUnmarshalerAll"] = message[".gogoproto.unsafeUnmarshalerAll"]; + if (message[".gogoproto.goprotoExtensionsMapAll"] != null && message.hasOwnProperty(".gogoproto.goprotoExtensionsMapAll")) + object[".gogoproto.goprotoExtensionsMapAll"] = message[".gogoproto.goprotoExtensionsMapAll"]; + if (message[".gogoproto.goprotoUnrecognizedAll"] != null && message.hasOwnProperty(".gogoproto.goprotoUnrecognizedAll")) + object[".gogoproto.goprotoUnrecognizedAll"] = message[".gogoproto.goprotoUnrecognizedAll"]; + if (message[".gogoproto.gogoprotoImport"] != null && message.hasOwnProperty(".gogoproto.gogoprotoImport")) + object[".gogoproto.gogoprotoImport"] = message[".gogoproto.gogoprotoImport"]; + if (message[".gogoproto.protosizerAll"] != null && message.hasOwnProperty(".gogoproto.protosizerAll")) + object[".gogoproto.protosizerAll"] = message[".gogoproto.protosizerAll"]; + if (message[".gogoproto.compareAll"] != null && message.hasOwnProperty(".gogoproto.compareAll")) + object[".gogoproto.compareAll"] = message[".gogoproto.compareAll"]; + if (message[".gogoproto.typedeclAll"] != null && message.hasOwnProperty(".gogoproto.typedeclAll")) + object[".gogoproto.typedeclAll"] = message[".gogoproto.typedeclAll"]; + if (message[".gogoproto.enumdeclAll"] != null && message.hasOwnProperty(".gogoproto.enumdeclAll")) + object[".gogoproto.enumdeclAll"] = message[".gogoproto.enumdeclAll"]; + if (message[".gogoproto.goprotoRegistration"] != null && message.hasOwnProperty(".gogoproto.goprotoRegistration")) + object[".gogoproto.goprotoRegistration"] = message[".gogoproto.goprotoRegistration"]; + if (message[".gogoproto.messagenameAll"] != null && message.hasOwnProperty(".gogoproto.messagenameAll")) + object[".gogoproto.messagenameAll"] = message[".gogoproto.messagenameAll"]; + if (message[".gogoproto.goprotoSizecacheAll"] != null && message.hasOwnProperty(".gogoproto.goprotoSizecacheAll")) + object[".gogoproto.goprotoSizecacheAll"] = message[".gogoproto.goprotoSizecacheAll"]; + if (message[".gogoproto.goprotoUnkeyedAll"] != null && message.hasOwnProperty(".gogoproto.goprotoUnkeyedAll")) + object[".gogoproto.goprotoUnkeyedAll"] = message[".gogoproto.goprotoUnkeyedAll"]; + return object; + }; + + /** + * Converts this FileOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FileOptions + * @instance + * @returns {Object.} JSON object + */ + FileOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * OptimizeMode enum. + * @name google.protobuf.FileOptions.OptimizeMode + * @enum {number} + * @property {number} SPEED=1 SPEED value + * @property {number} CODE_SIZE=2 CODE_SIZE value + * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value + */ + FileOptions.OptimizeMode = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[1] = "SPEED"] = 1; + values[valuesById[2] = "CODE_SIZE"] = 2; + values[valuesById[3] = "LITE_RUNTIME"] = 3; + return values; + })(); + + return FileOptions; + })(); + + protobuf.MessageOptions = (function() { + + /** + * Properties of a MessageOptions. + * @memberof google.protobuf + * @interface IMessageOptions + * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat + * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor + * @property {boolean|null} [deprecated] MessageOptions deprecated + * @property {boolean|null} [mapEntry] MessageOptions mapEntry + * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption + * @property {boolean|null} [".gogoproto.goprotoGetters"] MessageOptions .gogoproto.goprotoGetters + * @property {boolean|null} [".gogoproto.goprotoStringer"] MessageOptions .gogoproto.goprotoStringer + * @property {boolean|null} [".gogoproto.verboseEqual"] MessageOptions .gogoproto.verboseEqual + * @property {boolean|null} [".gogoproto.face"] MessageOptions .gogoproto.face + * @property {boolean|null} [".gogoproto.gostring"] MessageOptions .gogoproto.gostring + * @property {boolean|null} [".gogoproto.populate"] MessageOptions .gogoproto.populate + * @property {boolean|null} [".gogoproto.stringer"] MessageOptions .gogoproto.stringer + * @property {boolean|null} [".gogoproto.onlyone"] MessageOptions .gogoproto.onlyone + * @property {boolean|null} [".gogoproto.equal"] MessageOptions .gogoproto.equal + * @property {boolean|null} [".gogoproto.description"] MessageOptions .gogoproto.description + * @property {boolean|null} [".gogoproto.testgen"] MessageOptions .gogoproto.testgen + * @property {boolean|null} [".gogoproto.benchgen"] MessageOptions .gogoproto.benchgen + * @property {boolean|null} [".gogoproto.marshaler"] MessageOptions .gogoproto.marshaler + * @property {boolean|null} [".gogoproto.unmarshaler"] MessageOptions .gogoproto.unmarshaler + * @property {boolean|null} [".gogoproto.stableMarshaler"] MessageOptions .gogoproto.stableMarshaler + * @property {boolean|null} [".gogoproto.sizer"] MessageOptions .gogoproto.sizer + * @property {boolean|null} [".gogoproto.unsafeMarshaler"] MessageOptions .gogoproto.unsafeMarshaler + * @property {boolean|null} [".gogoproto.unsafeUnmarshaler"] MessageOptions .gogoproto.unsafeUnmarshaler + * @property {boolean|null} [".gogoproto.goprotoExtensionsMap"] MessageOptions .gogoproto.goprotoExtensionsMap + * @property {boolean|null} [".gogoproto.goprotoUnrecognized"] MessageOptions .gogoproto.goprotoUnrecognized + * @property {boolean|null} [".gogoproto.protosizer"] MessageOptions .gogoproto.protosizer + * @property {boolean|null} [".gogoproto.compare"] MessageOptions .gogoproto.compare + * @property {boolean|null} [".gogoproto.typedecl"] MessageOptions .gogoproto.typedecl + * @property {boolean|null} [".gogoproto.messagename"] MessageOptions .gogoproto.messagename + * @property {boolean|null} [".gogoproto.goprotoSizecache"] MessageOptions .gogoproto.goprotoSizecache + * @property {boolean|null} [".gogoproto.goprotoUnkeyed"] MessageOptions .gogoproto.goprotoUnkeyed + */ + + /** + * Constructs a new MessageOptions. + * @memberof google.protobuf + * @classdesc Represents a MessageOptions. + * @implements IMessageOptions + * @constructor + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + */ + function MessageOptions(properties) { + this.uninterpretedOption = []; + 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]]; + } + + /** + * MessageOptions messageSetWireFormat. + * @member {boolean} messageSetWireFormat + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.messageSetWireFormat = false; + + /** + * MessageOptions noStandardDescriptorAccessor. + * @member {boolean} noStandardDescriptorAccessor + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.noStandardDescriptorAccessor = false; + + /** + * MessageOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.deprecated = false; + + /** + * MessageOptions mapEntry. + * @member {boolean} mapEntry + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.mapEntry = false; + + /** + * MessageOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * MessageOptions .gogoproto.goprotoGetters. + * @member {boolean} .gogoproto.goprotoGetters + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".gogoproto.goprotoGetters"] = false; + + /** + * MessageOptions .gogoproto.goprotoStringer. + * @member {boolean} .gogoproto.goprotoStringer + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".gogoproto.goprotoStringer"] = false; + + /** + * MessageOptions .gogoproto.verboseEqual. + * @member {boolean} .gogoproto.verboseEqual + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".gogoproto.verboseEqual"] = false; + + /** + * MessageOptions .gogoproto.face. + * @member {boolean} .gogoproto.face + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".gogoproto.face"] = false; + + /** + * MessageOptions .gogoproto.gostring. + * @member {boolean} .gogoproto.gostring + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".gogoproto.gostring"] = false; + + /** + * MessageOptions .gogoproto.populate. + * @member {boolean} .gogoproto.populate + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".gogoproto.populate"] = false; + + /** + * MessageOptions .gogoproto.stringer. + * @member {boolean} .gogoproto.stringer + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".gogoproto.stringer"] = false; + + /** + * MessageOptions .gogoproto.onlyone. + * @member {boolean} .gogoproto.onlyone + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".gogoproto.onlyone"] = false; + + /** + * MessageOptions .gogoproto.equal. + * @member {boolean} .gogoproto.equal + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".gogoproto.equal"] = false; + + /** + * MessageOptions .gogoproto.description. + * @member {boolean} .gogoproto.description + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".gogoproto.description"] = false; + + /** + * MessageOptions .gogoproto.testgen. + * @member {boolean} .gogoproto.testgen + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".gogoproto.testgen"] = false; + + /** + * MessageOptions .gogoproto.benchgen. + * @member {boolean} .gogoproto.benchgen + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".gogoproto.benchgen"] = false; + + /** + * MessageOptions .gogoproto.marshaler. + * @member {boolean} .gogoproto.marshaler + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".gogoproto.marshaler"] = false; + + /** + * MessageOptions .gogoproto.unmarshaler. + * @member {boolean} .gogoproto.unmarshaler + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".gogoproto.unmarshaler"] = false; + + /** + * MessageOptions .gogoproto.stableMarshaler. + * @member {boolean} .gogoproto.stableMarshaler + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".gogoproto.stableMarshaler"] = false; + + /** + * MessageOptions .gogoproto.sizer. + * @member {boolean} .gogoproto.sizer + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".gogoproto.sizer"] = false; + + /** + * MessageOptions .gogoproto.unsafeMarshaler. + * @member {boolean} .gogoproto.unsafeMarshaler + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".gogoproto.unsafeMarshaler"] = false; + + /** + * MessageOptions .gogoproto.unsafeUnmarshaler. + * @member {boolean} .gogoproto.unsafeUnmarshaler + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".gogoproto.unsafeUnmarshaler"] = false; + + /** + * MessageOptions .gogoproto.goprotoExtensionsMap. + * @member {boolean} .gogoproto.goprotoExtensionsMap + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".gogoproto.goprotoExtensionsMap"] = false; + + /** + * MessageOptions .gogoproto.goprotoUnrecognized. + * @member {boolean} .gogoproto.goprotoUnrecognized + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".gogoproto.goprotoUnrecognized"] = false; + + /** + * MessageOptions .gogoproto.protosizer. + * @member {boolean} .gogoproto.protosizer + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".gogoproto.protosizer"] = false; + + /** + * MessageOptions .gogoproto.compare. + * @member {boolean} .gogoproto.compare + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".gogoproto.compare"] = false; + + /** + * MessageOptions .gogoproto.typedecl. + * @member {boolean} .gogoproto.typedecl + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".gogoproto.typedecl"] = false; + + /** + * MessageOptions .gogoproto.messagename. + * @member {boolean} .gogoproto.messagename + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".gogoproto.messagename"] = false; + + /** + * MessageOptions .gogoproto.goprotoSizecache. + * @member {boolean} .gogoproto.goprotoSizecache + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".gogoproto.goprotoSizecache"] = false; + + /** + * MessageOptions .gogoproto.goprotoUnkeyed. + * @member {boolean} .gogoproto.goprotoUnkeyed + * @memberof google.protobuf.MessageOptions + * @instance + */ + MessageOptions.prototype[".gogoproto.goprotoUnkeyed"] = false; + + /** + * Creates a new MessageOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions=} [properties] Properties to set + * @returns {google.protobuf.MessageOptions} MessageOptions instance + */ + MessageOptions.create = function create(properties) { + return new MessageOptions(properties); + }; + + /** + * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); + if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) + writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".gogoproto.goprotoGetters"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goprotoGetters")) + writer.uint32(/* id 64001, wireType 0 =*/512008).bool(message[".gogoproto.goprotoGetters"]); + if (message[".gogoproto.goprotoStringer"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goprotoStringer")) + writer.uint32(/* id 64003, wireType 0 =*/512024).bool(message[".gogoproto.goprotoStringer"]); + if (message[".gogoproto.verboseEqual"] != null && Object.hasOwnProperty.call(message, ".gogoproto.verboseEqual")) + writer.uint32(/* id 64004, wireType 0 =*/512032).bool(message[".gogoproto.verboseEqual"]); + if (message[".gogoproto.face"] != null && Object.hasOwnProperty.call(message, ".gogoproto.face")) + writer.uint32(/* id 64005, wireType 0 =*/512040).bool(message[".gogoproto.face"]); + if (message[".gogoproto.gostring"] != null && Object.hasOwnProperty.call(message, ".gogoproto.gostring")) + writer.uint32(/* id 64006, wireType 0 =*/512048).bool(message[".gogoproto.gostring"]); + if (message[".gogoproto.populate"] != null && Object.hasOwnProperty.call(message, ".gogoproto.populate")) + writer.uint32(/* id 64007, wireType 0 =*/512056).bool(message[".gogoproto.populate"]); + if (message[".gogoproto.onlyone"] != null && Object.hasOwnProperty.call(message, ".gogoproto.onlyone")) + writer.uint32(/* id 64009, wireType 0 =*/512072).bool(message[".gogoproto.onlyone"]); + if (message[".gogoproto.equal"] != null && Object.hasOwnProperty.call(message, ".gogoproto.equal")) + writer.uint32(/* id 64013, wireType 0 =*/512104).bool(message[".gogoproto.equal"]); + if (message[".gogoproto.description"] != null && Object.hasOwnProperty.call(message, ".gogoproto.description")) + writer.uint32(/* id 64014, wireType 0 =*/512112).bool(message[".gogoproto.description"]); + if (message[".gogoproto.testgen"] != null && Object.hasOwnProperty.call(message, ".gogoproto.testgen")) + writer.uint32(/* id 64015, wireType 0 =*/512120).bool(message[".gogoproto.testgen"]); + if (message[".gogoproto.benchgen"] != null && Object.hasOwnProperty.call(message, ".gogoproto.benchgen")) + writer.uint32(/* id 64016, wireType 0 =*/512128).bool(message[".gogoproto.benchgen"]); + if (message[".gogoproto.marshaler"] != null && Object.hasOwnProperty.call(message, ".gogoproto.marshaler")) + writer.uint32(/* id 64017, wireType 0 =*/512136).bool(message[".gogoproto.marshaler"]); + if (message[".gogoproto.unmarshaler"] != null && Object.hasOwnProperty.call(message, ".gogoproto.unmarshaler")) + writer.uint32(/* id 64018, wireType 0 =*/512144).bool(message[".gogoproto.unmarshaler"]); + if (message[".gogoproto.stableMarshaler"] != null && Object.hasOwnProperty.call(message, ".gogoproto.stableMarshaler")) + writer.uint32(/* id 64019, wireType 0 =*/512152).bool(message[".gogoproto.stableMarshaler"]); + if (message[".gogoproto.sizer"] != null && Object.hasOwnProperty.call(message, ".gogoproto.sizer")) + writer.uint32(/* id 64020, wireType 0 =*/512160).bool(message[".gogoproto.sizer"]); + if (message[".gogoproto.unsafeMarshaler"] != null && Object.hasOwnProperty.call(message, ".gogoproto.unsafeMarshaler")) + writer.uint32(/* id 64023, wireType 0 =*/512184).bool(message[".gogoproto.unsafeMarshaler"]); + if (message[".gogoproto.unsafeUnmarshaler"] != null && Object.hasOwnProperty.call(message, ".gogoproto.unsafeUnmarshaler")) + writer.uint32(/* id 64024, wireType 0 =*/512192).bool(message[".gogoproto.unsafeUnmarshaler"]); + if (message[".gogoproto.goprotoExtensionsMap"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goprotoExtensionsMap")) + writer.uint32(/* id 64025, wireType 0 =*/512200).bool(message[".gogoproto.goprotoExtensionsMap"]); + if (message[".gogoproto.goprotoUnrecognized"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goprotoUnrecognized")) + writer.uint32(/* id 64026, wireType 0 =*/512208).bool(message[".gogoproto.goprotoUnrecognized"]); + if (message[".gogoproto.protosizer"] != null && Object.hasOwnProperty.call(message, ".gogoproto.protosizer")) + writer.uint32(/* id 64028, wireType 0 =*/512224).bool(message[".gogoproto.protosizer"]); + if (message[".gogoproto.compare"] != null && Object.hasOwnProperty.call(message, ".gogoproto.compare")) + writer.uint32(/* id 64029, wireType 0 =*/512232).bool(message[".gogoproto.compare"]); + if (message[".gogoproto.typedecl"] != null && Object.hasOwnProperty.call(message, ".gogoproto.typedecl")) + writer.uint32(/* id 64030, wireType 0 =*/512240).bool(message[".gogoproto.typedecl"]); + if (message[".gogoproto.messagename"] != null && Object.hasOwnProperty.call(message, ".gogoproto.messagename")) + writer.uint32(/* id 64033, wireType 0 =*/512264).bool(message[".gogoproto.messagename"]); + if (message[".gogoproto.goprotoSizecache"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goprotoSizecache")) + writer.uint32(/* id 64034, wireType 0 =*/512272).bool(message[".gogoproto.goprotoSizecache"]); + if (message[".gogoproto.goprotoUnkeyed"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goprotoUnkeyed")) + writer.uint32(/* id 64035, wireType 0 =*/512280).bool(message[".gogoproto.goprotoUnkeyed"]); + if (message[".gogoproto.stringer"] != null && Object.hasOwnProperty.call(message, ".gogoproto.stringer")) + writer.uint32(/* id 67008, wireType 0 =*/536064).bool(message[".gogoproto.stringer"]); + return writer; + }; + + /** + * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.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.google.protobuf.MessageOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.messageSetWireFormat = reader.bool(); + break; + case 2: + message.noStandardDescriptorAccessor = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 7: + message.mapEntry = reader.bool(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + case 64001: + message[".gogoproto.goprotoGetters"] = reader.bool(); + break; + case 64003: + message[".gogoproto.goprotoStringer"] = reader.bool(); + break; + case 64004: + message[".gogoproto.verboseEqual"] = reader.bool(); + break; + case 64005: + message[".gogoproto.face"] = reader.bool(); + break; + case 64006: + message[".gogoproto.gostring"] = reader.bool(); + break; + case 64007: + message[".gogoproto.populate"] = reader.bool(); + break; + case 67008: + message[".gogoproto.stringer"] = reader.bool(); + break; + case 64009: + message[".gogoproto.onlyone"] = reader.bool(); + break; + case 64013: + message[".gogoproto.equal"] = reader.bool(); + break; + case 64014: + message[".gogoproto.description"] = reader.bool(); + break; + case 64015: + message[".gogoproto.testgen"] = reader.bool(); + break; + case 64016: + message[".gogoproto.benchgen"] = reader.bool(); + break; + case 64017: + message[".gogoproto.marshaler"] = reader.bool(); + break; + case 64018: + message[".gogoproto.unmarshaler"] = reader.bool(); + break; + case 64019: + message[".gogoproto.stableMarshaler"] = reader.bool(); + break; + case 64020: + message[".gogoproto.sizer"] = reader.bool(); + break; + case 64023: + message[".gogoproto.unsafeMarshaler"] = reader.bool(); + break; + case 64024: + message[".gogoproto.unsafeUnmarshaler"] = reader.bool(); + break; + case 64025: + message[".gogoproto.goprotoExtensionsMap"] = reader.bool(); + break; + case 64026: + message[".gogoproto.goprotoUnrecognized"] = reader.bool(); + break; + case 64028: + message[".gogoproto.protosizer"] = reader.bool(); + break; + case 64029: + message[".gogoproto.compare"] = reader.bool(); + break; + case 64030: + message[".gogoproto.typedecl"] = reader.bool(); + break; + case 64033: + message[".gogoproto.messagename"] = reader.bool(); + break; + case 64034: + message[".gogoproto.goprotoSizecache"] = reader.bool(); + break; + case 64035: + message[".gogoproto.goprotoUnkeyed"] = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MessageOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MessageOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MessageOptions} MessageOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MessageOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MessageOptions message. + * @function verify + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MessageOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + if (typeof message.messageSetWireFormat !== "boolean") + return "messageSetWireFormat: boolean expected"; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + if (typeof message.noStandardDescriptorAccessor !== "boolean") + return "noStandardDescriptorAccessor: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + if (typeof message.mapEntry !== "boolean") + return "mapEntry: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".gogoproto.goprotoGetters"] != null && message.hasOwnProperty(".gogoproto.goprotoGetters")) + if (typeof message[".gogoproto.goprotoGetters"] !== "boolean") + return ".gogoproto.goprotoGetters: boolean expected"; + if (message[".gogoproto.goprotoStringer"] != null && message.hasOwnProperty(".gogoproto.goprotoStringer")) + if (typeof message[".gogoproto.goprotoStringer"] !== "boolean") + return ".gogoproto.goprotoStringer: boolean expected"; + if (message[".gogoproto.verboseEqual"] != null && message.hasOwnProperty(".gogoproto.verboseEqual")) + if (typeof message[".gogoproto.verboseEqual"] !== "boolean") + return ".gogoproto.verboseEqual: boolean expected"; + if (message[".gogoproto.face"] != null && message.hasOwnProperty(".gogoproto.face")) + if (typeof message[".gogoproto.face"] !== "boolean") + return ".gogoproto.face: boolean expected"; + if (message[".gogoproto.gostring"] != null && message.hasOwnProperty(".gogoproto.gostring")) + if (typeof message[".gogoproto.gostring"] !== "boolean") + return ".gogoproto.gostring: boolean expected"; + if (message[".gogoproto.populate"] != null && message.hasOwnProperty(".gogoproto.populate")) + if (typeof message[".gogoproto.populate"] !== "boolean") + return ".gogoproto.populate: boolean expected"; + if (message[".gogoproto.stringer"] != null && message.hasOwnProperty(".gogoproto.stringer")) + if (typeof message[".gogoproto.stringer"] !== "boolean") + return ".gogoproto.stringer: boolean expected"; + if (message[".gogoproto.onlyone"] != null && message.hasOwnProperty(".gogoproto.onlyone")) + if (typeof message[".gogoproto.onlyone"] !== "boolean") + return ".gogoproto.onlyone: boolean expected"; + if (message[".gogoproto.equal"] != null && message.hasOwnProperty(".gogoproto.equal")) + if (typeof message[".gogoproto.equal"] !== "boolean") + return ".gogoproto.equal: boolean expected"; + if (message[".gogoproto.description"] != null && message.hasOwnProperty(".gogoproto.description")) + if (typeof message[".gogoproto.description"] !== "boolean") + return ".gogoproto.description: boolean expected"; + if (message[".gogoproto.testgen"] != null && message.hasOwnProperty(".gogoproto.testgen")) + if (typeof message[".gogoproto.testgen"] !== "boolean") + return ".gogoproto.testgen: boolean expected"; + if (message[".gogoproto.benchgen"] != null && message.hasOwnProperty(".gogoproto.benchgen")) + if (typeof message[".gogoproto.benchgen"] !== "boolean") + return ".gogoproto.benchgen: boolean expected"; + if (message[".gogoproto.marshaler"] != null && message.hasOwnProperty(".gogoproto.marshaler")) + if (typeof message[".gogoproto.marshaler"] !== "boolean") + return ".gogoproto.marshaler: boolean expected"; + if (message[".gogoproto.unmarshaler"] != null && message.hasOwnProperty(".gogoproto.unmarshaler")) + if (typeof message[".gogoproto.unmarshaler"] !== "boolean") + return ".gogoproto.unmarshaler: boolean expected"; + if (message[".gogoproto.stableMarshaler"] != null && message.hasOwnProperty(".gogoproto.stableMarshaler")) + if (typeof message[".gogoproto.stableMarshaler"] !== "boolean") + return ".gogoproto.stableMarshaler: boolean expected"; + if (message[".gogoproto.sizer"] != null && message.hasOwnProperty(".gogoproto.sizer")) + if (typeof message[".gogoproto.sizer"] !== "boolean") + return ".gogoproto.sizer: boolean expected"; + if (message[".gogoproto.unsafeMarshaler"] != null && message.hasOwnProperty(".gogoproto.unsafeMarshaler")) + if (typeof message[".gogoproto.unsafeMarshaler"] !== "boolean") + return ".gogoproto.unsafeMarshaler: boolean expected"; + if (message[".gogoproto.unsafeUnmarshaler"] != null && message.hasOwnProperty(".gogoproto.unsafeUnmarshaler")) + if (typeof message[".gogoproto.unsafeUnmarshaler"] !== "boolean") + return ".gogoproto.unsafeUnmarshaler: boolean expected"; + if (message[".gogoproto.goprotoExtensionsMap"] != null && message.hasOwnProperty(".gogoproto.goprotoExtensionsMap")) + if (typeof message[".gogoproto.goprotoExtensionsMap"] !== "boolean") + return ".gogoproto.goprotoExtensionsMap: boolean expected"; + if (message[".gogoproto.goprotoUnrecognized"] != null && message.hasOwnProperty(".gogoproto.goprotoUnrecognized")) + if (typeof message[".gogoproto.goprotoUnrecognized"] !== "boolean") + return ".gogoproto.goprotoUnrecognized: boolean expected"; + if (message[".gogoproto.protosizer"] != null && message.hasOwnProperty(".gogoproto.protosizer")) + if (typeof message[".gogoproto.protosizer"] !== "boolean") + return ".gogoproto.protosizer: boolean expected"; + if (message[".gogoproto.compare"] != null && message.hasOwnProperty(".gogoproto.compare")) + if (typeof message[".gogoproto.compare"] !== "boolean") + return ".gogoproto.compare: boolean expected"; + if (message[".gogoproto.typedecl"] != null && message.hasOwnProperty(".gogoproto.typedecl")) + if (typeof message[".gogoproto.typedecl"] !== "boolean") + return ".gogoproto.typedecl: boolean expected"; + if (message[".gogoproto.messagename"] != null && message.hasOwnProperty(".gogoproto.messagename")) + if (typeof message[".gogoproto.messagename"] !== "boolean") + return ".gogoproto.messagename: boolean expected"; + if (message[".gogoproto.goprotoSizecache"] != null && message.hasOwnProperty(".gogoproto.goprotoSizecache")) + if (typeof message[".gogoproto.goprotoSizecache"] !== "boolean") + return ".gogoproto.goprotoSizecache: boolean expected"; + if (message[".gogoproto.goprotoUnkeyed"] != null && message.hasOwnProperty(".gogoproto.goprotoUnkeyed")) + if (typeof message[".gogoproto.goprotoUnkeyed"] !== "boolean") + return ".gogoproto.goprotoUnkeyed: boolean expected"; + return null; + }; + + /** + * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MessageOptions} MessageOptions + */ + MessageOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MessageOptions) + return object; + var message = new $root.google.protobuf.MessageOptions(); + if (object.messageSetWireFormat != null) + message.messageSetWireFormat = Boolean(object.messageSetWireFormat); + if (object.noStandardDescriptorAccessor != null) + message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.mapEntry != null) + message.mapEntry = Boolean(object.mapEntry); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".gogoproto.goprotoGetters"] != null) + message[".gogoproto.goprotoGetters"] = Boolean(object[".gogoproto.goprotoGetters"]); + if (object[".gogoproto.goprotoStringer"] != null) + message[".gogoproto.goprotoStringer"] = Boolean(object[".gogoproto.goprotoStringer"]); + if (object[".gogoproto.verboseEqual"] != null) + message[".gogoproto.verboseEqual"] = Boolean(object[".gogoproto.verboseEqual"]); + if (object[".gogoproto.face"] != null) + message[".gogoproto.face"] = Boolean(object[".gogoproto.face"]); + if (object[".gogoproto.gostring"] != null) + message[".gogoproto.gostring"] = Boolean(object[".gogoproto.gostring"]); + if (object[".gogoproto.populate"] != null) + message[".gogoproto.populate"] = Boolean(object[".gogoproto.populate"]); + if (object[".gogoproto.stringer"] != null) + message[".gogoproto.stringer"] = Boolean(object[".gogoproto.stringer"]); + if (object[".gogoproto.onlyone"] != null) + message[".gogoproto.onlyone"] = Boolean(object[".gogoproto.onlyone"]); + if (object[".gogoproto.equal"] != null) + message[".gogoproto.equal"] = Boolean(object[".gogoproto.equal"]); + if (object[".gogoproto.description"] != null) + message[".gogoproto.description"] = Boolean(object[".gogoproto.description"]); + if (object[".gogoproto.testgen"] != null) + message[".gogoproto.testgen"] = Boolean(object[".gogoproto.testgen"]); + if (object[".gogoproto.benchgen"] != null) + message[".gogoproto.benchgen"] = Boolean(object[".gogoproto.benchgen"]); + if (object[".gogoproto.marshaler"] != null) + message[".gogoproto.marshaler"] = Boolean(object[".gogoproto.marshaler"]); + if (object[".gogoproto.unmarshaler"] != null) + message[".gogoproto.unmarshaler"] = Boolean(object[".gogoproto.unmarshaler"]); + if (object[".gogoproto.stableMarshaler"] != null) + message[".gogoproto.stableMarshaler"] = Boolean(object[".gogoproto.stableMarshaler"]); + if (object[".gogoproto.sizer"] != null) + message[".gogoproto.sizer"] = Boolean(object[".gogoproto.sizer"]); + if (object[".gogoproto.unsafeMarshaler"] != null) + message[".gogoproto.unsafeMarshaler"] = Boolean(object[".gogoproto.unsafeMarshaler"]); + if (object[".gogoproto.unsafeUnmarshaler"] != null) + message[".gogoproto.unsafeUnmarshaler"] = Boolean(object[".gogoproto.unsafeUnmarshaler"]); + if (object[".gogoproto.goprotoExtensionsMap"] != null) + message[".gogoproto.goprotoExtensionsMap"] = Boolean(object[".gogoproto.goprotoExtensionsMap"]); + if (object[".gogoproto.goprotoUnrecognized"] != null) + message[".gogoproto.goprotoUnrecognized"] = Boolean(object[".gogoproto.goprotoUnrecognized"]); + if (object[".gogoproto.protosizer"] != null) + message[".gogoproto.protosizer"] = Boolean(object[".gogoproto.protosizer"]); + if (object[".gogoproto.compare"] != null) + message[".gogoproto.compare"] = Boolean(object[".gogoproto.compare"]); + if (object[".gogoproto.typedecl"] != null) + message[".gogoproto.typedecl"] = Boolean(object[".gogoproto.typedecl"]); + if (object[".gogoproto.messagename"] != null) + message[".gogoproto.messagename"] = Boolean(object[".gogoproto.messagename"]); + if (object[".gogoproto.goprotoSizecache"] != null) + message[".gogoproto.goprotoSizecache"] = Boolean(object[".gogoproto.goprotoSizecache"]); + if (object[".gogoproto.goprotoUnkeyed"] != null) + message[".gogoproto.goprotoUnkeyed"] = Boolean(object[".gogoproto.goprotoUnkeyed"]); + return message; + }; + + /** + * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MessageOptions + * @static + * @param {google.protobuf.MessageOptions} message MessageOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MessageOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.messageSetWireFormat = false; + object.noStandardDescriptorAccessor = false; + object.deprecated = false; + object.mapEntry = false; + object[".gogoproto.goprotoGetters"] = false; + object[".gogoproto.goprotoStringer"] = false; + object[".gogoproto.verboseEqual"] = false; + object[".gogoproto.face"] = false; + object[".gogoproto.gostring"] = false; + object[".gogoproto.populate"] = false; + object[".gogoproto.onlyone"] = false; + object[".gogoproto.equal"] = false; + object[".gogoproto.description"] = false; + object[".gogoproto.testgen"] = false; + object[".gogoproto.benchgen"] = false; + object[".gogoproto.marshaler"] = false; + object[".gogoproto.unmarshaler"] = false; + object[".gogoproto.stableMarshaler"] = false; + object[".gogoproto.sizer"] = false; + object[".gogoproto.unsafeMarshaler"] = false; + object[".gogoproto.unsafeUnmarshaler"] = false; + object[".gogoproto.goprotoExtensionsMap"] = false; + object[".gogoproto.goprotoUnrecognized"] = false; + object[".gogoproto.protosizer"] = false; + object[".gogoproto.compare"] = false; + object[".gogoproto.typedecl"] = false; + object[".gogoproto.messagename"] = false; + object[".gogoproto.goprotoSizecache"] = false; + object[".gogoproto.goprotoUnkeyed"] = false; + object[".gogoproto.stringer"] = false; + } + if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) + object.messageSetWireFormat = message.messageSetWireFormat; + if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) + object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) + object.mapEntry = message.mapEntry; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".gogoproto.goprotoGetters"] != null && message.hasOwnProperty(".gogoproto.goprotoGetters")) + object[".gogoproto.goprotoGetters"] = message[".gogoproto.goprotoGetters"]; + if (message[".gogoproto.goprotoStringer"] != null && message.hasOwnProperty(".gogoproto.goprotoStringer")) + object[".gogoproto.goprotoStringer"] = message[".gogoproto.goprotoStringer"]; + if (message[".gogoproto.verboseEqual"] != null && message.hasOwnProperty(".gogoproto.verboseEqual")) + object[".gogoproto.verboseEqual"] = message[".gogoproto.verboseEqual"]; + if (message[".gogoproto.face"] != null && message.hasOwnProperty(".gogoproto.face")) + object[".gogoproto.face"] = message[".gogoproto.face"]; + if (message[".gogoproto.gostring"] != null && message.hasOwnProperty(".gogoproto.gostring")) + object[".gogoproto.gostring"] = message[".gogoproto.gostring"]; + if (message[".gogoproto.populate"] != null && message.hasOwnProperty(".gogoproto.populate")) + object[".gogoproto.populate"] = message[".gogoproto.populate"]; + if (message[".gogoproto.onlyone"] != null && message.hasOwnProperty(".gogoproto.onlyone")) + object[".gogoproto.onlyone"] = message[".gogoproto.onlyone"]; + if (message[".gogoproto.equal"] != null && message.hasOwnProperty(".gogoproto.equal")) + object[".gogoproto.equal"] = message[".gogoproto.equal"]; + if (message[".gogoproto.description"] != null && message.hasOwnProperty(".gogoproto.description")) + object[".gogoproto.description"] = message[".gogoproto.description"]; + if (message[".gogoproto.testgen"] != null && message.hasOwnProperty(".gogoproto.testgen")) + object[".gogoproto.testgen"] = message[".gogoproto.testgen"]; + if (message[".gogoproto.benchgen"] != null && message.hasOwnProperty(".gogoproto.benchgen")) + object[".gogoproto.benchgen"] = message[".gogoproto.benchgen"]; + if (message[".gogoproto.marshaler"] != null && message.hasOwnProperty(".gogoproto.marshaler")) + object[".gogoproto.marshaler"] = message[".gogoproto.marshaler"]; + if (message[".gogoproto.unmarshaler"] != null && message.hasOwnProperty(".gogoproto.unmarshaler")) + object[".gogoproto.unmarshaler"] = message[".gogoproto.unmarshaler"]; + if (message[".gogoproto.stableMarshaler"] != null && message.hasOwnProperty(".gogoproto.stableMarshaler")) + object[".gogoproto.stableMarshaler"] = message[".gogoproto.stableMarshaler"]; + if (message[".gogoproto.sizer"] != null && message.hasOwnProperty(".gogoproto.sizer")) + object[".gogoproto.sizer"] = message[".gogoproto.sizer"]; + if (message[".gogoproto.unsafeMarshaler"] != null && message.hasOwnProperty(".gogoproto.unsafeMarshaler")) + object[".gogoproto.unsafeMarshaler"] = message[".gogoproto.unsafeMarshaler"]; + if (message[".gogoproto.unsafeUnmarshaler"] != null && message.hasOwnProperty(".gogoproto.unsafeUnmarshaler")) + object[".gogoproto.unsafeUnmarshaler"] = message[".gogoproto.unsafeUnmarshaler"]; + if (message[".gogoproto.goprotoExtensionsMap"] != null && message.hasOwnProperty(".gogoproto.goprotoExtensionsMap")) + object[".gogoproto.goprotoExtensionsMap"] = message[".gogoproto.goprotoExtensionsMap"]; + if (message[".gogoproto.goprotoUnrecognized"] != null && message.hasOwnProperty(".gogoproto.goprotoUnrecognized")) + object[".gogoproto.goprotoUnrecognized"] = message[".gogoproto.goprotoUnrecognized"]; + if (message[".gogoproto.protosizer"] != null && message.hasOwnProperty(".gogoproto.protosizer")) + object[".gogoproto.protosizer"] = message[".gogoproto.protosizer"]; + if (message[".gogoproto.compare"] != null && message.hasOwnProperty(".gogoproto.compare")) + object[".gogoproto.compare"] = message[".gogoproto.compare"]; + if (message[".gogoproto.typedecl"] != null && message.hasOwnProperty(".gogoproto.typedecl")) + object[".gogoproto.typedecl"] = message[".gogoproto.typedecl"]; + if (message[".gogoproto.messagename"] != null && message.hasOwnProperty(".gogoproto.messagename")) + object[".gogoproto.messagename"] = message[".gogoproto.messagename"]; + if (message[".gogoproto.goprotoSizecache"] != null && message.hasOwnProperty(".gogoproto.goprotoSizecache")) + object[".gogoproto.goprotoSizecache"] = message[".gogoproto.goprotoSizecache"]; + if (message[".gogoproto.goprotoUnkeyed"] != null && message.hasOwnProperty(".gogoproto.goprotoUnkeyed")) + object[".gogoproto.goprotoUnkeyed"] = message[".gogoproto.goprotoUnkeyed"]; + if (message[".gogoproto.stringer"] != null && message.hasOwnProperty(".gogoproto.stringer")) + object[".gogoproto.stringer"] = message[".gogoproto.stringer"]; + return object; + }; + + /** + * Converts this MessageOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MessageOptions + * @instance + * @returns {Object.} JSON object + */ + MessageOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return MessageOptions; + })(); + + protobuf.FieldOptions = (function() { + + /** + * Properties of a FieldOptions. + * @memberof google.protobuf + * @interface IFieldOptions + * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype + * @property {boolean|null} [packed] FieldOptions packed + * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype + * @property {boolean|null} [lazy] FieldOptions lazy + * @property {boolean|null} [deprecated] FieldOptions deprecated + * @property {boolean|null} [weak] FieldOptions weak + * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption + * @property {boolean|null} [".gogoproto.nullable"] FieldOptions .gogoproto.nullable + * @property {boolean|null} [".gogoproto.embed"] FieldOptions .gogoproto.embed + * @property {string|null} [".gogoproto.customtype"] FieldOptions .gogoproto.customtype + * @property {string|null} [".gogoproto.customname"] FieldOptions .gogoproto.customname + * @property {string|null} [".gogoproto.jsontag"] FieldOptions .gogoproto.jsontag + * @property {string|null} [".gogoproto.moretags"] FieldOptions .gogoproto.moretags + * @property {string|null} [".gogoproto.casttype"] FieldOptions .gogoproto.casttype + * @property {string|null} [".gogoproto.castkey"] FieldOptions .gogoproto.castkey + * @property {string|null} [".gogoproto.castvalue"] FieldOptions .gogoproto.castvalue + * @property {boolean|null} [".gogoproto.stdtime"] FieldOptions .gogoproto.stdtime + * @property {boolean|null} [".gogoproto.stdduration"] FieldOptions .gogoproto.stdduration + * @property {boolean|null} [".gogoproto.wktpointer"] FieldOptions .gogoproto.wktpointer + * @property {string|null} [".gogoproto.castrepeated"] FieldOptions .gogoproto.castrepeated + */ + + /** + * Constructs a new FieldOptions. + * @memberof google.protobuf + * @classdesc Represents a FieldOptions. + * @implements IFieldOptions + * @constructor + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + */ + function FieldOptions(properties) { + this.uninterpretedOption = []; + 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]]; + } + + /** + * FieldOptions ctype. + * @member {google.protobuf.FieldOptions.CType} ctype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.ctype = 0; + + /** + * FieldOptions packed. + * @member {boolean} packed + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.packed = false; + + /** + * FieldOptions jstype. + * @member {google.protobuf.FieldOptions.JSType} jstype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.jstype = 0; + + /** + * FieldOptions lazy. + * @member {boolean} lazy + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.lazy = false; + + /** + * FieldOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.deprecated = false; + + /** + * FieldOptions weak. + * @member {boolean} weak + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.weak = false; + + /** + * FieldOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * FieldOptions .gogoproto.nullable. + * @member {boolean} .gogoproto.nullable + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".gogoproto.nullable"] = false; + + /** + * FieldOptions .gogoproto.embed. + * @member {boolean} .gogoproto.embed + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".gogoproto.embed"] = false; + + /** + * FieldOptions .gogoproto.customtype. + * @member {string} .gogoproto.customtype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".gogoproto.customtype"] = ""; + + /** + * FieldOptions .gogoproto.customname. + * @member {string} .gogoproto.customname + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".gogoproto.customname"] = ""; + + /** + * FieldOptions .gogoproto.jsontag. + * @member {string} .gogoproto.jsontag + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".gogoproto.jsontag"] = ""; + + /** + * FieldOptions .gogoproto.moretags. + * @member {string} .gogoproto.moretags + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".gogoproto.moretags"] = ""; + + /** + * FieldOptions .gogoproto.casttype. + * @member {string} .gogoproto.casttype + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".gogoproto.casttype"] = ""; + + /** + * FieldOptions .gogoproto.castkey. + * @member {string} .gogoproto.castkey + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".gogoproto.castkey"] = ""; + + /** + * FieldOptions .gogoproto.castvalue. + * @member {string} .gogoproto.castvalue + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".gogoproto.castvalue"] = ""; + + /** + * FieldOptions .gogoproto.stdtime. + * @member {boolean} .gogoproto.stdtime + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".gogoproto.stdtime"] = false; + + /** + * FieldOptions .gogoproto.stdduration. + * @member {boolean} .gogoproto.stdduration + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".gogoproto.stdduration"] = false; + + /** + * FieldOptions .gogoproto.wktpointer. + * @member {boolean} .gogoproto.wktpointer + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".gogoproto.wktpointer"] = false; + + /** + * FieldOptions .gogoproto.castrepeated. + * @member {string} .gogoproto.castrepeated + * @memberof google.protobuf.FieldOptions + * @instance + */ + FieldOptions.prototype[".gogoproto.castrepeated"] = ""; + + /** + * Creates a new FieldOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions=} [properties] Properties to set + * @returns {google.protobuf.FieldOptions} FieldOptions instance + */ + FieldOptions.create = function create(properties) { + return new FieldOptions(properties); + }; + + /** + * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) + writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); + if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) + writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); + if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) + writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); + if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) + writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".gogoproto.nullable"] != null && Object.hasOwnProperty.call(message, ".gogoproto.nullable")) + writer.uint32(/* id 65001, wireType 0 =*/520008).bool(message[".gogoproto.nullable"]); + if (message[".gogoproto.embed"] != null && Object.hasOwnProperty.call(message, ".gogoproto.embed")) + writer.uint32(/* id 65002, wireType 0 =*/520016).bool(message[".gogoproto.embed"]); + if (message[".gogoproto.customtype"] != null && Object.hasOwnProperty.call(message, ".gogoproto.customtype")) + writer.uint32(/* id 65003, wireType 2 =*/520026).string(message[".gogoproto.customtype"]); + if (message[".gogoproto.customname"] != null && Object.hasOwnProperty.call(message, ".gogoproto.customname")) + writer.uint32(/* id 65004, wireType 2 =*/520034).string(message[".gogoproto.customname"]); + if (message[".gogoproto.jsontag"] != null && Object.hasOwnProperty.call(message, ".gogoproto.jsontag")) + writer.uint32(/* id 65005, wireType 2 =*/520042).string(message[".gogoproto.jsontag"]); + if (message[".gogoproto.moretags"] != null && Object.hasOwnProperty.call(message, ".gogoproto.moretags")) + writer.uint32(/* id 65006, wireType 2 =*/520050).string(message[".gogoproto.moretags"]); + if (message[".gogoproto.casttype"] != null && Object.hasOwnProperty.call(message, ".gogoproto.casttype")) + writer.uint32(/* id 65007, wireType 2 =*/520058).string(message[".gogoproto.casttype"]); + if (message[".gogoproto.castkey"] != null && Object.hasOwnProperty.call(message, ".gogoproto.castkey")) + writer.uint32(/* id 65008, wireType 2 =*/520066).string(message[".gogoproto.castkey"]); + if (message[".gogoproto.castvalue"] != null && Object.hasOwnProperty.call(message, ".gogoproto.castvalue")) + writer.uint32(/* id 65009, wireType 2 =*/520074).string(message[".gogoproto.castvalue"]); + if (message[".gogoproto.stdtime"] != null && Object.hasOwnProperty.call(message, ".gogoproto.stdtime")) + writer.uint32(/* id 65010, wireType 0 =*/520080).bool(message[".gogoproto.stdtime"]); + if (message[".gogoproto.stdduration"] != null && Object.hasOwnProperty.call(message, ".gogoproto.stdduration")) + writer.uint32(/* id 65011, wireType 0 =*/520088).bool(message[".gogoproto.stdduration"]); + if (message[".gogoproto.wktpointer"] != null && Object.hasOwnProperty.call(message, ".gogoproto.wktpointer")) + writer.uint32(/* id 65012, wireType 0 =*/520096).bool(message[".gogoproto.wktpointer"]); + if (message[".gogoproto.castrepeated"] != null && Object.hasOwnProperty.call(message, ".gogoproto.castrepeated")) + writer.uint32(/* id 65013, wireType 2 =*/520106).string(message[".gogoproto.castrepeated"]); + return writer; + }; + + /** + * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.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.google.protobuf.FieldOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.ctype = reader.int32(); + break; + case 2: + message.packed = reader.bool(); + break; + case 6: + message.jstype = reader.int32(); + break; + case 5: + message.lazy = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 10: + message.weak = reader.bool(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + case 65001: + message[".gogoproto.nullable"] = reader.bool(); + break; + case 65002: + message[".gogoproto.embed"] = reader.bool(); + break; + case 65003: + message[".gogoproto.customtype"] = reader.string(); + break; + case 65004: + message[".gogoproto.customname"] = reader.string(); + break; + case 65005: + message[".gogoproto.jsontag"] = reader.string(); + break; + case 65006: + message[".gogoproto.moretags"] = reader.string(); + break; + case 65007: + message[".gogoproto.casttype"] = reader.string(); + break; + case 65008: + message[".gogoproto.castkey"] = reader.string(); + break; + case 65009: + message[".gogoproto.castvalue"] = reader.string(); + break; + case 65010: + message[".gogoproto.stdtime"] = reader.bool(); + break; + case 65011: + message[".gogoproto.stdduration"] = reader.bool(); + break; + case 65012: + message[".gogoproto.wktpointer"] = reader.bool(); + break; + case 65013: + message[".gogoproto.castrepeated"] = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a FieldOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.FieldOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.FieldOptions} FieldOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + FieldOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a FieldOptions message. + * @function verify + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + FieldOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.ctype != null && message.hasOwnProperty("ctype")) + switch (message.ctype) { + default: + return "ctype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.packed != null && message.hasOwnProperty("packed")) + if (typeof message.packed !== "boolean") + return "packed: boolean expected"; + if (message.jstype != null && message.hasOwnProperty("jstype")) + switch (message.jstype) { + default: + return "jstype: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.lazy != null && message.hasOwnProperty("lazy")) + if (typeof message.lazy !== "boolean") + return "lazy: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.weak != null && message.hasOwnProperty("weak")) + if (typeof message.weak !== "boolean") + return "weak: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".gogoproto.nullable"] != null && message.hasOwnProperty(".gogoproto.nullable")) + if (typeof message[".gogoproto.nullable"] !== "boolean") + return ".gogoproto.nullable: boolean expected"; + if (message[".gogoproto.embed"] != null && message.hasOwnProperty(".gogoproto.embed")) + if (typeof message[".gogoproto.embed"] !== "boolean") + return ".gogoproto.embed: boolean expected"; + if (message[".gogoproto.customtype"] != null && message.hasOwnProperty(".gogoproto.customtype")) + if (!$util.isString(message[".gogoproto.customtype"])) + return ".gogoproto.customtype: string expected"; + if (message[".gogoproto.customname"] != null && message.hasOwnProperty(".gogoproto.customname")) + if (!$util.isString(message[".gogoproto.customname"])) + return ".gogoproto.customname: string expected"; + if (message[".gogoproto.jsontag"] != null && message.hasOwnProperty(".gogoproto.jsontag")) + if (!$util.isString(message[".gogoproto.jsontag"])) + return ".gogoproto.jsontag: string expected"; + if (message[".gogoproto.moretags"] != null && message.hasOwnProperty(".gogoproto.moretags")) + if (!$util.isString(message[".gogoproto.moretags"])) + return ".gogoproto.moretags: string expected"; + if (message[".gogoproto.casttype"] != null && message.hasOwnProperty(".gogoproto.casttype")) + if (!$util.isString(message[".gogoproto.casttype"])) + return ".gogoproto.casttype: string expected"; + if (message[".gogoproto.castkey"] != null && message.hasOwnProperty(".gogoproto.castkey")) + if (!$util.isString(message[".gogoproto.castkey"])) + return ".gogoproto.castkey: string expected"; + if (message[".gogoproto.castvalue"] != null && message.hasOwnProperty(".gogoproto.castvalue")) + if (!$util.isString(message[".gogoproto.castvalue"])) + return ".gogoproto.castvalue: string expected"; + if (message[".gogoproto.stdtime"] != null && message.hasOwnProperty(".gogoproto.stdtime")) + if (typeof message[".gogoproto.stdtime"] !== "boolean") + return ".gogoproto.stdtime: boolean expected"; + if (message[".gogoproto.stdduration"] != null && message.hasOwnProperty(".gogoproto.stdduration")) + if (typeof message[".gogoproto.stdduration"] !== "boolean") + return ".gogoproto.stdduration: boolean expected"; + if (message[".gogoproto.wktpointer"] != null && message.hasOwnProperty(".gogoproto.wktpointer")) + if (typeof message[".gogoproto.wktpointer"] !== "boolean") + return ".gogoproto.wktpointer: boolean expected"; + if (message[".gogoproto.castrepeated"] != null && message.hasOwnProperty(".gogoproto.castrepeated")) + if (!$util.isString(message[".gogoproto.castrepeated"])) + return ".gogoproto.castrepeated: string expected"; + return null; + }; + + /** + * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.FieldOptions} FieldOptions + */ + FieldOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.FieldOptions) + return object; + var message = new $root.google.protobuf.FieldOptions(); + switch (object.ctype) { + case "STRING": + case 0: + message.ctype = 0; + break; + case "CORD": + case 1: + message.ctype = 1; + break; + case "STRING_PIECE": + case 2: + message.ctype = 2; + break; + } + if (object.packed != null) + message.packed = Boolean(object.packed); + switch (object.jstype) { + case "JS_NORMAL": + case 0: + message.jstype = 0; + break; + case "JS_STRING": + case 1: + message.jstype = 1; + break; + case "JS_NUMBER": + case 2: + message.jstype = 2; + break; + } + if (object.lazy != null) + message.lazy = Boolean(object.lazy); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.weak != null) + message.weak = Boolean(object.weak); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".gogoproto.nullable"] != null) + message[".gogoproto.nullable"] = Boolean(object[".gogoproto.nullable"]); + if (object[".gogoproto.embed"] != null) + message[".gogoproto.embed"] = Boolean(object[".gogoproto.embed"]); + if (object[".gogoproto.customtype"] != null) + message[".gogoproto.customtype"] = String(object[".gogoproto.customtype"]); + if (object[".gogoproto.customname"] != null) + message[".gogoproto.customname"] = String(object[".gogoproto.customname"]); + if (object[".gogoproto.jsontag"] != null) + message[".gogoproto.jsontag"] = String(object[".gogoproto.jsontag"]); + if (object[".gogoproto.moretags"] != null) + message[".gogoproto.moretags"] = String(object[".gogoproto.moretags"]); + if (object[".gogoproto.casttype"] != null) + message[".gogoproto.casttype"] = String(object[".gogoproto.casttype"]); + if (object[".gogoproto.castkey"] != null) + message[".gogoproto.castkey"] = String(object[".gogoproto.castkey"]); + if (object[".gogoproto.castvalue"] != null) + message[".gogoproto.castvalue"] = String(object[".gogoproto.castvalue"]); + if (object[".gogoproto.stdtime"] != null) + message[".gogoproto.stdtime"] = Boolean(object[".gogoproto.stdtime"]); + if (object[".gogoproto.stdduration"] != null) + message[".gogoproto.stdduration"] = Boolean(object[".gogoproto.stdduration"]); + if (object[".gogoproto.wktpointer"] != null) + message[".gogoproto.wktpointer"] = Boolean(object[".gogoproto.wktpointer"]); + if (object[".gogoproto.castrepeated"] != null) + message[".gogoproto.castrepeated"] = String(object[".gogoproto.castrepeated"]); + return message; + }; + + /** + * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.FieldOptions + * @static + * @param {google.protobuf.FieldOptions} message FieldOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + FieldOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.ctype = options.enums === String ? "STRING" : 0; + object.packed = false; + object.deprecated = false; + object.lazy = false; + object.jstype = options.enums === String ? "JS_NORMAL" : 0; + object.weak = false; + object[".gogoproto.nullable"] = false; + object[".gogoproto.embed"] = false; + object[".gogoproto.customtype"] = ""; + object[".gogoproto.customname"] = ""; + object[".gogoproto.jsontag"] = ""; + object[".gogoproto.moretags"] = ""; + object[".gogoproto.casttype"] = ""; + object[".gogoproto.castkey"] = ""; + object[".gogoproto.castvalue"] = ""; + object[".gogoproto.stdtime"] = false; + object[".gogoproto.stdduration"] = false; + object[".gogoproto.wktpointer"] = false; + object[".gogoproto.castrepeated"] = ""; + } + if (message.ctype != null && message.hasOwnProperty("ctype")) + object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; + if (message.packed != null && message.hasOwnProperty("packed")) + object.packed = message.packed; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.lazy != null && message.hasOwnProperty("lazy")) + object.lazy = message.lazy; + if (message.jstype != null && message.hasOwnProperty("jstype")) + object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; + if (message.weak != null && message.hasOwnProperty("weak")) + object.weak = message.weak; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".gogoproto.nullable"] != null && message.hasOwnProperty(".gogoproto.nullable")) + object[".gogoproto.nullable"] = message[".gogoproto.nullable"]; + if (message[".gogoproto.embed"] != null && message.hasOwnProperty(".gogoproto.embed")) + object[".gogoproto.embed"] = message[".gogoproto.embed"]; + if (message[".gogoproto.customtype"] != null && message.hasOwnProperty(".gogoproto.customtype")) + object[".gogoproto.customtype"] = message[".gogoproto.customtype"]; + if (message[".gogoproto.customname"] != null && message.hasOwnProperty(".gogoproto.customname")) + object[".gogoproto.customname"] = message[".gogoproto.customname"]; + if (message[".gogoproto.jsontag"] != null && message.hasOwnProperty(".gogoproto.jsontag")) + object[".gogoproto.jsontag"] = message[".gogoproto.jsontag"]; + if (message[".gogoproto.moretags"] != null && message.hasOwnProperty(".gogoproto.moretags")) + object[".gogoproto.moretags"] = message[".gogoproto.moretags"]; + if (message[".gogoproto.casttype"] != null && message.hasOwnProperty(".gogoproto.casttype")) + object[".gogoproto.casttype"] = message[".gogoproto.casttype"]; + if (message[".gogoproto.castkey"] != null && message.hasOwnProperty(".gogoproto.castkey")) + object[".gogoproto.castkey"] = message[".gogoproto.castkey"]; + if (message[".gogoproto.castvalue"] != null && message.hasOwnProperty(".gogoproto.castvalue")) + object[".gogoproto.castvalue"] = message[".gogoproto.castvalue"]; + if (message[".gogoproto.stdtime"] != null && message.hasOwnProperty(".gogoproto.stdtime")) + object[".gogoproto.stdtime"] = message[".gogoproto.stdtime"]; + if (message[".gogoproto.stdduration"] != null && message.hasOwnProperty(".gogoproto.stdduration")) + object[".gogoproto.stdduration"] = message[".gogoproto.stdduration"]; + if (message[".gogoproto.wktpointer"] != null && message.hasOwnProperty(".gogoproto.wktpointer")) + object[".gogoproto.wktpointer"] = message[".gogoproto.wktpointer"]; + if (message[".gogoproto.castrepeated"] != null && message.hasOwnProperty(".gogoproto.castrepeated")) + object[".gogoproto.castrepeated"] = message[".gogoproto.castrepeated"]; + return object; + }; + + /** + * Converts this FieldOptions to JSON. + * @function toJSON + * @memberof google.protobuf.FieldOptions + * @instance + * @returns {Object.} JSON object + */ + FieldOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * CType enum. + * @name google.protobuf.FieldOptions.CType + * @enum {number} + * @property {number} STRING=0 STRING value + * @property {number} CORD=1 CORD value + * @property {number} STRING_PIECE=2 STRING_PIECE value + */ + FieldOptions.CType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "STRING"] = 0; + values[valuesById[1] = "CORD"] = 1; + values[valuesById[2] = "STRING_PIECE"] = 2; + return values; + })(); + + /** + * JSType enum. + * @name google.protobuf.FieldOptions.JSType + * @enum {number} + * @property {number} JS_NORMAL=0 JS_NORMAL value + * @property {number} JS_STRING=1 JS_STRING value + * @property {number} JS_NUMBER=2 JS_NUMBER value + */ + FieldOptions.JSType = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "JS_NORMAL"] = 0; + values[valuesById[1] = "JS_STRING"] = 1; + values[valuesById[2] = "JS_NUMBER"] = 2; + return values; + })(); + + return FieldOptions; + })(); + + protobuf.OneofOptions = (function() { + + /** + * Properties of an OneofOptions. + * @memberof google.protobuf + * @interface IOneofOptions + * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption + */ + + /** + * Constructs a new OneofOptions. + * @memberof google.protobuf + * @classdesc Represents an OneofOptions. + * @implements IOneofOptions + * @constructor + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + */ + function OneofOptions(properties) { + this.uninterpretedOption = []; + 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]]; + } + + /** + * OneofOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.OneofOptions + * @instance + */ + OneofOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new OneofOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions=} [properties] Properties to set + * @returns {google.protobuf.OneofOptions} OneofOptions instance + */ + OneofOptions.create = function create(properties) { + return new OneofOptions(properties); + }; + + /** + * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.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.google.protobuf.OneofOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OneofOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.OneofOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.OneofOptions} OneofOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OneofOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OneofOptions message. + * @function verify + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OneofOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.OneofOptions} OneofOptions + */ + OneofOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.OneofOptions) + return object; + var message = new $root.google.protobuf.OneofOptions(); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.OneofOptions + * @static + * @param {google.protobuf.OneofOptions} message OneofOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OneofOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this OneofOptions to JSON. + * @function toJSON + * @memberof google.protobuf.OneofOptions + * @instance + * @returns {Object.} JSON object + */ + OneofOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return OneofOptions; + })(); + + protobuf.EnumOptions = (function() { + + /** + * Properties of an EnumOptions. + * @memberof google.protobuf + * @interface IEnumOptions + * @property {boolean|null} [allowAlias] EnumOptions allowAlias + * @property {boolean|null} [deprecated] EnumOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption + * @property {boolean|null} [".gogoproto.goprotoEnumPrefix"] EnumOptions .gogoproto.goprotoEnumPrefix + * @property {boolean|null} [".gogoproto.goprotoEnumStringer"] EnumOptions .gogoproto.goprotoEnumStringer + * @property {boolean|null} [".gogoproto.enumStringer"] EnumOptions .gogoproto.enumStringer + * @property {string|null} [".gogoproto.enumCustomname"] EnumOptions .gogoproto.enumCustomname + * @property {boolean|null} [".gogoproto.enumdecl"] EnumOptions .gogoproto.enumdecl + */ + + /** + * Constructs a new EnumOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumOptions. + * @implements IEnumOptions + * @constructor + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + */ + function EnumOptions(properties) { + this.uninterpretedOption = []; + 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]]; + } + + /** + * EnumOptions allowAlias. + * @member {boolean} allowAlias + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.allowAlias = false; + + /** + * EnumOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.deprecated = false; + + /** + * EnumOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * EnumOptions .gogoproto.goprotoEnumPrefix. + * @member {boolean} .gogoproto.goprotoEnumPrefix + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype[".gogoproto.goprotoEnumPrefix"] = false; + + /** + * EnumOptions .gogoproto.goprotoEnumStringer. + * @member {boolean} .gogoproto.goprotoEnumStringer + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype[".gogoproto.goprotoEnumStringer"] = false; + + /** + * EnumOptions .gogoproto.enumStringer. + * @member {boolean} .gogoproto.enumStringer + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype[".gogoproto.enumStringer"] = false; + + /** + * EnumOptions .gogoproto.enumCustomname. + * @member {string} .gogoproto.enumCustomname + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype[".gogoproto.enumCustomname"] = ""; + + /** + * EnumOptions .gogoproto.enumdecl. + * @member {boolean} .gogoproto.enumdecl + * @memberof google.protobuf.EnumOptions + * @instance + */ + EnumOptions.prototype[".gogoproto.enumdecl"] = false; + + /** + * Creates a new EnumOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumOptions} EnumOptions instance + */ + EnumOptions.create = function create(properties) { + return new EnumOptions(properties); + }; + + /** + * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".gogoproto.goprotoEnumPrefix"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goprotoEnumPrefix")) + writer.uint32(/* id 62001, wireType 0 =*/496008).bool(message[".gogoproto.goprotoEnumPrefix"]); + if (message[".gogoproto.goprotoEnumStringer"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goprotoEnumStringer")) + writer.uint32(/* id 62021, wireType 0 =*/496168).bool(message[".gogoproto.goprotoEnumStringer"]); + if (message[".gogoproto.enumStringer"] != null && Object.hasOwnProperty.call(message, ".gogoproto.enumStringer")) + writer.uint32(/* id 62022, wireType 0 =*/496176).bool(message[".gogoproto.enumStringer"]); + if (message[".gogoproto.enumCustomname"] != null && Object.hasOwnProperty.call(message, ".gogoproto.enumCustomname")) + writer.uint32(/* id 62023, wireType 2 =*/496186).string(message[".gogoproto.enumCustomname"]); + if (message[".gogoproto.enumdecl"] != null && Object.hasOwnProperty.call(message, ".gogoproto.enumdecl")) + writer.uint32(/* id 62024, wireType 0 =*/496192).bool(message[".gogoproto.enumdecl"]); + return writer; + }; + + /** + * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.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.google.protobuf.EnumOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + message.allowAlias = reader.bool(); + break; + case 3: + message.deprecated = reader.bool(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + case 62001: + message[".gogoproto.goprotoEnumPrefix"] = reader.bool(); + break; + case 62021: + message[".gogoproto.goprotoEnumStringer"] = reader.bool(); + break; + case 62022: + message[".gogoproto.enumStringer"] = reader.bool(); + break; + case 62023: + message[".gogoproto.enumCustomname"] = reader.string(); + break; + case 62024: + message[".gogoproto.enumdecl"] = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumOptions} EnumOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumOptions message. + * @function verify + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + if (typeof message.allowAlias !== "boolean") + return "allowAlias: boolean expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".gogoproto.goprotoEnumPrefix"] != null && message.hasOwnProperty(".gogoproto.goprotoEnumPrefix")) + if (typeof message[".gogoproto.goprotoEnumPrefix"] !== "boolean") + return ".gogoproto.goprotoEnumPrefix: boolean expected"; + if (message[".gogoproto.goprotoEnumStringer"] != null && message.hasOwnProperty(".gogoproto.goprotoEnumStringer")) + if (typeof message[".gogoproto.goprotoEnumStringer"] !== "boolean") + return ".gogoproto.goprotoEnumStringer: boolean expected"; + if (message[".gogoproto.enumStringer"] != null && message.hasOwnProperty(".gogoproto.enumStringer")) + if (typeof message[".gogoproto.enumStringer"] !== "boolean") + return ".gogoproto.enumStringer: boolean expected"; + if (message[".gogoproto.enumCustomname"] != null && message.hasOwnProperty(".gogoproto.enumCustomname")) + if (!$util.isString(message[".gogoproto.enumCustomname"])) + return ".gogoproto.enumCustomname: string expected"; + if (message[".gogoproto.enumdecl"] != null && message.hasOwnProperty(".gogoproto.enumdecl")) + if (typeof message[".gogoproto.enumdecl"] !== "boolean") + return ".gogoproto.enumdecl: boolean expected"; + return null; + }; + + /** + * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumOptions} EnumOptions + */ + EnumOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumOptions) + return object; + var message = new $root.google.protobuf.EnumOptions(); + if (object.allowAlias != null) + message.allowAlias = Boolean(object.allowAlias); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".gogoproto.goprotoEnumPrefix"] != null) + message[".gogoproto.goprotoEnumPrefix"] = Boolean(object[".gogoproto.goprotoEnumPrefix"]); + if (object[".gogoproto.goprotoEnumStringer"] != null) + message[".gogoproto.goprotoEnumStringer"] = Boolean(object[".gogoproto.goprotoEnumStringer"]); + if (object[".gogoproto.enumStringer"] != null) + message[".gogoproto.enumStringer"] = Boolean(object[".gogoproto.enumStringer"]); + if (object[".gogoproto.enumCustomname"] != null) + message[".gogoproto.enumCustomname"] = String(object[".gogoproto.enumCustomname"]); + if (object[".gogoproto.enumdecl"] != null) + message[".gogoproto.enumdecl"] = Boolean(object[".gogoproto.enumdecl"]); + return message; + }; + + /** + * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumOptions + * @static + * @param {google.protobuf.EnumOptions} message EnumOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.allowAlias = false; + object.deprecated = false; + object[".gogoproto.goprotoEnumPrefix"] = false; + object[".gogoproto.goprotoEnumStringer"] = false; + object[".gogoproto.enumStringer"] = false; + object[".gogoproto.enumCustomname"] = ""; + object[".gogoproto.enumdecl"] = false; + } + if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) + object.allowAlias = message.allowAlias; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".gogoproto.goprotoEnumPrefix"] != null && message.hasOwnProperty(".gogoproto.goprotoEnumPrefix")) + object[".gogoproto.goprotoEnumPrefix"] = message[".gogoproto.goprotoEnumPrefix"]; + if (message[".gogoproto.goprotoEnumStringer"] != null && message.hasOwnProperty(".gogoproto.goprotoEnumStringer")) + object[".gogoproto.goprotoEnumStringer"] = message[".gogoproto.goprotoEnumStringer"]; + if (message[".gogoproto.enumStringer"] != null && message.hasOwnProperty(".gogoproto.enumStringer")) + object[".gogoproto.enumStringer"] = message[".gogoproto.enumStringer"]; + if (message[".gogoproto.enumCustomname"] != null && message.hasOwnProperty(".gogoproto.enumCustomname")) + object[".gogoproto.enumCustomname"] = message[".gogoproto.enumCustomname"]; + if (message[".gogoproto.enumdecl"] != null && message.hasOwnProperty(".gogoproto.enumdecl")) + object[".gogoproto.enumdecl"] = message[".gogoproto.enumdecl"]; + return object; + }; + + /** + * Converts this EnumOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumOptions + * @instance + * @returns {Object.} JSON object + */ + EnumOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EnumOptions; + })(); + + protobuf.EnumValueOptions = (function() { + + /** + * Properties of an EnumValueOptions. + * @memberof google.protobuf + * @interface IEnumValueOptions + * @property {boolean|null} [deprecated] EnumValueOptions deprecated + * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption + * @property {string|null} [".gogoproto.enumvalueCustomname"] EnumValueOptions .gogoproto.enumvalueCustomname + */ + + /** + * Constructs a new EnumValueOptions. + * @memberof google.protobuf + * @classdesc Represents an EnumValueOptions. + * @implements IEnumValueOptions + * @constructor + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + */ + function EnumValueOptions(properties) { + this.uninterpretedOption = []; + 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]]; + } + + /** + * EnumValueOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.deprecated = false; + + /** + * EnumValueOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * EnumValueOptions .gogoproto.enumvalueCustomname. + * @member {string} .gogoproto.enumvalueCustomname + * @memberof google.protobuf.EnumValueOptions + * @instance + */ + EnumValueOptions.prototype[".gogoproto.enumvalueCustomname"] = ""; + + /** + * Creates a new EnumValueOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance + */ + EnumValueOptions.create = function create(properties) { + return new EnumValueOptions(properties); + }; + + /** + * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + if (message[".gogoproto.enumvalueCustomname"] != null && Object.hasOwnProperty.call(message, ".gogoproto.enumvalueCustomname")) + writer.uint32(/* id 66001, wireType 2 =*/528010).string(message[".gogoproto.enumvalueCustomname"]); + return writer; + }; + + /** + * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.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.google.protobuf.EnumValueOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.deprecated = reader.bool(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + case 66001: + message[".gogoproto.enumvalueCustomname"] = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an EnumValueOptions message. + * @function verify + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + EnumValueOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + if (message[".gogoproto.enumvalueCustomname"] != null && message.hasOwnProperty(".gogoproto.enumvalueCustomname")) + if (!$util.isString(message[".gogoproto.enumvalueCustomname"])) + return ".gogoproto.enumvalueCustomname: string expected"; + return null; + }; + + /** + * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.EnumValueOptions} EnumValueOptions + */ + EnumValueOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.EnumValueOptions) + return object; + var message = new $root.google.protobuf.EnumValueOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + if (object[".gogoproto.enumvalueCustomname"] != null) + message[".gogoproto.enumvalueCustomname"] = String(object[".gogoproto.enumvalueCustomname"]); + return message; + }; + + /** + * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.EnumValueOptions + * @static + * @param {google.protobuf.EnumValueOptions} message EnumValueOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + EnumValueOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object[".gogoproto.enumvalueCustomname"] = ""; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + if (message[".gogoproto.enumvalueCustomname"] != null && message.hasOwnProperty(".gogoproto.enumvalueCustomname")) + object[".gogoproto.enumvalueCustomname"] = message[".gogoproto.enumvalueCustomname"]; + return object; + }; + + /** + * Converts this EnumValueOptions to JSON. + * @function toJSON + * @memberof google.protobuf.EnumValueOptions + * @instance + * @returns {Object.} JSON object + */ + EnumValueOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return EnumValueOptions; + })(); + + protobuf.ServiceOptions = (function() { + + /** + * Properties of a ServiceOptions. + * @memberof google.protobuf + * @interface IServiceOptions + * @property {boolean|null} [deprecated] ServiceOptions deprecated + * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption + */ + + /** + * Constructs a new ServiceOptions. + * @memberof google.protobuf + * @classdesc Represents a ServiceOptions. + * @implements IServiceOptions + * @constructor + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + */ + function ServiceOptions(properties) { + this.uninterpretedOption = []; + 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]]; + } + + /** + * ServiceOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.deprecated = false; + + /** + * ServiceOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.ServiceOptions + * @instance + */ + ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new ServiceOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions=} [properties] Properties to set + * @returns {google.protobuf.ServiceOptions} ServiceOptions instance + */ + ServiceOptions.create = function create(properties) { + return new ServiceOptions(properties); + }; + + /** + * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.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.google.protobuf.ServiceOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: + message.deprecated = reader.bool(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.ServiceOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.ServiceOptions} ServiceOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ServiceOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a ServiceOptions message. + * @function verify + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ServiceOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.ServiceOptions} ServiceOptions + */ + ServiceOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.ServiceOptions) + return object; + var message = new $root.google.protobuf.ServiceOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.ServiceOptions + * @static + * @param {google.protobuf.ServiceOptions} message ServiceOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ServiceOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) + object.deprecated = false; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this ServiceOptions to JSON. + * @function toJSON + * @memberof google.protobuf.ServiceOptions + * @instance + * @returns {Object.} JSON object + */ + ServiceOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ServiceOptions; + })(); + + protobuf.MethodOptions = (function() { + + /** + * Properties of a MethodOptions. + * @memberof google.protobuf + * @interface IMethodOptions + * @property {boolean|null} [deprecated] MethodOptions deprecated + * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel + * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption + */ + + /** + * Constructs a new MethodOptions. + * @memberof google.protobuf + * @classdesc Represents a MethodOptions. + * @implements IMethodOptions + * @constructor + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + */ + function MethodOptions(properties) { + this.uninterpretedOption = []; + 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]]; + } + + /** + * MethodOptions deprecated. + * @member {boolean} deprecated + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.deprecated = false; + + /** + * MethodOptions idempotencyLevel. + * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.idempotencyLevel = 0; + + /** + * MethodOptions uninterpretedOption. + * @member {Array.} uninterpretedOption + * @memberof google.protobuf.MethodOptions + * @instance + */ + MethodOptions.prototype.uninterpretedOption = $util.emptyArray; + + /** + * Creates a new MethodOptions instance using the specified properties. + * @function create + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions=} [properties] Properties to set + * @returns {google.protobuf.MethodOptions} MethodOptions instance + */ + MethodOptions.create = function create(properties) { + return new MethodOptions(properties); + }; + + /** + * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encode + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) + writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); + if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) + writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); + if (message.uninterpretedOption != null && message.uninterpretedOption.length) + for (var i = 0; i < message.uninterpretedOption.length; ++i) + $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.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.google.protobuf.MethodOptions(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 33: + message.deprecated = reader.bool(); + break; + case 34: + message.idempotencyLevel = reader.int32(); + break; + case 999: + if (!(message.uninterpretedOption && message.uninterpretedOption.length)) + message.uninterpretedOption = []; + message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a MethodOptions message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.MethodOptions + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.MethodOptions} MethodOptions + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + MethodOptions.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a MethodOptions message. + * @function verify + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + MethodOptions.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + if (typeof message.deprecated !== "boolean") + return "deprecated: boolean expected"; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + switch (message.idempotencyLevel) { + default: + return "idempotencyLevel: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { + if (!Array.isArray(message.uninterpretedOption)) + return "uninterpretedOption: array expected"; + for (var i = 0; i < message.uninterpretedOption.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); + if (error) + return "uninterpretedOption." + error; + } + } + return null; + }; + + /** + * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.MethodOptions} MethodOptions + */ + MethodOptions.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.MethodOptions) + return object; + var message = new $root.google.protobuf.MethodOptions(); + if (object.deprecated != null) + message.deprecated = Boolean(object.deprecated); + switch (object.idempotencyLevel) { + case "IDEMPOTENCY_UNKNOWN": + case 0: + message.idempotencyLevel = 0; + break; + case "NO_SIDE_EFFECTS": + case 1: + message.idempotencyLevel = 1; + break; + case "IDEMPOTENT": + case 2: + message.idempotencyLevel = 2; + break; + } + if (object.uninterpretedOption) { + if (!Array.isArray(object.uninterpretedOption)) + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); + message.uninterpretedOption = []; + for (var i = 0; i < object.uninterpretedOption.length; ++i) { + if (typeof object.uninterpretedOption[i] !== "object") + throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); + message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.MethodOptions + * @static + * @param {google.protobuf.MethodOptions} message MethodOptions + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MethodOptions.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.uninterpretedOption = []; + if (options.defaults) { + object.deprecated = false; + object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; + } + if (message.deprecated != null && message.hasOwnProperty("deprecated")) + object.deprecated = message.deprecated; + if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) + object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; + if (message.uninterpretedOption && message.uninterpretedOption.length) { + object.uninterpretedOption = []; + for (var j = 0; j < message.uninterpretedOption.length; ++j) + object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); + } + return object; + }; + + /** + * Converts this MethodOptions to JSON. + * @function toJSON + * @memberof google.protobuf.MethodOptions + * @instance + * @returns {Object.} JSON object + */ + MethodOptions.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + /** + * IdempotencyLevel enum. + * @name google.protobuf.MethodOptions.IdempotencyLevel + * @enum {number} + * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value + * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value + * @property {number} IDEMPOTENT=2 IDEMPOTENT value + */ + MethodOptions.IdempotencyLevel = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; + values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; + values[valuesById[2] = "IDEMPOTENT"] = 2; + return values; + })(); + + return MethodOptions; + })(); + + protobuf.UninterpretedOption = (function() { + + /** + * Properties of an UninterpretedOption. + * @memberof google.protobuf + * @interface IUninterpretedOption + * @property {Array.|null} [name] UninterpretedOption name + * @property {string|null} [identifierValue] UninterpretedOption identifierValue + * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue + * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue + * @property {number|null} [doubleValue] UninterpretedOption doubleValue + * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue + * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue + */ + + /** + * Constructs a new UninterpretedOption. + * @memberof google.protobuf + * @classdesc Represents an UninterpretedOption. + * @implements IUninterpretedOption + * @constructor + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + */ + function UninterpretedOption(properties) { + this.name = []; + 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]]; + } + + /** + * UninterpretedOption name. + * @member {Array.} name + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.name = $util.emptyArray; + + /** + * UninterpretedOption identifierValue. + * @member {string} identifierValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.identifierValue = ""; + + /** + * UninterpretedOption positiveIntValue. + * @member {number|Long} positiveIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * UninterpretedOption negativeIntValue. + * @member {number|Long} negativeIntValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * UninterpretedOption doubleValue. + * @member {number} doubleValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.doubleValue = 0; + + /** + * UninterpretedOption stringValue. + * @member {Uint8Array} stringValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.stringValue = $util.newBuffer([]); + + /** + * UninterpretedOption aggregateValue. + * @member {string} aggregateValue + * @memberof google.protobuf.UninterpretedOption + * @instance + */ + UninterpretedOption.prototype.aggregateValue = ""; + + /** + * Creates a new UninterpretedOption instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance + */ + UninterpretedOption.create = function create(properties) { + return new UninterpretedOption(properties); + }; + + /** + * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.name != null && message.name.length) + for (var i = 0; i < message.name.length; ++i) + $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); + if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); + if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); + if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) + writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); + if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) + writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); + if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) + writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); + return writer; + }; + + /** + * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.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.google.protobuf.UninterpretedOption(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 2: + if (!(message.name && message.name.length)) + message.name = []; + message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); + break; + case 3: + message.identifierValue = reader.string(); + break; + case 4: + message.positiveIntValue = reader.uint64(); + break; + case 5: + message.negativeIntValue = reader.int64(); + break; + case 6: + message.doubleValue = reader.double(); + break; + case 7: + message.stringValue = reader.bytes(); + break; + case 8: + message.aggregateValue = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an UninterpretedOption message. + * @function verify + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + UninterpretedOption.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.name != null && message.hasOwnProperty("name")) { + if (!Array.isArray(message.name)) + return "name: array expected"; + for (var i = 0; i < message.name.length; ++i) { + var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); + if (error) + return "name." + error; + } + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + if (!$util.isString(message.identifierValue)) + return "identifierValue: string expected"; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) + return "positiveIntValue: integer|Long expected"; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) + return "negativeIntValue: integer|Long expected"; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + if (typeof message.doubleValue !== "number") + return "doubleValue: number expected"; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) + return "stringValue: buffer expected"; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + if (!$util.isString(message.aggregateValue)) + return "aggregateValue: string expected"; + return null; + }; + + /** + * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption} UninterpretedOption + */ + UninterpretedOption.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption) + return object; + var message = new $root.google.protobuf.UninterpretedOption(); + if (object.name) { + if (!Array.isArray(object.name)) + throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); + message.name = []; + for (var i = 0; i < object.name.length; ++i) { + if (typeof object.name[i] !== "object") + throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); + message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); + } + } + if (object.identifierValue != null) + message.identifierValue = String(object.identifierValue); + if (object.positiveIntValue != null) + if ($util.Long) + (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; + else if (typeof object.positiveIntValue === "string") + message.positiveIntValue = parseInt(object.positiveIntValue, 10); + else if (typeof object.positiveIntValue === "number") + message.positiveIntValue = object.positiveIntValue; + else if (typeof object.positiveIntValue === "object") + message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); + if (object.negativeIntValue != null) + if ($util.Long) + (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; + else if (typeof object.negativeIntValue === "string") + message.negativeIntValue = parseInt(object.negativeIntValue, 10); + else if (typeof object.negativeIntValue === "number") + message.negativeIntValue = object.negativeIntValue; + else if (typeof object.negativeIntValue === "object") + message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); + if (object.doubleValue != null) + message.doubleValue = Number(object.doubleValue); + if (object.stringValue != null) + if (typeof object.stringValue === "string") + $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); + else if (object.stringValue.length) + message.stringValue = object.stringValue; + if (object.aggregateValue != null) + message.aggregateValue = String(object.aggregateValue); + return message; + }; + + /** + * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption + * @static + * @param {google.protobuf.UninterpretedOption} message UninterpretedOption + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + UninterpretedOption.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.name = []; + if (options.defaults) { + object.identifierValue = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.positiveIntValue = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.negativeIntValue = options.longs === String ? "0" : 0; + object.doubleValue = 0; + if (options.bytes === String) + object.stringValue = ""; + else { + object.stringValue = []; + if (options.bytes !== Array) + object.stringValue = $util.newBuffer(object.stringValue); + } + object.aggregateValue = ""; + } + if (message.name && message.name.length) { + object.name = []; + for (var j = 0; j < message.name.length; ++j) + object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); + } + if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) + object.identifierValue = message.identifierValue; + if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) + if (typeof message.positiveIntValue === "number") + object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; + else + object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; + if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) + if (typeof message.negativeIntValue === "number") + object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; + else + object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; + if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) + object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; + if (message.stringValue != null && message.hasOwnProperty("stringValue")) + object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; + if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) + object.aggregateValue = message.aggregateValue; + return object; + }; + + /** + * Converts this UninterpretedOption to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption + * @instance + * @returns {Object.} JSON object + */ + UninterpretedOption.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + UninterpretedOption.NamePart = (function() { + + /** + * Properties of a NamePart. + * @memberof google.protobuf.UninterpretedOption + * @interface INamePart + * @property {string} namePart NamePart namePart + * @property {boolean} isExtension NamePart isExtension + */ + + /** + * Constructs a new NamePart. + * @memberof google.protobuf.UninterpretedOption + * @classdesc Represents a NamePart. + * @implements INamePart + * @constructor + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + */ + function NamePart(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]]; + } + + /** + * NamePart namePart. + * @member {string} namePart + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.namePart = ""; + + /** + * NamePart isExtension. + * @member {boolean} isExtension + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + */ + NamePart.prototype.isExtension = false; + + /** + * Creates a new NamePart instance using the specified properties. + * @function create + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance + */ + NamePart.create = function create(properties) { + return new NamePart(properties); + }; + + /** + * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); + writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); + return writer; + }; + + /** + * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NamePart.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NamePart message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.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.google.protobuf.UninterpretedOption.NamePart(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.namePart = reader.string(); + break; + case 2: + message.isExtension = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + if (!message.hasOwnProperty("namePart")) + throw $util.ProtocolError("missing required 'namePart'", { instance: message }); + if (!message.hasOwnProperty("isExtension")) + throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); + return message; + }; + + /** + * Decodes a NamePart message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NamePart.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NamePart message. + * @function verify + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NamePart.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (!$util.isString(message.namePart)) + return "namePart: string expected"; + if (typeof message.isExtension !== "boolean") + return "isExtension: boolean expected"; + return null; + }; + + /** + * Creates a NamePart message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart + */ + NamePart.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) + return object; + var message = new $root.google.protobuf.UninterpretedOption.NamePart(); + if (object.namePart != null) + message.namePart = String(object.namePart); + if (object.isExtension != null) + message.isExtension = Boolean(object.isExtension); + return message; + }; + + /** + * Creates a plain object from a NamePart message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.UninterpretedOption.NamePart + * @static + * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NamePart.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.namePart = ""; + object.isExtension = false; + } + if (message.namePart != null && message.hasOwnProperty("namePart")) + object.namePart = message.namePart; + if (message.isExtension != null && message.hasOwnProperty("isExtension")) + object.isExtension = message.isExtension; + return object; + }; + + /** + * Converts this NamePart to JSON. + * @function toJSON + * @memberof google.protobuf.UninterpretedOption.NamePart + * @instance + * @returns {Object.} JSON object + */ + NamePart.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NamePart; + })(); + + return UninterpretedOption; + })(); + + protobuf.SourceCodeInfo = (function() { + + /** + * Properties of a SourceCodeInfo. + * @memberof google.protobuf + * @interface ISourceCodeInfo + * @property {Array.|null} [location] SourceCodeInfo location + */ + + /** + * Constructs a new SourceCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a SourceCodeInfo. + * @implements ISourceCodeInfo + * @constructor + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + */ + function SourceCodeInfo(properties) { + this.location = []; + 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]]; + } + + /** + * SourceCodeInfo location. + * @member {Array.} location + * @memberof google.protobuf.SourceCodeInfo + * @instance + */ + SourceCodeInfo.prototype.location = $util.emptyArray; + + /** + * Creates a new SourceCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance + */ + SourceCodeInfo.create = function create(properties) { + return new SourceCodeInfo(properties); + }; + + /** + * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.location != null && message.location.length) + for (var i = 0; i < message.location.length; ++i) + $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.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.google.protobuf.SourceCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.location && message.location.length)) + message.location = []; + message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a SourceCodeInfo message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + SourceCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.location != null && message.hasOwnProperty("location")) { + if (!Array.isArray(message.location)) + return "location: array expected"; + for (var i = 0; i < message.location.length; ++i) { + var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); + if (error) + return "location." + error; + } + } + return null; + }; + + /** + * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo + */ + SourceCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo) + return object; + var message = new $root.google.protobuf.SourceCodeInfo(); + if (object.location) { + if (!Array.isArray(object.location)) + throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); + message.location = []; + for (var i = 0; i < object.location.length; ++i) { + if (typeof object.location[i] !== "object") + throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); + message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo + * @static + * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + SourceCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.location = []; + if (message.location && message.location.length) { + object.location = []; + for (var j = 0; j < message.location.length; ++j) + object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); + } + return object; + }; + + /** + * Converts this SourceCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo + * @instance + * @returns {Object.} JSON object + */ + SourceCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + SourceCodeInfo.Location = (function() { + + /** + * Properties of a Location. + * @memberof google.protobuf.SourceCodeInfo + * @interface ILocation + * @property {Array.|null} [path] Location path + * @property {Array.|null} [span] Location span + * @property {string|null} [leadingComments] Location leadingComments + * @property {string|null} [trailingComments] Location trailingComments + * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments + */ + + /** + * Constructs a new Location. + * @memberof google.protobuf.SourceCodeInfo + * @classdesc Represents a Location. + * @implements ILocation + * @constructor + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + */ + function Location(properties) { + this.path = []; + this.span = []; + this.leadingDetachedComments = []; + 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]]; + } + + /** + * Location path. + * @member {Array.} path + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.path = $util.emptyArray; + + /** + * Location span. + * @member {Array.} span + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.span = $util.emptyArray; + + /** + * Location leadingComments. + * @member {string} leadingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingComments = ""; + + /** + * Location trailingComments. + * @member {string} trailingComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.trailingComments = ""; + + /** + * Location leadingDetachedComments. + * @member {Array.} leadingDetachedComments + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + */ + Location.prototype.leadingDetachedComments = $util.emptyArray; + + /** + * Creates a new Location instance using the specified properties. + * @function create + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set + * @returns {google.protobuf.SourceCodeInfo.Location} Location instance + */ + Location.create = function create(properties) { + return new Location(properties); + }; + + /** + * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.span != null && message.span.length) { + writer.uint32(/* id 2, wireType 2 =*/18).fork(); + for (var i = 0; i < message.span.length; ++i) + writer.int32(message.span[i]); + writer.ldelim(); + } + if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); + if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) + writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); + if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); + return writer; + }; + + /** + * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Location.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Location message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.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.google.protobuf.SourceCodeInfo.Location(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + case 2: + if (!(message.span && message.span.length)) + message.span = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.span.push(reader.int32()); + } else + message.span.push(reader.int32()); + break; + case 3: + message.leadingComments = reader.string(); + break; + case 4: + message.trailingComments = reader.string(); + break; + case 6: + if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) + message.leadingDetachedComments = []; + message.leadingDetachedComments.push(reader.string()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Location message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.SourceCodeInfo.Location} Location + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Location.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Location message. + * @function verify + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Location.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.span != null && message.hasOwnProperty("span")) { + if (!Array.isArray(message.span)) + return "span: array expected"; + for (var i = 0; i < message.span.length; ++i) + if (!$util.isInteger(message.span[i])) + return "span: integer[] expected"; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + if (!$util.isString(message.leadingComments)) + return "leadingComments: string expected"; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + if (!$util.isString(message.trailingComments)) + return "trailingComments: string expected"; + if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { + if (!Array.isArray(message.leadingDetachedComments)) + return "leadingDetachedComments: array expected"; + for (var i = 0; i < message.leadingDetachedComments.length; ++i) + if (!$util.isString(message.leadingDetachedComments[i])) + return "leadingDetachedComments: string[] expected"; + } + return null; + }; + + /** + * Creates a Location message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.SourceCodeInfo.Location} Location + */ + Location.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) + return object; + var message = new $root.google.protobuf.SourceCodeInfo.Location(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.span) { + if (!Array.isArray(object.span)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); + message.span = []; + for (var i = 0; i < object.span.length; ++i) + message.span[i] = object.span[i] | 0; + } + if (object.leadingComments != null) + message.leadingComments = String(object.leadingComments); + if (object.trailingComments != null) + message.trailingComments = String(object.trailingComments); + if (object.leadingDetachedComments) { + if (!Array.isArray(object.leadingDetachedComments)) + throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); + message.leadingDetachedComments = []; + for (var i = 0; i < object.leadingDetachedComments.length; ++i) + message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); + } + return message; + }; + + /** + * Creates a plain object from a Location message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.SourceCodeInfo.Location + * @static + * @param {google.protobuf.SourceCodeInfo.Location} message Location + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Location.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.path = []; + object.span = []; + object.leadingDetachedComments = []; + } + if (options.defaults) { + object.leadingComments = ""; + object.trailingComments = ""; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.span && message.span.length) { + object.span = []; + for (var j = 0; j < message.span.length; ++j) + object.span[j] = message.span[j]; + } + if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) + object.leadingComments = message.leadingComments; + if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) + object.trailingComments = message.trailingComments; + if (message.leadingDetachedComments && message.leadingDetachedComments.length) { + object.leadingDetachedComments = []; + for (var j = 0; j < message.leadingDetachedComments.length; ++j) + object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; + } + return object; + }; + + /** + * Converts this Location to JSON. + * @function toJSON + * @memberof google.protobuf.SourceCodeInfo.Location + * @instance + * @returns {Object.} JSON object + */ + Location.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Location; + })(); + + return SourceCodeInfo; + })(); + + protobuf.GeneratedCodeInfo = (function() { + + /** + * Properties of a GeneratedCodeInfo. + * @memberof google.protobuf + * @interface IGeneratedCodeInfo + * @property {Array.|null} [annotation] GeneratedCodeInfo annotation + */ + + /** + * Constructs a new GeneratedCodeInfo. + * @memberof google.protobuf + * @classdesc Represents a GeneratedCodeInfo. + * @implements IGeneratedCodeInfo + * @constructor + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + */ + function GeneratedCodeInfo(properties) { + this.annotation = []; + 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]]; + } + + /** + * GeneratedCodeInfo annotation. + * @member {Array.} annotation + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + */ + GeneratedCodeInfo.prototype.annotation = $util.emptyArray; + + /** + * Creates a new GeneratedCodeInfo instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance + */ + GeneratedCodeInfo.create = function create(properties) { + return new GeneratedCodeInfo(properties); + }; + + /** + * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.annotation != null && message.annotation.length) + for (var i = 0; i < message.annotation.length; ++i) + $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.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.google.protobuf.GeneratedCodeInfo(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.annotation && message.annotation.length)) + message.annotation = []; + message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a GeneratedCodeInfo message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + GeneratedCodeInfo.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.annotation != null && message.hasOwnProperty("annotation")) { + if (!Array.isArray(message.annotation)) + return "annotation: array expected"; + for (var i = 0; i < message.annotation.length; ++i) { + var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); + if (error) + return "annotation." + error; + } + } + return null; + }; + + /** + * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo + */ + GeneratedCodeInfo.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo(); + if (object.annotation) { + if (!Array.isArray(object.annotation)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); + message.annotation = []; + for (var i = 0; i < object.annotation.length; ++i) { + if (typeof object.annotation[i] !== "object") + throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); + message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo + * @static + * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + GeneratedCodeInfo.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.annotation = []; + if (message.annotation && message.annotation.length) { + object.annotation = []; + for (var j = 0; j < message.annotation.length; ++j) + object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); + } + return object; + }; + + /** + * Converts this GeneratedCodeInfo to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo + * @instance + * @returns {Object.} JSON object + */ + GeneratedCodeInfo.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + GeneratedCodeInfo.Annotation = (function() { + + /** + * Properties of an Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @interface IAnnotation + * @property {Array.|null} [path] Annotation path + * @property {string|null} [sourceFile] Annotation sourceFile + * @property {number|null} [begin] Annotation begin + * @property {number|null} [end] Annotation end + */ + + /** + * Constructs a new Annotation. + * @memberof google.protobuf.GeneratedCodeInfo + * @classdesc Represents an Annotation. + * @implements IAnnotation + * @constructor + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + */ + function Annotation(properties) { + this.path = []; + 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]]; + } + + /** + * Annotation path. + * @member {Array.} path + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.path = $util.emptyArray; + + /** + * Annotation sourceFile. + * @member {string} sourceFile + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.sourceFile = ""; + + /** + * Annotation begin. + * @member {number} begin + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.begin = 0; + + /** + * Annotation end. + * @member {number} end + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + */ + Annotation.prototype.end = 0; + + /** + * Creates a new Annotation instance using the specified properties. + * @function create + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance + */ + Annotation.create = function create(properties) { + return new Annotation(properties); + }; + + /** + * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.path != null && message.path.length) { + writer.uint32(/* id 1, wireType 2 =*/10).fork(); + for (var i = 0; i < message.path.length; ++i) + writer.int32(message.path[i]); + writer.ldelim(); + } + if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); + if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) + writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); + if (message.end != null && Object.hasOwnProperty.call(message, "end")) + writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); + return writer; + }; + + /** + * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. + * @function encodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Annotation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Annotation message from the specified reader or buffer. + * @function decode + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.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.google.protobuf.GeneratedCodeInfo.Annotation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.path && message.path.length)) + message.path = []; + if ((tag & 7) === 2) { + var end2 = reader.uint32() + reader.pos; + while (reader.pos < end2) + message.path.push(reader.int32()); + } else + message.path.push(reader.int32()); + break; + case 2: + message.sourceFile = reader.string(); + break; + case 3: + message.begin = reader.int32(); + break; + case 4: + message.end = reader.int32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Annotation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Annotation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Annotation message. + * @function verify + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Annotation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.path != null && message.hasOwnProperty("path")) { + if (!Array.isArray(message.path)) + return "path: array expected"; + for (var i = 0; i < message.path.length; ++i) + if (!$util.isInteger(message.path[i])) + return "path: integer[] expected"; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + if (!$util.isString(message.sourceFile)) + return "sourceFile: string expected"; + if (message.begin != null && message.hasOwnProperty("begin")) + if (!$util.isInteger(message.begin)) + return "begin: integer expected"; + if (message.end != null && message.hasOwnProperty("end")) + if (!$util.isInteger(message.end)) + return "end: integer expected"; + return null; + }; + + /** + * Creates an Annotation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {Object.} object Plain object + * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation + */ + Annotation.fromObject = function fromObject(object) { + if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) + return object; + var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); + if (object.path) { + if (!Array.isArray(object.path)) + throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); + message.path = []; + for (var i = 0; i < object.path.length; ++i) + message.path[i] = object.path[i] | 0; + } + if (object.sourceFile != null) + message.sourceFile = String(object.sourceFile); + if (object.begin != null) + message.begin = object.begin | 0; + if (object.end != null) + message.end = object.end | 0; + return message; + }; + + /** + * Creates a plain object from an Annotation message. Also converts values to other types if specified. + * @function toObject + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @static + * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Annotation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.path = []; + if (options.defaults) { + object.sourceFile = ""; + object.begin = 0; + object.end = 0; + } + if (message.path && message.path.length) { + object.path = []; + for (var j = 0; j < message.path.length; ++j) + object.path[j] = message.path[j]; + } + if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) + object.sourceFile = message.sourceFile; + if (message.begin != null && message.hasOwnProperty("begin")) + object.begin = message.begin; + if (message.end != null && message.hasOwnProperty("end")) + object.end = message.end; + return object; + }; + + /** + * Converts this Annotation to JSON. + * @function toJSON + * @memberof google.protobuf.GeneratedCodeInfo.Annotation + * @instance + * @returns {Object.} JSON object + */ + Annotation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Annotation; + })(); + + return GeneratedCodeInfo; + })(); + + return protobuf; + })(); + + return google; +})(); + $root.types = (function() { /** diff --git a/packages/xchain-thorchain/genMsgs.sh b/packages/xchain-thorchain/genMsgs.sh index 89340c6ae..802dacb43 100755 --- a/packages/xchain-thorchain/genMsgs.sh +++ b/packages/xchain-thorchain/genMsgs.sh @@ -1,53 +1,113 @@ #!/bin/bash # This script updates THORChain Protobuf bindings for MsgDeposit and MsgSend +set -e # Exit on any error MSG_COMPILED_OUTPUTFILE=src/types/proto/MsgCompiled.js MSG_COMPILED_TYPES_OUTPUTFILE=src/types/proto/MsgCompiled.d.ts TMP_DIR=$(mktemp -d) +# Cleanup function +cleanup() { + if [ -d "$TMP_DIR" ]; then + tput setaf 2 + echo "Cleaning up $TMP_DIR" + tput sgr0 + rm -rf "$TMP_DIR" + fi +} +trap cleanup EXIT + tput setaf 2 echo "Checking out https://gitlab.com/thorchain/thornode to $TMP_DIR" tput sgr0 -(cd "$TMP_DIR" && git clone --branch develop https://gitlab.com/thorchain/thornode) +if ! (cd "$TMP_DIR" && git clone --branch develop https://gitlab.com/thorchain/thornode); then + echo "Error: Failed to clone thornode repository" + exit 1 +fi # Verify proto files exist tput setaf 2 echo "Checking proto files" tput sgr0 -ls "$TMP_DIR/thornode/proto/thorchain/v1/common/common.proto" || echo "common.proto missing" -ls "$TMP_DIR/thornode/proto/thorchain/v1/types/msg_deposit.proto" || echo "msg_deposit.proto missing" -ls "$TMP_DIR/thornode/proto/thorchain/v1/types/msg_send.proto" || echo "msg_send.proto missing" +MISSING_FILES=0 +for proto_file in \ + "$TMP_DIR/thornode/proto/thorchain/v1/common/common.proto" \ + "$TMP_DIR/thornode/proto/thorchain/v1/types/msg_deposit.proto" \ + "$TMP_DIR/thornode/proto/thorchain/v1/types/msg_send.proto"; do + if [ ! -f "$proto_file" ]; then + echo "Error: $(basename "$proto_file") missing" + MISSING_FILES=1 + else + echo "✓ $(basename "$proto_file") found" + fi +done -# Download cosmos/base/v1beta1/coin.proto from cosmossdk -tput setaf 2 -echo "Downloading cosmos/base/v1beta1/coin.proto from cosmossdk" -tput sgr0 -mkdir -p "$TMP_DIR/thornode/third_party/proto/cosmos/base/v1beta1" -curl -o "$TMP_DIR/thornode/third_party/proto/cosmos/base/v1beta1/coin.proto" \ - "https://raw.githubusercontent.com/cosmos/cosmos-sdk/main/proto/cosmos/base/v1beta1/coin.proto" +if [ $MISSING_FILES -eq 1 ]; then + echo "Error: Required proto files are missing" + exit 1 +fi + +# Download cosmos/base/v1beta1/coin.proto from cosmossdk if not exists +COSMOS_COIN_PROTO="$TMP_DIR/thornode/third_party/proto/cosmos/base/v1beta1/coin.proto" +if [ ! -f "$COSMOS_COIN_PROTO" ]; then + tput setaf 2 + echo "Downloading cosmos/base/v1beta1/coin.proto from cosmossdk" + tput sgr0 + mkdir -p "$TMP_DIR/thornode/third_party/proto/cosmos/base/v1beta1" + if ! curl -f -o "$COSMOS_COIN_PROTO" \ + "https://raw.githubusercontent.com/cosmos/cosmos-sdk/main/proto/cosmos/base/v1beta1/coin.proto"; then + echo "Error: Failed to download cosmos coin.proto" + exit 1 + fi + echo "✓ Downloaded cosmos coin.proto" +else + echo "✓ cosmos coin.proto already exists" +fi # Generate Protobuf JS bindings with include path tput setaf 2 echo "Generating $MSG_COMPILED_OUTPUTFILE" tput sgr0 -yarn pbjs -w commonjs -t static-module \ +if ! yarn pbjs -w commonjs -t static-module \ -p "$TMP_DIR/thornode/proto" \ -p "$TMP_DIR/thornode/third_party/proto" \ "$TMP_DIR/thornode/proto/thorchain/v1/common/common.proto" \ "$TMP_DIR/thornode/proto/thorchain/v1/types/msg_deposit.proto" \ "$TMP_DIR/thornode/proto/thorchain/v1/types/msg_send.proto" \ "$TMP_DIR/thornode/third_party/proto/cosmos/base/v1beta1/coin.proto" \ - -o "$MSG_COMPILED_OUTPUTFILE" 2>pbjs_errors.txt + -o "$MSG_COMPILED_OUTPUTFILE" 2>pbjs_errors.txt; then + echo "Error: Failed to generate JavaScript bindings" + cat pbjs_errors.txt + exit 1 +fi # Generate TypeScript definitions with explicit namespace tput setaf 2 echo "Generating $MSG_COMPILED_TYPES_OUTPUTFILE" tput sgr0 -yarn pbts --name types "$MSG_COMPILED_OUTPUTFILE" -o "$MSG_COMPILED_TYPES_OUTPUTFILE" 2>pbts_errors.txt +if ! yarn pbts --name types "$MSG_COMPILED_OUTPUTFILE" -o "$MSG_COMPILED_TYPES_OUTPUTFILE" 2>pbts_errors.txt; then + echo "Error: Failed to generate TypeScript definitions" + cat pbts_errors.txt + exit 1 +fi + +# Verify generated files +if [ ! -f "$MSG_COMPILED_OUTPUTFILE" ] || [ ! -s "$MSG_COMPILED_OUTPUTFILE" ]; then + echo "Error: Generated JavaScript file is missing or empty" + exit 1 +fi + +if [ ! -f "$MSG_COMPILED_TYPES_OUTPUTFILE" ] || [ ! -s "$MSG_COMPILED_TYPES_OUTPUTFILE" ]; then + echo "Error: Generated TypeScript definitions file is missing or empty" + exit 1 +fi + +# Clean up error files if they're empty +[ ! -s pbjs_errors.txt ] && rm -f pbjs_errors.txt +[ ! -s pbts_errors.txt ] && rm -f pbts_errors.txt tput setaf 2 -echo "Removing $TMP_DIR/thornode" +echo "✓ Successfully generated protobuf bindings" tput sgr0 -rm -rf "$TMP_DIR" diff --git a/packages/xchain-thorchain/src/types/proto/MsgCompiled.d.ts b/packages/xchain-thorchain/src/types/proto/MsgCompiled.d.ts index 32353b79a..1b2c65789 100644 --- a/packages/xchain-thorchain/src/types/proto/MsgCompiled.d.ts +++ b/packages/xchain-thorchain/src/types/proto/MsgCompiled.d.ts @@ -636,6 +636,2077 @@ declare namespace types { */ public toJSON(): { [k: string]: any }; } + + /** Status enum. */ + enum Status { + incomplete = 0, + done = 1, + reverted = 2 + } + + /** Properties of an ObservedTx. */ + interface IObservedTx { + + /** ObservedTx tx */ + tx?: (common.ITx|null); + + /** ObservedTx status */ + status?: (common.Status|null); + + /** ObservedTx outHashes */ + outHashes?: (string[]|null); + + /** ObservedTx blockHeight */ + blockHeight?: (number|Long|null); + + /** ObservedTx signers */ + signers?: (string[]|null); + + /** ObservedTx observedPubKey */ + observedPubKey?: (string|null); + + /** ObservedTx keysignMs */ + keysignMs?: (number|Long|null); + + /** ObservedTx finaliseHeight */ + finaliseHeight?: (number|Long|null); + + /** ObservedTx aggregator */ + aggregator?: (string|null); + + /** ObservedTx aggregatorTarget */ + aggregatorTarget?: (string|null); + + /** ObservedTx aggregatorTargetLimit */ + aggregatorTargetLimit?: (string|null); + } + + /** Represents an ObservedTx. */ + class ObservedTx implements IObservedTx { + + /** + * Constructs a new ObservedTx. + * @param [properties] Properties to set + */ + constructor(properties?: common.IObservedTx); + + /** ObservedTx tx. */ + public tx?: (common.ITx|null); + + /** ObservedTx status. */ + public status: common.Status; + + /** ObservedTx outHashes. */ + public outHashes: string[]; + + /** ObservedTx blockHeight. */ + public blockHeight: (number|Long); + + /** ObservedTx signers. */ + public signers: string[]; + + /** ObservedTx observedPubKey. */ + public observedPubKey: string; + + /** ObservedTx keysignMs. */ + public keysignMs: (number|Long); + + /** ObservedTx finaliseHeight. */ + public finaliseHeight: (number|Long); + + /** ObservedTx aggregator. */ + public aggregator: string; + + /** ObservedTx aggregatorTarget. */ + public aggregatorTarget: string; + + /** ObservedTx aggregatorTargetLimit. */ + public aggregatorTargetLimit: string; + + /** + * Creates a new ObservedTx instance using the specified properties. + * @param [properties] Properties to set + * @returns ObservedTx instance + */ + public static create(properties?: common.IObservedTx): common.ObservedTx; + + /** + * Encodes the specified ObservedTx message. Does not implicitly {@link common.ObservedTx.verify|verify} messages. + * @param message ObservedTx message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: common.IObservedTx, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ObservedTx message, length delimited. Does not implicitly {@link common.ObservedTx.verify|verify} messages. + * @param message ObservedTx message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: common.IObservedTx, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ObservedTx message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ObservedTx + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.ObservedTx; + + /** + * Decodes an ObservedTx message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ObservedTx + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.ObservedTx; + + /** + * Verifies an ObservedTx message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ObservedTx message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ObservedTx + */ + public static fromObject(object: { [k: string]: any }): common.ObservedTx; + + /** + * Creates a plain object from an ObservedTx message. Also converts values to other types if specified. + * @param message ObservedTx + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: common.ObservedTx, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ObservedTx to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an Attestation. */ + interface IAttestation { + + /** Attestation PubKey */ + PubKey?: (Uint8Array|null); + + /** Attestation Signature */ + Signature?: (Uint8Array|null); + } + + /** Represents an Attestation. */ + class Attestation implements IAttestation { + + /** + * Constructs a new Attestation. + * @param [properties] Properties to set + */ + constructor(properties?: common.IAttestation); + + /** Attestation PubKey. */ + public PubKey: Uint8Array; + + /** Attestation Signature. */ + public Signature: Uint8Array; + + /** + * Creates a new Attestation instance using the specified properties. + * @param [properties] Properties to set + * @returns Attestation instance + */ + public static create(properties?: common.IAttestation): common.Attestation; + + /** + * Encodes the specified Attestation message. Does not implicitly {@link common.Attestation.verify|verify} messages. + * @param message Attestation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: common.IAttestation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Attestation message, length delimited. Does not implicitly {@link common.Attestation.verify|verify} messages. + * @param message Attestation message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: common.IAttestation, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Attestation message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Attestation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.Attestation; + + /** + * Decodes an Attestation message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Attestation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.Attestation; + + /** + * Verifies an Attestation message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Attestation message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Attestation + */ + public static fromObject(object: { [k: string]: any }): common.Attestation; + + /** + * Creates a plain object from an Attestation message. Also converts values to other types if specified. + * @param message Attestation + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: common.Attestation, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Attestation to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AttestTx. */ + interface IAttestTx { + + /** AttestTx obsTx */ + obsTx?: (common.IObservedTx|null); + + /** AttestTx attestation */ + attestation?: (common.IAttestation|null); + + /** AttestTx inbound */ + inbound?: (boolean|null); + + /** AttestTx allowFutureObservation */ + allowFutureObservation?: (boolean|null); + } + + /** Represents an AttestTx. */ + class AttestTx implements IAttestTx { + + /** + * Constructs a new AttestTx. + * @param [properties] Properties to set + */ + constructor(properties?: common.IAttestTx); + + /** AttestTx obsTx. */ + public obsTx?: (common.IObservedTx|null); + + /** AttestTx attestation. */ + public attestation?: (common.IAttestation|null); + + /** AttestTx inbound. */ + public inbound: boolean; + + /** AttestTx allowFutureObservation. */ + public allowFutureObservation: boolean; + + /** + * Creates a new AttestTx instance using the specified properties. + * @param [properties] Properties to set + * @returns AttestTx instance + */ + public static create(properties?: common.IAttestTx): common.AttestTx; + + /** + * Encodes the specified AttestTx message. Does not implicitly {@link common.AttestTx.verify|verify} messages. + * @param message AttestTx message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: common.IAttestTx, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AttestTx message, length delimited. Does not implicitly {@link common.AttestTx.verify|verify} messages. + * @param message AttestTx message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: common.IAttestTx, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AttestTx message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AttestTx + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.AttestTx; + + /** + * Decodes an AttestTx message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AttestTx + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.AttestTx; + + /** + * Verifies an AttestTx message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AttestTx message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AttestTx + */ + public static fromObject(object: { [k: string]: any }): common.AttestTx; + + /** + * Creates a plain object from an AttestTx message. Also converts values to other types if specified. + * @param message AttestTx + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: common.AttestTx, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AttestTx to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a QuorumTx. */ + interface IQuorumTx { + + /** QuorumTx obsTx */ + obsTx?: (common.IObservedTx|null); + + /** QuorumTx attestations */ + attestations?: (common.IAttestation[]|null); + + /** QuorumTx inbound */ + inbound?: (boolean|null); + + /** QuorumTx allowFutureObservation */ + allowFutureObservation?: (boolean|null); + } + + /** Represents a QuorumTx. */ + class QuorumTx implements IQuorumTx { + + /** + * Constructs a new QuorumTx. + * @param [properties] Properties to set + */ + constructor(properties?: common.IQuorumTx); + + /** QuorumTx obsTx. */ + public obsTx?: (common.IObservedTx|null); + + /** QuorumTx attestations. */ + public attestations: common.IAttestation[]; + + /** QuorumTx inbound. */ + public inbound: boolean; + + /** QuorumTx allowFutureObservation. */ + public allowFutureObservation: boolean; + + /** + * Creates a new QuorumTx instance using the specified properties. + * @param [properties] Properties to set + * @returns QuorumTx instance + */ + public static create(properties?: common.IQuorumTx): common.QuorumTx; + + /** + * Encodes the specified QuorumTx message. Does not implicitly {@link common.QuorumTx.verify|verify} messages. + * @param message QuorumTx message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: common.IQuorumTx, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QuorumTx message, length delimited. Does not implicitly {@link common.QuorumTx.verify|verify} messages. + * @param message QuorumTx message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: common.IQuorumTx, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QuorumTx message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QuorumTx + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.QuorumTx; + + /** + * Decodes a QuorumTx message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QuorumTx + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.QuorumTx; + + /** + * Verifies a QuorumTx message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QuorumTx message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QuorumTx + */ + public static fromObject(object: { [k: string]: any }): common.QuorumTx; + + /** + * Creates a plain object from a QuorumTx message. Also converts values to other types if specified. + * @param message QuorumTx + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: common.QuorumTx, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QuorumTx to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a QuorumState. */ + interface IQuorumState { + + /** QuorumState quoTxs */ + quoTxs?: (common.IQuorumTx[]|null); + + /** QuorumState quoNetworkFees */ + quoNetworkFees?: (common.IQuorumNetworkFee[]|null); + + /** QuorumState quoSolvencies */ + quoSolvencies?: (common.IQuorumSolvency[]|null); + + /** QuorumState quoErrataTxs */ + quoErrataTxs?: (common.IQuorumErrataTx[]|null); + + /** QuorumState quoPriceFeeds */ + quoPriceFeeds?: (common.IQuorumPriceFeed[]|null); + } + + /** Represents a QuorumState. */ + class QuorumState implements IQuorumState { + + /** + * Constructs a new QuorumState. + * @param [properties] Properties to set + */ + constructor(properties?: common.IQuorumState); + + /** QuorumState quoTxs. */ + public quoTxs: common.IQuorumTx[]; + + /** QuorumState quoNetworkFees. */ + public quoNetworkFees: common.IQuorumNetworkFee[]; + + /** QuorumState quoSolvencies. */ + public quoSolvencies: common.IQuorumSolvency[]; + + /** QuorumState quoErrataTxs. */ + public quoErrataTxs: common.IQuorumErrataTx[]; + + /** QuorumState quoPriceFeeds. */ + public quoPriceFeeds: common.IQuorumPriceFeed[]; + + /** + * Creates a new QuorumState instance using the specified properties. + * @param [properties] Properties to set + * @returns QuorumState instance + */ + public static create(properties?: common.IQuorumState): common.QuorumState; + + /** + * Encodes the specified QuorumState message. Does not implicitly {@link common.QuorumState.verify|verify} messages. + * @param message QuorumState message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: common.IQuorumState, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QuorumState message, length delimited. Does not implicitly {@link common.QuorumState.verify|verify} messages. + * @param message QuorumState message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: common.IQuorumState, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QuorumState message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QuorumState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.QuorumState; + + /** + * Decodes a QuorumState message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QuorumState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.QuorumState; + + /** + * Verifies a QuorumState message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QuorumState message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QuorumState + */ + public static fromObject(object: { [k: string]: any }): common.QuorumState; + + /** + * Creates a plain object from a QuorumState message. Also converts values to other types if specified. + * @param message QuorumState + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: common.QuorumState, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QuorumState to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a NetworkFee. */ + interface INetworkFee { + + /** NetworkFee height */ + height?: (number|Long|null); + + /** NetworkFee chain */ + chain?: (string|null); + + /** NetworkFee transactionSize */ + transactionSize?: (number|Long|null); + + /** NetworkFee transactionRate */ + transactionRate?: (number|Long|null); + } + + /** Represents a NetworkFee. */ + class NetworkFee implements INetworkFee { + + /** + * Constructs a new NetworkFee. + * @param [properties] Properties to set + */ + constructor(properties?: common.INetworkFee); + + /** NetworkFee height. */ + public height: (number|Long); + + /** NetworkFee chain. */ + public chain: string; + + /** NetworkFee transactionSize. */ + public transactionSize: (number|Long); + + /** NetworkFee transactionRate. */ + public transactionRate: (number|Long); + + /** + * Creates a new NetworkFee instance using the specified properties. + * @param [properties] Properties to set + * @returns NetworkFee instance + */ + public static create(properties?: common.INetworkFee): common.NetworkFee; + + /** + * Encodes the specified NetworkFee message. Does not implicitly {@link common.NetworkFee.verify|verify} messages. + * @param message NetworkFee message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: common.INetworkFee, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified NetworkFee message, length delimited. Does not implicitly {@link common.NetworkFee.verify|verify} messages. + * @param message NetworkFee message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: common.INetworkFee, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a NetworkFee message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns NetworkFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.NetworkFee; + + /** + * Decodes a NetworkFee message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns NetworkFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.NetworkFee; + + /** + * Verifies a NetworkFee message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a NetworkFee message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns NetworkFee + */ + public static fromObject(object: { [k: string]: any }): common.NetworkFee; + + /** + * Creates a plain object from a NetworkFee message. Also converts values to other types if specified. + * @param message NetworkFee + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: common.NetworkFee, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this NetworkFee to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AttestNetworkFee. */ + interface IAttestNetworkFee { + + /** AttestNetworkFee networkFee */ + networkFee?: (common.INetworkFee|null); + + /** AttestNetworkFee attestation */ + attestation?: (common.IAttestation|null); + } + + /** Represents an AttestNetworkFee. */ + class AttestNetworkFee implements IAttestNetworkFee { + + /** + * Constructs a new AttestNetworkFee. + * @param [properties] Properties to set + */ + constructor(properties?: common.IAttestNetworkFee); + + /** AttestNetworkFee networkFee. */ + public networkFee?: (common.INetworkFee|null); + + /** AttestNetworkFee attestation. */ + public attestation?: (common.IAttestation|null); + + /** + * Creates a new AttestNetworkFee instance using the specified properties. + * @param [properties] Properties to set + * @returns AttestNetworkFee instance + */ + public static create(properties?: common.IAttestNetworkFee): common.AttestNetworkFee; + + /** + * Encodes the specified AttestNetworkFee message. Does not implicitly {@link common.AttestNetworkFee.verify|verify} messages. + * @param message AttestNetworkFee message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: common.IAttestNetworkFee, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AttestNetworkFee message, length delimited. Does not implicitly {@link common.AttestNetworkFee.verify|verify} messages. + * @param message AttestNetworkFee message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: common.IAttestNetworkFee, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AttestNetworkFee message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AttestNetworkFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.AttestNetworkFee; + + /** + * Decodes an AttestNetworkFee message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AttestNetworkFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.AttestNetworkFee; + + /** + * Verifies an AttestNetworkFee message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AttestNetworkFee message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AttestNetworkFee + */ + public static fromObject(object: { [k: string]: any }): common.AttestNetworkFee; + + /** + * Creates a plain object from an AttestNetworkFee message. Also converts values to other types if specified. + * @param message AttestNetworkFee + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: common.AttestNetworkFee, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AttestNetworkFee to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a QuorumNetworkFee. */ + interface IQuorumNetworkFee { + + /** QuorumNetworkFee networkFee */ + networkFee?: (common.INetworkFee|null); + + /** QuorumNetworkFee attestations */ + attestations?: (common.IAttestation[]|null); + } + + /** Represents a QuorumNetworkFee. */ + class QuorumNetworkFee implements IQuorumNetworkFee { + + /** + * Constructs a new QuorumNetworkFee. + * @param [properties] Properties to set + */ + constructor(properties?: common.IQuorumNetworkFee); + + /** QuorumNetworkFee networkFee. */ + public networkFee?: (common.INetworkFee|null); + + /** QuorumNetworkFee attestations. */ + public attestations: common.IAttestation[]; + + /** + * Creates a new QuorumNetworkFee instance using the specified properties. + * @param [properties] Properties to set + * @returns QuorumNetworkFee instance + */ + public static create(properties?: common.IQuorumNetworkFee): common.QuorumNetworkFee; + + /** + * Encodes the specified QuorumNetworkFee message. Does not implicitly {@link common.QuorumNetworkFee.verify|verify} messages. + * @param message QuorumNetworkFee message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: common.IQuorumNetworkFee, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QuorumNetworkFee message, length delimited. Does not implicitly {@link common.QuorumNetworkFee.verify|verify} messages. + * @param message QuorumNetworkFee message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: common.IQuorumNetworkFee, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QuorumNetworkFee message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QuorumNetworkFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.QuorumNetworkFee; + + /** + * Decodes a QuorumNetworkFee message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QuorumNetworkFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.QuorumNetworkFee; + + /** + * Verifies a QuorumNetworkFee message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QuorumNetworkFee message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QuorumNetworkFee + */ + public static fromObject(object: { [k: string]: any }): common.QuorumNetworkFee; + + /** + * Creates a plain object from a QuorumNetworkFee message. Also converts values to other types if specified. + * @param message QuorumNetworkFee + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: common.QuorumNetworkFee, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QuorumNetworkFee to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a Solvency. */ + interface ISolvency { + + /** Solvency id */ + id?: (string|null); + + /** Solvency chain */ + chain?: (string|null); + + /** Solvency pubKey */ + pubKey?: (string|null); + + /** Solvency coins */ + coins?: (common.ICoin[]|null); + + /** Solvency height */ + height?: (number|Long|null); + } + + /** Represents a Solvency. */ + class Solvency implements ISolvency { + + /** + * Constructs a new Solvency. + * @param [properties] Properties to set + */ + constructor(properties?: common.ISolvency); + + /** Solvency id. */ + public id: string; + + /** Solvency chain. */ + public chain: string; + + /** Solvency pubKey. */ + public pubKey: string; + + /** Solvency coins. */ + public coins: common.ICoin[]; + + /** Solvency height. */ + public height: (number|Long); + + /** + * Creates a new Solvency instance using the specified properties. + * @param [properties] Properties to set + * @returns Solvency instance + */ + public static create(properties?: common.ISolvency): common.Solvency; + + /** + * Encodes the specified Solvency message. Does not implicitly {@link common.Solvency.verify|verify} messages. + * @param message Solvency message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: common.ISolvency, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Solvency message, length delimited. Does not implicitly {@link common.Solvency.verify|verify} messages. + * @param message Solvency message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: common.ISolvency, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Solvency message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Solvency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.Solvency; + + /** + * Decodes a Solvency message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Solvency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.Solvency; + + /** + * Verifies a Solvency message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Solvency message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Solvency + */ + public static fromObject(object: { [k: string]: any }): common.Solvency; + + /** + * Creates a plain object from a Solvency message. Also converts values to other types if specified. + * @param message Solvency + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: common.Solvency, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Solvency to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AttestSolvency. */ + interface IAttestSolvency { + + /** AttestSolvency solvency */ + solvency?: (common.ISolvency|null); + + /** AttestSolvency attestation */ + attestation?: (common.IAttestation|null); + } + + /** Represents an AttestSolvency. */ + class AttestSolvency implements IAttestSolvency { + + /** + * Constructs a new AttestSolvency. + * @param [properties] Properties to set + */ + constructor(properties?: common.IAttestSolvency); + + /** AttestSolvency solvency. */ + public solvency?: (common.ISolvency|null); + + /** AttestSolvency attestation. */ + public attestation?: (common.IAttestation|null); + + /** + * Creates a new AttestSolvency instance using the specified properties. + * @param [properties] Properties to set + * @returns AttestSolvency instance + */ + public static create(properties?: common.IAttestSolvency): common.AttestSolvency; + + /** + * Encodes the specified AttestSolvency message. Does not implicitly {@link common.AttestSolvency.verify|verify} messages. + * @param message AttestSolvency message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: common.IAttestSolvency, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AttestSolvency message, length delimited. Does not implicitly {@link common.AttestSolvency.verify|verify} messages. + * @param message AttestSolvency message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: common.IAttestSolvency, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AttestSolvency message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AttestSolvency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.AttestSolvency; + + /** + * Decodes an AttestSolvency message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AttestSolvency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.AttestSolvency; + + /** + * Verifies an AttestSolvency message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AttestSolvency message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AttestSolvency + */ + public static fromObject(object: { [k: string]: any }): common.AttestSolvency; + + /** + * Creates a plain object from an AttestSolvency message. Also converts values to other types if specified. + * @param message AttestSolvency + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: common.AttestSolvency, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AttestSolvency to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a QuorumSolvency. */ + interface IQuorumSolvency { + + /** QuorumSolvency solvency */ + solvency?: (common.ISolvency|null); + + /** QuorumSolvency attestations */ + attestations?: (common.IAttestation[]|null); + } + + /** Represents a QuorumSolvency. */ + class QuorumSolvency implements IQuorumSolvency { + + /** + * Constructs a new QuorumSolvency. + * @param [properties] Properties to set + */ + constructor(properties?: common.IQuorumSolvency); + + /** QuorumSolvency solvency. */ + public solvency?: (common.ISolvency|null); + + /** QuorumSolvency attestations. */ + public attestations: common.IAttestation[]; + + /** + * Creates a new QuorumSolvency instance using the specified properties. + * @param [properties] Properties to set + * @returns QuorumSolvency instance + */ + public static create(properties?: common.IQuorumSolvency): common.QuorumSolvency; + + /** + * Encodes the specified QuorumSolvency message. Does not implicitly {@link common.QuorumSolvency.verify|verify} messages. + * @param message QuorumSolvency message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: common.IQuorumSolvency, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QuorumSolvency message, length delimited. Does not implicitly {@link common.QuorumSolvency.verify|verify} messages. + * @param message QuorumSolvency message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: common.IQuorumSolvency, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QuorumSolvency message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QuorumSolvency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.QuorumSolvency; + + /** + * Decodes a QuorumSolvency message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QuorumSolvency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.QuorumSolvency; + + /** + * Verifies a QuorumSolvency message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QuorumSolvency message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QuorumSolvency + */ + public static fromObject(object: { [k: string]: any }): common.QuorumSolvency; + + /** + * Creates a plain object from a QuorumSolvency message. Also converts values to other types if specified. + * @param message QuorumSolvency + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: common.QuorumSolvency, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QuorumSolvency to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an ErrataTx. */ + interface IErrataTx { + + /** ErrataTx id */ + id?: (string|null); + + /** ErrataTx chain */ + chain?: (string|null); + } + + /** Represents an ErrataTx. */ + class ErrataTx implements IErrataTx { + + /** + * Constructs a new ErrataTx. + * @param [properties] Properties to set + */ + constructor(properties?: common.IErrataTx); + + /** ErrataTx id. */ + public id: string; + + /** ErrataTx chain. */ + public chain: string; + + /** + * Creates a new ErrataTx instance using the specified properties. + * @param [properties] Properties to set + * @returns ErrataTx instance + */ + public static create(properties?: common.IErrataTx): common.ErrataTx; + + /** + * Encodes the specified ErrataTx message. Does not implicitly {@link common.ErrataTx.verify|verify} messages. + * @param message ErrataTx message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: common.IErrataTx, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ErrataTx message, length delimited. Does not implicitly {@link common.ErrataTx.verify|verify} messages. + * @param message ErrataTx message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: common.IErrataTx, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an ErrataTx message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ErrataTx + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.ErrataTx; + + /** + * Decodes an ErrataTx message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ErrataTx + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.ErrataTx; + + /** + * Verifies an ErrataTx message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an ErrataTx message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ErrataTx + */ + public static fromObject(object: { [k: string]: any }): common.ErrataTx; + + /** + * Creates a plain object from an ErrataTx message. Also converts values to other types if specified. + * @param message ErrataTx + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: common.ErrataTx, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ErrataTx to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AttestErrataTx. */ + interface IAttestErrataTx { + + /** AttestErrataTx errataTx */ + errataTx?: (common.IErrataTx|null); + + /** AttestErrataTx attestation */ + attestation?: (common.IAttestation|null); + } + + /** Represents an AttestErrataTx. */ + class AttestErrataTx implements IAttestErrataTx { + + /** + * Constructs a new AttestErrataTx. + * @param [properties] Properties to set + */ + constructor(properties?: common.IAttestErrataTx); + + /** AttestErrataTx errataTx. */ + public errataTx?: (common.IErrataTx|null); + + /** AttestErrataTx attestation. */ + public attestation?: (common.IAttestation|null); + + /** + * Creates a new AttestErrataTx instance using the specified properties. + * @param [properties] Properties to set + * @returns AttestErrataTx instance + */ + public static create(properties?: common.IAttestErrataTx): common.AttestErrataTx; + + /** + * Encodes the specified AttestErrataTx message. Does not implicitly {@link common.AttestErrataTx.verify|verify} messages. + * @param message AttestErrataTx message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: common.IAttestErrataTx, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AttestErrataTx message, length delimited. Does not implicitly {@link common.AttestErrataTx.verify|verify} messages. + * @param message AttestErrataTx message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: common.IAttestErrataTx, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AttestErrataTx message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AttestErrataTx + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.AttestErrataTx; + + /** + * Decodes an AttestErrataTx message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AttestErrataTx + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.AttestErrataTx; + + /** + * Verifies an AttestErrataTx message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AttestErrataTx message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AttestErrataTx + */ + public static fromObject(object: { [k: string]: any }): common.AttestErrataTx; + + /** + * Creates a plain object from an AttestErrataTx message. Also converts values to other types if specified. + * @param message AttestErrataTx + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: common.AttestErrataTx, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AttestErrataTx to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a QuorumErrataTx. */ + interface IQuorumErrataTx { + + /** QuorumErrataTx errataTx */ + errataTx?: (common.IErrataTx|null); + + /** QuorumErrataTx attestations */ + attestations?: (common.IAttestation[]|null); + } + + /** Represents a QuorumErrataTx. */ + class QuorumErrataTx implements IQuorumErrataTx { + + /** + * Constructs a new QuorumErrataTx. + * @param [properties] Properties to set + */ + constructor(properties?: common.IQuorumErrataTx); + + /** QuorumErrataTx errataTx. */ + public errataTx?: (common.IErrataTx|null); + + /** QuorumErrataTx attestations. */ + public attestations: common.IAttestation[]; + + /** + * Creates a new QuorumErrataTx instance using the specified properties. + * @param [properties] Properties to set + * @returns QuorumErrataTx instance + */ + public static create(properties?: common.IQuorumErrataTx): common.QuorumErrataTx; + + /** + * Encodes the specified QuorumErrataTx message. Does not implicitly {@link common.QuorumErrataTx.verify|verify} messages. + * @param message QuorumErrataTx message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: common.IQuorumErrataTx, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QuorumErrataTx message, length delimited. Does not implicitly {@link common.QuorumErrataTx.verify|verify} messages. + * @param message QuorumErrataTx message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: common.IQuorumErrataTx, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QuorumErrataTx message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QuorumErrataTx + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.QuorumErrataTx; + + /** + * Decodes a QuorumErrataTx message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QuorumErrataTx + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.QuorumErrataTx; + + /** + * Verifies a QuorumErrataTx message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QuorumErrataTx message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QuorumErrataTx + */ + public static fromObject(object: { [k: string]: any }): common.QuorumErrataTx; + + /** + * Creates a plain object from a QuorumErrataTx message. Also converts values to other types if specified. + * @param message QuorumErrataTx + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: common.QuorumErrataTx, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QuorumErrataTx to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a PriceFeed. */ + interface IPriceFeed { + + /** PriceFeed version */ + version?: (Uint8Array|null); + + /** PriceFeed time */ + time?: (number|Long|null); + + /** PriceFeed rates */ + rates?: (common.IOraclePrice[]|null); + } + + /** Represents a PriceFeed. */ + class PriceFeed implements IPriceFeed { + + /** + * Constructs a new PriceFeed. + * @param [properties] Properties to set + */ + constructor(properties?: common.IPriceFeed); + + /** PriceFeed version. */ + public version: Uint8Array; + + /** PriceFeed time. */ + public time: (number|Long); + + /** PriceFeed rates. */ + public rates: common.IOraclePrice[]; + + /** + * Creates a new PriceFeed instance using the specified properties. + * @param [properties] Properties to set + * @returns PriceFeed instance + */ + public static create(properties?: common.IPriceFeed): common.PriceFeed; + + /** + * Encodes the specified PriceFeed message. Does not implicitly {@link common.PriceFeed.verify|verify} messages. + * @param message PriceFeed message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: common.IPriceFeed, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PriceFeed message, length delimited. Does not implicitly {@link common.PriceFeed.verify|verify} messages. + * @param message PriceFeed message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: common.IPriceFeed, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PriceFeed message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PriceFeed + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.PriceFeed; + + /** + * Decodes a PriceFeed message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PriceFeed + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.PriceFeed; + + /** + * Verifies a PriceFeed message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PriceFeed message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PriceFeed + */ + public static fromObject(object: { [k: string]: any }): common.PriceFeed; + + /** + * Creates a plain object from a PriceFeed message. Also converts values to other types if specified. + * @param message PriceFeed + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: common.PriceFeed, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PriceFeed to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AttestPriceFeed. */ + interface IAttestPriceFeed { + + /** AttestPriceFeed priceFeed */ + priceFeed?: (common.IPriceFeed|null); + + /** AttestPriceFeed attestation */ + attestation?: (common.IAttestation|null); + } + + /** Represents an AttestPriceFeed. */ + class AttestPriceFeed implements IAttestPriceFeed { + + /** + * Constructs a new AttestPriceFeed. + * @param [properties] Properties to set + */ + constructor(properties?: common.IAttestPriceFeed); + + /** AttestPriceFeed priceFeed. */ + public priceFeed?: (common.IPriceFeed|null); + + /** AttestPriceFeed attestation. */ + public attestation?: (common.IAttestation|null); + + /** + * Creates a new AttestPriceFeed instance using the specified properties. + * @param [properties] Properties to set + * @returns AttestPriceFeed instance + */ + public static create(properties?: common.IAttestPriceFeed): common.AttestPriceFeed; + + /** + * Encodes the specified AttestPriceFeed message. Does not implicitly {@link common.AttestPriceFeed.verify|verify} messages. + * @param message AttestPriceFeed message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: common.IAttestPriceFeed, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AttestPriceFeed message, length delimited. Does not implicitly {@link common.AttestPriceFeed.verify|verify} messages. + * @param message AttestPriceFeed message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: common.IAttestPriceFeed, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AttestPriceFeed message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AttestPriceFeed + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.AttestPriceFeed; + + /** + * Decodes an AttestPriceFeed message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AttestPriceFeed + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.AttestPriceFeed; + + /** + * Verifies an AttestPriceFeed message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AttestPriceFeed message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AttestPriceFeed + */ + public static fromObject(object: { [k: string]: any }): common.AttestPriceFeed; + + /** + * Creates a plain object from an AttestPriceFeed message. Also converts values to other types if specified. + * @param message AttestPriceFeed + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: common.AttestPriceFeed, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AttestPriceFeed to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a QuorumPriceFeed. */ + interface IQuorumPriceFeed { + + /** QuorumPriceFeed priceFeed */ + priceFeed?: (common.IPriceFeed|null); + + /** QuorumPriceFeed attestations */ + attestations?: (common.IAttestation[]|null); + } + + /** Represents a QuorumPriceFeed. */ + class QuorumPriceFeed implements IQuorumPriceFeed { + + /** + * Constructs a new QuorumPriceFeed. + * @param [properties] Properties to set + */ + constructor(properties?: common.IQuorumPriceFeed); + + /** QuorumPriceFeed priceFeed. */ + public priceFeed?: (common.IPriceFeed|null); + + /** QuorumPriceFeed attestations. */ + public attestations: common.IAttestation[]; + + /** + * Creates a new QuorumPriceFeed instance using the specified properties. + * @param [properties] Properties to set + * @returns QuorumPriceFeed instance + */ + public static create(properties?: common.IQuorumPriceFeed): common.QuorumPriceFeed; + + /** + * Encodes the specified QuorumPriceFeed message. Does not implicitly {@link common.QuorumPriceFeed.verify|verify} messages. + * @param message QuorumPriceFeed message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: common.IQuorumPriceFeed, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QuorumPriceFeed message, length delimited. Does not implicitly {@link common.QuorumPriceFeed.verify|verify} messages. + * @param message QuorumPriceFeed message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: common.IQuorumPriceFeed, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QuorumPriceFeed message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QuorumPriceFeed + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.QuorumPriceFeed; + + /** + * Decodes a QuorumPriceFeed message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QuorumPriceFeed + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.QuorumPriceFeed; + + /** + * Verifies a QuorumPriceFeed message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QuorumPriceFeed message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QuorumPriceFeed + */ + public static fromObject(object: { [k: string]: any }): common.QuorumPriceFeed; + + /** + * Creates a plain object from a QuorumPriceFeed message. Also converts values to other types if specified. + * @param message QuorumPriceFeed + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: common.QuorumPriceFeed, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QuorumPriceFeed to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of a QuorumPriceFeedBatch. */ + interface IQuorumPriceFeedBatch { + + /** QuorumPriceFeedBatch quorumPriceFeeds */ + quorumPriceFeeds?: (common.IQuorumPriceFeed[]|null); + } + + /** Represents a QuorumPriceFeedBatch. */ + class QuorumPriceFeedBatch implements IQuorumPriceFeedBatch { + + /** + * Constructs a new QuorumPriceFeedBatch. + * @param [properties] Properties to set + */ + constructor(properties?: common.IQuorumPriceFeedBatch); + + /** QuorumPriceFeedBatch quorumPriceFeeds. */ + public quorumPriceFeeds: common.IQuorumPriceFeed[]; + + /** + * Creates a new QuorumPriceFeedBatch instance using the specified properties. + * @param [properties] Properties to set + * @returns QuorumPriceFeedBatch instance + */ + public static create(properties?: common.IQuorumPriceFeedBatch): common.QuorumPriceFeedBatch; + + /** + * Encodes the specified QuorumPriceFeedBatch message. Does not implicitly {@link common.QuorumPriceFeedBatch.verify|verify} messages. + * @param message QuorumPriceFeedBatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: common.IQuorumPriceFeedBatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified QuorumPriceFeedBatch message, length delimited. Does not implicitly {@link common.QuorumPriceFeedBatch.verify|verify} messages. + * @param message QuorumPriceFeedBatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: common.IQuorumPriceFeedBatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a QuorumPriceFeedBatch message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns QuorumPriceFeedBatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.QuorumPriceFeedBatch; + + /** + * Decodes a QuorumPriceFeedBatch message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns QuorumPriceFeedBatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.QuorumPriceFeedBatch; + + /** + * Verifies a QuorumPriceFeedBatch message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a QuorumPriceFeedBatch message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns QuorumPriceFeedBatch + */ + public static fromObject(object: { [k: string]: any }): common.QuorumPriceFeedBatch; + + /** + * Creates a plain object from a QuorumPriceFeedBatch message. Also converts values to other types if specified. + * @param message QuorumPriceFeedBatch + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: common.QuorumPriceFeedBatch, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this QuorumPriceFeedBatch to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an OraclePrice. */ + interface IOraclePrice { + + /** OraclePrice amount */ + amount?: (number|Long|null); + + /** OraclePrice decimals */ + decimals?: (number|null); + } + + /** Represents an OraclePrice. */ + class OraclePrice implements IOraclePrice { + + /** + * Constructs a new OraclePrice. + * @param [properties] Properties to set + */ + constructor(properties?: common.IOraclePrice); + + /** OraclePrice amount. */ + public amount: (number|Long); + + /** OraclePrice decimals. */ + public decimals: number; + + /** + * Creates a new OraclePrice instance using the specified properties. + * @param [properties] Properties to set + * @returns OraclePrice instance + */ + public static create(properties?: common.IOraclePrice): common.OraclePrice; + + /** + * Encodes the specified OraclePrice message. Does not implicitly {@link common.OraclePrice.verify|verify} messages. + * @param message OraclePrice message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: common.IOraclePrice, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified OraclePrice message, length delimited. Does not implicitly {@link common.OraclePrice.verify|verify} messages. + * @param message OraclePrice message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: common.IOraclePrice, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an OraclePrice message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns OraclePrice + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.OraclePrice; + + /** + * Decodes an OraclePrice message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns OraclePrice + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.OraclePrice; + + /** + * Verifies an OraclePrice message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an OraclePrice message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns OraclePrice + */ + public static fromObject(object: { [k: string]: any }): common.OraclePrice; + + /** + * Creates a plain object from an OraclePrice message. Also converts values to other types if specified. + * @param message OraclePrice + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: common.OraclePrice, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this OraclePrice to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + + /** Properties of an AttestationBatch. */ + interface IAttestationBatch { + + /** AttestationBatch attestTxs */ + attestTxs?: (common.IAttestTx[]|null); + + /** AttestationBatch attestNetworkFees */ + attestNetworkFees?: (common.IAttestNetworkFee[]|null); + + /** AttestationBatch attestSolvencies */ + attestSolvencies?: (common.IAttestSolvency[]|null); + + /** AttestationBatch attestErrataTxs */ + attestErrataTxs?: (common.IAttestErrataTx[]|null); + + /** AttestationBatch attestPriceFeeds */ + attestPriceFeeds?: (common.IAttestPriceFeed[]|null); + } + + /** Represents an AttestationBatch. */ + class AttestationBatch implements IAttestationBatch { + + /** + * Constructs a new AttestationBatch. + * @param [properties] Properties to set + */ + constructor(properties?: common.IAttestationBatch); + + /** AttestationBatch attestTxs. */ + public attestTxs: common.IAttestTx[]; + + /** AttestationBatch attestNetworkFees. */ + public attestNetworkFees: common.IAttestNetworkFee[]; + + /** AttestationBatch attestSolvencies. */ + public attestSolvencies: common.IAttestSolvency[]; + + /** AttestationBatch attestErrataTxs. */ + public attestErrataTxs: common.IAttestErrataTx[]; + + /** AttestationBatch attestPriceFeeds. */ + public attestPriceFeeds: common.IAttestPriceFeed[]; + + /** + * Creates a new AttestationBatch instance using the specified properties. + * @param [properties] Properties to set + * @returns AttestationBatch instance + */ + public static create(properties?: common.IAttestationBatch): common.AttestationBatch; + + /** + * Encodes the specified AttestationBatch message. Does not implicitly {@link common.AttestationBatch.verify|verify} messages. + * @param message AttestationBatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: common.IAttestationBatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified AttestationBatch message, length delimited. Does not implicitly {@link common.AttestationBatch.verify|verify} messages. + * @param message AttestationBatch message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: common.IAttestationBatch, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an AttestationBatch message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns AttestationBatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.AttestationBatch; + + /** + * Decodes an AttestationBatch message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns AttestationBatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.AttestationBatch; + + /** + * Verifies an AttestationBatch message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an AttestationBatch message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns AttestationBatch + */ + public static fromObject(object: { [k: string]: any }): common.AttestationBatch; + + /** + * Creates a plain object from an AttestationBatch message. Also converts values to other types if specified. + * @param message AttestationBatch + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: common.AttestationBatch, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this AttestationBatch to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } } /** Namespace types. */ diff --git a/packages/xchain-thorchain/src/types/proto/MsgCompiled.js b/packages/xchain-thorchain/src/types/proto/MsgCompiled.js index b2ebddc85..03f8d7660 100644 --- a/packages/xchain-thorchain/src/types/proto/MsgCompiled.js +++ b/packages/xchain-thorchain/src/types/proto/MsgCompiled.js @@ -1559,6 +1559,5415 @@ $root.common = (function() { return ProtoUint; })(); + /** + * Status enum. + * @name common.Status + * @enum {number} + * @property {number} incomplete=0 incomplete value + * @property {number} done=1 done value + * @property {number} reverted=2 reverted value + */ + common.Status = (function() { + var valuesById = {}, values = Object.create(valuesById); + values[valuesById[0] = "incomplete"] = 0; + values[valuesById[1] = "done"] = 1; + values[valuesById[2] = "reverted"] = 2; + return values; + })(); + + common.ObservedTx = (function() { + + /** + * Properties of an ObservedTx. + * @memberof common + * @interface IObservedTx + * @property {common.ITx|null} [tx] ObservedTx tx + * @property {common.Status|null} [status] ObservedTx status + * @property {Array.|null} [outHashes] ObservedTx outHashes + * @property {number|Long|null} [blockHeight] ObservedTx blockHeight + * @property {Array.|null} [signers] ObservedTx signers + * @property {string|null} [observedPubKey] ObservedTx observedPubKey + * @property {number|Long|null} [keysignMs] ObservedTx keysignMs + * @property {number|Long|null} [finaliseHeight] ObservedTx finaliseHeight + * @property {string|null} [aggregator] ObservedTx aggregator + * @property {string|null} [aggregatorTarget] ObservedTx aggregatorTarget + * @property {string|null} [aggregatorTargetLimit] ObservedTx aggregatorTargetLimit + */ + + /** + * Constructs a new ObservedTx. + * @memberof common + * @classdesc Represents an ObservedTx. + * @implements IObservedTx + * @constructor + * @param {common.IObservedTx=} [properties] Properties to set + */ + function ObservedTx(properties) { + this.outHashes = []; + this.signers = []; + 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]]; + } + + /** + * ObservedTx tx. + * @member {common.ITx|null|undefined} tx + * @memberof common.ObservedTx + * @instance + */ + ObservedTx.prototype.tx = null; + + /** + * ObservedTx status. + * @member {common.Status} status + * @memberof common.ObservedTx + * @instance + */ + ObservedTx.prototype.status = 0; + + /** + * ObservedTx outHashes. + * @member {Array.} outHashes + * @memberof common.ObservedTx + * @instance + */ + ObservedTx.prototype.outHashes = $util.emptyArray; + + /** + * ObservedTx blockHeight. + * @member {number|Long} blockHeight + * @memberof common.ObservedTx + * @instance + */ + ObservedTx.prototype.blockHeight = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ObservedTx signers. + * @member {Array.} signers + * @memberof common.ObservedTx + * @instance + */ + ObservedTx.prototype.signers = $util.emptyArray; + + /** + * ObservedTx observedPubKey. + * @member {string} observedPubKey + * @memberof common.ObservedTx + * @instance + */ + ObservedTx.prototype.observedPubKey = ""; + + /** + * ObservedTx keysignMs. + * @member {number|Long} keysignMs + * @memberof common.ObservedTx + * @instance + */ + ObservedTx.prototype.keysignMs = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ObservedTx finaliseHeight. + * @member {number|Long} finaliseHeight + * @memberof common.ObservedTx + * @instance + */ + ObservedTx.prototype.finaliseHeight = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * ObservedTx aggregator. + * @member {string} aggregator + * @memberof common.ObservedTx + * @instance + */ + ObservedTx.prototype.aggregator = ""; + + /** + * ObservedTx aggregatorTarget. + * @member {string} aggregatorTarget + * @memberof common.ObservedTx + * @instance + */ + ObservedTx.prototype.aggregatorTarget = ""; + + /** + * ObservedTx aggregatorTargetLimit. + * @member {string} aggregatorTargetLimit + * @memberof common.ObservedTx + * @instance + */ + ObservedTx.prototype.aggregatorTargetLimit = ""; + + /** + * Creates a new ObservedTx instance using the specified properties. + * @function create + * @memberof common.ObservedTx + * @static + * @param {common.IObservedTx=} [properties] Properties to set + * @returns {common.ObservedTx} ObservedTx instance + */ + ObservedTx.create = function create(properties) { + return new ObservedTx(properties); + }; + + /** + * Encodes the specified ObservedTx message. Does not implicitly {@link common.ObservedTx.verify|verify} messages. + * @function encode + * @memberof common.ObservedTx + * @static + * @param {common.IObservedTx} message ObservedTx message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ObservedTx.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.tx != null && Object.hasOwnProperty.call(message, "tx")) + $root.common.Tx.encode(message.tx, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.status != null && Object.hasOwnProperty.call(message, "status")) + writer.uint32(/* id 2, wireType 0 =*/16).int32(message.status); + if (message.outHashes != null && message.outHashes.length) + for (var i = 0; i < message.outHashes.length; ++i) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.outHashes[i]); + if (message.blockHeight != null && Object.hasOwnProperty.call(message, "blockHeight")) + writer.uint32(/* id 4, wireType 0 =*/32).int64(message.blockHeight); + if (message.signers != null && message.signers.length) + for (var i = 0; i < message.signers.length; ++i) + writer.uint32(/* id 5, wireType 2 =*/42).string(message.signers[i]); + if (message.observedPubKey != null && Object.hasOwnProperty.call(message, "observedPubKey")) + writer.uint32(/* id 6, wireType 2 =*/50).string(message.observedPubKey); + if (message.keysignMs != null && Object.hasOwnProperty.call(message, "keysignMs")) + writer.uint32(/* id 7, wireType 0 =*/56).int64(message.keysignMs); + if (message.finaliseHeight != null && Object.hasOwnProperty.call(message, "finaliseHeight")) + writer.uint32(/* id 8, wireType 0 =*/64).int64(message.finaliseHeight); + if (message.aggregator != null && Object.hasOwnProperty.call(message, "aggregator")) + writer.uint32(/* id 9, wireType 2 =*/74).string(message.aggregator); + if (message.aggregatorTarget != null && Object.hasOwnProperty.call(message, "aggregatorTarget")) + writer.uint32(/* id 10, wireType 2 =*/82).string(message.aggregatorTarget); + if (message.aggregatorTargetLimit != null && Object.hasOwnProperty.call(message, "aggregatorTargetLimit")) + writer.uint32(/* id 11, wireType 2 =*/90).string(message.aggregatorTargetLimit); + return writer; + }; + + /** + * Encodes the specified ObservedTx message, length delimited. Does not implicitly {@link common.ObservedTx.verify|verify} messages. + * @function encodeDelimited + * @memberof common.ObservedTx + * @static + * @param {common.IObservedTx} message ObservedTx message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ObservedTx.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ObservedTx message from the specified reader or buffer. + * @function decode + * @memberof common.ObservedTx + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {common.ObservedTx} ObservedTx + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ObservedTx.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.common.ObservedTx(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.tx = $root.common.Tx.decode(reader, reader.uint32()); + break; + case 2: + message.status = reader.int32(); + break; + case 3: + if (!(message.outHashes && message.outHashes.length)) + message.outHashes = []; + message.outHashes.push(reader.string()); + break; + case 4: + message.blockHeight = reader.int64(); + break; + case 5: + if (!(message.signers && message.signers.length)) + message.signers = []; + message.signers.push(reader.string()); + break; + case 6: + message.observedPubKey = reader.string(); + break; + case 7: + message.keysignMs = reader.int64(); + break; + case 8: + message.finaliseHeight = reader.int64(); + break; + case 9: + message.aggregator = reader.string(); + break; + case 10: + message.aggregatorTarget = reader.string(); + break; + case 11: + message.aggregatorTargetLimit = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ObservedTx message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof common.ObservedTx + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {common.ObservedTx} ObservedTx + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ObservedTx.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ObservedTx message. + * @function verify + * @memberof common.ObservedTx + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ObservedTx.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.tx != null && message.hasOwnProperty("tx")) { + var error = $root.common.Tx.verify(message.tx); + if (error) + return "tx." + error; + } + if (message.status != null && message.hasOwnProperty("status")) + switch (message.status) { + default: + return "status: enum value expected"; + case 0: + case 1: + case 2: + break; + } + if (message.outHashes != null && message.hasOwnProperty("outHashes")) { + if (!Array.isArray(message.outHashes)) + return "outHashes: array expected"; + for (var i = 0; i < message.outHashes.length; ++i) + if (!$util.isString(message.outHashes[i])) + return "outHashes: string[] expected"; + } + if (message.blockHeight != null && message.hasOwnProperty("blockHeight")) + if (!$util.isInteger(message.blockHeight) && !(message.blockHeight && $util.isInteger(message.blockHeight.low) && $util.isInteger(message.blockHeight.high))) + return "blockHeight: integer|Long expected"; + if (message.signers != null && message.hasOwnProperty("signers")) { + if (!Array.isArray(message.signers)) + return "signers: array expected"; + for (var i = 0; i < message.signers.length; ++i) + if (!$util.isString(message.signers[i])) + return "signers: string[] expected"; + } + if (message.observedPubKey != null && message.hasOwnProperty("observedPubKey")) + if (!$util.isString(message.observedPubKey)) + return "observedPubKey: string expected"; + if (message.keysignMs != null && message.hasOwnProperty("keysignMs")) + if (!$util.isInteger(message.keysignMs) && !(message.keysignMs && $util.isInteger(message.keysignMs.low) && $util.isInteger(message.keysignMs.high))) + return "keysignMs: integer|Long expected"; + if (message.finaliseHeight != null && message.hasOwnProperty("finaliseHeight")) + if (!$util.isInteger(message.finaliseHeight) && !(message.finaliseHeight && $util.isInteger(message.finaliseHeight.low) && $util.isInteger(message.finaliseHeight.high))) + return "finaliseHeight: integer|Long expected"; + if (message.aggregator != null && message.hasOwnProperty("aggregator")) + if (!$util.isString(message.aggregator)) + return "aggregator: string expected"; + if (message.aggregatorTarget != null && message.hasOwnProperty("aggregatorTarget")) + if (!$util.isString(message.aggregatorTarget)) + return "aggregatorTarget: string expected"; + if (message.aggregatorTargetLimit != null && message.hasOwnProperty("aggregatorTargetLimit")) + if (!$util.isString(message.aggregatorTargetLimit)) + return "aggregatorTargetLimit: string expected"; + return null; + }; + + /** + * Creates an ObservedTx message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof common.ObservedTx + * @static + * @param {Object.} object Plain object + * @returns {common.ObservedTx} ObservedTx + */ + ObservedTx.fromObject = function fromObject(object) { + if (object instanceof $root.common.ObservedTx) + return object; + var message = new $root.common.ObservedTx(); + if (object.tx != null) { + if (typeof object.tx !== "object") + throw TypeError(".common.ObservedTx.tx: object expected"); + message.tx = $root.common.Tx.fromObject(object.tx); + } + switch (object.status) { + case "incomplete": + case 0: + message.status = 0; + break; + case "done": + case 1: + message.status = 1; + break; + case "reverted": + case 2: + message.status = 2; + break; + } + if (object.outHashes) { + if (!Array.isArray(object.outHashes)) + throw TypeError(".common.ObservedTx.outHashes: array expected"); + message.outHashes = []; + for (var i = 0; i < object.outHashes.length; ++i) + message.outHashes[i] = String(object.outHashes[i]); + } + if (object.blockHeight != null) + if ($util.Long) + (message.blockHeight = $util.Long.fromValue(object.blockHeight)).unsigned = false; + else if (typeof object.blockHeight === "string") + message.blockHeight = parseInt(object.blockHeight, 10); + else if (typeof object.blockHeight === "number") + message.blockHeight = object.blockHeight; + else if (typeof object.blockHeight === "object") + message.blockHeight = new $util.LongBits(object.blockHeight.low >>> 0, object.blockHeight.high >>> 0).toNumber(); + if (object.signers) { + if (!Array.isArray(object.signers)) + throw TypeError(".common.ObservedTx.signers: array expected"); + message.signers = []; + for (var i = 0; i < object.signers.length; ++i) + message.signers[i] = String(object.signers[i]); + } + if (object.observedPubKey != null) + message.observedPubKey = String(object.observedPubKey); + if (object.keysignMs != null) + if ($util.Long) + (message.keysignMs = $util.Long.fromValue(object.keysignMs)).unsigned = false; + else if (typeof object.keysignMs === "string") + message.keysignMs = parseInt(object.keysignMs, 10); + else if (typeof object.keysignMs === "number") + message.keysignMs = object.keysignMs; + else if (typeof object.keysignMs === "object") + message.keysignMs = new $util.LongBits(object.keysignMs.low >>> 0, object.keysignMs.high >>> 0).toNumber(); + if (object.finaliseHeight != null) + if ($util.Long) + (message.finaliseHeight = $util.Long.fromValue(object.finaliseHeight)).unsigned = false; + else if (typeof object.finaliseHeight === "string") + message.finaliseHeight = parseInt(object.finaliseHeight, 10); + else if (typeof object.finaliseHeight === "number") + message.finaliseHeight = object.finaliseHeight; + else if (typeof object.finaliseHeight === "object") + message.finaliseHeight = new $util.LongBits(object.finaliseHeight.low >>> 0, object.finaliseHeight.high >>> 0).toNumber(); + if (object.aggregator != null) + message.aggregator = String(object.aggregator); + if (object.aggregatorTarget != null) + message.aggregatorTarget = String(object.aggregatorTarget); + if (object.aggregatorTargetLimit != null) + message.aggregatorTargetLimit = String(object.aggregatorTargetLimit); + return message; + }; + + /** + * Creates a plain object from an ObservedTx message. Also converts values to other types if specified. + * @function toObject + * @memberof common.ObservedTx + * @static + * @param {common.ObservedTx} message ObservedTx + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ObservedTx.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.outHashes = []; + object.signers = []; + } + if (options.defaults) { + object.tx = null; + object.status = options.enums === String ? "incomplete" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.blockHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.blockHeight = options.longs === String ? "0" : 0; + object.observedPubKey = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.keysignMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.keysignMs = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.finaliseHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.finaliseHeight = options.longs === String ? "0" : 0; + object.aggregator = ""; + object.aggregatorTarget = ""; + object.aggregatorTargetLimit = ""; + } + if (message.tx != null && message.hasOwnProperty("tx")) + object.tx = $root.common.Tx.toObject(message.tx, options); + if (message.status != null && message.hasOwnProperty("status")) + object.status = options.enums === String ? $root.common.Status[message.status] : message.status; + if (message.outHashes && message.outHashes.length) { + object.outHashes = []; + for (var j = 0; j < message.outHashes.length; ++j) + object.outHashes[j] = message.outHashes[j]; + } + if (message.blockHeight != null && message.hasOwnProperty("blockHeight")) + if (typeof message.blockHeight === "number") + object.blockHeight = options.longs === String ? String(message.blockHeight) : message.blockHeight; + else + object.blockHeight = options.longs === String ? $util.Long.prototype.toString.call(message.blockHeight) : options.longs === Number ? new $util.LongBits(message.blockHeight.low >>> 0, message.blockHeight.high >>> 0).toNumber() : message.blockHeight; + if (message.signers && message.signers.length) { + object.signers = []; + for (var j = 0; j < message.signers.length; ++j) + object.signers[j] = message.signers[j]; + } + if (message.observedPubKey != null && message.hasOwnProperty("observedPubKey")) + object.observedPubKey = message.observedPubKey; + if (message.keysignMs != null && message.hasOwnProperty("keysignMs")) + if (typeof message.keysignMs === "number") + object.keysignMs = options.longs === String ? String(message.keysignMs) : message.keysignMs; + else + object.keysignMs = options.longs === String ? $util.Long.prototype.toString.call(message.keysignMs) : options.longs === Number ? new $util.LongBits(message.keysignMs.low >>> 0, message.keysignMs.high >>> 0).toNumber() : message.keysignMs; + if (message.finaliseHeight != null && message.hasOwnProperty("finaliseHeight")) + if (typeof message.finaliseHeight === "number") + object.finaliseHeight = options.longs === String ? String(message.finaliseHeight) : message.finaliseHeight; + else + object.finaliseHeight = options.longs === String ? $util.Long.prototype.toString.call(message.finaliseHeight) : options.longs === Number ? new $util.LongBits(message.finaliseHeight.low >>> 0, message.finaliseHeight.high >>> 0).toNumber() : message.finaliseHeight; + if (message.aggregator != null && message.hasOwnProperty("aggregator")) + object.aggregator = message.aggregator; + if (message.aggregatorTarget != null && message.hasOwnProperty("aggregatorTarget")) + object.aggregatorTarget = message.aggregatorTarget; + if (message.aggregatorTargetLimit != null && message.hasOwnProperty("aggregatorTargetLimit")) + object.aggregatorTargetLimit = message.aggregatorTargetLimit; + return object; + }; + + /** + * Converts this ObservedTx to JSON. + * @function toJSON + * @memberof common.ObservedTx + * @instance + * @returns {Object.} JSON object + */ + ObservedTx.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ObservedTx; + })(); + + common.Attestation = (function() { + + /** + * Properties of an Attestation. + * @memberof common + * @interface IAttestation + * @property {Uint8Array|null} [PubKey] Attestation PubKey + * @property {Uint8Array|null} [Signature] Attestation Signature + */ + + /** + * Constructs a new Attestation. + * @memberof common + * @classdesc Represents an Attestation. + * @implements IAttestation + * @constructor + * @param {common.IAttestation=} [properties] Properties to set + */ + function Attestation(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]]; + } + + /** + * Attestation PubKey. + * @member {Uint8Array} PubKey + * @memberof common.Attestation + * @instance + */ + Attestation.prototype.PubKey = $util.newBuffer([]); + + /** + * Attestation Signature. + * @member {Uint8Array} Signature + * @memberof common.Attestation + * @instance + */ + Attestation.prototype.Signature = $util.newBuffer([]); + + /** + * Creates a new Attestation instance using the specified properties. + * @function create + * @memberof common.Attestation + * @static + * @param {common.IAttestation=} [properties] Properties to set + * @returns {common.Attestation} Attestation instance + */ + Attestation.create = function create(properties) { + return new Attestation(properties); + }; + + /** + * Encodes the specified Attestation message. Does not implicitly {@link common.Attestation.verify|verify} messages. + * @function encode + * @memberof common.Attestation + * @static + * @param {common.IAttestation} message Attestation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Attestation.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.PubKey != null && Object.hasOwnProperty.call(message, "PubKey")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.PubKey); + if (message.Signature != null && Object.hasOwnProperty.call(message, "Signature")) + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.Signature); + return writer; + }; + + /** + * Encodes the specified Attestation message, length delimited. Does not implicitly {@link common.Attestation.verify|verify} messages. + * @function encodeDelimited + * @memberof common.Attestation + * @static + * @param {common.IAttestation} message Attestation message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Attestation.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an Attestation message from the specified reader or buffer. + * @function decode + * @memberof common.Attestation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {common.Attestation} Attestation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Attestation.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.common.Attestation(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.PubKey = reader.bytes(); + break; + case 2: + message.Signature = reader.bytes(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an Attestation message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof common.Attestation + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {common.Attestation} Attestation + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Attestation.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an Attestation message. + * @function verify + * @memberof common.Attestation + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Attestation.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.PubKey != null && message.hasOwnProperty("PubKey")) + if (!(message.PubKey && typeof message.PubKey.length === "number" || $util.isString(message.PubKey))) + return "PubKey: buffer expected"; + if (message.Signature != null && message.hasOwnProperty("Signature")) + if (!(message.Signature && typeof message.Signature.length === "number" || $util.isString(message.Signature))) + return "Signature: buffer expected"; + return null; + }; + + /** + * Creates an Attestation message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof common.Attestation + * @static + * @param {Object.} object Plain object + * @returns {common.Attestation} Attestation + */ + Attestation.fromObject = function fromObject(object) { + if (object instanceof $root.common.Attestation) + return object; + var message = new $root.common.Attestation(); + if (object.PubKey != null) + if (typeof object.PubKey === "string") + $util.base64.decode(object.PubKey, message.PubKey = $util.newBuffer($util.base64.length(object.PubKey)), 0); + else if (object.PubKey.length) + message.PubKey = object.PubKey; + if (object.Signature != null) + if (typeof object.Signature === "string") + $util.base64.decode(object.Signature, message.Signature = $util.newBuffer($util.base64.length(object.Signature)), 0); + else if (object.Signature.length) + message.Signature = object.Signature; + return message; + }; + + /** + * Creates a plain object from an Attestation message. Also converts values to other types if specified. + * @function toObject + * @memberof common.Attestation + * @static + * @param {common.Attestation} message Attestation + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Attestation.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if (options.bytes === String) + object.PubKey = ""; + else { + object.PubKey = []; + if (options.bytes !== Array) + object.PubKey = $util.newBuffer(object.PubKey); + } + if (options.bytes === String) + object.Signature = ""; + else { + object.Signature = []; + if (options.bytes !== Array) + object.Signature = $util.newBuffer(object.Signature); + } + } + if (message.PubKey != null && message.hasOwnProperty("PubKey")) + object.PubKey = options.bytes === String ? $util.base64.encode(message.PubKey, 0, message.PubKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.PubKey) : message.PubKey; + if (message.Signature != null && message.hasOwnProperty("Signature")) + object.Signature = options.bytes === String ? $util.base64.encode(message.Signature, 0, message.Signature.length) : options.bytes === Array ? Array.prototype.slice.call(message.Signature) : message.Signature; + return object; + }; + + /** + * Converts this Attestation to JSON. + * @function toJSON + * @memberof common.Attestation + * @instance + * @returns {Object.} JSON object + */ + Attestation.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Attestation; + })(); + + common.AttestTx = (function() { + + /** + * Properties of an AttestTx. + * @memberof common + * @interface IAttestTx + * @property {common.IObservedTx|null} [obsTx] AttestTx obsTx + * @property {common.IAttestation|null} [attestation] AttestTx attestation + * @property {boolean|null} [inbound] AttestTx inbound + * @property {boolean|null} [allowFutureObservation] AttestTx allowFutureObservation + */ + + /** + * Constructs a new AttestTx. + * @memberof common + * @classdesc Represents an AttestTx. + * @implements IAttestTx + * @constructor + * @param {common.IAttestTx=} [properties] Properties to set + */ + function AttestTx(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]]; + } + + /** + * AttestTx obsTx. + * @member {common.IObservedTx|null|undefined} obsTx + * @memberof common.AttestTx + * @instance + */ + AttestTx.prototype.obsTx = null; + + /** + * AttestTx attestation. + * @member {common.IAttestation|null|undefined} attestation + * @memberof common.AttestTx + * @instance + */ + AttestTx.prototype.attestation = null; + + /** + * AttestTx inbound. + * @member {boolean} inbound + * @memberof common.AttestTx + * @instance + */ + AttestTx.prototype.inbound = false; + + /** + * AttestTx allowFutureObservation. + * @member {boolean} allowFutureObservation + * @memberof common.AttestTx + * @instance + */ + AttestTx.prototype.allowFutureObservation = false; + + /** + * Creates a new AttestTx instance using the specified properties. + * @function create + * @memberof common.AttestTx + * @static + * @param {common.IAttestTx=} [properties] Properties to set + * @returns {common.AttestTx} AttestTx instance + */ + AttestTx.create = function create(properties) { + return new AttestTx(properties); + }; + + /** + * Encodes the specified AttestTx message. Does not implicitly {@link common.AttestTx.verify|verify} messages. + * @function encode + * @memberof common.AttestTx + * @static + * @param {common.IAttestTx} message AttestTx message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttestTx.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.obsTx != null && Object.hasOwnProperty.call(message, "obsTx")) + $root.common.ObservedTx.encode(message.obsTx, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.attestation != null && Object.hasOwnProperty.call(message, "attestation")) + $root.common.Attestation.encode(message.attestation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.inbound != null && Object.hasOwnProperty.call(message, "inbound")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.inbound); + if (message.allowFutureObservation != null && Object.hasOwnProperty.call(message, "allowFutureObservation")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.allowFutureObservation); + return writer; + }; + + /** + * Encodes the specified AttestTx message, length delimited. Does not implicitly {@link common.AttestTx.verify|verify} messages. + * @function encodeDelimited + * @memberof common.AttestTx + * @static + * @param {common.IAttestTx} message AttestTx message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttestTx.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AttestTx message from the specified reader or buffer. + * @function decode + * @memberof common.AttestTx + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {common.AttestTx} AttestTx + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttestTx.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.common.AttestTx(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.obsTx = $root.common.ObservedTx.decode(reader, reader.uint32()); + break; + case 2: + message.attestation = $root.common.Attestation.decode(reader, reader.uint32()); + break; + case 3: + message.inbound = reader.bool(); + break; + case 4: + message.allowFutureObservation = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AttestTx message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof common.AttestTx + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {common.AttestTx} AttestTx + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttestTx.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AttestTx message. + * @function verify + * @memberof common.AttestTx + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AttestTx.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.obsTx != null && message.hasOwnProperty("obsTx")) { + var error = $root.common.ObservedTx.verify(message.obsTx); + if (error) + return "obsTx." + error; + } + if (message.attestation != null && message.hasOwnProperty("attestation")) { + var error = $root.common.Attestation.verify(message.attestation); + if (error) + return "attestation." + error; + } + if (message.inbound != null && message.hasOwnProperty("inbound")) + if (typeof message.inbound !== "boolean") + return "inbound: boolean expected"; + if (message.allowFutureObservation != null && message.hasOwnProperty("allowFutureObservation")) + if (typeof message.allowFutureObservation !== "boolean") + return "allowFutureObservation: boolean expected"; + return null; + }; + + /** + * Creates an AttestTx message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof common.AttestTx + * @static + * @param {Object.} object Plain object + * @returns {common.AttestTx} AttestTx + */ + AttestTx.fromObject = function fromObject(object) { + if (object instanceof $root.common.AttestTx) + return object; + var message = new $root.common.AttestTx(); + if (object.obsTx != null) { + if (typeof object.obsTx !== "object") + throw TypeError(".common.AttestTx.obsTx: object expected"); + message.obsTx = $root.common.ObservedTx.fromObject(object.obsTx); + } + if (object.attestation != null) { + if (typeof object.attestation !== "object") + throw TypeError(".common.AttestTx.attestation: object expected"); + message.attestation = $root.common.Attestation.fromObject(object.attestation); + } + if (object.inbound != null) + message.inbound = Boolean(object.inbound); + if (object.allowFutureObservation != null) + message.allowFutureObservation = Boolean(object.allowFutureObservation); + return message; + }; + + /** + * Creates a plain object from an AttestTx message. Also converts values to other types if specified. + * @function toObject + * @memberof common.AttestTx + * @static + * @param {common.AttestTx} message AttestTx + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AttestTx.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.obsTx = null; + object.attestation = null; + object.inbound = false; + object.allowFutureObservation = false; + } + if (message.obsTx != null && message.hasOwnProperty("obsTx")) + object.obsTx = $root.common.ObservedTx.toObject(message.obsTx, options); + if (message.attestation != null && message.hasOwnProperty("attestation")) + object.attestation = $root.common.Attestation.toObject(message.attestation, options); + if (message.inbound != null && message.hasOwnProperty("inbound")) + object.inbound = message.inbound; + if (message.allowFutureObservation != null && message.hasOwnProperty("allowFutureObservation")) + object.allowFutureObservation = message.allowFutureObservation; + return object; + }; + + /** + * Converts this AttestTx to JSON. + * @function toJSON + * @memberof common.AttestTx + * @instance + * @returns {Object.} JSON object + */ + AttestTx.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AttestTx; + })(); + + common.QuorumTx = (function() { + + /** + * Properties of a QuorumTx. + * @memberof common + * @interface IQuorumTx + * @property {common.IObservedTx|null} [obsTx] QuorumTx obsTx + * @property {Array.|null} [attestations] QuorumTx attestations + * @property {boolean|null} [inbound] QuorumTx inbound + * @property {boolean|null} [allowFutureObservation] QuorumTx allowFutureObservation + */ + + /** + * Constructs a new QuorumTx. + * @memberof common + * @classdesc Represents a QuorumTx. + * @implements IQuorumTx + * @constructor + * @param {common.IQuorumTx=} [properties] Properties to set + */ + function QuorumTx(properties) { + this.attestations = []; + 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]]; + } + + /** + * QuorumTx obsTx. + * @member {common.IObservedTx|null|undefined} obsTx + * @memberof common.QuorumTx + * @instance + */ + QuorumTx.prototype.obsTx = null; + + /** + * QuorumTx attestations. + * @member {Array.} attestations + * @memberof common.QuorumTx + * @instance + */ + QuorumTx.prototype.attestations = $util.emptyArray; + + /** + * QuorumTx inbound. + * @member {boolean} inbound + * @memberof common.QuorumTx + * @instance + */ + QuorumTx.prototype.inbound = false; + + /** + * QuorumTx allowFutureObservation. + * @member {boolean} allowFutureObservation + * @memberof common.QuorumTx + * @instance + */ + QuorumTx.prototype.allowFutureObservation = false; + + /** + * Creates a new QuorumTx instance using the specified properties. + * @function create + * @memberof common.QuorumTx + * @static + * @param {common.IQuorumTx=} [properties] Properties to set + * @returns {common.QuorumTx} QuorumTx instance + */ + QuorumTx.create = function create(properties) { + return new QuorumTx(properties); + }; + + /** + * Encodes the specified QuorumTx message. Does not implicitly {@link common.QuorumTx.verify|verify} messages. + * @function encode + * @memberof common.QuorumTx + * @static + * @param {common.IQuorumTx} message QuorumTx message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuorumTx.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.obsTx != null && Object.hasOwnProperty.call(message, "obsTx")) + $root.common.ObservedTx.encode(message.obsTx, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.attestations != null && message.attestations.length) + for (var i = 0; i < message.attestations.length; ++i) + $root.common.Attestation.encode(message.attestations[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.inbound != null && Object.hasOwnProperty.call(message, "inbound")) + writer.uint32(/* id 3, wireType 0 =*/24).bool(message.inbound); + if (message.allowFutureObservation != null && Object.hasOwnProperty.call(message, "allowFutureObservation")) + writer.uint32(/* id 4, wireType 0 =*/32).bool(message.allowFutureObservation); + return writer; + }; + + /** + * Encodes the specified QuorumTx message, length delimited. Does not implicitly {@link common.QuorumTx.verify|verify} messages. + * @function encodeDelimited + * @memberof common.QuorumTx + * @static + * @param {common.IQuorumTx} message QuorumTx message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuorumTx.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QuorumTx message from the specified reader or buffer. + * @function decode + * @memberof common.QuorumTx + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {common.QuorumTx} QuorumTx + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuorumTx.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.common.QuorumTx(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.obsTx = $root.common.ObservedTx.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.attestations && message.attestations.length)) + message.attestations = []; + message.attestations.push($root.common.Attestation.decode(reader, reader.uint32())); + break; + case 3: + message.inbound = reader.bool(); + break; + case 4: + message.allowFutureObservation = reader.bool(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QuorumTx message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof common.QuorumTx + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {common.QuorumTx} QuorumTx + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuorumTx.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QuorumTx message. + * @function verify + * @memberof common.QuorumTx + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QuorumTx.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.obsTx != null && message.hasOwnProperty("obsTx")) { + var error = $root.common.ObservedTx.verify(message.obsTx); + if (error) + return "obsTx." + error; + } + if (message.attestations != null && message.hasOwnProperty("attestations")) { + if (!Array.isArray(message.attestations)) + return "attestations: array expected"; + for (var i = 0; i < message.attestations.length; ++i) { + var error = $root.common.Attestation.verify(message.attestations[i]); + if (error) + return "attestations." + error; + } + } + if (message.inbound != null && message.hasOwnProperty("inbound")) + if (typeof message.inbound !== "boolean") + return "inbound: boolean expected"; + if (message.allowFutureObservation != null && message.hasOwnProperty("allowFutureObservation")) + if (typeof message.allowFutureObservation !== "boolean") + return "allowFutureObservation: boolean expected"; + return null; + }; + + /** + * Creates a QuorumTx message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof common.QuorumTx + * @static + * @param {Object.} object Plain object + * @returns {common.QuorumTx} QuorumTx + */ + QuorumTx.fromObject = function fromObject(object) { + if (object instanceof $root.common.QuorumTx) + return object; + var message = new $root.common.QuorumTx(); + if (object.obsTx != null) { + if (typeof object.obsTx !== "object") + throw TypeError(".common.QuorumTx.obsTx: object expected"); + message.obsTx = $root.common.ObservedTx.fromObject(object.obsTx); + } + if (object.attestations) { + if (!Array.isArray(object.attestations)) + throw TypeError(".common.QuorumTx.attestations: array expected"); + message.attestations = []; + for (var i = 0; i < object.attestations.length; ++i) { + if (typeof object.attestations[i] !== "object") + throw TypeError(".common.QuorumTx.attestations: object expected"); + message.attestations[i] = $root.common.Attestation.fromObject(object.attestations[i]); + } + } + if (object.inbound != null) + message.inbound = Boolean(object.inbound); + if (object.allowFutureObservation != null) + message.allowFutureObservation = Boolean(object.allowFutureObservation); + return message; + }; + + /** + * Creates a plain object from a QuorumTx message. Also converts values to other types if specified. + * @function toObject + * @memberof common.QuorumTx + * @static + * @param {common.QuorumTx} message QuorumTx + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QuorumTx.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.attestations = []; + if (options.defaults) { + object.obsTx = null; + object.inbound = false; + object.allowFutureObservation = false; + } + if (message.obsTx != null && message.hasOwnProperty("obsTx")) + object.obsTx = $root.common.ObservedTx.toObject(message.obsTx, options); + if (message.attestations && message.attestations.length) { + object.attestations = []; + for (var j = 0; j < message.attestations.length; ++j) + object.attestations[j] = $root.common.Attestation.toObject(message.attestations[j], options); + } + if (message.inbound != null && message.hasOwnProperty("inbound")) + object.inbound = message.inbound; + if (message.allowFutureObservation != null && message.hasOwnProperty("allowFutureObservation")) + object.allowFutureObservation = message.allowFutureObservation; + return object; + }; + + /** + * Converts this QuorumTx to JSON. + * @function toJSON + * @memberof common.QuorumTx + * @instance + * @returns {Object.} JSON object + */ + QuorumTx.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QuorumTx; + })(); + + common.QuorumState = (function() { + + /** + * Properties of a QuorumState. + * @memberof common + * @interface IQuorumState + * @property {Array.|null} [quoTxs] QuorumState quoTxs + * @property {Array.|null} [quoNetworkFees] QuorumState quoNetworkFees + * @property {Array.|null} [quoSolvencies] QuorumState quoSolvencies + * @property {Array.|null} [quoErrataTxs] QuorumState quoErrataTxs + * @property {Array.|null} [quoPriceFeeds] QuorumState quoPriceFeeds + */ + + /** + * Constructs a new QuorumState. + * @memberof common + * @classdesc Represents a QuorumState. + * @implements IQuorumState + * @constructor + * @param {common.IQuorumState=} [properties] Properties to set + */ + function QuorumState(properties) { + this.quoTxs = []; + this.quoNetworkFees = []; + this.quoSolvencies = []; + this.quoErrataTxs = []; + this.quoPriceFeeds = []; + 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]]; + } + + /** + * QuorumState quoTxs. + * @member {Array.} quoTxs + * @memberof common.QuorumState + * @instance + */ + QuorumState.prototype.quoTxs = $util.emptyArray; + + /** + * QuorumState quoNetworkFees. + * @member {Array.} quoNetworkFees + * @memberof common.QuorumState + * @instance + */ + QuorumState.prototype.quoNetworkFees = $util.emptyArray; + + /** + * QuorumState quoSolvencies. + * @member {Array.} quoSolvencies + * @memberof common.QuorumState + * @instance + */ + QuorumState.prototype.quoSolvencies = $util.emptyArray; + + /** + * QuorumState quoErrataTxs. + * @member {Array.} quoErrataTxs + * @memberof common.QuorumState + * @instance + */ + QuorumState.prototype.quoErrataTxs = $util.emptyArray; + + /** + * QuorumState quoPriceFeeds. + * @member {Array.} quoPriceFeeds + * @memberof common.QuorumState + * @instance + */ + QuorumState.prototype.quoPriceFeeds = $util.emptyArray; + + /** + * Creates a new QuorumState instance using the specified properties. + * @function create + * @memberof common.QuorumState + * @static + * @param {common.IQuorumState=} [properties] Properties to set + * @returns {common.QuorumState} QuorumState instance + */ + QuorumState.create = function create(properties) { + return new QuorumState(properties); + }; + + /** + * Encodes the specified QuorumState message. Does not implicitly {@link common.QuorumState.verify|verify} messages. + * @function encode + * @memberof common.QuorumState + * @static + * @param {common.IQuorumState} message QuorumState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuorumState.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.quoTxs != null && message.quoTxs.length) + for (var i = 0; i < message.quoTxs.length; ++i) + $root.common.QuorumTx.encode(message.quoTxs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.quoNetworkFees != null && message.quoNetworkFees.length) + for (var i = 0; i < message.quoNetworkFees.length; ++i) + $root.common.QuorumNetworkFee.encode(message.quoNetworkFees[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.quoSolvencies != null && message.quoSolvencies.length) + for (var i = 0; i < message.quoSolvencies.length; ++i) + $root.common.QuorumSolvency.encode(message.quoSolvencies[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.quoErrataTxs != null && message.quoErrataTxs.length) + for (var i = 0; i < message.quoErrataTxs.length; ++i) + $root.common.QuorumErrataTx.encode(message.quoErrataTxs[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.quoPriceFeeds != null && message.quoPriceFeeds.length) + for (var i = 0; i < message.quoPriceFeeds.length; ++i) + $root.common.QuorumPriceFeed.encode(message.quoPriceFeeds[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QuorumState message, length delimited. Does not implicitly {@link common.QuorumState.verify|verify} messages. + * @function encodeDelimited + * @memberof common.QuorumState + * @static + * @param {common.IQuorumState} message QuorumState message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuorumState.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QuorumState message from the specified reader or buffer. + * @function decode + * @memberof common.QuorumState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {common.QuorumState} QuorumState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuorumState.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.common.QuorumState(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.quoTxs && message.quoTxs.length)) + message.quoTxs = []; + message.quoTxs.push($root.common.QuorumTx.decode(reader, reader.uint32())); + break; + case 2: + if (!(message.quoNetworkFees && message.quoNetworkFees.length)) + message.quoNetworkFees = []; + message.quoNetworkFees.push($root.common.QuorumNetworkFee.decode(reader, reader.uint32())); + break; + case 3: + if (!(message.quoSolvencies && message.quoSolvencies.length)) + message.quoSolvencies = []; + message.quoSolvencies.push($root.common.QuorumSolvency.decode(reader, reader.uint32())); + break; + case 4: + if (!(message.quoErrataTxs && message.quoErrataTxs.length)) + message.quoErrataTxs = []; + message.quoErrataTxs.push($root.common.QuorumErrataTx.decode(reader, reader.uint32())); + break; + case 5: + if (!(message.quoPriceFeeds && message.quoPriceFeeds.length)) + message.quoPriceFeeds = []; + message.quoPriceFeeds.push($root.common.QuorumPriceFeed.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QuorumState message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof common.QuorumState + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {common.QuorumState} QuorumState + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuorumState.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QuorumState message. + * @function verify + * @memberof common.QuorumState + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QuorumState.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.quoTxs != null && message.hasOwnProperty("quoTxs")) { + if (!Array.isArray(message.quoTxs)) + return "quoTxs: array expected"; + for (var i = 0; i < message.quoTxs.length; ++i) { + var error = $root.common.QuorumTx.verify(message.quoTxs[i]); + if (error) + return "quoTxs." + error; + } + } + if (message.quoNetworkFees != null && message.hasOwnProperty("quoNetworkFees")) { + if (!Array.isArray(message.quoNetworkFees)) + return "quoNetworkFees: array expected"; + for (var i = 0; i < message.quoNetworkFees.length; ++i) { + var error = $root.common.QuorumNetworkFee.verify(message.quoNetworkFees[i]); + if (error) + return "quoNetworkFees." + error; + } + } + if (message.quoSolvencies != null && message.hasOwnProperty("quoSolvencies")) { + if (!Array.isArray(message.quoSolvencies)) + return "quoSolvencies: array expected"; + for (var i = 0; i < message.quoSolvencies.length; ++i) { + var error = $root.common.QuorumSolvency.verify(message.quoSolvencies[i]); + if (error) + return "quoSolvencies." + error; + } + } + if (message.quoErrataTxs != null && message.hasOwnProperty("quoErrataTxs")) { + if (!Array.isArray(message.quoErrataTxs)) + return "quoErrataTxs: array expected"; + for (var i = 0; i < message.quoErrataTxs.length; ++i) { + var error = $root.common.QuorumErrataTx.verify(message.quoErrataTxs[i]); + if (error) + return "quoErrataTxs." + error; + } + } + if (message.quoPriceFeeds != null && message.hasOwnProperty("quoPriceFeeds")) { + if (!Array.isArray(message.quoPriceFeeds)) + return "quoPriceFeeds: array expected"; + for (var i = 0; i < message.quoPriceFeeds.length; ++i) { + var error = $root.common.QuorumPriceFeed.verify(message.quoPriceFeeds[i]); + if (error) + return "quoPriceFeeds." + error; + } + } + return null; + }; + + /** + * Creates a QuorumState message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof common.QuorumState + * @static + * @param {Object.} object Plain object + * @returns {common.QuorumState} QuorumState + */ + QuorumState.fromObject = function fromObject(object) { + if (object instanceof $root.common.QuorumState) + return object; + var message = new $root.common.QuorumState(); + if (object.quoTxs) { + if (!Array.isArray(object.quoTxs)) + throw TypeError(".common.QuorumState.quoTxs: array expected"); + message.quoTxs = []; + for (var i = 0; i < object.quoTxs.length; ++i) { + if (typeof object.quoTxs[i] !== "object") + throw TypeError(".common.QuorumState.quoTxs: object expected"); + message.quoTxs[i] = $root.common.QuorumTx.fromObject(object.quoTxs[i]); + } + } + if (object.quoNetworkFees) { + if (!Array.isArray(object.quoNetworkFees)) + throw TypeError(".common.QuorumState.quoNetworkFees: array expected"); + message.quoNetworkFees = []; + for (var i = 0; i < object.quoNetworkFees.length; ++i) { + if (typeof object.quoNetworkFees[i] !== "object") + throw TypeError(".common.QuorumState.quoNetworkFees: object expected"); + message.quoNetworkFees[i] = $root.common.QuorumNetworkFee.fromObject(object.quoNetworkFees[i]); + } + } + if (object.quoSolvencies) { + if (!Array.isArray(object.quoSolvencies)) + throw TypeError(".common.QuorumState.quoSolvencies: array expected"); + message.quoSolvencies = []; + for (var i = 0; i < object.quoSolvencies.length; ++i) { + if (typeof object.quoSolvencies[i] !== "object") + throw TypeError(".common.QuorumState.quoSolvencies: object expected"); + message.quoSolvencies[i] = $root.common.QuorumSolvency.fromObject(object.quoSolvencies[i]); + } + } + if (object.quoErrataTxs) { + if (!Array.isArray(object.quoErrataTxs)) + throw TypeError(".common.QuorumState.quoErrataTxs: array expected"); + message.quoErrataTxs = []; + for (var i = 0; i < object.quoErrataTxs.length; ++i) { + if (typeof object.quoErrataTxs[i] !== "object") + throw TypeError(".common.QuorumState.quoErrataTxs: object expected"); + message.quoErrataTxs[i] = $root.common.QuorumErrataTx.fromObject(object.quoErrataTxs[i]); + } + } + if (object.quoPriceFeeds) { + if (!Array.isArray(object.quoPriceFeeds)) + throw TypeError(".common.QuorumState.quoPriceFeeds: array expected"); + message.quoPriceFeeds = []; + for (var i = 0; i < object.quoPriceFeeds.length; ++i) { + if (typeof object.quoPriceFeeds[i] !== "object") + throw TypeError(".common.QuorumState.quoPriceFeeds: object expected"); + message.quoPriceFeeds[i] = $root.common.QuorumPriceFeed.fromObject(object.quoPriceFeeds[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a QuorumState message. Also converts values to other types if specified. + * @function toObject + * @memberof common.QuorumState + * @static + * @param {common.QuorumState} message QuorumState + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QuorumState.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.quoTxs = []; + object.quoNetworkFees = []; + object.quoSolvencies = []; + object.quoErrataTxs = []; + object.quoPriceFeeds = []; + } + if (message.quoTxs && message.quoTxs.length) { + object.quoTxs = []; + for (var j = 0; j < message.quoTxs.length; ++j) + object.quoTxs[j] = $root.common.QuorumTx.toObject(message.quoTxs[j], options); + } + if (message.quoNetworkFees && message.quoNetworkFees.length) { + object.quoNetworkFees = []; + for (var j = 0; j < message.quoNetworkFees.length; ++j) + object.quoNetworkFees[j] = $root.common.QuorumNetworkFee.toObject(message.quoNetworkFees[j], options); + } + if (message.quoSolvencies && message.quoSolvencies.length) { + object.quoSolvencies = []; + for (var j = 0; j < message.quoSolvencies.length; ++j) + object.quoSolvencies[j] = $root.common.QuorumSolvency.toObject(message.quoSolvencies[j], options); + } + if (message.quoErrataTxs && message.quoErrataTxs.length) { + object.quoErrataTxs = []; + for (var j = 0; j < message.quoErrataTxs.length; ++j) + object.quoErrataTxs[j] = $root.common.QuorumErrataTx.toObject(message.quoErrataTxs[j], options); + } + if (message.quoPriceFeeds && message.quoPriceFeeds.length) { + object.quoPriceFeeds = []; + for (var j = 0; j < message.quoPriceFeeds.length; ++j) + object.quoPriceFeeds[j] = $root.common.QuorumPriceFeed.toObject(message.quoPriceFeeds[j], options); + } + return object; + }; + + /** + * Converts this QuorumState to JSON. + * @function toJSON + * @memberof common.QuorumState + * @instance + * @returns {Object.} JSON object + */ + QuorumState.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QuorumState; + })(); + + common.NetworkFee = (function() { + + /** + * Properties of a NetworkFee. + * @memberof common + * @interface INetworkFee + * @property {number|Long|null} [height] NetworkFee height + * @property {string|null} [chain] NetworkFee chain + * @property {number|Long|null} [transactionSize] NetworkFee transactionSize + * @property {number|Long|null} [transactionRate] NetworkFee transactionRate + */ + + /** + * Constructs a new NetworkFee. + * @memberof common + * @classdesc Represents a NetworkFee. + * @implements INetworkFee + * @constructor + * @param {common.INetworkFee=} [properties] Properties to set + */ + function NetworkFee(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]]; + } + + /** + * NetworkFee height. + * @member {number|Long} height + * @memberof common.NetworkFee + * @instance + */ + NetworkFee.prototype.height = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * NetworkFee chain. + * @member {string} chain + * @memberof common.NetworkFee + * @instance + */ + NetworkFee.prototype.chain = ""; + + /** + * NetworkFee transactionSize. + * @member {number|Long} transactionSize + * @memberof common.NetworkFee + * @instance + */ + NetworkFee.prototype.transactionSize = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * NetworkFee transactionRate. + * @member {number|Long} transactionRate + * @memberof common.NetworkFee + * @instance + */ + NetworkFee.prototype.transactionRate = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * Creates a new NetworkFee instance using the specified properties. + * @function create + * @memberof common.NetworkFee + * @static + * @param {common.INetworkFee=} [properties] Properties to set + * @returns {common.NetworkFee} NetworkFee instance + */ + NetworkFee.create = function create(properties) { + return new NetworkFee(properties); + }; + + /** + * Encodes the specified NetworkFee message. Does not implicitly {@link common.NetworkFee.verify|verify} messages. + * @function encode + * @memberof common.NetworkFee + * @static + * @param {common.INetworkFee} message NetworkFee message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkFee.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 1, wireType 0 =*/8).int64(message.height); + if (message.chain != null && Object.hasOwnProperty.call(message, "chain")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.chain); + if (message.transactionSize != null && Object.hasOwnProperty.call(message, "transactionSize")) + writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.transactionSize); + if (message.transactionRate != null && Object.hasOwnProperty.call(message, "transactionRate")) + writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.transactionRate); + return writer; + }; + + /** + * Encodes the specified NetworkFee message, length delimited. Does not implicitly {@link common.NetworkFee.verify|verify} messages. + * @function encodeDelimited + * @memberof common.NetworkFee + * @static + * @param {common.INetworkFee} message NetworkFee message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + NetworkFee.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a NetworkFee message from the specified reader or buffer. + * @function decode + * @memberof common.NetworkFee + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {common.NetworkFee} NetworkFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkFee.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.common.NetworkFee(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.height = reader.int64(); + break; + case 2: + message.chain = reader.string(); + break; + case 3: + message.transactionSize = reader.uint64(); + break; + case 4: + message.transactionRate = reader.uint64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a NetworkFee message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof common.NetworkFee + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {common.NetworkFee} NetworkFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + NetworkFee.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a NetworkFee message. + * @function verify + * @memberof common.NetworkFee + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + NetworkFee.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) + return "height: integer|Long expected"; + if (message.chain != null && message.hasOwnProperty("chain")) + if (!$util.isString(message.chain)) + return "chain: string expected"; + if (message.transactionSize != null && message.hasOwnProperty("transactionSize")) + if (!$util.isInteger(message.transactionSize) && !(message.transactionSize && $util.isInteger(message.transactionSize.low) && $util.isInteger(message.transactionSize.high))) + return "transactionSize: integer|Long expected"; + if (message.transactionRate != null && message.hasOwnProperty("transactionRate")) + if (!$util.isInteger(message.transactionRate) && !(message.transactionRate && $util.isInteger(message.transactionRate.low) && $util.isInteger(message.transactionRate.high))) + return "transactionRate: integer|Long expected"; + return null; + }; + + /** + * Creates a NetworkFee message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof common.NetworkFee + * @static + * @param {Object.} object Plain object + * @returns {common.NetworkFee} NetworkFee + */ + NetworkFee.fromObject = function fromObject(object) { + if (object instanceof $root.common.NetworkFee) + return object; + var message = new $root.common.NetworkFee(); + if (object.height != null) + if ($util.Long) + (message.height = $util.Long.fromValue(object.height)).unsigned = false; + else if (typeof object.height === "string") + message.height = parseInt(object.height, 10); + else if (typeof object.height === "number") + message.height = object.height; + else if (typeof object.height === "object") + message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(); + if (object.chain != null) + message.chain = String(object.chain); + if (object.transactionSize != null) + if ($util.Long) + (message.transactionSize = $util.Long.fromValue(object.transactionSize)).unsigned = true; + else if (typeof object.transactionSize === "string") + message.transactionSize = parseInt(object.transactionSize, 10); + else if (typeof object.transactionSize === "number") + message.transactionSize = object.transactionSize; + else if (typeof object.transactionSize === "object") + message.transactionSize = new $util.LongBits(object.transactionSize.low >>> 0, object.transactionSize.high >>> 0).toNumber(true); + if (object.transactionRate != null) + if ($util.Long) + (message.transactionRate = $util.Long.fromValue(object.transactionRate)).unsigned = true; + else if (typeof object.transactionRate === "string") + message.transactionRate = parseInt(object.transactionRate, 10); + else if (typeof object.transactionRate === "number") + message.transactionRate = object.transactionRate; + else if (typeof object.transactionRate === "object") + message.transactionRate = new $util.LongBits(object.transactionRate.low >>> 0, object.transactionRate.high >>> 0).toNumber(true); + return message; + }; + + /** + * Creates a plain object from a NetworkFee message. Also converts values to other types if specified. + * @function toObject + * @memberof common.NetworkFee + * @static + * @param {common.NetworkFee} message NetworkFee + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + NetworkFee.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.height = options.longs === String ? "0" : 0; + object.chain = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.transactionSize = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.transactionSize = options.longs === String ? "0" : 0; + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.transactionRate = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.transactionRate = options.longs === String ? "0" : 0; + } + if (message.height != null && message.hasOwnProperty("height")) + if (typeof message.height === "number") + object.height = options.longs === String ? String(message.height) : message.height; + else + object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber() : message.height; + if (message.chain != null && message.hasOwnProperty("chain")) + object.chain = message.chain; + if (message.transactionSize != null && message.hasOwnProperty("transactionSize")) + if (typeof message.transactionSize === "number") + object.transactionSize = options.longs === String ? String(message.transactionSize) : message.transactionSize; + else + object.transactionSize = options.longs === String ? $util.Long.prototype.toString.call(message.transactionSize) : options.longs === Number ? new $util.LongBits(message.transactionSize.low >>> 0, message.transactionSize.high >>> 0).toNumber(true) : message.transactionSize; + if (message.transactionRate != null && message.hasOwnProperty("transactionRate")) + if (typeof message.transactionRate === "number") + object.transactionRate = options.longs === String ? String(message.transactionRate) : message.transactionRate; + else + object.transactionRate = options.longs === String ? $util.Long.prototype.toString.call(message.transactionRate) : options.longs === Number ? new $util.LongBits(message.transactionRate.low >>> 0, message.transactionRate.high >>> 0).toNumber(true) : message.transactionRate; + return object; + }; + + /** + * Converts this NetworkFee to JSON. + * @function toJSON + * @memberof common.NetworkFee + * @instance + * @returns {Object.} JSON object + */ + NetworkFee.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return NetworkFee; + })(); + + common.AttestNetworkFee = (function() { + + /** + * Properties of an AttestNetworkFee. + * @memberof common + * @interface IAttestNetworkFee + * @property {common.INetworkFee|null} [networkFee] AttestNetworkFee networkFee + * @property {common.IAttestation|null} [attestation] AttestNetworkFee attestation + */ + + /** + * Constructs a new AttestNetworkFee. + * @memberof common + * @classdesc Represents an AttestNetworkFee. + * @implements IAttestNetworkFee + * @constructor + * @param {common.IAttestNetworkFee=} [properties] Properties to set + */ + function AttestNetworkFee(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]]; + } + + /** + * AttestNetworkFee networkFee. + * @member {common.INetworkFee|null|undefined} networkFee + * @memberof common.AttestNetworkFee + * @instance + */ + AttestNetworkFee.prototype.networkFee = null; + + /** + * AttestNetworkFee attestation. + * @member {common.IAttestation|null|undefined} attestation + * @memberof common.AttestNetworkFee + * @instance + */ + AttestNetworkFee.prototype.attestation = null; + + /** + * Creates a new AttestNetworkFee instance using the specified properties. + * @function create + * @memberof common.AttestNetworkFee + * @static + * @param {common.IAttestNetworkFee=} [properties] Properties to set + * @returns {common.AttestNetworkFee} AttestNetworkFee instance + */ + AttestNetworkFee.create = function create(properties) { + return new AttestNetworkFee(properties); + }; + + /** + * Encodes the specified AttestNetworkFee message. Does not implicitly {@link common.AttestNetworkFee.verify|verify} messages. + * @function encode + * @memberof common.AttestNetworkFee + * @static + * @param {common.IAttestNetworkFee} message AttestNetworkFee message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttestNetworkFee.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.networkFee != null && Object.hasOwnProperty.call(message, "networkFee")) + $root.common.NetworkFee.encode(message.networkFee, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.attestation != null && Object.hasOwnProperty.call(message, "attestation")) + $root.common.Attestation.encode(message.attestation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AttestNetworkFee message, length delimited. Does not implicitly {@link common.AttestNetworkFee.verify|verify} messages. + * @function encodeDelimited + * @memberof common.AttestNetworkFee + * @static + * @param {common.IAttestNetworkFee} message AttestNetworkFee message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttestNetworkFee.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AttestNetworkFee message from the specified reader or buffer. + * @function decode + * @memberof common.AttestNetworkFee + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {common.AttestNetworkFee} AttestNetworkFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttestNetworkFee.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.common.AttestNetworkFee(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.networkFee = $root.common.NetworkFee.decode(reader, reader.uint32()); + break; + case 2: + message.attestation = $root.common.Attestation.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AttestNetworkFee message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof common.AttestNetworkFee + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {common.AttestNetworkFee} AttestNetworkFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttestNetworkFee.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AttestNetworkFee message. + * @function verify + * @memberof common.AttestNetworkFee + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AttestNetworkFee.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.networkFee != null && message.hasOwnProperty("networkFee")) { + var error = $root.common.NetworkFee.verify(message.networkFee); + if (error) + return "networkFee." + error; + } + if (message.attestation != null && message.hasOwnProperty("attestation")) { + var error = $root.common.Attestation.verify(message.attestation); + if (error) + return "attestation." + error; + } + return null; + }; + + /** + * Creates an AttestNetworkFee message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof common.AttestNetworkFee + * @static + * @param {Object.} object Plain object + * @returns {common.AttestNetworkFee} AttestNetworkFee + */ + AttestNetworkFee.fromObject = function fromObject(object) { + if (object instanceof $root.common.AttestNetworkFee) + return object; + var message = new $root.common.AttestNetworkFee(); + if (object.networkFee != null) { + if (typeof object.networkFee !== "object") + throw TypeError(".common.AttestNetworkFee.networkFee: object expected"); + message.networkFee = $root.common.NetworkFee.fromObject(object.networkFee); + } + if (object.attestation != null) { + if (typeof object.attestation !== "object") + throw TypeError(".common.AttestNetworkFee.attestation: object expected"); + message.attestation = $root.common.Attestation.fromObject(object.attestation); + } + return message; + }; + + /** + * Creates a plain object from an AttestNetworkFee message. Also converts values to other types if specified. + * @function toObject + * @memberof common.AttestNetworkFee + * @static + * @param {common.AttestNetworkFee} message AttestNetworkFee + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AttestNetworkFee.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.networkFee = null; + object.attestation = null; + } + if (message.networkFee != null && message.hasOwnProperty("networkFee")) + object.networkFee = $root.common.NetworkFee.toObject(message.networkFee, options); + if (message.attestation != null && message.hasOwnProperty("attestation")) + object.attestation = $root.common.Attestation.toObject(message.attestation, options); + return object; + }; + + /** + * Converts this AttestNetworkFee to JSON. + * @function toJSON + * @memberof common.AttestNetworkFee + * @instance + * @returns {Object.} JSON object + */ + AttestNetworkFee.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AttestNetworkFee; + })(); + + common.QuorumNetworkFee = (function() { + + /** + * Properties of a QuorumNetworkFee. + * @memberof common + * @interface IQuorumNetworkFee + * @property {common.INetworkFee|null} [networkFee] QuorumNetworkFee networkFee + * @property {Array.|null} [attestations] QuorumNetworkFee attestations + */ + + /** + * Constructs a new QuorumNetworkFee. + * @memberof common + * @classdesc Represents a QuorumNetworkFee. + * @implements IQuorumNetworkFee + * @constructor + * @param {common.IQuorumNetworkFee=} [properties] Properties to set + */ + function QuorumNetworkFee(properties) { + this.attestations = []; + 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]]; + } + + /** + * QuorumNetworkFee networkFee. + * @member {common.INetworkFee|null|undefined} networkFee + * @memberof common.QuorumNetworkFee + * @instance + */ + QuorumNetworkFee.prototype.networkFee = null; + + /** + * QuorumNetworkFee attestations. + * @member {Array.} attestations + * @memberof common.QuorumNetworkFee + * @instance + */ + QuorumNetworkFee.prototype.attestations = $util.emptyArray; + + /** + * Creates a new QuorumNetworkFee instance using the specified properties. + * @function create + * @memberof common.QuorumNetworkFee + * @static + * @param {common.IQuorumNetworkFee=} [properties] Properties to set + * @returns {common.QuorumNetworkFee} QuorumNetworkFee instance + */ + QuorumNetworkFee.create = function create(properties) { + return new QuorumNetworkFee(properties); + }; + + /** + * Encodes the specified QuorumNetworkFee message. Does not implicitly {@link common.QuorumNetworkFee.verify|verify} messages. + * @function encode + * @memberof common.QuorumNetworkFee + * @static + * @param {common.IQuorumNetworkFee} message QuorumNetworkFee message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuorumNetworkFee.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.networkFee != null && Object.hasOwnProperty.call(message, "networkFee")) + $root.common.NetworkFee.encode(message.networkFee, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.attestations != null && message.attestations.length) + for (var i = 0; i < message.attestations.length; ++i) + $root.common.Attestation.encode(message.attestations[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QuorumNetworkFee message, length delimited. Does not implicitly {@link common.QuorumNetworkFee.verify|verify} messages. + * @function encodeDelimited + * @memberof common.QuorumNetworkFee + * @static + * @param {common.IQuorumNetworkFee} message QuorumNetworkFee message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuorumNetworkFee.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QuorumNetworkFee message from the specified reader or buffer. + * @function decode + * @memberof common.QuorumNetworkFee + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {common.QuorumNetworkFee} QuorumNetworkFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuorumNetworkFee.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.common.QuorumNetworkFee(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.networkFee = $root.common.NetworkFee.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.attestations && message.attestations.length)) + message.attestations = []; + message.attestations.push($root.common.Attestation.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QuorumNetworkFee message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof common.QuorumNetworkFee + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {common.QuorumNetworkFee} QuorumNetworkFee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuorumNetworkFee.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QuorumNetworkFee message. + * @function verify + * @memberof common.QuorumNetworkFee + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QuorumNetworkFee.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.networkFee != null && message.hasOwnProperty("networkFee")) { + var error = $root.common.NetworkFee.verify(message.networkFee); + if (error) + return "networkFee." + error; + } + if (message.attestations != null && message.hasOwnProperty("attestations")) { + if (!Array.isArray(message.attestations)) + return "attestations: array expected"; + for (var i = 0; i < message.attestations.length; ++i) { + var error = $root.common.Attestation.verify(message.attestations[i]); + if (error) + return "attestations." + error; + } + } + return null; + }; + + /** + * Creates a QuorumNetworkFee message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof common.QuorumNetworkFee + * @static + * @param {Object.} object Plain object + * @returns {common.QuorumNetworkFee} QuorumNetworkFee + */ + QuorumNetworkFee.fromObject = function fromObject(object) { + if (object instanceof $root.common.QuorumNetworkFee) + return object; + var message = new $root.common.QuorumNetworkFee(); + if (object.networkFee != null) { + if (typeof object.networkFee !== "object") + throw TypeError(".common.QuorumNetworkFee.networkFee: object expected"); + message.networkFee = $root.common.NetworkFee.fromObject(object.networkFee); + } + if (object.attestations) { + if (!Array.isArray(object.attestations)) + throw TypeError(".common.QuorumNetworkFee.attestations: array expected"); + message.attestations = []; + for (var i = 0; i < object.attestations.length; ++i) { + if (typeof object.attestations[i] !== "object") + throw TypeError(".common.QuorumNetworkFee.attestations: object expected"); + message.attestations[i] = $root.common.Attestation.fromObject(object.attestations[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a QuorumNetworkFee message. Also converts values to other types if specified. + * @function toObject + * @memberof common.QuorumNetworkFee + * @static + * @param {common.QuorumNetworkFee} message QuorumNetworkFee + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QuorumNetworkFee.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.attestations = []; + if (options.defaults) + object.networkFee = null; + if (message.networkFee != null && message.hasOwnProperty("networkFee")) + object.networkFee = $root.common.NetworkFee.toObject(message.networkFee, options); + if (message.attestations && message.attestations.length) { + object.attestations = []; + for (var j = 0; j < message.attestations.length; ++j) + object.attestations[j] = $root.common.Attestation.toObject(message.attestations[j], options); + } + return object; + }; + + /** + * Converts this QuorumNetworkFee to JSON. + * @function toJSON + * @memberof common.QuorumNetworkFee + * @instance + * @returns {Object.} JSON object + */ + QuorumNetworkFee.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QuorumNetworkFee; + })(); + + common.Solvency = (function() { + + /** + * Properties of a Solvency. + * @memberof common + * @interface ISolvency + * @property {string|null} [id] Solvency id + * @property {string|null} [chain] Solvency chain + * @property {string|null} [pubKey] Solvency pubKey + * @property {Array.|null} [coins] Solvency coins + * @property {number|Long|null} [height] Solvency height + */ + + /** + * Constructs a new Solvency. + * @memberof common + * @classdesc Represents a Solvency. + * @implements ISolvency + * @constructor + * @param {common.ISolvency=} [properties] Properties to set + */ + function Solvency(properties) { + this.coins = []; + 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]]; + } + + /** + * Solvency id. + * @member {string} id + * @memberof common.Solvency + * @instance + */ + Solvency.prototype.id = ""; + + /** + * Solvency chain. + * @member {string} chain + * @memberof common.Solvency + * @instance + */ + Solvency.prototype.chain = ""; + + /** + * Solvency pubKey. + * @member {string} pubKey + * @memberof common.Solvency + * @instance + */ + Solvency.prototype.pubKey = ""; + + /** + * Solvency coins. + * @member {Array.} coins + * @memberof common.Solvency + * @instance + */ + Solvency.prototype.coins = $util.emptyArray; + + /** + * Solvency height. + * @member {number|Long} height + * @memberof common.Solvency + * @instance + */ + Solvency.prototype.height = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * Creates a new Solvency instance using the specified properties. + * @function create + * @memberof common.Solvency + * @static + * @param {common.ISolvency=} [properties] Properties to set + * @returns {common.Solvency} Solvency instance + */ + Solvency.create = function create(properties) { + return new Solvency(properties); + }; + + /** + * Encodes the specified Solvency message. Does not implicitly {@link common.Solvency.verify|verify} messages. + * @function encode + * @memberof common.Solvency + * @static + * @param {common.ISolvency} message Solvency message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Solvency.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.chain != null && Object.hasOwnProperty.call(message, "chain")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.chain); + if (message.pubKey != null && Object.hasOwnProperty.call(message, "pubKey")) + writer.uint32(/* id 3, wireType 2 =*/26).string(message.pubKey); + if (message.coins != null && message.coins.length) + for (var i = 0; i < message.coins.length; ++i) + $root.common.Coin.encode(message.coins[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.height != null && Object.hasOwnProperty.call(message, "height")) + writer.uint32(/* id 5, wireType 0 =*/40).int64(message.height); + return writer; + }; + + /** + * Encodes the specified Solvency message, length delimited. Does not implicitly {@link common.Solvency.verify|verify} messages. + * @function encodeDelimited + * @memberof common.Solvency + * @static + * @param {common.ISolvency} message Solvency message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + Solvency.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a Solvency message from the specified reader or buffer. + * @function decode + * @memberof common.Solvency + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {common.Solvency} Solvency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Solvency.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.common.Solvency(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.chain = reader.string(); + break; + case 3: + message.pubKey = reader.string(); + break; + case 4: + if (!(message.coins && message.coins.length)) + message.coins = []; + message.coins.push($root.common.Coin.decode(reader, reader.uint32())); + break; + case 5: + message.height = reader.int64(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a Solvency message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof common.Solvency + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {common.Solvency} Solvency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + Solvency.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a Solvency message. + * @function verify + * @memberof common.Solvency + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + Solvency.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.chain != null && message.hasOwnProperty("chain")) + if (!$util.isString(message.chain)) + return "chain: string expected"; + if (message.pubKey != null && message.hasOwnProperty("pubKey")) + if (!$util.isString(message.pubKey)) + return "pubKey: string expected"; + if (message.coins != null && message.hasOwnProperty("coins")) { + if (!Array.isArray(message.coins)) + return "coins: array expected"; + for (var i = 0; i < message.coins.length; ++i) { + var error = $root.common.Coin.verify(message.coins[i]); + if (error) + return "coins." + error; + } + } + if (message.height != null && message.hasOwnProperty("height")) + if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) + return "height: integer|Long expected"; + return null; + }; + + /** + * Creates a Solvency message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof common.Solvency + * @static + * @param {Object.} object Plain object + * @returns {common.Solvency} Solvency + */ + Solvency.fromObject = function fromObject(object) { + if (object instanceof $root.common.Solvency) + return object; + var message = new $root.common.Solvency(); + if (object.id != null) + message.id = String(object.id); + if (object.chain != null) + message.chain = String(object.chain); + if (object.pubKey != null) + message.pubKey = String(object.pubKey); + if (object.coins) { + if (!Array.isArray(object.coins)) + throw TypeError(".common.Solvency.coins: array expected"); + message.coins = []; + for (var i = 0; i < object.coins.length; ++i) { + if (typeof object.coins[i] !== "object") + throw TypeError(".common.Solvency.coins: object expected"); + message.coins[i] = $root.common.Coin.fromObject(object.coins[i]); + } + } + if (object.height != null) + if ($util.Long) + (message.height = $util.Long.fromValue(object.height)).unsigned = false; + else if (typeof object.height === "string") + message.height = parseInt(object.height, 10); + else if (typeof object.height === "number") + message.height = object.height; + else if (typeof object.height === "object") + message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(); + return message; + }; + + /** + * Creates a plain object from a Solvency message. Also converts values to other types if specified. + * @function toObject + * @memberof common.Solvency + * @static + * @param {common.Solvency} message Solvency + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + Solvency.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.coins = []; + if (options.defaults) { + object.id = ""; + object.chain = ""; + object.pubKey = ""; + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.height = options.longs === String ? "0" : 0; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.chain != null && message.hasOwnProperty("chain")) + object.chain = message.chain; + if (message.pubKey != null && message.hasOwnProperty("pubKey")) + object.pubKey = message.pubKey; + if (message.coins && message.coins.length) { + object.coins = []; + for (var j = 0; j < message.coins.length; ++j) + object.coins[j] = $root.common.Coin.toObject(message.coins[j], options); + } + if (message.height != null && message.hasOwnProperty("height")) + if (typeof message.height === "number") + object.height = options.longs === String ? String(message.height) : message.height; + else + object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber() : message.height; + return object; + }; + + /** + * Converts this Solvency to JSON. + * @function toJSON + * @memberof common.Solvency + * @instance + * @returns {Object.} JSON object + */ + Solvency.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return Solvency; + })(); + + common.AttestSolvency = (function() { + + /** + * Properties of an AttestSolvency. + * @memberof common + * @interface IAttestSolvency + * @property {common.ISolvency|null} [solvency] AttestSolvency solvency + * @property {common.IAttestation|null} [attestation] AttestSolvency attestation + */ + + /** + * Constructs a new AttestSolvency. + * @memberof common + * @classdesc Represents an AttestSolvency. + * @implements IAttestSolvency + * @constructor + * @param {common.IAttestSolvency=} [properties] Properties to set + */ + function AttestSolvency(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]]; + } + + /** + * AttestSolvency solvency. + * @member {common.ISolvency|null|undefined} solvency + * @memberof common.AttestSolvency + * @instance + */ + AttestSolvency.prototype.solvency = null; + + /** + * AttestSolvency attestation. + * @member {common.IAttestation|null|undefined} attestation + * @memberof common.AttestSolvency + * @instance + */ + AttestSolvency.prototype.attestation = null; + + /** + * Creates a new AttestSolvency instance using the specified properties. + * @function create + * @memberof common.AttestSolvency + * @static + * @param {common.IAttestSolvency=} [properties] Properties to set + * @returns {common.AttestSolvency} AttestSolvency instance + */ + AttestSolvency.create = function create(properties) { + return new AttestSolvency(properties); + }; + + /** + * Encodes the specified AttestSolvency message. Does not implicitly {@link common.AttestSolvency.verify|verify} messages. + * @function encode + * @memberof common.AttestSolvency + * @static + * @param {common.IAttestSolvency} message AttestSolvency message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttestSolvency.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.solvency != null && Object.hasOwnProperty.call(message, "solvency")) + $root.common.Solvency.encode(message.solvency, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.attestation != null && Object.hasOwnProperty.call(message, "attestation")) + $root.common.Attestation.encode(message.attestation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AttestSolvency message, length delimited. Does not implicitly {@link common.AttestSolvency.verify|verify} messages. + * @function encodeDelimited + * @memberof common.AttestSolvency + * @static + * @param {common.IAttestSolvency} message AttestSolvency message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttestSolvency.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AttestSolvency message from the specified reader or buffer. + * @function decode + * @memberof common.AttestSolvency + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {common.AttestSolvency} AttestSolvency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttestSolvency.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.common.AttestSolvency(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.solvency = $root.common.Solvency.decode(reader, reader.uint32()); + break; + case 2: + message.attestation = $root.common.Attestation.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AttestSolvency message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof common.AttestSolvency + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {common.AttestSolvency} AttestSolvency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttestSolvency.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AttestSolvency message. + * @function verify + * @memberof common.AttestSolvency + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AttestSolvency.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.solvency != null && message.hasOwnProperty("solvency")) { + var error = $root.common.Solvency.verify(message.solvency); + if (error) + return "solvency." + error; + } + if (message.attestation != null && message.hasOwnProperty("attestation")) { + var error = $root.common.Attestation.verify(message.attestation); + if (error) + return "attestation." + error; + } + return null; + }; + + /** + * Creates an AttestSolvency message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof common.AttestSolvency + * @static + * @param {Object.} object Plain object + * @returns {common.AttestSolvency} AttestSolvency + */ + AttestSolvency.fromObject = function fromObject(object) { + if (object instanceof $root.common.AttestSolvency) + return object; + var message = new $root.common.AttestSolvency(); + if (object.solvency != null) { + if (typeof object.solvency !== "object") + throw TypeError(".common.AttestSolvency.solvency: object expected"); + message.solvency = $root.common.Solvency.fromObject(object.solvency); + } + if (object.attestation != null) { + if (typeof object.attestation !== "object") + throw TypeError(".common.AttestSolvency.attestation: object expected"); + message.attestation = $root.common.Attestation.fromObject(object.attestation); + } + return message; + }; + + /** + * Creates a plain object from an AttestSolvency message. Also converts values to other types if specified. + * @function toObject + * @memberof common.AttestSolvency + * @static + * @param {common.AttestSolvency} message AttestSolvency + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AttestSolvency.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.solvency = null; + object.attestation = null; + } + if (message.solvency != null && message.hasOwnProperty("solvency")) + object.solvency = $root.common.Solvency.toObject(message.solvency, options); + if (message.attestation != null && message.hasOwnProperty("attestation")) + object.attestation = $root.common.Attestation.toObject(message.attestation, options); + return object; + }; + + /** + * Converts this AttestSolvency to JSON. + * @function toJSON + * @memberof common.AttestSolvency + * @instance + * @returns {Object.} JSON object + */ + AttestSolvency.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AttestSolvency; + })(); + + common.QuorumSolvency = (function() { + + /** + * Properties of a QuorumSolvency. + * @memberof common + * @interface IQuorumSolvency + * @property {common.ISolvency|null} [solvency] QuorumSolvency solvency + * @property {Array.|null} [attestations] QuorumSolvency attestations + */ + + /** + * Constructs a new QuorumSolvency. + * @memberof common + * @classdesc Represents a QuorumSolvency. + * @implements IQuorumSolvency + * @constructor + * @param {common.IQuorumSolvency=} [properties] Properties to set + */ + function QuorumSolvency(properties) { + this.attestations = []; + 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]]; + } + + /** + * QuorumSolvency solvency. + * @member {common.ISolvency|null|undefined} solvency + * @memberof common.QuorumSolvency + * @instance + */ + QuorumSolvency.prototype.solvency = null; + + /** + * QuorumSolvency attestations. + * @member {Array.} attestations + * @memberof common.QuorumSolvency + * @instance + */ + QuorumSolvency.prototype.attestations = $util.emptyArray; + + /** + * Creates a new QuorumSolvency instance using the specified properties. + * @function create + * @memberof common.QuorumSolvency + * @static + * @param {common.IQuorumSolvency=} [properties] Properties to set + * @returns {common.QuorumSolvency} QuorumSolvency instance + */ + QuorumSolvency.create = function create(properties) { + return new QuorumSolvency(properties); + }; + + /** + * Encodes the specified QuorumSolvency message. Does not implicitly {@link common.QuorumSolvency.verify|verify} messages. + * @function encode + * @memberof common.QuorumSolvency + * @static + * @param {common.IQuorumSolvency} message QuorumSolvency message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuorumSolvency.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.solvency != null && Object.hasOwnProperty.call(message, "solvency")) + $root.common.Solvency.encode(message.solvency, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.attestations != null && message.attestations.length) + for (var i = 0; i < message.attestations.length; ++i) + $root.common.Attestation.encode(message.attestations[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QuorumSolvency message, length delimited. Does not implicitly {@link common.QuorumSolvency.verify|verify} messages. + * @function encodeDelimited + * @memberof common.QuorumSolvency + * @static + * @param {common.IQuorumSolvency} message QuorumSolvency message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuorumSolvency.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QuorumSolvency message from the specified reader or buffer. + * @function decode + * @memberof common.QuorumSolvency + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {common.QuorumSolvency} QuorumSolvency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuorumSolvency.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.common.QuorumSolvency(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.solvency = $root.common.Solvency.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.attestations && message.attestations.length)) + message.attestations = []; + message.attestations.push($root.common.Attestation.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QuorumSolvency message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof common.QuorumSolvency + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {common.QuorumSolvency} QuorumSolvency + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuorumSolvency.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QuorumSolvency message. + * @function verify + * @memberof common.QuorumSolvency + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QuorumSolvency.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.solvency != null && message.hasOwnProperty("solvency")) { + var error = $root.common.Solvency.verify(message.solvency); + if (error) + return "solvency." + error; + } + if (message.attestations != null && message.hasOwnProperty("attestations")) { + if (!Array.isArray(message.attestations)) + return "attestations: array expected"; + for (var i = 0; i < message.attestations.length; ++i) { + var error = $root.common.Attestation.verify(message.attestations[i]); + if (error) + return "attestations." + error; + } + } + return null; + }; + + /** + * Creates a QuorumSolvency message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof common.QuorumSolvency + * @static + * @param {Object.} object Plain object + * @returns {common.QuorumSolvency} QuorumSolvency + */ + QuorumSolvency.fromObject = function fromObject(object) { + if (object instanceof $root.common.QuorumSolvency) + return object; + var message = new $root.common.QuorumSolvency(); + if (object.solvency != null) { + if (typeof object.solvency !== "object") + throw TypeError(".common.QuorumSolvency.solvency: object expected"); + message.solvency = $root.common.Solvency.fromObject(object.solvency); + } + if (object.attestations) { + if (!Array.isArray(object.attestations)) + throw TypeError(".common.QuorumSolvency.attestations: array expected"); + message.attestations = []; + for (var i = 0; i < object.attestations.length; ++i) { + if (typeof object.attestations[i] !== "object") + throw TypeError(".common.QuorumSolvency.attestations: object expected"); + message.attestations[i] = $root.common.Attestation.fromObject(object.attestations[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a QuorumSolvency message. Also converts values to other types if specified. + * @function toObject + * @memberof common.QuorumSolvency + * @static + * @param {common.QuorumSolvency} message QuorumSolvency + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QuorumSolvency.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.attestations = []; + if (options.defaults) + object.solvency = null; + if (message.solvency != null && message.hasOwnProperty("solvency")) + object.solvency = $root.common.Solvency.toObject(message.solvency, options); + if (message.attestations && message.attestations.length) { + object.attestations = []; + for (var j = 0; j < message.attestations.length; ++j) + object.attestations[j] = $root.common.Attestation.toObject(message.attestations[j], options); + } + return object; + }; + + /** + * Converts this QuorumSolvency to JSON. + * @function toJSON + * @memberof common.QuorumSolvency + * @instance + * @returns {Object.} JSON object + */ + QuorumSolvency.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QuorumSolvency; + })(); + + common.ErrataTx = (function() { + + /** + * Properties of an ErrataTx. + * @memberof common + * @interface IErrataTx + * @property {string|null} [id] ErrataTx id + * @property {string|null} [chain] ErrataTx chain + */ + + /** + * Constructs a new ErrataTx. + * @memberof common + * @classdesc Represents an ErrataTx. + * @implements IErrataTx + * @constructor + * @param {common.IErrataTx=} [properties] Properties to set + */ + function ErrataTx(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]]; + } + + /** + * ErrataTx id. + * @member {string} id + * @memberof common.ErrataTx + * @instance + */ + ErrataTx.prototype.id = ""; + + /** + * ErrataTx chain. + * @member {string} chain + * @memberof common.ErrataTx + * @instance + */ + ErrataTx.prototype.chain = ""; + + /** + * Creates a new ErrataTx instance using the specified properties. + * @function create + * @memberof common.ErrataTx + * @static + * @param {common.IErrataTx=} [properties] Properties to set + * @returns {common.ErrataTx} ErrataTx instance + */ + ErrataTx.create = function create(properties) { + return new ErrataTx(properties); + }; + + /** + * Encodes the specified ErrataTx message. Does not implicitly {@link common.ErrataTx.verify|verify} messages. + * @function encode + * @memberof common.ErrataTx + * @static + * @param {common.IErrataTx} message ErrataTx message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ErrataTx.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.id != null && Object.hasOwnProperty.call(message, "id")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); + if (message.chain != null && Object.hasOwnProperty.call(message, "chain")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.chain); + return writer; + }; + + /** + * Encodes the specified ErrataTx message, length delimited. Does not implicitly {@link common.ErrataTx.verify|verify} messages. + * @function encodeDelimited + * @memberof common.ErrataTx + * @static + * @param {common.IErrataTx} message ErrataTx message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + ErrataTx.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an ErrataTx message from the specified reader or buffer. + * @function decode + * @memberof common.ErrataTx + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {common.ErrataTx} ErrataTx + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ErrataTx.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.common.ErrataTx(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.id = reader.string(); + break; + case 2: + message.chain = reader.string(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an ErrataTx message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof common.ErrataTx + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {common.ErrataTx} ErrataTx + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + ErrataTx.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an ErrataTx message. + * @function verify + * @memberof common.ErrataTx + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + ErrataTx.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.id != null && message.hasOwnProperty("id")) + if (!$util.isString(message.id)) + return "id: string expected"; + if (message.chain != null && message.hasOwnProperty("chain")) + if (!$util.isString(message.chain)) + return "chain: string expected"; + return null; + }; + + /** + * Creates an ErrataTx message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof common.ErrataTx + * @static + * @param {Object.} object Plain object + * @returns {common.ErrataTx} ErrataTx + */ + ErrataTx.fromObject = function fromObject(object) { + if (object instanceof $root.common.ErrataTx) + return object; + var message = new $root.common.ErrataTx(); + if (object.id != null) + message.id = String(object.id); + if (object.chain != null) + message.chain = String(object.chain); + return message; + }; + + /** + * Creates a plain object from an ErrataTx message. Also converts values to other types if specified. + * @function toObject + * @memberof common.ErrataTx + * @static + * @param {common.ErrataTx} message ErrataTx + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + ErrataTx.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.id = ""; + object.chain = ""; + } + if (message.id != null && message.hasOwnProperty("id")) + object.id = message.id; + if (message.chain != null && message.hasOwnProperty("chain")) + object.chain = message.chain; + return object; + }; + + /** + * Converts this ErrataTx to JSON. + * @function toJSON + * @memberof common.ErrataTx + * @instance + * @returns {Object.} JSON object + */ + ErrataTx.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return ErrataTx; + })(); + + common.AttestErrataTx = (function() { + + /** + * Properties of an AttestErrataTx. + * @memberof common + * @interface IAttestErrataTx + * @property {common.IErrataTx|null} [errataTx] AttestErrataTx errataTx + * @property {common.IAttestation|null} [attestation] AttestErrataTx attestation + */ + + /** + * Constructs a new AttestErrataTx. + * @memberof common + * @classdesc Represents an AttestErrataTx. + * @implements IAttestErrataTx + * @constructor + * @param {common.IAttestErrataTx=} [properties] Properties to set + */ + function AttestErrataTx(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]]; + } + + /** + * AttestErrataTx errataTx. + * @member {common.IErrataTx|null|undefined} errataTx + * @memberof common.AttestErrataTx + * @instance + */ + AttestErrataTx.prototype.errataTx = null; + + /** + * AttestErrataTx attestation. + * @member {common.IAttestation|null|undefined} attestation + * @memberof common.AttestErrataTx + * @instance + */ + AttestErrataTx.prototype.attestation = null; + + /** + * Creates a new AttestErrataTx instance using the specified properties. + * @function create + * @memberof common.AttestErrataTx + * @static + * @param {common.IAttestErrataTx=} [properties] Properties to set + * @returns {common.AttestErrataTx} AttestErrataTx instance + */ + AttestErrataTx.create = function create(properties) { + return new AttestErrataTx(properties); + }; + + /** + * Encodes the specified AttestErrataTx message. Does not implicitly {@link common.AttestErrataTx.verify|verify} messages. + * @function encode + * @memberof common.AttestErrataTx + * @static + * @param {common.IAttestErrataTx} message AttestErrataTx message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttestErrataTx.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.errataTx != null && Object.hasOwnProperty.call(message, "errataTx")) + $root.common.ErrataTx.encode(message.errataTx, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.attestation != null && Object.hasOwnProperty.call(message, "attestation")) + $root.common.Attestation.encode(message.attestation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AttestErrataTx message, length delimited. Does not implicitly {@link common.AttestErrataTx.verify|verify} messages. + * @function encodeDelimited + * @memberof common.AttestErrataTx + * @static + * @param {common.IAttestErrataTx} message AttestErrataTx message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttestErrataTx.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AttestErrataTx message from the specified reader or buffer. + * @function decode + * @memberof common.AttestErrataTx + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {common.AttestErrataTx} AttestErrataTx + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttestErrataTx.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.common.AttestErrataTx(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.errataTx = $root.common.ErrataTx.decode(reader, reader.uint32()); + break; + case 2: + message.attestation = $root.common.Attestation.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AttestErrataTx message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof common.AttestErrataTx + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {common.AttestErrataTx} AttestErrataTx + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttestErrataTx.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AttestErrataTx message. + * @function verify + * @memberof common.AttestErrataTx + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AttestErrataTx.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.errataTx != null && message.hasOwnProperty("errataTx")) { + var error = $root.common.ErrataTx.verify(message.errataTx); + if (error) + return "errataTx." + error; + } + if (message.attestation != null && message.hasOwnProperty("attestation")) { + var error = $root.common.Attestation.verify(message.attestation); + if (error) + return "attestation." + error; + } + return null; + }; + + /** + * Creates an AttestErrataTx message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof common.AttestErrataTx + * @static + * @param {Object.} object Plain object + * @returns {common.AttestErrataTx} AttestErrataTx + */ + AttestErrataTx.fromObject = function fromObject(object) { + if (object instanceof $root.common.AttestErrataTx) + return object; + var message = new $root.common.AttestErrataTx(); + if (object.errataTx != null) { + if (typeof object.errataTx !== "object") + throw TypeError(".common.AttestErrataTx.errataTx: object expected"); + message.errataTx = $root.common.ErrataTx.fromObject(object.errataTx); + } + if (object.attestation != null) { + if (typeof object.attestation !== "object") + throw TypeError(".common.AttestErrataTx.attestation: object expected"); + message.attestation = $root.common.Attestation.fromObject(object.attestation); + } + return message; + }; + + /** + * Creates a plain object from an AttestErrataTx message. Also converts values to other types if specified. + * @function toObject + * @memberof common.AttestErrataTx + * @static + * @param {common.AttestErrataTx} message AttestErrataTx + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AttestErrataTx.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.errataTx = null; + object.attestation = null; + } + if (message.errataTx != null && message.hasOwnProperty("errataTx")) + object.errataTx = $root.common.ErrataTx.toObject(message.errataTx, options); + if (message.attestation != null && message.hasOwnProperty("attestation")) + object.attestation = $root.common.Attestation.toObject(message.attestation, options); + return object; + }; + + /** + * Converts this AttestErrataTx to JSON. + * @function toJSON + * @memberof common.AttestErrataTx + * @instance + * @returns {Object.} JSON object + */ + AttestErrataTx.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AttestErrataTx; + })(); + + common.QuorumErrataTx = (function() { + + /** + * Properties of a QuorumErrataTx. + * @memberof common + * @interface IQuorumErrataTx + * @property {common.IErrataTx|null} [errataTx] QuorumErrataTx errataTx + * @property {Array.|null} [attestations] QuorumErrataTx attestations + */ + + /** + * Constructs a new QuorumErrataTx. + * @memberof common + * @classdesc Represents a QuorumErrataTx. + * @implements IQuorumErrataTx + * @constructor + * @param {common.IQuorumErrataTx=} [properties] Properties to set + */ + function QuorumErrataTx(properties) { + this.attestations = []; + 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]]; + } + + /** + * QuorumErrataTx errataTx. + * @member {common.IErrataTx|null|undefined} errataTx + * @memberof common.QuorumErrataTx + * @instance + */ + QuorumErrataTx.prototype.errataTx = null; + + /** + * QuorumErrataTx attestations. + * @member {Array.} attestations + * @memberof common.QuorumErrataTx + * @instance + */ + QuorumErrataTx.prototype.attestations = $util.emptyArray; + + /** + * Creates a new QuorumErrataTx instance using the specified properties. + * @function create + * @memberof common.QuorumErrataTx + * @static + * @param {common.IQuorumErrataTx=} [properties] Properties to set + * @returns {common.QuorumErrataTx} QuorumErrataTx instance + */ + QuorumErrataTx.create = function create(properties) { + return new QuorumErrataTx(properties); + }; + + /** + * Encodes the specified QuorumErrataTx message. Does not implicitly {@link common.QuorumErrataTx.verify|verify} messages. + * @function encode + * @memberof common.QuorumErrataTx + * @static + * @param {common.IQuorumErrataTx} message QuorumErrataTx message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuorumErrataTx.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.errataTx != null && Object.hasOwnProperty.call(message, "errataTx")) + $root.common.ErrataTx.encode(message.errataTx, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.attestations != null && message.attestations.length) + for (var i = 0; i < message.attestations.length; ++i) + $root.common.Attestation.encode(message.attestations[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QuorumErrataTx message, length delimited. Does not implicitly {@link common.QuorumErrataTx.verify|verify} messages. + * @function encodeDelimited + * @memberof common.QuorumErrataTx + * @static + * @param {common.IQuorumErrataTx} message QuorumErrataTx message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuorumErrataTx.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QuorumErrataTx message from the specified reader or buffer. + * @function decode + * @memberof common.QuorumErrataTx + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {common.QuorumErrataTx} QuorumErrataTx + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuorumErrataTx.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.common.QuorumErrataTx(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.errataTx = $root.common.ErrataTx.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.attestations && message.attestations.length)) + message.attestations = []; + message.attestations.push($root.common.Attestation.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QuorumErrataTx message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof common.QuorumErrataTx + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {common.QuorumErrataTx} QuorumErrataTx + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuorumErrataTx.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QuorumErrataTx message. + * @function verify + * @memberof common.QuorumErrataTx + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QuorumErrataTx.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.errataTx != null && message.hasOwnProperty("errataTx")) { + var error = $root.common.ErrataTx.verify(message.errataTx); + if (error) + return "errataTx." + error; + } + if (message.attestations != null && message.hasOwnProperty("attestations")) { + if (!Array.isArray(message.attestations)) + return "attestations: array expected"; + for (var i = 0; i < message.attestations.length; ++i) { + var error = $root.common.Attestation.verify(message.attestations[i]); + if (error) + return "attestations." + error; + } + } + return null; + }; + + /** + * Creates a QuorumErrataTx message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof common.QuorumErrataTx + * @static + * @param {Object.} object Plain object + * @returns {common.QuorumErrataTx} QuorumErrataTx + */ + QuorumErrataTx.fromObject = function fromObject(object) { + if (object instanceof $root.common.QuorumErrataTx) + return object; + var message = new $root.common.QuorumErrataTx(); + if (object.errataTx != null) { + if (typeof object.errataTx !== "object") + throw TypeError(".common.QuorumErrataTx.errataTx: object expected"); + message.errataTx = $root.common.ErrataTx.fromObject(object.errataTx); + } + if (object.attestations) { + if (!Array.isArray(object.attestations)) + throw TypeError(".common.QuorumErrataTx.attestations: array expected"); + message.attestations = []; + for (var i = 0; i < object.attestations.length; ++i) { + if (typeof object.attestations[i] !== "object") + throw TypeError(".common.QuorumErrataTx.attestations: object expected"); + message.attestations[i] = $root.common.Attestation.fromObject(object.attestations[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a QuorumErrataTx message. Also converts values to other types if specified. + * @function toObject + * @memberof common.QuorumErrataTx + * @static + * @param {common.QuorumErrataTx} message QuorumErrataTx + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QuorumErrataTx.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.attestations = []; + if (options.defaults) + object.errataTx = null; + if (message.errataTx != null && message.hasOwnProperty("errataTx")) + object.errataTx = $root.common.ErrataTx.toObject(message.errataTx, options); + if (message.attestations && message.attestations.length) { + object.attestations = []; + for (var j = 0; j < message.attestations.length; ++j) + object.attestations[j] = $root.common.Attestation.toObject(message.attestations[j], options); + } + return object; + }; + + /** + * Converts this QuorumErrataTx to JSON. + * @function toJSON + * @memberof common.QuorumErrataTx + * @instance + * @returns {Object.} JSON object + */ + QuorumErrataTx.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QuorumErrataTx; + })(); + + common.PriceFeed = (function() { + + /** + * Properties of a PriceFeed. + * @memberof common + * @interface IPriceFeed + * @property {Uint8Array|null} [version] PriceFeed version + * @property {number|Long|null} [time] PriceFeed time + * @property {Array.|null} [rates] PriceFeed rates + */ + + /** + * Constructs a new PriceFeed. + * @memberof common + * @classdesc Represents a PriceFeed. + * @implements IPriceFeed + * @constructor + * @param {common.IPriceFeed=} [properties] Properties to set + */ + function PriceFeed(properties) { + this.rates = []; + 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]]; + } + + /** + * PriceFeed version. + * @member {Uint8Array} version + * @memberof common.PriceFeed + * @instance + */ + PriceFeed.prototype.version = $util.newBuffer([]); + + /** + * PriceFeed time. + * @member {number|Long} time + * @memberof common.PriceFeed + * @instance + */ + PriceFeed.prototype.time = $util.Long ? $util.Long.fromBits(0,0,false) : 0; + + /** + * PriceFeed rates. + * @member {Array.} rates + * @memberof common.PriceFeed + * @instance + */ + PriceFeed.prototype.rates = $util.emptyArray; + + /** + * Creates a new PriceFeed instance using the specified properties. + * @function create + * @memberof common.PriceFeed + * @static + * @param {common.IPriceFeed=} [properties] Properties to set + * @returns {common.PriceFeed} PriceFeed instance + */ + PriceFeed.create = function create(properties) { + return new PriceFeed(properties); + }; + + /** + * Encodes the specified PriceFeed message. Does not implicitly {@link common.PriceFeed.verify|verify} messages. + * @function encode + * @memberof common.PriceFeed + * @static + * @param {common.IPriceFeed} message PriceFeed message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PriceFeed.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.version != null && Object.hasOwnProperty.call(message, "version")) + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.version); + if (message.time != null && Object.hasOwnProperty.call(message, "time")) + writer.uint32(/* id 2, wireType 0 =*/16).int64(message.time); + if (message.rates != null && message.rates.length) + for (var i = 0; i < message.rates.length; ++i) + $root.common.OraclePrice.encode(message.rates[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified PriceFeed message, length delimited. Does not implicitly {@link common.PriceFeed.verify|verify} messages. + * @function encodeDelimited + * @memberof common.PriceFeed + * @static + * @param {common.IPriceFeed} message PriceFeed message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + PriceFeed.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a PriceFeed message from the specified reader or buffer. + * @function decode + * @memberof common.PriceFeed + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {common.PriceFeed} PriceFeed + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PriceFeed.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.common.PriceFeed(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.version = reader.bytes(); + break; + case 2: + message.time = reader.int64(); + break; + case 3: + if (!(message.rates && message.rates.length)) + message.rates = []; + message.rates.push($root.common.OraclePrice.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a PriceFeed message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof common.PriceFeed + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {common.PriceFeed} PriceFeed + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + PriceFeed.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a PriceFeed message. + * @function verify + * @memberof common.PriceFeed + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + PriceFeed.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.version != null && message.hasOwnProperty("version")) + if (!(message.version && typeof message.version.length === "number" || $util.isString(message.version))) + return "version: buffer expected"; + if (message.time != null && message.hasOwnProperty("time")) + if (!$util.isInteger(message.time) && !(message.time && $util.isInteger(message.time.low) && $util.isInteger(message.time.high))) + return "time: integer|Long expected"; + if (message.rates != null && message.hasOwnProperty("rates")) { + if (!Array.isArray(message.rates)) + return "rates: array expected"; + for (var i = 0; i < message.rates.length; ++i) { + var error = $root.common.OraclePrice.verify(message.rates[i]); + if (error) + return "rates." + error; + } + } + return null; + }; + + /** + * Creates a PriceFeed message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof common.PriceFeed + * @static + * @param {Object.} object Plain object + * @returns {common.PriceFeed} PriceFeed + */ + PriceFeed.fromObject = function fromObject(object) { + if (object instanceof $root.common.PriceFeed) + return object; + var message = new $root.common.PriceFeed(); + if (object.version != null) + if (typeof object.version === "string") + $util.base64.decode(object.version, message.version = $util.newBuffer($util.base64.length(object.version)), 0); + else if (object.version.length) + message.version = object.version; + if (object.time != null) + if ($util.Long) + (message.time = $util.Long.fromValue(object.time)).unsigned = false; + else if (typeof object.time === "string") + message.time = parseInt(object.time, 10); + else if (typeof object.time === "number") + message.time = object.time; + else if (typeof object.time === "object") + message.time = new $util.LongBits(object.time.low >>> 0, object.time.high >>> 0).toNumber(); + if (object.rates) { + if (!Array.isArray(object.rates)) + throw TypeError(".common.PriceFeed.rates: array expected"); + message.rates = []; + for (var i = 0; i < object.rates.length; ++i) { + if (typeof object.rates[i] !== "object") + throw TypeError(".common.PriceFeed.rates: object expected"); + message.rates[i] = $root.common.OraclePrice.fromObject(object.rates[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a PriceFeed message. Also converts values to other types if specified. + * @function toObject + * @memberof common.PriceFeed + * @static + * @param {common.PriceFeed} message PriceFeed + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + PriceFeed.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.rates = []; + if (options.defaults) { + if (options.bytes === String) + object.version = ""; + else { + object.version = []; + if (options.bytes !== Array) + object.version = $util.newBuffer(object.version); + } + if ($util.Long) { + var long = new $util.Long(0, 0, false); + object.time = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.time = options.longs === String ? "0" : 0; + } + if (message.version != null && message.hasOwnProperty("version")) + object.version = options.bytes === String ? $util.base64.encode(message.version, 0, message.version.length) : options.bytes === Array ? Array.prototype.slice.call(message.version) : message.version; + if (message.time != null && message.hasOwnProperty("time")) + if (typeof message.time === "number") + object.time = options.longs === String ? String(message.time) : message.time; + else + object.time = options.longs === String ? $util.Long.prototype.toString.call(message.time) : options.longs === Number ? new $util.LongBits(message.time.low >>> 0, message.time.high >>> 0).toNumber() : message.time; + if (message.rates && message.rates.length) { + object.rates = []; + for (var j = 0; j < message.rates.length; ++j) + object.rates[j] = $root.common.OraclePrice.toObject(message.rates[j], options); + } + return object; + }; + + /** + * Converts this PriceFeed to JSON. + * @function toJSON + * @memberof common.PriceFeed + * @instance + * @returns {Object.} JSON object + */ + PriceFeed.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return PriceFeed; + })(); + + common.AttestPriceFeed = (function() { + + /** + * Properties of an AttestPriceFeed. + * @memberof common + * @interface IAttestPriceFeed + * @property {common.IPriceFeed|null} [priceFeed] AttestPriceFeed priceFeed + * @property {common.IAttestation|null} [attestation] AttestPriceFeed attestation + */ + + /** + * Constructs a new AttestPriceFeed. + * @memberof common + * @classdesc Represents an AttestPriceFeed. + * @implements IAttestPriceFeed + * @constructor + * @param {common.IAttestPriceFeed=} [properties] Properties to set + */ + function AttestPriceFeed(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]]; + } + + /** + * AttestPriceFeed priceFeed. + * @member {common.IPriceFeed|null|undefined} priceFeed + * @memberof common.AttestPriceFeed + * @instance + */ + AttestPriceFeed.prototype.priceFeed = null; + + /** + * AttestPriceFeed attestation. + * @member {common.IAttestation|null|undefined} attestation + * @memberof common.AttestPriceFeed + * @instance + */ + AttestPriceFeed.prototype.attestation = null; + + /** + * Creates a new AttestPriceFeed instance using the specified properties. + * @function create + * @memberof common.AttestPriceFeed + * @static + * @param {common.IAttestPriceFeed=} [properties] Properties to set + * @returns {common.AttestPriceFeed} AttestPriceFeed instance + */ + AttestPriceFeed.create = function create(properties) { + return new AttestPriceFeed(properties); + }; + + /** + * Encodes the specified AttestPriceFeed message. Does not implicitly {@link common.AttestPriceFeed.verify|verify} messages. + * @function encode + * @memberof common.AttestPriceFeed + * @static + * @param {common.IAttestPriceFeed} message AttestPriceFeed message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttestPriceFeed.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.priceFeed != null && Object.hasOwnProperty.call(message, "priceFeed")) + $root.common.PriceFeed.encode(message.priceFeed, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.attestation != null && Object.hasOwnProperty.call(message, "attestation")) + $root.common.Attestation.encode(message.attestation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AttestPriceFeed message, length delimited. Does not implicitly {@link common.AttestPriceFeed.verify|verify} messages. + * @function encodeDelimited + * @memberof common.AttestPriceFeed + * @static + * @param {common.IAttestPriceFeed} message AttestPriceFeed message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttestPriceFeed.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AttestPriceFeed message from the specified reader or buffer. + * @function decode + * @memberof common.AttestPriceFeed + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {common.AttestPriceFeed} AttestPriceFeed + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttestPriceFeed.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.common.AttestPriceFeed(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.priceFeed = $root.common.PriceFeed.decode(reader, reader.uint32()); + break; + case 2: + message.attestation = $root.common.Attestation.decode(reader, reader.uint32()); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AttestPriceFeed message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof common.AttestPriceFeed + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {common.AttestPriceFeed} AttestPriceFeed + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttestPriceFeed.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AttestPriceFeed message. + * @function verify + * @memberof common.AttestPriceFeed + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AttestPriceFeed.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.priceFeed != null && message.hasOwnProperty("priceFeed")) { + var error = $root.common.PriceFeed.verify(message.priceFeed); + if (error) + return "priceFeed." + error; + } + if (message.attestation != null && message.hasOwnProperty("attestation")) { + var error = $root.common.Attestation.verify(message.attestation); + if (error) + return "attestation." + error; + } + return null; + }; + + /** + * Creates an AttestPriceFeed message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof common.AttestPriceFeed + * @static + * @param {Object.} object Plain object + * @returns {common.AttestPriceFeed} AttestPriceFeed + */ + AttestPriceFeed.fromObject = function fromObject(object) { + if (object instanceof $root.common.AttestPriceFeed) + return object; + var message = new $root.common.AttestPriceFeed(); + if (object.priceFeed != null) { + if (typeof object.priceFeed !== "object") + throw TypeError(".common.AttestPriceFeed.priceFeed: object expected"); + message.priceFeed = $root.common.PriceFeed.fromObject(object.priceFeed); + } + if (object.attestation != null) { + if (typeof object.attestation !== "object") + throw TypeError(".common.AttestPriceFeed.attestation: object expected"); + message.attestation = $root.common.Attestation.fromObject(object.attestation); + } + return message; + }; + + /** + * Creates a plain object from an AttestPriceFeed message. Also converts values to other types if specified. + * @function toObject + * @memberof common.AttestPriceFeed + * @static + * @param {common.AttestPriceFeed} message AttestPriceFeed + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AttestPriceFeed.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + object.priceFeed = null; + object.attestation = null; + } + if (message.priceFeed != null && message.hasOwnProperty("priceFeed")) + object.priceFeed = $root.common.PriceFeed.toObject(message.priceFeed, options); + if (message.attestation != null && message.hasOwnProperty("attestation")) + object.attestation = $root.common.Attestation.toObject(message.attestation, options); + return object; + }; + + /** + * Converts this AttestPriceFeed to JSON. + * @function toJSON + * @memberof common.AttestPriceFeed + * @instance + * @returns {Object.} JSON object + */ + AttestPriceFeed.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AttestPriceFeed; + })(); + + common.QuorumPriceFeed = (function() { + + /** + * Properties of a QuorumPriceFeed. + * @memberof common + * @interface IQuorumPriceFeed + * @property {common.IPriceFeed|null} [priceFeed] QuorumPriceFeed priceFeed + * @property {Array.|null} [attestations] QuorumPriceFeed attestations + */ + + /** + * Constructs a new QuorumPriceFeed. + * @memberof common + * @classdesc Represents a QuorumPriceFeed. + * @implements IQuorumPriceFeed + * @constructor + * @param {common.IQuorumPriceFeed=} [properties] Properties to set + */ + function QuorumPriceFeed(properties) { + this.attestations = []; + 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]]; + } + + /** + * QuorumPriceFeed priceFeed. + * @member {common.IPriceFeed|null|undefined} priceFeed + * @memberof common.QuorumPriceFeed + * @instance + */ + QuorumPriceFeed.prototype.priceFeed = null; + + /** + * QuorumPriceFeed attestations. + * @member {Array.} attestations + * @memberof common.QuorumPriceFeed + * @instance + */ + QuorumPriceFeed.prototype.attestations = $util.emptyArray; + + /** + * Creates a new QuorumPriceFeed instance using the specified properties. + * @function create + * @memberof common.QuorumPriceFeed + * @static + * @param {common.IQuorumPriceFeed=} [properties] Properties to set + * @returns {common.QuorumPriceFeed} QuorumPriceFeed instance + */ + QuorumPriceFeed.create = function create(properties) { + return new QuorumPriceFeed(properties); + }; + + /** + * Encodes the specified QuorumPriceFeed message. Does not implicitly {@link common.QuorumPriceFeed.verify|verify} messages. + * @function encode + * @memberof common.QuorumPriceFeed + * @static + * @param {common.IQuorumPriceFeed} message QuorumPriceFeed message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuorumPriceFeed.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.priceFeed != null && Object.hasOwnProperty.call(message, "priceFeed")) + $root.common.PriceFeed.encode(message.priceFeed, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.attestations != null && message.attestations.length) + for (var i = 0; i < message.attestations.length; ++i) + $root.common.Attestation.encode(message.attestations[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QuorumPriceFeed message, length delimited. Does not implicitly {@link common.QuorumPriceFeed.verify|verify} messages. + * @function encodeDelimited + * @memberof common.QuorumPriceFeed + * @static + * @param {common.IQuorumPriceFeed} message QuorumPriceFeed message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuorumPriceFeed.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QuorumPriceFeed message from the specified reader or buffer. + * @function decode + * @memberof common.QuorumPriceFeed + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {common.QuorumPriceFeed} QuorumPriceFeed + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuorumPriceFeed.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.common.QuorumPriceFeed(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.priceFeed = $root.common.PriceFeed.decode(reader, reader.uint32()); + break; + case 2: + if (!(message.attestations && message.attestations.length)) + message.attestations = []; + message.attestations.push($root.common.Attestation.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QuorumPriceFeed message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof common.QuorumPriceFeed + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {common.QuorumPriceFeed} QuorumPriceFeed + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuorumPriceFeed.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QuorumPriceFeed message. + * @function verify + * @memberof common.QuorumPriceFeed + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QuorumPriceFeed.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.priceFeed != null && message.hasOwnProperty("priceFeed")) { + var error = $root.common.PriceFeed.verify(message.priceFeed); + if (error) + return "priceFeed." + error; + } + if (message.attestations != null && message.hasOwnProperty("attestations")) { + if (!Array.isArray(message.attestations)) + return "attestations: array expected"; + for (var i = 0; i < message.attestations.length; ++i) { + var error = $root.common.Attestation.verify(message.attestations[i]); + if (error) + return "attestations." + error; + } + } + return null; + }; + + /** + * Creates a QuorumPriceFeed message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof common.QuorumPriceFeed + * @static + * @param {Object.} object Plain object + * @returns {common.QuorumPriceFeed} QuorumPriceFeed + */ + QuorumPriceFeed.fromObject = function fromObject(object) { + if (object instanceof $root.common.QuorumPriceFeed) + return object; + var message = new $root.common.QuorumPriceFeed(); + if (object.priceFeed != null) { + if (typeof object.priceFeed !== "object") + throw TypeError(".common.QuorumPriceFeed.priceFeed: object expected"); + message.priceFeed = $root.common.PriceFeed.fromObject(object.priceFeed); + } + if (object.attestations) { + if (!Array.isArray(object.attestations)) + throw TypeError(".common.QuorumPriceFeed.attestations: array expected"); + message.attestations = []; + for (var i = 0; i < object.attestations.length; ++i) { + if (typeof object.attestations[i] !== "object") + throw TypeError(".common.QuorumPriceFeed.attestations: object expected"); + message.attestations[i] = $root.common.Attestation.fromObject(object.attestations[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a QuorumPriceFeed message. Also converts values to other types if specified. + * @function toObject + * @memberof common.QuorumPriceFeed + * @static + * @param {common.QuorumPriceFeed} message QuorumPriceFeed + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QuorumPriceFeed.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.attestations = []; + if (options.defaults) + object.priceFeed = null; + if (message.priceFeed != null && message.hasOwnProperty("priceFeed")) + object.priceFeed = $root.common.PriceFeed.toObject(message.priceFeed, options); + if (message.attestations && message.attestations.length) { + object.attestations = []; + for (var j = 0; j < message.attestations.length; ++j) + object.attestations[j] = $root.common.Attestation.toObject(message.attestations[j], options); + } + return object; + }; + + /** + * Converts this QuorumPriceFeed to JSON. + * @function toJSON + * @memberof common.QuorumPriceFeed + * @instance + * @returns {Object.} JSON object + */ + QuorumPriceFeed.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QuorumPriceFeed; + })(); + + common.QuorumPriceFeedBatch = (function() { + + /** + * Properties of a QuorumPriceFeedBatch. + * @memberof common + * @interface IQuorumPriceFeedBatch + * @property {Array.|null} [quorumPriceFeeds] QuorumPriceFeedBatch quorumPriceFeeds + */ + + /** + * Constructs a new QuorumPriceFeedBatch. + * @memberof common + * @classdesc Represents a QuorumPriceFeedBatch. + * @implements IQuorumPriceFeedBatch + * @constructor + * @param {common.IQuorumPriceFeedBatch=} [properties] Properties to set + */ + function QuorumPriceFeedBatch(properties) { + this.quorumPriceFeeds = []; + 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]]; + } + + /** + * QuorumPriceFeedBatch quorumPriceFeeds. + * @member {Array.} quorumPriceFeeds + * @memberof common.QuorumPriceFeedBatch + * @instance + */ + QuorumPriceFeedBatch.prototype.quorumPriceFeeds = $util.emptyArray; + + /** + * Creates a new QuorumPriceFeedBatch instance using the specified properties. + * @function create + * @memberof common.QuorumPriceFeedBatch + * @static + * @param {common.IQuorumPriceFeedBatch=} [properties] Properties to set + * @returns {common.QuorumPriceFeedBatch} QuorumPriceFeedBatch instance + */ + QuorumPriceFeedBatch.create = function create(properties) { + return new QuorumPriceFeedBatch(properties); + }; + + /** + * Encodes the specified QuorumPriceFeedBatch message. Does not implicitly {@link common.QuorumPriceFeedBatch.verify|verify} messages. + * @function encode + * @memberof common.QuorumPriceFeedBatch + * @static + * @param {common.IQuorumPriceFeedBatch} message QuorumPriceFeedBatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuorumPriceFeedBatch.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.quorumPriceFeeds != null && message.quorumPriceFeeds.length) + for (var i = 0; i < message.quorumPriceFeeds.length; ++i) + $root.common.QuorumPriceFeed.encode(message.quorumPriceFeeds[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified QuorumPriceFeedBatch message, length delimited. Does not implicitly {@link common.QuorumPriceFeedBatch.verify|verify} messages. + * @function encodeDelimited + * @memberof common.QuorumPriceFeedBatch + * @static + * @param {common.IQuorumPriceFeedBatch} message QuorumPriceFeedBatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + QuorumPriceFeedBatch.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes a QuorumPriceFeedBatch message from the specified reader or buffer. + * @function decode + * @memberof common.QuorumPriceFeedBatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {common.QuorumPriceFeedBatch} QuorumPriceFeedBatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuorumPriceFeedBatch.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.common.QuorumPriceFeedBatch(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.quorumPriceFeeds && message.quorumPriceFeeds.length)) + message.quorumPriceFeeds = []; + message.quorumPriceFeeds.push($root.common.QuorumPriceFeed.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes a QuorumPriceFeedBatch message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof common.QuorumPriceFeedBatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {common.QuorumPriceFeedBatch} QuorumPriceFeedBatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + QuorumPriceFeedBatch.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies a QuorumPriceFeedBatch message. + * @function verify + * @memberof common.QuorumPriceFeedBatch + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + QuorumPriceFeedBatch.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.quorumPriceFeeds != null && message.hasOwnProperty("quorumPriceFeeds")) { + if (!Array.isArray(message.quorumPriceFeeds)) + return "quorumPriceFeeds: array expected"; + for (var i = 0; i < message.quorumPriceFeeds.length; ++i) { + var error = $root.common.QuorumPriceFeed.verify(message.quorumPriceFeeds[i]); + if (error) + return "quorumPriceFeeds." + error; + } + } + return null; + }; + + /** + * Creates a QuorumPriceFeedBatch message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof common.QuorumPriceFeedBatch + * @static + * @param {Object.} object Plain object + * @returns {common.QuorumPriceFeedBatch} QuorumPriceFeedBatch + */ + QuorumPriceFeedBatch.fromObject = function fromObject(object) { + if (object instanceof $root.common.QuorumPriceFeedBatch) + return object; + var message = new $root.common.QuorumPriceFeedBatch(); + if (object.quorumPriceFeeds) { + if (!Array.isArray(object.quorumPriceFeeds)) + throw TypeError(".common.QuorumPriceFeedBatch.quorumPriceFeeds: array expected"); + message.quorumPriceFeeds = []; + for (var i = 0; i < object.quorumPriceFeeds.length; ++i) { + if (typeof object.quorumPriceFeeds[i] !== "object") + throw TypeError(".common.QuorumPriceFeedBatch.quorumPriceFeeds: object expected"); + message.quorumPriceFeeds[i] = $root.common.QuorumPriceFeed.fromObject(object.quorumPriceFeeds[i]); + } + } + return message; + }; + + /** + * Creates a plain object from a QuorumPriceFeedBatch message. Also converts values to other types if specified. + * @function toObject + * @memberof common.QuorumPriceFeedBatch + * @static + * @param {common.QuorumPriceFeedBatch} message QuorumPriceFeedBatch + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + QuorumPriceFeedBatch.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.quorumPriceFeeds = []; + if (message.quorumPriceFeeds && message.quorumPriceFeeds.length) { + object.quorumPriceFeeds = []; + for (var j = 0; j < message.quorumPriceFeeds.length; ++j) + object.quorumPriceFeeds[j] = $root.common.QuorumPriceFeed.toObject(message.quorumPriceFeeds[j], options); + } + return object; + }; + + /** + * Converts this QuorumPriceFeedBatch to JSON. + * @function toJSON + * @memberof common.QuorumPriceFeedBatch + * @instance + * @returns {Object.} JSON object + */ + QuorumPriceFeedBatch.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return QuorumPriceFeedBatch; + })(); + + common.OraclePrice = (function() { + + /** + * Properties of an OraclePrice. + * @memberof common + * @interface IOraclePrice + * @property {number|Long|null} [amount] OraclePrice amount + * @property {number|null} [decimals] OraclePrice decimals + */ + + /** + * Constructs a new OraclePrice. + * @memberof common + * @classdesc Represents an OraclePrice. + * @implements IOraclePrice + * @constructor + * @param {common.IOraclePrice=} [properties] Properties to set + */ + function OraclePrice(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]]; + } + + /** + * OraclePrice amount. + * @member {number|Long} amount + * @memberof common.OraclePrice + * @instance + */ + OraclePrice.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; + + /** + * OraclePrice decimals. + * @member {number} decimals + * @memberof common.OraclePrice + * @instance + */ + OraclePrice.prototype.decimals = 0; + + /** + * Creates a new OraclePrice instance using the specified properties. + * @function create + * @memberof common.OraclePrice + * @static + * @param {common.IOraclePrice=} [properties] Properties to set + * @returns {common.OraclePrice} OraclePrice instance + */ + OraclePrice.create = function create(properties) { + return new OraclePrice(properties); + }; + + /** + * Encodes the specified OraclePrice message. Does not implicitly {@link common.OraclePrice.verify|verify} messages. + * @function encode + * @memberof common.OraclePrice + * @static + * @param {common.IOraclePrice} message OraclePrice message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OraclePrice.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) + writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.amount); + if (message.decimals != null && Object.hasOwnProperty.call(message, "decimals")) + writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.decimals); + return writer; + }; + + /** + * Encodes the specified OraclePrice message, length delimited. Does not implicitly {@link common.OraclePrice.verify|verify} messages. + * @function encodeDelimited + * @memberof common.OraclePrice + * @static + * @param {common.IOraclePrice} message OraclePrice message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + OraclePrice.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an OraclePrice message from the specified reader or buffer. + * @function decode + * @memberof common.OraclePrice + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {common.OraclePrice} OraclePrice + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OraclePrice.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.common.OraclePrice(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + message.amount = reader.uint64(); + break; + case 2: + message.decimals = reader.uint32(); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an OraclePrice message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof common.OraclePrice + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {common.OraclePrice} OraclePrice + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + OraclePrice.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an OraclePrice message. + * @function verify + * @memberof common.OraclePrice + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + OraclePrice.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.amount != null && message.hasOwnProperty("amount")) + if (!$util.isInteger(message.amount) && !(message.amount && $util.isInteger(message.amount.low) && $util.isInteger(message.amount.high))) + return "amount: integer|Long expected"; + if (message.decimals != null && message.hasOwnProperty("decimals")) + if (!$util.isInteger(message.decimals)) + return "decimals: integer expected"; + return null; + }; + + /** + * Creates an OraclePrice message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof common.OraclePrice + * @static + * @param {Object.} object Plain object + * @returns {common.OraclePrice} OraclePrice + */ + OraclePrice.fromObject = function fromObject(object) { + if (object instanceof $root.common.OraclePrice) + return object; + var message = new $root.common.OraclePrice(); + if (object.amount != null) + if ($util.Long) + (message.amount = $util.Long.fromValue(object.amount)).unsigned = true; + else if (typeof object.amount === "string") + message.amount = parseInt(object.amount, 10); + else if (typeof object.amount === "number") + message.amount = object.amount; + else if (typeof object.amount === "object") + message.amount = new $util.LongBits(object.amount.low >>> 0, object.amount.high >>> 0).toNumber(true); + if (object.decimals != null) + message.decimals = object.decimals >>> 0; + return message; + }; + + /** + * Creates a plain object from an OraclePrice message. Also converts values to other types if specified. + * @function toObject + * @memberof common.OraclePrice + * @static + * @param {common.OraclePrice} message OraclePrice + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + OraclePrice.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.defaults) { + if ($util.Long) { + var long = new $util.Long(0, 0, true); + object.amount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; + } else + object.amount = options.longs === String ? "0" : 0; + object.decimals = 0; + } + if (message.amount != null && message.hasOwnProperty("amount")) + if (typeof message.amount === "number") + object.amount = options.longs === String ? String(message.amount) : message.amount; + else + object.amount = options.longs === String ? $util.Long.prototype.toString.call(message.amount) : options.longs === Number ? new $util.LongBits(message.amount.low >>> 0, message.amount.high >>> 0).toNumber(true) : message.amount; + if (message.decimals != null && message.hasOwnProperty("decimals")) + object.decimals = message.decimals; + return object; + }; + + /** + * Converts this OraclePrice to JSON. + * @function toJSON + * @memberof common.OraclePrice + * @instance + * @returns {Object.} JSON object + */ + OraclePrice.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return OraclePrice; + })(); + + common.AttestationBatch = (function() { + + /** + * Properties of an AttestationBatch. + * @memberof common + * @interface IAttestationBatch + * @property {Array.|null} [attestTxs] AttestationBatch attestTxs + * @property {Array.|null} [attestNetworkFees] AttestationBatch attestNetworkFees + * @property {Array.|null} [attestSolvencies] AttestationBatch attestSolvencies + * @property {Array.|null} [attestErrataTxs] AttestationBatch attestErrataTxs + * @property {Array.|null} [attestPriceFeeds] AttestationBatch attestPriceFeeds + */ + + /** + * Constructs a new AttestationBatch. + * @memberof common + * @classdesc Represents an AttestationBatch. + * @implements IAttestationBatch + * @constructor + * @param {common.IAttestationBatch=} [properties] Properties to set + */ + function AttestationBatch(properties) { + this.attestTxs = []; + this.attestNetworkFees = []; + this.attestSolvencies = []; + this.attestErrataTxs = []; + this.attestPriceFeeds = []; + 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]]; + } + + /** + * AttestationBatch attestTxs. + * @member {Array.} attestTxs + * @memberof common.AttestationBatch + * @instance + */ + AttestationBatch.prototype.attestTxs = $util.emptyArray; + + /** + * AttestationBatch attestNetworkFees. + * @member {Array.} attestNetworkFees + * @memberof common.AttestationBatch + * @instance + */ + AttestationBatch.prototype.attestNetworkFees = $util.emptyArray; + + /** + * AttestationBatch attestSolvencies. + * @member {Array.} attestSolvencies + * @memberof common.AttestationBatch + * @instance + */ + AttestationBatch.prototype.attestSolvencies = $util.emptyArray; + + /** + * AttestationBatch attestErrataTxs. + * @member {Array.} attestErrataTxs + * @memberof common.AttestationBatch + * @instance + */ + AttestationBatch.prototype.attestErrataTxs = $util.emptyArray; + + /** + * AttestationBatch attestPriceFeeds. + * @member {Array.} attestPriceFeeds + * @memberof common.AttestationBatch + * @instance + */ + AttestationBatch.prototype.attestPriceFeeds = $util.emptyArray; + + /** + * Creates a new AttestationBatch instance using the specified properties. + * @function create + * @memberof common.AttestationBatch + * @static + * @param {common.IAttestationBatch=} [properties] Properties to set + * @returns {common.AttestationBatch} AttestationBatch instance + */ + AttestationBatch.create = function create(properties) { + return new AttestationBatch(properties); + }; + + /** + * Encodes the specified AttestationBatch message. Does not implicitly {@link common.AttestationBatch.verify|verify} messages. + * @function encode + * @memberof common.AttestationBatch + * @static + * @param {common.IAttestationBatch} message AttestationBatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttestationBatch.encode = function encode(message, writer) { + if (!writer) + writer = $Writer.create(); + if (message.attestTxs != null && message.attestTxs.length) + for (var i = 0; i < message.attestTxs.length; ++i) + $root.common.AttestTx.encode(message.attestTxs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.attestNetworkFees != null && message.attestNetworkFees.length) + for (var i = 0; i < message.attestNetworkFees.length; ++i) + $root.common.AttestNetworkFee.encode(message.attestNetworkFees[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); + if (message.attestSolvencies != null && message.attestSolvencies.length) + for (var i = 0; i < message.attestSolvencies.length; ++i) + $root.common.AttestSolvency.encode(message.attestSolvencies[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); + if (message.attestErrataTxs != null && message.attestErrataTxs.length) + for (var i = 0; i < message.attestErrataTxs.length; ++i) + $root.common.AttestErrataTx.encode(message.attestErrataTxs[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); + if (message.attestPriceFeeds != null && message.attestPriceFeeds.length) + for (var i = 0; i < message.attestPriceFeeds.length; ++i) + $root.common.AttestPriceFeed.encode(message.attestPriceFeeds[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); + return writer; + }; + + /** + * Encodes the specified AttestationBatch message, length delimited. Does not implicitly {@link common.AttestationBatch.verify|verify} messages. + * @function encodeDelimited + * @memberof common.AttestationBatch + * @static + * @param {common.IAttestationBatch} message AttestationBatch message or plain object to encode + * @param {$protobuf.Writer} [writer] Writer to encode to + * @returns {$protobuf.Writer} Writer + */ + AttestationBatch.encodeDelimited = function encodeDelimited(message, writer) { + return this.encode(message, writer).ldelim(); + }; + + /** + * Decodes an AttestationBatch message from the specified reader or buffer. + * @function decode + * @memberof common.AttestationBatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @param {number} [length] Message length if known beforehand + * @returns {common.AttestationBatch} AttestationBatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttestationBatch.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.common.AttestationBatch(); + while (reader.pos < end) { + var tag = reader.uint32(); + switch (tag >>> 3) { + case 1: + if (!(message.attestTxs && message.attestTxs.length)) + message.attestTxs = []; + message.attestTxs.push($root.common.AttestTx.decode(reader, reader.uint32())); + break; + case 2: + if (!(message.attestNetworkFees && message.attestNetworkFees.length)) + message.attestNetworkFees = []; + message.attestNetworkFees.push($root.common.AttestNetworkFee.decode(reader, reader.uint32())); + break; + case 3: + if (!(message.attestSolvencies && message.attestSolvencies.length)) + message.attestSolvencies = []; + message.attestSolvencies.push($root.common.AttestSolvency.decode(reader, reader.uint32())); + break; + case 4: + if (!(message.attestErrataTxs && message.attestErrataTxs.length)) + message.attestErrataTxs = []; + message.attestErrataTxs.push($root.common.AttestErrataTx.decode(reader, reader.uint32())); + break; + case 5: + if (!(message.attestPriceFeeds && message.attestPriceFeeds.length)) + message.attestPriceFeeds = []; + message.attestPriceFeeds.push($root.common.AttestPriceFeed.decode(reader, reader.uint32())); + break; + default: + reader.skipType(tag & 7); + break; + } + } + return message; + }; + + /** + * Decodes an AttestationBatch message from the specified reader or buffer, length delimited. + * @function decodeDelimited + * @memberof common.AttestationBatch + * @static + * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from + * @returns {common.AttestationBatch} AttestationBatch + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + AttestationBatch.decodeDelimited = function decodeDelimited(reader) { + if (!(reader instanceof $Reader)) + reader = new $Reader(reader); + return this.decode(reader, reader.uint32()); + }; + + /** + * Verifies an AttestationBatch message. + * @function verify + * @memberof common.AttestationBatch + * @static + * @param {Object.} message Plain object to verify + * @returns {string|null} `null` if valid, otherwise the reason why it is not + */ + AttestationBatch.verify = function verify(message) { + if (typeof message !== "object" || message === null) + return "object expected"; + if (message.attestTxs != null && message.hasOwnProperty("attestTxs")) { + if (!Array.isArray(message.attestTxs)) + return "attestTxs: array expected"; + for (var i = 0; i < message.attestTxs.length; ++i) { + var error = $root.common.AttestTx.verify(message.attestTxs[i]); + if (error) + return "attestTxs." + error; + } + } + if (message.attestNetworkFees != null && message.hasOwnProperty("attestNetworkFees")) { + if (!Array.isArray(message.attestNetworkFees)) + return "attestNetworkFees: array expected"; + for (var i = 0; i < message.attestNetworkFees.length; ++i) { + var error = $root.common.AttestNetworkFee.verify(message.attestNetworkFees[i]); + if (error) + return "attestNetworkFees." + error; + } + } + if (message.attestSolvencies != null && message.hasOwnProperty("attestSolvencies")) { + if (!Array.isArray(message.attestSolvencies)) + return "attestSolvencies: array expected"; + for (var i = 0; i < message.attestSolvencies.length; ++i) { + var error = $root.common.AttestSolvency.verify(message.attestSolvencies[i]); + if (error) + return "attestSolvencies." + error; + } + } + if (message.attestErrataTxs != null && message.hasOwnProperty("attestErrataTxs")) { + if (!Array.isArray(message.attestErrataTxs)) + return "attestErrataTxs: array expected"; + for (var i = 0; i < message.attestErrataTxs.length; ++i) { + var error = $root.common.AttestErrataTx.verify(message.attestErrataTxs[i]); + if (error) + return "attestErrataTxs." + error; + } + } + if (message.attestPriceFeeds != null && message.hasOwnProperty("attestPriceFeeds")) { + if (!Array.isArray(message.attestPriceFeeds)) + return "attestPriceFeeds: array expected"; + for (var i = 0; i < message.attestPriceFeeds.length; ++i) { + var error = $root.common.AttestPriceFeed.verify(message.attestPriceFeeds[i]); + if (error) + return "attestPriceFeeds." + error; + } + } + return null; + }; + + /** + * Creates an AttestationBatch message from a plain object. Also converts values to their respective internal types. + * @function fromObject + * @memberof common.AttestationBatch + * @static + * @param {Object.} object Plain object + * @returns {common.AttestationBatch} AttestationBatch + */ + AttestationBatch.fromObject = function fromObject(object) { + if (object instanceof $root.common.AttestationBatch) + return object; + var message = new $root.common.AttestationBatch(); + if (object.attestTxs) { + if (!Array.isArray(object.attestTxs)) + throw TypeError(".common.AttestationBatch.attestTxs: array expected"); + message.attestTxs = []; + for (var i = 0; i < object.attestTxs.length; ++i) { + if (typeof object.attestTxs[i] !== "object") + throw TypeError(".common.AttestationBatch.attestTxs: object expected"); + message.attestTxs[i] = $root.common.AttestTx.fromObject(object.attestTxs[i]); + } + } + if (object.attestNetworkFees) { + if (!Array.isArray(object.attestNetworkFees)) + throw TypeError(".common.AttestationBatch.attestNetworkFees: array expected"); + message.attestNetworkFees = []; + for (var i = 0; i < object.attestNetworkFees.length; ++i) { + if (typeof object.attestNetworkFees[i] !== "object") + throw TypeError(".common.AttestationBatch.attestNetworkFees: object expected"); + message.attestNetworkFees[i] = $root.common.AttestNetworkFee.fromObject(object.attestNetworkFees[i]); + } + } + if (object.attestSolvencies) { + if (!Array.isArray(object.attestSolvencies)) + throw TypeError(".common.AttestationBatch.attestSolvencies: array expected"); + message.attestSolvencies = []; + for (var i = 0; i < object.attestSolvencies.length; ++i) { + if (typeof object.attestSolvencies[i] !== "object") + throw TypeError(".common.AttestationBatch.attestSolvencies: object expected"); + message.attestSolvencies[i] = $root.common.AttestSolvency.fromObject(object.attestSolvencies[i]); + } + } + if (object.attestErrataTxs) { + if (!Array.isArray(object.attestErrataTxs)) + throw TypeError(".common.AttestationBatch.attestErrataTxs: array expected"); + message.attestErrataTxs = []; + for (var i = 0; i < object.attestErrataTxs.length; ++i) { + if (typeof object.attestErrataTxs[i] !== "object") + throw TypeError(".common.AttestationBatch.attestErrataTxs: object expected"); + message.attestErrataTxs[i] = $root.common.AttestErrataTx.fromObject(object.attestErrataTxs[i]); + } + } + if (object.attestPriceFeeds) { + if (!Array.isArray(object.attestPriceFeeds)) + throw TypeError(".common.AttestationBatch.attestPriceFeeds: array expected"); + message.attestPriceFeeds = []; + for (var i = 0; i < object.attestPriceFeeds.length; ++i) { + if (typeof object.attestPriceFeeds[i] !== "object") + throw TypeError(".common.AttestationBatch.attestPriceFeeds: object expected"); + message.attestPriceFeeds[i] = $root.common.AttestPriceFeed.fromObject(object.attestPriceFeeds[i]); + } + } + return message; + }; + + /** + * Creates a plain object from an AttestationBatch message. Also converts values to other types if specified. + * @function toObject + * @memberof common.AttestationBatch + * @static + * @param {common.AttestationBatch} message AttestationBatch + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + AttestationBatch.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) { + object.attestTxs = []; + object.attestNetworkFees = []; + object.attestSolvencies = []; + object.attestErrataTxs = []; + object.attestPriceFeeds = []; + } + if (message.attestTxs && message.attestTxs.length) { + object.attestTxs = []; + for (var j = 0; j < message.attestTxs.length; ++j) + object.attestTxs[j] = $root.common.AttestTx.toObject(message.attestTxs[j], options); + } + if (message.attestNetworkFees && message.attestNetworkFees.length) { + object.attestNetworkFees = []; + for (var j = 0; j < message.attestNetworkFees.length; ++j) + object.attestNetworkFees[j] = $root.common.AttestNetworkFee.toObject(message.attestNetworkFees[j], options); + } + if (message.attestSolvencies && message.attestSolvencies.length) { + object.attestSolvencies = []; + for (var j = 0; j < message.attestSolvencies.length; ++j) + object.attestSolvencies[j] = $root.common.AttestSolvency.toObject(message.attestSolvencies[j], options); + } + if (message.attestErrataTxs && message.attestErrataTxs.length) { + object.attestErrataTxs = []; + for (var j = 0; j < message.attestErrataTxs.length; ++j) + object.attestErrataTxs[j] = $root.common.AttestErrataTx.toObject(message.attestErrataTxs[j], options); + } + if (message.attestPriceFeeds && message.attestPriceFeeds.length) { + object.attestPriceFeeds = []; + for (var j = 0; j < message.attestPriceFeeds.length; ++j) + object.attestPriceFeeds[j] = $root.common.AttestPriceFeed.toObject(message.attestPriceFeeds[j], options); + } + return object; + }; + + /** + * Converts this AttestationBatch to JSON. + * @function toJSON + * @memberof common.AttestationBatch + * @instance + * @returns {Object.} JSON object + */ + AttestationBatch.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; + + return AttestationBatch; + })(); + return common; })(); From e0cc58cec03e1228a4e20b4468ac25aefeb5df6f Mon Sep 17 00:00:00 2001 From: Naq302 Date: Fri, 5 Sep 2025 10:58:49 +0930 Subject: [PATCH 2/7] Updates to scripts and reverted protos --- packages/xchain-mayachain/genMsgs.sh | 99 +- .../src/types/proto/MsgCompiled.d.ts | 3347 +---- .../src/types/proto/MsgCompiled.js | 10137 +--------------- packages/xchain-thorchain/genMsgs.sh | 73 +- .../src/types/proto/MsgCompiled.d.ts | 2071 ---- .../src/types/proto/MsgCompiled.js | 5409 --------- 6 files changed, 124 insertions(+), 21012 deletions(-) diff --git a/packages/xchain-mayachain/genMsgs.sh b/packages/xchain-mayachain/genMsgs.sh index 1ed7bbc85..964aeafce 100755 --- a/packages/xchain-mayachain/genMsgs.sh +++ b/packages/xchain-mayachain/genMsgs.sh @@ -1,55 +1,94 @@ #!/bin/bash # This script updates MAYAChain Protobuf bindings for MsgDeposit and MsgSend +set -e # Exit on any error MSG_COMPILED_OUTPUTFILE=src/types/proto/MsgCompiled.js MSG_COMPILED_TYPES_OUTPUTFILE=src/types/proto/MsgCompiled.d.ts -TMP_DIR=$(mktemp -d) +# Using local minimal proto files - no need to clone mayanode repository -tput setaf 2 -echo "Checking out https://gitlab.com/mayachain/mayanode to $TMP_DIR" -tput sgr0 -(cd "$TMP_DIR" && git clone https://gitlab.com/mayachain/mayanode) +# Download cosmos/base/v1beta1/coin.proto from cosmossdk +COSMOS_COIN_PROTO="proto/cosmos/base/v1beta1/coin.proto" +if [ ! -f "$COSMOS_COIN_PROTO" ]; then + tput setaf 2 + echo "Downloading cosmos/base/v1beta1/coin.proto from cosmossdk" + tput sgr0 + mkdir -p "proto/cosmos/base/v1beta1" + if ! curl -f -o "$COSMOS_COIN_PROTO" \ + "https://raw.githubusercontent.com/cosmos/cosmos-sdk/main/proto/cosmos/base/v1beta1/coin.proto"; then + echo "Error: Failed to download cosmos coin.proto" + exit 1 + fi + echo "✓ Downloaded cosmos coin.proto" +else + echo "✓ cosmos coin.proto already exists" +fi -# Verify proto files exist +# Verify our minimal proto files exist tput setaf 2 -echo "Checking proto files" +echo "Checking minimal proto files" tput sgr0 -ls "$TMP_DIR/mayanode/proto/mayachain/v1/common/common.proto" || echo "common.proto missing" -ls "$TMP_DIR/mayanode/proto/mayachain/v1/x/mayachain/types/msg_deposit.proto" || echo "msg_deposit.proto missing" -ls "$TMP_DIR/mayanode/proto/mayachain/v1/x/mayachain/types/msg_send.proto" || echo "msg_send.proto missing" +MISSING_FILES=0 +for proto_file in \ + "proto/common/minimal_common.proto" \ + "proto/types/minimal_msg_deposit.proto" \ + "proto/types/minimal_msg_send.proto" \ + "$COSMOS_COIN_PROTO"; do + if [ ! -f "$proto_file" ]; then + echo "Error: $(basename "$proto_file") missing" + MISSING_FILES=1 + else + echo "✓ $(basename "$proto_file") found" + fi +done -# Download cosmos/base/v1beta1/coin.proto from cosmossdk if needed -if [ ! -f "$TMP_DIR/mayanode/third_party/proto/cosmos/base/v1beta1/coin.proto" ]; then - tput setaf 2 - echo "Downloading cosmos/base/v1beta1/coin.proto from cosmossdk" - tput sgr0 - mkdir -p "$TMP_DIR/mayanode/third_party/proto/cosmos/base/v1beta1" - curl -o "$TMP_DIR/mayanode/third_party/proto/cosmos/base/v1beta1/coin.proto" \ - "https://raw.githubusercontent.com/cosmos/cosmos-sdk/main/proto/cosmos/base/v1beta1/coin.proto" +if [ $MISSING_FILES -eq 1 ]; then + echo "Error: Required proto files are missing" + exit 1 fi -# Generate Protobuf JS bindings with include path +# Generate Protobuf JS bindings using minimal proto files to prevent over-inclusion tput setaf 2 echo "Generating $MSG_COMPILED_OUTPUTFILE" tput sgr0 -yarn pbjs -w commonjs -t static-module \ - -p "$TMP_DIR/mayanode/proto" \ - -p "$TMP_DIR/mayanode/third_party/proto" \ - "$TMP_DIR/mayanode/proto/mayachain/v1/common/common.proto" \ - "$TMP_DIR/mayanode/proto/mayachain/v1/x/mayachain/types/msg_deposit.proto" \ - "$TMP_DIR/mayanode/proto/mayachain/v1/x/mayachain/types/msg_send.proto" \ - "$TMP_DIR/mayanode/third_party/proto/cosmos/base/v1beta1/coin.proto" \ - -o "$MSG_COMPILED_OUTPUTFILE" 2>pbjs_errors.txt +if ! yarn pbjs -w commonjs -t static-module \ + -p proto \ + "proto/common/minimal_common.proto" \ + "proto/types/minimal_msg_deposit.proto" \ + "proto/types/minimal_msg_send.proto" \ + "$COSMOS_COIN_PROTO" \ + -o "$MSG_COMPILED_OUTPUTFILE" 2>pbjs_errors.txt; then + echo "Error: Failed to generate JavaScript bindings" + cat pbjs_errors.txt + exit 1 +fi # Generate TypeScript definitions tput setaf 2 echo "Generating $MSG_COMPILED_TYPES_OUTPUTFILE" tput sgr0 -yarn pbts "$MSG_COMPILED_OUTPUTFILE" -o "$MSG_COMPILED_TYPES_OUTPUTFILE" 2>pbts_errors.txt +if ! yarn pbts "$MSG_COMPILED_OUTPUTFILE" -o "$MSG_COMPILED_TYPES_OUTPUTFILE" 2>pbts_errors.txt; then + echo "Error: Failed to generate TypeScript definitions" + cat pbts_errors.txt + exit 1 +fi + +# Verify generated files +if [ ! -f "$MSG_COMPILED_OUTPUTFILE" ] || [ ! -s "$MSG_COMPILED_OUTPUTFILE" ]; then + echo "Error: Generated JavaScript file is missing or empty" + exit 1 +fi + +if [ ! -f "$MSG_COMPILED_TYPES_OUTPUTFILE" ] || [ ! -s "$MSG_COMPILED_TYPES_OUTPUTFILE" ]; then + echo "Error: Generated TypeScript definitions file is missing or empty" + exit 1 +fi + +# Clean up error files if they're empty +[ ! -s pbjs_errors.txt ] && rm -f pbjs_errors.txt +[ ! -s pbts_errors.txt ] && rm -f pbts_errors.txt tput setaf 2 -echo "Removing $TMP_DIR/mayanode" +echo "✓ Successfully generated protobuf bindings" tput sgr0 -rm -rf "$TMP_DIR" diff --git a/packages/xchain-mayachain/src/types/proto/MsgCompiled.d.ts b/packages/xchain-mayachain/src/types/proto/MsgCompiled.d.ts index 74e2546eb..06a5a401c 100644 --- a/packages/xchain-mayachain/src/types/proto/MsgCompiled.d.ts +++ b/packages/xchain-mayachain/src/types/proto/MsgCompiled.d.ts @@ -19,6 +19,9 @@ export namespace common { /** Asset trade */ trade?: (boolean|null); + + /** Asset secured */ + secured?: (boolean|null); } /** Represents an Asset. */ @@ -45,6 +48,9 @@ export namespace common { /** Asset trade. */ public trade: boolean; + /** Asset secured. */ + public secured: boolean; + /** * Creates a new Asset instance using the specified properties. * @param [properties] Properties to set @@ -627,3347 +633,6 @@ export namespace common { } } -/** Namespace google. */ -export namespace google { - - /** Namespace protobuf. */ - namespace protobuf { - - /** Properties of a FileDescriptorSet. */ - interface IFileDescriptorSet { - - /** FileDescriptorSet file */ - file?: (google.protobuf.IFileDescriptorProto[]|null); - } - - /** Represents a FileDescriptorSet. */ - class FileDescriptorSet implements IFileDescriptorSet { - - /** - * Constructs a new FileDescriptorSet. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileDescriptorSet); - - /** FileDescriptorSet file. */ - public file: google.protobuf.IFileDescriptorProto[]; - - /** - * Creates a new FileDescriptorSet instance using the specified properties. - * @param [properties] Properties to set - * @returns FileDescriptorSet instance - */ - public static create(properties?: google.protobuf.IFileDescriptorSet): google.protobuf.FileDescriptorSet; - - /** - * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @param message FileDescriptorSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @param message FileDescriptorSet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFileDescriptorSet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorSet; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorSet; - - /** - * Verifies a FileDescriptorSet message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileDescriptorSet - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorSet; - - /** - * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. - * @param message FileDescriptorSet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileDescriptorSet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileDescriptorSet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a FileDescriptorProto. */ - interface IFileDescriptorProto { - - /** FileDescriptorProto name */ - name?: (string|null); - - /** FileDescriptorProto package */ - "package"?: (string|null); - - /** FileDescriptorProto dependency */ - dependency?: (string[]|null); - - /** FileDescriptorProto publicDependency */ - publicDependency?: (number[]|null); - - /** FileDescriptorProto weakDependency */ - weakDependency?: (number[]|null); - - /** FileDescriptorProto messageType */ - messageType?: (google.protobuf.IDescriptorProto[]|null); - - /** FileDescriptorProto enumType */ - enumType?: (google.protobuf.IEnumDescriptorProto[]|null); - - /** FileDescriptorProto service */ - service?: (google.protobuf.IServiceDescriptorProto[]|null); - - /** FileDescriptorProto extension */ - extension?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** FileDescriptorProto options */ - options?: (google.protobuf.IFileOptions|null); - - /** FileDescriptorProto sourceCodeInfo */ - sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); - - /** FileDescriptorProto syntax */ - syntax?: (string|null); - } - - /** Represents a FileDescriptorProto. */ - class FileDescriptorProto implements IFileDescriptorProto { - - /** - * Constructs a new FileDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileDescriptorProto); - - /** FileDescriptorProto name. */ - public name: string; - - /** FileDescriptorProto package. */ - public package: string; - - /** FileDescriptorProto dependency. */ - public dependency: string[]; - - /** FileDescriptorProto publicDependency. */ - public publicDependency: number[]; - - /** FileDescriptorProto weakDependency. */ - public weakDependency: number[]; - - /** FileDescriptorProto messageType. */ - public messageType: google.protobuf.IDescriptorProto[]; - - /** FileDescriptorProto enumType. */ - public enumType: google.protobuf.IEnumDescriptorProto[]; - - /** FileDescriptorProto service. */ - public service: google.protobuf.IServiceDescriptorProto[]; - - /** FileDescriptorProto extension. */ - public extension: google.protobuf.IFieldDescriptorProto[]; - - /** FileDescriptorProto options. */ - public options?: (google.protobuf.IFileOptions|null); - - /** FileDescriptorProto sourceCodeInfo. */ - public sourceCodeInfo?: (google.protobuf.ISourceCodeInfo|null); - - /** FileDescriptorProto syntax. */ - public syntax: string; - - /** - * Creates a new FileDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns FileDescriptorProto instance - */ - public static create(properties?: google.protobuf.IFileDescriptorProto): google.protobuf.FileDescriptorProto; - - /** - * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @param message FileDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @param message FileDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFileDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileDescriptorProto; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileDescriptorProto; - - /** - * Verifies a FileDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileDescriptorProto; - - /** - * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. - * @param message FileDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a DescriptorProto. */ - interface IDescriptorProto { - - /** DescriptorProto name */ - name?: (string|null); - - /** DescriptorProto field */ - field?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** DescriptorProto extension */ - extension?: (google.protobuf.IFieldDescriptorProto[]|null); - - /** DescriptorProto nestedType */ - nestedType?: (google.protobuf.IDescriptorProto[]|null); - - /** DescriptorProto enumType */ - enumType?: (google.protobuf.IEnumDescriptorProto[]|null); - - /** DescriptorProto extensionRange */ - extensionRange?: (google.protobuf.DescriptorProto.IExtensionRange[]|null); - - /** DescriptorProto oneofDecl */ - oneofDecl?: (google.protobuf.IOneofDescriptorProto[]|null); - - /** DescriptorProto options */ - options?: (google.protobuf.IMessageOptions|null); - - /** DescriptorProto reservedRange */ - reservedRange?: (google.protobuf.DescriptorProto.IReservedRange[]|null); - - /** DescriptorProto reservedName */ - reservedName?: (string[]|null); - } - - /** Represents a DescriptorProto. */ - class DescriptorProto implements IDescriptorProto { - - /** - * Constructs a new DescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IDescriptorProto); - - /** DescriptorProto name. */ - public name: string; - - /** DescriptorProto field. */ - public field: google.protobuf.IFieldDescriptorProto[]; - - /** DescriptorProto extension. */ - public extension: google.protobuf.IFieldDescriptorProto[]; - - /** DescriptorProto nestedType. */ - public nestedType: google.protobuf.IDescriptorProto[]; - - /** DescriptorProto enumType. */ - public enumType: google.protobuf.IEnumDescriptorProto[]; - - /** DescriptorProto extensionRange. */ - public extensionRange: google.protobuf.DescriptorProto.IExtensionRange[]; - - /** DescriptorProto oneofDecl. */ - public oneofDecl: google.protobuf.IOneofDescriptorProto[]; - - /** DescriptorProto options. */ - public options?: (google.protobuf.IMessageOptions|null); - - /** DescriptorProto reservedRange. */ - public reservedRange: google.protobuf.DescriptorProto.IReservedRange[]; - - /** DescriptorProto reservedName. */ - public reservedName: string[]; - - /** - * Creates a new DescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns DescriptorProto instance - */ - public static create(properties?: google.protobuf.IDescriptorProto): google.protobuf.DescriptorProto; - - /** - * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @param message DescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @param message DescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto; - - /** - * Verifies a DescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto; - - /** - * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. - * @param message DescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace DescriptorProto { - - /** Properties of an ExtensionRange. */ - interface IExtensionRange { - - /** ExtensionRange start */ - start?: (number|null); - - /** ExtensionRange end */ - end?: (number|null); - - /** ExtensionRange options */ - options?: (google.protobuf.IExtensionRangeOptions|null); - } - - /** Represents an ExtensionRange. */ - class ExtensionRange implements IExtensionRange { - - /** - * Constructs a new ExtensionRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.DescriptorProto.IExtensionRange); - - /** ExtensionRange start. */ - public start: number; - - /** ExtensionRange end. */ - public end: number; - - /** ExtensionRange options. */ - public options?: (google.protobuf.IExtensionRangeOptions|null); - - /** - * Creates a new ExtensionRange instance using the specified properties. - * @param [properties] Properties to set - * @returns ExtensionRange instance - */ - public static create(properties?: google.protobuf.DescriptorProto.IExtensionRange): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @param message ExtensionRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @param message ExtensionRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.DescriptorProto.IExtensionRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Verifies an ExtensionRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExtensionRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ExtensionRange; - - /** - * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. - * @param message ExtensionRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto.ExtensionRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExtensionRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ReservedRange. */ - interface IReservedRange { - - /** ReservedRange start */ - start?: (number|null); - - /** ReservedRange end */ - end?: (number|null); - } - - /** Represents a ReservedRange. */ - class ReservedRange implements IReservedRange { - - /** - * Constructs a new ReservedRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.DescriptorProto.IReservedRange); - - /** ReservedRange start. */ - public start: number; - - /** ReservedRange end. */ - public end: number; - - /** - * Creates a new ReservedRange instance using the specified properties. - * @param [properties] Properties to set - * @returns ReservedRange instance - */ - public static create(properties?: google.protobuf.DescriptorProto.IReservedRange): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @param message ReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @param message ReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.DescriptorProto.IReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ReservedRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Decodes a ReservedRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Verifies a ReservedRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ReservedRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.DescriptorProto.ReservedRange; - - /** - * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. - * @param message ReservedRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.DescriptorProto.ReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ReservedRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Properties of an ExtensionRangeOptions. */ - interface IExtensionRangeOptions { - - /** ExtensionRangeOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an ExtensionRangeOptions. */ - class ExtensionRangeOptions implements IExtensionRangeOptions { - - /** - * Constructs a new ExtensionRangeOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IExtensionRangeOptions); - - /** ExtensionRangeOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new ExtensionRangeOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns ExtensionRangeOptions instance - */ - public static create(properties?: google.protobuf.IExtensionRangeOptions): google.protobuf.ExtensionRangeOptions; - - /** - * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @param message ExtensionRangeOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @param message ExtensionRangeOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IExtensionRangeOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ExtensionRangeOptions; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ExtensionRangeOptions; - - /** - * Verifies an ExtensionRangeOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ExtensionRangeOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ExtensionRangeOptions; - - /** - * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. - * @param message ExtensionRangeOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ExtensionRangeOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ExtensionRangeOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a FieldDescriptorProto. */ - interface IFieldDescriptorProto { - - /** FieldDescriptorProto name */ - name?: (string|null); - - /** FieldDescriptorProto number */ - number?: (number|null); - - /** FieldDescriptorProto label */ - label?: (google.protobuf.FieldDescriptorProto.Label|null); - - /** FieldDescriptorProto type */ - type?: (google.protobuf.FieldDescriptorProto.Type|null); - - /** FieldDescriptorProto typeName */ - typeName?: (string|null); - - /** FieldDescriptorProto extendee */ - extendee?: (string|null); - - /** FieldDescriptorProto defaultValue */ - defaultValue?: (string|null); - - /** FieldDescriptorProto oneofIndex */ - oneofIndex?: (number|null); - - /** FieldDescriptorProto jsonName */ - jsonName?: (string|null); - - /** FieldDescriptorProto options */ - options?: (google.protobuf.IFieldOptions|null); - - /** FieldDescriptorProto proto3Optional */ - proto3Optional?: (boolean|null); - } - - /** Represents a FieldDescriptorProto. */ - class FieldDescriptorProto implements IFieldDescriptorProto { - - /** - * Constructs a new FieldDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldDescriptorProto); - - /** FieldDescriptorProto name. */ - public name: string; - - /** FieldDescriptorProto number. */ - public number: number; - - /** FieldDescriptorProto label. */ - public label: google.protobuf.FieldDescriptorProto.Label; - - /** FieldDescriptorProto type. */ - public type: google.protobuf.FieldDescriptorProto.Type; - - /** FieldDescriptorProto typeName. */ - public typeName: string; - - /** FieldDescriptorProto extendee. */ - public extendee: string; - - /** FieldDescriptorProto defaultValue. */ - public defaultValue: string; - - /** FieldDescriptorProto oneofIndex. */ - public oneofIndex: number; - - /** FieldDescriptorProto jsonName. */ - public jsonName: string; - - /** FieldDescriptorProto options. */ - public options?: (google.protobuf.IFieldOptions|null); - - /** FieldDescriptorProto proto3Optional. */ - public proto3Optional: boolean; - - /** - * Creates a new FieldDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns FieldDescriptorProto instance - */ - public static create(properties?: google.protobuf.IFieldDescriptorProto): google.protobuf.FieldDescriptorProto; - - /** - * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @param message FieldDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @param message FieldDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFieldDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldDescriptorProto; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldDescriptorProto; - - /** - * Verifies a FieldDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldDescriptorProto; - - /** - * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. - * @param message FieldDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace FieldDescriptorProto { - - /** Type enum. */ - enum Type { - TYPE_DOUBLE = 1, - TYPE_FLOAT = 2, - TYPE_INT64 = 3, - TYPE_UINT64 = 4, - TYPE_INT32 = 5, - TYPE_FIXED64 = 6, - TYPE_FIXED32 = 7, - TYPE_BOOL = 8, - TYPE_STRING = 9, - TYPE_GROUP = 10, - TYPE_MESSAGE = 11, - TYPE_BYTES = 12, - TYPE_UINT32 = 13, - TYPE_ENUM = 14, - TYPE_SFIXED32 = 15, - TYPE_SFIXED64 = 16, - TYPE_SINT32 = 17, - TYPE_SINT64 = 18 - } - - /** Label enum. */ - enum Label { - LABEL_OPTIONAL = 1, - LABEL_REQUIRED = 2, - LABEL_REPEATED = 3 - } - } - - /** Properties of an OneofDescriptorProto. */ - interface IOneofDescriptorProto { - - /** OneofDescriptorProto name */ - name?: (string|null); - - /** OneofDescriptorProto options */ - options?: (google.protobuf.IOneofOptions|null); - } - - /** Represents an OneofDescriptorProto. */ - class OneofDescriptorProto implements IOneofDescriptorProto { - - /** - * Constructs a new OneofDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IOneofDescriptorProto); - - /** OneofDescriptorProto name. */ - public name: string; - - /** OneofDescriptorProto options. */ - public options?: (google.protobuf.IOneofOptions|null); - - /** - * Creates a new OneofDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns OneofDescriptorProto instance - */ - public static create(properties?: google.protobuf.IOneofDescriptorProto): google.protobuf.OneofDescriptorProto; - - /** - * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @param message OneofDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @param message OneofDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IOneofDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofDescriptorProto; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofDescriptorProto; - - /** - * Verifies an OneofDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OneofDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.OneofDescriptorProto; - - /** - * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. - * @param message OneofDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.OneofDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OneofDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an EnumDescriptorProto. */ - interface IEnumDescriptorProto { - - /** EnumDescriptorProto name */ - name?: (string|null); - - /** EnumDescriptorProto value */ - value?: (google.protobuf.IEnumValueDescriptorProto[]|null); - - /** EnumDescriptorProto options */ - options?: (google.protobuf.IEnumOptions|null); - - /** EnumDescriptorProto reservedRange */ - reservedRange?: (google.protobuf.EnumDescriptorProto.IEnumReservedRange[]|null); - - /** EnumDescriptorProto reservedName */ - reservedName?: (string[]|null); - } - - /** Represents an EnumDescriptorProto. */ - class EnumDescriptorProto implements IEnumDescriptorProto { - - /** - * Constructs a new EnumDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumDescriptorProto); - - /** EnumDescriptorProto name. */ - public name: string; - - /** EnumDescriptorProto value. */ - public value: google.protobuf.IEnumValueDescriptorProto[]; - - /** EnumDescriptorProto options. */ - public options?: (google.protobuf.IEnumOptions|null); - - /** EnumDescriptorProto reservedRange. */ - public reservedRange: google.protobuf.EnumDescriptorProto.IEnumReservedRange[]; - - /** EnumDescriptorProto reservedName. */ - public reservedName: string[]; - - /** - * Creates a new EnumDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumDescriptorProto instance - */ - public static create(properties?: google.protobuf.IEnumDescriptorProto): google.protobuf.EnumDescriptorProto; - - /** - * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @param message EnumDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @param message EnumDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto; - - /** - * Verifies an EnumDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto; - - /** - * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. - * @param message EnumDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace EnumDescriptorProto { - - /** Properties of an EnumReservedRange. */ - interface IEnumReservedRange { - - /** EnumReservedRange start */ - start?: (number|null); - - /** EnumReservedRange end */ - end?: (number|null); - } - - /** Represents an EnumReservedRange. */ - class EnumReservedRange implements IEnumReservedRange { - - /** - * Constructs a new EnumReservedRange. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange); - - /** EnumReservedRange start. */ - public start: number; - - /** EnumReservedRange end. */ - public end: number; - - /** - * Creates a new EnumReservedRange instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumReservedRange instance - */ - public static create(properties?: google.protobuf.EnumDescriptorProto.IEnumReservedRange): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @param message EnumReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @param message EnumReservedRange message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.EnumDescriptorProto.IEnumReservedRange, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Verifies an EnumReservedRange message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumReservedRange - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumDescriptorProto.EnumReservedRange; - - /** - * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. - * @param message EnumReservedRange - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumDescriptorProto.EnumReservedRange, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumReservedRange to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Properties of an EnumValueDescriptorProto. */ - interface IEnumValueDescriptorProto { - - /** EnumValueDescriptorProto name */ - name?: (string|null); - - /** EnumValueDescriptorProto number */ - number?: (number|null); - - /** EnumValueDescriptorProto options */ - options?: (google.protobuf.IEnumValueOptions|null); - } - - /** Represents an EnumValueDescriptorProto. */ - class EnumValueDescriptorProto implements IEnumValueDescriptorProto { - - /** - * Constructs a new EnumValueDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumValueDescriptorProto); - - /** EnumValueDescriptorProto name. */ - public name: string; - - /** EnumValueDescriptorProto number. */ - public number: number; - - /** EnumValueDescriptorProto options. */ - public options?: (google.protobuf.IEnumValueOptions|null); - - /** - * Creates a new EnumValueDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumValueDescriptorProto instance - */ - public static create(properties?: google.protobuf.IEnumValueDescriptorProto): google.protobuf.EnumValueDescriptorProto; - - /** - * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @param message EnumValueDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @param message EnumValueDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumValueDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueDescriptorProto; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueDescriptorProto; - - /** - * Verifies an EnumValueDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumValueDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueDescriptorProto; - - /** - * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. - * @param message EnumValueDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumValueDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumValueDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ServiceDescriptorProto. */ - interface IServiceDescriptorProto { - - /** ServiceDescriptorProto name */ - name?: (string|null); - - /** ServiceDescriptorProto method */ - method?: (google.protobuf.IMethodDescriptorProto[]|null); - - /** ServiceDescriptorProto options */ - options?: (google.protobuf.IServiceOptions|null); - } - - /** Represents a ServiceDescriptorProto. */ - class ServiceDescriptorProto implements IServiceDescriptorProto { - - /** - * Constructs a new ServiceDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IServiceDescriptorProto); - - /** ServiceDescriptorProto name. */ - public name: string; - - /** ServiceDescriptorProto method. */ - public method: google.protobuf.IMethodDescriptorProto[]; - - /** ServiceDescriptorProto options. */ - public options?: (google.protobuf.IServiceOptions|null); - - /** - * Creates a new ServiceDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns ServiceDescriptorProto instance - */ - public static create(properties?: google.protobuf.IServiceDescriptorProto): google.protobuf.ServiceDescriptorProto; - - /** - * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @param message ServiceDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @param message ServiceDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IServiceDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceDescriptorProto; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceDescriptorProto; - - /** - * Verifies a ServiceDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceDescriptorProto; - - /** - * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. - * @param message ServiceDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ServiceDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MethodDescriptorProto. */ - interface IMethodDescriptorProto { - - /** MethodDescriptorProto name */ - name?: (string|null); - - /** MethodDescriptorProto inputType */ - inputType?: (string|null); - - /** MethodDescriptorProto outputType */ - outputType?: (string|null); - - /** MethodDescriptorProto options */ - options?: (google.protobuf.IMethodOptions|null); - - /** MethodDescriptorProto clientStreaming */ - clientStreaming?: (boolean|null); - - /** MethodDescriptorProto serverStreaming */ - serverStreaming?: (boolean|null); - } - - /** Represents a MethodDescriptorProto. */ - class MethodDescriptorProto implements IMethodDescriptorProto { - - /** - * Constructs a new MethodDescriptorProto. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMethodDescriptorProto); - - /** MethodDescriptorProto name. */ - public name: string; - - /** MethodDescriptorProto inputType. */ - public inputType: string; - - /** MethodDescriptorProto outputType. */ - public outputType: string; - - /** MethodDescriptorProto options. */ - public options?: (google.protobuf.IMethodOptions|null); - - /** MethodDescriptorProto clientStreaming. */ - public clientStreaming: boolean; - - /** MethodDescriptorProto serverStreaming. */ - public serverStreaming: boolean; - - /** - * Creates a new MethodDescriptorProto instance using the specified properties. - * @param [properties] Properties to set - * @returns MethodDescriptorProto instance - */ - public static create(properties?: google.protobuf.IMethodDescriptorProto): google.protobuf.MethodDescriptorProto; - - /** - * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @param message MethodDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @param message MethodDescriptorProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMethodDescriptorProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodDescriptorProto; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodDescriptorProto; - - /** - * Verifies a MethodDescriptorProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodDescriptorProto - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MethodDescriptorProto; - - /** - * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. - * @param message MethodDescriptorProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MethodDescriptorProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodDescriptorProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a FileOptions. */ - interface IFileOptions { - - /** FileOptions javaPackage */ - javaPackage?: (string|null); - - /** FileOptions javaOuterClassname */ - javaOuterClassname?: (string|null); - - /** FileOptions javaMultipleFiles */ - javaMultipleFiles?: (boolean|null); - - /** FileOptions javaGenerateEqualsAndHash */ - javaGenerateEqualsAndHash?: (boolean|null); - - /** FileOptions javaStringCheckUtf8 */ - javaStringCheckUtf8?: (boolean|null); - - /** FileOptions optimizeFor */ - optimizeFor?: (google.protobuf.FileOptions.OptimizeMode|null); - - /** FileOptions goPackage */ - goPackage?: (string|null); - - /** FileOptions ccGenericServices */ - ccGenericServices?: (boolean|null); - - /** FileOptions javaGenericServices */ - javaGenericServices?: (boolean|null); - - /** FileOptions pyGenericServices */ - pyGenericServices?: (boolean|null); - - /** FileOptions phpGenericServices */ - phpGenericServices?: (boolean|null); - - /** FileOptions deprecated */ - deprecated?: (boolean|null); - - /** FileOptions ccEnableArenas */ - ccEnableArenas?: (boolean|null); - - /** FileOptions objcClassPrefix */ - objcClassPrefix?: (string|null); - - /** FileOptions csharpNamespace */ - csharpNamespace?: (string|null); - - /** FileOptions swiftPrefix */ - swiftPrefix?: (string|null); - - /** FileOptions phpClassPrefix */ - phpClassPrefix?: (string|null); - - /** FileOptions phpNamespace */ - phpNamespace?: (string|null); - - /** FileOptions phpMetadataNamespace */ - phpMetadataNamespace?: (string|null); - - /** FileOptions rubyPackage */ - rubyPackage?: (string|null); - - /** FileOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** FileOptions .gogoproto.goprotoGettersAll */ - ".gogoproto.goprotoGettersAll"?: (boolean|null); - - /** FileOptions .gogoproto.goprotoEnumPrefixAll */ - ".gogoproto.goprotoEnumPrefixAll"?: (boolean|null); - - /** FileOptions .gogoproto.goprotoStringerAll */ - ".gogoproto.goprotoStringerAll"?: (boolean|null); - - /** FileOptions .gogoproto.verboseEqualAll */ - ".gogoproto.verboseEqualAll"?: (boolean|null); - - /** FileOptions .gogoproto.faceAll */ - ".gogoproto.faceAll"?: (boolean|null); - - /** FileOptions .gogoproto.gostringAll */ - ".gogoproto.gostringAll"?: (boolean|null); - - /** FileOptions .gogoproto.populateAll */ - ".gogoproto.populateAll"?: (boolean|null); - - /** FileOptions .gogoproto.stringerAll */ - ".gogoproto.stringerAll"?: (boolean|null); - - /** FileOptions .gogoproto.onlyoneAll */ - ".gogoproto.onlyoneAll"?: (boolean|null); - - /** FileOptions .gogoproto.equalAll */ - ".gogoproto.equalAll"?: (boolean|null); - - /** FileOptions .gogoproto.descriptionAll */ - ".gogoproto.descriptionAll"?: (boolean|null); - - /** FileOptions .gogoproto.testgenAll */ - ".gogoproto.testgenAll"?: (boolean|null); - - /** FileOptions .gogoproto.benchgenAll */ - ".gogoproto.benchgenAll"?: (boolean|null); - - /** FileOptions .gogoproto.marshalerAll */ - ".gogoproto.marshalerAll"?: (boolean|null); - - /** FileOptions .gogoproto.unmarshalerAll */ - ".gogoproto.unmarshalerAll"?: (boolean|null); - - /** FileOptions .gogoproto.stableMarshalerAll */ - ".gogoproto.stableMarshalerAll"?: (boolean|null); - - /** FileOptions .gogoproto.sizerAll */ - ".gogoproto.sizerAll"?: (boolean|null); - - /** FileOptions .gogoproto.goprotoEnumStringerAll */ - ".gogoproto.goprotoEnumStringerAll"?: (boolean|null); - - /** FileOptions .gogoproto.enumStringerAll */ - ".gogoproto.enumStringerAll"?: (boolean|null); - - /** FileOptions .gogoproto.unsafeMarshalerAll */ - ".gogoproto.unsafeMarshalerAll"?: (boolean|null); - - /** FileOptions .gogoproto.unsafeUnmarshalerAll */ - ".gogoproto.unsafeUnmarshalerAll"?: (boolean|null); - - /** FileOptions .gogoproto.goprotoExtensionsMapAll */ - ".gogoproto.goprotoExtensionsMapAll"?: (boolean|null); - - /** FileOptions .gogoproto.goprotoUnrecognizedAll */ - ".gogoproto.goprotoUnrecognizedAll"?: (boolean|null); - - /** FileOptions .gogoproto.gogoprotoImport */ - ".gogoproto.gogoprotoImport"?: (boolean|null); - - /** FileOptions .gogoproto.protosizerAll */ - ".gogoproto.protosizerAll"?: (boolean|null); - - /** FileOptions .gogoproto.compareAll */ - ".gogoproto.compareAll"?: (boolean|null); - - /** FileOptions .gogoproto.typedeclAll */ - ".gogoproto.typedeclAll"?: (boolean|null); - - /** FileOptions .gogoproto.enumdeclAll */ - ".gogoproto.enumdeclAll"?: (boolean|null); - - /** FileOptions .gogoproto.goprotoRegistration */ - ".gogoproto.goprotoRegistration"?: (boolean|null); - - /** FileOptions .gogoproto.messagenameAll */ - ".gogoproto.messagenameAll"?: (boolean|null); - - /** FileOptions .gogoproto.goprotoSizecacheAll */ - ".gogoproto.goprotoSizecacheAll"?: (boolean|null); - - /** FileOptions .gogoproto.goprotoUnkeyedAll */ - ".gogoproto.goprotoUnkeyedAll"?: (boolean|null); - } - - /** Represents a FileOptions. */ - class FileOptions implements IFileOptions { - - /** - * Constructs a new FileOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFileOptions); - - /** FileOptions javaPackage. */ - public javaPackage: string; - - /** FileOptions javaOuterClassname. */ - public javaOuterClassname: string; - - /** FileOptions javaMultipleFiles. */ - public javaMultipleFiles: boolean; - - /** FileOptions javaGenerateEqualsAndHash. */ - public javaGenerateEqualsAndHash: boolean; - - /** FileOptions javaStringCheckUtf8. */ - public javaStringCheckUtf8: boolean; - - /** FileOptions optimizeFor. */ - public optimizeFor: google.protobuf.FileOptions.OptimizeMode; - - /** FileOptions goPackage. */ - public goPackage: string; - - /** FileOptions ccGenericServices. */ - public ccGenericServices: boolean; - - /** FileOptions javaGenericServices. */ - public javaGenericServices: boolean; - - /** FileOptions pyGenericServices. */ - public pyGenericServices: boolean; - - /** FileOptions phpGenericServices. */ - public phpGenericServices: boolean; - - /** FileOptions deprecated. */ - public deprecated: boolean; - - /** FileOptions ccEnableArenas. */ - public ccEnableArenas: boolean; - - /** FileOptions objcClassPrefix. */ - public objcClassPrefix: string; - - /** FileOptions csharpNamespace. */ - public csharpNamespace: string; - - /** FileOptions swiftPrefix. */ - public swiftPrefix: string; - - /** FileOptions phpClassPrefix. */ - public phpClassPrefix: string; - - /** FileOptions phpNamespace. */ - public phpNamespace: string; - - /** FileOptions phpMetadataNamespace. */ - public phpMetadataNamespace: string; - - /** FileOptions rubyPackage. */ - public rubyPackage: string; - - /** FileOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new FileOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns FileOptions instance - */ - public static create(properties?: google.protobuf.IFileOptions): google.protobuf.FileOptions; - - /** - * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @param message FileOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @param message FileOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFileOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FileOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FileOptions; - - /** - * Decodes a FileOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FileOptions; - - /** - * Verifies a FileOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FileOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FileOptions; - - /** - * Creates a plain object from a FileOptions message. Also converts values to other types if specified. - * @param message FileOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FileOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FileOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace FileOptions { - - /** OptimizeMode enum. */ - enum OptimizeMode { - SPEED = 1, - CODE_SIZE = 2, - LITE_RUNTIME = 3 - } - } - - /** Properties of a MessageOptions. */ - interface IMessageOptions { - - /** MessageOptions messageSetWireFormat */ - messageSetWireFormat?: (boolean|null); - - /** MessageOptions noStandardDescriptorAccessor */ - noStandardDescriptorAccessor?: (boolean|null); - - /** MessageOptions deprecated */ - deprecated?: (boolean|null); - - /** MessageOptions mapEntry */ - mapEntry?: (boolean|null); - - /** MessageOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** MessageOptions .gogoproto.goprotoGetters */ - ".gogoproto.goprotoGetters"?: (boolean|null); - - /** MessageOptions .gogoproto.goprotoStringer */ - ".gogoproto.goprotoStringer"?: (boolean|null); - - /** MessageOptions .gogoproto.verboseEqual */ - ".gogoproto.verboseEqual"?: (boolean|null); - - /** MessageOptions .gogoproto.face */ - ".gogoproto.face"?: (boolean|null); - - /** MessageOptions .gogoproto.gostring */ - ".gogoproto.gostring"?: (boolean|null); - - /** MessageOptions .gogoproto.populate */ - ".gogoproto.populate"?: (boolean|null); - - /** MessageOptions .gogoproto.stringer */ - ".gogoproto.stringer"?: (boolean|null); - - /** MessageOptions .gogoproto.onlyone */ - ".gogoproto.onlyone"?: (boolean|null); - - /** MessageOptions .gogoproto.equal */ - ".gogoproto.equal"?: (boolean|null); - - /** MessageOptions .gogoproto.description */ - ".gogoproto.description"?: (boolean|null); - - /** MessageOptions .gogoproto.testgen */ - ".gogoproto.testgen"?: (boolean|null); - - /** MessageOptions .gogoproto.benchgen */ - ".gogoproto.benchgen"?: (boolean|null); - - /** MessageOptions .gogoproto.marshaler */ - ".gogoproto.marshaler"?: (boolean|null); - - /** MessageOptions .gogoproto.unmarshaler */ - ".gogoproto.unmarshaler"?: (boolean|null); - - /** MessageOptions .gogoproto.stableMarshaler */ - ".gogoproto.stableMarshaler"?: (boolean|null); - - /** MessageOptions .gogoproto.sizer */ - ".gogoproto.sizer"?: (boolean|null); - - /** MessageOptions .gogoproto.unsafeMarshaler */ - ".gogoproto.unsafeMarshaler"?: (boolean|null); - - /** MessageOptions .gogoproto.unsafeUnmarshaler */ - ".gogoproto.unsafeUnmarshaler"?: (boolean|null); - - /** MessageOptions .gogoproto.goprotoExtensionsMap */ - ".gogoproto.goprotoExtensionsMap"?: (boolean|null); - - /** MessageOptions .gogoproto.goprotoUnrecognized */ - ".gogoproto.goprotoUnrecognized"?: (boolean|null); - - /** MessageOptions .gogoproto.protosizer */ - ".gogoproto.protosizer"?: (boolean|null); - - /** MessageOptions .gogoproto.compare */ - ".gogoproto.compare"?: (boolean|null); - - /** MessageOptions .gogoproto.typedecl */ - ".gogoproto.typedecl"?: (boolean|null); - - /** MessageOptions .gogoproto.messagename */ - ".gogoproto.messagename"?: (boolean|null); - - /** MessageOptions .gogoproto.goprotoSizecache */ - ".gogoproto.goprotoSizecache"?: (boolean|null); - - /** MessageOptions .gogoproto.goprotoUnkeyed */ - ".gogoproto.goprotoUnkeyed"?: (boolean|null); - } - - /** Represents a MessageOptions. */ - class MessageOptions implements IMessageOptions { - - /** - * Constructs a new MessageOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMessageOptions); - - /** MessageOptions messageSetWireFormat. */ - public messageSetWireFormat: boolean; - - /** MessageOptions noStandardDescriptorAccessor. */ - public noStandardDescriptorAccessor: boolean; - - /** MessageOptions deprecated. */ - public deprecated: boolean; - - /** MessageOptions mapEntry. */ - public mapEntry: boolean; - - /** MessageOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new MessageOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns MessageOptions instance - */ - public static create(properties?: google.protobuf.IMessageOptions): google.protobuf.MessageOptions; - - /** - * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @param message MessageOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @param message MessageOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMessageOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MessageOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MessageOptions; - - /** - * Decodes a MessageOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MessageOptions; - - /** - * Verifies a MessageOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MessageOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MessageOptions; - - /** - * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. - * @param message MessageOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MessageOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MessageOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a FieldOptions. */ - interface IFieldOptions { - - /** FieldOptions ctype */ - ctype?: (google.protobuf.FieldOptions.CType|null); - - /** FieldOptions packed */ - packed?: (boolean|null); - - /** FieldOptions jstype */ - jstype?: (google.protobuf.FieldOptions.JSType|null); - - /** FieldOptions lazy */ - lazy?: (boolean|null); - - /** FieldOptions deprecated */ - deprecated?: (boolean|null); - - /** FieldOptions weak */ - weak?: (boolean|null); - - /** FieldOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** FieldOptions .gogoproto.nullable */ - ".gogoproto.nullable"?: (boolean|null); - - /** FieldOptions .gogoproto.embed */ - ".gogoproto.embed"?: (boolean|null); - - /** FieldOptions .gogoproto.customtype */ - ".gogoproto.customtype"?: (string|null); - - /** FieldOptions .gogoproto.customname */ - ".gogoproto.customname"?: (string|null); - - /** FieldOptions .gogoproto.jsontag */ - ".gogoproto.jsontag"?: (string|null); - - /** FieldOptions .gogoproto.moretags */ - ".gogoproto.moretags"?: (string|null); - - /** FieldOptions .gogoproto.casttype */ - ".gogoproto.casttype"?: (string|null); - - /** FieldOptions .gogoproto.castkey */ - ".gogoproto.castkey"?: (string|null); - - /** FieldOptions .gogoproto.castvalue */ - ".gogoproto.castvalue"?: (string|null); - - /** FieldOptions .gogoproto.stdtime */ - ".gogoproto.stdtime"?: (boolean|null); - - /** FieldOptions .gogoproto.stdduration */ - ".gogoproto.stdduration"?: (boolean|null); - - /** FieldOptions .gogoproto.wktpointer */ - ".gogoproto.wktpointer"?: (boolean|null); - - /** FieldOptions .gogoproto.castrepeated */ - ".gogoproto.castrepeated"?: (string|null); - } - - /** Represents a FieldOptions. */ - class FieldOptions implements IFieldOptions { - - /** - * Constructs a new FieldOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IFieldOptions); - - /** FieldOptions ctype. */ - public ctype: google.protobuf.FieldOptions.CType; - - /** FieldOptions packed. */ - public packed: boolean; - - /** FieldOptions jstype. */ - public jstype: google.protobuf.FieldOptions.JSType; - - /** FieldOptions lazy. */ - public lazy: boolean; - - /** FieldOptions deprecated. */ - public deprecated: boolean; - - /** FieldOptions weak. */ - public weak: boolean; - - /** FieldOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new FieldOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns FieldOptions instance - */ - public static create(properties?: google.protobuf.IFieldOptions): google.protobuf.FieldOptions; - - /** - * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @param message FieldOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @param message FieldOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IFieldOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a FieldOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.FieldOptions; - - /** - * Decodes a FieldOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.FieldOptions; - - /** - * Verifies a FieldOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns FieldOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.FieldOptions; - - /** - * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. - * @param message FieldOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.FieldOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this FieldOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace FieldOptions { - - /** CType enum. */ - enum CType { - STRING = 0, - CORD = 1, - STRING_PIECE = 2 - } - - /** JSType enum. */ - enum JSType { - JS_NORMAL = 0, - JS_STRING = 1, - JS_NUMBER = 2 - } - } - - /** Properties of an OneofOptions. */ - interface IOneofOptions { - - /** OneofOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents an OneofOptions. */ - class OneofOptions implements IOneofOptions { - - /** - * Constructs a new OneofOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IOneofOptions); - - /** OneofOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new OneofOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns OneofOptions instance - */ - public static create(properties?: google.protobuf.IOneofOptions): google.protobuf.OneofOptions; - - /** - * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @param message OneofOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @param message OneofOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IOneofOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OneofOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.OneofOptions; - - /** - * Decodes an OneofOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.OneofOptions; - - /** - * Verifies an OneofOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OneofOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.OneofOptions; - - /** - * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. - * @param message OneofOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.OneofOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OneofOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an EnumOptions. */ - interface IEnumOptions { - - /** EnumOptions allowAlias */ - allowAlias?: (boolean|null); - - /** EnumOptions deprecated */ - deprecated?: (boolean|null); - - /** EnumOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** EnumOptions .gogoproto.goprotoEnumPrefix */ - ".gogoproto.goprotoEnumPrefix"?: (boolean|null); - - /** EnumOptions .gogoproto.goprotoEnumStringer */ - ".gogoproto.goprotoEnumStringer"?: (boolean|null); - - /** EnumOptions .gogoproto.enumStringer */ - ".gogoproto.enumStringer"?: (boolean|null); - - /** EnumOptions .gogoproto.enumCustomname */ - ".gogoproto.enumCustomname"?: (string|null); - - /** EnumOptions .gogoproto.enumdecl */ - ".gogoproto.enumdecl"?: (boolean|null); - } - - /** Represents an EnumOptions. */ - class EnumOptions implements IEnumOptions { - - /** - * Constructs a new EnumOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumOptions); - - /** EnumOptions allowAlias. */ - public allowAlias: boolean; - - /** EnumOptions deprecated. */ - public deprecated: boolean; - - /** EnumOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new EnumOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumOptions instance - */ - public static create(properties?: google.protobuf.IEnumOptions): google.protobuf.EnumOptions; - - /** - * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @param message EnumOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @param message EnumOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumOptions; - - /** - * Decodes an EnumOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumOptions; - - /** - * Verifies an EnumOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumOptions; - - /** - * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. - * @param message EnumOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an EnumValueOptions. */ - interface IEnumValueOptions { - - /** EnumValueOptions deprecated */ - deprecated?: (boolean|null); - - /** EnumValueOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - - /** EnumValueOptions .gogoproto.enumvalueCustomname */ - ".gogoproto.enumvalueCustomname"?: (string|null); - } - - /** Represents an EnumValueOptions. */ - class EnumValueOptions implements IEnumValueOptions { - - /** - * Constructs a new EnumValueOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IEnumValueOptions); - - /** EnumValueOptions deprecated. */ - public deprecated: boolean; - - /** EnumValueOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new EnumValueOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns EnumValueOptions instance - */ - public static create(properties?: google.protobuf.IEnumValueOptions): google.protobuf.EnumValueOptions; - - /** - * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @param message EnumValueOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @param message EnumValueOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IEnumValueOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.EnumValueOptions; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.EnumValueOptions; - - /** - * Verifies an EnumValueOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns EnumValueOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.EnumValueOptions; - - /** - * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. - * @param message EnumValueOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.EnumValueOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this EnumValueOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ServiceOptions. */ - interface IServiceOptions { - - /** ServiceOptions deprecated */ - deprecated?: (boolean|null); - - /** ServiceOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents a ServiceOptions. */ - class ServiceOptions implements IServiceOptions { - - /** - * Constructs a new ServiceOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IServiceOptions); - - /** ServiceOptions deprecated. */ - public deprecated: boolean; - - /** ServiceOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new ServiceOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns ServiceOptions instance - */ - public static create(properties?: google.protobuf.IServiceOptions): google.protobuf.ServiceOptions; - - /** - * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @param message ServiceOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @param message ServiceOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IServiceOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.ServiceOptions; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.ServiceOptions; - - /** - * Verifies a ServiceOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ServiceOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.ServiceOptions; - - /** - * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. - * @param message ServiceOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.ServiceOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ServiceOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a MethodOptions. */ - interface IMethodOptions { - - /** MethodOptions deprecated */ - deprecated?: (boolean|null); - - /** MethodOptions idempotencyLevel */ - idempotencyLevel?: (google.protobuf.MethodOptions.IdempotencyLevel|null); - - /** MethodOptions uninterpretedOption */ - uninterpretedOption?: (google.protobuf.IUninterpretedOption[]|null); - } - - /** Represents a MethodOptions. */ - class MethodOptions implements IMethodOptions { - - /** - * Constructs a new MethodOptions. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IMethodOptions); - - /** MethodOptions deprecated. */ - public deprecated: boolean; - - /** MethodOptions idempotencyLevel. */ - public idempotencyLevel: google.protobuf.MethodOptions.IdempotencyLevel; - - /** MethodOptions uninterpretedOption. */ - public uninterpretedOption: google.protobuf.IUninterpretedOption[]; - - /** - * Creates a new MethodOptions instance using the specified properties. - * @param [properties] Properties to set - * @returns MethodOptions instance - */ - public static create(properties?: google.protobuf.IMethodOptions): google.protobuf.MethodOptions; - - /** - * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @param message MethodOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @param message MethodOptions message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IMethodOptions, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MethodOptions message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.MethodOptions; - - /** - * Decodes a MethodOptions message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.MethodOptions; - - /** - * Verifies a MethodOptions message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MethodOptions - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.MethodOptions; - - /** - * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. - * @param message MethodOptions - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.MethodOptions, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MethodOptions to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace MethodOptions { - - /** IdempotencyLevel enum. */ - enum IdempotencyLevel { - IDEMPOTENCY_UNKNOWN = 0, - NO_SIDE_EFFECTS = 1, - IDEMPOTENT = 2 - } - } - - /** Properties of an UninterpretedOption. */ - interface IUninterpretedOption { - - /** UninterpretedOption name */ - name?: (google.protobuf.UninterpretedOption.INamePart[]|null); - - /** UninterpretedOption identifierValue */ - identifierValue?: (string|null); - - /** UninterpretedOption positiveIntValue */ - positiveIntValue?: (number|Long|null); - - /** UninterpretedOption negativeIntValue */ - negativeIntValue?: (number|Long|null); - - /** UninterpretedOption doubleValue */ - doubleValue?: (number|null); - - /** UninterpretedOption stringValue */ - stringValue?: (Uint8Array|null); - - /** UninterpretedOption aggregateValue */ - aggregateValue?: (string|null); - } - - /** Represents an UninterpretedOption. */ - class UninterpretedOption implements IUninterpretedOption { - - /** - * Constructs a new UninterpretedOption. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IUninterpretedOption); - - /** UninterpretedOption name. */ - public name: google.protobuf.UninterpretedOption.INamePart[]; - - /** UninterpretedOption identifierValue. */ - public identifierValue: string; - - /** UninterpretedOption positiveIntValue. */ - public positiveIntValue: (number|Long); - - /** UninterpretedOption negativeIntValue. */ - public negativeIntValue: (number|Long); - - /** UninterpretedOption doubleValue. */ - public doubleValue: number; - - /** UninterpretedOption stringValue. */ - public stringValue: Uint8Array; - - /** UninterpretedOption aggregateValue. */ - public aggregateValue: string; - - /** - * Creates a new UninterpretedOption instance using the specified properties. - * @param [properties] Properties to set - * @returns UninterpretedOption instance - */ - public static create(properties?: google.protobuf.IUninterpretedOption): google.protobuf.UninterpretedOption; - - /** - * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @param message UninterpretedOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @param message UninterpretedOption message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IUninterpretedOption, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption; - - /** - * Verifies an UninterpretedOption message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns UninterpretedOption - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption; - - /** - * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. - * @param message UninterpretedOption - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UninterpretedOption, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this UninterpretedOption to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace UninterpretedOption { - - /** Properties of a NamePart. */ - interface INamePart { - - /** NamePart namePart */ - namePart: string; - - /** NamePart isExtension */ - isExtension: boolean; - } - - /** Represents a NamePart. */ - class NamePart implements INamePart { - - /** - * Constructs a new NamePart. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.UninterpretedOption.INamePart); - - /** NamePart namePart. */ - public namePart: string; - - /** NamePart isExtension. */ - public isExtension: boolean; - - /** - * Creates a new NamePart instance using the specified properties. - * @param [properties] Properties to set - * @returns NamePart instance - */ - public static create(properties?: google.protobuf.UninterpretedOption.INamePart): google.protobuf.UninterpretedOption.NamePart; - - /** - * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @param message NamePart message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @param message NamePart message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.UninterpretedOption.INamePart, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NamePart message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.UninterpretedOption.NamePart; - - /** - * Decodes a NamePart message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.UninterpretedOption.NamePart; - - /** - * Verifies a NamePart message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NamePart message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NamePart - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.UninterpretedOption.NamePart; - - /** - * Creates a plain object from a NamePart message. Also converts values to other types if specified. - * @param message NamePart - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.UninterpretedOption.NamePart, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NamePart to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Properties of a SourceCodeInfo. */ - interface ISourceCodeInfo { - - /** SourceCodeInfo location */ - location?: (google.protobuf.SourceCodeInfo.ILocation[]|null); - } - - /** Represents a SourceCodeInfo. */ - class SourceCodeInfo implements ISourceCodeInfo { - - /** - * Constructs a new SourceCodeInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.ISourceCodeInfo); - - /** SourceCodeInfo location. */ - public location: google.protobuf.SourceCodeInfo.ILocation[]; - - /** - * Creates a new SourceCodeInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns SourceCodeInfo instance - */ - public static create(properties?: google.protobuf.ISourceCodeInfo): google.protobuf.SourceCodeInfo; - - /** - * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @param message SourceCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @param message SourceCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.ISourceCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo; - - /** - * Verifies a SourceCodeInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns SourceCodeInfo - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo; - - /** - * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. - * @param message SourceCodeInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.SourceCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this SourceCodeInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace SourceCodeInfo { - - /** Properties of a Location. */ - interface ILocation { - - /** Location path */ - path?: (number[]|null); - - /** Location span */ - span?: (number[]|null); - - /** Location leadingComments */ - leadingComments?: (string|null); - - /** Location trailingComments */ - trailingComments?: (string|null); - - /** Location leadingDetachedComments */ - leadingDetachedComments?: (string[]|null); - } - - /** Represents a Location. */ - class Location implements ILocation { - - /** - * Constructs a new Location. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.SourceCodeInfo.ILocation); - - /** Location path. */ - public path: number[]; - - /** Location span. */ - public span: number[]; - - /** Location leadingComments. */ - public leadingComments: string; - - /** Location trailingComments. */ - public trailingComments: string; - - /** Location leadingDetachedComments. */ - public leadingDetachedComments: string[]; - - /** - * Creates a new Location instance using the specified properties. - * @param [properties] Properties to set - * @returns Location instance - */ - public static create(properties?: google.protobuf.SourceCodeInfo.ILocation): google.protobuf.SourceCodeInfo.Location; - - /** - * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @param message Location message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @param message Location message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.SourceCodeInfo.ILocation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Location message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.SourceCodeInfo.Location; - - /** - * Decodes a Location message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.SourceCodeInfo.Location; - - /** - * Verifies a Location message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Location message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Location - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.SourceCodeInfo.Location; - - /** - * Creates a plain object from a Location message. Also converts values to other types if specified. - * @param message Location - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.SourceCodeInfo.Location, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Location to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - - /** Properties of a GeneratedCodeInfo. */ - interface IGeneratedCodeInfo { - - /** GeneratedCodeInfo annotation */ - annotation?: (google.protobuf.GeneratedCodeInfo.IAnnotation[]|null); - } - - /** Represents a GeneratedCodeInfo. */ - class GeneratedCodeInfo implements IGeneratedCodeInfo { - - /** - * Constructs a new GeneratedCodeInfo. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.IGeneratedCodeInfo); - - /** GeneratedCodeInfo annotation. */ - public annotation: google.protobuf.GeneratedCodeInfo.IAnnotation[]; - - /** - * Creates a new GeneratedCodeInfo instance using the specified properties. - * @param [properties] Properties to set - * @returns GeneratedCodeInfo instance - */ - public static create(properties?: google.protobuf.IGeneratedCodeInfo): google.protobuf.GeneratedCodeInfo; - - /** - * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @param message GeneratedCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @param message GeneratedCodeInfo message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.IGeneratedCodeInfo, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo; - - /** - * Verifies a GeneratedCodeInfo message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns GeneratedCodeInfo - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo; - - /** - * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. - * @param message GeneratedCodeInfo - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.GeneratedCodeInfo, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this GeneratedCodeInfo to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - namespace GeneratedCodeInfo { - - /** Properties of an Annotation. */ - interface IAnnotation { - - /** Annotation path */ - path?: (number[]|null); - - /** Annotation sourceFile */ - sourceFile?: (string|null); - - /** Annotation begin */ - begin?: (number|null); - - /** Annotation end */ - end?: (number|null); - } - - /** Represents an Annotation. */ - class Annotation implements IAnnotation { - - /** - * Constructs a new Annotation. - * @param [properties] Properties to set - */ - constructor(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation); - - /** Annotation path. */ - public path: number[]; - - /** Annotation sourceFile. */ - public sourceFile: string; - - /** Annotation begin. */ - public begin: number; - - /** Annotation end. */ - public end: number; - - /** - * Creates a new Annotation instance using the specified properties. - * @param [properties] Properties to set - * @returns Annotation instance - */ - public static create(properties?: google.protobuf.GeneratedCodeInfo.IAnnotation): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @param message Annotation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @param message Annotation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: google.protobuf.GeneratedCodeInfo.IAnnotation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Annotation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Decodes an Annotation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Verifies an Annotation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Annotation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Annotation - */ - public static fromObject(object: { [k: string]: any }): google.protobuf.GeneratedCodeInfo.Annotation; - - /** - * Creates a plain object from an Annotation message. Also converts values to other types if specified. - * @param message Annotation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: google.protobuf.GeneratedCodeInfo.Annotation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Annotation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - } - } -} - /** Namespace types. */ export namespace types { diff --git a/packages/xchain-mayachain/src/types/proto/MsgCompiled.js b/packages/xchain-mayachain/src/types/proto/MsgCompiled.js index 1f3ea47ea..b2ebddc85 100644 --- a/packages/xchain-mayachain/src/types/proto/MsgCompiled.js +++ b/packages/xchain-mayachain/src/types/proto/MsgCompiled.js @@ -29,6 +29,7 @@ $root.common = (function() { * @property {string|null} [ticker] Asset ticker * @property {boolean|null} [synth] Asset synth * @property {boolean|null} [trade] Asset trade + * @property {boolean|null} [secured] Asset secured */ /** @@ -86,6 +87,14 @@ $root.common = (function() { */ Asset.prototype.trade = false; + /** + * Asset secured. + * @member {boolean} secured + * @memberof common.Asset + * @instance + */ + Asset.prototype.secured = false; + /** * Creates a new Asset instance using the specified properties. * @function create @@ -120,6 +129,8 @@ $root.common = (function() { writer.uint32(/* id 4, wireType 0 =*/32).bool(message.synth); if (message.trade != null && Object.hasOwnProperty.call(message, "trade")) writer.uint32(/* id 5, wireType 0 =*/40).bool(message.trade); + if (message.secured != null && Object.hasOwnProperty.call(message, "secured")) + writer.uint32(/* id 6, wireType 0 =*/48).bool(message.secured); return writer; }; @@ -169,6 +180,9 @@ $root.common = (function() { case 5: message.trade = reader.bool(); break; + case 6: + message.secured = reader.bool(); + break; default: reader.skipType(tag & 7); break; @@ -219,6 +233,9 @@ $root.common = (function() { if (message.trade != null && message.hasOwnProperty("trade")) if (typeof message.trade !== "boolean") return "trade: boolean expected"; + if (message.secured != null && message.hasOwnProperty("secured")) + if (typeof message.secured !== "boolean") + return "secured: boolean expected"; return null; }; @@ -244,6 +261,8 @@ $root.common = (function() { message.synth = Boolean(object.synth); if (object.trade != null) message.trade = Boolean(object.trade); + if (object.secured != null) + message.secured = Boolean(object.secured); return message; }; @@ -266,6 +285,7 @@ $root.common = (function() { object.ticker = ""; object.synth = false; object.trade = false; + object.secured = false; } if (message.chain != null && message.hasOwnProperty("chain")) object.chain = message.chain; @@ -277,6 +297,8 @@ $root.common = (function() { object.synth = message.synth; if (message.trade != null && message.hasOwnProperty("trade")) object.trade = message.trade; + if (message.secured != null && message.hasOwnProperty("secured")) + object.secured = message.secured; return object; }; @@ -1540,10121 +1562,6 @@ $root.common = (function() { return common; })(); -$root.gogoproto = (function() { - - /** - * Namespace gogoproto. - * @exports gogoproto - * @namespace - */ - var gogoproto = {}; - - return gogoproto; -})(); - -$root.google = (function() { - - /** - * Namespace google. - * @exports google - * @namespace - */ - var google = {}; - - google.protobuf = (function() { - - /** - * Namespace protobuf. - * @memberof google - * @namespace - */ - var protobuf = {}; - - protobuf.FileDescriptorSet = (function() { - - /** - * Properties of a FileDescriptorSet. - * @memberof google.protobuf - * @interface IFileDescriptorSet - * @property {Array.|null} [file] FileDescriptorSet file - */ - - /** - * Constructs a new FileDescriptorSet. - * @memberof google.protobuf - * @classdesc Represents a FileDescriptorSet. - * @implements IFileDescriptorSet - * @constructor - * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set - */ - function FileDescriptorSet(properties) { - this.file = []; - 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]]; - } - - /** - * FileDescriptorSet file. - * @member {Array.} file - * @memberof google.protobuf.FileDescriptorSet - * @instance - */ - FileDescriptorSet.prototype.file = $util.emptyArray; - - /** - * Creates a new FileDescriptorSet instance using the specified properties. - * @function create - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.IFileDescriptorSet=} [properties] Properties to set - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet instance - */ - FileDescriptorSet.create = function create(properties) { - return new FileDescriptorSet(properties); - }; - - /** - * Encodes the specified FileDescriptorSet message. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorSet.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.file != null && message.file.length) - for (var i = 0; i < message.file.length; ++i) - $root.google.protobuf.FileDescriptorProto.encode(message.file[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified FileDescriptorSet message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorSet.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.IFileDescriptorSet} message FileDescriptorSet message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorSet.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorSet.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.google.protobuf.FileDescriptorSet(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.file && message.file.length)) - message.file = []; - message.file.push($root.google.protobuf.FileDescriptorProto.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileDescriptorSet message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorSet.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileDescriptorSet message. - * @function verify - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileDescriptorSet.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.file != null && message.hasOwnProperty("file")) { - if (!Array.isArray(message.file)) - return "file: array expected"; - for (var i = 0; i < message.file.length; ++i) { - var error = $root.google.protobuf.FileDescriptorProto.verify(message.file[i]); - if (error) - return "file." + error; - } - } - return null; - }; - - /** - * Creates a FileDescriptorSet message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileDescriptorSet} FileDescriptorSet - */ - FileDescriptorSet.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileDescriptorSet) - return object; - var message = new $root.google.protobuf.FileDescriptorSet(); - if (object.file) { - if (!Array.isArray(object.file)) - throw TypeError(".google.protobuf.FileDescriptorSet.file: array expected"); - message.file = []; - for (var i = 0; i < object.file.length; ++i) { - if (typeof object.file[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorSet.file: object expected"); - message.file[i] = $root.google.protobuf.FileDescriptorProto.fromObject(object.file[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a FileDescriptorSet message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileDescriptorSet - * @static - * @param {google.protobuf.FileDescriptorSet} message FileDescriptorSet - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileDescriptorSet.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.file = []; - if (message.file && message.file.length) { - object.file = []; - for (var j = 0; j < message.file.length; ++j) - object.file[j] = $root.google.protobuf.FileDescriptorProto.toObject(message.file[j], options); - } - return object; - }; - - /** - * Converts this FileDescriptorSet to JSON. - * @function toJSON - * @memberof google.protobuf.FileDescriptorSet - * @instance - * @returns {Object.} JSON object - */ - FileDescriptorSet.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return FileDescriptorSet; - })(); - - protobuf.FileDescriptorProto = (function() { - - /** - * Properties of a FileDescriptorProto. - * @memberof google.protobuf - * @interface IFileDescriptorProto - * @property {string|null} [name] FileDescriptorProto name - * @property {string|null} ["package"] FileDescriptorProto package - * @property {Array.|null} [dependency] FileDescriptorProto dependency - * @property {Array.|null} [publicDependency] FileDescriptorProto publicDependency - * @property {Array.|null} [weakDependency] FileDescriptorProto weakDependency - * @property {Array.|null} [messageType] FileDescriptorProto messageType - * @property {Array.|null} [enumType] FileDescriptorProto enumType - * @property {Array.|null} [service] FileDescriptorProto service - * @property {Array.|null} [extension] FileDescriptorProto extension - * @property {google.protobuf.IFileOptions|null} [options] FileDescriptorProto options - * @property {google.protobuf.ISourceCodeInfo|null} [sourceCodeInfo] FileDescriptorProto sourceCodeInfo - * @property {string|null} [syntax] FileDescriptorProto syntax - */ - - /** - * Constructs a new FileDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a FileDescriptorProto. - * @implements IFileDescriptorProto - * @constructor - * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set - */ - function FileDescriptorProto(properties) { - this.dependency = []; - this.publicDependency = []; - this.weakDependency = []; - this.messageType = []; - this.enumType = []; - this.service = []; - this.extension = []; - 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]]; - } - - /** - * FileDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.name = ""; - - /** - * FileDescriptorProto package. - * @member {string} package - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype["package"] = ""; - - /** - * FileDescriptorProto dependency. - * @member {Array.} dependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.dependency = $util.emptyArray; - - /** - * FileDescriptorProto publicDependency. - * @member {Array.} publicDependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.publicDependency = $util.emptyArray; - - /** - * FileDescriptorProto weakDependency. - * @member {Array.} weakDependency - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.weakDependency = $util.emptyArray; - - /** - * FileDescriptorProto messageType. - * @member {Array.} messageType - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.messageType = $util.emptyArray; - - /** - * FileDescriptorProto enumType. - * @member {Array.} enumType - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.enumType = $util.emptyArray; - - /** - * FileDescriptorProto service. - * @member {Array.} service - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.service = $util.emptyArray; - - /** - * FileDescriptorProto extension. - * @member {Array.} extension - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.extension = $util.emptyArray; - - /** - * FileDescriptorProto options. - * @member {google.protobuf.IFileOptions|null|undefined} options - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.options = null; - - /** - * FileDescriptorProto sourceCodeInfo. - * @member {google.protobuf.ISourceCodeInfo|null|undefined} sourceCodeInfo - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.sourceCodeInfo = null; - - /** - * FileDescriptorProto syntax. - * @member {string} syntax - * @memberof google.protobuf.FileDescriptorProto - * @instance - */ - FileDescriptorProto.prototype.syntax = ""; - - /** - * Creates a new FileDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto instance - */ - FileDescriptorProto.create = function create(properties) { - return new FileDescriptorProto(properties); - }; - - /** - * Encodes the specified FileDescriptorProto message. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message["package"] != null && Object.hasOwnProperty.call(message, "package")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message["package"]); - if (message.dependency != null && message.dependency.length) - for (var i = 0; i < message.dependency.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.dependency[i]); - if (message.messageType != null && message.messageType.length) - for (var i = 0; i < message.messageType.length; ++i) - $root.google.protobuf.DescriptorProto.encode(message.messageType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.enumType != null && message.enumType.length) - for (var i = 0; i < message.enumType.length; ++i) - $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.service != null && message.service.length) - for (var i = 0; i < message.service.length; ++i) - $root.google.protobuf.ServiceDescriptorProto.encode(message.service[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.extension != null && message.extension.length) - for (var i = 0; i < message.extension.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.FileOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.sourceCodeInfo != null && Object.hasOwnProperty.call(message, "sourceCodeInfo")) - $root.google.protobuf.SourceCodeInfo.encode(message.sourceCodeInfo, writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.publicDependency != null && message.publicDependency.length) - for (var i = 0; i < message.publicDependency.length; ++i) - writer.uint32(/* id 10, wireType 0 =*/80).int32(message.publicDependency[i]); - if (message.weakDependency != null && message.weakDependency.length) - for (var i = 0; i < message.weakDependency.length; ++i) - writer.uint32(/* id 11, wireType 0 =*/88).int32(message.weakDependency[i]); - if (message.syntax != null && Object.hasOwnProperty.call(message, "syntax")) - writer.uint32(/* id 12, wireType 2 =*/98).string(message.syntax); - return writer; - }; - - /** - * Encodes the specified FileDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FileDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.IFileDescriptorProto} message FileDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorProto.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.google.protobuf.FileDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message["package"] = reader.string(); - break; - case 3: - if (!(message.dependency && message.dependency.length)) - message.dependency = []; - message.dependency.push(reader.string()); - break; - case 10: - if (!(message.publicDependency && message.publicDependency.length)) - message.publicDependency = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.publicDependency.push(reader.int32()); - } else - message.publicDependency.push(reader.int32()); - break; - case 11: - if (!(message.weakDependency && message.weakDependency.length)) - message.weakDependency = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.weakDependency.push(reader.int32()); - } else - message.weakDependency.push(reader.int32()); - break; - case 4: - if (!(message.messageType && message.messageType.length)) - message.messageType = []; - message.messageType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); - break; - case 5: - if (!(message.enumType && message.enumType.length)) - message.enumType = []; - message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); - break; - case 6: - if (!(message.service && message.service.length)) - message.service = []; - message.service.push($root.google.protobuf.ServiceDescriptorProto.decode(reader, reader.uint32())); - break; - case 7: - if (!(message.extension && message.extension.length)) - message.extension = []; - message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - case 8: - message.options = $root.google.protobuf.FileOptions.decode(reader, reader.uint32()); - break; - case 9: - message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.decode(reader, reader.uint32()); - break; - case 12: - message.syntax = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileDescriptorProto message. - * @function verify - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message["package"] != null && message.hasOwnProperty("package")) - if (!$util.isString(message["package"])) - return "package: string expected"; - if (message.dependency != null && message.hasOwnProperty("dependency")) { - if (!Array.isArray(message.dependency)) - return "dependency: array expected"; - for (var i = 0; i < message.dependency.length; ++i) - if (!$util.isString(message.dependency[i])) - return "dependency: string[] expected"; - } - if (message.publicDependency != null && message.hasOwnProperty("publicDependency")) { - if (!Array.isArray(message.publicDependency)) - return "publicDependency: array expected"; - for (var i = 0; i < message.publicDependency.length; ++i) - if (!$util.isInteger(message.publicDependency[i])) - return "publicDependency: integer[] expected"; - } - if (message.weakDependency != null && message.hasOwnProperty("weakDependency")) { - if (!Array.isArray(message.weakDependency)) - return "weakDependency: array expected"; - for (var i = 0; i < message.weakDependency.length; ++i) - if (!$util.isInteger(message.weakDependency[i])) - return "weakDependency: integer[] expected"; - } - if (message.messageType != null && message.hasOwnProperty("messageType")) { - if (!Array.isArray(message.messageType)) - return "messageType: array expected"; - for (var i = 0; i < message.messageType.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.verify(message.messageType[i]); - if (error) - return "messageType." + error; - } - } - if (message.enumType != null && message.hasOwnProperty("enumType")) { - if (!Array.isArray(message.enumType)) - return "enumType: array expected"; - for (var i = 0; i < message.enumType.length; ++i) { - var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); - if (error) - return "enumType." + error; - } - } - if (message.service != null && message.hasOwnProperty("service")) { - if (!Array.isArray(message.service)) - return "service: array expected"; - for (var i = 0; i < message.service.length; ++i) { - var error = $root.google.protobuf.ServiceDescriptorProto.verify(message.service[i]); - if (error) - return "service." + error; - } - } - if (message.extension != null && message.hasOwnProperty("extension")) { - if (!Array.isArray(message.extension)) - return "extension: array expected"; - for (var i = 0; i < message.extension.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); - if (error) - return "extension." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.FileOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) { - var error = $root.google.protobuf.SourceCodeInfo.verify(message.sourceCodeInfo); - if (error) - return "sourceCodeInfo." + error; - } - if (message.syntax != null && message.hasOwnProperty("syntax")) - if (!$util.isString(message.syntax)) - return "syntax: string expected"; - return null; - }; - - /** - * Creates a FileDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileDescriptorProto} FileDescriptorProto - */ - FileDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileDescriptorProto) - return object; - var message = new $root.google.protobuf.FileDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object["package"] != null) - message["package"] = String(object["package"]); - if (object.dependency) { - if (!Array.isArray(object.dependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.dependency: array expected"); - message.dependency = []; - for (var i = 0; i < object.dependency.length; ++i) - message.dependency[i] = String(object.dependency[i]); - } - if (object.publicDependency) { - if (!Array.isArray(object.publicDependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.publicDependency: array expected"); - message.publicDependency = []; - for (var i = 0; i < object.publicDependency.length; ++i) - message.publicDependency[i] = object.publicDependency[i] | 0; - } - if (object.weakDependency) { - if (!Array.isArray(object.weakDependency)) - throw TypeError(".google.protobuf.FileDescriptorProto.weakDependency: array expected"); - message.weakDependency = []; - for (var i = 0; i < object.weakDependency.length; ++i) - message.weakDependency[i] = object.weakDependency[i] | 0; - } - if (object.messageType) { - if (!Array.isArray(object.messageType)) - throw TypeError(".google.protobuf.FileDescriptorProto.messageType: array expected"); - message.messageType = []; - for (var i = 0; i < object.messageType.length; ++i) { - if (typeof object.messageType[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.messageType: object expected"); - message.messageType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.messageType[i]); - } - } - if (object.enumType) { - if (!Array.isArray(object.enumType)) - throw TypeError(".google.protobuf.FileDescriptorProto.enumType: array expected"); - message.enumType = []; - for (var i = 0; i < object.enumType.length; ++i) { - if (typeof object.enumType[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.enumType: object expected"); - message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); - } - } - if (object.service) { - if (!Array.isArray(object.service)) - throw TypeError(".google.protobuf.FileDescriptorProto.service: array expected"); - message.service = []; - for (var i = 0; i < object.service.length; ++i) { - if (typeof object.service[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.service: object expected"); - message.service[i] = $root.google.protobuf.ServiceDescriptorProto.fromObject(object.service[i]); - } - } - if (object.extension) { - if (!Array.isArray(object.extension)) - throw TypeError(".google.protobuf.FileDescriptorProto.extension: array expected"); - message.extension = []; - for (var i = 0; i < object.extension.length; ++i) { - if (typeof object.extension[i] !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.extension: object expected"); - message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.FileOptions.fromObject(object.options); - } - if (object.sourceCodeInfo != null) { - if (typeof object.sourceCodeInfo !== "object") - throw TypeError(".google.protobuf.FileDescriptorProto.sourceCodeInfo: object expected"); - message.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.fromObject(object.sourceCodeInfo); - } - if (object.syntax != null) - message.syntax = String(object.syntax); - return message; - }; - - /** - * Creates a plain object from a FileDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileDescriptorProto - * @static - * @param {google.protobuf.FileDescriptorProto} message FileDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.dependency = []; - object.messageType = []; - object.enumType = []; - object.service = []; - object.extension = []; - object.publicDependency = []; - object.weakDependency = []; - } - if (options.defaults) { - object.name = ""; - object["package"] = ""; - object.options = null; - object.sourceCodeInfo = null; - object.syntax = ""; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message["package"] != null && message.hasOwnProperty("package")) - object["package"] = message["package"]; - if (message.dependency && message.dependency.length) { - object.dependency = []; - for (var j = 0; j < message.dependency.length; ++j) - object.dependency[j] = message.dependency[j]; - } - if (message.messageType && message.messageType.length) { - object.messageType = []; - for (var j = 0; j < message.messageType.length; ++j) - object.messageType[j] = $root.google.protobuf.DescriptorProto.toObject(message.messageType[j], options); - } - if (message.enumType && message.enumType.length) { - object.enumType = []; - for (var j = 0; j < message.enumType.length; ++j) - object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); - } - if (message.service && message.service.length) { - object.service = []; - for (var j = 0; j < message.service.length; ++j) - object.service[j] = $root.google.protobuf.ServiceDescriptorProto.toObject(message.service[j], options); - } - if (message.extension && message.extension.length) { - object.extension = []; - for (var j = 0; j < message.extension.length; ++j) - object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.FileOptions.toObject(message.options, options); - if (message.sourceCodeInfo != null && message.hasOwnProperty("sourceCodeInfo")) - object.sourceCodeInfo = $root.google.protobuf.SourceCodeInfo.toObject(message.sourceCodeInfo, options); - if (message.publicDependency && message.publicDependency.length) { - object.publicDependency = []; - for (var j = 0; j < message.publicDependency.length; ++j) - object.publicDependency[j] = message.publicDependency[j]; - } - if (message.weakDependency && message.weakDependency.length) { - object.weakDependency = []; - for (var j = 0; j < message.weakDependency.length; ++j) - object.weakDependency[j] = message.weakDependency[j]; - } - if (message.syntax != null && message.hasOwnProperty("syntax")) - object.syntax = message.syntax; - return object; - }; - - /** - * Converts this FileDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.FileDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - FileDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return FileDescriptorProto; - })(); - - protobuf.DescriptorProto = (function() { - - /** - * Properties of a DescriptorProto. - * @memberof google.protobuf - * @interface IDescriptorProto - * @property {string|null} [name] DescriptorProto name - * @property {Array.|null} [field] DescriptorProto field - * @property {Array.|null} [extension] DescriptorProto extension - * @property {Array.|null} [nestedType] DescriptorProto nestedType - * @property {Array.|null} [enumType] DescriptorProto enumType - * @property {Array.|null} [extensionRange] DescriptorProto extensionRange - * @property {Array.|null} [oneofDecl] DescriptorProto oneofDecl - * @property {google.protobuf.IMessageOptions|null} [options] DescriptorProto options - * @property {Array.|null} [reservedRange] DescriptorProto reservedRange - * @property {Array.|null} [reservedName] DescriptorProto reservedName - */ - - /** - * Constructs a new DescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a DescriptorProto. - * @implements IDescriptorProto - * @constructor - * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set - */ - function DescriptorProto(properties) { - this.field = []; - this.extension = []; - this.nestedType = []; - this.enumType = []; - this.extensionRange = []; - this.oneofDecl = []; - this.reservedRange = []; - this.reservedName = []; - 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]]; - } - - /** - * DescriptorProto name. - * @member {string} name - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.name = ""; - - /** - * DescriptorProto field. - * @member {Array.} field - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.field = $util.emptyArray; - - /** - * DescriptorProto extension. - * @member {Array.} extension - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.extension = $util.emptyArray; - - /** - * DescriptorProto nestedType. - * @member {Array.} nestedType - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.nestedType = $util.emptyArray; - - /** - * DescriptorProto enumType. - * @member {Array.} enumType - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.enumType = $util.emptyArray; - - /** - * DescriptorProto extensionRange. - * @member {Array.} extensionRange - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.extensionRange = $util.emptyArray; - - /** - * DescriptorProto oneofDecl. - * @member {Array.} oneofDecl - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.oneofDecl = $util.emptyArray; - - /** - * DescriptorProto options. - * @member {google.protobuf.IMessageOptions|null|undefined} options - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.options = null; - - /** - * DescriptorProto reservedRange. - * @member {Array.} reservedRange - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.reservedRange = $util.emptyArray; - - /** - * DescriptorProto reservedName. - * @member {Array.} reservedName - * @memberof google.protobuf.DescriptorProto - * @instance - */ - DescriptorProto.prototype.reservedName = $util.emptyArray; - - /** - * Creates a new DescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto} DescriptorProto instance - */ - DescriptorProto.create = function create(properties) { - return new DescriptorProto(properties); - }; - - /** - * Encodes the specified DescriptorProto message. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.field != null && message.field.length) - for (var i = 0; i < message.field.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.field[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.nestedType != null && message.nestedType.length) - for (var i = 0; i < message.nestedType.length; ++i) - $root.google.protobuf.DescriptorProto.encode(message.nestedType[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.enumType != null && message.enumType.length) - for (var i = 0; i < message.enumType.length; ++i) - $root.google.protobuf.EnumDescriptorProto.encode(message.enumType[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.extensionRange != null && message.extensionRange.length) - for (var i = 0; i < message.extensionRange.length; ++i) - $root.google.protobuf.DescriptorProto.ExtensionRange.encode(message.extensionRange[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.extension != null && message.extension.length) - for (var i = 0; i < message.extension.length; ++i) - $root.google.protobuf.FieldDescriptorProto.encode(message.extension[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.MessageOptions.encode(message.options, writer.uint32(/* id 7, wireType 2 =*/58).fork()).ldelim(); - if (message.oneofDecl != null && message.oneofDecl.length) - for (var i = 0; i < message.oneofDecl.length; ++i) - $root.google.protobuf.OneofDescriptorProto.encode(message.oneofDecl[i], writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.reservedRange != null && message.reservedRange.length) - for (var i = 0; i < message.reservedRange.length; ++i) - $root.google.protobuf.DescriptorProto.ReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim(); - if (message.reservedName != null && message.reservedName.length) - for (var i = 0; i < message.reservedName.length; ++i) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.reservedName[i]); - return writer; - }; - - /** - * Encodes the specified DescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.IDescriptorProto} message DescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto} DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DescriptorProto.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.google.protobuf.DescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - if (!(message.field && message.field.length)) - message.field = []; - message.field.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - case 6: - if (!(message.extension && message.extension.length)) - message.extension = []; - message.extension.push($root.google.protobuf.FieldDescriptorProto.decode(reader, reader.uint32())); - break; - case 3: - if (!(message.nestedType && message.nestedType.length)) - message.nestedType = []; - message.nestedType.push($root.google.protobuf.DescriptorProto.decode(reader, reader.uint32())); - break; - case 4: - if (!(message.enumType && message.enumType.length)) - message.enumType = []; - message.enumType.push($root.google.protobuf.EnumDescriptorProto.decode(reader, reader.uint32())); - break; - case 5: - if (!(message.extensionRange && message.extensionRange.length)) - message.extensionRange = []; - message.extensionRange.push($root.google.protobuf.DescriptorProto.ExtensionRange.decode(reader, reader.uint32())); - break; - case 8: - if (!(message.oneofDecl && message.oneofDecl.length)) - message.oneofDecl = []; - message.oneofDecl.push($root.google.protobuf.OneofDescriptorProto.decode(reader, reader.uint32())); - break; - case 7: - message.options = $root.google.protobuf.MessageOptions.decode(reader, reader.uint32()); - break; - case 9: - if (!(message.reservedRange && message.reservedRange.length)) - message.reservedRange = []; - message.reservedRange.push($root.google.protobuf.DescriptorProto.ReservedRange.decode(reader, reader.uint32())); - break; - case 10: - if (!(message.reservedName && message.reservedName.length)) - message.reservedName = []; - message.reservedName.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto} DescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DescriptorProto message. - * @function verify - * @memberof google.protobuf.DescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.field != null && message.hasOwnProperty("field")) { - if (!Array.isArray(message.field)) - return "field: array expected"; - for (var i = 0; i < message.field.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.field[i]); - if (error) - return "field." + error; - } - } - if (message.extension != null && message.hasOwnProperty("extension")) { - if (!Array.isArray(message.extension)) - return "extension: array expected"; - for (var i = 0; i < message.extension.length; ++i) { - var error = $root.google.protobuf.FieldDescriptorProto.verify(message.extension[i]); - if (error) - return "extension." + error; - } - } - if (message.nestedType != null && message.hasOwnProperty("nestedType")) { - if (!Array.isArray(message.nestedType)) - return "nestedType: array expected"; - for (var i = 0; i < message.nestedType.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.verify(message.nestedType[i]); - if (error) - return "nestedType." + error; - } - } - if (message.enumType != null && message.hasOwnProperty("enumType")) { - if (!Array.isArray(message.enumType)) - return "enumType: array expected"; - for (var i = 0; i < message.enumType.length; ++i) { - var error = $root.google.protobuf.EnumDescriptorProto.verify(message.enumType[i]); - if (error) - return "enumType." + error; - } - } - if (message.extensionRange != null && message.hasOwnProperty("extensionRange")) { - if (!Array.isArray(message.extensionRange)) - return "extensionRange: array expected"; - for (var i = 0; i < message.extensionRange.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.ExtensionRange.verify(message.extensionRange[i]); - if (error) - return "extensionRange." + error; - } - } - if (message.oneofDecl != null && message.hasOwnProperty("oneofDecl")) { - if (!Array.isArray(message.oneofDecl)) - return "oneofDecl: array expected"; - for (var i = 0; i < message.oneofDecl.length; ++i) { - var error = $root.google.protobuf.OneofDescriptorProto.verify(message.oneofDecl[i]); - if (error) - return "oneofDecl." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.MessageOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { - if (!Array.isArray(message.reservedRange)) - return "reservedRange: array expected"; - for (var i = 0; i < message.reservedRange.length; ++i) { - var error = $root.google.protobuf.DescriptorProto.ReservedRange.verify(message.reservedRange[i]); - if (error) - return "reservedRange." + error; - } - } - if (message.reservedName != null && message.hasOwnProperty("reservedName")) { - if (!Array.isArray(message.reservedName)) - return "reservedName: array expected"; - for (var i = 0; i < message.reservedName.length; ++i) - if (!$util.isString(message.reservedName[i])) - return "reservedName: string[] expected"; - } - return null; - }; - - /** - * Creates a DescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto} DescriptorProto - */ - DescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto) - return object; - var message = new $root.google.protobuf.DescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.field) { - if (!Array.isArray(object.field)) - throw TypeError(".google.protobuf.DescriptorProto.field: array expected"); - message.field = []; - for (var i = 0; i < object.field.length; ++i) { - if (typeof object.field[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.field: object expected"); - message.field[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.field[i]); - } - } - if (object.extension) { - if (!Array.isArray(object.extension)) - throw TypeError(".google.protobuf.DescriptorProto.extension: array expected"); - message.extension = []; - for (var i = 0; i < object.extension.length; ++i) { - if (typeof object.extension[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.extension: object expected"); - message.extension[i] = $root.google.protobuf.FieldDescriptorProto.fromObject(object.extension[i]); - } - } - if (object.nestedType) { - if (!Array.isArray(object.nestedType)) - throw TypeError(".google.protobuf.DescriptorProto.nestedType: array expected"); - message.nestedType = []; - for (var i = 0; i < object.nestedType.length; ++i) { - if (typeof object.nestedType[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.nestedType: object expected"); - message.nestedType[i] = $root.google.protobuf.DescriptorProto.fromObject(object.nestedType[i]); - } - } - if (object.enumType) { - if (!Array.isArray(object.enumType)) - throw TypeError(".google.protobuf.DescriptorProto.enumType: array expected"); - message.enumType = []; - for (var i = 0; i < object.enumType.length; ++i) { - if (typeof object.enumType[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.enumType: object expected"); - message.enumType[i] = $root.google.protobuf.EnumDescriptorProto.fromObject(object.enumType[i]); - } - } - if (object.extensionRange) { - if (!Array.isArray(object.extensionRange)) - throw TypeError(".google.protobuf.DescriptorProto.extensionRange: array expected"); - message.extensionRange = []; - for (var i = 0; i < object.extensionRange.length; ++i) { - if (typeof object.extensionRange[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.extensionRange: object expected"); - message.extensionRange[i] = $root.google.protobuf.DescriptorProto.ExtensionRange.fromObject(object.extensionRange[i]); - } - } - if (object.oneofDecl) { - if (!Array.isArray(object.oneofDecl)) - throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: array expected"); - message.oneofDecl = []; - for (var i = 0; i < object.oneofDecl.length; ++i) { - if (typeof object.oneofDecl[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.oneofDecl: object expected"); - message.oneofDecl[i] = $root.google.protobuf.OneofDescriptorProto.fromObject(object.oneofDecl[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.DescriptorProto.options: object expected"); - message.options = $root.google.protobuf.MessageOptions.fromObject(object.options); - } - if (object.reservedRange) { - if (!Array.isArray(object.reservedRange)) - throw TypeError(".google.protobuf.DescriptorProto.reservedRange: array expected"); - message.reservedRange = []; - for (var i = 0; i < object.reservedRange.length; ++i) { - if (typeof object.reservedRange[i] !== "object") - throw TypeError(".google.protobuf.DescriptorProto.reservedRange: object expected"); - message.reservedRange[i] = $root.google.protobuf.DescriptorProto.ReservedRange.fromObject(object.reservedRange[i]); - } - } - if (object.reservedName) { - if (!Array.isArray(object.reservedName)) - throw TypeError(".google.protobuf.DescriptorProto.reservedName: array expected"); - message.reservedName = []; - for (var i = 0; i < object.reservedName.length; ++i) - message.reservedName[i] = String(object.reservedName[i]); - } - return message; - }; - - /** - * Creates a plain object from a DescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto - * @static - * @param {google.protobuf.DescriptorProto} message DescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.field = []; - object.nestedType = []; - object.enumType = []; - object.extensionRange = []; - object.extension = []; - object.oneofDecl = []; - object.reservedRange = []; - object.reservedName = []; - } - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.field && message.field.length) { - object.field = []; - for (var j = 0; j < message.field.length; ++j) - object.field[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.field[j], options); - } - if (message.nestedType && message.nestedType.length) { - object.nestedType = []; - for (var j = 0; j < message.nestedType.length; ++j) - object.nestedType[j] = $root.google.protobuf.DescriptorProto.toObject(message.nestedType[j], options); - } - if (message.enumType && message.enumType.length) { - object.enumType = []; - for (var j = 0; j < message.enumType.length; ++j) - object.enumType[j] = $root.google.protobuf.EnumDescriptorProto.toObject(message.enumType[j], options); - } - if (message.extensionRange && message.extensionRange.length) { - object.extensionRange = []; - for (var j = 0; j < message.extensionRange.length; ++j) - object.extensionRange[j] = $root.google.protobuf.DescriptorProto.ExtensionRange.toObject(message.extensionRange[j], options); - } - if (message.extension && message.extension.length) { - object.extension = []; - for (var j = 0; j < message.extension.length; ++j) - object.extension[j] = $root.google.protobuf.FieldDescriptorProto.toObject(message.extension[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.MessageOptions.toObject(message.options, options); - if (message.oneofDecl && message.oneofDecl.length) { - object.oneofDecl = []; - for (var j = 0; j < message.oneofDecl.length; ++j) - object.oneofDecl[j] = $root.google.protobuf.OneofDescriptorProto.toObject(message.oneofDecl[j], options); - } - if (message.reservedRange && message.reservedRange.length) { - object.reservedRange = []; - for (var j = 0; j < message.reservedRange.length; ++j) - object.reservedRange[j] = $root.google.protobuf.DescriptorProto.ReservedRange.toObject(message.reservedRange[j], options); - } - if (message.reservedName && message.reservedName.length) { - object.reservedName = []; - for (var j = 0; j < message.reservedName.length; ++j) - object.reservedName[j] = message.reservedName[j]; - } - return object; - }; - - /** - * Converts this DescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto - * @instance - * @returns {Object.} JSON object - */ - DescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - DescriptorProto.ExtensionRange = (function() { - - /** - * Properties of an ExtensionRange. - * @memberof google.protobuf.DescriptorProto - * @interface IExtensionRange - * @property {number|null} [start] ExtensionRange start - * @property {number|null} [end] ExtensionRange end - * @property {google.protobuf.IExtensionRangeOptions|null} [options] ExtensionRange options - */ - - /** - * Constructs a new ExtensionRange. - * @memberof google.protobuf.DescriptorProto - * @classdesc Represents an ExtensionRange. - * @implements IExtensionRange - * @constructor - * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set - */ - function ExtensionRange(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]]; - } - - /** - * ExtensionRange start. - * @member {number} start - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.start = 0; - - /** - * ExtensionRange end. - * @member {number} end - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.end = 0; - - /** - * ExtensionRange options. - * @member {google.protobuf.IExtensionRangeOptions|null|undefined} options - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - */ - ExtensionRange.prototype.options = null; - - /** - * Creates a new ExtensionRange instance using the specified properties. - * @function create - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange instance - */ - ExtensionRange.create = function create(properties) { - return new ExtensionRange(properties); - }; - - /** - * Encodes the specified ExtensionRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.ExtensionRangeOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExtensionRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ExtensionRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.IExtensionRange} message ExtensionRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRange.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.google.protobuf.DescriptorProto.ExtensionRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.start = reader.int32(); - break; - case 2: - message.end = reader.int32(); - break; - case 3: - message.options = $root.google.protobuf.ExtensionRangeOptions.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExtensionRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExtensionRange message. - * @function verify - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExtensionRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.ExtensionRangeOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an ExtensionRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto.ExtensionRange} ExtensionRange - */ - ExtensionRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto.ExtensionRange) - return object; - var message = new $root.google.protobuf.DescriptorProto.ExtensionRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.DescriptorProto.ExtensionRange.options: object expected"); - message.options = $root.google.protobuf.ExtensionRangeOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an ExtensionRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @static - * @param {google.protobuf.DescriptorProto.ExtensionRange} message ExtensionRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExtensionRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - object.options = null; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.ExtensionRangeOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this ExtensionRange to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto.ExtensionRange - * @instance - * @returns {Object.} JSON object - */ - ExtensionRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ExtensionRange; - })(); - - DescriptorProto.ReservedRange = (function() { - - /** - * Properties of a ReservedRange. - * @memberof google.protobuf.DescriptorProto - * @interface IReservedRange - * @property {number|null} [start] ReservedRange start - * @property {number|null} [end] ReservedRange end - */ - - /** - * Constructs a new ReservedRange. - * @memberof google.protobuf.DescriptorProto - * @classdesc Represents a ReservedRange. - * @implements IReservedRange - * @constructor - * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set - */ - function ReservedRange(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]]; - } - - /** - * ReservedRange start. - * @member {number} start - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - */ - ReservedRange.prototype.start = 0; - - /** - * ReservedRange end. - * @member {number} end - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - */ - ReservedRange.prototype.end = 0; - - /** - * Creates a new ReservedRange instance using the specified properties. - * @function create - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange=} [properties] Properties to set - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange instance - */ - ReservedRange.create = function create(properties) { - return new ReservedRange(properties); - }; - - /** - * Encodes the specified ReservedRange message. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReservedRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - return writer; - }; - - /** - * Encodes the specified ReservedRange message, length delimited. Does not implicitly {@link google.protobuf.DescriptorProto.ReservedRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.IReservedRange} message ReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ReservedRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ReservedRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReservedRange.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.google.protobuf.DescriptorProto.ReservedRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.start = reader.int32(); - break; - case 2: - message.end = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ReservedRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ReservedRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ReservedRange message. - * @function verify - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ReservedRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - return null; - }; - - /** - * Creates a ReservedRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.DescriptorProto.ReservedRange} ReservedRange - */ - ReservedRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.DescriptorProto.ReservedRange) - return object; - var message = new $root.google.protobuf.DescriptorProto.ReservedRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - return message; - }; - - /** - * Creates a plain object from a ReservedRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @static - * @param {google.protobuf.DescriptorProto.ReservedRange} message ReservedRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ReservedRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - return object; - }; - - /** - * Converts this ReservedRange to JSON. - * @function toJSON - * @memberof google.protobuf.DescriptorProto.ReservedRange - * @instance - * @returns {Object.} JSON object - */ - ReservedRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ReservedRange; - })(); - - return DescriptorProto; - })(); - - protobuf.ExtensionRangeOptions = (function() { - - /** - * Properties of an ExtensionRangeOptions. - * @memberof google.protobuf - * @interface IExtensionRangeOptions - * @property {Array.|null} [uninterpretedOption] ExtensionRangeOptions uninterpretedOption - */ - - /** - * Constructs a new ExtensionRangeOptions. - * @memberof google.protobuf - * @classdesc Represents an ExtensionRangeOptions. - * @implements IExtensionRangeOptions - * @constructor - * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set - */ - function ExtensionRangeOptions(properties) { - this.uninterpretedOption = []; - 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]]; - } - - /** - * ExtensionRangeOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - */ - ExtensionRangeOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * Creates a new ExtensionRangeOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.IExtensionRangeOptions=} [properties] Properties to set - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions instance - */ - ExtensionRangeOptions.create = function create(properties) { - return new ExtensionRangeOptions(properties); - }; - - /** - * Encodes the specified ExtensionRangeOptions message. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRangeOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ExtensionRangeOptions message, length delimited. Does not implicitly {@link google.protobuf.ExtensionRangeOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.IExtensionRangeOptions} message ExtensionRangeOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ExtensionRangeOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRangeOptions.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.google.protobuf.ExtensionRangeOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ExtensionRangeOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ExtensionRangeOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ExtensionRangeOptions message. - * @function verify - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ExtensionRangeOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; - - /** - * Creates an ExtensionRangeOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ExtensionRangeOptions} ExtensionRangeOptions - */ - ExtensionRangeOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ExtensionRangeOptions) - return object; - var message = new $root.google.protobuf.ExtensionRangeOptions(); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.ExtensionRangeOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an ExtensionRangeOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ExtensionRangeOptions - * @static - * @param {google.protobuf.ExtensionRangeOptions} message ExtensionRangeOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ExtensionRangeOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this ExtensionRangeOptions to JSON. - * @function toJSON - * @memberof google.protobuf.ExtensionRangeOptions - * @instance - * @returns {Object.} JSON object - */ - ExtensionRangeOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ExtensionRangeOptions; - })(); - - protobuf.FieldDescriptorProto = (function() { - - /** - * Properties of a FieldDescriptorProto. - * @memberof google.protobuf - * @interface IFieldDescriptorProto - * @property {string|null} [name] FieldDescriptorProto name - * @property {number|null} [number] FieldDescriptorProto number - * @property {google.protobuf.FieldDescriptorProto.Label|null} [label] FieldDescriptorProto label - * @property {google.protobuf.FieldDescriptorProto.Type|null} [type] FieldDescriptorProto type - * @property {string|null} [typeName] FieldDescriptorProto typeName - * @property {string|null} [extendee] FieldDescriptorProto extendee - * @property {string|null} [defaultValue] FieldDescriptorProto defaultValue - * @property {number|null} [oneofIndex] FieldDescriptorProto oneofIndex - * @property {string|null} [jsonName] FieldDescriptorProto jsonName - * @property {google.protobuf.IFieldOptions|null} [options] FieldDescriptorProto options - * @property {boolean|null} [proto3Optional] FieldDescriptorProto proto3Optional - */ - - /** - * Constructs a new FieldDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a FieldDescriptorProto. - * @implements IFieldDescriptorProto - * @constructor - * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set - */ - function FieldDescriptorProto(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]]; - } - - /** - * FieldDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.name = ""; - - /** - * FieldDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.number = 0; - - /** - * FieldDescriptorProto label. - * @member {google.protobuf.FieldDescriptorProto.Label} label - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.label = 1; - - /** - * FieldDescriptorProto type. - * @member {google.protobuf.FieldDescriptorProto.Type} type - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.type = 1; - - /** - * FieldDescriptorProto typeName. - * @member {string} typeName - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.typeName = ""; - - /** - * FieldDescriptorProto extendee. - * @member {string} extendee - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.extendee = ""; - - /** - * FieldDescriptorProto defaultValue. - * @member {string} defaultValue - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.defaultValue = ""; - - /** - * FieldDescriptorProto oneofIndex. - * @member {number} oneofIndex - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.oneofIndex = 0; - - /** - * FieldDescriptorProto jsonName. - * @member {string} jsonName - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.jsonName = ""; - - /** - * FieldDescriptorProto options. - * @member {google.protobuf.IFieldOptions|null|undefined} options - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.options = null; - - /** - * FieldDescriptorProto proto3Optional. - * @member {boolean} proto3Optional - * @memberof google.protobuf.FieldDescriptorProto - * @instance - */ - FieldDescriptorProto.prototype.proto3Optional = false; - - /** - * Creates a new FieldDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto instance - */ - FieldDescriptorProto.create = function create(properties) { - return new FieldDescriptorProto(properties); - }; - - /** - * Encodes the specified FieldDescriptorProto message. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.extendee != null && Object.hasOwnProperty.call(message, "extendee")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.extendee); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.number); - if (message.label != null && Object.hasOwnProperty.call(message, "label")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.label); - if (message.type != null && Object.hasOwnProperty.call(message, "type")) - writer.uint32(/* id 5, wireType 0 =*/40).int32(message.type); - if (message.typeName != null && Object.hasOwnProperty.call(message, "typeName")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.typeName); - if (message.defaultValue != null && Object.hasOwnProperty.call(message, "defaultValue")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.defaultValue); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.FieldOptions.encode(message.options, writer.uint32(/* id 8, wireType 2 =*/66).fork()).ldelim(); - if (message.oneofIndex != null && Object.hasOwnProperty.call(message, "oneofIndex")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.oneofIndex); - if (message.jsonName != null && Object.hasOwnProperty.call(message, "jsonName")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.jsonName); - if (message.proto3Optional != null && Object.hasOwnProperty.call(message, "proto3Optional")) - writer.uint32(/* id 17, wireType 0 =*/136).bool(message.proto3Optional); - return writer; - }; - - /** - * Encodes the specified FieldDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.FieldDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.IFieldDescriptorProto} message FieldDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldDescriptorProto.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.google.protobuf.FieldDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 3: - message.number = reader.int32(); - break; - case 4: - message.label = reader.int32(); - break; - case 5: - message.type = reader.int32(); - break; - case 6: - message.typeName = reader.string(); - break; - case 2: - message.extendee = reader.string(); - break; - case 7: - message.defaultValue = reader.string(); - break; - case 9: - message.oneofIndex = reader.int32(); - break; - case 10: - message.jsonName = reader.string(); - break; - case 8: - message.options = $root.google.protobuf.FieldOptions.decode(reader, reader.uint32()); - break; - case 17: - message.proto3Optional = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldDescriptorProto message. - * @function verify - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.label != null && message.hasOwnProperty("label")) - switch (message.label) { - default: - return "label: enum value expected"; - case 1: - case 2: - case 3: - break; - } - if (message.type != null && message.hasOwnProperty("type")) - switch (message.type) { - default: - return "type: enum value expected"; - case 1: - case 2: - case 3: - case 4: - case 5: - case 6: - case 7: - case 8: - case 9: - case 10: - case 11: - case 12: - case 13: - case 14: - case 15: - case 16: - case 17: - case 18: - break; - } - if (message.typeName != null && message.hasOwnProperty("typeName")) - if (!$util.isString(message.typeName)) - return "typeName: string expected"; - if (message.extendee != null && message.hasOwnProperty("extendee")) - if (!$util.isString(message.extendee)) - return "extendee: string expected"; - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) - if (!$util.isString(message.defaultValue)) - return "defaultValue: string expected"; - if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) - if (!$util.isInteger(message.oneofIndex)) - return "oneofIndex: integer expected"; - if (message.jsonName != null && message.hasOwnProperty("jsonName")) - if (!$util.isString(message.jsonName)) - return "jsonName: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.FieldOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) - if (typeof message.proto3Optional !== "boolean") - return "proto3Optional: boolean expected"; - return null; - }; - - /** - * Creates a FieldDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldDescriptorProto} FieldDescriptorProto - */ - FieldDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldDescriptorProto) - return object; - var message = new $root.google.protobuf.FieldDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.number != null) - message.number = object.number | 0; - switch (object.label) { - case "LABEL_OPTIONAL": - case 1: - message.label = 1; - break; - case "LABEL_REQUIRED": - case 2: - message.label = 2; - break; - case "LABEL_REPEATED": - case 3: - message.label = 3; - break; - } - switch (object.type) { - case "TYPE_DOUBLE": - case 1: - message.type = 1; - break; - case "TYPE_FLOAT": - case 2: - message.type = 2; - break; - case "TYPE_INT64": - case 3: - message.type = 3; - break; - case "TYPE_UINT64": - case 4: - message.type = 4; - break; - case "TYPE_INT32": - case 5: - message.type = 5; - break; - case "TYPE_FIXED64": - case 6: - message.type = 6; - break; - case "TYPE_FIXED32": - case 7: - message.type = 7; - break; - case "TYPE_BOOL": - case 8: - message.type = 8; - break; - case "TYPE_STRING": - case 9: - message.type = 9; - break; - case "TYPE_GROUP": - case 10: - message.type = 10; - break; - case "TYPE_MESSAGE": - case 11: - message.type = 11; - break; - case "TYPE_BYTES": - case 12: - message.type = 12; - break; - case "TYPE_UINT32": - case 13: - message.type = 13; - break; - case "TYPE_ENUM": - case 14: - message.type = 14; - break; - case "TYPE_SFIXED32": - case 15: - message.type = 15; - break; - case "TYPE_SFIXED64": - case 16: - message.type = 16; - break; - case "TYPE_SINT32": - case 17: - message.type = 17; - break; - case "TYPE_SINT64": - case 18: - message.type = 18; - break; - } - if (object.typeName != null) - message.typeName = String(object.typeName); - if (object.extendee != null) - message.extendee = String(object.extendee); - if (object.defaultValue != null) - message.defaultValue = String(object.defaultValue); - if (object.oneofIndex != null) - message.oneofIndex = object.oneofIndex | 0; - if (object.jsonName != null) - message.jsonName = String(object.jsonName); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.FieldDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.FieldOptions.fromObject(object.options); - } - if (object.proto3Optional != null) - message.proto3Optional = Boolean(object.proto3Optional); - return message; - }; - - /** - * Creates a plain object from a FieldDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldDescriptorProto - * @static - * @param {google.protobuf.FieldDescriptorProto} message FieldDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.extendee = ""; - object.number = 0; - object.label = options.enums === String ? "LABEL_OPTIONAL" : 1; - object.type = options.enums === String ? "TYPE_DOUBLE" : 1; - object.typeName = ""; - object.defaultValue = ""; - object.options = null; - object.oneofIndex = 0; - object.jsonName = ""; - object.proto3Optional = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.extendee != null && message.hasOwnProperty("extendee")) - object.extendee = message.extendee; - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.label != null && message.hasOwnProperty("label")) - object.label = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Label[message.label] : message.label; - if (message.type != null && message.hasOwnProperty("type")) - object.type = options.enums === String ? $root.google.protobuf.FieldDescriptorProto.Type[message.type] : message.type; - if (message.typeName != null && message.hasOwnProperty("typeName")) - object.typeName = message.typeName; - if (message.defaultValue != null && message.hasOwnProperty("defaultValue")) - object.defaultValue = message.defaultValue; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.FieldOptions.toObject(message.options, options); - if (message.oneofIndex != null && message.hasOwnProperty("oneofIndex")) - object.oneofIndex = message.oneofIndex; - if (message.jsonName != null && message.hasOwnProperty("jsonName")) - object.jsonName = message.jsonName; - if (message.proto3Optional != null && message.hasOwnProperty("proto3Optional")) - object.proto3Optional = message.proto3Optional; - return object; - }; - - /** - * Converts this FieldDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.FieldDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - FieldDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * Type enum. - * @name google.protobuf.FieldDescriptorProto.Type - * @enum {number} - * @property {number} TYPE_DOUBLE=1 TYPE_DOUBLE value - * @property {number} TYPE_FLOAT=2 TYPE_FLOAT value - * @property {number} TYPE_INT64=3 TYPE_INT64 value - * @property {number} TYPE_UINT64=4 TYPE_UINT64 value - * @property {number} TYPE_INT32=5 TYPE_INT32 value - * @property {number} TYPE_FIXED64=6 TYPE_FIXED64 value - * @property {number} TYPE_FIXED32=7 TYPE_FIXED32 value - * @property {number} TYPE_BOOL=8 TYPE_BOOL value - * @property {number} TYPE_STRING=9 TYPE_STRING value - * @property {number} TYPE_GROUP=10 TYPE_GROUP value - * @property {number} TYPE_MESSAGE=11 TYPE_MESSAGE value - * @property {number} TYPE_BYTES=12 TYPE_BYTES value - * @property {number} TYPE_UINT32=13 TYPE_UINT32 value - * @property {number} TYPE_ENUM=14 TYPE_ENUM value - * @property {number} TYPE_SFIXED32=15 TYPE_SFIXED32 value - * @property {number} TYPE_SFIXED64=16 TYPE_SFIXED64 value - * @property {number} TYPE_SINT32=17 TYPE_SINT32 value - * @property {number} TYPE_SINT64=18 TYPE_SINT64 value - */ - FieldDescriptorProto.Type = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "TYPE_DOUBLE"] = 1; - values[valuesById[2] = "TYPE_FLOAT"] = 2; - values[valuesById[3] = "TYPE_INT64"] = 3; - values[valuesById[4] = "TYPE_UINT64"] = 4; - values[valuesById[5] = "TYPE_INT32"] = 5; - values[valuesById[6] = "TYPE_FIXED64"] = 6; - values[valuesById[7] = "TYPE_FIXED32"] = 7; - values[valuesById[8] = "TYPE_BOOL"] = 8; - values[valuesById[9] = "TYPE_STRING"] = 9; - values[valuesById[10] = "TYPE_GROUP"] = 10; - values[valuesById[11] = "TYPE_MESSAGE"] = 11; - values[valuesById[12] = "TYPE_BYTES"] = 12; - values[valuesById[13] = "TYPE_UINT32"] = 13; - values[valuesById[14] = "TYPE_ENUM"] = 14; - values[valuesById[15] = "TYPE_SFIXED32"] = 15; - values[valuesById[16] = "TYPE_SFIXED64"] = 16; - values[valuesById[17] = "TYPE_SINT32"] = 17; - values[valuesById[18] = "TYPE_SINT64"] = 18; - return values; - })(); - - /** - * Label enum. - * @name google.protobuf.FieldDescriptorProto.Label - * @enum {number} - * @property {number} LABEL_OPTIONAL=1 LABEL_OPTIONAL value - * @property {number} LABEL_REQUIRED=2 LABEL_REQUIRED value - * @property {number} LABEL_REPEATED=3 LABEL_REPEATED value - */ - FieldDescriptorProto.Label = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "LABEL_OPTIONAL"] = 1; - values[valuesById[2] = "LABEL_REQUIRED"] = 2; - values[valuesById[3] = "LABEL_REPEATED"] = 3; - return values; - })(); - - return FieldDescriptorProto; - })(); - - protobuf.OneofDescriptorProto = (function() { - - /** - * Properties of an OneofDescriptorProto. - * @memberof google.protobuf - * @interface IOneofDescriptorProto - * @property {string|null} [name] OneofDescriptorProto name - * @property {google.protobuf.IOneofOptions|null} [options] OneofDescriptorProto options - */ - - /** - * Constructs a new OneofDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an OneofDescriptorProto. - * @implements IOneofDescriptorProto - * @constructor - * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set - */ - function OneofDescriptorProto(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]]; - } - - /** - * OneofDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.OneofDescriptorProto - * @instance - */ - OneofDescriptorProto.prototype.name = ""; - - /** - * OneofDescriptorProto options. - * @member {google.protobuf.IOneofOptions|null|undefined} options - * @memberof google.protobuf.OneofDescriptorProto - * @instance - */ - OneofDescriptorProto.prototype.options = null; - - /** - * Creates a new OneofDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto instance - */ - OneofDescriptorProto.create = function create(properties) { - return new OneofDescriptorProto(properties); - }; - - /** - * Encodes the specified OneofDescriptorProto message. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.OneofOptions.encode(message.options, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OneofDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.OneofDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.IOneofDescriptorProto} message OneofDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofDescriptorProto.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.google.protobuf.OneofDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.options = $root.google.protobuf.OneofOptions.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OneofDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OneofDescriptorProto message. - * @function verify - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OneofDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.OneofOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an OneofDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.OneofDescriptorProto} OneofDescriptorProto - */ - OneofDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.OneofDescriptorProto) - return object; - var message = new $root.google.protobuf.OneofDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.OneofDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.OneofOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an OneofDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.OneofDescriptorProto - * @static - * @param {google.protobuf.OneofDescriptorProto} message OneofDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OneofDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.OneofOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this OneofDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.OneofDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - OneofDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return OneofDescriptorProto; - })(); - - protobuf.EnumDescriptorProto = (function() { - - /** - * Properties of an EnumDescriptorProto. - * @memberof google.protobuf - * @interface IEnumDescriptorProto - * @property {string|null} [name] EnumDescriptorProto name - * @property {Array.|null} [value] EnumDescriptorProto value - * @property {google.protobuf.IEnumOptions|null} [options] EnumDescriptorProto options - * @property {Array.|null} [reservedRange] EnumDescriptorProto reservedRange - * @property {Array.|null} [reservedName] EnumDescriptorProto reservedName - */ - - /** - * Constructs a new EnumDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an EnumDescriptorProto. - * @implements IEnumDescriptorProto - * @constructor - * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set - */ - function EnumDescriptorProto(properties) { - this.value = []; - this.reservedRange = []; - this.reservedName = []; - 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]]; - } - - /** - * EnumDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.name = ""; - - /** - * EnumDescriptorProto value. - * @member {Array.} value - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.value = $util.emptyArray; - - /** - * EnumDescriptorProto options. - * @member {google.protobuf.IEnumOptions|null|undefined} options - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.options = null; - - /** - * EnumDescriptorProto reservedRange. - * @member {Array.} reservedRange - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.reservedRange = $util.emptyArray; - - /** - * EnumDescriptorProto reservedName. - * @member {Array.} reservedName - * @memberof google.protobuf.EnumDescriptorProto - * @instance - */ - EnumDescriptorProto.prototype.reservedName = $util.emptyArray; - - /** - * Creates a new EnumDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto instance - */ - EnumDescriptorProto.create = function create(properties) { - return new EnumDescriptorProto(properties); - }; - - /** - * Encodes the specified EnumDescriptorProto message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.value != null && message.value.length) - for (var i = 0; i < message.value.length; ++i) - $root.google.protobuf.EnumValueDescriptorProto.encode(message.value[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.EnumOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.reservedRange != null && message.reservedRange.length) - for (var i = 0; i < message.reservedRange.length; ++i) - $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.encode(message.reservedRange[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.reservedName != null && message.reservedName.length) - for (var i = 0; i < message.reservedName.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.reservedName[i]); - return writer; - }; - - /** - * Encodes the specified EnumDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.IEnumDescriptorProto} message EnumDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumDescriptorProto.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.google.protobuf.EnumDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - if (!(message.value && message.value.length)) - message.value = []; - message.value.push($root.google.protobuf.EnumValueDescriptorProto.decode(reader, reader.uint32())); - break; - case 3: - message.options = $root.google.protobuf.EnumOptions.decode(reader, reader.uint32()); - break; - case 4: - if (!(message.reservedRange && message.reservedRange.length)) - message.reservedRange = []; - message.reservedRange.push($root.google.protobuf.EnumDescriptorProto.EnumReservedRange.decode(reader, reader.uint32())); - break; - case 5: - if (!(message.reservedName && message.reservedName.length)) - message.reservedName = []; - message.reservedName.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumDescriptorProto message. - * @function verify - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.value != null && message.hasOwnProperty("value")) { - if (!Array.isArray(message.value)) - return "value: array expected"; - for (var i = 0; i < message.value.length; ++i) { - var error = $root.google.protobuf.EnumValueDescriptorProto.verify(message.value[i]); - if (error) - return "value." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.EnumOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.reservedRange != null && message.hasOwnProperty("reservedRange")) { - if (!Array.isArray(message.reservedRange)) - return "reservedRange: array expected"; - for (var i = 0; i < message.reservedRange.length; ++i) { - var error = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.verify(message.reservedRange[i]); - if (error) - return "reservedRange." + error; - } - } - if (message.reservedName != null && message.hasOwnProperty("reservedName")) { - if (!Array.isArray(message.reservedName)) - return "reservedName: array expected"; - for (var i = 0; i < message.reservedName.length; ++i) - if (!$util.isString(message.reservedName[i])) - return "reservedName: string[] expected"; - } - return null; - }; - - /** - * Creates an EnumDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumDescriptorProto} EnumDescriptorProto - */ - EnumDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumDescriptorProto) - return object; - var message = new $root.google.protobuf.EnumDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.value) { - if (!Array.isArray(object.value)) - throw TypeError(".google.protobuf.EnumDescriptorProto.value: array expected"); - message.value = []; - for (var i = 0; i < object.value.length; ++i) { - if (typeof object.value[i] !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.value: object expected"); - message.value[i] = $root.google.protobuf.EnumValueDescriptorProto.fromObject(object.value[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.EnumOptions.fromObject(object.options); - } - if (object.reservedRange) { - if (!Array.isArray(object.reservedRange)) - throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: array expected"); - message.reservedRange = []; - for (var i = 0; i < object.reservedRange.length; ++i) { - if (typeof object.reservedRange[i] !== "object") - throw TypeError(".google.protobuf.EnumDescriptorProto.reservedRange: object expected"); - message.reservedRange[i] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.fromObject(object.reservedRange[i]); - } - } - if (object.reservedName) { - if (!Array.isArray(object.reservedName)) - throw TypeError(".google.protobuf.EnumDescriptorProto.reservedName: array expected"); - message.reservedName = []; - for (var i = 0; i < object.reservedName.length; ++i) - message.reservedName[i] = String(object.reservedName[i]); - } - return message; - }; - - /** - * Creates a plain object from an EnumDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumDescriptorProto - * @static - * @param {google.protobuf.EnumDescriptorProto} message EnumDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.value = []; - object.reservedRange = []; - object.reservedName = []; - } - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.value && message.value.length) { - object.value = []; - for (var j = 0; j < message.value.length; ++j) - object.value[j] = $root.google.protobuf.EnumValueDescriptorProto.toObject(message.value[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.EnumOptions.toObject(message.options, options); - if (message.reservedRange && message.reservedRange.length) { - object.reservedRange = []; - for (var j = 0; j < message.reservedRange.length; ++j) - object.reservedRange[j] = $root.google.protobuf.EnumDescriptorProto.EnumReservedRange.toObject(message.reservedRange[j], options); - } - if (message.reservedName && message.reservedName.length) { - object.reservedName = []; - for (var j = 0; j < message.reservedName.length; ++j) - object.reservedName[j] = message.reservedName[j]; - } - return object; - }; - - /** - * Converts this EnumDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.EnumDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - EnumDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - EnumDescriptorProto.EnumReservedRange = (function() { - - /** - * Properties of an EnumReservedRange. - * @memberof google.protobuf.EnumDescriptorProto - * @interface IEnumReservedRange - * @property {number|null} [start] EnumReservedRange start - * @property {number|null} [end] EnumReservedRange end - */ - - /** - * Constructs a new EnumReservedRange. - * @memberof google.protobuf.EnumDescriptorProto - * @classdesc Represents an EnumReservedRange. - * @implements IEnumReservedRange - * @constructor - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set - */ - function EnumReservedRange(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]]; - } - - /** - * EnumReservedRange start. - * @member {number} start - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - */ - EnumReservedRange.prototype.start = 0; - - /** - * EnumReservedRange end. - * @member {number} end - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - */ - EnumReservedRange.prototype.end = 0; - - /** - * Creates a new EnumReservedRange instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange=} [properties] Properties to set - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange instance - */ - EnumReservedRange.create = function create(properties) { - return new EnumReservedRange(properties); - }; - - /** - * Encodes the specified EnumReservedRange message. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumReservedRange.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.start != null && Object.hasOwnProperty.call(message, "start")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.start); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.end); - return writer; - }; - - /** - * Encodes the specified EnumReservedRange message, length delimited. Does not implicitly {@link google.protobuf.EnumDescriptorProto.EnumReservedRange.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.IEnumReservedRange} message EnumReservedRange message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumReservedRange.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumReservedRange.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.google.protobuf.EnumDescriptorProto.EnumReservedRange(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.start = reader.int32(); - break; - case 2: - message.end = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumReservedRange message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumReservedRange.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumReservedRange message. - * @function verify - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumReservedRange.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.start != null && message.hasOwnProperty("start")) - if (!$util.isInteger(message.start)) - return "start: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - return null; - }; - - /** - * Creates an EnumReservedRange message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumDescriptorProto.EnumReservedRange} EnumReservedRange - */ - EnumReservedRange.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumDescriptorProto.EnumReservedRange) - return object; - var message = new $root.google.protobuf.EnumDescriptorProto.EnumReservedRange(); - if (object.start != null) - message.start = object.start | 0; - if (object.end != null) - message.end = object.end | 0; - return message; - }; - - /** - * Creates a plain object from an EnumReservedRange message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @static - * @param {google.protobuf.EnumDescriptorProto.EnumReservedRange} message EnumReservedRange - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumReservedRange.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.start = 0; - object.end = 0; - } - if (message.start != null && message.hasOwnProperty("start")) - object.start = message.start; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - return object; - }; - - /** - * Converts this EnumReservedRange to JSON. - * @function toJSON - * @memberof google.protobuf.EnumDescriptorProto.EnumReservedRange - * @instance - * @returns {Object.} JSON object - */ - EnumReservedRange.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return EnumReservedRange; - })(); - - return EnumDescriptorProto; - })(); - - protobuf.EnumValueDescriptorProto = (function() { - - /** - * Properties of an EnumValueDescriptorProto. - * @memberof google.protobuf - * @interface IEnumValueDescriptorProto - * @property {string|null} [name] EnumValueDescriptorProto name - * @property {number|null} [number] EnumValueDescriptorProto number - * @property {google.protobuf.IEnumValueOptions|null} [options] EnumValueDescriptorProto options - */ - - /** - * Constructs a new EnumValueDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents an EnumValueDescriptorProto. - * @implements IEnumValueDescriptorProto - * @constructor - * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set - */ - function EnumValueDescriptorProto(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]]; - } - - /** - * EnumValueDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.name = ""; - - /** - * EnumValueDescriptorProto number. - * @member {number} number - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.number = 0; - - /** - * EnumValueDescriptorProto options. - * @member {google.protobuf.IEnumValueOptions|null|undefined} options - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - */ - EnumValueDescriptorProto.prototype.options = null; - - /** - * Creates a new EnumValueDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto instance - */ - EnumValueDescriptorProto.create = function create(properties) { - return new EnumValueDescriptorProto(properties); - }; - - /** - * Encodes the specified EnumValueDescriptorProto message. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.number != null && Object.hasOwnProperty.call(message, "number")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.number); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.EnumValueOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified EnumValueDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.EnumValueDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.IEnumValueDescriptorProto} message EnumValueDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueDescriptorProto.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.google.protobuf.EnumValueDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.number = reader.int32(); - break; - case 3: - message.options = $root.google.protobuf.EnumValueOptions.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumValueDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumValueDescriptorProto message. - * @function verify - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumValueDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.number != null && message.hasOwnProperty("number")) - if (!$util.isInteger(message.number)) - return "number: integer expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.EnumValueOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates an EnumValueDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueDescriptorProto} EnumValueDescriptorProto - */ - EnumValueDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValueDescriptorProto) - return object; - var message = new $root.google.protobuf.EnumValueDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.number != null) - message.number = object.number | 0; - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.EnumValueDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.EnumValueOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from an EnumValueDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumValueDescriptorProto - * @static - * @param {google.protobuf.EnumValueDescriptorProto} message EnumValueDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumValueDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.number = 0; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.number != null && message.hasOwnProperty("number")) - object.number = message.number; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.EnumValueOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this EnumValueDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.EnumValueDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - EnumValueDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return EnumValueDescriptorProto; - })(); - - protobuf.ServiceDescriptorProto = (function() { - - /** - * Properties of a ServiceDescriptorProto. - * @memberof google.protobuf - * @interface IServiceDescriptorProto - * @property {string|null} [name] ServiceDescriptorProto name - * @property {Array.|null} [method] ServiceDescriptorProto method - * @property {google.protobuf.IServiceOptions|null} [options] ServiceDescriptorProto options - */ - - /** - * Constructs a new ServiceDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a ServiceDescriptorProto. - * @implements IServiceDescriptorProto - * @constructor - * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set - */ - function ServiceDescriptorProto(properties) { - this.method = []; - 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]]; - } - - /** - * ServiceDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.name = ""; - - /** - * ServiceDescriptorProto method. - * @member {Array.} method - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.method = $util.emptyArray; - - /** - * ServiceDescriptorProto options. - * @member {google.protobuf.IServiceOptions|null|undefined} options - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - */ - ServiceDescriptorProto.prototype.options = null; - - /** - * Creates a new ServiceDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto instance - */ - ServiceDescriptorProto.create = function create(properties) { - return new ServiceDescriptorProto(properties); - }; - - /** - * Encodes the specified ServiceDescriptorProto message. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.method != null && message.method.length) - for (var i = 0; i < message.method.length; ++i) - $root.google.protobuf.MethodDescriptorProto.encode(message.method[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.ServiceOptions.encode(message.options, writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ServiceDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.ServiceDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.IServiceDescriptorProto} message ServiceDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceDescriptorProto.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.google.protobuf.ServiceDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - if (!(message.method && message.method.length)) - message.method = []; - message.method.push($root.google.protobuf.MethodDescriptorProto.decode(reader, reader.uint32())); - break; - case 3: - message.options = $root.google.protobuf.ServiceOptions.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ServiceDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ServiceDescriptorProto message. - * @function verify - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.method != null && message.hasOwnProperty("method")) { - if (!Array.isArray(message.method)) - return "method: array expected"; - for (var i = 0; i < message.method.length; ++i) { - var error = $root.google.protobuf.MethodDescriptorProto.verify(message.method[i]); - if (error) - return "method." + error; - } - } - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.ServiceOptions.verify(message.options); - if (error) - return "options." + error; - } - return null; - }; - - /** - * Creates a ServiceDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceDescriptorProto} ServiceDescriptorProto - */ - ServiceDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceDescriptorProto) - return object; - var message = new $root.google.protobuf.ServiceDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.method) { - if (!Array.isArray(object.method)) - throw TypeError(".google.protobuf.ServiceDescriptorProto.method: array expected"); - message.method = []; - for (var i = 0; i < object.method.length; ++i) { - if (typeof object.method[i] !== "object") - throw TypeError(".google.protobuf.ServiceDescriptorProto.method: object expected"); - message.method[i] = $root.google.protobuf.MethodDescriptorProto.fromObject(object.method[i]); - } - } - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.ServiceDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.ServiceOptions.fromObject(object.options); - } - return message; - }; - - /** - * Creates a plain object from a ServiceDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ServiceDescriptorProto - * @static - * @param {google.protobuf.ServiceDescriptorProto} message ServiceDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.method = []; - if (options.defaults) { - object.name = ""; - object.options = null; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.method && message.method.length) { - object.method = []; - for (var j = 0; j < message.method.length; ++j) - object.method[j] = $root.google.protobuf.MethodDescriptorProto.toObject(message.method[j], options); - } - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.ServiceOptions.toObject(message.options, options); - return object; - }; - - /** - * Converts this ServiceDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.ServiceDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - ServiceDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ServiceDescriptorProto; - })(); - - protobuf.MethodDescriptorProto = (function() { - - /** - * Properties of a MethodDescriptorProto. - * @memberof google.protobuf - * @interface IMethodDescriptorProto - * @property {string|null} [name] MethodDescriptorProto name - * @property {string|null} [inputType] MethodDescriptorProto inputType - * @property {string|null} [outputType] MethodDescriptorProto outputType - * @property {google.protobuf.IMethodOptions|null} [options] MethodDescriptorProto options - * @property {boolean|null} [clientStreaming] MethodDescriptorProto clientStreaming - * @property {boolean|null} [serverStreaming] MethodDescriptorProto serverStreaming - */ - - /** - * Constructs a new MethodDescriptorProto. - * @memberof google.protobuf - * @classdesc Represents a MethodDescriptorProto. - * @implements IMethodDescriptorProto - * @constructor - * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set - */ - function MethodDescriptorProto(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]]; - } - - /** - * MethodDescriptorProto name. - * @member {string} name - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.name = ""; - - /** - * MethodDescriptorProto inputType. - * @member {string} inputType - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.inputType = ""; - - /** - * MethodDescriptorProto outputType. - * @member {string} outputType - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.outputType = ""; - - /** - * MethodDescriptorProto options. - * @member {google.protobuf.IMethodOptions|null|undefined} options - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.options = null; - - /** - * MethodDescriptorProto clientStreaming. - * @member {boolean} clientStreaming - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.clientStreaming = false; - - /** - * MethodDescriptorProto serverStreaming. - * @member {boolean} serverStreaming - * @memberof google.protobuf.MethodDescriptorProto - * @instance - */ - MethodDescriptorProto.prototype.serverStreaming = false; - - /** - * Creates a new MethodDescriptorProto instance using the specified properties. - * @function create - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto=} [properties] Properties to set - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto instance - */ - MethodDescriptorProto.create = function create(properties) { - return new MethodDescriptorProto(properties); - }; - - /** - * Encodes the specified MethodDescriptorProto message. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodDescriptorProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && Object.hasOwnProperty.call(message, "name")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.name); - if (message.inputType != null && Object.hasOwnProperty.call(message, "inputType")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.inputType); - if (message.outputType != null && Object.hasOwnProperty.call(message, "outputType")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.outputType); - if (message.options != null && Object.hasOwnProperty.call(message, "options")) - $root.google.protobuf.MethodOptions.encode(message.options, writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.clientStreaming != null && Object.hasOwnProperty.call(message, "clientStreaming")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.clientStreaming); - if (message.serverStreaming != null && Object.hasOwnProperty.call(message, "serverStreaming")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.serverStreaming); - return writer; - }; - - /** - * Encodes the specified MethodDescriptorProto message, length delimited. Does not implicitly {@link google.protobuf.MethodDescriptorProto.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.IMethodDescriptorProto} message MethodDescriptorProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodDescriptorProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodDescriptorProto.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.google.protobuf.MethodDescriptorProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.name = reader.string(); - break; - case 2: - message.inputType = reader.string(); - break; - case 3: - message.outputType = reader.string(); - break; - case 4: - message.options = $root.google.protobuf.MethodOptions.decode(reader, reader.uint32()); - break; - case 5: - message.clientStreaming = reader.bool(); - break; - case 6: - message.serverStreaming = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MethodDescriptorProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodDescriptorProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MethodDescriptorProto message. - * @function verify - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MethodDescriptorProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) - if (!$util.isString(message.name)) - return "name: string expected"; - if (message.inputType != null && message.hasOwnProperty("inputType")) - if (!$util.isString(message.inputType)) - return "inputType: string expected"; - if (message.outputType != null && message.hasOwnProperty("outputType")) - if (!$util.isString(message.outputType)) - return "outputType: string expected"; - if (message.options != null && message.hasOwnProperty("options")) { - var error = $root.google.protobuf.MethodOptions.verify(message.options); - if (error) - return "options." + error; - } - if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) - if (typeof message.clientStreaming !== "boolean") - return "clientStreaming: boolean expected"; - if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) - if (typeof message.serverStreaming !== "boolean") - return "serverStreaming: boolean expected"; - return null; - }; - - /** - * Creates a MethodDescriptorProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MethodDescriptorProto} MethodDescriptorProto - */ - MethodDescriptorProto.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MethodDescriptorProto) - return object; - var message = new $root.google.protobuf.MethodDescriptorProto(); - if (object.name != null) - message.name = String(object.name); - if (object.inputType != null) - message.inputType = String(object.inputType); - if (object.outputType != null) - message.outputType = String(object.outputType); - if (object.options != null) { - if (typeof object.options !== "object") - throw TypeError(".google.protobuf.MethodDescriptorProto.options: object expected"); - message.options = $root.google.protobuf.MethodOptions.fromObject(object.options); - } - if (object.clientStreaming != null) - message.clientStreaming = Boolean(object.clientStreaming); - if (object.serverStreaming != null) - message.serverStreaming = Boolean(object.serverStreaming); - return message; - }; - - /** - * Creates a plain object from a MethodDescriptorProto message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MethodDescriptorProto - * @static - * @param {google.protobuf.MethodDescriptorProto} message MethodDescriptorProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodDescriptorProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.name = ""; - object.inputType = ""; - object.outputType = ""; - object.options = null; - object.clientStreaming = false; - object.serverStreaming = false; - } - if (message.name != null && message.hasOwnProperty("name")) - object.name = message.name; - if (message.inputType != null && message.hasOwnProperty("inputType")) - object.inputType = message.inputType; - if (message.outputType != null && message.hasOwnProperty("outputType")) - object.outputType = message.outputType; - if (message.options != null && message.hasOwnProperty("options")) - object.options = $root.google.protobuf.MethodOptions.toObject(message.options, options); - if (message.clientStreaming != null && message.hasOwnProperty("clientStreaming")) - object.clientStreaming = message.clientStreaming; - if (message.serverStreaming != null && message.hasOwnProperty("serverStreaming")) - object.serverStreaming = message.serverStreaming; - return object; - }; - - /** - * Converts this MethodDescriptorProto to JSON. - * @function toJSON - * @memberof google.protobuf.MethodDescriptorProto - * @instance - * @returns {Object.} JSON object - */ - MethodDescriptorProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MethodDescriptorProto; - })(); - - protobuf.FileOptions = (function() { - - /** - * Properties of a FileOptions. - * @memberof google.protobuf - * @interface IFileOptions - * @property {string|null} [javaPackage] FileOptions javaPackage - * @property {string|null} [javaOuterClassname] FileOptions javaOuterClassname - * @property {boolean|null} [javaMultipleFiles] FileOptions javaMultipleFiles - * @property {boolean|null} [javaGenerateEqualsAndHash] FileOptions javaGenerateEqualsAndHash - * @property {boolean|null} [javaStringCheckUtf8] FileOptions javaStringCheckUtf8 - * @property {google.protobuf.FileOptions.OptimizeMode|null} [optimizeFor] FileOptions optimizeFor - * @property {string|null} [goPackage] FileOptions goPackage - * @property {boolean|null} [ccGenericServices] FileOptions ccGenericServices - * @property {boolean|null} [javaGenericServices] FileOptions javaGenericServices - * @property {boolean|null} [pyGenericServices] FileOptions pyGenericServices - * @property {boolean|null} [phpGenericServices] FileOptions phpGenericServices - * @property {boolean|null} [deprecated] FileOptions deprecated - * @property {boolean|null} [ccEnableArenas] FileOptions ccEnableArenas - * @property {string|null} [objcClassPrefix] FileOptions objcClassPrefix - * @property {string|null} [csharpNamespace] FileOptions csharpNamespace - * @property {string|null} [swiftPrefix] FileOptions swiftPrefix - * @property {string|null} [phpClassPrefix] FileOptions phpClassPrefix - * @property {string|null} [phpNamespace] FileOptions phpNamespace - * @property {string|null} [phpMetadataNamespace] FileOptions phpMetadataNamespace - * @property {string|null} [rubyPackage] FileOptions rubyPackage - * @property {Array.|null} [uninterpretedOption] FileOptions uninterpretedOption - * @property {boolean|null} [".gogoproto.goprotoGettersAll"] FileOptions .gogoproto.goprotoGettersAll - * @property {boolean|null} [".gogoproto.goprotoEnumPrefixAll"] FileOptions .gogoproto.goprotoEnumPrefixAll - * @property {boolean|null} [".gogoproto.goprotoStringerAll"] FileOptions .gogoproto.goprotoStringerAll - * @property {boolean|null} [".gogoproto.verboseEqualAll"] FileOptions .gogoproto.verboseEqualAll - * @property {boolean|null} [".gogoproto.faceAll"] FileOptions .gogoproto.faceAll - * @property {boolean|null} [".gogoproto.gostringAll"] FileOptions .gogoproto.gostringAll - * @property {boolean|null} [".gogoproto.populateAll"] FileOptions .gogoproto.populateAll - * @property {boolean|null} [".gogoproto.stringerAll"] FileOptions .gogoproto.stringerAll - * @property {boolean|null} [".gogoproto.onlyoneAll"] FileOptions .gogoproto.onlyoneAll - * @property {boolean|null} [".gogoproto.equalAll"] FileOptions .gogoproto.equalAll - * @property {boolean|null} [".gogoproto.descriptionAll"] FileOptions .gogoproto.descriptionAll - * @property {boolean|null} [".gogoproto.testgenAll"] FileOptions .gogoproto.testgenAll - * @property {boolean|null} [".gogoproto.benchgenAll"] FileOptions .gogoproto.benchgenAll - * @property {boolean|null} [".gogoproto.marshalerAll"] FileOptions .gogoproto.marshalerAll - * @property {boolean|null} [".gogoproto.unmarshalerAll"] FileOptions .gogoproto.unmarshalerAll - * @property {boolean|null} [".gogoproto.stableMarshalerAll"] FileOptions .gogoproto.stableMarshalerAll - * @property {boolean|null} [".gogoproto.sizerAll"] FileOptions .gogoproto.sizerAll - * @property {boolean|null} [".gogoproto.goprotoEnumStringerAll"] FileOptions .gogoproto.goprotoEnumStringerAll - * @property {boolean|null} [".gogoproto.enumStringerAll"] FileOptions .gogoproto.enumStringerAll - * @property {boolean|null} [".gogoproto.unsafeMarshalerAll"] FileOptions .gogoproto.unsafeMarshalerAll - * @property {boolean|null} [".gogoproto.unsafeUnmarshalerAll"] FileOptions .gogoproto.unsafeUnmarshalerAll - * @property {boolean|null} [".gogoproto.goprotoExtensionsMapAll"] FileOptions .gogoproto.goprotoExtensionsMapAll - * @property {boolean|null} [".gogoproto.goprotoUnrecognizedAll"] FileOptions .gogoproto.goprotoUnrecognizedAll - * @property {boolean|null} [".gogoproto.gogoprotoImport"] FileOptions .gogoproto.gogoprotoImport - * @property {boolean|null} [".gogoproto.protosizerAll"] FileOptions .gogoproto.protosizerAll - * @property {boolean|null} [".gogoproto.compareAll"] FileOptions .gogoproto.compareAll - * @property {boolean|null} [".gogoproto.typedeclAll"] FileOptions .gogoproto.typedeclAll - * @property {boolean|null} [".gogoproto.enumdeclAll"] FileOptions .gogoproto.enumdeclAll - * @property {boolean|null} [".gogoproto.goprotoRegistration"] FileOptions .gogoproto.goprotoRegistration - * @property {boolean|null} [".gogoproto.messagenameAll"] FileOptions .gogoproto.messagenameAll - * @property {boolean|null} [".gogoproto.goprotoSizecacheAll"] FileOptions .gogoproto.goprotoSizecacheAll - * @property {boolean|null} [".gogoproto.goprotoUnkeyedAll"] FileOptions .gogoproto.goprotoUnkeyedAll - */ - - /** - * Constructs a new FileOptions. - * @memberof google.protobuf - * @classdesc Represents a FileOptions. - * @implements IFileOptions - * @constructor - * @param {google.protobuf.IFileOptions=} [properties] Properties to set - */ - function FileOptions(properties) { - this.uninterpretedOption = []; - 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]]; - } - - /** - * FileOptions javaPackage. - * @member {string} javaPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaPackage = ""; - - /** - * FileOptions javaOuterClassname. - * @member {string} javaOuterClassname - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaOuterClassname = ""; - - /** - * FileOptions javaMultipleFiles. - * @member {boolean} javaMultipleFiles - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaMultipleFiles = false; - - /** - * FileOptions javaGenerateEqualsAndHash. - * @member {boolean} javaGenerateEqualsAndHash - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaGenerateEqualsAndHash = false; - - /** - * FileOptions javaStringCheckUtf8. - * @member {boolean} javaStringCheckUtf8 - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaStringCheckUtf8 = false; - - /** - * FileOptions optimizeFor. - * @member {google.protobuf.FileOptions.OptimizeMode} optimizeFor - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.optimizeFor = 1; - - /** - * FileOptions goPackage. - * @member {string} goPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.goPackage = ""; - - /** - * FileOptions ccGenericServices. - * @member {boolean} ccGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.ccGenericServices = false; - - /** - * FileOptions javaGenericServices. - * @member {boolean} javaGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.javaGenericServices = false; - - /** - * FileOptions pyGenericServices. - * @member {boolean} pyGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.pyGenericServices = false; - - /** - * FileOptions phpGenericServices. - * @member {boolean} phpGenericServices - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpGenericServices = false; - - /** - * FileOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.deprecated = false; - - /** - * FileOptions ccEnableArenas. - * @member {boolean} ccEnableArenas - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.ccEnableArenas = true; - - /** - * FileOptions objcClassPrefix. - * @member {string} objcClassPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.objcClassPrefix = ""; - - /** - * FileOptions csharpNamespace. - * @member {string} csharpNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.csharpNamespace = ""; - - /** - * FileOptions swiftPrefix. - * @member {string} swiftPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.swiftPrefix = ""; - - /** - * FileOptions phpClassPrefix. - * @member {string} phpClassPrefix - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpClassPrefix = ""; - - /** - * FileOptions phpNamespace. - * @member {string} phpNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpNamespace = ""; - - /** - * FileOptions phpMetadataNamespace. - * @member {string} phpMetadataNamespace - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.phpMetadataNamespace = ""; - - /** - * FileOptions rubyPackage. - * @member {string} rubyPackage - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.rubyPackage = ""; - - /** - * FileOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * FileOptions .gogoproto.goprotoGettersAll. - * @member {boolean} .gogoproto.goprotoGettersAll - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.goprotoGettersAll"] = false; - - /** - * FileOptions .gogoproto.goprotoEnumPrefixAll. - * @member {boolean} .gogoproto.goprotoEnumPrefixAll - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.goprotoEnumPrefixAll"] = false; - - /** - * FileOptions .gogoproto.goprotoStringerAll. - * @member {boolean} .gogoproto.goprotoStringerAll - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.goprotoStringerAll"] = false; - - /** - * FileOptions .gogoproto.verboseEqualAll. - * @member {boolean} .gogoproto.verboseEqualAll - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.verboseEqualAll"] = false; - - /** - * FileOptions .gogoproto.faceAll. - * @member {boolean} .gogoproto.faceAll - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.faceAll"] = false; - - /** - * FileOptions .gogoproto.gostringAll. - * @member {boolean} .gogoproto.gostringAll - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.gostringAll"] = false; - - /** - * FileOptions .gogoproto.populateAll. - * @member {boolean} .gogoproto.populateAll - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.populateAll"] = false; - - /** - * FileOptions .gogoproto.stringerAll. - * @member {boolean} .gogoproto.stringerAll - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.stringerAll"] = false; - - /** - * FileOptions .gogoproto.onlyoneAll. - * @member {boolean} .gogoproto.onlyoneAll - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.onlyoneAll"] = false; - - /** - * FileOptions .gogoproto.equalAll. - * @member {boolean} .gogoproto.equalAll - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.equalAll"] = false; - - /** - * FileOptions .gogoproto.descriptionAll. - * @member {boolean} .gogoproto.descriptionAll - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.descriptionAll"] = false; - - /** - * FileOptions .gogoproto.testgenAll. - * @member {boolean} .gogoproto.testgenAll - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.testgenAll"] = false; - - /** - * FileOptions .gogoproto.benchgenAll. - * @member {boolean} .gogoproto.benchgenAll - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.benchgenAll"] = false; - - /** - * FileOptions .gogoproto.marshalerAll. - * @member {boolean} .gogoproto.marshalerAll - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.marshalerAll"] = false; - - /** - * FileOptions .gogoproto.unmarshalerAll. - * @member {boolean} .gogoproto.unmarshalerAll - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.unmarshalerAll"] = false; - - /** - * FileOptions .gogoproto.stableMarshalerAll. - * @member {boolean} .gogoproto.stableMarshalerAll - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.stableMarshalerAll"] = false; - - /** - * FileOptions .gogoproto.sizerAll. - * @member {boolean} .gogoproto.sizerAll - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.sizerAll"] = false; - - /** - * FileOptions .gogoproto.goprotoEnumStringerAll. - * @member {boolean} .gogoproto.goprotoEnumStringerAll - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.goprotoEnumStringerAll"] = false; - - /** - * FileOptions .gogoproto.enumStringerAll. - * @member {boolean} .gogoproto.enumStringerAll - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.enumStringerAll"] = false; - - /** - * FileOptions .gogoproto.unsafeMarshalerAll. - * @member {boolean} .gogoproto.unsafeMarshalerAll - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.unsafeMarshalerAll"] = false; - - /** - * FileOptions .gogoproto.unsafeUnmarshalerAll. - * @member {boolean} .gogoproto.unsafeUnmarshalerAll - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.unsafeUnmarshalerAll"] = false; - - /** - * FileOptions .gogoproto.goprotoExtensionsMapAll. - * @member {boolean} .gogoproto.goprotoExtensionsMapAll - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.goprotoExtensionsMapAll"] = false; - - /** - * FileOptions .gogoproto.goprotoUnrecognizedAll. - * @member {boolean} .gogoproto.goprotoUnrecognizedAll - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.goprotoUnrecognizedAll"] = false; - - /** - * FileOptions .gogoproto.gogoprotoImport. - * @member {boolean} .gogoproto.gogoprotoImport - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.gogoprotoImport"] = false; - - /** - * FileOptions .gogoproto.protosizerAll. - * @member {boolean} .gogoproto.protosizerAll - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.protosizerAll"] = false; - - /** - * FileOptions .gogoproto.compareAll. - * @member {boolean} .gogoproto.compareAll - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.compareAll"] = false; - - /** - * FileOptions .gogoproto.typedeclAll. - * @member {boolean} .gogoproto.typedeclAll - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.typedeclAll"] = false; - - /** - * FileOptions .gogoproto.enumdeclAll. - * @member {boolean} .gogoproto.enumdeclAll - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.enumdeclAll"] = false; - - /** - * FileOptions .gogoproto.goprotoRegistration. - * @member {boolean} .gogoproto.goprotoRegistration - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.goprotoRegistration"] = false; - - /** - * FileOptions .gogoproto.messagenameAll. - * @member {boolean} .gogoproto.messagenameAll - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.messagenameAll"] = false; - - /** - * FileOptions .gogoproto.goprotoSizecacheAll. - * @member {boolean} .gogoproto.goprotoSizecacheAll - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.goprotoSizecacheAll"] = false; - - /** - * FileOptions .gogoproto.goprotoUnkeyedAll. - * @member {boolean} .gogoproto.goprotoUnkeyedAll - * @memberof google.protobuf.FileOptions - * @instance - */ - FileOptions.prototype[".gogoproto.goprotoUnkeyedAll"] = false; - - /** - * Creates a new FileOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions=} [properties] Properties to set - * @returns {google.protobuf.FileOptions} FileOptions instance - */ - FileOptions.create = function create(properties) { - return new FileOptions(properties); - }; - - /** - * Encodes the specified FileOptions message. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.javaPackage != null && Object.hasOwnProperty.call(message, "javaPackage")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.javaPackage); - if (message.javaOuterClassname != null && Object.hasOwnProperty.call(message, "javaOuterClassname")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.javaOuterClassname); - if (message.optimizeFor != null && Object.hasOwnProperty.call(message, "optimizeFor")) - writer.uint32(/* id 9, wireType 0 =*/72).int32(message.optimizeFor); - if (message.javaMultipleFiles != null && Object.hasOwnProperty.call(message, "javaMultipleFiles")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.javaMultipleFiles); - if (message.goPackage != null && Object.hasOwnProperty.call(message, "goPackage")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.goPackage); - if (message.ccGenericServices != null && Object.hasOwnProperty.call(message, "ccGenericServices")) - writer.uint32(/* id 16, wireType 0 =*/128).bool(message.ccGenericServices); - if (message.javaGenericServices != null && Object.hasOwnProperty.call(message, "javaGenericServices")) - writer.uint32(/* id 17, wireType 0 =*/136).bool(message.javaGenericServices); - if (message.pyGenericServices != null && Object.hasOwnProperty.call(message, "pyGenericServices")) - writer.uint32(/* id 18, wireType 0 =*/144).bool(message.pyGenericServices); - if (message.javaGenerateEqualsAndHash != null && Object.hasOwnProperty.call(message, "javaGenerateEqualsAndHash")) - writer.uint32(/* id 20, wireType 0 =*/160).bool(message.javaGenerateEqualsAndHash); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 23, wireType 0 =*/184).bool(message.deprecated); - if (message.javaStringCheckUtf8 != null && Object.hasOwnProperty.call(message, "javaStringCheckUtf8")) - writer.uint32(/* id 27, wireType 0 =*/216).bool(message.javaStringCheckUtf8); - if (message.ccEnableArenas != null && Object.hasOwnProperty.call(message, "ccEnableArenas")) - writer.uint32(/* id 31, wireType 0 =*/248).bool(message.ccEnableArenas); - if (message.objcClassPrefix != null && Object.hasOwnProperty.call(message, "objcClassPrefix")) - writer.uint32(/* id 36, wireType 2 =*/290).string(message.objcClassPrefix); - if (message.csharpNamespace != null && Object.hasOwnProperty.call(message, "csharpNamespace")) - writer.uint32(/* id 37, wireType 2 =*/298).string(message.csharpNamespace); - if (message.swiftPrefix != null && Object.hasOwnProperty.call(message, "swiftPrefix")) - writer.uint32(/* id 39, wireType 2 =*/314).string(message.swiftPrefix); - if (message.phpClassPrefix != null && Object.hasOwnProperty.call(message, "phpClassPrefix")) - writer.uint32(/* id 40, wireType 2 =*/322).string(message.phpClassPrefix); - if (message.phpNamespace != null && Object.hasOwnProperty.call(message, "phpNamespace")) - writer.uint32(/* id 41, wireType 2 =*/330).string(message.phpNamespace); - if (message.phpGenericServices != null && Object.hasOwnProperty.call(message, "phpGenericServices")) - writer.uint32(/* id 42, wireType 0 =*/336).bool(message.phpGenericServices); - if (message.phpMetadataNamespace != null && Object.hasOwnProperty.call(message, "phpMetadataNamespace")) - writer.uint32(/* id 44, wireType 2 =*/354).string(message.phpMetadataNamespace); - if (message.rubyPackage != null && Object.hasOwnProperty.call(message, "rubyPackage")) - writer.uint32(/* id 45, wireType 2 =*/362).string(message.rubyPackage); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".gogoproto.goprotoGettersAll"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goprotoGettersAll")) - writer.uint32(/* id 63001, wireType 0 =*/504008).bool(message[".gogoproto.goprotoGettersAll"]); - if (message[".gogoproto.goprotoEnumPrefixAll"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goprotoEnumPrefixAll")) - writer.uint32(/* id 63002, wireType 0 =*/504016).bool(message[".gogoproto.goprotoEnumPrefixAll"]); - if (message[".gogoproto.goprotoStringerAll"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goprotoStringerAll")) - writer.uint32(/* id 63003, wireType 0 =*/504024).bool(message[".gogoproto.goprotoStringerAll"]); - if (message[".gogoproto.verboseEqualAll"] != null && Object.hasOwnProperty.call(message, ".gogoproto.verboseEqualAll")) - writer.uint32(/* id 63004, wireType 0 =*/504032).bool(message[".gogoproto.verboseEqualAll"]); - if (message[".gogoproto.faceAll"] != null && Object.hasOwnProperty.call(message, ".gogoproto.faceAll")) - writer.uint32(/* id 63005, wireType 0 =*/504040).bool(message[".gogoproto.faceAll"]); - if (message[".gogoproto.gostringAll"] != null && Object.hasOwnProperty.call(message, ".gogoproto.gostringAll")) - writer.uint32(/* id 63006, wireType 0 =*/504048).bool(message[".gogoproto.gostringAll"]); - if (message[".gogoproto.populateAll"] != null && Object.hasOwnProperty.call(message, ".gogoproto.populateAll")) - writer.uint32(/* id 63007, wireType 0 =*/504056).bool(message[".gogoproto.populateAll"]); - if (message[".gogoproto.stringerAll"] != null && Object.hasOwnProperty.call(message, ".gogoproto.stringerAll")) - writer.uint32(/* id 63008, wireType 0 =*/504064).bool(message[".gogoproto.stringerAll"]); - if (message[".gogoproto.onlyoneAll"] != null && Object.hasOwnProperty.call(message, ".gogoproto.onlyoneAll")) - writer.uint32(/* id 63009, wireType 0 =*/504072).bool(message[".gogoproto.onlyoneAll"]); - if (message[".gogoproto.equalAll"] != null && Object.hasOwnProperty.call(message, ".gogoproto.equalAll")) - writer.uint32(/* id 63013, wireType 0 =*/504104).bool(message[".gogoproto.equalAll"]); - if (message[".gogoproto.descriptionAll"] != null && Object.hasOwnProperty.call(message, ".gogoproto.descriptionAll")) - writer.uint32(/* id 63014, wireType 0 =*/504112).bool(message[".gogoproto.descriptionAll"]); - if (message[".gogoproto.testgenAll"] != null && Object.hasOwnProperty.call(message, ".gogoproto.testgenAll")) - writer.uint32(/* id 63015, wireType 0 =*/504120).bool(message[".gogoproto.testgenAll"]); - if (message[".gogoproto.benchgenAll"] != null && Object.hasOwnProperty.call(message, ".gogoproto.benchgenAll")) - writer.uint32(/* id 63016, wireType 0 =*/504128).bool(message[".gogoproto.benchgenAll"]); - if (message[".gogoproto.marshalerAll"] != null && Object.hasOwnProperty.call(message, ".gogoproto.marshalerAll")) - writer.uint32(/* id 63017, wireType 0 =*/504136).bool(message[".gogoproto.marshalerAll"]); - if (message[".gogoproto.unmarshalerAll"] != null && Object.hasOwnProperty.call(message, ".gogoproto.unmarshalerAll")) - writer.uint32(/* id 63018, wireType 0 =*/504144).bool(message[".gogoproto.unmarshalerAll"]); - if (message[".gogoproto.stableMarshalerAll"] != null && Object.hasOwnProperty.call(message, ".gogoproto.stableMarshalerAll")) - writer.uint32(/* id 63019, wireType 0 =*/504152).bool(message[".gogoproto.stableMarshalerAll"]); - if (message[".gogoproto.sizerAll"] != null && Object.hasOwnProperty.call(message, ".gogoproto.sizerAll")) - writer.uint32(/* id 63020, wireType 0 =*/504160).bool(message[".gogoproto.sizerAll"]); - if (message[".gogoproto.goprotoEnumStringerAll"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goprotoEnumStringerAll")) - writer.uint32(/* id 63021, wireType 0 =*/504168).bool(message[".gogoproto.goprotoEnumStringerAll"]); - if (message[".gogoproto.enumStringerAll"] != null && Object.hasOwnProperty.call(message, ".gogoproto.enumStringerAll")) - writer.uint32(/* id 63022, wireType 0 =*/504176).bool(message[".gogoproto.enumStringerAll"]); - if (message[".gogoproto.unsafeMarshalerAll"] != null && Object.hasOwnProperty.call(message, ".gogoproto.unsafeMarshalerAll")) - writer.uint32(/* id 63023, wireType 0 =*/504184).bool(message[".gogoproto.unsafeMarshalerAll"]); - if (message[".gogoproto.unsafeUnmarshalerAll"] != null && Object.hasOwnProperty.call(message, ".gogoproto.unsafeUnmarshalerAll")) - writer.uint32(/* id 63024, wireType 0 =*/504192).bool(message[".gogoproto.unsafeUnmarshalerAll"]); - if (message[".gogoproto.goprotoExtensionsMapAll"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goprotoExtensionsMapAll")) - writer.uint32(/* id 63025, wireType 0 =*/504200).bool(message[".gogoproto.goprotoExtensionsMapAll"]); - if (message[".gogoproto.goprotoUnrecognizedAll"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goprotoUnrecognizedAll")) - writer.uint32(/* id 63026, wireType 0 =*/504208).bool(message[".gogoproto.goprotoUnrecognizedAll"]); - if (message[".gogoproto.gogoprotoImport"] != null && Object.hasOwnProperty.call(message, ".gogoproto.gogoprotoImport")) - writer.uint32(/* id 63027, wireType 0 =*/504216).bool(message[".gogoproto.gogoprotoImport"]); - if (message[".gogoproto.protosizerAll"] != null && Object.hasOwnProperty.call(message, ".gogoproto.protosizerAll")) - writer.uint32(/* id 63028, wireType 0 =*/504224).bool(message[".gogoproto.protosizerAll"]); - if (message[".gogoproto.compareAll"] != null && Object.hasOwnProperty.call(message, ".gogoproto.compareAll")) - writer.uint32(/* id 63029, wireType 0 =*/504232).bool(message[".gogoproto.compareAll"]); - if (message[".gogoproto.typedeclAll"] != null && Object.hasOwnProperty.call(message, ".gogoproto.typedeclAll")) - writer.uint32(/* id 63030, wireType 0 =*/504240).bool(message[".gogoproto.typedeclAll"]); - if (message[".gogoproto.enumdeclAll"] != null && Object.hasOwnProperty.call(message, ".gogoproto.enumdeclAll")) - writer.uint32(/* id 63031, wireType 0 =*/504248).bool(message[".gogoproto.enumdeclAll"]); - if (message[".gogoproto.goprotoRegistration"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goprotoRegistration")) - writer.uint32(/* id 63032, wireType 0 =*/504256).bool(message[".gogoproto.goprotoRegistration"]); - if (message[".gogoproto.messagenameAll"] != null && Object.hasOwnProperty.call(message, ".gogoproto.messagenameAll")) - writer.uint32(/* id 63033, wireType 0 =*/504264).bool(message[".gogoproto.messagenameAll"]); - if (message[".gogoproto.goprotoSizecacheAll"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goprotoSizecacheAll")) - writer.uint32(/* id 63034, wireType 0 =*/504272).bool(message[".gogoproto.goprotoSizecacheAll"]); - if (message[".gogoproto.goprotoUnkeyedAll"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goprotoUnkeyedAll")) - writer.uint32(/* id 63035, wireType 0 =*/504280).bool(message[".gogoproto.goprotoUnkeyedAll"]); - return writer; - }; - - /** - * Encodes the specified FileOptions message, length delimited. Does not implicitly {@link google.protobuf.FileOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.IFileOptions} message FileOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FileOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FileOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FileOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FileOptions} FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileOptions.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.google.protobuf.FileOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.javaPackage = reader.string(); - break; - case 8: - message.javaOuterClassname = reader.string(); - break; - case 10: - message.javaMultipleFiles = reader.bool(); - break; - case 20: - message.javaGenerateEqualsAndHash = reader.bool(); - break; - case 27: - message.javaStringCheckUtf8 = reader.bool(); - break; - case 9: - message.optimizeFor = reader.int32(); - break; - case 11: - message.goPackage = reader.string(); - break; - case 16: - message.ccGenericServices = reader.bool(); - break; - case 17: - message.javaGenericServices = reader.bool(); - break; - case 18: - message.pyGenericServices = reader.bool(); - break; - case 42: - message.phpGenericServices = reader.bool(); - break; - case 23: - message.deprecated = reader.bool(); - break; - case 31: - message.ccEnableArenas = reader.bool(); - break; - case 36: - message.objcClassPrefix = reader.string(); - break; - case 37: - message.csharpNamespace = reader.string(); - break; - case 39: - message.swiftPrefix = reader.string(); - break; - case 40: - message.phpClassPrefix = reader.string(); - break; - case 41: - message.phpNamespace = reader.string(); - break; - case 44: - message.phpMetadataNamespace = reader.string(); - break; - case 45: - message.rubyPackage = reader.string(); - break; - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - case 63001: - message[".gogoproto.goprotoGettersAll"] = reader.bool(); - break; - case 63002: - message[".gogoproto.goprotoEnumPrefixAll"] = reader.bool(); - break; - case 63003: - message[".gogoproto.goprotoStringerAll"] = reader.bool(); - break; - case 63004: - message[".gogoproto.verboseEqualAll"] = reader.bool(); - break; - case 63005: - message[".gogoproto.faceAll"] = reader.bool(); - break; - case 63006: - message[".gogoproto.gostringAll"] = reader.bool(); - break; - case 63007: - message[".gogoproto.populateAll"] = reader.bool(); - break; - case 63008: - message[".gogoproto.stringerAll"] = reader.bool(); - break; - case 63009: - message[".gogoproto.onlyoneAll"] = reader.bool(); - break; - case 63013: - message[".gogoproto.equalAll"] = reader.bool(); - break; - case 63014: - message[".gogoproto.descriptionAll"] = reader.bool(); - break; - case 63015: - message[".gogoproto.testgenAll"] = reader.bool(); - break; - case 63016: - message[".gogoproto.benchgenAll"] = reader.bool(); - break; - case 63017: - message[".gogoproto.marshalerAll"] = reader.bool(); - break; - case 63018: - message[".gogoproto.unmarshalerAll"] = reader.bool(); - break; - case 63019: - message[".gogoproto.stableMarshalerAll"] = reader.bool(); - break; - case 63020: - message[".gogoproto.sizerAll"] = reader.bool(); - break; - case 63021: - message[".gogoproto.goprotoEnumStringerAll"] = reader.bool(); - break; - case 63022: - message[".gogoproto.enumStringerAll"] = reader.bool(); - break; - case 63023: - message[".gogoproto.unsafeMarshalerAll"] = reader.bool(); - break; - case 63024: - message[".gogoproto.unsafeUnmarshalerAll"] = reader.bool(); - break; - case 63025: - message[".gogoproto.goprotoExtensionsMapAll"] = reader.bool(); - break; - case 63026: - message[".gogoproto.goprotoUnrecognizedAll"] = reader.bool(); - break; - case 63027: - message[".gogoproto.gogoprotoImport"] = reader.bool(); - break; - case 63028: - message[".gogoproto.protosizerAll"] = reader.bool(); - break; - case 63029: - message[".gogoproto.compareAll"] = reader.bool(); - break; - case 63030: - message[".gogoproto.typedeclAll"] = reader.bool(); - break; - case 63031: - message[".gogoproto.enumdeclAll"] = reader.bool(); - break; - case 63032: - message[".gogoproto.goprotoRegistration"] = reader.bool(); - break; - case 63033: - message[".gogoproto.messagenameAll"] = reader.bool(); - break; - case 63034: - message[".gogoproto.goprotoSizecacheAll"] = reader.bool(); - break; - case 63035: - message[".gogoproto.goprotoUnkeyedAll"] = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FileOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FileOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FileOptions} FileOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FileOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FileOptions message. - * @function verify - * @memberof google.protobuf.FileOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FileOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) - if (!$util.isString(message.javaPackage)) - return "javaPackage: string expected"; - if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) - if (!$util.isString(message.javaOuterClassname)) - return "javaOuterClassname: string expected"; - if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) - if (typeof message.javaMultipleFiles !== "boolean") - return "javaMultipleFiles: boolean expected"; - if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) - if (typeof message.javaGenerateEqualsAndHash !== "boolean") - return "javaGenerateEqualsAndHash: boolean expected"; - if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) - if (typeof message.javaStringCheckUtf8 !== "boolean") - return "javaStringCheckUtf8: boolean expected"; - if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) - switch (message.optimizeFor) { - default: - return "optimizeFor: enum value expected"; - case 1: - case 2: - case 3: - break; - } - if (message.goPackage != null && message.hasOwnProperty("goPackage")) - if (!$util.isString(message.goPackage)) - return "goPackage: string expected"; - if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) - if (typeof message.ccGenericServices !== "boolean") - return "ccGenericServices: boolean expected"; - if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) - if (typeof message.javaGenericServices !== "boolean") - return "javaGenericServices: boolean expected"; - if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) - if (typeof message.pyGenericServices !== "boolean") - return "pyGenericServices: boolean expected"; - if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) - if (typeof message.phpGenericServices !== "boolean") - return "phpGenericServices: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) - if (typeof message.ccEnableArenas !== "boolean") - return "ccEnableArenas: boolean expected"; - if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) - if (!$util.isString(message.objcClassPrefix)) - return "objcClassPrefix: string expected"; - if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) - if (!$util.isString(message.csharpNamespace)) - return "csharpNamespace: string expected"; - if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) - if (!$util.isString(message.swiftPrefix)) - return "swiftPrefix: string expected"; - if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) - if (!$util.isString(message.phpClassPrefix)) - return "phpClassPrefix: string expected"; - if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) - if (!$util.isString(message.phpNamespace)) - return "phpNamespace: string expected"; - if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) - if (!$util.isString(message.phpMetadataNamespace)) - return "phpMetadataNamespace: string expected"; - if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) - if (!$util.isString(message.rubyPackage)) - return "rubyPackage: string expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".gogoproto.goprotoGettersAll"] != null && message.hasOwnProperty(".gogoproto.goprotoGettersAll")) - if (typeof message[".gogoproto.goprotoGettersAll"] !== "boolean") - return ".gogoproto.goprotoGettersAll: boolean expected"; - if (message[".gogoproto.goprotoEnumPrefixAll"] != null && message.hasOwnProperty(".gogoproto.goprotoEnumPrefixAll")) - if (typeof message[".gogoproto.goprotoEnumPrefixAll"] !== "boolean") - return ".gogoproto.goprotoEnumPrefixAll: boolean expected"; - if (message[".gogoproto.goprotoStringerAll"] != null && message.hasOwnProperty(".gogoproto.goprotoStringerAll")) - if (typeof message[".gogoproto.goprotoStringerAll"] !== "boolean") - return ".gogoproto.goprotoStringerAll: boolean expected"; - if (message[".gogoproto.verboseEqualAll"] != null && message.hasOwnProperty(".gogoproto.verboseEqualAll")) - if (typeof message[".gogoproto.verboseEqualAll"] !== "boolean") - return ".gogoproto.verboseEqualAll: boolean expected"; - if (message[".gogoproto.faceAll"] != null && message.hasOwnProperty(".gogoproto.faceAll")) - if (typeof message[".gogoproto.faceAll"] !== "boolean") - return ".gogoproto.faceAll: boolean expected"; - if (message[".gogoproto.gostringAll"] != null && message.hasOwnProperty(".gogoproto.gostringAll")) - if (typeof message[".gogoproto.gostringAll"] !== "boolean") - return ".gogoproto.gostringAll: boolean expected"; - if (message[".gogoproto.populateAll"] != null && message.hasOwnProperty(".gogoproto.populateAll")) - if (typeof message[".gogoproto.populateAll"] !== "boolean") - return ".gogoproto.populateAll: boolean expected"; - if (message[".gogoproto.stringerAll"] != null && message.hasOwnProperty(".gogoproto.stringerAll")) - if (typeof message[".gogoproto.stringerAll"] !== "boolean") - return ".gogoproto.stringerAll: boolean expected"; - if (message[".gogoproto.onlyoneAll"] != null && message.hasOwnProperty(".gogoproto.onlyoneAll")) - if (typeof message[".gogoproto.onlyoneAll"] !== "boolean") - return ".gogoproto.onlyoneAll: boolean expected"; - if (message[".gogoproto.equalAll"] != null && message.hasOwnProperty(".gogoproto.equalAll")) - if (typeof message[".gogoproto.equalAll"] !== "boolean") - return ".gogoproto.equalAll: boolean expected"; - if (message[".gogoproto.descriptionAll"] != null && message.hasOwnProperty(".gogoproto.descriptionAll")) - if (typeof message[".gogoproto.descriptionAll"] !== "boolean") - return ".gogoproto.descriptionAll: boolean expected"; - if (message[".gogoproto.testgenAll"] != null && message.hasOwnProperty(".gogoproto.testgenAll")) - if (typeof message[".gogoproto.testgenAll"] !== "boolean") - return ".gogoproto.testgenAll: boolean expected"; - if (message[".gogoproto.benchgenAll"] != null && message.hasOwnProperty(".gogoproto.benchgenAll")) - if (typeof message[".gogoproto.benchgenAll"] !== "boolean") - return ".gogoproto.benchgenAll: boolean expected"; - if (message[".gogoproto.marshalerAll"] != null && message.hasOwnProperty(".gogoproto.marshalerAll")) - if (typeof message[".gogoproto.marshalerAll"] !== "boolean") - return ".gogoproto.marshalerAll: boolean expected"; - if (message[".gogoproto.unmarshalerAll"] != null && message.hasOwnProperty(".gogoproto.unmarshalerAll")) - if (typeof message[".gogoproto.unmarshalerAll"] !== "boolean") - return ".gogoproto.unmarshalerAll: boolean expected"; - if (message[".gogoproto.stableMarshalerAll"] != null && message.hasOwnProperty(".gogoproto.stableMarshalerAll")) - if (typeof message[".gogoproto.stableMarshalerAll"] !== "boolean") - return ".gogoproto.stableMarshalerAll: boolean expected"; - if (message[".gogoproto.sizerAll"] != null && message.hasOwnProperty(".gogoproto.sizerAll")) - if (typeof message[".gogoproto.sizerAll"] !== "boolean") - return ".gogoproto.sizerAll: boolean expected"; - if (message[".gogoproto.goprotoEnumStringerAll"] != null && message.hasOwnProperty(".gogoproto.goprotoEnumStringerAll")) - if (typeof message[".gogoproto.goprotoEnumStringerAll"] !== "boolean") - return ".gogoproto.goprotoEnumStringerAll: boolean expected"; - if (message[".gogoproto.enumStringerAll"] != null && message.hasOwnProperty(".gogoproto.enumStringerAll")) - if (typeof message[".gogoproto.enumStringerAll"] !== "boolean") - return ".gogoproto.enumStringerAll: boolean expected"; - if (message[".gogoproto.unsafeMarshalerAll"] != null && message.hasOwnProperty(".gogoproto.unsafeMarshalerAll")) - if (typeof message[".gogoproto.unsafeMarshalerAll"] !== "boolean") - return ".gogoproto.unsafeMarshalerAll: boolean expected"; - if (message[".gogoproto.unsafeUnmarshalerAll"] != null && message.hasOwnProperty(".gogoproto.unsafeUnmarshalerAll")) - if (typeof message[".gogoproto.unsafeUnmarshalerAll"] !== "boolean") - return ".gogoproto.unsafeUnmarshalerAll: boolean expected"; - if (message[".gogoproto.goprotoExtensionsMapAll"] != null && message.hasOwnProperty(".gogoproto.goprotoExtensionsMapAll")) - if (typeof message[".gogoproto.goprotoExtensionsMapAll"] !== "boolean") - return ".gogoproto.goprotoExtensionsMapAll: boolean expected"; - if (message[".gogoproto.goprotoUnrecognizedAll"] != null && message.hasOwnProperty(".gogoproto.goprotoUnrecognizedAll")) - if (typeof message[".gogoproto.goprotoUnrecognizedAll"] !== "boolean") - return ".gogoproto.goprotoUnrecognizedAll: boolean expected"; - if (message[".gogoproto.gogoprotoImport"] != null && message.hasOwnProperty(".gogoproto.gogoprotoImport")) - if (typeof message[".gogoproto.gogoprotoImport"] !== "boolean") - return ".gogoproto.gogoprotoImport: boolean expected"; - if (message[".gogoproto.protosizerAll"] != null && message.hasOwnProperty(".gogoproto.protosizerAll")) - if (typeof message[".gogoproto.protosizerAll"] !== "boolean") - return ".gogoproto.protosizerAll: boolean expected"; - if (message[".gogoproto.compareAll"] != null && message.hasOwnProperty(".gogoproto.compareAll")) - if (typeof message[".gogoproto.compareAll"] !== "boolean") - return ".gogoproto.compareAll: boolean expected"; - if (message[".gogoproto.typedeclAll"] != null && message.hasOwnProperty(".gogoproto.typedeclAll")) - if (typeof message[".gogoproto.typedeclAll"] !== "boolean") - return ".gogoproto.typedeclAll: boolean expected"; - if (message[".gogoproto.enumdeclAll"] != null && message.hasOwnProperty(".gogoproto.enumdeclAll")) - if (typeof message[".gogoproto.enumdeclAll"] !== "boolean") - return ".gogoproto.enumdeclAll: boolean expected"; - if (message[".gogoproto.goprotoRegistration"] != null && message.hasOwnProperty(".gogoproto.goprotoRegistration")) - if (typeof message[".gogoproto.goprotoRegistration"] !== "boolean") - return ".gogoproto.goprotoRegistration: boolean expected"; - if (message[".gogoproto.messagenameAll"] != null && message.hasOwnProperty(".gogoproto.messagenameAll")) - if (typeof message[".gogoproto.messagenameAll"] !== "boolean") - return ".gogoproto.messagenameAll: boolean expected"; - if (message[".gogoproto.goprotoSizecacheAll"] != null && message.hasOwnProperty(".gogoproto.goprotoSizecacheAll")) - if (typeof message[".gogoproto.goprotoSizecacheAll"] !== "boolean") - return ".gogoproto.goprotoSizecacheAll: boolean expected"; - if (message[".gogoproto.goprotoUnkeyedAll"] != null && message.hasOwnProperty(".gogoproto.goprotoUnkeyedAll")) - if (typeof message[".gogoproto.goprotoUnkeyedAll"] !== "boolean") - return ".gogoproto.goprotoUnkeyedAll: boolean expected"; - return null; - }; - - /** - * Creates a FileOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FileOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FileOptions} FileOptions - */ - FileOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FileOptions) - return object; - var message = new $root.google.protobuf.FileOptions(); - if (object.javaPackage != null) - message.javaPackage = String(object.javaPackage); - if (object.javaOuterClassname != null) - message.javaOuterClassname = String(object.javaOuterClassname); - if (object.javaMultipleFiles != null) - message.javaMultipleFiles = Boolean(object.javaMultipleFiles); - if (object.javaGenerateEqualsAndHash != null) - message.javaGenerateEqualsAndHash = Boolean(object.javaGenerateEqualsAndHash); - if (object.javaStringCheckUtf8 != null) - message.javaStringCheckUtf8 = Boolean(object.javaStringCheckUtf8); - switch (object.optimizeFor) { - case "SPEED": - case 1: - message.optimizeFor = 1; - break; - case "CODE_SIZE": - case 2: - message.optimizeFor = 2; - break; - case "LITE_RUNTIME": - case 3: - message.optimizeFor = 3; - break; - } - if (object.goPackage != null) - message.goPackage = String(object.goPackage); - if (object.ccGenericServices != null) - message.ccGenericServices = Boolean(object.ccGenericServices); - if (object.javaGenericServices != null) - message.javaGenericServices = Boolean(object.javaGenericServices); - if (object.pyGenericServices != null) - message.pyGenericServices = Boolean(object.pyGenericServices); - if (object.phpGenericServices != null) - message.phpGenericServices = Boolean(object.phpGenericServices); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.ccEnableArenas != null) - message.ccEnableArenas = Boolean(object.ccEnableArenas); - if (object.objcClassPrefix != null) - message.objcClassPrefix = String(object.objcClassPrefix); - if (object.csharpNamespace != null) - message.csharpNamespace = String(object.csharpNamespace); - if (object.swiftPrefix != null) - message.swiftPrefix = String(object.swiftPrefix); - if (object.phpClassPrefix != null) - message.phpClassPrefix = String(object.phpClassPrefix); - if (object.phpNamespace != null) - message.phpNamespace = String(object.phpNamespace); - if (object.phpMetadataNamespace != null) - message.phpMetadataNamespace = String(object.phpMetadataNamespace); - if (object.rubyPackage != null) - message.rubyPackage = String(object.rubyPackage); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.FileOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".gogoproto.goprotoGettersAll"] != null) - message[".gogoproto.goprotoGettersAll"] = Boolean(object[".gogoproto.goprotoGettersAll"]); - if (object[".gogoproto.goprotoEnumPrefixAll"] != null) - message[".gogoproto.goprotoEnumPrefixAll"] = Boolean(object[".gogoproto.goprotoEnumPrefixAll"]); - if (object[".gogoproto.goprotoStringerAll"] != null) - message[".gogoproto.goprotoStringerAll"] = Boolean(object[".gogoproto.goprotoStringerAll"]); - if (object[".gogoproto.verboseEqualAll"] != null) - message[".gogoproto.verboseEqualAll"] = Boolean(object[".gogoproto.verboseEqualAll"]); - if (object[".gogoproto.faceAll"] != null) - message[".gogoproto.faceAll"] = Boolean(object[".gogoproto.faceAll"]); - if (object[".gogoproto.gostringAll"] != null) - message[".gogoproto.gostringAll"] = Boolean(object[".gogoproto.gostringAll"]); - if (object[".gogoproto.populateAll"] != null) - message[".gogoproto.populateAll"] = Boolean(object[".gogoproto.populateAll"]); - if (object[".gogoproto.stringerAll"] != null) - message[".gogoproto.stringerAll"] = Boolean(object[".gogoproto.stringerAll"]); - if (object[".gogoproto.onlyoneAll"] != null) - message[".gogoproto.onlyoneAll"] = Boolean(object[".gogoproto.onlyoneAll"]); - if (object[".gogoproto.equalAll"] != null) - message[".gogoproto.equalAll"] = Boolean(object[".gogoproto.equalAll"]); - if (object[".gogoproto.descriptionAll"] != null) - message[".gogoproto.descriptionAll"] = Boolean(object[".gogoproto.descriptionAll"]); - if (object[".gogoproto.testgenAll"] != null) - message[".gogoproto.testgenAll"] = Boolean(object[".gogoproto.testgenAll"]); - if (object[".gogoproto.benchgenAll"] != null) - message[".gogoproto.benchgenAll"] = Boolean(object[".gogoproto.benchgenAll"]); - if (object[".gogoproto.marshalerAll"] != null) - message[".gogoproto.marshalerAll"] = Boolean(object[".gogoproto.marshalerAll"]); - if (object[".gogoproto.unmarshalerAll"] != null) - message[".gogoproto.unmarshalerAll"] = Boolean(object[".gogoproto.unmarshalerAll"]); - if (object[".gogoproto.stableMarshalerAll"] != null) - message[".gogoproto.stableMarshalerAll"] = Boolean(object[".gogoproto.stableMarshalerAll"]); - if (object[".gogoproto.sizerAll"] != null) - message[".gogoproto.sizerAll"] = Boolean(object[".gogoproto.sizerAll"]); - if (object[".gogoproto.goprotoEnumStringerAll"] != null) - message[".gogoproto.goprotoEnumStringerAll"] = Boolean(object[".gogoproto.goprotoEnumStringerAll"]); - if (object[".gogoproto.enumStringerAll"] != null) - message[".gogoproto.enumStringerAll"] = Boolean(object[".gogoproto.enumStringerAll"]); - if (object[".gogoproto.unsafeMarshalerAll"] != null) - message[".gogoproto.unsafeMarshalerAll"] = Boolean(object[".gogoproto.unsafeMarshalerAll"]); - if (object[".gogoproto.unsafeUnmarshalerAll"] != null) - message[".gogoproto.unsafeUnmarshalerAll"] = Boolean(object[".gogoproto.unsafeUnmarshalerAll"]); - if (object[".gogoproto.goprotoExtensionsMapAll"] != null) - message[".gogoproto.goprotoExtensionsMapAll"] = Boolean(object[".gogoproto.goprotoExtensionsMapAll"]); - if (object[".gogoproto.goprotoUnrecognizedAll"] != null) - message[".gogoproto.goprotoUnrecognizedAll"] = Boolean(object[".gogoproto.goprotoUnrecognizedAll"]); - if (object[".gogoproto.gogoprotoImport"] != null) - message[".gogoproto.gogoprotoImport"] = Boolean(object[".gogoproto.gogoprotoImport"]); - if (object[".gogoproto.protosizerAll"] != null) - message[".gogoproto.protosizerAll"] = Boolean(object[".gogoproto.protosizerAll"]); - if (object[".gogoproto.compareAll"] != null) - message[".gogoproto.compareAll"] = Boolean(object[".gogoproto.compareAll"]); - if (object[".gogoproto.typedeclAll"] != null) - message[".gogoproto.typedeclAll"] = Boolean(object[".gogoproto.typedeclAll"]); - if (object[".gogoproto.enumdeclAll"] != null) - message[".gogoproto.enumdeclAll"] = Boolean(object[".gogoproto.enumdeclAll"]); - if (object[".gogoproto.goprotoRegistration"] != null) - message[".gogoproto.goprotoRegistration"] = Boolean(object[".gogoproto.goprotoRegistration"]); - if (object[".gogoproto.messagenameAll"] != null) - message[".gogoproto.messagenameAll"] = Boolean(object[".gogoproto.messagenameAll"]); - if (object[".gogoproto.goprotoSizecacheAll"] != null) - message[".gogoproto.goprotoSizecacheAll"] = Boolean(object[".gogoproto.goprotoSizecacheAll"]); - if (object[".gogoproto.goprotoUnkeyedAll"] != null) - message[".gogoproto.goprotoUnkeyedAll"] = Boolean(object[".gogoproto.goprotoUnkeyedAll"]); - return message; - }; - - /** - * Creates a plain object from a FileOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FileOptions - * @static - * @param {google.protobuf.FileOptions} message FileOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FileOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.javaPackage = ""; - object.javaOuterClassname = ""; - object.optimizeFor = options.enums === String ? "SPEED" : 1; - object.javaMultipleFiles = false; - object.goPackage = ""; - object.ccGenericServices = false; - object.javaGenericServices = false; - object.pyGenericServices = false; - object.javaGenerateEqualsAndHash = false; - object.deprecated = false; - object.javaStringCheckUtf8 = false; - object.ccEnableArenas = true; - object.objcClassPrefix = ""; - object.csharpNamespace = ""; - object.swiftPrefix = ""; - object.phpClassPrefix = ""; - object.phpNamespace = ""; - object.phpGenericServices = false; - object.phpMetadataNamespace = ""; - object.rubyPackage = ""; - object[".gogoproto.goprotoGettersAll"] = false; - object[".gogoproto.goprotoEnumPrefixAll"] = false; - object[".gogoproto.goprotoStringerAll"] = false; - object[".gogoproto.verboseEqualAll"] = false; - object[".gogoproto.faceAll"] = false; - object[".gogoproto.gostringAll"] = false; - object[".gogoproto.populateAll"] = false; - object[".gogoproto.stringerAll"] = false; - object[".gogoproto.onlyoneAll"] = false; - object[".gogoproto.equalAll"] = false; - object[".gogoproto.descriptionAll"] = false; - object[".gogoproto.testgenAll"] = false; - object[".gogoproto.benchgenAll"] = false; - object[".gogoproto.marshalerAll"] = false; - object[".gogoproto.unmarshalerAll"] = false; - object[".gogoproto.stableMarshalerAll"] = false; - object[".gogoproto.sizerAll"] = false; - object[".gogoproto.goprotoEnumStringerAll"] = false; - object[".gogoproto.enumStringerAll"] = false; - object[".gogoproto.unsafeMarshalerAll"] = false; - object[".gogoproto.unsafeUnmarshalerAll"] = false; - object[".gogoproto.goprotoExtensionsMapAll"] = false; - object[".gogoproto.goprotoUnrecognizedAll"] = false; - object[".gogoproto.gogoprotoImport"] = false; - object[".gogoproto.protosizerAll"] = false; - object[".gogoproto.compareAll"] = false; - object[".gogoproto.typedeclAll"] = false; - object[".gogoproto.enumdeclAll"] = false; - object[".gogoproto.goprotoRegistration"] = false; - object[".gogoproto.messagenameAll"] = false; - object[".gogoproto.goprotoSizecacheAll"] = false; - object[".gogoproto.goprotoUnkeyedAll"] = false; - } - if (message.javaPackage != null && message.hasOwnProperty("javaPackage")) - object.javaPackage = message.javaPackage; - if (message.javaOuterClassname != null && message.hasOwnProperty("javaOuterClassname")) - object.javaOuterClassname = message.javaOuterClassname; - if (message.optimizeFor != null && message.hasOwnProperty("optimizeFor")) - object.optimizeFor = options.enums === String ? $root.google.protobuf.FileOptions.OptimizeMode[message.optimizeFor] : message.optimizeFor; - if (message.javaMultipleFiles != null && message.hasOwnProperty("javaMultipleFiles")) - object.javaMultipleFiles = message.javaMultipleFiles; - if (message.goPackage != null && message.hasOwnProperty("goPackage")) - object.goPackage = message.goPackage; - if (message.ccGenericServices != null && message.hasOwnProperty("ccGenericServices")) - object.ccGenericServices = message.ccGenericServices; - if (message.javaGenericServices != null && message.hasOwnProperty("javaGenericServices")) - object.javaGenericServices = message.javaGenericServices; - if (message.pyGenericServices != null && message.hasOwnProperty("pyGenericServices")) - object.pyGenericServices = message.pyGenericServices; - if (message.javaGenerateEqualsAndHash != null && message.hasOwnProperty("javaGenerateEqualsAndHash")) - object.javaGenerateEqualsAndHash = message.javaGenerateEqualsAndHash; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.javaStringCheckUtf8 != null && message.hasOwnProperty("javaStringCheckUtf8")) - object.javaStringCheckUtf8 = message.javaStringCheckUtf8; - if (message.ccEnableArenas != null && message.hasOwnProperty("ccEnableArenas")) - object.ccEnableArenas = message.ccEnableArenas; - if (message.objcClassPrefix != null && message.hasOwnProperty("objcClassPrefix")) - object.objcClassPrefix = message.objcClassPrefix; - if (message.csharpNamespace != null && message.hasOwnProperty("csharpNamespace")) - object.csharpNamespace = message.csharpNamespace; - if (message.swiftPrefix != null && message.hasOwnProperty("swiftPrefix")) - object.swiftPrefix = message.swiftPrefix; - if (message.phpClassPrefix != null && message.hasOwnProperty("phpClassPrefix")) - object.phpClassPrefix = message.phpClassPrefix; - if (message.phpNamespace != null && message.hasOwnProperty("phpNamespace")) - object.phpNamespace = message.phpNamespace; - if (message.phpGenericServices != null && message.hasOwnProperty("phpGenericServices")) - object.phpGenericServices = message.phpGenericServices; - if (message.phpMetadataNamespace != null && message.hasOwnProperty("phpMetadataNamespace")) - object.phpMetadataNamespace = message.phpMetadataNamespace; - if (message.rubyPackage != null && message.hasOwnProperty("rubyPackage")) - object.rubyPackage = message.rubyPackage; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".gogoproto.goprotoGettersAll"] != null && message.hasOwnProperty(".gogoproto.goprotoGettersAll")) - object[".gogoproto.goprotoGettersAll"] = message[".gogoproto.goprotoGettersAll"]; - if (message[".gogoproto.goprotoEnumPrefixAll"] != null && message.hasOwnProperty(".gogoproto.goprotoEnumPrefixAll")) - object[".gogoproto.goprotoEnumPrefixAll"] = message[".gogoproto.goprotoEnumPrefixAll"]; - if (message[".gogoproto.goprotoStringerAll"] != null && message.hasOwnProperty(".gogoproto.goprotoStringerAll")) - object[".gogoproto.goprotoStringerAll"] = message[".gogoproto.goprotoStringerAll"]; - if (message[".gogoproto.verboseEqualAll"] != null && message.hasOwnProperty(".gogoproto.verboseEqualAll")) - object[".gogoproto.verboseEqualAll"] = message[".gogoproto.verboseEqualAll"]; - if (message[".gogoproto.faceAll"] != null && message.hasOwnProperty(".gogoproto.faceAll")) - object[".gogoproto.faceAll"] = message[".gogoproto.faceAll"]; - if (message[".gogoproto.gostringAll"] != null && message.hasOwnProperty(".gogoproto.gostringAll")) - object[".gogoproto.gostringAll"] = message[".gogoproto.gostringAll"]; - if (message[".gogoproto.populateAll"] != null && message.hasOwnProperty(".gogoproto.populateAll")) - object[".gogoproto.populateAll"] = message[".gogoproto.populateAll"]; - if (message[".gogoproto.stringerAll"] != null && message.hasOwnProperty(".gogoproto.stringerAll")) - object[".gogoproto.stringerAll"] = message[".gogoproto.stringerAll"]; - if (message[".gogoproto.onlyoneAll"] != null && message.hasOwnProperty(".gogoproto.onlyoneAll")) - object[".gogoproto.onlyoneAll"] = message[".gogoproto.onlyoneAll"]; - if (message[".gogoproto.equalAll"] != null && message.hasOwnProperty(".gogoproto.equalAll")) - object[".gogoproto.equalAll"] = message[".gogoproto.equalAll"]; - if (message[".gogoproto.descriptionAll"] != null && message.hasOwnProperty(".gogoproto.descriptionAll")) - object[".gogoproto.descriptionAll"] = message[".gogoproto.descriptionAll"]; - if (message[".gogoproto.testgenAll"] != null && message.hasOwnProperty(".gogoproto.testgenAll")) - object[".gogoproto.testgenAll"] = message[".gogoproto.testgenAll"]; - if (message[".gogoproto.benchgenAll"] != null && message.hasOwnProperty(".gogoproto.benchgenAll")) - object[".gogoproto.benchgenAll"] = message[".gogoproto.benchgenAll"]; - if (message[".gogoproto.marshalerAll"] != null && message.hasOwnProperty(".gogoproto.marshalerAll")) - object[".gogoproto.marshalerAll"] = message[".gogoproto.marshalerAll"]; - if (message[".gogoproto.unmarshalerAll"] != null && message.hasOwnProperty(".gogoproto.unmarshalerAll")) - object[".gogoproto.unmarshalerAll"] = message[".gogoproto.unmarshalerAll"]; - if (message[".gogoproto.stableMarshalerAll"] != null && message.hasOwnProperty(".gogoproto.stableMarshalerAll")) - object[".gogoproto.stableMarshalerAll"] = message[".gogoproto.stableMarshalerAll"]; - if (message[".gogoproto.sizerAll"] != null && message.hasOwnProperty(".gogoproto.sizerAll")) - object[".gogoproto.sizerAll"] = message[".gogoproto.sizerAll"]; - if (message[".gogoproto.goprotoEnumStringerAll"] != null && message.hasOwnProperty(".gogoproto.goprotoEnumStringerAll")) - object[".gogoproto.goprotoEnumStringerAll"] = message[".gogoproto.goprotoEnumStringerAll"]; - if (message[".gogoproto.enumStringerAll"] != null && message.hasOwnProperty(".gogoproto.enumStringerAll")) - object[".gogoproto.enumStringerAll"] = message[".gogoproto.enumStringerAll"]; - if (message[".gogoproto.unsafeMarshalerAll"] != null && message.hasOwnProperty(".gogoproto.unsafeMarshalerAll")) - object[".gogoproto.unsafeMarshalerAll"] = message[".gogoproto.unsafeMarshalerAll"]; - if (message[".gogoproto.unsafeUnmarshalerAll"] != null && message.hasOwnProperty(".gogoproto.unsafeUnmarshalerAll")) - object[".gogoproto.unsafeUnmarshalerAll"] = message[".gogoproto.unsafeUnmarshalerAll"]; - if (message[".gogoproto.goprotoExtensionsMapAll"] != null && message.hasOwnProperty(".gogoproto.goprotoExtensionsMapAll")) - object[".gogoproto.goprotoExtensionsMapAll"] = message[".gogoproto.goprotoExtensionsMapAll"]; - if (message[".gogoproto.goprotoUnrecognizedAll"] != null && message.hasOwnProperty(".gogoproto.goprotoUnrecognizedAll")) - object[".gogoproto.goprotoUnrecognizedAll"] = message[".gogoproto.goprotoUnrecognizedAll"]; - if (message[".gogoproto.gogoprotoImport"] != null && message.hasOwnProperty(".gogoproto.gogoprotoImport")) - object[".gogoproto.gogoprotoImport"] = message[".gogoproto.gogoprotoImport"]; - if (message[".gogoproto.protosizerAll"] != null && message.hasOwnProperty(".gogoproto.protosizerAll")) - object[".gogoproto.protosizerAll"] = message[".gogoproto.protosizerAll"]; - if (message[".gogoproto.compareAll"] != null && message.hasOwnProperty(".gogoproto.compareAll")) - object[".gogoproto.compareAll"] = message[".gogoproto.compareAll"]; - if (message[".gogoproto.typedeclAll"] != null && message.hasOwnProperty(".gogoproto.typedeclAll")) - object[".gogoproto.typedeclAll"] = message[".gogoproto.typedeclAll"]; - if (message[".gogoproto.enumdeclAll"] != null && message.hasOwnProperty(".gogoproto.enumdeclAll")) - object[".gogoproto.enumdeclAll"] = message[".gogoproto.enumdeclAll"]; - if (message[".gogoproto.goprotoRegistration"] != null && message.hasOwnProperty(".gogoproto.goprotoRegistration")) - object[".gogoproto.goprotoRegistration"] = message[".gogoproto.goprotoRegistration"]; - if (message[".gogoproto.messagenameAll"] != null && message.hasOwnProperty(".gogoproto.messagenameAll")) - object[".gogoproto.messagenameAll"] = message[".gogoproto.messagenameAll"]; - if (message[".gogoproto.goprotoSizecacheAll"] != null && message.hasOwnProperty(".gogoproto.goprotoSizecacheAll")) - object[".gogoproto.goprotoSizecacheAll"] = message[".gogoproto.goprotoSizecacheAll"]; - if (message[".gogoproto.goprotoUnkeyedAll"] != null && message.hasOwnProperty(".gogoproto.goprotoUnkeyedAll")) - object[".gogoproto.goprotoUnkeyedAll"] = message[".gogoproto.goprotoUnkeyedAll"]; - return object; - }; - - /** - * Converts this FileOptions to JSON. - * @function toJSON - * @memberof google.protobuf.FileOptions - * @instance - * @returns {Object.} JSON object - */ - FileOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * OptimizeMode enum. - * @name google.protobuf.FileOptions.OptimizeMode - * @enum {number} - * @property {number} SPEED=1 SPEED value - * @property {number} CODE_SIZE=2 CODE_SIZE value - * @property {number} LITE_RUNTIME=3 LITE_RUNTIME value - */ - FileOptions.OptimizeMode = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[1] = "SPEED"] = 1; - values[valuesById[2] = "CODE_SIZE"] = 2; - values[valuesById[3] = "LITE_RUNTIME"] = 3; - return values; - })(); - - return FileOptions; - })(); - - protobuf.MessageOptions = (function() { - - /** - * Properties of a MessageOptions. - * @memberof google.protobuf - * @interface IMessageOptions - * @property {boolean|null} [messageSetWireFormat] MessageOptions messageSetWireFormat - * @property {boolean|null} [noStandardDescriptorAccessor] MessageOptions noStandardDescriptorAccessor - * @property {boolean|null} [deprecated] MessageOptions deprecated - * @property {boolean|null} [mapEntry] MessageOptions mapEntry - * @property {Array.|null} [uninterpretedOption] MessageOptions uninterpretedOption - * @property {boolean|null} [".gogoproto.goprotoGetters"] MessageOptions .gogoproto.goprotoGetters - * @property {boolean|null} [".gogoproto.goprotoStringer"] MessageOptions .gogoproto.goprotoStringer - * @property {boolean|null} [".gogoproto.verboseEqual"] MessageOptions .gogoproto.verboseEqual - * @property {boolean|null} [".gogoproto.face"] MessageOptions .gogoproto.face - * @property {boolean|null} [".gogoproto.gostring"] MessageOptions .gogoproto.gostring - * @property {boolean|null} [".gogoproto.populate"] MessageOptions .gogoproto.populate - * @property {boolean|null} [".gogoproto.stringer"] MessageOptions .gogoproto.stringer - * @property {boolean|null} [".gogoproto.onlyone"] MessageOptions .gogoproto.onlyone - * @property {boolean|null} [".gogoproto.equal"] MessageOptions .gogoproto.equal - * @property {boolean|null} [".gogoproto.description"] MessageOptions .gogoproto.description - * @property {boolean|null} [".gogoproto.testgen"] MessageOptions .gogoproto.testgen - * @property {boolean|null} [".gogoproto.benchgen"] MessageOptions .gogoproto.benchgen - * @property {boolean|null} [".gogoproto.marshaler"] MessageOptions .gogoproto.marshaler - * @property {boolean|null} [".gogoproto.unmarshaler"] MessageOptions .gogoproto.unmarshaler - * @property {boolean|null} [".gogoproto.stableMarshaler"] MessageOptions .gogoproto.stableMarshaler - * @property {boolean|null} [".gogoproto.sizer"] MessageOptions .gogoproto.sizer - * @property {boolean|null} [".gogoproto.unsafeMarshaler"] MessageOptions .gogoproto.unsafeMarshaler - * @property {boolean|null} [".gogoproto.unsafeUnmarshaler"] MessageOptions .gogoproto.unsafeUnmarshaler - * @property {boolean|null} [".gogoproto.goprotoExtensionsMap"] MessageOptions .gogoproto.goprotoExtensionsMap - * @property {boolean|null} [".gogoproto.goprotoUnrecognized"] MessageOptions .gogoproto.goprotoUnrecognized - * @property {boolean|null} [".gogoproto.protosizer"] MessageOptions .gogoproto.protosizer - * @property {boolean|null} [".gogoproto.compare"] MessageOptions .gogoproto.compare - * @property {boolean|null} [".gogoproto.typedecl"] MessageOptions .gogoproto.typedecl - * @property {boolean|null} [".gogoproto.messagename"] MessageOptions .gogoproto.messagename - * @property {boolean|null} [".gogoproto.goprotoSizecache"] MessageOptions .gogoproto.goprotoSizecache - * @property {boolean|null} [".gogoproto.goprotoUnkeyed"] MessageOptions .gogoproto.goprotoUnkeyed - */ - - /** - * Constructs a new MessageOptions. - * @memberof google.protobuf - * @classdesc Represents a MessageOptions. - * @implements IMessageOptions - * @constructor - * @param {google.protobuf.IMessageOptions=} [properties] Properties to set - */ - function MessageOptions(properties) { - this.uninterpretedOption = []; - 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]]; - } - - /** - * MessageOptions messageSetWireFormat. - * @member {boolean} messageSetWireFormat - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.messageSetWireFormat = false; - - /** - * MessageOptions noStandardDescriptorAccessor. - * @member {boolean} noStandardDescriptorAccessor - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.noStandardDescriptorAccessor = false; - - /** - * MessageOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.deprecated = false; - - /** - * MessageOptions mapEntry. - * @member {boolean} mapEntry - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.mapEntry = false; - - /** - * MessageOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * MessageOptions .gogoproto.goprotoGetters. - * @member {boolean} .gogoproto.goprotoGetters - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.goprotoGetters"] = false; - - /** - * MessageOptions .gogoproto.goprotoStringer. - * @member {boolean} .gogoproto.goprotoStringer - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.goprotoStringer"] = false; - - /** - * MessageOptions .gogoproto.verboseEqual. - * @member {boolean} .gogoproto.verboseEqual - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.verboseEqual"] = false; - - /** - * MessageOptions .gogoproto.face. - * @member {boolean} .gogoproto.face - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.face"] = false; - - /** - * MessageOptions .gogoproto.gostring. - * @member {boolean} .gogoproto.gostring - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.gostring"] = false; - - /** - * MessageOptions .gogoproto.populate. - * @member {boolean} .gogoproto.populate - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.populate"] = false; - - /** - * MessageOptions .gogoproto.stringer. - * @member {boolean} .gogoproto.stringer - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.stringer"] = false; - - /** - * MessageOptions .gogoproto.onlyone. - * @member {boolean} .gogoproto.onlyone - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.onlyone"] = false; - - /** - * MessageOptions .gogoproto.equal. - * @member {boolean} .gogoproto.equal - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.equal"] = false; - - /** - * MessageOptions .gogoproto.description. - * @member {boolean} .gogoproto.description - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.description"] = false; - - /** - * MessageOptions .gogoproto.testgen. - * @member {boolean} .gogoproto.testgen - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.testgen"] = false; - - /** - * MessageOptions .gogoproto.benchgen. - * @member {boolean} .gogoproto.benchgen - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.benchgen"] = false; - - /** - * MessageOptions .gogoproto.marshaler. - * @member {boolean} .gogoproto.marshaler - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.marshaler"] = false; - - /** - * MessageOptions .gogoproto.unmarshaler. - * @member {boolean} .gogoproto.unmarshaler - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.unmarshaler"] = false; - - /** - * MessageOptions .gogoproto.stableMarshaler. - * @member {boolean} .gogoproto.stableMarshaler - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.stableMarshaler"] = false; - - /** - * MessageOptions .gogoproto.sizer. - * @member {boolean} .gogoproto.sizer - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.sizer"] = false; - - /** - * MessageOptions .gogoproto.unsafeMarshaler. - * @member {boolean} .gogoproto.unsafeMarshaler - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.unsafeMarshaler"] = false; - - /** - * MessageOptions .gogoproto.unsafeUnmarshaler. - * @member {boolean} .gogoproto.unsafeUnmarshaler - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.unsafeUnmarshaler"] = false; - - /** - * MessageOptions .gogoproto.goprotoExtensionsMap. - * @member {boolean} .gogoproto.goprotoExtensionsMap - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.goprotoExtensionsMap"] = false; - - /** - * MessageOptions .gogoproto.goprotoUnrecognized. - * @member {boolean} .gogoproto.goprotoUnrecognized - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.goprotoUnrecognized"] = false; - - /** - * MessageOptions .gogoproto.protosizer. - * @member {boolean} .gogoproto.protosizer - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.protosizer"] = false; - - /** - * MessageOptions .gogoproto.compare. - * @member {boolean} .gogoproto.compare - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.compare"] = false; - - /** - * MessageOptions .gogoproto.typedecl. - * @member {boolean} .gogoproto.typedecl - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.typedecl"] = false; - - /** - * MessageOptions .gogoproto.messagename. - * @member {boolean} .gogoproto.messagename - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.messagename"] = false; - - /** - * MessageOptions .gogoproto.goprotoSizecache. - * @member {boolean} .gogoproto.goprotoSizecache - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.goprotoSizecache"] = false; - - /** - * MessageOptions .gogoproto.goprotoUnkeyed. - * @member {boolean} .gogoproto.goprotoUnkeyed - * @memberof google.protobuf.MessageOptions - * @instance - */ - MessageOptions.prototype[".gogoproto.goprotoUnkeyed"] = false; - - /** - * Creates a new MessageOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions=} [properties] Properties to set - * @returns {google.protobuf.MessageOptions} MessageOptions instance - */ - MessageOptions.create = function create(properties) { - return new MessageOptions(properties); - }; - - /** - * Encodes the specified MessageOptions message. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MessageOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.messageSetWireFormat != null && Object.hasOwnProperty.call(message, "messageSetWireFormat")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.messageSetWireFormat); - if (message.noStandardDescriptorAccessor != null && Object.hasOwnProperty.call(message, "noStandardDescriptorAccessor")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.noStandardDescriptorAccessor); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.mapEntry != null && Object.hasOwnProperty.call(message, "mapEntry")) - writer.uint32(/* id 7, wireType 0 =*/56).bool(message.mapEntry); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".gogoproto.goprotoGetters"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goprotoGetters")) - writer.uint32(/* id 64001, wireType 0 =*/512008).bool(message[".gogoproto.goprotoGetters"]); - if (message[".gogoproto.goprotoStringer"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goprotoStringer")) - writer.uint32(/* id 64003, wireType 0 =*/512024).bool(message[".gogoproto.goprotoStringer"]); - if (message[".gogoproto.verboseEqual"] != null && Object.hasOwnProperty.call(message, ".gogoproto.verboseEqual")) - writer.uint32(/* id 64004, wireType 0 =*/512032).bool(message[".gogoproto.verboseEqual"]); - if (message[".gogoproto.face"] != null && Object.hasOwnProperty.call(message, ".gogoproto.face")) - writer.uint32(/* id 64005, wireType 0 =*/512040).bool(message[".gogoproto.face"]); - if (message[".gogoproto.gostring"] != null && Object.hasOwnProperty.call(message, ".gogoproto.gostring")) - writer.uint32(/* id 64006, wireType 0 =*/512048).bool(message[".gogoproto.gostring"]); - if (message[".gogoproto.populate"] != null && Object.hasOwnProperty.call(message, ".gogoproto.populate")) - writer.uint32(/* id 64007, wireType 0 =*/512056).bool(message[".gogoproto.populate"]); - if (message[".gogoproto.onlyone"] != null && Object.hasOwnProperty.call(message, ".gogoproto.onlyone")) - writer.uint32(/* id 64009, wireType 0 =*/512072).bool(message[".gogoproto.onlyone"]); - if (message[".gogoproto.equal"] != null && Object.hasOwnProperty.call(message, ".gogoproto.equal")) - writer.uint32(/* id 64013, wireType 0 =*/512104).bool(message[".gogoproto.equal"]); - if (message[".gogoproto.description"] != null && Object.hasOwnProperty.call(message, ".gogoproto.description")) - writer.uint32(/* id 64014, wireType 0 =*/512112).bool(message[".gogoproto.description"]); - if (message[".gogoproto.testgen"] != null && Object.hasOwnProperty.call(message, ".gogoproto.testgen")) - writer.uint32(/* id 64015, wireType 0 =*/512120).bool(message[".gogoproto.testgen"]); - if (message[".gogoproto.benchgen"] != null && Object.hasOwnProperty.call(message, ".gogoproto.benchgen")) - writer.uint32(/* id 64016, wireType 0 =*/512128).bool(message[".gogoproto.benchgen"]); - if (message[".gogoproto.marshaler"] != null && Object.hasOwnProperty.call(message, ".gogoproto.marshaler")) - writer.uint32(/* id 64017, wireType 0 =*/512136).bool(message[".gogoproto.marshaler"]); - if (message[".gogoproto.unmarshaler"] != null && Object.hasOwnProperty.call(message, ".gogoproto.unmarshaler")) - writer.uint32(/* id 64018, wireType 0 =*/512144).bool(message[".gogoproto.unmarshaler"]); - if (message[".gogoproto.stableMarshaler"] != null && Object.hasOwnProperty.call(message, ".gogoproto.stableMarshaler")) - writer.uint32(/* id 64019, wireType 0 =*/512152).bool(message[".gogoproto.stableMarshaler"]); - if (message[".gogoproto.sizer"] != null && Object.hasOwnProperty.call(message, ".gogoproto.sizer")) - writer.uint32(/* id 64020, wireType 0 =*/512160).bool(message[".gogoproto.sizer"]); - if (message[".gogoproto.unsafeMarshaler"] != null && Object.hasOwnProperty.call(message, ".gogoproto.unsafeMarshaler")) - writer.uint32(/* id 64023, wireType 0 =*/512184).bool(message[".gogoproto.unsafeMarshaler"]); - if (message[".gogoproto.unsafeUnmarshaler"] != null && Object.hasOwnProperty.call(message, ".gogoproto.unsafeUnmarshaler")) - writer.uint32(/* id 64024, wireType 0 =*/512192).bool(message[".gogoproto.unsafeUnmarshaler"]); - if (message[".gogoproto.goprotoExtensionsMap"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goprotoExtensionsMap")) - writer.uint32(/* id 64025, wireType 0 =*/512200).bool(message[".gogoproto.goprotoExtensionsMap"]); - if (message[".gogoproto.goprotoUnrecognized"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goprotoUnrecognized")) - writer.uint32(/* id 64026, wireType 0 =*/512208).bool(message[".gogoproto.goprotoUnrecognized"]); - if (message[".gogoproto.protosizer"] != null && Object.hasOwnProperty.call(message, ".gogoproto.protosizer")) - writer.uint32(/* id 64028, wireType 0 =*/512224).bool(message[".gogoproto.protosizer"]); - if (message[".gogoproto.compare"] != null && Object.hasOwnProperty.call(message, ".gogoproto.compare")) - writer.uint32(/* id 64029, wireType 0 =*/512232).bool(message[".gogoproto.compare"]); - if (message[".gogoproto.typedecl"] != null && Object.hasOwnProperty.call(message, ".gogoproto.typedecl")) - writer.uint32(/* id 64030, wireType 0 =*/512240).bool(message[".gogoproto.typedecl"]); - if (message[".gogoproto.messagename"] != null && Object.hasOwnProperty.call(message, ".gogoproto.messagename")) - writer.uint32(/* id 64033, wireType 0 =*/512264).bool(message[".gogoproto.messagename"]); - if (message[".gogoproto.goprotoSizecache"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goprotoSizecache")) - writer.uint32(/* id 64034, wireType 0 =*/512272).bool(message[".gogoproto.goprotoSizecache"]); - if (message[".gogoproto.goprotoUnkeyed"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goprotoUnkeyed")) - writer.uint32(/* id 64035, wireType 0 =*/512280).bool(message[".gogoproto.goprotoUnkeyed"]); - if (message[".gogoproto.stringer"] != null && Object.hasOwnProperty.call(message, ".gogoproto.stringer")) - writer.uint32(/* id 67008, wireType 0 =*/536064).bool(message[".gogoproto.stringer"]); - return writer; - }; - - /** - * Encodes the specified MessageOptions message, length delimited. Does not implicitly {@link google.protobuf.MessageOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.IMessageOptions} message MessageOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MessageOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MessageOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MessageOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MessageOptions} MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MessageOptions.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.google.protobuf.MessageOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.messageSetWireFormat = reader.bool(); - break; - case 2: - message.noStandardDescriptorAccessor = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 7: - message.mapEntry = reader.bool(); - break; - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - case 64001: - message[".gogoproto.goprotoGetters"] = reader.bool(); - break; - case 64003: - message[".gogoproto.goprotoStringer"] = reader.bool(); - break; - case 64004: - message[".gogoproto.verboseEqual"] = reader.bool(); - break; - case 64005: - message[".gogoproto.face"] = reader.bool(); - break; - case 64006: - message[".gogoproto.gostring"] = reader.bool(); - break; - case 64007: - message[".gogoproto.populate"] = reader.bool(); - break; - case 67008: - message[".gogoproto.stringer"] = reader.bool(); - break; - case 64009: - message[".gogoproto.onlyone"] = reader.bool(); - break; - case 64013: - message[".gogoproto.equal"] = reader.bool(); - break; - case 64014: - message[".gogoproto.description"] = reader.bool(); - break; - case 64015: - message[".gogoproto.testgen"] = reader.bool(); - break; - case 64016: - message[".gogoproto.benchgen"] = reader.bool(); - break; - case 64017: - message[".gogoproto.marshaler"] = reader.bool(); - break; - case 64018: - message[".gogoproto.unmarshaler"] = reader.bool(); - break; - case 64019: - message[".gogoproto.stableMarshaler"] = reader.bool(); - break; - case 64020: - message[".gogoproto.sizer"] = reader.bool(); - break; - case 64023: - message[".gogoproto.unsafeMarshaler"] = reader.bool(); - break; - case 64024: - message[".gogoproto.unsafeUnmarshaler"] = reader.bool(); - break; - case 64025: - message[".gogoproto.goprotoExtensionsMap"] = reader.bool(); - break; - case 64026: - message[".gogoproto.goprotoUnrecognized"] = reader.bool(); - break; - case 64028: - message[".gogoproto.protosizer"] = reader.bool(); - break; - case 64029: - message[".gogoproto.compare"] = reader.bool(); - break; - case 64030: - message[".gogoproto.typedecl"] = reader.bool(); - break; - case 64033: - message[".gogoproto.messagename"] = reader.bool(); - break; - case 64034: - message[".gogoproto.goprotoSizecache"] = reader.bool(); - break; - case 64035: - message[".gogoproto.goprotoUnkeyed"] = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MessageOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MessageOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MessageOptions} MessageOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MessageOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MessageOptions message. - * @function verify - * @memberof google.protobuf.MessageOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MessageOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) - if (typeof message.messageSetWireFormat !== "boolean") - return "messageSetWireFormat: boolean expected"; - if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) - if (typeof message.noStandardDescriptorAccessor !== "boolean") - return "noStandardDescriptorAccessor: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) - if (typeof message.mapEntry !== "boolean") - return "mapEntry: boolean expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".gogoproto.goprotoGetters"] != null && message.hasOwnProperty(".gogoproto.goprotoGetters")) - if (typeof message[".gogoproto.goprotoGetters"] !== "boolean") - return ".gogoproto.goprotoGetters: boolean expected"; - if (message[".gogoproto.goprotoStringer"] != null && message.hasOwnProperty(".gogoproto.goprotoStringer")) - if (typeof message[".gogoproto.goprotoStringer"] !== "boolean") - return ".gogoproto.goprotoStringer: boolean expected"; - if (message[".gogoproto.verboseEqual"] != null && message.hasOwnProperty(".gogoproto.verboseEqual")) - if (typeof message[".gogoproto.verboseEqual"] !== "boolean") - return ".gogoproto.verboseEqual: boolean expected"; - if (message[".gogoproto.face"] != null && message.hasOwnProperty(".gogoproto.face")) - if (typeof message[".gogoproto.face"] !== "boolean") - return ".gogoproto.face: boolean expected"; - if (message[".gogoproto.gostring"] != null && message.hasOwnProperty(".gogoproto.gostring")) - if (typeof message[".gogoproto.gostring"] !== "boolean") - return ".gogoproto.gostring: boolean expected"; - if (message[".gogoproto.populate"] != null && message.hasOwnProperty(".gogoproto.populate")) - if (typeof message[".gogoproto.populate"] !== "boolean") - return ".gogoproto.populate: boolean expected"; - if (message[".gogoproto.stringer"] != null && message.hasOwnProperty(".gogoproto.stringer")) - if (typeof message[".gogoproto.stringer"] !== "boolean") - return ".gogoproto.stringer: boolean expected"; - if (message[".gogoproto.onlyone"] != null && message.hasOwnProperty(".gogoproto.onlyone")) - if (typeof message[".gogoproto.onlyone"] !== "boolean") - return ".gogoproto.onlyone: boolean expected"; - if (message[".gogoproto.equal"] != null && message.hasOwnProperty(".gogoproto.equal")) - if (typeof message[".gogoproto.equal"] !== "boolean") - return ".gogoproto.equal: boolean expected"; - if (message[".gogoproto.description"] != null && message.hasOwnProperty(".gogoproto.description")) - if (typeof message[".gogoproto.description"] !== "boolean") - return ".gogoproto.description: boolean expected"; - if (message[".gogoproto.testgen"] != null && message.hasOwnProperty(".gogoproto.testgen")) - if (typeof message[".gogoproto.testgen"] !== "boolean") - return ".gogoproto.testgen: boolean expected"; - if (message[".gogoproto.benchgen"] != null && message.hasOwnProperty(".gogoproto.benchgen")) - if (typeof message[".gogoproto.benchgen"] !== "boolean") - return ".gogoproto.benchgen: boolean expected"; - if (message[".gogoproto.marshaler"] != null && message.hasOwnProperty(".gogoproto.marshaler")) - if (typeof message[".gogoproto.marshaler"] !== "boolean") - return ".gogoproto.marshaler: boolean expected"; - if (message[".gogoproto.unmarshaler"] != null && message.hasOwnProperty(".gogoproto.unmarshaler")) - if (typeof message[".gogoproto.unmarshaler"] !== "boolean") - return ".gogoproto.unmarshaler: boolean expected"; - if (message[".gogoproto.stableMarshaler"] != null && message.hasOwnProperty(".gogoproto.stableMarshaler")) - if (typeof message[".gogoproto.stableMarshaler"] !== "boolean") - return ".gogoproto.stableMarshaler: boolean expected"; - if (message[".gogoproto.sizer"] != null && message.hasOwnProperty(".gogoproto.sizer")) - if (typeof message[".gogoproto.sizer"] !== "boolean") - return ".gogoproto.sizer: boolean expected"; - if (message[".gogoproto.unsafeMarshaler"] != null && message.hasOwnProperty(".gogoproto.unsafeMarshaler")) - if (typeof message[".gogoproto.unsafeMarshaler"] !== "boolean") - return ".gogoproto.unsafeMarshaler: boolean expected"; - if (message[".gogoproto.unsafeUnmarshaler"] != null && message.hasOwnProperty(".gogoproto.unsafeUnmarshaler")) - if (typeof message[".gogoproto.unsafeUnmarshaler"] !== "boolean") - return ".gogoproto.unsafeUnmarshaler: boolean expected"; - if (message[".gogoproto.goprotoExtensionsMap"] != null && message.hasOwnProperty(".gogoproto.goprotoExtensionsMap")) - if (typeof message[".gogoproto.goprotoExtensionsMap"] !== "boolean") - return ".gogoproto.goprotoExtensionsMap: boolean expected"; - if (message[".gogoproto.goprotoUnrecognized"] != null && message.hasOwnProperty(".gogoproto.goprotoUnrecognized")) - if (typeof message[".gogoproto.goprotoUnrecognized"] !== "boolean") - return ".gogoproto.goprotoUnrecognized: boolean expected"; - if (message[".gogoproto.protosizer"] != null && message.hasOwnProperty(".gogoproto.protosizer")) - if (typeof message[".gogoproto.protosizer"] !== "boolean") - return ".gogoproto.protosizer: boolean expected"; - if (message[".gogoproto.compare"] != null && message.hasOwnProperty(".gogoproto.compare")) - if (typeof message[".gogoproto.compare"] !== "boolean") - return ".gogoproto.compare: boolean expected"; - if (message[".gogoproto.typedecl"] != null && message.hasOwnProperty(".gogoproto.typedecl")) - if (typeof message[".gogoproto.typedecl"] !== "boolean") - return ".gogoproto.typedecl: boolean expected"; - if (message[".gogoproto.messagename"] != null && message.hasOwnProperty(".gogoproto.messagename")) - if (typeof message[".gogoproto.messagename"] !== "boolean") - return ".gogoproto.messagename: boolean expected"; - if (message[".gogoproto.goprotoSizecache"] != null && message.hasOwnProperty(".gogoproto.goprotoSizecache")) - if (typeof message[".gogoproto.goprotoSizecache"] !== "boolean") - return ".gogoproto.goprotoSizecache: boolean expected"; - if (message[".gogoproto.goprotoUnkeyed"] != null && message.hasOwnProperty(".gogoproto.goprotoUnkeyed")) - if (typeof message[".gogoproto.goprotoUnkeyed"] !== "boolean") - return ".gogoproto.goprotoUnkeyed: boolean expected"; - return null; - }; - - /** - * Creates a MessageOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MessageOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MessageOptions} MessageOptions - */ - MessageOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MessageOptions) - return object; - var message = new $root.google.protobuf.MessageOptions(); - if (object.messageSetWireFormat != null) - message.messageSetWireFormat = Boolean(object.messageSetWireFormat); - if (object.noStandardDescriptorAccessor != null) - message.noStandardDescriptorAccessor = Boolean(object.noStandardDescriptorAccessor); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.mapEntry != null) - message.mapEntry = Boolean(object.mapEntry); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.MessageOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".gogoproto.goprotoGetters"] != null) - message[".gogoproto.goprotoGetters"] = Boolean(object[".gogoproto.goprotoGetters"]); - if (object[".gogoproto.goprotoStringer"] != null) - message[".gogoproto.goprotoStringer"] = Boolean(object[".gogoproto.goprotoStringer"]); - if (object[".gogoproto.verboseEqual"] != null) - message[".gogoproto.verboseEqual"] = Boolean(object[".gogoproto.verboseEqual"]); - if (object[".gogoproto.face"] != null) - message[".gogoproto.face"] = Boolean(object[".gogoproto.face"]); - if (object[".gogoproto.gostring"] != null) - message[".gogoproto.gostring"] = Boolean(object[".gogoproto.gostring"]); - if (object[".gogoproto.populate"] != null) - message[".gogoproto.populate"] = Boolean(object[".gogoproto.populate"]); - if (object[".gogoproto.stringer"] != null) - message[".gogoproto.stringer"] = Boolean(object[".gogoproto.stringer"]); - if (object[".gogoproto.onlyone"] != null) - message[".gogoproto.onlyone"] = Boolean(object[".gogoproto.onlyone"]); - if (object[".gogoproto.equal"] != null) - message[".gogoproto.equal"] = Boolean(object[".gogoproto.equal"]); - if (object[".gogoproto.description"] != null) - message[".gogoproto.description"] = Boolean(object[".gogoproto.description"]); - if (object[".gogoproto.testgen"] != null) - message[".gogoproto.testgen"] = Boolean(object[".gogoproto.testgen"]); - if (object[".gogoproto.benchgen"] != null) - message[".gogoproto.benchgen"] = Boolean(object[".gogoproto.benchgen"]); - if (object[".gogoproto.marshaler"] != null) - message[".gogoproto.marshaler"] = Boolean(object[".gogoproto.marshaler"]); - if (object[".gogoproto.unmarshaler"] != null) - message[".gogoproto.unmarshaler"] = Boolean(object[".gogoproto.unmarshaler"]); - if (object[".gogoproto.stableMarshaler"] != null) - message[".gogoproto.stableMarshaler"] = Boolean(object[".gogoproto.stableMarshaler"]); - if (object[".gogoproto.sizer"] != null) - message[".gogoproto.sizer"] = Boolean(object[".gogoproto.sizer"]); - if (object[".gogoproto.unsafeMarshaler"] != null) - message[".gogoproto.unsafeMarshaler"] = Boolean(object[".gogoproto.unsafeMarshaler"]); - if (object[".gogoproto.unsafeUnmarshaler"] != null) - message[".gogoproto.unsafeUnmarshaler"] = Boolean(object[".gogoproto.unsafeUnmarshaler"]); - if (object[".gogoproto.goprotoExtensionsMap"] != null) - message[".gogoproto.goprotoExtensionsMap"] = Boolean(object[".gogoproto.goprotoExtensionsMap"]); - if (object[".gogoproto.goprotoUnrecognized"] != null) - message[".gogoproto.goprotoUnrecognized"] = Boolean(object[".gogoproto.goprotoUnrecognized"]); - if (object[".gogoproto.protosizer"] != null) - message[".gogoproto.protosizer"] = Boolean(object[".gogoproto.protosizer"]); - if (object[".gogoproto.compare"] != null) - message[".gogoproto.compare"] = Boolean(object[".gogoproto.compare"]); - if (object[".gogoproto.typedecl"] != null) - message[".gogoproto.typedecl"] = Boolean(object[".gogoproto.typedecl"]); - if (object[".gogoproto.messagename"] != null) - message[".gogoproto.messagename"] = Boolean(object[".gogoproto.messagename"]); - if (object[".gogoproto.goprotoSizecache"] != null) - message[".gogoproto.goprotoSizecache"] = Boolean(object[".gogoproto.goprotoSizecache"]); - if (object[".gogoproto.goprotoUnkeyed"] != null) - message[".gogoproto.goprotoUnkeyed"] = Boolean(object[".gogoproto.goprotoUnkeyed"]); - return message; - }; - - /** - * Creates a plain object from a MessageOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MessageOptions - * @static - * @param {google.protobuf.MessageOptions} message MessageOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MessageOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.messageSetWireFormat = false; - object.noStandardDescriptorAccessor = false; - object.deprecated = false; - object.mapEntry = false; - object[".gogoproto.goprotoGetters"] = false; - object[".gogoproto.goprotoStringer"] = false; - object[".gogoproto.verboseEqual"] = false; - object[".gogoproto.face"] = false; - object[".gogoproto.gostring"] = false; - object[".gogoproto.populate"] = false; - object[".gogoproto.onlyone"] = false; - object[".gogoproto.equal"] = false; - object[".gogoproto.description"] = false; - object[".gogoproto.testgen"] = false; - object[".gogoproto.benchgen"] = false; - object[".gogoproto.marshaler"] = false; - object[".gogoproto.unmarshaler"] = false; - object[".gogoproto.stableMarshaler"] = false; - object[".gogoproto.sizer"] = false; - object[".gogoproto.unsafeMarshaler"] = false; - object[".gogoproto.unsafeUnmarshaler"] = false; - object[".gogoproto.goprotoExtensionsMap"] = false; - object[".gogoproto.goprotoUnrecognized"] = false; - object[".gogoproto.protosizer"] = false; - object[".gogoproto.compare"] = false; - object[".gogoproto.typedecl"] = false; - object[".gogoproto.messagename"] = false; - object[".gogoproto.goprotoSizecache"] = false; - object[".gogoproto.goprotoUnkeyed"] = false; - object[".gogoproto.stringer"] = false; - } - if (message.messageSetWireFormat != null && message.hasOwnProperty("messageSetWireFormat")) - object.messageSetWireFormat = message.messageSetWireFormat; - if (message.noStandardDescriptorAccessor != null && message.hasOwnProperty("noStandardDescriptorAccessor")) - object.noStandardDescriptorAccessor = message.noStandardDescriptorAccessor; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.mapEntry != null && message.hasOwnProperty("mapEntry")) - object.mapEntry = message.mapEntry; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".gogoproto.goprotoGetters"] != null && message.hasOwnProperty(".gogoproto.goprotoGetters")) - object[".gogoproto.goprotoGetters"] = message[".gogoproto.goprotoGetters"]; - if (message[".gogoproto.goprotoStringer"] != null && message.hasOwnProperty(".gogoproto.goprotoStringer")) - object[".gogoproto.goprotoStringer"] = message[".gogoproto.goprotoStringer"]; - if (message[".gogoproto.verboseEqual"] != null && message.hasOwnProperty(".gogoproto.verboseEqual")) - object[".gogoproto.verboseEqual"] = message[".gogoproto.verboseEqual"]; - if (message[".gogoproto.face"] != null && message.hasOwnProperty(".gogoproto.face")) - object[".gogoproto.face"] = message[".gogoproto.face"]; - if (message[".gogoproto.gostring"] != null && message.hasOwnProperty(".gogoproto.gostring")) - object[".gogoproto.gostring"] = message[".gogoproto.gostring"]; - if (message[".gogoproto.populate"] != null && message.hasOwnProperty(".gogoproto.populate")) - object[".gogoproto.populate"] = message[".gogoproto.populate"]; - if (message[".gogoproto.onlyone"] != null && message.hasOwnProperty(".gogoproto.onlyone")) - object[".gogoproto.onlyone"] = message[".gogoproto.onlyone"]; - if (message[".gogoproto.equal"] != null && message.hasOwnProperty(".gogoproto.equal")) - object[".gogoproto.equal"] = message[".gogoproto.equal"]; - if (message[".gogoproto.description"] != null && message.hasOwnProperty(".gogoproto.description")) - object[".gogoproto.description"] = message[".gogoproto.description"]; - if (message[".gogoproto.testgen"] != null && message.hasOwnProperty(".gogoproto.testgen")) - object[".gogoproto.testgen"] = message[".gogoproto.testgen"]; - if (message[".gogoproto.benchgen"] != null && message.hasOwnProperty(".gogoproto.benchgen")) - object[".gogoproto.benchgen"] = message[".gogoproto.benchgen"]; - if (message[".gogoproto.marshaler"] != null && message.hasOwnProperty(".gogoproto.marshaler")) - object[".gogoproto.marshaler"] = message[".gogoproto.marshaler"]; - if (message[".gogoproto.unmarshaler"] != null && message.hasOwnProperty(".gogoproto.unmarshaler")) - object[".gogoproto.unmarshaler"] = message[".gogoproto.unmarshaler"]; - if (message[".gogoproto.stableMarshaler"] != null && message.hasOwnProperty(".gogoproto.stableMarshaler")) - object[".gogoproto.stableMarshaler"] = message[".gogoproto.stableMarshaler"]; - if (message[".gogoproto.sizer"] != null && message.hasOwnProperty(".gogoproto.sizer")) - object[".gogoproto.sizer"] = message[".gogoproto.sizer"]; - if (message[".gogoproto.unsafeMarshaler"] != null && message.hasOwnProperty(".gogoproto.unsafeMarshaler")) - object[".gogoproto.unsafeMarshaler"] = message[".gogoproto.unsafeMarshaler"]; - if (message[".gogoproto.unsafeUnmarshaler"] != null && message.hasOwnProperty(".gogoproto.unsafeUnmarshaler")) - object[".gogoproto.unsafeUnmarshaler"] = message[".gogoproto.unsafeUnmarshaler"]; - if (message[".gogoproto.goprotoExtensionsMap"] != null && message.hasOwnProperty(".gogoproto.goprotoExtensionsMap")) - object[".gogoproto.goprotoExtensionsMap"] = message[".gogoproto.goprotoExtensionsMap"]; - if (message[".gogoproto.goprotoUnrecognized"] != null && message.hasOwnProperty(".gogoproto.goprotoUnrecognized")) - object[".gogoproto.goprotoUnrecognized"] = message[".gogoproto.goprotoUnrecognized"]; - if (message[".gogoproto.protosizer"] != null && message.hasOwnProperty(".gogoproto.protosizer")) - object[".gogoproto.protosizer"] = message[".gogoproto.protosizer"]; - if (message[".gogoproto.compare"] != null && message.hasOwnProperty(".gogoproto.compare")) - object[".gogoproto.compare"] = message[".gogoproto.compare"]; - if (message[".gogoproto.typedecl"] != null && message.hasOwnProperty(".gogoproto.typedecl")) - object[".gogoproto.typedecl"] = message[".gogoproto.typedecl"]; - if (message[".gogoproto.messagename"] != null && message.hasOwnProperty(".gogoproto.messagename")) - object[".gogoproto.messagename"] = message[".gogoproto.messagename"]; - if (message[".gogoproto.goprotoSizecache"] != null && message.hasOwnProperty(".gogoproto.goprotoSizecache")) - object[".gogoproto.goprotoSizecache"] = message[".gogoproto.goprotoSizecache"]; - if (message[".gogoproto.goprotoUnkeyed"] != null && message.hasOwnProperty(".gogoproto.goprotoUnkeyed")) - object[".gogoproto.goprotoUnkeyed"] = message[".gogoproto.goprotoUnkeyed"]; - if (message[".gogoproto.stringer"] != null && message.hasOwnProperty(".gogoproto.stringer")) - object[".gogoproto.stringer"] = message[".gogoproto.stringer"]; - return object; - }; - - /** - * Converts this MessageOptions to JSON. - * @function toJSON - * @memberof google.protobuf.MessageOptions - * @instance - * @returns {Object.} JSON object - */ - MessageOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MessageOptions; - })(); - - protobuf.FieldOptions = (function() { - - /** - * Properties of a FieldOptions. - * @memberof google.protobuf - * @interface IFieldOptions - * @property {google.protobuf.FieldOptions.CType|null} [ctype] FieldOptions ctype - * @property {boolean|null} [packed] FieldOptions packed - * @property {google.protobuf.FieldOptions.JSType|null} [jstype] FieldOptions jstype - * @property {boolean|null} [lazy] FieldOptions lazy - * @property {boolean|null} [deprecated] FieldOptions deprecated - * @property {boolean|null} [weak] FieldOptions weak - * @property {Array.|null} [uninterpretedOption] FieldOptions uninterpretedOption - * @property {boolean|null} [".gogoproto.nullable"] FieldOptions .gogoproto.nullable - * @property {boolean|null} [".gogoproto.embed"] FieldOptions .gogoproto.embed - * @property {string|null} [".gogoproto.customtype"] FieldOptions .gogoproto.customtype - * @property {string|null} [".gogoproto.customname"] FieldOptions .gogoproto.customname - * @property {string|null} [".gogoproto.jsontag"] FieldOptions .gogoproto.jsontag - * @property {string|null} [".gogoproto.moretags"] FieldOptions .gogoproto.moretags - * @property {string|null} [".gogoproto.casttype"] FieldOptions .gogoproto.casttype - * @property {string|null} [".gogoproto.castkey"] FieldOptions .gogoproto.castkey - * @property {string|null} [".gogoproto.castvalue"] FieldOptions .gogoproto.castvalue - * @property {boolean|null} [".gogoproto.stdtime"] FieldOptions .gogoproto.stdtime - * @property {boolean|null} [".gogoproto.stdduration"] FieldOptions .gogoproto.stdduration - * @property {boolean|null} [".gogoproto.wktpointer"] FieldOptions .gogoproto.wktpointer - * @property {string|null} [".gogoproto.castrepeated"] FieldOptions .gogoproto.castrepeated - */ - - /** - * Constructs a new FieldOptions. - * @memberof google.protobuf - * @classdesc Represents a FieldOptions. - * @implements IFieldOptions - * @constructor - * @param {google.protobuf.IFieldOptions=} [properties] Properties to set - */ - function FieldOptions(properties) { - this.uninterpretedOption = []; - 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]]; - } - - /** - * FieldOptions ctype. - * @member {google.protobuf.FieldOptions.CType} ctype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.ctype = 0; - - /** - * FieldOptions packed. - * @member {boolean} packed - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.packed = false; - - /** - * FieldOptions jstype. - * @member {google.protobuf.FieldOptions.JSType} jstype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.jstype = 0; - - /** - * FieldOptions lazy. - * @member {boolean} lazy - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.lazy = false; - - /** - * FieldOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.deprecated = false; - - /** - * FieldOptions weak. - * @member {boolean} weak - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.weak = false; - - /** - * FieldOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * FieldOptions .gogoproto.nullable. - * @member {boolean} .gogoproto.nullable - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.nullable"] = false; - - /** - * FieldOptions .gogoproto.embed. - * @member {boolean} .gogoproto.embed - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.embed"] = false; - - /** - * FieldOptions .gogoproto.customtype. - * @member {string} .gogoproto.customtype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.customtype"] = ""; - - /** - * FieldOptions .gogoproto.customname. - * @member {string} .gogoproto.customname - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.customname"] = ""; - - /** - * FieldOptions .gogoproto.jsontag. - * @member {string} .gogoproto.jsontag - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.jsontag"] = ""; - - /** - * FieldOptions .gogoproto.moretags. - * @member {string} .gogoproto.moretags - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.moretags"] = ""; - - /** - * FieldOptions .gogoproto.casttype. - * @member {string} .gogoproto.casttype - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.casttype"] = ""; - - /** - * FieldOptions .gogoproto.castkey. - * @member {string} .gogoproto.castkey - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.castkey"] = ""; - - /** - * FieldOptions .gogoproto.castvalue. - * @member {string} .gogoproto.castvalue - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.castvalue"] = ""; - - /** - * FieldOptions .gogoproto.stdtime. - * @member {boolean} .gogoproto.stdtime - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.stdtime"] = false; - - /** - * FieldOptions .gogoproto.stdduration. - * @member {boolean} .gogoproto.stdduration - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.stdduration"] = false; - - /** - * FieldOptions .gogoproto.wktpointer. - * @member {boolean} .gogoproto.wktpointer - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.wktpointer"] = false; - - /** - * FieldOptions .gogoproto.castrepeated. - * @member {string} .gogoproto.castrepeated - * @memberof google.protobuf.FieldOptions - * @instance - */ - FieldOptions.prototype[".gogoproto.castrepeated"] = ""; - - /** - * Creates a new FieldOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions=} [properties] Properties to set - * @returns {google.protobuf.FieldOptions} FieldOptions instance - */ - FieldOptions.create = function create(properties) { - return new FieldOptions(properties); - }; - - /** - * Encodes the specified FieldOptions message. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.ctype != null && Object.hasOwnProperty.call(message, "ctype")) - writer.uint32(/* id 1, wireType 0 =*/8).int32(message.ctype); - if (message.packed != null && Object.hasOwnProperty.call(message, "packed")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.packed); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.lazy != null && Object.hasOwnProperty.call(message, "lazy")) - writer.uint32(/* id 5, wireType 0 =*/40).bool(message.lazy); - if (message.jstype != null && Object.hasOwnProperty.call(message, "jstype")) - writer.uint32(/* id 6, wireType 0 =*/48).int32(message.jstype); - if (message.weak != null && Object.hasOwnProperty.call(message, "weak")) - writer.uint32(/* id 10, wireType 0 =*/80).bool(message.weak); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".gogoproto.nullable"] != null && Object.hasOwnProperty.call(message, ".gogoproto.nullable")) - writer.uint32(/* id 65001, wireType 0 =*/520008).bool(message[".gogoproto.nullable"]); - if (message[".gogoproto.embed"] != null && Object.hasOwnProperty.call(message, ".gogoproto.embed")) - writer.uint32(/* id 65002, wireType 0 =*/520016).bool(message[".gogoproto.embed"]); - if (message[".gogoproto.customtype"] != null && Object.hasOwnProperty.call(message, ".gogoproto.customtype")) - writer.uint32(/* id 65003, wireType 2 =*/520026).string(message[".gogoproto.customtype"]); - if (message[".gogoproto.customname"] != null && Object.hasOwnProperty.call(message, ".gogoproto.customname")) - writer.uint32(/* id 65004, wireType 2 =*/520034).string(message[".gogoproto.customname"]); - if (message[".gogoproto.jsontag"] != null && Object.hasOwnProperty.call(message, ".gogoproto.jsontag")) - writer.uint32(/* id 65005, wireType 2 =*/520042).string(message[".gogoproto.jsontag"]); - if (message[".gogoproto.moretags"] != null && Object.hasOwnProperty.call(message, ".gogoproto.moretags")) - writer.uint32(/* id 65006, wireType 2 =*/520050).string(message[".gogoproto.moretags"]); - if (message[".gogoproto.casttype"] != null && Object.hasOwnProperty.call(message, ".gogoproto.casttype")) - writer.uint32(/* id 65007, wireType 2 =*/520058).string(message[".gogoproto.casttype"]); - if (message[".gogoproto.castkey"] != null && Object.hasOwnProperty.call(message, ".gogoproto.castkey")) - writer.uint32(/* id 65008, wireType 2 =*/520066).string(message[".gogoproto.castkey"]); - if (message[".gogoproto.castvalue"] != null && Object.hasOwnProperty.call(message, ".gogoproto.castvalue")) - writer.uint32(/* id 65009, wireType 2 =*/520074).string(message[".gogoproto.castvalue"]); - if (message[".gogoproto.stdtime"] != null && Object.hasOwnProperty.call(message, ".gogoproto.stdtime")) - writer.uint32(/* id 65010, wireType 0 =*/520080).bool(message[".gogoproto.stdtime"]); - if (message[".gogoproto.stdduration"] != null && Object.hasOwnProperty.call(message, ".gogoproto.stdduration")) - writer.uint32(/* id 65011, wireType 0 =*/520088).bool(message[".gogoproto.stdduration"]); - if (message[".gogoproto.wktpointer"] != null && Object.hasOwnProperty.call(message, ".gogoproto.wktpointer")) - writer.uint32(/* id 65012, wireType 0 =*/520096).bool(message[".gogoproto.wktpointer"]); - if (message[".gogoproto.castrepeated"] != null && Object.hasOwnProperty.call(message, ".gogoproto.castrepeated")) - writer.uint32(/* id 65013, wireType 2 =*/520106).string(message[".gogoproto.castrepeated"]); - return writer; - }; - - /** - * Encodes the specified FieldOptions message, length delimited. Does not implicitly {@link google.protobuf.FieldOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.IFieldOptions} message FieldOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - FieldOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a FieldOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.FieldOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.FieldOptions} FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldOptions.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.google.protobuf.FieldOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.ctype = reader.int32(); - break; - case 2: - message.packed = reader.bool(); - break; - case 6: - message.jstype = reader.int32(); - break; - case 5: - message.lazy = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 10: - message.weak = reader.bool(); - break; - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - case 65001: - message[".gogoproto.nullable"] = reader.bool(); - break; - case 65002: - message[".gogoproto.embed"] = reader.bool(); - break; - case 65003: - message[".gogoproto.customtype"] = reader.string(); - break; - case 65004: - message[".gogoproto.customname"] = reader.string(); - break; - case 65005: - message[".gogoproto.jsontag"] = reader.string(); - break; - case 65006: - message[".gogoproto.moretags"] = reader.string(); - break; - case 65007: - message[".gogoproto.casttype"] = reader.string(); - break; - case 65008: - message[".gogoproto.castkey"] = reader.string(); - break; - case 65009: - message[".gogoproto.castvalue"] = reader.string(); - break; - case 65010: - message[".gogoproto.stdtime"] = reader.bool(); - break; - case 65011: - message[".gogoproto.stdduration"] = reader.bool(); - break; - case 65012: - message[".gogoproto.wktpointer"] = reader.bool(); - break; - case 65013: - message[".gogoproto.castrepeated"] = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a FieldOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.FieldOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.FieldOptions} FieldOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - FieldOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a FieldOptions message. - * @function verify - * @memberof google.protobuf.FieldOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - FieldOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.ctype != null && message.hasOwnProperty("ctype")) - switch (message.ctype) { - default: - return "ctype: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.packed != null && message.hasOwnProperty("packed")) - if (typeof message.packed !== "boolean") - return "packed: boolean expected"; - if (message.jstype != null && message.hasOwnProperty("jstype")) - switch (message.jstype) { - default: - return "jstype: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.lazy != null && message.hasOwnProperty("lazy")) - if (typeof message.lazy !== "boolean") - return "lazy: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.weak != null && message.hasOwnProperty("weak")) - if (typeof message.weak !== "boolean") - return "weak: boolean expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".gogoproto.nullable"] != null && message.hasOwnProperty(".gogoproto.nullable")) - if (typeof message[".gogoproto.nullable"] !== "boolean") - return ".gogoproto.nullable: boolean expected"; - if (message[".gogoproto.embed"] != null && message.hasOwnProperty(".gogoproto.embed")) - if (typeof message[".gogoproto.embed"] !== "boolean") - return ".gogoproto.embed: boolean expected"; - if (message[".gogoproto.customtype"] != null && message.hasOwnProperty(".gogoproto.customtype")) - if (!$util.isString(message[".gogoproto.customtype"])) - return ".gogoproto.customtype: string expected"; - if (message[".gogoproto.customname"] != null && message.hasOwnProperty(".gogoproto.customname")) - if (!$util.isString(message[".gogoproto.customname"])) - return ".gogoproto.customname: string expected"; - if (message[".gogoproto.jsontag"] != null && message.hasOwnProperty(".gogoproto.jsontag")) - if (!$util.isString(message[".gogoproto.jsontag"])) - return ".gogoproto.jsontag: string expected"; - if (message[".gogoproto.moretags"] != null && message.hasOwnProperty(".gogoproto.moretags")) - if (!$util.isString(message[".gogoproto.moretags"])) - return ".gogoproto.moretags: string expected"; - if (message[".gogoproto.casttype"] != null && message.hasOwnProperty(".gogoproto.casttype")) - if (!$util.isString(message[".gogoproto.casttype"])) - return ".gogoproto.casttype: string expected"; - if (message[".gogoproto.castkey"] != null && message.hasOwnProperty(".gogoproto.castkey")) - if (!$util.isString(message[".gogoproto.castkey"])) - return ".gogoproto.castkey: string expected"; - if (message[".gogoproto.castvalue"] != null && message.hasOwnProperty(".gogoproto.castvalue")) - if (!$util.isString(message[".gogoproto.castvalue"])) - return ".gogoproto.castvalue: string expected"; - if (message[".gogoproto.stdtime"] != null && message.hasOwnProperty(".gogoproto.stdtime")) - if (typeof message[".gogoproto.stdtime"] !== "boolean") - return ".gogoproto.stdtime: boolean expected"; - if (message[".gogoproto.stdduration"] != null && message.hasOwnProperty(".gogoproto.stdduration")) - if (typeof message[".gogoproto.stdduration"] !== "boolean") - return ".gogoproto.stdduration: boolean expected"; - if (message[".gogoproto.wktpointer"] != null && message.hasOwnProperty(".gogoproto.wktpointer")) - if (typeof message[".gogoproto.wktpointer"] !== "boolean") - return ".gogoproto.wktpointer: boolean expected"; - if (message[".gogoproto.castrepeated"] != null && message.hasOwnProperty(".gogoproto.castrepeated")) - if (!$util.isString(message[".gogoproto.castrepeated"])) - return ".gogoproto.castrepeated: string expected"; - return null; - }; - - /** - * Creates a FieldOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.FieldOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.FieldOptions} FieldOptions - */ - FieldOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.FieldOptions) - return object; - var message = new $root.google.protobuf.FieldOptions(); - switch (object.ctype) { - case "STRING": - case 0: - message.ctype = 0; - break; - case "CORD": - case 1: - message.ctype = 1; - break; - case "STRING_PIECE": - case 2: - message.ctype = 2; - break; - } - if (object.packed != null) - message.packed = Boolean(object.packed); - switch (object.jstype) { - case "JS_NORMAL": - case 0: - message.jstype = 0; - break; - case "JS_STRING": - case 1: - message.jstype = 1; - break; - case "JS_NUMBER": - case 2: - message.jstype = 2; - break; - } - if (object.lazy != null) - message.lazy = Boolean(object.lazy); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.weak != null) - message.weak = Boolean(object.weak); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.FieldOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".gogoproto.nullable"] != null) - message[".gogoproto.nullable"] = Boolean(object[".gogoproto.nullable"]); - if (object[".gogoproto.embed"] != null) - message[".gogoproto.embed"] = Boolean(object[".gogoproto.embed"]); - if (object[".gogoproto.customtype"] != null) - message[".gogoproto.customtype"] = String(object[".gogoproto.customtype"]); - if (object[".gogoproto.customname"] != null) - message[".gogoproto.customname"] = String(object[".gogoproto.customname"]); - if (object[".gogoproto.jsontag"] != null) - message[".gogoproto.jsontag"] = String(object[".gogoproto.jsontag"]); - if (object[".gogoproto.moretags"] != null) - message[".gogoproto.moretags"] = String(object[".gogoproto.moretags"]); - if (object[".gogoproto.casttype"] != null) - message[".gogoproto.casttype"] = String(object[".gogoproto.casttype"]); - if (object[".gogoproto.castkey"] != null) - message[".gogoproto.castkey"] = String(object[".gogoproto.castkey"]); - if (object[".gogoproto.castvalue"] != null) - message[".gogoproto.castvalue"] = String(object[".gogoproto.castvalue"]); - if (object[".gogoproto.stdtime"] != null) - message[".gogoproto.stdtime"] = Boolean(object[".gogoproto.stdtime"]); - if (object[".gogoproto.stdduration"] != null) - message[".gogoproto.stdduration"] = Boolean(object[".gogoproto.stdduration"]); - if (object[".gogoproto.wktpointer"] != null) - message[".gogoproto.wktpointer"] = Boolean(object[".gogoproto.wktpointer"]); - if (object[".gogoproto.castrepeated"] != null) - message[".gogoproto.castrepeated"] = String(object[".gogoproto.castrepeated"]); - return message; - }; - - /** - * Creates a plain object from a FieldOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.FieldOptions - * @static - * @param {google.protobuf.FieldOptions} message FieldOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - FieldOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.ctype = options.enums === String ? "STRING" : 0; - object.packed = false; - object.deprecated = false; - object.lazy = false; - object.jstype = options.enums === String ? "JS_NORMAL" : 0; - object.weak = false; - object[".gogoproto.nullable"] = false; - object[".gogoproto.embed"] = false; - object[".gogoproto.customtype"] = ""; - object[".gogoproto.customname"] = ""; - object[".gogoproto.jsontag"] = ""; - object[".gogoproto.moretags"] = ""; - object[".gogoproto.casttype"] = ""; - object[".gogoproto.castkey"] = ""; - object[".gogoproto.castvalue"] = ""; - object[".gogoproto.stdtime"] = false; - object[".gogoproto.stdduration"] = false; - object[".gogoproto.wktpointer"] = false; - object[".gogoproto.castrepeated"] = ""; - } - if (message.ctype != null && message.hasOwnProperty("ctype")) - object.ctype = options.enums === String ? $root.google.protobuf.FieldOptions.CType[message.ctype] : message.ctype; - if (message.packed != null && message.hasOwnProperty("packed")) - object.packed = message.packed; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.lazy != null && message.hasOwnProperty("lazy")) - object.lazy = message.lazy; - if (message.jstype != null && message.hasOwnProperty("jstype")) - object.jstype = options.enums === String ? $root.google.protobuf.FieldOptions.JSType[message.jstype] : message.jstype; - if (message.weak != null && message.hasOwnProperty("weak")) - object.weak = message.weak; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".gogoproto.nullable"] != null && message.hasOwnProperty(".gogoproto.nullable")) - object[".gogoproto.nullable"] = message[".gogoproto.nullable"]; - if (message[".gogoproto.embed"] != null && message.hasOwnProperty(".gogoproto.embed")) - object[".gogoproto.embed"] = message[".gogoproto.embed"]; - if (message[".gogoproto.customtype"] != null && message.hasOwnProperty(".gogoproto.customtype")) - object[".gogoproto.customtype"] = message[".gogoproto.customtype"]; - if (message[".gogoproto.customname"] != null && message.hasOwnProperty(".gogoproto.customname")) - object[".gogoproto.customname"] = message[".gogoproto.customname"]; - if (message[".gogoproto.jsontag"] != null && message.hasOwnProperty(".gogoproto.jsontag")) - object[".gogoproto.jsontag"] = message[".gogoproto.jsontag"]; - if (message[".gogoproto.moretags"] != null && message.hasOwnProperty(".gogoproto.moretags")) - object[".gogoproto.moretags"] = message[".gogoproto.moretags"]; - if (message[".gogoproto.casttype"] != null && message.hasOwnProperty(".gogoproto.casttype")) - object[".gogoproto.casttype"] = message[".gogoproto.casttype"]; - if (message[".gogoproto.castkey"] != null && message.hasOwnProperty(".gogoproto.castkey")) - object[".gogoproto.castkey"] = message[".gogoproto.castkey"]; - if (message[".gogoproto.castvalue"] != null && message.hasOwnProperty(".gogoproto.castvalue")) - object[".gogoproto.castvalue"] = message[".gogoproto.castvalue"]; - if (message[".gogoproto.stdtime"] != null && message.hasOwnProperty(".gogoproto.stdtime")) - object[".gogoproto.stdtime"] = message[".gogoproto.stdtime"]; - if (message[".gogoproto.stdduration"] != null && message.hasOwnProperty(".gogoproto.stdduration")) - object[".gogoproto.stdduration"] = message[".gogoproto.stdduration"]; - if (message[".gogoproto.wktpointer"] != null && message.hasOwnProperty(".gogoproto.wktpointer")) - object[".gogoproto.wktpointer"] = message[".gogoproto.wktpointer"]; - if (message[".gogoproto.castrepeated"] != null && message.hasOwnProperty(".gogoproto.castrepeated")) - object[".gogoproto.castrepeated"] = message[".gogoproto.castrepeated"]; - return object; - }; - - /** - * Converts this FieldOptions to JSON. - * @function toJSON - * @memberof google.protobuf.FieldOptions - * @instance - * @returns {Object.} JSON object - */ - FieldOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * CType enum. - * @name google.protobuf.FieldOptions.CType - * @enum {number} - * @property {number} STRING=0 STRING value - * @property {number} CORD=1 CORD value - * @property {number} STRING_PIECE=2 STRING_PIECE value - */ - FieldOptions.CType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "STRING"] = 0; - values[valuesById[1] = "CORD"] = 1; - values[valuesById[2] = "STRING_PIECE"] = 2; - return values; - })(); - - /** - * JSType enum. - * @name google.protobuf.FieldOptions.JSType - * @enum {number} - * @property {number} JS_NORMAL=0 JS_NORMAL value - * @property {number} JS_STRING=1 JS_STRING value - * @property {number} JS_NUMBER=2 JS_NUMBER value - */ - FieldOptions.JSType = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "JS_NORMAL"] = 0; - values[valuesById[1] = "JS_STRING"] = 1; - values[valuesById[2] = "JS_NUMBER"] = 2; - return values; - })(); - - return FieldOptions; - })(); - - protobuf.OneofOptions = (function() { - - /** - * Properties of an OneofOptions. - * @memberof google.protobuf - * @interface IOneofOptions - * @property {Array.|null} [uninterpretedOption] OneofOptions uninterpretedOption - */ - - /** - * Constructs a new OneofOptions. - * @memberof google.protobuf - * @classdesc Represents an OneofOptions. - * @implements IOneofOptions - * @constructor - * @param {google.protobuf.IOneofOptions=} [properties] Properties to set - */ - function OneofOptions(properties) { - this.uninterpretedOption = []; - 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]]; - } - - /** - * OneofOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.OneofOptions - * @instance - */ - OneofOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * Creates a new OneofOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions=} [properties] Properties to set - * @returns {google.protobuf.OneofOptions} OneofOptions instance - */ - OneofOptions.create = function create(properties) { - return new OneofOptions(properties); - }; - - /** - * Encodes the specified OneofOptions message. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified OneofOptions message, length delimited. Does not implicitly {@link google.protobuf.OneofOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.IOneofOptions} message OneofOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OneofOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OneofOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.OneofOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.OneofOptions} OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofOptions.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.google.protobuf.OneofOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OneofOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.OneofOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.OneofOptions} OneofOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OneofOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OneofOptions message. - * @function verify - * @memberof google.protobuf.OneofOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OneofOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; - - /** - * Creates an OneofOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.OneofOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.OneofOptions} OneofOptions - */ - OneofOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.OneofOptions) - return object; - var message = new $root.google.protobuf.OneofOptions(); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.OneofOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an OneofOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.OneofOptions - * @static - * @param {google.protobuf.OneofOptions} message OneofOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OneofOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this OneofOptions to JSON. - * @function toJSON - * @memberof google.protobuf.OneofOptions - * @instance - * @returns {Object.} JSON object - */ - OneofOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return OneofOptions; - })(); - - protobuf.EnumOptions = (function() { - - /** - * Properties of an EnumOptions. - * @memberof google.protobuf - * @interface IEnumOptions - * @property {boolean|null} [allowAlias] EnumOptions allowAlias - * @property {boolean|null} [deprecated] EnumOptions deprecated - * @property {Array.|null} [uninterpretedOption] EnumOptions uninterpretedOption - * @property {boolean|null} [".gogoproto.goprotoEnumPrefix"] EnumOptions .gogoproto.goprotoEnumPrefix - * @property {boolean|null} [".gogoproto.goprotoEnumStringer"] EnumOptions .gogoproto.goprotoEnumStringer - * @property {boolean|null} [".gogoproto.enumStringer"] EnumOptions .gogoproto.enumStringer - * @property {string|null} [".gogoproto.enumCustomname"] EnumOptions .gogoproto.enumCustomname - * @property {boolean|null} [".gogoproto.enumdecl"] EnumOptions .gogoproto.enumdecl - */ - - /** - * Constructs a new EnumOptions. - * @memberof google.protobuf - * @classdesc Represents an EnumOptions. - * @implements IEnumOptions - * @constructor - * @param {google.protobuf.IEnumOptions=} [properties] Properties to set - */ - function EnumOptions(properties) { - this.uninterpretedOption = []; - 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]]; - } - - /** - * EnumOptions allowAlias. - * @member {boolean} allowAlias - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.allowAlias = false; - - /** - * EnumOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.deprecated = false; - - /** - * EnumOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * EnumOptions .gogoproto.goprotoEnumPrefix. - * @member {boolean} .gogoproto.goprotoEnumPrefix - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype[".gogoproto.goprotoEnumPrefix"] = false; - - /** - * EnumOptions .gogoproto.goprotoEnumStringer. - * @member {boolean} .gogoproto.goprotoEnumStringer - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype[".gogoproto.goprotoEnumStringer"] = false; - - /** - * EnumOptions .gogoproto.enumStringer. - * @member {boolean} .gogoproto.enumStringer - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype[".gogoproto.enumStringer"] = false; - - /** - * EnumOptions .gogoproto.enumCustomname. - * @member {string} .gogoproto.enumCustomname - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype[".gogoproto.enumCustomname"] = ""; - - /** - * EnumOptions .gogoproto.enumdecl. - * @member {boolean} .gogoproto.enumdecl - * @memberof google.protobuf.EnumOptions - * @instance - */ - EnumOptions.prototype[".gogoproto.enumdecl"] = false; - - /** - * Creates a new EnumOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions=} [properties] Properties to set - * @returns {google.protobuf.EnumOptions} EnumOptions instance - */ - EnumOptions.create = function create(properties) { - return new EnumOptions(properties); - }; - - /** - * Encodes the specified EnumOptions message. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.allowAlias != null && Object.hasOwnProperty.call(message, "allowAlias")) - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.allowAlias); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.deprecated); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".gogoproto.goprotoEnumPrefix"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goprotoEnumPrefix")) - writer.uint32(/* id 62001, wireType 0 =*/496008).bool(message[".gogoproto.goprotoEnumPrefix"]); - if (message[".gogoproto.goprotoEnumStringer"] != null && Object.hasOwnProperty.call(message, ".gogoproto.goprotoEnumStringer")) - writer.uint32(/* id 62021, wireType 0 =*/496168).bool(message[".gogoproto.goprotoEnumStringer"]); - if (message[".gogoproto.enumStringer"] != null && Object.hasOwnProperty.call(message, ".gogoproto.enumStringer")) - writer.uint32(/* id 62022, wireType 0 =*/496176).bool(message[".gogoproto.enumStringer"]); - if (message[".gogoproto.enumCustomname"] != null && Object.hasOwnProperty.call(message, ".gogoproto.enumCustomname")) - writer.uint32(/* id 62023, wireType 2 =*/496186).string(message[".gogoproto.enumCustomname"]); - if (message[".gogoproto.enumdecl"] != null && Object.hasOwnProperty.call(message, ".gogoproto.enumdecl")) - writer.uint32(/* id 62024, wireType 0 =*/496192).bool(message[".gogoproto.enumdecl"]); - return writer; - }; - - /** - * Encodes the specified EnumOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.IEnumOptions} message EnumOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumOptions} EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumOptions.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.google.protobuf.EnumOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - message.allowAlias = reader.bool(); - break; - case 3: - message.deprecated = reader.bool(); - break; - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - case 62001: - message[".gogoproto.goprotoEnumPrefix"] = reader.bool(); - break; - case 62021: - message[".gogoproto.goprotoEnumStringer"] = reader.bool(); - break; - case 62022: - message[".gogoproto.enumStringer"] = reader.bool(); - break; - case 62023: - message[".gogoproto.enumCustomname"] = reader.string(); - break; - case 62024: - message[".gogoproto.enumdecl"] = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumOptions} EnumOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumOptions message. - * @function verify - * @memberof google.protobuf.EnumOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) - if (typeof message.allowAlias !== "boolean") - return "allowAlias: boolean expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".gogoproto.goprotoEnumPrefix"] != null && message.hasOwnProperty(".gogoproto.goprotoEnumPrefix")) - if (typeof message[".gogoproto.goprotoEnumPrefix"] !== "boolean") - return ".gogoproto.goprotoEnumPrefix: boolean expected"; - if (message[".gogoproto.goprotoEnumStringer"] != null && message.hasOwnProperty(".gogoproto.goprotoEnumStringer")) - if (typeof message[".gogoproto.goprotoEnumStringer"] !== "boolean") - return ".gogoproto.goprotoEnumStringer: boolean expected"; - if (message[".gogoproto.enumStringer"] != null && message.hasOwnProperty(".gogoproto.enumStringer")) - if (typeof message[".gogoproto.enumStringer"] !== "boolean") - return ".gogoproto.enumStringer: boolean expected"; - if (message[".gogoproto.enumCustomname"] != null && message.hasOwnProperty(".gogoproto.enumCustomname")) - if (!$util.isString(message[".gogoproto.enumCustomname"])) - return ".gogoproto.enumCustomname: string expected"; - if (message[".gogoproto.enumdecl"] != null && message.hasOwnProperty(".gogoproto.enumdecl")) - if (typeof message[".gogoproto.enumdecl"] !== "boolean") - return ".gogoproto.enumdecl: boolean expected"; - return null; - }; - - /** - * Creates an EnumOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumOptions} EnumOptions - */ - EnumOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumOptions) - return object; - var message = new $root.google.protobuf.EnumOptions(); - if (object.allowAlias != null) - message.allowAlias = Boolean(object.allowAlias); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.EnumOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".gogoproto.goprotoEnumPrefix"] != null) - message[".gogoproto.goprotoEnumPrefix"] = Boolean(object[".gogoproto.goprotoEnumPrefix"]); - if (object[".gogoproto.goprotoEnumStringer"] != null) - message[".gogoproto.goprotoEnumStringer"] = Boolean(object[".gogoproto.goprotoEnumStringer"]); - if (object[".gogoproto.enumStringer"] != null) - message[".gogoproto.enumStringer"] = Boolean(object[".gogoproto.enumStringer"]); - if (object[".gogoproto.enumCustomname"] != null) - message[".gogoproto.enumCustomname"] = String(object[".gogoproto.enumCustomname"]); - if (object[".gogoproto.enumdecl"] != null) - message[".gogoproto.enumdecl"] = Boolean(object[".gogoproto.enumdecl"]); - return message; - }; - - /** - * Creates a plain object from an EnumOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumOptions - * @static - * @param {google.protobuf.EnumOptions} message EnumOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.allowAlias = false; - object.deprecated = false; - object[".gogoproto.goprotoEnumPrefix"] = false; - object[".gogoproto.goprotoEnumStringer"] = false; - object[".gogoproto.enumStringer"] = false; - object[".gogoproto.enumCustomname"] = ""; - object[".gogoproto.enumdecl"] = false; - } - if (message.allowAlias != null && message.hasOwnProperty("allowAlias")) - object.allowAlias = message.allowAlias; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".gogoproto.goprotoEnumPrefix"] != null && message.hasOwnProperty(".gogoproto.goprotoEnumPrefix")) - object[".gogoproto.goprotoEnumPrefix"] = message[".gogoproto.goprotoEnumPrefix"]; - if (message[".gogoproto.goprotoEnumStringer"] != null && message.hasOwnProperty(".gogoproto.goprotoEnumStringer")) - object[".gogoproto.goprotoEnumStringer"] = message[".gogoproto.goprotoEnumStringer"]; - if (message[".gogoproto.enumStringer"] != null && message.hasOwnProperty(".gogoproto.enumStringer")) - object[".gogoproto.enumStringer"] = message[".gogoproto.enumStringer"]; - if (message[".gogoproto.enumCustomname"] != null && message.hasOwnProperty(".gogoproto.enumCustomname")) - object[".gogoproto.enumCustomname"] = message[".gogoproto.enumCustomname"]; - if (message[".gogoproto.enumdecl"] != null && message.hasOwnProperty(".gogoproto.enumdecl")) - object[".gogoproto.enumdecl"] = message[".gogoproto.enumdecl"]; - return object; - }; - - /** - * Converts this EnumOptions to JSON. - * @function toJSON - * @memberof google.protobuf.EnumOptions - * @instance - * @returns {Object.} JSON object - */ - EnumOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return EnumOptions; - })(); - - protobuf.EnumValueOptions = (function() { - - /** - * Properties of an EnumValueOptions. - * @memberof google.protobuf - * @interface IEnumValueOptions - * @property {boolean|null} [deprecated] EnumValueOptions deprecated - * @property {Array.|null} [uninterpretedOption] EnumValueOptions uninterpretedOption - * @property {string|null} [".gogoproto.enumvalueCustomname"] EnumValueOptions .gogoproto.enumvalueCustomname - */ - - /** - * Constructs a new EnumValueOptions. - * @memberof google.protobuf - * @classdesc Represents an EnumValueOptions. - * @implements IEnumValueOptions - * @constructor - * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set - */ - function EnumValueOptions(properties) { - this.uninterpretedOption = []; - 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]]; - } - - /** - * EnumValueOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.deprecated = false; - - /** - * EnumValueOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * EnumValueOptions .gogoproto.enumvalueCustomname. - * @member {string} .gogoproto.enumvalueCustomname - * @memberof google.protobuf.EnumValueOptions - * @instance - */ - EnumValueOptions.prototype[".gogoproto.enumvalueCustomname"] = ""; - - /** - * Creates a new EnumValueOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions=} [properties] Properties to set - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions instance - */ - EnumValueOptions.create = function create(properties) { - return new EnumValueOptions(properties); - }; - - /** - * Encodes the specified EnumValueOptions message. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 1, wireType 0 =*/8).bool(message.deprecated); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - if (message[".gogoproto.enumvalueCustomname"] != null && Object.hasOwnProperty.call(message, ".gogoproto.enumvalueCustomname")) - writer.uint32(/* id 66001, wireType 2 =*/528010).string(message[".gogoproto.enumvalueCustomname"]); - return writer; - }; - - /** - * Encodes the specified EnumValueOptions message, length delimited. Does not implicitly {@link google.protobuf.EnumValueOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.IEnumValueOptions} message EnumValueOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - EnumValueOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueOptions.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.google.protobuf.EnumValueOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.deprecated = reader.bool(); - break; - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - case 66001: - message[".gogoproto.enumvalueCustomname"] = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an EnumValueOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - EnumValueOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an EnumValueOptions message. - * @function verify - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - EnumValueOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - if (message[".gogoproto.enumvalueCustomname"] != null && message.hasOwnProperty(".gogoproto.enumvalueCustomname")) - if (!$util.isString(message[".gogoproto.enumvalueCustomname"])) - return ".gogoproto.enumvalueCustomname: string expected"; - return null; - }; - - /** - * Creates an EnumValueOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.EnumValueOptions} EnumValueOptions - */ - EnumValueOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.EnumValueOptions) - return object; - var message = new $root.google.protobuf.EnumValueOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.EnumValueOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - if (object[".gogoproto.enumvalueCustomname"] != null) - message[".gogoproto.enumvalueCustomname"] = String(object[".gogoproto.enumvalueCustomname"]); - return message; - }; - - /** - * Creates a plain object from an EnumValueOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.EnumValueOptions - * @static - * @param {google.protobuf.EnumValueOptions} message EnumValueOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - EnumValueOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.deprecated = false; - object[".gogoproto.enumvalueCustomname"] = ""; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - if (message[".gogoproto.enumvalueCustomname"] != null && message.hasOwnProperty(".gogoproto.enumvalueCustomname")) - object[".gogoproto.enumvalueCustomname"] = message[".gogoproto.enumvalueCustomname"]; - return object; - }; - - /** - * Converts this EnumValueOptions to JSON. - * @function toJSON - * @memberof google.protobuf.EnumValueOptions - * @instance - * @returns {Object.} JSON object - */ - EnumValueOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return EnumValueOptions; - })(); - - protobuf.ServiceOptions = (function() { - - /** - * Properties of a ServiceOptions. - * @memberof google.protobuf - * @interface IServiceOptions - * @property {boolean|null} [deprecated] ServiceOptions deprecated - * @property {Array.|null} [uninterpretedOption] ServiceOptions uninterpretedOption - */ - - /** - * Constructs a new ServiceOptions. - * @memberof google.protobuf - * @classdesc Represents a ServiceOptions. - * @implements IServiceOptions - * @constructor - * @param {google.protobuf.IServiceOptions=} [properties] Properties to set - */ - function ServiceOptions(properties) { - this.uninterpretedOption = []; - 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]]; - } - - /** - * ServiceOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.deprecated = false; - - /** - * ServiceOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.ServiceOptions - * @instance - */ - ServiceOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * Creates a new ServiceOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions=} [properties] Properties to set - * @returns {google.protobuf.ServiceOptions} ServiceOptions instance - */ - ServiceOptions.create = function create(properties) { - return new ServiceOptions(properties); - }; - - /** - * Encodes the specified ServiceOptions message. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified ServiceOptions message, length delimited. Does not implicitly {@link google.protobuf.ServiceOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.IServiceOptions} message ServiceOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ServiceOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.ServiceOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.ServiceOptions} ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceOptions.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.google.protobuf.ServiceOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ServiceOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.ServiceOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.ServiceOptions} ServiceOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ServiceOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ServiceOptions message. - * @function verify - * @memberof google.protobuf.ServiceOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ServiceOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; - - /** - * Creates a ServiceOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.ServiceOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.ServiceOptions} ServiceOptions - */ - ServiceOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.ServiceOptions) - return object; - var message = new $root.google.protobuf.ServiceOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.ServiceOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a ServiceOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.ServiceOptions - * @static - * @param {google.protobuf.ServiceOptions} message ServiceOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ServiceOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) - object.deprecated = false; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this ServiceOptions to JSON. - * @function toJSON - * @memberof google.protobuf.ServiceOptions - * @instance - * @returns {Object.} JSON object - */ - ServiceOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ServiceOptions; - })(); - - protobuf.MethodOptions = (function() { - - /** - * Properties of a MethodOptions. - * @memberof google.protobuf - * @interface IMethodOptions - * @property {boolean|null} [deprecated] MethodOptions deprecated - * @property {google.protobuf.MethodOptions.IdempotencyLevel|null} [idempotencyLevel] MethodOptions idempotencyLevel - * @property {Array.|null} [uninterpretedOption] MethodOptions uninterpretedOption - */ - - /** - * Constructs a new MethodOptions. - * @memberof google.protobuf - * @classdesc Represents a MethodOptions. - * @implements IMethodOptions - * @constructor - * @param {google.protobuf.IMethodOptions=} [properties] Properties to set - */ - function MethodOptions(properties) { - this.uninterpretedOption = []; - 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]]; - } - - /** - * MethodOptions deprecated. - * @member {boolean} deprecated - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.deprecated = false; - - /** - * MethodOptions idempotencyLevel. - * @member {google.protobuf.MethodOptions.IdempotencyLevel} idempotencyLevel - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.idempotencyLevel = 0; - - /** - * MethodOptions uninterpretedOption. - * @member {Array.} uninterpretedOption - * @memberof google.protobuf.MethodOptions - * @instance - */ - MethodOptions.prototype.uninterpretedOption = $util.emptyArray; - - /** - * Creates a new MethodOptions instance using the specified properties. - * @function create - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.IMethodOptions=} [properties] Properties to set - * @returns {google.protobuf.MethodOptions} MethodOptions instance - */ - MethodOptions.create = function create(properties) { - return new MethodOptions(properties); - }; - - /** - * Encodes the specified MethodOptions message. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @function encode - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodOptions.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.deprecated != null && Object.hasOwnProperty.call(message, "deprecated")) - writer.uint32(/* id 33, wireType 0 =*/264).bool(message.deprecated); - if (message.idempotencyLevel != null && Object.hasOwnProperty.call(message, "idempotencyLevel")) - writer.uint32(/* id 34, wireType 0 =*/272).int32(message.idempotencyLevel); - if (message.uninterpretedOption != null && message.uninterpretedOption.length) - for (var i = 0; i < message.uninterpretedOption.length; ++i) - $root.google.protobuf.UninterpretedOption.encode(message.uninterpretedOption[i], writer.uint32(/* id 999, wireType 2 =*/7994).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MethodOptions message, length delimited. Does not implicitly {@link google.protobuf.MethodOptions.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.IMethodOptions} message MethodOptions message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MethodOptions.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MethodOptions message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.MethodOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.MethodOptions} MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodOptions.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.google.protobuf.MethodOptions(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 33: - message.deprecated = reader.bool(); - break; - case 34: - message.idempotencyLevel = reader.int32(); - break; - case 999: - if (!(message.uninterpretedOption && message.uninterpretedOption.length)) - message.uninterpretedOption = []; - message.uninterpretedOption.push($root.google.protobuf.UninterpretedOption.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MethodOptions message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.MethodOptions - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.MethodOptions} MethodOptions - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MethodOptions.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MethodOptions message. - * @function verify - * @memberof google.protobuf.MethodOptions - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MethodOptions.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - if (typeof message.deprecated !== "boolean") - return "deprecated: boolean expected"; - if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) - switch (message.idempotencyLevel) { - default: - return "idempotencyLevel: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.uninterpretedOption != null && message.hasOwnProperty("uninterpretedOption")) { - if (!Array.isArray(message.uninterpretedOption)) - return "uninterpretedOption: array expected"; - for (var i = 0; i < message.uninterpretedOption.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.verify(message.uninterpretedOption[i]); - if (error) - return "uninterpretedOption." + error; - } - } - return null; - }; - - /** - * Creates a MethodOptions message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.MethodOptions - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.MethodOptions} MethodOptions - */ - MethodOptions.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.MethodOptions) - return object; - var message = new $root.google.protobuf.MethodOptions(); - if (object.deprecated != null) - message.deprecated = Boolean(object.deprecated); - switch (object.idempotencyLevel) { - case "IDEMPOTENCY_UNKNOWN": - case 0: - message.idempotencyLevel = 0; - break; - case "NO_SIDE_EFFECTS": - case 1: - message.idempotencyLevel = 1; - break; - case "IDEMPOTENT": - case 2: - message.idempotencyLevel = 2; - break; - } - if (object.uninterpretedOption) { - if (!Array.isArray(object.uninterpretedOption)) - throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: array expected"); - message.uninterpretedOption = []; - for (var i = 0; i < object.uninterpretedOption.length; ++i) { - if (typeof object.uninterpretedOption[i] !== "object") - throw TypeError(".google.protobuf.MethodOptions.uninterpretedOption: object expected"); - message.uninterpretedOption[i] = $root.google.protobuf.UninterpretedOption.fromObject(object.uninterpretedOption[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a MethodOptions message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.MethodOptions - * @static - * @param {google.protobuf.MethodOptions} message MethodOptions - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MethodOptions.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.uninterpretedOption = []; - if (options.defaults) { - object.deprecated = false; - object.idempotencyLevel = options.enums === String ? "IDEMPOTENCY_UNKNOWN" : 0; - } - if (message.deprecated != null && message.hasOwnProperty("deprecated")) - object.deprecated = message.deprecated; - if (message.idempotencyLevel != null && message.hasOwnProperty("idempotencyLevel")) - object.idempotencyLevel = options.enums === String ? $root.google.protobuf.MethodOptions.IdempotencyLevel[message.idempotencyLevel] : message.idempotencyLevel; - if (message.uninterpretedOption && message.uninterpretedOption.length) { - object.uninterpretedOption = []; - for (var j = 0; j < message.uninterpretedOption.length; ++j) - object.uninterpretedOption[j] = $root.google.protobuf.UninterpretedOption.toObject(message.uninterpretedOption[j], options); - } - return object; - }; - - /** - * Converts this MethodOptions to JSON. - * @function toJSON - * @memberof google.protobuf.MethodOptions - * @instance - * @returns {Object.} JSON object - */ - MethodOptions.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - /** - * IdempotencyLevel enum. - * @name google.protobuf.MethodOptions.IdempotencyLevel - * @enum {number} - * @property {number} IDEMPOTENCY_UNKNOWN=0 IDEMPOTENCY_UNKNOWN value - * @property {number} NO_SIDE_EFFECTS=1 NO_SIDE_EFFECTS value - * @property {number} IDEMPOTENT=2 IDEMPOTENT value - */ - MethodOptions.IdempotencyLevel = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "IDEMPOTENCY_UNKNOWN"] = 0; - values[valuesById[1] = "NO_SIDE_EFFECTS"] = 1; - values[valuesById[2] = "IDEMPOTENT"] = 2; - return values; - })(); - - return MethodOptions; - })(); - - protobuf.UninterpretedOption = (function() { - - /** - * Properties of an UninterpretedOption. - * @memberof google.protobuf - * @interface IUninterpretedOption - * @property {Array.|null} [name] UninterpretedOption name - * @property {string|null} [identifierValue] UninterpretedOption identifierValue - * @property {number|Long|null} [positiveIntValue] UninterpretedOption positiveIntValue - * @property {number|Long|null} [negativeIntValue] UninterpretedOption negativeIntValue - * @property {number|null} [doubleValue] UninterpretedOption doubleValue - * @property {Uint8Array|null} [stringValue] UninterpretedOption stringValue - * @property {string|null} [aggregateValue] UninterpretedOption aggregateValue - */ - - /** - * Constructs a new UninterpretedOption. - * @memberof google.protobuf - * @classdesc Represents an UninterpretedOption. - * @implements IUninterpretedOption - * @constructor - * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set - */ - function UninterpretedOption(properties) { - this.name = []; - 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]]; - } - - /** - * UninterpretedOption name. - * @member {Array.} name - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.name = $util.emptyArray; - - /** - * UninterpretedOption identifierValue. - * @member {string} identifierValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.identifierValue = ""; - - /** - * UninterpretedOption positiveIntValue. - * @member {number|Long} positiveIntValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.positiveIntValue = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * UninterpretedOption negativeIntValue. - * @member {number|Long} negativeIntValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.negativeIntValue = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * UninterpretedOption doubleValue. - * @member {number} doubleValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.doubleValue = 0; - - /** - * UninterpretedOption stringValue. - * @member {Uint8Array} stringValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.stringValue = $util.newBuffer([]); - - /** - * UninterpretedOption aggregateValue. - * @member {string} aggregateValue - * @memberof google.protobuf.UninterpretedOption - * @instance - */ - UninterpretedOption.prototype.aggregateValue = ""; - - /** - * Creates a new UninterpretedOption instance using the specified properties. - * @function create - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption=} [properties] Properties to set - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption instance - */ - UninterpretedOption.create = function create(properties) { - return new UninterpretedOption(properties); - }; - - /** - * Encodes the specified UninterpretedOption message. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UninterpretedOption.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.name != null && message.name.length) - for (var i = 0; i < message.name.length; ++i) - $root.google.protobuf.UninterpretedOption.NamePart.encode(message.name[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.identifierValue != null && Object.hasOwnProperty.call(message, "identifierValue")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.identifierValue); - if (message.positiveIntValue != null && Object.hasOwnProperty.call(message, "positiveIntValue")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.positiveIntValue); - if (message.negativeIntValue != null && Object.hasOwnProperty.call(message, "negativeIntValue")) - writer.uint32(/* id 5, wireType 0 =*/40).int64(message.negativeIntValue); - if (message.doubleValue != null && Object.hasOwnProperty.call(message, "doubleValue")) - writer.uint32(/* id 6, wireType 1 =*/49).double(message.doubleValue); - if (message.stringValue != null && Object.hasOwnProperty.call(message, "stringValue")) - writer.uint32(/* id 7, wireType 2 =*/58).bytes(message.stringValue); - if (message.aggregateValue != null && Object.hasOwnProperty.call(message, "aggregateValue")) - writer.uint32(/* id 8, wireType 2 =*/66).string(message.aggregateValue); - return writer; - }; - - /** - * Encodes the specified UninterpretedOption message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.IUninterpretedOption} message UninterpretedOption message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - UninterpretedOption.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UninterpretedOption.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.google.protobuf.UninterpretedOption(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 2: - if (!(message.name && message.name.length)) - message.name = []; - message.name.push($root.google.protobuf.UninterpretedOption.NamePart.decode(reader, reader.uint32())); - break; - case 3: - message.identifierValue = reader.string(); - break; - case 4: - message.positiveIntValue = reader.uint64(); - break; - case 5: - message.negativeIntValue = reader.int64(); - break; - case 6: - message.doubleValue = reader.double(); - break; - case 7: - message.stringValue = reader.bytes(); - break; - case 8: - message.aggregateValue = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an UninterpretedOption message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - UninterpretedOption.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an UninterpretedOption message. - * @function verify - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - UninterpretedOption.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.name != null && message.hasOwnProperty("name")) { - if (!Array.isArray(message.name)) - return "name: array expected"; - for (var i = 0; i < message.name.length; ++i) { - var error = $root.google.protobuf.UninterpretedOption.NamePart.verify(message.name[i]); - if (error) - return "name." + error; - } - } - if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) - if (!$util.isString(message.identifierValue)) - return "identifierValue: string expected"; - if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) - if (!$util.isInteger(message.positiveIntValue) && !(message.positiveIntValue && $util.isInteger(message.positiveIntValue.low) && $util.isInteger(message.positiveIntValue.high))) - return "positiveIntValue: integer|Long expected"; - if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) - if (!$util.isInteger(message.negativeIntValue) && !(message.negativeIntValue && $util.isInteger(message.negativeIntValue.low) && $util.isInteger(message.negativeIntValue.high))) - return "negativeIntValue: integer|Long expected"; - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) - if (typeof message.doubleValue !== "number") - return "doubleValue: number expected"; - if (message.stringValue != null && message.hasOwnProperty("stringValue")) - if (!(message.stringValue && typeof message.stringValue.length === "number" || $util.isString(message.stringValue))) - return "stringValue: buffer expected"; - if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) - if (!$util.isString(message.aggregateValue)) - return "aggregateValue: string expected"; - return null; - }; - - /** - * Creates an UninterpretedOption message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UninterpretedOption} UninterpretedOption - */ - UninterpretedOption.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UninterpretedOption) - return object; - var message = new $root.google.protobuf.UninterpretedOption(); - if (object.name) { - if (!Array.isArray(object.name)) - throw TypeError(".google.protobuf.UninterpretedOption.name: array expected"); - message.name = []; - for (var i = 0; i < object.name.length; ++i) { - if (typeof object.name[i] !== "object") - throw TypeError(".google.protobuf.UninterpretedOption.name: object expected"); - message.name[i] = $root.google.protobuf.UninterpretedOption.NamePart.fromObject(object.name[i]); - } - } - if (object.identifierValue != null) - message.identifierValue = String(object.identifierValue); - if (object.positiveIntValue != null) - if ($util.Long) - (message.positiveIntValue = $util.Long.fromValue(object.positiveIntValue)).unsigned = true; - else if (typeof object.positiveIntValue === "string") - message.positiveIntValue = parseInt(object.positiveIntValue, 10); - else if (typeof object.positiveIntValue === "number") - message.positiveIntValue = object.positiveIntValue; - else if (typeof object.positiveIntValue === "object") - message.positiveIntValue = new $util.LongBits(object.positiveIntValue.low >>> 0, object.positiveIntValue.high >>> 0).toNumber(true); - if (object.negativeIntValue != null) - if ($util.Long) - (message.negativeIntValue = $util.Long.fromValue(object.negativeIntValue)).unsigned = false; - else if (typeof object.negativeIntValue === "string") - message.negativeIntValue = parseInt(object.negativeIntValue, 10); - else if (typeof object.negativeIntValue === "number") - message.negativeIntValue = object.negativeIntValue; - else if (typeof object.negativeIntValue === "object") - message.negativeIntValue = new $util.LongBits(object.negativeIntValue.low >>> 0, object.negativeIntValue.high >>> 0).toNumber(); - if (object.doubleValue != null) - message.doubleValue = Number(object.doubleValue); - if (object.stringValue != null) - if (typeof object.stringValue === "string") - $util.base64.decode(object.stringValue, message.stringValue = $util.newBuffer($util.base64.length(object.stringValue)), 0); - else if (object.stringValue.length) - message.stringValue = object.stringValue; - if (object.aggregateValue != null) - message.aggregateValue = String(object.aggregateValue); - return message; - }; - - /** - * Creates a plain object from an UninterpretedOption message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UninterpretedOption - * @static - * @param {google.protobuf.UninterpretedOption} message UninterpretedOption - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - UninterpretedOption.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.name = []; - if (options.defaults) { - object.identifierValue = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.positiveIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.positiveIntValue = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.negativeIntValue = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.negativeIntValue = options.longs === String ? "0" : 0; - object.doubleValue = 0; - if (options.bytes === String) - object.stringValue = ""; - else { - object.stringValue = []; - if (options.bytes !== Array) - object.stringValue = $util.newBuffer(object.stringValue); - } - object.aggregateValue = ""; - } - if (message.name && message.name.length) { - object.name = []; - for (var j = 0; j < message.name.length; ++j) - object.name[j] = $root.google.protobuf.UninterpretedOption.NamePart.toObject(message.name[j], options); - } - if (message.identifierValue != null && message.hasOwnProperty("identifierValue")) - object.identifierValue = message.identifierValue; - if (message.positiveIntValue != null && message.hasOwnProperty("positiveIntValue")) - if (typeof message.positiveIntValue === "number") - object.positiveIntValue = options.longs === String ? String(message.positiveIntValue) : message.positiveIntValue; - else - object.positiveIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.positiveIntValue) : options.longs === Number ? new $util.LongBits(message.positiveIntValue.low >>> 0, message.positiveIntValue.high >>> 0).toNumber(true) : message.positiveIntValue; - if (message.negativeIntValue != null && message.hasOwnProperty("negativeIntValue")) - if (typeof message.negativeIntValue === "number") - object.negativeIntValue = options.longs === String ? String(message.negativeIntValue) : message.negativeIntValue; - else - object.negativeIntValue = options.longs === String ? $util.Long.prototype.toString.call(message.negativeIntValue) : options.longs === Number ? new $util.LongBits(message.negativeIntValue.low >>> 0, message.negativeIntValue.high >>> 0).toNumber() : message.negativeIntValue; - if (message.doubleValue != null && message.hasOwnProperty("doubleValue")) - object.doubleValue = options.json && !isFinite(message.doubleValue) ? String(message.doubleValue) : message.doubleValue; - if (message.stringValue != null && message.hasOwnProperty("stringValue")) - object.stringValue = options.bytes === String ? $util.base64.encode(message.stringValue, 0, message.stringValue.length) : options.bytes === Array ? Array.prototype.slice.call(message.stringValue) : message.stringValue; - if (message.aggregateValue != null && message.hasOwnProperty("aggregateValue")) - object.aggregateValue = message.aggregateValue; - return object; - }; - - /** - * Converts this UninterpretedOption to JSON. - * @function toJSON - * @memberof google.protobuf.UninterpretedOption - * @instance - * @returns {Object.} JSON object - */ - UninterpretedOption.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - UninterpretedOption.NamePart = (function() { - - /** - * Properties of a NamePart. - * @memberof google.protobuf.UninterpretedOption - * @interface INamePart - * @property {string} namePart NamePart namePart - * @property {boolean} isExtension NamePart isExtension - */ - - /** - * Constructs a new NamePart. - * @memberof google.protobuf.UninterpretedOption - * @classdesc Represents a NamePart. - * @implements INamePart - * @constructor - * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set - */ - function NamePart(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]]; - } - - /** - * NamePart namePart. - * @member {string} namePart - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - */ - NamePart.prototype.namePart = ""; - - /** - * NamePart isExtension. - * @member {boolean} isExtension - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - */ - NamePart.prototype.isExtension = false; - - /** - * Creates a new NamePart instance using the specified properties. - * @function create - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart=} [properties] Properties to set - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart instance - */ - NamePart.create = function create(properties) { - return new NamePart(properties); - }; - - /** - * Encodes the specified NamePart message. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @function encode - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NamePart.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - writer.uint32(/* id 1, wireType 2 =*/10).string(message.namePart); - writer.uint32(/* id 2, wireType 0 =*/16).bool(message.isExtension); - return writer; - }; - - /** - * Encodes the specified NamePart message, length delimited. Does not implicitly {@link google.protobuf.UninterpretedOption.NamePart.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.INamePart} message NamePart message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NamePart.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NamePart message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NamePart.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.google.protobuf.UninterpretedOption.NamePart(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.namePart = reader.string(); - break; - case 2: - message.isExtension = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - if (!message.hasOwnProperty("namePart")) - throw $util.ProtocolError("missing required 'namePart'", { instance: message }); - if (!message.hasOwnProperty("isExtension")) - throw $util.ProtocolError("missing required 'isExtension'", { instance: message }); - return message; - }; - - /** - * Decodes a NamePart message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NamePart.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NamePart message. - * @function verify - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NamePart.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (!$util.isString(message.namePart)) - return "namePart: string expected"; - if (typeof message.isExtension !== "boolean") - return "isExtension: boolean expected"; - return null; - }; - - /** - * Creates a NamePart message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.UninterpretedOption.NamePart} NamePart - */ - NamePart.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.UninterpretedOption.NamePart) - return object; - var message = new $root.google.protobuf.UninterpretedOption.NamePart(); - if (object.namePart != null) - message.namePart = String(object.namePart); - if (object.isExtension != null) - message.isExtension = Boolean(object.isExtension); - return message; - }; - - /** - * Creates a plain object from a NamePart message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.UninterpretedOption.NamePart - * @static - * @param {google.protobuf.UninterpretedOption.NamePart} message NamePart - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NamePart.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.namePart = ""; - object.isExtension = false; - } - if (message.namePart != null && message.hasOwnProperty("namePart")) - object.namePart = message.namePart; - if (message.isExtension != null && message.hasOwnProperty("isExtension")) - object.isExtension = message.isExtension; - return object; - }; - - /** - * Converts this NamePart to JSON. - * @function toJSON - * @memberof google.protobuf.UninterpretedOption.NamePart - * @instance - * @returns {Object.} JSON object - */ - NamePart.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return NamePart; - })(); - - return UninterpretedOption; - })(); - - protobuf.SourceCodeInfo = (function() { - - /** - * Properties of a SourceCodeInfo. - * @memberof google.protobuf - * @interface ISourceCodeInfo - * @property {Array.|null} [location] SourceCodeInfo location - */ - - /** - * Constructs a new SourceCodeInfo. - * @memberof google.protobuf - * @classdesc Represents a SourceCodeInfo. - * @implements ISourceCodeInfo - * @constructor - * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set - */ - function SourceCodeInfo(properties) { - this.location = []; - 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]]; - } - - /** - * SourceCodeInfo location. - * @member {Array.} location - * @memberof google.protobuf.SourceCodeInfo - * @instance - */ - SourceCodeInfo.prototype.location = $util.emptyArray; - - /** - * Creates a new SourceCodeInfo instance using the specified properties. - * @function create - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo=} [properties] Properties to set - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo instance - */ - SourceCodeInfo.create = function create(properties) { - return new SourceCodeInfo(properties); - }; - - /** - * Encodes the specified SourceCodeInfo message. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @function encode - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SourceCodeInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.location != null && message.location.length) - for (var i = 0; i < message.location.length; ++i) - $root.google.protobuf.SourceCodeInfo.Location.encode(message.location[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified SourceCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.ISourceCodeInfo} message SourceCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - SourceCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SourceCodeInfo.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.google.protobuf.SourceCodeInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.location && message.location.length)) - message.location = []; - message.location.push($root.google.protobuf.SourceCodeInfo.Location.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a SourceCodeInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - SourceCodeInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a SourceCodeInfo message. - * @function verify - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - SourceCodeInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.location != null && message.hasOwnProperty("location")) { - if (!Array.isArray(message.location)) - return "location: array expected"; - for (var i = 0; i < message.location.length; ++i) { - var error = $root.google.protobuf.SourceCodeInfo.Location.verify(message.location[i]); - if (error) - return "location." + error; - } - } - return null; - }; - - /** - * Creates a SourceCodeInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.SourceCodeInfo} SourceCodeInfo - */ - SourceCodeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.SourceCodeInfo) - return object; - var message = new $root.google.protobuf.SourceCodeInfo(); - if (object.location) { - if (!Array.isArray(object.location)) - throw TypeError(".google.protobuf.SourceCodeInfo.location: array expected"); - message.location = []; - for (var i = 0; i < object.location.length; ++i) { - if (typeof object.location[i] !== "object") - throw TypeError(".google.protobuf.SourceCodeInfo.location: object expected"); - message.location[i] = $root.google.protobuf.SourceCodeInfo.Location.fromObject(object.location[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a SourceCodeInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.SourceCodeInfo - * @static - * @param {google.protobuf.SourceCodeInfo} message SourceCodeInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - SourceCodeInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.location = []; - if (message.location && message.location.length) { - object.location = []; - for (var j = 0; j < message.location.length; ++j) - object.location[j] = $root.google.protobuf.SourceCodeInfo.Location.toObject(message.location[j], options); - } - return object; - }; - - /** - * Converts this SourceCodeInfo to JSON. - * @function toJSON - * @memberof google.protobuf.SourceCodeInfo - * @instance - * @returns {Object.} JSON object - */ - SourceCodeInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - SourceCodeInfo.Location = (function() { - - /** - * Properties of a Location. - * @memberof google.protobuf.SourceCodeInfo - * @interface ILocation - * @property {Array.|null} [path] Location path - * @property {Array.|null} [span] Location span - * @property {string|null} [leadingComments] Location leadingComments - * @property {string|null} [trailingComments] Location trailingComments - * @property {Array.|null} [leadingDetachedComments] Location leadingDetachedComments - */ - - /** - * Constructs a new Location. - * @memberof google.protobuf.SourceCodeInfo - * @classdesc Represents a Location. - * @implements ILocation - * @constructor - * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set - */ - function Location(properties) { - this.path = []; - this.span = []; - this.leadingDetachedComments = []; - 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]]; - } - - /** - * Location path. - * @member {Array.} path - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.path = $util.emptyArray; - - /** - * Location span. - * @member {Array.} span - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.span = $util.emptyArray; - - /** - * Location leadingComments. - * @member {string} leadingComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.leadingComments = ""; - - /** - * Location trailingComments. - * @member {string} trailingComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.trailingComments = ""; - - /** - * Location leadingDetachedComments. - * @member {Array.} leadingDetachedComments - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - */ - Location.prototype.leadingDetachedComments = $util.emptyArray; - - /** - * Creates a new Location instance using the specified properties. - * @function create - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation=} [properties] Properties to set - * @returns {google.protobuf.SourceCodeInfo.Location} Location instance - */ - Location.create = function create(properties) { - return new Location(properties); - }; - - /** - * Encodes the specified Location message. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @function encode - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Location.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && message.path.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.path.length; ++i) - writer.int32(message.path[i]); - writer.ldelim(); - } - if (message.span != null && message.span.length) { - writer.uint32(/* id 2, wireType 2 =*/18).fork(); - for (var i = 0; i < message.span.length; ++i) - writer.int32(message.span[i]); - writer.ldelim(); - } - if (message.leadingComments != null && Object.hasOwnProperty.call(message, "leadingComments")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.leadingComments); - if (message.trailingComments != null && Object.hasOwnProperty.call(message, "trailingComments")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.trailingComments); - if (message.leadingDetachedComments != null && message.leadingDetachedComments.length) - for (var i = 0; i < message.leadingDetachedComments.length; ++i) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.leadingDetachedComments[i]); - return writer; - }; - - /** - * Encodes the specified Location message, length delimited. Does not implicitly {@link google.protobuf.SourceCodeInfo.Location.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.ILocation} message Location message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Location.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Location message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.SourceCodeInfo.Location} Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Location.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.google.protobuf.SourceCodeInfo.Location(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.path && message.path.length)) - message.path = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.path.push(reader.int32()); - } else - message.path.push(reader.int32()); - break; - case 2: - if (!(message.span && message.span.length)) - message.span = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.span.push(reader.int32()); - } else - message.span.push(reader.int32()); - break; - case 3: - message.leadingComments = reader.string(); - break; - case 4: - message.trailingComments = reader.string(); - break; - case 6: - if (!(message.leadingDetachedComments && message.leadingDetachedComments.length)) - message.leadingDetachedComments = []; - message.leadingDetachedComments.push(reader.string()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Location message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.SourceCodeInfo.Location} Location - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Location.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Location message. - * @function verify - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Location.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) { - if (!Array.isArray(message.path)) - return "path: array expected"; - for (var i = 0; i < message.path.length; ++i) - if (!$util.isInteger(message.path[i])) - return "path: integer[] expected"; - } - if (message.span != null && message.hasOwnProperty("span")) { - if (!Array.isArray(message.span)) - return "span: array expected"; - for (var i = 0; i < message.span.length; ++i) - if (!$util.isInteger(message.span[i])) - return "span: integer[] expected"; - } - if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) - if (!$util.isString(message.leadingComments)) - return "leadingComments: string expected"; - if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) - if (!$util.isString(message.trailingComments)) - return "trailingComments: string expected"; - if (message.leadingDetachedComments != null && message.hasOwnProperty("leadingDetachedComments")) { - if (!Array.isArray(message.leadingDetachedComments)) - return "leadingDetachedComments: array expected"; - for (var i = 0; i < message.leadingDetachedComments.length; ++i) - if (!$util.isString(message.leadingDetachedComments[i])) - return "leadingDetachedComments: string[] expected"; - } - return null; - }; - - /** - * Creates a Location message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.SourceCodeInfo.Location} Location - */ - Location.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.SourceCodeInfo.Location) - return object; - var message = new $root.google.protobuf.SourceCodeInfo.Location(); - if (object.path) { - if (!Array.isArray(object.path)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.path: array expected"); - message.path = []; - for (var i = 0; i < object.path.length; ++i) - message.path[i] = object.path[i] | 0; - } - if (object.span) { - if (!Array.isArray(object.span)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.span: array expected"); - message.span = []; - for (var i = 0; i < object.span.length; ++i) - message.span[i] = object.span[i] | 0; - } - if (object.leadingComments != null) - message.leadingComments = String(object.leadingComments); - if (object.trailingComments != null) - message.trailingComments = String(object.trailingComments); - if (object.leadingDetachedComments) { - if (!Array.isArray(object.leadingDetachedComments)) - throw TypeError(".google.protobuf.SourceCodeInfo.Location.leadingDetachedComments: array expected"); - message.leadingDetachedComments = []; - for (var i = 0; i < object.leadingDetachedComments.length; ++i) - message.leadingDetachedComments[i] = String(object.leadingDetachedComments[i]); - } - return message; - }; - - /** - * Creates a plain object from a Location message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.SourceCodeInfo.Location - * @static - * @param {google.protobuf.SourceCodeInfo.Location} message Location - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Location.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.path = []; - object.span = []; - object.leadingDetachedComments = []; - } - if (options.defaults) { - object.leadingComments = ""; - object.trailingComments = ""; - } - if (message.path && message.path.length) { - object.path = []; - for (var j = 0; j < message.path.length; ++j) - object.path[j] = message.path[j]; - } - if (message.span && message.span.length) { - object.span = []; - for (var j = 0; j < message.span.length; ++j) - object.span[j] = message.span[j]; - } - if (message.leadingComments != null && message.hasOwnProperty("leadingComments")) - object.leadingComments = message.leadingComments; - if (message.trailingComments != null && message.hasOwnProperty("trailingComments")) - object.trailingComments = message.trailingComments; - if (message.leadingDetachedComments && message.leadingDetachedComments.length) { - object.leadingDetachedComments = []; - for (var j = 0; j < message.leadingDetachedComments.length; ++j) - object.leadingDetachedComments[j] = message.leadingDetachedComments[j]; - } - return object; - }; - - /** - * Converts this Location to JSON. - * @function toJSON - * @memberof google.protobuf.SourceCodeInfo.Location - * @instance - * @returns {Object.} JSON object - */ - Location.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Location; - })(); - - return SourceCodeInfo; - })(); - - protobuf.GeneratedCodeInfo = (function() { - - /** - * Properties of a GeneratedCodeInfo. - * @memberof google.protobuf - * @interface IGeneratedCodeInfo - * @property {Array.|null} [annotation] GeneratedCodeInfo annotation - */ - - /** - * Constructs a new GeneratedCodeInfo. - * @memberof google.protobuf - * @classdesc Represents a GeneratedCodeInfo. - * @implements IGeneratedCodeInfo - * @constructor - * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set - */ - function GeneratedCodeInfo(properties) { - this.annotation = []; - 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]]; - } - - /** - * GeneratedCodeInfo annotation. - * @member {Array.} annotation - * @memberof google.protobuf.GeneratedCodeInfo - * @instance - */ - GeneratedCodeInfo.prototype.annotation = $util.emptyArray; - - /** - * Creates a new GeneratedCodeInfo instance using the specified properties. - * @function create - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo=} [properties] Properties to set - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo instance - */ - GeneratedCodeInfo.create = function create(properties) { - return new GeneratedCodeInfo(properties); - }; - - /** - * Encodes the specified GeneratedCodeInfo message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @function encode - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GeneratedCodeInfo.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.annotation != null && message.annotation.length) - for (var i = 0; i < message.annotation.length; ++i) - $root.google.protobuf.GeneratedCodeInfo.Annotation.encode(message.annotation[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified GeneratedCodeInfo message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.IGeneratedCodeInfo} message GeneratedCodeInfo message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - GeneratedCodeInfo.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GeneratedCodeInfo.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.google.protobuf.GeneratedCodeInfo(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.annotation && message.annotation.length)) - message.annotation = []; - message.annotation.push($root.google.protobuf.GeneratedCodeInfo.Annotation.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a GeneratedCodeInfo message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - GeneratedCodeInfo.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a GeneratedCodeInfo message. - * @function verify - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - GeneratedCodeInfo.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.annotation != null && message.hasOwnProperty("annotation")) { - if (!Array.isArray(message.annotation)) - return "annotation: array expected"; - for (var i = 0; i < message.annotation.length; ++i) { - var error = $root.google.protobuf.GeneratedCodeInfo.Annotation.verify(message.annotation[i]); - if (error) - return "annotation." + error; - } - } - return null; - }; - - /** - * Creates a GeneratedCodeInfo message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.GeneratedCodeInfo} GeneratedCodeInfo - */ - GeneratedCodeInfo.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.GeneratedCodeInfo) - return object; - var message = new $root.google.protobuf.GeneratedCodeInfo(); - if (object.annotation) { - if (!Array.isArray(object.annotation)) - throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: array expected"); - message.annotation = []; - for (var i = 0; i < object.annotation.length; ++i) { - if (typeof object.annotation[i] !== "object") - throw TypeError(".google.protobuf.GeneratedCodeInfo.annotation: object expected"); - message.annotation[i] = $root.google.protobuf.GeneratedCodeInfo.Annotation.fromObject(object.annotation[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a GeneratedCodeInfo message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.GeneratedCodeInfo - * @static - * @param {google.protobuf.GeneratedCodeInfo} message GeneratedCodeInfo - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - GeneratedCodeInfo.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.annotation = []; - if (message.annotation && message.annotation.length) { - object.annotation = []; - for (var j = 0; j < message.annotation.length; ++j) - object.annotation[j] = $root.google.protobuf.GeneratedCodeInfo.Annotation.toObject(message.annotation[j], options); - } - return object; - }; - - /** - * Converts this GeneratedCodeInfo to JSON. - * @function toJSON - * @memberof google.protobuf.GeneratedCodeInfo - * @instance - * @returns {Object.} JSON object - */ - GeneratedCodeInfo.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - GeneratedCodeInfo.Annotation = (function() { - - /** - * Properties of an Annotation. - * @memberof google.protobuf.GeneratedCodeInfo - * @interface IAnnotation - * @property {Array.|null} [path] Annotation path - * @property {string|null} [sourceFile] Annotation sourceFile - * @property {number|null} [begin] Annotation begin - * @property {number|null} [end] Annotation end - */ - - /** - * Constructs a new Annotation. - * @memberof google.protobuf.GeneratedCodeInfo - * @classdesc Represents an Annotation. - * @implements IAnnotation - * @constructor - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set - */ - function Annotation(properties) { - this.path = []; - 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]]; - } - - /** - * Annotation path. - * @member {Array.} path - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.path = $util.emptyArray; - - /** - * Annotation sourceFile. - * @member {string} sourceFile - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.sourceFile = ""; - - /** - * Annotation begin. - * @member {number} begin - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.begin = 0; - - /** - * Annotation end. - * @member {number} end - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - */ - Annotation.prototype.end = 0; - - /** - * Creates a new Annotation instance using the specified properties. - * @function create - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation=} [properties] Properties to set - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation instance - */ - Annotation.create = function create(properties) { - return new Annotation(properties); - }; - - /** - * Encodes the specified Annotation message. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @function encode - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Annotation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.path != null && message.path.length) { - writer.uint32(/* id 1, wireType 2 =*/10).fork(); - for (var i = 0; i < message.path.length; ++i) - writer.int32(message.path[i]); - writer.ldelim(); - } - if (message.sourceFile != null && Object.hasOwnProperty.call(message, "sourceFile")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.sourceFile); - if (message.begin != null && Object.hasOwnProperty.call(message, "begin")) - writer.uint32(/* id 3, wireType 0 =*/24).int32(message.begin); - if (message.end != null && Object.hasOwnProperty.call(message, "end")) - writer.uint32(/* id 4, wireType 0 =*/32).int32(message.end); - return writer; - }; - - /** - * Encodes the specified Annotation message, length delimited. Does not implicitly {@link google.protobuf.GeneratedCodeInfo.Annotation.verify|verify} messages. - * @function encodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.IAnnotation} message Annotation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Annotation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Annotation message from the specified reader or buffer. - * @function decode - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Annotation.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.google.protobuf.GeneratedCodeInfo.Annotation(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.path && message.path.length)) - message.path = []; - if ((tag & 7) === 2) { - var end2 = reader.uint32() + reader.pos; - while (reader.pos < end2) - message.path.push(reader.int32()); - } else - message.path.push(reader.int32()); - break; - case 2: - message.sourceFile = reader.string(); - break; - case 3: - message.begin = reader.int32(); - break; - case 4: - message.end = reader.int32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Annotation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Annotation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Annotation message. - * @function verify - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Annotation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.path != null && message.hasOwnProperty("path")) { - if (!Array.isArray(message.path)) - return "path: array expected"; - for (var i = 0; i < message.path.length; ++i) - if (!$util.isInteger(message.path[i])) - return "path: integer[] expected"; - } - if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) - if (!$util.isString(message.sourceFile)) - return "sourceFile: string expected"; - if (message.begin != null && message.hasOwnProperty("begin")) - if (!$util.isInteger(message.begin)) - return "begin: integer expected"; - if (message.end != null && message.hasOwnProperty("end")) - if (!$util.isInteger(message.end)) - return "end: integer expected"; - return null; - }; - - /** - * Creates an Annotation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {Object.} object Plain object - * @returns {google.protobuf.GeneratedCodeInfo.Annotation} Annotation - */ - Annotation.fromObject = function fromObject(object) { - if (object instanceof $root.google.protobuf.GeneratedCodeInfo.Annotation) - return object; - var message = new $root.google.protobuf.GeneratedCodeInfo.Annotation(); - if (object.path) { - if (!Array.isArray(object.path)) - throw TypeError(".google.protobuf.GeneratedCodeInfo.Annotation.path: array expected"); - message.path = []; - for (var i = 0; i < object.path.length; ++i) - message.path[i] = object.path[i] | 0; - } - if (object.sourceFile != null) - message.sourceFile = String(object.sourceFile); - if (object.begin != null) - message.begin = object.begin | 0; - if (object.end != null) - message.end = object.end | 0; - return message; - }; - - /** - * Creates a plain object from an Annotation message. Also converts values to other types if specified. - * @function toObject - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @static - * @param {google.protobuf.GeneratedCodeInfo.Annotation} message Annotation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Annotation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.path = []; - if (options.defaults) { - object.sourceFile = ""; - object.begin = 0; - object.end = 0; - } - if (message.path && message.path.length) { - object.path = []; - for (var j = 0; j < message.path.length; ++j) - object.path[j] = message.path[j]; - } - if (message.sourceFile != null && message.hasOwnProperty("sourceFile")) - object.sourceFile = message.sourceFile; - if (message.begin != null && message.hasOwnProperty("begin")) - object.begin = message.begin; - if (message.end != null && message.hasOwnProperty("end")) - object.end = message.end; - return object; - }; - - /** - * Converts this Annotation to JSON. - * @function toJSON - * @memberof google.protobuf.GeneratedCodeInfo.Annotation - * @instance - * @returns {Object.} JSON object - */ - Annotation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Annotation; - })(); - - return GeneratedCodeInfo; - })(); - - return protobuf; - })(); - - return google; -})(); - $root.types = (function() { /** diff --git a/packages/xchain-thorchain/genMsgs.sh b/packages/xchain-thorchain/genMsgs.sh index 802dacb43..8d2bddc83 100755 --- a/packages/xchain-thorchain/genMsgs.sh +++ b/packages/xchain-thorchain/genMsgs.sh @@ -6,36 +6,35 @@ set -e # Exit on any error MSG_COMPILED_OUTPUTFILE=src/types/proto/MsgCompiled.js MSG_COMPILED_TYPES_OUTPUTFILE=src/types/proto/MsgCompiled.d.ts -TMP_DIR=$(mktemp -d) +# Using local minimal proto files - no need to clone thornode repository -# Cleanup function -cleanup() { - if [ -d "$TMP_DIR" ]; then - tput setaf 2 - echo "Cleaning up $TMP_DIR" - tput sgr0 - rm -rf "$TMP_DIR" +# Download cosmos/base/v1beta1/coin.proto from cosmossdk +COSMOS_COIN_PROTO="proto/cosmos/base/v1beta1/coin.proto" +if [ ! -f "$COSMOS_COIN_PROTO" ]; then + tput setaf 2 + echo "Downloading cosmos/base/v1beta1/coin.proto from cosmossdk" + tput sgr0 + mkdir -p "proto/cosmos/base/v1beta1" + if ! curl -f -o "$COSMOS_COIN_PROTO" \ + "https://raw.githubusercontent.com/cosmos/cosmos-sdk/main/proto/cosmos/base/v1beta1/coin.proto"; then + echo "Error: Failed to download cosmos coin.proto" + exit 1 fi -} -trap cleanup EXIT - -tput setaf 2 -echo "Checking out https://gitlab.com/thorchain/thornode to $TMP_DIR" -tput sgr0 -if ! (cd "$TMP_DIR" && git clone --branch develop https://gitlab.com/thorchain/thornode); then - echo "Error: Failed to clone thornode repository" - exit 1 + echo "✓ Downloaded cosmos coin.proto" +else + echo "✓ cosmos coin.proto already exists" fi -# Verify proto files exist +# Verify our minimal proto files exist tput setaf 2 -echo "Checking proto files" +echo "Checking minimal proto files" tput sgr0 MISSING_FILES=0 for proto_file in \ - "$TMP_DIR/thornode/proto/thorchain/v1/common/common.proto" \ - "$TMP_DIR/thornode/proto/thorchain/v1/types/msg_deposit.proto" \ - "$TMP_DIR/thornode/proto/thorchain/v1/types/msg_send.proto"; do + "proto/common/minimal_common.proto" \ + "proto/types/minimal_msg_deposit.proto" \ + "proto/types/minimal_msg_send.proto" \ + "$COSMOS_COIN_PROTO"; do if [ ! -f "$proto_file" ]; then echo "Error: $(basename "$proto_file") missing" MISSING_FILES=1 @@ -49,34 +48,16 @@ if [ $MISSING_FILES -eq 1 ]; then exit 1 fi -# Download cosmos/base/v1beta1/coin.proto from cosmossdk if not exists -COSMOS_COIN_PROTO="$TMP_DIR/thornode/third_party/proto/cosmos/base/v1beta1/coin.proto" -if [ ! -f "$COSMOS_COIN_PROTO" ]; then - tput setaf 2 - echo "Downloading cosmos/base/v1beta1/coin.proto from cosmossdk" - tput sgr0 - mkdir -p "$TMP_DIR/thornode/third_party/proto/cosmos/base/v1beta1" - if ! curl -f -o "$COSMOS_COIN_PROTO" \ - "https://raw.githubusercontent.com/cosmos/cosmos-sdk/main/proto/cosmos/base/v1beta1/coin.proto"; then - echo "Error: Failed to download cosmos coin.proto" - exit 1 - fi - echo "✓ Downloaded cosmos coin.proto" -else - echo "✓ cosmos coin.proto already exists" -fi - -# Generate Protobuf JS bindings with include path +# Generate Protobuf JS bindings using minimal proto files to prevent over-inclusion tput setaf 2 echo "Generating $MSG_COMPILED_OUTPUTFILE" tput sgr0 if ! yarn pbjs -w commonjs -t static-module \ - -p "$TMP_DIR/thornode/proto" \ - -p "$TMP_DIR/thornode/third_party/proto" \ - "$TMP_DIR/thornode/proto/thorchain/v1/common/common.proto" \ - "$TMP_DIR/thornode/proto/thorchain/v1/types/msg_deposit.proto" \ - "$TMP_DIR/thornode/proto/thorchain/v1/types/msg_send.proto" \ - "$TMP_DIR/thornode/third_party/proto/cosmos/base/v1beta1/coin.proto" \ + -p proto \ + "proto/common/minimal_common.proto" \ + "proto/types/minimal_msg_deposit.proto" \ + "proto/types/minimal_msg_send.proto" \ + "$COSMOS_COIN_PROTO" \ -o "$MSG_COMPILED_OUTPUTFILE" 2>pbjs_errors.txt; then echo "Error: Failed to generate JavaScript bindings" cat pbjs_errors.txt diff --git a/packages/xchain-thorchain/src/types/proto/MsgCompiled.d.ts b/packages/xchain-thorchain/src/types/proto/MsgCompiled.d.ts index 1b2c65789..32353b79a 100644 --- a/packages/xchain-thorchain/src/types/proto/MsgCompiled.d.ts +++ b/packages/xchain-thorchain/src/types/proto/MsgCompiled.d.ts @@ -636,2077 +636,6 @@ declare namespace types { */ public toJSON(): { [k: string]: any }; } - - /** Status enum. */ - enum Status { - incomplete = 0, - done = 1, - reverted = 2 - } - - /** Properties of an ObservedTx. */ - interface IObservedTx { - - /** ObservedTx tx */ - tx?: (common.ITx|null); - - /** ObservedTx status */ - status?: (common.Status|null); - - /** ObservedTx outHashes */ - outHashes?: (string[]|null); - - /** ObservedTx blockHeight */ - blockHeight?: (number|Long|null); - - /** ObservedTx signers */ - signers?: (string[]|null); - - /** ObservedTx observedPubKey */ - observedPubKey?: (string|null); - - /** ObservedTx keysignMs */ - keysignMs?: (number|Long|null); - - /** ObservedTx finaliseHeight */ - finaliseHeight?: (number|Long|null); - - /** ObservedTx aggregator */ - aggregator?: (string|null); - - /** ObservedTx aggregatorTarget */ - aggregatorTarget?: (string|null); - - /** ObservedTx aggregatorTargetLimit */ - aggregatorTargetLimit?: (string|null); - } - - /** Represents an ObservedTx. */ - class ObservedTx implements IObservedTx { - - /** - * Constructs a new ObservedTx. - * @param [properties] Properties to set - */ - constructor(properties?: common.IObservedTx); - - /** ObservedTx tx. */ - public tx?: (common.ITx|null); - - /** ObservedTx status. */ - public status: common.Status; - - /** ObservedTx outHashes. */ - public outHashes: string[]; - - /** ObservedTx blockHeight. */ - public blockHeight: (number|Long); - - /** ObservedTx signers. */ - public signers: string[]; - - /** ObservedTx observedPubKey. */ - public observedPubKey: string; - - /** ObservedTx keysignMs. */ - public keysignMs: (number|Long); - - /** ObservedTx finaliseHeight. */ - public finaliseHeight: (number|Long); - - /** ObservedTx aggregator. */ - public aggregator: string; - - /** ObservedTx aggregatorTarget. */ - public aggregatorTarget: string; - - /** ObservedTx aggregatorTargetLimit. */ - public aggregatorTargetLimit: string; - - /** - * Creates a new ObservedTx instance using the specified properties. - * @param [properties] Properties to set - * @returns ObservedTx instance - */ - public static create(properties?: common.IObservedTx): common.ObservedTx; - - /** - * Encodes the specified ObservedTx message. Does not implicitly {@link common.ObservedTx.verify|verify} messages. - * @param message ObservedTx message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: common.IObservedTx, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ObservedTx message, length delimited. Does not implicitly {@link common.ObservedTx.verify|verify} messages. - * @param message ObservedTx message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: common.IObservedTx, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ObservedTx message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ObservedTx - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.ObservedTx; - - /** - * Decodes an ObservedTx message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ObservedTx - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.ObservedTx; - - /** - * Verifies an ObservedTx message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ObservedTx message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ObservedTx - */ - public static fromObject(object: { [k: string]: any }): common.ObservedTx; - - /** - * Creates a plain object from an ObservedTx message. Also converts values to other types if specified. - * @param message ObservedTx - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: common.ObservedTx, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ObservedTx to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an Attestation. */ - interface IAttestation { - - /** Attestation PubKey */ - PubKey?: (Uint8Array|null); - - /** Attestation Signature */ - Signature?: (Uint8Array|null); - } - - /** Represents an Attestation. */ - class Attestation implements IAttestation { - - /** - * Constructs a new Attestation. - * @param [properties] Properties to set - */ - constructor(properties?: common.IAttestation); - - /** Attestation PubKey. */ - public PubKey: Uint8Array; - - /** Attestation Signature. */ - public Signature: Uint8Array; - - /** - * Creates a new Attestation instance using the specified properties. - * @param [properties] Properties to set - * @returns Attestation instance - */ - public static create(properties?: common.IAttestation): common.Attestation; - - /** - * Encodes the specified Attestation message. Does not implicitly {@link common.Attestation.verify|verify} messages. - * @param message Attestation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: common.IAttestation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Attestation message, length delimited. Does not implicitly {@link common.Attestation.verify|verify} messages. - * @param message Attestation message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: common.IAttestation, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Attestation message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Attestation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.Attestation; - - /** - * Decodes an Attestation message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Attestation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.Attestation; - - /** - * Verifies an Attestation message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Attestation message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Attestation - */ - public static fromObject(object: { [k: string]: any }): common.Attestation; - - /** - * Creates a plain object from an Attestation message. Also converts values to other types if specified. - * @param message Attestation - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: common.Attestation, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Attestation to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an AttestTx. */ - interface IAttestTx { - - /** AttestTx obsTx */ - obsTx?: (common.IObservedTx|null); - - /** AttestTx attestation */ - attestation?: (common.IAttestation|null); - - /** AttestTx inbound */ - inbound?: (boolean|null); - - /** AttestTx allowFutureObservation */ - allowFutureObservation?: (boolean|null); - } - - /** Represents an AttestTx. */ - class AttestTx implements IAttestTx { - - /** - * Constructs a new AttestTx. - * @param [properties] Properties to set - */ - constructor(properties?: common.IAttestTx); - - /** AttestTx obsTx. */ - public obsTx?: (common.IObservedTx|null); - - /** AttestTx attestation. */ - public attestation?: (common.IAttestation|null); - - /** AttestTx inbound. */ - public inbound: boolean; - - /** AttestTx allowFutureObservation. */ - public allowFutureObservation: boolean; - - /** - * Creates a new AttestTx instance using the specified properties. - * @param [properties] Properties to set - * @returns AttestTx instance - */ - public static create(properties?: common.IAttestTx): common.AttestTx; - - /** - * Encodes the specified AttestTx message. Does not implicitly {@link common.AttestTx.verify|verify} messages. - * @param message AttestTx message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: common.IAttestTx, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AttestTx message, length delimited. Does not implicitly {@link common.AttestTx.verify|verify} messages. - * @param message AttestTx message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: common.IAttestTx, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AttestTx message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AttestTx - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.AttestTx; - - /** - * Decodes an AttestTx message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AttestTx - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.AttestTx; - - /** - * Verifies an AttestTx message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AttestTx message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AttestTx - */ - public static fromObject(object: { [k: string]: any }): common.AttestTx; - - /** - * Creates a plain object from an AttestTx message. Also converts values to other types if specified. - * @param message AttestTx - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: common.AttestTx, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AttestTx to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QuorumTx. */ - interface IQuorumTx { - - /** QuorumTx obsTx */ - obsTx?: (common.IObservedTx|null); - - /** QuorumTx attestations */ - attestations?: (common.IAttestation[]|null); - - /** QuorumTx inbound */ - inbound?: (boolean|null); - - /** QuorumTx allowFutureObservation */ - allowFutureObservation?: (boolean|null); - } - - /** Represents a QuorumTx. */ - class QuorumTx implements IQuorumTx { - - /** - * Constructs a new QuorumTx. - * @param [properties] Properties to set - */ - constructor(properties?: common.IQuorumTx); - - /** QuorumTx obsTx. */ - public obsTx?: (common.IObservedTx|null); - - /** QuorumTx attestations. */ - public attestations: common.IAttestation[]; - - /** QuorumTx inbound. */ - public inbound: boolean; - - /** QuorumTx allowFutureObservation. */ - public allowFutureObservation: boolean; - - /** - * Creates a new QuorumTx instance using the specified properties. - * @param [properties] Properties to set - * @returns QuorumTx instance - */ - public static create(properties?: common.IQuorumTx): common.QuorumTx; - - /** - * Encodes the specified QuorumTx message. Does not implicitly {@link common.QuorumTx.verify|verify} messages. - * @param message QuorumTx message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: common.IQuorumTx, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QuorumTx message, length delimited. Does not implicitly {@link common.QuorumTx.verify|verify} messages. - * @param message QuorumTx message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: common.IQuorumTx, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QuorumTx message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QuorumTx - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.QuorumTx; - - /** - * Decodes a QuorumTx message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QuorumTx - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.QuorumTx; - - /** - * Verifies a QuorumTx message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QuorumTx message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QuorumTx - */ - public static fromObject(object: { [k: string]: any }): common.QuorumTx; - - /** - * Creates a plain object from a QuorumTx message. Also converts values to other types if specified. - * @param message QuorumTx - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: common.QuorumTx, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QuorumTx to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QuorumState. */ - interface IQuorumState { - - /** QuorumState quoTxs */ - quoTxs?: (common.IQuorumTx[]|null); - - /** QuorumState quoNetworkFees */ - quoNetworkFees?: (common.IQuorumNetworkFee[]|null); - - /** QuorumState quoSolvencies */ - quoSolvencies?: (common.IQuorumSolvency[]|null); - - /** QuorumState quoErrataTxs */ - quoErrataTxs?: (common.IQuorumErrataTx[]|null); - - /** QuorumState quoPriceFeeds */ - quoPriceFeeds?: (common.IQuorumPriceFeed[]|null); - } - - /** Represents a QuorumState. */ - class QuorumState implements IQuorumState { - - /** - * Constructs a new QuorumState. - * @param [properties] Properties to set - */ - constructor(properties?: common.IQuorumState); - - /** QuorumState quoTxs. */ - public quoTxs: common.IQuorumTx[]; - - /** QuorumState quoNetworkFees. */ - public quoNetworkFees: common.IQuorumNetworkFee[]; - - /** QuorumState quoSolvencies. */ - public quoSolvencies: common.IQuorumSolvency[]; - - /** QuorumState quoErrataTxs. */ - public quoErrataTxs: common.IQuorumErrataTx[]; - - /** QuorumState quoPriceFeeds. */ - public quoPriceFeeds: common.IQuorumPriceFeed[]; - - /** - * Creates a new QuorumState instance using the specified properties. - * @param [properties] Properties to set - * @returns QuorumState instance - */ - public static create(properties?: common.IQuorumState): common.QuorumState; - - /** - * Encodes the specified QuorumState message. Does not implicitly {@link common.QuorumState.verify|verify} messages. - * @param message QuorumState message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: common.IQuorumState, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QuorumState message, length delimited. Does not implicitly {@link common.QuorumState.verify|verify} messages. - * @param message QuorumState message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: common.IQuorumState, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QuorumState message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QuorumState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.QuorumState; - - /** - * Decodes a QuorumState message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QuorumState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.QuorumState; - - /** - * Verifies a QuorumState message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QuorumState message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QuorumState - */ - public static fromObject(object: { [k: string]: any }): common.QuorumState; - - /** - * Creates a plain object from a QuorumState message. Also converts values to other types if specified. - * @param message QuorumState - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: common.QuorumState, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QuorumState to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a NetworkFee. */ - interface INetworkFee { - - /** NetworkFee height */ - height?: (number|Long|null); - - /** NetworkFee chain */ - chain?: (string|null); - - /** NetworkFee transactionSize */ - transactionSize?: (number|Long|null); - - /** NetworkFee transactionRate */ - transactionRate?: (number|Long|null); - } - - /** Represents a NetworkFee. */ - class NetworkFee implements INetworkFee { - - /** - * Constructs a new NetworkFee. - * @param [properties] Properties to set - */ - constructor(properties?: common.INetworkFee); - - /** NetworkFee height. */ - public height: (number|Long); - - /** NetworkFee chain. */ - public chain: string; - - /** NetworkFee transactionSize. */ - public transactionSize: (number|Long); - - /** NetworkFee transactionRate. */ - public transactionRate: (number|Long); - - /** - * Creates a new NetworkFee instance using the specified properties. - * @param [properties] Properties to set - * @returns NetworkFee instance - */ - public static create(properties?: common.INetworkFee): common.NetworkFee; - - /** - * Encodes the specified NetworkFee message. Does not implicitly {@link common.NetworkFee.verify|verify} messages. - * @param message NetworkFee message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: common.INetworkFee, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified NetworkFee message, length delimited. Does not implicitly {@link common.NetworkFee.verify|verify} messages. - * @param message NetworkFee message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: common.INetworkFee, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a NetworkFee message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns NetworkFee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.NetworkFee; - - /** - * Decodes a NetworkFee message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns NetworkFee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.NetworkFee; - - /** - * Verifies a NetworkFee message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a NetworkFee message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns NetworkFee - */ - public static fromObject(object: { [k: string]: any }): common.NetworkFee; - - /** - * Creates a plain object from a NetworkFee message. Also converts values to other types if specified. - * @param message NetworkFee - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: common.NetworkFee, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this NetworkFee to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an AttestNetworkFee. */ - interface IAttestNetworkFee { - - /** AttestNetworkFee networkFee */ - networkFee?: (common.INetworkFee|null); - - /** AttestNetworkFee attestation */ - attestation?: (common.IAttestation|null); - } - - /** Represents an AttestNetworkFee. */ - class AttestNetworkFee implements IAttestNetworkFee { - - /** - * Constructs a new AttestNetworkFee. - * @param [properties] Properties to set - */ - constructor(properties?: common.IAttestNetworkFee); - - /** AttestNetworkFee networkFee. */ - public networkFee?: (common.INetworkFee|null); - - /** AttestNetworkFee attestation. */ - public attestation?: (common.IAttestation|null); - - /** - * Creates a new AttestNetworkFee instance using the specified properties. - * @param [properties] Properties to set - * @returns AttestNetworkFee instance - */ - public static create(properties?: common.IAttestNetworkFee): common.AttestNetworkFee; - - /** - * Encodes the specified AttestNetworkFee message. Does not implicitly {@link common.AttestNetworkFee.verify|verify} messages. - * @param message AttestNetworkFee message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: common.IAttestNetworkFee, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AttestNetworkFee message, length delimited. Does not implicitly {@link common.AttestNetworkFee.verify|verify} messages. - * @param message AttestNetworkFee message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: common.IAttestNetworkFee, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AttestNetworkFee message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AttestNetworkFee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.AttestNetworkFee; - - /** - * Decodes an AttestNetworkFee message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AttestNetworkFee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.AttestNetworkFee; - - /** - * Verifies an AttestNetworkFee message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AttestNetworkFee message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AttestNetworkFee - */ - public static fromObject(object: { [k: string]: any }): common.AttestNetworkFee; - - /** - * Creates a plain object from an AttestNetworkFee message. Also converts values to other types if specified. - * @param message AttestNetworkFee - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: common.AttestNetworkFee, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AttestNetworkFee to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QuorumNetworkFee. */ - interface IQuorumNetworkFee { - - /** QuorumNetworkFee networkFee */ - networkFee?: (common.INetworkFee|null); - - /** QuorumNetworkFee attestations */ - attestations?: (common.IAttestation[]|null); - } - - /** Represents a QuorumNetworkFee. */ - class QuorumNetworkFee implements IQuorumNetworkFee { - - /** - * Constructs a new QuorumNetworkFee. - * @param [properties] Properties to set - */ - constructor(properties?: common.IQuorumNetworkFee); - - /** QuorumNetworkFee networkFee. */ - public networkFee?: (common.INetworkFee|null); - - /** QuorumNetworkFee attestations. */ - public attestations: common.IAttestation[]; - - /** - * Creates a new QuorumNetworkFee instance using the specified properties. - * @param [properties] Properties to set - * @returns QuorumNetworkFee instance - */ - public static create(properties?: common.IQuorumNetworkFee): common.QuorumNetworkFee; - - /** - * Encodes the specified QuorumNetworkFee message. Does not implicitly {@link common.QuorumNetworkFee.verify|verify} messages. - * @param message QuorumNetworkFee message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: common.IQuorumNetworkFee, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QuorumNetworkFee message, length delimited. Does not implicitly {@link common.QuorumNetworkFee.verify|verify} messages. - * @param message QuorumNetworkFee message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: common.IQuorumNetworkFee, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QuorumNetworkFee message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QuorumNetworkFee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.QuorumNetworkFee; - - /** - * Decodes a QuorumNetworkFee message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QuorumNetworkFee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.QuorumNetworkFee; - - /** - * Verifies a QuorumNetworkFee message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QuorumNetworkFee message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QuorumNetworkFee - */ - public static fromObject(object: { [k: string]: any }): common.QuorumNetworkFee; - - /** - * Creates a plain object from a QuorumNetworkFee message. Also converts values to other types if specified. - * @param message QuorumNetworkFee - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: common.QuorumNetworkFee, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QuorumNetworkFee to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Solvency. */ - interface ISolvency { - - /** Solvency id */ - id?: (string|null); - - /** Solvency chain */ - chain?: (string|null); - - /** Solvency pubKey */ - pubKey?: (string|null); - - /** Solvency coins */ - coins?: (common.ICoin[]|null); - - /** Solvency height */ - height?: (number|Long|null); - } - - /** Represents a Solvency. */ - class Solvency implements ISolvency { - - /** - * Constructs a new Solvency. - * @param [properties] Properties to set - */ - constructor(properties?: common.ISolvency); - - /** Solvency id. */ - public id: string; - - /** Solvency chain. */ - public chain: string; - - /** Solvency pubKey. */ - public pubKey: string; - - /** Solvency coins. */ - public coins: common.ICoin[]; - - /** Solvency height. */ - public height: (number|Long); - - /** - * Creates a new Solvency instance using the specified properties. - * @param [properties] Properties to set - * @returns Solvency instance - */ - public static create(properties?: common.ISolvency): common.Solvency; - - /** - * Encodes the specified Solvency message. Does not implicitly {@link common.Solvency.verify|verify} messages. - * @param message Solvency message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: common.ISolvency, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Solvency message, length delimited. Does not implicitly {@link common.Solvency.verify|verify} messages. - * @param message Solvency message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: common.ISolvency, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Solvency message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Solvency - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.Solvency; - - /** - * Decodes a Solvency message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Solvency - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.Solvency; - - /** - * Verifies a Solvency message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Solvency message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Solvency - */ - public static fromObject(object: { [k: string]: any }): common.Solvency; - - /** - * Creates a plain object from a Solvency message. Also converts values to other types if specified. - * @param message Solvency - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: common.Solvency, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Solvency to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an AttestSolvency. */ - interface IAttestSolvency { - - /** AttestSolvency solvency */ - solvency?: (common.ISolvency|null); - - /** AttestSolvency attestation */ - attestation?: (common.IAttestation|null); - } - - /** Represents an AttestSolvency. */ - class AttestSolvency implements IAttestSolvency { - - /** - * Constructs a new AttestSolvency. - * @param [properties] Properties to set - */ - constructor(properties?: common.IAttestSolvency); - - /** AttestSolvency solvency. */ - public solvency?: (common.ISolvency|null); - - /** AttestSolvency attestation. */ - public attestation?: (common.IAttestation|null); - - /** - * Creates a new AttestSolvency instance using the specified properties. - * @param [properties] Properties to set - * @returns AttestSolvency instance - */ - public static create(properties?: common.IAttestSolvency): common.AttestSolvency; - - /** - * Encodes the specified AttestSolvency message. Does not implicitly {@link common.AttestSolvency.verify|verify} messages. - * @param message AttestSolvency message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: common.IAttestSolvency, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AttestSolvency message, length delimited. Does not implicitly {@link common.AttestSolvency.verify|verify} messages. - * @param message AttestSolvency message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: common.IAttestSolvency, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AttestSolvency message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AttestSolvency - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.AttestSolvency; - - /** - * Decodes an AttestSolvency message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AttestSolvency - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.AttestSolvency; - - /** - * Verifies an AttestSolvency message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AttestSolvency message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AttestSolvency - */ - public static fromObject(object: { [k: string]: any }): common.AttestSolvency; - - /** - * Creates a plain object from an AttestSolvency message. Also converts values to other types if specified. - * @param message AttestSolvency - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: common.AttestSolvency, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AttestSolvency to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QuorumSolvency. */ - interface IQuorumSolvency { - - /** QuorumSolvency solvency */ - solvency?: (common.ISolvency|null); - - /** QuorumSolvency attestations */ - attestations?: (common.IAttestation[]|null); - } - - /** Represents a QuorumSolvency. */ - class QuorumSolvency implements IQuorumSolvency { - - /** - * Constructs a new QuorumSolvency. - * @param [properties] Properties to set - */ - constructor(properties?: common.IQuorumSolvency); - - /** QuorumSolvency solvency. */ - public solvency?: (common.ISolvency|null); - - /** QuorumSolvency attestations. */ - public attestations: common.IAttestation[]; - - /** - * Creates a new QuorumSolvency instance using the specified properties. - * @param [properties] Properties to set - * @returns QuorumSolvency instance - */ - public static create(properties?: common.IQuorumSolvency): common.QuorumSolvency; - - /** - * Encodes the specified QuorumSolvency message. Does not implicitly {@link common.QuorumSolvency.verify|verify} messages. - * @param message QuorumSolvency message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: common.IQuorumSolvency, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QuorumSolvency message, length delimited. Does not implicitly {@link common.QuorumSolvency.verify|verify} messages. - * @param message QuorumSolvency message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: common.IQuorumSolvency, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QuorumSolvency message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QuorumSolvency - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.QuorumSolvency; - - /** - * Decodes a QuorumSolvency message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QuorumSolvency - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.QuorumSolvency; - - /** - * Verifies a QuorumSolvency message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QuorumSolvency message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QuorumSolvency - */ - public static fromObject(object: { [k: string]: any }): common.QuorumSolvency; - - /** - * Creates a plain object from a QuorumSolvency message. Also converts values to other types if specified. - * @param message QuorumSolvency - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: common.QuorumSolvency, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QuorumSolvency to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an ErrataTx. */ - interface IErrataTx { - - /** ErrataTx id */ - id?: (string|null); - - /** ErrataTx chain */ - chain?: (string|null); - } - - /** Represents an ErrataTx. */ - class ErrataTx implements IErrataTx { - - /** - * Constructs a new ErrataTx. - * @param [properties] Properties to set - */ - constructor(properties?: common.IErrataTx); - - /** ErrataTx id. */ - public id: string; - - /** ErrataTx chain. */ - public chain: string; - - /** - * Creates a new ErrataTx instance using the specified properties. - * @param [properties] Properties to set - * @returns ErrataTx instance - */ - public static create(properties?: common.IErrataTx): common.ErrataTx; - - /** - * Encodes the specified ErrataTx message. Does not implicitly {@link common.ErrataTx.verify|verify} messages. - * @param message ErrataTx message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: common.IErrataTx, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ErrataTx message, length delimited. Does not implicitly {@link common.ErrataTx.verify|verify} messages. - * @param message ErrataTx message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: common.IErrataTx, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an ErrataTx message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ErrataTx - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.ErrataTx; - - /** - * Decodes an ErrataTx message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ErrataTx - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.ErrataTx; - - /** - * Verifies an ErrataTx message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an ErrataTx message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ErrataTx - */ - public static fromObject(object: { [k: string]: any }): common.ErrataTx; - - /** - * Creates a plain object from an ErrataTx message. Also converts values to other types if specified. - * @param message ErrataTx - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: common.ErrataTx, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ErrataTx to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an AttestErrataTx. */ - interface IAttestErrataTx { - - /** AttestErrataTx errataTx */ - errataTx?: (common.IErrataTx|null); - - /** AttestErrataTx attestation */ - attestation?: (common.IAttestation|null); - } - - /** Represents an AttestErrataTx. */ - class AttestErrataTx implements IAttestErrataTx { - - /** - * Constructs a new AttestErrataTx. - * @param [properties] Properties to set - */ - constructor(properties?: common.IAttestErrataTx); - - /** AttestErrataTx errataTx. */ - public errataTx?: (common.IErrataTx|null); - - /** AttestErrataTx attestation. */ - public attestation?: (common.IAttestation|null); - - /** - * Creates a new AttestErrataTx instance using the specified properties. - * @param [properties] Properties to set - * @returns AttestErrataTx instance - */ - public static create(properties?: common.IAttestErrataTx): common.AttestErrataTx; - - /** - * Encodes the specified AttestErrataTx message. Does not implicitly {@link common.AttestErrataTx.verify|verify} messages. - * @param message AttestErrataTx message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: common.IAttestErrataTx, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AttestErrataTx message, length delimited. Does not implicitly {@link common.AttestErrataTx.verify|verify} messages. - * @param message AttestErrataTx message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: common.IAttestErrataTx, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AttestErrataTx message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AttestErrataTx - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.AttestErrataTx; - - /** - * Decodes an AttestErrataTx message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AttestErrataTx - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.AttestErrataTx; - - /** - * Verifies an AttestErrataTx message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AttestErrataTx message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AttestErrataTx - */ - public static fromObject(object: { [k: string]: any }): common.AttestErrataTx; - - /** - * Creates a plain object from an AttestErrataTx message. Also converts values to other types if specified. - * @param message AttestErrataTx - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: common.AttestErrataTx, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AttestErrataTx to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QuorumErrataTx. */ - interface IQuorumErrataTx { - - /** QuorumErrataTx errataTx */ - errataTx?: (common.IErrataTx|null); - - /** QuorumErrataTx attestations */ - attestations?: (common.IAttestation[]|null); - } - - /** Represents a QuorumErrataTx. */ - class QuorumErrataTx implements IQuorumErrataTx { - - /** - * Constructs a new QuorumErrataTx. - * @param [properties] Properties to set - */ - constructor(properties?: common.IQuorumErrataTx); - - /** QuorumErrataTx errataTx. */ - public errataTx?: (common.IErrataTx|null); - - /** QuorumErrataTx attestations. */ - public attestations: common.IAttestation[]; - - /** - * Creates a new QuorumErrataTx instance using the specified properties. - * @param [properties] Properties to set - * @returns QuorumErrataTx instance - */ - public static create(properties?: common.IQuorumErrataTx): common.QuorumErrataTx; - - /** - * Encodes the specified QuorumErrataTx message. Does not implicitly {@link common.QuorumErrataTx.verify|verify} messages. - * @param message QuorumErrataTx message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: common.IQuorumErrataTx, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QuorumErrataTx message, length delimited. Does not implicitly {@link common.QuorumErrataTx.verify|verify} messages. - * @param message QuorumErrataTx message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: common.IQuorumErrataTx, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QuorumErrataTx message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QuorumErrataTx - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.QuorumErrataTx; - - /** - * Decodes a QuorumErrataTx message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QuorumErrataTx - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.QuorumErrataTx; - - /** - * Verifies a QuorumErrataTx message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QuorumErrataTx message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QuorumErrataTx - */ - public static fromObject(object: { [k: string]: any }): common.QuorumErrataTx; - - /** - * Creates a plain object from a QuorumErrataTx message. Also converts values to other types if specified. - * @param message QuorumErrataTx - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: common.QuorumErrataTx, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QuorumErrataTx to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a PriceFeed. */ - interface IPriceFeed { - - /** PriceFeed version */ - version?: (Uint8Array|null); - - /** PriceFeed time */ - time?: (number|Long|null); - - /** PriceFeed rates */ - rates?: (common.IOraclePrice[]|null); - } - - /** Represents a PriceFeed. */ - class PriceFeed implements IPriceFeed { - - /** - * Constructs a new PriceFeed. - * @param [properties] Properties to set - */ - constructor(properties?: common.IPriceFeed); - - /** PriceFeed version. */ - public version: Uint8Array; - - /** PriceFeed time. */ - public time: (number|Long); - - /** PriceFeed rates. */ - public rates: common.IOraclePrice[]; - - /** - * Creates a new PriceFeed instance using the specified properties. - * @param [properties] Properties to set - * @returns PriceFeed instance - */ - public static create(properties?: common.IPriceFeed): common.PriceFeed; - - /** - * Encodes the specified PriceFeed message. Does not implicitly {@link common.PriceFeed.verify|verify} messages. - * @param message PriceFeed message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: common.IPriceFeed, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PriceFeed message, length delimited. Does not implicitly {@link common.PriceFeed.verify|verify} messages. - * @param message PriceFeed message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: common.IPriceFeed, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PriceFeed message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PriceFeed - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.PriceFeed; - - /** - * Decodes a PriceFeed message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PriceFeed - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.PriceFeed; - - /** - * Verifies a PriceFeed message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PriceFeed message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PriceFeed - */ - public static fromObject(object: { [k: string]: any }): common.PriceFeed; - - /** - * Creates a plain object from a PriceFeed message. Also converts values to other types if specified. - * @param message PriceFeed - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: common.PriceFeed, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PriceFeed to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an AttestPriceFeed. */ - interface IAttestPriceFeed { - - /** AttestPriceFeed priceFeed */ - priceFeed?: (common.IPriceFeed|null); - - /** AttestPriceFeed attestation */ - attestation?: (common.IAttestation|null); - } - - /** Represents an AttestPriceFeed. */ - class AttestPriceFeed implements IAttestPriceFeed { - - /** - * Constructs a new AttestPriceFeed. - * @param [properties] Properties to set - */ - constructor(properties?: common.IAttestPriceFeed); - - /** AttestPriceFeed priceFeed. */ - public priceFeed?: (common.IPriceFeed|null); - - /** AttestPriceFeed attestation. */ - public attestation?: (common.IAttestation|null); - - /** - * Creates a new AttestPriceFeed instance using the specified properties. - * @param [properties] Properties to set - * @returns AttestPriceFeed instance - */ - public static create(properties?: common.IAttestPriceFeed): common.AttestPriceFeed; - - /** - * Encodes the specified AttestPriceFeed message. Does not implicitly {@link common.AttestPriceFeed.verify|verify} messages. - * @param message AttestPriceFeed message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: common.IAttestPriceFeed, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AttestPriceFeed message, length delimited. Does not implicitly {@link common.AttestPriceFeed.verify|verify} messages. - * @param message AttestPriceFeed message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: common.IAttestPriceFeed, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AttestPriceFeed message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AttestPriceFeed - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.AttestPriceFeed; - - /** - * Decodes an AttestPriceFeed message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AttestPriceFeed - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.AttestPriceFeed; - - /** - * Verifies an AttestPriceFeed message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AttestPriceFeed message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AttestPriceFeed - */ - public static fromObject(object: { [k: string]: any }): common.AttestPriceFeed; - - /** - * Creates a plain object from an AttestPriceFeed message. Also converts values to other types if specified. - * @param message AttestPriceFeed - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: common.AttestPriceFeed, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AttestPriceFeed to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QuorumPriceFeed. */ - interface IQuorumPriceFeed { - - /** QuorumPriceFeed priceFeed */ - priceFeed?: (common.IPriceFeed|null); - - /** QuorumPriceFeed attestations */ - attestations?: (common.IAttestation[]|null); - } - - /** Represents a QuorumPriceFeed. */ - class QuorumPriceFeed implements IQuorumPriceFeed { - - /** - * Constructs a new QuorumPriceFeed. - * @param [properties] Properties to set - */ - constructor(properties?: common.IQuorumPriceFeed); - - /** QuorumPriceFeed priceFeed. */ - public priceFeed?: (common.IPriceFeed|null); - - /** QuorumPriceFeed attestations. */ - public attestations: common.IAttestation[]; - - /** - * Creates a new QuorumPriceFeed instance using the specified properties. - * @param [properties] Properties to set - * @returns QuorumPriceFeed instance - */ - public static create(properties?: common.IQuorumPriceFeed): common.QuorumPriceFeed; - - /** - * Encodes the specified QuorumPriceFeed message. Does not implicitly {@link common.QuorumPriceFeed.verify|verify} messages. - * @param message QuorumPriceFeed message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: common.IQuorumPriceFeed, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QuorumPriceFeed message, length delimited. Does not implicitly {@link common.QuorumPriceFeed.verify|verify} messages. - * @param message QuorumPriceFeed message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: common.IQuorumPriceFeed, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QuorumPriceFeed message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QuorumPriceFeed - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.QuorumPriceFeed; - - /** - * Decodes a QuorumPriceFeed message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QuorumPriceFeed - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.QuorumPriceFeed; - - /** - * Verifies a QuorumPriceFeed message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QuorumPriceFeed message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QuorumPriceFeed - */ - public static fromObject(object: { [k: string]: any }): common.QuorumPriceFeed; - - /** - * Creates a plain object from a QuorumPriceFeed message. Also converts values to other types if specified. - * @param message QuorumPriceFeed - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: common.QuorumPriceFeed, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QuorumPriceFeed to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a QuorumPriceFeedBatch. */ - interface IQuorumPriceFeedBatch { - - /** QuorumPriceFeedBatch quorumPriceFeeds */ - quorumPriceFeeds?: (common.IQuorumPriceFeed[]|null); - } - - /** Represents a QuorumPriceFeedBatch. */ - class QuorumPriceFeedBatch implements IQuorumPriceFeedBatch { - - /** - * Constructs a new QuorumPriceFeedBatch. - * @param [properties] Properties to set - */ - constructor(properties?: common.IQuorumPriceFeedBatch); - - /** QuorumPriceFeedBatch quorumPriceFeeds. */ - public quorumPriceFeeds: common.IQuorumPriceFeed[]; - - /** - * Creates a new QuorumPriceFeedBatch instance using the specified properties. - * @param [properties] Properties to set - * @returns QuorumPriceFeedBatch instance - */ - public static create(properties?: common.IQuorumPriceFeedBatch): common.QuorumPriceFeedBatch; - - /** - * Encodes the specified QuorumPriceFeedBatch message. Does not implicitly {@link common.QuorumPriceFeedBatch.verify|verify} messages. - * @param message QuorumPriceFeedBatch message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: common.IQuorumPriceFeedBatch, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified QuorumPriceFeedBatch message, length delimited. Does not implicitly {@link common.QuorumPriceFeedBatch.verify|verify} messages. - * @param message QuorumPriceFeedBatch message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: common.IQuorumPriceFeedBatch, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a QuorumPriceFeedBatch message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns QuorumPriceFeedBatch - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.QuorumPriceFeedBatch; - - /** - * Decodes a QuorumPriceFeedBatch message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns QuorumPriceFeedBatch - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.QuorumPriceFeedBatch; - - /** - * Verifies a QuorumPriceFeedBatch message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a QuorumPriceFeedBatch message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns QuorumPriceFeedBatch - */ - public static fromObject(object: { [k: string]: any }): common.QuorumPriceFeedBatch; - - /** - * Creates a plain object from a QuorumPriceFeedBatch message. Also converts values to other types if specified. - * @param message QuorumPriceFeedBatch - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: common.QuorumPriceFeedBatch, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this QuorumPriceFeedBatch to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an OraclePrice. */ - interface IOraclePrice { - - /** OraclePrice amount */ - amount?: (number|Long|null); - - /** OraclePrice decimals */ - decimals?: (number|null); - } - - /** Represents an OraclePrice. */ - class OraclePrice implements IOraclePrice { - - /** - * Constructs a new OraclePrice. - * @param [properties] Properties to set - */ - constructor(properties?: common.IOraclePrice); - - /** OraclePrice amount. */ - public amount: (number|Long); - - /** OraclePrice decimals. */ - public decimals: number; - - /** - * Creates a new OraclePrice instance using the specified properties. - * @param [properties] Properties to set - * @returns OraclePrice instance - */ - public static create(properties?: common.IOraclePrice): common.OraclePrice; - - /** - * Encodes the specified OraclePrice message. Does not implicitly {@link common.OraclePrice.verify|verify} messages. - * @param message OraclePrice message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: common.IOraclePrice, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified OraclePrice message, length delimited. Does not implicitly {@link common.OraclePrice.verify|verify} messages. - * @param message OraclePrice message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: common.IOraclePrice, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an OraclePrice message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns OraclePrice - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.OraclePrice; - - /** - * Decodes an OraclePrice message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns OraclePrice - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.OraclePrice; - - /** - * Verifies an OraclePrice message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an OraclePrice message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns OraclePrice - */ - public static fromObject(object: { [k: string]: any }): common.OraclePrice; - - /** - * Creates a plain object from an OraclePrice message. Also converts values to other types if specified. - * @param message OraclePrice - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: common.OraclePrice, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this OraclePrice to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an AttestationBatch. */ - interface IAttestationBatch { - - /** AttestationBatch attestTxs */ - attestTxs?: (common.IAttestTx[]|null); - - /** AttestationBatch attestNetworkFees */ - attestNetworkFees?: (common.IAttestNetworkFee[]|null); - - /** AttestationBatch attestSolvencies */ - attestSolvencies?: (common.IAttestSolvency[]|null); - - /** AttestationBatch attestErrataTxs */ - attestErrataTxs?: (common.IAttestErrataTx[]|null); - - /** AttestationBatch attestPriceFeeds */ - attestPriceFeeds?: (common.IAttestPriceFeed[]|null); - } - - /** Represents an AttestationBatch. */ - class AttestationBatch implements IAttestationBatch { - - /** - * Constructs a new AttestationBatch. - * @param [properties] Properties to set - */ - constructor(properties?: common.IAttestationBatch); - - /** AttestationBatch attestTxs. */ - public attestTxs: common.IAttestTx[]; - - /** AttestationBatch attestNetworkFees. */ - public attestNetworkFees: common.IAttestNetworkFee[]; - - /** AttestationBatch attestSolvencies. */ - public attestSolvencies: common.IAttestSolvency[]; - - /** AttestationBatch attestErrataTxs. */ - public attestErrataTxs: common.IAttestErrataTx[]; - - /** AttestationBatch attestPriceFeeds. */ - public attestPriceFeeds: common.IAttestPriceFeed[]; - - /** - * Creates a new AttestationBatch instance using the specified properties. - * @param [properties] Properties to set - * @returns AttestationBatch instance - */ - public static create(properties?: common.IAttestationBatch): common.AttestationBatch; - - /** - * Encodes the specified AttestationBatch message. Does not implicitly {@link common.AttestationBatch.verify|verify} messages. - * @param message AttestationBatch message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: common.IAttestationBatch, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified AttestationBatch message, length delimited. Does not implicitly {@link common.AttestationBatch.verify|verify} messages. - * @param message AttestationBatch message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: common.IAttestationBatch, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an AttestationBatch message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns AttestationBatch - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.AttestationBatch; - - /** - * Decodes an AttestationBatch message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns AttestationBatch - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.AttestationBatch; - - /** - * Verifies an AttestationBatch message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an AttestationBatch message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns AttestationBatch - */ - public static fromObject(object: { [k: string]: any }): common.AttestationBatch; - - /** - * Creates a plain object from an AttestationBatch message. Also converts values to other types if specified. - * @param message AttestationBatch - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: common.AttestationBatch, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this AttestationBatch to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } } /** Namespace types. */ diff --git a/packages/xchain-thorchain/src/types/proto/MsgCompiled.js b/packages/xchain-thorchain/src/types/proto/MsgCompiled.js index 03f8d7660..b2ebddc85 100644 --- a/packages/xchain-thorchain/src/types/proto/MsgCompiled.js +++ b/packages/xchain-thorchain/src/types/proto/MsgCompiled.js @@ -1559,5415 +1559,6 @@ $root.common = (function() { return ProtoUint; })(); - /** - * Status enum. - * @name common.Status - * @enum {number} - * @property {number} incomplete=0 incomplete value - * @property {number} done=1 done value - * @property {number} reverted=2 reverted value - */ - common.Status = (function() { - var valuesById = {}, values = Object.create(valuesById); - values[valuesById[0] = "incomplete"] = 0; - values[valuesById[1] = "done"] = 1; - values[valuesById[2] = "reverted"] = 2; - return values; - })(); - - common.ObservedTx = (function() { - - /** - * Properties of an ObservedTx. - * @memberof common - * @interface IObservedTx - * @property {common.ITx|null} [tx] ObservedTx tx - * @property {common.Status|null} [status] ObservedTx status - * @property {Array.|null} [outHashes] ObservedTx outHashes - * @property {number|Long|null} [blockHeight] ObservedTx blockHeight - * @property {Array.|null} [signers] ObservedTx signers - * @property {string|null} [observedPubKey] ObservedTx observedPubKey - * @property {number|Long|null} [keysignMs] ObservedTx keysignMs - * @property {number|Long|null} [finaliseHeight] ObservedTx finaliseHeight - * @property {string|null} [aggregator] ObservedTx aggregator - * @property {string|null} [aggregatorTarget] ObservedTx aggregatorTarget - * @property {string|null} [aggregatorTargetLimit] ObservedTx aggregatorTargetLimit - */ - - /** - * Constructs a new ObservedTx. - * @memberof common - * @classdesc Represents an ObservedTx. - * @implements IObservedTx - * @constructor - * @param {common.IObservedTx=} [properties] Properties to set - */ - function ObservedTx(properties) { - this.outHashes = []; - this.signers = []; - 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]]; - } - - /** - * ObservedTx tx. - * @member {common.ITx|null|undefined} tx - * @memberof common.ObservedTx - * @instance - */ - ObservedTx.prototype.tx = null; - - /** - * ObservedTx status. - * @member {common.Status} status - * @memberof common.ObservedTx - * @instance - */ - ObservedTx.prototype.status = 0; - - /** - * ObservedTx outHashes. - * @member {Array.} outHashes - * @memberof common.ObservedTx - * @instance - */ - ObservedTx.prototype.outHashes = $util.emptyArray; - - /** - * ObservedTx blockHeight. - * @member {number|Long} blockHeight - * @memberof common.ObservedTx - * @instance - */ - ObservedTx.prototype.blockHeight = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * ObservedTx signers. - * @member {Array.} signers - * @memberof common.ObservedTx - * @instance - */ - ObservedTx.prototype.signers = $util.emptyArray; - - /** - * ObservedTx observedPubKey. - * @member {string} observedPubKey - * @memberof common.ObservedTx - * @instance - */ - ObservedTx.prototype.observedPubKey = ""; - - /** - * ObservedTx keysignMs. - * @member {number|Long} keysignMs - * @memberof common.ObservedTx - * @instance - */ - ObservedTx.prototype.keysignMs = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * ObservedTx finaliseHeight. - * @member {number|Long} finaliseHeight - * @memberof common.ObservedTx - * @instance - */ - ObservedTx.prototype.finaliseHeight = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * ObservedTx aggregator. - * @member {string} aggregator - * @memberof common.ObservedTx - * @instance - */ - ObservedTx.prototype.aggregator = ""; - - /** - * ObservedTx aggregatorTarget. - * @member {string} aggregatorTarget - * @memberof common.ObservedTx - * @instance - */ - ObservedTx.prototype.aggregatorTarget = ""; - - /** - * ObservedTx aggregatorTargetLimit. - * @member {string} aggregatorTargetLimit - * @memberof common.ObservedTx - * @instance - */ - ObservedTx.prototype.aggregatorTargetLimit = ""; - - /** - * Creates a new ObservedTx instance using the specified properties. - * @function create - * @memberof common.ObservedTx - * @static - * @param {common.IObservedTx=} [properties] Properties to set - * @returns {common.ObservedTx} ObservedTx instance - */ - ObservedTx.create = function create(properties) { - return new ObservedTx(properties); - }; - - /** - * Encodes the specified ObservedTx message. Does not implicitly {@link common.ObservedTx.verify|verify} messages. - * @function encode - * @memberof common.ObservedTx - * @static - * @param {common.IObservedTx} message ObservedTx message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ObservedTx.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.tx != null && Object.hasOwnProperty.call(message, "tx")) - $root.common.Tx.encode(message.tx, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.status != null && Object.hasOwnProperty.call(message, "status")) - writer.uint32(/* id 2, wireType 0 =*/16).int32(message.status); - if (message.outHashes != null && message.outHashes.length) - for (var i = 0; i < message.outHashes.length; ++i) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.outHashes[i]); - if (message.blockHeight != null && Object.hasOwnProperty.call(message, "blockHeight")) - writer.uint32(/* id 4, wireType 0 =*/32).int64(message.blockHeight); - if (message.signers != null && message.signers.length) - for (var i = 0; i < message.signers.length; ++i) - writer.uint32(/* id 5, wireType 2 =*/42).string(message.signers[i]); - if (message.observedPubKey != null && Object.hasOwnProperty.call(message, "observedPubKey")) - writer.uint32(/* id 6, wireType 2 =*/50).string(message.observedPubKey); - if (message.keysignMs != null && Object.hasOwnProperty.call(message, "keysignMs")) - writer.uint32(/* id 7, wireType 0 =*/56).int64(message.keysignMs); - if (message.finaliseHeight != null && Object.hasOwnProperty.call(message, "finaliseHeight")) - writer.uint32(/* id 8, wireType 0 =*/64).int64(message.finaliseHeight); - if (message.aggregator != null && Object.hasOwnProperty.call(message, "aggregator")) - writer.uint32(/* id 9, wireType 2 =*/74).string(message.aggregator); - if (message.aggregatorTarget != null && Object.hasOwnProperty.call(message, "aggregatorTarget")) - writer.uint32(/* id 10, wireType 2 =*/82).string(message.aggregatorTarget); - if (message.aggregatorTargetLimit != null && Object.hasOwnProperty.call(message, "aggregatorTargetLimit")) - writer.uint32(/* id 11, wireType 2 =*/90).string(message.aggregatorTargetLimit); - return writer; - }; - - /** - * Encodes the specified ObservedTx message, length delimited. Does not implicitly {@link common.ObservedTx.verify|verify} messages. - * @function encodeDelimited - * @memberof common.ObservedTx - * @static - * @param {common.IObservedTx} message ObservedTx message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ObservedTx.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ObservedTx message from the specified reader or buffer. - * @function decode - * @memberof common.ObservedTx - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {common.ObservedTx} ObservedTx - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ObservedTx.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.common.ObservedTx(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.tx = $root.common.Tx.decode(reader, reader.uint32()); - break; - case 2: - message.status = reader.int32(); - break; - case 3: - if (!(message.outHashes && message.outHashes.length)) - message.outHashes = []; - message.outHashes.push(reader.string()); - break; - case 4: - message.blockHeight = reader.int64(); - break; - case 5: - if (!(message.signers && message.signers.length)) - message.signers = []; - message.signers.push(reader.string()); - break; - case 6: - message.observedPubKey = reader.string(); - break; - case 7: - message.keysignMs = reader.int64(); - break; - case 8: - message.finaliseHeight = reader.int64(); - break; - case 9: - message.aggregator = reader.string(); - break; - case 10: - message.aggregatorTarget = reader.string(); - break; - case 11: - message.aggregatorTargetLimit = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ObservedTx message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof common.ObservedTx - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {common.ObservedTx} ObservedTx - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ObservedTx.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ObservedTx message. - * @function verify - * @memberof common.ObservedTx - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ObservedTx.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.tx != null && message.hasOwnProperty("tx")) { - var error = $root.common.Tx.verify(message.tx); - if (error) - return "tx." + error; - } - if (message.status != null && message.hasOwnProperty("status")) - switch (message.status) { - default: - return "status: enum value expected"; - case 0: - case 1: - case 2: - break; - } - if (message.outHashes != null && message.hasOwnProperty("outHashes")) { - if (!Array.isArray(message.outHashes)) - return "outHashes: array expected"; - for (var i = 0; i < message.outHashes.length; ++i) - if (!$util.isString(message.outHashes[i])) - return "outHashes: string[] expected"; - } - if (message.blockHeight != null && message.hasOwnProperty("blockHeight")) - if (!$util.isInteger(message.blockHeight) && !(message.blockHeight && $util.isInteger(message.blockHeight.low) && $util.isInteger(message.blockHeight.high))) - return "blockHeight: integer|Long expected"; - if (message.signers != null && message.hasOwnProperty("signers")) { - if (!Array.isArray(message.signers)) - return "signers: array expected"; - for (var i = 0; i < message.signers.length; ++i) - if (!$util.isString(message.signers[i])) - return "signers: string[] expected"; - } - if (message.observedPubKey != null && message.hasOwnProperty("observedPubKey")) - if (!$util.isString(message.observedPubKey)) - return "observedPubKey: string expected"; - if (message.keysignMs != null && message.hasOwnProperty("keysignMs")) - if (!$util.isInteger(message.keysignMs) && !(message.keysignMs && $util.isInteger(message.keysignMs.low) && $util.isInteger(message.keysignMs.high))) - return "keysignMs: integer|Long expected"; - if (message.finaliseHeight != null && message.hasOwnProperty("finaliseHeight")) - if (!$util.isInteger(message.finaliseHeight) && !(message.finaliseHeight && $util.isInteger(message.finaliseHeight.low) && $util.isInteger(message.finaliseHeight.high))) - return "finaliseHeight: integer|Long expected"; - if (message.aggregator != null && message.hasOwnProperty("aggregator")) - if (!$util.isString(message.aggregator)) - return "aggregator: string expected"; - if (message.aggregatorTarget != null && message.hasOwnProperty("aggregatorTarget")) - if (!$util.isString(message.aggregatorTarget)) - return "aggregatorTarget: string expected"; - if (message.aggregatorTargetLimit != null && message.hasOwnProperty("aggregatorTargetLimit")) - if (!$util.isString(message.aggregatorTargetLimit)) - return "aggregatorTargetLimit: string expected"; - return null; - }; - - /** - * Creates an ObservedTx message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof common.ObservedTx - * @static - * @param {Object.} object Plain object - * @returns {common.ObservedTx} ObservedTx - */ - ObservedTx.fromObject = function fromObject(object) { - if (object instanceof $root.common.ObservedTx) - return object; - var message = new $root.common.ObservedTx(); - if (object.tx != null) { - if (typeof object.tx !== "object") - throw TypeError(".common.ObservedTx.tx: object expected"); - message.tx = $root.common.Tx.fromObject(object.tx); - } - switch (object.status) { - case "incomplete": - case 0: - message.status = 0; - break; - case "done": - case 1: - message.status = 1; - break; - case "reverted": - case 2: - message.status = 2; - break; - } - if (object.outHashes) { - if (!Array.isArray(object.outHashes)) - throw TypeError(".common.ObservedTx.outHashes: array expected"); - message.outHashes = []; - for (var i = 0; i < object.outHashes.length; ++i) - message.outHashes[i] = String(object.outHashes[i]); - } - if (object.blockHeight != null) - if ($util.Long) - (message.blockHeight = $util.Long.fromValue(object.blockHeight)).unsigned = false; - else if (typeof object.blockHeight === "string") - message.blockHeight = parseInt(object.blockHeight, 10); - else if (typeof object.blockHeight === "number") - message.blockHeight = object.blockHeight; - else if (typeof object.blockHeight === "object") - message.blockHeight = new $util.LongBits(object.blockHeight.low >>> 0, object.blockHeight.high >>> 0).toNumber(); - if (object.signers) { - if (!Array.isArray(object.signers)) - throw TypeError(".common.ObservedTx.signers: array expected"); - message.signers = []; - for (var i = 0; i < object.signers.length; ++i) - message.signers[i] = String(object.signers[i]); - } - if (object.observedPubKey != null) - message.observedPubKey = String(object.observedPubKey); - if (object.keysignMs != null) - if ($util.Long) - (message.keysignMs = $util.Long.fromValue(object.keysignMs)).unsigned = false; - else if (typeof object.keysignMs === "string") - message.keysignMs = parseInt(object.keysignMs, 10); - else if (typeof object.keysignMs === "number") - message.keysignMs = object.keysignMs; - else if (typeof object.keysignMs === "object") - message.keysignMs = new $util.LongBits(object.keysignMs.low >>> 0, object.keysignMs.high >>> 0).toNumber(); - if (object.finaliseHeight != null) - if ($util.Long) - (message.finaliseHeight = $util.Long.fromValue(object.finaliseHeight)).unsigned = false; - else if (typeof object.finaliseHeight === "string") - message.finaliseHeight = parseInt(object.finaliseHeight, 10); - else if (typeof object.finaliseHeight === "number") - message.finaliseHeight = object.finaliseHeight; - else if (typeof object.finaliseHeight === "object") - message.finaliseHeight = new $util.LongBits(object.finaliseHeight.low >>> 0, object.finaliseHeight.high >>> 0).toNumber(); - if (object.aggregator != null) - message.aggregator = String(object.aggregator); - if (object.aggregatorTarget != null) - message.aggregatorTarget = String(object.aggregatorTarget); - if (object.aggregatorTargetLimit != null) - message.aggregatorTargetLimit = String(object.aggregatorTargetLimit); - return message; - }; - - /** - * Creates a plain object from an ObservedTx message. Also converts values to other types if specified. - * @function toObject - * @memberof common.ObservedTx - * @static - * @param {common.ObservedTx} message ObservedTx - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ObservedTx.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.outHashes = []; - object.signers = []; - } - if (options.defaults) { - object.tx = null; - object.status = options.enums === String ? "incomplete" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.blockHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.blockHeight = options.longs === String ? "0" : 0; - object.observedPubKey = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.keysignMs = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.keysignMs = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.finaliseHeight = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.finaliseHeight = options.longs === String ? "0" : 0; - object.aggregator = ""; - object.aggregatorTarget = ""; - object.aggregatorTargetLimit = ""; - } - if (message.tx != null && message.hasOwnProperty("tx")) - object.tx = $root.common.Tx.toObject(message.tx, options); - if (message.status != null && message.hasOwnProperty("status")) - object.status = options.enums === String ? $root.common.Status[message.status] : message.status; - if (message.outHashes && message.outHashes.length) { - object.outHashes = []; - for (var j = 0; j < message.outHashes.length; ++j) - object.outHashes[j] = message.outHashes[j]; - } - if (message.blockHeight != null && message.hasOwnProperty("blockHeight")) - if (typeof message.blockHeight === "number") - object.blockHeight = options.longs === String ? String(message.blockHeight) : message.blockHeight; - else - object.blockHeight = options.longs === String ? $util.Long.prototype.toString.call(message.blockHeight) : options.longs === Number ? new $util.LongBits(message.blockHeight.low >>> 0, message.blockHeight.high >>> 0).toNumber() : message.blockHeight; - if (message.signers && message.signers.length) { - object.signers = []; - for (var j = 0; j < message.signers.length; ++j) - object.signers[j] = message.signers[j]; - } - if (message.observedPubKey != null && message.hasOwnProperty("observedPubKey")) - object.observedPubKey = message.observedPubKey; - if (message.keysignMs != null && message.hasOwnProperty("keysignMs")) - if (typeof message.keysignMs === "number") - object.keysignMs = options.longs === String ? String(message.keysignMs) : message.keysignMs; - else - object.keysignMs = options.longs === String ? $util.Long.prototype.toString.call(message.keysignMs) : options.longs === Number ? new $util.LongBits(message.keysignMs.low >>> 0, message.keysignMs.high >>> 0).toNumber() : message.keysignMs; - if (message.finaliseHeight != null && message.hasOwnProperty("finaliseHeight")) - if (typeof message.finaliseHeight === "number") - object.finaliseHeight = options.longs === String ? String(message.finaliseHeight) : message.finaliseHeight; - else - object.finaliseHeight = options.longs === String ? $util.Long.prototype.toString.call(message.finaliseHeight) : options.longs === Number ? new $util.LongBits(message.finaliseHeight.low >>> 0, message.finaliseHeight.high >>> 0).toNumber() : message.finaliseHeight; - if (message.aggregator != null && message.hasOwnProperty("aggregator")) - object.aggregator = message.aggregator; - if (message.aggregatorTarget != null && message.hasOwnProperty("aggregatorTarget")) - object.aggregatorTarget = message.aggregatorTarget; - if (message.aggregatorTargetLimit != null && message.hasOwnProperty("aggregatorTargetLimit")) - object.aggregatorTargetLimit = message.aggregatorTargetLimit; - return object; - }; - - /** - * Converts this ObservedTx to JSON. - * @function toJSON - * @memberof common.ObservedTx - * @instance - * @returns {Object.} JSON object - */ - ObservedTx.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ObservedTx; - })(); - - common.Attestation = (function() { - - /** - * Properties of an Attestation. - * @memberof common - * @interface IAttestation - * @property {Uint8Array|null} [PubKey] Attestation PubKey - * @property {Uint8Array|null} [Signature] Attestation Signature - */ - - /** - * Constructs a new Attestation. - * @memberof common - * @classdesc Represents an Attestation. - * @implements IAttestation - * @constructor - * @param {common.IAttestation=} [properties] Properties to set - */ - function Attestation(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]]; - } - - /** - * Attestation PubKey. - * @member {Uint8Array} PubKey - * @memberof common.Attestation - * @instance - */ - Attestation.prototype.PubKey = $util.newBuffer([]); - - /** - * Attestation Signature. - * @member {Uint8Array} Signature - * @memberof common.Attestation - * @instance - */ - Attestation.prototype.Signature = $util.newBuffer([]); - - /** - * Creates a new Attestation instance using the specified properties. - * @function create - * @memberof common.Attestation - * @static - * @param {common.IAttestation=} [properties] Properties to set - * @returns {common.Attestation} Attestation instance - */ - Attestation.create = function create(properties) { - return new Attestation(properties); - }; - - /** - * Encodes the specified Attestation message. Does not implicitly {@link common.Attestation.verify|verify} messages. - * @function encode - * @memberof common.Attestation - * @static - * @param {common.IAttestation} message Attestation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Attestation.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.PubKey != null && Object.hasOwnProperty.call(message, "PubKey")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.PubKey); - if (message.Signature != null && Object.hasOwnProperty.call(message, "Signature")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.Signature); - return writer; - }; - - /** - * Encodes the specified Attestation message, length delimited. Does not implicitly {@link common.Attestation.verify|verify} messages. - * @function encodeDelimited - * @memberof common.Attestation - * @static - * @param {common.IAttestation} message Attestation message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Attestation.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an Attestation message from the specified reader or buffer. - * @function decode - * @memberof common.Attestation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {common.Attestation} Attestation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Attestation.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.common.Attestation(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.PubKey = reader.bytes(); - break; - case 2: - message.Signature = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an Attestation message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof common.Attestation - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {common.Attestation} Attestation - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Attestation.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an Attestation message. - * @function verify - * @memberof common.Attestation - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Attestation.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.PubKey != null && message.hasOwnProperty("PubKey")) - if (!(message.PubKey && typeof message.PubKey.length === "number" || $util.isString(message.PubKey))) - return "PubKey: buffer expected"; - if (message.Signature != null && message.hasOwnProperty("Signature")) - if (!(message.Signature && typeof message.Signature.length === "number" || $util.isString(message.Signature))) - return "Signature: buffer expected"; - return null; - }; - - /** - * Creates an Attestation message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof common.Attestation - * @static - * @param {Object.} object Plain object - * @returns {common.Attestation} Attestation - */ - Attestation.fromObject = function fromObject(object) { - if (object instanceof $root.common.Attestation) - return object; - var message = new $root.common.Attestation(); - if (object.PubKey != null) - if (typeof object.PubKey === "string") - $util.base64.decode(object.PubKey, message.PubKey = $util.newBuffer($util.base64.length(object.PubKey)), 0); - else if (object.PubKey.length) - message.PubKey = object.PubKey; - if (object.Signature != null) - if (typeof object.Signature === "string") - $util.base64.decode(object.Signature, message.Signature = $util.newBuffer($util.base64.length(object.Signature)), 0); - else if (object.Signature.length) - message.Signature = object.Signature; - return message; - }; - - /** - * Creates a plain object from an Attestation message. Also converts values to other types if specified. - * @function toObject - * @memberof common.Attestation - * @static - * @param {common.Attestation} message Attestation - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Attestation.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if (options.bytes === String) - object.PubKey = ""; - else { - object.PubKey = []; - if (options.bytes !== Array) - object.PubKey = $util.newBuffer(object.PubKey); - } - if (options.bytes === String) - object.Signature = ""; - else { - object.Signature = []; - if (options.bytes !== Array) - object.Signature = $util.newBuffer(object.Signature); - } - } - if (message.PubKey != null && message.hasOwnProperty("PubKey")) - object.PubKey = options.bytes === String ? $util.base64.encode(message.PubKey, 0, message.PubKey.length) : options.bytes === Array ? Array.prototype.slice.call(message.PubKey) : message.PubKey; - if (message.Signature != null && message.hasOwnProperty("Signature")) - object.Signature = options.bytes === String ? $util.base64.encode(message.Signature, 0, message.Signature.length) : options.bytes === Array ? Array.prototype.slice.call(message.Signature) : message.Signature; - return object; - }; - - /** - * Converts this Attestation to JSON. - * @function toJSON - * @memberof common.Attestation - * @instance - * @returns {Object.} JSON object - */ - Attestation.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Attestation; - })(); - - common.AttestTx = (function() { - - /** - * Properties of an AttestTx. - * @memberof common - * @interface IAttestTx - * @property {common.IObservedTx|null} [obsTx] AttestTx obsTx - * @property {common.IAttestation|null} [attestation] AttestTx attestation - * @property {boolean|null} [inbound] AttestTx inbound - * @property {boolean|null} [allowFutureObservation] AttestTx allowFutureObservation - */ - - /** - * Constructs a new AttestTx. - * @memberof common - * @classdesc Represents an AttestTx. - * @implements IAttestTx - * @constructor - * @param {common.IAttestTx=} [properties] Properties to set - */ - function AttestTx(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]]; - } - - /** - * AttestTx obsTx. - * @member {common.IObservedTx|null|undefined} obsTx - * @memberof common.AttestTx - * @instance - */ - AttestTx.prototype.obsTx = null; - - /** - * AttestTx attestation. - * @member {common.IAttestation|null|undefined} attestation - * @memberof common.AttestTx - * @instance - */ - AttestTx.prototype.attestation = null; - - /** - * AttestTx inbound. - * @member {boolean} inbound - * @memberof common.AttestTx - * @instance - */ - AttestTx.prototype.inbound = false; - - /** - * AttestTx allowFutureObservation. - * @member {boolean} allowFutureObservation - * @memberof common.AttestTx - * @instance - */ - AttestTx.prototype.allowFutureObservation = false; - - /** - * Creates a new AttestTx instance using the specified properties. - * @function create - * @memberof common.AttestTx - * @static - * @param {common.IAttestTx=} [properties] Properties to set - * @returns {common.AttestTx} AttestTx instance - */ - AttestTx.create = function create(properties) { - return new AttestTx(properties); - }; - - /** - * Encodes the specified AttestTx message. Does not implicitly {@link common.AttestTx.verify|verify} messages. - * @function encode - * @memberof common.AttestTx - * @static - * @param {common.IAttestTx} message AttestTx message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AttestTx.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.obsTx != null && Object.hasOwnProperty.call(message, "obsTx")) - $root.common.ObservedTx.encode(message.obsTx, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.attestation != null && Object.hasOwnProperty.call(message, "attestation")) - $root.common.Attestation.encode(message.attestation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.inbound != null && Object.hasOwnProperty.call(message, "inbound")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.inbound); - if (message.allowFutureObservation != null && Object.hasOwnProperty.call(message, "allowFutureObservation")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.allowFutureObservation); - return writer; - }; - - /** - * Encodes the specified AttestTx message, length delimited. Does not implicitly {@link common.AttestTx.verify|verify} messages. - * @function encodeDelimited - * @memberof common.AttestTx - * @static - * @param {common.IAttestTx} message AttestTx message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AttestTx.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AttestTx message from the specified reader or buffer. - * @function decode - * @memberof common.AttestTx - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {common.AttestTx} AttestTx - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AttestTx.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.common.AttestTx(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.obsTx = $root.common.ObservedTx.decode(reader, reader.uint32()); - break; - case 2: - message.attestation = $root.common.Attestation.decode(reader, reader.uint32()); - break; - case 3: - message.inbound = reader.bool(); - break; - case 4: - message.allowFutureObservation = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AttestTx message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof common.AttestTx - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {common.AttestTx} AttestTx - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AttestTx.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AttestTx message. - * @function verify - * @memberof common.AttestTx - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AttestTx.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.obsTx != null && message.hasOwnProperty("obsTx")) { - var error = $root.common.ObservedTx.verify(message.obsTx); - if (error) - return "obsTx." + error; - } - if (message.attestation != null && message.hasOwnProperty("attestation")) { - var error = $root.common.Attestation.verify(message.attestation); - if (error) - return "attestation." + error; - } - if (message.inbound != null && message.hasOwnProperty("inbound")) - if (typeof message.inbound !== "boolean") - return "inbound: boolean expected"; - if (message.allowFutureObservation != null && message.hasOwnProperty("allowFutureObservation")) - if (typeof message.allowFutureObservation !== "boolean") - return "allowFutureObservation: boolean expected"; - return null; - }; - - /** - * Creates an AttestTx message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof common.AttestTx - * @static - * @param {Object.} object Plain object - * @returns {common.AttestTx} AttestTx - */ - AttestTx.fromObject = function fromObject(object) { - if (object instanceof $root.common.AttestTx) - return object; - var message = new $root.common.AttestTx(); - if (object.obsTx != null) { - if (typeof object.obsTx !== "object") - throw TypeError(".common.AttestTx.obsTx: object expected"); - message.obsTx = $root.common.ObservedTx.fromObject(object.obsTx); - } - if (object.attestation != null) { - if (typeof object.attestation !== "object") - throw TypeError(".common.AttestTx.attestation: object expected"); - message.attestation = $root.common.Attestation.fromObject(object.attestation); - } - if (object.inbound != null) - message.inbound = Boolean(object.inbound); - if (object.allowFutureObservation != null) - message.allowFutureObservation = Boolean(object.allowFutureObservation); - return message; - }; - - /** - * Creates a plain object from an AttestTx message. Also converts values to other types if specified. - * @function toObject - * @memberof common.AttestTx - * @static - * @param {common.AttestTx} message AttestTx - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AttestTx.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.obsTx = null; - object.attestation = null; - object.inbound = false; - object.allowFutureObservation = false; - } - if (message.obsTx != null && message.hasOwnProperty("obsTx")) - object.obsTx = $root.common.ObservedTx.toObject(message.obsTx, options); - if (message.attestation != null && message.hasOwnProperty("attestation")) - object.attestation = $root.common.Attestation.toObject(message.attestation, options); - if (message.inbound != null && message.hasOwnProperty("inbound")) - object.inbound = message.inbound; - if (message.allowFutureObservation != null && message.hasOwnProperty("allowFutureObservation")) - object.allowFutureObservation = message.allowFutureObservation; - return object; - }; - - /** - * Converts this AttestTx to JSON. - * @function toJSON - * @memberof common.AttestTx - * @instance - * @returns {Object.} JSON object - */ - AttestTx.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return AttestTx; - })(); - - common.QuorumTx = (function() { - - /** - * Properties of a QuorumTx. - * @memberof common - * @interface IQuorumTx - * @property {common.IObservedTx|null} [obsTx] QuorumTx obsTx - * @property {Array.|null} [attestations] QuorumTx attestations - * @property {boolean|null} [inbound] QuorumTx inbound - * @property {boolean|null} [allowFutureObservation] QuorumTx allowFutureObservation - */ - - /** - * Constructs a new QuorumTx. - * @memberof common - * @classdesc Represents a QuorumTx. - * @implements IQuorumTx - * @constructor - * @param {common.IQuorumTx=} [properties] Properties to set - */ - function QuorumTx(properties) { - this.attestations = []; - 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]]; - } - - /** - * QuorumTx obsTx. - * @member {common.IObservedTx|null|undefined} obsTx - * @memberof common.QuorumTx - * @instance - */ - QuorumTx.prototype.obsTx = null; - - /** - * QuorumTx attestations. - * @member {Array.} attestations - * @memberof common.QuorumTx - * @instance - */ - QuorumTx.prototype.attestations = $util.emptyArray; - - /** - * QuorumTx inbound. - * @member {boolean} inbound - * @memberof common.QuorumTx - * @instance - */ - QuorumTx.prototype.inbound = false; - - /** - * QuorumTx allowFutureObservation. - * @member {boolean} allowFutureObservation - * @memberof common.QuorumTx - * @instance - */ - QuorumTx.prototype.allowFutureObservation = false; - - /** - * Creates a new QuorumTx instance using the specified properties. - * @function create - * @memberof common.QuorumTx - * @static - * @param {common.IQuorumTx=} [properties] Properties to set - * @returns {common.QuorumTx} QuorumTx instance - */ - QuorumTx.create = function create(properties) { - return new QuorumTx(properties); - }; - - /** - * Encodes the specified QuorumTx message. Does not implicitly {@link common.QuorumTx.verify|verify} messages. - * @function encode - * @memberof common.QuorumTx - * @static - * @param {common.IQuorumTx} message QuorumTx message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QuorumTx.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.obsTx != null && Object.hasOwnProperty.call(message, "obsTx")) - $root.common.ObservedTx.encode(message.obsTx, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.attestations != null && message.attestations.length) - for (var i = 0; i < message.attestations.length; ++i) - $root.common.Attestation.encode(message.attestations[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.inbound != null && Object.hasOwnProperty.call(message, "inbound")) - writer.uint32(/* id 3, wireType 0 =*/24).bool(message.inbound); - if (message.allowFutureObservation != null && Object.hasOwnProperty.call(message, "allowFutureObservation")) - writer.uint32(/* id 4, wireType 0 =*/32).bool(message.allowFutureObservation); - return writer; - }; - - /** - * Encodes the specified QuorumTx message, length delimited. Does not implicitly {@link common.QuorumTx.verify|verify} messages. - * @function encodeDelimited - * @memberof common.QuorumTx - * @static - * @param {common.IQuorumTx} message QuorumTx message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QuorumTx.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QuorumTx message from the specified reader or buffer. - * @function decode - * @memberof common.QuorumTx - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {common.QuorumTx} QuorumTx - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QuorumTx.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.common.QuorumTx(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.obsTx = $root.common.ObservedTx.decode(reader, reader.uint32()); - break; - case 2: - if (!(message.attestations && message.attestations.length)) - message.attestations = []; - message.attestations.push($root.common.Attestation.decode(reader, reader.uint32())); - break; - case 3: - message.inbound = reader.bool(); - break; - case 4: - message.allowFutureObservation = reader.bool(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QuorumTx message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof common.QuorumTx - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {common.QuorumTx} QuorumTx - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QuorumTx.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QuorumTx message. - * @function verify - * @memberof common.QuorumTx - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QuorumTx.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.obsTx != null && message.hasOwnProperty("obsTx")) { - var error = $root.common.ObservedTx.verify(message.obsTx); - if (error) - return "obsTx." + error; - } - if (message.attestations != null && message.hasOwnProperty("attestations")) { - if (!Array.isArray(message.attestations)) - return "attestations: array expected"; - for (var i = 0; i < message.attestations.length; ++i) { - var error = $root.common.Attestation.verify(message.attestations[i]); - if (error) - return "attestations." + error; - } - } - if (message.inbound != null && message.hasOwnProperty("inbound")) - if (typeof message.inbound !== "boolean") - return "inbound: boolean expected"; - if (message.allowFutureObservation != null && message.hasOwnProperty("allowFutureObservation")) - if (typeof message.allowFutureObservation !== "boolean") - return "allowFutureObservation: boolean expected"; - return null; - }; - - /** - * Creates a QuorumTx message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof common.QuorumTx - * @static - * @param {Object.} object Plain object - * @returns {common.QuorumTx} QuorumTx - */ - QuorumTx.fromObject = function fromObject(object) { - if (object instanceof $root.common.QuorumTx) - return object; - var message = new $root.common.QuorumTx(); - if (object.obsTx != null) { - if (typeof object.obsTx !== "object") - throw TypeError(".common.QuorumTx.obsTx: object expected"); - message.obsTx = $root.common.ObservedTx.fromObject(object.obsTx); - } - if (object.attestations) { - if (!Array.isArray(object.attestations)) - throw TypeError(".common.QuorumTx.attestations: array expected"); - message.attestations = []; - for (var i = 0; i < object.attestations.length; ++i) { - if (typeof object.attestations[i] !== "object") - throw TypeError(".common.QuorumTx.attestations: object expected"); - message.attestations[i] = $root.common.Attestation.fromObject(object.attestations[i]); - } - } - if (object.inbound != null) - message.inbound = Boolean(object.inbound); - if (object.allowFutureObservation != null) - message.allowFutureObservation = Boolean(object.allowFutureObservation); - return message; - }; - - /** - * Creates a plain object from a QuorumTx message. Also converts values to other types if specified. - * @function toObject - * @memberof common.QuorumTx - * @static - * @param {common.QuorumTx} message QuorumTx - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QuorumTx.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.attestations = []; - if (options.defaults) { - object.obsTx = null; - object.inbound = false; - object.allowFutureObservation = false; - } - if (message.obsTx != null && message.hasOwnProperty("obsTx")) - object.obsTx = $root.common.ObservedTx.toObject(message.obsTx, options); - if (message.attestations && message.attestations.length) { - object.attestations = []; - for (var j = 0; j < message.attestations.length; ++j) - object.attestations[j] = $root.common.Attestation.toObject(message.attestations[j], options); - } - if (message.inbound != null && message.hasOwnProperty("inbound")) - object.inbound = message.inbound; - if (message.allowFutureObservation != null && message.hasOwnProperty("allowFutureObservation")) - object.allowFutureObservation = message.allowFutureObservation; - return object; - }; - - /** - * Converts this QuorumTx to JSON. - * @function toJSON - * @memberof common.QuorumTx - * @instance - * @returns {Object.} JSON object - */ - QuorumTx.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QuorumTx; - })(); - - common.QuorumState = (function() { - - /** - * Properties of a QuorumState. - * @memberof common - * @interface IQuorumState - * @property {Array.|null} [quoTxs] QuorumState quoTxs - * @property {Array.|null} [quoNetworkFees] QuorumState quoNetworkFees - * @property {Array.|null} [quoSolvencies] QuorumState quoSolvencies - * @property {Array.|null} [quoErrataTxs] QuorumState quoErrataTxs - * @property {Array.|null} [quoPriceFeeds] QuorumState quoPriceFeeds - */ - - /** - * Constructs a new QuorumState. - * @memberof common - * @classdesc Represents a QuorumState. - * @implements IQuorumState - * @constructor - * @param {common.IQuorumState=} [properties] Properties to set - */ - function QuorumState(properties) { - this.quoTxs = []; - this.quoNetworkFees = []; - this.quoSolvencies = []; - this.quoErrataTxs = []; - this.quoPriceFeeds = []; - 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]]; - } - - /** - * QuorumState quoTxs. - * @member {Array.} quoTxs - * @memberof common.QuorumState - * @instance - */ - QuorumState.prototype.quoTxs = $util.emptyArray; - - /** - * QuorumState quoNetworkFees. - * @member {Array.} quoNetworkFees - * @memberof common.QuorumState - * @instance - */ - QuorumState.prototype.quoNetworkFees = $util.emptyArray; - - /** - * QuorumState quoSolvencies. - * @member {Array.} quoSolvencies - * @memberof common.QuorumState - * @instance - */ - QuorumState.prototype.quoSolvencies = $util.emptyArray; - - /** - * QuorumState quoErrataTxs. - * @member {Array.} quoErrataTxs - * @memberof common.QuorumState - * @instance - */ - QuorumState.prototype.quoErrataTxs = $util.emptyArray; - - /** - * QuorumState quoPriceFeeds. - * @member {Array.} quoPriceFeeds - * @memberof common.QuorumState - * @instance - */ - QuorumState.prototype.quoPriceFeeds = $util.emptyArray; - - /** - * Creates a new QuorumState instance using the specified properties. - * @function create - * @memberof common.QuorumState - * @static - * @param {common.IQuorumState=} [properties] Properties to set - * @returns {common.QuorumState} QuorumState instance - */ - QuorumState.create = function create(properties) { - return new QuorumState(properties); - }; - - /** - * Encodes the specified QuorumState message. Does not implicitly {@link common.QuorumState.verify|verify} messages. - * @function encode - * @memberof common.QuorumState - * @static - * @param {common.IQuorumState} message QuorumState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QuorumState.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.quoTxs != null && message.quoTxs.length) - for (var i = 0; i < message.quoTxs.length; ++i) - $root.common.QuorumTx.encode(message.quoTxs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.quoNetworkFees != null && message.quoNetworkFees.length) - for (var i = 0; i < message.quoNetworkFees.length; ++i) - $root.common.QuorumNetworkFee.encode(message.quoNetworkFees[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.quoSolvencies != null && message.quoSolvencies.length) - for (var i = 0; i < message.quoSolvencies.length; ++i) - $root.common.QuorumSolvency.encode(message.quoSolvencies[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.quoErrataTxs != null && message.quoErrataTxs.length) - for (var i = 0; i < message.quoErrataTxs.length; ++i) - $root.common.QuorumErrataTx.encode(message.quoErrataTxs[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.quoPriceFeeds != null && message.quoPriceFeeds.length) - for (var i = 0; i < message.quoPriceFeeds.length; ++i) - $root.common.QuorumPriceFeed.encode(message.quoPriceFeeds[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QuorumState message, length delimited. Does not implicitly {@link common.QuorumState.verify|verify} messages. - * @function encodeDelimited - * @memberof common.QuorumState - * @static - * @param {common.IQuorumState} message QuorumState message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QuorumState.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QuorumState message from the specified reader or buffer. - * @function decode - * @memberof common.QuorumState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {common.QuorumState} QuorumState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QuorumState.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.common.QuorumState(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.quoTxs && message.quoTxs.length)) - message.quoTxs = []; - message.quoTxs.push($root.common.QuorumTx.decode(reader, reader.uint32())); - break; - case 2: - if (!(message.quoNetworkFees && message.quoNetworkFees.length)) - message.quoNetworkFees = []; - message.quoNetworkFees.push($root.common.QuorumNetworkFee.decode(reader, reader.uint32())); - break; - case 3: - if (!(message.quoSolvencies && message.quoSolvencies.length)) - message.quoSolvencies = []; - message.quoSolvencies.push($root.common.QuorumSolvency.decode(reader, reader.uint32())); - break; - case 4: - if (!(message.quoErrataTxs && message.quoErrataTxs.length)) - message.quoErrataTxs = []; - message.quoErrataTxs.push($root.common.QuorumErrataTx.decode(reader, reader.uint32())); - break; - case 5: - if (!(message.quoPriceFeeds && message.quoPriceFeeds.length)) - message.quoPriceFeeds = []; - message.quoPriceFeeds.push($root.common.QuorumPriceFeed.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QuorumState message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof common.QuorumState - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {common.QuorumState} QuorumState - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QuorumState.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QuorumState message. - * @function verify - * @memberof common.QuorumState - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QuorumState.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.quoTxs != null && message.hasOwnProperty("quoTxs")) { - if (!Array.isArray(message.quoTxs)) - return "quoTxs: array expected"; - for (var i = 0; i < message.quoTxs.length; ++i) { - var error = $root.common.QuorumTx.verify(message.quoTxs[i]); - if (error) - return "quoTxs." + error; - } - } - if (message.quoNetworkFees != null && message.hasOwnProperty("quoNetworkFees")) { - if (!Array.isArray(message.quoNetworkFees)) - return "quoNetworkFees: array expected"; - for (var i = 0; i < message.quoNetworkFees.length; ++i) { - var error = $root.common.QuorumNetworkFee.verify(message.quoNetworkFees[i]); - if (error) - return "quoNetworkFees." + error; - } - } - if (message.quoSolvencies != null && message.hasOwnProperty("quoSolvencies")) { - if (!Array.isArray(message.quoSolvencies)) - return "quoSolvencies: array expected"; - for (var i = 0; i < message.quoSolvencies.length; ++i) { - var error = $root.common.QuorumSolvency.verify(message.quoSolvencies[i]); - if (error) - return "quoSolvencies." + error; - } - } - if (message.quoErrataTxs != null && message.hasOwnProperty("quoErrataTxs")) { - if (!Array.isArray(message.quoErrataTxs)) - return "quoErrataTxs: array expected"; - for (var i = 0; i < message.quoErrataTxs.length; ++i) { - var error = $root.common.QuorumErrataTx.verify(message.quoErrataTxs[i]); - if (error) - return "quoErrataTxs." + error; - } - } - if (message.quoPriceFeeds != null && message.hasOwnProperty("quoPriceFeeds")) { - if (!Array.isArray(message.quoPriceFeeds)) - return "quoPriceFeeds: array expected"; - for (var i = 0; i < message.quoPriceFeeds.length; ++i) { - var error = $root.common.QuorumPriceFeed.verify(message.quoPriceFeeds[i]); - if (error) - return "quoPriceFeeds." + error; - } - } - return null; - }; - - /** - * Creates a QuorumState message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof common.QuorumState - * @static - * @param {Object.} object Plain object - * @returns {common.QuorumState} QuorumState - */ - QuorumState.fromObject = function fromObject(object) { - if (object instanceof $root.common.QuorumState) - return object; - var message = new $root.common.QuorumState(); - if (object.quoTxs) { - if (!Array.isArray(object.quoTxs)) - throw TypeError(".common.QuorumState.quoTxs: array expected"); - message.quoTxs = []; - for (var i = 0; i < object.quoTxs.length; ++i) { - if (typeof object.quoTxs[i] !== "object") - throw TypeError(".common.QuorumState.quoTxs: object expected"); - message.quoTxs[i] = $root.common.QuorumTx.fromObject(object.quoTxs[i]); - } - } - if (object.quoNetworkFees) { - if (!Array.isArray(object.quoNetworkFees)) - throw TypeError(".common.QuorumState.quoNetworkFees: array expected"); - message.quoNetworkFees = []; - for (var i = 0; i < object.quoNetworkFees.length; ++i) { - if (typeof object.quoNetworkFees[i] !== "object") - throw TypeError(".common.QuorumState.quoNetworkFees: object expected"); - message.quoNetworkFees[i] = $root.common.QuorumNetworkFee.fromObject(object.quoNetworkFees[i]); - } - } - if (object.quoSolvencies) { - if (!Array.isArray(object.quoSolvencies)) - throw TypeError(".common.QuorumState.quoSolvencies: array expected"); - message.quoSolvencies = []; - for (var i = 0; i < object.quoSolvencies.length; ++i) { - if (typeof object.quoSolvencies[i] !== "object") - throw TypeError(".common.QuorumState.quoSolvencies: object expected"); - message.quoSolvencies[i] = $root.common.QuorumSolvency.fromObject(object.quoSolvencies[i]); - } - } - if (object.quoErrataTxs) { - if (!Array.isArray(object.quoErrataTxs)) - throw TypeError(".common.QuorumState.quoErrataTxs: array expected"); - message.quoErrataTxs = []; - for (var i = 0; i < object.quoErrataTxs.length; ++i) { - if (typeof object.quoErrataTxs[i] !== "object") - throw TypeError(".common.QuorumState.quoErrataTxs: object expected"); - message.quoErrataTxs[i] = $root.common.QuorumErrataTx.fromObject(object.quoErrataTxs[i]); - } - } - if (object.quoPriceFeeds) { - if (!Array.isArray(object.quoPriceFeeds)) - throw TypeError(".common.QuorumState.quoPriceFeeds: array expected"); - message.quoPriceFeeds = []; - for (var i = 0; i < object.quoPriceFeeds.length; ++i) { - if (typeof object.quoPriceFeeds[i] !== "object") - throw TypeError(".common.QuorumState.quoPriceFeeds: object expected"); - message.quoPriceFeeds[i] = $root.common.QuorumPriceFeed.fromObject(object.quoPriceFeeds[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a QuorumState message. Also converts values to other types if specified. - * @function toObject - * @memberof common.QuorumState - * @static - * @param {common.QuorumState} message QuorumState - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QuorumState.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.quoTxs = []; - object.quoNetworkFees = []; - object.quoSolvencies = []; - object.quoErrataTxs = []; - object.quoPriceFeeds = []; - } - if (message.quoTxs && message.quoTxs.length) { - object.quoTxs = []; - for (var j = 0; j < message.quoTxs.length; ++j) - object.quoTxs[j] = $root.common.QuorumTx.toObject(message.quoTxs[j], options); - } - if (message.quoNetworkFees && message.quoNetworkFees.length) { - object.quoNetworkFees = []; - for (var j = 0; j < message.quoNetworkFees.length; ++j) - object.quoNetworkFees[j] = $root.common.QuorumNetworkFee.toObject(message.quoNetworkFees[j], options); - } - if (message.quoSolvencies && message.quoSolvencies.length) { - object.quoSolvencies = []; - for (var j = 0; j < message.quoSolvencies.length; ++j) - object.quoSolvencies[j] = $root.common.QuorumSolvency.toObject(message.quoSolvencies[j], options); - } - if (message.quoErrataTxs && message.quoErrataTxs.length) { - object.quoErrataTxs = []; - for (var j = 0; j < message.quoErrataTxs.length; ++j) - object.quoErrataTxs[j] = $root.common.QuorumErrataTx.toObject(message.quoErrataTxs[j], options); - } - if (message.quoPriceFeeds && message.quoPriceFeeds.length) { - object.quoPriceFeeds = []; - for (var j = 0; j < message.quoPriceFeeds.length; ++j) - object.quoPriceFeeds[j] = $root.common.QuorumPriceFeed.toObject(message.quoPriceFeeds[j], options); - } - return object; - }; - - /** - * Converts this QuorumState to JSON. - * @function toJSON - * @memberof common.QuorumState - * @instance - * @returns {Object.} JSON object - */ - QuorumState.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QuorumState; - })(); - - common.NetworkFee = (function() { - - /** - * Properties of a NetworkFee. - * @memberof common - * @interface INetworkFee - * @property {number|Long|null} [height] NetworkFee height - * @property {string|null} [chain] NetworkFee chain - * @property {number|Long|null} [transactionSize] NetworkFee transactionSize - * @property {number|Long|null} [transactionRate] NetworkFee transactionRate - */ - - /** - * Constructs a new NetworkFee. - * @memberof common - * @classdesc Represents a NetworkFee. - * @implements INetworkFee - * @constructor - * @param {common.INetworkFee=} [properties] Properties to set - */ - function NetworkFee(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]]; - } - - /** - * NetworkFee height. - * @member {number|Long} height - * @memberof common.NetworkFee - * @instance - */ - NetworkFee.prototype.height = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * NetworkFee chain. - * @member {string} chain - * @memberof common.NetworkFee - * @instance - */ - NetworkFee.prototype.chain = ""; - - /** - * NetworkFee transactionSize. - * @member {number|Long} transactionSize - * @memberof common.NetworkFee - * @instance - */ - NetworkFee.prototype.transactionSize = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * NetworkFee transactionRate. - * @member {number|Long} transactionRate - * @memberof common.NetworkFee - * @instance - */ - NetworkFee.prototype.transactionRate = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * Creates a new NetworkFee instance using the specified properties. - * @function create - * @memberof common.NetworkFee - * @static - * @param {common.INetworkFee=} [properties] Properties to set - * @returns {common.NetworkFee} NetworkFee instance - */ - NetworkFee.create = function create(properties) { - return new NetworkFee(properties); - }; - - /** - * Encodes the specified NetworkFee message. Does not implicitly {@link common.NetworkFee.verify|verify} messages. - * @function encode - * @memberof common.NetworkFee - * @static - * @param {common.INetworkFee} message NetworkFee message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NetworkFee.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.height != null && Object.hasOwnProperty.call(message, "height")) - writer.uint32(/* id 1, wireType 0 =*/8).int64(message.height); - if (message.chain != null && Object.hasOwnProperty.call(message, "chain")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.chain); - if (message.transactionSize != null && Object.hasOwnProperty.call(message, "transactionSize")) - writer.uint32(/* id 3, wireType 0 =*/24).uint64(message.transactionSize); - if (message.transactionRate != null && Object.hasOwnProperty.call(message, "transactionRate")) - writer.uint32(/* id 4, wireType 0 =*/32).uint64(message.transactionRate); - return writer; - }; - - /** - * Encodes the specified NetworkFee message, length delimited. Does not implicitly {@link common.NetworkFee.verify|verify} messages. - * @function encodeDelimited - * @memberof common.NetworkFee - * @static - * @param {common.INetworkFee} message NetworkFee message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - NetworkFee.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a NetworkFee message from the specified reader or buffer. - * @function decode - * @memberof common.NetworkFee - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {common.NetworkFee} NetworkFee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NetworkFee.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.common.NetworkFee(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.height = reader.int64(); - break; - case 2: - message.chain = reader.string(); - break; - case 3: - message.transactionSize = reader.uint64(); - break; - case 4: - message.transactionRate = reader.uint64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a NetworkFee message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof common.NetworkFee - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {common.NetworkFee} NetworkFee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - NetworkFee.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a NetworkFee message. - * @function verify - * @memberof common.NetworkFee - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - NetworkFee.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.height != null && message.hasOwnProperty("height")) - if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) - return "height: integer|Long expected"; - if (message.chain != null && message.hasOwnProperty("chain")) - if (!$util.isString(message.chain)) - return "chain: string expected"; - if (message.transactionSize != null && message.hasOwnProperty("transactionSize")) - if (!$util.isInteger(message.transactionSize) && !(message.transactionSize && $util.isInteger(message.transactionSize.low) && $util.isInteger(message.transactionSize.high))) - return "transactionSize: integer|Long expected"; - if (message.transactionRate != null && message.hasOwnProperty("transactionRate")) - if (!$util.isInteger(message.transactionRate) && !(message.transactionRate && $util.isInteger(message.transactionRate.low) && $util.isInteger(message.transactionRate.high))) - return "transactionRate: integer|Long expected"; - return null; - }; - - /** - * Creates a NetworkFee message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof common.NetworkFee - * @static - * @param {Object.} object Plain object - * @returns {common.NetworkFee} NetworkFee - */ - NetworkFee.fromObject = function fromObject(object) { - if (object instanceof $root.common.NetworkFee) - return object; - var message = new $root.common.NetworkFee(); - if (object.height != null) - if ($util.Long) - (message.height = $util.Long.fromValue(object.height)).unsigned = false; - else if (typeof object.height === "string") - message.height = parseInt(object.height, 10); - else if (typeof object.height === "number") - message.height = object.height; - else if (typeof object.height === "object") - message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(); - if (object.chain != null) - message.chain = String(object.chain); - if (object.transactionSize != null) - if ($util.Long) - (message.transactionSize = $util.Long.fromValue(object.transactionSize)).unsigned = true; - else if (typeof object.transactionSize === "string") - message.transactionSize = parseInt(object.transactionSize, 10); - else if (typeof object.transactionSize === "number") - message.transactionSize = object.transactionSize; - else if (typeof object.transactionSize === "object") - message.transactionSize = new $util.LongBits(object.transactionSize.low >>> 0, object.transactionSize.high >>> 0).toNumber(true); - if (object.transactionRate != null) - if ($util.Long) - (message.transactionRate = $util.Long.fromValue(object.transactionRate)).unsigned = true; - else if (typeof object.transactionRate === "string") - message.transactionRate = parseInt(object.transactionRate, 10); - else if (typeof object.transactionRate === "number") - message.transactionRate = object.transactionRate; - else if (typeof object.transactionRate === "object") - message.transactionRate = new $util.LongBits(object.transactionRate.low >>> 0, object.transactionRate.high >>> 0).toNumber(true); - return message; - }; - - /** - * Creates a plain object from a NetworkFee message. Also converts values to other types if specified. - * @function toObject - * @memberof common.NetworkFee - * @static - * @param {common.NetworkFee} message NetworkFee - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - NetworkFee.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.height = options.longs === String ? "0" : 0; - object.chain = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.transactionSize = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.transactionSize = options.longs === String ? "0" : 0; - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.transactionRate = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.transactionRate = options.longs === String ? "0" : 0; - } - if (message.height != null && message.hasOwnProperty("height")) - if (typeof message.height === "number") - object.height = options.longs === String ? String(message.height) : message.height; - else - object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber() : message.height; - if (message.chain != null && message.hasOwnProperty("chain")) - object.chain = message.chain; - if (message.transactionSize != null && message.hasOwnProperty("transactionSize")) - if (typeof message.transactionSize === "number") - object.transactionSize = options.longs === String ? String(message.transactionSize) : message.transactionSize; - else - object.transactionSize = options.longs === String ? $util.Long.prototype.toString.call(message.transactionSize) : options.longs === Number ? new $util.LongBits(message.transactionSize.low >>> 0, message.transactionSize.high >>> 0).toNumber(true) : message.transactionSize; - if (message.transactionRate != null && message.hasOwnProperty("transactionRate")) - if (typeof message.transactionRate === "number") - object.transactionRate = options.longs === String ? String(message.transactionRate) : message.transactionRate; - else - object.transactionRate = options.longs === String ? $util.Long.prototype.toString.call(message.transactionRate) : options.longs === Number ? new $util.LongBits(message.transactionRate.low >>> 0, message.transactionRate.high >>> 0).toNumber(true) : message.transactionRate; - return object; - }; - - /** - * Converts this NetworkFee to JSON. - * @function toJSON - * @memberof common.NetworkFee - * @instance - * @returns {Object.} JSON object - */ - NetworkFee.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return NetworkFee; - })(); - - common.AttestNetworkFee = (function() { - - /** - * Properties of an AttestNetworkFee. - * @memberof common - * @interface IAttestNetworkFee - * @property {common.INetworkFee|null} [networkFee] AttestNetworkFee networkFee - * @property {common.IAttestation|null} [attestation] AttestNetworkFee attestation - */ - - /** - * Constructs a new AttestNetworkFee. - * @memberof common - * @classdesc Represents an AttestNetworkFee. - * @implements IAttestNetworkFee - * @constructor - * @param {common.IAttestNetworkFee=} [properties] Properties to set - */ - function AttestNetworkFee(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]]; - } - - /** - * AttestNetworkFee networkFee. - * @member {common.INetworkFee|null|undefined} networkFee - * @memberof common.AttestNetworkFee - * @instance - */ - AttestNetworkFee.prototype.networkFee = null; - - /** - * AttestNetworkFee attestation. - * @member {common.IAttestation|null|undefined} attestation - * @memberof common.AttestNetworkFee - * @instance - */ - AttestNetworkFee.prototype.attestation = null; - - /** - * Creates a new AttestNetworkFee instance using the specified properties. - * @function create - * @memberof common.AttestNetworkFee - * @static - * @param {common.IAttestNetworkFee=} [properties] Properties to set - * @returns {common.AttestNetworkFee} AttestNetworkFee instance - */ - AttestNetworkFee.create = function create(properties) { - return new AttestNetworkFee(properties); - }; - - /** - * Encodes the specified AttestNetworkFee message. Does not implicitly {@link common.AttestNetworkFee.verify|verify} messages. - * @function encode - * @memberof common.AttestNetworkFee - * @static - * @param {common.IAttestNetworkFee} message AttestNetworkFee message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AttestNetworkFee.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.networkFee != null && Object.hasOwnProperty.call(message, "networkFee")) - $root.common.NetworkFee.encode(message.networkFee, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.attestation != null && Object.hasOwnProperty.call(message, "attestation")) - $root.common.Attestation.encode(message.attestation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified AttestNetworkFee message, length delimited. Does not implicitly {@link common.AttestNetworkFee.verify|verify} messages. - * @function encodeDelimited - * @memberof common.AttestNetworkFee - * @static - * @param {common.IAttestNetworkFee} message AttestNetworkFee message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AttestNetworkFee.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AttestNetworkFee message from the specified reader or buffer. - * @function decode - * @memberof common.AttestNetworkFee - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {common.AttestNetworkFee} AttestNetworkFee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AttestNetworkFee.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.common.AttestNetworkFee(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.networkFee = $root.common.NetworkFee.decode(reader, reader.uint32()); - break; - case 2: - message.attestation = $root.common.Attestation.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AttestNetworkFee message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof common.AttestNetworkFee - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {common.AttestNetworkFee} AttestNetworkFee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AttestNetworkFee.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AttestNetworkFee message. - * @function verify - * @memberof common.AttestNetworkFee - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AttestNetworkFee.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.networkFee != null && message.hasOwnProperty("networkFee")) { - var error = $root.common.NetworkFee.verify(message.networkFee); - if (error) - return "networkFee." + error; - } - if (message.attestation != null && message.hasOwnProperty("attestation")) { - var error = $root.common.Attestation.verify(message.attestation); - if (error) - return "attestation." + error; - } - return null; - }; - - /** - * Creates an AttestNetworkFee message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof common.AttestNetworkFee - * @static - * @param {Object.} object Plain object - * @returns {common.AttestNetworkFee} AttestNetworkFee - */ - AttestNetworkFee.fromObject = function fromObject(object) { - if (object instanceof $root.common.AttestNetworkFee) - return object; - var message = new $root.common.AttestNetworkFee(); - if (object.networkFee != null) { - if (typeof object.networkFee !== "object") - throw TypeError(".common.AttestNetworkFee.networkFee: object expected"); - message.networkFee = $root.common.NetworkFee.fromObject(object.networkFee); - } - if (object.attestation != null) { - if (typeof object.attestation !== "object") - throw TypeError(".common.AttestNetworkFee.attestation: object expected"); - message.attestation = $root.common.Attestation.fromObject(object.attestation); - } - return message; - }; - - /** - * Creates a plain object from an AttestNetworkFee message. Also converts values to other types if specified. - * @function toObject - * @memberof common.AttestNetworkFee - * @static - * @param {common.AttestNetworkFee} message AttestNetworkFee - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AttestNetworkFee.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.networkFee = null; - object.attestation = null; - } - if (message.networkFee != null && message.hasOwnProperty("networkFee")) - object.networkFee = $root.common.NetworkFee.toObject(message.networkFee, options); - if (message.attestation != null && message.hasOwnProperty("attestation")) - object.attestation = $root.common.Attestation.toObject(message.attestation, options); - return object; - }; - - /** - * Converts this AttestNetworkFee to JSON. - * @function toJSON - * @memberof common.AttestNetworkFee - * @instance - * @returns {Object.} JSON object - */ - AttestNetworkFee.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return AttestNetworkFee; - })(); - - common.QuorumNetworkFee = (function() { - - /** - * Properties of a QuorumNetworkFee. - * @memberof common - * @interface IQuorumNetworkFee - * @property {common.INetworkFee|null} [networkFee] QuorumNetworkFee networkFee - * @property {Array.|null} [attestations] QuorumNetworkFee attestations - */ - - /** - * Constructs a new QuorumNetworkFee. - * @memberof common - * @classdesc Represents a QuorumNetworkFee. - * @implements IQuorumNetworkFee - * @constructor - * @param {common.IQuorumNetworkFee=} [properties] Properties to set - */ - function QuorumNetworkFee(properties) { - this.attestations = []; - 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]]; - } - - /** - * QuorumNetworkFee networkFee. - * @member {common.INetworkFee|null|undefined} networkFee - * @memberof common.QuorumNetworkFee - * @instance - */ - QuorumNetworkFee.prototype.networkFee = null; - - /** - * QuorumNetworkFee attestations. - * @member {Array.} attestations - * @memberof common.QuorumNetworkFee - * @instance - */ - QuorumNetworkFee.prototype.attestations = $util.emptyArray; - - /** - * Creates a new QuorumNetworkFee instance using the specified properties. - * @function create - * @memberof common.QuorumNetworkFee - * @static - * @param {common.IQuorumNetworkFee=} [properties] Properties to set - * @returns {common.QuorumNetworkFee} QuorumNetworkFee instance - */ - QuorumNetworkFee.create = function create(properties) { - return new QuorumNetworkFee(properties); - }; - - /** - * Encodes the specified QuorumNetworkFee message. Does not implicitly {@link common.QuorumNetworkFee.verify|verify} messages. - * @function encode - * @memberof common.QuorumNetworkFee - * @static - * @param {common.IQuorumNetworkFee} message QuorumNetworkFee message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QuorumNetworkFee.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.networkFee != null && Object.hasOwnProperty.call(message, "networkFee")) - $root.common.NetworkFee.encode(message.networkFee, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.attestations != null && message.attestations.length) - for (var i = 0; i < message.attestations.length; ++i) - $root.common.Attestation.encode(message.attestations[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QuorumNetworkFee message, length delimited. Does not implicitly {@link common.QuorumNetworkFee.verify|verify} messages. - * @function encodeDelimited - * @memberof common.QuorumNetworkFee - * @static - * @param {common.IQuorumNetworkFee} message QuorumNetworkFee message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QuorumNetworkFee.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QuorumNetworkFee message from the specified reader or buffer. - * @function decode - * @memberof common.QuorumNetworkFee - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {common.QuorumNetworkFee} QuorumNetworkFee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QuorumNetworkFee.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.common.QuorumNetworkFee(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.networkFee = $root.common.NetworkFee.decode(reader, reader.uint32()); - break; - case 2: - if (!(message.attestations && message.attestations.length)) - message.attestations = []; - message.attestations.push($root.common.Attestation.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QuorumNetworkFee message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof common.QuorumNetworkFee - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {common.QuorumNetworkFee} QuorumNetworkFee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QuorumNetworkFee.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QuorumNetworkFee message. - * @function verify - * @memberof common.QuorumNetworkFee - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QuorumNetworkFee.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.networkFee != null && message.hasOwnProperty("networkFee")) { - var error = $root.common.NetworkFee.verify(message.networkFee); - if (error) - return "networkFee." + error; - } - if (message.attestations != null && message.hasOwnProperty("attestations")) { - if (!Array.isArray(message.attestations)) - return "attestations: array expected"; - for (var i = 0; i < message.attestations.length; ++i) { - var error = $root.common.Attestation.verify(message.attestations[i]); - if (error) - return "attestations." + error; - } - } - return null; - }; - - /** - * Creates a QuorumNetworkFee message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof common.QuorumNetworkFee - * @static - * @param {Object.} object Plain object - * @returns {common.QuorumNetworkFee} QuorumNetworkFee - */ - QuorumNetworkFee.fromObject = function fromObject(object) { - if (object instanceof $root.common.QuorumNetworkFee) - return object; - var message = new $root.common.QuorumNetworkFee(); - if (object.networkFee != null) { - if (typeof object.networkFee !== "object") - throw TypeError(".common.QuorumNetworkFee.networkFee: object expected"); - message.networkFee = $root.common.NetworkFee.fromObject(object.networkFee); - } - if (object.attestations) { - if (!Array.isArray(object.attestations)) - throw TypeError(".common.QuorumNetworkFee.attestations: array expected"); - message.attestations = []; - for (var i = 0; i < object.attestations.length; ++i) { - if (typeof object.attestations[i] !== "object") - throw TypeError(".common.QuorumNetworkFee.attestations: object expected"); - message.attestations[i] = $root.common.Attestation.fromObject(object.attestations[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a QuorumNetworkFee message. Also converts values to other types if specified. - * @function toObject - * @memberof common.QuorumNetworkFee - * @static - * @param {common.QuorumNetworkFee} message QuorumNetworkFee - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QuorumNetworkFee.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.attestations = []; - if (options.defaults) - object.networkFee = null; - if (message.networkFee != null && message.hasOwnProperty("networkFee")) - object.networkFee = $root.common.NetworkFee.toObject(message.networkFee, options); - if (message.attestations && message.attestations.length) { - object.attestations = []; - for (var j = 0; j < message.attestations.length; ++j) - object.attestations[j] = $root.common.Attestation.toObject(message.attestations[j], options); - } - return object; - }; - - /** - * Converts this QuorumNetworkFee to JSON. - * @function toJSON - * @memberof common.QuorumNetworkFee - * @instance - * @returns {Object.} JSON object - */ - QuorumNetworkFee.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QuorumNetworkFee; - })(); - - common.Solvency = (function() { - - /** - * Properties of a Solvency. - * @memberof common - * @interface ISolvency - * @property {string|null} [id] Solvency id - * @property {string|null} [chain] Solvency chain - * @property {string|null} [pubKey] Solvency pubKey - * @property {Array.|null} [coins] Solvency coins - * @property {number|Long|null} [height] Solvency height - */ - - /** - * Constructs a new Solvency. - * @memberof common - * @classdesc Represents a Solvency. - * @implements ISolvency - * @constructor - * @param {common.ISolvency=} [properties] Properties to set - */ - function Solvency(properties) { - this.coins = []; - 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]]; - } - - /** - * Solvency id. - * @member {string} id - * @memberof common.Solvency - * @instance - */ - Solvency.prototype.id = ""; - - /** - * Solvency chain. - * @member {string} chain - * @memberof common.Solvency - * @instance - */ - Solvency.prototype.chain = ""; - - /** - * Solvency pubKey. - * @member {string} pubKey - * @memberof common.Solvency - * @instance - */ - Solvency.prototype.pubKey = ""; - - /** - * Solvency coins. - * @member {Array.} coins - * @memberof common.Solvency - * @instance - */ - Solvency.prototype.coins = $util.emptyArray; - - /** - * Solvency height. - * @member {number|Long} height - * @memberof common.Solvency - * @instance - */ - Solvency.prototype.height = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * Creates a new Solvency instance using the specified properties. - * @function create - * @memberof common.Solvency - * @static - * @param {common.ISolvency=} [properties] Properties to set - * @returns {common.Solvency} Solvency instance - */ - Solvency.create = function create(properties) { - return new Solvency(properties); - }; - - /** - * Encodes the specified Solvency message. Does not implicitly {@link common.Solvency.verify|verify} messages. - * @function encode - * @memberof common.Solvency - * @static - * @param {common.ISolvency} message Solvency message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Solvency.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); - if (message.chain != null && Object.hasOwnProperty.call(message, "chain")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.chain); - if (message.pubKey != null && Object.hasOwnProperty.call(message, "pubKey")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.pubKey); - if (message.coins != null && message.coins.length) - for (var i = 0; i < message.coins.length; ++i) - $root.common.Coin.encode(message.coins[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.height != null && Object.hasOwnProperty.call(message, "height")) - writer.uint32(/* id 5, wireType 0 =*/40).int64(message.height); - return writer; - }; - - /** - * Encodes the specified Solvency message, length delimited. Does not implicitly {@link common.Solvency.verify|verify} messages. - * @function encodeDelimited - * @memberof common.Solvency - * @static - * @param {common.ISolvency} message Solvency message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Solvency.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Solvency message from the specified reader or buffer. - * @function decode - * @memberof common.Solvency - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {common.Solvency} Solvency - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Solvency.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.common.Solvency(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.id = reader.string(); - break; - case 2: - message.chain = reader.string(); - break; - case 3: - message.pubKey = reader.string(); - break; - case 4: - if (!(message.coins && message.coins.length)) - message.coins = []; - message.coins.push($root.common.Coin.decode(reader, reader.uint32())); - break; - case 5: - message.height = reader.int64(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Solvency message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof common.Solvency - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {common.Solvency} Solvency - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Solvency.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Solvency message. - * @function verify - * @memberof common.Solvency - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Solvency.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!$util.isString(message.id)) - return "id: string expected"; - if (message.chain != null && message.hasOwnProperty("chain")) - if (!$util.isString(message.chain)) - return "chain: string expected"; - if (message.pubKey != null && message.hasOwnProperty("pubKey")) - if (!$util.isString(message.pubKey)) - return "pubKey: string expected"; - if (message.coins != null && message.hasOwnProperty("coins")) { - if (!Array.isArray(message.coins)) - return "coins: array expected"; - for (var i = 0; i < message.coins.length; ++i) { - var error = $root.common.Coin.verify(message.coins[i]); - if (error) - return "coins." + error; - } - } - if (message.height != null && message.hasOwnProperty("height")) - if (!$util.isInteger(message.height) && !(message.height && $util.isInteger(message.height.low) && $util.isInteger(message.height.high))) - return "height: integer|Long expected"; - return null; - }; - - /** - * Creates a Solvency message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof common.Solvency - * @static - * @param {Object.} object Plain object - * @returns {common.Solvency} Solvency - */ - Solvency.fromObject = function fromObject(object) { - if (object instanceof $root.common.Solvency) - return object; - var message = new $root.common.Solvency(); - if (object.id != null) - message.id = String(object.id); - if (object.chain != null) - message.chain = String(object.chain); - if (object.pubKey != null) - message.pubKey = String(object.pubKey); - if (object.coins) { - if (!Array.isArray(object.coins)) - throw TypeError(".common.Solvency.coins: array expected"); - message.coins = []; - for (var i = 0; i < object.coins.length; ++i) { - if (typeof object.coins[i] !== "object") - throw TypeError(".common.Solvency.coins: object expected"); - message.coins[i] = $root.common.Coin.fromObject(object.coins[i]); - } - } - if (object.height != null) - if ($util.Long) - (message.height = $util.Long.fromValue(object.height)).unsigned = false; - else if (typeof object.height === "string") - message.height = parseInt(object.height, 10); - else if (typeof object.height === "number") - message.height = object.height; - else if (typeof object.height === "object") - message.height = new $util.LongBits(object.height.low >>> 0, object.height.high >>> 0).toNumber(); - return message; - }; - - /** - * Creates a plain object from a Solvency message. Also converts values to other types if specified. - * @function toObject - * @memberof common.Solvency - * @static - * @param {common.Solvency} message Solvency - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Solvency.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.coins = []; - if (options.defaults) { - object.id = ""; - object.chain = ""; - object.pubKey = ""; - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.height = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.height = options.longs === String ? "0" : 0; - } - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.chain != null && message.hasOwnProperty("chain")) - object.chain = message.chain; - if (message.pubKey != null && message.hasOwnProperty("pubKey")) - object.pubKey = message.pubKey; - if (message.coins && message.coins.length) { - object.coins = []; - for (var j = 0; j < message.coins.length; ++j) - object.coins[j] = $root.common.Coin.toObject(message.coins[j], options); - } - if (message.height != null && message.hasOwnProperty("height")) - if (typeof message.height === "number") - object.height = options.longs === String ? String(message.height) : message.height; - else - object.height = options.longs === String ? $util.Long.prototype.toString.call(message.height) : options.longs === Number ? new $util.LongBits(message.height.low >>> 0, message.height.high >>> 0).toNumber() : message.height; - return object; - }; - - /** - * Converts this Solvency to JSON. - * @function toJSON - * @memberof common.Solvency - * @instance - * @returns {Object.} JSON object - */ - Solvency.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Solvency; - })(); - - common.AttestSolvency = (function() { - - /** - * Properties of an AttestSolvency. - * @memberof common - * @interface IAttestSolvency - * @property {common.ISolvency|null} [solvency] AttestSolvency solvency - * @property {common.IAttestation|null} [attestation] AttestSolvency attestation - */ - - /** - * Constructs a new AttestSolvency. - * @memberof common - * @classdesc Represents an AttestSolvency. - * @implements IAttestSolvency - * @constructor - * @param {common.IAttestSolvency=} [properties] Properties to set - */ - function AttestSolvency(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]]; - } - - /** - * AttestSolvency solvency. - * @member {common.ISolvency|null|undefined} solvency - * @memberof common.AttestSolvency - * @instance - */ - AttestSolvency.prototype.solvency = null; - - /** - * AttestSolvency attestation. - * @member {common.IAttestation|null|undefined} attestation - * @memberof common.AttestSolvency - * @instance - */ - AttestSolvency.prototype.attestation = null; - - /** - * Creates a new AttestSolvency instance using the specified properties. - * @function create - * @memberof common.AttestSolvency - * @static - * @param {common.IAttestSolvency=} [properties] Properties to set - * @returns {common.AttestSolvency} AttestSolvency instance - */ - AttestSolvency.create = function create(properties) { - return new AttestSolvency(properties); - }; - - /** - * Encodes the specified AttestSolvency message. Does not implicitly {@link common.AttestSolvency.verify|verify} messages. - * @function encode - * @memberof common.AttestSolvency - * @static - * @param {common.IAttestSolvency} message AttestSolvency message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AttestSolvency.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.solvency != null && Object.hasOwnProperty.call(message, "solvency")) - $root.common.Solvency.encode(message.solvency, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.attestation != null && Object.hasOwnProperty.call(message, "attestation")) - $root.common.Attestation.encode(message.attestation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified AttestSolvency message, length delimited. Does not implicitly {@link common.AttestSolvency.verify|verify} messages. - * @function encodeDelimited - * @memberof common.AttestSolvency - * @static - * @param {common.IAttestSolvency} message AttestSolvency message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AttestSolvency.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AttestSolvency message from the specified reader or buffer. - * @function decode - * @memberof common.AttestSolvency - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {common.AttestSolvency} AttestSolvency - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AttestSolvency.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.common.AttestSolvency(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.solvency = $root.common.Solvency.decode(reader, reader.uint32()); - break; - case 2: - message.attestation = $root.common.Attestation.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AttestSolvency message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof common.AttestSolvency - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {common.AttestSolvency} AttestSolvency - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AttestSolvency.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AttestSolvency message. - * @function verify - * @memberof common.AttestSolvency - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AttestSolvency.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.solvency != null && message.hasOwnProperty("solvency")) { - var error = $root.common.Solvency.verify(message.solvency); - if (error) - return "solvency." + error; - } - if (message.attestation != null && message.hasOwnProperty("attestation")) { - var error = $root.common.Attestation.verify(message.attestation); - if (error) - return "attestation." + error; - } - return null; - }; - - /** - * Creates an AttestSolvency message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof common.AttestSolvency - * @static - * @param {Object.} object Plain object - * @returns {common.AttestSolvency} AttestSolvency - */ - AttestSolvency.fromObject = function fromObject(object) { - if (object instanceof $root.common.AttestSolvency) - return object; - var message = new $root.common.AttestSolvency(); - if (object.solvency != null) { - if (typeof object.solvency !== "object") - throw TypeError(".common.AttestSolvency.solvency: object expected"); - message.solvency = $root.common.Solvency.fromObject(object.solvency); - } - if (object.attestation != null) { - if (typeof object.attestation !== "object") - throw TypeError(".common.AttestSolvency.attestation: object expected"); - message.attestation = $root.common.Attestation.fromObject(object.attestation); - } - return message; - }; - - /** - * Creates a plain object from an AttestSolvency message. Also converts values to other types if specified. - * @function toObject - * @memberof common.AttestSolvency - * @static - * @param {common.AttestSolvency} message AttestSolvency - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AttestSolvency.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.solvency = null; - object.attestation = null; - } - if (message.solvency != null && message.hasOwnProperty("solvency")) - object.solvency = $root.common.Solvency.toObject(message.solvency, options); - if (message.attestation != null && message.hasOwnProperty("attestation")) - object.attestation = $root.common.Attestation.toObject(message.attestation, options); - return object; - }; - - /** - * Converts this AttestSolvency to JSON. - * @function toJSON - * @memberof common.AttestSolvency - * @instance - * @returns {Object.} JSON object - */ - AttestSolvency.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return AttestSolvency; - })(); - - common.QuorumSolvency = (function() { - - /** - * Properties of a QuorumSolvency. - * @memberof common - * @interface IQuorumSolvency - * @property {common.ISolvency|null} [solvency] QuorumSolvency solvency - * @property {Array.|null} [attestations] QuorumSolvency attestations - */ - - /** - * Constructs a new QuorumSolvency. - * @memberof common - * @classdesc Represents a QuorumSolvency. - * @implements IQuorumSolvency - * @constructor - * @param {common.IQuorumSolvency=} [properties] Properties to set - */ - function QuorumSolvency(properties) { - this.attestations = []; - 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]]; - } - - /** - * QuorumSolvency solvency. - * @member {common.ISolvency|null|undefined} solvency - * @memberof common.QuorumSolvency - * @instance - */ - QuorumSolvency.prototype.solvency = null; - - /** - * QuorumSolvency attestations. - * @member {Array.} attestations - * @memberof common.QuorumSolvency - * @instance - */ - QuorumSolvency.prototype.attestations = $util.emptyArray; - - /** - * Creates a new QuorumSolvency instance using the specified properties. - * @function create - * @memberof common.QuorumSolvency - * @static - * @param {common.IQuorumSolvency=} [properties] Properties to set - * @returns {common.QuorumSolvency} QuorumSolvency instance - */ - QuorumSolvency.create = function create(properties) { - return new QuorumSolvency(properties); - }; - - /** - * Encodes the specified QuorumSolvency message. Does not implicitly {@link common.QuorumSolvency.verify|verify} messages. - * @function encode - * @memberof common.QuorumSolvency - * @static - * @param {common.IQuorumSolvency} message QuorumSolvency message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QuorumSolvency.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.solvency != null && Object.hasOwnProperty.call(message, "solvency")) - $root.common.Solvency.encode(message.solvency, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.attestations != null && message.attestations.length) - for (var i = 0; i < message.attestations.length; ++i) - $root.common.Attestation.encode(message.attestations[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QuorumSolvency message, length delimited. Does not implicitly {@link common.QuorumSolvency.verify|verify} messages. - * @function encodeDelimited - * @memberof common.QuorumSolvency - * @static - * @param {common.IQuorumSolvency} message QuorumSolvency message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QuorumSolvency.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QuorumSolvency message from the specified reader or buffer. - * @function decode - * @memberof common.QuorumSolvency - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {common.QuorumSolvency} QuorumSolvency - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QuorumSolvency.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.common.QuorumSolvency(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.solvency = $root.common.Solvency.decode(reader, reader.uint32()); - break; - case 2: - if (!(message.attestations && message.attestations.length)) - message.attestations = []; - message.attestations.push($root.common.Attestation.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QuorumSolvency message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof common.QuorumSolvency - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {common.QuorumSolvency} QuorumSolvency - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QuorumSolvency.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QuorumSolvency message. - * @function verify - * @memberof common.QuorumSolvency - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QuorumSolvency.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.solvency != null && message.hasOwnProperty("solvency")) { - var error = $root.common.Solvency.verify(message.solvency); - if (error) - return "solvency." + error; - } - if (message.attestations != null && message.hasOwnProperty("attestations")) { - if (!Array.isArray(message.attestations)) - return "attestations: array expected"; - for (var i = 0; i < message.attestations.length; ++i) { - var error = $root.common.Attestation.verify(message.attestations[i]); - if (error) - return "attestations." + error; - } - } - return null; - }; - - /** - * Creates a QuorumSolvency message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof common.QuorumSolvency - * @static - * @param {Object.} object Plain object - * @returns {common.QuorumSolvency} QuorumSolvency - */ - QuorumSolvency.fromObject = function fromObject(object) { - if (object instanceof $root.common.QuorumSolvency) - return object; - var message = new $root.common.QuorumSolvency(); - if (object.solvency != null) { - if (typeof object.solvency !== "object") - throw TypeError(".common.QuorumSolvency.solvency: object expected"); - message.solvency = $root.common.Solvency.fromObject(object.solvency); - } - if (object.attestations) { - if (!Array.isArray(object.attestations)) - throw TypeError(".common.QuorumSolvency.attestations: array expected"); - message.attestations = []; - for (var i = 0; i < object.attestations.length; ++i) { - if (typeof object.attestations[i] !== "object") - throw TypeError(".common.QuorumSolvency.attestations: object expected"); - message.attestations[i] = $root.common.Attestation.fromObject(object.attestations[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a QuorumSolvency message. Also converts values to other types if specified. - * @function toObject - * @memberof common.QuorumSolvency - * @static - * @param {common.QuorumSolvency} message QuorumSolvency - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QuorumSolvency.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.attestations = []; - if (options.defaults) - object.solvency = null; - if (message.solvency != null && message.hasOwnProperty("solvency")) - object.solvency = $root.common.Solvency.toObject(message.solvency, options); - if (message.attestations && message.attestations.length) { - object.attestations = []; - for (var j = 0; j < message.attestations.length; ++j) - object.attestations[j] = $root.common.Attestation.toObject(message.attestations[j], options); - } - return object; - }; - - /** - * Converts this QuorumSolvency to JSON. - * @function toJSON - * @memberof common.QuorumSolvency - * @instance - * @returns {Object.} JSON object - */ - QuorumSolvency.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QuorumSolvency; - })(); - - common.ErrataTx = (function() { - - /** - * Properties of an ErrataTx. - * @memberof common - * @interface IErrataTx - * @property {string|null} [id] ErrataTx id - * @property {string|null} [chain] ErrataTx chain - */ - - /** - * Constructs a new ErrataTx. - * @memberof common - * @classdesc Represents an ErrataTx. - * @implements IErrataTx - * @constructor - * @param {common.IErrataTx=} [properties] Properties to set - */ - function ErrataTx(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]]; - } - - /** - * ErrataTx id. - * @member {string} id - * @memberof common.ErrataTx - * @instance - */ - ErrataTx.prototype.id = ""; - - /** - * ErrataTx chain. - * @member {string} chain - * @memberof common.ErrataTx - * @instance - */ - ErrataTx.prototype.chain = ""; - - /** - * Creates a new ErrataTx instance using the specified properties. - * @function create - * @memberof common.ErrataTx - * @static - * @param {common.IErrataTx=} [properties] Properties to set - * @returns {common.ErrataTx} ErrataTx instance - */ - ErrataTx.create = function create(properties) { - return new ErrataTx(properties); - }; - - /** - * Encodes the specified ErrataTx message. Does not implicitly {@link common.ErrataTx.verify|verify} messages. - * @function encode - * @memberof common.ErrataTx - * @static - * @param {common.IErrataTx} message ErrataTx message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ErrataTx.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); - if (message.chain != null && Object.hasOwnProperty.call(message, "chain")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.chain); - return writer; - }; - - /** - * Encodes the specified ErrataTx message, length delimited. Does not implicitly {@link common.ErrataTx.verify|verify} messages. - * @function encodeDelimited - * @memberof common.ErrataTx - * @static - * @param {common.IErrataTx} message ErrataTx message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ErrataTx.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an ErrataTx message from the specified reader or buffer. - * @function decode - * @memberof common.ErrataTx - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {common.ErrataTx} ErrataTx - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ErrataTx.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.common.ErrataTx(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.id = reader.string(); - break; - case 2: - message.chain = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an ErrataTx message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof common.ErrataTx - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {common.ErrataTx} ErrataTx - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ErrataTx.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an ErrataTx message. - * @function verify - * @memberof common.ErrataTx - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ErrataTx.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!$util.isString(message.id)) - return "id: string expected"; - if (message.chain != null && message.hasOwnProperty("chain")) - if (!$util.isString(message.chain)) - return "chain: string expected"; - return null; - }; - - /** - * Creates an ErrataTx message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof common.ErrataTx - * @static - * @param {Object.} object Plain object - * @returns {common.ErrataTx} ErrataTx - */ - ErrataTx.fromObject = function fromObject(object) { - if (object instanceof $root.common.ErrataTx) - return object; - var message = new $root.common.ErrataTx(); - if (object.id != null) - message.id = String(object.id); - if (object.chain != null) - message.chain = String(object.chain); - return message; - }; - - /** - * Creates a plain object from an ErrataTx message. Also converts values to other types if specified. - * @function toObject - * @memberof common.ErrataTx - * @static - * @param {common.ErrataTx} message ErrataTx - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ErrataTx.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.id = ""; - object.chain = ""; - } - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.chain != null && message.hasOwnProperty("chain")) - object.chain = message.chain; - return object; - }; - - /** - * Converts this ErrataTx to JSON. - * @function toJSON - * @memberof common.ErrataTx - * @instance - * @returns {Object.} JSON object - */ - ErrataTx.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ErrataTx; - })(); - - common.AttestErrataTx = (function() { - - /** - * Properties of an AttestErrataTx. - * @memberof common - * @interface IAttestErrataTx - * @property {common.IErrataTx|null} [errataTx] AttestErrataTx errataTx - * @property {common.IAttestation|null} [attestation] AttestErrataTx attestation - */ - - /** - * Constructs a new AttestErrataTx. - * @memberof common - * @classdesc Represents an AttestErrataTx. - * @implements IAttestErrataTx - * @constructor - * @param {common.IAttestErrataTx=} [properties] Properties to set - */ - function AttestErrataTx(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]]; - } - - /** - * AttestErrataTx errataTx. - * @member {common.IErrataTx|null|undefined} errataTx - * @memberof common.AttestErrataTx - * @instance - */ - AttestErrataTx.prototype.errataTx = null; - - /** - * AttestErrataTx attestation. - * @member {common.IAttestation|null|undefined} attestation - * @memberof common.AttestErrataTx - * @instance - */ - AttestErrataTx.prototype.attestation = null; - - /** - * Creates a new AttestErrataTx instance using the specified properties. - * @function create - * @memberof common.AttestErrataTx - * @static - * @param {common.IAttestErrataTx=} [properties] Properties to set - * @returns {common.AttestErrataTx} AttestErrataTx instance - */ - AttestErrataTx.create = function create(properties) { - return new AttestErrataTx(properties); - }; - - /** - * Encodes the specified AttestErrataTx message. Does not implicitly {@link common.AttestErrataTx.verify|verify} messages. - * @function encode - * @memberof common.AttestErrataTx - * @static - * @param {common.IAttestErrataTx} message AttestErrataTx message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AttestErrataTx.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.errataTx != null && Object.hasOwnProperty.call(message, "errataTx")) - $root.common.ErrataTx.encode(message.errataTx, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.attestation != null && Object.hasOwnProperty.call(message, "attestation")) - $root.common.Attestation.encode(message.attestation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified AttestErrataTx message, length delimited. Does not implicitly {@link common.AttestErrataTx.verify|verify} messages. - * @function encodeDelimited - * @memberof common.AttestErrataTx - * @static - * @param {common.IAttestErrataTx} message AttestErrataTx message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AttestErrataTx.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AttestErrataTx message from the specified reader or buffer. - * @function decode - * @memberof common.AttestErrataTx - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {common.AttestErrataTx} AttestErrataTx - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AttestErrataTx.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.common.AttestErrataTx(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.errataTx = $root.common.ErrataTx.decode(reader, reader.uint32()); - break; - case 2: - message.attestation = $root.common.Attestation.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AttestErrataTx message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof common.AttestErrataTx - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {common.AttestErrataTx} AttestErrataTx - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AttestErrataTx.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AttestErrataTx message. - * @function verify - * @memberof common.AttestErrataTx - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AttestErrataTx.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.errataTx != null && message.hasOwnProperty("errataTx")) { - var error = $root.common.ErrataTx.verify(message.errataTx); - if (error) - return "errataTx." + error; - } - if (message.attestation != null && message.hasOwnProperty("attestation")) { - var error = $root.common.Attestation.verify(message.attestation); - if (error) - return "attestation." + error; - } - return null; - }; - - /** - * Creates an AttestErrataTx message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof common.AttestErrataTx - * @static - * @param {Object.} object Plain object - * @returns {common.AttestErrataTx} AttestErrataTx - */ - AttestErrataTx.fromObject = function fromObject(object) { - if (object instanceof $root.common.AttestErrataTx) - return object; - var message = new $root.common.AttestErrataTx(); - if (object.errataTx != null) { - if (typeof object.errataTx !== "object") - throw TypeError(".common.AttestErrataTx.errataTx: object expected"); - message.errataTx = $root.common.ErrataTx.fromObject(object.errataTx); - } - if (object.attestation != null) { - if (typeof object.attestation !== "object") - throw TypeError(".common.AttestErrataTx.attestation: object expected"); - message.attestation = $root.common.Attestation.fromObject(object.attestation); - } - return message; - }; - - /** - * Creates a plain object from an AttestErrataTx message. Also converts values to other types if specified. - * @function toObject - * @memberof common.AttestErrataTx - * @static - * @param {common.AttestErrataTx} message AttestErrataTx - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AttestErrataTx.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.errataTx = null; - object.attestation = null; - } - if (message.errataTx != null && message.hasOwnProperty("errataTx")) - object.errataTx = $root.common.ErrataTx.toObject(message.errataTx, options); - if (message.attestation != null && message.hasOwnProperty("attestation")) - object.attestation = $root.common.Attestation.toObject(message.attestation, options); - return object; - }; - - /** - * Converts this AttestErrataTx to JSON. - * @function toJSON - * @memberof common.AttestErrataTx - * @instance - * @returns {Object.} JSON object - */ - AttestErrataTx.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return AttestErrataTx; - })(); - - common.QuorumErrataTx = (function() { - - /** - * Properties of a QuorumErrataTx. - * @memberof common - * @interface IQuorumErrataTx - * @property {common.IErrataTx|null} [errataTx] QuorumErrataTx errataTx - * @property {Array.|null} [attestations] QuorumErrataTx attestations - */ - - /** - * Constructs a new QuorumErrataTx. - * @memberof common - * @classdesc Represents a QuorumErrataTx. - * @implements IQuorumErrataTx - * @constructor - * @param {common.IQuorumErrataTx=} [properties] Properties to set - */ - function QuorumErrataTx(properties) { - this.attestations = []; - 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]]; - } - - /** - * QuorumErrataTx errataTx. - * @member {common.IErrataTx|null|undefined} errataTx - * @memberof common.QuorumErrataTx - * @instance - */ - QuorumErrataTx.prototype.errataTx = null; - - /** - * QuorumErrataTx attestations. - * @member {Array.} attestations - * @memberof common.QuorumErrataTx - * @instance - */ - QuorumErrataTx.prototype.attestations = $util.emptyArray; - - /** - * Creates a new QuorumErrataTx instance using the specified properties. - * @function create - * @memberof common.QuorumErrataTx - * @static - * @param {common.IQuorumErrataTx=} [properties] Properties to set - * @returns {common.QuorumErrataTx} QuorumErrataTx instance - */ - QuorumErrataTx.create = function create(properties) { - return new QuorumErrataTx(properties); - }; - - /** - * Encodes the specified QuorumErrataTx message. Does not implicitly {@link common.QuorumErrataTx.verify|verify} messages. - * @function encode - * @memberof common.QuorumErrataTx - * @static - * @param {common.IQuorumErrataTx} message QuorumErrataTx message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QuorumErrataTx.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.errataTx != null && Object.hasOwnProperty.call(message, "errataTx")) - $root.common.ErrataTx.encode(message.errataTx, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.attestations != null && message.attestations.length) - for (var i = 0; i < message.attestations.length; ++i) - $root.common.Attestation.encode(message.attestations[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QuorumErrataTx message, length delimited. Does not implicitly {@link common.QuorumErrataTx.verify|verify} messages. - * @function encodeDelimited - * @memberof common.QuorumErrataTx - * @static - * @param {common.IQuorumErrataTx} message QuorumErrataTx message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QuorumErrataTx.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QuorumErrataTx message from the specified reader or buffer. - * @function decode - * @memberof common.QuorumErrataTx - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {common.QuorumErrataTx} QuorumErrataTx - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QuorumErrataTx.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.common.QuorumErrataTx(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.errataTx = $root.common.ErrataTx.decode(reader, reader.uint32()); - break; - case 2: - if (!(message.attestations && message.attestations.length)) - message.attestations = []; - message.attestations.push($root.common.Attestation.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QuorumErrataTx message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof common.QuorumErrataTx - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {common.QuorumErrataTx} QuorumErrataTx - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QuorumErrataTx.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QuorumErrataTx message. - * @function verify - * @memberof common.QuorumErrataTx - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QuorumErrataTx.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.errataTx != null && message.hasOwnProperty("errataTx")) { - var error = $root.common.ErrataTx.verify(message.errataTx); - if (error) - return "errataTx." + error; - } - if (message.attestations != null && message.hasOwnProperty("attestations")) { - if (!Array.isArray(message.attestations)) - return "attestations: array expected"; - for (var i = 0; i < message.attestations.length; ++i) { - var error = $root.common.Attestation.verify(message.attestations[i]); - if (error) - return "attestations." + error; - } - } - return null; - }; - - /** - * Creates a QuorumErrataTx message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof common.QuorumErrataTx - * @static - * @param {Object.} object Plain object - * @returns {common.QuorumErrataTx} QuorumErrataTx - */ - QuorumErrataTx.fromObject = function fromObject(object) { - if (object instanceof $root.common.QuorumErrataTx) - return object; - var message = new $root.common.QuorumErrataTx(); - if (object.errataTx != null) { - if (typeof object.errataTx !== "object") - throw TypeError(".common.QuorumErrataTx.errataTx: object expected"); - message.errataTx = $root.common.ErrataTx.fromObject(object.errataTx); - } - if (object.attestations) { - if (!Array.isArray(object.attestations)) - throw TypeError(".common.QuorumErrataTx.attestations: array expected"); - message.attestations = []; - for (var i = 0; i < object.attestations.length; ++i) { - if (typeof object.attestations[i] !== "object") - throw TypeError(".common.QuorumErrataTx.attestations: object expected"); - message.attestations[i] = $root.common.Attestation.fromObject(object.attestations[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a QuorumErrataTx message. Also converts values to other types if specified. - * @function toObject - * @memberof common.QuorumErrataTx - * @static - * @param {common.QuorumErrataTx} message QuorumErrataTx - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QuorumErrataTx.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.attestations = []; - if (options.defaults) - object.errataTx = null; - if (message.errataTx != null && message.hasOwnProperty("errataTx")) - object.errataTx = $root.common.ErrataTx.toObject(message.errataTx, options); - if (message.attestations && message.attestations.length) { - object.attestations = []; - for (var j = 0; j < message.attestations.length; ++j) - object.attestations[j] = $root.common.Attestation.toObject(message.attestations[j], options); - } - return object; - }; - - /** - * Converts this QuorumErrataTx to JSON. - * @function toJSON - * @memberof common.QuorumErrataTx - * @instance - * @returns {Object.} JSON object - */ - QuorumErrataTx.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QuorumErrataTx; - })(); - - common.PriceFeed = (function() { - - /** - * Properties of a PriceFeed. - * @memberof common - * @interface IPriceFeed - * @property {Uint8Array|null} [version] PriceFeed version - * @property {number|Long|null} [time] PriceFeed time - * @property {Array.|null} [rates] PriceFeed rates - */ - - /** - * Constructs a new PriceFeed. - * @memberof common - * @classdesc Represents a PriceFeed. - * @implements IPriceFeed - * @constructor - * @param {common.IPriceFeed=} [properties] Properties to set - */ - function PriceFeed(properties) { - this.rates = []; - 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]]; - } - - /** - * PriceFeed version. - * @member {Uint8Array} version - * @memberof common.PriceFeed - * @instance - */ - PriceFeed.prototype.version = $util.newBuffer([]); - - /** - * PriceFeed time. - * @member {number|Long} time - * @memberof common.PriceFeed - * @instance - */ - PriceFeed.prototype.time = $util.Long ? $util.Long.fromBits(0,0,false) : 0; - - /** - * PriceFeed rates. - * @member {Array.} rates - * @memberof common.PriceFeed - * @instance - */ - PriceFeed.prototype.rates = $util.emptyArray; - - /** - * Creates a new PriceFeed instance using the specified properties. - * @function create - * @memberof common.PriceFeed - * @static - * @param {common.IPriceFeed=} [properties] Properties to set - * @returns {common.PriceFeed} PriceFeed instance - */ - PriceFeed.create = function create(properties) { - return new PriceFeed(properties); - }; - - /** - * Encodes the specified PriceFeed message. Does not implicitly {@link common.PriceFeed.verify|verify} messages. - * @function encode - * @memberof common.PriceFeed - * @static - * @param {common.IPriceFeed} message PriceFeed message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PriceFeed.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.version != null && Object.hasOwnProperty.call(message, "version")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.version); - if (message.time != null && Object.hasOwnProperty.call(message, "time")) - writer.uint32(/* id 2, wireType 0 =*/16).int64(message.time); - if (message.rates != null && message.rates.length) - for (var i = 0; i < message.rates.length; ++i) - $root.common.OraclePrice.encode(message.rates[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified PriceFeed message, length delimited. Does not implicitly {@link common.PriceFeed.verify|verify} messages. - * @function encodeDelimited - * @memberof common.PriceFeed - * @static - * @param {common.IPriceFeed} message PriceFeed message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - PriceFeed.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a PriceFeed message from the specified reader or buffer. - * @function decode - * @memberof common.PriceFeed - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {common.PriceFeed} PriceFeed - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PriceFeed.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.common.PriceFeed(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.version = reader.bytes(); - break; - case 2: - message.time = reader.int64(); - break; - case 3: - if (!(message.rates && message.rates.length)) - message.rates = []; - message.rates.push($root.common.OraclePrice.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a PriceFeed message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof common.PriceFeed - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {common.PriceFeed} PriceFeed - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - PriceFeed.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a PriceFeed message. - * @function verify - * @memberof common.PriceFeed - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - PriceFeed.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.version != null && message.hasOwnProperty("version")) - if (!(message.version && typeof message.version.length === "number" || $util.isString(message.version))) - return "version: buffer expected"; - if (message.time != null && message.hasOwnProperty("time")) - if (!$util.isInteger(message.time) && !(message.time && $util.isInteger(message.time.low) && $util.isInteger(message.time.high))) - return "time: integer|Long expected"; - if (message.rates != null && message.hasOwnProperty("rates")) { - if (!Array.isArray(message.rates)) - return "rates: array expected"; - for (var i = 0; i < message.rates.length; ++i) { - var error = $root.common.OraclePrice.verify(message.rates[i]); - if (error) - return "rates." + error; - } - } - return null; - }; - - /** - * Creates a PriceFeed message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof common.PriceFeed - * @static - * @param {Object.} object Plain object - * @returns {common.PriceFeed} PriceFeed - */ - PriceFeed.fromObject = function fromObject(object) { - if (object instanceof $root.common.PriceFeed) - return object; - var message = new $root.common.PriceFeed(); - if (object.version != null) - if (typeof object.version === "string") - $util.base64.decode(object.version, message.version = $util.newBuffer($util.base64.length(object.version)), 0); - else if (object.version.length) - message.version = object.version; - if (object.time != null) - if ($util.Long) - (message.time = $util.Long.fromValue(object.time)).unsigned = false; - else if (typeof object.time === "string") - message.time = parseInt(object.time, 10); - else if (typeof object.time === "number") - message.time = object.time; - else if (typeof object.time === "object") - message.time = new $util.LongBits(object.time.low >>> 0, object.time.high >>> 0).toNumber(); - if (object.rates) { - if (!Array.isArray(object.rates)) - throw TypeError(".common.PriceFeed.rates: array expected"); - message.rates = []; - for (var i = 0; i < object.rates.length; ++i) { - if (typeof object.rates[i] !== "object") - throw TypeError(".common.PriceFeed.rates: object expected"); - message.rates[i] = $root.common.OraclePrice.fromObject(object.rates[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a PriceFeed message. Also converts values to other types if specified. - * @function toObject - * @memberof common.PriceFeed - * @static - * @param {common.PriceFeed} message PriceFeed - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - PriceFeed.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.rates = []; - if (options.defaults) { - if (options.bytes === String) - object.version = ""; - else { - object.version = []; - if (options.bytes !== Array) - object.version = $util.newBuffer(object.version); - } - if ($util.Long) { - var long = new $util.Long(0, 0, false); - object.time = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.time = options.longs === String ? "0" : 0; - } - if (message.version != null && message.hasOwnProperty("version")) - object.version = options.bytes === String ? $util.base64.encode(message.version, 0, message.version.length) : options.bytes === Array ? Array.prototype.slice.call(message.version) : message.version; - if (message.time != null && message.hasOwnProperty("time")) - if (typeof message.time === "number") - object.time = options.longs === String ? String(message.time) : message.time; - else - object.time = options.longs === String ? $util.Long.prototype.toString.call(message.time) : options.longs === Number ? new $util.LongBits(message.time.low >>> 0, message.time.high >>> 0).toNumber() : message.time; - if (message.rates && message.rates.length) { - object.rates = []; - for (var j = 0; j < message.rates.length; ++j) - object.rates[j] = $root.common.OraclePrice.toObject(message.rates[j], options); - } - return object; - }; - - /** - * Converts this PriceFeed to JSON. - * @function toJSON - * @memberof common.PriceFeed - * @instance - * @returns {Object.} JSON object - */ - PriceFeed.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return PriceFeed; - })(); - - common.AttestPriceFeed = (function() { - - /** - * Properties of an AttestPriceFeed. - * @memberof common - * @interface IAttestPriceFeed - * @property {common.IPriceFeed|null} [priceFeed] AttestPriceFeed priceFeed - * @property {common.IAttestation|null} [attestation] AttestPriceFeed attestation - */ - - /** - * Constructs a new AttestPriceFeed. - * @memberof common - * @classdesc Represents an AttestPriceFeed. - * @implements IAttestPriceFeed - * @constructor - * @param {common.IAttestPriceFeed=} [properties] Properties to set - */ - function AttestPriceFeed(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]]; - } - - /** - * AttestPriceFeed priceFeed. - * @member {common.IPriceFeed|null|undefined} priceFeed - * @memberof common.AttestPriceFeed - * @instance - */ - AttestPriceFeed.prototype.priceFeed = null; - - /** - * AttestPriceFeed attestation. - * @member {common.IAttestation|null|undefined} attestation - * @memberof common.AttestPriceFeed - * @instance - */ - AttestPriceFeed.prototype.attestation = null; - - /** - * Creates a new AttestPriceFeed instance using the specified properties. - * @function create - * @memberof common.AttestPriceFeed - * @static - * @param {common.IAttestPriceFeed=} [properties] Properties to set - * @returns {common.AttestPriceFeed} AttestPriceFeed instance - */ - AttestPriceFeed.create = function create(properties) { - return new AttestPriceFeed(properties); - }; - - /** - * Encodes the specified AttestPriceFeed message. Does not implicitly {@link common.AttestPriceFeed.verify|verify} messages. - * @function encode - * @memberof common.AttestPriceFeed - * @static - * @param {common.IAttestPriceFeed} message AttestPriceFeed message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AttestPriceFeed.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.priceFeed != null && Object.hasOwnProperty.call(message, "priceFeed")) - $root.common.PriceFeed.encode(message.priceFeed, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.attestation != null && Object.hasOwnProperty.call(message, "attestation")) - $root.common.Attestation.encode(message.attestation, writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified AttestPriceFeed message, length delimited. Does not implicitly {@link common.AttestPriceFeed.verify|verify} messages. - * @function encodeDelimited - * @memberof common.AttestPriceFeed - * @static - * @param {common.IAttestPriceFeed} message AttestPriceFeed message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AttestPriceFeed.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AttestPriceFeed message from the specified reader or buffer. - * @function decode - * @memberof common.AttestPriceFeed - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {common.AttestPriceFeed} AttestPriceFeed - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AttestPriceFeed.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.common.AttestPriceFeed(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.priceFeed = $root.common.PriceFeed.decode(reader, reader.uint32()); - break; - case 2: - message.attestation = $root.common.Attestation.decode(reader, reader.uint32()); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AttestPriceFeed message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof common.AttestPriceFeed - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {common.AttestPriceFeed} AttestPriceFeed - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AttestPriceFeed.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AttestPriceFeed message. - * @function verify - * @memberof common.AttestPriceFeed - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AttestPriceFeed.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.priceFeed != null && message.hasOwnProperty("priceFeed")) { - var error = $root.common.PriceFeed.verify(message.priceFeed); - if (error) - return "priceFeed." + error; - } - if (message.attestation != null && message.hasOwnProperty("attestation")) { - var error = $root.common.Attestation.verify(message.attestation); - if (error) - return "attestation." + error; - } - return null; - }; - - /** - * Creates an AttestPriceFeed message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof common.AttestPriceFeed - * @static - * @param {Object.} object Plain object - * @returns {common.AttestPriceFeed} AttestPriceFeed - */ - AttestPriceFeed.fromObject = function fromObject(object) { - if (object instanceof $root.common.AttestPriceFeed) - return object; - var message = new $root.common.AttestPriceFeed(); - if (object.priceFeed != null) { - if (typeof object.priceFeed !== "object") - throw TypeError(".common.AttestPriceFeed.priceFeed: object expected"); - message.priceFeed = $root.common.PriceFeed.fromObject(object.priceFeed); - } - if (object.attestation != null) { - if (typeof object.attestation !== "object") - throw TypeError(".common.AttestPriceFeed.attestation: object expected"); - message.attestation = $root.common.Attestation.fromObject(object.attestation); - } - return message; - }; - - /** - * Creates a plain object from an AttestPriceFeed message. Also converts values to other types if specified. - * @function toObject - * @memberof common.AttestPriceFeed - * @static - * @param {common.AttestPriceFeed} message AttestPriceFeed - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AttestPriceFeed.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.priceFeed = null; - object.attestation = null; - } - if (message.priceFeed != null && message.hasOwnProperty("priceFeed")) - object.priceFeed = $root.common.PriceFeed.toObject(message.priceFeed, options); - if (message.attestation != null && message.hasOwnProperty("attestation")) - object.attestation = $root.common.Attestation.toObject(message.attestation, options); - return object; - }; - - /** - * Converts this AttestPriceFeed to JSON. - * @function toJSON - * @memberof common.AttestPriceFeed - * @instance - * @returns {Object.} JSON object - */ - AttestPriceFeed.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return AttestPriceFeed; - })(); - - common.QuorumPriceFeed = (function() { - - /** - * Properties of a QuorumPriceFeed. - * @memberof common - * @interface IQuorumPriceFeed - * @property {common.IPriceFeed|null} [priceFeed] QuorumPriceFeed priceFeed - * @property {Array.|null} [attestations] QuorumPriceFeed attestations - */ - - /** - * Constructs a new QuorumPriceFeed. - * @memberof common - * @classdesc Represents a QuorumPriceFeed. - * @implements IQuorumPriceFeed - * @constructor - * @param {common.IQuorumPriceFeed=} [properties] Properties to set - */ - function QuorumPriceFeed(properties) { - this.attestations = []; - 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]]; - } - - /** - * QuorumPriceFeed priceFeed. - * @member {common.IPriceFeed|null|undefined} priceFeed - * @memberof common.QuorumPriceFeed - * @instance - */ - QuorumPriceFeed.prototype.priceFeed = null; - - /** - * QuorumPriceFeed attestations. - * @member {Array.} attestations - * @memberof common.QuorumPriceFeed - * @instance - */ - QuorumPriceFeed.prototype.attestations = $util.emptyArray; - - /** - * Creates a new QuorumPriceFeed instance using the specified properties. - * @function create - * @memberof common.QuorumPriceFeed - * @static - * @param {common.IQuorumPriceFeed=} [properties] Properties to set - * @returns {common.QuorumPriceFeed} QuorumPriceFeed instance - */ - QuorumPriceFeed.create = function create(properties) { - return new QuorumPriceFeed(properties); - }; - - /** - * Encodes the specified QuorumPriceFeed message. Does not implicitly {@link common.QuorumPriceFeed.verify|verify} messages. - * @function encode - * @memberof common.QuorumPriceFeed - * @static - * @param {common.IQuorumPriceFeed} message QuorumPriceFeed message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QuorumPriceFeed.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.priceFeed != null && Object.hasOwnProperty.call(message, "priceFeed")) - $root.common.PriceFeed.encode(message.priceFeed, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.attestations != null && message.attestations.length) - for (var i = 0; i < message.attestations.length; ++i) - $root.common.Attestation.encode(message.attestations[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QuorumPriceFeed message, length delimited. Does not implicitly {@link common.QuorumPriceFeed.verify|verify} messages. - * @function encodeDelimited - * @memberof common.QuorumPriceFeed - * @static - * @param {common.IQuorumPriceFeed} message QuorumPriceFeed message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QuorumPriceFeed.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QuorumPriceFeed message from the specified reader or buffer. - * @function decode - * @memberof common.QuorumPriceFeed - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {common.QuorumPriceFeed} QuorumPriceFeed - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QuorumPriceFeed.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.common.QuorumPriceFeed(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.priceFeed = $root.common.PriceFeed.decode(reader, reader.uint32()); - break; - case 2: - if (!(message.attestations && message.attestations.length)) - message.attestations = []; - message.attestations.push($root.common.Attestation.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QuorumPriceFeed message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof common.QuorumPriceFeed - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {common.QuorumPriceFeed} QuorumPriceFeed - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QuorumPriceFeed.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QuorumPriceFeed message. - * @function verify - * @memberof common.QuorumPriceFeed - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QuorumPriceFeed.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.priceFeed != null && message.hasOwnProperty("priceFeed")) { - var error = $root.common.PriceFeed.verify(message.priceFeed); - if (error) - return "priceFeed." + error; - } - if (message.attestations != null && message.hasOwnProperty("attestations")) { - if (!Array.isArray(message.attestations)) - return "attestations: array expected"; - for (var i = 0; i < message.attestations.length; ++i) { - var error = $root.common.Attestation.verify(message.attestations[i]); - if (error) - return "attestations." + error; - } - } - return null; - }; - - /** - * Creates a QuorumPriceFeed message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof common.QuorumPriceFeed - * @static - * @param {Object.} object Plain object - * @returns {common.QuorumPriceFeed} QuorumPriceFeed - */ - QuorumPriceFeed.fromObject = function fromObject(object) { - if (object instanceof $root.common.QuorumPriceFeed) - return object; - var message = new $root.common.QuorumPriceFeed(); - if (object.priceFeed != null) { - if (typeof object.priceFeed !== "object") - throw TypeError(".common.QuorumPriceFeed.priceFeed: object expected"); - message.priceFeed = $root.common.PriceFeed.fromObject(object.priceFeed); - } - if (object.attestations) { - if (!Array.isArray(object.attestations)) - throw TypeError(".common.QuorumPriceFeed.attestations: array expected"); - message.attestations = []; - for (var i = 0; i < object.attestations.length; ++i) { - if (typeof object.attestations[i] !== "object") - throw TypeError(".common.QuorumPriceFeed.attestations: object expected"); - message.attestations[i] = $root.common.Attestation.fromObject(object.attestations[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a QuorumPriceFeed message. Also converts values to other types if specified. - * @function toObject - * @memberof common.QuorumPriceFeed - * @static - * @param {common.QuorumPriceFeed} message QuorumPriceFeed - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QuorumPriceFeed.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.attestations = []; - if (options.defaults) - object.priceFeed = null; - if (message.priceFeed != null && message.hasOwnProperty("priceFeed")) - object.priceFeed = $root.common.PriceFeed.toObject(message.priceFeed, options); - if (message.attestations && message.attestations.length) { - object.attestations = []; - for (var j = 0; j < message.attestations.length; ++j) - object.attestations[j] = $root.common.Attestation.toObject(message.attestations[j], options); - } - return object; - }; - - /** - * Converts this QuorumPriceFeed to JSON. - * @function toJSON - * @memberof common.QuorumPriceFeed - * @instance - * @returns {Object.} JSON object - */ - QuorumPriceFeed.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QuorumPriceFeed; - })(); - - common.QuorumPriceFeedBatch = (function() { - - /** - * Properties of a QuorumPriceFeedBatch. - * @memberof common - * @interface IQuorumPriceFeedBatch - * @property {Array.|null} [quorumPriceFeeds] QuorumPriceFeedBatch quorumPriceFeeds - */ - - /** - * Constructs a new QuorumPriceFeedBatch. - * @memberof common - * @classdesc Represents a QuorumPriceFeedBatch. - * @implements IQuorumPriceFeedBatch - * @constructor - * @param {common.IQuorumPriceFeedBatch=} [properties] Properties to set - */ - function QuorumPriceFeedBatch(properties) { - this.quorumPriceFeeds = []; - 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]]; - } - - /** - * QuorumPriceFeedBatch quorumPriceFeeds. - * @member {Array.} quorumPriceFeeds - * @memberof common.QuorumPriceFeedBatch - * @instance - */ - QuorumPriceFeedBatch.prototype.quorumPriceFeeds = $util.emptyArray; - - /** - * Creates a new QuorumPriceFeedBatch instance using the specified properties. - * @function create - * @memberof common.QuorumPriceFeedBatch - * @static - * @param {common.IQuorumPriceFeedBatch=} [properties] Properties to set - * @returns {common.QuorumPriceFeedBatch} QuorumPriceFeedBatch instance - */ - QuorumPriceFeedBatch.create = function create(properties) { - return new QuorumPriceFeedBatch(properties); - }; - - /** - * Encodes the specified QuorumPriceFeedBatch message. Does not implicitly {@link common.QuorumPriceFeedBatch.verify|verify} messages. - * @function encode - * @memberof common.QuorumPriceFeedBatch - * @static - * @param {common.IQuorumPriceFeedBatch} message QuorumPriceFeedBatch message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QuorumPriceFeedBatch.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.quorumPriceFeeds != null && message.quorumPriceFeeds.length) - for (var i = 0; i < message.quorumPriceFeeds.length; ++i) - $root.common.QuorumPriceFeed.encode(message.quorumPriceFeeds[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified QuorumPriceFeedBatch message, length delimited. Does not implicitly {@link common.QuorumPriceFeedBatch.verify|verify} messages. - * @function encodeDelimited - * @memberof common.QuorumPriceFeedBatch - * @static - * @param {common.IQuorumPriceFeedBatch} message QuorumPriceFeedBatch message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - QuorumPriceFeedBatch.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a QuorumPriceFeedBatch message from the specified reader or buffer. - * @function decode - * @memberof common.QuorumPriceFeedBatch - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {common.QuorumPriceFeedBatch} QuorumPriceFeedBatch - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QuorumPriceFeedBatch.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.common.QuorumPriceFeedBatch(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.quorumPriceFeeds && message.quorumPriceFeeds.length)) - message.quorumPriceFeeds = []; - message.quorumPriceFeeds.push($root.common.QuorumPriceFeed.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a QuorumPriceFeedBatch message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof common.QuorumPriceFeedBatch - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {common.QuorumPriceFeedBatch} QuorumPriceFeedBatch - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - QuorumPriceFeedBatch.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a QuorumPriceFeedBatch message. - * @function verify - * @memberof common.QuorumPriceFeedBatch - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - QuorumPriceFeedBatch.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.quorumPriceFeeds != null && message.hasOwnProperty("quorumPriceFeeds")) { - if (!Array.isArray(message.quorumPriceFeeds)) - return "quorumPriceFeeds: array expected"; - for (var i = 0; i < message.quorumPriceFeeds.length; ++i) { - var error = $root.common.QuorumPriceFeed.verify(message.quorumPriceFeeds[i]); - if (error) - return "quorumPriceFeeds." + error; - } - } - return null; - }; - - /** - * Creates a QuorumPriceFeedBatch message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof common.QuorumPriceFeedBatch - * @static - * @param {Object.} object Plain object - * @returns {common.QuorumPriceFeedBatch} QuorumPriceFeedBatch - */ - QuorumPriceFeedBatch.fromObject = function fromObject(object) { - if (object instanceof $root.common.QuorumPriceFeedBatch) - return object; - var message = new $root.common.QuorumPriceFeedBatch(); - if (object.quorumPriceFeeds) { - if (!Array.isArray(object.quorumPriceFeeds)) - throw TypeError(".common.QuorumPriceFeedBatch.quorumPriceFeeds: array expected"); - message.quorumPriceFeeds = []; - for (var i = 0; i < object.quorumPriceFeeds.length; ++i) { - if (typeof object.quorumPriceFeeds[i] !== "object") - throw TypeError(".common.QuorumPriceFeedBatch.quorumPriceFeeds: object expected"); - message.quorumPriceFeeds[i] = $root.common.QuorumPriceFeed.fromObject(object.quorumPriceFeeds[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a QuorumPriceFeedBatch message. Also converts values to other types if specified. - * @function toObject - * @memberof common.QuorumPriceFeedBatch - * @static - * @param {common.QuorumPriceFeedBatch} message QuorumPriceFeedBatch - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - QuorumPriceFeedBatch.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.quorumPriceFeeds = []; - if (message.quorumPriceFeeds && message.quorumPriceFeeds.length) { - object.quorumPriceFeeds = []; - for (var j = 0; j < message.quorumPriceFeeds.length; ++j) - object.quorumPriceFeeds[j] = $root.common.QuorumPriceFeed.toObject(message.quorumPriceFeeds[j], options); - } - return object; - }; - - /** - * Converts this QuorumPriceFeedBatch to JSON. - * @function toJSON - * @memberof common.QuorumPriceFeedBatch - * @instance - * @returns {Object.} JSON object - */ - QuorumPriceFeedBatch.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return QuorumPriceFeedBatch; - })(); - - common.OraclePrice = (function() { - - /** - * Properties of an OraclePrice. - * @memberof common - * @interface IOraclePrice - * @property {number|Long|null} [amount] OraclePrice amount - * @property {number|null} [decimals] OraclePrice decimals - */ - - /** - * Constructs a new OraclePrice. - * @memberof common - * @classdesc Represents an OraclePrice. - * @implements IOraclePrice - * @constructor - * @param {common.IOraclePrice=} [properties] Properties to set - */ - function OraclePrice(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]]; - } - - /** - * OraclePrice amount. - * @member {number|Long} amount - * @memberof common.OraclePrice - * @instance - */ - OraclePrice.prototype.amount = $util.Long ? $util.Long.fromBits(0,0,true) : 0; - - /** - * OraclePrice decimals. - * @member {number} decimals - * @memberof common.OraclePrice - * @instance - */ - OraclePrice.prototype.decimals = 0; - - /** - * Creates a new OraclePrice instance using the specified properties. - * @function create - * @memberof common.OraclePrice - * @static - * @param {common.IOraclePrice=} [properties] Properties to set - * @returns {common.OraclePrice} OraclePrice instance - */ - OraclePrice.create = function create(properties) { - return new OraclePrice(properties); - }; - - /** - * Encodes the specified OraclePrice message. Does not implicitly {@link common.OraclePrice.verify|verify} messages. - * @function encode - * @memberof common.OraclePrice - * @static - * @param {common.IOraclePrice} message OraclePrice message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OraclePrice.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) - writer.uint32(/* id 1, wireType 0 =*/8).uint64(message.amount); - if (message.decimals != null && Object.hasOwnProperty.call(message, "decimals")) - writer.uint32(/* id 2, wireType 0 =*/16).uint32(message.decimals); - return writer; - }; - - /** - * Encodes the specified OraclePrice message, length delimited. Does not implicitly {@link common.OraclePrice.verify|verify} messages. - * @function encodeDelimited - * @memberof common.OraclePrice - * @static - * @param {common.IOraclePrice} message OraclePrice message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - OraclePrice.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an OraclePrice message from the specified reader or buffer. - * @function decode - * @memberof common.OraclePrice - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {common.OraclePrice} OraclePrice - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OraclePrice.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.common.OraclePrice(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.amount = reader.uint64(); - break; - case 2: - message.decimals = reader.uint32(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an OraclePrice message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof common.OraclePrice - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {common.OraclePrice} OraclePrice - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - OraclePrice.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an OraclePrice message. - * @function verify - * @memberof common.OraclePrice - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - OraclePrice.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.amount != null && message.hasOwnProperty("amount")) - if (!$util.isInteger(message.amount) && !(message.amount && $util.isInteger(message.amount.low) && $util.isInteger(message.amount.high))) - return "amount: integer|Long expected"; - if (message.decimals != null && message.hasOwnProperty("decimals")) - if (!$util.isInteger(message.decimals)) - return "decimals: integer expected"; - return null; - }; - - /** - * Creates an OraclePrice message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof common.OraclePrice - * @static - * @param {Object.} object Plain object - * @returns {common.OraclePrice} OraclePrice - */ - OraclePrice.fromObject = function fromObject(object) { - if (object instanceof $root.common.OraclePrice) - return object; - var message = new $root.common.OraclePrice(); - if (object.amount != null) - if ($util.Long) - (message.amount = $util.Long.fromValue(object.amount)).unsigned = true; - else if (typeof object.amount === "string") - message.amount = parseInt(object.amount, 10); - else if (typeof object.amount === "number") - message.amount = object.amount; - else if (typeof object.amount === "object") - message.amount = new $util.LongBits(object.amount.low >>> 0, object.amount.high >>> 0).toNumber(true); - if (object.decimals != null) - message.decimals = object.decimals >>> 0; - return message; - }; - - /** - * Creates a plain object from an OraclePrice message. Also converts values to other types if specified. - * @function toObject - * @memberof common.OraclePrice - * @static - * @param {common.OraclePrice} message OraclePrice - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - OraclePrice.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - if ($util.Long) { - var long = new $util.Long(0, 0, true); - object.amount = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long; - } else - object.amount = options.longs === String ? "0" : 0; - object.decimals = 0; - } - if (message.amount != null && message.hasOwnProperty("amount")) - if (typeof message.amount === "number") - object.amount = options.longs === String ? String(message.amount) : message.amount; - else - object.amount = options.longs === String ? $util.Long.prototype.toString.call(message.amount) : options.longs === Number ? new $util.LongBits(message.amount.low >>> 0, message.amount.high >>> 0).toNumber(true) : message.amount; - if (message.decimals != null && message.hasOwnProperty("decimals")) - object.decimals = message.decimals; - return object; - }; - - /** - * Converts this OraclePrice to JSON. - * @function toJSON - * @memberof common.OraclePrice - * @instance - * @returns {Object.} JSON object - */ - OraclePrice.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return OraclePrice; - })(); - - common.AttestationBatch = (function() { - - /** - * Properties of an AttestationBatch. - * @memberof common - * @interface IAttestationBatch - * @property {Array.|null} [attestTxs] AttestationBatch attestTxs - * @property {Array.|null} [attestNetworkFees] AttestationBatch attestNetworkFees - * @property {Array.|null} [attestSolvencies] AttestationBatch attestSolvencies - * @property {Array.|null} [attestErrataTxs] AttestationBatch attestErrataTxs - * @property {Array.|null} [attestPriceFeeds] AttestationBatch attestPriceFeeds - */ - - /** - * Constructs a new AttestationBatch. - * @memberof common - * @classdesc Represents an AttestationBatch. - * @implements IAttestationBatch - * @constructor - * @param {common.IAttestationBatch=} [properties] Properties to set - */ - function AttestationBatch(properties) { - this.attestTxs = []; - this.attestNetworkFees = []; - this.attestSolvencies = []; - this.attestErrataTxs = []; - this.attestPriceFeeds = []; - 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]]; - } - - /** - * AttestationBatch attestTxs. - * @member {Array.} attestTxs - * @memberof common.AttestationBatch - * @instance - */ - AttestationBatch.prototype.attestTxs = $util.emptyArray; - - /** - * AttestationBatch attestNetworkFees. - * @member {Array.} attestNetworkFees - * @memberof common.AttestationBatch - * @instance - */ - AttestationBatch.prototype.attestNetworkFees = $util.emptyArray; - - /** - * AttestationBatch attestSolvencies. - * @member {Array.} attestSolvencies - * @memberof common.AttestationBatch - * @instance - */ - AttestationBatch.prototype.attestSolvencies = $util.emptyArray; - - /** - * AttestationBatch attestErrataTxs. - * @member {Array.} attestErrataTxs - * @memberof common.AttestationBatch - * @instance - */ - AttestationBatch.prototype.attestErrataTxs = $util.emptyArray; - - /** - * AttestationBatch attestPriceFeeds. - * @member {Array.} attestPriceFeeds - * @memberof common.AttestationBatch - * @instance - */ - AttestationBatch.prototype.attestPriceFeeds = $util.emptyArray; - - /** - * Creates a new AttestationBatch instance using the specified properties. - * @function create - * @memberof common.AttestationBatch - * @static - * @param {common.IAttestationBatch=} [properties] Properties to set - * @returns {common.AttestationBatch} AttestationBatch instance - */ - AttestationBatch.create = function create(properties) { - return new AttestationBatch(properties); - }; - - /** - * Encodes the specified AttestationBatch message. Does not implicitly {@link common.AttestationBatch.verify|verify} messages. - * @function encode - * @memberof common.AttestationBatch - * @static - * @param {common.IAttestationBatch} message AttestationBatch message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AttestationBatch.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.attestTxs != null && message.attestTxs.length) - for (var i = 0; i < message.attestTxs.length; ++i) - $root.common.AttestTx.encode(message.attestTxs[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.attestNetworkFees != null && message.attestNetworkFees.length) - for (var i = 0; i < message.attestNetworkFees.length; ++i) - $root.common.AttestNetworkFee.encode(message.attestNetworkFees[i], writer.uint32(/* id 2, wireType 2 =*/18).fork()).ldelim(); - if (message.attestSolvencies != null && message.attestSolvencies.length) - for (var i = 0; i < message.attestSolvencies.length; ++i) - $root.common.AttestSolvency.encode(message.attestSolvencies[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - if (message.attestErrataTxs != null && message.attestErrataTxs.length) - for (var i = 0; i < message.attestErrataTxs.length; ++i) - $root.common.AttestErrataTx.encode(message.attestErrataTxs[i], writer.uint32(/* id 4, wireType 2 =*/34).fork()).ldelim(); - if (message.attestPriceFeeds != null && message.attestPriceFeeds.length) - for (var i = 0; i < message.attestPriceFeeds.length; ++i) - $root.common.AttestPriceFeed.encode(message.attestPriceFeeds[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified AttestationBatch message, length delimited. Does not implicitly {@link common.AttestationBatch.verify|verify} messages. - * @function encodeDelimited - * @memberof common.AttestationBatch - * @static - * @param {common.IAttestationBatch} message AttestationBatch message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - AttestationBatch.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an AttestationBatch message from the specified reader or buffer. - * @function decode - * @memberof common.AttestationBatch - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {common.AttestationBatch} AttestationBatch - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AttestationBatch.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.common.AttestationBatch(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.attestTxs && message.attestTxs.length)) - message.attestTxs = []; - message.attestTxs.push($root.common.AttestTx.decode(reader, reader.uint32())); - break; - case 2: - if (!(message.attestNetworkFees && message.attestNetworkFees.length)) - message.attestNetworkFees = []; - message.attestNetworkFees.push($root.common.AttestNetworkFee.decode(reader, reader.uint32())); - break; - case 3: - if (!(message.attestSolvencies && message.attestSolvencies.length)) - message.attestSolvencies = []; - message.attestSolvencies.push($root.common.AttestSolvency.decode(reader, reader.uint32())); - break; - case 4: - if (!(message.attestErrataTxs && message.attestErrataTxs.length)) - message.attestErrataTxs = []; - message.attestErrataTxs.push($root.common.AttestErrataTx.decode(reader, reader.uint32())); - break; - case 5: - if (!(message.attestPriceFeeds && message.attestPriceFeeds.length)) - message.attestPriceFeeds = []; - message.attestPriceFeeds.push($root.common.AttestPriceFeed.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an AttestationBatch message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof common.AttestationBatch - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {common.AttestationBatch} AttestationBatch - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - AttestationBatch.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an AttestationBatch message. - * @function verify - * @memberof common.AttestationBatch - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - AttestationBatch.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.attestTxs != null && message.hasOwnProperty("attestTxs")) { - if (!Array.isArray(message.attestTxs)) - return "attestTxs: array expected"; - for (var i = 0; i < message.attestTxs.length; ++i) { - var error = $root.common.AttestTx.verify(message.attestTxs[i]); - if (error) - return "attestTxs." + error; - } - } - if (message.attestNetworkFees != null && message.hasOwnProperty("attestNetworkFees")) { - if (!Array.isArray(message.attestNetworkFees)) - return "attestNetworkFees: array expected"; - for (var i = 0; i < message.attestNetworkFees.length; ++i) { - var error = $root.common.AttestNetworkFee.verify(message.attestNetworkFees[i]); - if (error) - return "attestNetworkFees." + error; - } - } - if (message.attestSolvencies != null && message.hasOwnProperty("attestSolvencies")) { - if (!Array.isArray(message.attestSolvencies)) - return "attestSolvencies: array expected"; - for (var i = 0; i < message.attestSolvencies.length; ++i) { - var error = $root.common.AttestSolvency.verify(message.attestSolvencies[i]); - if (error) - return "attestSolvencies." + error; - } - } - if (message.attestErrataTxs != null && message.hasOwnProperty("attestErrataTxs")) { - if (!Array.isArray(message.attestErrataTxs)) - return "attestErrataTxs: array expected"; - for (var i = 0; i < message.attestErrataTxs.length; ++i) { - var error = $root.common.AttestErrataTx.verify(message.attestErrataTxs[i]); - if (error) - return "attestErrataTxs." + error; - } - } - if (message.attestPriceFeeds != null && message.hasOwnProperty("attestPriceFeeds")) { - if (!Array.isArray(message.attestPriceFeeds)) - return "attestPriceFeeds: array expected"; - for (var i = 0; i < message.attestPriceFeeds.length; ++i) { - var error = $root.common.AttestPriceFeed.verify(message.attestPriceFeeds[i]); - if (error) - return "attestPriceFeeds." + error; - } - } - return null; - }; - - /** - * Creates an AttestationBatch message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof common.AttestationBatch - * @static - * @param {Object.} object Plain object - * @returns {common.AttestationBatch} AttestationBatch - */ - AttestationBatch.fromObject = function fromObject(object) { - if (object instanceof $root.common.AttestationBatch) - return object; - var message = new $root.common.AttestationBatch(); - if (object.attestTxs) { - if (!Array.isArray(object.attestTxs)) - throw TypeError(".common.AttestationBatch.attestTxs: array expected"); - message.attestTxs = []; - for (var i = 0; i < object.attestTxs.length; ++i) { - if (typeof object.attestTxs[i] !== "object") - throw TypeError(".common.AttestationBatch.attestTxs: object expected"); - message.attestTxs[i] = $root.common.AttestTx.fromObject(object.attestTxs[i]); - } - } - if (object.attestNetworkFees) { - if (!Array.isArray(object.attestNetworkFees)) - throw TypeError(".common.AttestationBatch.attestNetworkFees: array expected"); - message.attestNetworkFees = []; - for (var i = 0; i < object.attestNetworkFees.length; ++i) { - if (typeof object.attestNetworkFees[i] !== "object") - throw TypeError(".common.AttestationBatch.attestNetworkFees: object expected"); - message.attestNetworkFees[i] = $root.common.AttestNetworkFee.fromObject(object.attestNetworkFees[i]); - } - } - if (object.attestSolvencies) { - if (!Array.isArray(object.attestSolvencies)) - throw TypeError(".common.AttestationBatch.attestSolvencies: array expected"); - message.attestSolvencies = []; - for (var i = 0; i < object.attestSolvencies.length; ++i) { - if (typeof object.attestSolvencies[i] !== "object") - throw TypeError(".common.AttestationBatch.attestSolvencies: object expected"); - message.attestSolvencies[i] = $root.common.AttestSolvency.fromObject(object.attestSolvencies[i]); - } - } - if (object.attestErrataTxs) { - if (!Array.isArray(object.attestErrataTxs)) - throw TypeError(".common.AttestationBatch.attestErrataTxs: array expected"); - message.attestErrataTxs = []; - for (var i = 0; i < object.attestErrataTxs.length; ++i) { - if (typeof object.attestErrataTxs[i] !== "object") - throw TypeError(".common.AttestationBatch.attestErrataTxs: object expected"); - message.attestErrataTxs[i] = $root.common.AttestErrataTx.fromObject(object.attestErrataTxs[i]); - } - } - if (object.attestPriceFeeds) { - if (!Array.isArray(object.attestPriceFeeds)) - throw TypeError(".common.AttestationBatch.attestPriceFeeds: array expected"); - message.attestPriceFeeds = []; - for (var i = 0; i < object.attestPriceFeeds.length; ++i) { - if (typeof object.attestPriceFeeds[i] !== "object") - throw TypeError(".common.AttestationBatch.attestPriceFeeds: object expected"); - message.attestPriceFeeds[i] = $root.common.AttestPriceFeed.fromObject(object.attestPriceFeeds[i]); - } - } - return message; - }; - - /** - * Creates a plain object from an AttestationBatch message. Also converts values to other types if specified. - * @function toObject - * @memberof common.AttestationBatch - * @static - * @param {common.AttestationBatch} message AttestationBatch - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - AttestationBatch.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.attestTxs = []; - object.attestNetworkFees = []; - object.attestSolvencies = []; - object.attestErrataTxs = []; - object.attestPriceFeeds = []; - } - if (message.attestTxs && message.attestTxs.length) { - object.attestTxs = []; - for (var j = 0; j < message.attestTxs.length; ++j) - object.attestTxs[j] = $root.common.AttestTx.toObject(message.attestTxs[j], options); - } - if (message.attestNetworkFees && message.attestNetworkFees.length) { - object.attestNetworkFees = []; - for (var j = 0; j < message.attestNetworkFees.length; ++j) - object.attestNetworkFees[j] = $root.common.AttestNetworkFee.toObject(message.attestNetworkFees[j], options); - } - if (message.attestSolvencies && message.attestSolvencies.length) { - object.attestSolvencies = []; - for (var j = 0; j < message.attestSolvencies.length; ++j) - object.attestSolvencies[j] = $root.common.AttestSolvency.toObject(message.attestSolvencies[j], options); - } - if (message.attestErrataTxs && message.attestErrataTxs.length) { - object.attestErrataTxs = []; - for (var j = 0; j < message.attestErrataTxs.length; ++j) - object.attestErrataTxs[j] = $root.common.AttestErrataTx.toObject(message.attestErrataTxs[j], options); - } - if (message.attestPriceFeeds && message.attestPriceFeeds.length) { - object.attestPriceFeeds = []; - for (var j = 0; j < message.attestPriceFeeds.length; ++j) - object.attestPriceFeeds[j] = $root.common.AttestPriceFeed.toObject(message.attestPriceFeeds[j], options); - } - return object; - }; - - /** - * Converts this AttestationBatch to JSON. - * @function toJSON - * @memberof common.AttestationBatch - * @instance - * @returns {Object.} JSON object - */ - AttestationBatch.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return AttestationBatch; - })(); - return common; })(); From a079d628e5306d62bf620811316cd8ebd89e0b0c Mon Sep 17 00:00:00 2001 From: Naq302 Date: Fri, 5 Sep 2025 12:27:06 +0930 Subject: [PATCH 3/7] resolve protobuf generation bloat with sparse mode filtering --- packages/xchain-mayachain/genMsgs.sh | 78 +- .../src/types/proto/MsgCompiled.d.ts | 2070 +++++++---------- .../src/types/proto/MsgCompiled.js | 606 ----- packages/xchain-thorchain/genMsgs.sh | 75 +- 4 files changed, 991 insertions(+), 1838 deletions(-) diff --git a/packages/xchain-mayachain/genMsgs.sh b/packages/xchain-mayachain/genMsgs.sh index 3c01fc086..26a2f3170 100755 --- a/packages/xchain-mayachain/genMsgs.sh +++ b/packages/xchain-mayachain/genMsgs.sh @@ -6,35 +6,36 @@ set -e # Exit on any error MSG_COMPILED_OUTPUTFILE=src/types/proto/MsgCompiled.js MSG_COMPILED_TYPES_OUTPUTFILE=src/types/proto/MsgCompiled.d.ts -# Using local minimal proto files - no need to clone mayanode repository +TMP_DIR=$(mktemp -d) -# Download cosmos/base/v1beta1/coin.proto from cosmossdk -COSMOS_COIN_PROTO="proto/cosmos/base/v1beta1/coin.proto" -if [ ! -f "$COSMOS_COIN_PROTO" ]; then - tput setaf 2 - echo "Downloading cosmos/base/v1beta1/coin.proto from cosmossdk" - tput sgr0 - mkdir -p "proto/cosmos/base/v1beta1" - if ! curl -f -o "$COSMOS_COIN_PROTO" \ - "https://raw.githubusercontent.com/cosmos/cosmos-sdk/main/proto/cosmos/base/v1beta1/coin.proto"; then - echo "Error: Failed to download cosmos coin.proto" - exit 1 +# Cleanup function +cleanup() { + if [ -d "$TMP_DIR" ]; then + tput setaf 2 + echo "Cleaning up $TMP_DIR" + tput sgr0 + rm -rf "$TMP_DIR" fi - echo "✓ Downloaded cosmos coin.proto" -else - echo "✓ cosmos coin.proto already exists" +} +trap cleanup EXIT + +tput setaf 2 +echo "Checking out https://gitlab.com/mayachain/mayanode to $TMP_DIR" +tput sgr0 +if ! (cd "$TMP_DIR" && git clone https://gitlab.com/mayachain/mayanode); then + echo "Error: Failed to clone mayanode repository" + exit 1 fi -# Verify our minimal proto files exist +# Verify proto files exist tput setaf 2 -echo "Checking minimal proto files" +echo "Checking proto files" tput sgr0 MISSING_FILES=0 for proto_file in \ - "proto/common/minimal_common.proto" \ - "proto/types/minimal_msg_deposit.proto" \ - "proto/types/minimal_msg_send.proto" \ - "$COSMOS_COIN_PROTO"; do + "$TMP_DIR/mayanode/proto/mayachain/v1/common/common.proto" \ + "$TMP_DIR/mayanode/proto/mayachain/v1/x/mayachain/types/msg_deposit.proto" \ + "$TMP_DIR/mayanode/proto/mayachain/v1/x/mayachain/types/msg_send.proto"; do if [ ! -f "$proto_file" ]; then echo "Error: $(basename "$proto_file") missing" MISSING_FILES=1 @@ -48,16 +49,33 @@ if [ $MISSING_FILES -eq 1 ]; then exit 1 fi -# Generate Protobuf JS bindings using minimal proto files to prevent over-inclusion +# Download cosmos/base/v1beta1/coin.proto from cosmossdk if not exists +COSMOS_COIN_PROTO="$TMP_DIR/mayanode/third_party/proto/cosmos/base/v1beta1/coin.proto" +if [ ! -f "$COSMOS_COIN_PROTO" ]; then + tput setaf 2 + echo "Downloading cosmos/base/v1beta1/coin.proto from cosmossdk" + tput sgr0 + mkdir -p "$TMP_DIR/mayanode/third_party/proto/cosmos/base/v1beta1" + if ! curl -f -o "$COSMOS_COIN_PROTO" \ + "https://raw.githubusercontent.com/cosmos/cosmos-sdk/main/proto/cosmos/base/v1beta1/coin.proto"; then + echo "Error: Failed to download cosmos coin.proto" + exit 1 + fi + echo "✓ Downloaded cosmos coin.proto" +else + echo "✓ cosmos coin.proto already exists" +fi + +# Generate Protobuf JS bindings using sparse mode to only include referenced types tput setaf 2 -echo "Generating $MSG_COMPILED_OUTPUTFILE" +echo "Generating $MSG_COMPILED_OUTPUTFILE (using sparse mode to avoid bloat)" tput sgr0 -if ! yarn pbjs -w commonjs -t static-module \ - -p proto \ - "proto/common/minimal_common.proto" \ - "proto/types/minimal_msg_deposit.proto" \ - "proto/types/minimal_msg_send.proto" \ - "$COSMOS_COIN_PROTO" \ +if ! yarn pbjs -w commonjs -t static-module --sparse \ + -p "$TMP_DIR/mayanode/proto" \ + -p "$TMP_DIR/mayanode/third_party/proto" \ + "$TMP_DIR/mayanode/proto/mayachain/v1/common/common.proto" \ + "$TMP_DIR/mayanode/proto/mayachain/v1/x/mayachain/types/msg_deposit.proto" \ + "$TMP_DIR/mayanode/proto/mayachain/v1/x/mayachain/types/msg_send.proto" \ -o "$MSG_COMPILED_OUTPUTFILE" 2>pbjs_errors.txt; then echo "Error: Failed to generate JavaScript bindings" cat pbjs_errors.txt @@ -71,7 +89,7 @@ sed -i -E 's|"(protobufjs/minimal)"|"\1.js"|' "$MSG_COMPILED_OUTPUTFILE" tput setaf 2 echo "Generating $MSG_COMPILED_TYPES_OUTPUTFILE" tput sgr0 -if ! yarn pbts "$MSG_COMPILED_OUTPUTFILE" -o "$MSG_COMPILED_TYPES_OUTPUTFILE" 2>pbts_errors.txt; then +if ! yarn pbts --name types "$MSG_COMPILED_OUTPUTFILE" -o "$MSG_COMPILED_TYPES_OUTPUTFILE" 2>pbts_errors.txt; then echo "Error: Failed to generate TypeScript definitions" cat pbts_errors.txt exit 1 diff --git a/packages/xchain-mayachain/src/types/proto/MsgCompiled.d.ts b/packages/xchain-mayachain/src/types/proto/MsgCompiled.d.ts index 06a5a401c..abb227bbe 100644 --- a/packages/xchain-mayachain/src/types/proto/MsgCompiled.d.ts +++ b/packages/xchain-mayachain/src/types/proto/MsgCompiled.d.ts @@ -1,1225 +1,949 @@ import * as $protobuf from "protobufjs"; -/** Namespace common. */ -export namespace common { +export = types; - /** Properties of an Asset. */ - interface IAsset { +declare namespace types { - /** Asset chain */ - chain?: (string|null); - /** Asset symbol */ - symbol?: (string|null); + /** Namespace common. */ + namespace common { - /** Asset ticker */ - ticker?: (string|null); + /** Properties of an Asset. */ + interface IAsset { - /** Asset synth */ - synth?: (boolean|null); + /** Asset chain */ + chain?: (string|null); - /** Asset trade */ - trade?: (boolean|null); + /** Asset symbol */ + symbol?: (string|null); - /** Asset secured */ - secured?: (boolean|null); - } - - /** Represents an Asset. */ - class Asset implements IAsset { - - /** - * Constructs a new Asset. - * @param [properties] Properties to set - */ - constructor(properties?: common.IAsset); - - /** Asset chain. */ - public chain: string; - - /** Asset symbol. */ - public symbol: string; - - /** Asset ticker. */ - public ticker: string; - - /** Asset synth. */ - public synth: boolean; - - /** Asset trade. */ - public trade: boolean; - - /** Asset secured. */ - public secured: boolean; - - /** - * Creates a new Asset instance using the specified properties. - * @param [properties] Properties to set - * @returns Asset instance - */ - public static create(properties?: common.IAsset): common.Asset; - - /** - * Encodes the specified Asset message. Does not implicitly {@link common.Asset.verify|verify} messages. - * @param message Asset message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: common.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Asset message, length delimited. Does not implicitly {@link common.Asset.verify|verify} messages. - * @param message Asset message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: common.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an Asset message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Asset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.Asset; - - /** - * Decodes an Asset message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Asset - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.Asset; - - /** - * Verifies an Asset message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an Asset message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Asset - */ - public static fromObject(object: { [k: string]: any }): common.Asset; - - /** - * Creates a plain object from an Asset message. Also converts values to other types if specified. - * @param message Asset - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: common.Asset, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Asset to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Coin. */ - interface ICoin { - - /** Coin asset */ - asset?: (common.IAsset|null); - - /** Coin amount */ - amount?: (string|null); - - /** Coin decimals */ - decimals?: (number|Long|null); - } - - /** Represents a Coin. */ - class Coin implements ICoin { - - /** - * Constructs a new Coin. - * @param [properties] Properties to set - */ - constructor(properties?: common.ICoin); - - /** Coin asset. */ - public asset?: (common.IAsset|null); - - /** Coin amount. */ - public amount: string; - - /** Coin decimals. */ - public decimals: (number|Long); - - /** - * Creates a new Coin instance using the specified properties. - * @param [properties] Properties to set - * @returns Coin instance - */ - public static create(properties?: common.ICoin): common.Coin; - - /** - * Encodes the specified Coin message. Does not implicitly {@link common.Coin.verify|verify} messages. - * @param message Coin message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: common.ICoin, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Coin message, length delimited. Does not implicitly {@link common.Coin.verify|verify} messages. - * @param message Coin message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: common.ICoin, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Coin message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Coin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.Coin; - - /** - * Decodes a Coin message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Coin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.Coin; - - /** - * Verifies a Coin message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Coin message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Coin - */ - public static fromObject(object: { [k: string]: any }): common.Coin; - - /** - * Creates a plain object from a Coin message. Also converts values to other types if specified. - * @param message Coin - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: common.Coin, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Coin to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a PubKeySet. */ - interface IPubKeySet { - - /** PubKeySet secp256k1 */ - secp256k1?: (string|null); - - /** PubKeySet ed25519 */ - ed25519?: (string|null); - } + /** Asset ticker */ + ticker?: (string|null); - /** Represents a PubKeySet. */ - class PubKeySet implements IPubKeySet { - - /** - * Constructs a new PubKeySet. - * @param [properties] Properties to set - */ - constructor(properties?: common.IPubKeySet); - - /** PubKeySet secp256k1. */ - public secp256k1: string; - - /** PubKeySet ed25519. */ - public ed25519: string; - - /** - * Creates a new PubKeySet instance using the specified properties. - * @param [properties] Properties to set - * @returns PubKeySet instance - */ - public static create(properties?: common.IPubKeySet): common.PubKeySet; - - /** - * Encodes the specified PubKeySet message. Does not implicitly {@link common.PubKeySet.verify|verify} messages. - * @param message PubKeySet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: common.IPubKeySet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PubKeySet message, length delimited. Does not implicitly {@link common.PubKeySet.verify|verify} messages. - * @param message PubKeySet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: common.IPubKeySet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PubKeySet message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PubKeySet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.PubKeySet; - - /** - * Decodes a PubKeySet message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PubKeySet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.PubKeySet; - - /** - * Verifies a PubKeySet message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PubKeySet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PubKeySet - */ - public static fromObject(object: { [k: string]: any }): common.PubKeySet; - - /** - * Creates a plain object from a PubKeySet message. Also converts values to other types if specified. - * @param message PubKeySet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: common.PubKeySet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PubKeySet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Asset synth */ + synth?: (boolean|null); - /** Properties of a Tx. */ - interface ITx { + /** Asset trade */ + trade?: (boolean|null); + } - /** Tx id */ - id?: (string|null); + /** Represents an Asset. */ + class Asset implements IAsset { + + /** + * Constructs a new Asset. + * @param [properties] Properties to set + */ + constructor(properties?: common.IAsset); + + /** Asset chain. */ + public chain: string; + + /** Asset symbol. */ + public symbol: string; + + /** Asset ticker. */ + public ticker: string; + + /** Asset synth. */ + public synth: boolean; + + /** Asset trade. */ + public trade: boolean; + + /** + * Creates a new Asset instance using the specified properties. + * @param [properties] Properties to set + * @returns Asset instance + */ + public static create(properties?: common.IAsset): common.Asset; + + /** + * Encodes the specified Asset message. Does not implicitly {@link common.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: common.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Asset message, length delimited. Does not implicitly {@link common.Asset.verify|verify} messages. + * @param message Asset message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: common.IAsset, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes an Asset message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.Asset; + + /** + * Decodes an Asset message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Asset + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.Asset; + + /** + * Verifies an Asset message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates an Asset message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Asset + */ + public static fromObject(object: { [k: string]: any }): common.Asset; + + /** + * Creates a plain object from an Asset message. Also converts values to other types if specified. + * @param message Asset + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: common.Asset, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Asset to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Tx chain */ - chain?: (string|null); + /** Properties of a Coin. */ + interface ICoin { - /** Tx fromAddress */ - fromAddress?: (string|null); + /** Coin asset */ + asset?: (common.IAsset|null); - /** Tx toAddress */ - toAddress?: (string|null); + /** Coin amount */ + amount?: (string|null); - /** Tx coins */ - coins?: (common.ICoin[]|null); + /** Coin decimals */ + decimals?: (number|Long|null); + } - /** Tx gas */ - gas?: (common.ICoin[]|null); + /** Represents a Coin. */ + class Coin implements ICoin { + + /** + * Constructs a new Coin. + * @param [properties] Properties to set + */ + constructor(properties?: common.ICoin); + + /** Coin asset. */ + public asset?: (common.IAsset|null); + + /** Coin amount. */ + public amount: string; + + /** Coin decimals. */ + public decimals: (number|Long); + + /** + * Creates a new Coin instance using the specified properties. + * @param [properties] Properties to set + * @returns Coin instance + */ + public static create(properties?: common.ICoin): common.Coin; + + /** + * Encodes the specified Coin message. Does not implicitly {@link common.Coin.verify|verify} messages. + * @param message Coin message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: common.ICoin, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Coin message, length delimited. Does not implicitly {@link common.Coin.verify|verify} messages. + * @param message Coin message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: common.ICoin, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Coin message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Coin + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.Coin; + + /** + * Decodes a Coin message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Coin + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.Coin; + + /** + * Verifies a Coin message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Coin message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Coin + */ + public static fromObject(object: { [k: string]: any }): common.Coin; + + /** + * Creates a plain object from a Coin message. Also converts values to other types if specified. + * @param message Coin + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: common.Coin, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Coin to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Tx memo */ - memo?: (string|null); - } + /** Properties of a PubKeySet. */ + interface IPubKeySet { - /** Represents a Tx. */ - class Tx implements ITx { - - /** - * Constructs a new Tx. - * @param [properties] Properties to set - */ - constructor(properties?: common.ITx); - - /** Tx id. */ - public id: string; - - /** Tx chain. */ - public chain: string; - - /** Tx fromAddress. */ - public fromAddress: string; - - /** Tx toAddress. */ - public toAddress: string; - - /** Tx coins. */ - public coins: common.ICoin[]; - - /** Tx gas. */ - public gas: common.ICoin[]; - - /** Tx memo. */ - public memo: string; - - /** - * Creates a new Tx instance using the specified properties. - * @param [properties] Properties to set - * @returns Tx instance - */ - public static create(properties?: common.ITx): common.Tx; - - /** - * Encodes the specified Tx message. Does not implicitly {@link common.Tx.verify|verify} messages. - * @param message Tx message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: common.ITx, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Tx message, length delimited. Does not implicitly {@link common.Tx.verify|verify} messages. - * @param message Tx message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: common.ITx, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Tx message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Tx - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.Tx; - - /** - * Decodes a Tx message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Tx - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.Tx; - - /** - * Verifies a Tx message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Tx message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Tx - */ - public static fromObject(object: { [k: string]: any }): common.Tx; - - /** - * Creates a plain object from a Tx message. Also converts values to other types if specified. - * @param message Tx - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: common.Tx, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Tx to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** PubKeySet secp256k1 */ + secp256k1?: (string|null); - /** Properties of a Fee. */ - interface IFee { + /** PubKeySet ed25519 */ + ed25519?: (string|null); + } - /** Fee coins */ - coins?: (common.ICoin[]|null); + /** Represents a PubKeySet. */ + class PubKeySet implements IPubKeySet { + + /** + * Constructs a new PubKeySet. + * @param [properties] Properties to set + */ + constructor(properties?: common.IPubKeySet); + + /** PubKeySet secp256k1. */ + public secp256k1: string; + + /** PubKeySet ed25519. */ + public ed25519: string; + + /** + * Creates a new PubKeySet instance using the specified properties. + * @param [properties] Properties to set + * @returns PubKeySet instance + */ + public static create(properties?: common.IPubKeySet): common.PubKeySet; + + /** + * Encodes the specified PubKeySet message. Does not implicitly {@link common.PubKeySet.verify|verify} messages. + * @param message PubKeySet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: common.IPubKeySet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified PubKeySet message, length delimited. Does not implicitly {@link common.PubKeySet.verify|verify} messages. + * @param message PubKeySet message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: common.IPubKeySet, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a PubKeySet message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns PubKeySet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.PubKeySet; + + /** + * Decodes a PubKeySet message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns PubKeySet + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.PubKeySet; + + /** + * Verifies a PubKeySet message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a PubKeySet message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns PubKeySet + */ + public static fromObject(object: { [k: string]: any }): common.PubKeySet; + + /** + * Creates a plain object from a PubKeySet message. Also converts values to other types if specified. + * @param message PubKeySet + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: common.PubKeySet, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this PubKeySet to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Fee poolDeduct */ - poolDeduct?: (string|null); - } + /** Properties of a Tx. */ + interface ITx { - /** Represents a Fee. */ - class Fee implements IFee { - - /** - * Constructs a new Fee. - * @param [properties] Properties to set - */ - constructor(properties?: common.IFee); - - /** Fee coins. */ - public coins: common.ICoin[]; - - /** Fee poolDeduct. */ - public poolDeduct: string; - - /** - * Creates a new Fee instance using the specified properties. - * @param [properties] Properties to set - * @returns Fee instance - */ - public static create(properties?: common.IFee): common.Fee; - - /** - * Encodes the specified Fee message. Does not implicitly {@link common.Fee.verify|verify} messages. - * @param message Fee message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: common.IFee, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Fee message, length delimited. Does not implicitly {@link common.Fee.verify|verify} messages. - * @param message Fee message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: common.IFee, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Fee message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Fee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.Fee; - - /** - * Decodes a Fee message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Fee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.Fee; - - /** - * Verifies a Fee message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Fee message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Fee - */ - public static fromObject(object: { [k: string]: any }): common.Fee; - - /** - * Creates a plain object from a Fee message. Also converts values to other types if specified. - * @param message Fee - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: common.Fee, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Fee to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Tx id */ + id?: (string|null); - /** Properties of a ProtoUint. */ - interface IProtoUint { + /** Tx chain */ + chain?: (string|null); - /** ProtoUint value */ - value?: (string|null); - } + /** Tx fromAddress */ + fromAddress?: (string|null); - /** Represents a ProtoUint. */ - class ProtoUint implements IProtoUint { - - /** - * Constructs a new ProtoUint. - * @param [properties] Properties to set - */ - constructor(properties?: common.IProtoUint); - - /** ProtoUint value. */ - public value: string; - - /** - * Creates a new ProtoUint instance using the specified properties. - * @param [properties] Properties to set - * @returns ProtoUint instance - */ - public static create(properties?: common.IProtoUint): common.ProtoUint; - - /** - * Encodes the specified ProtoUint message. Does not implicitly {@link common.ProtoUint.verify|verify} messages. - * @param message ProtoUint message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: common.IProtoUint, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ProtoUint message, length delimited. Does not implicitly {@link common.ProtoUint.verify|verify} messages. - * @param message ProtoUint message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: common.IProtoUint, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ProtoUint message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ProtoUint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.ProtoUint; - - /** - * Decodes a ProtoUint message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ProtoUint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.ProtoUint; - - /** - * Verifies a ProtoUint message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ProtoUint message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ProtoUint - */ - public static fromObject(object: { [k: string]: any }): common.ProtoUint; - - /** - * Creates a plain object from a ProtoUint message. Also converts values to other types if specified. - * @param message ProtoUint - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: common.ProtoUint, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ProtoUint to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } -} + /** Tx toAddress */ + toAddress?: (string|null); -/** Namespace types. */ -export namespace types { + /** Tx coins */ + coins?: (common.ICoin[]|null); - /** Properties of a MsgDeposit. */ - interface IMsgDeposit { + /** Tx gas */ + gas?: (common.ICoin[]|null); - /** MsgDeposit coins */ - coins?: (common.ICoin[]|null); + /** Tx memo */ + memo?: (string|null); + } - /** MsgDeposit memo */ - memo?: (string|null); + /** Represents a Tx. */ + class Tx implements ITx { + + /** + * Constructs a new Tx. + * @param [properties] Properties to set + */ + constructor(properties?: common.ITx); + + /** Tx id. */ + public id: string; + + /** Tx chain. */ + public chain: string; + + /** Tx fromAddress. */ + public fromAddress: string; + + /** Tx toAddress. */ + public toAddress: string; + + /** Tx coins. */ + public coins: common.ICoin[]; + + /** Tx gas. */ + public gas: common.ICoin[]; + + /** Tx memo. */ + public memo: string; + + /** + * Creates a new Tx instance using the specified properties. + * @param [properties] Properties to set + * @returns Tx instance + */ + public static create(properties?: common.ITx): common.Tx; + + /** + * Encodes the specified Tx message. Does not implicitly {@link common.Tx.verify|verify} messages. + * @param message Tx message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: common.ITx, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Tx message, length delimited. Does not implicitly {@link common.Tx.verify|verify} messages. + * @param message Tx message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: common.ITx, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Tx message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Tx + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.Tx; + + /** + * Decodes a Tx message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Tx + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.Tx; + + /** + * Verifies a Tx message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Tx message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Tx + */ + public static fromObject(object: { [k: string]: any }): common.Tx; + + /** + * Creates a plain object from a Tx message. Also converts values to other types if specified. + * @param message Tx + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: common.Tx, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Tx to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** MsgDeposit signer */ - signer?: (Uint8Array|null); - } + /** Properties of a Fee. */ + interface IFee { - /** Represents a MsgDeposit. */ - class MsgDeposit implements IMsgDeposit { - - /** - * Constructs a new MsgDeposit. - * @param [properties] Properties to set - */ - constructor(properties?: types.IMsgDeposit); - - /** MsgDeposit coins. */ - public coins: common.ICoin[]; - - /** MsgDeposit memo. */ - public memo: string; - - /** MsgDeposit signer. */ - public signer: Uint8Array; - - /** - * Creates a new MsgDeposit instance using the specified properties. - * @param [properties] Properties to set - * @returns MsgDeposit instance - */ - public static create(properties?: types.IMsgDeposit): types.MsgDeposit; - - /** - * Encodes the specified MsgDeposit message. Does not implicitly {@link types.MsgDeposit.verify|verify} messages. - * @param message MsgDeposit message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: types.IMsgDeposit, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgDeposit message, length delimited. Does not implicitly {@link types.MsgDeposit.verify|verify} messages. - * @param message MsgDeposit message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: types.IMsgDeposit, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgDeposit message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgDeposit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): types.MsgDeposit; - - /** - * Decodes a MsgDeposit message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgDeposit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): types.MsgDeposit; - - /** - * Verifies a MsgDeposit message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgDeposit message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgDeposit - */ - public static fromObject(object: { [k: string]: any }): types.MsgDeposit; - - /** - * Creates a plain object from a MsgDeposit message. Also converts values to other types if specified. - * @param message MsgDeposit - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: types.MsgDeposit, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgDeposit to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Fee coins */ + coins?: (common.ICoin[]|null); - /** Properties of a MsgSend. */ - interface IMsgSend { + /** Fee poolDeduct */ + poolDeduct?: (string|null); + } - /** MsgSend fromAddress */ - fromAddress?: (Uint8Array|null); + /** Represents a Fee. */ + class Fee implements IFee { + + /** + * Constructs a new Fee. + * @param [properties] Properties to set + */ + constructor(properties?: common.IFee); + + /** Fee coins. */ + public coins: common.ICoin[]; + + /** Fee poolDeduct. */ + public poolDeduct: string; + + /** + * Creates a new Fee instance using the specified properties. + * @param [properties] Properties to set + * @returns Fee instance + */ + public static create(properties?: common.IFee): common.Fee; + + /** + * Encodes the specified Fee message. Does not implicitly {@link common.Fee.verify|verify} messages. + * @param message Fee message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: common.IFee, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Fee message, length delimited. Does not implicitly {@link common.Fee.verify|verify} messages. + * @param message Fee message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: common.IFee, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Fee message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Fee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.Fee; + + /** + * Decodes a Fee message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Fee + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.Fee; + + /** + * Verifies a Fee message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Fee message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Fee + */ + public static fromObject(object: { [k: string]: any }): common.Fee; + + /** + * Creates a plain object from a Fee message. Also converts values to other types if specified. + * @param message Fee + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: common.Fee, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Fee to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** MsgSend toAddress */ - toAddress?: (Uint8Array|null); + /** Properties of a ProtoUint. */ + interface IProtoUint { - /** MsgSend amount */ - amount?: (cosmos.base.v1beta1.ICoin[]|null); - } + /** ProtoUint value */ + value?: (string|null); + } - /** Represents a MsgSend. */ - class MsgSend implements IMsgSend { - - /** - * Constructs a new MsgSend. - * @param [properties] Properties to set - */ - constructor(properties?: types.IMsgSend); - - /** MsgSend fromAddress. */ - public fromAddress: Uint8Array; - - /** MsgSend toAddress. */ - public toAddress: Uint8Array; - - /** MsgSend amount. */ - public amount: cosmos.base.v1beta1.ICoin[]; - - /** - * Creates a new MsgSend instance using the specified properties. - * @param [properties] Properties to set - * @returns MsgSend instance - */ - public static create(properties?: types.IMsgSend): types.MsgSend; - - /** - * Encodes the specified MsgSend message. Does not implicitly {@link types.MsgSend.verify|verify} messages. - * @param message MsgSend message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: types.IMsgSend, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified MsgSend message, length delimited. Does not implicitly {@link types.MsgSend.verify|verify} messages. - * @param message MsgSend message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: types.IMsgSend, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a MsgSend message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns MsgSend - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): types.MsgSend; - - /** - * Decodes a MsgSend message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns MsgSend - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): types.MsgSend; - - /** - * Verifies a MsgSend message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a MsgSend message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns MsgSend - */ - public static fromObject(object: { [k: string]: any }): types.MsgSend; - - /** - * Creates a plain object from a MsgSend message. Also converts values to other types if specified. - * @param message MsgSend - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: types.MsgSend, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this MsgSend to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** Represents a ProtoUint. */ + class ProtoUint implements IProtoUint { + + /** + * Constructs a new ProtoUint. + * @param [properties] Properties to set + */ + constructor(properties?: common.IProtoUint); + + /** ProtoUint value. */ + public value: string; + + /** + * Creates a new ProtoUint instance using the specified properties. + * @param [properties] Properties to set + * @returns ProtoUint instance + */ + public static create(properties?: common.IProtoUint): common.ProtoUint; + + /** + * Encodes the specified ProtoUint message. Does not implicitly {@link common.ProtoUint.verify|verify} messages. + * @param message ProtoUint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: common.IProtoUint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified ProtoUint message, length delimited. Does not implicitly {@link common.ProtoUint.verify|verify} messages. + * @param message ProtoUint message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: common.IProtoUint, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a ProtoUint message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns ProtoUint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.ProtoUint; + + /** + * Decodes a ProtoUint message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns ProtoUint + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.ProtoUint; + + /** + * Verifies a ProtoUint message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a ProtoUint message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns ProtoUint + */ + public static fromObject(object: { [k: string]: any }): common.ProtoUint; + + /** + * Creates a plain object from a ProtoUint message. Also converts values to other types if specified. + * @param message ProtoUint + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: common.ProtoUint, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this ProtoUint to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } } -} - -/** Namespace cosmos. */ -export namespace cosmos { - /** Namespace base. */ - namespace base { + /** Namespace types. */ + namespace types { - /** Namespace v1beta1. */ - namespace v1beta1 { + /** Properties of a MsgDeposit. */ + interface IMsgDeposit { - /** Properties of a Coin. */ - interface ICoin { + /** MsgDeposit coins */ + coins?: (common.ICoin[]|null); - /** Coin denom */ - denom?: (string|null); + /** MsgDeposit memo */ + memo?: (string|null); - /** Coin amount */ - amount?: (string|null); - } - - /** Represents a Coin. */ - class Coin implements ICoin { - - /** - * Constructs a new Coin. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.base.v1beta1.ICoin); - - /** Coin denom. */ - public denom: string; - - /** Coin amount. */ - public amount: string; - - /** - * Creates a new Coin instance using the specified properties. - * @param [properties] Properties to set - * @returns Coin instance - */ - public static create(properties?: cosmos.base.v1beta1.ICoin): cosmos.base.v1beta1.Coin; - - /** - * Encodes the specified Coin message. Does not implicitly {@link cosmos.base.v1beta1.Coin.verify|verify} messages. - * @param message Coin message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.base.v1beta1.ICoin, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Coin message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.Coin.verify|verify} messages. - * @param message Coin message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.base.v1beta1.ICoin, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Coin message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Coin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.base.v1beta1.Coin; - - /** - * Decodes a Coin message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Coin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.base.v1beta1.Coin; - - /** - * Verifies a Coin message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Coin message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Coin - */ - public static fromObject(object: { [k: string]: any }): cosmos.base.v1beta1.Coin; - - /** - * Creates a plain object from a Coin message. Also converts values to other types if specified. - * @param message Coin - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.base.v1beta1.Coin, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Coin to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a DecCoin. */ - interface IDecCoin { - - /** DecCoin denom */ - denom?: (string|null); + /** MsgDeposit signer */ + signer?: (Uint8Array|null); + } - /** DecCoin amount */ - amount?: (string|null); - } + /** Represents a MsgDeposit. */ + class MsgDeposit implements IMsgDeposit { + + /** + * Constructs a new MsgDeposit. + * @param [properties] Properties to set + */ + constructor(properties?: types.IMsgDeposit); + + /** MsgDeposit coins. */ + public coins: common.ICoin[]; + + /** MsgDeposit memo. */ + public memo: string; + + /** MsgDeposit signer. */ + public signer: Uint8Array; + + /** + * Creates a new MsgDeposit instance using the specified properties. + * @param [properties] Properties to set + * @returns MsgDeposit instance + */ + public static create(properties?: types.IMsgDeposit): types.MsgDeposit; + + /** + * Encodes the specified MsgDeposit message. Does not implicitly {@link types.MsgDeposit.verify|verify} messages. + * @param message MsgDeposit message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: types.IMsgDeposit, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MsgDeposit message, length delimited. Does not implicitly {@link types.MsgDeposit.verify|verify} messages. + * @param message MsgDeposit message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: types.IMsgDeposit, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MsgDeposit message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MsgDeposit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): types.MsgDeposit; + + /** + * Decodes a MsgDeposit message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MsgDeposit + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): types.MsgDeposit; + + /** + * Verifies a MsgDeposit message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MsgDeposit message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MsgDeposit + */ + public static fromObject(object: { [k: string]: any }): types.MsgDeposit; + + /** + * Creates a plain object from a MsgDeposit message. Also converts values to other types if specified. + * @param message MsgDeposit + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: types.MsgDeposit, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MsgDeposit to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } - /** Represents a DecCoin. */ - class DecCoin implements IDecCoin { - - /** - * Constructs a new DecCoin. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.base.v1beta1.IDecCoin); - - /** DecCoin denom. */ - public denom: string; - - /** DecCoin amount. */ - public amount: string; - - /** - * Creates a new DecCoin instance using the specified properties. - * @param [properties] Properties to set - * @returns DecCoin instance - */ - public static create(properties?: cosmos.base.v1beta1.IDecCoin): cosmos.base.v1beta1.DecCoin; - - /** - * Encodes the specified DecCoin message. Does not implicitly {@link cosmos.base.v1beta1.DecCoin.verify|verify} messages. - * @param message DecCoin message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.base.v1beta1.IDecCoin, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DecCoin message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.DecCoin.verify|verify} messages. - * @param message DecCoin message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.base.v1beta1.IDecCoin, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DecCoin message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DecCoin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.base.v1beta1.DecCoin; - - /** - * Decodes a DecCoin message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DecCoin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.base.v1beta1.DecCoin; - - /** - * Verifies a DecCoin message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DecCoin message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DecCoin - */ - public static fromObject(object: { [k: string]: any }): cosmos.base.v1beta1.DecCoin; - - /** - * Creates a plain object from a DecCoin message. Also converts values to other types if specified. - * @param message DecCoin - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.base.v1beta1.DecCoin, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DecCoin to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } + /** Properties of a MsgSend. */ + interface IMsgSend { - /** Properties of an IntProto. */ - interface IIntProto { + /** MsgSend fromAddress */ + fromAddress?: (Uint8Array|null); - /** IntProto int */ - int?: (string|null); - } + /** MsgSend toAddress */ + toAddress?: (Uint8Array|null); - /** Represents an IntProto. */ - class IntProto implements IIntProto { - - /** - * Constructs a new IntProto. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.base.v1beta1.IIntProto); - - /** IntProto int. */ - public int: string; - - /** - * Creates a new IntProto instance using the specified properties. - * @param [properties] Properties to set - * @returns IntProto instance - */ - public static create(properties?: cosmos.base.v1beta1.IIntProto): cosmos.base.v1beta1.IntProto; - - /** - * Encodes the specified IntProto message. Does not implicitly {@link cosmos.base.v1beta1.IntProto.verify|verify} messages. - * @param message IntProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.base.v1beta1.IIntProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified IntProto message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.IntProto.verify|verify} messages. - * @param message IntProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.base.v1beta1.IIntProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an IntProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns IntProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.base.v1beta1.IntProto; - - /** - * Decodes an IntProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns IntProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.base.v1beta1.IntProto; - - /** - * Verifies an IntProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an IntProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IntProto - */ - public static fromObject(object: { [k: string]: any }): cosmos.base.v1beta1.IntProto; - - /** - * Creates a plain object from an IntProto message. Also converts values to other types if specified. - * @param message IntProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.base.v1beta1.IntProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this IntProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a DecProto. */ - interface IDecProto { + /** MsgSend amount */ + amount?: (cosmos.base.v1beta1.ICoin[]|null); + } - /** DecProto dec */ - dec?: (string|null); - } + /** Represents a MsgSend. */ + class MsgSend implements IMsgSend { + + /** + * Constructs a new MsgSend. + * @param [properties] Properties to set + */ + constructor(properties?: types.IMsgSend); + + /** MsgSend fromAddress. */ + public fromAddress: Uint8Array; + + /** MsgSend toAddress. */ + public toAddress: Uint8Array; + + /** MsgSend amount. */ + public amount: cosmos.base.v1beta1.ICoin[]; + + /** + * Creates a new MsgSend instance using the specified properties. + * @param [properties] Properties to set + * @returns MsgSend instance + */ + public static create(properties?: types.IMsgSend): types.MsgSend; + + /** + * Encodes the specified MsgSend message. Does not implicitly {@link types.MsgSend.verify|verify} messages. + * @param message MsgSend message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: types.IMsgSend, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified MsgSend message, length delimited. Does not implicitly {@link types.MsgSend.verify|verify} messages. + * @param message MsgSend message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: types.IMsgSend, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a MsgSend message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns MsgSend + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): types.MsgSend; + + /** + * Decodes a MsgSend message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns MsgSend + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): types.MsgSend; + + /** + * Verifies a MsgSend message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a MsgSend message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns MsgSend + */ + public static fromObject(object: { [k: string]: any }): types.MsgSend; + + /** + * Creates a plain object from a MsgSend message. Also converts values to other types if specified. + * @param message MsgSend + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: types.MsgSend, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this MsgSend to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } + } - /** Represents a DecProto. */ - class DecProto implements IDecProto { - - /** - * Constructs a new DecProto. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.base.v1beta1.IDecProto); - - /** DecProto dec. */ - public dec: string; - - /** - * Creates a new DecProto instance using the specified properties. - * @param [properties] Properties to set - * @returns DecProto instance - */ - public static create(properties?: cosmos.base.v1beta1.IDecProto): cosmos.base.v1beta1.DecProto; - - /** - * Encodes the specified DecProto message. Does not implicitly {@link cosmos.base.v1beta1.DecProto.verify|verify} messages. - * @param message DecProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.base.v1beta1.IDecProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DecProto message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.DecProto.verify|verify} messages. - * @param message DecProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.base.v1beta1.IDecProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DecProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DecProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.base.v1beta1.DecProto; - - /** - * Decodes a DecProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DecProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.base.v1beta1.DecProto; - - /** - * Verifies a DecProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DecProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DecProto - */ - public static fromObject(object: { [k: string]: any }): cosmos.base.v1beta1.DecProto; - - /** - * Creates a plain object from a DecProto message. Also converts values to other types if specified. - * @param message DecProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.base.v1beta1.DecProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DecProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; + /** Namespace cosmos. */ + namespace cosmos { + + /** Namespace base. */ + namespace base { + + /** Namespace v1beta1. */ + namespace v1beta1 { + + /** Properties of a Coin. */ + interface ICoin { + + /** Coin denom */ + denom?: (string|null); + + /** Coin amount */ + amount?: (string|null); + } + + /** Represents a Coin. */ + class Coin implements ICoin { + + /** + * Constructs a new Coin. + * @param [properties] Properties to set + */ + constructor(properties?: cosmos.base.v1beta1.ICoin); + + /** Coin denom. */ + public denom: string; + + /** Coin amount. */ + public amount: string; + + /** + * Creates a new Coin instance using the specified properties. + * @param [properties] Properties to set + * @returns Coin instance + */ + public static create(properties?: cosmos.base.v1beta1.ICoin): cosmos.base.v1beta1.Coin; + + /** + * Encodes the specified Coin message. Does not implicitly {@link cosmos.base.v1beta1.Coin.verify|verify} messages. + * @param message Coin message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encode(message: cosmos.base.v1beta1.ICoin, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Encodes the specified Coin message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.Coin.verify|verify} messages. + * @param message Coin message or plain object to encode + * @param [writer] Writer to encode to + * @returns Writer + */ + public static encodeDelimited(message: cosmos.base.v1beta1.ICoin, writer?: $protobuf.Writer): $protobuf.Writer; + + /** + * Decodes a Coin message from the specified reader or buffer. + * @param reader Reader or buffer to decode from + * @param [length] Message length if known beforehand + * @returns Coin + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.base.v1beta1.Coin; + + /** + * Decodes a Coin message from the specified reader or buffer, length delimited. + * @param reader Reader or buffer to decode from + * @returns Coin + * @throws {Error} If the payload is not a reader or valid buffer + * @throws {$protobuf.util.ProtocolError} If required fields are missing + */ + public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.base.v1beta1.Coin; + + /** + * Verifies a Coin message. + * @param message Plain object to verify + * @returns `null` if valid, otherwise the reason why it is not + */ + public static verify(message: { [k: string]: any }): (string|null); + + /** + * Creates a Coin message from a plain object. Also converts values to their respective internal types. + * @param object Plain object + * @returns Coin + */ + public static fromObject(object: { [k: string]: any }): cosmos.base.v1beta1.Coin; + + /** + * Creates a plain object from a Coin message. Also converts values to other types if specified. + * @param message Coin + * @param [options] Conversion options + * @returns Plain object + */ + public static toObject(message: cosmos.base.v1beta1.Coin, options?: $protobuf.IConversionOptions): { [k: string]: any }; + + /** + * Converts this Coin to JSON. + * @returns JSON object + */ + public toJSON(): { [k: string]: any }; + } } } } diff --git a/packages/xchain-mayachain/src/types/proto/MsgCompiled.js b/packages/xchain-mayachain/src/types/proto/MsgCompiled.js index 403f2edd3..93f8c418a 100644 --- a/packages/xchain-mayachain/src/types/proto/MsgCompiled.js +++ b/packages/xchain-mayachain/src/types/proto/MsgCompiled.js @@ -29,7 +29,6 @@ $root.common = (function() { * @property {string|null} [ticker] Asset ticker * @property {boolean|null} [synth] Asset synth * @property {boolean|null} [trade] Asset trade - * @property {boolean|null} [secured] Asset secured */ /** @@ -87,14 +86,6 @@ $root.common = (function() { */ Asset.prototype.trade = false; - /** - * Asset secured. - * @member {boolean} secured - * @memberof common.Asset - * @instance - */ - Asset.prototype.secured = false; - /** * Creates a new Asset instance using the specified properties. * @function create @@ -129,8 +120,6 @@ $root.common = (function() { writer.uint32(/* id 4, wireType 0 =*/32).bool(message.synth); if (message.trade != null && Object.hasOwnProperty.call(message, "trade")) writer.uint32(/* id 5, wireType 0 =*/40).bool(message.trade); - if (message.secured != null && Object.hasOwnProperty.call(message, "secured")) - writer.uint32(/* id 6, wireType 0 =*/48).bool(message.secured); return writer; }; @@ -180,9 +169,6 @@ $root.common = (function() { case 5: message.trade = reader.bool(); break; - case 6: - message.secured = reader.bool(); - break; default: reader.skipType(tag & 7); break; @@ -233,9 +219,6 @@ $root.common = (function() { if (message.trade != null && message.hasOwnProperty("trade")) if (typeof message.trade !== "boolean") return "trade: boolean expected"; - if (message.secured != null && message.hasOwnProperty("secured")) - if (typeof message.secured !== "boolean") - return "secured: boolean expected"; return null; }; @@ -261,8 +244,6 @@ $root.common = (function() { message.synth = Boolean(object.synth); if (object.trade != null) message.trade = Boolean(object.trade); - if (object.secured != null) - message.secured = Boolean(object.secured); return message; }; @@ -285,7 +266,6 @@ $root.common = (function() { object.ticker = ""; object.synth = false; object.trade = false; - object.secured = false; } if (message.chain != null && message.hasOwnProperty("chain")) object.chain = message.chain; @@ -297,8 +277,6 @@ $root.common = (function() { object.synth = message.synth; if (message.trade != null && message.hasOwnProperty("trade")) object.trade = message.trade; - if (message.secured != null && message.hasOwnProperty("secured")) - object.secured = message.secured; return object; }; @@ -2346,590 +2324,6 @@ $root.cosmos = (function() { return Coin; })(); - v1beta1.DecCoin = (function() { - - /** - * Properties of a DecCoin. - * @memberof cosmos.base.v1beta1 - * @interface IDecCoin - * @property {string|null} [denom] DecCoin denom - * @property {string|null} [amount] DecCoin amount - */ - - /** - * Constructs a new DecCoin. - * @memberof cosmos.base.v1beta1 - * @classdesc Represents a DecCoin. - * @implements IDecCoin - * @constructor - * @param {cosmos.base.v1beta1.IDecCoin=} [properties] Properties to set - */ - function DecCoin(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]]; - } - - /** - * DecCoin denom. - * @member {string} denom - * @memberof cosmos.base.v1beta1.DecCoin - * @instance - */ - DecCoin.prototype.denom = ""; - - /** - * DecCoin amount. - * @member {string} amount - * @memberof cosmos.base.v1beta1.DecCoin - * @instance - */ - DecCoin.prototype.amount = ""; - - /** - * Creates a new DecCoin instance using the specified properties. - * @function create - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {cosmos.base.v1beta1.IDecCoin=} [properties] Properties to set - * @returns {cosmos.base.v1beta1.DecCoin} DecCoin instance - */ - DecCoin.create = function create(properties) { - return new DecCoin(properties); - }; - - /** - * Encodes the specified DecCoin message. Does not implicitly {@link cosmos.base.v1beta1.DecCoin.verify|verify} messages. - * @function encode - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {cosmos.base.v1beta1.IDecCoin} message DecCoin message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DecCoin.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.denom != null && Object.hasOwnProperty.call(message, "denom")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.denom); - if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.amount); - return writer; - }; - - /** - * Encodes the specified DecCoin message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.DecCoin.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {cosmos.base.v1beta1.IDecCoin} message DecCoin message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DecCoin.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DecCoin message from the specified reader or buffer. - * @function decode - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.base.v1beta1.DecCoin} DecCoin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DecCoin.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.cosmos.base.v1beta1.DecCoin(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.denom = reader.string(); - break; - case 2: - message.amount = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DecCoin message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.base.v1beta1.DecCoin} DecCoin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DecCoin.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DecCoin message. - * @function verify - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DecCoin.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.denom != null && message.hasOwnProperty("denom")) - if (!$util.isString(message.denom)) - return "denom: string expected"; - if (message.amount != null && message.hasOwnProperty("amount")) - if (!$util.isString(message.amount)) - return "amount: string expected"; - return null; - }; - - /** - * Creates a DecCoin message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {Object.} object Plain object - * @returns {cosmos.base.v1beta1.DecCoin} DecCoin - */ - DecCoin.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.base.v1beta1.DecCoin) - return object; - var message = new $root.cosmos.base.v1beta1.DecCoin(); - if (object.denom != null) - message.denom = String(object.denom); - if (object.amount != null) - message.amount = String(object.amount); - return message; - }; - - /** - * Creates a plain object from a DecCoin message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {cosmos.base.v1beta1.DecCoin} message DecCoin - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DecCoin.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.denom = ""; - object.amount = ""; - } - if (message.denom != null && message.hasOwnProperty("denom")) - object.denom = message.denom; - if (message.amount != null && message.hasOwnProperty("amount")) - object.amount = message.amount; - return object; - }; - - /** - * Converts this DecCoin to JSON. - * @function toJSON - * @memberof cosmos.base.v1beta1.DecCoin - * @instance - * @returns {Object.} JSON object - */ - DecCoin.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return DecCoin; - })(); - - v1beta1.IntProto = (function() { - - /** - * Properties of an IntProto. - * @memberof cosmos.base.v1beta1 - * @interface IIntProto - * @property {string|null} [int] IntProto int - */ - - /** - * Constructs a new IntProto. - * @memberof cosmos.base.v1beta1 - * @classdesc Represents an IntProto. - * @implements IIntProto - * @constructor - * @param {cosmos.base.v1beta1.IIntProto=} [properties] Properties to set - */ - function IntProto(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]]; - } - - /** - * IntProto int. - * @member {string} int - * @memberof cosmos.base.v1beta1.IntProto - * @instance - */ - IntProto.prototype.int = ""; - - /** - * Creates a new IntProto instance using the specified properties. - * @function create - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {cosmos.base.v1beta1.IIntProto=} [properties] Properties to set - * @returns {cosmos.base.v1beta1.IntProto} IntProto instance - */ - IntProto.create = function create(properties) { - return new IntProto(properties); - }; - - /** - * Encodes the specified IntProto message. Does not implicitly {@link cosmos.base.v1beta1.IntProto.verify|verify} messages. - * @function encode - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {cosmos.base.v1beta1.IIntProto} message IntProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IntProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.int != null && Object.hasOwnProperty.call(message, "int")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.int); - return writer; - }; - - /** - * Encodes the specified IntProto message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.IntProto.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {cosmos.base.v1beta1.IIntProto} message IntProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IntProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes an IntProto message from the specified reader or buffer. - * @function decode - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.base.v1beta1.IntProto} IntProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IntProto.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.cosmos.base.v1beta1.IntProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.int = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes an IntProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.base.v1beta1.IntProto} IntProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IntProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies an IntProto message. - * @function verify - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IntProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.int != null && message.hasOwnProperty("int")) - if (!$util.isString(message.int)) - return "int: string expected"; - return null; - }; - - /** - * Creates an IntProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {Object.} object Plain object - * @returns {cosmos.base.v1beta1.IntProto} IntProto - */ - IntProto.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.base.v1beta1.IntProto) - return object; - var message = new $root.cosmos.base.v1beta1.IntProto(); - if (object.int != null) - message.int = String(object.int); - return message; - }; - - /** - * Creates a plain object from an IntProto message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {cosmos.base.v1beta1.IntProto} message IntProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IntProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.int = ""; - if (message.int != null && message.hasOwnProperty("int")) - object.int = message.int; - return object; - }; - - /** - * Converts this IntProto to JSON. - * @function toJSON - * @memberof cosmos.base.v1beta1.IntProto - * @instance - * @returns {Object.} JSON object - */ - IntProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return IntProto; - })(); - - v1beta1.DecProto = (function() { - - /** - * Properties of a DecProto. - * @memberof cosmos.base.v1beta1 - * @interface IDecProto - * @property {string|null} [dec] DecProto dec - */ - - /** - * Constructs a new DecProto. - * @memberof cosmos.base.v1beta1 - * @classdesc Represents a DecProto. - * @implements IDecProto - * @constructor - * @param {cosmos.base.v1beta1.IDecProto=} [properties] Properties to set - */ - function DecProto(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]]; - } - - /** - * DecProto dec. - * @member {string} dec - * @memberof cosmos.base.v1beta1.DecProto - * @instance - */ - DecProto.prototype.dec = ""; - - /** - * Creates a new DecProto instance using the specified properties. - * @function create - * @memberof cosmos.base.v1beta1.DecProto - * @static - * @param {cosmos.base.v1beta1.IDecProto=} [properties] Properties to set - * @returns {cosmos.base.v1beta1.DecProto} DecProto instance - */ - DecProto.create = function create(properties) { - return new DecProto(properties); - }; - - /** - * Encodes the specified DecProto message. Does not implicitly {@link cosmos.base.v1beta1.DecProto.verify|verify} messages. - * @function encode - * @memberof cosmos.base.v1beta1.DecProto - * @static - * @param {cosmos.base.v1beta1.IDecProto} message DecProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DecProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.dec != null && Object.hasOwnProperty.call(message, "dec")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.dec); - return writer; - }; - - /** - * Encodes the specified DecProto message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.DecProto.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.base.v1beta1.DecProto - * @static - * @param {cosmos.base.v1beta1.IDecProto} message DecProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DecProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DecProto message from the specified reader or buffer. - * @function decode - * @memberof cosmos.base.v1beta1.DecProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.base.v1beta1.DecProto} DecProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DecProto.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.cosmos.base.v1beta1.DecProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.dec = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DecProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.base.v1beta1.DecProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.base.v1beta1.DecProto} DecProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DecProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DecProto message. - * @function verify - * @memberof cosmos.base.v1beta1.DecProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DecProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.dec != null && message.hasOwnProperty("dec")) - if (!$util.isString(message.dec)) - return "dec: string expected"; - return null; - }; - - /** - * Creates a DecProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.base.v1beta1.DecProto - * @static - * @param {Object.} object Plain object - * @returns {cosmos.base.v1beta1.DecProto} DecProto - */ - DecProto.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.base.v1beta1.DecProto) - return object; - var message = new $root.cosmos.base.v1beta1.DecProto(); - if (object.dec != null) - message.dec = String(object.dec); - return message; - }; - - /** - * Creates a plain object from a DecProto message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.base.v1beta1.DecProto - * @static - * @param {cosmos.base.v1beta1.DecProto} message DecProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DecProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.dec = ""; - if (message.dec != null && message.hasOwnProperty("dec")) - object.dec = message.dec; - return object; - }; - - /** - * Converts this DecProto to JSON. - * @function toJSON - * @memberof cosmos.base.v1beta1.DecProto - * @instance - * @returns {Object.} JSON object - */ - DecProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return DecProto; - })(); - return v1beta1; })(); diff --git a/packages/xchain-thorchain/genMsgs.sh b/packages/xchain-thorchain/genMsgs.sh index ab47bc329..91dcbc4f0 100755 --- a/packages/xchain-thorchain/genMsgs.sh +++ b/packages/xchain-thorchain/genMsgs.sh @@ -6,35 +6,36 @@ set -e # Exit on any error MSG_COMPILED_OUTPUTFILE=src/types/proto/MsgCompiled.js MSG_COMPILED_TYPES_OUTPUTFILE=src/types/proto/MsgCompiled.d.ts -# Using local minimal proto files - no need to clone thornode repository +TMP_DIR=$(mktemp -d) -# Download cosmos/base/v1beta1/coin.proto from cosmossdk -COSMOS_COIN_PROTO="proto/cosmos/base/v1beta1/coin.proto" -if [ ! -f "$COSMOS_COIN_PROTO" ]; then - tput setaf 2 - echo "Downloading cosmos/base/v1beta1/coin.proto from cosmossdk" - tput sgr0 - mkdir -p "proto/cosmos/base/v1beta1" - if ! curl -f -o "$COSMOS_COIN_PROTO" \ - "https://raw.githubusercontent.com/cosmos/cosmos-sdk/main/proto/cosmos/base/v1beta1/coin.proto"; then - echo "Error: Failed to download cosmos coin.proto" - exit 1 +# Cleanup function +cleanup() { + if [ -d "$TMP_DIR" ]; then + tput setaf 2 + echo "Cleaning up $TMP_DIR" + tput sgr0 + rm -rf "$TMP_DIR" fi - echo "✓ Downloaded cosmos coin.proto" -else - echo "✓ cosmos coin.proto already exists" +} +trap cleanup EXIT + +tput setaf 2 +echo "Checking out https://gitlab.com/thorchain/thornode to $TMP_DIR" +tput sgr0 +if ! (cd "$TMP_DIR" && git clone --branch develop https://gitlab.com/thorchain/thornode); then + echo "Error: Failed to clone thornode repository" + exit 1 fi -# Verify our minimal proto files exist +# Verify proto files exist tput setaf 2 -echo "Checking minimal proto files" +echo "Checking proto files" tput sgr0 MISSING_FILES=0 for proto_file in \ - "proto/common/minimal_common.proto" \ - "proto/types/minimal_msg_deposit.proto" \ - "proto/types/minimal_msg_send.proto" \ - "$COSMOS_COIN_PROTO"; do + "$TMP_DIR/thornode/proto/thorchain/v1/common/common.proto" \ + "$TMP_DIR/thornode/proto/thorchain/v1/types/msg_deposit.proto" \ + "$TMP_DIR/thornode/proto/thorchain/v1/types/msg_send.proto"; do if [ ! -f "$proto_file" ]; then echo "Error: $(basename "$proto_file") missing" MISSING_FILES=1 @@ -48,16 +49,32 @@ if [ $MISSING_FILES -eq 1 ]; then exit 1 fi -# Generate Protobuf JS bindings using minimal proto files to prevent over-inclusion +# Download cosmos/base/v1beta1/coin.proto from cosmossdk if not exists +COSMOS_COIN_PROTO="$TMP_DIR/thornode/third_party/proto/cosmos/base/v1beta1/coin.proto" +if [ ! -f "$COSMOS_COIN_PROTO" ]; then + tput setaf 2 + echo "Downloading cosmos/base/v1beta1/coin.proto from cosmossdk" + tput sgr0 + mkdir -p "$TMP_DIR/thornode/third_party/proto/cosmos/base/v1beta1" + if ! curl -f -o "$COSMOS_COIN_PROTO" \ + "https://raw.githubusercontent.com/cosmos/cosmos-sdk/main/proto/cosmos/base/v1beta1/coin.proto"; then + echo "Error: Failed to download cosmos coin.proto" + exit 1 + fi + echo "✓ Downloaded cosmos coin.proto" +else + echo "✓ cosmos coin.proto already exists" +fi + +# Generate Protobuf JS bindings using sparse mode to only include referenced types tput setaf 2 -echo "Generating $MSG_COMPILED_OUTPUTFILE" +echo "Generating $MSG_COMPILED_OUTPUTFILE (using sparse mode to avoid bloat)" tput sgr0 -if ! yarn pbjs -w commonjs -t static-module \ - -p proto \ - "proto/common/minimal_common.proto" \ - "proto/types/minimal_msg_deposit.proto" \ - "proto/types/minimal_msg_send.proto" \ - "$COSMOS_COIN_PROTO" \ +if ! yarn pbjs -w commonjs -t static-module --sparse \ + -p "$TMP_DIR/thornode/proto" \ + -p "$TMP_DIR/thornode/third_party/proto" \ + "$TMP_DIR/thornode/proto/thorchain/v1/types/msg_deposit.proto" \ + "$TMP_DIR/thornode/proto/thorchain/v1/types/msg_send.proto" \ -o "$MSG_COMPILED_OUTPUTFILE" 2>pbjs_errors.txt; then echo "Error: Failed to generate JavaScript bindings" cat pbjs_errors.txt From cb614fe0373b0b7403b619c4df68b28644baf675 Mon Sep 17 00:00:00 2001 From: Naq302 Date: Fri, 5 Sep 2025 12:41:11 +0930 Subject: [PATCH 4/7] Code Rabbit Feedback --- packages/xchain-mayachain/genMsgs.sh | 15 +++++++++++++-- packages/xchain-thorchain/genMsgs.sh | 15 +++++++++++++-- 2 files changed, 26 insertions(+), 4 deletions(-) diff --git a/packages/xchain-mayachain/genMsgs.sh b/packages/xchain-mayachain/genMsgs.sh index 26a2f3170..ef6cc64bf 100755 --- a/packages/xchain-mayachain/genMsgs.sh +++ b/packages/xchain-mayachain/genMsgs.sh @@ -1,11 +1,22 @@ #!/bin/bash # This script updates MAYAChain Protobuf bindings for MsgDeposit and MsgSend -set -e # Exit on any error +set -euo pipefail # Exit on error, undefined variables, and pipe failures + +# Check for required tools +for tool in yarn git curl sed; do + if ! command -v "$tool" &>/dev/null; then + echo "Error: Required tool '$tool' is not installed" + exit 1 + fi +done MSG_COMPILED_OUTPUTFILE=src/types/proto/MsgCompiled.js MSG_COMPILED_TYPES_OUTPUTFILE=src/types/proto/MsgCompiled.d.ts +# Ensure output directory exists +mkdir -p "$(dirname "$MSG_COMPILED_OUTPUTFILE")" + TMP_DIR=$(mktemp -d) # Cleanup function @@ -56,7 +67,7 @@ if [ ! -f "$COSMOS_COIN_PROTO" ]; then echo "Downloading cosmos/base/v1beta1/coin.proto from cosmossdk" tput sgr0 mkdir -p "$TMP_DIR/mayanode/third_party/proto/cosmos/base/v1beta1" - if ! curl -f -o "$COSMOS_COIN_PROTO" \ + if ! curl -fSL --retry 3 --retry-delay 2 -o "$COSMOS_COIN_PROTO" \ "https://raw.githubusercontent.com/cosmos/cosmos-sdk/main/proto/cosmos/base/v1beta1/coin.proto"; then echo "Error: Failed to download cosmos coin.proto" exit 1 diff --git a/packages/xchain-thorchain/genMsgs.sh b/packages/xchain-thorchain/genMsgs.sh index 91dcbc4f0..39e2151b3 100755 --- a/packages/xchain-thorchain/genMsgs.sh +++ b/packages/xchain-thorchain/genMsgs.sh @@ -1,11 +1,22 @@ #!/bin/bash # This script updates THORChain Protobuf bindings for MsgDeposit and MsgSend -set -e # Exit on any error +set -euo pipefail # Exit on error, undefined variables, and pipe failures + +# Check for required tools +for tool in yarn git curl sed; do + if ! command -v "$tool" &>/dev/null; then + echo "Error: Required tool '$tool' is not installed" + exit 1 + fi +done MSG_COMPILED_OUTPUTFILE=src/types/proto/MsgCompiled.js MSG_COMPILED_TYPES_OUTPUTFILE=src/types/proto/MsgCompiled.d.ts +# Ensure output directory exists +mkdir -p "$(dirname "$MSG_COMPILED_OUTPUTFILE")" + TMP_DIR=$(mktemp -d) # Cleanup function @@ -56,7 +67,7 @@ if [ ! -f "$COSMOS_COIN_PROTO" ]; then echo "Downloading cosmos/base/v1beta1/coin.proto from cosmossdk" tput sgr0 mkdir -p "$TMP_DIR/thornode/third_party/proto/cosmos/base/v1beta1" - if ! curl -f -o "$COSMOS_COIN_PROTO" \ + if ! curl -fSL --retry 3 --retry-delay 2 -o "$COSMOS_COIN_PROTO" \ "https://raw.githubusercontent.com/cosmos/cosmos-sdk/main/proto/cosmos/base/v1beta1/coin.proto"; then echo "Error: Failed to download cosmos coin.proto" exit 1 From 1ca33996a0ecdcaa49b4f7265733181d1ffdbe04 Mon Sep 17 00:00:00 2001 From: Naq302 Date: Fri, 5 Sep 2025 13:36:03 +0930 Subject: [PATCH 5/7] Reduced clone time and adding back in coin for thorchain. wip --- packages/xchain-mayachain/genMsgs.sh | 2 +- packages/xchain-thorchain/genMsgs.sh | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/packages/xchain-mayachain/genMsgs.sh b/packages/xchain-mayachain/genMsgs.sh index ef6cc64bf..1f864c307 100755 --- a/packages/xchain-mayachain/genMsgs.sh +++ b/packages/xchain-mayachain/genMsgs.sh @@ -33,7 +33,7 @@ trap cleanup EXIT tput setaf 2 echo "Checking out https://gitlab.com/mayachain/mayanode to $TMP_DIR" tput sgr0 -if ! (cd "$TMP_DIR" && git clone https://gitlab.com/mayachain/mayanode); then +if ! (cd "$TMP_DIR" && git clone --depth 1 --single-branch https://gitlab.com/mayachain/mayanode); then echo "Error: Failed to clone mayanode repository" exit 1 fi diff --git a/packages/xchain-thorchain/genMsgs.sh b/packages/xchain-thorchain/genMsgs.sh index 39e2151b3..7d3a43c7c 100755 --- a/packages/xchain-thorchain/genMsgs.sh +++ b/packages/xchain-thorchain/genMsgs.sh @@ -33,7 +33,7 @@ trap cleanup EXIT tput setaf 2 echo "Checking out https://gitlab.com/thorchain/thornode to $TMP_DIR" tput sgr0 -if ! (cd "$TMP_DIR" && git clone --branch develop https://gitlab.com/thorchain/thornode); then +if ! (cd "$TMP_DIR" && git clone --depth 1 --single-branch --branch develop https://gitlab.com/thorchain/thornode); then echo "Error: Failed to clone thornode repository" exit 1 fi @@ -84,6 +84,7 @@ tput sgr0 if ! yarn pbjs -w commonjs -t static-module --sparse \ -p "$TMP_DIR/thornode/proto" \ -p "$TMP_DIR/thornode/third_party/proto" \ + "$TMP_DIR/thornode/proto/thorchain/v1/common/common.proto" \ "$TMP_DIR/thornode/proto/thorchain/v1/types/msg_deposit.proto" \ "$TMP_DIR/thornode/proto/thorchain/v1/types/msg_send.proto" \ -o "$MSG_COMPILED_OUTPUTFILE" 2>pbjs_errors.txt; then From 4f9cad63b3ec2f01399e6e0616b64bf8dbd7c808 Mon Sep 17 00:00:00 2001 From: Naq302 Date: Fri, 5 Sep 2025 14:07:36 +0930 Subject: [PATCH 6/7] Fix THORChain protobuf bloat using minimal common.proto --- .../xchain-thorchain/common_minimal.proto | 20 + packages/xchain-thorchain/genMsgs.sh | 12 +- .../src/types/proto/MsgCompiled.d.ts | 684 ----- .../src/types/proto/MsgCompiled.js | 2380 +++-------------- 4 files changed, 433 insertions(+), 2663 deletions(-) create mode 100644 packages/xchain-thorchain/common_minimal.proto diff --git a/packages/xchain-thorchain/common_minimal.proto b/packages/xchain-thorchain/common_minimal.proto new file mode 100644 index 000000000..df2db7be7 --- /dev/null +++ b/packages/xchain-thorchain/common_minimal.proto @@ -0,0 +1,20 @@ +syntax = "proto3"; +package common; + +option go_package = "gitlab.com/thorchain/thornode/v3/common"; + +// Minimal common.proto with only types needed by MsgDeposit +message Asset { + string chain = 1; + string symbol = 2; + string ticker = 3; + bool synth = 4; + bool trade = 5; + bool secured = 6; +} + +message Coin { + Asset asset = 1; + string amount = 2; + int64 decimals = 3; +} \ No newline at end of file diff --git a/packages/xchain-thorchain/genMsgs.sh b/packages/xchain-thorchain/genMsgs.sh index 7d3a43c7c..518f7a53f 100755 --- a/packages/xchain-thorchain/genMsgs.sh +++ b/packages/xchain-thorchain/genMsgs.sh @@ -44,7 +44,6 @@ echo "Checking proto files" tput sgr0 MISSING_FILES=0 for proto_file in \ - "$TMP_DIR/thornode/proto/thorchain/v1/common/common.proto" \ "$TMP_DIR/thornode/proto/thorchain/v1/types/msg_deposit.proto" \ "$TMP_DIR/thornode/proto/thorchain/v1/types/msg_send.proto"; do if [ ! -f "$proto_file" ]; then @@ -60,6 +59,17 @@ if [ $MISSING_FILES -eq 1 ]; then exit 1 fi +# Copy minimal common.proto to temp directory +tput setaf 2 +echo "Using minimal common.proto to avoid bloat" +tput sgr0 +mkdir -p "$TMP_DIR/thornode/proto/thorchain/v1/common" +if ! cp common_minimal.proto "$TMP_DIR/thornode/proto/thorchain/v1/common/common.proto"; then + echo "Error: Failed to copy minimal common.proto" + exit 1 +fi +echo "✓ Using minimal common.proto" + # Download cosmos/base/v1beta1/coin.proto from cosmossdk if not exists COSMOS_COIN_PROTO="$TMP_DIR/thornode/third_party/proto/cosmos/base/v1beta1/coin.proto" if [ ! -f "$COSMOS_COIN_PROTO" ]; then diff --git a/packages/xchain-thorchain/src/types/proto/MsgCompiled.d.ts b/packages/xchain-thorchain/src/types/proto/MsgCompiled.d.ts index 32353b79a..fb46ab031 100644 --- a/packages/xchain-thorchain/src/types/proto/MsgCompiled.d.ts +++ b/packages/xchain-thorchain/src/types/proto/MsgCompiled.d.ts @@ -228,414 +228,6 @@ declare namespace types { */ public toJSON(): { [k: string]: any }; } - - /** Properties of a PubKeySet. */ - interface IPubKeySet { - - /** PubKeySet secp256k1 */ - secp256k1?: (string|null); - - /** PubKeySet ed25519 */ - ed25519?: (string|null); - } - - /** Represents a PubKeySet. */ - class PubKeySet implements IPubKeySet { - - /** - * Constructs a new PubKeySet. - * @param [properties] Properties to set - */ - constructor(properties?: common.IPubKeySet); - - /** PubKeySet secp256k1. */ - public secp256k1: string; - - /** PubKeySet ed25519. */ - public ed25519: string; - - /** - * Creates a new PubKeySet instance using the specified properties. - * @param [properties] Properties to set - * @returns PubKeySet instance - */ - public static create(properties?: common.IPubKeySet): common.PubKeySet; - - /** - * Encodes the specified PubKeySet message. Does not implicitly {@link common.PubKeySet.verify|verify} messages. - * @param message PubKeySet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: common.IPubKeySet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified PubKeySet message, length delimited. Does not implicitly {@link common.PubKeySet.verify|verify} messages. - * @param message PubKeySet message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: common.IPubKeySet, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a PubKeySet message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns PubKeySet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.PubKeySet; - - /** - * Decodes a PubKeySet message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns PubKeySet - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.PubKeySet; - - /** - * Verifies a PubKeySet message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a PubKeySet message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns PubKeySet - */ - public static fromObject(object: { [k: string]: any }): common.PubKeySet; - - /** - * Creates a plain object from a PubKeySet message. Also converts values to other types if specified. - * @param message PubKeySet - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: common.PubKeySet, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this PubKeySet to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Tx. */ - interface ITx { - - /** Tx id */ - id?: (string|null); - - /** Tx chain */ - chain?: (string|null); - - /** Tx fromAddress */ - fromAddress?: (string|null); - - /** Tx toAddress */ - toAddress?: (string|null); - - /** Tx coins */ - coins?: (common.ICoin[]|null); - - /** Tx gas */ - gas?: (common.ICoin[]|null); - - /** Tx memo */ - memo?: (string|null); - } - - /** Represents a Tx. */ - class Tx implements ITx { - - /** - * Constructs a new Tx. - * @param [properties] Properties to set - */ - constructor(properties?: common.ITx); - - /** Tx id. */ - public id: string; - - /** Tx chain. */ - public chain: string; - - /** Tx fromAddress. */ - public fromAddress: string; - - /** Tx toAddress. */ - public toAddress: string; - - /** Tx coins. */ - public coins: common.ICoin[]; - - /** Tx gas. */ - public gas: common.ICoin[]; - - /** Tx memo. */ - public memo: string; - - /** - * Creates a new Tx instance using the specified properties. - * @param [properties] Properties to set - * @returns Tx instance - */ - public static create(properties?: common.ITx): common.Tx; - - /** - * Encodes the specified Tx message. Does not implicitly {@link common.Tx.verify|verify} messages. - * @param message Tx message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: common.ITx, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Tx message, length delimited. Does not implicitly {@link common.Tx.verify|verify} messages. - * @param message Tx message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: common.ITx, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Tx message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Tx - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.Tx; - - /** - * Decodes a Tx message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Tx - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.Tx; - - /** - * Verifies a Tx message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Tx message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Tx - */ - public static fromObject(object: { [k: string]: any }): common.Tx; - - /** - * Creates a plain object from a Tx message. Also converts values to other types if specified. - * @param message Tx - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: common.Tx, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Tx to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a Fee. */ - interface IFee { - - /** Fee coins */ - coins?: (common.ICoin[]|null); - - /** Fee poolDeduct */ - poolDeduct?: (string|null); - } - - /** Represents a Fee. */ - class Fee implements IFee { - - /** - * Constructs a new Fee. - * @param [properties] Properties to set - */ - constructor(properties?: common.IFee); - - /** Fee coins. */ - public coins: common.ICoin[]; - - /** Fee poolDeduct. */ - public poolDeduct: string; - - /** - * Creates a new Fee instance using the specified properties. - * @param [properties] Properties to set - * @returns Fee instance - */ - public static create(properties?: common.IFee): common.Fee; - - /** - * Encodes the specified Fee message. Does not implicitly {@link common.Fee.verify|verify} messages. - * @param message Fee message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: common.IFee, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified Fee message, length delimited. Does not implicitly {@link common.Fee.verify|verify} messages. - * @param message Fee message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: common.IFee, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a Fee message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns Fee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.Fee; - - /** - * Decodes a Fee message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns Fee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.Fee; - - /** - * Verifies a Fee message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a Fee message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns Fee - */ - public static fromObject(object: { [k: string]: any }): common.Fee; - - /** - * Creates a plain object from a Fee message. Also converts values to other types if specified. - * @param message Fee - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: common.Fee, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this Fee to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a ProtoUint. */ - interface IProtoUint { - - /** ProtoUint value */ - value?: (string|null); - } - - /** Represents a ProtoUint. */ - class ProtoUint implements IProtoUint { - - /** - * Constructs a new ProtoUint. - * @param [properties] Properties to set - */ - constructor(properties?: common.IProtoUint); - - /** ProtoUint value. */ - public value: string; - - /** - * Creates a new ProtoUint instance using the specified properties. - * @param [properties] Properties to set - * @returns ProtoUint instance - */ - public static create(properties?: common.IProtoUint): common.ProtoUint; - - /** - * Encodes the specified ProtoUint message. Does not implicitly {@link common.ProtoUint.verify|verify} messages. - * @param message ProtoUint message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: common.IProtoUint, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified ProtoUint message, length delimited. Does not implicitly {@link common.ProtoUint.verify|verify} messages. - * @param message ProtoUint message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: common.IProtoUint, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a ProtoUint message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns ProtoUint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): common.ProtoUint; - - /** - * Decodes a ProtoUint message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns ProtoUint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): common.ProtoUint; - - /** - * Verifies a ProtoUint message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a ProtoUint message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns ProtoUint - */ - public static fromObject(object: { [k: string]: any }): common.ProtoUint; - - /** - * Creates a plain object from a ProtoUint message. Also converts values to other types if specified. - * @param message ProtoUint - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: common.ProtoUint, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this ProtoUint to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } } /** Namespace types. */ @@ -950,282 +542,6 @@ declare namespace types { */ public toJSON(): { [k: string]: any }; } - - /** Properties of a DecCoin. */ - interface IDecCoin { - - /** DecCoin denom */ - denom?: (string|null); - - /** DecCoin amount */ - amount?: (string|null); - } - - /** Represents a DecCoin. */ - class DecCoin implements IDecCoin { - - /** - * Constructs a new DecCoin. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.base.v1beta1.IDecCoin); - - /** DecCoin denom. */ - public denom: string; - - /** DecCoin amount. */ - public amount: string; - - /** - * Creates a new DecCoin instance using the specified properties. - * @param [properties] Properties to set - * @returns DecCoin instance - */ - public static create(properties?: cosmos.base.v1beta1.IDecCoin): cosmos.base.v1beta1.DecCoin; - - /** - * Encodes the specified DecCoin message. Does not implicitly {@link cosmos.base.v1beta1.DecCoin.verify|verify} messages. - * @param message DecCoin message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.base.v1beta1.IDecCoin, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DecCoin message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.DecCoin.verify|verify} messages. - * @param message DecCoin message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.base.v1beta1.IDecCoin, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DecCoin message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DecCoin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.base.v1beta1.DecCoin; - - /** - * Decodes a DecCoin message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DecCoin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.base.v1beta1.DecCoin; - - /** - * Verifies a DecCoin message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DecCoin message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DecCoin - */ - public static fromObject(object: { [k: string]: any }): cosmos.base.v1beta1.DecCoin; - - /** - * Creates a plain object from a DecCoin message. Also converts values to other types if specified. - * @param message DecCoin - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.base.v1beta1.DecCoin, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DecCoin to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of an IntProto. */ - interface IIntProto { - - /** IntProto int */ - int?: (string|null); - } - - /** Represents an IntProto. */ - class IntProto implements IIntProto { - - /** - * Constructs a new IntProto. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.base.v1beta1.IIntProto); - - /** IntProto int. */ - public int: string; - - /** - * Creates a new IntProto instance using the specified properties. - * @param [properties] Properties to set - * @returns IntProto instance - */ - public static create(properties?: cosmos.base.v1beta1.IIntProto): cosmos.base.v1beta1.IntProto; - - /** - * Encodes the specified IntProto message. Does not implicitly {@link cosmos.base.v1beta1.IntProto.verify|verify} messages. - * @param message IntProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.base.v1beta1.IIntProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified IntProto message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.IntProto.verify|verify} messages. - * @param message IntProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.base.v1beta1.IIntProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes an IntProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns IntProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.base.v1beta1.IntProto; - - /** - * Decodes an IntProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns IntProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.base.v1beta1.IntProto; - - /** - * Verifies an IntProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates an IntProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns IntProto - */ - public static fromObject(object: { [k: string]: any }): cosmos.base.v1beta1.IntProto; - - /** - * Creates a plain object from an IntProto message. Also converts values to other types if specified. - * @param message IntProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.base.v1beta1.IntProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this IntProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } - - /** Properties of a DecProto. */ - interface IDecProto { - - /** DecProto dec */ - dec?: (string|null); - } - - /** Represents a DecProto. */ - class DecProto implements IDecProto { - - /** - * Constructs a new DecProto. - * @param [properties] Properties to set - */ - constructor(properties?: cosmos.base.v1beta1.IDecProto); - - /** DecProto dec. */ - public dec: string; - - /** - * Creates a new DecProto instance using the specified properties. - * @param [properties] Properties to set - * @returns DecProto instance - */ - public static create(properties?: cosmos.base.v1beta1.IDecProto): cosmos.base.v1beta1.DecProto; - - /** - * Encodes the specified DecProto message. Does not implicitly {@link cosmos.base.v1beta1.DecProto.verify|verify} messages. - * @param message DecProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encode(message: cosmos.base.v1beta1.IDecProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Encodes the specified DecProto message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.DecProto.verify|verify} messages. - * @param message DecProto message or plain object to encode - * @param [writer] Writer to encode to - * @returns Writer - */ - public static encodeDelimited(message: cosmos.base.v1beta1.IDecProto, writer?: $protobuf.Writer): $protobuf.Writer; - - /** - * Decodes a DecProto message from the specified reader or buffer. - * @param reader Reader or buffer to decode from - * @param [length] Message length if known beforehand - * @returns DecProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): cosmos.base.v1beta1.DecProto; - - /** - * Decodes a DecProto message from the specified reader or buffer, length delimited. - * @param reader Reader or buffer to decode from - * @returns DecProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): cosmos.base.v1beta1.DecProto; - - /** - * Verifies a DecProto message. - * @param message Plain object to verify - * @returns `null` if valid, otherwise the reason why it is not - */ - public static verify(message: { [k: string]: any }): (string|null); - - /** - * Creates a DecProto message from a plain object. Also converts values to their respective internal types. - * @param object Plain object - * @returns DecProto - */ - public static fromObject(object: { [k: string]: any }): cosmos.base.v1beta1.DecProto; - - /** - * Creates a plain object from a DecProto message. Also converts values to other types if specified. - * @param message DecProto - * @param [options] Conversion options - * @returns Plain object - */ - public static toObject(message: cosmos.base.v1beta1.DecProto, options?: $protobuf.IConversionOptions): { [k: string]: any }; - - /** - * Converts this DecProto to JSON. - * @returns JSON object - */ - public toJSON(): { [k: string]: any }; - } } } } diff --git a/packages/xchain-thorchain/src/types/proto/MsgCompiled.js b/packages/xchain-thorchain/src/types/proto/MsgCompiled.js index 403f2edd3..fe4face6f 100644 --- a/packages/xchain-thorchain/src/types/proto/MsgCompiled.js +++ b/packages/xchain-thorchain/src/types/proto/MsgCompiled.js @@ -567,25 +567,39 @@ $root.common = (function() { return Coin; })(); - common.PubKeySet = (function() { + return common; +})(); + +$root.types = (function() { + + /** + * Namespace types. + * @exports types + * @namespace + */ + var types = {}; + + types.MsgDeposit = (function() { /** - * Properties of a PubKeySet. - * @memberof common - * @interface IPubKeySet - * @property {string|null} [secp256k1] PubKeySet secp256k1 - * @property {string|null} [ed25519] PubKeySet ed25519 + * Properties of a MsgDeposit. + * @memberof types + * @interface IMsgDeposit + * @property {Array.|null} [coins] MsgDeposit coins + * @property {string|null} [memo] MsgDeposit memo + * @property {Uint8Array|null} [signer] MsgDeposit signer */ /** - * Constructs a new PubKeySet. - * @memberof common - * @classdesc Represents a PubKeySet. - * @implements IPubKeySet + * Constructs a new MsgDeposit. + * @memberof types + * @classdesc Represents a MsgDeposit. + * @implements IMsgDeposit * @constructor - * @param {common.IPubKeySet=} [properties] Properties to set + * @param {types.IMsgDeposit=} [properties] Properties to set */ - function PubKeySet(properties) { + function MsgDeposit(properties) { + this.coins = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -593,88 +607,104 @@ $root.common = (function() { } /** - * PubKeySet secp256k1. - * @member {string} secp256k1 - * @memberof common.PubKeySet + * MsgDeposit coins. + * @member {Array.} coins + * @memberof types.MsgDeposit + * @instance + */ + MsgDeposit.prototype.coins = $util.emptyArray; + + /** + * MsgDeposit memo. + * @member {string} memo + * @memberof types.MsgDeposit * @instance */ - PubKeySet.prototype.secp256k1 = ""; + MsgDeposit.prototype.memo = ""; /** - * PubKeySet ed25519. - * @member {string} ed25519 - * @memberof common.PubKeySet + * MsgDeposit signer. + * @member {Uint8Array} signer + * @memberof types.MsgDeposit * @instance */ - PubKeySet.prototype.ed25519 = ""; + MsgDeposit.prototype.signer = $util.newBuffer([]); /** - * Creates a new PubKeySet instance using the specified properties. + * Creates a new MsgDeposit instance using the specified properties. * @function create - * @memberof common.PubKeySet + * @memberof types.MsgDeposit * @static - * @param {common.IPubKeySet=} [properties] Properties to set - * @returns {common.PubKeySet} PubKeySet instance + * @param {types.IMsgDeposit=} [properties] Properties to set + * @returns {types.MsgDeposit} MsgDeposit instance */ - PubKeySet.create = function create(properties) { - return new PubKeySet(properties); + MsgDeposit.create = function create(properties) { + return new MsgDeposit(properties); }; /** - * Encodes the specified PubKeySet message. Does not implicitly {@link common.PubKeySet.verify|verify} messages. + * Encodes the specified MsgDeposit message. Does not implicitly {@link types.MsgDeposit.verify|verify} messages. * @function encode - * @memberof common.PubKeySet + * @memberof types.MsgDeposit * @static - * @param {common.IPubKeySet} message PubKeySet message or plain object to encode + * @param {types.IMsgDeposit} message MsgDeposit message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PubKeySet.encode = function encode(message, writer) { + MsgDeposit.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.secp256k1 != null && Object.hasOwnProperty.call(message, "secp256k1")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.secp256k1); - if (message.ed25519 != null && Object.hasOwnProperty.call(message, "ed25519")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.ed25519); + if (message.coins != null && message.coins.length) + for (var i = 0; i < message.coins.length; ++i) + $root.common.Coin.encode(message.coins[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); + if (message.memo != null && Object.hasOwnProperty.call(message, "memo")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.memo); + if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) + writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.signer); return writer; }; /** - * Encodes the specified PubKeySet message, length delimited. Does not implicitly {@link common.PubKeySet.verify|verify} messages. + * Encodes the specified MsgDeposit message, length delimited. Does not implicitly {@link types.MsgDeposit.verify|verify} messages. * @function encodeDelimited - * @memberof common.PubKeySet + * @memberof types.MsgDeposit * @static - * @param {common.IPubKeySet} message PubKeySet message or plain object to encode + * @param {types.IMsgDeposit} message MsgDeposit message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - PubKeySet.encodeDelimited = function encodeDelimited(message, writer) { + MsgDeposit.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a PubKeySet message from the specified reader or buffer. + * Decodes a MsgDeposit message from the specified reader or buffer. * @function decode - * @memberof common.PubKeySet + * @memberof types.MsgDeposit * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {common.PubKeySet} PubKeySet + * @returns {types.MsgDeposit} MsgDeposit * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PubKeySet.decode = function decode(reader, length) { + MsgDeposit.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.common.PubKeySet(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.MsgDeposit(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.secp256k1 = reader.string(); + if (!(message.coins && message.coins.length)) + message.coins = []; + message.coins.push($root.common.Coin.decode(reader, reader.uint32())); break; case 2: - message.ed25519 = reader.string(); + message.memo = reader.string(); + break; + case 3: + message.signer = reader.bytes(); break; default: reader.skipType(tag & 7); @@ -685,124 +715,154 @@ $root.common = (function() { }; /** - * Decodes a PubKeySet message from the specified reader or buffer, length delimited. + * Decodes a MsgDeposit message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof common.PubKeySet + * @memberof types.MsgDeposit * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {common.PubKeySet} PubKeySet + * @returns {types.MsgDeposit} MsgDeposit * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - PubKeySet.decodeDelimited = function decodeDelimited(reader) { + MsgDeposit.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a PubKeySet message. + * Verifies a MsgDeposit message. * @function verify - * @memberof common.PubKeySet + * @memberof types.MsgDeposit * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - PubKeySet.verify = function verify(message) { + MsgDeposit.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.secp256k1 != null && message.hasOwnProperty("secp256k1")) - if (!$util.isString(message.secp256k1)) - return "secp256k1: string expected"; - if (message.ed25519 != null && message.hasOwnProperty("ed25519")) - if (!$util.isString(message.ed25519)) - return "ed25519: string expected"; + if (message.coins != null && message.hasOwnProperty("coins")) { + if (!Array.isArray(message.coins)) + return "coins: array expected"; + for (var i = 0; i < message.coins.length; ++i) { + var error = $root.common.Coin.verify(message.coins[i]); + if (error) + return "coins." + error; + } + } + if (message.memo != null && message.hasOwnProperty("memo")) + if (!$util.isString(message.memo)) + return "memo: string expected"; + if (message.signer != null && message.hasOwnProperty("signer")) + if (!(message.signer && typeof message.signer.length === "number" || $util.isString(message.signer))) + return "signer: buffer expected"; return null; }; /** - * Creates a PubKeySet message from a plain object. Also converts values to their respective internal types. + * Creates a MsgDeposit message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof common.PubKeySet + * @memberof types.MsgDeposit * @static * @param {Object.} object Plain object - * @returns {common.PubKeySet} PubKeySet + * @returns {types.MsgDeposit} MsgDeposit */ - PubKeySet.fromObject = function fromObject(object) { - if (object instanceof $root.common.PubKeySet) + MsgDeposit.fromObject = function fromObject(object) { + if (object instanceof $root.types.MsgDeposit) return object; - var message = new $root.common.PubKeySet(); - if (object.secp256k1 != null) - message.secp256k1 = String(object.secp256k1); - if (object.ed25519 != null) - message.ed25519 = String(object.ed25519); + var message = new $root.types.MsgDeposit(); + if (object.coins) { + if (!Array.isArray(object.coins)) + throw TypeError(".types.MsgDeposit.coins: array expected"); + message.coins = []; + for (var i = 0; i < object.coins.length; ++i) { + if (typeof object.coins[i] !== "object") + throw TypeError(".types.MsgDeposit.coins: object expected"); + message.coins[i] = $root.common.Coin.fromObject(object.coins[i]); + } + } + if (object.memo != null) + message.memo = String(object.memo); + if (object.signer != null) + if (typeof object.signer === "string") + $util.base64.decode(object.signer, message.signer = $util.newBuffer($util.base64.length(object.signer)), 0); + else if (object.signer.length) + message.signer = object.signer; return message; }; /** - * Creates a plain object from a PubKeySet message. Also converts values to other types if specified. + * Creates a plain object from a MsgDeposit message. Also converts values to other types if specified. * @function toObject - * @memberof common.PubKeySet + * @memberof types.MsgDeposit * @static - * @param {common.PubKeySet} message PubKeySet + * @param {types.MsgDeposit} message MsgDeposit * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - PubKeySet.toObject = function toObject(message, options) { + MsgDeposit.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; + if (options.arrays || options.defaults) + object.coins = []; if (options.defaults) { - object.secp256k1 = ""; - object.ed25519 = ""; + object.memo = ""; + if (options.bytes === String) + object.signer = ""; + else { + object.signer = []; + if (options.bytes !== Array) + object.signer = $util.newBuffer(object.signer); + } } - if (message.secp256k1 != null && message.hasOwnProperty("secp256k1")) - object.secp256k1 = message.secp256k1; - if (message.ed25519 != null && message.hasOwnProperty("ed25519")) - object.ed25519 = message.ed25519; + if (message.coins && message.coins.length) { + object.coins = []; + for (var j = 0; j < message.coins.length; ++j) + object.coins[j] = $root.common.Coin.toObject(message.coins[j], options); + } + if (message.memo != null && message.hasOwnProperty("memo")) + object.memo = message.memo; + if (message.signer != null && message.hasOwnProperty("signer")) + object.signer = options.bytes === String ? $util.base64.encode(message.signer, 0, message.signer.length) : options.bytes === Array ? Array.prototype.slice.call(message.signer) : message.signer; return object; }; /** - * Converts this PubKeySet to JSON. + * Converts this MsgDeposit to JSON. * @function toJSON - * @memberof common.PubKeySet + * @memberof types.MsgDeposit * @instance * @returns {Object.} JSON object */ - PubKeySet.prototype.toJSON = function toJSON() { + MsgDeposit.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return PubKeySet; + return MsgDeposit; })(); - common.Tx = (function() { + types.MsgSend = (function() { /** - * Properties of a Tx. - * @memberof common - * @interface ITx - * @property {string|null} [id] Tx id - * @property {string|null} [chain] Tx chain - * @property {string|null} [fromAddress] Tx fromAddress - * @property {string|null} [toAddress] Tx toAddress - * @property {Array.|null} [coins] Tx coins - * @property {Array.|null} [gas] Tx gas - * @property {string|null} [memo] Tx memo + * Properties of a MsgSend. + * @memberof types + * @interface IMsgSend + * @property {Uint8Array|null} [fromAddress] MsgSend fromAddress + * @property {Uint8Array|null} [toAddress] MsgSend toAddress + * @property {Array.|null} [amount] MsgSend amount */ /** - * Constructs a new Tx. - * @memberof common - * @classdesc Represents a Tx. - * @implements ITx + * Constructs a new MsgSend. + * @memberof types + * @classdesc Represents a MsgSend. + * @implements IMsgSend * @constructor - * @param {common.ITx=} [properties] Properties to set + * @param {types.IMsgSend=} [properties] Properties to set */ - function Tx(properties) { - this.coins = []; - this.gas = []; + function MsgSend(properties) { + this.amount = []; if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -810,159 +870,104 @@ $root.common = (function() { } /** - * Tx id. - * @member {string} id - * @memberof common.Tx - * @instance - */ - Tx.prototype.id = ""; - - /** - * Tx chain. - * @member {string} chain - * @memberof common.Tx - * @instance - */ - Tx.prototype.chain = ""; - - /** - * Tx fromAddress. - * @member {string} fromAddress - * @memberof common.Tx - * @instance - */ - Tx.prototype.fromAddress = ""; - - /** - * Tx toAddress. - * @member {string} toAddress - * @memberof common.Tx - * @instance - */ - Tx.prototype.toAddress = ""; - - /** - * Tx coins. - * @member {Array.} coins - * @memberof common.Tx + * MsgSend fromAddress. + * @member {Uint8Array} fromAddress + * @memberof types.MsgSend * @instance */ - Tx.prototype.coins = $util.emptyArray; + MsgSend.prototype.fromAddress = $util.newBuffer([]); /** - * Tx gas. - * @member {Array.} gas - * @memberof common.Tx + * MsgSend toAddress. + * @member {Uint8Array} toAddress + * @memberof types.MsgSend * @instance */ - Tx.prototype.gas = $util.emptyArray; + MsgSend.prototype.toAddress = $util.newBuffer([]); /** - * Tx memo. - * @member {string} memo - * @memberof common.Tx + * MsgSend amount. + * @member {Array.} amount + * @memberof types.MsgSend * @instance */ - Tx.prototype.memo = ""; + MsgSend.prototype.amount = $util.emptyArray; /** - * Creates a new Tx instance using the specified properties. + * Creates a new MsgSend instance using the specified properties. * @function create - * @memberof common.Tx + * @memberof types.MsgSend * @static - * @param {common.ITx=} [properties] Properties to set - * @returns {common.Tx} Tx instance + * @param {types.IMsgSend=} [properties] Properties to set + * @returns {types.MsgSend} MsgSend instance */ - Tx.create = function create(properties) { - return new Tx(properties); + MsgSend.create = function create(properties) { + return new MsgSend(properties); }; /** - * Encodes the specified Tx message. Does not implicitly {@link common.Tx.verify|verify} messages. + * Encodes the specified MsgSend message. Does not implicitly {@link types.MsgSend.verify|verify} messages. * @function encode - * @memberof common.Tx + * @memberof types.MsgSend * @static - * @param {common.ITx} message Tx message or plain object to encode + * @param {types.IMsgSend} message MsgSend message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Tx.encode = function encode(message, writer) { + MsgSend.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.id != null && Object.hasOwnProperty.call(message, "id")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.id); - if (message.chain != null && Object.hasOwnProperty.call(message, "chain")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.chain); if (message.fromAddress != null && Object.hasOwnProperty.call(message, "fromAddress")) - writer.uint32(/* id 3, wireType 2 =*/26).string(message.fromAddress); + writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.fromAddress); if (message.toAddress != null && Object.hasOwnProperty.call(message, "toAddress")) - writer.uint32(/* id 4, wireType 2 =*/34).string(message.toAddress); - if (message.coins != null && message.coins.length) - for (var i = 0; i < message.coins.length; ++i) - $root.common.Coin.encode(message.coins[i], writer.uint32(/* id 5, wireType 2 =*/42).fork()).ldelim(); - if (message.gas != null && message.gas.length) - for (var i = 0; i < message.gas.length; ++i) - $root.common.Coin.encode(message.gas[i], writer.uint32(/* id 6, wireType 2 =*/50).fork()).ldelim(); - if (message.memo != null && Object.hasOwnProperty.call(message, "memo")) - writer.uint32(/* id 7, wireType 2 =*/58).string(message.memo); + writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.toAddress); + if (message.amount != null && message.amount.length) + for (var i = 0; i < message.amount.length; ++i) + $root.cosmos.base.v1beta1.Coin.encode(message.amount[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); return writer; }; /** - * Encodes the specified Tx message, length delimited. Does not implicitly {@link common.Tx.verify|verify} messages. + * Encodes the specified MsgSend message, length delimited. Does not implicitly {@link types.MsgSend.verify|verify} messages. * @function encodeDelimited - * @memberof common.Tx + * @memberof types.MsgSend * @static - * @param {common.ITx} message Tx message or plain object to encode + * @param {types.IMsgSend} message MsgSend message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - Tx.encodeDelimited = function encodeDelimited(message, writer) { + MsgSend.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a Tx message from the specified reader or buffer. + * Decodes a MsgSend message from the specified reader or buffer. * @function decode - * @memberof common.Tx + * @memberof types.MsgSend * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {common.Tx} Tx + * @returns {types.MsgSend} MsgSend * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Tx.decode = function decode(reader, length) { + MsgSend.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.common.Tx(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.types.MsgSend(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.id = reader.string(); + message.fromAddress = reader.bytes(); break; case 2: - message.chain = reader.string(); + message.toAddress = reader.bytes(); break; case 3: - message.fromAddress = reader.string(); - break; - case 4: - message.toAddress = reader.string(); - break; - case 5: - if (!(message.coins && message.coins.length)) - message.coins = []; - message.coins.push($root.common.Coin.decode(reader, reader.uint32())); - break; - case 6: - if (!(message.gas && message.gas.length)) - message.gas = []; - message.gas.push($root.common.Coin.decode(reader, reader.uint32())); - break; - case 7: - message.memo = reader.string(); + if (!(message.amount && message.amount.length)) + message.amount = []; + message.amount.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); break; default: reader.skipType(tag & 7); @@ -973,1794 +978,191 @@ $root.common = (function() { }; /** - * Decodes a Tx message from the specified reader or buffer, length delimited. + * Decodes a MsgSend message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof common.Tx + * @memberof types.MsgSend * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {common.Tx} Tx + * @returns {types.MsgSend} MsgSend * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - Tx.decodeDelimited = function decodeDelimited(reader) { + MsgSend.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a Tx message. + * Verifies a MsgSend message. * @function verify - * @memberof common.Tx + * @memberof types.MsgSend * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - Tx.verify = function verify(message) { + MsgSend.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.id != null && message.hasOwnProperty("id")) - if (!$util.isString(message.id)) - return "id: string expected"; - if (message.chain != null && message.hasOwnProperty("chain")) - if (!$util.isString(message.chain)) - return "chain: string expected"; if (message.fromAddress != null && message.hasOwnProperty("fromAddress")) - if (!$util.isString(message.fromAddress)) - return "fromAddress: string expected"; + if (!(message.fromAddress && typeof message.fromAddress.length === "number" || $util.isString(message.fromAddress))) + return "fromAddress: buffer expected"; if (message.toAddress != null && message.hasOwnProperty("toAddress")) - if (!$util.isString(message.toAddress)) - return "toAddress: string expected"; - if (message.coins != null && message.hasOwnProperty("coins")) { - if (!Array.isArray(message.coins)) - return "coins: array expected"; - for (var i = 0; i < message.coins.length; ++i) { - var error = $root.common.Coin.verify(message.coins[i]); - if (error) - return "coins." + error; - } - } - if (message.gas != null && message.hasOwnProperty("gas")) { - if (!Array.isArray(message.gas)) - return "gas: array expected"; - for (var i = 0; i < message.gas.length; ++i) { - var error = $root.common.Coin.verify(message.gas[i]); + if (!(message.toAddress && typeof message.toAddress.length === "number" || $util.isString(message.toAddress))) + return "toAddress: buffer expected"; + if (message.amount != null && message.hasOwnProperty("amount")) { + if (!Array.isArray(message.amount)) + return "amount: array expected"; + for (var i = 0; i < message.amount.length; ++i) { + var error = $root.cosmos.base.v1beta1.Coin.verify(message.amount[i]); if (error) - return "gas." + error; + return "amount." + error; } } - if (message.memo != null && message.hasOwnProperty("memo")) - if (!$util.isString(message.memo)) - return "memo: string expected"; return null; }; /** - * Creates a Tx message from a plain object. Also converts values to their respective internal types. + * Creates a MsgSend message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof common.Tx + * @memberof types.MsgSend * @static * @param {Object.} object Plain object - * @returns {common.Tx} Tx + * @returns {types.MsgSend} MsgSend */ - Tx.fromObject = function fromObject(object) { - if (object instanceof $root.common.Tx) + MsgSend.fromObject = function fromObject(object) { + if (object instanceof $root.types.MsgSend) return object; - var message = new $root.common.Tx(); - if (object.id != null) - message.id = String(object.id); - if (object.chain != null) - message.chain = String(object.chain); + var message = new $root.types.MsgSend(); if (object.fromAddress != null) - message.fromAddress = String(object.fromAddress); + if (typeof object.fromAddress === "string") + $util.base64.decode(object.fromAddress, message.fromAddress = $util.newBuffer($util.base64.length(object.fromAddress)), 0); + else if (object.fromAddress.length) + message.fromAddress = object.fromAddress; if (object.toAddress != null) - message.toAddress = String(object.toAddress); - if (object.coins) { - if (!Array.isArray(object.coins)) - throw TypeError(".common.Tx.coins: array expected"); - message.coins = []; - for (var i = 0; i < object.coins.length; ++i) { - if (typeof object.coins[i] !== "object") - throw TypeError(".common.Tx.coins: object expected"); - message.coins[i] = $root.common.Coin.fromObject(object.coins[i]); - } - } - if (object.gas) { - if (!Array.isArray(object.gas)) - throw TypeError(".common.Tx.gas: array expected"); - message.gas = []; - for (var i = 0; i < object.gas.length; ++i) { - if (typeof object.gas[i] !== "object") - throw TypeError(".common.Tx.gas: object expected"); - message.gas[i] = $root.common.Coin.fromObject(object.gas[i]); - } - } - if (object.memo != null) - message.memo = String(object.memo); - return message; - }; - - /** - * Creates a plain object from a Tx message. Also converts values to other types if specified. - * @function toObject - * @memberof common.Tx - * @static - * @param {common.Tx} message Tx - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Tx.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) { - object.coins = []; - object.gas = []; - } - if (options.defaults) { - object.id = ""; - object.chain = ""; - object.fromAddress = ""; - object.toAddress = ""; - object.memo = ""; - } - if (message.id != null && message.hasOwnProperty("id")) - object.id = message.id; - if (message.chain != null && message.hasOwnProperty("chain")) - object.chain = message.chain; - if (message.fromAddress != null && message.hasOwnProperty("fromAddress")) - object.fromAddress = message.fromAddress; - if (message.toAddress != null && message.hasOwnProperty("toAddress")) - object.toAddress = message.toAddress; - if (message.coins && message.coins.length) { - object.coins = []; - for (var j = 0; j < message.coins.length; ++j) - object.coins[j] = $root.common.Coin.toObject(message.coins[j], options); - } - if (message.gas && message.gas.length) { - object.gas = []; - for (var j = 0; j < message.gas.length; ++j) - object.gas[j] = $root.common.Coin.toObject(message.gas[j], options); - } - if (message.memo != null && message.hasOwnProperty("memo")) - object.memo = message.memo; - return object; - }; - - /** - * Converts this Tx to JSON. - * @function toJSON - * @memberof common.Tx - * @instance - * @returns {Object.} JSON object - */ - Tx.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Tx; - })(); - - common.Fee = (function() { - - /** - * Properties of a Fee. - * @memberof common - * @interface IFee - * @property {Array.|null} [coins] Fee coins - * @property {string|null} [poolDeduct] Fee poolDeduct - */ - - /** - * Constructs a new Fee. - * @memberof common - * @classdesc Represents a Fee. - * @implements IFee - * @constructor - * @param {common.IFee=} [properties] Properties to set - */ - function Fee(properties) { - this.coins = []; - 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]]; - } - - /** - * Fee coins. - * @member {Array.} coins - * @memberof common.Fee - * @instance - */ - Fee.prototype.coins = $util.emptyArray; - - /** - * Fee poolDeduct. - * @member {string} poolDeduct - * @memberof common.Fee - * @instance - */ - Fee.prototype.poolDeduct = ""; - - /** - * Creates a new Fee instance using the specified properties. - * @function create - * @memberof common.Fee - * @static - * @param {common.IFee=} [properties] Properties to set - * @returns {common.Fee} Fee instance - */ - Fee.create = function create(properties) { - return new Fee(properties); - }; - - /** - * Encodes the specified Fee message. Does not implicitly {@link common.Fee.verify|verify} messages. - * @function encode - * @memberof common.Fee - * @static - * @param {common.IFee} message Fee message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Fee.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.coins != null && message.coins.length) - for (var i = 0; i < message.coins.length; ++i) - $root.common.Coin.encode(message.coins[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.poolDeduct != null && Object.hasOwnProperty.call(message, "poolDeduct")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.poolDeduct); - return writer; - }; - - /** - * Encodes the specified Fee message, length delimited. Does not implicitly {@link common.Fee.verify|verify} messages. - * @function encodeDelimited - * @memberof common.Fee - * @static - * @param {common.IFee} message Fee message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Fee.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Fee message from the specified reader or buffer. - * @function decode - * @memberof common.Fee - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {common.Fee} Fee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Fee.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.common.Fee(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.coins && message.coins.length)) - message.coins = []; - message.coins.push($root.common.Coin.decode(reader, reader.uint32())); - break; - case 2: - message.poolDeduct = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Fee message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof common.Fee - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {common.Fee} Fee - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Fee.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Fee message. - * @function verify - * @memberof common.Fee - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Fee.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.coins != null && message.hasOwnProperty("coins")) { - if (!Array.isArray(message.coins)) - return "coins: array expected"; - for (var i = 0; i < message.coins.length; ++i) { - var error = $root.common.Coin.verify(message.coins[i]); - if (error) - return "coins." + error; - } - } - if (message.poolDeduct != null && message.hasOwnProperty("poolDeduct")) - if (!$util.isString(message.poolDeduct)) - return "poolDeduct: string expected"; - return null; - }; - - /** - * Creates a Fee message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof common.Fee - * @static - * @param {Object.} object Plain object - * @returns {common.Fee} Fee - */ - Fee.fromObject = function fromObject(object) { - if (object instanceof $root.common.Fee) - return object; - var message = new $root.common.Fee(); - if (object.coins) { - if (!Array.isArray(object.coins)) - throw TypeError(".common.Fee.coins: array expected"); - message.coins = []; - for (var i = 0; i < object.coins.length; ++i) { - if (typeof object.coins[i] !== "object") - throw TypeError(".common.Fee.coins: object expected"); - message.coins[i] = $root.common.Coin.fromObject(object.coins[i]); + if (typeof object.toAddress === "string") + $util.base64.decode(object.toAddress, message.toAddress = $util.newBuffer($util.base64.length(object.toAddress)), 0); + else if (object.toAddress.length) + message.toAddress = object.toAddress; + if (object.amount) { + if (!Array.isArray(object.amount)) + throw TypeError(".types.MsgSend.amount: array expected"); + message.amount = []; + for (var i = 0; i < object.amount.length; ++i) { + if (typeof object.amount[i] !== "object") + throw TypeError(".types.MsgSend.amount: object expected"); + message.amount[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.amount[i]); } } - if (object.poolDeduct != null) - message.poolDeduct = String(object.poolDeduct); return message; }; /** - * Creates a plain object from a Fee message. Also converts values to other types if specified. + * Creates a plain object from a MsgSend message. Also converts values to other types if specified. * @function toObject - * @memberof common.Fee + * @memberof types.MsgSend * @static - * @param {common.Fee} message Fee - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Fee.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.coins = []; - if (options.defaults) - object.poolDeduct = ""; - if (message.coins && message.coins.length) { - object.coins = []; - for (var j = 0; j < message.coins.length; ++j) - object.coins[j] = $root.common.Coin.toObject(message.coins[j], options); - } - if (message.poolDeduct != null && message.hasOwnProperty("poolDeduct")) - object.poolDeduct = message.poolDeduct; - return object; - }; - - /** - * Converts this Fee to JSON. - * @function toJSON - * @memberof common.Fee - * @instance - * @returns {Object.} JSON object - */ - Fee.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Fee; - })(); - - common.ProtoUint = (function() { - - /** - * Properties of a ProtoUint. - * @memberof common - * @interface IProtoUint - * @property {string|null} [value] ProtoUint value - */ - - /** - * Constructs a new ProtoUint. - * @memberof common - * @classdesc Represents a ProtoUint. - * @implements IProtoUint - * @constructor - * @param {common.IProtoUint=} [properties] Properties to set - */ - function ProtoUint(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]]; - } - - /** - * ProtoUint value. - * @member {string} value - * @memberof common.ProtoUint - * @instance - */ - ProtoUint.prototype.value = ""; - - /** - * Creates a new ProtoUint instance using the specified properties. - * @function create - * @memberof common.ProtoUint - * @static - * @param {common.IProtoUint=} [properties] Properties to set - * @returns {common.ProtoUint} ProtoUint instance - */ - ProtoUint.create = function create(properties) { - return new ProtoUint(properties); - }; - - /** - * Encodes the specified ProtoUint message. Does not implicitly {@link common.ProtoUint.verify|verify} messages. - * @function encode - * @memberof common.ProtoUint - * @static - * @param {common.IProtoUint} message ProtoUint message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ProtoUint.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.value != null && Object.hasOwnProperty.call(message, "value")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.value); - return writer; - }; - - /** - * Encodes the specified ProtoUint message, length delimited. Does not implicitly {@link common.ProtoUint.verify|verify} messages. - * @function encodeDelimited - * @memberof common.ProtoUint - * @static - * @param {common.IProtoUint} message ProtoUint message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - ProtoUint.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a ProtoUint message from the specified reader or buffer. - * @function decode - * @memberof common.ProtoUint - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {common.ProtoUint} ProtoUint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ProtoUint.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.common.ProtoUint(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.value = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a ProtoUint message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof common.ProtoUint - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {common.ProtoUint} ProtoUint - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - ProtoUint.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a ProtoUint message. - * @function verify - * @memberof common.ProtoUint - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - ProtoUint.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.value != null && message.hasOwnProperty("value")) - if (!$util.isString(message.value)) - return "value: string expected"; - return null; - }; - - /** - * Creates a ProtoUint message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof common.ProtoUint - * @static - * @param {Object.} object Plain object - * @returns {common.ProtoUint} ProtoUint - */ - ProtoUint.fromObject = function fromObject(object) { - if (object instanceof $root.common.ProtoUint) - return object; - var message = new $root.common.ProtoUint(); - if (object.value != null) - message.value = String(object.value); - return message; - }; - - /** - * Creates a plain object from a ProtoUint message. Also converts values to other types if specified. - * @function toObject - * @memberof common.ProtoUint - * @static - * @param {common.ProtoUint} message ProtoUint - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - ProtoUint.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.value = ""; - if (message.value != null && message.hasOwnProperty("value")) - object.value = message.value; - return object; - }; - - /** - * Converts this ProtoUint to JSON. - * @function toJSON - * @memberof common.ProtoUint - * @instance - * @returns {Object.} JSON object - */ - ProtoUint.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return ProtoUint; - })(); - - return common; -})(); - -$root.types = (function() { - - /** - * Namespace types. - * @exports types - * @namespace - */ - var types = {}; - - types.MsgDeposit = (function() { - - /** - * Properties of a MsgDeposit. - * @memberof types - * @interface IMsgDeposit - * @property {Array.|null} [coins] MsgDeposit coins - * @property {string|null} [memo] MsgDeposit memo - * @property {Uint8Array|null} [signer] MsgDeposit signer - */ - - /** - * Constructs a new MsgDeposit. - * @memberof types - * @classdesc Represents a MsgDeposit. - * @implements IMsgDeposit - * @constructor - * @param {types.IMsgDeposit=} [properties] Properties to set - */ - function MsgDeposit(properties) { - this.coins = []; - 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]]; - } - - /** - * MsgDeposit coins. - * @member {Array.} coins - * @memberof types.MsgDeposit - * @instance - */ - MsgDeposit.prototype.coins = $util.emptyArray; - - /** - * MsgDeposit memo. - * @member {string} memo - * @memberof types.MsgDeposit - * @instance - */ - MsgDeposit.prototype.memo = ""; - - /** - * MsgDeposit signer. - * @member {Uint8Array} signer - * @memberof types.MsgDeposit - * @instance - */ - MsgDeposit.prototype.signer = $util.newBuffer([]); - - /** - * Creates a new MsgDeposit instance using the specified properties. - * @function create - * @memberof types.MsgDeposit - * @static - * @param {types.IMsgDeposit=} [properties] Properties to set - * @returns {types.MsgDeposit} MsgDeposit instance - */ - MsgDeposit.create = function create(properties) { - return new MsgDeposit(properties); - }; - - /** - * Encodes the specified MsgDeposit message. Does not implicitly {@link types.MsgDeposit.verify|verify} messages. - * @function encode - * @memberof types.MsgDeposit - * @static - * @param {types.IMsgDeposit} message MsgDeposit message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgDeposit.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.coins != null && message.coins.length) - for (var i = 0; i < message.coins.length; ++i) - $root.common.Coin.encode(message.coins[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim(); - if (message.memo != null && Object.hasOwnProperty.call(message, "memo")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.memo); - if (message.signer != null && Object.hasOwnProperty.call(message, "signer")) - writer.uint32(/* id 3, wireType 2 =*/26).bytes(message.signer); - return writer; - }; - - /** - * Encodes the specified MsgDeposit message, length delimited. Does not implicitly {@link types.MsgDeposit.verify|verify} messages. - * @function encodeDelimited - * @memberof types.MsgDeposit - * @static - * @param {types.IMsgDeposit} message MsgDeposit message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgDeposit.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgDeposit message from the specified reader or buffer. - * @function decode - * @memberof types.MsgDeposit - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {types.MsgDeposit} MsgDeposit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgDeposit.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.types.MsgDeposit(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - if (!(message.coins && message.coins.length)) - message.coins = []; - message.coins.push($root.common.Coin.decode(reader, reader.uint32())); - break; - case 2: - message.memo = reader.string(); - break; - case 3: - message.signer = reader.bytes(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgDeposit message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof types.MsgDeposit - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {types.MsgDeposit} MsgDeposit - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgDeposit.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgDeposit message. - * @function verify - * @memberof types.MsgDeposit - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgDeposit.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.coins != null && message.hasOwnProperty("coins")) { - if (!Array.isArray(message.coins)) - return "coins: array expected"; - for (var i = 0; i < message.coins.length; ++i) { - var error = $root.common.Coin.verify(message.coins[i]); - if (error) - return "coins." + error; - } - } - if (message.memo != null && message.hasOwnProperty("memo")) - if (!$util.isString(message.memo)) - return "memo: string expected"; - if (message.signer != null && message.hasOwnProperty("signer")) - if (!(message.signer && typeof message.signer.length === "number" || $util.isString(message.signer))) - return "signer: buffer expected"; - return null; - }; - - /** - * Creates a MsgDeposit message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof types.MsgDeposit - * @static - * @param {Object.} object Plain object - * @returns {types.MsgDeposit} MsgDeposit - */ - MsgDeposit.fromObject = function fromObject(object) { - if (object instanceof $root.types.MsgDeposit) - return object; - var message = new $root.types.MsgDeposit(); - if (object.coins) { - if (!Array.isArray(object.coins)) - throw TypeError(".types.MsgDeposit.coins: array expected"); - message.coins = []; - for (var i = 0; i < object.coins.length; ++i) { - if (typeof object.coins[i] !== "object") - throw TypeError(".types.MsgDeposit.coins: object expected"); - message.coins[i] = $root.common.Coin.fromObject(object.coins[i]); - } - } - if (object.memo != null) - message.memo = String(object.memo); - if (object.signer != null) - if (typeof object.signer === "string") - $util.base64.decode(object.signer, message.signer = $util.newBuffer($util.base64.length(object.signer)), 0); - else if (object.signer.length) - message.signer = object.signer; - return message; - }; - - /** - * Creates a plain object from a MsgDeposit message. Also converts values to other types if specified. - * @function toObject - * @memberof types.MsgDeposit - * @static - * @param {types.MsgDeposit} message MsgDeposit - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgDeposit.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.coins = []; - if (options.defaults) { - object.memo = ""; - if (options.bytes === String) - object.signer = ""; - else { - object.signer = []; - if (options.bytes !== Array) - object.signer = $util.newBuffer(object.signer); - } - } - if (message.coins && message.coins.length) { - object.coins = []; - for (var j = 0; j < message.coins.length; ++j) - object.coins[j] = $root.common.Coin.toObject(message.coins[j], options); - } - if (message.memo != null && message.hasOwnProperty("memo")) - object.memo = message.memo; - if (message.signer != null && message.hasOwnProperty("signer")) - object.signer = options.bytes === String ? $util.base64.encode(message.signer, 0, message.signer.length) : options.bytes === Array ? Array.prototype.slice.call(message.signer) : message.signer; - return object; - }; - - /** - * Converts this MsgDeposit to JSON. - * @function toJSON - * @memberof types.MsgDeposit - * @instance - * @returns {Object.} JSON object - */ - MsgDeposit.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgDeposit; - })(); - - types.MsgSend = (function() { - - /** - * Properties of a MsgSend. - * @memberof types - * @interface IMsgSend - * @property {Uint8Array|null} [fromAddress] MsgSend fromAddress - * @property {Uint8Array|null} [toAddress] MsgSend toAddress - * @property {Array.|null} [amount] MsgSend amount - */ - - /** - * Constructs a new MsgSend. - * @memberof types - * @classdesc Represents a MsgSend. - * @implements IMsgSend - * @constructor - * @param {types.IMsgSend=} [properties] Properties to set - */ - function MsgSend(properties) { - this.amount = []; - 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]]; - } - - /** - * MsgSend fromAddress. - * @member {Uint8Array} fromAddress - * @memberof types.MsgSend - * @instance - */ - MsgSend.prototype.fromAddress = $util.newBuffer([]); - - /** - * MsgSend toAddress. - * @member {Uint8Array} toAddress - * @memberof types.MsgSend - * @instance - */ - MsgSend.prototype.toAddress = $util.newBuffer([]); - - /** - * MsgSend amount. - * @member {Array.} amount - * @memberof types.MsgSend - * @instance - */ - MsgSend.prototype.amount = $util.emptyArray; - - /** - * Creates a new MsgSend instance using the specified properties. - * @function create - * @memberof types.MsgSend - * @static - * @param {types.IMsgSend=} [properties] Properties to set - * @returns {types.MsgSend} MsgSend instance - */ - MsgSend.create = function create(properties) { - return new MsgSend(properties); - }; - - /** - * Encodes the specified MsgSend message. Does not implicitly {@link types.MsgSend.verify|verify} messages. - * @function encode - * @memberof types.MsgSend - * @static - * @param {types.IMsgSend} message MsgSend message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgSend.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.fromAddress != null && Object.hasOwnProperty.call(message, "fromAddress")) - writer.uint32(/* id 1, wireType 2 =*/10).bytes(message.fromAddress); - if (message.toAddress != null && Object.hasOwnProperty.call(message, "toAddress")) - writer.uint32(/* id 2, wireType 2 =*/18).bytes(message.toAddress); - if (message.amount != null && message.amount.length) - for (var i = 0; i < message.amount.length; ++i) - $root.cosmos.base.v1beta1.Coin.encode(message.amount[i], writer.uint32(/* id 3, wireType 2 =*/26).fork()).ldelim(); - return writer; - }; - - /** - * Encodes the specified MsgSend message, length delimited. Does not implicitly {@link types.MsgSend.verify|verify} messages. - * @function encodeDelimited - * @memberof types.MsgSend - * @static - * @param {types.IMsgSend} message MsgSend message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - MsgSend.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a MsgSend message from the specified reader or buffer. - * @function decode - * @memberof types.MsgSend - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {types.MsgSend} MsgSend - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgSend.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.types.MsgSend(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.fromAddress = reader.bytes(); - break; - case 2: - message.toAddress = reader.bytes(); - break; - case 3: - if (!(message.amount && message.amount.length)) - message.amount = []; - message.amount.push($root.cosmos.base.v1beta1.Coin.decode(reader, reader.uint32())); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a MsgSend message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof types.MsgSend - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {types.MsgSend} MsgSend - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - MsgSend.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a MsgSend message. - * @function verify - * @memberof types.MsgSend - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - MsgSend.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.fromAddress != null && message.hasOwnProperty("fromAddress")) - if (!(message.fromAddress && typeof message.fromAddress.length === "number" || $util.isString(message.fromAddress))) - return "fromAddress: buffer expected"; - if (message.toAddress != null && message.hasOwnProperty("toAddress")) - if (!(message.toAddress && typeof message.toAddress.length === "number" || $util.isString(message.toAddress))) - return "toAddress: buffer expected"; - if (message.amount != null && message.hasOwnProperty("amount")) { - if (!Array.isArray(message.amount)) - return "amount: array expected"; - for (var i = 0; i < message.amount.length; ++i) { - var error = $root.cosmos.base.v1beta1.Coin.verify(message.amount[i]); - if (error) - return "amount." + error; - } - } - return null; - }; - - /** - * Creates a MsgSend message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof types.MsgSend - * @static - * @param {Object.} object Plain object - * @returns {types.MsgSend} MsgSend - */ - MsgSend.fromObject = function fromObject(object) { - if (object instanceof $root.types.MsgSend) - return object; - var message = new $root.types.MsgSend(); - if (object.fromAddress != null) - if (typeof object.fromAddress === "string") - $util.base64.decode(object.fromAddress, message.fromAddress = $util.newBuffer($util.base64.length(object.fromAddress)), 0); - else if (object.fromAddress.length) - message.fromAddress = object.fromAddress; - if (object.toAddress != null) - if (typeof object.toAddress === "string") - $util.base64.decode(object.toAddress, message.toAddress = $util.newBuffer($util.base64.length(object.toAddress)), 0); - else if (object.toAddress.length) - message.toAddress = object.toAddress; - if (object.amount) { - if (!Array.isArray(object.amount)) - throw TypeError(".types.MsgSend.amount: array expected"); - message.amount = []; - for (var i = 0; i < object.amount.length; ++i) { - if (typeof object.amount[i] !== "object") - throw TypeError(".types.MsgSend.amount: object expected"); - message.amount[i] = $root.cosmos.base.v1beta1.Coin.fromObject(object.amount[i]); - } - } - return message; - }; - - /** - * Creates a plain object from a MsgSend message. Also converts values to other types if specified. - * @function toObject - * @memberof types.MsgSend - * @static - * @param {types.MsgSend} message MsgSend - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - MsgSend.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.arrays || options.defaults) - object.amount = []; - if (options.defaults) { - if (options.bytes === String) - object.fromAddress = ""; - else { - object.fromAddress = []; - if (options.bytes !== Array) - object.fromAddress = $util.newBuffer(object.fromAddress); - } - if (options.bytes === String) - object.toAddress = ""; - else { - object.toAddress = []; - if (options.bytes !== Array) - object.toAddress = $util.newBuffer(object.toAddress); - } - } - if (message.fromAddress != null && message.hasOwnProperty("fromAddress")) - object.fromAddress = options.bytes === String ? $util.base64.encode(message.fromAddress, 0, message.fromAddress.length) : options.bytes === Array ? Array.prototype.slice.call(message.fromAddress) : message.fromAddress; - if (message.toAddress != null && message.hasOwnProperty("toAddress")) - object.toAddress = options.bytes === String ? $util.base64.encode(message.toAddress, 0, message.toAddress.length) : options.bytes === Array ? Array.prototype.slice.call(message.toAddress) : message.toAddress; - if (message.amount && message.amount.length) { - object.amount = []; - for (var j = 0; j < message.amount.length; ++j) - object.amount[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.amount[j], options); - } - return object; - }; - - /** - * Converts this MsgSend to JSON. - * @function toJSON - * @memberof types.MsgSend - * @instance - * @returns {Object.} JSON object - */ - MsgSend.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return MsgSend; - })(); - - return types; -})(); - -$root.cosmos = (function() { - - /** - * Namespace cosmos. - * @exports cosmos - * @namespace - */ - var cosmos = {}; - - cosmos.base = (function() { - - /** - * Namespace base. - * @memberof cosmos - * @namespace - */ - var base = {}; - - base.v1beta1 = (function() { - - /** - * Namespace v1beta1. - * @memberof cosmos.base - * @namespace - */ - var v1beta1 = {}; - - v1beta1.Coin = (function() { - - /** - * Properties of a Coin. - * @memberof cosmos.base.v1beta1 - * @interface ICoin - * @property {string|null} [denom] Coin denom - * @property {string|null} [amount] Coin amount - */ - - /** - * Constructs a new Coin. - * @memberof cosmos.base.v1beta1 - * @classdesc Represents a Coin. - * @implements ICoin - * @constructor - * @param {cosmos.base.v1beta1.ICoin=} [properties] Properties to set - */ - function Coin(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]]; - } - - /** - * Coin denom. - * @member {string} denom - * @memberof cosmos.base.v1beta1.Coin - * @instance - */ - Coin.prototype.denom = ""; - - /** - * Coin amount. - * @member {string} amount - * @memberof cosmos.base.v1beta1.Coin - * @instance - */ - Coin.prototype.amount = ""; - - /** - * Creates a new Coin instance using the specified properties. - * @function create - * @memberof cosmos.base.v1beta1.Coin - * @static - * @param {cosmos.base.v1beta1.ICoin=} [properties] Properties to set - * @returns {cosmos.base.v1beta1.Coin} Coin instance - */ - Coin.create = function create(properties) { - return new Coin(properties); - }; - - /** - * Encodes the specified Coin message. Does not implicitly {@link cosmos.base.v1beta1.Coin.verify|verify} messages. - * @function encode - * @memberof cosmos.base.v1beta1.Coin - * @static - * @param {cosmos.base.v1beta1.ICoin} message Coin message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Coin.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.denom != null && Object.hasOwnProperty.call(message, "denom")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.denom); - if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.amount); - return writer; - }; - - /** - * Encodes the specified Coin message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.Coin.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.base.v1beta1.Coin - * @static - * @param {cosmos.base.v1beta1.ICoin} message Coin message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - Coin.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a Coin message from the specified reader or buffer. - * @function decode - * @memberof cosmos.base.v1beta1.Coin - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.base.v1beta1.Coin} Coin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Coin.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.cosmos.base.v1beta1.Coin(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.denom = reader.string(); - break; - case 2: - message.amount = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a Coin message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.base.v1beta1.Coin - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.base.v1beta1.Coin} Coin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - Coin.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a Coin message. - * @function verify - * @memberof cosmos.base.v1beta1.Coin - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - Coin.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.denom != null && message.hasOwnProperty("denom")) - if (!$util.isString(message.denom)) - return "denom: string expected"; - if (message.amount != null && message.hasOwnProperty("amount")) - if (!$util.isString(message.amount)) - return "amount: string expected"; - return null; - }; - - /** - * Creates a Coin message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.base.v1beta1.Coin - * @static - * @param {Object.} object Plain object - * @returns {cosmos.base.v1beta1.Coin} Coin - */ - Coin.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.base.v1beta1.Coin) - return object; - var message = new $root.cosmos.base.v1beta1.Coin(); - if (object.denom != null) - message.denom = String(object.denom); - if (object.amount != null) - message.amount = String(object.amount); - return message; - }; - - /** - * Creates a plain object from a Coin message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.base.v1beta1.Coin - * @static - * @param {cosmos.base.v1beta1.Coin} message Coin - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - Coin.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.denom = ""; - object.amount = ""; - } - if (message.denom != null && message.hasOwnProperty("denom")) - object.denom = message.denom; - if (message.amount != null && message.hasOwnProperty("amount")) - object.amount = message.amount; - return object; - }; - - /** - * Converts this Coin to JSON. - * @function toJSON - * @memberof cosmos.base.v1beta1.Coin - * @instance - * @returns {Object.} JSON object - */ - Coin.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return Coin; - })(); - - v1beta1.DecCoin = (function() { - - /** - * Properties of a DecCoin. - * @memberof cosmos.base.v1beta1 - * @interface IDecCoin - * @property {string|null} [denom] DecCoin denom - * @property {string|null} [amount] DecCoin amount - */ - - /** - * Constructs a new DecCoin. - * @memberof cosmos.base.v1beta1 - * @classdesc Represents a DecCoin. - * @implements IDecCoin - * @constructor - * @param {cosmos.base.v1beta1.IDecCoin=} [properties] Properties to set - */ - function DecCoin(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]]; - } - - /** - * DecCoin denom. - * @member {string} denom - * @memberof cosmos.base.v1beta1.DecCoin - * @instance - */ - DecCoin.prototype.denom = ""; - - /** - * DecCoin amount. - * @member {string} amount - * @memberof cosmos.base.v1beta1.DecCoin - * @instance - */ - DecCoin.prototype.amount = ""; - - /** - * Creates a new DecCoin instance using the specified properties. - * @function create - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {cosmos.base.v1beta1.IDecCoin=} [properties] Properties to set - * @returns {cosmos.base.v1beta1.DecCoin} DecCoin instance - */ - DecCoin.create = function create(properties) { - return new DecCoin(properties); - }; - - /** - * Encodes the specified DecCoin message. Does not implicitly {@link cosmos.base.v1beta1.DecCoin.verify|verify} messages. - * @function encode - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {cosmos.base.v1beta1.IDecCoin} message DecCoin message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DecCoin.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.denom != null && Object.hasOwnProperty.call(message, "denom")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.denom); - if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) - writer.uint32(/* id 2, wireType 2 =*/18).string(message.amount); - return writer; - }; - - /** - * Encodes the specified DecCoin message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.DecCoin.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {cosmos.base.v1beta1.IDecCoin} message DecCoin message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - DecCoin.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; - - /** - * Decodes a DecCoin message from the specified reader or buffer. - * @function decode - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.base.v1beta1.DecCoin} DecCoin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DecCoin.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.cosmos.base.v1beta1.DecCoin(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.denom = reader.string(); - break; - case 2: - message.amount = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; - - /** - * Decodes a DecCoin message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.base.v1beta1.DecCoin} DecCoin - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - DecCoin.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; - - /** - * Verifies a DecCoin message. - * @function verify - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - DecCoin.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.denom != null && message.hasOwnProperty("denom")) - if (!$util.isString(message.denom)) - return "denom: string expected"; - if (message.amount != null && message.hasOwnProperty("amount")) - if (!$util.isString(message.amount)) - return "amount: string expected"; - return null; - }; - - /** - * Creates a DecCoin message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {Object.} object Plain object - * @returns {cosmos.base.v1beta1.DecCoin} DecCoin - */ - DecCoin.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.base.v1beta1.DecCoin) - return object; - var message = new $root.cosmos.base.v1beta1.DecCoin(); - if (object.denom != null) - message.denom = String(object.denom); - if (object.amount != null) - message.amount = String(object.amount); - return message; - }; - - /** - * Creates a plain object from a DecCoin message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.base.v1beta1.DecCoin - * @static - * @param {cosmos.base.v1beta1.DecCoin} message DecCoin - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - DecCoin.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) { - object.denom = ""; - object.amount = ""; - } - if (message.denom != null && message.hasOwnProperty("denom")) - object.denom = message.denom; - if (message.amount != null && message.hasOwnProperty("amount")) - object.amount = message.amount; - return object; - }; - - /** - * Converts this DecCoin to JSON. - * @function toJSON - * @memberof cosmos.base.v1beta1.DecCoin - * @instance - * @returns {Object.} JSON object - */ - DecCoin.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; - - return DecCoin; - })(); - - v1beta1.IntProto = (function() { - - /** - * Properties of an IntProto. - * @memberof cosmos.base.v1beta1 - * @interface IIntProto - * @property {string|null} [int] IntProto int - */ - - /** - * Constructs a new IntProto. - * @memberof cosmos.base.v1beta1 - * @classdesc Represents an IntProto. - * @implements IIntProto - * @constructor - * @param {cosmos.base.v1beta1.IIntProto=} [properties] Properties to set - */ - function IntProto(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]]; + * @param {types.MsgSend} message MsgSend + * @param {$protobuf.IConversionOptions} [options] Conversion options + * @returns {Object.} Plain object + */ + MsgSend.toObject = function toObject(message, options) { + if (!options) + options = {}; + var object = {}; + if (options.arrays || options.defaults) + object.amount = []; + if (options.defaults) { + if (options.bytes === String) + object.fromAddress = ""; + else { + object.fromAddress = []; + if (options.bytes !== Array) + object.fromAddress = $util.newBuffer(object.fromAddress); } + if (options.bytes === String) + object.toAddress = ""; + else { + object.toAddress = []; + if (options.bytes !== Array) + object.toAddress = $util.newBuffer(object.toAddress); + } + } + if (message.fromAddress != null && message.hasOwnProperty("fromAddress")) + object.fromAddress = options.bytes === String ? $util.base64.encode(message.fromAddress, 0, message.fromAddress.length) : options.bytes === Array ? Array.prototype.slice.call(message.fromAddress) : message.fromAddress; + if (message.toAddress != null && message.hasOwnProperty("toAddress")) + object.toAddress = options.bytes === String ? $util.base64.encode(message.toAddress, 0, message.toAddress.length) : options.bytes === Array ? Array.prototype.slice.call(message.toAddress) : message.toAddress; + if (message.amount && message.amount.length) { + object.amount = []; + for (var j = 0; j < message.amount.length; ++j) + object.amount[j] = $root.cosmos.base.v1beta1.Coin.toObject(message.amount[j], options); + } + return object; + }; - /** - * IntProto int. - * @member {string} int - * @memberof cosmos.base.v1beta1.IntProto - * @instance - */ - IntProto.prototype.int = ""; - - /** - * Creates a new IntProto instance using the specified properties. - * @function create - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {cosmos.base.v1beta1.IIntProto=} [properties] Properties to set - * @returns {cosmos.base.v1beta1.IntProto} IntProto instance - */ - IntProto.create = function create(properties) { - return new IntProto(properties); - }; - - /** - * Encodes the specified IntProto message. Does not implicitly {@link cosmos.base.v1beta1.IntProto.verify|verify} messages. - * @function encode - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {cosmos.base.v1beta1.IIntProto} message IntProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IntProto.encode = function encode(message, writer) { - if (!writer) - writer = $Writer.create(); - if (message.int != null && Object.hasOwnProperty.call(message, "int")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.int); - return writer; - }; + /** + * Converts this MsgSend to JSON. + * @function toJSON + * @memberof types.MsgSend + * @instance + * @returns {Object.} JSON object + */ + MsgSend.prototype.toJSON = function toJSON() { + return this.constructor.toObject(this, $protobuf.util.toJSONOptions); + }; - /** - * Encodes the specified IntProto message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.IntProto.verify|verify} messages. - * @function encodeDelimited - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {cosmos.base.v1beta1.IIntProto} message IntProto message or plain object to encode - * @param {$protobuf.Writer} [writer] Writer to encode to - * @returns {$protobuf.Writer} Writer - */ - IntProto.encodeDelimited = function encodeDelimited(message, writer) { - return this.encode(message, writer).ldelim(); - }; + return MsgSend; + })(); - /** - * Decodes an IntProto message from the specified reader or buffer. - * @function decode - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @param {number} [length] Message length if known beforehand - * @returns {cosmos.base.v1beta1.IntProto} IntProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IntProto.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.cosmos.base.v1beta1.IntProto(); - while (reader.pos < end) { - var tag = reader.uint32(); - switch (tag >>> 3) { - case 1: - message.int = reader.string(); - break; - default: - reader.skipType(tag & 7); - break; - } - } - return message; - }; + return types; +})(); - /** - * Decodes an IntProto message from the specified reader or buffer, length delimited. - * @function decodeDelimited - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.base.v1beta1.IntProto} IntProto - * @throws {Error} If the payload is not a reader or valid buffer - * @throws {$protobuf.util.ProtocolError} If required fields are missing - */ - IntProto.decodeDelimited = function decodeDelimited(reader) { - if (!(reader instanceof $Reader)) - reader = new $Reader(reader); - return this.decode(reader, reader.uint32()); - }; +$root.cosmos = (function() { - /** - * Verifies an IntProto message. - * @function verify - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {Object.} message Plain object to verify - * @returns {string|null} `null` if valid, otherwise the reason why it is not - */ - IntProto.verify = function verify(message) { - if (typeof message !== "object" || message === null) - return "object expected"; - if (message.int != null && message.hasOwnProperty("int")) - if (!$util.isString(message.int)) - return "int: string expected"; - return null; - }; + /** + * Namespace cosmos. + * @exports cosmos + * @namespace + */ + var cosmos = {}; - /** - * Creates an IntProto message from a plain object. Also converts values to their respective internal types. - * @function fromObject - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {Object.} object Plain object - * @returns {cosmos.base.v1beta1.IntProto} IntProto - */ - IntProto.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.base.v1beta1.IntProto) - return object; - var message = new $root.cosmos.base.v1beta1.IntProto(); - if (object.int != null) - message.int = String(object.int); - return message; - }; + cosmos.base = (function() { - /** - * Creates a plain object from an IntProto message. Also converts values to other types if specified. - * @function toObject - * @memberof cosmos.base.v1beta1.IntProto - * @static - * @param {cosmos.base.v1beta1.IntProto} message IntProto - * @param {$protobuf.IConversionOptions} [options] Conversion options - * @returns {Object.} Plain object - */ - IntProto.toObject = function toObject(message, options) { - if (!options) - options = {}; - var object = {}; - if (options.defaults) - object.int = ""; - if (message.int != null && message.hasOwnProperty("int")) - object.int = message.int; - return object; - }; + /** + * Namespace base. + * @memberof cosmos + * @namespace + */ + var base = {}; - /** - * Converts this IntProto to JSON. - * @function toJSON - * @memberof cosmos.base.v1beta1.IntProto - * @instance - * @returns {Object.} JSON object - */ - IntProto.prototype.toJSON = function toJSON() { - return this.constructor.toObject(this, $protobuf.util.toJSONOptions); - }; + base.v1beta1 = (function() { - return IntProto; - })(); + /** + * Namespace v1beta1. + * @memberof cosmos.base + * @namespace + */ + var v1beta1 = {}; - v1beta1.DecProto = (function() { + v1beta1.Coin = (function() { /** - * Properties of a DecProto. + * Properties of a Coin. * @memberof cosmos.base.v1beta1 - * @interface IDecProto - * @property {string|null} [dec] DecProto dec + * @interface ICoin + * @property {string|null} [denom] Coin denom + * @property {string|null} [amount] Coin amount */ /** - * Constructs a new DecProto. + * Constructs a new Coin. * @memberof cosmos.base.v1beta1 - * @classdesc Represents a DecProto. - * @implements IDecProto + * @classdesc Represents a Coin. + * @implements ICoin * @constructor - * @param {cosmos.base.v1beta1.IDecProto=} [properties] Properties to set + * @param {cosmos.base.v1beta1.ICoin=} [properties] Properties to set */ - function DecProto(properties) { + function Coin(properties) { if (properties) for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i) if (properties[keys[i]] != null) @@ -2768,75 +1170,88 @@ $root.cosmos = (function() { } /** - * DecProto dec. - * @member {string} dec - * @memberof cosmos.base.v1beta1.DecProto + * Coin denom. + * @member {string} denom + * @memberof cosmos.base.v1beta1.Coin + * @instance + */ + Coin.prototype.denom = ""; + + /** + * Coin amount. + * @member {string} amount + * @memberof cosmos.base.v1beta1.Coin * @instance */ - DecProto.prototype.dec = ""; + Coin.prototype.amount = ""; /** - * Creates a new DecProto instance using the specified properties. + * Creates a new Coin instance using the specified properties. * @function create - * @memberof cosmos.base.v1beta1.DecProto + * @memberof cosmos.base.v1beta1.Coin * @static - * @param {cosmos.base.v1beta1.IDecProto=} [properties] Properties to set - * @returns {cosmos.base.v1beta1.DecProto} DecProto instance + * @param {cosmos.base.v1beta1.ICoin=} [properties] Properties to set + * @returns {cosmos.base.v1beta1.Coin} Coin instance */ - DecProto.create = function create(properties) { - return new DecProto(properties); + Coin.create = function create(properties) { + return new Coin(properties); }; /** - * Encodes the specified DecProto message. Does not implicitly {@link cosmos.base.v1beta1.DecProto.verify|verify} messages. + * Encodes the specified Coin message. Does not implicitly {@link cosmos.base.v1beta1.Coin.verify|verify} messages. * @function encode - * @memberof cosmos.base.v1beta1.DecProto + * @memberof cosmos.base.v1beta1.Coin * @static - * @param {cosmos.base.v1beta1.IDecProto} message DecProto message or plain object to encode + * @param {cosmos.base.v1beta1.ICoin} message Coin message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DecProto.encode = function encode(message, writer) { + Coin.encode = function encode(message, writer) { if (!writer) writer = $Writer.create(); - if (message.dec != null && Object.hasOwnProperty.call(message, "dec")) - writer.uint32(/* id 1, wireType 2 =*/10).string(message.dec); + if (message.denom != null && Object.hasOwnProperty.call(message, "denom")) + writer.uint32(/* id 1, wireType 2 =*/10).string(message.denom); + if (message.amount != null && Object.hasOwnProperty.call(message, "amount")) + writer.uint32(/* id 2, wireType 2 =*/18).string(message.amount); return writer; }; /** - * Encodes the specified DecProto message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.DecProto.verify|verify} messages. + * Encodes the specified Coin message, length delimited. Does not implicitly {@link cosmos.base.v1beta1.Coin.verify|verify} messages. * @function encodeDelimited - * @memberof cosmos.base.v1beta1.DecProto + * @memberof cosmos.base.v1beta1.Coin * @static - * @param {cosmos.base.v1beta1.IDecProto} message DecProto message or plain object to encode + * @param {cosmos.base.v1beta1.ICoin} message Coin message or plain object to encode * @param {$protobuf.Writer} [writer] Writer to encode to * @returns {$protobuf.Writer} Writer */ - DecProto.encodeDelimited = function encodeDelimited(message, writer) { + Coin.encodeDelimited = function encodeDelimited(message, writer) { return this.encode(message, writer).ldelim(); }; /** - * Decodes a DecProto message from the specified reader or buffer. + * Decodes a Coin message from the specified reader or buffer. * @function decode - * @memberof cosmos.base.v1beta1.DecProto + * @memberof cosmos.base.v1beta1.Coin * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from * @param {number} [length] Message length if known beforehand - * @returns {cosmos.base.v1beta1.DecProto} DecProto + * @returns {cosmos.base.v1beta1.Coin} Coin * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DecProto.decode = function decode(reader, length) { + Coin.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.cosmos.base.v1beta1.DecProto(); + var end = length === undefined ? reader.len : reader.pos + length, message = new $root.cosmos.base.v1beta1.Coin(); while (reader.pos < end) { var tag = reader.uint32(); switch (tag >>> 3) { case 1: - message.dec = reader.string(); + message.denom = reader.string(); + break; + case 2: + message.amount = reader.string(); break; default: reader.skipType(tag & 7); @@ -2847,87 +1262,96 @@ $root.cosmos = (function() { }; /** - * Decodes a DecProto message from the specified reader or buffer, length delimited. + * Decodes a Coin message from the specified reader or buffer, length delimited. * @function decodeDelimited - * @memberof cosmos.base.v1beta1.DecProto + * @memberof cosmos.base.v1beta1.Coin * @static * @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from - * @returns {cosmos.base.v1beta1.DecProto} DecProto + * @returns {cosmos.base.v1beta1.Coin} Coin * @throws {Error} If the payload is not a reader or valid buffer * @throws {$protobuf.util.ProtocolError} If required fields are missing */ - DecProto.decodeDelimited = function decodeDelimited(reader) { + Coin.decodeDelimited = function decodeDelimited(reader) { if (!(reader instanceof $Reader)) reader = new $Reader(reader); return this.decode(reader, reader.uint32()); }; /** - * Verifies a DecProto message. + * Verifies a Coin message. * @function verify - * @memberof cosmos.base.v1beta1.DecProto + * @memberof cosmos.base.v1beta1.Coin * @static * @param {Object.} message Plain object to verify * @returns {string|null} `null` if valid, otherwise the reason why it is not */ - DecProto.verify = function verify(message) { + Coin.verify = function verify(message) { if (typeof message !== "object" || message === null) return "object expected"; - if (message.dec != null && message.hasOwnProperty("dec")) - if (!$util.isString(message.dec)) - return "dec: string expected"; + if (message.denom != null && message.hasOwnProperty("denom")) + if (!$util.isString(message.denom)) + return "denom: string expected"; + if (message.amount != null && message.hasOwnProperty("amount")) + if (!$util.isString(message.amount)) + return "amount: string expected"; return null; }; /** - * Creates a DecProto message from a plain object. Also converts values to their respective internal types. + * Creates a Coin message from a plain object. Also converts values to their respective internal types. * @function fromObject - * @memberof cosmos.base.v1beta1.DecProto + * @memberof cosmos.base.v1beta1.Coin * @static * @param {Object.} object Plain object - * @returns {cosmos.base.v1beta1.DecProto} DecProto + * @returns {cosmos.base.v1beta1.Coin} Coin */ - DecProto.fromObject = function fromObject(object) { - if (object instanceof $root.cosmos.base.v1beta1.DecProto) + Coin.fromObject = function fromObject(object) { + if (object instanceof $root.cosmos.base.v1beta1.Coin) return object; - var message = new $root.cosmos.base.v1beta1.DecProto(); - if (object.dec != null) - message.dec = String(object.dec); + var message = new $root.cosmos.base.v1beta1.Coin(); + if (object.denom != null) + message.denom = String(object.denom); + if (object.amount != null) + message.amount = String(object.amount); return message; }; /** - * Creates a plain object from a DecProto message. Also converts values to other types if specified. + * Creates a plain object from a Coin message. Also converts values to other types if specified. * @function toObject - * @memberof cosmos.base.v1beta1.DecProto + * @memberof cosmos.base.v1beta1.Coin * @static - * @param {cosmos.base.v1beta1.DecProto} message DecProto + * @param {cosmos.base.v1beta1.Coin} message Coin * @param {$protobuf.IConversionOptions} [options] Conversion options * @returns {Object.} Plain object */ - DecProto.toObject = function toObject(message, options) { + Coin.toObject = function toObject(message, options) { if (!options) options = {}; var object = {}; - if (options.defaults) - object.dec = ""; - if (message.dec != null && message.hasOwnProperty("dec")) - object.dec = message.dec; + if (options.defaults) { + object.denom = ""; + object.amount = ""; + } + if (message.denom != null && message.hasOwnProperty("denom")) + object.denom = message.denom; + if (message.amount != null && message.hasOwnProperty("amount")) + object.amount = message.amount; return object; }; /** - * Converts this DecProto to JSON. + * Converts this Coin to JSON. * @function toJSON - * @memberof cosmos.base.v1beta1.DecProto + * @memberof cosmos.base.v1beta1.Coin * @instance * @returns {Object.} JSON object */ - DecProto.prototype.toJSON = function toJSON() { + Coin.prototype.toJSON = function toJSON() { return this.constructor.toObject(this, $protobuf.util.toJSONOptions); }; - return DecProto; + return Coin; })(); return v1beta1; From 4d2ddf211e8a873c24609d0915ffa6360be46034 Mon Sep 17 00:00:00 2001 From: Naq302 Date: Fri, 5 Sep 2025 14:28:45 +0930 Subject: [PATCH 7/7] CR feedback --- packages/xchain-thorchain/genMsgs.sh | 3 ++- .../xchain-thorchain/{ => proto/common}/common_minimal.proto | 0 2 files changed, 2 insertions(+), 1 deletion(-) rename packages/xchain-thorchain/{ => proto/common}/common_minimal.proto (100%) diff --git a/packages/xchain-thorchain/genMsgs.sh b/packages/xchain-thorchain/genMsgs.sh index 518f7a53f..012f8a316 100755 --- a/packages/xchain-thorchain/genMsgs.sh +++ b/packages/xchain-thorchain/genMsgs.sh @@ -63,8 +63,9 @@ fi tput setaf 2 echo "Using minimal common.proto to avoid bloat" tput sgr0 +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" mkdir -p "$TMP_DIR/thornode/proto/thorchain/v1/common" -if ! cp common_minimal.proto "$TMP_DIR/thornode/proto/thorchain/v1/common/common.proto"; then +if ! cp "$SCRIPT_DIR/proto/common/common_minimal.proto" "$TMP_DIR/thornode/proto/thorchain/v1/common/common.proto"; then echo "Error: Failed to copy minimal common.proto" exit 1 fi diff --git a/packages/xchain-thorchain/common_minimal.proto b/packages/xchain-thorchain/proto/common/common_minimal.proto similarity index 100% rename from packages/xchain-thorchain/common_minimal.proto rename to packages/xchain-thorchain/proto/common/common_minimal.proto